n8n-editor-ui 1.32.0 → 1.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +61 -61
- package/dist/assets/{AuthView-WS0zqkdS.js → AuthView-XJQTAppn.js} +2 -2
- package/dist/assets/{AuthView-WS0zqkdS.js.map → AuthView-XJQTAppn.js.map} +1 -1
- package/dist/assets/{CanvasControls-tmVe2elM.js → CanvasControls-nkm_s3NJ.js} +2 -2
- package/dist/assets/{CanvasControls-tmVe2elM.js.map → CanvasControls-nkm_s3NJ.js.map} +1 -1
- package/dist/assets/{ChangePasswordView-u6wexPI8.js → ChangePasswordView-LJP0GGhW.js} +2 -2
- package/dist/assets/{ChangePasswordView-u6wexPI8.js.map → ChangePasswordView-LJP0GGhW.js.map} +1 -1
- package/dist/assets/{CollectionParameter-ix5yo0BD.js → CollectionParameter-WomdLuIg.js} +2 -2
- package/dist/assets/CollectionParameter-WomdLuIg.js.map +1 -0
- package/dist/assets/{CredentialsView-d-2fVzNy.js → CredentialsView-eWc7OhDm.js} +2 -2
- package/dist/assets/{CredentialsView-d-2fVzNy.js.map → CredentialsView-eWc7OhDm.js.map} +1 -1
- package/dist/assets/{ExecutionFilter-Kg4fhYje.js → ExecutionFilter-PMU0Na0k.js} +2 -2
- package/dist/assets/{ExecutionFilter-Kg4fhYje.js.map → ExecutionFilter-PMU0Na0k.js.map} +1 -1
- package/dist/assets/{ExecutionPreview-Z16KTdFl.js → ExecutionPreview-HbKLO92J.js} +2 -2
- package/dist/assets/{ExecutionPreview-Z16KTdFl.js.map → ExecutionPreview-HbKLO92J.js.map} +1 -1
- package/dist/assets/{ExecutionsInfoAccordion-UocBSgxb.js → ExecutionsInfoAccordion-bUnNtFv2.js} +2 -2
- package/dist/assets/{ExecutionsInfoAccordion-UocBSgxb.js.map → ExecutionsInfoAccordion-bUnNtFv2.js.map} +1 -1
- package/dist/assets/{ExecutionsLandingPage--EwoSMiA.js → ExecutionsLandingPage-T60dbSux.js} +2 -2
- package/dist/assets/{ExecutionsLandingPage--EwoSMiA.js.map → ExecutionsLandingPage-T60dbSux.js.map} +1 -1
- package/dist/assets/{ExecutionsList-9MEhhn56.js → ExecutionsList-XJRM7Cqr.js} +2 -2
- package/dist/assets/{ExecutionsList-9MEhhn56.js.map → ExecutionsList-XJRM7Cqr.js.map} +1 -1
- package/dist/assets/{ExecutionsView-dOO1b5pZ.js → ExecutionsView-1aQVikJo.js} +2 -2
- package/dist/assets/{ExecutionsView-dOO1b5pZ.js.map → ExecutionsView-1aQVikJo.js.map} +1 -1
- package/dist/assets/{ForgotMyPasswordView-P3MqS20s.js → ForgotMyPasswordView-7wj-yAwY.js} +2 -2
- package/dist/assets/{ForgotMyPasswordView-P3MqS20s.js.map → ForgotMyPasswordView-7wj-yAwY.js.map} +1 -1
- package/dist/assets/{MainHeader-A43lnXDH.js → MainHeader-DUYaLAFd.js} +2 -2
- package/dist/assets/{MainHeader-A43lnXDH.js.map → MainHeader-DUYaLAFd.js.map} +1 -1
- package/dist/assets/{MainSidebar-_TrEfGUX.js → MainSidebar-AwOXawEk.js} +2 -2
- package/dist/assets/{MainSidebar-_TrEfGUX.js.map → MainSidebar-AwOXawEk.js.map} +1 -1
- package/dist/assets/{NodeCreation-d5MgZecP.js → NodeCreation-KwIDuMQX.js} +3 -3
- package/dist/assets/{NodeCreation-d5MgZecP.js.map → NodeCreation-KwIDuMQX.js.map} +1 -1
- package/dist/assets/{NodeCreator-HX7vFQ36.js → NodeCreator-6iz29Jwh.js} +2 -2
- package/dist/assets/{NodeCreator-HX7vFQ36.js.map → NodeCreator-6iz29Jwh.js.map} +1 -1
- package/dist/assets/{NodeList-Av_5l31V.js → NodeList-oe8SSQ2g.js} +2 -2
- package/dist/assets/{NodeList-Av_5l31V.js.map → NodeList-oe8SSQ2g.js.map} +1 -1
- package/dist/assets/{NodeView-xSCHk5Gm.js → NodeView-JV8BP6TJ.js} +3 -3
- package/dist/assets/{NodeView-xSCHk5Gm.js.map → NodeView-JV8BP6TJ.js.map} +1 -1
- package/dist/assets/{RunDataAi-lf7VU0w1.js → RunDataAi--C9ACRTm.js} +2 -2
- package/dist/assets/{RunDataAi-lf7VU0w1.js.map → RunDataAi--C9ACRTm.js.map} +1 -1
- package/dist/assets/{RunDataJson-hLAWizOD.js → RunDataJson-hcKGDyJz.js} +3 -3
- package/dist/assets/{RunDataJson-hLAWizOD.js.map → RunDataJson-hcKGDyJz.js.map} +1 -1
- package/dist/assets/{RunDataJsonActions-GrJTnQ3y.js → RunDataJsonActions-pkATA7DE.js} +2 -2
- package/dist/assets/{RunDataJsonActions-GrJTnQ3y.js.map → RunDataJsonActions-pkATA7DE.js.map} +1 -1
- package/dist/assets/{RunDataSchema-ZI0MG5I5.js → RunDataSchema-fPAFgFi6.js} +2 -2
- package/dist/assets/{RunDataSchema-ZI0MG5I5.js.map → RunDataSchema-fPAFgFi6.js.map} +1 -1
- package/dist/assets/{RunDataTable-th0cgEkH.js → RunDataTable-Xbkzwy5h.js} +2 -2
- package/dist/assets/{RunDataTable-th0cgEkH.js.map → RunDataTable-Xbkzwy5h.js.map} +1 -1
- package/dist/assets/{SamlOnboarding-1z7rskrY.js → SamlOnboarding-tMxkYuyc.js} +2 -2
- package/dist/assets/{SamlOnboarding-1z7rskrY.js.map → SamlOnboarding-tMxkYuyc.js.map} +1 -1
- package/dist/assets/{SettingsApiView-y-RxfWUk.js → SettingsApiView-iLhcZ_Ad.js} +2 -2
- package/dist/assets/{SettingsApiView-y-RxfWUk.js.map → SettingsApiView-iLhcZ_Ad.js.map} +1 -1
- package/dist/assets/{SettingsCommunityNodesView-eB9yXqkR.js → SettingsCommunityNodesView-kCmnDZXU.js} +2 -2
- package/dist/assets/{SettingsCommunityNodesView-eB9yXqkR.js.map → SettingsCommunityNodesView-kCmnDZXU.js.map} +1 -1
- package/dist/assets/{SettingsExternalSecrets-F8cAkZ70.js → SettingsExternalSecrets-QTCx-DCR.js} +2 -2
- package/dist/assets/{SettingsExternalSecrets-F8cAkZ70.js.map → SettingsExternalSecrets-QTCx-DCR.js.map} +1 -1
- package/dist/assets/{SettingsFakeDoorView-vORcl2KE.js → SettingsFakeDoorView-3ZAyfMNZ.js} +2 -2
- package/dist/assets/{SettingsFakeDoorView-vORcl2KE.js.map → SettingsFakeDoorView-3ZAyfMNZ.js.map} +1 -1
- package/dist/assets/{SettingsLdapView-HLdSAg7l.js → SettingsLdapView-9EURrpDL.js} +2 -2
- package/dist/assets/{SettingsLdapView-HLdSAg7l.js.map → SettingsLdapView-9EURrpDL.js.map} +1 -1
- package/dist/assets/{SettingsLogStreamingView-k8W4YRkq.js → SettingsLogStreamingView-eE9RDUjN.js} +2 -2
- package/dist/assets/{SettingsLogStreamingView-k8W4YRkq.js.map → SettingsLogStreamingView-eE9RDUjN.js.map} +1 -1
- package/dist/assets/{SettingsSourceControl-zQ3hu1Xb.js → SettingsSourceControl-bMzlo6t4.js} +2 -2
- package/dist/assets/{SettingsSourceControl-zQ3hu1Xb.js.map → SettingsSourceControl-bMzlo6t4.js.map} +1 -1
- package/dist/assets/{SettingsSso-ZDaKZSAz.js → SettingsSso-f8qqkUbH.js} +2 -2
- package/dist/assets/{SettingsSso-ZDaKZSAz.js.map → SettingsSso-f8qqkUbH.js.map} +1 -1
- package/dist/assets/{SettingsUsageAndPlan-qhA0XufK.js → SettingsUsageAndPlan-Smr5GpEg.js} +2 -2
- package/dist/assets/{SettingsUsageAndPlan-qhA0XufK.js.map → SettingsUsageAndPlan-Smr5GpEg.js.map} +1 -1
- package/dist/assets/{SettingsUsersView-MpwADpXX.js → SettingsUsersView-VvvWispo.js} +2 -2
- package/dist/assets/{SettingsUsersView-MpwADpXX.js.map → SettingsUsersView-VvvWispo.js.map} +1 -1
- package/dist/assets/{SettingsView-0oD4eR43.js → SettingsView-rRURYQHa.js} +2 -2
- package/dist/assets/{SettingsView-0oD4eR43.js.map → SettingsView-rRURYQHa.js.map} +1 -1
- package/dist/assets/{SetupView-BgoIEBSe.js → SetupView-Pgc80gpk.js} +2 -2
- package/dist/assets/{SetupView-BgoIEBSe.js.map → SetupView-Pgc80gpk.js.map} +1 -1
- package/dist/assets/{SetupWorkflowCredentialsButton-lgz8EmNk.js → SetupWorkflowCredentialsButton-13o0FsxU.js} +2 -2
- package/dist/assets/{SetupWorkflowCredentialsButton-lgz8EmNk.js.map → SetupWorkflowCredentialsButton-13o0FsxU.js.map} +1 -1
- package/dist/assets/{SetupWorkflowFromTemplateView-oupB9su8.js → SetupWorkflowFromTemplateView-j2kVEUDy.js} +2 -2
- package/dist/assets/{SetupWorkflowFromTemplateView-oupB9su8.js.map → SetupWorkflowFromTemplateView-j2kVEUDy.js.map} +1 -1
- package/dist/assets/{SigninView-NkydbvAT.js → SigninView-uMLwylSB.js} +2 -2
- package/dist/assets/{SigninView-NkydbvAT.js.map → SigninView-uMLwylSB.js.map} +1 -1
- package/dist/assets/{SignupView-_1SYATx9.js → SignupView-D81TqUjs.js} +2 -2
- package/dist/assets/{SignupView-_1SYATx9.js.map → SignupView-D81TqUjs.js.map} +1 -1
- package/dist/assets/{TemplateDetails-1Snx23Yf.js → TemplateDetails-VIO9zkEg.js} +2 -2
- package/dist/assets/{TemplateDetails-1Snx23Yf.js.map → TemplateDetails-VIO9zkEg.js.map} +1 -1
- package/dist/assets/{TemplateList-EnEI8gDE.js → TemplateList-HB8hUr_8.js} +2 -2
- package/dist/assets/{TemplateList-EnEI8gDE.js.map → TemplateList-HB8hUr_8.js.map} +1 -1
- package/dist/assets/{TemplatesCollectionView-n34DkMyr.js → TemplatesCollectionView-NFkj_TcY.js} +2 -2
- package/dist/assets/{TemplatesCollectionView-n34DkMyr.js.map → TemplatesCollectionView-NFkj_TcY.js.map} +1 -1
- package/dist/assets/{TemplatesInfoCarousel-f6mATm4z.js → TemplatesInfoCarousel-d4FjKWjW.js} +2 -2
- package/dist/assets/{TemplatesInfoCarousel-f6mATm4z.js.map → TemplatesInfoCarousel-d4FjKWjW.js.map} +1 -1
- package/dist/assets/{TemplatesSearchView-Zux67gUG.js → TemplatesSearchView-W0D9cTjN.js} +2 -2
- package/dist/assets/{TemplatesSearchView-Zux67gUG.js.map → TemplatesSearchView-W0D9cTjN.js.map} +1 -1
- package/dist/assets/{TemplatesWorkflowView-dSvK0QBs.js → TemplatesWorkflowView-vHpI2Rpl.js} +2 -2
- package/dist/assets/{TemplatesWorkflowView-dSvK0QBs.js.map → TemplatesWorkflowView-vHpI2Rpl.js.map} +1 -1
- package/dist/assets/{VariablesView-BftXbT8z.js → VariablesView-nF0EArdS.js} +2 -2
- package/dist/assets/{VariablesView-BftXbT8z.js.map → VariablesView-nF0EArdS.js.map} +1 -1
- package/dist/assets/{WorkerView-7Ib0flYZ.js → WorkerView-GubNFvBv.js} +2 -2
- package/dist/assets/{WorkerView-7Ib0flYZ.js.map → WorkerView-GubNFvBv.js.map} +1 -1
- package/dist/assets/{WorkflowActivator-Pbw1i_AI.js → WorkflowActivator-ySuj7uJI.js} +2 -2
- package/dist/assets/{WorkflowActivator-Pbw1i_AI.js.map → WorkflowActivator-ySuj7uJI.js.map} +1 -1
- package/dist/assets/{WorkflowHistory-_c2_b4mu.js → WorkflowHistory-gufVg7PC.js} +2 -2
- package/dist/assets/{WorkflowHistory-_c2_b4mu.js.map → WorkflowHistory-gufVg7PC.js.map} +1 -1
- package/dist/assets/{WorkflowOnboardingView-IqgW-M7B.js → WorkflowOnboardingView-sWTN3TK2.js} +2 -2
- package/dist/assets/{WorkflowOnboardingView-IqgW-M7B.js.map → WorkflowOnboardingView-sWTN3TK2.js.map} +1 -1
- package/dist/assets/{WorkflowsView-K1vknxJ3.js → WorkflowsView-9qPyA8du.js} +2 -2
- package/dist/assets/{WorkflowsView-K1vknxJ3.js.map → WorkflowsView-9qPyA8du.js.map} +1 -1
- package/dist/assets/{cloud-39Y_KZne.js → cloud-mOwwKpjz.js} +2 -2
- package/dist/assets/{cloud-39Y_KZne.js.map → cloud-mOwwKpjz.js.map} +1 -1
- package/dist/assets/{index-lUr8MiJ2.js → index-9xnnd4cn.js} +66 -66
- package/dist/assets/index-9xnnd4cn.js.map +1 -0
- package/dist/assets/{index-wl9S8xQJ.css → index-ED3b68TP.css} +1 -1
- package/dist/assets/{pushConnection-9MR6fwUT.js → pushConnection-6aRCrIsi.js} +2 -2
- package/dist/assets/{pushConnection-9MR6fwUT.js.map → pushConnection-6aRCrIsi.js.map} +1 -1
- package/dist/assets/{templateActions-MTyOknNV.js → templateActions-MRmcczkP.js} +2 -2
- package/dist/assets/{templateActions-MTyOknNV.js.map → templateActions-MRmcczkP.js.map} +1 -1
- package/dist/assets/{useExecutionDebugging-rwa9vby_.js → useExecutionDebugging-Z2R2TujJ.js} +2 -2
- package/dist/assets/{useExecutionDebugging-rwa9vby_.js.map → useExecutionDebugging-Z2R2TujJ.js.map} +1 -1
- package/dist/assets/{workflowActivate-iOg_mrLc.js → workflowActivate-rRmpx9AQ.js} +2 -2
- package/dist/assets/{workflowActivate-iOg_mrLc.js.map → workflowActivate-rRmpx9AQ.js.map} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/CollectionParameter-ix5yo0BD.js.map +0 -1
- package/dist/assets/index-lUr8MiJ2.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function __vite__mapDeps(indexes) {
|
|
2
2
|
if (!__vite__mapDeps.viteFileDeps) {
|
|
3
|
-
__vite__mapDeps.viteFileDeps = ["assets/RunDataTable-
|
|
3
|
+
__vite__mapDeps.viteFileDeps = ["assets/RunDataTable-Xbkzwy5h.js","assets/pinia-e-gLcRJ1.js","assets/n8n-uKoDE8Qf.js","assets/vendor-3VD3vVJy.js","assets/lodash-es-JdX4GWLn.js","assets/axios-s2RMMPhA.js","assets/flatted-jPn12Tq4.js","assets/esprima-next-ulPLCZ1Z.js","assets/luxon-ZRIU05qF.js","assets/@vueuse/core-lH03nmRE.js","assets/uuid-McvpxQtQ.js","assets/vue-i18n-MkmfYvll.js","assets/@n8n/permissions-8yMqUF1Y.js","assets/n8n-y89D68g9.css","assets/TextWithHighlights.vue_vue_type_script_setup_true_lang-rakqbOJB.js","assets/TextWithHighlights-4fPn_DY2.css","assets/index-9xnnd4cn.js","assets/@n8n/codemirror-lang-sql-feLn5IS9.js","assets/@lezer/common-1hBQ1gIF.js","assets/codemirror-lang-html-n8n-wWQLhhqk.js","assets/prettier-s3fE3Qyr.js","assets/@jsplumb/util-DR0SB56A.js","assets/@jsplumb/core-MKwKlGip.js","assets/@jsplumb/common-Q5_tv_GT.js","assets/@jsplumb/connector-bezier-3dWY17R5.js","assets/@jsplumb/browser-ui-AlqFM-P6.js","assets/codemirror-lang-n8n-expression-HpIZnV_9.js","assets/fast-json-stable-stringify-LPGjnXm6.js","assets/timeago.js--Bumj2r9.js","assets/qrcode.vue-B6sLPrrf.js","assets/vue3-touch-events-_RfbPMOD.js","assets/chart.js-JtqvIvkt.js","assets/index-ED3b68TP.css","assets/useExecutionDebugging-Z2R2TujJ.js","assets/file-saver-1UKPYnQ-.js","assets/vue-json-pretty-SeZ9jw7A.js","assets/dateFormatter-uGeLbFGz.js","assets/RunDataAi--C9ACRTm.js","assets/RunDataAi-lJTQYpdI.css","assets/workflowActivate-rRmpx9AQ.js","assets/collaboration.store-KS2_i2m5.js","assets/RunDataTable-SMFiA3bR.css","assets/RunDataJson-hcKGDyJz.js","assets/RunDataJson-Jt5WVSW6.css","assets/RunDataSchema-fPAFgFi6.js","assets/RunDataSchema-_PH4mUfw.css","assets/RunDataSearch-LSCwcEYy.js","assets/RunDataSearch-EE8rOPoF.css","assets/NodeCreation-KwIDuMQX.js","assets/NodeCreation-LcTWlYP6.css","assets/CanvasControls-nkm_s3NJ.js","assets/CanvasControls-vUMDXWeC.css","assets/SetupWorkflowCredentialsButton-13o0FsxU.js"]
|
|
4
4
|
}
|
|
5
5
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
6
6
|
}
|
|
7
|
-
import{u as de,y as J,v as j,q as ce,x as Ne,ec as dn,ed as un,dP as De,_ as x,$ as X,ee as Ln,ef as xn,bf as cn,aw as hn,N as M,a8 as Ee,e as ze,eg as to,eh as Hn,cT as Me,an as Qe,aA as vt,cR as pn,J as fe,d1 as ge,m as xt,ei as Fn,ej as zn,ek as st,el as Yn,em as Kn,en as Nt,O as jn,b7 as Ze,a2 as _e,di as ie,a9 as xe,B as fn,da as oo,eo as qn,ep as Le,o as Re,a6 as He,eq as gt,d6 as Ae,er as no,es as Gn,et as so,eu as gn,al as St,ev as Jn,ew as Xn,ex as Qn,cQ as io,b5 as At,aY as ao,ey as Zn,d2 as Te,ez as ke,eA as ro,eB as es,eC as ts,eD as lo,eE as Mt,cI as Ce,z as Ht,eF as os,eG as ns,k as mn,d8 as ft,V as K,d4 as ss,l as yn,eH as is,eI as as,t as wn,eJ as rs,eK as ls,eL as ds,eM as us,eN as cs,e0 as hs,eO as ps,F as fs,D as Dt,r as it,eP as vn,eQ as he,eR as et,cZ as Ft,b as gs,S as ms,eS as Fe,eT as mt,eU as zt,eV as uo,eW as co,eX as ho,eY as po,eZ as fo,e_ as go,e$ as mo,f0 as yo,f1 as wo,f2 as vo,f3 as ys,b8 as No,f4 as ko,f5 as bo,f6 as Wt,f7 as ws,f8 as vs,f9 as To,b9 as Ns,b1 as So,fa as ks,fb as Do,fc as bs,fd as Ts,fe as Ss,ff as Ds,fg as Es,fh as Eo,fi as Cs,fj as Is,fk as Ps,fl as Co,fm as Io,fn as Os,fo as $s,fp as Po,fq as Rs,ah as _s,fr as Oo,fs as $o,a1 as As,c$ as Ms,c_ as Ws,d0 as Vs,ft as Bs,fu as Ro,M as Ye,a3 as Ke,fv as Us,cW as Ls,f as xs,d3 as Hs,fw as me,cJ as Fs,cK as zs,cL as Ys,bt as Ks,cY as js,cS as Et,aa as qs,fx as Gs,fy as Js,ea as Xs,fz as Qs}from"./n8n-uKoDE8Qf.js";import{m as te,s as kt,d as Yt}from"./pinia-e-gLcRJ1.js";import{_ as _o,$ as Ao,a0 as Mo,a1 as at}from"./@jsplumb/core-MKwKlGip.js";import{d as Kt,i as yt,j as Nn,c as jt,k as Zs,N as tt,l as qt,a as bt,m as We,n as Vt,o as kn,b as Gt,p as ei,P as ti,q as bn,r as Jt,R as Tn,J as oi,C as ni,t as Wo,v as Bt,w as Sn,x as Ct,y as si,z as ii,A as Ut,B as je,D as ai,E as ri,h as Dn,K as li,F as rt,G as di,H as ui,I as ci,u as hi,L as pi,M as lt,s as Vo,O as ae,Q as fi,U as gi,V as mi,W as Ve,X as qe,Y as yi,Z as wi,_ as It,$ as vi,a0 as Bo,a1 as dt,a2 as Ni,a3 as ki,a4 as bi,a5 as Ti,a6 as Si,a7 as Di,a8 as Ei,a9 as Uo,aa as Lo,ab as xo,ac as Pt,ad as Ci,ae as Ho,af as Fo,ag as Ii,ah as ut,ai as zo,aj as Yo,ak as Pi,al as Oi,am as Ko,an as jo,ao as $i,ap as Ri,aq as _i,ar as Ai,as as Mi,at as Wi,au as Vi}from"./index-lUr8MiJ2.js";import{r as F,e as Y,d as Xt,b as En,v as z,f as c,h as b,i as f,K as y,y as D,E as w,J as I,I as T,D as O,H as E,$ as qo,V as se,a6 as S,ar as ot,F as Z,_ as re,aj as Cn,ak as In,z as ee,ae as Tt,M as G,u as L,A as Bi,L as ne,x as le,Y as Pn,G as On,l as Ui,N as Li,as as Ie,au as be,a0 as Qt,aA as xi,T as Hi,n as $n}from"./vendor-3VD3vVJy.js";import{u as Fi}from"./useExecutionDebugging-rwa9vby_.js";import{g as ye,s as Be,z as Ot,y as zi,e as Yi}from"./lodash-es-JdX4GWLn.js";import{F as $t}from"./file-saver-1UKPYnQ-.js";import{V as Rn}from"./vue-json-pretty-SeZ9jw7A.js";import{c as Ki}from"./dateFormatter-uGeLbFGz.js";import ji from"./RunDataAi-lf7VU0w1.js";import{w as Go}from"./workflowActivate-iOg_mrLc.js";import{v as we}from"./uuid-McvpxQtQ.js";import{a as qi,u as Gi}from"./collaboration.store-KS2_i2m5.js";import{g as Ji,f as ct,h as Jo,a as Xo,E as Qo,b as Zo,d as en,i as ht}from"./@jsplumb/browser-ui-AlqFM-P6.js";const Rt=F([0,0]),Ge=F(!1),Je=F({source:"canvas"}),pt=F([]),tn=F(()=>{}),nt=(e=()=>{})=>{const t=de(),o=J(),n=j(),s=Kt(),{getInputDataWithPinned:i}=Nn(),a=Ne(),r=Y(()=>s.preferences.branchReadOnly||t.isReadOnlyView),l=Y(()=>{if(!Ge.value)return[];const u=t.selectedNodes.map(v=>n.getNodeByName(v.name)),k=Je.value;return k.source==="canvas"?u:k.source==="node-right-click"?u.some(P=>P.name===k.node.name)?u:[k.node]:[k.node]}),d=u=>{const k=n.allNodes.filter(v=>v.type===u.name);return u.maxNodes===void 0||k.length<u.maxNodes},h=u=>{const k=o.getNodeType(u.type,u.typeVersion);return!k||dn.includes(k.name)?!1:d(k)},p=u=>{const k=o.getNodeType(u.type,u.typeVersion),v=i(u);return!k||v.length===0?!1:k.outputs.length===1&&!un.includes(u.type)},g=u=>!!n.pinDataByNodeName(u.name),N=()=>{Je.value={source:"canvas"},Ge.value=!1,pt.value=[],Rt.value=[0,0]},m=(u,k={source:"canvas"})=>{if(u.stopPropagation(),Ge.value&&k.source===Je.value.source){N();return}u.preventDefault(),tn.value=e,Je.value=k,Rt.value=yt(u),Ge.value=!0;const v=l.value,P=v.every(A=>A.type===ce),_={adjustToNumber:v.length,interpolate:{subject:P?a.baseText("contextMenu.sticky",{adjustToNumber:v.length}):a.baseText("contextMenu.node",{adjustToNumber:v.length})}},R=[{id:"select_all",divided:!0,label:a.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:v.length===n.allNodes.length},{id:"deselect_all",label:a.baseText("contextMenu.deselectAll"),disabled:v.length===0}];if(v.length===0)pt.value=[{id:"add_node",shortcut:{keys:["Tab"]},label:a.baseText("contextMenu.addNode"),disabled:r.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:a.baseText("contextMenu.addSticky"),disabled:r.value},...R];else{const A=[!P&&{id:"toggle_activation",label:v.every($=>$.disabled)?a.baseText("contextMenu.activate",_):a.baseText("contextMenu.deactivate",_),shortcut:{keys:["D"]},disabled:r.value},!P&&{id:"toggle_pin",label:v.every($=>g($))?a.baseText("contextMenu.unpin",_):a.baseText("contextMenu.pin",_),shortcut:{keys:["p"]},disabled:r.value||!v.every(p)},{id:"copy",label:a.baseText("contextMenu.copy",_),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:a.baseText("contextMenu.duplicate",_),shortcut:{metaKey:!0,keys:["D"]},disabled:r.value||!v.every(h)},...R,{id:"delete",divided:!0,label:a.baseText("contextMenu.delete",_),shortcut:{keys:["Del"]},disabled:r.value}].filter(Boolean);if(v.length===1){const $=P?[{id:"open",label:a.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:r.value},{id:"change_color",label:a.baseText("contextMenu.changeColor"),disabled:r.value}]:[{id:"open",label:a.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:a.baseText("contextMenu.test"),disabled:r.value},{id:"rename",label:a.baseText("contextMenu.rename"),shortcut:{keys:["F2"]},disabled:r.value}];A.unshift(...$)}pt.value=A}},C=u=>{tn.value(u,l.value)};return Xt(()=>t.nodeViewOffsetPosition,()=>{N()}),{isOpen:Ge,position:Rt,target:Je,actions:pt,targetNodes:l,open:m,close:N,_dispatchAction:C}};function Xi(){const e=F(!1),t=F(document.createElement("span")),{isTouchDevice:o,isCtrlKeyPressed:n}=De(),s=de(),i=jt(),a=j(),{isOpen:r}=nt();function l($){Object.assign(t.value.style,$)}function d($){const[B,U]=v($);t.value=Object.assign(t.value,{x:B,y:U}),l({left:t.value.x+"px",top:t.value.y+"px",visibility:"visible"}),e.value=!0}function h($){const B=g($);l({left:B.x+"px",top:B.y+"px",width:B.width+"px",height:B.height+"px"})}function p(){t.value.x=0,t.value.y=0,l({visibility:"hidden",left:"0px",top:"0px",width:"0px",height:"0px"}),e.value=!1}function g($){const[B,U]=v($);return{x:Math.min(B,t.value.x),y:Math.min(U,t.value.y),width:Math.abs(B-t.value.x),height:Math.abs(U-t.value.y)}}function N($){const B=[],U=g($);return a.allNodes.forEach(oe=>{oe.position[0]<U.x||oe.position[0]>U.x+U.width||oe.position[1]<U.y||oe.position[1]>U.y+U.height||B.push(oe)}),B}function m(){t.value.id="select-box",l({margin:"0px auto",border:"2px dotted #FF0000",position:"absolute",zIndex:"100",visibility:"hidden"}),t.value.addEventListener("mouseup",u),document.querySelector("#node-view").appendChild(t.value)}function C($){if($.buttons===0){u($);return}h($)}function u($){if($.button===2||r.value)return;if(!e.value){o&&$.target instanceof HTMLElement&&$.target&&$.target.id.includes("node-view")&&R();return}document.removeEventListener("mousemove",C),R();const B=N($);B.forEach(U=>{_(U)}),B.length===1&&(s.lastSelectedNode=B[0].name),p()}function k($,B){n($)||B||$.button===2||s.isActionActive("dragActive")||(d($),document.addEventListener("mousemove",C))}function v($){const B=yt($),[U,oe]=i.canvasPositionFromPagePosition(B),pe=i.nodeViewScale,V=s.nodeViewOffsetPosition;return Zs(U,oe,pe,V)}function P($){s.removeNodeFromSelection($),A.value.removeFromDragSelection(A.value.getManagedElement($==null?void 0:$.id))}function _($){s.addSelectedNode($),A.value.addToDragSelection(A.value.getManagedElement($==null?void 0:$.id))}function R(){A.value.clearDragSelection(),s.resetSelectedNodes(),s.lastSelectedNode=null,s.lastSelectedNodeOutputIndex=null,i.lastSelectedConnection=null,i.newNodeInsertPosition=null}const A=Y(()=>i.jsPlumbInstance);return En(()=>{m()}),{selectActive:e,getMousePositionWithinNodeView:v,mouseUpMouseSelect:u,mouseDownMouseSelect:k,nodeDeselected:P,nodeSelected:_,deselectAllNodes:R}}function Qi(){function e(){return J().allNodeTypes.reduce((o,n)=>{if(typeof n.defaults.name!="string")throw new Error("Expected node name default to be a string");return/\d$/.test(n.defaults.name)&&o.push(n.defaults.name),o},[])}function t(o,n=[]){var h,p;const{canvasNames:s}=j();if(!s.has(o)&&!n.includes(o))return o;const a=e().find(g=>o.startsWith(g));if(a){let g="",N=1;const m=o.split(a).pop(),C=m==null?void 0:m[m.length-1];for(C&&Number.isInteger(Number(C))&&(N=parseInt(C,10),o=o.slice(0,-1)),g=o;s.has(g)||n.includes(g);)g=o+N++;return g}if(/^\d+-?\d*$/.test(o)){let g="",N=1;const m=o.match(/(?<base>\d+)-?(?<suffix>\d*)/);if(!(m!=null&&m.groups))throw new Error("Failed to find match for unique name");for(((h=m==null?void 0:m.groups)==null?void 0:h.suffix)!==""&&(N=parseInt(m.groups.suffix,10)),g=m.groups.base;s.has(g)||n.includes(g);)g=m.groups.base+"-"+N++;return g}let r="",l=1;const d=o.match(/(?<base>.*\D+)(?<suffix>\d*)/);if(!(d!=null&&d.groups))throw new Error("Failed to find match for unique name");for(((p=d==null?void 0:d.groups)==null?void 0:p.suffix)!==""&&(l=parseInt(d.groups.suffix,10)),r=d.groups.base;s.has(r)||n.includes(r);)r=d.groups.base+l++;return r}return{uniqueNodeName:t}}const Zi=z({name:"NodeTitle",components:{NodeIcon:tt},props:{modelValue:{type:String,default:""},nodeType:{},readOnly:{type:Boolean,default:!1}},data(){return{editName:!1,newName:""}},computed:{editable(){return!this.readOnly&&window===window.parent}},methods:{async onEdit(){this.newName=this.modelValue,this.editName=!0,await this.$nextTick();const e=this.$refs.input;e&&e.focus()},onRename(){this.newName.trim()!==""&&this.$emit("update:modelValue",this.newName.trim()),this.editName=!1}}}),ea="_container_15oh7_5",ta="_title_15oh7_15",oa="_hoverable_15oh7_23",na="_editIcon_15oh7_26",sa="_iconWrapper_15oh7_30",ia="_editIconContainer_15oh7_43",aa="_editButtons_15oh7_49",ra="_editContainer_15oh7_57",la={container:ea,title:ta,hoverable:oa,editIcon:na,iconWrapper:sa,editIconContainer:ia,editButtons:aa,editContainer:ra};function da(e,t,o,n,s,i){const a=S("NodeIcon"),r=S("n8n-text"),l=S("n8n-input"),d=S("n8n-button"),h=S("font-awesome-icon"),p=S("n8n-popover");return c(),b("span",{class:D(e.$style.container),"data-test-id":"node-title-container",onClick:t[5]||(t[5]=(...g)=>e.onEdit&&e.onEdit(...g))},[f("span",{class:D(e.$style.iconWrapper)},[y(a,{"node-type":e.nodeType,size:18},null,8,["node-type"])],2),y(p,{placement:"right",width:"200",visible:e.editName,disabled:!e.editable},{reference:w(()=>[f("div",{class:D({[e.$style.title]:!0,[e.$style.hoverable]:e.editable})},[I(T(e.modelValue)+" ",1),f("div",{class:D(e.$style.editIconContainer)},[e.editable?(c(),O(h,{key:0,class:D(e.$style.editIcon),icon:"pencil-alt"},null,8,["class"])):E("",!0)],2)],2)]),default:w(()=>[f("div",{class:D(e.$style.editContainer),onKeydown:[t[2]||(t[2]=qo((...g)=>e.onRename&&e.onRename(...g),["enter"])),t[3]||(t[3]=se(()=>{},["stop"])),t[4]||(t[4]=qo(g=>e.editName=!1,["esc"]))]},[y(r,{bold:!0,color:"text-base",tag:"div"},{default:w(()=>[I(T(e.$locale.baseText("ndv.title.renameNode")),1)]),_:1}),y(l,{ref:"input",modelValue:e.newName,"onUpdate:modelValue":t[0]||(t[0]=g=>e.newName=g),size:"small","data-test-id":"node-rename-input"},null,8,["modelValue"]),f("div",{class:D(e.$style.editButtons)},[y(d,{type:"secondary",size:"small",label:e.$locale.baseText("ndv.title.cancel"),onClick:t[1]||(t[1]=g=>e.editName=!1)},null,8,["label"]),y(d,{type:"primary",size:"small",label:e.$locale.baseText("ndv.title.rename"),onClick:e.onRename},null,8,["label","onClick"])],2)],34)]),_:1},8,["visible","disabled"])],2)}const ua={$style:la},ca=x(Zi,[["render",da],["__cssModules",ua]]),ha=z({name:"NodeSettingsTabs",props:{modelValue:{type:String,default:""},nodeType:{},sessionId:{type:String}},setup(){return{externalHooks:Ee()}},computed:{...te(X,j),activeNode(){return this.ndvStore.activeNode},documentationUrl(){var n,s,i,a;const e=this.nodeType;if(!e)return"";if(e.documentationUrl&&e.documentationUrl.startsWith("http"))return e.documentationUrl;const t="?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign="+e.name,o=(a=(i=(s=(n=e.codex)==null?void 0:n.resources)==null?void 0:s.primaryDocumentation)==null?void 0:i[0])==null?void 0:a.url;return o?o+t:this.isCommunityNode?`${Ln}${e.name.split(".")[0]}`:xn+t},isCommunityNode(){const e=this.nodeType;return e?cn(e.name):!1},packageName(){return this.nodeType.name.split(".")[0]},options(){const e=[{label:this.$locale.baseText("nodeSettings.parameters"),value:"params"}];this.documentationUrl&&e.push({label:this.$locale.baseText("nodeSettings.docs"),value:"docs",href:this.documentationUrl}),this.isCommunityNode&&e.push({icon:"cube",value:"communityNode",align:"right",tooltip:this.$locale.baseText("generic.communityNode.tooltip",{interpolate:{docUrl:hn,packageName:this.packageName}})});const t=!this.isCommunityNode;return e.push({icon:"cog",value:"settings",align:t?"right":void 0}),e}},methods:{onTabSelect(e){e==="docs"&&this.nodeType&&(this.externalHooks.run("dataDisplay.onDocumentationUrlClick",{nodeType:this.nodeType,documentationUrl:this.documentationUrl}),this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:M.Main,type:"docs"})),e==="settings"&&this.nodeType&&this.$telemetry.track("User viewed node settings",{node_type:this.nodeType.name,workflow_id:this.workflowsStore.workflowId}),(e==="settings"||e==="params")&&this.$emit("update:modelValue",e)},onTooltipClick(e,t){e==="communityNode"&&t.target.localName==="a"&&this.$telemetry.track("user clicked cnr docs link",{source:"node details view"})}}});function pa(e,t,o,n,s,i){const a=S("n8n-tabs");return c(),O(a,{options:e.options,"model-value":e.modelValue,"onUpdate:modelValue":e.onTabSelect,onTooltipClick:e.onTooltipClick},null,8,["options","model-value","onUpdate:modelValue","onTooltipClick"])}const fa=x(ha,[["render",pa]]),ga=z({name:"NodeWebhooks",props:["node","nodeType"],setup(){const e=ot(),t=qt(),o=bt({router:e});return{clipboard:t,workflowHelpers:o,...ze()}},data(){return{isMinimized:this.nodeType&&!to.includes(this.nodeType.name),showUrlFor:"test"}},computed:{isProductionOnly(){return this.nodeType&&Hn.includes(this.nodeType.name)},urlOptions(){return[...this.isProductionOnly?[]:[{label:this.baseText.testUrl,value:"test"}],{label:this.baseText.productionUrl,value:"production"}]},visibleWebhookUrls(){return this.webhooksNode.filter(e=>typeof e.ndvHideUrl=="string"?!this.workflowHelpers.getWebhookExpressionValue(e,"ndvHideUrl"):!e.ndvHideUrl)},webhooksNode(){return this.nodeType===null||this.nodeType.webhooks===void 0?[]:this.nodeType.webhooks.filter(e=>e.restartWebhook!==!0)},baseText(){switch(this.nodeType.name){case Qe:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.chatTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.chatTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.chatTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.chatTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.chatTrigger")};case Me:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.formTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.formTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.formTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.formTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.formTrigger")};default:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title"),copyMessage:void 0}}}},watch:{node(){this.isMinimized=!to.includes(this.nodeType.name)}},methods:{copyWebhookUrl(e){const t=this.getWebhookUrlDisplay(e);this.clipboard.copy(t),this.showMessage({title:this.baseText.copyTitle,message:this.baseText.copyMessage,type:"success"}),this.$telemetry.track("User copied webhook URL",{pane:"parameters",type:`${this.showUrlFor} url`})},getWebhookUrlDisplay(e){return this.node?this.workflowHelpers.getWebhookUrl(e,this.node,this.isProductionOnly?"production":this.showUrlFor):""},isWebhookMethodVisible(e){return typeof e.ndvHideMethod=="string"?!this.workflowHelpers.getWebhookExpressionValue(e,"ndvHideMethod"):!e.ndvHideMethod}}}),Zt=e=>(Cn("data-v-df24ab0e"),e=e(),In(),e),ma={key:0,class:"webhooks"},ya=["title"],wa={key:0,class:"node-webhooks"},va={key:0,class:"url-selection"},Na={key:0,class:"webhook-wrapper"},ka={class:"http-field"},ba={class:"http-method"},Ta=Zt(()=>f("br",null,null,-1)),Sa={class:"url-field"},Da=["onClick"],Ea=Zt(()=>f("br",null,null,-1)),Ca={key:1,class:"webhook-wrapper"},Ia={class:"url-field-full-width"},Pa=["onClick"],Oa=Zt(()=>f("br",null,null,-1));function $a(e,t,o,n,s,i){const a=S("font-awesome-icon"),r=S("n8n-radio-buttons"),l=S("el-col"),d=S("el-row"),h=S("n8n-tooltip"),p=S("el-collapse-transition");return e.webhooksNode.length&&e.visibleWebhookUrls.length>0?(c(),b("div",ma,[f("div",{class:D(["clickable headline",{expanded:!e.isMinimized}]),title:e.isMinimized?e.baseText.clickToDisplay:e.baseText.clickToHide,onClick:t[0]||(t[0]=g=>e.isMinimized=!e.isMinimized)},[y(a,{icon:"angle-right",class:"minimize-button minimize-icon"}),I(" "+T(e.baseText.toggleTitle),1)],10,ya),y(p,null,{default:w(()=>[e.isMinimized?E("",!0):(c(),b("div",wa,[e.isProductionOnly?E("",!0):(c(),b("div",va,[y(d,null,{default:w(()=>[y(l,{span:24},{default:w(()=>[y(r,{modelValue:e.showUrlFor,"onUpdate:modelValue":t[1]||(t[1]=g=>e.showUrlFor=g),options:e.urlOptions},null,8,["modelValue","options"])]),_:1})]),_:1})])),(c(!0),b(Z,null,re(e.visibleWebhookUrls,(g,N)=>(c(),O(h,{key:N,class:"item",content:e.baseText.clickToCopy,placement:"left"},{default:w(()=>[e.isWebhookMethodVisible(g)?(c(),b("div",Na,[f("div",ka,[f("div",ba,[I(T(e.workflowHelpers.getWebhookExpressionValue(g,"httpMethod")),1),Ta])]),f("div",Sa,[f("div",{class:"webhook-url left-ellipsis clickable",onClick:m=>e.copyWebhookUrl(g)},[I(T(e.getWebhookUrlDisplay(g)),1),Ea],8,Da)])])):(c(),b("div",Ca,[f("div",Ia,[f("div",{class:"webhook-url left-ellipsis clickable",onClick:m=>e.copyWebhookUrl(g)},[I(T(e.getWebhookUrlDisplay(g)),1),Oa],8,Pa)])]))]),_:2},1032,["content"]))),128))]))]),_:1})])):E("",!0)}const Ra=x(ga,[["render",$a],["__scopeId","data-v-df24ab0e"]]),_a=["data-test-id"],Aa=["textContent"],Ma=["onClick"],Wa=["onClick"],Va=["data-node-name"],Ba=["onClick"],Ua=z({__name:"NDVSubConnections",props:{rootNode:{}},emits:["switchSelectedNode","openConnectionNodeCreator"],setup(e,{expose:t,emit:o}){const n=e,s=j(),i=J(),a=We(),{debounce:r}=vt(),l=o,d=F([]),h=F([]),p=F(!1),g=Y(()=>i.getNodeType(n.rootNode.type,n.rootNode.typeVersion)),N=Y(()=>s.getNodeByName(n.rootNode.name)),m=Y(()=>s.getCurrentWorkflow()),C=Y(()=>{const V=a.getNodeIssues(g.value,n.rootNode,m.value,["typeUnknown","parameters","credentials","execution"]);return(V==null?void 0:V.input)??{}}),u=Y(()=>d.value.reduce((V,H)=>{const Q=R(m.value.getParentNodes(n.rootNode.name,H.type));return{...V,[H.type]:Q}},{}));function k(V){return d.value.find(H=>H.type===V)}function v(V){const H=k(V);return(H==null?void 0:H.maxConnections)!==1}function P(V){return v(V)&&!h.value.includes(V)}function _(V,H){v(V)&&(H?h.value=[...h.value,V]:h.value=h.value.filter(Q=>Q!==V))}function R(V){return V.map(H=>{const Q=s.getNodeByName(H);if(Q){const ve=i.getNodeType(Q.type);if(ve){const Pe=a.getNodeIssues(ve,Q,m.value),W=Pe?pn(Pe,Q):"";return{node:Q,nodeType:ve,issues:W}}}return null}).filter(H=>H!==null)}function A(V){return p.value&&(C.value[V]??[]).length>0}function $(V){return typeof V=="string"?!1:"type"in V}function B(){return!g.value||!n.rootNode?[]:fe(m.value,n.rootNode,g.value).filter(Q=>$(Q)?Q.type!=="main":!1)}function U(V,H){if(v(H)&&!h.value.includes(H)){_(H,!0);return}l("switchSelectedNode",V)}function oe(V){const H=u.value[V];if(v(V)&&!h.value.includes(V)&&H.length>=1){_(V,!0);return}l("openConnectionNodeCreator",n.rootNode.name,V)}function pe(){p.value=!1,setTimeout(()=>{p.value=!0},0)}return Xt(N,r(()=>setTimeout(()=>{h.value=[],d.value=B()},0),{debounceTime:1e3}),{immediate:!0}),t({showNodeInputsIssues:pe}),(V,H)=>{const Q=S("n8n-icon-button"),ve=S("n8n-tooltip"),Pe=Tt("on-click-outside");return c(),b("div",{class:D(V.$style.container)},[f("div",{class:D(V.$style.connections),style:ee(`--possible-connections: ${d.value.length}`)},[(c(!0),b(Z,null,re(d.value,W=>(c(),b("div",{key:W.type,"data-test-id":`subnode-connection-group-${W.type}`},[f("div",{class:D(V.$style.connectionType)},[f("span",{class:D({[V.$style.connectionLabel]:!0,[V.$style.hasIssues]:A(W.type)}),textContent:T(`${W.displayName}${W.required?" *":""}`)},null,10,Aa),G((c(),b("div",{class:D({[V.$style.connectedNodesWrapper]:!0,[V.$style.connectedNodesWrapperExpanded]:h.value.includes(W.type)}),style:ee(`--nodes-length: ${u.value[W.type].length}`),onClick:q=>_(W.type,!0)},[!(u.value[W.type].length>=1)||W.maxConnections!==1?(c(),b("div",{key:0,class:D({[V.$style.plusButton]:!0,[V.$style.hasIssues]:A(W.type)}),onClick:q=>oe(W.type)},[y(ve,{placement:"top",teleported:!0,offset:10,"show-after":300,disabled:P(W.type)&&u.value[W.type].length>=1},{content:w(()=>[I(" Add "+T(W.displayName)+" ",1),A(W.type)?(c(),O(Vt,{key:0,title:`${V.$locale.baseText("node.issues")}:`,items:C.value[W.type]},null,8,["title","items"])):E("",!0)]),default:w(()=>[y(Q,{size:"medium",icon:"plus",type:"tertiary","data-test-id":`add-subnode-${W.type}`},null,8,["data-test-id"])]),_:2},1032,["disabled"])],10,Wa)):E("",!0),u.value[W.type].length>0?(c(),b("div",{key:1,class:D({[V.$style.connectedNodes]:!0,[V.$style.connectedNodesMultiple]:u.value[W.type].length>1})},[(c(!0),b(Z,null,re(u.value[W.type],(q,ue)=>(c(),b("div",{key:q.node.name,class:D({[V.$style.nodeWrapper]:!0,[V.$style.hasIssues]:q.issues}),"data-test-id":"floating-subnode","data-node-name":q.node.name,style:ee(`--node-index: ${ue}`)},[(c(),O(ve,{key:q.node.name,placement:"top",teleported:!0,offset:10,"show-after":300,disabled:P(W.type)},{content:w(()=>[I(T(q.node.name)+" ",1),q.issues?(c(),O(Vt,{key:0,title:`${V.$locale.baseText("node.issues")}:`,items:q.issues},null,8,["title","items"])):E("",!0)]),default:w(()=>[f("div",{class:D(V.$style.connectedNode),onClick:Oe=>U(q.node.name,W.type)},[y(tt,{"node-type":q.nodeType,"node-name":q.node.name,"tooltip-position":"top",size:20,circle:""},null,8,["node-type","node-name"])],10,Ba)]),_:2},1032,["disabled"]))],14,Va))),128))],2)):E("",!0)],14,Ma)),[[Pe,()=>_(W.type,!1)]])],2)],8,_a))),128))],6)],2)}}}),La="_container_547vc_22",xa="_connections_547vc_30",Ha="_connectionType_547vc_42",Fa="_connectionLabel_547vc_49",za="_hasIssues_547vc_55",Ya="_connectedNodesWrapper_547vc_59",Ka="_plusButton_547vc_67",ja="_connectedNodesWrapperExpanded_547vc_85",qa="_connectedNodesMultiple_547vc_91",Ga="_connectedNode_547vc_59",Ja="_connectedNodes_547vc_59",Xa="_nodeWrapper_547vc_129",Qa={container:La,connections:xa,connectionType:Ha,connectionLabel:Fa,hasIssues:za,connectedNodesWrapper:Ya,plusButton:Ka,"horizontal-shake":"_horizontal-shake_547vc_1",connectedNodesWrapperExpanded:ja,connectedNodesMultiple:qa,connectedNode:Ga,connectedNodes:Ja,nodeWrapper:Xa},Za={$style:Qa},er=x(Ua,[["__cssModules",Za]]);function _n(e={}){const t=J(),o=Y(()=>{if(e.nodeType)return L(e.nodeType);const i=L(e.node);return i?t.getNodeType(i.type,i.typeVersion):null}),n=Y(()=>{var a,r,l;if(!((a=o.value)!=null&&a.outputs)||typeof((r=o.value)==null?void 0:r.outputs)=="string")return!1;const i=ge((l=o.value)==null?void 0:l.outputs);return i?i.filter(d=>d!==M.Main).length>0:!1}),s=Y(()=>{var i;return(((i=o.value)==null?void 0:i.outputs)??[]).length>1});return{nodeType:o,isSubNodeType:n,isMultipleOutputsNodeType:s}}function Se(e,t={}){const o=xt(),n=j(),s=ze(),i=Ne(),a=jn(),r=Ee(),{sessionId:l}=kt(o),{isSubNodeType:d,isMultipleOutputsNodeType:h}=_n({node:e}),p=Y(()=>{const R=L(e);return R?n.pinDataByNodeName(R.name):void 0}),g=Y(()=>!!L(e)&&typeof p.value<"u"),N=Y(()=>{const R=L(e);return!!R&&!d.value&&!h.value&&!un.includes(R.type)});function m(R){try{return JSON.parse(R),!0}catch(A){const $=i.baseText("runData.editOutputInvalid"),B=new RegExp(/JSON\.parse:|of the JSON data/,"g"),U=A.message.replace(B,"").trim(),oe=/at position (\d+)/,pe=A.message.match(oe);if(A.message=U.charAt(0).toUpperCase()+U.slice(1),A.message=A.message.replace("Unexpected token ' in JSON",i.baseText("runData.editOutputInvalid.singleQuote")),pe){const V=parseInt(pe[1],10),H=(R.slice(0,V).match(/\n/g)||[]).length;A.message=A.message.replace(oe,i.baseText("runData.editOutputInvalid.atPosition",{interpolate:{position:`${V}`}})),A.message=`${i.baseText("runData.editOutputInvalid.onLine",{interpolate:{line:`${H+1}`}})} ${A.message}`}return s.showError(A,$),!1}}function C(R){const A=L(e);if(!A)return!1;typeof R=="object"&&(R=JSON.stringify(R));const{pinData:$,...B}=n.getCurrentWorkflow(),U=Fn(B,{replaceCircularRefs:!0}),oe={...$,[A.name]:R},pe=n.getPinDataSize(oe);return pe>zn?(s.showError(new Error(i.baseText("ndv.pinData.error.tooLarge.description")),i.baseText("ndv.pinData.error.tooLarge.title")),!1):st(U)+pe>Yn-Kn?(s.showError(new Error(i.baseText("ndv.pinData.error.tooLargeWorkflow.description")),i.baseText("ndv.pinData.error.tooLargeWorkflow.title")),!1):!0}function u({source:R}){const A=L(e),$=L(t.displayMode),B=L(t.runIndex),U={pinning_source:R,node_type:A==null?void 0:A.type,session_id:l.value,data_size:st(p.value),view:$,run_index:B};r.run("runData.onDataPinningSuccess",U),a.track("Ndv data pinning success",U)}function k({errorType:R,source:A}){const $=L(e),B=L(t.displayMode),U=L(t.runIndex);a.track("Ndv data pinning failure",{pinning_source:A,node_type:$==null?void 0:$.type,session_id:l.value,data_size:st(p.value),view:B,run_index:U,error_type:R})}function v(R,A){const $=L(e);if($){if(typeof R=="string"){if(!m(R))throw k({errorType:"invalid-json",source:A}),new Error("Invalid JSON");R=Nt(R)}if(!C(R))throw k({errorType:"data-too-large",source:A}),new Error("Data too large");n.pinData({node:$,data:R}),u({source:A})}}function P({source:R}){const A=L(e),$=L(t.runIndex);a.track("User unpinned ndv data",{node_type:A==null?void 0:A.type,session_id:l.value,run_index:$,source:R,data_size:st(p.value)})}function _(R){const A=L(e);A&&(P({source:R}),n.unpinData({node:A}))}return{data:p,hasData:g,isValidNodeType:N,setData:v,onSetDataSuccess:u,onSetDataError:k,unsetData:_,onUnsetData:P,isValidJSON:m,isValidSize:C}}const tr=z({inheritAttrs:!1,props:{nodeName:{type:String,required:!0},disabled:{type:Boolean,default:!1},label:{type:String},type:{type:String},size:{type:String},transparent:{type:Boolean,default:!1},telemetrySource:{type:String},hideIcon:{type:Boolean}},setup(e){const t=ot(),n=j().getNodeByName(e.nodeName),s=Se(n),i=Ee(),{runWorkflow:a}=kn({router:t});return{externalHooks:i,pinnedData:s,runWorkflow:a,...ze(),...Gt()}},computed:{...te(J,X,j,de),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},nodeRunning(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&(this.workflowsStore.isNodeExecuting(this.node.name)||e===this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isTriggerNode(){return this.node?this.nodeTypesStore.isTriggerNode(this.node.type):!1},isManualTriggerNode(){return!!(this.nodeType&&this.nodeType.name===Ze)},isChatNode(){return!!(this.nodeType&&this.nodeType.name===Qe)},isFormTriggerNode(){return!!(this.nodeType&&this.nodeType.name===Me)},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){var e;return!!((e=this.nodeType)!=null&&e.group.includes("schedule"))},isWebhookNode(){return!!(this.nodeType&&this.nodeType.name===_e)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return this.node&&!this.node.disabled&&this.isTriggerNode&&e&&(!t||t===this.nodeName)},isListeningForWorkflowEvents(){return this.nodeRunning&&this.isTriggerNode&&!this.isScheduleTrigger&&!this.isManualTriggerNode},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},disabledHint(){if(this.isListeningForEvents)return"";if(this.isTriggerNode&&this.node.disabled)return this.$locale.baseText("ndv.execute.nodeIsDisabled");if(this.isTriggerNode&&this.hasIssues){const e=this.ndvStore.activeNode;return e&&e.name!==this.nodeName?this.$locale.baseText("ndv.execute.fixPrevious"):this.$locale.baseText("ndv.execute.requiredFieldsMissing")}return this.workflowRunning&&!this.nodeRunning?this.$locale.baseText("ndv.execute.workflowAlreadyRunning"):""},buttonLabel(){var e;return this.isListeningForEvents||this.isListeningForWorkflowEvents?this.$locale.baseText("ndv.execute.stopListening"):this.label?this.label:this.isChatNode?this.$locale.baseText("ndv.execute.testChat"):this.isWebhookNode?this.$locale.baseText("ndv.execute.listenForTestEvent"):this.isFormTriggerNode?this.$locale.baseText("ndv.execute.testStep"):this.isPollingTypeNode||(e=this.nodeType)!=null&&e.mockManualExecution?this.$locale.baseText("ndv.execute.fetchEvent"):this.$locale.baseText("ndv.execute.testNode")}},methods:{async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("ndv.execute.stopWaitingForWebhook.error"));return}},async onClick(){if(this.isChatNode)this.ndvStore.setActiveNodeName(null),ie.emit("openChat");else if(this.isListeningForEvents)await this.stopWaitingForWebhook();else if(this.isListeningForWorkflowEvents)this.$emit("stopExecution");else{let e=!1;if(this.pinnedData.hasData.value&&(e=await this.confirm(this.$locale.baseText("ndv.pinData.unpinAndExecute.description"),this.$locale.baseText("ndv.pinData.unpinAndExecute.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.cancel")})===xe,e&&this.node&&this.pinnedData.unsetData("unpin-and-execute-modal")),!this.pinnedData.hasData.value||e){const t={node_type:this.nodeType?this.nodeType.name:null,workflow_id:this.workflowsStore.workflowId,source:this.telemetrySource,session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",t),await this.externalHooks.run("nodeExecuteButton.onClick",t),await this.runWorkflow({destinationNode:this.nodeName,source:"RunData.ExecuteNodeButton"}),this.$emit("execute")}}}}});function or(e,t,o,n,s,i){const a=S("n8n-button"),r=S("n8n-tooltip");return c(),b("div",null,[y(r,{placement:"bottom",disabled:!e.disabledHint},{content:w(()=>[f("div",null,T(e.disabledHint),1)]),default:w(()=>[f("div",null,[y(a,Bi(e.$attrs,{loading:e.nodeRunning&&!e.isListeningForEvents&&!e.isListeningForWorkflowEvents,disabled:e.disabled||!!e.disabledHint,label:e.buttonLabel,type:e.type,size:e.size,icon:!e.isListeningForEvents&&!e.hideIcon&&"flask","transparent-background":e.transparent,title:e.isTriggerNode?"":e.$locale.baseText("ndv.execute.testNode.description"),onClick:e.onClick}),null,16,["loading","disabled","label","type","size","icon","transparent-background","title","onClick"])])]),_:1},8,["disabled"])])}const eo=x(tr,[["render",or]]),nr=z({name:"NodeSettings",components:{NodeTitle:ca,NodeCredentials:ei,ParameterInputList:ti,NodeSettingsTabs:fa,NodeWebhooks:Ra,NDVSubConnections:er,NodeExecuteButton:eo},setup(){const e=We();return{externalHooks:Ee(),nodeHelpers:e}},computed:{...te(Jt,J,X,de,fn,j,bn),isCurlImportModalOpen(){return this.uiStore.isModalOpen(oo)},isReadOnly(){return this.readOnly||this.hasForeignCredential},isExecutable(){if(this.nodeType&&this.node){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=fe(e,t,this.nodeType);if(!ge(o).includes(M.Main)&&!this.isTriggerNode)return!1}return this.executable||this.hasForeignCredential},nodeTypeName(){if(this.nodeType){const e=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${e}.displayName`,fallback:this.nodeType.name})}return""},nodeTypeVersions(){return this.node?this.nodeTypesStore.getNodeVersions(this.node.type):[]},latestVersion(){return Math.max(...this.nodeTypeVersions)},isLatestNodeVersion(){var e;return!((e=this.node)!=null&&e.typeVersion)||this.latestVersion===this.node.typeVersion},nodeVersionTag(){return!this.nodeType||this.nodeType.hidden?this.$locale.baseText("nodeSettings.deprecated"):this.isLatestNodeVersion?this.$locale.baseText("nodeSettings.latest"):this.$locale.baseText("nodeSettings.latestVersion",{interpolate:{version:this.latestVersion.toString()}})},nodeTypeDescription(){var e;if((e=this.nodeType)!=null&&e.description){const t=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${t}.description`,fallback:this.nodeType.description})}else return this.$locale.baseText("nodeSettings.noDescriptionFound")},headerStyle(){return this.node?{"background-color":this.node.color}:{}},node(){return this.ndvStore.activeNode},parametersSetting(){return this.parameters.filter(e=>e.isNodeSetting)},parametersNoneSetting(){return this.parameters.filter(e=>!e.isNodeSetting)},parameters(){return this.nodeType===null?[]:this.nodeType.properties},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isCommunityNode(){var e;return cn((e=this.node)==null?void 0:e.type)},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode((e=this.node)==null?void 0:e.type)},workflowOwnerName(){return this.workflowsEEStore.getWorkflowOwnerName(`${this.workflowsStore.workflowId}`)},hasForeignCredential(){return this.foreignCredentials.length>0},usedCredentials(){return Object.values(this.workflowsStore.usedCredentials).filter(e=>{var t;return Object.values(((t=this.node)==null?void 0:t.credentials)||[]).find(o=>o.id===e.id)})},credentialOwnerName(){const e=this.usedCredentials?Object.values(this.usedCredentials).find(t=>t.id===this.foreignCredentials[0]):void 0;return this.credentialsStore.getCredentialOwnerName(e)}},props:{eventBus:{type:Object},dragging:{type:Boolean},sessionId:{type:String},nodeType:{type:Object},readOnly:{type:Boolean,default:!1},foreignCredentials:{type:Array,default:()=>[]},blockUI:{type:Boolean,default:!1},executable:{type:Boolean,default:!0}},data(){return{nodeValid:!0,nodeColor:null,openPanel:"params",nodeValues:{color:"#ff0000",alwaysOutputData:!1,executeOnce:!1,notesInFlow:!1,onError:"stopWorkflow",retryOnFail:!1,maxTries:3,waitBetweenTries:1e3,notes:"",parameters:{}},nodeValuesInitialized:!1,nodeSettings:[],COMMUNITY_NODES_INSTALLATION_DOCS_URL:hn,CUSTOM_NODES_DOCS_URL:qn,MAIN_NODE_PANEL_WIDTH:Le,hiddenIssuesInputs:[]}},watch:{node(e,t){this.setNodeValues()},isCurlImportModalOpen(e,t){if(e===!1){let o=this.uiStore.getHttpNodeParameters||"";if(!o)return;try{o=JSON.parse(o),this.valueChanged({node:this.node.name,name:"parameters",value:o}),this.uiStore.setHttpNodeParameters({name:oo,parameters:""})}catch{}}}},mounted(){var e;this.populateHiddenIssuesSet(),this.populateSettings(),this.setNodeValues(),(e=this.eventBus)==null||e.on("openSettings",this.openSettings),this.nodeHelpers.updateNodeParameterIssues(this.node,this.nodeType)},beforeUnmount(){var e;(e=this.eventBus)==null||e.off("openSettings",this.openSettings)},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},onOpenConnectionNodeCreator(e,t){this.$emit("openConnectionNodeCreator",e,t)},populateHiddenIssuesSet(){!this.node||!this.workflowsStore.isNodePristine(this.node.name)||(this.hiddenIssuesInputs.push("credentials"),this.parametersNoneSetting.forEach(e=>{this.hiddenIssuesInputs.push(e.name)}),this.workflowsStore.setNodePristine(this.node.name,!1))},populateSettings(){this.isExecutable&&!this.isTriggerNode&&this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.alwaysOutputData.displayName"),name:"alwaysOutputData",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.alwaysOutputData.description")},{displayName:this.$locale.baseText("nodeSettings.executeOnce.displayName"),name:"executeOnce",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.executeOnce.description")},{displayName:this.$locale.baseText("nodeSettings.retryOnFail.displayName"),name:"retryOnFail",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.retryOnFail.description")},{displayName:this.$locale.baseText("nodeSettings.maxTries.displayName"),name:"maxTries",type:"number",typeOptions:{minValue:2,maxValue:5},default:3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.maxTries.description")},{displayName:this.$locale.baseText("nodeSettings.waitBetweenTries.displayName"),name:"waitBetweenTries",type:"number",typeOptions:{minValue:0,maxValue:5e3},default:1e3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.waitBetweenTries.description")},{displayName:this.$locale.baseText("nodeSettings.onError.displayName"),name:"onError",type:"options",options:[{name:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.displayName"),value:"stopWorkflow",description:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.displayName"),value:"continueRegularOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.displayName"),value:"continueErrorOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.description")}],default:"stopWorkflow",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.onError.description")}),this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.notes.displayName"),name:"notes",type:"string",typeOptions:{rows:5},default:"",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notes.description")},{displayName:this.$locale.baseText("nodeSettings.notesInFlow.displayName"),name:"notesInFlow",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notesInFlow.description")})},onParameterBlur(e){this.hiddenIssuesInputs=this.hiddenIssuesInputs.filter(t=>t!==e)},onWorkflowActivate(){this.hiddenIssuesInputs=[],this.$emit("activate")},onNodeExecute(){var e;this.hiddenIssuesInputs=[],(e=this.$refs.subConnections)==null||e.showNodeInputsIssues(),this.$emit("execute")},setValue(e,t){const o=e.split(".");let n=o.pop(),s=!1;if(n!==void 0&&n.includes("[")){const i=n.match(/(.*)\[(\d+)\]$/);i&&(o.push(i[1]),n=i[2],s=!0)}if(o.length===0)if(t===null){const{[n]:i,...a}=this.nodeValues;this.nodeValues=a}else this.nodeValues={...this.nodeValues,[n]:t};else if(t===null){let i=ye(this.nodeValues,o.join("."));const{[n]:a,...r}=i;if(i=r,s&&i.length===0){n=o.pop(),i=ye(this.nodeValues,o.join("."));const{[n]:l,...d}=i;i=d}}else typeof t=="object"?Be(ye(this.nodeValues,o.join(".")),n,Re(t)):Be(ye(this.nodeValues,o.join(".")),n,t);this.nodeValues={...this.nodeValues}},credentialSelected(e){this.workflowsStore.updateNodeProperties(e);const t=this.workflowsStore.getNodeByName(e.name);t&&this.nodeHelpers.updateNodeCredentialIssues(t),this.externalHooks.run("nodeSettings.credentialSelected",{updateInformation:e})},nameChanged(e){this.node&&this.historyStore.pushCommandToUndo(new Tn(this.node.name,e)),this.valueChanged({value:e,name:"name"})},valueChanged(e){var s;let t;e.hasOwnProperty("value")?t=e.value:t=ye(this.nodeValues,e.name);const o=e.node||((s=this.node)==null?void 0:s.name),n=this.workflowsStore.getNodeByName(o);if(n!==null)if(e.name==="onError"&&this.$emit("redrawRequired"),e.name==="name"){const i={value:t,oldValue:o,name:e.name};this.$emit("valueChanged",i)}else if(e.name==="parameters"){const i=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!i)return;let a=He(i.properties,n.parameters,!1,!1,n);const r=Object.assign({},a);a=Re(a);for(const l of Object.keys(e.value)){t=e.value[l];const d=l.split(".").slice(1).join("."),h=d.match(/(.*)\[(\d+)\]$/);if(e[l]===void 0&&h!==null){const p=h[1],g=h[2],N=ye(a,p);Array.isArray(N)&&(N.splice(parseInt(g,10),1),Be(a,p,N))}else t===void 0?Ot(a,d):Be(a,d,t);this.externalHooks.run("nodeSettings.valueChanged",{parameterPath:d,newValue:t,parameters:this.parameters,oldNodeParameters:r})}a=He(i.properties,a,!0,!1,n);for(const l of Object.keys(a))a&&a[l]!==null&&a[l]!==void 0&&this.setValue(`parameters.${l}`,a[l]);if(a){const l={name:n.name,value:a};this.workflowsStore.setNodeParameters(l),this.nodeHelpers.updateNodeParameterIssuesByName(n.name),this.nodeHelpers.updateNodeCredentialIssuesByName(n.name)}}else if(e.name.startsWith("parameters.")){const i=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!i)return;let a=He(i.properties,n.parameters,!1,!1,n);const r=Object.assign({},a);a=Re(a);const l=e.name.split(".").slice(1).join("."),d=l.match(/(.*)\[(\d+)\]$/);if(e.value===void 0&&d!==null){const p=d[1],g=d[2],N=ye(a,p);Array.isArray(N)&&(N.splice(parseInt(g,10),1),Be(a,p,N))}else t===void 0?Ot(a,l):Be(a,l,t),this.removeMismatchedOptionValues(i,a,{name:l,value:t});a=He(i.properties,a,!0,!1,n);for(const p of Object.keys(a))a&&a[p]!==null&&a[p]!==void 0&&this.setValue(`parameters.${p}`,a[p]);const h={name:n.name,value:a};this.workflowsStore.setNodeParameters(h),this.externalHooks.run("nodeSettings.valueChanged",{parameterPath:l,newValue:t,parameters:this.parameters,oldNodeParameters:r}),this.nodeHelpers.updateNodeParameterIssuesByName(n.name),this.nodeHelpers.updateNodeCredentialIssuesByName(n.name),this.$telemetry.trackNodeParametersValuesChange(i.name,e)}else{this.nodeValues={...this.nodeValues,[e.name]:t};const i={name:n.name,key:e.name,value:t};this.workflowsStore.setNodeValue(i)}},removeMismatchedOptionValues(e,t,o){e.properties.forEach(n=>{var l,d;const s=n.displayOptions;if(!(t!=null&&t.hasOwnProperty(n.name))||!s||!n.options)return;const i=(l=s.show)==null?void 0:l[o.name],a=(d=s.hide)==null?void 0:d[o.name];if(i===void 0&&a===void 0)return;(!Object.keys(t).every(h=>(n.options??[]).find(p=>p.name===h)!==void 0)||i!==o.value||a===o.value)&&Ot(t,n.name)})},setNodeValues(){if(!this.node){this.nodeValuesInitialized=!0;return}if(this.nodeType!==null){this.nodeValid=!0;const e=[];this.node.color&&(e.push("color"),this.nodeValues={...this.nodeValues,color:this.node.color}),this.node.notes&&(e.push("notes"),this.nodeValues={...this.nodeValues,notes:this.node.notes}),this.node.alwaysOutputData&&(e.push("alwaysOutputData"),this.nodeValues={...this.nodeValues,alwaysOutputData:this.node.alwaysOutputData}),this.node.executeOnce&&(e.push("executeOnce"),this.nodeValues={...this.nodeValues,executeOnce:this.node.executeOnce}),this.node.continueOnFail&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:"continueRegularOutput"}),this.node.onError&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:this.node.onError}),this.node.notesInFlow&&(e.push("notesInFlow"),this.nodeValues={...this.nodeValues,notesInFlow:this.node.notesInFlow}),this.node.retryOnFail&&(e.push("retryOnFail"),this.nodeValues={...this.nodeValues,retryOnFail:this.node.retryOnFail}),this.node.maxTries&&(e.push("maxTries"),this.nodeValues={...this.nodeValues,maxTries:this.node.maxTries}),this.node.waitBetweenTries&&(e.push("waitBetweenTries"),this.nodeValues={...this.nodeValues,waitBetweenTries:this.node.waitBetweenTries});for(const t of this.nodeSettings)e.includes(t.name)||(this.nodeValues={...this.nodeValues,[t.name]:t.default});this.nodeValues={...this.nodeValues,parameters:Re(this.node.parameters)}}else this.nodeValid=!1;this.nodeValuesInitialized=!0},onMissingNodeTextClick(e){e.target.localName==="a"&&this.$telemetry.track("user clicked cnr browse button",{source:"cnr missing node modal"})},onMissingNodeLearnMoreLinkClick(){var e,t;this.$telemetry.track("user clicked cnr docs link",{source:"missing node modal source",package_name:(e=this.node)==null?void 0:e.type.split(".")[0],node_type:(t=this.node)==null?void 0:t.type})},onStopExecution(){this.$emit("stopExecution")},openSettings(){this.openPanel="settings"}}}),sr="_header_1uxvz_5",ir="_warningIcon_1uxvz_9",ar="_descriptionContainer_1uxvz_14",rr={header:sr,warningIcon:ir,descriptionContainer:ar},lr={class:"header-side-menu"},dr={key:1},ur={key:0,class:"node-is-not-valid"},cr={class:"missingNodeTitleContainer mt-s mb-xs"},hr={class:"mb-l"},pr=["href"],fr=["href","textContent"],gr={key:1,class:"node-parameters-wrapper","data-test-id":"node-parameters"},mr={key:1,class:"no-parameters"},yr={key:2,class:"parameter-item parameter-notice","data-test-id":"node-parameters-http-notice"},wr={class:"node-version","data-test-id":"node-version"};function vr(e,t,o,n,s,i){var P;const a=S("NodeTitle"),r=S("NodeExecuteButton"),l=S("NodeSettingsTabs"),d=S("font-awesome-icon"),h=S("n8n-text"),p=S("i18n-t"),g=S("n8n-link"),N=S("n8n-notice"),m=S("NodeWebhooks"),C=S("NodeCredentials"),u=S("ParameterInputList"),k=S("NDVSubConnections"),v=S("n8n-block-ui");return c(),b("div",{class:D({"node-settings":!0,dragging:e.dragging}),onKeydown:t[1]||(t[1]=se(()=>{},["stop"]))},[f("div",{class:D(e.$style.header)},[f("div",lr,[e.node?(c(),O(a,{key:0,class:"node-name","model-value":e.node.name,"node-type":e.nodeType,"read-only":e.isReadOnly,"onUpdate:modelValue":e.nameChanged},null,8,["model-value","node-type","read-only","onUpdate:modelValue"])):E("",!0),e.isExecutable?(c(),b("div",dr,[!e.blockUI&&e.node&&e.nodeValid?(c(),O(r,{key:0,"data-test-id":"node-execute-button","node-name":e.node.name,disabled:e.outputPanelEditMode.enabled&&!e.isTriggerNode,size:"small","telemetry-source":"parameters",onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution},null,8,["node-name","disabled","onExecute","onStopExecution"])):E("",!0)])):E("",!0)]),e.node&&e.nodeValid?(c(),O(l,{key:0,modelValue:e.openPanel,"onUpdate:modelValue":t[0]||(t[0]=_=>e.openPanel=_),"node-type":e.nodeType,"session-id":e.sessionId},null,8,["modelValue","node-type","session-id"])):E("",!0)],2),e.node&&!e.nodeValid?(c(),b("div",ur,[f("p",{class:D(e.$style.warningIcon)},[y(d,{icon:"exclamation-triangle"})],2),f("div",cr,[y(h,{size:"large",color:"text-dark",bold:""},{default:w(()=>[I(T(e.$locale.baseText("nodeSettings.communityNodeUnknown.title")),1)]),_:1})]),e.isCommunityNode?(c(),b("div",{key:0,class:D(e.$style.descriptionContainer)},[f("div",hr,[y(p,{keypath:"nodeSettings.communityNodeUnknown.description",tag:"span",onClick:e.onMissingNodeTextClick},{action:w(()=>[f("a",{href:`https://www.npmjs.com/package/${e.node.type.split(".")[0]}`,target:"_blank"},T(e.node.type.split(".")[0]),9,pr)]),_:1},8,["onClick"])]),y(g,{to:e.COMMUNITY_NODES_INSTALLATION_DOCS_URL,onClick:e.onMissingNodeLearnMoreLinkClick},{default:w(()=>[I(T(e.$locale.baseText("nodeSettings.communityNodeUnknown.installLink.text")),1)]),_:1},8,["to","onClick"])],2)):(c(),O(p,{key:1,keypath:"nodeSettings.nodeTypeUnknown.description",tag:"span"},{action:w(()=>[f("a",{href:e.CUSTOM_NODES_DOCS_URL,target:"_blank",textContent:T(e.$locale.baseText("nodeSettings.nodeTypeUnknown.description.customNode"))},null,8,fr)]),_:1}))])):E("",!0),e.node&&e.nodeValid?(c(),b("div",gr,[e.hasForeignCredential?(c(),O(N,{key:0,content:e.$locale.baseText("nodeSettings.hasForeignCredential",{interpolate:{owner:e.credentialOwnerName}})},null,8,["content"])):E("",!0),G(f("div",null,[y(m,{node:e.node,"node-type":e.nodeType},null,8,["node","node-type"]),e.nodeValuesInitialized?(c(),O(u,{key:0,parameters:e.parametersNoneSetting,"hide-delete":!0,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onActivate:e.onWorkflowActivate,onParameterBlur:e.onParameterBlur},{default:w(()=>[y(C,{node:e.node,readonly:e.isReadOnly,"show-all":!0,"hide-issues":e.hiddenIssuesInputs.includes("credentials"),onCredentialSelected:e.credentialSelected,onValueChanged:e.valueChanged,onBlur:e.onParameterBlur},null,8,["node","readonly","hide-issues","onCredentialSelected","onValueChanged","onBlur"])]),_:1},8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onActivate","onParameterBlur"])):E("",!0),e.parametersNoneSetting.length===0?(c(),b("div",mr,[y(h,null,{default:w(()=>[I(T(e.$locale.baseText("nodeSettings.thisNodeDoesNotHaveAnyParameters")),1)]),_:1})])):E("",!0),e.nodeHelpers.isCustomApiCallSelected(e.nodeValues)?(c(),b("div",yr,[y(N,{content:e.$locale.baseText("nodeSettings.useTheHttpRequestNode",{interpolate:{nodeTypeDisplayName:e.nodeType.displayName}})},null,8,["content"])])):E("",!0)],512),[[ne,e.openPanel==="params"]]),G(f("div",null,[y(u,{parameters:e.parametersSetting,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onParameterBlur"]),y(u,{parameters:e.nodeSettings,"hide-delete":!0,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onParameterBlur"]),f("div",wr,[I(T(e.$locale.baseText("nodeSettings.nodeVersion",{interpolate:{node:(P=e.nodeType)==null?void 0:P.displayName,version:(e.node.typeVersion??e.latestVersion).toString()}}))+" ",1),f("span",null,"("+T(e.nodeVersionTag)+")",1)])],512),[[ne,e.openPanel==="settings"]])])):E("",!0),e.node?(c(),O(k,{key:2,ref:"subConnections","root-node":e.node,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator},null,8,["root-node","onSwitchSelectedNode","onOpenConnectionNodeCreator"])):E("",!0),y(v,{show:e.blockUI},null,8,["show"])],34)}const Nr={$style:rr},kr=x(nr,[["render",vr],["__cssModules",Nr],["__scopeId","data-v-b094ac2b"]]),br=z({name:"Draggable",props:{disabled:{type:Boolean},type:{type:String},data:{type:String},tag:{type:String,default:"div"},targetDataKey:{type:String}},data(){const e={x:-100,y:-100};return{isDragging:!1,draggablePosition:e,draggingEl:null,draggableStyle:{transform:`translate(${e.x}px, ${e.y}px)`},animationFrameId:0}},computed:{...te(X),canDrop(){return this.ndvStore.canDraggableDrop},stickyPosition(){return this.ndvStore.draggableStickyPos}},methods:{setDraggableStyle(){this.draggableStyle={transform:`translate(${this.draggablePosition.x}px, ${this.draggablePosition.y}px)`}},onDragStart(e){var o,n,s;if(this.disabled||(this.draggingEl=e.target,this.targetDataKey&&((o=this.draggingEl.dataset)==null?void 0:o.target)!==this.targetDataKey&&(this.draggingEl=this.draggingEl.closest(`[data-target="${this.targetDataKey}"]`)),this.targetDataKey&&((s=(n=this.draggingEl)==null?void 0:n.dataset)==null?void 0:s.target)!==this.targetDataKey))return;e.preventDefault(),e.stopPropagation(),this.isDragging=!1,this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),window.addEventListener("mousemove",this.onDrag),window.addEventListener("mouseup",this.onDragEnd);const t=document.activeElement;t&&t.blur()},onDrag(e){var t;if(e.preventDefault(),e.stopPropagation(),!this.disabled){if(!this.isDragging){this.isDragging=!0;const o=this.targetDataKey&&this.draggingEl?this.draggingEl.dataset.value:this.data||"";this.ndvStore.draggableStartDragging({type:this.type,data:o||"",dimensions:((t=this.draggingEl)==null?void 0:t.getBoundingClientRect())??null}),this.$emit("dragstart",this.draggingEl),document.body.style.cursor="grabbing"}this.animationFrameId=window.requestAnimationFrame(()=>{this.canDrop&&this.stickyPosition?this.draggablePosition={x:this.stickyPosition[0],y:this.stickyPosition[1]}:this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),this.$emit("drag",this.draggablePosition)})}},onDragEnd(){this.disabled||(document.body.style.cursor="unset",window.removeEventListener("mousemove",this.onDrag),window.removeEventListener("mouseup",this.onDragEnd),window.cancelAnimationFrame(this.animationFrameId),setTimeout(()=>{this.$emit("dragend",this.draggingEl),this.isDragging=!1,this.draggingEl=null,this.ndvStore.draggableStopDragging()},0))}}}),Tr="_dragging_bt5wj_5",Sr="_draggable_bt5wj_10",Dr={dragging:Tr,draggable:Sr,"draggable-data-transfer":"_draggable-data-transfer_bt5wj_17"};function Er(e,t,o,n,s,i){return c(),O(On(e.tag),{ref:"wrapper",class:D({[e.$style.dragging]:e.isDragging}),onMousedown:e.onDragStart},{default:w(()=>[le(e.$slots,"default",{isDragging:e.isDragging}),(c(),O(Pn,{to:"body"},[G(f("div",{ref:"draggable",class:D(e.$style.draggable),style:ee(e.draggableStyle)},[le(e.$slots,"preview",{canDrop:e.canDrop,el:e.draggingEl})],6),[[ne,e.isDragging]])]))]),_:3},40,["class","onMousedown"])}const Cr={$style:Dr},Ir=x(br,[["render",Er],["__cssModules",Cr]]),Pr=z({components:{Draggable:Ir},props:{canMoveRight:{type:Boolean},canMoveLeft:{type:Boolean}},methods:{onDrag(e){this.$emit("drag",e)},onDragStart(){this.$emit("dragstart")},onDragEnd(){this.$emit("dragend")}}}),Or="_dragContainer_4rvyw_5",$r="_dragButton_4rvyw_9",Rr="_leftArrow_4rvyw_23 _arrow_4rvyw_32",_r="_rightArrow_4rvyw_24 _arrow_4rvyw_32",Ar="_visible_4rvyw_28",Mr="_arrow_4rvyw_32",Wr="_grid_4rvyw_50",Vr={dragContainer:Or,dragButton:$r,leftArrow:Rr,rightArrow:_r,visible:Ar,arrow:Mr,grid:Wr},Br=f("div",null,[f("div"),f("div"),f("div"),f("div"),f("div")],-1),Ur=f("div",null,[f("div"),f("div"),f("div"),f("div"),f("div")],-1),Lr=[Br,Ur];function xr(e,t,o,n,s,i){const a=S("font-awesome-icon"),r=S("Draggable");return c(),O(r,{type:"panel-resize",class:D(e.$style.dragContainer),onDrag:e.onDrag,onDragstart:e.onDragStart,onDragend:e.onDragEnd},{default:w(({isDragging:l})=>[f("div",{class:D({[e.$style.dragButton]:!0})},[e.canMoveLeft?(c(),b("span",{key:0,class:D({[e.$style.leftArrow]:!0,[e.$style.visible]:l})},[y(a,{icon:"arrow-left"})],2)):E("",!0),e.canMoveRight?(c(),b("span",{key:1,class:D({[e.$style.rightArrow]:!0,[e.$style.visible]:l})},[y(a,{icon:"arrow-right"})],2)):E("",!0),f("div",{class:D(e.$style.grid)},Lr,2)],2)]),_:1},8,["class","onDrag","onDragstart","onDragend"])}const Hr={$style:Vr},Fr=x(Pr,[["render",xr],["__cssModules",Hr]]),zr=["data-node-name","data-node-placement","onClick"],Yr=z({__name:"NDVFloatingNodes",props:{rootNode:{}},emits:["switchSelectedNode"],setup(e,{expose:t,emit:o}){const n=e,s=j(),i=J(),a=s.getCurrentWorkflow(),r=o;function l(m){const C=p.value[m][0];C&&r("switchSelectedNode",C.node.name)}function d(m){if(m.shiftKey&&m.altKey&&(m.ctrlKey||m.metaKey)){const u={ArrowUp:"outputSub",ArrowRight:"outputMain",ArrowLeft:"inputMain"}[m.key]||null;u&&l(u)}}function h(m){return m.map(C=>{const u=s.getNodeByName(C);if(u){const k=i.getNodeType(u.type);if(k)return{node:u,nodeType:k}}return null}).filter(C=>C!==null)}const p=Y(()=>{const m=n.rootNode.name;return{outputSub:h(a.getChildNodes(m,"ALL_NON_MAIN")),outputMain:h(a.getChildNodes(m,"main",1)),inputMain:h(a.getParentNodes(m,"main",1))}}),g=["outputSub","outputMain","inputMain"],N={outputSub:"bottom",outputMain:"left",inputMain:"right"};return En(()=>{document.addEventListener("keydown",d,!0)}),Ui(()=>{document.removeEventListener("keydown",d,!0)}),t({moveNodeDirection:l}),(m,C)=>{const u=S("n8n-tooltip");return c(),b("aside",{class:D(m.$style.floatingNodes)},[(c(),b(Z,null,re(g,k=>f("ul",{key:k,class:D([m.$style.nodesList,m.$style[k]])},[(c(!0),b(Z,null,re(p.value[k],({node:v,nodeType:P})=>(c(),b(Z,null,[v&&P?(c(),O(u,{key:v.name,placement:N[k],teleported:!1,offset:60},{content:w(()=>[I(T(v.name),1)]),default:w(()=>[f("li",{class:D(m.$style.connectedNode),"data-test-id":"floating-node","data-node-name":v.name,"data-node-placement":k,onClick:_=>m.$emit("switchSelectedNode",v.name)},[y(tt,{"node-type":P,"node-name":v.name,"tooltip-position":N[k],size:35,circle:""},null,8,["node-type","node-name","tooltip-position"])],10,zr)]),_:2},1032,["placement"])):E("",!0)],64))),256))],2)),64))],2)}}}),Kr="_floatingNodes_htxl9_5",jr="_nodesList_htxl9_19",qr="_inputSub_htxl9_33",Gr="_outputSub_htxl9_33",Jr="_outputMain_htxl9_44",Xr="_inputMain_htxl9_44",Qr="_connectedNode_htxl9_67",Zr={floatingNodes:Kr,nodesList:jr,inputSub:qr,outputSub:Gr,outputMain:Jr,inputMain:Xr,connectedNode:Qr},el={$style:Zr},tl=x(Yr,[["__cssModules",el]]),$e=24,on=80,Ue=280,ol=320,nl=420,sl={regular:Le,dragless:Le,unknown:Le,inputless:Le,wide:Le*2},il=z({name:"NDVDraggablePanels",components:{PanelDragButton:Fr,NDVFloatingNodes:tl},props:{isDraggable:{type:Boolean},hideInputAndOutput:{type:Boolean},position:{type:Number},nodeType:{type:Object,default:()=>({})}},setup(){const{callDebounced:e}=vt();return{callDebounced:e}},data(){return{windowWidth:1,isDragging:!1,MIN_PANEL_WIDTH:Ue,initialized:!1}},mounted(){this.setTotalWidth(),this.mainPanelDimensions.relativeLeft===1&&this.mainPanelDimensions.relativeRight===1&&(this.setMainPanelWidth(),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)),this.restorePositionData()),window.addEventListener("resize",this.setTotalWidth),this.$emit("init",{position:this.mainPanelDimensions.relativeLeft}),setTimeout(()=>{this.initialized=!0},0),gt.on("setPositionByName",this.setPositionByName)},beforeUnmount(){window.removeEventListener("resize",this.setTotalWidth),gt.off("setPositionByName",this.setPositionByName)},computed:{...te(X),mainPanelDimensions(){return this.ndvStore.getMainPanelDimensions(this.currentNodePaneType)},activeNode(){return this.ndvStore.activeNode},supportedResizeDirections(){const e=["right"];return this.isDraggable&&e.push("left"),e},currentNodePaneType(){return this.hasInputSlot?this.isDraggable?this.nodeType===null?"unknown":ye(this,"nodeType.parameterPane")||"regular":"dragless":"inputless"},hasInputSlot(){return this.$slots.input!==void 0},inputPanelMargin(){return this.pxToRelativeWidth(on)},minWindowWidth(){return 2*($e+on)+Ue},minimumLeftPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.hasInputSlot?this.pxToRelativeWidth($e+20)+this.inputPanelMargin:this.pxToRelativeWidth($e)},maximumRightPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.pxToRelativeWidth($e+20)+this.inputPanelMargin},canMoveLeft(){return this.mainPanelDimensions.relativeLeft>this.minimumLeftPosition},canMoveRight(){return this.mainPanelDimensions.relativeRight>this.maximumRightPosition},mainPanelStyles(){return{left:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeLeft)}px`,right:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeRight)}px`}},inputPanelStyles(){return{right:`${this.relativeWidthToPx(this.calculatedPositions.inputPanelRelativeRight)}px`}},outputPanelStyles(){return{left:`${this.relativeWidthToPx(this.calculatedPositions.outputPanelRelativeLeft)}px`,transform:`translateX(-${this.relativeWidthToPx(this.outputPanelRelativeTranslate)}px)`}},calculatedPositions(){const e=this.$slots.input!==void 0,t=this.mainPanelDimensions.relativeLeft+this.mainPanelDimensions.relativeWidth;return{inputPanelRelativeRight:e?1-t+this.mainPanelDimensions.relativeWidth:1-this.pxToRelativeWidth($e),outputPanelRelativeLeft:t}},outputPanelRelativeTranslate(){const e=1-this.pxToRelativeWidth(Ue+$e),t=this.calculatedPositions.outputPanelRelativeLeft-e;return t>0?t:0},hasDoubleWidth(){return ye(this,"nodeType.parameterPane")==="wide"},fixedPanelWidth(){const e=this.hasDoubleWidth?2:1;return this.windowWidth>1700?nl*e:ol*e},isBelowMinWidthMainPanel(){const e=this.pxToRelativeWidth(Ue);return this.mainPanelDimensions.relativeWidth<e}},watch:{windowWidth(e){const t=this.pxToRelativeWidth(Ue);this.isBelowMinWidthMainPanel&&this.setMainPanelWidth(t);const o=this.minimumLeftPosition>this.mainPanelDimensions.relativeLeft,n=this.maximumRightPosition>this.mainPanelDimensions.relativeRight;e>this.minWindowWidth&&o&&n&&(this.setMainPanelWidth(t),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth))),this.setPositions(this.mainPanelDimensions.relativeLeft)}},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},getInitialLeftPosition(e){return this.currentNodePaneType==="dragless"?this.pxToRelativeWidth($e+1+this.fixedPanelWidth):this.hasInputSlot?.5-e/2:this.minimumLeftPosition},setMainPanelWidth(e){const t=e||this.pxToRelativeWidth(sl[this.currentNodePaneType]);this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeWidth:t}})},setPositions(e){const t=e||1-this.calculatedPositions.inputPanelRelativeRight,o=1-t-this.mainPanelDimensions.relativeWidth,n=this.maximumRightPosition>o,s=this.minimumLeftPosition>t,i=this.currentNodePaneType==="inputless";if(s){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:this.minimumLeftPosition,relativeRight:1-this.mainPanelDimensions.relativeWidth-this.minimumLeftPosition}});return}if(n){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:1-this.mainPanelDimensions.relativeWidth-this.maximumRightPosition,relativeRight:this.maximumRightPosition}});return}this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:i?this.minimumLeftPosition:t,relativeRight:o}})},setPositionByName(e){const t={minLeft:this.minimumLeftPosition,maxRight:this.maximumRightPosition,initial:this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)};this.setPositions(t[e])},pxToRelativeWidth(e){return e/this.windowWidth},relativeWidthToPx(e){return e*this.windowWidth},onResizeStart(){this.setTotalWidth()},onResizeEnd(){this.storePositionData()},onResizeDebounced(e){this.initialized&&this.callDebounced(this.onResize,{debounceTime:10,trailing:!0},e)},onResize({direction:e,x:t,width:o}){const n=this.pxToRelativeWidth(t),s=this.pxToRelativeWidth(o);e==="left"&&n<=this.minimumLeftPosition||e==="right"&&1-n<=this.maximumRightPosition||o<=Ue||(this.setMainPanelWidth(s),this.setPositions(e==="left"?n:this.mainPanelDimensions.relativeLeft))},restorePositionData(){const e=Ae(`${no}_${this.currentNodePaneType}`).value;if(e){const t=parseFloat(e);this.setMainPanelWidth(t);const o=this.getInitialLeftPosition(t);return this.setPositions(o),!0}return!1},storePositionData(){Ae(`${no}_${this.currentNodePaneType}`).value=this.mainPanelDimensions.relativeWidth.toString()},onDragStart(){this.isDragging=!0,this.$emit("dragstart",{position:this.mainPanelDimensions.relativeLeft})},onDrag(e){const t=this.pxToRelativeWidth(e.x)-this.mainPanelDimensions.relativeWidth/2;this.setPositions(t)},onDragEnd(){setTimeout(()=>{this.isDragging=!1,this.$emit("dragend",{windowWidth:this.windowWidth,position:this.mainPanelDimensions.relativeLeft})},0),this.storePositionData()},setTotalWidth(){this.windowWidth=window.innerWidth},close(){this.$emit("close")}}}),al="_dataPanel_w56ig_5",rl="_inputPanel_w56ig_14 _dataPanel_w56ig_5",ll="_outputPanel_w56ig_22 _dataPanel_w56ig_5",dl="_mainPanel_w56ig_30",ul="_draggable_w56ig_34",cl="_mainPanelInner_w56ig_38",hl="_dragging_w56ig_45",pl="_dragButtonContainer_w56ig_58",fl="_visible_w56ig_74",gl={dataPanel:al,inputPanel:rl,outputPanel:ll,mainPanel:dl,draggable:ul,mainPanelInner:cl,dragging:hl,"double-width":"_double-width_w56ig_54",dragButtonContainer:pl,visible:fl};function ml(e,t,o,n,s,i){const a=S("NDVFloatingNodes"),r=S("PanelDragButton"),l=S("n8n-resize-wrapper");return c(),b("div",null,[e.activeNode?(c(),O(a,{key:0,"root-node":e.activeNode,onSwitchSelectedNode:e.onSwitchSelectedNode},null,8,["root-node","onSwitchSelectedNode"])):E("",!0),e.hideInputAndOutput?E("",!0):(c(),b("div",{key:1,class:D(e.$style.inputPanel),style:ee(e.inputPanelStyles)},[le(e.$slots,"input")],6)),e.hideInputAndOutput?E("",!0):(c(),b("div",{key:2,class:D(e.$style.outputPanel),style:ee(e.outputPanelStyles)},[le(e.$slots,"output")],6)),f("div",{class:D(e.$style.mainPanel),style:ee(e.mainPanelStyles)},[y(l,{"is-resizing-enabled":e.currentNodePaneType!=="unknown",width:e.relativeWidthToPx(e.mainPanelDimensions.relativeWidth),"min-width":e.MIN_PANEL_WIDTH,"grid-size":20,"supported-directions":e.supportedResizeDirections,onResize:e.onResizeDebounced,onResizestart:e.onResizeStart,onResizeend:e.onResizeEnd},{default:w(()=>[f("div",{class:D(e.$style.dragButtonContainer)},[!e.hideInputAndOutput&&e.isDraggable?(c(),O(r,{key:0,class:D({[e.$style.draggable]:!0,[e.$style.visible]:e.isDragging}),"can-move-left":e.canMoveLeft,"can-move-right":e.canMoveRight,onDragstart:e.onDragStart,onDrag:e.onDrag,onDragend:e.onDragEnd},null,8,["class","can-move-left","can-move-right","onDragstart","onDrag","onDragend"])):E("",!0)],2),f("div",{class:D({[e.$style.mainPanelInner]:!0,[e.$style.dragging]:e.isDragging})},[le(e.$slots,"main")],2)]),_:3},8,["is-resizing-enabled","width","min-width","supported-directions","onResize","onResizestart","onResizeend"])],6)])}const yl={$style:gl},wl=x(il,[["render",ml],["__cssModules",yl]]),vl={allowVulnerableTags:!1,enforceHtmlBoundary:!1,disallowedTagsMode:"discard",allowedTags:[...so.defaults.allowedTags,"style","img","title"],allowedAttributes:{...so.defaults.allowedAttributes,"*":["class","style"]},transformTags:{head:""}},Nl={name:"RunDataHtml",props:{inputHtml:{type:String}},computed:{sanitizedHtml(){return Gn(this.inputHtml,vl)}}},kl=["srcdoc"];function bl(e,t,o,n,s,i){return c(),b("iframe",{class:"__html-display",srcdoc:i.sanitizedHtml},null,8,kl)}const An=x(Nl,[["render",bl]]),Tl=Object.freeze(Object.defineProperty({__proto__:null,default:An},Symbol.toStringTag,{value:"Module"})),Sl=z({name:"BinaryDataDisplayEmbed",components:{VueJsonPretty:Rn,RunDataHtml:An},props:{binaryData:{type:Object,required:!0}},data(){return{isLoading:!0,embedSource:"",error:!1,data:""}},computed:{...te(j)},async mounted(){const{id:e,data:t,fileName:o,fileType:n,mimeType:s}=this.binaryData,i=n==="json",a=n==="html";if(!e)i||a?this.data=Nt(atob(t)):this.embedSource="data:"+s+";base64,"+t;else try{const r=this.workflowsStore.getBinaryUrl(e,"view",o,s);if(i||a){const l=await fetch(r,{credentials:"include"});this.data=await(i?l.json():l.text())}else this.embedSource=r}catch{this.error=!0}this.isLoading=!1},methods:{embedClass(){const{fileType:e}=this.binaryData;return[e??"other"]}}}),Dl={key:0},El={key:1},Cl={key:2},Il={key:0,controls:"",autoplay:""},Pl=["src","type"],Ol={key:1,controls:"",autoplay:""},$l=["src","type"],Rl=["src"];function _l(e,t,o,n,s,i){const a=S("VueJsonPretty"),r=S("RunDataHtml");return c(),b("span",null,[e.isLoading?(c(),b("div",Dl,"Loading binary data...")):e.error?(c(),b("div",El,"Error loading binary data")):(c(),b("span",Cl,[e.binaryData.fileType==="video"?(c(),b("video",Il,[f("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Pl),I(" "+T(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="audio"?(c(),b("audio",Ol,[f("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,$l),I(" "+T(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="json"?(c(),O(a,{key:2,data:e.data,deep:3,"show-length":!0},null,8,["data"])):e.binaryData.fileType==="html"?(c(),O(r,{key:3,"input-html":e.data},null,8,["input-html"])):(c(),b("embed",{key:4,src:e.embedSource,class:D(["binary-data",e.embedClass()])},null,10,Rl))]))])}const Al=x(Sl,[["render",_l]]),Ml=z({name:"BinaryDataDisplay",components:{BinaryDataDisplayEmbed:Al},props:["displayData","windowVisible"],setup(){return{nodeHelpers:We()}},computed:{...te(j),binaryData(){const e=this.nodeHelpers.getBinaryData(this.workflowRunData,this.displayData.node,this.displayData.runIndex,this.displayData.outputIndex);return e.length===0||this.displayData.index>=e.length||e[this.displayData.index][this.displayData.key]===void 0?null:e[this.displayData.index][this.displayData.key]},workflowRunData(){const e=this.workflowsStore.getWorkflowExecution;if(e===null)return null;const t=e.data;return t?t.resultData.runData:null}},methods:{closeWindow(){return this.$emit("close"),!1}}}),Wl={class:"binary-data-window-wrapper"},Vl={key:0};function Bl(e,t,o,n,s,i){var l;const a=S("n8n-button"),r=S("BinaryDataDisplayEmbed");return e.windowVisible?(c(),b("div",{key:0,class:D(["binary-data-window",(l=e.binaryData)==null?void 0:l.fileType])},[y(a,{size:"small",class:"binary-data-window-back",title:e.$locale.baseText("binaryDataDisplay.backToOverviewPage"),icon:"arrow-left",label:e.$locale.baseText("binaryDataDisplay.backToList"),onClick:se(e.closeWindow,["stop"])},null,8,["title","label","onClick"]),f("div",Wl,[e.binaryData?(c(),O(r,{key:1,"binary-data":e.binaryData},null,8,["binary-data"])):(c(),b("div",Vl,T(e.$locale.baseText("binaryDataDisplay.noDataFoundToDisplay")),1))])],2)):E("",!0)}const Ul=x(Ml,[["render",Bl]]),Ll=z({name:"NodeErrorView",components:{VueJsonPretty:Rn},props:["error"],setup(){return{clipboard:qt(),...ze()}},computed:{...te(J,X),displayCause(){return JSON.stringify(this.error.cause).length<gn},parameters(){const e=this.ndvStore.activeNode;if(!e)return[];const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion);return t===null?[]:t.properties}},methods:{replacePlaceholders(e,t){const o=this.parameterDisplayName(e,!1),n=this.parameterDisplayName(e,!0);return t.replace(/%%PARAMETER%%/g,o).replace(/%%PARAMETER_FULL%%/g,n)},getErrorDescription(){var o;if(this.error.name==="NodeOperationError"&&this.error.functionality==="configuration-node")return St(this.error.description+this.$locale.baseText("pushConnection.executionError.openNode",{interpolate:{node:this.error.node.name}}));if(!((o=this.error.context)!=null&&o.descriptionTemplate))return St(this.error.description);const t=this.parameterDisplayName(this.error.context.parameter);return St(this.error.context.descriptionTemplate.replace(/%%PARAMETER%%/g,t))},getErrorMessage(){var n;const e=this.$locale.baseText("nodeErrorView.error")+": ";if(this.error.name==="NodeOperationError"&&this.error.functionality==="configuration-node")return this.$locale.baseText("nodeErrorView.errorSubNode",{interpolate:{node:this.error.node.name}});if(this.error.message===this.error.description)return e;if(!((n=this.error.context)!=null&&n.messageTemplate))return e+this.error.message;const o=this.parameterDisplayName(this.error.context.parameter);return e+this.error.context.messageTemplate.replace(/%%PARAMETER%%/g,o)},parameterDisplayName(e,t=!0){try{const o=this.parameterName(this.parameters,e.split("."));if(!o.length)throw new Error;return t?o.map(n=>n.displayName).join(" > "):o.pop().displayName}catch{return`Could not find parameter "${e}"`}},parameterName(e,t){let o=t.shift();if(o===void 0)return[];const n=o.match(/(.*)\[([\d])\]$/);n!==null&&n.length>0&&(o=n[1]);const s=e.find(i=>i.name===o);if(s===void 0)throw new Error(`Could not find parameter "${o}"`);return t.length===0?[s]:s.hasOwnProperty("options")?[s,...this.parameterName(s.options,t)]:s.hasOwnProperty("values")?[s,...this.parameterName(s.values,t)]:[s]},copyCause(){this.clipboard.copy(JSON.stringify(this.error.cause)),this.copySuccess()},copySuccess(){this.showMessage({title:this.$locale.baseText("nodeErrorView.showMessage.title"),type:"info"})}}}),xl={class:"error-header"},Hl=["textContent"],Fl=["innerHTML"],zl={class:"error-details__summary"},Yl={class:"error-details__content"},Kl={key:0},jl={key:1},ql={class:"clearfix box-card__title"},Gl={key:2,class:"el-card box-card is-never-shadow el-card__body"},Jl={class:"error-details__summary"},Xl={key:0},Ql={class:"error-details__summary"},Zl={key:1},ed={class:"error-details__summary"},td={key:3},od={class:"clearfix box-card__title"},nd={key:4},sd={class:"clearfix box-card__title"},id=f("br",null,null,-1),ad={class:"box-card__subtitle"},rd={key:0,class:"copy-button"},ld={key:2},dd={key:5},ud={class:"clearfix box-card__title"};function cd(e,t,o,n,s,i){const a=S("font-awesome-icon"),r=S("el-card"),l=S("n8n-icon-button"),d=S("VueJsonPretty");return c(),b("div",null,[f("div",xl,[f("div",{class:"error-message",textContent:T(e.getErrorMessage())},null,8,Hl),e.error.description?(c(),b("div",{key:0,class:"error-description",innerHTML:e.getErrorDescription()},null,8,Fl)):E("",!0)]),f("details",null,[f("summary",zl,[y(a,{class:"error-details__icon",icon:"angle-right"}),I(" "+T(e.$locale.baseText("nodeErrorView.details")),1)]),f("div",Yl,[e.error.context&&e.error.context.causeDetailed?(c(),b("div",Kl,[y(r,{class:"box-card",shadow:"never"},{default:w(()=>[f("div",null,T(e.error.context.causeDetailed),1)]),_:1})])):E("",!0),e.error.timestamp?(c(),b("div",jl,[y(r,{class:"box-card",shadow:"never"},{header:w(()=>[f("div",ql,[f("span",null,T(e.$locale.baseText("nodeErrorView.time")),1)])]),default:w(()=>[f("div",null,T(new Date(e.error.timestamp).toLocaleString()),1)]),_:1})])):E("",!0),e.error.context&&e.error.context.itemIndex!==void 0?(c(),b("div",Gl,[f("span",Jl,T(e.$locale.baseText("nodeErrorView.itemIndex"))+":",1),I(" "+T(e.error.context.itemIndex)+" ",1),e.error.context.runIndex?(c(),b("span",Xl,[I(" | "),f("span",Ql,T(e.$locale.baseText("nodeErrorView.itemIndex"))+":",1),I(" "+T(e.error.context.runIndex),1)])):E("",!0),e.error.context.parameter?(c(),b("span",Zl,[I(" | "),f("span",ed,T(e.$locale.baseText("nodeErrorView.inParameter"))+":",1),I(" "+T(e.parameterDisplayName(e.error.context.parameter)),1)])):E("",!0)])):E("",!0),e.error.httpCode?(c(),b("div",td,[y(r,{class:"box-card",shadow:"never"},{header:w(()=>[f("div",od,[f("span",null,T(e.$locale.baseText("nodeErrorView.httpCode")),1)])]),default:w(()=>[f("div",null,T(e.error.httpCode),1)]),_:1})])):E("",!0),e.error.cause?(c(),b("div",nd,[y(r,{class:"box-card",shadow:"never"},{header:w(()=>[f("div",sd,[f("span",null,T(e.$locale.baseText("nodeErrorView.cause")),1),id,f("span",ad,T(e.$locale.baseText("nodeErrorView.dataBelowMayContain")),1)])]),default:w(()=>[f("div",null,[e.displayCause?(c(),b("div",rd,[y(l,{title:e.$locale.baseText("nodeErrorView.copyToClipboard"),icon:"copy",onClick:e.copyCause},null,8,["title","onClick"])])):E("",!0),e.displayCause?(c(),O(d,{key:1,data:e.error.cause,deep:3,"show-length":!0,"selectable-type":"single",path:"error",class:"json-data"},null,8,["data"])):(c(),b("span",ld,[y(a,{icon:"info-circle"}),I(T(e.$locale.baseText("nodeErrorView.theErrorCauseIsTooLargeToBeDisplayed")),1)]))])]),_:1})])):E("",!0),e.error.stack?(c(),b("div",dd,[y(r,{class:"box-card",shadow:"never"},{header:w(()=>[f("div",ud,[f("span",null,T(e.$locale.baseText("nodeErrorView.stack")),1)])]),default:w(()=>[f("div",null,[f("pre",null,[f("code",null,T(e.error.stack),1)])])]),_:1})])):E("",!0)])])])}const hd=x(Ll,[["render",cd]]),pd={key:0},fd={key:1},gd={key:2},md=z({__name:"RunDataPinButton",props:{tooltipContentsVisibility:{},dataPinningDocsUrl:{},pinnedData:{},disabled:{type:Boolean}},emits:["togglePinData"],setup(e,{emit:t}){const o=Ne(),n=e,s=t,i=Y(()=>n.tooltipContentsVisibility.pinDataDiscoveryTooltipContent?!0:void 0);return(a,r)=>{const l=S("n8n-link"),d=S("n8n-text"),h=S("n8n-icon-button"),p=S("n8n-tooltip");return c(),O(p,{placement:"bottom-end",visible:i.value},{content:w(()=>[n.tooltipContentsVisibility.binaryDataTooltipContent?(c(),b("div",pd,T(L(o).baseText("ndv.pinData.pin.binary")),1)):n.tooltipContentsVisibility.pinDataDiscoveryTooltipContent?(c(),b("div",fd,T(L(o).baseText("node.discovery.pinData.ndv")),1)):(c(),b("div",gd,[f("strong",null,T(L(o).baseText("ndv.pinData.pin.title")),1),y(d,{size:"small",tag:"p"},{default:w(()=>[I(T(L(o).baseText("ndv.pinData.pin.description"))+" ",1),y(l,{to:n.dataPinningDocsUrl,size:"small"},{default:w(()=>[I(T(L(o).baseText("ndv.pinData.pin.link")),1)]),_:1},8,["to"])]),_:1})]))]),default:w(()=>[y(h,{class:D(a.$style.pinDataButton),type:"tertiary",active:n.pinnedData.hasData.value,icon:"thumbtack",disabled:n.disabled,"data-test-id":"ndv-pin-data",onClick:r[0]||(r[0]=g=>s("togglePinData"))},null,8,["class","active","disabled"])]),_:1},8,["visible"])}}}),yd="_pinDataButton_fzux8_5",wd={pinDataButton:yd},vd={$style:wd},Nd=x(md,[["__cssModules",vd]]),kd=Ie(async()=>await Ce(()=>import("./RunDataTable-th0cgEkH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]))),bd=Ie(async()=>await Ce(()=>import("./RunDataJson-hLAWizOD.js"),__vite__mapDeps([42,2,3,4,5,6,7,8,1,9,10,11,12,13,35,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,36,37,38,39,40,43]))),Td=Ie(async()=>await Ce(()=>import("./RunDataSchema-ZI0MG5I5.js"),__vite__mapDeps([44,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,14,15,33,34,35,36,37,38,39,40,45]))),Sd=Ie(async()=>await Ce(()=>Promise.resolve().then(()=>Tl),void 0)),Dd=Ie(async()=>await Ce(()=>import("./RunDataSearch-LSCwcEYy.js"),__vite__mapDeps([46,2,3,4,5,6,7,8,1,9,10,11,12,13,47]))),Ed=z({name:"RunData",components:{BinaryDataDisplay:Ul,NodeErrorView:hd,JsonEditor:oi,RunDataTable:kd,RunDataJson:bd,RunDataSchema:Td,RunDataHtml:Sd,RunDataSearch:Dd,RunDataPinButton:Nd},props:{node:{type:Object,default:null},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},tooMuchDataTitle:{type:String},noDataInBranchMessage:{type:String},isExecuting:{type:Boolean},executingMessage:{type:String},sessionId:{type:String},paneType:{type:String,required:!0},overrideOutputs:{type:Array},mappingEnabled:{type:Boolean},distanceFromActive:{type:Number},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(e){const t=X(),o=We(),n=Ee(),s=Li(e,"node"),i=Se(s,{runIndex:e.runIndex,displayMode:t.getPanelDisplayMode(e.paneType)});return{...ze(),externalHooks:n,nodeHelpers:o,pinnedData:i}},data(){return{connectionType:M.Main,binaryDataPreviewActive:!1,dataSize:0,showData:!1,outputIndex:0,binaryDataDisplayVisible:!1,binaryDataDisplayData:null,MAX_DISPLAY_DATA_SIZE:gn,MAX_DISPLAY_ITEMS_AUTO_ALL:Jn,currentPage:1,pageSize:10,pageSizes:[10,25,50,100],pinDataDiscoveryTooltipVisible:!1,isControlledPinDataTooltip:!1,search:""}},mounted(){var e,t,o;if(this.init(),this.isPaneTypeInput||this.showPinDataDiscoveryTooltip(this.jsonData),this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:this.currentOutputIndex}),this.paneType==="output"&&(this.setDisplayMode(),this.activatePane()),this.hasRunError){const n=(o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])==null?void 0:o.error;n&&["unknown error"].some(i=>n.message.toLowerCase().includes(i))&&this.$telemetry.track(`User encountered an error: "${n.message}"`,{node:this.node.type,errorMessage:n.message,nodeVersion:this.node.typeVersion,n8nVersion:this.rootStore.versionCli},{withPostHog:!0})}},beforeUnmount(){this.hidePinDataDiscoveryTooltip()},computed:{...te(J,X,j,Kt,xt),isReadOnlyRoute(){var e,t;return((t=(e=this.$route)==null?void 0:e.meta)==null?void 0:t.readOnlyCanvas)===!0},activeNode(){return this.ndvStore.activeNode},dataPinningDocsUrl(){return Xn},dataEditingDocsUrl(){return Qn},displayMode(){return this.ndvStore.getPanelDisplayMode(this.paneType)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isSchemaView(){return this.displayMode==="schema"},isTriggerNode(){return this.node===null?!1:this.nodeTypesStore.isTriggerNode(this.node.type)},canPinData(){if(this.node===null)return!1;const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=fe(e,t,this.nodeType);return!!!ge(o).find(i=>i!==M.Main)&&!this.isPaneTypeInput&&this.pinnedData.isValidNodeType.value&&!(this.binaryData&&this.binaryData.length>0)},buttons(){var o;const e=[{label:this.$locale.baseText("runData.table"),value:"table"},{label:this.$locale.baseText("runData.json"),value:"json"}];this.binaryData.length&&e.push({label:this.$locale.baseText("runData.binary"),value:"binary"});const t={label:this.$locale.baseText("runData.schema"),value:"schema"};return this.isPaneTypeInput&&!io(this.jsonData)?e.unshift(t):e.push(t),this.isPaneTypeOutput&&((o=this.activeNode)==null?void 0:o.type)===At&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&e.unshift({label:"HTML",value:"html"}),e},hasNodeRun(){return!!(!this.isExecuting&&this.node&&(this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name)||this.pinnedData.hasData.value))},isArtificialRecoveredEventItem(){var e,t,o;return!!((o=(t=(e=this.rawInputData)==null?void 0:e[0])==null?void 0:t.json)!=null&&o.isArtificialRecoveredEventItem)},subworkflowExecutionError(){return this.workflowsStore.subWorkflowExecutionError},hasSubworkflowExecutionError(){return!!this.subworkflowExecutionError},hasRunError(){var e,t,o;return!!(this.node&&((o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])!=null&&o.error))},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},dataCount(){return this.getDataCount(this.runIndex,this.currentOutputIndex)},unfilteredDataCount(){return this.pinnedData.data.value?this.pinnedData.data.value.length:this.rawInputData.length},dataSizeInMB(){return(this.dataSize/1024/1e3).toLocaleString()},maxOutputIndex(){if(this.node===null||this.runIndex===void 0)return 0;const e=this.workflowRunData;if(e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<this.runIndex)return 0;if(e[this.node.name][this.runIndex]){const t=e[this.node.name][this.runIndex].data;if(t!=null&&t.main)return t.main.length-1}return 0},currentPageOffset(){return this.pageSize*(this.currentPage-1)},maxRunIndex(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length-1:0},rawInputData(){return this.getRawInputData(this.runIndex,this.currentOutputIndex,this.connectionType)},inputData(){const e=this.getPinDataOrLiveData(this.rawInputData);return this.getFilteredData(e)},inputDataPage(){const e=this.pageSize*(this.currentPage-1);return this.inputData.slice(e,e+this.pageSize)},jsonData(){return ao(this.inputData)},binaryData(){return this.node?this.nodeHelpers.getBinaryData(this.workflowRunData,this.node.name,this.runIndex,this.currentOutputIndex).filter(t=>!!(t&&Object.keys(t).length)):[]},currentOutputIndex(){var e;return(e=this.overrideOutputs)!=null&&e.length&&!this.overrideOutputs.includes(this.outputIndex)?this.overrideOutputs[0]:this.outputIndex},branches(){var o;const e=n=>n.charAt(0).toLocaleUpperCase()+n.slice(1),t=[];for(let n=0;n<=this.maxOutputIndex;n++){if(this.overrideOutputs&&!this.overrideOutputs.includes(n))continue;const s=this.getRawInputData(this.runIndex,n).length,i=this.getDataCount(this.runIndex,n),a=this.search?this.$locale.baseText("ndv.search.items",{adjustToNumber:s,interpolate:{matched:i,total:s}}):this.$locale.baseText("ndv.output.items",{adjustToNumber:i,interpolate:{count:i}});let r=this.getOutputName(n);if(`${r}`==`${n}`)r=`${this.$locale.baseText("ndv.output")} ${r}`;else{const l=Zn.includes((o=this.node)==null?void 0:o.type)?"":` ${this.$locale.baseText("ndv.output.branch")}`;r=e(`${this.getOutputName(n)}${l}`)}t.push({label:this.search&&i||s?`${r} (${a})`:r,value:n})}return t},editMode(){return this.isPaneTypeInput?{enabled:!1,value:""}:this.ndvStore.outputPanelEditMode},isPaneTypeInput(){return this.paneType==="input"},isPaneTypeOutput(){return this.paneType==="output"},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},showIOSearch(){return this.hasNodeRun&&!this.hasRunError},showIoSearchNoMatchContent(){return this.hasNodeRun&&!this.inputData.length&&this.search}},methods:{getResolvedNodeOutputs(){if(this.node&&this.nodeType){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name);if(t)return Te(e,t,this.nodeType)}return[]},onItemHover(e){if(e===null){this.$emit("itemHover",null);return}this.$emit("itemHover",{outputIndex:this.currentOutputIndex,itemIndex:e})},onClickDataPinningDocsLink(){var e;this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:(e=this.activeNode)==null?void 0:e.type,pane:"output",type:"data-pinning-docs"})},showPinDataDiscoveryTooltip(e){if(!this.isTriggerNode)return;const t=Ae(lo).value;e&&e.length>0&&!this.isReadOnlyRoute&&!t&&(this.pinDataDiscoveryComplete(),setTimeout(()=>{this.isControlledPinDataTooltip=!0,this.pinDataDiscoveryTooltipVisible=!0,ke.emit("data-pinning-discovery",{isTooltipVisible:!0})},500))},hidePinDataDiscoveryTooltip(){this.pinDataDiscoveryTooltipVisible&&(this.isControlledPinDataTooltip=!1,this.pinDataDiscoveryTooltipVisible=!1,ke.emit("data-pinning-discovery",{isTooltipVisible:!1}))},pinDataDiscoveryComplete(){Ae(lo).value="true",Ae(Mt).value="true"},enterEditMode({origin:e}){var n;const t=this.pinnedData.data.value?ro(this.pinnedData.data.value):ao(this.rawInputData),o=t.length>0?t:es;this.ndvStore.setOutputPanelEditModeEnabled(!0),this.ndvStore.setOutputPanelEditModeValue(JSON.stringify(o,null,2)),this.$telemetry.track("User opened ndv edit state",{node_type:(n=this.activeNode)==null?void 0:n.type,click_type:e==="editIconButton"?"button":"link",session_id:this.sessionId,run_index:this.runIndex,is_output_present:this.hasNodeRun||this.pinnedData.hasData.value,view:!this.hasNodeRun&&!this.pinnedData.hasData.value?"undefined":this.displayMode,is_data_pinned:this.pinnedData.hasData.value})},onClickCancelEdit(){this.ndvStore.setOutputPanelEditModeEnabled(!1),this.ndvStore.setOutputPanelEditModeValue(""),this.onExitEditMode({type:"cancel"})},onClickSaveEdit(){if(!this.node)return;const{value:e}=this.editMode;this.clearAllStickyNotifications();try{this.pinnedData.setData(ro(e),"save-edit")}catch(t){console.error(t);return}this.ndvStore.setOutputPanelEditModeEnabled(!1),this.onExitEditMode({type:"save"})},onExitEditMode({type:e}){var t;this.$telemetry.track("User closed ndv edit state",{node_type:(t=this.activeNode)==null?void 0:t.type,session_id:this.sessionId,run_index:this.runIndex,view:this.displayMode,type:e})},async onTogglePinData({source:e}){if(this.node){if(e==="pin-icon-click"){const t={node_type:this.activeNode.type,session_id:this.sessionId,run_index:this.runIndex,view:!this.hasNodeRun&&!this.pinnedData.hasData.value?"none":this.displayMode};this.externalHooks.run("runData.onTogglePinData",t),this.$telemetry.track("User clicked pin data icon",t)}if(this.nodeHelpers.updateNodeParameterIssues(this.node),this.pinnedData.hasData.value){this.pinnedData.unsetData(e);return}try{this.pinnedData.setData(this.rawInputData,"pin-icon-click")}catch(t){console.error(t);return}this.maxRunIndex>0&&this.showToast({title:this.$locale.baseText("ndv.pinData.pin.multipleRuns.title",{interpolate:{index:`${this.runIndex}`}}),message:this.$locale.baseText("ndv.pinData.pin.multipleRuns.description"),type:"success",duration:2e3}),this.hidePinDataDiscoveryTooltip(),this.pinDataDiscoveryComplete()}},switchToBinary(){this.onDisplayModeChange("binary")},onBranchChange(e){this.outputIndex=e,this.$telemetry.track("User changed ndv branch",{session_id:this.sessionId,branch_index:e,node_type:this.activeNode.type,node_type_input_selection:this.nodeType?this.nodeType.name:"",pane:this.paneType})},showTooMuchData(){this.showData=!0,this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,type:"showTooMuchData"})},toggleLinkRuns(){this.linkedRuns?this.unlinkRun():this.linkRun()},linkRun(){this.$emit("linkRun")},unlinkRun(){this.$emit("unlinkRun")},onCurrentPageChange(e){var t;this.currentPage=e,this.$telemetry.track("User changed ndv page",{node_type:(t=this.activeNode)==null?void 0:t.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onPageSizeChange(e){var o;this.pageSize=e;const t=Math.ceil(this.dataCount/this.pageSize);t<this.currentPage&&(this.currentPage=t),this.$telemetry.track("User changed ndv page size",{node_type:(o=this.activeNode)==null?void 0:o.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onDisplayModeChange(e){const t=this.displayMode;this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:e});const o=this.$refs.dataContainer;if(o){const n=o.children[0];n&&n.scrollTo(0,0)}this.closeBinaryDataDisplay(),this.externalHooks.run("runData.displayModeChanged",{newValue:e,oldValue:t}),this.activeNode&&this.$telemetry.track("User changed ndv item view",{previous_view:t,new_view:e,node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType})},getRunLabel(e){let t=0;for(let s=0;s<=this.maxOutputIndex;s++)t+=this.getPinDataOrLiveData(this.getRawInputData(e-1,s)).length;const o=this.$locale.baseText("ndv.output.items",{adjustToNumber:t,interpolate:{count:t}}),n=t>0?` (${o})`:"";return e+this.$locale.baseText("ndv.output.of")+(this.maxRunIndex+1)+n},getRawInputData(e,t,o=M.Main){let n=[];return this.node&&(n=this.nodeHelpers.getNodeInputData(this.node,e,t,this.paneType,o)),n.length===0||!Array.isArray(n)?[]:n},getPinDataOrLiveData(e){return this.pinnedData.data.value&&!this.isProductionExecutionPreview?Array.isArray(this.pinnedData.data.value)?this.pinnedData.data.value.map(t=>({json:t})):[{json:this.pinnedData.data.value}]:e},getFilteredData(e){return this.search?(this.currentPage=1,e.filter(({json:t})=>ts(t,this.search))):e},getDataCount(e,t,o=M.Main){var i,a,r;if(!this.node)return 0;if((r=(a=(i=this.workflowRunData)==null?void 0:i[this.node.name])==null?void 0:a[e])!=null&&r.hasOwnProperty("error"))return 1;const n=this.getRawInputData(e,t,o),s=this.getPinDataOrLiveData(n);return this.getFilteredData(s).length},init(){this.outputIndex=0,this.refreshDataSize(),this.closeBinaryDataDisplay();let e=[];if(this.nodeType!==null&&this.node!==null){const t=this.getResolvedNodeOutputs();e=ge(t)}this.connectionType=e.length===0?M.Main:e[0],this.binaryData.length>0?this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"binary"}):this.displayMode==="binary"&&this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"table"})},closeBinaryDataDisplay(){this.binaryDataDisplayVisible=!1,this.binaryDataDisplayData=null},clearExecutionData(){this.workflowsStore.setWorkflowExecutionData(null),this.nodeHelpers.updateNodesExecutionIssues()},isViewable(e,t){const{fileType:o}=this.binaryData[e][t];return!!o&&["image","audio","video","text","json","pdf","html"].includes(o)},isDownloadable(e,t){const{mimeType:o,fileName:n}=this.binaryData[e][t];return!!(o&&n)},async downloadBinaryData(e,t){const{id:o,data:n,fileName:s,fileExtension:i,mimeType:a}=this.binaryData[e][t];if(o){const r=this.workflowsStore.getBinaryUrl(o,"download",s,a);$t.saveAs(r,[s,i].join("."));return}else{const r="data:"+a+";base64,"+n,l=await fetch(r).then(async d=>await d.blob());$t.saveAs(l,s)}},async downloadJsonData(){const e=this.node.name.replace(/[^\w\d]/g,"_"),t=new Blob([JSON.stringify(this.rawInputData,null,2)],{type:"application/json"});$t.saveAs(t,`${e}.json`)},displayBinaryData(e,t){this.binaryDataDisplayVisible=!0,this.binaryDataDisplayData={node:this.node.name,runIndex:this.runIndex,outputIndex:this.currentOutputIndex,index:e,key:t}},getOutputName(e){if(this.node===null)return e+1;const t=this.nodeType,o=this.getResolvedNodeOutputs(),n=o==null?void 0:o[e];return n&&zi(n)?n==null?void 0:n.displayName:!(t!=null&&t.outputNames)||t.outputNames.length<=e?e+1:t.outputNames[e]},refreshDataSize(){this.showData=!1;const e=this.inputDataPage.map(t=>t.json);this.dataSize=JSON.stringify(e).length,this.dataSize<this.MAX_DISPLAY_DATA_SIZE&&(this.showData=!0)},onRunIndexChange(e){this.$emit("runChange",e)},enableNode(){if(this.node){const e={name:this.node.name,properties:{disabled:!this.node.disabled}};this.workflowsStore.updateNodeProperties(e)}},setDisplayMode(){if(!this.activeNode)return;this.activeNode.type===At&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&this.ndvStore.setPanelDisplayMode({pane:"output",mode:"html"})},activatePane(){this.$emit("activatePane")},onSearchClear(){this.search="",document.dispatchEvent(new KeyboardEvent("keyup",{key:"/"}))}},watch:{node(e,t){e.id!==t.id&&this.init()},hasNodeRun(){this.paneType==="output"&&this.setDisplayMode()},inputDataPage:{handler(e){this.paneType&&e&&this.ndvStore.setNDVPanelDataIsEmpty({panel:this.paneType,isEmpty:e.every(t=>io(t.json))})},immediate:!0,deep:!0},jsonData(e,t){Yi(e,t)||(this.refreshDataSize(),this.showPinDataDiscoveryTooltip(e))},binaryData(e,t){e.length&&!t.length&&this.displayMode!=="binary"?this.switchToBinary():!e.length&&this.displayMode==="binary"&&this.onDisplayModeChange("table")},currentOutputIndex(e){this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:e})},search(e){this.$emit("search",e)}}}),Cd="_infoIcon_1s3ok_5",Id="_center_1s3ok_9",Pd="_container_1s3ok_23",Od="_pinnedDataCallout_1s3ok_32",$d="_header_1s3ok_40",Rd="_dataContainer_1s3ok_54",_d="_dataDisplay_1s3ok_63",Ad="_tabs_1s3ok_75",Md="_itemsCount_1s3ok_82",Wd="_runSelector_1s3ok_90",Vd="_runSelectorWrapper_1s3ok_99",Bd="_pagination_1s3ok_104",Ud="_pageSizeSelector_1s3ok_114",Ld="_binaryIndex_1s3ok_120",xd="_binaryRow_1s3ok_137",Hd="_binaryCell_1s3ok_142",Fd="_binaryHeader_1s3ok_154",zd="_binaryButtonContainer_1s3ok_163",Yd="_binaryValue_1s3ok_174",Kd="_displayModes_1s3ok_179",jd="_tooltipContain_1s3ok_185",qd="_spinner_1s3ok_189",Gd="_editMode_1s3ok_200",Jd="_editModeBody_1s3ok_209",Xd="_editModeFooter_1s3ok_216",Qd="_editModeFooterInfotip_1s3ok_226",Zd="_editModeActions_1s3ok_232",eu="_stretchVertically_1s3ok_239",tu="_uiBlocker_1s3ok_243",ou={infoIcon:Cd,center:Id,container:Pd,pinnedDataCallout:Od,header:$d,dataContainer:Rd,"actions-group":"_actions-group_1s3ok_59",dataDisplay:_d,tabs:Ad,itemsCount:Md,runSelector:Wd,runSelectorWrapper:Vd,pagination:Bd,pageSizeSelector:Ud,binaryIndex:Ld,binaryRow:xd,binaryCell:Hd,binaryHeader:Fd,binaryButtonContainer:zd,binaryValue:Yd,displayModes:Kd,tooltipContain:jd,spinner:qd,editMode:Gd,editModeBody:Jd,editModeFooter:Xd,editModeFooterInfotip:Qd,editModeActions:Zd,stretchVertically:eu,uiBlocker:tu},nu={key:0,class:"ml-4xs"},su={key:0},iu=["innerHTML"],au=["data-test-id"],ru={key:0},lu={key:1},du={key:2},uu={key:3},cu={key:4};function hu(e,t,o,n,s,i){var Q,ve,Pe;const a=S("n8n-link"),r=S("n8n-callout"),l=S("BinaryDataDisplay"),d=S("n8n-radio-buttons"),h=S("n8n-icon-button"),p=S("RunDataPinButton"),g=S("n8n-button"),N=S("n8n-option"),m=S("n8n-select"),C=S("n8n-tooltip"),u=S("RunDataSearch"),k=S("n8n-tabs"),v=S("n8n-text"),P=S("n8n-spinner"),_=S("JsonEditor"),R=S("n8n-info-tip"),A=S("NodeErrorView"),$=S("i18n-t"),B=S("RunDataTable"),U=S("RunDataJson"),oe=S("RunDataHtml"),pe=S("RunDataSchema"),V=S("el-pagination"),H=S("n8n-block-ui");return c(),b("div",{class:D(["run-data",e.$style.container]),onMouseover:t[14]||(t[14]=(...W)=>e.activatePane&&e.activatePane(...W))},[e.canPinData&&e.pinnedData.hasData.value&&!e.editMode.enabled&&!e.isProductionExecutionPreview?(c(),O(r,{key:0,theme:"secondary",icon:"thumbtack",class:D(e.$style.pinnedDataCallout)},{trailingContent:w(()=>[y(a,{to:e.dataPinningDocsUrl,size:"small",theme:"secondary",bold:"",underline:"",onClick:e.onClickDataPinningDocsLink},{default:w(()=>[I(T(e.$locale.baseText("runData.pindata.learnMore")),1)]),_:1},8,["to","onClick"])]),default:w(()=>[I(T(e.$locale.baseText("runData.pindata.thisDataIsPinned"))+" ",1),!e.isReadOnlyRoute&&!e.readOnlyEnv?(c(),b("span",nu,[y(a,{theme:"secondary",size:"small",underline:"",bold:"",onClick:t[0]||(t[0]=se(W=>e.onTogglePinData({source:"banner-link"}),["stop"]))},{default:w(()=>[I(T(e.$locale.baseText("runData.pindata.unpin")),1)]),_:1})])):E("",!0)]),_:1},8,["class"])):E("",!0),y(l,{"window-visible":e.binaryDataDisplayVisible,"display-data":e.binaryDataDisplayData,onClose:e.closeBinaryDataDisplay},null,8,["window-visible","display-data","onClose"]),f("div",{class:D(e.$style.header)},[le(e.$slots,"header",{},void 0,!0),G(f("div",{class:D(e.$style.displayModes),"data-test-id":"run-data-pane-header",onClick:t[3]||(t[3]=se(()=>{},["stop"]))},[G(y(d,{"model-value":e.displayMode,options:e.buttons,"data-test-id":"ndv-run-data-display-mode","onUpdate:modelValue":e.onDisplayModeChange},null,8,["model-value","options","onUpdate:modelValue"]),[[ne,e.hasNodeRun&&(e.inputData.length||e.binaryData.length||e.search)&&!e.editMode.enabled]]),e.canPinData&&!e.isReadOnlyRoute&&!e.readOnlyEnv?G((c(),O(h,{key:0,title:e.$locale.baseText("runData.editOutput"),circle:!1,disabled:e.node.disabled,class:"ml-2xs",icon:"pencil-alt",type:"tertiary","data-test-id":"ndv-edit-pinned-data",onClick:t[1]||(t[1]=W=>e.enterEditMode({origin:"editIconButton"}))},null,8,["title","disabled"])),[[ne,!e.editMode.enabled]]):E("",!0),(e.canPinData||(Q=e.binaryData)!=null&&Q.length)&&e.rawInputData.length&&!e.editMode.enabled?(c(),O(p,{key:1,disabled:!e.rawInputData.length&&!e.pinnedData.hasData.value||e.isReadOnlyRoute||e.readOnlyEnv||!!((ve=e.binaryData)!=null&&ve.length),"tooltip-contents-visibility":{binaryDataTooltipContent:!!((Pe=e.binaryData)!=null&&Pe.length),pinDataDiscoveryTooltipContent:e.isControlledPinDataTooltip&&e.pinDataDiscoveryTooltipVisible},"data-pinning-docs-url":e.dataPinningDocsUrl,"pinned-data":e.pinnedData,onTogglePinData:t[2]||(t[2]=W=>e.onTogglePinData({source:"pin-icon-click"}))},null,8,["disabled","tooltip-contents-visibility","data-pinning-docs-url","pinned-data"])):E("",!0),G(f("div",{class:D(e.$style.editModeActions)},[y(g,{type:"tertiary",label:e.$locale.baseText("runData.editor.cancel"),onClick:e.onClickCancelEdit},null,8,["label","onClick"]),y(g,{class:"ml-2xs",type:"primary",label:e.$locale.baseText("runData.editor.save"),onClick:e.onClickSaveEdit},null,8,["label","onClick"])],2),[[ne,e.editMode.enabled]])],2),[[ne,!e.hasRunError]])],2),e.maxRunIndex>0?G((c(),b("div",{key:1,class:D(e.$style.runSelector),"data-test-id":"run-selector"},[f("div",{class:D(e.$style.runSelectorWrapper)},[y(m,{size:"small","model-value":e.runIndex,teleported:"","onUpdate:modelValue":e.onRunIndexChange,onClick:t[4]||(t[4]=se(()=>{},["stop"]))},{prepend:w(()=>[I(T(e.$locale.baseText("ndv.output.run")),1)]),default:w(()=>[(c(!0),b(Z,null,re(e.maxRunIndex+1,W=>(c(),O(N,{key:W,label:e.getRunLabel(W),value:W-1},null,8,["label","value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"]),e.canLinkRuns?(c(),O(C,{key:0,placement:"right"},{content:w(()=>[I(T(e.$locale.baseText(e.linkedRuns?"runData.unlinking.hint":"runData.linking.hint")),1)]),default:w(()=>[y(h,{class:"linkRun",icon:e.linkedRuns?"unlink":"link",text:"",type:"tertiary",size:"small",onClick:e.toggleLinkRuns},null,8,["icon","onClick"])]),_:1})):E("",!0),le(e.$slots,"run-info",{},void 0,!0)],2),e.showIOSearch?(c(),O(u,{key:0,modelValue:e.search,"onUpdate:modelValue":t[5]||(t[5]=W=>e.search=W),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)),[[ne,!e.editMode.enabled]]):E("",!0),le(e.$slots,"before-data",{},void 0,!0),e.maxOutputIndex>0&&e.branches.length>1?(c(),b("div",{key:2,class:D(e.$style.tabs),"data-test-id":"branches"},[y(k,{"model-value":e.currentOutputIndex,options:e.branches,"onUpdate:modelValue":e.onBranchChange},null,8,["model-value","options","onUpdate:modelValue"]),e.showIOSearch?(c(),O(u,{key:0,modelValue:e.search,"onUpdate:modelValue":t[6]||(t[6]=W=>e.search=W),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)):!e.hasRunError&&e.hasNodeRun&&(e.dataCount>0&&e.maxRunIndex===0||e.search)&&!e.isArtificialRecoveredEventItem?G((c(),b("div",{key:3,class:D(e.$style.itemsCount),"data-test-id":"ndv-items-count"},[e.search?(c(),O(v,{key:0},{default:w(()=>[I(T(e.$locale.baseText("ndv.search.items",{adjustToNumber:e.unfilteredDataCount,interpolate:{matched:e.dataCount,total:e.unfilteredDataCount}})),1)]),_:1})):(c(),O(v,{key:1},{default:w(()=>[I(T(e.$locale.baseText("ndv.output.items",{adjustToNumber:e.dataCount,interpolate:{count:e.dataCount}})),1)]),_:1})),e.showIOSearch?(c(),O(u,{key:2,modelValue:e.search,"onUpdate:modelValue":t[7]||(t[7]=W=>e.search=W),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)),[[ne,!e.editMode.enabled]]):E("",!0),f("div",{ref:"dataContainer",class:D(e.$style.dataContainer),"data-test-id":"ndv-data-container"},[e.isExecuting?(c(),b("div",{key:0,class:D(e.$style.center),"data-test-id":"ndv-executing"},[f("div",{class:D(e.$style.spinner)},[y(P,{type:"ring"})],2),y(v,null,{default:w(()=>[I(T(e.executingMessage),1)]),_:1})],2)):e.editMode.enabled?(c(),b("div",{key:1,class:D(e.$style.editMode)},[f("div",{class:D([e.$style.editModeBody,"ignore-key-press"])},[y(_,{"model-value":e.editMode.value,"onUpdate:modelValue":t[8]||(t[8]=W=>e.ndvStore.setOutputPanelEditModeValue(W))},null,8,["model-value"])],2),f("div",{class:D(e.$style.editModeFooter)},[y(R,{bold:!1,class:D(e.$style.editModeFooterInfotip)},{default:w(()=>[I(T(e.$locale.baseText("runData.editor.copyDataInfo"))+" ",1),y(a,{to:e.dataEditingDocsUrl,size:"small"},{default:w(()=>[I(T(e.$locale.baseText("generic.learnMore")),1)]),_:1},8,["to"])]),_:1},8,["class"])],2)],2)):e.paneType==="output"&&e.hasSubworkflowExecutionError?(c(),b("div",{key:2,class:D(e.$style.stretchVertically)},[y(A,{error:e.subworkflowExecutionError,class:D(e.$style.errorDisplay)},null,8,["error","class"])],2)):e.hasNodeRun?e.paneType==="input"&&e.node.disabled?(c(),b("div",{key:4,class:D(e.$style.center)},[y(v,null,{default:w(()=>[I(T(e.$locale.baseText("ndv.input.disabled",{interpolate:{nodeName:e.node.name}}))+" ",1),y(a,{onClick:e.enableNode},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.disabled.cta")),1)]),_:1},8,["onClick"])]),_:1})],2)):e.hasNodeRun&&e.isArtificialRecoveredEventItem?(c(),b("div",{key:5,class:D(e.$style.center)},[le(e.$slots,"recovered-artificial-output-data",{},void 0,!0)],2)):e.hasNodeRun&&e.hasRunError?(c(),b("div",{key:6,class:D(e.$style.stretchVertically)},[e.isPaneTypeInput?(c(),O(v,{key:0,class:D(e.$style.center),size:"large",tag:"p",bold:""},{default:w(()=>[I(T(e.$locale.baseText("nodeErrorView.inputPanel.previousNodeError.title",{interpolate:{nodeName:e.node.name}})),1)]),_:1},8,["class"])):e.$slots.content?le(e.$slots,"content",{key:1},void 0,!0):(c(),O(A,{key:2,error:e.workflowRunData[e.node.name][e.runIndex].error,class:D(e.$style.dataDisplay)},null,8,["error","class"]))],2)):e.hasNodeRun&&(!e.unfilteredDataCount||e.search&&!e.dataCount)&&e.branches.length>1?(c(),b("div",{key:7,class:D(e.$style.center)},[e.search?(c(),b("div",su,[y(v,{tag:"h3",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),y(v,null,{default:w(()=>[y($,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:w(()=>[f("a",{href:"#",onClick:t[9]||(t[9]=(...W)=>e.onSearchClear&&e.onSearchClear(...W))},T(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})])):(c(),O(v,{key:1},{default:w(()=>[I(T(e.noDataInBranchMessage),1)]),_:1}))],2)):e.hasNodeRun&&!e.inputData.length&&!e.search?(c(),b("div",{key:8,class:D(e.$style.center)},[le(e.$slots,"no-output-data",{},()=>[I("xxx")],!0)],2)):e.hasNodeRun&&!e.showData?(c(),b("div",{key:9,class:D(e.$style.center)},[y(v,{bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.tooMuchDataTitle),1)]),_:1}),y(v,{align:"center",tag:"div"},{default:w(()=>[f("span",{innerHTML:e.$locale.baseText("ndv.output.tooMuchData.message",{interpolate:{size:e.dataSizeInMB}})},null,8,iu)]),_:1}),y(g,{outline:"",label:e.$locale.baseText("ndv.output.tooMuchData.showDataAnyway"),onClick:e.showTooMuchData},null,8,["label","onClick"]),y(g,{size:"small",label:e.$locale.baseText("runData.downloadBinaryData"),onClick:t[10]||(t[10]=W=>e.downloadJsonData())},null,8,["label"])],2)):e.hasNodeRun&&e.$slots.content?le(e.$slots,"content",{key:10},void 0,!0):e.hasNodeRun&&e.displayMode==="table"&&e.binaryData.length>0&&e.inputData.length===1&&Object.keys(e.jsonData[0]||{}).length===0?(c(),b("div",{key:11,class:D(e.$style.center)},[y(v,null,{default:w(()=>[I(T(e.$locale.baseText("runData.switchToBinary.info"))+" ",1),f("a",{onClick:t[11]||(t[11]=(...W)=>e.switchToBinary&&e.switchToBinary(...W))},T(e.$locale.baseText("runData.switchToBinary.binary")),1)]),_:1})],2)):e.showIoSearchNoMatchContent?(c(),b("div",{key:12,class:D(e.$style.center)},[y(v,{tag:"h3",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),y(v,null,{default:w(()=>[y($,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:w(()=>[f("a",{href:"#",onClick:t[12]||(t[12]=(...W)=>e.onSearchClear&&e.onSearchClear(...W))},T(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})],2)):e.hasNodeRun&&e.displayMode==="table"?(c(),O(be,{key:13},{default:w(()=>[y(B,{node:e.node,"input-data":e.inputDataPage,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,"run-index":e.runIndex,"page-offset":e.currentPageOffset,"total-runs":e.maxRunIndex,"has-default-hover-state":e.paneType==="input"&&!e.search,search:e.search,onMounted:t[13]||(t[13]=W=>e.$emit("tableMounted",W)),onActiveRowChanged:e.onItemHover,onDisplayModeChange:e.onDisplayModeChange},null,8,["node","input-data","mapping-enabled","distance-from-active","run-index","page-offset","total-runs","has-default-hover-state","search","onActiveRowChanged","onDisplayModeChange"])]),_:1})):e.hasNodeRun&&e.displayMode==="json"?(c(),O(be,{key:14},{default:w(()=>[y(U,{"pane-type":e.paneType,"edit-mode":e.editMode,"sessio-id":e.sessionId,node:e.node,"input-data":e.inputDataPage,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,"run-index":e.runIndex,"total-runs":e.maxRunIndex,search:e.search},null,8,["pane-type","edit-mode","sessio-id","node","input-data","mapping-enabled","distance-from-active","run-index","total-runs","search"])]),_:1})):e.hasNodeRun&&e.isPaneTypeOutput&&e.displayMode==="html"?(c(),O(be,{key:15},{default:w(()=>[y(oe,{"input-html":e.inputDataPage[0].json.html},null,8,["input-html"])]),_:1})):e.hasNodeRun&&e.isSchemaView?(c(),O(be,{key:16},{default:w(()=>[y(pe,{data:e.jsonData,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,node:e.node,"pane-type":e.paneType,"run-index":e.runIndex,"total-runs":e.maxRunIndex,search:e.search},null,8,["data","mapping-enabled","distance-from-active","node","pane-type","run-index","total-runs","search"])]),_:1})):e.displayMode==="binary"&&e.binaryData.length===0?(c(),b("div",{key:17,class:D(e.$style.center)},[y(v,{align:"center",tag:"div"},{default:w(()=>[I(T(e.$locale.baseText("runData.noBinaryDataFound")),1)]),_:1})],2)):e.displayMode==="binary"?(c(),b("div",{key:18,class:D(e.$style.dataDisplay)},[(c(!0),b(Z,null,re(e.binaryData,(W,q)=>(c(),b("div",{key:q},[e.binaryData.length>1?(c(),b("div",{key:0,class:D(e.$style.binaryIndex)},[f("div",null,T(q+1),1)],2)):E("",!0),f("div",{class:D(e.$style.binaryRow)},[(c(!0),b(Z,null,re(W,(ue,Oe)=>(c(),b("div",{key:q+"_"+Oe,class:D(e.$style.binaryCell)},[f("div",{"data-test-id":"ndv-binary-data_"+q},[f("div",{class:D(e.$style.binaryHeader)},T(Oe),3),ue.fileName?(c(),b("div",ru,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.fileName"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.fileName),3)])):E("",!0),ue.directory?(c(),b("div",lu,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.directory"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.directory),3)])):E("",!0),ue.fileExtension?(c(),b("div",du,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.fileExtension"))+":",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.fileExtension),3)])):E("",!0),ue.mimeType?(c(),b("div",uu,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.mimeType"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.mimeType),3)])):E("",!0),ue.fileSize?(c(),b("div",cu,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.fileSize"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.fileSize),3)])):E("",!0),f("div",{class:D(e.$style.binaryButtonContainer)},[e.isViewable(q,Oe)?(c(),O(g,{key:0,size:"small",label:e.$locale.baseText("runData.showBinaryData"),"data-test-id":"ndv-view-binary-data",onClick:Un=>e.displayBinaryData(q,Oe)},null,8,["label","onClick"])):E("",!0),e.isDownloadable(q,Oe)?(c(),O(g,{key:1,size:"small",type:"secondary",label:e.$locale.baseText("runData.downloadBinaryData"),"data-test-id":"ndv-download-binary-data",onClick:Un=>e.downloadBinaryData(q,Oe)},null,8,["label","onClick"])):E("",!0)],2)],8,au)],2))),128))],2)]))),128))],2)):E("",!0):(c(),b("div",{key:3,class:D(e.$style.center)},[le(e.$slots,"node-not-run",{},void 0,!0)],2))],2),e.hasNodeRun&&!e.hasRunError&&e.binaryData.length===0&&e.dataCount>e.pageSize&&!e.isSchemaView&&!e.isArtificialRecoveredEventItem?G((c(),b("div",{key:4,class:D(e.$style.pagination),"data-test-id":"ndv-data-pagination"},[y(V,{background:"","hide-on-single-page":!0,"current-page":e.currentPage,"pager-count":5,"page-size":e.pageSize,layout:"prev, pager, next",total:e.dataCount,"onUpdate:currentPage":e.onCurrentPageChange},null,8,["current-page","page-size","total","onUpdate:currentPage"]),f("div",{class:D(e.$style.pageSizeSelector)},[y(m,{size:"mini","model-value":e.pageSize,teleported:"","onUpdate:modelValue":e.onPageSizeChange},{prepend:w(()=>[I(T(e.$locale.baseText("ndv.output.pageSize")),1)]),default:w(()=>[(c(!0),b(Z,null,re(e.pageSizes,W=>(c(),O(N,{key:W,label:W,value:W},null,8,["label","value"]))),128)),y(N,{label:e.$locale.baseText("ndv.output.all"),value:e.dataCount},null,8,["label","value"])]),_:1},8,["model-value","onUpdate:modelValue"])],2)],2)),[[ne,!e.editMode.enabled]]):E("",!0),y(H,{show:e.blockUI,class:D(e.$style.uiBlocker)},null,8,["show","class"])],34)}const pu={$style:ou},Mn=x(Ed,[["render",hu],["__cssModules",pu],["__scopeId","data-v-ea93d802"]]),fu=z({props:{taskData:{},hasStaleData:Boolean,hasPinData:Boolean},computed:{theme(){var e;return(e=this.runTaskData)!=null&&e.error?"danger":"success"},runTaskData(){return this.taskData},runMetadata(){if(!this.runTaskData)return null;const{date:e,time:t}=Ki(this.runTaskData.startTime);return{executionTime:this.runTaskData.executionTime,startTime:`${e} at ${t}`}}}}),gu=["innerHTML"],mu=f("br",null,null,-1),yu=f("br",null,null,-1);function wu(e,t,o,n,s,i){const a=S("n8n-info-tip"),r=S("n8n-text");return e.hasStaleData?(c(),O(a,{key:0,theme:"warning",type:"tooltip","tooltip-placement":"right","data-test-id":"node-run-info-stale"},{default:w(()=>[f("span",{innerHTML:e.$locale.baseText(e.hasPinData?"ndv.output.staleDataWarning.pinData":"ndv.output.staleDataWarning.regular")},null,8,gu)]),_:1})):e.runMetadata?(c(),O(a,{key:1,type:"tooltip",theme:e.theme,"data-test-id":`node-run-info-${e.theme}`,"tooltip-placement":"right"},{default:w(()=>[f("div",null,[y(r,{bold:!0,size:"small"},{default:w(()=>[I(T(e.runTaskData.error?e.$locale.baseText("runData.executionStatus.failed"):e.$locale.baseText("runData.executionStatus.success")),1)]),_:1}),mu,y(r,{bold:!0,size:"small"},{default:w(()=>[I(T(e.$locale.baseText("runData.startTime")+":"),1)]),_:1}),I(" "+T(e.runMetadata.startTime),1),yu,y(r,{bold:!0,size:"small"},{default:w(()=>[I(T(e.$locale.baseText("runData.executionTime")+":"),1)]),_:1}),I(" "+T(e.runMetadata.executionTime)+" "+T(e.$locale.baseText("runData.ms")),1)])]),_:1},8,["theme","data-test-id"])):E("",!0)}const vu=x(fu,[["render",wu]]),_t={REGULAR:"regular",LOGS:"logs"},Nu=z({name:"OutputPanel",components:{RunData:Mn,RunInfo:vu,RunDataAi:ji},props:{runIndex:{type:Number,required:!0},isReadOnly:{type:Boolean},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},sessionId:{type:String},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(e){const t=X(),{activeNode:o}=kt(t),{isSubNodeType:n}=_n({node:o});return{pinnedData:Se(o,{runIndex:e.runIndex,displayMode:t.getPanelDisplayMode("output")}),isSubNodeType:n}},data(){return{outputMode:"regular",outputTypes:[{label:this.$locale.baseText("ndv.output.outType.regular"),value:_t.REGULAR},{label:this.$locale.baseText("ndv.output.outType.logs"),value:_t.LOGS}]}},computed:{...te(J,X,de,j),node(){return this.ndvStore.activeNode},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isTriggerNode(){return this.nodeTypesStore.isTriggerNode(this.node.type)},hasAiMetadata(){if(this.node){const e=this.workflowsStore.getWorkflowResultDataByNodeName(this.node.name);return!e||!Array.isArray(e)||e.length===0?!1:!!e[e.length-1].metadata}return!1},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){return!!(this.nodeType&&this.nodeType.group.includes("schedule"))},isNodeRunning(){return this.node&&this.workflowsStore.isNodeExecuting(this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){var t;if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return(t=e==null?void 0:e.resultData)!=null&&t.runData?e.resultData.runData:null},hasNodeRun(){return this.workflowsStore.subWorkflowExecutionError?!0:!!(this.node&&this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name))},runTaskData(){if(!this.node||this.workflowExecution===null)return null;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<=this.runIndex?null:e[this.node.name][this.runIndex]},runsCount(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length:0},staleData(){if(!this.node)return!1;const e=this.workflowsStore.getParametersLastUpdate(this.node.name);if(!e||!this.runTaskData)return!1;const t=this.runTaskData.startTime;return e>t},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},canPinData(){return this.pinnedData.isValidNodeType.value&&!this.isReadOnly}},methods:{insertTestData(){const e=this.$refs.runData;e&&(e.enterEditMode({origin:"insertTestDataLink"}),this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:this.node.type,pane:"output",type:"insert-test-data"}))},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},openSettings(){this.$emit("openSettings"),this.$telemetry.track("User clicked ndv link",{node_type:this.node.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"output",type:"settings"})},onRunIndexChange(e){this.$emit("runChange",e)},onUpdateOutputMode(e){e===_t.LOGS?gt.emit("setPositionByName","minLeft"):gt.emit("setPositionByName","initial")},activatePane(){this.$emit("activatePane")}}}),ku="_outputTypeSelect_1tinm_10",bu="_titleSection_1tinm_15",Tu="_title_1tinm_15",Su="_noOutputData_1tinm_31",Du="_recoveredOutputData_1tinm_41",Eu={outputTypeSelect:ku,titleSection:bu,title:Tu,noOutputData:Su,recoveredOutputData:Du},Cu=f("br",null,null,-1);function Iu(e,t,o,n,s,i){const a=S("n8n-radio-buttons"),r=S("RunInfo"),l=S("n8n-text"),d=S("RunDataAi"),h=S("RunData");return c(),O(h,{ref:"runData",node:e.node,"run-index":e.runIndex,"linked-runs":e.linkedRuns,"can-link-runs":e.canLinkRuns,"too-much-data-title":e.$locale.baseText("ndv.output.tooMuchData.title"),"no-data-in-branch-message":e.$locale.baseText("ndv.output.noOutputDataInBranch"),"is-executing":e.isNodeRunning,"executing-message":e.$locale.baseText("ndv.output.executing"),"session-id":e.sessionId,"block-u-i":e.blockUI,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isPaneActive,"pane-type":"output","data-output-type":e.outputMode,onActivatePane:e.activatePane,onRunChange:e.onRunIndexChange,onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onTableMounted:t[3]||(t[3]=p=>e.$emit("tableMounted",p)),onItemHover:t[4]||(t[4]=p=>e.$emit("itemHover",p)),onSearch:t[5]||(t[5]=p=>e.$emit("search",p))},Qt({header:w(()=>[f("div",{class:D(e.$style.titleSection)},[e.hasAiMetadata?(c(),O(a,{key:0,modelValue:e.outputMode,"onUpdate:modelValue":[t[0]||(t[0]=p=>e.outputMode=p),e.onUpdateOutputMode],options:e.outputTypes},null,8,["modelValue","options","onUpdate:modelValue"])):(c(),b("span",{key:1,class:D(e.$style.title)},T(e.$locale.baseText(e.outputPanelEditMode.enabled?"ndv.output.edit":"ndv.output")),3)),e.hasNodeRun&&!e.pinnedData.hasData.value&&e.runsCount===1?G((c(),O(r,{key:2,"task-data":e.runTaskData,"has-stale-data":e.staleData,"has-pin-data":e.pinnedData.hasData.value},null,8,["task-data","has-stale-data","has-pin-data"])),[[ne,!e.outputPanelEditMode.enabled]]):E("",!0)],2)]),"node-not-run":w(()=>[e.workflowRunning&&!e.isTriggerNode?(c(),O(l,{key:0,"data-test-id":"ndv-output-waiting"},{default:w(()=>[I(T(e.$locale.baseText("ndv.output.waitingToRun")),1)]),_:1})):E("",!0),e.workflowRunning?E("",!0):(c(),O(l,{key:1,"data-test-id":"ndv-output-run-node-hint"},{default:w(()=>[e.isSubNodeType.value?(c(),b(Z,{key:0},[I(T(e.$locale.baseText("ndv.output.runNodeHintSubNode")),1)],64)):(c(),b(Z,{key:1},[I(T(e.$locale.baseText("ndv.output.runNodeHint"))+" ",1),e.canPinData?(c(),b("span",{key:0,onClick:t[1]||(t[1]=(...p)=>e.insertTestData&&e.insertTestData(...p))},[Cu,I(" "+T(e.$locale.baseText("generic.or"))+" ",1),y(l,{tag:"a",size:"medium",color:"primary"},{default:w(()=>[I(T(e.$locale.baseText("ndv.output.insertTestData")),1)]),_:1})])):E("",!0)],64))]),_:1}))]),"no-output-data":w(()=>[y(l,{bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.output.noOutputData.title")),1)]),_:1}),y(l,null,{default:w(()=>[I(T(e.$locale.baseText("ndv.output.noOutputData.message"))+" ",1),f("a",{onClick:t[2]||(t[2]=(...p)=>e.openSettings&&e.openSettings(...p))},T(e.$locale.baseText("ndv.output.noOutputData.message.settings")),1),I(" "+T(e.$locale.baseText("ndv.output.noOutputData.message.settingsOption")),1)]),_:1})]),"recovered-artificial-output-data":w(()=>[f("div",{class:D(e.$style.recoveredOutputData)},[y(l,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),y(l,null,{default:w(()=>[I(T(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.outputMode==="logs"?{name:"content",fn:w(()=>[y(d,{node:e.node,"run-index":e.runIndex},null,8,["node","run-index"])]),key:"0"}:void 0,!e.pinnedData.hasData.value&&e.runsCount>1?{name:"run-info",fn:w(()=>[y(r,{"task-data":e.runTaskData},null,8,["task-data"])]),key:"1"}:void 0]),1032,["node","run-index","linked-runs","can-link-runs","too-much-data-title","no-data-in-branch-message","is-executing","executing-message","session-id","block-u-i","is-production-execution-preview","is-pane-active","data-output-type","onActivatePane","onRunChange","onLinkRun","onUnlinkRun"])}const Pu={$style:Eu},Ou=x(Nu,[["render",Iu],["__cssModules",Pu]]),$u={},Ru={width:"112",height:"80",viewBox:"0 0 112 80",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},_u=xi('<mask id="mask0_489_46042" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="0" y="0" width="112" height="80"><rect width="112" height="80" fill="url(#paint0_linear_489_46042)"></rect></mask><g mask="url(#mask0_489_46042)"><rect x="-0.5" width="112" height="80" fill="url(#pattern0)" fill-opacity="0.6"></rect></g><defs><pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"><use xlink:href="#image0_489_46042" transform="scale(0.00357143 0.005)"></use></pattern><linearGradient id="paint0_linear_489_46042" x1="90.5" y1="40.4494" x2="112.5" y2="40.4494" gradientUnits="userSpaceOnUse"><stop></stop><stop offset="1" stop-color="white" stop-opacity="0"></stop></linearGradient><image id="image0_489_46042" width="280" height="200" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAADICAYAAAAzx/4XAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABhdSURBVHgB7d0JcFTVngbw/72d4IYa0Ie4IK2llgpodNwtB9AaxVILF7ZxynkgWupojaRwASXQGEBqEAI8LXfBpZQS9IFabjMFkXFfijCKyqjQqIiKShCUpdP3vvPdpXP7pjtk6dPdSX+/qlPpJX07UfrL/yz3XEOIPJNiswaZkbKBtkiluC0qRB1gCJW86ntmjzYM81YvWIhyhgFTwlCxGJGyBcJKhTQxhUrSpJraKSpcVgjDhTQqEyo5U+6prbVExmV6TnWT6ixbnuxmSZ262xCLVTUIUTsxYEoMKpdM4aKCZV5ZUmIMFMoljsGUkMk1c9RArjE39HBchcuYadVVdUKUYwyYEjEhVhstj8gqdbMi8HA8kpTBqmqJC5EGHOQtEeVlMkXSw6WB4UK6cQymBKB6UYMso4OPWYZMrWG4kGasYEpAmWGHB3Xj0ydVzRUizRgwJcAwjaFpD9gyVYjygAHTxTndo9Bium2WLBWiPGDAdHFlkWT4/KK6uVzrQnnCgOniDNuIBu/blr1aiPKEAdPF2Xba1DQeYfVCecOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2hhCXc7ll19eUVZWNto0zYFGJDLIamys8J+LRMrilpWst217WSKRqFu6dGlciDRhwHQho0aNilqWVavC4/I2vGyhCpqpDBrSISLUJYwcOfJWFS6vq5vHS9tURiKRcf3795c1a9a8JUQ5xAqmk0N3qLy8/O/q5iDpIMMwlu7evXuMqmYahCgHOMjbyalwWSE5CBdA18o7HlFOsIvUiY0YMaJWfWnLeEtr9FbdpQrVXXpDiDqIXaROavjw4aPVlwWiiapmBi9ZsqROiDqAXaTOa4popMZjtIUXlQ4GTCfkVS9R0SvqvQ9RuzFgOqe/Sn7k632oi+IYTCfjTUtvkTxJJBI9OG1N7cUKppMpKyurlDzK9/tR18KA6Xzy+oG3LCsqRO3EgOl8KiSPTNOMClE7MWCISJsyIUcsVlvRGJEVhm3Nq5k8fqEUr3wPuHKAl9qNFYwnFqtqMND9MMwF1TW16yfXzLl1Qqw2KkXGtu245Fe9ELUTAybAaPprHbXFmFsekfXV02oX3BX7r6KZSUkmk3WSR42NjQwYajcGTIBl2aubPWjL6EikfJWqalZU3zN7tBSYtyalTvJAVUt1XANDHcExmDTofmRdezhIdZ8GqaCZYog9d3fSWDYzVhWXwnhScrRFQ0sMw3hSiDqAFUyAZUi8Fd9W8O5TIpFYqr7ERa/44sWLFwpRBzBggiJm28YbCtR9QrfFsqwq0WuqEHUQz0UKwFR1MiIdOc8nns/u01VXXTXXNM1bJcdUeM174YUXxglRBzFgQlQ1goDp+GpZQxYmGxPzZsTu0DYL4534iC0uc9lNq1ddo1OEKAfYRQoYpyoYI1djG6r7ZEbKF+CYogm6Smo8ZjA265YcwHFwPCHKkZKrYPCB31cSUTEjlaYtUSNi9rVtqTTcqiUqOWKLzCtLql5XrCov07zDhg2LqYBo9y53akq6asmSJXOFKIe6ZMDEYvdGG6W80jKNioiYJ6vfUs38qDBxA0T7yYJqNqpq+qSqvH9YceG1xsZGBE1bNorihddIm04ZMMEqJILAMFWI2E5wYCwiKoUTV0E2Zlp1VZ0UEIImmUwOUjeHRiKRSnU76j9nlpU1WI2NdapieUuF0UIupCOdijZgUIXslkhFhq5MVPRWIQ3tOb4KlnrVJboiVrjFdxlNmjo7ZphmqutkW9bUaVPGx4QoDwq6ktfvyhimEVV/W/uiKyNuFVKRVC110SbEoJ2zNGywMZ1sSL2dtLdahlFvGtKgwqEe4aCmqqNqqnp9Ww6Y7/EWos5Ca8Bk6cpExa1CoipEdJVQ6Ko0uCFibbAMM94tIvWSkPieQgAho6aqpbUKNd5C1Bl0OGCaDaiaUpHelSlv+mZbcimuWr1t2RvUoGbcNiSOKkQ91pCDSiIuex7LccZbVLjUhR5vT2bm9r8MUZHYY8CgCqmQnRVZujKpKiTVnclTV0b0QlBFsz2ZZbzFCH0N3w4dIo3Riu/Z0+NERScVMM5Je1nWhiRlb21dGcGHWQWHWLJahVVDa7syOjlVkZn5Nw6Nt4S/yQg0LGJECJ+n2nGqdVPtO9XeUW2lagnZw4+R4bYdeE8GDRW9VMCURcoX2PhA5HhA1WvNujLFNtsSZBjetg12+mfYErtq+uTx86QpQFIvkab/ZOgTnqlajWpniBssQY2qrVJtumornMOK9BQ3jE5XrY9q3VXbodo61d5U7TPVtgeO4QcNQ4aKWipgsNmS+qvdnnNaAl2ZtAHVhmIOkZbYKmCM9HCJJ3bvGjtz2sT/FffDv7e4/+3wTegl7lJtt3f/JHHD5VzVjH333Ve6deuGZfjYHU62b99eZts2gmS+ajHVvlZtjGqjVNsnw4+DkxkfVW2OapuF1Qx1IoExmBY3W1LPFV9XRhcracUjpulUMKq8WP3Lr1uGPzx/Gk6CPFu1gaqdrNrB4lYjP6n2iWr/p9pG1W5X7Z9UM4499li59NJL5ZRTTnFC5ssvv5Tly5fL+++/L7t370alMkO1TaqdYqr36969uxx44IG42Bm2xpStW7fK77//fqAKpPHiVkYIpR+897Wl5WBh6FDBNQWMaSJAFhZgQLXYGNbO5AZzn4gkLWv+199+O23xgr/tpR7/V9VuUK1fhtdcLW43BhXOaart07NnT5kzZ44MGTLECQxABTN06FAZM2aM1NfXI817oyFcEEbnn3++DBgwwAmZbdu2yTvvvCNvvPGGbN68WRVU9s3ijt9sFbdqOki1fcUNEoTfL9I0rhOsbogKJhUw06qrcEZuTs7K7exmzpy49a7qe8feWzPxKXErh39TrVq1ngiLCjWv1qNHD+ybggpDGhoasMtcf/X8ieJ9sC+88EI599xzU+ECuH3MMcfIyJEjETCpxw8++GCpqqqSa665RtCl8g0fPlzuuusuWbRoEaoZHOhKcSumY8Ttgh0pbjWD6ul/xJ39+i3wq7CKoYLinrzpUlPNM9xwwQAtQuM/VeuJILjgggucdvTRRzsVyTfffCPLli2T9957D1VHauD3zDPPdLpFYfvtt5+cdtppTpD8+eefzmP9+vWTgQMHpoULoAq69tpr5e2333a6S8r54obLaaHDXqTaNar9TbUnVPtVguGC8SSDBQ3lHwOmueA0MwZdMRN01D777COnnnqq1NTUON2ZIHRr7rzzTidkfAcddJBEIpHmB1cfdARV37595YsvvnAeQ0X0l7/8JeMPc8IJJ8ghhxwin3/+ObZU6KUe6uUfPxqNyo4dO2TdunXGzp07D1UP/4dq34hbiWJ2Cq8x8J4MGSoEbjjVJLhQLhgwGNB1xkVQuYTDBc444ww5++yz5YADDkg9tv/++zthkgnCChUQIITQ3cLxM8FxjjrqKCkvb1oRjdCZMWOGzJs3zxnnufrqq3ENaTyFMZ1LxR2ANv3fif0kKhRWMOnCC+XQMMDrjJ+EuzC+vfbay+n2YEB2zZo1zmP+1HQme++9t1OV+LdRwQTHasJQ7SBg1MyTc//mm2+W66+/3jk+xoHw3GuvvSabNm3CQfp4zRmLsdWkO+sWKhRWMJkFF9JhdsYZL9m4cWPWF5x++ulOpeGHSksBg0BCFwdQoWTrHvmOOOKIVAWDMBoxYkTq2KhcevXq5by3Zz9xK5iI83uoAEL3yKlibNYylF8MmHTh6sWfoXEGWT/99NPUwGwYxkMwJY1qA10m3M80BgPoEmGGqbKy0hkMRmsJxn4wOIxQwXuEAwlhhuDx74obMs7vkFRjMIwVKhR2kVzBpf7BbhICZr1qW5LJZA/MGK1du9ZZOBeGLs5ll13mTEPj9mGHHeaPizSDQBg8eLAzZoNqpn///tISjPvMmjVLNmzYIIMGDWr2PN4Hx/Eg1RAyTsBgkDdVubCzRHnGgMkcLH4Fg9vbxK1iBm7evNlZhZspYODII4902h7fUH3QES4ImdbA2M+wYcOcGSNUMpkEwsw/uT01yEtUKKXeRco0c4SG2ZgrVLtRtb+KNxGDBXXvvvsuVtZKvmEMBqGUrdsVkgpIO5k0/HMK2FWifCvlCiZT5YJp6RGqjVXtEO++3+Vwzg/CepS6ujpnlW2RMkKNqGBYwTRVLvuLe8byveIurouKGzKYkUktcME09EsvveSvrC16lhAVTqlWMMHqxe9O3CbuuT7OdMzxxx/vnAmNLsknn3wiK1eudNah7Nq1ywmZVatWZRxwLQScsrBz507/LjIFJz2ygqGCK+Uukj8Iiq/YcW6keOFyww03yN133+2sUcHgKaqV5557TqZOnepMU3/77bfO1gvFEjDougWmzxEuu4WoCJRiwGSaLbpANWdxyVlnnSUPPfRQ2gswuDp27Fhn1ezEiROdr63xww8/yPr16+Wcc85ptugOA8aYkcIpAlg3Ex68xZQ0zrg++eSTpU+fPi0O7qKCCXTZEC47hKgIlOoYTDBk8MnFMlhnqewll1yS8QVYeYvl+Y8++qjMnDnTmTZuCVb94gzp8847T6qrq9OeQxg888wzcvHFF8tNN90kL7/8ctrzv/zyi0yYMEGuvPJKufHGG+Wrr75q8b3QbcNrPOgrdY4BIurySrmCQbj660XKvcdSS/gzwXPXXXedtAbGabBXjG3bznYLQVjP8v333zu3f/vtN6fLFYSw2LJli1Mpff3119hms8X3QsD8+uuv/l30lRAwzsw0l2pTIZXav7/wJUX8CuYP8SZc8IHvTBBgCKA//vjDuStuBfO7EBWBUvwDF5xd8cdgUttNrlu3TjqTRCIh8Xg8dVfczaawCTnX1VHBlXIFHewqob/iBAy6NnYnOusYAYOBZA+ql58leOUBNQvGVXdUKFxo58In1Pmrj5W6GP/o8IEDs0aYRtYFa3NwlrcH/SR/TwlWMFRwpV7B+PChxEhrI3bzf/7556WjsGudHzLZtnjoKExPYzr7448/9h/CANL/S9OpR9gvk0FDBVPKARP84KHEeEu89SNPPPFEh09oxJYNfsDoqmAwsPvqq6/6U9T42dHVQ1Cmn9+In4NbNVABlGLAhK/57DcsRomrlvzoo4/kvvvuS21RWawwIP3444/7dzG4i8vMImgwI8YTqKngSi1ggpdd9ZvlNVwxEbvxO4tO8MFdunRpq1ft5hsGonH6gjfrhSTEJWhxWYNguLCLRAVV6l0kS9JD5lVxr87oLFybPXu2rFixQnINXSd/gygERXtCDCdfPvvss/5d9JH+W7Ufpel3SS20S80gsZtEeVaqXaRgwwCJ5X3FwMsDqq3CN+JcICzz/+CDDySXcF6Rv8UlBmrb2hVbvXq1cyVIbxNyTK9jqTACxgo1VjBUUKVawQS7R37I+A19DlwhcR0++NiWAdce+uyzzySXgicvtqWCQWU1efJk5+cS9+fHz/uCuDNIflimmmFGbFYuVCilXMH4H0L/Q9no3cbXD1Wbr9pm7LPyyiuvSG1tbcFX+SKIHnzwQXn99df9hzCw+4i4ewYHQ5KDvFQUSn0Mxg+a4IcTAYM+CwZfZqm2BetYsDYGlcN3333XqoMfeuihqbUwuMJAEK4qgEuXADb0Dp9giX1ounfv7rwWx8HF2QAXV3vssceCXaoHxb3o/W7v5/ZD0g9PB8dfqFBatYN0F5TppMdwQ/g0iLv0/sxEIlGOcEFFc+KJJ2a91KsPwYFrUGNnPGy5cPjhh6eewxoZvB7PY9OqK664wgkVHwIFe9DgciWjRo2Sk046yTkDe/z48c64kKdO3IDBVQ8QLAlJr8KcKmbg4Iv+WQXVoFTA2PZbK+verBOiPCjVHe0QHn6I+GMwqOYS3vP+SZAIl9dU66Vme67fsmVL+YIFC+Tnn3+W6dOnOxdZywZVysiRI51qI3ypEYy/IHjuuOOO8DWNUq+96KKLnMua4Htx//777xesz/HOk8Ks0Qxxt2VISnq4sItERaPUr4sUnk0KngDp38bWB4vFvUb1v2/durUcm36j4sBMznHHHZf14AiOcHgEZbvWNaDK8a9XjbGXxYsXC05j8Dyh2iZp6hZlC5emlbxEBVDKAROsYvzxiuAVHYMnIP+k2jOq7VIVxLXbt2/f++mnn3bOMbrttttkwIABohO23sSWDN5sE6qVl6SpagmHS7ARFVSpn02daU1MIktDyDyl2gMqZLbhPKCnnnpKbr/9dmeLh/ZAcNxyyy3Su3dv6devnzz88MPBKiUF2zFg1zoPRpl/C/1smWaQRNhFogLjpWObPoTBv/jB7pIEvqK7hDUn+LTfotoBb775pnOdJAziBi5Av0c//vijzJ8/Xx544AHn/k8//SRTpkxxFt5hn97gda2xQXjghMmNkh4o4XDh+AsVDW7Zmnm62p+V8S8BEqwWMLD6d9UeVu1nDLouX77cuYxJa2FbTgQTAsZ7b6e7g5BZtGiRfPjhh2lnYKN6CWyCtUOyj70EqxeigmPAuIJdinDQBMPGb9jg5RPVPseLsGQfVUZrYYOoWbNmOVPP4p5cWe8dy8a1r1ER4Zh+qIQueWJK5vEWW9g1oiLDLlKTTFPXRuh5/3vQsO2ds7k2LkPiX4wNMLUcvg4SwgLbW2ItDS7g5p16gLDCiU4LVTtBtR5qILcPVuuiizRkyBBnvQwqG7zWg+s3ZQsXdo2oqDBg0vkBgg+tXymINL9YW3DTcKfL88gjj8iLL77oBAMWygXHUABjK9iKEwHj7aGLY8dVW6baN+IO3PZW7SpVDVXgTO4lS5Y44zp4XWBXvL7e+zJYqOgxYJoLhox4t4NB4y/CA2clNFb34vrVbYBuF1IG+898JE1ncmO7CKzK+xd1zB5r167N1IXtJu51nFi9UNFjwGQWDhlfsILBtDVOisSJRPuGno9I8038cUzMPmHnf8wEYd+ZleKGjR8MOJtyobhbX1aqdqB3LASQf0lY7PD9hzBYqBNgwGQXDBm/e+QP/vrXUkIFgg98T0m/UmQ3aQqi4DQ4ggELXbBvrn/1xeDMD74f4YNFfW94x8WxEt7rMO6zSTKfDsCQoaLDgGlZeLVveJUvQgZBgS5LRJoCxsxwnEzbRPiDyb5gFwxVzEbJvAgwKaxgqBNgwLROOBwQMqb31YcP/Z4CxsrS/IDwqx5T0isgW9L3rOGCOuoUGDB7FuyCBM9bagw8jsf8cMk2/tJSwPiCYzzB2apM+9bwrGkqegyY1guGCzQGHiuTpqom05VagwETDppgQISnws0Mr/cXAPK8Iyp6DJjWC6/2Dd72181ASwETrmQyVR/h7SLCxwhu88kxGCpqDJjWCa/ytaR5WIR3xAu/Pjzj01LA7Cmk2DWiToEB03Z+mJiB28GAEckcMMHbVuhxO/S6TCHlf1+msGLQUFFiwLSeX8X4ty1pHiit2TouU7cmU8BI6Lad5StR0WLAtE0wCMKDs209RkvPtTY8GDJU1Bgw7WNnuW+04TVEXR4DJrcYIkQB3HCKiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBdnGFI2gWbjIjZV4jyhAHTxdmGHU9/QKJClCcMmC6uLBmpDz1UOS5W2/qLaBN1AAOmi4vFquLiXuDNV7GfaY0WojxgwJQA27KeDN43DXOoEOUBA6YElNnmwtBDg6rvmT1OiDRjwJQAdJNssdOqGDHMKRNitVEh0ogBUyLKkkZMfQlOWVeUR2QFQ4Z0YsCUCGew15CpoYejCJlJNbWDhEiDtmz1SF2ACpOY+p8+pdkThixMNMrUme6sE1FOMGBK0KSaOXMNMW7N8vRSNe20LGkl62fE7qgXog5gwJSorJUMUQ4xYEoYxl7UP4AF6mZUiDRgwJBU31M7Wv1LQDUTFaIcYsBQSmx6bWVjo3W5mOZAww2bqBB1wD8AobUpv0xPqN8AAAAASUVORK5CYII="></image></defs>',3),Au=[_u];function Mu(e,t){return c(),b("svg",Ru,Au)}const Wu=x($u,[["render",Mu]]),Vu=z({name:"InputPanel",components:{RunData:Mn,NodeExecuteButton:eo,WireMeUp:Wu},props:{currentNodeName:{type:String},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},workflow:{},canLinkRuns:{type:Boolean},sessionId:{type:String},readOnly:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},data(){return{showDraggableHintWithDelay:!1,draggableHintShown:!1,inputMode:"debugging",mappedNode:null,inputModes:[{value:"mapping",label:this.$locale.baseText("ndv.input.mapping")},{value:"debugging",label:this.$locale.baseText("ndv.input.debugging")}]}},computed:{...te(J,X,j,de),focusedMappableInput(){return this.ndvStore.focusedMappableInput},isUserOnboarded(){return this.ndvStore.isMappingOnboarded},isMappingMode(){return this.isActiveNodeConfig&&this.inputMode==="mapping"},showDraggableHint(){const e=[Ht,Ze,os,ns];return!this.currentNode||e.includes(this.currentNode.type)?!1:!!this.focusedMappableInput&&!this.isUserOnboarded},isActiveNodeConfig(){var o,n;let e=((o=this.activeNodeType)==null?void 0:o.inputs)??[],t=((n=this.activeNodeType)==null?void 0:n.outputs)??[];if(this.activeNode!==null&&this.currentWorkflow!==null){const s=this.currentWorkflow.getNode(this.activeNode.name);e=fe(this.currentWorkflow,s,this.activeNodeType),t=Te(this.currentWorkflow,s,this.activeNodeType)}else Array.isArray(e)||(e=[]),Array.isArray(t)||(t=[]);return!!(e.length===0||e.every(s=>this.filterOutConnectionType(s,M.Main))&&t.find(s=>this.filterOutConnectionType(s,M.Main)))},isMappingEnabled(){return this.readOnly?!1:this.isActiveNodeConfig?this.isMappingMode&&this.mappedNode!==null:!0},isExecutingPrevious(){if(!this.workflowRunning)return!1;const e=this.workflowsStore.executedNode,t=this.workflowsStore.executingNode;return this.activeNode&&e===this.activeNode.name&&!this.workflowsStore.isNodeExecuting(this.activeNode.name)?!0:t.length||e?!!this.parentNodes.find(o=>this.workflowsStore.isNodeExecuting(o.name)||o.name===e):!1},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){return this.workflow},activeNode(){return this.ndvStore.activeNode},rootNode(){return this.currentWorkflow.getChildNodes(this.activeNode.name,"ALL_NON_MAIN")[0]},rootNodesParents(){return[...this.currentWorkflow.getParentNodes(this.rootNode,"main")].reverse()},currentNode(){return this.isActiveNodeConfig?this.mappedNode?this.workflowsStore.getNodeByName(this.mappedNode):this.activeNode:this.workflowsStore.getNodeByName(this.currentNodeName)},connectedCurrentNodeOutputs(){const e=this.parentNodes.find(({name:t})=>t===this.currentNodeName);if(e)return e.indicies},parentNodes(){if(!this.activeNode)return[];const e=this.workflow.getParentNodesByDepth(this.activeNode.name);return e.filter(({name:t},o)=>this.activeNode&&t!==this.activeNode.name&&e.findIndex(n=>n.name===t)===o)},currentNodeDepth(){const e=this.parentNodes.find(t=>this.currentNode&&t.name===this.currentNode.name);return e?e.depth:-1},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},isMultiInputNode(){return this.activeNodeType!==null&&this.activeNodeType.inputs.length>1}},watch:{inputMode:{handler(e){this.onRunIndexChange(-1),e==="mapping"?(this.onUnlinkRun(),this.mappedNode=this.rootNodesParents[0]):this.mappedNode=null},immediate:!0},showDraggableHint(e,t){e&&!t?setTimeout(()=>{this.draggableHintShown||(this.showDraggableHintWithDelay=this.showDraggableHint,this.showDraggableHintWithDelay&&(this.draggableHintShown=!0,this.$telemetry.track("User viewed data mapping tooltip",{type:"unexecuted input pane"})))},1e3):e||(this.showDraggableHintWithDelay=!1)}},methods:{filterOutConnectionType(e,t){return e?typeof e=="string"?e!==t:e.type!==t:!1},onInputModeChange(e){this.inputMode=e},onMappedNodeSelected(e){this.mappedNode=e,this.onRunIndexChange(0),this.onUnlinkRun()},getMultipleNodesText(e){var s;if(!e||!this.isMultiInputNode||!this.activeNode||((s=this.activeNodeType)==null?void 0:s.inputNames)===void 0)return"";const n=(this.currentWorkflow.connectionsByDestinationNode[this.activeNode.name].main||[]).reduce((i,a,r)=>a[0]&&a[0].node===e?[...i,r]:i,[]).map(i=>{var a,r;return(r=(a=this.activeNodeType)==null?void 0:a.inputNames)==null?void 0:r[i]});return n.length===0?"":`(${n.join(" & ")})`},onNodeExecute(){this.$emit("execute"),this.activeNode&&this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"executePrevious"})},onRunIndexChange(e){this.$emit("runChange",e)},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},onInputNodeChange(e){const t=this.parentNodes.findIndex(o=>o.name===e)+1;this.$emit("changeInputNode",e,t)},onConnectionHelpClick(){this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"not-connected-help"})},truncate(e){const t=e.substring(0,30);return t.length<e.length?`${t}...`:t},activatePane(){this.$emit("activatePane")}}}),Bu="_mappedNode_13qhk_5",Uu="_titleSection_13qhk_10",Lu="_inputModeTab_13qhk_19",xu="_noOutputData_13qhk_23",Hu="_recoveredOutputData_13qhk_33",Fu="_notConnected_13qhk_42",zu="_title_13qhk_10",Yu={mappedNode:Bu,titleSection:Uu,inputModeTab:Lu,noOutputData:xu,recoveredOutputData:Hu,notConnected:Fu,title:zu},Ku={key:0},ju={key:1},qu=["innerHTML"];function Gu(e,t,o,n,s,i){const a=S("n8n-option"),r=S("n8n-select"),l=S("n8n-radio-buttons"),d=S("n8n-text"),h=S("NodeExecuteButton"),p=S("n8n-tooltip"),g=S("WireMeUp"),N=S("RunData");return c(),O(N,{node:e.currentNode,"run-index":e.runIndex,"linked-runs":e.linkedRuns,"can-link-runs":!e.mappedNode&&e.canLinkRuns,"too-much-data-title":e.$locale.baseText("ndv.input.tooMuchData.title"),"no-data-in-branch-message":e.$locale.baseText("ndv.input.noOutputDataInBranch"),"is-executing":e.isExecutingPrevious,"executing-message":e.$locale.baseText("ndv.input.executingPrevious"),"session-id":e.sessionId,"override-outputs":e.connectedCurrentNodeOutputs,"mapping-enabled":e.isMappingEnabled,"distance-from-active":e.currentNodeDepth,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isPaneActive,"pane-type":"input","data-test-id":"ndv-input-panel",onActivatePane:e.activatePane,onItemHover:t[2]||(t[2]=m=>e.$emit("itemHover",m)),onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onRunChange:e.onRunIndexChange,onTableMounted:t[3]||(t[3]=m=>e.$emit("tableMounted",m)),onSearch:t[4]||(t[4]=m=>e.$emit("search",m))},Qt({header:w(()=>[f("div",{class:D(e.$style.titleSection)},[e.parentNodes.length?(c(),O(r,{key:0,teleported:"",size:"small","model-value":e.currentNodeName,"no-data-text":e.$locale.baseText("ndv.input.noNodesFound"),placeholder:e.$locale.baseText("ndv.input.parentNodes"),filterable:"","data-test-id":"ndv-input-select","onUpdate:modelValue":e.onInputNodeChange},{prepend:w(()=>[f("span",{class:D(e.$style.title)},T(e.$locale.baseText("ndv.input")),3)]),default:w(()=>[(c(!0),b(Z,null,re(e.parentNodes,m=>(c(),O(a,{key:m.name,value:m.name,class:"node-option",label:`${e.truncate(m.name)} ${e.getMultipleNodesText(m.name)}`,"data-test-id":"ndv-input-option"},{default:w(()=>[f("span",null,T(e.truncate(m.name))+" ",1),e.getMultipleNodesText(m.name)?(c(),b("span",Ku,T(e.getMultipleNodesText(m.name)),1)):(c(),b("span",ju,T(e.$locale.baseText("ndv.input.nodeDistance",{adjustToNumber:m.depth})),1))]),_:2},1032,["value","label"]))),128))]),_:1},8,["model-value","no-data-text","placeholder","onUpdate:modelValue"])):(c(),b("span",{key:1,class:D(e.$style.title)},T(e.$locale.baseText("ndv.input")),3)),e.isActiveNodeConfig&&!e.readOnly?(c(),O(l,{key:2,options:e.inputModes,"model-value":e.inputMode,"onUpdate:modelValue":e.onInputModeChange},null,8,["options","model-value","onUpdate:modelValue"])):E("",!0)],2)]),"node-not-run":w(()=>[e.isActiveNodeConfig&&e.rootNode||e.parentNodes.length?(c(),b("div",{key:0,class:D(e.$style.noOutputData)},[y(d,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.noOutputData.title")),1)]),_:1}),e.readOnly?E("",!0):(c(),O(p,{key:0,visible:e.showDraggableHint&&e.showDraggableHintWithDelay},{content:w(()=>[f("div",{innerHTML:e.$locale.baseText("dataMapping.dragFromPreviousHint",{interpolate:{name:e.focusedMappableInput}})},null,8,qu)]),default:w(()=>[y(h,{type:"secondary","hide-icon":"",transparent:!0,"node-name":e.isActiveNodeConfig?e.rootNode:e.currentNodeName,label:e.$locale.baseText("ndv.input.noOutputData.executePrevious"),"telemetry-source":"inputs","data-test-id":"execute-previous-node",onExecute:e.onNodeExecute},null,8,["node-name","label","onExecute"])]),_:1},8,["visible"])),e.readOnly?E("",!0):(c(),O(d,{key:1,tag:"div",size:"small"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.noOutputData.hint")),1)]),_:1}))],2)):(c(),b("div",{key:1,class:D(e.$style.notConnected)},[f("div",null,[y(g)]),y(d,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.notConnected.title")),1)]),_:1}),y(d,{tag:"div"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.notConnected.message"))+" ",1),f("a",{href:"https://docs.n8n.io/workflows/connections/",target:"_blank",onClick:t[1]||(t[1]=(...m)=>e.onConnectionHelpClick&&e.onConnectionHelpClick(...m))},T(e.$locale.baseText("ndv.input.notConnected.learnMore")),1)]),_:1})],2))]),"no-output-data":w(()=>[y(d,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.noOutputData")),1)]),_:1})]),"recovered-artificial-output-data":w(()=>[f("div",{class:D(e.$style.recoveredOutputData)},[y(d,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),y(d,null,{default:w(()=>[I(T(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.isMappingMode?{name:"before-data",fn:w(()=>[(c(),O(On("style"),null,{default:w(()=>[I("button.linkRun { display: none }")]),_:1})),f("div",{class:D(e.$style.mappedNode)},[y(r,{"model-value":e.mappedNode,size:"small",teleported:"","onUpdate:modelValue":e.onMappedNodeSelected,onClick:t[0]||(t[0]=se(()=>{},["stop"]))},{prepend:w(()=>[I(T(e.$locale.baseText("ndv.input.previousNode")),1)]),default:w(()=>[(c(!0),b(Z,null,re(e.rootNodesParents,m=>(c(),O(a,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])],2)]),key:"0"}:void 0]),1032,["node","run-index","linked-runs","can-link-runs","too-much-data-title","no-data-in-branch-message","is-executing","executing-message","session-id","override-outputs","mapping-enabled","distance-from-active","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onUnlinkRun","onRunChange"])}const Ju={$style:Yu},Xu=x(Vu,[["render",Gu],["__cssModules",Ju],["__scopeId","data-v-51727c96"]]),Qu=z({name:"TriggerPanel",components:{NodeExecuteButton:eo,CopyInput:ni,NodeIcon:tt},props:{nodeName:{type:String},sessionId:{type:String}},setup(){const e=ot();return{workflowHelpers:bt({router:e})}},data:()=>({executionsHelpEventBus:mn()}),computed:{...te(J,X,de,j),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},hideContent(){var e,t,o,n;if(!((e=this.nodeType)!=null&&e.triggerPanel))return!1;if((t=this.nodeType)!=null&&t.triggerPanel&&((o=this.nodeType)!=null&&o.triggerPanel.hasOwnProperty("hideContent"))){const s=(n=this.nodeType)==null?void 0:n.triggerPanel.hideContent;if(typeof s=="boolean")return s;if(this.node){const i=this.workflowHelpers.getCurrentWorkflow().expression.getSimpleParameterValue(this.node,s,"internal",{});if(typeof i=="boolean")return i}}return!1},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},serviceName(){return this.nodeType?ft(this.nodeType):""},displayChatButton(){return!!(this.node&&this.node.type===Qe&&this.node.parameters.mode!=="webhook")},isWebhookNode(){return!!(this.node&&this.node.type===_e)},webhookHttpMethod(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.workflowHelpers.getWebhookExpressionValue(this.nodeType.webhooks[0],"httpMethod")},webhookTestUrl(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.workflowHelpers.getWebhookUrl(this.nodeType.webhooks[0],this.node,"test")},isWebhookBasedNode(){var e,t;return!!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)},isPollingNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return!!this.node&&!this.node.disabled&&this.isWebhookBasedNode&&e&&(!t||t===this.nodeName)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isActivelyPolling(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&this.isPollingNode&&this.nodeName===e},isWorkflowActive(){return this.workflowsStore.isWorkflowActive},listeningTitle(){var e;return((e=this.nodeType)==null?void 0:e.name)===Me?this.$locale.baseText("ndv.trigger.webhookNode.formTrigger.listening"):this.$locale.baseText("ndv.trigger.webhookNode.listening")},listeningHint(){var e;switch((e=this.nodeType)==null?void 0:e.name){case Qe:return this.$locale.baseText("ndv.trigger.webhookBasedNode.chatTrigger.serviceHint");case Me:return this.$locale.baseText("ndv.trigger.webhookBasedNode.formTrigger.serviceHint");default:return this.$locale.baseText("ndv.trigger.webhookBasedNode.serviceHint",{interpolate:{service:this.serviceName}})}},header(){var t;const e=this.nodeType?ft(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingEvent"):(t=this.nodeType)!=null&&t.triggerPanel&&typeof this.nodeType.triggerPanel.header=="string"?this.nodeType.triggerPanel.header:this.isWebhookBasedNode?this.$locale.baseText("ndv.trigger.webhookBasedNode.action",{interpolate:{name:e}}):""},subheader(){const e=this.nodeType?ft(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingHint",{interpolate:{name:e}}):""},executionsHelp(){var e,t;if(((t=(e=this.nodeType)==null?void 0:e.triggerPanel)==null?void 0:t.executionsHelp)!==void 0){if(typeof this.nodeType.triggerPanel.executionsHelp=="string")return this.nodeType.triggerPanel.executionsHelp;if(!this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.inactive)return this.nodeType.triggerPanel.executionsHelp.inactive;if(this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.active)return this.nodeType.triggerPanel.executionsHelp.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):""},activationHint(){var e,t;if(this.isActivelyPolling)return"";if((t=(e=this.nodeType)==null?void 0:e.triggerPanel)!=null&&t.activationHint){if(typeof this.nodeType.triggerPanel.activationHint=="string")return this.nodeType.triggerPanel.activationHint;if(!this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.inactive=="string")return this.nodeType.triggerPanel.activationHint.inactive;if(this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.active=="string")return this.nodeType.triggerPanel.activationHint.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):""}},methods:{expandExecutionHelp(){this.$refs.help&&this.executionsHelpEventBus.emit("expand")},openWebhookUrl(){this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-chat"}),window.open(this.webhookTestUrl,"_blank","noreferrer")},onLinkClick(e){var o;if(!e.target)return;const t=e.target;t.localName==="a"&&(o=t.dataset)!=null&&o.key&&(e.stopPropagation(),e.preventDefault(),t.dataset.key==="activate"?this.$emit("activate"):t.dataset.key==="executions"?(this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-executions-log"}),this.ndvStore.activeNodeName=null,this.$router.push({name:K.EXECUTIONS})):t.dataset.key==="settings"&&this.uiStore.openModal(ss))},onTestLinkCopied(){this.$telemetry.track("User copied webhook URL",{pane:"inputs",type:"test url"})},onNodeExecute(){this.$emit("execute")}}}),Zu="_container_2vg29_5",ec="_header_2vg29_22",tc="_action_2vg29_29",oc="_shake_2vg29_33",nc="_accordion_2vg29_54",sc={container:Zu,header:ec,action:tc,shake:oc,accordion:nc},ic={key:"empty"},ac={key:"listening"},rc={key:0},lc={key:1},dc={key:0},uc={key:"default"},cc={key:0,class:"mb-xl"},hc=["textContent"],pc=["innerHTML"];function fc(e,t,o,n,s,i){const a=S("NodeIcon"),r=S("n8n-pulse"),l=S("n8n-text"),d=S("CopyInput"),h=S("NodeExecuteButton"),p=S("n8n-button"),g=S("n8n-spinner"),N=S("n8n-heading"),m=S("n8n-link"),C=S("n8n-info-accordion");return c(),b("div",{class:D(e.$style.container)},[y(Hi,{name:"fade",mode:"out-in"},{default:w(()=>[e.hasIssues||e.hideContent?(c(),b("div",ic)):e.isListeningForEvents?(c(),b("div",ac,[y(r,null,{default:w(()=>[y(a,{"node-type":e.nodeType,size:40},null,8,["node-type"])]),_:1}),e.isWebhookNode?(c(),b("div",rc,[y(l,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:w(()=>[I(T(e.$locale.baseText("ndv.trigger.webhookNode.listening")),1)]),_:1}),f("div",{class:D([e.$style.shake,"mb-xs"])},[y(l,null,{default:w(()=>[I(T(e.$locale.baseText("ndv.trigger.webhookNode.requestHint",{interpolate:{type:e.webhookHttpMethod}})),1)]),_:1})],2),y(d,{value:e.webhookTestUrl,"toast-title":e.$locale.baseText("ndv.trigger.copiedTestUrl"),class:"mb-2xl",size:"medium",collapse:!0,"copy-button-text":e.$locale.baseText("generic.clickToCopy"),onCopy:e.onTestLinkCopied},null,8,["value","toast-title","copy-button-text","onCopy"]),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])])):(c(),b("div",lc,[y(l,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:w(()=>[I(T(e.listeningTitle),1)]),_:1}),f("div",{class:D([e.$style.shake,"mb-xs"])},[y(l,{tag:"div"},{default:w(()=>[I(T(e.listeningHint),1)]),_:1})],2),e.displayChatButton?(c(),b("div",dc,[y(p,{class:"mb-xl",onClick:t[0]||(t[0]=u=>e.openWebhookUrl())},{default:w(()=>[I(T(e.$locale.baseText("ndv.trigger.chatTrigger.openChat")),1)]),_:1})])):E("",!0),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])]))])):(c(),b("div",uc,[e.isActivelyPolling?(c(),b("div",cc,[y(g,{type:"ring"})])):E("",!0),f("div",{class:D(e.$style.action)},[f("div",{class:D(e.$style.header)},[e.header?(c(),O(N,{key:0,tag:"h1",bold:""},{default:w(()=>[I(T(e.header),1)]),_:1})):E("",!0),e.subheader?(c(),O(l,{key:1},{default:w(()=>[f("span",{textContent:T(e.subheader)},null,8,hc)]),_:1})):E("",!0)],2),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])],2),e.activationHint?(c(),O(l,{key:1,size:"small",onClick:e.onLinkClick},{default:w(()=>[f("span",{innerHTML:e.activationHint},null,8,pc),I(" ")]),_:1},8,["onClick"])):E("",!0),e.activationHint&&e.executionsHelp?(c(),O(m,{key:2,size:"small",onClick:e.expandExecutionHelp},{default:w(()=>[I(T(e.$locale.baseText("ndv.trigger.moreInfo")),1)]),_:1},8,["onClick"])):E("",!0),e.executionsHelp?(c(),O(C,{key:3,ref:"help",class:D(e.$style.accordion),title:e.$locale.baseText("ndv.trigger.executionsHint.question"),description:e.executionsHelp,"event-bus":e.executionsHelpEventBus,"onClick:body":e.onLinkClick},null,8,["class","title","description","event-bus","onClick:body"])):E("",!0)]))]),_:1})],2)}const gc={$style:sc},mc=x(Qu,[["render",fc],["__cssModules",gc],["__scopeId","data-v-4b3bae7d"]]),yc=z({name:"NodeDetailsView",components:{NodeSettings:kr,InputPanel:Xu,OutputPanel:Ou,NDVDraggablePanels:wl,TriggerPanel:mc},mixins:[Go],props:{readOnly:{type:Boolean},renaming:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1}},setup(e,t){var d,h;const o=X(),n=Ee(),s=We(),{activeNode:i}=kt(o),a=Se(i),r=ot(),l=bt({router:r});return{externalHooks:n,nodeHelpers:s,pinnedData:a,workflowHelpers:l,...De(),...Gt(),...(h=(d=Go).setup)==null?void 0:h.call(d,e,t)}},data(){return{settingsEventBus:mn(),redrawRequired:!1,runInputIndex:-1,runOutputIndex:-1,isLinkingEnabled:!0,selectedInput:void 0,triggerWaitingWarningEnabled:!1,isDragging:!1,mainPanelPosition:0,pinDataDiscoveryTooltipVisible:!1,avgInputRowHeight:0,avgOutputRowHeight:0,isInputPaneActive:!1,isOutputPaneActive:!1,isPairedItemHoveringEnabled:!0}},mounted(){ke.on("data-pinning-discovery",this.setIsTooltipVisible)},beforeUnmount(){ke.off("data-pinning-discovery",this.setIsTooltipVisible)},computed:{...te(J,X,de,j,yn),sessionId(){return this.ndvStore.sessionId},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},showTriggerWaitingWarning(){return this.triggerWaitingWarningEnabled&&!!this.activeNodeType&&!this.activeNodeType.group.includes("trigger")&&this.workflowRunning&&this.workflowsStore.executionWaitingForWebhook},activeNode(){return this.ndvStore.activeNode},inputNodeName(){return this.selectedInput||this.parentNode},inputNode(){return this.inputNodeName?this.workflowsStore.getNodeByName(this.inputNodeName):null},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},showTriggerPanel(){var n,s,i,a,r;const e=!!((n=this.activeNodeType)!=null&&n.triggerPanel);if(typeof((s=this.activeNodeType)==null?void 0:s.triggerPanel)=="boolean")return e;const t=!!((a=(i=this.activeNodeType)==null?void 0:i.webhooks)!=null&&a.length),o=(r=this.activeNodeType)==null?void 0:r.polling;return!this.readOnly&&this.isTriggerNode&&(t||o||e)},workflow(){return this.workflowHelpers.getCurrentWorkflow()},hasOutputConnection(){var t,o;if(!this.activeNode)return!1;const e=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);return(((o=(t=Object.values(e))==null?void 0:t[0])==null?void 0:o[0])??[]).length>0},parentNodes(){return this.activeNode?this.workflow.getParentNodesByDepth(this.activeNode.name,1).map(({name:e})=>e)||[]:[]},parentNode(){var e;for(const t of this.parentNodes)if(this.workflowsStore.pinnedWorkflowData[t]||(e=this.workflowRunData)!=null&&e[t])return t;return this.parentNodes[0]},isExecutableTriggerNode(){return this.activeNodeType?is.includes(this.activeNodeType.name):!1},isTriggerNode(){return!!this.activeNodeType&&(this.activeNodeType.group.includes("trigger")||this.activeNodeType.name===Ht)},isActiveStickyNode(){return!!this.ndvStore.activeNode&&this.ndvStore.activeNode.type===ce},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},maxOutputRun(){if(this.activeNode===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.activeNode.name)?0:e[this.activeNode.name].length?e[this.activeNode.name].length-1:0},outputRun(){return this.runOutputIndex===-1?this.maxOutputRun:Math.min(this.runOutputIndex,this.maxOutputRun)},maxInputRun(){if(this.inputNode===null||this.activeNode===null)return 0;const e=this.workflow.getNode(this.activeNode.name),t=Te(this.workflow,e,this.activeNodeType);let o=this.inputNode;const n=this.workflowRunData;return t.some(s=>s!==M.Main)&&(o=this.activeNode),!o||!n||!n.hasOwnProperty(o.name)?0:n[o.name].length?n[o.name].length-1:0},inputRun(){return this.isLinkingEnabled&&this.maxOutputRun===this.maxInputRun?this.outputRun:this.runInputIndex===-1?this.maxInputRun:Math.min(this.runInputIndex,this.maxInputRun)},canLinkRuns(){return this.maxOutputRun>0&&this.maxOutputRun===this.maxInputRun},linked(){return this.isLinkingEnabled&&this.canLinkRuns},inputPanelMargin(){return this.isTriggerNode?0:80},featureRequestUrl(){return this.activeNodeType?`${as}${this.activeNodeType.name}`:""},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isWorkflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isExecutionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},blockUi(){return this.isWorkflowRunning||this.isExecutionWaitingForWebhook},foreignCredentials(){const e=(this.activeNode||{}).credentials,t=this.workflowsStore.usedCredentials,o=[];return e&&this.settingsStore.isEnterpriseFeatureEnabled(wn.Sharing)&&Object.values(e).forEach(n=>{n.id&&t[n.id]&&!t[n.id].currentUserHasAccess&&o.push(n.id)}),o},hasForeignCredential(){return this.foreignCredentials.length>0}},watch:{activeNode(e,t){e&&e.name!==(t==null?void 0:t.name)&&!this.isActiveStickyNode&&(this.runInputIndex=-1,this.runOutputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=void 0,this.triggerWaitingWarningEnabled=!1,this.avgOutputRowHeight=0,this.avgInputRowHeight=0,setTimeout(()=>this.ndvStore.setNDVSessionId(),0),this.externalHooks.run("dataDisplay.nodeTypeChanged",{nodeSubtitle:this.nodeHelpers.getNodeSubtitle(e,this.activeNodeType,this.workflowHelpers.getCurrentWorkflow())}),setTimeout(()=>{var o;if(this.activeNode){const n=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);this.$telemetry.track("User opened node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,is_editable:!this.hasForeignCredential,parameters_pane_position:this.mainPanelPosition,input_first_connector_runs:this.maxInputRun,output_first_connector_runs:this.maxOutputRun,selected_view_inputs:this.isTriggerNode?"trigger":this.ndvStore.inputPanelDisplayMode,selected_view_outputs:this.ndvStore.outputPanelDisplayMode,input_connectors:this.parentNodes.length,output_connectors:(o=n==null?void 0:n.main)==null?void 0:o.length,input_displayed_run_index:this.inputRun,output_displayed_run_index:this.outputRun,data_pinning_tooltip_presented:this.pinDataDiscoveryTooltipVisible,input_displayed_row_height_avg:this.avgInputRowHeight,output_displayed_row_height_avg:this.avgOutputRowHeight})}},2e3)),window.top&&!this.isActiveStickyNode&&window.top.postMessage(JSON.stringify({command:e?"openNDV":"closeNDV"}),"*")},maxOutputRun(){this.runOutputIndex=-1},maxInputRun(){this.runInputIndex=-1},inputNodeName(e){setTimeout(()=>{this.ndvStore.setInputNodeName(e)},0)},inputRun(){setTimeout(()=>{this.ndvStore.setInputRunIndex(this.inputRun)},0)}},methods:{setIsTooltipVisible({isTooltipVisible:e}){this.pinDataDiscoveryTooltipVisible=e},onKeyDown(e){if(e.key==="s"&&this.isCtrlKeyPressed(e)){if(e.stopPropagation(),e.preventDefault(),this.readOnly)return;this.$emit("saveKeyboardShortcut",e)}},onInputItemHover(e){if(e===null||!this.inputNodeName||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.inputNodeName,runIndex:this.inputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onOutputItemHover(e){if(e===null||!this.activeNode||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.activeNode.name,runIndex:this.outputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onInputTableMounted(e){this.avgInputRowHeight=e.avgRowHeight},onOutputTableMounted(e){this.avgOutputRowHeight=e.avgRowHeight},onWorkflowActivate(){this.ndvStore.activeNodeName=null,setTimeout(()=>{this.activateCurrentWorkflow("ndv")},1e3)},onFeatureRequestClick(){window.open(this.featureRequestUrl,"_blank"),this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:M.Main,type:"i-wish-this-node-would"})},onPanelsInit(e){this.mainPanelPosition=e.position},onDragStart(e){this.isDragging=!0,this.mainPanelPosition=e.position},onDragEnd(e){this.isDragging=!1,this.$telemetry.track("User moved parameters pane",{window_width:e.windowWidth,start_position:this.mainPanelPosition,end_position:e.position,node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.mainPanelPosition=e.position},onLinkRunToInput(){this.runOutputIndex=this.runInputIndex,this.isLinkingEnabled=!0,this.trackLinking("input")},onLinkRunToOutput(){this.isLinkingEnabled=!0,this.trackLinking("output")},onUnlinkRun(e){this.runInputIndex=this.runOutputIndex,this.isLinkingEnabled=!1,this.trackLinking(e)},trackLinking(e){this.$telemetry.track("User changed ndv run linking",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,linked:this.linked,pane:e})},onNodeExecute(){setTimeout(()=>{!this.activeNode||!this.workflowRunning||(this.triggerWaitingWarningEnabled=!0)},1e3)},openSettings(){this.settingsEventBus.emit("openSettings")},valueChanged(e){this.$emit("valueChanged",e)},nodeTypeSelected(e){this.$emit("nodeTypeSelected",e)},onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},onOpenConnectionNodeCreator(e,t){this.$emit("openConnectionNodeCreator",e,t)},async close(){var e,t;if(!this.isDragging){if(this.activeNode&&(typeof((e=this.activeNodeType)==null?void 0:e.outputs)=="string"||typeof((t=this.activeNodeType)==null?void 0:t.inputs)=="string"||this.redrawRequired)){const o=this.activeNode.name;setTimeout(()=>{this.$emit("redrawNode",o)},1)}if(this.outputPanelEditMode.enabled&&this.activeNode){if(await this.confirm("",this.$locale.baseText("ndv.pinData.beforeClosing.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.cancel")})===xe){const{value:n}=this.outputPanelEditMode;try{this.pinnedData.setData(Nt(n),"on-ndv-close-modal")}catch(s){console.error(s)}}this.ndvStore.setOutputPanelEditModeEnabled(!1)}await this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.$telemetry.track("User closed node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.triggerWaitingWarningEnabled=!1,this.ndvStore.activeNodeName=null,this.ndvStore.resetNDVSessionId()}},onRunOutputIndexChange(e){this.runOutputIndex=e,this.trackRunChange(e,"output")},onRunInputIndexChange(e){this.runInputIndex=e,this.linked&&(this.runOutputIndex=e),this.trackRunChange(e,"input")},trackRunChange(e,t){this.$telemetry.track("User changed ndv run dropdown",{session_id:this.sessionId,run_index:e,node_type:this.activeNodeType?this.activeNodeType.name:"",pane:t})},onInputNodeChange(e,t){this.runInputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=e,this.$telemetry.track("User changed ndv input dropdown",{node_type:this.activeNode?this.activeNode.type:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId,selection_value:t,input_node_type:this.inputNode?this.inputNode.type:""})},onStopExecution(){this.$emit("stopExecution")},activateInputPane(){this.isInputPaneActive=!0,this.isOutputPaneActive=!1},activateOutputPane(){this.isInputPaneActive=!1,this.isOutputPaneActive=!0},onSearch(e){this.isPairedItemHoveringEnabled=!e}}}),wc="_modalBackground_17uio_5",vc="_triggerWarning_17uio_10",Nc="_backToCanvas_17uio_14",kc="_featureRequest_17uio_35",bc={modalBackground:wc,triggerWarning:vc,backToCanvas:Nc,featureRequest:kc};function Tc(e,t,o,n,s,i){const a=S("n8n-icon"),r=S("n8n-text"),l=S("n8n-tooltip"),d=S("TriggerPanel"),h=S("InputPanel"),p=S("OutputPanel"),g=S("NodeSettings"),N=S("font-awesome-icon"),m=S("NDVDraggablePanels"),C=S("el-dialog");return c(),O(C,{"model-value":(!!e.activeNode||e.renaming)&&!e.isActiveStickyNode,"before-close":e.close,"show-close":!1,class:"data-display-wrapper ndv-wrapper","overlay-class":"data-display-overlay",width:"auto","append-to-body":"","data-test-id":"ndv","data-has-output-connection":e.hasOutputConnection},{default:w(()=>{var u;return[y(l,{placement:"bottom-start",visible:e.showTriggerWaitingWarning,disabled:!e.showTriggerWaitingWarning},{content:w(()=>[f("div",{class:D(e.$style.triggerWarning)},T(e.$locale.baseText("ndv.backToCanvas.waitingForTriggerWarning")),3)]),default:w(()=>[f("div",{class:D(e.$style.backToCanvas),"data-test-id":"back-to-canvas",onClick:t[0]||(t[0]=(...k)=>e.close&&e.close(...k))},[y(a,{icon:"arrow-left",color:"text-xlight",size:"medium"}),y(r,{color:"text-xlight",size:"medium",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("ndv.backToCanvas")),1)]),_:1})],2)]),_:1},8,["visible","disabled"]),e.activeNode?(c(),b("div",{key:0,ref:"container",class:"data-display",tabindex:"0",onKeydownCapture:t[6]||(t[6]=(...k)=>e.onKeyDown&&e.onKeyDown(...k))},[f("div",{class:D(e.$style.modalBackground),onClick:t[1]||(t[1]=(...k)=>e.close&&e.close(...k))},null,2),(c(),O(m,{key:e.activeNode.name,"is-trigger-node":e.isTriggerNode,"hide-input-and-output":e.activeNodeType===null,position:e.isTriggerNode&&!e.showTriggerPanel?0:void 0,"is-draggable":!e.isTriggerNode,"has-double-width":((u=e.activeNodeType)==null?void 0:u.parameterPane)==="wide","node-type":e.activeNodeType,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator,onClose:e.close,onInit:e.onPanelsInit,onDragstart:e.onDragStart,onDragend:e.onDragEnd},Qt({output:w(()=>[y(p,{"data-test-id":"output-panel","can-link-runs":e.canLinkRuns,"run-index":e.outputRun,"linked-runs":e.linked,"session-id":e.sessionId,"is-read-only":e.readOnly||e.hasForeignCredential,"block-u-i":e.blockUi&&e.isTriggerNode&&!e.isExecutableTriggerNode,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isOutputPaneActive,onActivatePane:e.activateOutputPane,onLinkRun:e.onLinkRunToOutput,onUnlinkRun:t[3]||(t[3]=()=>e.onUnlinkRun("output")),onRunChange:e.onRunOutputIndexChange,onOpenSettings:e.openSettings,onTableMounted:e.onOutputTableMounted,onItemHover:e.onOutputItemHover,onSearch:e.onSearch},null,8,["can-link-runs","run-index","linked-runs","session-id","is-read-only","block-u-i","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onTableMounted","onItemHover","onSearch"])]),main:w(()=>[y(g,{"event-bus":e.settingsEventBus,dragging:e.isDragging,"session-id":e.sessionId,"node-type":e.activeNodeType,"foreign-credentials":e.foreignCredentials,"read-only":e.readOnly,"block-u-i":e.blockUi&&e.showTriggerPanel,executable:!e.readOnly,onValueChanged:e.valueChanged,onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution,onRedrawRequired:t[4]||(t[4]=k=>e.redrawRequired=!0),onActivate:e.onWorkflowActivate,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator},null,8,["event-bus","dragging","session-id","node-type","foreign-credentials","read-only","block-u-i","executable","onValueChanged","onExecute","onStopExecution","onActivate","onSwitchSelectedNode","onOpenConnectionNodeCreator"]),e.featureRequestUrl?(c(),b("a",{key:0,class:D(e.$style.featureRequest),target:"_blank",onClick:t[5]||(t[5]=(...k)=>e.onFeatureRequestClick&&e.onFeatureRequestClick(...k))},[y(N,{icon:"lightbulb"}),I(" "+T(e.$locale.baseText("ndv.featureRequest")),1)],2)):E("",!0)]),_:2},[e.showTriggerPanel||!e.isTriggerNode?{name:"input",fn:w(()=>[e.showTriggerPanel?(c(),O(d,{key:0,"node-name":e.activeNode.name,"session-id":e.sessionId,onExecute:e.onNodeExecute,onActivate:e.onWorkflowActivate},null,8,["node-name","session-id","onExecute","onActivate"])):e.isTriggerNode?E("",!0):(c(),O(h,{key:1,workflow:e.workflow,"can-link-runs":e.canLinkRuns,"run-index":e.inputRun,"linked-runs":e.linked,"current-node-name":e.inputNodeName,"session-id":e.sessionId,"read-only":e.readOnly||e.hasForeignCredential,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isInputPaneActive,onActivatePane:e.activateInputPane,onLinkRun:e.onLinkRunToInput,onUnlinkRun:t[2]||(t[2]=()=>e.onUnlinkRun("input")),onRunChange:e.onRunInputIndexChange,onOpenSettings:e.openSettings,onChangeInputNode:e.onInputNodeChange,onExecute:e.onNodeExecute,onTableMounted:e.onInputTableMounted,onItemHover:e.onInputItemHover,onSearch:e.onSearch},null,8,["workflow","can-link-runs","run-index","linked-runs","current-node-name","session-id","read-only","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onChangeInputNode","onExecute","onTableMounted","onItemHover","onSearch"]))]),key:"0"}:void 0]),1032,["is-trigger-node","hide-input-and-output","position","is-draggable","has-double-width","node-type","onSwitchSelectedNode","onOpenConnectionNodeCreator","onClose","onInit","onDragstart","onDragend"]))],544)):E("",!0)]}),_:1},8,["model-value","before-close","data-has-output-connection"])}const Sc={$style:bc},Dc=x(yc,[["render",Tc],["__cssModules",Sc]]),Ec=z({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const o=nt(),{position:n,isOpen:s,actions:i,target:a}=o,r=F(),l=t;Xt(s,()=>{var p,g;s?(p=r.value)==null||p.open():(g=r.value)==null||g.close()},{flush:"post"});function d(p){const g=p;o._dispatchAction(g),l("action",g,o.targetNodes.value)}function h(p){p||o.close()}return(p,g)=>L(s)?(c(),O(Pn,{key:0,to:"body"},[f("div",{class:D(p.$style.contextMenu),style:ee({left:`${L(n)[0]}px`,top:`${L(n)[1]}px`})},[y(L(rs),{ref_key:"dropdown",ref:r,items:L(i),placement:"bottom-start","data-test-id":"context-menu","hide-arrow":L(a).source!=="node-button",onSelect:d,onVisibleChange:h},{activator:w(()=>[f("div",{class:D(p.$style.activator)},null,2)]),_:1},8,["items","hide-arrow"])],6)])):E("",!0)}}),Cc="_contextMenu_2nizv_5",Ic="_activator_2nizv_9",Pc={contextMenu:Cc,activator:Ic},Oc={$style:Pc},$c=x(Ec,[["__cssModules",Oc]]),Rc=(e,t)=>{const o=cs.includes(e);return{type:"N8nAddInput",options:{width:24,height:72,color:t,multiple:o}}},_c=()=>({type:"Rectangle",options:{height:10,width:10,cssClass:"diamond-output-endpoint"}}),Wn=z({data(){return{inputs:[],outputs:[]}},mounted(){if(this.data!==null)try{this.__addNode(this.data)}catch{}},computed:{...te(J,de,jt,j,Jt),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""}},props:{name:{type:String,required:!0},instance:{type:Object},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean},workflow:{type:Object,required:!0}},methods:{__addEndpointTestingData(e,t,o){if(window!=null&&window.Cypress&&"canvas"in e.endpoint){const n=e.endpoint.canvas;this.instance.setAttribute(n,"data-endpoint-name",this.data.name),this.instance.setAttribute(n,"data-input-index",o.toString()),this.instance.setAttribute(n,"data-endpoint-type",t)}},__addInputEndpoints(e,t){const o={},n={},s=fe(this.workflow,this.data,t)||[];this.inputs=s;const i=[...s];i.sort((a,r)=>typeof a=="string"?1:typeof r=="string"||a.required&&!r.required?-1:!a.required&&r.required?1:0),i.forEach((a,r)=>{var A,$;let l;typeof a=="string"?l={type:a}:l=a;const d=l.type,h=d===M.Main?M.Main:"other";o.hasOwnProperty(h)?o[h]++:o[h]=0,n.hasOwnProperty(d)?n[d]++:n[d]=0;const p=o[h],g=n[d],N=s.filter(B=>{const U=typeof B=="string"?B:B.type;return d===M.Main?U===M.Main:U!==M.Main}),m=N.filter(B=>B!==M.Main),C=m.filter(B=>typeof B!="string"&&B.required),u=m.filter(B=>typeof B!="string"&&!B.required),k=this.getSpacerIndexes(C.length,u.length),v=Wo(d,"input",N.length,k)[p],P=Bt(d),_={uuid:Sn(this.nodeId,d,g),anchor:v,maxConnections:l.maxConnections??-1,endpoint:"Rectangle",paintStyle:Ct(t,"--color-foreground-xdark",d),hoverPaintStyle:Ct(t,"--color-primary",d),scope:si(P),source:d!==M.Main,target:!this.isReadOnly&&s.length>1,parameters:{connection:"target",nodeId:this.nodeId,type:d,index:g},enabled:!this.isReadOnly,cssClass:"rect-input-endpoint",dragAllowedWhenFull:!0,hoverClass:"rect-input-endpoint-hover",...this.__getInputConnectionStyle(d,t)},R=(A=this.instance)==null?void 0:A.addEndpoint(this.$refs[this.data.name],_);this.__addEndpointTestingData(R,"input",g),(l.displayName||($=t.inputNames)!=null&&$[r])&&R.addOverlay(ii(l.displayName||t.inputNames[r],d,l.required)),Array.isArray(R)||(R.__meta={nodeName:e.name,nodeId:this.nodeId,index:g,totalEndpoints:N.length,nodeType:e.type})}),i.length===0&&this.instance.manage(this.$refs[this.data.name])},getSpacerIndexes(e,t,o=ls,n=ds){const s=[];if(e>0&&t>0){if(o)s.push(e);else if(e+t<n)for(let i=e;i<n-t;i++)s.push(i)}else if(e>0&&e<n&&t===0)for(let i=0;i<n-e;i++)s.push(i+e);else if(e===0&&t>0&&t<n)for(let i=0;i<n-t;i++)s.push(i);return s},__addOutputEndpoints(e,t){const o={},n={};this.outputs=Te(this.workflow,this.data,t)||[];let s=0;const i=[];this.outputs.forEach((r,l)=>{var h;let d;typeof r=="string"?d={type:r}:d=r,(h=t.outputNames)!=null&&h[l]&&(d.displayName=t.outputNames[l]),d.displayName&&(s=d.displayName.length>s?d.displayName.length:s),i.push(d)});const a=s<4?"short":"medium";this.outputs.forEach((r,l)=>{const d=i[l],h=d.type,p=h===M.Main?M.Main:"other";o.hasOwnProperty(p)?o[p]++:o[p]=0,n.hasOwnProperty(h)?n[h]++:n[h]=0;const g=o[p],N=n[h],m=this.outputs.filter(P=>{const _=typeof P=="string"?P:P.type;return h===M.Main?_===M.Main:_!==M.Main}),C=Wo(h,"output",m.length)[g],u=Bt(h),k={uuid:Ut(this.nodeId,h,N),anchor:C,maxConnections:-1,endpoint:{type:"Dot",options:{radius:t&&m.length>2?7:9}},hoverPaintStyle:je(t,"--color-primary"),scope:u,source:!0,target:h!==M.Main,enabled:!this.isReadOnly,parameters:{connection:"source",nodeId:this.nodeId,type:h,index:N},hoverClass:"dot-output-endpoint-hover",connectionsDirected:!0,dragAllowedWhenFull:!1,...this.__getOutputConnectionStyle(h,d,t)},v=this.instance.addEndpoint(this.$refs[this.data.name],k);if(this.__addEndpointTestingData(v,"output",N),d.displayName){const P=ai(d.displayName,h,d==null?void 0:d.category);v.addOverlay(P)}if(Array.isArray(v)||(v.__meta={nodeName:e.name,nodeId:this.nodeId,index:N,totalEndpoints:m.length,endpointLabelLength:a}),!this.isReadOnly&&h===M.Main){const P={uuid:Ut(this.nodeId,h,N),anchor:C,maxConnections:-1,endpoint:{type:"N8nPlus",options:{dimensions:24,connectedEndpoint:v,showOutputLabel:this.outputs.length===1,size:this.outputs.length>=3?"small":"medium",endpointLabelLength:a,hoverMessage:this.$locale.baseText("nodeBase.clickToAddNodeOrDragToConnect")}},source:!0,target:!1,enabled:!this.isReadOnly,paintStyle:{outlineStroke:"none"},hoverPaintStyle:{outlineStroke:"none"},parameters:{connection:"source",nodeId:this.nodeId,type:h,index:N,category:d==null?void 0:d.category},cssClass:"plus-draggable-endpoint",dragAllowedWhenFull:!1};d!=null&&d.category&&(P.cssClass=`${P.cssClass} ${d==null?void 0:d.category}`);const _=this.instance.addEndpoint(this.$refs[this.data.name],P);this.__addEndpointTestingData(_,"plus",N),Array.isArray(_)||(_.__meta={nodeName:e.name,nodeId:this.nodeId,index:N,nodeType:e.type,totalEndpoints:m.length})}})},__addNode(e){const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion)??this.nodeTypesStore.getNodeType(us);this.__addInputEndpoints(e,t),this.__addOutputEndpoints(e,t)},__getEndpointColor(e){return`--node-type-${e}-color`},__getInputConnectionStyle(e,t){return e===M.Main?{paintStyle:Ct(t,this.__getEndpointColor(M.Main),e)}:Object.values(M).includes(e)?(n=>({endpoint:Rc(n,this.__getEndpointColor(n))}))(e):{}},__getOutputConnectionStyle(e,t,o){const n="output",s=i=>({endpoint:_c(),paintStyle:je(o,this.__getEndpointColor(i)),hoverPaintStyle:je(o,this.__getEndpointColor(i))});return e===M.Main?t.category==="error"?{paintStyle:{...je(o,this.__getEndpointColor(M.Main)),fill:"var(--node-error-output-color)"},cssClass:`dot-${n}-endpoint`}:{paintStyle:je(o,this.__getEndpointColor(M.Main)),cssClass:`dot-${n}-endpoint`}:Object.values(M).includes(e)?s(e):{}},touchEnd(e){De().isTouchDevice&&this.uiStore.isActionActive("dragActive")&&this.uiStore.removeActiveAction("dragActive")},mouseLeftClick(e){const t=De(),o=e.path||e.composedPath&&e.composedPath();for(let n=0;n<o.length;n++)if(o[n].className&&typeof o[n].className=="string"&&o[n].className.includes("no-select-on-click"))return;t.isTouchDevice||(this.uiStore.isActionActive("dragActive")?this.uiStore.removeActiveAction("dragActive"):(t.isCtrlKeyPressed(e)||this.$emit("deselectAllNodes"),this.uiStore.isNodeSelected(this.data.name)?this.$emit("deselectNode",this.name):this.$emit("nodeSelected",this.name)))}}}),Ac=z({name:"Node",components:{TitledList:Vt,FontAwesomeIcon:hs,NodeIcon:tt},mixins:[Wn],props:{isProductionExecutionPreview:{type:Boolean,default:!1},disablePointerEvents:{type:Boolean,default:!1},hideNodeIssues:{type:Boolean,default:!1}},setup(e){const t=j(),o=nt(),n=Ee(),s=We(),i=t.getNodeByName(e.name),a=Se(i),r=De(),{callDebounced:l}=vt();return{contextMenu:o,externalHooks:n,nodeHelpers:s,pinnedData:a,deviceSupport:r,callDebounced:l}},computed:{...te(J,X,de,j),showPinnedDataInfo(){return this.pinnedData.hasData.value&&!this.isProductionExecutionPreview},isDuplicatable(){return this.nodeType?dn.includes(this.nodeType.name)?!1:this.nodeType.maxNodes===void 0||this.sameTypeNodes.length<this.nodeType.maxNodes:!0},isScheduledGroup(){var e;return((e=this.nodeType)==null?void 0:e.group.includes("schedule"))===!0},iconColorDefault(){if(this.isConfigNode)return"var(--color-text-base)"},nodeRunData(){var e;return this.workflowsStore.getWorkflowResultDataByNodeName(((e=this.data)==null?void 0:e.name)||"")||[]},hasIssues(){var e;return this.nodeExecutionStatus&&["crashed","error","failed"].includes(this.nodeExecutionStatus)?!0:this.pinnedData.hasData.value?!1:!!(((e=this.data)==null?void 0:e.issues)!==void 0&&Object.keys(this.data.issues).length)},workflowDataItems(){const e=this.nodeRunData;return e===null?0:e.length},canvasOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},getTriggerNodeTooltip(){if(this.nodeType!==null&&this.nodeType.hasOwnProperty("eventTriggerDescription")){const e=this.$locale.shortNodeType(this.nodeType.name),{eventTriggerDescription:t}=this.nodeType;return this.$locale.nodeText().eventTriggerDescription(e,t||"")}else return this.$locale.baseText("node.waitingForYouToCreateAnEventIn",{interpolate:{nodeType:this.nodeType?ft(this.nodeType):""}})},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isExecuting(){return this.workflowsStore.isNodeExecuting(this.data.name)},isSingleActiveTriggerNode(){return this.workflowsStore.workflowTriggerNodes.filter(t=>{const o=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);return o&&o.eventTriggerDescription!==""&&!t.disabled}).length===1},isManualTypeNode(){return this.data.type===Ze},isConfigNode(){var e;return this.nodeTypesStore.isConfigNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??"")},isConfigurableNode(){var e;return this.nodeTypesStore.isConfigurableNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??"")},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode(((e=this.data)==null?void 0:e.type)||"")},isTriggerNodeTooltipEmpty(){return this.nodeType!==null?this.nodeType.eventTriggerDescription==="":!1},isNodeDisabled(){return this.node&&this.node.disabled},nodeType(){return this.data&&this.nodeTypesStore.getNodeType(this.data.type,this.data.typeVersion)},node(){return this.workflowsStore.nodesByName[this.name]},sameTypeNodes(){return this.workflowsStore.allNodes.filter(e=>e.type===this.data.type)},nodeWrapperClass(){const e={"node-wrapper":!0,"node-wrapper--trigger":this.isTriggerNode,"node-wrapper--configurable":this.isConfigurableNode,"node-wrapper--config":this.isConfigNode};if(this.outputs.length){const o=ge(this.outputs).filter(n=>n!==M.Main);o.length&&o.forEach(n=>{e[`node-wrapper--connection-type-${n}`]=!0})}return e},nodeWrapperStyles(){const e={left:this.position[0]+"px",top:this.position[1]+"px"};if(this.node&&this.nodeType){const t=fe(this.workflow,this.node,this.nodeType)||[],n=ge(t).filter(r=>r!==M.Main);if(n.length){t.filter(l=>typeof l!="string"&&l.required);let r=0;e["--configurable-node-input-count"]=n.length+r}let s=[];this.workflow.nodes[this.node.name]&&(s=Te(this.workflow,this.node,this.nodeType));const a=ge(s).filter(r=>r===M.Main);e["--node-main-output-count"]=a.length}return e},nodeClass(){return{"node-box":!0,disabled:this.data.disabled,executing:this.isExecuting}},nodeExecutionStatus(){var t;const e=(t=this.workflowsStore.getWorkflowRunData)==null?void 0:t[this.name];return e?e.filter(Boolean)[0].executionStatus??"":""},nodeIssues(){var o,n;const e=[],t=(o=this.workflowsStore.getWorkflowRunData)==null?void 0:o[this.name];return t&&t.forEach(s=>{s!=null&&s.error&&e.push(`${s.error.message}${s.error.description?` (${s.error.description})`:""}`)}),((n=this.data)==null?void 0:n.issues)!==void 0&&e.push(...pn(this.data.issues,this.data)),e},nodeDisabledTitle(){return this.data.disabled?this.$locale.baseText("node.enable"):this.$locale.baseText("node.disable")},position(){return this.node?this.node.position:[0,0]},showDisabledLinethrough(){return!this.isConfigurableNode&&!!(this.data.disabled&&this.inputs.length===1&&this.outputs.length===1)},shortNodeType(){return this.$locale.shortNodeType(this.data.type)},nodeTitle(){return this.data.name==="Start"?this.$locale.headerText({key:"headers.start.displayName",fallback:"Start"}):this.data.name},waiting(){const e=this.workflowsStore.getWorkflowExecution;if(e!=null&&e.waitTill){const t=ye(e,"data.resultData.lastNodeExecuted");if(this.name===t){const o=new Date(e.waitTill);return o.toISOString()===ps?this.$locale.baseText("node.theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall"):this.$locale.baseText("node.nodeIsWaitingTill",{interpolate:{date:o.toLocaleDateString(),time:o.toLocaleTimeString()}})}}},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},nodeStyle(){var o,n,s;const e={};let t="--color-foreground-xdark";return(this.isConfigurableNode||this.isConfigNode)&&(t="--color-foreground-dark"),this.data.disabled?t="--color-foreground-base":this.isExecuting||(this.hasIssues&&!this.hideNodeIssues?((s=(n=(o=this.nodeRunData)==null?void 0:o[0])==null?void 0:n.error)==null?void 0:s.functionality)!=="configuration-node"&&(t="--color-danger",e["border-width"]="2px",e["border-style"]="solid"):this.waiting||this.showPinnedDataInfo?t="--color-canvas-node-pinned-border":this.nodeExecutionStatus==="unknown"?t="--color-foreground-xdark":this.workflowDataItems&&(e["border-width"]="2px",e["border-style"]="solid",t="--color-success")),e["border-color"]=`var(${t})`,e},isSelected(){return this.uiStore.getSelectedNodes.find(e=>e.name===this.data.name)!==void 0},shiftOutputCount(){return!!(this.nodeType&&this.outputs.length>2)},shouldShowTriggerTooltip(){return!!this.node&&this.isTriggerNode&&!this.isPollingTypeNode&&!this.pinnedData.hasData.value&&!this.isNodeDisabled&&this.workflowRunning&&this.workflowDataItems===0&&this.isSingleActiveTriggerNode&&!this.isTriggerNodeTooltipEmpty&&!this.hasIssues&&!this.dragging},isContextMenuOpen(){var e;return this.contextMenu.isOpen.value&&this.contextMenu.target.value.source==="node-button"&&this.contextMenu.target.value.node.name===((e=this.data)==null?void 0:e.name)}},watch:{isActive(e,t){!e&&t&&this.setSubtitle()},canvasOffsetPosition(){this.showTriggerNodeTooltip&&(this.showTriggerNodeTooltip=!1,setTimeout(()=>{this.showTriggerNodeTooltip=this.shouldShowTriggerTooltip},200)),this.pinDataDiscoveryTooltipVisible&&(this.pinDataDiscoveryTooltipVisible=!1,setTimeout(()=>{this.pinDataDiscoveryTooltipVisible=!0},200))},shouldShowTriggerTooltip(e){e?setTimeout(()=>{this.showTriggerNodeTooltip=this.shouldShowTriggerTooltip},2500):this.showTriggerNodeTooltip=!1},nodeRunData(e){this.data&&this.$emit("run",{name:this.data.name,data:e,waiting:!!this.waiting})}},created(){Ae(Mt).value||(this.unwatchWorkflowDataItems=this.$watch("workflowDataItems",t=>{this.showPinDataDiscoveryTooltip(t)}))},mounted(){setTimeout(()=>{this.setSubtitle()},0),this.nodeRunData&&setTimeout(()=>{this.$emit("run",{name:this.data&&this.data.name,data:this.nodeRunData,waiting:!!this.waiting})},0)},data(){return{isTouchActive:!1,nodeSubtitle:"",showTriggerNodeTooltip:!1,pinDataDiscoveryTooltipVisible:!1,dragging:!1,unwatchWorkflowDataItems:()=>{}}},methods:{showPinDataDiscoveryTooltip(e){!this.isTriggerNode||this.isManualTypeNode||this.isScheduledGroup||this.uiStore.isModalActive||e===0||(Ae(Mt).value="true",this.pinDataDiscoveryTooltipVisible=!0,this.unwatchWorkflowDataItems())},setSubtitle(){try{const e=this.nodeHelpers.getNodeSubtitle(this.data,this.nodeType,this.workflow)||"";this.nodeSubtitle=e.includes(fs)?"":e}catch{}},disableNode(){this.data!==null&&(this.nodeHelpers.disableNodes([this.data]),this.historyStore.pushCommandToUndo(new ri(this.data.name,!this.data.disabled,this.data.disabled===!0)),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"disable",workflow_id:this.workflowsStore.workflowId}))},executeNode(){this.$emit("runWorkflow",this.data.name,"Node.executeNode"),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"execute",workflow_id:this.workflowsStore.workflowId})},deleteNode(){this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"delete",workflow_id:this.workflowsStore.workflowId}),this.$emit("removeNode",this.data.name)},toggleDisableNode(e){e.currentTarget.blur(),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"disable",workflow_id:this.workflowsStore.workflowId}),this.$emit("toggleDisableNode",this.data)},onClick(e){this.callDebounced(this.onClickDebounced,{debounceTime:50,trailing:!0},e)},onClickDebounced(e){e.detail>=2?this.setNodeActive():this.mouseLeftClick(e)},setNodeActive(){this.ndvStore.activeNodeName=this.data?this.data.name:"",this.pinDataDiscoveryTooltipVisible=!1},touchStart(){this.deviceSupport.isTouchDevice&&!this.deviceSupport.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},openContextMenu(e,t){this.data&&this.contextMenu.open(e,{source:t,node:this.data})}}}),Vn=e=>(Cn("data-v-1142d909"),e=e(),In(),e),Mc=["id","data-name","data-node-type"],Wc={class:"select-background"},Vc={key:0,class:"trigger-icon"},Bc=["innerHTML"],Uc={key:0,class:"node-issues","data-test-id":"node-issues"},Lc={key:1,class:"waiting"},xc=["textContent"],Hc={key:2,class:"node-pin-data-icon"},Fc={key:0,class:"items-count"},zc={key:3},Yc={key:4,class:"data-count"},Kc={key:0,class:"items-count"},jc=["title"],qc={class:"node-trigger-tooltip__wrapper"},Gc=["textContent"],Jc=Vn(()=>f("span",null,null,-1)),Xc=Vn(()=>f("span",null,null,-1)),Qc={class:"node-description"},Zc=["title"],eh={"data-test-id":"canvas-node-box-title"},th={key:0},oh=["title"],nh={class:"node-options-inner"};function sh(e,t,o,n,s,i){var g;const a=S("FontAwesomeIcon"),r=S("n8n-tooltip"),l=S("TitledList"),d=S("NodeIcon"),h=S("n8n-icon-button"),p=Tt("touch");return c(),b("div",{id:e.nodeId,ref:e.data.name,class:D(e.nodeWrapperClass),style:ee(e.nodeWrapperStyles),"data-test-id":"canvas-node","data-name":e.data.name,"data-node-type":(g=e.nodeType)==null?void 0:g.name,onContextmenu:t[4]||(t[4]=N=>e.openContextMenu(N,"node-right-click"))},[G(f("div",Wc,null,512),[[ne,e.isSelected]]),f("div",{class:D({"node-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"menu-open":e.isContextMenuOpen,"disable-pointer-events":e.disablePointerEvents})},[G((c(),b("div",{class:D(e.nodeClass),style:ee(e.nodeStyle),onClick:t[0]||(t[0]=se((...N)=>e.onClick&&e.onClick(...N),["left"]))},[e.isTriggerNode?(c(),b("i",Vc,[y(r,{placement:"bottom"},{content:w(()=>[f("span",{innerHTML:e.$locale.baseText("node.thisIsATriggerNode")},null,8,Bc)]),default:w(()=>[y(a,{icon:"bolt",size:"lg"})]),_:1})])):E("",!0),e.data.disabled?E("",!0):(c(),b("div",{key:1,class:D({"node-info-icon":!0,"shift-icon":e.shiftOutputCount})},[e.hasIssues&&!e.hideNodeIssues?(c(),b("div",Uc,[y(r,{"show-after":500,placement:"bottom"},{content:w(()=>[y(l,{title:`${e.$locale.baseText("node.issues")}:`,items:e.nodeIssues},null,8,["title","items"])]),default:w(()=>[y(a,{icon:"exclamation-triangle"})]),_:1})])):e.waiting||e.nodeExecutionStatus==="waiting"?(c(),b("div",Lc,[y(r,{placement:"bottom"},{content:w(()=>[f("div",{textContent:T(e.waiting)},null,8,xc)]),default:w(()=>[y(a,{icon:"clock"})]),_:1})])):e.showPinnedDataInfo?(c(),b("span",Hc,[y(a,{icon:"thumbtack"}),e.workflowDataItems>1?(c(),b("span",Fc,T(e.workflowDataItems),1)):E("",!0)])):e.nodeExecutionStatus==="unknown"?(c(),b("span",zc)):e.workflowDataItems?(c(),b("span",Yc,[y(a,{icon:"check"}),e.workflowDataItems>1?(c(),b("span",Kc,T(e.workflowDataItems),1)):E("",!0)])):E("",!0)],2)),f("div",{class:"node-executing-info",title:e.$locale.baseText("node.nodeIsExecuting")},[y(a,{icon:"sync-alt",spin:""})],8,jc),f("div",qc,[y(r,{placement:"top","show-after":500,visible:e.showTriggerNodeTooltip,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:w(()=>[f("div",{textContent:T(e.getTriggerNodeTooltip)},null,8,Gc)]),default:w(()=>[Jc]),_:1},8,["visible"]),e.isTriggerNode?(c(),O(r,{key:0,placement:"top",visible:e.pinDataDiscoveryTooltipVisible,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:w(()=>[I(T(e.$locale.baseText("node.discovery.pinData.canvas")),1)]),default:w(()=>[Xc]),_:1},8,["visible"])):E("",!0)]),y(d,{class:"node-icon","node-type":e.nodeType,size:40,shrink:!1,"color-default":e.iconColorDefault,disabled:e.data.disabled},null,8,["node-type","color-default","disabled"])],6)),[[p,e.touchStart,"start"],[p,e.touchEnd,"end"]]),e.showDisabledLinethrough?(c(),b("div",{key:0,class:D({"disabled-linethrough":!0,success:!["unknown"].includes(e.nodeExecutionStatus)&&e.workflowDataItems>0})},null,2)):E("",!0)],2),f("div",Qc,[f("div",{class:"node-name",title:e.nodeTitle},[f("p",eh,T(e.nodeTitle),1),e.data.disabled?(c(),b("p",th,"("+T(e.$locale.baseText("node.disabled"))+")",1)):E("",!0)],8,Zc),e.nodeSubtitle!==void 0?(c(),b("div",{key:0,class:"node-subtitle",title:e.nodeSubtitle},T(e.nodeSubtitle),9,oh)):E("",!0)]),e.isReadOnly?E("",!0):G((c(),b("div",{key:0,class:"node-options no-select-on-click",onContextmenu:t[2]||(t[2]=se(()=>{},["stop"])),onMousedown:t[3]||(t[3]=se(()=>{},["stop"]))},[f("div",nh,[e.isConfigNode?E("",!0):(c(),O(h,{key:0,"data-test-id":"execute-node-button",type:"tertiary",text:"",size:"small",icon:"play",disabled:e.workflowRunning,title:e.$locale.baseText("node.testStep"),onClick:e.executeNode},null,8,["disabled","title","onClick"])),y(h,{"data-test-id":"disable-node-button",type:"tertiary",text:"",size:"small",icon:"power-off",title:e.nodeDisabledTitle,onClick:e.toggleDisableNode},null,8,["title","onClick"]),y(h,{"data-test-id":"delete-node-button",type:"tertiary",size:"small",text:"",icon:"trash",title:e.$locale.baseText("node.delete"),onClick:e.deleteNode},null,8,["title","onClick"]),y(h,{"data-test-id":"overflow-node-button",type:"tertiary",size:"small",text:"",icon:"ellipsis-h",onClick:t[1]||(t[1]=N=>e.openContextMenu(N,"node-button"))})])],544)),[[ne,!e.hideActions]])],46,Mc)}const ih=x(Ac,[["render",sh],["__scopeId","data-v-1142d909"]]),ah=z({name:"Sticky",mixins:[Wn],props:{nodeViewScale:{type:Number},gridSize:{type:Number}},setup(){const e=De(),t=F(),o=F(!1),n=i=>{o.value=i},s=nt(i=>{var a;i==="change_color"&&(n(!0),(a=t.value)==null||a.click())});return{deviceSupport:e,colorPopoverTrigger:t,contextMenu:s,forceActions:o,setForceActions:n}},computed:{...te(J,X,de,j),defaultText(){if(!this.nodeType)return"";const t=this.nodeType.properties.find(o=>o.name==="content");return t&&Dt(t.default)?t.default:""},isSelected(){return this.uiStore.getSelectedNodes.find(e=>e.name===this.data.name)!==void 0},nodeType(){return this.data&&this.nodeTypesStore.getNodeType(this.data.type,this.data.typeVersion)},node(){return this.workflowsStore.getNodeByName(this.name)},position(){return this.node?this.node.position:[0,0]},height(){return this.node&&it(this.node.parameters.height)?this.node.parameters.height:0},width(){return this.node&&it(this.node.parameters.width)?this.node.parameters.width:0},stickySize(){return{height:this.height+"px",width:this.width+"px"}},stickyPosition(){return{left:this.position[0]+"px",top:this.position[1]+"px",zIndex:this.isActive?9999999:-1*Math.floor(this.height*this.width/1e3)}},showActions(){return!(this.hideActions||this.isReadOnly||this.workflowRunning||this.isResizing)||this.forceActions},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")}},data(){return{isResizing:!1,isTouchActive:!1}},methods:{onShowPopover(){this.setForceActions(!0)},onHidePopover(){this.setForceActions(!1)},async deleteNode(){await this.$nextTick(),this.$emit("removeNode",this.data.name)},changeColor(e){this.workflowsStore.updateNodeProperties({name:this.name,properties:{parameters:{...this.node.parameters,color:e}}})},onEdit(e){e&&!this.isActive&&this.node?this.ndvStore.activeNodeName=this.node.name:this.isActive&&!e&&(this.ndvStore.activeNodeName=null)},onMarkdownClick(e,t){if(e){const o=this.name===vn,n=e.querySelector('img[alt="n8n quickstart video"'),s=o&&n?"welcome_video":o&&e.getAttribute("href")==="/templates"?"templates":"other";this.$telemetry.track("User clicked note link",{type:s})}},onInputChange(e){this.node.parameters.content=e,this.setParameters({content:e})},onResizeStart(){this.isResizing=!0,!this.isSelected&&this.node&&this.$emit("nodeSelected",this.node.name,!1,!0)},onResize({height:e,width:t,dX:o,dY:n}){this.node&&((o!==0||n!==0)&&this.setPosition([this.node.position[0]+(o||0),this.node.position[1]+(n||0)]),this.setParameters({height:e,width:t}))},onResizeEnd(){this.isResizing=!1},setParameters(e){if(this.node){const t={content:Dt(e.content)?e.content:this.node.parameters.content,height:it(e.height)?e.height:this.node.parameters.height,width:it(e.width)?e.width:this.node.parameters.width,color:Dt(e.color)?e.color:this.node.parameters.color},o={key:this.node.id,name:this.node.name,value:t};this.workflowsStore.setNodeParameters(o)}},setPosition(e){if(!this.node)return;const t={name:this.node.name,properties:{position:e}};this.workflowsStore.updateNodeProperties(t)},touchStart(){this.deviceSupport.isTouchDevice&&!this.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},onContextMenu(e){this.node&&!this.isActive?this.contextMenu.open(e,{source:"node-right-click",node:this.node}):e.stopPropagation()}}}),rh=["id","data-name"],lh={class:"select-sticky-background"},dh=["title"],uh=["title"],ch={class:"content"},hh=["onClick"];function ph(e,t,o,n,s,i){const a=S("n8n-sticky"),r=S("font-awesome-icon"),l=S("n8n-popover"),d=Tt("touch");return c(),b("div",{id:e.nodeId,ref:e.data.name,class:"sticky-wrapper",style:ee(e.stickyPosition),"data-name":e.data.name,"data-test-id":"sticky"},[f("div",{class:D({"sticky-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"is-read-only":e.isReadOnly}),style:ee(e.stickySize)},[G(f("div",lh,null,512),[[ne,e.isSelected]]),G((c(),b("div",{class:"sticky-box",onClick:t[0]||(t[0]=se((...h)=>e.mouseLeftClick&&e.mouseLeftClick(...h),["left"])),onContextmenu:t[1]||(t[1]=(...h)=>e.onContextMenu&&e.onContextMenu(...h))},[y(a,{id:e.node.id,"model-value":e.node.parameters.content,height:e.node.parameters.height,width:e.node.parameters.width,scale:e.nodeViewScale,"background-color":e.node.parameters.color,"read-only":e.isReadOnly,"default-text":e.defaultText,"edit-mode":e.isActive&&!e.isReadOnly,"grid-size":e.gridSize,onEdit:e.onEdit,onResizestart:e.onResizeStart,onResize:e.onResize,onResizeend:e.onResizeEnd,onMarkdownClick:e.onMarkdownClick,"onUpdate:modelValue":e.onInputChange},null,8,["id","model-value","height","width","scale","background-color","read-only","default-text","edit-mode","grid-size","onEdit","onResizestart","onResize","onResizeend","onMarkdownClick","onUpdate:modelValue"])],32)),[[d,e.touchStart,"start"],[d,e.touchEnd,"end"]]),G(f("div",{class:D({"sticky-options":!0,"no-select-on-click":!0,"force-show":e.forceActions})},[G((c(),b("div",{class:"option","data-test-id":"delete-sticky",title:e.$locale.baseText("node.deleteNode")},[y(r,{icon:"trash"})],8,dh)),[[d,e.deleteNode,"tap"]]),y(l,{effect:"dark","popper-style":{width:"208px"},trigger:"click",placement:"top",onShow:e.onShowPopover,onHide:e.onHidePopover},{reference:w(()=>[f("div",{ref:"colorPopoverTrigger",class:"option","data-test-id":"change-sticky-color",title:e.$locale.baseText("node.changeColor")},[y(r,{icon:"palette"})],8,uh)]),default:w(()=>[f("div",ch,[(c(!0),b(Z,null,re(Array.from({length:7}),(h,p)=>{var g,N;return c(),b("div",{key:p,class:D(["color",`sticky-color-${p+1}`]),"data-test-id":"color",style:ee({"border-width":"1px","border-style":"solid","border-color":"var(--color-foreground-xdark)","background-color":`var(--color-sticky-background-${p+1})`,"box-shadow":p===0&&((g=e.node)==null?void 0:g.parameters.color)===""||p+1===((N=e.node)==null?void 0:N.parameters.color)?`0 0 0 1px var(--color-sticky-background-${p+1})`:"none"}),onClick:m=>e.changeColor(p+1)},null,14,hh)}),128))])]),_:1},8,["onShow","onHide"])],2),[[ne,e.showActions]])],6)],12,rh)}const fh=x(ah,[["render",ph],["__scopeId","data-v-f4958951"]]),gh=60,mh=30,yh=30,wh=15,vh=-20,nn=-200,Nh=-5;function kh(e,t){let o=0,n=0;for(;o<e.length&&n<t.length;){const s=e.charAt(o).toLowerCase(),i=t.charAt(n).toLowerCase();s===i&&o++,++n}return e.length!==0&&t.length!==0&&o===e.length}function bh(e,t){return Bn(e,t,0,0,null,[],256,0,0,5)}function Bn(e,t,o,n,s,i,a,r,l,d){let h=0;if(++l>=d)return{matched:!1,outScore:h};if(o===e.length||n===t.length)return{matched:!1,outScore:h};let p=!1,g=[],N=0,m=!0;for(;o<e.length&&n<t.length;){if(e[o].toLowerCase()===t[n].toLowerCase()){if(r>=a)return{matched:!1,outScore:h};m&&s&&(i=[...s],m=!1);const u=[],k=Bn(e,t,o,n+1,i,u,a,r,l,d),v=k.outScore;k.matched&&((!p||v>N)&&(g=[...u],N=v),p=!0),i[r++]=n,++o}++n}const C=o===e.length;if(C){h=100;let u=vh*i[0];u=u<nn?nn:u,h+=u;const k=t.length-r;h+=Nh*k;for(let v=0;v<r;v++){const P=i[v];if(v>0){const _=i[v-1];P===_+1&&(h+=gh)}if(P>0){const _=t[P-1],R=t[P];_!==_.toUpperCase()&&R!==R.toLowerCase()&&(h+=yh),(_==="_"||_===" ")&&(h+=mh)}else h+=wh}return p&&(!C||N>h)?(i=[...g],h=N,{matched:!0,outScore:h}):C?{matched:!0,outScore:h}:{matched:!1,outScore:h}}return{matched:!1,outScore:h}}function Th(e,t){if(e.hasOwnProperty(t))return e[t];const o=t.split(".");let n=e,s=0;for(;n&&s<o.length;){const i=o[s];n=n[i],s++}return n}function Sh(e,t,o){const n=t.reduce((s,i)=>{let a=[];o.forEach(({key:l,weight:d})=>{const h=Th(i,l);Array.isArray(h)?a=a.concat(h.map(p=>({value:p,weight:d}))):typeof h=="string"&&a.push({value:h,weight:d})});const r=a.reduce((l,{value:d,weight:h})=>{if(!kh(e,d))return l;const p=bh(e,d);p.outScore*=h;const{matched:g,outScore:N}=p;return!l&&g||g&&l&&N>l.outScore?p:l},null);return r&&s.push({score:r.outScore,item:i}),s},[]);return n.sort((s,i)=>i.score-s.score),n}function Xe(e,t,o="node"){var s,i,a;const n={uuid:we(),key:e.name,subcategory:t??((a=(i=(s=e.codex)==null?void 0:s.subcategories)==null?void 0:i[he])==null?void 0:a[0])??et,properties:{...e},type:o};return n}function Dh(e){const t=[he,Ft];return e.reduce((o,n)=>{let s=[et];return t.forEach(i=>{var a,r,l,d;(r=(a=n.codex)==null?void 0:a.categories)!=null&&r.includes(i)&&(s=((d=(l=n.codex)==null?void 0:l.subcategories)==null?void 0:d[i])??[])}),s.forEach(i=>{o[i]||(o[i]=[]),o[i].push(Xe(n,i))}),o},{})}function Lt(e){return e.sort((t,o)=>{var i,a,r,l;if(t.type!=="node"||o.type!=="node")return 0;const n=((a=(i=t.properties)==null?void 0:i.displayName)==null?void 0:a.toLowerCase())||t.key,s=((l=(r=o.properties)==null?void 0:r.displayName)==null?void 0:l.toLowerCase())||o.key;return n.localeCompare(s,void 0,{sensitivity:"base"})})}function sn(e,t){const o=e.toLowerCase().replace("trigger","").trimEnd();return(Sh(o,t,[{key:"properties.displayName",weight:1.3},{key:"properties.codex.alias",weight:1}])||[]).map(({item:s})=>s)}function an(e){return e.map(t=>t.type==="section"?t.children:t).flat()}function Eh(e,t){const o=e.reduce((s,i)=>{const a=t.find(l=>l.items.includes(i.key)),r=(a==null?void 0:a.key)??"other";return s[r]=[...s[r]??[],i],s},{}),n=t.map(s=>({type:"section",key:s.key,title:s.title,children:Lt(o[s.key]??[])})).concat({type:"section",key:"other",title:gs.baseText("nodeCreator.sectionNames.other"),children:Lt(o.other??[])}).filter(s=>s.children.length>0);return n.length<=1?e:n}const wt=Yt(ms.NODE_CREATOR,()=>{const e=F(Fe),t=F([]),o=F({}),n=F(!1),s=F(""),i=Y(()=>Object.values(t.value).map(p=>Xe(p)));function a(p){t.value=p}function r(p){o.value=p}function l(p){n.value=p}function d(p){e.value=p}function h(p){s.value=p}return{openSource:s,selectedView:e,showScrim:n,mergedNodes:t,actions:o,setShowScrim:l,setSelectedView:d,setOpenSource:h,setActions:r,setMergeNodes:a,allNodeCreatorNodes:i}}),Ch=["textContent"],Ih=z({__name:"CanvasAddButton",props:{showTooltip:{type:Boolean},position:{}},setup(e){const t=e,o=wt(),n=Y(()=>({"--trigger-placeholder-left-position":`${t.position[0]}px`,"--trigger-placeholder-top-position":`${t.position[1]}px`}));return(s,i)=>{const a=S("font-awesome-icon"),r=S("n8n-tooltip");return c(),b("div",{ref:"container",class:D(s.$style.canvasAddButton),style:ee(n.value),"data-test-id":"canvas-add-button"},[y(r,{placement:"top",visible:s.showTooltip,disabled:L(o).showScrim,"popper-class":s.$style.tooltip,"show-after":700},{content:w(()=>[I(T(s.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)]),default:w(()=>[f("button",{class:D(s.$style.button),"data-test-id":"canvas-plus-button",onClick:i[0]||(i[0]=l=>s.$emit("click"))},[y(a,{icon:"plus",size:"lg"})],2)]),_:1},8,["visible","disabled","popper-class"]),f("p",{class:D(s.$style.label),textContent:T(s.$locale.baseText("nodeView.canvasAddButton.addFirstStep"))},null,10,Ch)],6)}}}),Ph="_canvasAddButton_mfxxv_5",Oh="_button_mfxxv_17",$h="_label_mfxxv_38",Rh={canvasAddButton:Ph,button:Oh,label:$h},_h={$style:Rh},Ah=x(Ih,[["__cssModules",_h]]);function rn(e,t){return e.filter(o=>{var n,s,i;return!o.hidden&&((i=(s=(n=o.codex)==null?void 0:n.subcategories)==null?void 0:s[Ft])==null?void 0:i.includes(t))}).map(o=>({key:o.name,type:"node",properties:{group:[],name:o.name,displayName:o.displayName,title:o.displayName,description:o.description,icon:o.icon,iconData:o.name.toLowerCase().includes("openai")?{type:"file",icon:"openai",fileBuffer:"/static/open-ai.svg"}:void 0}})).sort((o,n)=>o.properties.displayName.localeCompare(n.properties.displayName))}function fp(e){const t=Ne(),o=J(),n=Dn(),s=rn(o.allLatestNodeTypes,Ms),i=rn(o.allLatestNodeTypes,Ws);return{value:mt,title:t.baseText("nodeCreator.aiPanel.aiNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),info:t.baseText("nodeCreator.aiPanel.infoBox",{interpolate:{link:n.getWebsiteCategoryURL("ai")}}),items:[...s,...i,{key:zt,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.aiOtherNodesDescription")}}]}}function Mh(e){const t=Ne();function o(n){return{connectionType:n,iconProps:{color:`var(--node-type-${n}-color)`},panelClass:`nodes-list-panel-${n}`}}return{value:zt,title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),items:[{key:uo,type:"subcategory",properties:{title:uo,icon:"file-import",...o(M.AiDocument)}},{key:co,type:"subcategory",properties:{title:co,icon:"language",...o(M.AiLanguageModel)}},{key:ho,type:"subcategory",properties:{title:ho,icon:"brain",...o(M.AiMemory)}},{key:po,type:"subcategory",properties:{title:po,icon:"list",...o(M.AiOutputParser)}},{key:fo,type:"subcategory",properties:{title:fo,icon:"search",...o(M.AiRetriever)}},{key:go,type:"subcategory",properties:{title:go,icon:"grip-lines-vertical",...o(M.AiTextSplitter)}},{key:mo,type:"subcategory",properties:{title:mo,icon:"tools",...o(M.AiTool)}},{key:yo,type:"subcategory",properties:{title:yo,icon:"vector-square",...o(M.AiEmbedding)}},{key:wo,type:"subcategory",properties:{title:wo,icon:"project-diagram",...o(M.AiVectorStore)}},{key:vo,type:"subcategory",properties:{title:vo,icon:"code"}}]}}function gp(e){const t=Ne();return{value:Fe,title:t.baseText("nodeCreator.triggerHelperPanel.selectATrigger"),subtitle:t.baseText("nodeCreator.triggerHelperPanel.selectATriggerDescription"),items:[{key:et,type:"subcategory",properties:{forceIncludeNodes:[_e,ys],title:"App Trigger Nodes",icon:"satellite-dish"}},{key:No,type:"node",category:[he],properties:{group:[],name:No,displayName:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDescription"),icon:"fa:clock"}},{key:_e,type:"node",category:[he],properties:{group:[],name:_e,displayName:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDescription"),iconData:{type:"file",icon:"webhook",fileBuffer:"/static/webhook-icon.svg"}}},{key:Me,type:"node",category:[he],properties:{group:[],name:Me,displayName:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDescription"),iconData:{type:"file",icon:"form",fileBuffer:"/static/form-grey.svg"}}},{key:Ze,type:"node",category:[he],properties:{group:[],name:Ze,displayName:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDescription"),icon:"fa:mouse-pointer"}},{key:ko,type:"node",category:[he],properties:{group:[],name:ko,displayName:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDescription"),icon:"fa:sign-out-alt"}},{type:"subcategory",key:bo,category:he,properties:{title:bo,icon:"folder-open"}}]}}function mp(e){const t=Ne(),o={value:Wt,title:t.baseText("nodeCreator.triggerHelperPanel.whatHappensNext"),items:[{key:et,type:"subcategory",properties:{title:"App Regular Nodes",icon:"globe",forceIncludeNodes:[ws,vs]}},{type:"subcategory",key:To,category:he,properties:{title:To,icon:"pen",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Ns,So,ks]},{key:"addOrRemove",title:t.baseText("nodeCreator.sectionNames.transform.addOrRemove"),items:[Do,bs,Ts,Ss]},{key:"combine",title:t.baseText("nodeCreator.sectionNames.transform.combine"),items:[Ds,Es,Eo]},{key:"convert",title:t.baseText("nodeCreator.sectionNames.transform.convert"),items:[At,Cs,Is,Ps,Co,Io,Os,$s]}]}},{type:"subcategory",key:Po,category:he,properties:{title:Po,icon:"code-branch",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Do,Rs,_s,Eo]}]}},{type:"subcategory",key:Oo,category:he,properties:{title:Oo,icon:"file-alt",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Io,Co]}]}},{type:"subcategory",key:$o,category:he,properties:{title:$o,icon:"toolbox",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[As,_e,So]}]}}]};return(e??[]).some(s=>{var i,a;return(a=(i=s.codex)==null?void 0:i.categories)==null?void 0:a.includes(Ft)})&&o.items.push({key:mt,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.langchainAiNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.nodesForAi"),tag:t.baseText("nodeCreator.aiPanel.newTag")}}),o.items.push({key:Fe,type:"view",properties:{title:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTrigger"),icon:"bolt",description:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTriggerDescription")}}),o}const Wh="data-keyboard-nav-id",ln=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Escape","Tab"],Vh=Yt("nodeCreatorKeyboardNavigation",()=>{const e=F([]),t=F(null),o=F({});function n(u){return u==null?void 0:u.getAttribute("data-keyboard-nav-type")}function s(u){return(u==null?void 0:u.getAttribute(Wh))||void 0}async function i(){return await new Promise(u=>{m(),setTimeout(()=>{e.value=Array.from(document.querySelectorAll("[data-keyboard-nav-type]")).map(k=>new WeakRef(k)),u()},0)})}function a(u,k){Object.values(o.value).filter(_=>_.keyboardKeys.includes(u)).forEach(_=>{if(!t.value)return;(_.condition===void 0||_.condition(n(k)||"",t.value))&&t.value&&_.handler(t.value,u)})}async function r(u){var A,$,B;const k=u.key;if(!ln.includes(k))return;u.preventDefault(),u.stopPropagation(),await i();const v=e.value.findIndex(U=>s(U==null?void 0:U.deref())===t.value),P=(A=e.value[v])==null?void 0:A.deref(),_=k==="ArrowDown",R=k==="ArrowUp";if(P){if(_){const U=v<e.value.length-1?v+1:0;d(($=e.value[U])==null?void 0:$.deref())}if(R){const U=v>0?v-1:e.value.length-1;d((B=e.value[U])==null?void 0:B.deref())}a(k,P)}}function l(u){t.value=u}function d(u){const k=s(u);k&&(l(k),u!=null&&u.scrollIntoView&&(u==null||u.scrollIntoView({block:"center"})))}async function h(u){var k;await i(),d((k=e.value[u])==null?void 0:k.deref())}function p(){document.addEventListener("keydown",r,{capture:!0})}function g(){m(),document.removeEventListener("keydown",r,{capture:!0})}function N(u,k){k.keyboardKeys.forEach(v=>{if(ln.includes(v))o.value={...o.value,[u]:k};else throw new Error(`Key ${v} is not supported`)})}function m(){e.value=[]}function C(){return e.value.findIndex(u=>s(u==null?void 0:u.deref())===t.value)}return{activeItemId:t,attachKeydownEvent:p,refreshSelectableItems:i,detachKeydownEvent:g,registerKeyHook:N,getActiveItemIndex:C,setActiveItemId:l,setActiveItemIndex:h}}),Bh=Yt("nodeCreatorViewStacks",()=>{const e=wt(),{getActiveItemIndex:t}=Vh(),o=F([]),n=Y(()=>{const u=o.value[o.value.length-1];if(!(u!=null&&u.baselineItems))return u.items?p(u.items):[];if(u.search&&a.value){const k=a.value.length>0?a.value:an(u.baselineItems??[]);return p(sn(u.search||"",k))}return p(u.baselineItems)}),s=Y(()=>{const u=o.value[o.value.length-1];if(!u)return{};const k=an(u.baselineItems??[]);return{...u,items:n.value,hasSearch:k.length>8||(u==null?void 0:u.hasSearch)}}),i=Y(()=>s.value.mode||Fe),a=Y(()=>{const u=o.value[o.value.length-1];return u!=null&&u.searchItems?u.searchItems.map(k=>Xe(k,u.subcategory)):[]}),r=Y(()=>{const u=o.value[o.value.length-1];if(!(u!=null&&u.search))return[];const k=e.mergedNodes.map(P=>Xe(P));return p(sn(u.search||"",k)).filter(P=>!n.value.find(_=>_.key===P.key))}),l=Y(()=>Dh(e.mergedNodes));async function d(u,k,v){var A;const P=Ne();let _,R;k===!0?(_=J().visibleNodeTypesByInputConnectionTypeNames,R={properties:{title:P.baseText("nodeCreator.aiPanel.aiNodes"),icon:"robot"}}):(_=J().visibleNodeTypesByOutputConnectionTypeNames,R=Mh().items.find($=>$.properties.connectionType===u)),await $n(),g({title:R==null?void 0:R.properties.title,rootView:zt,mode:"nodes",items:e.allNodeCreatorNodes,nodeIcon:{iconType:"icon",icon:R==null?void 0:R.properties.icon,color:(A=R==null?void 0:R.properties.iconProps)==null?void 0:A.color},panelClass:R==null?void 0:R.properties.panelClass,baseFilter:$=>{var U;if($.key===Vs)return!1;const B=_[u].includes($.key);return B&&((U=v==null?void 0:v.nodes)!=null&&U.length)?v.nodes.includes($.key):B},itemsMapper($){return{...$,subcategory:u}},preventBack:!0})}function h(){const u=o.value[o.value.length-1];if(!u||!s.value.uuid)return;let k=(u==null?void 0:u.items)??[];if(!(u!=null&&u.items)){const v=(u==null?void 0:u.subcategory)??et,P=l.value[v],_=u.sections;_?k=Eh(P,_):k=P}if((u.forceIncludeNodes??[]).length>0){const v=e.mergedNodes.filter(P=>{var _;return(_=u.forceIncludeNodes)==null?void 0:_.includes(P.name)}).map(P=>Xe(P,u.subcategory));k.push(...v)}u.baseFilter&&(k=k.filter(u.baseFilter)),u.itemsMapper&&(k=k.map(u.itemsMapper)),u.items||(k=Lt(k)),m({baselineItems:k})}function p(u){return u.map(k=>({...k,uuid:`${k.key}-${we()}`}))}function g(u){s.value.uuid&&m({activeIndex:t()});const k=we();o.value.push({...u,uuid:k,transitionDirection:"in",activeIndex:0}),h()}function N(){s.value.uuid&&(o.value.pop(),m({transitionDirection:"out"}))}function m(u){const k=o.value[o.value.length-1],v=o.value.findIndex(P=>P.uuid===k.uuid);k&&Object.keys(u).forEach(P=>{const _=P;o.value[v]={...o.value[v],[P]:u[_]}})}function C(){o.value=[]}return{viewStacks:o,activeViewStack:s,activeViewStackMode:i,globalSearchItemsDiff:r,gotoCompatibleConnectionView:d,resetViewStacks:C,updateCurrentViewStack:m,pushViewStack:g,popViewStack:N}});function Uh(e,t={}){const o=de(),n=F([0,0]),s=De();function i(d){const h=o.nodeViewOffsetPosition,[p,g]=yt(d),N=h[0]+(p-n.value[0]),m=h[1]+(g-n.value[1]);return o.nodeViewOffsetPosition=[N,m],n.value=[p,g],[N,m]}function a(d,h){if(!(s.isCtrlKeyPressed(d)||h)||o.isActionActive("dragActive"))return;d.button!==Bs.MIDDLE&&(o.nodeViewMoveInProgress=!0);const[p,g]=yt(d);n.value=[p,g];const N=L(e);N==null||N.addEventListener("mousemove",l)}function r(d){if(!o.nodeViewMoveInProgress)return;const h=L(e);h==null||h.removeEventListener("mousemove",l),o.nodeViewMoveInProgress=!1}function l(d){const h=L(e);if(!(d.target&&!(h===d.target||h!=null&&h.contains(d.target)))&&!o.isActionActive("dragActive")){if(d.buttons===Ro.MIDDLE&&(o.nodeViewMoveInProgress=!0),d.buttons===Ro.NONE){const p=L(t.onMouseMoveEnd);p==null||p(d);return}i(d)}}return{moveLastPosition:n,onMouseDown:a,onMouseUp:r,onMouseMove:l,panCanvas:i}}const Lh=Ie(async()=>await Ce(()=>import("./NodeCreation-d5MgZecP.js").then(e=>e.N),__vite__mapDeps([48,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,49]))),xh=Ie(async()=>await Ce(()=>import("./CanvasControls-tmVe2elM.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,51]))),Hh=Ie(async()=>await Ce(()=>import("./SetupWorkflowCredentialsButton-lgz8EmNk.js"),__vite__mapDeps([52,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),Fh=z({name:"NodeView",components:{NodeDetailsView:Dc,Node:ih,Sticky:fh,CanvasAddButton:Ah,KeyboardShortcutTooltip:li,NodeCreation:Lh,CanvasControls:xh,ContextMenu:$c,SetupWorkflowCredentialsButton:Hh},async beforeRouteLeave(e,t,o){if(rt(e)===Ye.EXECUTIONS||t.name===K.TEMPLATE_IMPORT||rt(e)===Ye.WORKFLOW&&t.name===K.EXECUTION_DEBUG){o();return}if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=await this.confirm(this.$locale.baseText("generic.unsavedWork.confirmMessage.message"),{title:this.$locale.baseText("generic.unsavedWork.confirmMessage.headline"),type:"warning",confirmButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),cancelButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),showClose:!0});n===xe?(this.workflowsStore.setWorkflowId(Ke),await this.workflowHelpers.saveCurrentWorkflow({},!1)&&await this.settingsStore.fetchPromptsData(),this.uiStore.stateIsDirty=!1,t.name===K.NEW_WORKFLOW?await this.$router.replace({name:K.WORKFLOW,params:{name:this.currentWorkflow}},()=>{this.$router.push(e)}):(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o())):n===Us&&(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),this.workflowsStore.setWorkflowId(Ke),this.resetWorkspace(),this.uiStore.stateIsDirty=!1,o())}else this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o()},setup(){const e=F(null),t=F(null),o=F(null),n=ot(),s=X(),i=Ee(),a=Ne(),r=nt(),l=Nn(),d=We(),h=qt(),{activeNode:p}=kt(s),g=Se(p),N=De(),{callDebounced:m}=vt(),C=Uh(e,{onMouseMoveEnd:o}),u=bt({router:n}),{runWorkflow:k}=kn({router:n});return{locale:a,contextMenu:r,dataSchema:l,nodeHelpers:d,externalHooks:i,clipboard:h,pinnedData:g,deviceSupport:N,canvasPanning:C,nodeViewRootRef:e,nodeViewRef:t,onMouseMoveEnd:o,workflowHelpers:u,runWorkflow:k,callDebounced:m,...Xi(),...di(),...Ls(),...ze(),...Gt(),...Qi(),...Fi()}},watch:{async $route(e,t){this.readOnlyEnvRouteCheck();const o=rt(e),n=!this.uiStore.nodeViewInitialized;let s=t.params.name!==e.params.name&&!(t.params.name==="new"&&this.currentWorkflow===Ke)&&t.name!==K.NEW_WORKFLOW&&e.params.action!=="workflowSave";const i=e.name===K.TEMPLATE_IMPORT;if(o===Ye.WORKFLOW||i){if(s||n||i){if(this.canvasStore.startLoading(),n){const a=this.uiStore.stateIsDirty;this.resetWorkspace(),this.uiStore.stateIsDirty=a}await Promise.all([this.loadCredentials(),this.initView()]),this.canvasStore.stopLoading(),this.blankRedirect&&(this.blankRedirect=!1)}await this.checkAndInitDebugMode()}o===Ye.EXECUTIONS&&(s=t.params.name!==e.params.name&&!(e.params.name==="new"&&t.params.name===void 0),s&&(this.uiStore.nodeViewInitialized=!1))},activeNode(){this.createNodeActive=!1},containsTrigger(e){e===!1&&this.canvasStore.setRecenteredCanvasAddButtonPosition(this.getNodeViewOffsetPosition)},nodeViewScale(e){const t=this.nodeViewRef;t&&(t.style.transform=`scale(${e})`)}},errorCaptured:(e,t,o)=>{console.error("errorCaptured"),console.error(e)},computed:{...te(jt,hi,fn,wt,J,X,xt,yn,Dn,de,j,xs,wt,ci,bn,Jt,ui,Gi,qi,Kt),nativelyNumberSuffixedDefaults(){return this.nodeTypesStore.nativelyNumberSuffixedDefaults},currentUser(){return this.usersStore.currentUser},activeNode(){return this.ndvStore.activeNode},executionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},isDemo(){return this.$route.name===K.DEMO},showCanvasAddButton(){return!this.isLoading&&!this.containsTrigger&&!this.isDemo&&!this.readOnlyEnv},lastSelectedNode(){return this.uiStore.getLastSelectedNode},nodes(){return this.workflowsStore.allNodes},nodesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type!==ce)},stickiesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type===ce)},runButtonText(){return this.workflowRunning?this.executionWaitingForWebhook?this.$locale.baseText("nodeView.runButtonText.waitingForTriggerEvent"):this.$locale.baseText("nodeView.runButtonText.executingWorkflow"):this.$locale.baseText("nodeView.runButtonText.executeWorkflow")},workflowStyle(){const e=this.uiStore.nodeViewOffsetPosition;return{left:e[0]+"px",top:e[1]+"px"}},canvasAddButtonStyle(){return{"pointer-events":this.createNodeActive?"none":"all"}},backgroundStyle(){return pi(this.nodeViewScale,this.uiStore.nodeViewOffsetPosition,this.isExecutionPreview)},workflowClasses(){const e=[];return(this.ctrlKeyPressed||this.moveCanvasKeyPressed)&&(this.uiStore.nodeViewMoveInProgress?e.push("move-in-process"):e.push("move-active")),(this.selectActive||this.ctrlKeyPressed||this.moveCanvasKeyPressed)&&e.push("do-not-select"),this.connectionDragScope.type&&(e.push("connection-drag-scope-active"),e.push(`connection-drag-scope-active-type-${this.connectionDragScope.type}`),e.push(`connection-drag-scope-active-connection-${this.connectionDragScope.connection}`)),e},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){return this.$route.params.name||this.workflowsStore.workflowId},workflowName(){return this.workflowsStore.workflowName},allTriggersDisabled(){return this.triggerNodes.filter(t=>t.disabled).length===this.triggerNodes.length},triggerNodes(){return this.nodes.filter(e=>e.type===Ht||this.nodeTypesStore.isTriggerNode(e.type))},containsTrigger(){return this.triggerNodes.length>0},containsChatNodes(){return!this.executionWaitingForWebhook&&!!this.nodes.find(e=>[Hs,Qe].includes(e.type)&&e.disabled!==!0)},isManualChatOnly(){return this.containsChatNodes&&this.triggerNodes.length===1},isExecutionDisabled(){return!this.containsTrigger||this.allTriggersDisabled},getNodeViewOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},nodeViewScale(){return this.canvasStore.nodeViewScale},instance(){return this.canvasStore.jsPlumbInstance},isLoading(){return this.canvasStore.isLoading},currentWorkflowObject(){return this.workflowsStore.getCurrentWorkflow()},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},isReadOnlyRoute(){var e,t;return((t=(e=this.$route)==null?void 0:e.meta)==null?void 0:t.readOnlyCanvas)===!0}},data(){return{GRID_SIZE:lt,STICKY_NODE_TYPE:ce,createNodeActive:!1,lastClickPosition:[450,450],ctrlKeyPressed:!1,moveCanvasKeyPressed:!1,stopExecutionInProgress:!1,blankRedirect:!1,credentialsUpdated:!1,pullConnActiveNodeName:null,pullConnActive:!1,dropPrevented:!1,connectionDragScope:{type:null,connection:null},renamingActive:!1,showStickyButton:!1,isExecutionPreview:!1,showTriggerMissingTooltip:!1,workflowData:null,activeConnection:null,isInsertingNodes:!1,isProductionExecutionPreview:!1,enterTimer:void 0,exitTimer:void 0,readOnlyNotification:null,suspendRecordingDetachedConnections:!1,NODE_CREATOR_OPEN_SOURCES:me,eventsAttached:!1,unloadTimeout:void 0,canOpenNDV:!0,hideNodeIssues:!1}},async mounted(){var t;this.onMouseMoveEnd=this.mouseUp,this.resetWorkspace(),this.canvasStore.initInstance(this.nodeViewRef),this.titleReset(),window.addEventListener("message",this.onPostMessageReceived),this.clipboard.onPaste.value=this.onClipboardPasteEvent,this.canvasStore.startLoading();const e=this.settingsStore.isPreviewMode&&this.isDemo?[]:[this.loadActiveWorkflows(),this.loadCredentials(),this.loadCredentialTypes(),this.loadVariables(),this.loadSecrets()];this.nodeTypesStore.allNodeTypes.length===0&&e.push(this.loadNodeTypes());try{await Promise.all(e)}catch(o){this.showError(o,this.$locale.baseText("nodeView.showError.mounted1.title"),this.$locale.baseText("nodeView.showError.mounted1.message")+":");return}if(Ji(async()=>{try{try{this.bindCanvasEvents()}catch{}await this.initView(),window.parent&&window.parent.postMessage(JSON.stringify({command:"n8nReady",version:this.rootStore.versionCli}),"*")}catch(o){this.showError(o,this.$locale.baseText("nodeView.showError.mounted2.title"),this.$locale.baseText("nodeView.showError.mounted2.message")+":")}this.canvasStore.stopLoading(),setTimeout(()=>{this.usersStore.showPersonalizationSurvey(),this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})},0)}),this.externalHooks.run("nodeView.mount").catch(o=>{}),((t=this.currentUser)==null?void 0:t.personalizationAnswers)!==null&&this.settingsStore.onboardingCallPromptEnabled&&this.currentUser&&Fs(this.currentUser)<=zs){const o=await this.uiStore.getNextOnboardingPrompt(),n=(o==null?void 0:o.toast_sequence_number)===1?Ys:1e3;o!=null&&o.title&&(o!=null&&o.description)&&setTimeout(async()=>{this.showToast({type:"info",title:o.title,message:o.description,duration:0,customClass:"clickable",closeOnClick:!0,onClick:()=>{this.$telemetry.track("user clicked onboarding toast",{seq_num:o.toast_sequence_number,title:o.title,description:o.description}),this.uiStore.openModal(Ks)}})},n)}Vo.on("pull",this.onSourceControlPull),this.registerCustomAction({key:"openNodeDetail",action:({node:o})=>{this.nodeSelectedByName(o,!0)}}),this.registerCustomAction({key:"openSelectiveNodeCreator",action:this.openSelectiveNodeCreator}),this.readOnlyEnvRouteCheck(),this.canvasStore.isDemo=this.isDemo},activated(){this.uiStore.addFirstStepOnLoad&&this.showTriggerCreator(me.TRIGGER_PLACEHOLDER_BUTTON),this.uiStore.addFirstStepOnLoad=!1,this.bindCanvasEvents(),document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("message",this.onPostMessageReceived),window.addEventListener("pageshow",this.onPageShow),ie.on("newWorkflow",this.newWorkflow),ie.on("importWorkflowData",this.onImportWorkflowDataEvent),ie.on("importWorkflowUrl",this.onImportWorkflowUrlEvent),ie.on("openChat",this.onOpenChat),ae.on("nodeMove",this.onMoveNode),ae.on("revertAddNode",this.onRevertAddNode),ae.on("revertRemoveNode",this.onRevertRemoveNode),ae.on("revertAddConnection",this.onRevertAddConnection),ae.on("revertRemoveConnection",this.onRevertRemoveConnection),ae.on("revertRenameNode",this.onRevertNameChange),ae.on("enableNodeToggle",this.onRevertEnableToggle),ke.on("pin-data",this.addPinDataConnections),ke.on("unpin-data",this.removePinDataConnections),ie.on("saveWorkflow",this.saveCurrentWorkflowExternal),this.canvasStore.isDemo=this.isDemo},deactivated(){this.unbindCanvasEvents(),document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),window.removeEventListener("message",this.onPostMessageReceived),window.removeEventListener("beforeunload",this.onBeforeUnload),window.removeEventListener("pageshow",this.onPageShow),ie.off("newWorkflow",this.newWorkflow),ie.off("importWorkflowData",this.onImportWorkflowDataEvent),ie.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),ie.off("openChat",this.onOpenChat),ae.off("nodeMove",this.onMoveNode),ae.off("revertAddNode",this.onRevertAddNode),ae.off("revertRemoveNode",this.onRevertRemoveNode),ae.off("revertAddConnection",this.onRevertAddConnection),ae.off("revertRemoveConnection",this.onRevertRemoveConnection),ae.off("revertRenameNode",this.onRevertNameChange),ae.off("enableNodeToggle",this.onRevertEnableToggle),ke.off("pin-data",this.addPinDataConnections),ke.off("unpin-data",this.removePinDataConnections),ie.off("saveWorkflow",this.saveCurrentWorkflowExternal)},beforeMount(){this.isDemo||this.pushStore.pushConnect()},beforeUnmount(){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),this.unregisterCustomAction("showNodeCreator"),this.unregisterCustomAction("openNodeDetail"),this.unregisterCustomAction("openSelectiveNodeCreator"),this.isDemo||this.pushStore.pushDisconnect(),this.resetWorkspace(),this.instance.unbind(),this.instance.destroy(),this.uiStore.stateIsDirty=!1,this.workflowsStore.resetChatMessages(),window.removeEventListener("message",this.onPostMessageReceived),ie.off("newWorkflow",this.newWorkflow),ie.off("importWorkflowData",this.onImportWorkflowDataEvent),ie.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),this.workflowsStore.setWorkflowId(Ke),Vo.off("pull",this.onSourceControlPull)},methods:{async openSelectiveNodeCreator({connectiontype:e,node:t,creatorview:o}){const n=t??this.ndvStore.activeNodeName,s=n?this.workflowsStore.getNodeByName(n):null;this.ndvStore.activeNodeName=null,await this.redrawNode(t),setTimeout(()=>{o?this.onToggleNodeCreator({createNodeActive:!0,nodeCreatorView:o}):e&&s&&this.insertNodeAfterSelected({index:0,endpointUuid:`${s.id}-input${e}0`,eventSource:me.NOTICE_ERROR_MESSAGE,outputType:e,sourceId:s.id})})},editAllowedCheck(){var e;if(!((e=this.readOnlyNotification)!=null&&e.visible))return this.isReadOnlyRoute||this.readOnlyEnv?(this.readOnlyNotification=this.showMessage({title:this.$locale.baseText(this.readOnlyEnv?`readOnlyEnv.showMessage.${this.isReadOnlyRoute?"executions":"workflows"}.title`:"readOnly.showMessage.executions.title"),message:this.$locale.baseText(this.readOnlyEnv?`readOnlyEnv.showMessage.${this.isReadOnlyRoute?"executions":"workflows"}.message`:"readOnly.showMessage.executions.message"),type:"info",dangerouslyUseHTMLString:!0}),!1):!0},showTriggerMissingToltip(e){this.showTriggerMissingTooltip=e},onRunNode(e,t){const o=this.workflowsStore.getNodeByName(e),n={node_type:o?o.type:null,workflow_id:this.workflowsStore.workflowId,source:"canvas",session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",n),this.externalHooks.run("nodeView.onRunNode",n),this.runWorkflow({destinationNode:e,source:t})},async onOpenChat(){const e={workflow_id:this.workflowsStore.workflowId};this.$telemetry.track("User clicked chat open button",e),this.externalHooks.run("nodeView.onOpenChat",e),this.uiStore.openModal(js)},async onRunWorkflow(){this.workflowHelpers.getWorkflowDataToSave().then(e=>{const t={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Et(e,this.workflowHelpers.getNodeTypes()).nodeGraph)};this.$telemetry.track("User clicked execute workflow button",t),this.externalHooks.run("nodeView.onRunWorkflow",t)}),await this.runWorkflow({}),this.refreshEndpointsErrorsState()},resetEndpointsErrors(){Object.values(this.instance.getManagedElements()).flatMap(t=>t.endpoints).filter(t=>(t==null?void 0:t.endpoint.type)===fi).forEach(t=>{const o=t==null?void 0:t.endpoint;o&&((t==null?void 0:t.connections)??[]).length>0&&o.resetError()})},refreshEndpointsErrorsState(){const e=this.workflowsStore.allNodes.filter(t=>t.issues);this.resetEndpointsErrors(),e.forEach(t=>{var s;const o=this.instance.getManagedElement(t.id),n=this.instance.getEndpoints(o);Object.keys(((s=t==null?void 0:t.issues)==null?void 0:s.input)??{}).forEach(i=>{n.filter(r=>r._defaultType.scope===i).forEach(r=>{const l=r==null?void 0:r.endpoint;l&&l.setError()})})})},onRunContainerClick(){if(this.containsTrigger&&!this.allTriggersDisabled)return;const e=this.containsTrigger&&this.allTriggersDisabled?this.$locale.baseText("nodeView.addOrEnableTriggerNode"):this.$locale.baseText("nodeView.addATriggerNodeFirst");this.registerCustomAction({key:"showNodeCreator",action:()=>this.showTriggerCreator(me.NO_TRIGGER_EXECUTION_TOOLTIP)});const t=this.showMessage({type:"info",title:this.$locale.baseText("nodeView.cantExecuteNoTrigger"),message:e,duration:3e3,onClick:()=>setTimeout(()=>{this.createNodeActive&&t.close()},0),dangerouslyUseHTMLString:!0})},clearExecutionData(){this.workflowsStore.workflowExecutionData=null,this.nodeHelpers.updateNodesExecutionIssues()},async onSaveKeyboardShortcut(e){let t=await this.workflowHelpers.saveCurrentWorkflow();t&&(await this.settingsStore.fetchPromptsData(),this.$route.name===K.EXECUTION_DEBUG&&await this.$router.replace({name:K.WORKFLOW,params:{name:this.currentWorkflow}})),this.activeNode&&(e.target instanceof HTMLInputElement?t=e.target.readOnly:t=!0,t&&this.showMessage({title:this.$locale.baseText("generic.workflowSaved"),type:"success"}))},showTriggerCreator(e){this.createNodeActive||(this.nodeCreatorStore.setSelectedView(Fe),this.nodeCreatorStore.setShowScrim(!0),this.onToggleNodeCreator({source:e,createNodeActive:!0}))},async openExecution(e){var o,n;this.canvasStore.startLoading(),this.resetWorkspace();let t;try{t=await this.workflowsStore.getExecution(e)}catch(s){this.showError(s,this.$locale.baseText("nodeView.showError.openExecution.title"));return}if(t===void 0)throw new Error(`Execution with id "${e}" could not be found!`);if(this.workflowsStore.setWorkflowName({newName:t.workflowData.name,setStateDirty:!1}),this.workflowsStore.setWorkflowId(Ke),this.workflowsStore.setWorkflowExecutionData(t),t.workflowData.pinData&&this.workflowsStore.setWorkflowPinData(t.workflowData.pinData),t.workflowData.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:t.workflowData.id,ownedBy:t.workflowData.ownedBy}),t.workflowData.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:t.workflowData.id,sharedWith:t.workflowData.sharedWith}),t.workflowData.usedCredentials&&this.workflowsStore.setUsedCredentials(t.workflowData.usedCredentials),await this.addNodes(Re(t.workflowData.nodes),Re(t.workflowData.connections)),await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!1,this.externalHooks.run("execution.open",{workflowId:t.workflowData.id,workflowName:t.workflowData.name,executionId:e}),this.$telemetry.track("User opened read-only execution",{workflow_id:t.workflowData.id,execution_mode:t.mode,execution_finished:t.finished}),!t.finished&&((n=(o=t.data)==null?void 0:o.resultData)!=null&&n.error)){let s=!1;if(t.data.resultData.runData){const i=t.data.resultData.runData;e:for(const a of Object.keys(i))for(const r of i[a])if(r.error){s=!0;break e}}!s&&t.data.resultData.error.stack&&(console.error(`Execution ${e} error:`),console.error(t.data.resultData.error.stack),this.showMessage({title:this.$locale.baseText("nodeView.showError.workflowError"),message:t.data.resultData.error.message,type:"error",duration:0}))}t.waitTill&&this.showMessage({title:this.$locale.baseText("nodeView.thisExecutionHasntFinishedYet"),message:`<a data-action="reload">${this.$locale.baseText("nodeView.refresh")}</a> ${this.$locale.baseText("nodeView.toSeeTheLatestStatus")}.<br/> <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">${this.$locale.baseText("nodeView.moreInfo")}</a>`,type:"warning",duration:0}),this.canvasStore.stopLoading()},async importWorkflowExact(e){if(!e.workflow.nodes||!e.workflow.connections)throw new Error("Invalid workflow object");this.resetWorkspace(),e.workflow.nodes=gi(e.workflow.nodes),await this.addNodes(e.workflow.nodes,e.workflow.connections),e.workflow.pinData&&this.workflowsStore.setWorkflowPinData(e.workflow.pinData),await this.$nextTick(),this.canvasStore.zoomToFit()},async openWorkflowTemplate(e){this.canvasStore.startLoading(),this.canvasStore.setLoadingText(this.$locale.baseText("nodeView.loadingTemplate")),this.resetWorkspace(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=null;let t;try{if(this.externalHooks.run("template.requested",{templateId:e}),t=await this.templatesStore.getFixedWorkflowTemplate(e),!t)throw new Error(this.$locale.baseText("nodeView.workflowTemplateWithIdCouldNotBeFound",{interpolate:{templateId:e}}))}catch(o){this.showError(o,this.$locale.baseText("nodeView.couldntImportWorkflow")),await this.$router.replace({name:K.NEW_WORKFLOW});return}this.$telemetry.track("User inserted workflow template",{source:"workflow",template_id:qs(e),wf_template_repo_session_id:this.templatesStore.previousSessionId},{withPostHog:!0}),this.blankRedirect=!0,await this.$router.replace({name:K.NEW_WORKFLOW,query:{templateId:e}}),await this.addNodes(t.workflow.nodes,t.workflow.connections),this.workflowData=await this.workflowsStore.getNewWorkflowData(t.name)||{},this.workflowsStore.addToWorkflowMetadata({templateId:e}),await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!0,this.externalHooks.run("template.open",{templateId:e,templateName:t.name,workflow:t.workflow}),this.canvasStore.stopLoading()},async openWorkflow(e){this.canvasStore.startLoading();const t=this.workflowsStore.activeWorkflowExecution;this.resetWorkspace(),this.workflowsStore.addWorkflow(e),this.workflowsStore.setActive(e.active||!1),this.workflowsStore.setWorkflowId(e.id),this.workflowsStore.setWorkflowName({newName:e.name,setStateDirty:!1}),this.workflowsStore.setWorkflowSettings(e.settings||{}),this.workflowsStore.setWorkflowPinData(e.pinData||{}),this.workflowsStore.setWorkflowVersionId(e.versionId),this.workflowsStore.setWorkflowMetadata(e.meta),e.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:e.id,ownedBy:e.ownedBy}),e.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:e.id,sharedWith:e.sharedWith}),e.usedCredentials&&this.workflowsStore.setUsedCredentials(e.usedCredentials);const o=e.tags||[],n=o.map(s=>s.id);this.workflowsStore.setWorkflowTagIds(n||[]),this.tagsStore.upsertTags(o),await this.addNodes(e.nodes,e.connections),this.credentialsUpdated||(this.uiStore.stateIsDirty=!1),this.canvasStore.zoomToFit(),this.externalHooks.run("workflow.open",{workflowId:e.id,workflowName:e.name}),(t==null?void 0:t.workflowId)!==e.id?(this.workflowsStore.activeWorkflowExecution=null,this.workflowsStore.currentWorkflowExecutions=[]):this.workflowsStore.activeWorkflowExecution=t,this.canvasStore.stopLoading(),this.collaborationStore.notifyWorkflowOpened(e.id)},touchTap(e){this.deviceSupport.isTouchDevice&&this.mouseDown(e)},mouseDown(e){this.lastClickPosition=this.getMousePositionWithinNodeView(e),e instanceof MouseEvent&&e.button===1&&(this.moveCanvasKeyPressed=!0),this.mouseDownMouseSelect(e,this.moveCanvasKeyPressed),this.canvasPanning.onMouseDown(e,this.moveCanvasKeyPressed),this.createNodeActive=!1},mouseUp(e){e.button===1&&(this.moveCanvasKeyPressed=!1),this.mouseUpMouseSelect(e),this.canvasPanning.onMouseUp(e)},keyUp(e){e.key===this.deviceSupport.controlKeyCode&&(this.ctrlKeyPressed=!1),e.key===" "&&(this.moveCanvasKeyPressed=!1)},async keyDown(e){this.contextMenu.close();const t=this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,o=e.shiftKey&&!e.altKey&&!this.deviceSupport.isCtrlKeyPressed(e),n=this.deviceSupport.isCtrlKeyPressed(e)&&e.altKey&&!e.shiftKey,s=!this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,i=this.isReadOnlyRoute||this.readOnlyEnv;if(e.key==="s"&&t&&!i){if(e.stopPropagation(),e.preventDefault(),this.isReadOnlyRoute||this.readOnlyEnv)return;this.callDebounced(this.onSaveKeyboardShortcut,{debounceTime:1e3},e);return}const a=e.path||e.composedPath&&e.composedPath();for(const l of a)if(l.className&&typeof l.className=="string"&&l.className.includes("ignore-key-press"))return;if(window.document.body.classList.contains("el-popup-parent--hidden"))return;if(e.key==="Escape"&&s){this.createNodeActive=!1,this.activeNode&&(this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.ndvStore.activeNodeName=null);return}if(this.activeNode)return;const r=this.uiStore.getSelectedNodes.map(l=>l&&this.workflowsStore.getNodeByName(l.name)).filter(l=>!!l);if(e.key==="d"&&s&&!i)this.callDebounced(this.toggleActivationNodes,{debounceTime:350},r);else if(e.key==="d"&&t&&!i)r.length>0&&(e.preventDefault(),this.duplicateNodes(r));else if(e.key==="p"&&s&&!i)r.length>0&&(e.preventDefault(),this.togglePinNodes(r,"keyboard-shortcut"));else if((e.key==="Delete"||e.key==="Backspace")&&s&&!i)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.deleteNodes,{debounceTime:500},r);else if(e.key==="Tab"&&s&&!i)this.onToggleNodeCreator({source:me.TAB,createNodeActive:!this.createNodeActive&&!this.isReadOnlyRoute&&!this.readOnlyEnv});else if(e.key==="Enter"&&t&&!i)this.onRunWorkflow();else if(e.key==="S"&&o&&!i)this.onAddNodes({nodes:[{type:ce}],connections:[]});else if(e.key===this.deviceSupport.controlKeyCode)this.ctrlKeyPressed=!0;else if(e.key===" ")this.moveCanvasKeyPressed=!0;else if(e.key==="F2"&&s&&!i){const l=this.lastSelectedNode;l!==null&&l.type!==ce&&this.callDebounced(this.renameNodePrompt,{debounceTime:1500},l.name)}else if(e.key==="a"&&t)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectAllNodes,{debounceTime:1e3});else if(e.key==="c"&&t)this.callDebounced(this.copyNodes,{debounceTime:1e3},r);else if(e.key==="x"&&t&&!i)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.cutNodes,{debounceTime:1e3},r);else if(e.key==="n"&&n){if(e.stopPropagation(),e.preventDefault(),this.isDemo)return;this.$router.currentRoute.name===K.NEW_WORKFLOW?ie.emit("newWorkflow"):this.$router.push({name:K.NEW_WORKFLOW}),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.keyDown.title"),type:"success"})}else if(e.key==="Enter"&&s){const l=this.lastSelectedNode;if(l!==null){if(l.type===ce&&(this.isReadOnlyRoute||this.readOnlyEnv))return;this.ndvStore.activeNodeName=l.name}}else if(e.key==="ArrowRight"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectDownstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowRight"&&s){const l=this.lastSelectedNode;if(l===null)return;const d=this.workflowsStore.outgoingConnectionsByNodeName(l.name);if(d.main===void 0||d.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},d.main[0][0].node,!1,!0)}else if(e.key==="ArrowLeft"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectUpstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowLeft"&&s){const l=this.lastSelectedNode;if(l===null)return;const d=this.workflowHelpers.getCurrentWorkflow();if(!d.connectionsByDestinationNode.hasOwnProperty(l.name))return;const h=d.connectionsByDestinationNode[l.name];if(h.main===void 0||h.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},h.main[0][0].node,!1,!0)}else if(["ArrowUp","ArrowDown"].includes(e.key)&&s){const l=this.lastSelectedNode;if(l===null)return;const d=this.workflowHelpers.getCurrentWorkflow();if(!d.connectionsByDestinationNode.hasOwnProperty(l.name))return;const h=d.connectionsByDestinationNode[l.name];if(!Array.isArray(h.main)||!h.main.length)return;const p=h.main[0][0].node,g=this.workflowsStore.outgoingConnectionsByNodeName(p);if(!Array.isArray(g.main)||!g.main.length)return;let N,m=e.key==="ArrowUp"?-99999999:99999999,C=null;for(const u of g.main)for(const k of u)k.node!==l.name&&(N=this.workflowsStore.getNodeByName(k.node),N&&(e.key==="ArrowUp"?N.position[1]<=l.position[1]&&N.position[1]>m&&(C=N.name,m=N.position[1]):N.position[1]>=l.position[1]&&N.position[1]<m&&(C=N.name,m=N.position[1])));C!==null&&this.callDebounced(this.nodeSelectedByName,{debounceTime:100},C,!1,!0)}},toggleActivationNodes(e){this.editAllowedCheck()&&this.nodeHelpers.disableNodes(e,!0)},togglePinNodes(e,t){if(!this.editAllowedCheck())return;this.historyStore.startRecordingUndo();const o=e.some(n=>!this.workflowsStore.pinDataByNodeName(n.name));for(const n of e){const s=Se(n);if(o){const i=this.dataSchema.getInputDataWithPinned(n);i.length!==0&&s.setData(i,t)}else s.unsetData(t)}this.historyStore.stopRecordingUndo()},deleteNodes(e){this.historyStore.startRecordingUndo(),e.forEach(t=>{this.removeNode(t.name,!0,!1)}),setTimeout(()=>{this.historyStore.stopRecordingUndo()},200)},selectAllNodes(){this.nodes.forEach(e=>{this.nodeSelectedByName(e.name)})},selectUpstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.workflowHelpers.getCurrentWorkflow(),o=this.workflowHelpers.getConnectedNodes("upstream",t,e.name);for(const n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},selectDownstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.workflowHelpers.getCurrentWorkflow(),o=this.workflowHelpers.getConnectedNodes("downstream",t,e.name);for(const n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},pushDownstreamNodes(e,t,o=!1){const n=this.workflowsStore.nodesByName[e],s=this.workflowHelpers.getCurrentWorkflow(),i=this.workflowHelpers.getConnectedNodes("downstream",s,e);for(const a of i){const r=this.workflowsStore.nodesByName[a],l=r.position;if(r.position[0]<n.position[0])continue;const d={name:a,properties:{position:[r.position[0]+t,r.position[1]]}};this.workflowsStore.updateNodeProperties(d),this.onNodeMoved(r),(o&&l[0]!==d.properties.position[0]||l[1]!==d.properties.position[1])&&this.historyStore.pushCommandToUndo(new mi(a,l,d.properties.position),o)}},cutNodes(e){const t=!this.isReadOnlyRoute&&!this.readOnlyEnv;this.copyNodes(e,t),t&&this.deleteNodes(e)},copyNodes(e,t=!1){this.getNodesToSave(e).then(o=>{const n={meta:{...this.workflowsStore.workflow.meta??{},instanceId:this.rootStore.instanceId},...o};this.workflowHelpers.removeForeignCredentialsFromWorkflow(n,this.credentialsStore.allCredentials);const s=JSON.stringify(n,null,2);this.clipboard.copy(s),o.nodes.length>0&&(t||this.showMessage({title:"Copied!",message:"",type:"success"}),this.$telemetry.track("User copied nodes",{node_types:o.nodes.map(i=>i.type),workflow_id:this.workflowsStore.workflowId}))})},async stopExecution(){const e=this.workflowsStore.activeExecutionId;if(e!==null){try{this.stopExecutionInProgress=!0,await this.workflowsStore.stopCurrentExecution(e)}catch(t){const o=await this.workflowsStore.getExecution(e);if(o===void 0)this.workflowsStore.finishActiveExecution({executionId:e,data:{finished:!0,stoppedAt:new Date}}),this.workflowsStore.executingNode.length=0,this.uiStore.removeActiveAction("workflowRunning"),this.titleSet(this.workflowsStore.workflowName,"IDLE"),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.unsaved.title"),message:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.unsaved.message"),type:"success"});else if(o!=null&&o.finished){const n={data:o.data,finished:o.finished,mode:o.mode,startedAt:o.startedAt,stoppedAt:o.stoppedAt},s={data:n,executionId:e,retryOf:o.retryOf};this.workflowsStore.finishActiveExecution(s),this.titleSet(o.workflowData.name,"IDLE"),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(n),this.uiStore.removeActiveAction("workflowRunning"),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.title"),message:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.message"),type:"success"})}else this.showError(t,this.$locale.baseText("nodeView.showError.stopExecution.title"))}this.stopExecutionInProgress=!1,this.workflowHelpers.getWorkflowDataToSave().then(t=>{const o={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Et(t,this.workflowHelpers.getNodeTypes()).nodeGraph)};this.$telemetry.track("User clicked stop workflow execution",o)})}},async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("nodeView.showError.stopWaitingForWebhook.title"));return}},async onClipboardPasteEvent(e){if(this.readOnlyEnv)return;if(rt(this.$route)===Ye.WORKFLOW){let o;if(!this.editAllowedCheck())return;if(e.match(/^http[s]?:\/\/.*\.json$/i)){if(!this.editAllowedCheck()||await this.confirm(this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.message",{interpolate:{plainTextData:e}}),this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.headline"),{type:"warning",confirmButtonText:this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.confirmButtonText"),cancelButtonText:this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.cancelButtonText"),dangerouslyUseHTMLString:!0})!==xe||(o=await this.getWorkflowDataFromUrl(e),o===void 0))return}else try{if(o=JSON.parse(e),!this.editAllowedCheck())return}catch{return}return await this.importWorkflowData(o,"paste",!1)}},async getWorkflowDataFromUrl(e){let t;this.canvasStore.startLoading();try{t=await this.workflowsStore.getWorkflowFromUrl(e)}catch(o){this.canvasStore.stopLoading(),this.showError(o,this.$locale.baseText("nodeView.showError.getWorkflowDataFromUrl.title"));return}return this.canvasStore.stopLoading(),t},async importWorkflowData(e,t,o=!0){if(!(!e.hasOwnProperty("nodes")||!e.hasOwnProperty("connections")))try{const n={};e.nodes&&e.nodes.forEach(l=>{if(l.webhookId&&Gs.includes(l.type)&&Object.values(this.workflowHelpers.getCurrentWorkflow().nodes).some(h=>h.webhookId===l.webhookId)&&(l.webhookId=we()),l.id){const d=we();n[d]=l.id,l.id=d}else l.id=we()}),this.removeUnknownCredentials(e);const s=this.rootStore.instanceId,i=JSON.stringify(Et(e,this.workflowHelpers.getNodeTypes(),{nodeIdMap:n,sourceInstanceId:e.meta&&e.meta.instanceId!==s?e.meta.instanceId:""}).nodeGraph);t==="paste"?this.$telemetry.track("User pasted nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:i}):t==="duplicate"?this.$telemetry.track("User duplicated nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:i}):this.$telemetry.track("User imported workflow",{source:t,workflow_id:this.workflowsStore.workflowId,node_graph_string:i}),this.deselectAllNodes(),this.workflowHelpers.updateNodePositions(e,Ve(this.nodes,this.lastClickPosition));const a=await this.addNodesToWorkflow(e);setTimeout(()=>{a.nodes.forEach(l=>{this.nodeSelectedByName(l.name)})});const r=this.settingsStore.areTagsEnabled;if(o&&r&&Array.isArray(e.tags)){const l=await this.tagsStore.fetchAll(),d=new Set(l.map(m=>m.name)),h=e.tags,p=h.filter(m=>!d.has(m.name)),g=[];for(const m of p){const C=this.tagsStore.create(m.name).then(u=>(l.push(u),u));g.push(C)}await Promise.all(g);const N=h.reduce((m,C)=>{const u=l.find(k=>k.name===C.name);return u&&m.push(u.id),m},[]);this.workflowsStore.addWorkflowTagIds(N),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})})}}catch(n){this.showError(n,this.$locale.baseText("nodeView.showError.importWorkflowData.title"))}},removeUnknownCredentials(e){if(e!=null&&e.nodes){for(const t of e.nodes)if(t.credentials)for(const[o,n]of Object.entries(t.credentials))n.id!==null&&(this.credentialsStore.getCredentialById(n.id)||delete t.credentials[o])}},onDragOver(e){e.preventDefault()},async onDrop(e){if(!e.dataTransfer)return;const t=Nt(e.dataTransfer.getData(Js));if(t){const o=this.getMousePositionWithinNodeView(e),n=[o[0]-qe/2+lt,o[1]-qe/2];await this.onAddNodes(t,!0,n),this.createNodeActive=!1}},nodeDeselectedByName(e){const t=this.workflowsStore.getNodeByName(e);t&&this.nodeDeselected(t)},nodeSelectedByName(e,t=!1,o){o===!0&&this.deselectAllNodes();const n=this.workflowsStore.getNodeByName(e);n&&(this.nodeSelected(n),this.uiStore.lastSelectedNode=n.name,this.uiStore.lastSelectedNodeOutputIndex=null,this.uiStore.lastSelectedNodeEndpointUuid=null,this.canvasStore.lastSelectedConnection=null,this.canvasStore.newNodeInsertPosition=null,t&&(this.ndvStore.activeNodeName=n.name))},showMaxNodeTypeError(e){const t=e.maxNodes;this.showMessage({title:this.$locale.baseText("nodeView.showMessage.showMaxNodeTypeError.title"),message:this.$locale.baseText("nodeView.showMessage.showMaxNodeTypeError.message",{adjustToNumber:t,interpolate:{nodeTypeDataDisplayName:e.displayName}}),type:"error",duration:0})},async getNewNodeWithDefaultCredential(e,t){var i,a,r,l;let o=e.defaultVersion;o===void 0&&(o=Array.isArray(e.version)?e.version.slice(-1)[0]:e.version);const n={id:we(),name:t.name??e.defaults.name,type:e.name,typeVersion:o,position:[0,0],parameters:{}},s=(i=e.credentials)==null?void 0:i.map(d=>this.credentialsStore.getUsableCredentialByType(d.name)).flat();if(s&&s.length===1){const d=s[0],h=this.credentialsStore.getCredentialById(d.id),p={id:h.id,name:h.name},g={[d.type]:p};await this.loadNodesProperties([n].map(C=>({name:C.type,version:C.typeVersion})));const N=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),m=He((N==null?void 0:N.properties)||[],{},!0,!1,n);if(e.credentials){const C=e.credentials.find(k=>k.name===d.type);if((a=C==null?void 0:C.displayOptions)!=null&&a.hide)return n;const u=(r=C==null?void 0:C.displayOptions)==null?void 0:r.show;if(!u)return n.credentials=g,n;if(Object.keys(u).length===1&&u.authentication){n.credentials=g;let k={};for(const v of Object.keys(u)){if(m&&!m[v]){k={},n.credentials=void 0;break}const P=(l=u[v])==null?void 0:l[0];P&&typeof P=="string"&&(k[v]=P),n.parameters={...n.parameters,...k}}}}}return n},async injectNode(e,t={},o=!0,n=!1,s=!1){var d,h;const i=this.nodeTypesStore.getNodeType(e);if(i===null){this.showMessage({title:this.$locale.baseText("nodeView.showMessage.addNodeButton.title"),message:this.$locale.baseText("nodeView.showMessage.addNodeButton.message",{interpolate:{nodeTypeName:e}}),type:"error"});return}if(i.maxNodes!==void 0&&this.workflowHelpers.getNodeTypeCount(e)>=i.maxNodes){this.showMaxNodeTypeError(i);return}const a=await this.getNewNodeWithDefaultCredential(i,{name:t.name}),r=this.lastSelectedNode;if(t.position)a.position=Ve(this.canvasStore.getNodesWithPlaceholderNode(),t.position);else if(r){const p=this.canvasStore.lastSelectedConnection;if(p){const[g]=yi(p);g<=wi&&this.pushDownstreamNodes(r.name,It,n)}if(this.canvasStore.newNodeInsertPosition)a.position=Ve(this.nodes,[this.canvasStore.newNodeInsertPosition[0]+lt,this.canvasStore.newNodeInsertPosition[1]-qe/2]),this.canvasStore.newNodeInsertPosition=null;else{let g=0;const N=this.workflowHelpers.getCurrentWorkflow();if(p){const k=this.nodeTypesStore.getNodeType(r.type,r.typeVersion);if(k){const v=[[-100,100],[-140,0,140],[-240,-100,100,240]],P=Te(N,r,k),R=ge(P).filter(A=>A===M.Main);if(R.length>1){const A=v[R.length-2],$=p.__meta?p.__meta.sourceOutputIndex:0;g=A[$]}}}let m=[];try{m=Te(N,a,i)}catch{}const C=ge(m),u=this.nodeTypesStore.getNodeType(r.type,r.typeVersion);if(C.length>0&&C.every(k=>k!==M.Main)){const k=N.getNode(r.name),v=fe(N,k,u),_=(ge(v)||[]).filter(R=>R!==M.Main).findIndex(R=>m[0]===R);a.position=Ve(this.nodes,[r.position[0]+qe/(Math.max(((d=u==null?void 0:u.inputs)==null?void 0:d.length)??1),1)*_,r.position[1]+It],[100,0])}else{const k=fe(N,r,u),v=ge(k);let P=It;v.find(_=>_!==M.Main)&&(P+=150),a.position=Ve(this.nodes,[r.position[0]+P,r.position[1]+g],[100,0])}}}else{const p=this.nodeTypesStore.isTriggerNode(e)&&!this.containsTrigger?this.canvasStore.canvasAddButtonPosition:this.lastClickPosition;a.position=Ve(this.nodes,p)}const l=this.locale.localizeNodeName(a.name,a.type);if(a.name=this.uniqueNodeName(l),(h=i.webhooks)!=null&&h.length&&(a.webhookId=we()),await this.addNodes([a],void 0,n),this.workflowsStore.setNodePristine(a.name,!0),this.uiStore.stateIsDirty=!0,e===ce)this.$telemetry.trackNodesPanel("nodeView.addSticky",{workflow_id:this.workflowsStore.workflowId});else{this.externalHooks.run("nodeView.addNodeButton",{nodeTypeName:e}),vi().trackAddedTrigger(e);const p={node_type:e,node_version:a.typeVersion,is_auto_add:s,workflow_id:this.workflowsStore.workflowId,drag_and_drop:t.dragAndDrop};r&&(p.input_node_type=r.type),this.$telemetry.trackNodesPanel("nodeView.addNodeButton",p)}return n&&(this.deselectAllNodes(),setTimeout(()=>{this.nodeSelectedByName(a.name,o&&e!==ce)})),a},getConnection(e,t,o,n,s){const i=this.workflowsStore.outgoingConnectionsByNodeName(e)[s];if(i){const a=i[t];if(a)return a.find(r=>r.node===o&&r.index===n)}},connectTwoNodes(e,t,o,n,s){this.uiStore.stateIsDirty=!0;const i=this.workflowsStore.getNodeByName(e),a=this.workflowsStore.getNodeByName(o);if(i&&a&&!this.checkNodeConnectionAllowed(i,a,s)||this.getConnection(e,t,o,n,s))return;const r=[{node:e,type:s,index:t},{node:o,type:s,index:n}];this.__addConnection(r)},async addNode(e,t={},o=!0,n=!1,s=!1){var g;if(!this.editAllowedCheck())return;const i=this.lastSelectedNode,a=this.uiStore.lastSelectedNodeOutputIndex,r=this.uiStore.lastSelectedNodeEndpointUuid,l=this.canvasStore.lastSelectedConnection;this.historyStore.startRecordingUndo();const d=await this.injectNode(e,t,o,n,s);if(!d)return;const h=a||0,p=r||"";if(r&&!s){const N=this.instance.getEndpoint(r);if(N&&this.checkNodeConnectionAllowed(i,d,N.scope)){const m=N.scope,C=this.instance.getManagedElement(d.id),k=this.instance.getEndpoints(C).find(v=>v.scope===m&&N.parameters.connection!==v.parameters.connection);(g=this.instance)==null||g.connect({uuids:[p,(k==null?void 0:k.uuid)||""],detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),this.historyStore.stopRecordingUndo();return}}if(i&&!s){if(await this.$nextTick(),l!=null&&l.__meta){this.__deleteJSPlumbConnection(l,n);const N=l.__meta.targetNodeName,m=l.__meta.targetOutputIndex;this.connectTwoNodes(d.name,0,N,m,M.Main)}this.connectTwoNodes(i.name,h,d.name,0,M.Main)}this.historyStore.stopRecordingUndo()},getNodeCreatorFilter(e,t){let o;const n=this.workflowHelpers.getCurrentWorkflow(),s=n.getNode(e);if(!s)return{nodes:[]};const i=this.nodeTypesStore.getNodeType(s==null?void 0:s.type,s.typeVersion);if(i){const r=fe(n,s,i).filter(l=>!(typeof l=="string"||l.type!==t||!l.filter));r.length&&(o=r[0].filter)}return o},insertNodeAfterSelected(e){var i,a,r;const t=e.outputType??M.Main,o=this.workflowsStore.getNodeById(e.sourceId);if(!o)return;this.uiStore.lastSelectedNode=o.name,this.uiStore.lastSelectedNodeEndpointUuid=e.endpointUuid??((a=(i=e.connection)==null?void 0:i.target.jtk)==null?void 0:a.endpoint.uuid),this.uiStore.lastSelectedNodeOutputIndex=e.index,this.canvasStore.newNodeInsertPosition=null,e.connection&&(this.canvasStore.lastSelectedConnection=e.connection),this.onToggleNodeCreator({source:e.eventSource,createNodeActive:!0,nodeCreatorView:e.nodeCreatorView});const n=((r=e.connection)==null?void 0:r.endpoints[0].parameters.connection)==="source";t!==M.Main&&Object.values(M).includes(t)&&Bh().gotoCompatibleConnectionView(t,n,this.getNodeCreatorFilter(o.name,t)).catch(l=>{})},async onEventConnectionAbort(e){var t,o;try{if(this.dropPrevented){this.dropPrevented=!1;return}if(this.pullConnActiveNodeName){const n=this.workflowsStore.getNodeById(e.parameters.nodeId),s=e.parameters.type??M.Main,i=(t=e==null?void 0:e.connector)==null?void 0:t.overrideTargetEndpoint;if(n){const a=e.parameters.connection==="target",r=a?this.pullConnActiveNodeName:n.name,l=a?n.name:this.pullConnActiveNodeName,d=e.parameters.index;Bo(e),await this.$nextTick(),this.connectTwoNodes(r,d,l,((o=i==null?void 0:i.parameters)==null?void 0:o.index)??0,s),this.pullConnActiveNodeName=null,this.dropPrevented=!1}return}this.insertNodeAfterSelected({sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:me.NODE_CONNECTION_DROP,connection:e,outputType:e.parameters.type})}catch(n){console.error(n)}},checkNodeConnectionAllowed(e,t,o){var s;const n=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);if((s=n==null?void 0:n.inputs)!=null&&s.length){const i=this.workflowHelpers.getCurrentWorkflow(),a=i.getNode(t.name);let r=[];n&&(r=fe(i,a,n));for(const l of r||[])if(!(typeof l=="string"||l.type!==o||!l.filter)&&l.filter.nodes.length&&!l.filter.nodes.includes(e.type))return this.dropPrevented=!0,this.showToast({title:this.$locale.baseText("nodeView.showError.nodeNodeCompatible.title"),message:this.$locale.baseText("nodeView.showError.nodeNodeCompatible.message",{interpolate:{sourceNodeName:e.name,targetNodeName:t.name}}),type:"error",duration:5e3}),!1}return!0},onInterceptBeforeDrop(e){try{let t,o;if(e.connection.endpoints[0].parameters.connection==="target"?(t=e.dropEndpoint.parameters,o=e.connection.endpoints[0].parameters):(t=e.connection.endpoints[0].parameters,o=e.dropEndpoint.parameters),t.type!==o.type||t.connection===o.connection)return this.dropPrevented=!0,!1;const n=this.workflowsStore.getNodeById(t.nodeId),s=this.workflowsStore.getNodeById(o.nodeId),i=(n==null?void 0:n.name)||"",a=(s==null?void 0:s.name)||"";return n&&s&&!this.checkNodeConnectionAllowed(n,s,o.type)?!1:this.getConnection(i,t.index,a,o.index,t.type)?(this.dropPrevented=!0,this.pullConnActiveNodeName=null,!1):!0}catch(t){return console.error(t),!0}},onEventConnection(e){var t,o;try{if(e.sourceEndpoint.parameters.connection==="target"){const l=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=l}const n=e.sourceEndpoint.parameters,s=e.targetEndpoint.parameters,i=(t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name,a=(o=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:o.name;i&&a&&(e.connection.__meta={sourceNodeName:i,sourceOutputIndex:n.index,targetNodeName:a,targetOutputIndex:s.index}),dt(e.connection),Ni(e.targetEndpoint);const r=[{node:i,type:n.type,index:n.index},{node:a,type:s.type,index:s.index}];if(this.dropPrevented=!0,this.workflowsStore.addConnection({connection:r}),!this.isReadOnlyRoute&&!this.readOnlyEnv){ki(e.sourceEndpoint),bi(e.connection,()=>{this.activeConnection=null,this.__deleteJSPlumbConnection(e.connection)},()=>{this.insertNodeAfterSelected({sourceId:e.sourceEndpoint.parameters.nodeId,index:n.index,connection:e.connection,eventSource:me.NODE_CONNECTION_ACTION})});const l=Si(e.connection,Ti);n.type!==M.Main&&(e.connection.setPaintStyle(Di(e.connection,e.sourceEndpoint.parameters.category)),l==null||l.setVisible(!1))}this.dropPrevented=!1,this.isLoading||(this.uiStore.stateIsDirty=!0,this.suspendRecordingDetachedConnections||this.historyStore.pushCommandToUndo(new Ei(r)),this.isInsertingNodes||(this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),setTimeout(()=>{var l,d;Uo(e.source,e.target,(d=(l=e.connection)==null?void 0:l.connector)!=null&&d.hasOwnProperty("canvas")?e.connection.connector.canvas:void 0)},0)))}catch(n){console.error(n)}},addConectionsTestData(){this.instance.connections.forEach(e=>{var t;Uo(e.source,e.target,(t=e==null?void 0:e.connector)!=null&&t.hasOwnProperty("canvas")?e==null?void 0:e.connector.canvas:void 0)})},onDragMove(){const e=this.nodes.length;this.callDebounced(this.updateConnectionsOverlays,{debounceTime:e>20?200:0})},updateConnectionsOverlays(){var e;(e=this.instance)==null||e.connections.forEach(t=>{Lo(t),xo(t),Object.values(t.overlays).forEach(o=>{var n;o.canvas&&((n=this.instance)==null||n.repaint(o.canvas))})})},isConnectionActive(e){var t,o;return!(e!=null&&e.id)||!((t=this.activeConnection)!=null&&t.id)?!1:((o=this.activeConnection)==null?void 0:o.id)===e.id},onConnectionMouseOver(e){try{if(this.exitTimer!==void 0&&(clearTimeout(this.exitTimer),this.exitTimer=void 0),this.isReadOnlyRoute??this.readOnlyEnv??this.enterTimer??!e??this.isConnectionActive(e))return;this.enterTimer=setTimeout(()=>{this.activeConnection&&!this.isConnectionActive(e)&&Pt(this.activeConnection),this.enterTimer=void 0,e&&(Ci(e),this.activeConnection=e)},150)}catch(t){console.error(t)}},onConnectionMouseOut(e){try{if(this.exitTimer||(this.enterTimer&&(clearTimeout(this.enterTimer),this.enterTimer=void 0),this.isReadOnlyRoute??this.readOnlyEnv??!e??!this.isConnectionActive(e)))return;this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,e&&this.isConnectionActive(e)&&(Pt(this.activeConnection),this.activeConnection=null)},500)}catch(t){console.error(t)}},onConnectionMoved(e){var t,o;try{Ho(e.connection);const n=e.connection.parameters,s=e.originalEndpoint.parameters,i=[{node:((t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name)||"",type:n.type,index:n.index},{node:((o=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:o.name)||"",type:s.type,index:s.index}];this.__removeConnection(i,!1)}catch(n){console.error(n)}},onEndpointMouseOver(e,t){!e.isTarget||t.target!==e.endpoint.canvas||this.instance.setHover(e,!0)},onEndpointMouseOut(e){e.isTarget&&this.instance.setHover(e,!1)},async onConnectionDetached(e){var t;try{if(e.sourceEndpoint.parameters.connection==="target"){const n=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=n}const o=Fo(e);if(Ho(e.targetEndpoint),Ii(e.sourceEndpoint,e.connection),e.connection.removeOverlays(),this.__removeConnectionByConnectionInfo(e,!1,!1),this.pullConnActiveNodeName){this.historyStore.startRecordingUndo();const s=this.workflowsStore.getNodeById(e.connection.parameters.nodeId).name,i=e.connection.parameters.index,a=e.connection.connector.overrideTargetEndpoint;o&&this.historyStore.pushCommandToUndo(new ut(o)),this.connectTwoNodes(s,i,this.pullConnActiveNodeName,((t=a==null?void 0:a.parameters)==null?void 0:t.index)??0,M.Main),this.pullConnActiveNodeName=null,await this.$nextTick(),this.historyStore.stopRecordingUndo()}else if(!this.historyStore.bulkInProgress&&!this.suspendRecordingDetachedConnections&&o){const n=new ut(o,this);this.historyStore.pushCommandToUndo(n)}this.nodeHelpers.updateNodesInputIssues()}catch(o){console.error(o)}},onConnectionDrag(e){var t;(t=e.overlays["midpoint-arrow"])==null||t.setVisible(!1);try{this.pullConnActiveNodeName=null,this.pullConnActive=!0,this.canvasStore.newNodeInsertPosition=null,Pt(e),dt(e);const o=e.scope,n=Array.from(document.querySelectorAll(`[data-jtk-scope-${o}=true]`)),i=e.parameters.connection==="source"?"target":"source",a=n.filter(d=>{const h=d.jtk.endpoint;if(!h)return!1;const p=h.parameters.nodeId===e.parameters.nodeId,g=h.parameters.connection;return!p&&g===i}),r=d=>{if(!e)return;const h=a.filter(p=>{const g=p.jtk.endpoint;if(p.classList.contains("jtk-floating-endpoint"))return!1;const N=Yo(p,d,50),m=Yo(g.element,d,30);if(N||m){const C=this.workflowsStore.getNodeById(g.parameters.nodeId);if(C)return!!this.nodeTypesStore.getNodeType(C.type,C.typeVersion)}return!1}).sort((p,g)=>{const N=zo(p,d,50),m=zo(g,d,50);return!(N!=null&&N.y)&&!(m!=null&&m.y)?0:N!=null&&N.y?m!=null&&m.y?m.y-N.y:-1:1});if(h.length>0){const g=h[0].jtk.endpoint,N=this.workflowsStore.getNodeById(g.parameters.nodeId);this.pullConnActiveNodeName=(N==null?void 0:N.name)??null,Pi(e,g)}else Oi(e),this.pullConnActiveNodeName=null},l=d=>{this.pullConnActive=!1,this.canvasStore.newNodeInsertPosition=this.getMousePositionWithinNodeView(d),Bo(e),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",l),this.connectionDragScope={type:null,connection:null}};window.addEventListener("mousemove",r),window.addEventListener("touchmove",r),window.addEventListener("mouseup",l),window.addEventListener("touchend",r),this.connectionDragScope={type:e.parameters.type,connection:e.parameters.connection}}catch(o){console.error(o)}},onConnectionDragAbortDetached(e){var t;Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>Object.values(o)).filter(o=>o.endpoint.type==="N8nPlus").forEach(o=>setTimeout(()=>o.instance.revalidate(o.element),0))},onPlusEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:me.PLUS_ENDPOINT,outputType:e.scope,endpointUuid:e.uuid})},onAddInputEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:me.ADD_INPUT_ENDPOINT,nodeCreatorView:mt,outputType:e.scope,endpointUuid:e.uuid})},bindCanvasEvents(){this.eventsAttached||(this.instance.bind(ct,this.onEventConnectionAbort),this.instance.bind(_o,this.onInterceptBeforeDrop),this.instance.bind(Ao,this.onEventConnection),this.instance.bind(Jo,this.onDragMove),this.instance.bind(Xo,this.onConnectionMouseOver),this.instance.bind(Qo,this.onConnectionMouseOut),this.instance.bind(Mo,this.onConnectionMoved),this.instance.bind(Zo,this.onEndpointMouseOver),this.instance.bind(en,this.onEndpointMouseOut),this.instance.bind(at,this.onConnectionDetached),this.instance.bind(ht,this.onConnectionDrag),this.instance.bind([ht,ct,at],this.onConnectionDragAbortDetached),this.instance.bind(Ko,this.onPlusEndpointClick),this.instance.bind(jo,this.onAddInputEndpointClick),this.eventsAttached=!0)},unbindCanvasEvents(){this.instance.unbind(ct,this.onEventConnectionAbort),this.instance.unbind(_o,this.onInterceptBeforeDrop),this.instance.unbind(Ao,this.onEventConnection),this.instance.unbind(Jo,this.onDragMove),this.instance.unbind(Xo,this.onConnectionMouseOver),this.instance.unbind(Qo,this.onConnectionMouseOut),this.instance.unbind(Mo,this.onConnectionMoved),this.instance.unbind(Zo,this.onEndpointMouseOver),this.instance.unbind(en,this.onEndpointMouseOut),this.instance.unbind(at,this.onConnectionDetached),this.instance.unbind(ht,this.onConnectionDrag),this.instance.unbind(ht,this.onConnectionDragAbortDetached),this.instance.unbind(ct,this.onConnectionDragAbortDetached),this.instance.unbind(at,this.onConnectionDragAbortDetached),this.instance.unbind(Ko,this.onPlusEndpointClick),this.instance.unbind(jo,this.onAddInputEndpointClick),this.eventsAttached=!1},unbindEndpointEventListeners(e=!0){if(this.instance){const t=this.instance.getManagedElements();for(const o of Object.values(t)){const n=o.endpoints;for(const s of n||[]){const i=s==null?void 0:s.endpoint;i&&i.type===$i&&i.unbindEvents()}}}this.eventsAttached=!1},onBeforeUnload(e){if(!(this.isDemo||window.preventNodeViewBeforeUnload)){if(this.uiStore.stateIsDirty)return this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId),this.unloadTimeout=setTimeout(()=>{this.collaborationStore.notifyWorkflowOpened(this.workflowsStore.workflowId)},5*Xs.SECOND),e.returnValue=!0,!0;this.canvasStore.startLoading(this.$locale.baseText("nodeView.redirecting")),this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId);return}},onUnload(){clearTimeout(this.unloadTimeout)},async newWorkflow(){this.canvasStore.startLoading(),this.resetWorkspace(),this.workflowData=await this.workflowsStore.getNewWorkflowData(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=null,this.uiStore.stateIsDirty=!1,this.canvasStore.setZoomLevel(1,[0,0]),await this.tryToAddWelcomeSticky(),this.uiStore.nodeViewInitialized=!0,this.historyStore.reset(),this.workflowsStore.activeWorkflowExecution=null,this.canvasStore.stopLoading()},async tryToAddWelcomeSticky(){this.canvasStore.zoomToFit()},async initView(){var e,t;if(this.$route.params.action==="workflowSave"){this.uiStore.stateIsDirty=!1;return}if(this.blankRedirect)this.blankRedirect=!1;else if(this.$route.name===K.TEMPLATE_IMPORT){const o=this.$route.params.id;await this.openWorkflowTemplate(o)}else{if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=await this.confirm(this.$locale.baseText("generic.unsavedWork.confirmMessage.message"),{title:this.$locale.baseText("generic.unsavedWork.confirmMessage.headline"),type:"warning",confirmButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),cancelButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),showClose:!0});if(n===xe)await this.workflowHelpers.saveCurrentWorkflow()&&await this.settingsStore.fetchPromptsData();else if(n===Qs)return}let o=null;if(this.$route.params.name&&(o=this.$route.params.name),o!==null){let n;try{n=await this.workflowsStore.fetchWorkflow(o)}catch(s){this.showError(s,this.$locale.baseText("openWorkflow.workflowNotFoundError")),this.$router.push({name:K.NEW_WORKFLOW})}n&&(this.titleSet(n.name,"IDLE"),await this.openWorkflow(n),await this.checkAndInitDebugMode(),(e=n.meta)!=null&&e.onboardingId&&this.$telemetry.track(`User opened workflow from onboarding template with ID ${n.meta.onboardingId}`,{workflow_id:n.id},{withPostHog:!0}))}else((t=this.$route.meta)==null?void 0:t.nodeView)===!0&&await this.newWorkflow()}this.historyStore.reset(),this.uiStore.nodeViewInitialized=!0,document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("beforeunload",this.onBeforeUnload),window.addEventListener("unload",this.onUnload),this.showNotificationForViews([K.WORKFLOW,K.NEW_WORKFLOW])},getOutputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?Ut(n.id,t,o):null},getInputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?Sn(n.id,t,o):null},__addConnection(e){var s;const t=this.getOutputEndpointUUID(e[0].node,e[0].type,e[0].index),o=this.getInputEndpointUUID(e[1].node,e[1].type,e[1].index);if(!t||!o)return;const n=[t,o];(s=this.instance)==null||s.connect({uuids:n,detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})})},__removeConnection(e,t=!1){var o,n;if(t){const s=this.workflowsStore.getNodeByName(e[0].node),i=this.workflowsStore.getNodeByName(e[1].node);if(!s||!i)return;const a=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),r=((o=a==null?void 0:a.outputs)==null?void 0:o[e[0].index])||M.Main,l=typeof r=="string"?r:r.name,d=Bt(l);((n=this.instance)==null?void 0:n.getConnections({scope:d,source:s.id,target:i.id})).forEach(p=>{p.__meta?p.__meta.sourceOutputIndex===e[0].index&&p.__meta.targetOutputIndex===e[1].index&&this.__deleteJSPlumbConnection(p):this.__deleteJSPlumbConnection(p)})}this.workflowsStore.removeConnection({connection:e})},__deleteJSPlumbConnection(e,t=!1){var o,n,s;if(e.removeOverlays(),this.pullConnActiveNodeName=null,(o=this.instance)==null||o.deleteConnection(e),t&&e.__meta){const i=[{index:(n=e.__meta)==null?void 0:n.sourceOutputIndex,node:e.__meta.sourceNodeName,type:M.Main},{index:(s=e.__meta)==null?void 0:s.targetOutputIndex,node:e.__meta.targetNodeName,type:M.Main}],a=new ut(i,this);this.historyStore.pushCommandToUndo(a)}},__removeConnectionByConnectionInfo(e,t=!1,o=!1){const n=Fo(e);n&&(t?this.__deleteJSPlumbConnection(e.connection,o):o&&this.historyStore.pushCommandToUndo(new ut(n)),this.workflowsStore.removeConnection({connection:n}))},async duplicateNodes(e){if(!this.editAllowedCheck())return;const t=Re(await this.getNodesToSave(e));await this.importWorkflowData(t,"duplicate",!1)},getIncomingOutgoingConnections(e){var o,n;const t=this.workflowsStore.getNodeByName(e);if(t){const s=(o=this.instance)==null?void 0:o.getConnections({source:t.id});return{incoming:(n=this.instance)==null?void 0:n.getConnections({target:t.id}),outgoing:s}}return{incoming:[],outgoing:[]}},onNodeMoved(e){const{incoming:t,outgoing:o}=this.getIncomingOutgoingConnections(e.name);[...t,...o].forEach(n=>{xo(n),Lo(n)})},onNodeRun({name:e,data:t,waiting:o}){var r;const n=this.workflowsStore.pinnedWorkflowData;if(n!=null&&n[e]){const{outgoing:l}=this.getIncomingOutgoingConnections(e);l.forEach(d=>{var h;if(((h=d.__meta)==null?void 0:h.sourceNodeName)===e){const p=this.workflowsStore.getWorkflowResultDataByNodeName(e)!==null;Ri({connection:d,overlayIds:[Wi],classNames:p?["has-run"]:[],includeConnector:!0})}});return}const s=e,i=this.workflowsStore.getNodeByName(s),a=i!==null?i.id:"";if(t===null||t.length===0||o){((r=this.instance)==null?void 0:r.getConnections({source:a})).forEach(h=>{dt(h)}),_i(i,this.instance).forEach(h=>{h.endpoint.type==="N8nPlus"&&h.endpoint.clearSuccessOutput()});return}this.nodeHelpers.setSuccessOutput(t,i)},removeNode(e,t=!1,o=!0){if(!this.editAllowedCheck())return;const n=this.workflowsStore.getNodeByName(e);if(!n)return;t&&o&&this.historyStore.startRecordingUndo();const s=[];if(s.includes(n.type)){let p=!1;for(const g of this.nodes)if(g.name!==n.name&&s.includes(g.type)){p=!0;break}if(!p)return}n.type===ce?this.$telemetry.track("User deleted workflow note",{workflow_id:this.workflowsStore.workflowId,is_welcome_note:n.name===vn}):(this.externalHooks.run("node.deleteNode",{node:n}),this.$telemetry.track("User deleted node",{node_type:n.type,workflow_id:this.workflowsStore.workflowId}));let i=!1;const a=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),r=this.workflowHelpers.getCurrentWorkflow(),l=r.getNode(n.name);let d=[],h=[];if(a&&(d=fe(r,l,a),h=Te(r,l,a)),h.length===1&&d.length===1){const{incoming:p,outgoing:g}=this.getIncomingOutgoingConnections(n.name);if(p.length===1&&g.length===1){const N=p[0],m=g[0];if(N.__meta&&m.__meta){i=!0;const C=N.__meta.sourceNodeName,u=N.__meta.sourceOutputIndex,k=m.__meta.targetNodeName,v=m.__meta.targetOutputIndex;setTimeout(()=>{var P;this.connectTwoNodes(C,u,k,v,M.Main),i&&((P=this.instance)==null||P.setSuspendDrawing(!1,!0),i=!1)},100)}}}$n(()=>{var p,g,N;(p=this.instance)==null||p.setSuspendDrawing(!0),(((g=this.instance)==null?void 0:g.endpointsByElement[n.id])||[]).flat().forEach(m=>{var C;return(C=this.instance)==null?void 0:C.deleteEndpoint(m)}),this.workflowsStore.removeAllNodeConnection(n),this.workflowsStore.removeNode(n),this.workflowsStore.clearNodeExecutionData(n.name),i||(N=this.instance)==null||N.setSuspendDrawing(!1,!0),this.uiStore.removeNodeFromSelection(n),t&&this.historyStore.pushCommandToUndo(new Vi(n))}),t&&o&&setTimeout(()=>{this.historyStore.stopRecordingUndo()},i?100:0)},async onSwitchSelectedNode(e){this.nodeSelectedByName(e,!0,!0)},async onOpenConnectionNodeCreator(e,t){await this.openSelectiveNodeCreator({connectiontype:t,node:e})},async redrawNode(e){const t="x____XXXX____x";await this.renameNode(e,t),await this.renameNode(t,e)},valueChanged(e){e.name==="name"&&e.oldValue&&this.renameNode(e.oldValue,e.value)},async renameNodePrompt(e){try{const t=this.prompt(this.$locale.baseText("nodeView.prompt.newName")+":",this.$locale.baseText("nodeView.prompt.renameNode")+`: ${e}`,{customClass:"rename-prompt",confirmButtonText:this.$locale.baseText("nodeView.prompt.rename"),cancelButtonText:this.$locale.baseText("nodeView.prompt.cancel"),inputErrorMessage:this.$locale.baseText("nodeView.prompt.invalidName"),inputValue:e});await this.$nextTick();const o=document.querySelector(".rename-prompt .el-input__inner");o&&(o.focus(),o.select());const n=await t;if((n==null?void 0:n.action)!==xe)return;await this.renameNode(e,n.value,!0)}catch{}},async renameNode(e,t,o=!1){var a;if(e===t)return;this.suspendRecordingDetachedConnections=!0,o&&this.historyStore.startRecordingUndo();const s=((a=this.activeNode)==null?void 0:a.name)===e;s&&(this.renamingActive=!0),t=this.uniqueNodeName(t);const i=this.workflowHelpers.getCurrentWorkflow(!0);i.renameNode(e,t),o&&this.historyStore.pushCommandToUndo(new Tn(e,t)),this.workflowsStore.renameNodeSelectedAndExecution({old:e,new:t}),this.deleteEveryEndpoint(),this.workflowsStore.removeAllConnections({setStateDirty:!1}),this.workflowsStore.removeAllNodes({removePinData:!1,setStateDirty:!0}),await this.$nextTick(),await this.addNodes(Object.values(i.nodes),i.connectionsBySourceNode,!1),this.deselectAllNodes(),this.nodeSelectedByName(t),s&&(this.ndvStore.activeNodeName=t,this.renamingActive=!1),o&&this.historyStore.stopRecordingUndo(),this.suspendRecordingDetachedConnections=!1},deleteEveryEndpoint(){var e,t;this.instance&&((e=this.instance)==null||e.reset(),Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>o).forEach(o=>o.destroy()),this.instance.deleteEveryConnection({fireEvent:!0}))},matchCredentials(e){e.credentials&&Object.entries(e.credentials).forEach(([t,o])=>{const n=this.credentialsStore.getCredentialsByType(t);if(typeof o=="string"&&(o={id:null,name:o},this.credentialsUpdated=!0),o.id){const i=o.id.toString(),a=n.find(r=>r.id===i);if(a){(a.name!==o.name||typeof o.id=="number")&&(e.credentials[t]={id:a.id,name:a.name},this.credentialsUpdated=!0);return}}e.credentials[t]=o;const s=n.filter(i=>i.name===o.name);s.length===1&&(e.credentials[t].id=s[0].id,this.credentialsUpdated=!0)})},async addNodes(e,t,o=!1){var s,i;if(!(e!=null&&e.length))return;this.isInsertingNodes=!0,await this.loadNodesProperties(e.map(a=>({name:a.type,version:a.typeVersion})));let n;e.forEach(a=>{if(a.id||(a.id=we()),n=this.nodeTypesStore.getNodeType(a.type,a.typeVersion),a.hasOwnProperty("disabled")||(a.disabled=!1),a.hasOwnProperty("parameters")||(a.parameters={}),n!==null){let r=null;try{r=He(n.properties,a.parameters,!0,!1,a)}catch(l){console.error(this.$locale.baseText("nodeView.thereWasAProblemLoadingTheNodeParametersOfNode")+`: "${a.name}"`),console.error(l)}a.parameters=r!==null?r:{},[_e,Me].includes(a.type)&&a.parameters.path===""&&(a.parameters.path=a.webhookId)}this.matchCredentials(a),this.workflowsStore.addNode(a),o&&this.historyStore.pushCommandToUndo(new Ai(a))}),await this.$nextTick(),(s=this.instance)==null||s.setSuspendDrawing(!0),t&&await this.addConnections(t),this.nodeHelpers.refreshNodeIssues(),this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),this.isInsertingNodes=!1,(i=this.instance)==null||i.setSuspendDrawing(!1,!0)},async addConnections(e){const t=[];for(const o in e)for(const n in e[o])e[o][n].forEach((s,i)=>{s&&s.forEach(a=>{t.push([{node:o,type:n,index:i},{node:a.node,type:a.type,index:a.index}])})});await this.processConnectionBatch(t),setTimeout(this.addConectionsTestData,0)},async processConnectionBatch(e){for(let o=0;o<e.length;o+=100)e.slice(o,o+100).forEach(s=>{this.__addConnection(s)})},async addNodesToWorkflow(e){const t={},o=[];if(!e.nodes)throw new Error(this.$locale.baseText("nodeView.noNodesGivenToAdd"));const n=this.workflowHelpers.getNodeTypesMaxCount();let s,i;const a=[];await this.loadNodesProperties(e.nodes.map(u=>({name:u.type,version:u.typeVersion}))),e.nodes.forEach(u=>{if(n[u.type]!==void 0)if(n[u.type].exist>=n[u.type].max){t[u.name]=n[u.type].nodeNames[0];return}else n[u.type].exist+=1;s=u.name;const k=this.locale.localizeNodeName(u.name,u.type);i=this.uniqueNodeName(k,o),o.push(i),t[s]=i,a.push(u)});const r={},l=e.connections,d=a.map(u=>u.name);let h,p,g,N,m;for(h of Object.keys(l)){if(!d.includes(h))continue;const u={};for(p of Object.keys(l[h]))for(u[p]=[],g=0;g<l[h][p].length;g++){const k=[];if(l[h][p][g])for(N=0;N<l[h][p][g].length;N++)m=l[h][p][g][N],d.includes(m.node)&&k.push(m);u[p].push(k)}r[h]=u}const C=this.workflowHelpers.getWorkflow(a,r);for(s in t)s!==t[s]&&C.renameNode(s,t[s]);if(e.pinData){let u=!0;for(const k of Object.keys(e.pinData)){if(!u){this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title"));continue}const v=C.nodes[t[k]];try{Se(v).setData(e.pinData[k],"add-nodes"),u=!0}catch(P){u=!1,console.error(P)}}}return this.historyStore.startRecordingUndo(),await this.addNodes(Object.values(C.nodes),C.connectionsBySourceNode,!0),this.historyStore.stopRecordingUndo(),this.uiStore.stateIsDirty=!0,{nodes:Object.values(C.nodes),connections:C.connectionsBySourceNode}},async getNodesToSave(e){const t={nodes:[],connections:{},pinData:{}};let o;const n=[];for(const p of e){o=this.workflowHelpers.getNodeDataToSave(p),n.push(p.name),t.nodes.push(o);const g=this.workflowsStore.pinDataByNodeName(p.name);if(g&&(t.pinData[p.name]=g),o.credentials&&this.settingsStore.isEnterpriseFeatureEnabled(wn.Sharing)){const N=this.workflowsStore.usedCredentials;o.credentials=Object.fromEntries(Object.entries(o.credentials).filter(([m,C])=>{var u;return C.id&&(!N[C.id]||((u=N[C.id])==null?void 0:u.currentUserHasAccess))}))}}let s,i,a,r,l,d,h;return t.nodes.forEach(p=>{if(i=this.workflowsStore.outgoingConnectionsByNodeName(p.name),Object.keys(i).length!==0){h={};for(a of Object.keys(i))for(l=0;l<i[a].length;l++){for(s=[],r=0;r<i[a][l].length;r++)d=i[a][l][r],n.indexOf(d.node)!==-1&&s.push(d);s.length&&(h.hasOwnProperty(a)||(h[a]=[]),h[a][l]=s)}Object.keys(h).length&&(t.connections[p.name]=h)}}),t},resetWorkspace(){if(this.workflowsStore.resetWorkflow(),this.onToggleNodeCreator({createNodeActive:!1}),this.nodeCreatorStore.setShowScrim(!1),this.canvasStore.resetZoom(),this.unbindEndpointEventListeners(),this.deleteEveryEndpoint(),this.executionWaitingForWebhook)try{this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch{}this.workflowsStore.resetState(),this.uiStore.removeActiveAction("workflowRunning"),this.uiStore.resetSelectedNodes(),this.uiStore.nodeViewOffsetPosition=[0,0],this.credentialsUpdated=!1},async loadActiveWorkflows(){await this.workflowsStore.fetchActiveWorkflows()},async loadNodeTypes(){await this.nodeTypesStore.getNodeTypes()},async loadCredentialTypes(){await this.credentialsStore.fetchCredentialTypes(!0)},async loadCredentials(){await this.credentialsStore.fetchAllCredentials()},async loadVariables(){await this.environmentsStore.fetchAllVariables()},async loadSecrets(){await this.externalSecretsStore.fetchAllSecrets()},async loadNodesProperties(e){const t=this.nodeTypesStore.allNodeTypes,o=[];t.forEach(n=>{const s=Array.isArray(n.version)?n.version:[n.version];e.find(i=>i.name===n.name&&s.includes(i.version))&&!n.hasOwnProperty("properties")&&o.push({name:n.name,version:Array.isArray(n.version)?n.version.slice(-1)[0]:n.version})}),o.length>0&&(this.canvasStore.startLoading(),await this.nodeTypesStore.getNodesInformation(o),this.canvasStore.stopLoading())},async onPostMessageReceived(e){var t,o;if(!(!e||typeof e.data!="string"||!((o=(t=e.data)==null?void 0:t.includes)!=null&&o.call(t,'"command"'))))try{const n=JSON.parse(e.data);if(n&&n.command==="openWorkflow")try{await this.importWorkflowExact(n),this.canOpenNDV=n.canOpenNDV??!0,this.hideNodeIssues=n.hideNodeIssues??!1,this.isExecutionPreview=!1}catch(s){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("openWorkflow.workflowImportError")}),"*"),this.showMessage({title:this.$locale.baseText("openWorkflow.workflowImportError"),message:s.message,type:"error"})}else if(n&&n.command==="openExecution")try{this.isProductionExecutionPreview=n.executionMode!=="manual",await this.openExecution(n.executionId),this.canOpenNDV=n.canOpenNDV??!0,this.hideNodeIssues=n.hideNodeIssues??!1,this.isExecutionPreview=!0}catch(s){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("nodeView.showError.openExecution.title")}),"*"),this.showMessage({title:this.$locale.baseText("nodeView.showError.openExecution.title"),message:s.message,type:"error"})}else(n==null?void 0:n.command)==="setActiveExecution"&&(this.workflowsStore.activeWorkflowExecution=n.execution)}catch{}},async onImportWorkflowDataEvent(e){await this.importWorkflowData(e.data,"file")},async onImportWorkflowUrlEvent(e){const t=await this.getWorkflowDataFromUrl(e.url);t!==void 0&&await this.importWorkflowData(t,"url")},addPinDataConnections(e){Object.keys(e).forEach(t=>{var a;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=this.workflowsStore.getWorkflowResultDataByNodeName(t)!==null,s=["pinned"];n&&s.push("has-run"),((a=this.instance)==null?void 0:a.getConnections({source:o.id})).forEach(r=>{Mi(r,{total:e[t].length,iterations:0,classNames:s})})})},removePinDataConnections(e){Object.keys(e).forEach(t=>{var s;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=(s=this.instance)==null?void 0:s.getConnections({source:o.id});this.instance.setSuspendDrawing(!0),n.forEach(dt),this.instance.setSuspendDrawing(!1,!0)})},onToggleNodeCreator({source:e,createNodeActive:t,nodeCreatorView:o}){if(t===this.createNodeActive)return;o||(o=this.containsTrigger?Wt:Fe),this.nodeCreatorStore.setSelectedView(o),this.createNodeActive=t;let n;switch(this.nodeCreatorStore.selectedView){case mt:n="ai";break;case Wt:n="regular";break;default:n="regular"}t&&this.nodeCreatorStore.setOpenSource(e),this.externalHooks.run("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t}),this.$telemetry.trackNodesPanel("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t,workflow_id:this.workflowsStore.workflowId})},async onAddNodes({nodes:e,connections:t},o=!1,n){let s=n;for(const{type:d,isAutoAdd:h,name:p,openDetail:g,position:N}of e){await this.addNode(d,{position:N??s,dragAndDrop:o,name:p},g??!1,!0,h);const m=this.nodes[this.nodes.length-1];s=[m.position[0]+qe*2+lt,m.position[1]]}const i=this.nodes.length-e.length;for(const{from:d,to:h}of t){const p=this.nodes[i+d.nodeIndex],g=this.nodes[i+h.nodeIndex];this.connectTwoNodes(p.name,d.outputIndex??0,g.name,h.inputIndex??0,M.Main)}const a=this.nodes[this.nodes.length-1],l=this.workflowHelpers.getCurrentWorkflow().getParentNodesByDepth(a.name,1);l.length>1&&l.slice(1).forEach((d,h)=>{const p=this.workflowsStore.getNodeByName(d.name);p&&this.onMoveNode({nodeName:p.name,position:[p.position[0],p.position[1]+100*(h+1)]})}),this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})},async saveCurrentWorkflowExternal(e){await this.workflowHelpers.saveCurrentWorkflow(),e==null||e()},setSuspendRecordingDetachedConnections(e){this.suspendRecordingDetachedConnections=e},onMoveNode({nodeName:e,position:t}){this.workflowsStore.updateNodeProperties({name:e,properties:{position:t}});const o=this.workflowsStore.getNodeByName(e);setTimeout(()=>{var n;o&&((n=this.instance)==null||n.repaintEverything(),this.onNodeMoved(o))},0)},onRevertAddNode({node:e}){this.removeNode(e.name,!1)},async onRevertRemoveNode({node:e}){this.workflowsStore.workflow.nodes.find(o=>o.id===e.id)||(e.id=we(),await this.addNodes([e]))},onRevertAddConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__removeConnection(e,!0),this.suspendRecordingDetachedConnections=!1},async onRevertRemoveConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__addConnection(e),this.suspendRecordingDetachedConnections=!1},async onRevertNameChange({currentName:e,newName:t}){await this.renameNode(t,e)},onRevertEnableToggle({nodeName:e,isDisabled:t}){const o=this.workflowsStore.getNodeByName(e);o&&this.nodeHelpers.disableNodes([o])},onPageShow(e){e.persisted&&this.canvasStore.stopLoading()},readOnlyEnvRouteCheck(){this.readOnlyEnv&&[K.NEW_WORKFLOW,K.TEMPLATE_IMPORT].includes(this.$route.name)&&this.$nextTick(async()=>{this.resetWorkspace(),this.uiStore.stateIsDirty=!1,await this.$router.replace({name:K.WORKFLOWS})})},async checkAndInitDebugMode(){this.$route.name===K.EXECUTION_DEBUG&&(this.titleSet(this.workflowName,"DEBUG"),this.workflowsStore.isInDebugMode||(await this.applyExecutionData(this.$route.params.executionId),this.workflowsStore.isInDebugMode=!0))},onContextMenuAction(e,t){switch(e){case"copy":this.copyNodes(t);break;case"delete":this.deleteNodes(t);break;case"duplicate":this.duplicateNodes(t);break;case"execute":this.onRunNode(t[0].name,"NodeView.onContextMenuAction");break;case"open":this.ndvStore.activeNodeName=t[0].name;break;case"rename":this.renameNodePrompt(t[0].name);break;case"toggle_activation":this.toggleActivationNodes(t);break;case"toggle_pin":this.togglePinNodes(t,"context-menu");break;case"add_node":this.onToggleNodeCreator({source:me.CONTEXT_MENU,createNodeActive:!this.isReadOnlyRoute&&!this.readOnlyEnv});break;case"add_sticky":this.onAddNodes({nodes:[{type:ce}],connections:[]});break;case"select_all":this.selectAllNodes();break;case"deselect_all":this.deselectAllNodes();break}}},async onSourceControlPull(){let e=null;this.$route.params.name&&(e=this.$route.params.name);try{if(await Promise.all([this.loadCredentials(),this.loadVariables(),this.tagsStore.fetchAll()]),e!==null&&!this.uiStore.stateIsDirty){const t=await this.workflowsStore.fetchWorkflow(e);t&&(this.titleSet(t.name,"IDLE"),await this.openWorkflow(t))}}catch(t){console.error(t)}}}),zh="_content_59nwu_5",Yh="_shake_59nwu_13",Kh="_setupCredentialsButtonWrapper_59nwu_31",jh={content:zh,shake:Yh,setupCredentialsButtonWrapper:Kh},qh=["textContent"],Gh={key:0,class:"workflow-execute-wrapper"};function Jh(e,t,o,n,s,i){const a=S("CanvasAddButton"),r=S("Node"),l=S("Sticky"),d=S("NodeDetailsView"),h=S("SetupWorkflowCredentialsButton"),p=S("NodeCreation"),g=S("CanvasControls"),N=S("ContextMenu"),m=S("n8n-button"),C=S("KeyboardShortcutTooltip"),u=S("n8n-icon-button"),k=Tt("touch");return c(),b("div",{ref:"nodeViewRootRef",class:D(e.$style.content)},[f("div",{id:"node-view-root",class:"node-view-root do-not-select","data-test-id":"node-view-root",onDragover:t[14]||(t[14]=(...v)=>e.onDragOver&&e.onDragOver(...v)),onDrop:t[15]||(t[15]=(...v)=>e.onDrop&&e.onDrop(...v))},[G((c(),b("div",{class:D(["node-view-wrapper",e.workflowClasses]),"data-test-id":"node-view-wrapper",onTouchstart:t[4]||(t[4]=(...v)=>e.mouseDown&&e.mouseDown(...v)),onTouchend:t[5]||(t[5]=(...v)=>e.mouseUp&&e.mouseUp(...v)),onTouchmove:t[6]||(t[6]=(...v)=>e.canvasPanning.onMouseMove&&e.canvasPanning.onMouseMove(...v)),onMousedown:t[7]||(t[7]=(...v)=>e.mouseDown&&e.mouseDown(...v)),onMouseup:t[8]||(t[8]=(...v)=>e.mouseUp&&e.mouseUp(...v)),onContextmenu:t[9]||(t[9]=(...v)=>e.contextMenu.open&&e.contextMenu.open(...v)),onWheel:t[10]||(t[10]=(...v)=>e.canvasStore.wheelScroll&&e.canvasStore.wheelScroll(...v))},[f("div",{id:"node-view-background",class:"node-view-background",style:ee(e.backgroundStyle),"data-test-id":"node-view-background"},null,4),f("div",{id:"node-view",ref:"nodeViewRef",class:"node-view",style:ee(e.workflowStyle),"data-test-id":"node-view"},[G(y(a,{ref:"canvasAddButton",style:ee(e.canvasAddButtonStyle),"show-tooltip":!e.containsTrigger&&e.showTriggerMissingTooltip,position:e.canvasStore.canvasAddButtonPosition,"data-test-id":"canvas-add-button",onClick:t[0]||(t[0]=v=>e.showTriggerCreator(e.NODE_CREATOR_OPEN_SOURCES.TRIGGER_PLACEHOLDER_BUTTON)),"onHook:mounted":e.canvasStore.setRecenteredCanvasAddButtonPosition},null,8,["style","show-tooltip","position","onHook:mounted"]),[[ne,e.showCanvasAddButton]]),(c(!0),b(Z,null,re(e.nodesToRender,v=>(c(),O(r,{key:`${v.id}_node`,name:v.name,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===v.name,"hide-actions":e.pullConnActive,"is-production-execution-preview":e.isProductionExecutionPreview,workflow:e.currentWorkflowObject,"disable-pointer-events":!e.canOpenNDV,"hide-node-issues":e.hideNodeIssues,onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRunWorkflow:e.onRunNode,onMoved:e.onNodeMoved,onRun:e.onNodeRun,onRemoveNode:t[1]||(t[1]=P=>e.removeNode(P,!0)),onToggleDisableNode:t[2]||(t[2]=P=>e.toggleActivationNodes([P]))},{"custom-tooltip":w(()=>[f("span",{textContent:T(e.$locale.baseText("nodeView.placeholderNode.addTriggerNodeBeforeExecuting"))},null,8,qh)]),_:2},1032,["name","is-read-only","instance","is-active","hide-actions","is-production-execution-preview","workflow","disable-pointer-events","hide-node-issues","onDeselectAllNodes","onDeselectNode","onNodeSelected","onRunWorkflow","onMoved","onRun"]))),128)),(c(!0),b(Z,null,re(e.stickiesToRender,v=>(c(),O(l,{key:`${v.id}_sticky`,name:v.name,workflow:e.currentWorkflowObject,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===v.name,"node-view-scale":e.nodeViewScale,"grid-size":e.GRID_SIZE,"hide-actions":e.pullConnActive,onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRemoveNode:t[3]||(t[3]=P=>e.removeNode(P,!0))},null,8,["name","workflow","is-read-only","instance","is-active","node-view-scale","grid-size","hide-actions","onDeselectAllNodes","onDeselectNode","onNodeSelected"]))),128))],4)],34)),[[k,e.touchTap,"tap"]]),y(d,{"read-only":e.isReadOnlyRoute||e.readOnlyEnv,renaming:e.renamingActive,"is-production-execution-preview":e.isProductionExecutionPreview,onRedrawNode:e.redrawNode,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator,onValueChanged:e.valueChanged,onStopExecution:e.stopExecution,onSaveKeyboardShortcut:e.onSaveKeyboardShortcut},null,8,["read-only","renaming","is-production-execution-preview","onRedrawNode","onSwitchSelectedNode","onOpenConnectionNodeCreator","onValueChanged","onStopExecution","onSaveKeyboardShortcut"]),(c(),O(be,null,{default:w(()=>[f("div",{class:D(e.$style.setupCredentialsButtonWrapper)},[y(h)],2)]),_:1})),(c(),O(be,null,{default:w(()=>[!e.isReadOnlyRoute&&!e.readOnlyEnv?(c(),O(p,{key:0,"create-node-active":e.createNodeActive,"node-view-scale":e.nodeViewScale,onToggleNodeCreator:e.onToggleNodeCreator,onAddNodes:e.onAddNodes},null,8,["create-node-active","node-view-scale","onToggleNodeCreator","onAddNodes"])):E("",!0)]),_:1})),(c(),O(be,null,{default:w(()=>[y(g)]),_:1})),(c(),O(be,null,{default:w(()=>[y(N,{onAction:e.onContextMenuAction},null,8,["onAction"])]),_:1})),!e.isReadOnlyRoute&&!e.readOnlyEnv?(c(),b("div",Gh,[e.isManualChatOnly?E("",!0):(c(),b("span",{key:0,onMouseenter:t[11]||(t[11]=v=>e.showTriggerMissingToltip(!0)),onMouseleave:t[12]||(t[12]=v=>e.showTriggerMissingToltip(!1)),onClick:t[13]||(t[13]=(...v)=>e.onRunContainerClick&&e.onRunContainerClick(...v))},[y(C,{label:e.runButtonText,shortcut:{metaKey:!0,keys:["↵"]}},{default:w(()=>[y(m,{loading:e.workflowRunning,label:e.runButtonText,size:"large",icon:"flask",type:"primary",disabled:e.isExecutionDisabled,"data-test-id":"execute-workflow-button",onClick:se(e.onRunWorkflow,["stop"])},null,8,["loading","label","disabled","onClick"])]),_:1},8,["label"])],32)),e.containsChatNodes?(c(),O(m,{key:1,label:"Chat",size:"large",icon:"comment",type:"primary","data-test-id":"workflow-chat-button",onClick:se(e.onOpenChat,["stop"])},null,8,["onClick"])):E("",!0),e.workflowRunning===!0&&!e.executionWaitingForWebhook?(c(),O(u,{key:2,icon:"stop",size:"large",class:"stop-execution",type:"secondary",title:e.stopExecutionInProgress?e.$locale.baseText("nodeView.stoppingCurrentExecution"):e.$locale.baseText("nodeView.stopCurrentExecution"),loading:e.stopExecutionInProgress,"data-test-id":"stop-execution-button",onClick:se(e.stopExecution,["stop"])},null,8,["title","loading","onClick"])):E("",!0),e.workflowRunning===!0&&e.executionWaitingForWebhook===!0?(c(),O(u,{key:3,class:"stop-execution",icon:"stop",size:"large",title:e.$locale.baseText("nodeView.stopWaitingForWebhookCall"),type:"secondary","data-test-id":"stop-execution-waiting-for-webhook-button",onClick:se(e.stopWaitingForWebhook,["stop"])},null,8,["title","onClick"])):E("",!0),!e.isReadOnlyRoute&&!e.readOnlyEnv&&e.workflowExecution&&!e.workflowRunning&&!e.allTriggersDisabled?(c(),O(u,{key:4,title:e.$locale.baseText("nodeView.deletesTheCurrentExecutionData"),icon:"trash",size:"large","data-test-id":"clear-execution-data-button",onClick:se(e.clearExecutionData,["stop"])},null,8,["title","onClick"])):E("",!0)])):E("",!0)],32)],2)}const Xh={$style:jh},Qh=x(Fh,[["render",Jh],["__cssModules",Xh],["__scopeId","data-v-e052f567"]]),yp=Object.freeze(Object.defineProperty({__proto__:null,default:Qh},Symbol.toStringTag,{value:"Module"}));export{fp as A,Ir as D,yp as N,mp as R,gp as T,_n as a,Bh as b,Vh as c,Mh as d,Se as e,an as f,Lt as s,Xe as t,wt as u};
|
|
8
|
-
//# sourceMappingURL=NodeView-
|
|
7
|
+
import{u as de,y as J,v as j,q as ce,x as Ne,ec as dn,ed as un,dP as De,_ as x,$ as X,ee as Ln,ef as xn,bf as cn,aw as hn,N as M,a8 as Ee,e as ze,eg as to,eh as Hn,cT as Me,an as Qe,aA as vt,cR as pn,J as fe,d1 as ge,m as xt,ei as Fn,ej as zn,ek as st,el as Yn,em as Kn,en as Nt,O as jn,b7 as Ze,a2 as _e,di as ie,a9 as xe,B as fn,da as oo,eo as qn,ep as Le,o as Re,a6 as He,eq as gt,d6 as Ae,er as no,es as Gn,et as so,eu as gn,al as St,ev as Jn,ew as Xn,ex as Qn,cQ as io,b5 as At,aY as ao,ey as Zn,d2 as Te,ez as ke,eA as ro,eB as es,eC as ts,eD as lo,eE as Mt,cI as Ce,z as Ht,eF as os,eG as ns,k as mn,d8 as ft,V as K,d4 as ss,l as yn,eH as is,eI as as,t as wn,eJ as rs,eK as ls,eL as ds,eM as us,eN as cs,e0 as hs,eO as ps,F as fs,D as Dt,r as it,eP as vn,eQ as he,eR as et,cZ as Ft,b as gs,S as ms,eS as Fe,eT as mt,eU as zt,eV as uo,eW as co,eX as ho,eY as po,eZ as fo,e_ as go,e$ as mo,f0 as yo,f1 as wo,f2 as vo,f3 as ys,b8 as No,f4 as ko,f5 as bo,f6 as Wt,f7 as ws,f8 as vs,f9 as To,b9 as Ns,b1 as So,fa as ks,fb as Do,fc as bs,fd as Ts,fe as Ss,ff as Ds,fg as Es,fh as Eo,fi as Cs,fj as Is,fk as Ps,fl as Co,fm as Io,fn as Os,fo as $s,fp as Po,fq as Rs,ah as _s,fr as Oo,fs as $o,a1 as As,c$ as Ms,c_ as Ws,d0 as Vs,ft as Bs,fu as Ro,M as Ye,a3 as Ke,fv as Us,cW as Ls,f as xs,d3 as Hs,fw as me,cJ as Fs,cK as zs,cL as Ys,bt as Ks,cY as js,cS as Et,aa as qs,fx as Gs,fy as Js,ea as Xs,fz as Qs}from"./n8n-uKoDE8Qf.js";import{m as te,s as kt,d as Yt}from"./pinia-e-gLcRJ1.js";import{_ as _o,$ as Ao,a0 as Mo,a1 as at}from"./@jsplumb/core-MKwKlGip.js";import{d as Kt,i as yt,j as Nn,c as jt,k as Zs,N as tt,l as qt,a as bt,m as We,n as Vt,o as kn,b as Gt,p as ei,P as ti,q as bn,r as Jt,R as Tn,J as oi,C as ni,t as Wo,v as Bt,w as Sn,x as Ct,y as si,z as ii,A as Ut,B as je,D as ai,E as ri,h as Dn,K as li,F as rt,G as di,H as ui,I as ci,u as hi,L as pi,M as lt,s as Vo,O as ae,Q as fi,U as gi,V as mi,W as Ve,X as qe,Y as yi,Z as wi,_ as It,$ as vi,a0 as Bo,a1 as dt,a2 as Ni,a3 as ki,a4 as bi,a5 as Ti,a6 as Si,a7 as Di,a8 as Ei,a9 as Uo,aa as Lo,ab as xo,ac as Pt,ad as Ci,ae as Ho,af as Fo,ag as Ii,ah as ut,ai as zo,aj as Yo,ak as Pi,al as Oi,am as Ko,an as jo,ao as $i,ap as Ri,aq as _i,ar as Ai,as as Mi,at as Wi,au as Vi}from"./index-9xnnd4cn.js";import{r as F,e as Y,d as Xt,b as En,v as z,f as c,h as b,i as f,K as y,y as D,E as w,J as I,I as T,D as O,H as E,$ as qo,V as se,a6 as S,ar as ot,F as Z,_ as re,aj as Cn,ak as In,z as ee,ae as Tt,M as G,u as L,A as Bi,L as ne,x as le,Y as Pn,G as On,l as Ui,N as Li,as as Ie,au as be,a0 as Qt,aA as xi,T as Hi,n as $n}from"./vendor-3VD3vVJy.js";import{u as Fi}from"./useExecutionDebugging-Z2R2TujJ.js";import{g as ye,s as Be,z as Ot,y as zi,e as Yi}from"./lodash-es-JdX4GWLn.js";import{F as $t}from"./file-saver-1UKPYnQ-.js";import{V as Rn}from"./vue-json-pretty-SeZ9jw7A.js";import{c as Ki}from"./dateFormatter-uGeLbFGz.js";import ji from"./RunDataAi--C9ACRTm.js";import{w as Go}from"./workflowActivate-rRmpx9AQ.js";import{v as we}from"./uuid-McvpxQtQ.js";import{a as qi,u as Gi}from"./collaboration.store-KS2_i2m5.js";import{g as Ji,f as ct,h as Jo,a as Xo,E as Qo,b as Zo,d as en,i as ht}from"./@jsplumb/browser-ui-AlqFM-P6.js";const Rt=F([0,0]),Ge=F(!1),Je=F({source:"canvas"}),pt=F([]),tn=F(()=>{}),nt=(e=()=>{})=>{const t=de(),o=J(),n=j(),s=Kt(),{getInputDataWithPinned:i}=Nn(),a=Ne(),r=Y(()=>s.preferences.branchReadOnly||t.isReadOnlyView),l=Y(()=>{if(!Ge.value)return[];const u=t.selectedNodes.map(v=>n.getNodeByName(v.name)),k=Je.value;return k.source==="canvas"?u:k.source==="node-right-click"?u.some(P=>P.name===k.node.name)?u:[k.node]:[k.node]}),d=u=>{const k=n.allNodes.filter(v=>v.type===u.name);return u.maxNodes===void 0||k.length<u.maxNodes},h=u=>{const k=o.getNodeType(u.type,u.typeVersion);return!k||dn.includes(k.name)?!1:d(k)},p=u=>{const k=o.getNodeType(u.type,u.typeVersion),v=i(u);return!k||v.length===0?!1:k.outputs.length===1&&!un.includes(u.type)},g=u=>!!n.pinDataByNodeName(u.name),N=()=>{Je.value={source:"canvas"},Ge.value=!1,pt.value=[],Rt.value=[0,0]},m=(u,k={source:"canvas"})=>{if(u.stopPropagation(),Ge.value&&k.source===Je.value.source){N();return}u.preventDefault(),tn.value=e,Je.value=k,Rt.value=yt(u),Ge.value=!0;const v=l.value,P=v.every(A=>A.type===ce),_={adjustToNumber:v.length,interpolate:{subject:P?a.baseText("contextMenu.sticky",{adjustToNumber:v.length}):a.baseText("contextMenu.node",{adjustToNumber:v.length})}},R=[{id:"select_all",divided:!0,label:a.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:v.length===n.allNodes.length},{id:"deselect_all",label:a.baseText("contextMenu.deselectAll"),disabled:v.length===0}];if(v.length===0)pt.value=[{id:"add_node",shortcut:{keys:["Tab"]},label:a.baseText("contextMenu.addNode"),disabled:r.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:a.baseText("contextMenu.addSticky"),disabled:r.value},...R];else{const A=[!P&&{id:"toggle_activation",label:v.every($=>$.disabled)?a.baseText("contextMenu.activate",_):a.baseText("contextMenu.deactivate",_),shortcut:{keys:["D"]},disabled:r.value},!P&&{id:"toggle_pin",label:v.every($=>g($))?a.baseText("contextMenu.unpin",_):a.baseText("contextMenu.pin",_),shortcut:{keys:["p"]},disabled:r.value||!v.every(p)},{id:"copy",label:a.baseText("contextMenu.copy",_),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:a.baseText("contextMenu.duplicate",_),shortcut:{metaKey:!0,keys:["D"]},disabled:r.value||!v.every(h)},...R,{id:"delete",divided:!0,label:a.baseText("contextMenu.delete",_),shortcut:{keys:["Del"]},disabled:r.value}].filter(Boolean);if(v.length===1){const $=P?[{id:"open",label:a.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:r.value},{id:"change_color",label:a.baseText("contextMenu.changeColor"),disabled:r.value}]:[{id:"open",label:a.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:a.baseText("contextMenu.test"),disabled:r.value},{id:"rename",label:a.baseText("contextMenu.rename"),shortcut:{keys:["F2"]},disabled:r.value}];A.unshift(...$)}pt.value=A}},C=u=>{tn.value(u,l.value)};return Xt(()=>t.nodeViewOffsetPosition,()=>{N()}),{isOpen:Ge,position:Rt,target:Je,actions:pt,targetNodes:l,open:m,close:N,_dispatchAction:C}};function Xi(){const e=F(!1),t=F(document.createElement("span")),{isTouchDevice:o,isCtrlKeyPressed:n}=De(),s=de(),i=jt(),a=j(),{isOpen:r}=nt();function l($){Object.assign(t.value.style,$)}function d($){const[B,U]=v($);t.value=Object.assign(t.value,{x:B,y:U}),l({left:t.value.x+"px",top:t.value.y+"px",visibility:"visible"}),e.value=!0}function h($){const B=g($);l({left:B.x+"px",top:B.y+"px",width:B.width+"px",height:B.height+"px"})}function p(){t.value.x=0,t.value.y=0,l({visibility:"hidden",left:"0px",top:"0px",width:"0px",height:"0px"}),e.value=!1}function g($){const[B,U]=v($);return{x:Math.min(B,t.value.x),y:Math.min(U,t.value.y),width:Math.abs(B-t.value.x),height:Math.abs(U-t.value.y)}}function N($){const B=[],U=g($);return a.allNodes.forEach(oe=>{oe.position[0]<U.x||oe.position[0]>U.x+U.width||oe.position[1]<U.y||oe.position[1]>U.y+U.height||B.push(oe)}),B}function m(){t.value.id="select-box",l({margin:"0px auto",border:"2px dotted #FF0000",position:"absolute",zIndex:"100",visibility:"hidden"}),t.value.addEventListener("mouseup",u),document.querySelector("#node-view").appendChild(t.value)}function C($){if($.buttons===0){u($);return}h($)}function u($){if($.button===2||r.value)return;if(!e.value){o&&$.target instanceof HTMLElement&&$.target&&$.target.id.includes("node-view")&&R();return}document.removeEventListener("mousemove",C),R();const B=N($);B.forEach(U=>{_(U)}),B.length===1&&(s.lastSelectedNode=B[0].name),p()}function k($,B){n($)||B||$.button===2||s.isActionActive("dragActive")||(d($),document.addEventListener("mousemove",C))}function v($){const B=yt($),[U,oe]=i.canvasPositionFromPagePosition(B),pe=i.nodeViewScale,V=s.nodeViewOffsetPosition;return Zs(U,oe,pe,V)}function P($){s.removeNodeFromSelection($),A.value.removeFromDragSelection(A.value.getManagedElement($==null?void 0:$.id))}function _($){s.addSelectedNode($),A.value.addToDragSelection(A.value.getManagedElement($==null?void 0:$.id))}function R(){A.value.clearDragSelection(),s.resetSelectedNodes(),s.lastSelectedNode=null,s.lastSelectedNodeOutputIndex=null,i.lastSelectedConnection=null,i.newNodeInsertPosition=null}const A=Y(()=>i.jsPlumbInstance);return En(()=>{m()}),{selectActive:e,getMousePositionWithinNodeView:v,mouseUpMouseSelect:u,mouseDownMouseSelect:k,nodeDeselected:P,nodeSelected:_,deselectAllNodes:R}}function Qi(){function e(){return J().allNodeTypes.reduce((o,n)=>{if(typeof n.defaults.name!="string")throw new Error("Expected node name default to be a string");return/\d$/.test(n.defaults.name)&&o.push(n.defaults.name),o},[])}function t(o,n=[]){var h,p;const{canvasNames:s}=j();if(!s.has(o)&&!n.includes(o))return o;const a=e().find(g=>o.startsWith(g));if(a){let g="",N=1;const m=o.split(a).pop(),C=m==null?void 0:m[m.length-1];for(C&&Number.isInteger(Number(C))&&(N=parseInt(C,10),o=o.slice(0,-1)),g=o;s.has(g)||n.includes(g);)g=o+N++;return g}if(/^\d+-?\d*$/.test(o)){let g="",N=1;const m=o.match(/(?<base>\d+)-?(?<suffix>\d*)/);if(!(m!=null&&m.groups))throw new Error("Failed to find match for unique name");for(((h=m==null?void 0:m.groups)==null?void 0:h.suffix)!==""&&(N=parseInt(m.groups.suffix,10)),g=m.groups.base;s.has(g)||n.includes(g);)g=m.groups.base+"-"+N++;return g}let r="",l=1;const d=o.match(/(?<base>.*\D+)(?<suffix>\d*)/);if(!(d!=null&&d.groups))throw new Error("Failed to find match for unique name");for(((p=d==null?void 0:d.groups)==null?void 0:p.suffix)!==""&&(l=parseInt(d.groups.suffix,10)),r=d.groups.base;s.has(r)||n.includes(r);)r=d.groups.base+l++;return r}return{uniqueNodeName:t}}const Zi=z({name:"NodeTitle",components:{NodeIcon:tt},props:{modelValue:{type:String,default:""},nodeType:{},readOnly:{type:Boolean,default:!1}},data(){return{editName:!1,newName:""}},computed:{editable(){return!this.readOnly&&window===window.parent}},methods:{async onEdit(){this.newName=this.modelValue,this.editName=!0,await this.$nextTick();const e=this.$refs.input;e&&e.focus()},onRename(){this.newName.trim()!==""&&this.$emit("update:modelValue",this.newName.trim()),this.editName=!1}}}),ea="_container_15oh7_5",ta="_title_15oh7_15",oa="_hoverable_15oh7_23",na="_editIcon_15oh7_26",sa="_iconWrapper_15oh7_30",ia="_editIconContainer_15oh7_43",aa="_editButtons_15oh7_49",ra="_editContainer_15oh7_57",la={container:ea,title:ta,hoverable:oa,editIcon:na,iconWrapper:sa,editIconContainer:ia,editButtons:aa,editContainer:ra};function da(e,t,o,n,s,i){const a=S("NodeIcon"),r=S("n8n-text"),l=S("n8n-input"),d=S("n8n-button"),h=S("font-awesome-icon"),p=S("n8n-popover");return c(),b("span",{class:D(e.$style.container),"data-test-id":"node-title-container",onClick:t[5]||(t[5]=(...g)=>e.onEdit&&e.onEdit(...g))},[f("span",{class:D(e.$style.iconWrapper)},[y(a,{"node-type":e.nodeType,size:18},null,8,["node-type"])],2),y(p,{placement:"right",width:"200",visible:e.editName,disabled:!e.editable},{reference:w(()=>[f("div",{class:D({[e.$style.title]:!0,[e.$style.hoverable]:e.editable})},[I(T(e.modelValue)+" ",1),f("div",{class:D(e.$style.editIconContainer)},[e.editable?(c(),O(h,{key:0,class:D(e.$style.editIcon),icon:"pencil-alt"},null,8,["class"])):E("",!0)],2)],2)]),default:w(()=>[f("div",{class:D(e.$style.editContainer),onKeydown:[t[2]||(t[2]=qo((...g)=>e.onRename&&e.onRename(...g),["enter"])),t[3]||(t[3]=se(()=>{},["stop"])),t[4]||(t[4]=qo(g=>e.editName=!1,["esc"]))]},[y(r,{bold:!0,color:"text-base",tag:"div"},{default:w(()=>[I(T(e.$locale.baseText("ndv.title.renameNode")),1)]),_:1}),y(l,{ref:"input",modelValue:e.newName,"onUpdate:modelValue":t[0]||(t[0]=g=>e.newName=g),size:"small","data-test-id":"node-rename-input"},null,8,["modelValue"]),f("div",{class:D(e.$style.editButtons)},[y(d,{type:"secondary",size:"small",label:e.$locale.baseText("ndv.title.cancel"),onClick:t[1]||(t[1]=g=>e.editName=!1)},null,8,["label"]),y(d,{type:"primary",size:"small",label:e.$locale.baseText("ndv.title.rename"),onClick:e.onRename},null,8,["label","onClick"])],2)],34)]),_:1},8,["visible","disabled"])],2)}const ua={$style:la},ca=x(Zi,[["render",da],["__cssModules",ua]]),ha=z({name:"NodeSettingsTabs",props:{modelValue:{type:String,default:""},nodeType:{},sessionId:{type:String}},setup(){return{externalHooks:Ee()}},computed:{...te(X,j),activeNode(){return this.ndvStore.activeNode},documentationUrl(){var n,s,i,a;const e=this.nodeType;if(!e)return"";if(e.documentationUrl&&e.documentationUrl.startsWith("http"))return e.documentationUrl;const t="?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign="+e.name,o=(a=(i=(s=(n=e.codex)==null?void 0:n.resources)==null?void 0:s.primaryDocumentation)==null?void 0:i[0])==null?void 0:a.url;return o?o+t:this.isCommunityNode?`${Ln}${e.name.split(".")[0]}`:xn+t},isCommunityNode(){const e=this.nodeType;return e?cn(e.name):!1},packageName(){return this.nodeType.name.split(".")[0]},options(){const e=[{label:this.$locale.baseText("nodeSettings.parameters"),value:"params"}];this.documentationUrl&&e.push({label:this.$locale.baseText("nodeSettings.docs"),value:"docs",href:this.documentationUrl}),this.isCommunityNode&&e.push({icon:"cube",value:"communityNode",align:"right",tooltip:this.$locale.baseText("generic.communityNode.tooltip",{interpolate:{docUrl:hn,packageName:this.packageName}})});const t=!this.isCommunityNode;return e.push({icon:"cog",value:"settings",align:t?"right":void 0}),e}},methods:{onTabSelect(e){e==="docs"&&this.nodeType&&(this.externalHooks.run("dataDisplay.onDocumentationUrlClick",{nodeType:this.nodeType,documentationUrl:this.documentationUrl}),this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:M.Main,type:"docs"})),e==="settings"&&this.nodeType&&this.$telemetry.track("User viewed node settings",{node_type:this.nodeType.name,workflow_id:this.workflowsStore.workflowId}),(e==="settings"||e==="params")&&this.$emit("update:modelValue",e)},onTooltipClick(e,t){e==="communityNode"&&t.target.localName==="a"&&this.$telemetry.track("user clicked cnr docs link",{source:"node details view"})}}});function pa(e,t,o,n,s,i){const a=S("n8n-tabs");return c(),O(a,{options:e.options,"model-value":e.modelValue,"onUpdate:modelValue":e.onTabSelect,onTooltipClick:e.onTooltipClick},null,8,["options","model-value","onUpdate:modelValue","onTooltipClick"])}const fa=x(ha,[["render",pa]]),ga=z({name:"NodeWebhooks",props:["node","nodeType"],setup(){const e=ot(),t=qt(),o=bt({router:e});return{clipboard:t,workflowHelpers:o,...ze()}},data(){return{isMinimized:this.nodeType&&!to.includes(this.nodeType.name),showUrlFor:"test"}},computed:{isProductionOnly(){return this.nodeType&&Hn.includes(this.nodeType.name)},urlOptions(){return[...this.isProductionOnly?[]:[{label:this.baseText.testUrl,value:"test"}],{label:this.baseText.productionUrl,value:"production"}]},visibleWebhookUrls(){return this.webhooksNode.filter(e=>typeof e.ndvHideUrl=="string"?!this.workflowHelpers.getWebhookExpressionValue(e,"ndvHideUrl"):!e.ndvHideUrl)},webhooksNode(){return this.nodeType===null||this.nodeType.webhooks===void 0?[]:this.nodeType.webhooks.filter(e=>e.restartWebhook!==!0)},baseText(){switch(this.nodeType.name){case Qe:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.chatTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.chatTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.chatTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.chatTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.chatTrigger")};case Me:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.formTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.formTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.formTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.formTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.formTrigger")};default:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title"),copyMessage:void 0}}}},watch:{node(){this.isMinimized=!to.includes(this.nodeType.name)}},methods:{copyWebhookUrl(e){const t=this.getWebhookUrlDisplay(e);this.clipboard.copy(t),this.showMessage({title:this.baseText.copyTitle,message:this.baseText.copyMessage,type:"success"}),this.$telemetry.track("User copied webhook URL",{pane:"parameters",type:`${this.showUrlFor} url`})},getWebhookUrlDisplay(e){return this.node?this.workflowHelpers.getWebhookUrl(e,this.node,this.isProductionOnly?"production":this.showUrlFor):""},isWebhookMethodVisible(e){return typeof e.ndvHideMethod=="string"?!this.workflowHelpers.getWebhookExpressionValue(e,"ndvHideMethod"):!e.ndvHideMethod}}}),Zt=e=>(Cn("data-v-df24ab0e"),e=e(),In(),e),ma={key:0,class:"webhooks"},ya=["title"],wa={key:0,class:"node-webhooks"},va={key:0,class:"url-selection"},Na={key:0,class:"webhook-wrapper"},ka={class:"http-field"},ba={class:"http-method"},Ta=Zt(()=>f("br",null,null,-1)),Sa={class:"url-field"},Da=["onClick"],Ea=Zt(()=>f("br",null,null,-1)),Ca={key:1,class:"webhook-wrapper"},Ia={class:"url-field-full-width"},Pa=["onClick"],Oa=Zt(()=>f("br",null,null,-1));function $a(e,t,o,n,s,i){const a=S("font-awesome-icon"),r=S("n8n-radio-buttons"),l=S("el-col"),d=S("el-row"),h=S("n8n-tooltip"),p=S("el-collapse-transition");return e.webhooksNode.length&&e.visibleWebhookUrls.length>0?(c(),b("div",ma,[f("div",{class:D(["clickable headline",{expanded:!e.isMinimized}]),title:e.isMinimized?e.baseText.clickToDisplay:e.baseText.clickToHide,onClick:t[0]||(t[0]=g=>e.isMinimized=!e.isMinimized)},[y(a,{icon:"angle-right",class:"minimize-button minimize-icon"}),I(" "+T(e.baseText.toggleTitle),1)],10,ya),y(p,null,{default:w(()=>[e.isMinimized?E("",!0):(c(),b("div",wa,[e.isProductionOnly?E("",!0):(c(),b("div",va,[y(d,null,{default:w(()=>[y(l,{span:24},{default:w(()=>[y(r,{modelValue:e.showUrlFor,"onUpdate:modelValue":t[1]||(t[1]=g=>e.showUrlFor=g),options:e.urlOptions},null,8,["modelValue","options"])]),_:1})]),_:1})])),(c(!0),b(Z,null,re(e.visibleWebhookUrls,(g,N)=>(c(),O(h,{key:N,class:"item",content:e.baseText.clickToCopy,placement:"left"},{default:w(()=>[e.isWebhookMethodVisible(g)?(c(),b("div",Na,[f("div",ka,[f("div",ba,[I(T(e.workflowHelpers.getWebhookExpressionValue(g,"httpMethod")),1),Ta])]),f("div",Sa,[f("div",{class:"webhook-url left-ellipsis clickable",onClick:m=>e.copyWebhookUrl(g)},[I(T(e.getWebhookUrlDisplay(g)),1),Ea],8,Da)])])):(c(),b("div",Ca,[f("div",Ia,[f("div",{class:"webhook-url left-ellipsis clickable",onClick:m=>e.copyWebhookUrl(g)},[I(T(e.getWebhookUrlDisplay(g)),1),Oa],8,Pa)])]))]),_:2},1032,["content"]))),128))]))]),_:1})])):E("",!0)}const Ra=x(ga,[["render",$a],["__scopeId","data-v-df24ab0e"]]),_a=["data-test-id"],Aa=["textContent"],Ma=["onClick"],Wa=["onClick"],Va=["data-node-name"],Ba=["onClick"],Ua=z({__name:"NDVSubConnections",props:{rootNode:{}},emits:["switchSelectedNode","openConnectionNodeCreator"],setup(e,{expose:t,emit:o}){const n=e,s=j(),i=J(),a=We(),{debounce:r}=vt(),l=o,d=F([]),h=F([]),p=F(!1),g=Y(()=>i.getNodeType(n.rootNode.type,n.rootNode.typeVersion)),N=Y(()=>s.getNodeByName(n.rootNode.name)),m=Y(()=>s.getCurrentWorkflow()),C=Y(()=>{const V=a.getNodeIssues(g.value,n.rootNode,m.value,["typeUnknown","parameters","credentials","execution"]);return(V==null?void 0:V.input)??{}}),u=Y(()=>d.value.reduce((V,H)=>{const Q=R(m.value.getParentNodes(n.rootNode.name,H.type));return{...V,[H.type]:Q}},{}));function k(V){return d.value.find(H=>H.type===V)}function v(V){const H=k(V);return(H==null?void 0:H.maxConnections)!==1}function P(V){return v(V)&&!h.value.includes(V)}function _(V,H){v(V)&&(H?h.value=[...h.value,V]:h.value=h.value.filter(Q=>Q!==V))}function R(V){return V.map(H=>{const Q=s.getNodeByName(H);if(Q){const ve=i.getNodeType(Q.type);if(ve){const Pe=a.getNodeIssues(ve,Q,m.value),W=Pe?pn(Pe,Q):"";return{node:Q,nodeType:ve,issues:W}}}return null}).filter(H=>H!==null)}function A(V){return p.value&&(C.value[V]??[]).length>0}function $(V){return typeof V=="string"?!1:"type"in V}function B(){return!g.value||!n.rootNode?[]:fe(m.value,n.rootNode,g.value).filter(Q=>$(Q)?Q.type!=="main":!1)}function U(V,H){if(v(H)&&!h.value.includes(H)){_(H,!0);return}l("switchSelectedNode",V)}function oe(V){const H=u.value[V];if(v(V)&&!h.value.includes(V)&&H.length>=1){_(V,!0);return}l("openConnectionNodeCreator",n.rootNode.name,V)}function pe(){p.value=!1,setTimeout(()=>{p.value=!0},0)}return Xt(N,r(()=>setTimeout(()=>{h.value=[],d.value=B()},0),{debounceTime:1e3}),{immediate:!0}),t({showNodeInputsIssues:pe}),(V,H)=>{const Q=S("n8n-icon-button"),ve=S("n8n-tooltip"),Pe=Tt("on-click-outside");return c(),b("div",{class:D(V.$style.container)},[f("div",{class:D(V.$style.connections),style:ee(`--possible-connections: ${d.value.length}`)},[(c(!0),b(Z,null,re(d.value,W=>(c(),b("div",{key:W.type,"data-test-id":`subnode-connection-group-${W.type}`},[f("div",{class:D(V.$style.connectionType)},[f("span",{class:D({[V.$style.connectionLabel]:!0,[V.$style.hasIssues]:A(W.type)}),textContent:T(`${W.displayName}${W.required?" *":""}`)},null,10,Aa),G((c(),b("div",{class:D({[V.$style.connectedNodesWrapper]:!0,[V.$style.connectedNodesWrapperExpanded]:h.value.includes(W.type)}),style:ee(`--nodes-length: ${u.value[W.type].length}`),onClick:q=>_(W.type,!0)},[!(u.value[W.type].length>=1)||W.maxConnections!==1?(c(),b("div",{key:0,class:D({[V.$style.plusButton]:!0,[V.$style.hasIssues]:A(W.type)}),onClick:q=>oe(W.type)},[y(ve,{placement:"top",teleported:!0,offset:10,"show-after":300,disabled:P(W.type)&&u.value[W.type].length>=1},{content:w(()=>[I(" Add "+T(W.displayName)+" ",1),A(W.type)?(c(),O(Vt,{key:0,title:`${V.$locale.baseText("node.issues")}:`,items:C.value[W.type]},null,8,["title","items"])):E("",!0)]),default:w(()=>[y(Q,{size:"medium",icon:"plus",type:"tertiary","data-test-id":`add-subnode-${W.type}`},null,8,["data-test-id"])]),_:2},1032,["disabled"])],10,Wa)):E("",!0),u.value[W.type].length>0?(c(),b("div",{key:1,class:D({[V.$style.connectedNodes]:!0,[V.$style.connectedNodesMultiple]:u.value[W.type].length>1})},[(c(!0),b(Z,null,re(u.value[W.type],(q,ue)=>(c(),b("div",{key:q.node.name,class:D({[V.$style.nodeWrapper]:!0,[V.$style.hasIssues]:q.issues}),"data-test-id":"floating-subnode","data-node-name":q.node.name,style:ee(`--node-index: ${ue}`)},[(c(),O(ve,{key:q.node.name,placement:"top",teleported:!0,offset:10,"show-after":300,disabled:P(W.type)},{content:w(()=>[I(T(q.node.name)+" ",1),q.issues?(c(),O(Vt,{key:0,title:`${V.$locale.baseText("node.issues")}:`,items:q.issues},null,8,["title","items"])):E("",!0)]),default:w(()=>[f("div",{class:D(V.$style.connectedNode),onClick:Oe=>U(q.node.name,W.type)},[y(tt,{"node-type":q.nodeType,"node-name":q.node.name,"tooltip-position":"top",size:20,circle:""},null,8,["node-type","node-name"])],10,Ba)]),_:2},1032,["disabled"]))],14,Va))),128))],2)):E("",!0)],14,Ma)),[[Pe,()=>_(W.type,!1)]])],2)],8,_a))),128))],6)],2)}}}),La="_container_547vc_22",xa="_connections_547vc_30",Ha="_connectionType_547vc_42",Fa="_connectionLabel_547vc_49",za="_hasIssues_547vc_55",Ya="_connectedNodesWrapper_547vc_59",Ka="_plusButton_547vc_67",ja="_connectedNodesWrapperExpanded_547vc_85",qa="_connectedNodesMultiple_547vc_91",Ga="_connectedNode_547vc_59",Ja="_connectedNodes_547vc_59",Xa="_nodeWrapper_547vc_129",Qa={container:La,connections:xa,connectionType:Ha,connectionLabel:Fa,hasIssues:za,connectedNodesWrapper:Ya,plusButton:Ka,"horizontal-shake":"_horizontal-shake_547vc_1",connectedNodesWrapperExpanded:ja,connectedNodesMultiple:qa,connectedNode:Ga,connectedNodes:Ja,nodeWrapper:Xa},Za={$style:Qa},er=x(Ua,[["__cssModules",Za]]);function _n(e={}){const t=J(),o=Y(()=>{if(e.nodeType)return L(e.nodeType);const i=L(e.node);return i?t.getNodeType(i.type,i.typeVersion):null}),n=Y(()=>{var a,r,l;if(!((a=o.value)!=null&&a.outputs)||typeof((r=o.value)==null?void 0:r.outputs)=="string")return!1;const i=ge((l=o.value)==null?void 0:l.outputs);return i?i.filter(d=>d!==M.Main).length>0:!1}),s=Y(()=>{var i;return(((i=o.value)==null?void 0:i.outputs)??[]).length>1});return{nodeType:o,isSubNodeType:n,isMultipleOutputsNodeType:s}}function Se(e,t={}){const o=xt(),n=j(),s=ze(),i=Ne(),a=jn(),r=Ee(),{sessionId:l}=kt(o),{isSubNodeType:d,isMultipleOutputsNodeType:h}=_n({node:e}),p=Y(()=>{const R=L(e);return R?n.pinDataByNodeName(R.name):void 0}),g=Y(()=>!!L(e)&&typeof p.value<"u"),N=Y(()=>{const R=L(e);return!!R&&!d.value&&!h.value&&!un.includes(R.type)});function m(R){try{return JSON.parse(R),!0}catch(A){const $=i.baseText("runData.editOutputInvalid"),B=new RegExp(/JSON\.parse:|of the JSON data/,"g"),U=A.message.replace(B,"").trim(),oe=/at position (\d+)/,pe=A.message.match(oe);if(A.message=U.charAt(0).toUpperCase()+U.slice(1),A.message=A.message.replace("Unexpected token ' in JSON",i.baseText("runData.editOutputInvalid.singleQuote")),pe){const V=parseInt(pe[1],10),H=(R.slice(0,V).match(/\n/g)||[]).length;A.message=A.message.replace(oe,i.baseText("runData.editOutputInvalid.atPosition",{interpolate:{position:`${V}`}})),A.message=`${i.baseText("runData.editOutputInvalid.onLine",{interpolate:{line:`${H+1}`}})} ${A.message}`}return s.showError(A,$),!1}}function C(R){const A=L(e);if(!A)return!1;typeof R=="object"&&(R=JSON.stringify(R));const{pinData:$,...B}=n.getCurrentWorkflow(),U=Fn(B,{replaceCircularRefs:!0}),oe={...$,[A.name]:R},pe=n.getPinDataSize(oe);return pe>zn?(s.showError(new Error(i.baseText("ndv.pinData.error.tooLarge.description")),i.baseText("ndv.pinData.error.tooLarge.title")),!1):st(U)+pe>Yn-Kn?(s.showError(new Error(i.baseText("ndv.pinData.error.tooLargeWorkflow.description")),i.baseText("ndv.pinData.error.tooLargeWorkflow.title")),!1):!0}function u({source:R}){const A=L(e),$=L(t.displayMode),B=L(t.runIndex),U={pinning_source:R,node_type:A==null?void 0:A.type,session_id:l.value,data_size:st(p.value),view:$,run_index:B};r.run("runData.onDataPinningSuccess",U),a.track("Ndv data pinning success",U)}function k({errorType:R,source:A}){const $=L(e),B=L(t.displayMode),U=L(t.runIndex);a.track("Ndv data pinning failure",{pinning_source:A,node_type:$==null?void 0:$.type,session_id:l.value,data_size:st(p.value),view:B,run_index:U,error_type:R})}function v(R,A){const $=L(e);if($){if(typeof R=="string"){if(!m(R))throw k({errorType:"invalid-json",source:A}),new Error("Invalid JSON");R=Nt(R)}if(!C(R))throw k({errorType:"data-too-large",source:A}),new Error("Data too large");n.pinData({node:$,data:R}),u({source:A})}}function P({source:R}){const A=L(e),$=L(t.runIndex);a.track("User unpinned ndv data",{node_type:A==null?void 0:A.type,session_id:l.value,run_index:$,source:R,data_size:st(p.value)})}function _(R){const A=L(e);A&&(P({source:R}),n.unpinData({node:A}))}return{data:p,hasData:g,isValidNodeType:N,setData:v,onSetDataSuccess:u,onSetDataError:k,unsetData:_,onUnsetData:P,isValidJSON:m,isValidSize:C}}const tr=z({inheritAttrs:!1,props:{nodeName:{type:String,required:!0},disabled:{type:Boolean,default:!1},label:{type:String},type:{type:String},size:{type:String},transparent:{type:Boolean,default:!1},telemetrySource:{type:String},hideIcon:{type:Boolean}},setup(e){const t=ot(),n=j().getNodeByName(e.nodeName),s=Se(n),i=Ee(),{runWorkflow:a}=kn({router:t});return{externalHooks:i,pinnedData:s,runWorkflow:a,...ze(),...Gt()}},computed:{...te(J,X,j,de),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},nodeRunning(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&(this.workflowsStore.isNodeExecuting(this.node.name)||e===this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isTriggerNode(){return this.node?this.nodeTypesStore.isTriggerNode(this.node.type):!1},isManualTriggerNode(){return!!(this.nodeType&&this.nodeType.name===Ze)},isChatNode(){return!!(this.nodeType&&this.nodeType.name===Qe)},isFormTriggerNode(){return!!(this.nodeType&&this.nodeType.name===Me)},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){var e;return!!((e=this.nodeType)!=null&&e.group.includes("schedule"))},isWebhookNode(){return!!(this.nodeType&&this.nodeType.name===_e)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return this.node&&!this.node.disabled&&this.isTriggerNode&&e&&(!t||t===this.nodeName)},isListeningForWorkflowEvents(){return this.nodeRunning&&this.isTriggerNode&&!this.isScheduleTrigger&&!this.isManualTriggerNode},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},disabledHint(){if(this.isListeningForEvents)return"";if(this.isTriggerNode&&this.node.disabled)return this.$locale.baseText("ndv.execute.nodeIsDisabled");if(this.isTriggerNode&&this.hasIssues){const e=this.ndvStore.activeNode;return e&&e.name!==this.nodeName?this.$locale.baseText("ndv.execute.fixPrevious"):this.$locale.baseText("ndv.execute.requiredFieldsMissing")}return this.workflowRunning&&!this.nodeRunning?this.$locale.baseText("ndv.execute.workflowAlreadyRunning"):""},buttonLabel(){var e;return this.isListeningForEvents||this.isListeningForWorkflowEvents?this.$locale.baseText("ndv.execute.stopListening"):this.label?this.label:this.isChatNode?this.$locale.baseText("ndv.execute.testChat"):this.isWebhookNode?this.$locale.baseText("ndv.execute.listenForTestEvent"):this.isFormTriggerNode?this.$locale.baseText("ndv.execute.testStep"):this.isPollingTypeNode||(e=this.nodeType)!=null&&e.mockManualExecution?this.$locale.baseText("ndv.execute.fetchEvent"):this.$locale.baseText("ndv.execute.testNode")}},methods:{async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("ndv.execute.stopWaitingForWebhook.error"));return}},async onClick(){if(this.isChatNode)this.ndvStore.setActiveNodeName(null),ie.emit("openChat");else if(this.isListeningForEvents)await this.stopWaitingForWebhook();else if(this.isListeningForWorkflowEvents)this.$emit("stopExecution");else{let e=!1;if(this.pinnedData.hasData.value&&(e=await this.confirm(this.$locale.baseText("ndv.pinData.unpinAndExecute.description"),this.$locale.baseText("ndv.pinData.unpinAndExecute.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.cancel")})===xe,e&&this.node&&this.pinnedData.unsetData("unpin-and-execute-modal")),!this.pinnedData.hasData.value||e){const t={node_type:this.nodeType?this.nodeType.name:null,workflow_id:this.workflowsStore.workflowId,source:this.telemetrySource,session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",t),await this.externalHooks.run("nodeExecuteButton.onClick",t),await this.runWorkflow({destinationNode:this.nodeName,source:"RunData.ExecuteNodeButton"}),this.$emit("execute")}}}}});function or(e,t,o,n,s,i){const a=S("n8n-button"),r=S("n8n-tooltip");return c(),b("div",null,[y(r,{placement:"bottom",disabled:!e.disabledHint},{content:w(()=>[f("div",null,T(e.disabledHint),1)]),default:w(()=>[f("div",null,[y(a,Bi(e.$attrs,{loading:e.nodeRunning&&!e.isListeningForEvents&&!e.isListeningForWorkflowEvents,disabled:e.disabled||!!e.disabledHint,label:e.buttonLabel,type:e.type,size:e.size,icon:!e.isListeningForEvents&&!e.hideIcon&&"flask","transparent-background":e.transparent,title:e.isTriggerNode?"":e.$locale.baseText("ndv.execute.testNode.description"),onClick:e.onClick}),null,16,["loading","disabled","label","type","size","icon","transparent-background","title","onClick"])])]),_:1},8,["disabled"])])}const eo=x(tr,[["render",or]]),nr=z({name:"NodeSettings",components:{NodeTitle:ca,NodeCredentials:ei,ParameterInputList:ti,NodeSettingsTabs:fa,NodeWebhooks:Ra,NDVSubConnections:er,NodeExecuteButton:eo},setup(){const e=We();return{externalHooks:Ee(),nodeHelpers:e}},computed:{...te(Jt,J,X,de,fn,j,bn),isCurlImportModalOpen(){return this.uiStore.isModalOpen(oo)},isReadOnly(){return this.readOnly||this.hasForeignCredential},isExecutable(){if(this.nodeType&&this.node){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=fe(e,t,this.nodeType);if(!ge(o).includes(M.Main)&&!this.isTriggerNode)return!1}return this.executable||this.hasForeignCredential},nodeTypeName(){if(this.nodeType){const e=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${e}.displayName`,fallback:this.nodeType.name})}return""},nodeTypeVersions(){return this.node?this.nodeTypesStore.getNodeVersions(this.node.type):[]},latestVersion(){return Math.max(...this.nodeTypeVersions)},isLatestNodeVersion(){var e;return!((e=this.node)!=null&&e.typeVersion)||this.latestVersion===this.node.typeVersion},nodeVersionTag(){return!this.nodeType||this.nodeType.hidden?this.$locale.baseText("nodeSettings.deprecated"):this.isLatestNodeVersion?this.$locale.baseText("nodeSettings.latest"):this.$locale.baseText("nodeSettings.latestVersion",{interpolate:{version:this.latestVersion.toString()}})},nodeTypeDescription(){var e;if((e=this.nodeType)!=null&&e.description){const t=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${t}.description`,fallback:this.nodeType.description})}else return this.$locale.baseText("nodeSettings.noDescriptionFound")},headerStyle(){return this.node?{"background-color":this.node.color}:{}},node(){return this.ndvStore.activeNode},parametersSetting(){return this.parameters.filter(e=>e.isNodeSetting)},parametersNoneSetting(){return this.parameters.filter(e=>!e.isNodeSetting)},parameters(){return this.nodeType===null?[]:this.nodeType.properties},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isCommunityNode(){var e;return cn((e=this.node)==null?void 0:e.type)},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode((e=this.node)==null?void 0:e.type)},workflowOwnerName(){return this.workflowsEEStore.getWorkflowOwnerName(`${this.workflowsStore.workflowId}`)},hasForeignCredential(){return this.foreignCredentials.length>0},usedCredentials(){return Object.values(this.workflowsStore.usedCredentials).filter(e=>{var t;return Object.values(((t=this.node)==null?void 0:t.credentials)||[]).find(o=>o.id===e.id)})},credentialOwnerName(){const e=this.usedCredentials?Object.values(this.usedCredentials).find(t=>t.id===this.foreignCredentials[0]):void 0;return this.credentialsStore.getCredentialOwnerName(e)}},props:{eventBus:{type:Object},dragging:{type:Boolean},sessionId:{type:String},nodeType:{type:Object},readOnly:{type:Boolean,default:!1},foreignCredentials:{type:Array,default:()=>[]},blockUI:{type:Boolean,default:!1},executable:{type:Boolean,default:!0}},data(){return{nodeValid:!0,nodeColor:null,openPanel:"params",nodeValues:{color:"#ff0000",alwaysOutputData:!1,executeOnce:!1,notesInFlow:!1,onError:"stopWorkflow",retryOnFail:!1,maxTries:3,waitBetweenTries:1e3,notes:"",parameters:{}},nodeValuesInitialized:!1,nodeSettings:[],COMMUNITY_NODES_INSTALLATION_DOCS_URL:hn,CUSTOM_NODES_DOCS_URL:qn,MAIN_NODE_PANEL_WIDTH:Le,hiddenIssuesInputs:[]}},watch:{node(e,t){this.setNodeValues()},isCurlImportModalOpen(e,t){if(e===!1){let o=this.uiStore.getHttpNodeParameters||"";if(!o)return;try{o=JSON.parse(o),this.valueChanged({node:this.node.name,name:"parameters",value:o}),this.uiStore.setHttpNodeParameters({name:oo,parameters:""})}catch{}}}},mounted(){var e;this.populateHiddenIssuesSet(),this.populateSettings(),this.setNodeValues(),(e=this.eventBus)==null||e.on("openSettings",this.openSettings),this.nodeHelpers.updateNodeParameterIssues(this.node,this.nodeType)},beforeUnmount(){var e;(e=this.eventBus)==null||e.off("openSettings",this.openSettings)},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},onOpenConnectionNodeCreator(e,t){this.$emit("openConnectionNodeCreator",e,t)},populateHiddenIssuesSet(){!this.node||!this.workflowsStore.isNodePristine(this.node.name)||(this.hiddenIssuesInputs.push("credentials"),this.parametersNoneSetting.forEach(e=>{this.hiddenIssuesInputs.push(e.name)}),this.workflowsStore.setNodePristine(this.node.name,!1))},populateSettings(){this.isExecutable&&!this.isTriggerNode&&this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.alwaysOutputData.displayName"),name:"alwaysOutputData",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.alwaysOutputData.description")},{displayName:this.$locale.baseText("nodeSettings.executeOnce.displayName"),name:"executeOnce",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.executeOnce.description")},{displayName:this.$locale.baseText("nodeSettings.retryOnFail.displayName"),name:"retryOnFail",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.retryOnFail.description")},{displayName:this.$locale.baseText("nodeSettings.maxTries.displayName"),name:"maxTries",type:"number",typeOptions:{minValue:2,maxValue:5},default:3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.maxTries.description")},{displayName:this.$locale.baseText("nodeSettings.waitBetweenTries.displayName"),name:"waitBetweenTries",type:"number",typeOptions:{minValue:0,maxValue:5e3},default:1e3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.waitBetweenTries.description")},{displayName:this.$locale.baseText("nodeSettings.onError.displayName"),name:"onError",type:"options",options:[{name:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.displayName"),value:"stopWorkflow",description:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.displayName"),value:"continueRegularOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.displayName"),value:"continueErrorOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.description")}],default:"stopWorkflow",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.onError.description")}),this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.notes.displayName"),name:"notes",type:"string",typeOptions:{rows:5},default:"",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notes.description")},{displayName:this.$locale.baseText("nodeSettings.notesInFlow.displayName"),name:"notesInFlow",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notesInFlow.description")})},onParameterBlur(e){this.hiddenIssuesInputs=this.hiddenIssuesInputs.filter(t=>t!==e)},onWorkflowActivate(){this.hiddenIssuesInputs=[],this.$emit("activate")},onNodeExecute(){var e;this.hiddenIssuesInputs=[],(e=this.$refs.subConnections)==null||e.showNodeInputsIssues(),this.$emit("execute")},setValue(e,t){const o=e.split(".");let n=o.pop(),s=!1;if(n!==void 0&&n.includes("[")){const i=n.match(/(.*)\[(\d+)\]$/);i&&(o.push(i[1]),n=i[2],s=!0)}if(o.length===0)if(t===null){const{[n]:i,...a}=this.nodeValues;this.nodeValues=a}else this.nodeValues={...this.nodeValues,[n]:t};else if(t===null){let i=ye(this.nodeValues,o.join("."));const{[n]:a,...r}=i;if(i=r,s&&i.length===0){n=o.pop(),i=ye(this.nodeValues,o.join("."));const{[n]:l,...d}=i;i=d}}else typeof t=="object"?Be(ye(this.nodeValues,o.join(".")),n,Re(t)):Be(ye(this.nodeValues,o.join(".")),n,t);this.nodeValues={...this.nodeValues}},credentialSelected(e){this.workflowsStore.updateNodeProperties(e);const t=this.workflowsStore.getNodeByName(e.name);t&&this.nodeHelpers.updateNodeCredentialIssues(t),this.externalHooks.run("nodeSettings.credentialSelected",{updateInformation:e})},nameChanged(e){this.node&&this.historyStore.pushCommandToUndo(new Tn(this.node.name,e)),this.valueChanged({value:e,name:"name"})},valueChanged(e){var s;let t;e.hasOwnProperty("value")?t=e.value:t=ye(this.nodeValues,e.name);const o=e.node||((s=this.node)==null?void 0:s.name),n=this.workflowsStore.getNodeByName(o);if(n!==null)if(e.name==="onError"&&this.$emit("redrawRequired"),e.name==="name"){const i={value:t,oldValue:o,name:e.name};this.$emit("valueChanged",i)}else if(e.name==="parameters"){const i=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!i)return;let a=He(i.properties,n.parameters,!1,!1,n);const r=Object.assign({},a);a=Re(a);for(const l of Object.keys(e.value)){t=e.value[l];const d=l.split(".").slice(1).join("."),h=d.match(/(.*)\[(\d+)\]$/);if(e[l]===void 0&&h!==null){const p=h[1],g=h[2],N=ye(a,p);Array.isArray(N)&&(N.splice(parseInt(g,10),1),Be(a,p,N))}else t===void 0?Ot(a,d):Be(a,d,t);this.externalHooks.run("nodeSettings.valueChanged",{parameterPath:d,newValue:t,parameters:this.parameters,oldNodeParameters:r})}a=He(i.properties,a,!0,!1,n);for(const l of Object.keys(a))a&&a[l]!==null&&a[l]!==void 0&&this.setValue(`parameters.${l}`,a[l]);if(a){const l={name:n.name,value:a};this.workflowsStore.setNodeParameters(l),this.nodeHelpers.updateNodeParameterIssuesByName(n.name),this.nodeHelpers.updateNodeCredentialIssuesByName(n.name)}}else if(e.name.startsWith("parameters.")){const i=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!i)return;let a=He(i.properties,n.parameters,!1,!1,n);const r=Object.assign({},a);a=Re(a);const l=e.name.split(".").slice(1).join("."),d=l.match(/(.*)\[(\d+)\]$/);if(e.value===void 0&&d!==null){const p=d[1],g=d[2],N=ye(a,p);Array.isArray(N)&&(N.splice(parseInt(g,10),1),Be(a,p,N))}else t===void 0?Ot(a,l):Be(a,l,t),this.removeMismatchedOptionValues(i,a,{name:l,value:t});a=He(i.properties,a,!0,!1,n);for(const p of Object.keys(a))a&&a[p]!==null&&a[p]!==void 0&&this.setValue(`parameters.${p}`,a[p]);const h={name:n.name,value:a};this.workflowsStore.setNodeParameters(h),this.externalHooks.run("nodeSettings.valueChanged",{parameterPath:l,newValue:t,parameters:this.parameters,oldNodeParameters:r}),this.nodeHelpers.updateNodeParameterIssuesByName(n.name),this.nodeHelpers.updateNodeCredentialIssuesByName(n.name),this.$telemetry.trackNodeParametersValuesChange(i.name,e)}else{this.nodeValues={...this.nodeValues,[e.name]:t};const i={name:n.name,key:e.name,value:t};this.workflowsStore.setNodeValue(i)}},removeMismatchedOptionValues(e,t,o){e.properties.forEach(n=>{var l,d;const s=n.displayOptions;if(!(t!=null&&t.hasOwnProperty(n.name))||!s||!n.options)return;const i=(l=s.show)==null?void 0:l[o.name],a=(d=s.hide)==null?void 0:d[o.name];if(i===void 0&&a===void 0)return;(!Object.keys(t).every(h=>(n.options??[]).find(p=>p.name===h)!==void 0)||i!==o.value||a===o.value)&&Ot(t,n.name)})},setNodeValues(){if(!this.node){this.nodeValuesInitialized=!0;return}if(this.nodeType!==null){this.nodeValid=!0;const e=[];this.node.color&&(e.push("color"),this.nodeValues={...this.nodeValues,color:this.node.color}),this.node.notes&&(e.push("notes"),this.nodeValues={...this.nodeValues,notes:this.node.notes}),this.node.alwaysOutputData&&(e.push("alwaysOutputData"),this.nodeValues={...this.nodeValues,alwaysOutputData:this.node.alwaysOutputData}),this.node.executeOnce&&(e.push("executeOnce"),this.nodeValues={...this.nodeValues,executeOnce:this.node.executeOnce}),this.node.continueOnFail&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:"continueRegularOutput"}),this.node.onError&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:this.node.onError}),this.node.notesInFlow&&(e.push("notesInFlow"),this.nodeValues={...this.nodeValues,notesInFlow:this.node.notesInFlow}),this.node.retryOnFail&&(e.push("retryOnFail"),this.nodeValues={...this.nodeValues,retryOnFail:this.node.retryOnFail}),this.node.maxTries&&(e.push("maxTries"),this.nodeValues={...this.nodeValues,maxTries:this.node.maxTries}),this.node.waitBetweenTries&&(e.push("waitBetweenTries"),this.nodeValues={...this.nodeValues,waitBetweenTries:this.node.waitBetweenTries});for(const t of this.nodeSettings)e.includes(t.name)||(this.nodeValues={...this.nodeValues,[t.name]:t.default});this.nodeValues={...this.nodeValues,parameters:Re(this.node.parameters)}}else this.nodeValid=!1;this.nodeValuesInitialized=!0},onMissingNodeTextClick(e){e.target.localName==="a"&&this.$telemetry.track("user clicked cnr browse button",{source:"cnr missing node modal"})},onMissingNodeLearnMoreLinkClick(){var e,t;this.$telemetry.track("user clicked cnr docs link",{source:"missing node modal source",package_name:(e=this.node)==null?void 0:e.type.split(".")[0],node_type:(t=this.node)==null?void 0:t.type})},onStopExecution(){this.$emit("stopExecution")},openSettings(){this.openPanel="settings"}}}),sr="_header_1uxvz_5",ir="_warningIcon_1uxvz_9",ar="_descriptionContainer_1uxvz_14",rr={header:sr,warningIcon:ir,descriptionContainer:ar},lr={class:"header-side-menu"},dr={key:1},ur={key:0,class:"node-is-not-valid"},cr={class:"missingNodeTitleContainer mt-s mb-xs"},hr={class:"mb-l"},pr=["href"],fr=["href","textContent"],gr={key:1,class:"node-parameters-wrapper","data-test-id":"node-parameters"},mr={key:1,class:"no-parameters"},yr={key:2,class:"parameter-item parameter-notice","data-test-id":"node-parameters-http-notice"},wr={class:"node-version","data-test-id":"node-version"};function vr(e,t,o,n,s,i){var P;const a=S("NodeTitle"),r=S("NodeExecuteButton"),l=S("NodeSettingsTabs"),d=S("font-awesome-icon"),h=S("n8n-text"),p=S("i18n-t"),g=S("n8n-link"),N=S("n8n-notice"),m=S("NodeWebhooks"),C=S("NodeCredentials"),u=S("ParameterInputList"),k=S("NDVSubConnections"),v=S("n8n-block-ui");return c(),b("div",{class:D({"node-settings":!0,dragging:e.dragging}),onKeydown:t[1]||(t[1]=se(()=>{},["stop"]))},[f("div",{class:D(e.$style.header)},[f("div",lr,[e.node?(c(),O(a,{key:0,class:"node-name","model-value":e.node.name,"node-type":e.nodeType,"read-only":e.isReadOnly,"onUpdate:modelValue":e.nameChanged},null,8,["model-value","node-type","read-only","onUpdate:modelValue"])):E("",!0),e.isExecutable?(c(),b("div",dr,[!e.blockUI&&e.node&&e.nodeValid?(c(),O(r,{key:0,"data-test-id":"node-execute-button","node-name":e.node.name,disabled:e.outputPanelEditMode.enabled&&!e.isTriggerNode,size:"small","telemetry-source":"parameters",onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution},null,8,["node-name","disabled","onExecute","onStopExecution"])):E("",!0)])):E("",!0)]),e.node&&e.nodeValid?(c(),O(l,{key:0,modelValue:e.openPanel,"onUpdate:modelValue":t[0]||(t[0]=_=>e.openPanel=_),"node-type":e.nodeType,"session-id":e.sessionId},null,8,["modelValue","node-type","session-id"])):E("",!0)],2),e.node&&!e.nodeValid?(c(),b("div",ur,[f("p",{class:D(e.$style.warningIcon)},[y(d,{icon:"exclamation-triangle"})],2),f("div",cr,[y(h,{size:"large",color:"text-dark",bold:""},{default:w(()=>[I(T(e.$locale.baseText("nodeSettings.communityNodeUnknown.title")),1)]),_:1})]),e.isCommunityNode?(c(),b("div",{key:0,class:D(e.$style.descriptionContainer)},[f("div",hr,[y(p,{keypath:"nodeSettings.communityNodeUnknown.description",tag:"span",onClick:e.onMissingNodeTextClick},{action:w(()=>[f("a",{href:`https://www.npmjs.com/package/${e.node.type.split(".")[0]}`,target:"_blank"},T(e.node.type.split(".")[0]),9,pr)]),_:1},8,["onClick"])]),y(g,{to:e.COMMUNITY_NODES_INSTALLATION_DOCS_URL,onClick:e.onMissingNodeLearnMoreLinkClick},{default:w(()=>[I(T(e.$locale.baseText("nodeSettings.communityNodeUnknown.installLink.text")),1)]),_:1},8,["to","onClick"])],2)):(c(),O(p,{key:1,keypath:"nodeSettings.nodeTypeUnknown.description",tag:"span"},{action:w(()=>[f("a",{href:e.CUSTOM_NODES_DOCS_URL,target:"_blank",textContent:T(e.$locale.baseText("nodeSettings.nodeTypeUnknown.description.customNode"))},null,8,fr)]),_:1}))])):E("",!0),e.node&&e.nodeValid?(c(),b("div",gr,[e.hasForeignCredential?(c(),O(N,{key:0,content:e.$locale.baseText("nodeSettings.hasForeignCredential",{interpolate:{owner:e.credentialOwnerName}})},null,8,["content"])):E("",!0),G(f("div",null,[y(m,{node:e.node,"node-type":e.nodeType},null,8,["node","node-type"]),e.nodeValuesInitialized?(c(),O(u,{key:0,parameters:e.parametersNoneSetting,"hide-delete":!0,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onActivate:e.onWorkflowActivate,onParameterBlur:e.onParameterBlur},{default:w(()=>[y(C,{node:e.node,readonly:e.isReadOnly,"show-all":!0,"hide-issues":e.hiddenIssuesInputs.includes("credentials"),onCredentialSelected:e.credentialSelected,onValueChanged:e.valueChanged,onBlur:e.onParameterBlur},null,8,["node","readonly","hide-issues","onCredentialSelected","onValueChanged","onBlur"])]),_:1},8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onActivate","onParameterBlur"])):E("",!0),e.parametersNoneSetting.length===0?(c(),b("div",mr,[y(h,null,{default:w(()=>[I(T(e.$locale.baseText("nodeSettings.thisNodeDoesNotHaveAnyParameters")),1)]),_:1})])):E("",!0),e.nodeHelpers.isCustomApiCallSelected(e.nodeValues)?(c(),b("div",yr,[y(N,{content:e.$locale.baseText("nodeSettings.useTheHttpRequestNode",{interpolate:{nodeTypeDisplayName:e.nodeType.displayName}})},null,8,["content"])])):E("",!0)],512),[[ne,e.openPanel==="params"]]),G(f("div",null,[y(u,{parameters:e.parametersSetting,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onParameterBlur"]),y(u,{parameters:e.nodeSettings,"hide-delete":!0,"node-values":e.nodeValues,"is-read-only":e.isReadOnly,"hidden-issues-inputs":e.hiddenIssuesInputs,path:"",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","node-values","is-read-only","hidden-issues-inputs","onValueChanged","onParameterBlur"]),f("div",wr,[I(T(e.$locale.baseText("nodeSettings.nodeVersion",{interpolate:{node:(P=e.nodeType)==null?void 0:P.displayName,version:(e.node.typeVersion??e.latestVersion).toString()}}))+" ",1),f("span",null,"("+T(e.nodeVersionTag)+")",1)])],512),[[ne,e.openPanel==="settings"]])])):E("",!0),e.node?(c(),O(k,{key:2,ref:"subConnections","root-node":e.node,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator},null,8,["root-node","onSwitchSelectedNode","onOpenConnectionNodeCreator"])):E("",!0),y(v,{show:e.blockUI},null,8,["show"])],34)}const Nr={$style:rr},kr=x(nr,[["render",vr],["__cssModules",Nr],["__scopeId","data-v-b094ac2b"]]),br=z({name:"Draggable",props:{disabled:{type:Boolean},type:{type:String},data:{type:String},tag:{type:String,default:"div"},targetDataKey:{type:String}},data(){const e={x:-100,y:-100};return{isDragging:!1,draggablePosition:e,draggingEl:null,draggableStyle:{transform:`translate(${e.x}px, ${e.y}px)`},animationFrameId:0}},computed:{...te(X),canDrop(){return this.ndvStore.canDraggableDrop},stickyPosition(){return this.ndvStore.draggableStickyPos}},methods:{setDraggableStyle(){this.draggableStyle={transform:`translate(${this.draggablePosition.x}px, ${this.draggablePosition.y}px)`}},onDragStart(e){var o,n,s;if(this.disabled||(this.draggingEl=e.target,this.targetDataKey&&((o=this.draggingEl.dataset)==null?void 0:o.target)!==this.targetDataKey&&(this.draggingEl=this.draggingEl.closest(`[data-target="${this.targetDataKey}"]`)),this.targetDataKey&&((s=(n=this.draggingEl)==null?void 0:n.dataset)==null?void 0:s.target)!==this.targetDataKey))return;e.preventDefault(),e.stopPropagation(),this.isDragging=!1,this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),window.addEventListener("mousemove",this.onDrag),window.addEventListener("mouseup",this.onDragEnd);const t=document.activeElement;t&&t.blur()},onDrag(e){var t;if(e.preventDefault(),e.stopPropagation(),!this.disabled){if(!this.isDragging){this.isDragging=!0;const o=this.targetDataKey&&this.draggingEl?this.draggingEl.dataset.value:this.data||"";this.ndvStore.draggableStartDragging({type:this.type,data:o||"",dimensions:((t=this.draggingEl)==null?void 0:t.getBoundingClientRect())??null}),this.$emit("dragstart",this.draggingEl),document.body.style.cursor="grabbing"}this.animationFrameId=window.requestAnimationFrame(()=>{this.canDrop&&this.stickyPosition?this.draggablePosition={x:this.stickyPosition[0],y:this.stickyPosition[1]}:this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),this.$emit("drag",this.draggablePosition)})}},onDragEnd(){this.disabled||(document.body.style.cursor="unset",window.removeEventListener("mousemove",this.onDrag),window.removeEventListener("mouseup",this.onDragEnd),window.cancelAnimationFrame(this.animationFrameId),setTimeout(()=>{this.$emit("dragend",this.draggingEl),this.isDragging=!1,this.draggingEl=null,this.ndvStore.draggableStopDragging()},0))}}}),Tr="_dragging_bt5wj_5",Sr="_draggable_bt5wj_10",Dr={dragging:Tr,draggable:Sr,"draggable-data-transfer":"_draggable-data-transfer_bt5wj_17"};function Er(e,t,o,n,s,i){return c(),O(On(e.tag),{ref:"wrapper",class:D({[e.$style.dragging]:e.isDragging}),onMousedown:e.onDragStart},{default:w(()=>[le(e.$slots,"default",{isDragging:e.isDragging}),(c(),O(Pn,{to:"body"},[G(f("div",{ref:"draggable",class:D(e.$style.draggable),style:ee(e.draggableStyle)},[le(e.$slots,"preview",{canDrop:e.canDrop,el:e.draggingEl})],6),[[ne,e.isDragging]])]))]),_:3},40,["class","onMousedown"])}const Cr={$style:Dr},Ir=x(br,[["render",Er],["__cssModules",Cr]]),Pr=z({components:{Draggable:Ir},props:{canMoveRight:{type:Boolean},canMoveLeft:{type:Boolean}},methods:{onDrag(e){this.$emit("drag",e)},onDragStart(){this.$emit("dragstart")},onDragEnd(){this.$emit("dragend")}}}),Or="_dragContainer_4rvyw_5",$r="_dragButton_4rvyw_9",Rr="_leftArrow_4rvyw_23 _arrow_4rvyw_32",_r="_rightArrow_4rvyw_24 _arrow_4rvyw_32",Ar="_visible_4rvyw_28",Mr="_arrow_4rvyw_32",Wr="_grid_4rvyw_50",Vr={dragContainer:Or,dragButton:$r,leftArrow:Rr,rightArrow:_r,visible:Ar,arrow:Mr,grid:Wr},Br=f("div",null,[f("div"),f("div"),f("div"),f("div"),f("div")],-1),Ur=f("div",null,[f("div"),f("div"),f("div"),f("div"),f("div")],-1),Lr=[Br,Ur];function xr(e,t,o,n,s,i){const a=S("font-awesome-icon"),r=S("Draggable");return c(),O(r,{type:"panel-resize",class:D(e.$style.dragContainer),onDrag:e.onDrag,onDragstart:e.onDragStart,onDragend:e.onDragEnd},{default:w(({isDragging:l})=>[f("div",{class:D({[e.$style.dragButton]:!0})},[e.canMoveLeft?(c(),b("span",{key:0,class:D({[e.$style.leftArrow]:!0,[e.$style.visible]:l})},[y(a,{icon:"arrow-left"})],2)):E("",!0),e.canMoveRight?(c(),b("span",{key:1,class:D({[e.$style.rightArrow]:!0,[e.$style.visible]:l})},[y(a,{icon:"arrow-right"})],2)):E("",!0),f("div",{class:D(e.$style.grid)},Lr,2)],2)]),_:1},8,["class","onDrag","onDragstart","onDragend"])}const Hr={$style:Vr},Fr=x(Pr,[["render",xr],["__cssModules",Hr]]),zr=["data-node-name","data-node-placement","onClick"],Yr=z({__name:"NDVFloatingNodes",props:{rootNode:{}},emits:["switchSelectedNode"],setup(e,{expose:t,emit:o}){const n=e,s=j(),i=J(),a=s.getCurrentWorkflow(),r=o;function l(m){const C=p.value[m][0];C&&r("switchSelectedNode",C.node.name)}function d(m){if(m.shiftKey&&m.altKey&&(m.ctrlKey||m.metaKey)){const u={ArrowUp:"outputSub",ArrowRight:"outputMain",ArrowLeft:"inputMain"}[m.key]||null;u&&l(u)}}function h(m){return m.map(C=>{const u=s.getNodeByName(C);if(u){const k=i.getNodeType(u.type);if(k)return{node:u,nodeType:k}}return null}).filter(C=>C!==null)}const p=Y(()=>{const m=n.rootNode.name;return{outputSub:h(a.getChildNodes(m,"ALL_NON_MAIN")),outputMain:h(a.getChildNodes(m,"main",1)),inputMain:h(a.getParentNodes(m,"main",1))}}),g=["outputSub","outputMain","inputMain"],N={outputSub:"bottom",outputMain:"left",inputMain:"right"};return En(()=>{document.addEventListener("keydown",d,!0)}),Ui(()=>{document.removeEventListener("keydown",d,!0)}),t({moveNodeDirection:l}),(m,C)=>{const u=S("n8n-tooltip");return c(),b("aside",{class:D(m.$style.floatingNodes)},[(c(),b(Z,null,re(g,k=>f("ul",{key:k,class:D([m.$style.nodesList,m.$style[k]])},[(c(!0),b(Z,null,re(p.value[k],({node:v,nodeType:P})=>(c(),b(Z,null,[v&&P?(c(),O(u,{key:v.name,placement:N[k],teleported:!1,offset:60},{content:w(()=>[I(T(v.name),1)]),default:w(()=>[f("li",{class:D(m.$style.connectedNode),"data-test-id":"floating-node","data-node-name":v.name,"data-node-placement":k,onClick:_=>m.$emit("switchSelectedNode",v.name)},[y(tt,{"node-type":P,"node-name":v.name,"tooltip-position":N[k],size:35,circle:""},null,8,["node-type","node-name","tooltip-position"])],10,zr)]),_:2},1032,["placement"])):E("",!0)],64))),256))],2)),64))],2)}}}),Kr="_floatingNodes_htxl9_5",jr="_nodesList_htxl9_19",qr="_inputSub_htxl9_33",Gr="_outputSub_htxl9_33",Jr="_outputMain_htxl9_44",Xr="_inputMain_htxl9_44",Qr="_connectedNode_htxl9_67",Zr={floatingNodes:Kr,nodesList:jr,inputSub:qr,outputSub:Gr,outputMain:Jr,inputMain:Xr,connectedNode:Qr},el={$style:Zr},tl=x(Yr,[["__cssModules",el]]),$e=24,on=80,Ue=280,ol=320,nl=420,sl={regular:Le,dragless:Le,unknown:Le,inputless:Le,wide:Le*2},il=z({name:"NDVDraggablePanels",components:{PanelDragButton:Fr,NDVFloatingNodes:tl},props:{isDraggable:{type:Boolean},hideInputAndOutput:{type:Boolean},position:{type:Number},nodeType:{type:Object,default:()=>({})}},setup(){const{callDebounced:e}=vt();return{callDebounced:e}},data(){return{windowWidth:1,isDragging:!1,MIN_PANEL_WIDTH:Ue,initialized:!1}},mounted(){this.setTotalWidth(),this.mainPanelDimensions.relativeLeft===1&&this.mainPanelDimensions.relativeRight===1&&(this.setMainPanelWidth(),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)),this.restorePositionData()),window.addEventListener("resize",this.setTotalWidth),this.$emit("init",{position:this.mainPanelDimensions.relativeLeft}),setTimeout(()=>{this.initialized=!0},0),gt.on("setPositionByName",this.setPositionByName)},beforeUnmount(){window.removeEventListener("resize",this.setTotalWidth),gt.off("setPositionByName",this.setPositionByName)},computed:{...te(X),mainPanelDimensions(){return this.ndvStore.getMainPanelDimensions(this.currentNodePaneType)},activeNode(){return this.ndvStore.activeNode},supportedResizeDirections(){const e=["right"];return this.isDraggable&&e.push("left"),e},currentNodePaneType(){return this.hasInputSlot?this.isDraggable?this.nodeType===null?"unknown":ye(this,"nodeType.parameterPane")||"regular":"dragless":"inputless"},hasInputSlot(){return this.$slots.input!==void 0},inputPanelMargin(){return this.pxToRelativeWidth(on)},minWindowWidth(){return 2*($e+on)+Ue},minimumLeftPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.hasInputSlot?this.pxToRelativeWidth($e+20)+this.inputPanelMargin:this.pxToRelativeWidth($e)},maximumRightPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.pxToRelativeWidth($e+20)+this.inputPanelMargin},canMoveLeft(){return this.mainPanelDimensions.relativeLeft>this.minimumLeftPosition},canMoveRight(){return this.mainPanelDimensions.relativeRight>this.maximumRightPosition},mainPanelStyles(){return{left:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeLeft)}px`,right:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeRight)}px`}},inputPanelStyles(){return{right:`${this.relativeWidthToPx(this.calculatedPositions.inputPanelRelativeRight)}px`}},outputPanelStyles(){return{left:`${this.relativeWidthToPx(this.calculatedPositions.outputPanelRelativeLeft)}px`,transform:`translateX(-${this.relativeWidthToPx(this.outputPanelRelativeTranslate)}px)`}},calculatedPositions(){const e=this.$slots.input!==void 0,t=this.mainPanelDimensions.relativeLeft+this.mainPanelDimensions.relativeWidth;return{inputPanelRelativeRight:e?1-t+this.mainPanelDimensions.relativeWidth:1-this.pxToRelativeWidth($e),outputPanelRelativeLeft:t}},outputPanelRelativeTranslate(){const e=1-this.pxToRelativeWidth(Ue+$e),t=this.calculatedPositions.outputPanelRelativeLeft-e;return t>0?t:0},hasDoubleWidth(){return ye(this,"nodeType.parameterPane")==="wide"},fixedPanelWidth(){const e=this.hasDoubleWidth?2:1;return this.windowWidth>1700?nl*e:ol*e},isBelowMinWidthMainPanel(){const e=this.pxToRelativeWidth(Ue);return this.mainPanelDimensions.relativeWidth<e}},watch:{windowWidth(e){const t=this.pxToRelativeWidth(Ue);this.isBelowMinWidthMainPanel&&this.setMainPanelWidth(t);const o=this.minimumLeftPosition>this.mainPanelDimensions.relativeLeft,n=this.maximumRightPosition>this.mainPanelDimensions.relativeRight;e>this.minWindowWidth&&o&&n&&(this.setMainPanelWidth(t),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth))),this.setPositions(this.mainPanelDimensions.relativeLeft)}},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},getInitialLeftPosition(e){return this.currentNodePaneType==="dragless"?this.pxToRelativeWidth($e+1+this.fixedPanelWidth):this.hasInputSlot?.5-e/2:this.minimumLeftPosition},setMainPanelWidth(e){const t=e||this.pxToRelativeWidth(sl[this.currentNodePaneType]);this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeWidth:t}})},setPositions(e){const t=e||1-this.calculatedPositions.inputPanelRelativeRight,o=1-t-this.mainPanelDimensions.relativeWidth,n=this.maximumRightPosition>o,s=this.minimumLeftPosition>t,i=this.currentNodePaneType==="inputless";if(s){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:this.minimumLeftPosition,relativeRight:1-this.mainPanelDimensions.relativeWidth-this.minimumLeftPosition}});return}if(n){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:1-this.mainPanelDimensions.relativeWidth-this.maximumRightPosition,relativeRight:this.maximumRightPosition}});return}this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:i?this.minimumLeftPosition:t,relativeRight:o}})},setPositionByName(e){const t={minLeft:this.minimumLeftPosition,maxRight:this.maximumRightPosition,initial:this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)};this.setPositions(t[e])},pxToRelativeWidth(e){return e/this.windowWidth},relativeWidthToPx(e){return e*this.windowWidth},onResizeStart(){this.setTotalWidth()},onResizeEnd(){this.storePositionData()},onResizeDebounced(e){this.initialized&&this.callDebounced(this.onResize,{debounceTime:10,trailing:!0},e)},onResize({direction:e,x:t,width:o}){const n=this.pxToRelativeWidth(t),s=this.pxToRelativeWidth(o);e==="left"&&n<=this.minimumLeftPosition||e==="right"&&1-n<=this.maximumRightPosition||o<=Ue||(this.setMainPanelWidth(s),this.setPositions(e==="left"?n:this.mainPanelDimensions.relativeLeft))},restorePositionData(){const e=Ae(`${no}_${this.currentNodePaneType}`).value;if(e){const t=parseFloat(e);this.setMainPanelWidth(t);const o=this.getInitialLeftPosition(t);return this.setPositions(o),!0}return!1},storePositionData(){Ae(`${no}_${this.currentNodePaneType}`).value=this.mainPanelDimensions.relativeWidth.toString()},onDragStart(){this.isDragging=!0,this.$emit("dragstart",{position:this.mainPanelDimensions.relativeLeft})},onDrag(e){const t=this.pxToRelativeWidth(e.x)-this.mainPanelDimensions.relativeWidth/2;this.setPositions(t)},onDragEnd(){setTimeout(()=>{this.isDragging=!1,this.$emit("dragend",{windowWidth:this.windowWidth,position:this.mainPanelDimensions.relativeLeft})},0),this.storePositionData()},setTotalWidth(){this.windowWidth=window.innerWidth},close(){this.$emit("close")}}}),al="_dataPanel_w56ig_5",rl="_inputPanel_w56ig_14 _dataPanel_w56ig_5",ll="_outputPanel_w56ig_22 _dataPanel_w56ig_5",dl="_mainPanel_w56ig_30",ul="_draggable_w56ig_34",cl="_mainPanelInner_w56ig_38",hl="_dragging_w56ig_45",pl="_dragButtonContainer_w56ig_58",fl="_visible_w56ig_74",gl={dataPanel:al,inputPanel:rl,outputPanel:ll,mainPanel:dl,draggable:ul,mainPanelInner:cl,dragging:hl,"double-width":"_double-width_w56ig_54",dragButtonContainer:pl,visible:fl};function ml(e,t,o,n,s,i){const a=S("NDVFloatingNodes"),r=S("PanelDragButton"),l=S("n8n-resize-wrapper");return c(),b("div",null,[e.activeNode?(c(),O(a,{key:0,"root-node":e.activeNode,onSwitchSelectedNode:e.onSwitchSelectedNode},null,8,["root-node","onSwitchSelectedNode"])):E("",!0),e.hideInputAndOutput?E("",!0):(c(),b("div",{key:1,class:D(e.$style.inputPanel),style:ee(e.inputPanelStyles)},[le(e.$slots,"input")],6)),e.hideInputAndOutput?E("",!0):(c(),b("div",{key:2,class:D(e.$style.outputPanel),style:ee(e.outputPanelStyles)},[le(e.$slots,"output")],6)),f("div",{class:D(e.$style.mainPanel),style:ee(e.mainPanelStyles)},[y(l,{"is-resizing-enabled":e.currentNodePaneType!=="unknown",width:e.relativeWidthToPx(e.mainPanelDimensions.relativeWidth),"min-width":e.MIN_PANEL_WIDTH,"grid-size":20,"supported-directions":e.supportedResizeDirections,onResize:e.onResizeDebounced,onResizestart:e.onResizeStart,onResizeend:e.onResizeEnd},{default:w(()=>[f("div",{class:D(e.$style.dragButtonContainer)},[!e.hideInputAndOutput&&e.isDraggable?(c(),O(r,{key:0,class:D({[e.$style.draggable]:!0,[e.$style.visible]:e.isDragging}),"can-move-left":e.canMoveLeft,"can-move-right":e.canMoveRight,onDragstart:e.onDragStart,onDrag:e.onDrag,onDragend:e.onDragEnd},null,8,["class","can-move-left","can-move-right","onDragstart","onDrag","onDragend"])):E("",!0)],2),f("div",{class:D({[e.$style.mainPanelInner]:!0,[e.$style.dragging]:e.isDragging})},[le(e.$slots,"main")],2)]),_:3},8,["is-resizing-enabled","width","min-width","supported-directions","onResize","onResizestart","onResizeend"])],6)])}const yl={$style:gl},wl=x(il,[["render",ml],["__cssModules",yl]]),vl={allowVulnerableTags:!1,enforceHtmlBoundary:!1,disallowedTagsMode:"discard",allowedTags:[...so.defaults.allowedTags,"style","img","title"],allowedAttributes:{...so.defaults.allowedAttributes,"*":["class","style"]},transformTags:{head:""}},Nl={name:"RunDataHtml",props:{inputHtml:{type:String}},computed:{sanitizedHtml(){return Gn(this.inputHtml,vl)}}},kl=["srcdoc"];function bl(e,t,o,n,s,i){return c(),b("iframe",{class:"__html-display",srcdoc:i.sanitizedHtml},null,8,kl)}const An=x(Nl,[["render",bl]]),Tl=Object.freeze(Object.defineProperty({__proto__:null,default:An},Symbol.toStringTag,{value:"Module"})),Sl=z({name:"BinaryDataDisplayEmbed",components:{VueJsonPretty:Rn,RunDataHtml:An},props:{binaryData:{type:Object,required:!0}},data(){return{isLoading:!0,embedSource:"",error:!1,data:""}},computed:{...te(j)},async mounted(){const{id:e,data:t,fileName:o,fileType:n,mimeType:s}=this.binaryData,i=n==="json",a=n==="html";if(!e)i||a?this.data=Nt(atob(t)):this.embedSource="data:"+s+";base64,"+t;else try{const r=this.workflowsStore.getBinaryUrl(e,"view",o,s);if(i||a){const l=await fetch(r,{credentials:"include"});this.data=await(i?l.json():l.text())}else this.embedSource=r}catch{this.error=!0}this.isLoading=!1},methods:{embedClass(){const{fileType:e}=this.binaryData;return[e??"other"]}}}),Dl={key:0},El={key:1},Cl={key:2},Il={key:0,controls:"",autoplay:""},Pl=["src","type"],Ol={key:1,controls:"",autoplay:""},$l=["src","type"],Rl=["src"];function _l(e,t,o,n,s,i){const a=S("VueJsonPretty"),r=S("RunDataHtml");return c(),b("span",null,[e.isLoading?(c(),b("div",Dl,"Loading binary data...")):e.error?(c(),b("div",El,"Error loading binary data")):(c(),b("span",Cl,[e.binaryData.fileType==="video"?(c(),b("video",Il,[f("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Pl),I(" "+T(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="audio"?(c(),b("audio",Ol,[f("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,$l),I(" "+T(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="json"?(c(),O(a,{key:2,data:e.data,deep:3,"show-length":!0},null,8,["data"])):e.binaryData.fileType==="html"?(c(),O(r,{key:3,"input-html":e.data},null,8,["input-html"])):(c(),b("embed",{key:4,src:e.embedSource,class:D(["binary-data",e.embedClass()])},null,10,Rl))]))])}const Al=x(Sl,[["render",_l]]),Ml=z({name:"BinaryDataDisplay",components:{BinaryDataDisplayEmbed:Al},props:["displayData","windowVisible"],setup(){return{nodeHelpers:We()}},computed:{...te(j),binaryData(){const e=this.nodeHelpers.getBinaryData(this.workflowRunData,this.displayData.node,this.displayData.runIndex,this.displayData.outputIndex);return e.length===0||this.displayData.index>=e.length||e[this.displayData.index][this.displayData.key]===void 0?null:e[this.displayData.index][this.displayData.key]},workflowRunData(){const e=this.workflowsStore.getWorkflowExecution;if(e===null)return null;const t=e.data;return t?t.resultData.runData:null}},methods:{closeWindow(){return this.$emit("close"),!1}}}),Wl={class:"binary-data-window-wrapper"},Vl={key:0};function Bl(e,t,o,n,s,i){var l;const a=S("n8n-button"),r=S("BinaryDataDisplayEmbed");return e.windowVisible?(c(),b("div",{key:0,class:D(["binary-data-window",(l=e.binaryData)==null?void 0:l.fileType])},[y(a,{size:"small",class:"binary-data-window-back",title:e.$locale.baseText("binaryDataDisplay.backToOverviewPage"),icon:"arrow-left",label:e.$locale.baseText("binaryDataDisplay.backToList"),onClick:se(e.closeWindow,["stop"])},null,8,["title","label","onClick"]),f("div",Wl,[e.binaryData?(c(),O(r,{key:1,"binary-data":e.binaryData},null,8,["binary-data"])):(c(),b("div",Vl,T(e.$locale.baseText("binaryDataDisplay.noDataFoundToDisplay")),1))])],2)):E("",!0)}const Ul=x(Ml,[["render",Bl]]),Ll=z({name:"NodeErrorView",components:{VueJsonPretty:Rn},props:["error"],setup(){return{clipboard:qt(),...ze()}},computed:{...te(J,X),displayCause(){return JSON.stringify(this.error.cause).length<gn},parameters(){const e=this.ndvStore.activeNode;if(!e)return[];const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion);return t===null?[]:t.properties}},methods:{replacePlaceholders(e,t){const o=this.parameterDisplayName(e,!1),n=this.parameterDisplayName(e,!0);return t.replace(/%%PARAMETER%%/g,o).replace(/%%PARAMETER_FULL%%/g,n)},getErrorDescription(){var o;if(this.error.name==="NodeOperationError"&&this.error.functionality==="configuration-node")return St(this.error.description+this.$locale.baseText("pushConnection.executionError.openNode",{interpolate:{node:this.error.node.name}}));if(!((o=this.error.context)!=null&&o.descriptionTemplate))return St(this.error.description);const t=this.parameterDisplayName(this.error.context.parameter);return St(this.error.context.descriptionTemplate.replace(/%%PARAMETER%%/g,t))},getErrorMessage(){var n;const e=this.$locale.baseText("nodeErrorView.error")+": ";if(this.error.name==="NodeOperationError"&&this.error.functionality==="configuration-node")return this.$locale.baseText("nodeErrorView.errorSubNode",{interpolate:{node:this.error.node.name}});if(this.error.message===this.error.description)return e;if(!((n=this.error.context)!=null&&n.messageTemplate))return e+this.error.message;const o=this.parameterDisplayName(this.error.context.parameter);return e+this.error.context.messageTemplate.replace(/%%PARAMETER%%/g,o)},parameterDisplayName(e,t=!0){try{const o=this.parameterName(this.parameters,e.split("."));if(!o.length)throw new Error;return t?o.map(n=>n.displayName).join(" > "):o.pop().displayName}catch{return`Could not find parameter "${e}"`}},parameterName(e,t){let o=t.shift();if(o===void 0)return[];const n=o.match(/(.*)\[([\d])\]$/);n!==null&&n.length>0&&(o=n[1]);const s=e.find(i=>i.name===o);if(s===void 0)throw new Error(`Could not find parameter "${o}"`);return t.length===0?[s]:s.hasOwnProperty("options")?[s,...this.parameterName(s.options,t)]:s.hasOwnProperty("values")?[s,...this.parameterName(s.values,t)]:[s]},copyCause(){this.clipboard.copy(JSON.stringify(this.error.cause)),this.copySuccess()},copySuccess(){this.showMessage({title:this.$locale.baseText("nodeErrorView.showMessage.title"),type:"info"})}}}),xl={class:"error-header"},Hl=["textContent"],Fl=["innerHTML"],zl={class:"error-details__summary"},Yl={class:"error-details__content"},Kl={key:0},jl={key:1},ql={class:"clearfix box-card__title"},Gl={key:2,class:"el-card box-card is-never-shadow el-card__body"},Jl={class:"error-details__summary"},Xl={key:0},Ql={class:"error-details__summary"},Zl={key:1},ed={class:"error-details__summary"},td={key:3},od={class:"clearfix box-card__title"},nd={key:4},sd={class:"clearfix box-card__title"},id=f("br",null,null,-1),ad={class:"box-card__subtitle"},rd={key:0,class:"copy-button"},ld={key:2},dd={key:5},ud={class:"clearfix box-card__title"};function cd(e,t,o,n,s,i){const a=S("font-awesome-icon"),r=S("el-card"),l=S("n8n-icon-button"),d=S("VueJsonPretty");return c(),b("div",null,[f("div",xl,[f("div",{class:"error-message",textContent:T(e.getErrorMessage())},null,8,Hl),e.error.description?(c(),b("div",{key:0,class:"error-description",innerHTML:e.getErrorDescription()},null,8,Fl)):E("",!0)]),f("details",null,[f("summary",zl,[y(a,{class:"error-details__icon",icon:"angle-right"}),I(" "+T(e.$locale.baseText("nodeErrorView.details")),1)]),f("div",Yl,[e.error.context&&e.error.context.causeDetailed?(c(),b("div",Kl,[y(r,{class:"box-card",shadow:"never"},{default:w(()=>[f("div",null,T(e.error.context.causeDetailed),1)]),_:1})])):E("",!0),e.error.timestamp?(c(),b("div",jl,[y(r,{class:"box-card",shadow:"never"},{header:w(()=>[f("div",ql,[f("span",null,T(e.$locale.baseText("nodeErrorView.time")),1)])]),default:w(()=>[f("div",null,T(new Date(e.error.timestamp).toLocaleString()),1)]),_:1})])):E("",!0),e.error.context&&e.error.context.itemIndex!==void 0?(c(),b("div",Gl,[f("span",Jl,T(e.$locale.baseText("nodeErrorView.itemIndex"))+":",1),I(" "+T(e.error.context.itemIndex)+" ",1),e.error.context.runIndex?(c(),b("span",Xl,[I(" | "),f("span",Ql,T(e.$locale.baseText("nodeErrorView.itemIndex"))+":",1),I(" "+T(e.error.context.runIndex),1)])):E("",!0),e.error.context.parameter?(c(),b("span",Zl,[I(" | "),f("span",ed,T(e.$locale.baseText("nodeErrorView.inParameter"))+":",1),I(" "+T(e.parameterDisplayName(e.error.context.parameter)),1)])):E("",!0)])):E("",!0),e.error.httpCode?(c(),b("div",td,[y(r,{class:"box-card",shadow:"never"},{header:w(()=>[f("div",od,[f("span",null,T(e.$locale.baseText("nodeErrorView.httpCode")),1)])]),default:w(()=>[f("div",null,T(e.error.httpCode),1)]),_:1})])):E("",!0),e.error.cause?(c(),b("div",nd,[y(r,{class:"box-card",shadow:"never"},{header:w(()=>[f("div",sd,[f("span",null,T(e.$locale.baseText("nodeErrorView.cause")),1),id,f("span",ad,T(e.$locale.baseText("nodeErrorView.dataBelowMayContain")),1)])]),default:w(()=>[f("div",null,[e.displayCause?(c(),b("div",rd,[y(l,{title:e.$locale.baseText("nodeErrorView.copyToClipboard"),icon:"copy",onClick:e.copyCause},null,8,["title","onClick"])])):E("",!0),e.displayCause?(c(),O(d,{key:1,data:e.error.cause,deep:3,"show-length":!0,"selectable-type":"single",path:"error",class:"json-data"},null,8,["data"])):(c(),b("span",ld,[y(a,{icon:"info-circle"}),I(T(e.$locale.baseText("nodeErrorView.theErrorCauseIsTooLargeToBeDisplayed")),1)]))])]),_:1})])):E("",!0),e.error.stack?(c(),b("div",dd,[y(r,{class:"box-card",shadow:"never"},{header:w(()=>[f("div",ud,[f("span",null,T(e.$locale.baseText("nodeErrorView.stack")),1)])]),default:w(()=>[f("div",null,[f("pre",null,[f("code",null,T(e.error.stack),1)])])]),_:1})])):E("",!0)])])])}const hd=x(Ll,[["render",cd]]),pd={key:0},fd={key:1},gd={key:2},md=z({__name:"RunDataPinButton",props:{tooltipContentsVisibility:{},dataPinningDocsUrl:{},pinnedData:{},disabled:{type:Boolean}},emits:["togglePinData"],setup(e,{emit:t}){const o=Ne(),n=e,s=t,i=Y(()=>n.tooltipContentsVisibility.pinDataDiscoveryTooltipContent?!0:void 0);return(a,r)=>{const l=S("n8n-link"),d=S("n8n-text"),h=S("n8n-icon-button"),p=S("n8n-tooltip");return c(),O(p,{placement:"bottom-end",visible:i.value},{content:w(()=>[n.tooltipContentsVisibility.binaryDataTooltipContent?(c(),b("div",pd,T(L(o).baseText("ndv.pinData.pin.binary")),1)):n.tooltipContentsVisibility.pinDataDiscoveryTooltipContent?(c(),b("div",fd,T(L(o).baseText("node.discovery.pinData.ndv")),1)):(c(),b("div",gd,[f("strong",null,T(L(o).baseText("ndv.pinData.pin.title")),1),y(d,{size:"small",tag:"p"},{default:w(()=>[I(T(L(o).baseText("ndv.pinData.pin.description"))+" ",1),y(l,{to:n.dataPinningDocsUrl,size:"small"},{default:w(()=>[I(T(L(o).baseText("ndv.pinData.pin.link")),1)]),_:1},8,["to"])]),_:1})]))]),default:w(()=>[y(h,{class:D(a.$style.pinDataButton),type:"tertiary",active:n.pinnedData.hasData.value,icon:"thumbtack",disabled:n.disabled,"data-test-id":"ndv-pin-data",onClick:r[0]||(r[0]=g=>s("togglePinData"))},null,8,["class","active","disabled"])]),_:1},8,["visible"])}}}),yd="_pinDataButton_fzux8_5",wd={pinDataButton:yd},vd={$style:wd},Nd=x(md,[["__cssModules",vd]]),kd=Ie(async()=>await Ce(()=>import("./RunDataTable-Xbkzwy5h.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]))),bd=Ie(async()=>await Ce(()=>import("./RunDataJson-hcKGDyJz.js"),__vite__mapDeps([42,2,3,4,5,6,7,8,1,9,10,11,12,13,35,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,36,37,38,39,40,43]))),Td=Ie(async()=>await Ce(()=>import("./RunDataSchema-fPAFgFi6.js"),__vite__mapDeps([44,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,14,15,33,34,35,36,37,38,39,40,45]))),Sd=Ie(async()=>await Ce(()=>Promise.resolve().then(()=>Tl),void 0)),Dd=Ie(async()=>await Ce(()=>import("./RunDataSearch-LSCwcEYy.js"),__vite__mapDeps([46,2,3,4,5,6,7,8,1,9,10,11,12,13,47]))),Ed=z({name:"RunData",components:{BinaryDataDisplay:Ul,NodeErrorView:hd,JsonEditor:oi,RunDataTable:kd,RunDataJson:bd,RunDataSchema:Td,RunDataHtml:Sd,RunDataSearch:Dd,RunDataPinButton:Nd},props:{node:{type:Object,default:null},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},tooMuchDataTitle:{type:String},noDataInBranchMessage:{type:String},isExecuting:{type:Boolean},executingMessage:{type:String},sessionId:{type:String},paneType:{type:String,required:!0},overrideOutputs:{type:Array},mappingEnabled:{type:Boolean},distanceFromActive:{type:Number},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(e){const t=X(),o=We(),n=Ee(),s=Li(e,"node"),i=Se(s,{runIndex:e.runIndex,displayMode:t.getPanelDisplayMode(e.paneType)});return{...ze(),externalHooks:n,nodeHelpers:o,pinnedData:i}},data(){return{connectionType:M.Main,binaryDataPreviewActive:!1,dataSize:0,showData:!1,outputIndex:0,binaryDataDisplayVisible:!1,binaryDataDisplayData:null,MAX_DISPLAY_DATA_SIZE:gn,MAX_DISPLAY_ITEMS_AUTO_ALL:Jn,currentPage:1,pageSize:10,pageSizes:[10,25,50,100],pinDataDiscoveryTooltipVisible:!1,isControlledPinDataTooltip:!1,search:""}},mounted(){var e,t,o;if(this.init(),this.isPaneTypeInput||this.showPinDataDiscoveryTooltip(this.jsonData),this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:this.currentOutputIndex}),this.paneType==="output"&&(this.setDisplayMode(),this.activatePane()),this.hasRunError){const n=(o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])==null?void 0:o.error;n&&["unknown error"].some(i=>n.message.toLowerCase().includes(i))&&this.$telemetry.track(`User encountered an error: "${n.message}"`,{node:this.node.type,errorMessage:n.message,nodeVersion:this.node.typeVersion,n8nVersion:this.rootStore.versionCli},{withPostHog:!0})}},beforeUnmount(){this.hidePinDataDiscoveryTooltip()},computed:{...te(J,X,j,Kt,xt),isReadOnlyRoute(){var e,t;return((t=(e=this.$route)==null?void 0:e.meta)==null?void 0:t.readOnlyCanvas)===!0},activeNode(){return this.ndvStore.activeNode},dataPinningDocsUrl(){return Xn},dataEditingDocsUrl(){return Qn},displayMode(){return this.ndvStore.getPanelDisplayMode(this.paneType)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isSchemaView(){return this.displayMode==="schema"},isTriggerNode(){return this.node===null?!1:this.nodeTypesStore.isTriggerNode(this.node.type)},canPinData(){if(this.node===null)return!1;const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=fe(e,t,this.nodeType);return!!!ge(o).find(i=>i!==M.Main)&&!this.isPaneTypeInput&&this.pinnedData.isValidNodeType.value&&!(this.binaryData&&this.binaryData.length>0)},buttons(){var o;const e=[{label:this.$locale.baseText("runData.table"),value:"table"},{label:this.$locale.baseText("runData.json"),value:"json"}];this.binaryData.length&&e.push({label:this.$locale.baseText("runData.binary"),value:"binary"});const t={label:this.$locale.baseText("runData.schema"),value:"schema"};return this.isPaneTypeInput&&!io(this.jsonData)?e.unshift(t):e.push(t),this.isPaneTypeOutput&&((o=this.activeNode)==null?void 0:o.type)===At&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&e.unshift({label:"HTML",value:"html"}),e},hasNodeRun(){return!!(!this.isExecuting&&this.node&&(this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name)||this.pinnedData.hasData.value))},isArtificialRecoveredEventItem(){var e,t,o;return!!((o=(t=(e=this.rawInputData)==null?void 0:e[0])==null?void 0:t.json)!=null&&o.isArtificialRecoveredEventItem)},subworkflowExecutionError(){return this.workflowsStore.subWorkflowExecutionError},hasSubworkflowExecutionError(){return!!this.subworkflowExecutionError},hasRunError(){var e,t,o;return!!(this.node&&((o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])!=null&&o.error))},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},dataCount(){return this.getDataCount(this.runIndex,this.currentOutputIndex)},unfilteredDataCount(){return this.pinnedData.data.value?this.pinnedData.data.value.length:this.rawInputData.length},dataSizeInMB(){return(this.dataSize/1024/1e3).toLocaleString()},maxOutputIndex(){if(this.node===null||this.runIndex===void 0)return 0;const e=this.workflowRunData;if(e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<this.runIndex)return 0;if(e[this.node.name][this.runIndex]){const t=e[this.node.name][this.runIndex].data;if(t!=null&&t.main)return t.main.length-1}return 0},currentPageOffset(){return this.pageSize*(this.currentPage-1)},maxRunIndex(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length-1:0},rawInputData(){return this.getRawInputData(this.runIndex,this.currentOutputIndex,this.connectionType)},inputData(){const e=this.getPinDataOrLiveData(this.rawInputData);return this.getFilteredData(e)},inputDataPage(){const e=this.pageSize*(this.currentPage-1);return this.inputData.slice(e,e+this.pageSize)},jsonData(){return ao(this.inputData)},binaryData(){return this.node?this.nodeHelpers.getBinaryData(this.workflowRunData,this.node.name,this.runIndex,this.currentOutputIndex).filter(t=>!!(t&&Object.keys(t).length)):[]},currentOutputIndex(){var e;return(e=this.overrideOutputs)!=null&&e.length&&!this.overrideOutputs.includes(this.outputIndex)?this.overrideOutputs[0]:this.outputIndex},branches(){var o;const e=n=>n.charAt(0).toLocaleUpperCase()+n.slice(1),t=[];for(let n=0;n<=this.maxOutputIndex;n++){if(this.overrideOutputs&&!this.overrideOutputs.includes(n))continue;const s=this.getRawInputData(this.runIndex,n).length,i=this.getDataCount(this.runIndex,n),a=this.search?this.$locale.baseText("ndv.search.items",{adjustToNumber:s,interpolate:{matched:i,total:s}}):this.$locale.baseText("ndv.output.items",{adjustToNumber:i,interpolate:{count:i}});let r=this.getOutputName(n);if(`${r}`==`${n}`)r=`${this.$locale.baseText("ndv.output")} ${r}`;else{const l=Zn.includes((o=this.node)==null?void 0:o.type)?"":` ${this.$locale.baseText("ndv.output.branch")}`;r=e(`${this.getOutputName(n)}${l}`)}t.push({label:this.search&&i||s?`${r} (${a})`:r,value:n})}return t},editMode(){return this.isPaneTypeInput?{enabled:!1,value:""}:this.ndvStore.outputPanelEditMode},isPaneTypeInput(){return this.paneType==="input"},isPaneTypeOutput(){return this.paneType==="output"},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},showIOSearch(){return this.hasNodeRun&&!this.hasRunError},showIoSearchNoMatchContent(){return this.hasNodeRun&&!this.inputData.length&&this.search}},methods:{getResolvedNodeOutputs(){if(this.node&&this.nodeType){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name);if(t)return Te(e,t,this.nodeType)}return[]},onItemHover(e){if(e===null){this.$emit("itemHover",null);return}this.$emit("itemHover",{outputIndex:this.currentOutputIndex,itemIndex:e})},onClickDataPinningDocsLink(){var e;this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:(e=this.activeNode)==null?void 0:e.type,pane:"output",type:"data-pinning-docs"})},showPinDataDiscoveryTooltip(e){if(!this.isTriggerNode)return;const t=Ae(lo).value;e&&e.length>0&&!this.isReadOnlyRoute&&!t&&(this.pinDataDiscoveryComplete(),setTimeout(()=>{this.isControlledPinDataTooltip=!0,this.pinDataDiscoveryTooltipVisible=!0,ke.emit("data-pinning-discovery",{isTooltipVisible:!0})},500))},hidePinDataDiscoveryTooltip(){this.pinDataDiscoveryTooltipVisible&&(this.isControlledPinDataTooltip=!1,this.pinDataDiscoveryTooltipVisible=!1,ke.emit("data-pinning-discovery",{isTooltipVisible:!1}))},pinDataDiscoveryComplete(){Ae(lo).value="true",Ae(Mt).value="true"},enterEditMode({origin:e}){var n;const t=this.pinnedData.data.value?ro(this.pinnedData.data.value):ao(this.rawInputData),o=t.length>0?t:es;this.ndvStore.setOutputPanelEditModeEnabled(!0),this.ndvStore.setOutputPanelEditModeValue(JSON.stringify(o,null,2)),this.$telemetry.track("User opened ndv edit state",{node_type:(n=this.activeNode)==null?void 0:n.type,click_type:e==="editIconButton"?"button":"link",session_id:this.sessionId,run_index:this.runIndex,is_output_present:this.hasNodeRun||this.pinnedData.hasData.value,view:!this.hasNodeRun&&!this.pinnedData.hasData.value?"undefined":this.displayMode,is_data_pinned:this.pinnedData.hasData.value})},onClickCancelEdit(){this.ndvStore.setOutputPanelEditModeEnabled(!1),this.ndvStore.setOutputPanelEditModeValue(""),this.onExitEditMode({type:"cancel"})},onClickSaveEdit(){if(!this.node)return;const{value:e}=this.editMode;this.clearAllStickyNotifications();try{this.pinnedData.setData(ro(e),"save-edit")}catch(t){console.error(t);return}this.ndvStore.setOutputPanelEditModeEnabled(!1),this.onExitEditMode({type:"save"})},onExitEditMode({type:e}){var t;this.$telemetry.track("User closed ndv edit state",{node_type:(t=this.activeNode)==null?void 0:t.type,session_id:this.sessionId,run_index:this.runIndex,view:this.displayMode,type:e})},async onTogglePinData({source:e}){if(this.node){if(e==="pin-icon-click"){const t={node_type:this.activeNode.type,session_id:this.sessionId,run_index:this.runIndex,view:!this.hasNodeRun&&!this.pinnedData.hasData.value?"none":this.displayMode};this.externalHooks.run("runData.onTogglePinData",t),this.$telemetry.track("User clicked pin data icon",t)}if(this.nodeHelpers.updateNodeParameterIssues(this.node),this.pinnedData.hasData.value){this.pinnedData.unsetData(e);return}try{this.pinnedData.setData(this.rawInputData,"pin-icon-click")}catch(t){console.error(t);return}this.maxRunIndex>0&&this.showToast({title:this.$locale.baseText("ndv.pinData.pin.multipleRuns.title",{interpolate:{index:`${this.runIndex}`}}),message:this.$locale.baseText("ndv.pinData.pin.multipleRuns.description"),type:"success",duration:2e3}),this.hidePinDataDiscoveryTooltip(),this.pinDataDiscoveryComplete()}},switchToBinary(){this.onDisplayModeChange("binary")},onBranchChange(e){this.outputIndex=e,this.$telemetry.track("User changed ndv branch",{session_id:this.sessionId,branch_index:e,node_type:this.activeNode.type,node_type_input_selection:this.nodeType?this.nodeType.name:"",pane:this.paneType})},showTooMuchData(){this.showData=!0,this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,type:"showTooMuchData"})},toggleLinkRuns(){this.linkedRuns?this.unlinkRun():this.linkRun()},linkRun(){this.$emit("linkRun")},unlinkRun(){this.$emit("unlinkRun")},onCurrentPageChange(e){var t;this.currentPage=e,this.$telemetry.track("User changed ndv page",{node_type:(t=this.activeNode)==null?void 0:t.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onPageSizeChange(e){var o;this.pageSize=e;const t=Math.ceil(this.dataCount/this.pageSize);t<this.currentPage&&(this.currentPage=t),this.$telemetry.track("User changed ndv page size",{node_type:(o=this.activeNode)==null?void 0:o.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onDisplayModeChange(e){const t=this.displayMode;this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:e});const o=this.$refs.dataContainer;if(o){const n=o.children[0];n&&n.scrollTo(0,0)}this.closeBinaryDataDisplay(),this.externalHooks.run("runData.displayModeChanged",{newValue:e,oldValue:t}),this.activeNode&&this.$telemetry.track("User changed ndv item view",{previous_view:t,new_view:e,node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType})},getRunLabel(e){let t=0;for(let s=0;s<=this.maxOutputIndex;s++)t+=this.getPinDataOrLiveData(this.getRawInputData(e-1,s)).length;const o=this.$locale.baseText("ndv.output.items",{adjustToNumber:t,interpolate:{count:t}}),n=t>0?` (${o})`:"";return e+this.$locale.baseText("ndv.output.of")+(this.maxRunIndex+1)+n},getRawInputData(e,t,o=M.Main){let n=[];return this.node&&(n=this.nodeHelpers.getNodeInputData(this.node,e,t,this.paneType,o)),n.length===0||!Array.isArray(n)?[]:n},getPinDataOrLiveData(e){return this.pinnedData.data.value&&!this.isProductionExecutionPreview?Array.isArray(this.pinnedData.data.value)?this.pinnedData.data.value.map(t=>({json:t})):[{json:this.pinnedData.data.value}]:e},getFilteredData(e){return this.search?(this.currentPage=1,e.filter(({json:t})=>ts(t,this.search))):e},getDataCount(e,t,o=M.Main){var i,a,r;if(!this.node)return 0;if((r=(a=(i=this.workflowRunData)==null?void 0:i[this.node.name])==null?void 0:a[e])!=null&&r.hasOwnProperty("error"))return 1;const n=this.getRawInputData(e,t,o),s=this.getPinDataOrLiveData(n);return this.getFilteredData(s).length},init(){this.outputIndex=0,this.refreshDataSize(),this.closeBinaryDataDisplay();let e=[];if(this.nodeType!==null&&this.node!==null){const t=this.getResolvedNodeOutputs();e=ge(t)}this.connectionType=e.length===0?M.Main:e[0],this.binaryData.length>0?this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"binary"}):this.displayMode==="binary"&&this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"table"})},closeBinaryDataDisplay(){this.binaryDataDisplayVisible=!1,this.binaryDataDisplayData=null},clearExecutionData(){this.workflowsStore.setWorkflowExecutionData(null),this.nodeHelpers.updateNodesExecutionIssues()},isViewable(e,t){const{fileType:o}=this.binaryData[e][t];return!!o&&["image","audio","video","text","json","pdf","html"].includes(o)},isDownloadable(e,t){const{mimeType:o,fileName:n}=this.binaryData[e][t];return!!(o&&n)},async downloadBinaryData(e,t){const{id:o,data:n,fileName:s,fileExtension:i,mimeType:a}=this.binaryData[e][t];if(o){const r=this.workflowsStore.getBinaryUrl(o,"download",s,a);$t.saveAs(r,[s,i].join("."));return}else{const r="data:"+a+";base64,"+n,l=await fetch(r).then(async d=>await d.blob());$t.saveAs(l,s)}},async downloadJsonData(){const e=this.node.name.replace(/[^\w\d]/g,"_"),t=new Blob([JSON.stringify(this.rawInputData,null,2)],{type:"application/json"});$t.saveAs(t,`${e}.json`)},displayBinaryData(e,t){this.binaryDataDisplayVisible=!0,this.binaryDataDisplayData={node:this.node.name,runIndex:this.runIndex,outputIndex:this.currentOutputIndex,index:e,key:t}},getOutputName(e){if(this.node===null)return e+1;const t=this.nodeType,o=this.getResolvedNodeOutputs(),n=o==null?void 0:o[e];return n&&zi(n)?n==null?void 0:n.displayName:!(t!=null&&t.outputNames)||t.outputNames.length<=e?e+1:t.outputNames[e]},refreshDataSize(){this.showData=!1;const e=this.inputDataPage.map(t=>t.json);this.dataSize=JSON.stringify(e).length,this.dataSize<this.MAX_DISPLAY_DATA_SIZE&&(this.showData=!0)},onRunIndexChange(e){this.$emit("runChange",e)},enableNode(){if(this.node){const e={name:this.node.name,properties:{disabled:!this.node.disabled}};this.workflowsStore.updateNodeProperties(e)}},setDisplayMode(){if(!this.activeNode)return;this.activeNode.type===At&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&this.ndvStore.setPanelDisplayMode({pane:"output",mode:"html"})},activatePane(){this.$emit("activatePane")},onSearchClear(){this.search="",document.dispatchEvent(new KeyboardEvent("keyup",{key:"/"}))}},watch:{node(e,t){e.id!==t.id&&this.init()},hasNodeRun(){this.paneType==="output"&&this.setDisplayMode()},inputDataPage:{handler(e){this.paneType&&e&&this.ndvStore.setNDVPanelDataIsEmpty({panel:this.paneType,isEmpty:e.every(t=>io(t.json))})},immediate:!0,deep:!0},jsonData(e,t){Yi(e,t)||(this.refreshDataSize(),this.showPinDataDiscoveryTooltip(e))},binaryData(e,t){e.length&&!t.length&&this.displayMode!=="binary"?this.switchToBinary():!e.length&&this.displayMode==="binary"&&this.onDisplayModeChange("table")},currentOutputIndex(e){this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:e})},search(e){this.$emit("search",e)}}}),Cd="_infoIcon_1s3ok_5",Id="_center_1s3ok_9",Pd="_container_1s3ok_23",Od="_pinnedDataCallout_1s3ok_32",$d="_header_1s3ok_40",Rd="_dataContainer_1s3ok_54",_d="_dataDisplay_1s3ok_63",Ad="_tabs_1s3ok_75",Md="_itemsCount_1s3ok_82",Wd="_runSelector_1s3ok_90",Vd="_runSelectorWrapper_1s3ok_99",Bd="_pagination_1s3ok_104",Ud="_pageSizeSelector_1s3ok_114",Ld="_binaryIndex_1s3ok_120",xd="_binaryRow_1s3ok_137",Hd="_binaryCell_1s3ok_142",Fd="_binaryHeader_1s3ok_154",zd="_binaryButtonContainer_1s3ok_163",Yd="_binaryValue_1s3ok_174",Kd="_displayModes_1s3ok_179",jd="_tooltipContain_1s3ok_185",qd="_spinner_1s3ok_189",Gd="_editMode_1s3ok_200",Jd="_editModeBody_1s3ok_209",Xd="_editModeFooter_1s3ok_216",Qd="_editModeFooterInfotip_1s3ok_226",Zd="_editModeActions_1s3ok_232",eu="_stretchVertically_1s3ok_239",tu="_uiBlocker_1s3ok_243",ou={infoIcon:Cd,center:Id,container:Pd,pinnedDataCallout:Od,header:$d,dataContainer:Rd,"actions-group":"_actions-group_1s3ok_59",dataDisplay:_d,tabs:Ad,itemsCount:Md,runSelector:Wd,runSelectorWrapper:Vd,pagination:Bd,pageSizeSelector:Ud,binaryIndex:Ld,binaryRow:xd,binaryCell:Hd,binaryHeader:Fd,binaryButtonContainer:zd,binaryValue:Yd,displayModes:Kd,tooltipContain:jd,spinner:qd,editMode:Gd,editModeBody:Jd,editModeFooter:Xd,editModeFooterInfotip:Qd,editModeActions:Zd,stretchVertically:eu,uiBlocker:tu},nu={key:0,class:"ml-4xs"},su={key:0},iu=["innerHTML"],au=["data-test-id"],ru={key:0},lu={key:1},du={key:2},uu={key:3},cu={key:4};function hu(e,t,o,n,s,i){var Q,ve,Pe;const a=S("n8n-link"),r=S("n8n-callout"),l=S("BinaryDataDisplay"),d=S("n8n-radio-buttons"),h=S("n8n-icon-button"),p=S("RunDataPinButton"),g=S("n8n-button"),N=S("n8n-option"),m=S("n8n-select"),C=S("n8n-tooltip"),u=S("RunDataSearch"),k=S("n8n-tabs"),v=S("n8n-text"),P=S("n8n-spinner"),_=S("JsonEditor"),R=S("n8n-info-tip"),A=S("NodeErrorView"),$=S("i18n-t"),B=S("RunDataTable"),U=S("RunDataJson"),oe=S("RunDataHtml"),pe=S("RunDataSchema"),V=S("el-pagination"),H=S("n8n-block-ui");return c(),b("div",{class:D(["run-data",e.$style.container]),onMouseover:t[14]||(t[14]=(...W)=>e.activatePane&&e.activatePane(...W))},[e.canPinData&&e.pinnedData.hasData.value&&!e.editMode.enabled&&!e.isProductionExecutionPreview?(c(),O(r,{key:0,theme:"secondary",icon:"thumbtack",class:D(e.$style.pinnedDataCallout)},{trailingContent:w(()=>[y(a,{to:e.dataPinningDocsUrl,size:"small",theme:"secondary",bold:"",underline:"",onClick:e.onClickDataPinningDocsLink},{default:w(()=>[I(T(e.$locale.baseText("runData.pindata.learnMore")),1)]),_:1},8,["to","onClick"])]),default:w(()=>[I(T(e.$locale.baseText("runData.pindata.thisDataIsPinned"))+" ",1),!e.isReadOnlyRoute&&!e.readOnlyEnv?(c(),b("span",nu,[y(a,{theme:"secondary",size:"small",underline:"",bold:"",onClick:t[0]||(t[0]=se(W=>e.onTogglePinData({source:"banner-link"}),["stop"]))},{default:w(()=>[I(T(e.$locale.baseText("runData.pindata.unpin")),1)]),_:1})])):E("",!0)]),_:1},8,["class"])):E("",!0),y(l,{"window-visible":e.binaryDataDisplayVisible,"display-data":e.binaryDataDisplayData,onClose:e.closeBinaryDataDisplay},null,8,["window-visible","display-data","onClose"]),f("div",{class:D(e.$style.header)},[le(e.$slots,"header",{},void 0,!0),G(f("div",{class:D(e.$style.displayModes),"data-test-id":"run-data-pane-header",onClick:t[3]||(t[3]=se(()=>{},["stop"]))},[G(y(d,{"model-value":e.displayMode,options:e.buttons,"data-test-id":"ndv-run-data-display-mode","onUpdate:modelValue":e.onDisplayModeChange},null,8,["model-value","options","onUpdate:modelValue"]),[[ne,e.hasNodeRun&&(e.inputData.length||e.binaryData.length||e.search)&&!e.editMode.enabled]]),e.canPinData&&!e.isReadOnlyRoute&&!e.readOnlyEnv?G((c(),O(h,{key:0,title:e.$locale.baseText("runData.editOutput"),circle:!1,disabled:e.node.disabled,class:"ml-2xs",icon:"pencil-alt",type:"tertiary","data-test-id":"ndv-edit-pinned-data",onClick:t[1]||(t[1]=W=>e.enterEditMode({origin:"editIconButton"}))},null,8,["title","disabled"])),[[ne,!e.editMode.enabled]]):E("",!0),(e.canPinData||(Q=e.binaryData)!=null&&Q.length)&&e.rawInputData.length&&!e.editMode.enabled?(c(),O(p,{key:1,disabled:!e.rawInputData.length&&!e.pinnedData.hasData.value||e.isReadOnlyRoute||e.readOnlyEnv||!!((ve=e.binaryData)!=null&&ve.length),"tooltip-contents-visibility":{binaryDataTooltipContent:!!((Pe=e.binaryData)!=null&&Pe.length),pinDataDiscoveryTooltipContent:e.isControlledPinDataTooltip&&e.pinDataDiscoveryTooltipVisible},"data-pinning-docs-url":e.dataPinningDocsUrl,"pinned-data":e.pinnedData,onTogglePinData:t[2]||(t[2]=W=>e.onTogglePinData({source:"pin-icon-click"}))},null,8,["disabled","tooltip-contents-visibility","data-pinning-docs-url","pinned-data"])):E("",!0),G(f("div",{class:D(e.$style.editModeActions)},[y(g,{type:"tertiary",label:e.$locale.baseText("runData.editor.cancel"),onClick:e.onClickCancelEdit},null,8,["label","onClick"]),y(g,{class:"ml-2xs",type:"primary",label:e.$locale.baseText("runData.editor.save"),onClick:e.onClickSaveEdit},null,8,["label","onClick"])],2),[[ne,e.editMode.enabled]])],2),[[ne,!e.hasRunError]])],2),e.maxRunIndex>0?G((c(),b("div",{key:1,class:D(e.$style.runSelector),"data-test-id":"run-selector"},[f("div",{class:D(e.$style.runSelectorWrapper)},[y(m,{size:"small","model-value":e.runIndex,teleported:"","onUpdate:modelValue":e.onRunIndexChange,onClick:t[4]||(t[4]=se(()=>{},["stop"]))},{prepend:w(()=>[I(T(e.$locale.baseText("ndv.output.run")),1)]),default:w(()=>[(c(!0),b(Z,null,re(e.maxRunIndex+1,W=>(c(),O(N,{key:W,label:e.getRunLabel(W),value:W-1},null,8,["label","value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"]),e.canLinkRuns?(c(),O(C,{key:0,placement:"right"},{content:w(()=>[I(T(e.$locale.baseText(e.linkedRuns?"runData.unlinking.hint":"runData.linking.hint")),1)]),default:w(()=>[y(h,{class:"linkRun",icon:e.linkedRuns?"unlink":"link",text:"",type:"tertiary",size:"small",onClick:e.toggleLinkRuns},null,8,["icon","onClick"])]),_:1})):E("",!0),le(e.$slots,"run-info",{},void 0,!0)],2),e.showIOSearch?(c(),O(u,{key:0,modelValue:e.search,"onUpdate:modelValue":t[5]||(t[5]=W=>e.search=W),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)),[[ne,!e.editMode.enabled]]):E("",!0),le(e.$slots,"before-data",{},void 0,!0),e.maxOutputIndex>0&&e.branches.length>1?(c(),b("div",{key:2,class:D(e.$style.tabs),"data-test-id":"branches"},[y(k,{"model-value":e.currentOutputIndex,options:e.branches,"onUpdate:modelValue":e.onBranchChange},null,8,["model-value","options","onUpdate:modelValue"]),e.showIOSearch?(c(),O(u,{key:0,modelValue:e.search,"onUpdate:modelValue":t[6]||(t[6]=W=>e.search=W),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)):!e.hasRunError&&e.hasNodeRun&&(e.dataCount>0&&e.maxRunIndex===0||e.search)&&!e.isArtificialRecoveredEventItem?G((c(),b("div",{key:3,class:D(e.$style.itemsCount),"data-test-id":"ndv-items-count"},[e.search?(c(),O(v,{key:0},{default:w(()=>[I(T(e.$locale.baseText("ndv.search.items",{adjustToNumber:e.unfilteredDataCount,interpolate:{matched:e.dataCount,total:e.unfilteredDataCount}})),1)]),_:1})):(c(),O(v,{key:1},{default:w(()=>[I(T(e.$locale.baseText("ndv.output.items",{adjustToNumber:e.dataCount,interpolate:{count:e.dataCount}})),1)]),_:1})),e.showIOSearch?(c(),O(u,{key:2,modelValue:e.search,"onUpdate:modelValue":t[7]||(t[7]=W=>e.search=W),"pane-type":e.paneType,"is-area-active":e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","pane-type","is-area-active","onFocus"])):E("",!0)],2)),[[ne,!e.editMode.enabled]]):E("",!0),f("div",{ref:"dataContainer",class:D(e.$style.dataContainer),"data-test-id":"ndv-data-container"},[e.isExecuting?(c(),b("div",{key:0,class:D(e.$style.center),"data-test-id":"ndv-executing"},[f("div",{class:D(e.$style.spinner)},[y(P,{type:"ring"})],2),y(v,null,{default:w(()=>[I(T(e.executingMessage),1)]),_:1})],2)):e.editMode.enabled?(c(),b("div",{key:1,class:D(e.$style.editMode)},[f("div",{class:D([e.$style.editModeBody,"ignore-key-press"])},[y(_,{"model-value":e.editMode.value,"onUpdate:modelValue":t[8]||(t[8]=W=>e.ndvStore.setOutputPanelEditModeValue(W))},null,8,["model-value"])],2),f("div",{class:D(e.$style.editModeFooter)},[y(R,{bold:!1,class:D(e.$style.editModeFooterInfotip)},{default:w(()=>[I(T(e.$locale.baseText("runData.editor.copyDataInfo"))+" ",1),y(a,{to:e.dataEditingDocsUrl,size:"small"},{default:w(()=>[I(T(e.$locale.baseText("generic.learnMore")),1)]),_:1},8,["to"])]),_:1},8,["class"])],2)],2)):e.paneType==="output"&&e.hasSubworkflowExecutionError?(c(),b("div",{key:2,class:D(e.$style.stretchVertically)},[y(A,{error:e.subworkflowExecutionError,class:D(e.$style.errorDisplay)},null,8,["error","class"])],2)):e.hasNodeRun?e.paneType==="input"&&e.node.disabled?(c(),b("div",{key:4,class:D(e.$style.center)},[y(v,null,{default:w(()=>[I(T(e.$locale.baseText("ndv.input.disabled",{interpolate:{nodeName:e.node.name}}))+" ",1),y(a,{onClick:e.enableNode},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.disabled.cta")),1)]),_:1},8,["onClick"])]),_:1})],2)):e.hasNodeRun&&e.isArtificialRecoveredEventItem?(c(),b("div",{key:5,class:D(e.$style.center)},[le(e.$slots,"recovered-artificial-output-data",{},void 0,!0)],2)):e.hasNodeRun&&e.hasRunError?(c(),b("div",{key:6,class:D(e.$style.stretchVertically)},[e.isPaneTypeInput?(c(),O(v,{key:0,class:D(e.$style.center),size:"large",tag:"p",bold:""},{default:w(()=>[I(T(e.$locale.baseText("nodeErrorView.inputPanel.previousNodeError.title",{interpolate:{nodeName:e.node.name}})),1)]),_:1},8,["class"])):e.$slots.content?le(e.$slots,"content",{key:1},void 0,!0):(c(),O(A,{key:2,error:e.workflowRunData[e.node.name][e.runIndex].error,class:D(e.$style.dataDisplay)},null,8,["error","class"]))],2)):e.hasNodeRun&&(!e.unfilteredDataCount||e.search&&!e.dataCount)&&e.branches.length>1?(c(),b("div",{key:7,class:D(e.$style.center)},[e.search?(c(),b("div",su,[y(v,{tag:"h3",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),y(v,null,{default:w(()=>[y($,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:w(()=>[f("a",{href:"#",onClick:t[9]||(t[9]=(...W)=>e.onSearchClear&&e.onSearchClear(...W))},T(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})])):(c(),O(v,{key:1},{default:w(()=>[I(T(e.noDataInBranchMessage),1)]),_:1}))],2)):e.hasNodeRun&&!e.inputData.length&&!e.search?(c(),b("div",{key:8,class:D(e.$style.center)},[le(e.$slots,"no-output-data",{},()=>[I("xxx")],!0)],2)):e.hasNodeRun&&!e.showData?(c(),b("div",{key:9,class:D(e.$style.center)},[y(v,{bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.tooMuchDataTitle),1)]),_:1}),y(v,{align:"center",tag:"div"},{default:w(()=>[f("span",{innerHTML:e.$locale.baseText("ndv.output.tooMuchData.message",{interpolate:{size:e.dataSizeInMB}})},null,8,iu)]),_:1}),y(g,{outline:"",label:e.$locale.baseText("ndv.output.tooMuchData.showDataAnyway"),onClick:e.showTooMuchData},null,8,["label","onClick"]),y(g,{size:"small",label:e.$locale.baseText("runData.downloadBinaryData"),onClick:t[10]||(t[10]=W=>e.downloadJsonData())},null,8,["label"])],2)):e.hasNodeRun&&e.$slots.content?le(e.$slots,"content",{key:10},void 0,!0):e.hasNodeRun&&e.displayMode==="table"&&e.binaryData.length>0&&e.inputData.length===1&&Object.keys(e.jsonData[0]||{}).length===0?(c(),b("div",{key:11,class:D(e.$style.center)},[y(v,null,{default:w(()=>[I(T(e.$locale.baseText("runData.switchToBinary.info"))+" ",1),f("a",{onClick:t[11]||(t[11]=(...W)=>e.switchToBinary&&e.switchToBinary(...W))},T(e.$locale.baseText("runData.switchToBinary.binary")),1)]),_:1})],2)):e.showIoSearchNoMatchContent?(c(),b("div",{key:12,class:D(e.$style.center)},[y(v,{tag:"h3",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),y(v,null,{default:w(()=>[y($,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:w(()=>[f("a",{href:"#",onClick:t[12]||(t[12]=(...W)=>e.onSearchClear&&e.onSearchClear(...W))},T(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})],2)):e.hasNodeRun&&e.displayMode==="table"?(c(),O(be,{key:13},{default:w(()=>[y(B,{node:e.node,"input-data":e.inputDataPage,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,"run-index":e.runIndex,"page-offset":e.currentPageOffset,"total-runs":e.maxRunIndex,"has-default-hover-state":e.paneType==="input"&&!e.search,search:e.search,onMounted:t[13]||(t[13]=W=>e.$emit("tableMounted",W)),onActiveRowChanged:e.onItemHover,onDisplayModeChange:e.onDisplayModeChange},null,8,["node","input-data","mapping-enabled","distance-from-active","run-index","page-offset","total-runs","has-default-hover-state","search","onActiveRowChanged","onDisplayModeChange"])]),_:1})):e.hasNodeRun&&e.displayMode==="json"?(c(),O(be,{key:14},{default:w(()=>[y(U,{"pane-type":e.paneType,"edit-mode":e.editMode,"sessio-id":e.sessionId,node:e.node,"input-data":e.inputDataPage,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,"run-index":e.runIndex,"total-runs":e.maxRunIndex,search:e.search},null,8,["pane-type","edit-mode","sessio-id","node","input-data","mapping-enabled","distance-from-active","run-index","total-runs","search"])]),_:1})):e.hasNodeRun&&e.isPaneTypeOutput&&e.displayMode==="html"?(c(),O(be,{key:15},{default:w(()=>[y(oe,{"input-html":e.inputDataPage[0].json.html},null,8,["input-html"])]),_:1})):e.hasNodeRun&&e.isSchemaView?(c(),O(be,{key:16},{default:w(()=>[y(pe,{data:e.jsonData,"mapping-enabled":e.mappingEnabled,"distance-from-active":e.distanceFromActive,node:e.node,"pane-type":e.paneType,"run-index":e.runIndex,"total-runs":e.maxRunIndex,search:e.search},null,8,["data","mapping-enabled","distance-from-active","node","pane-type","run-index","total-runs","search"])]),_:1})):e.displayMode==="binary"&&e.binaryData.length===0?(c(),b("div",{key:17,class:D(e.$style.center)},[y(v,{align:"center",tag:"div"},{default:w(()=>[I(T(e.$locale.baseText("runData.noBinaryDataFound")),1)]),_:1})],2)):e.displayMode==="binary"?(c(),b("div",{key:18,class:D(e.$style.dataDisplay)},[(c(!0),b(Z,null,re(e.binaryData,(W,q)=>(c(),b("div",{key:q},[e.binaryData.length>1?(c(),b("div",{key:0,class:D(e.$style.binaryIndex)},[f("div",null,T(q+1),1)],2)):E("",!0),f("div",{class:D(e.$style.binaryRow)},[(c(!0),b(Z,null,re(W,(ue,Oe)=>(c(),b("div",{key:q+"_"+Oe,class:D(e.$style.binaryCell)},[f("div",{"data-test-id":"ndv-binary-data_"+q},[f("div",{class:D(e.$style.binaryHeader)},T(Oe),3),ue.fileName?(c(),b("div",ru,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.fileName"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.fileName),3)])):E("",!0),ue.directory?(c(),b("div",lu,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.directory"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.directory),3)])):E("",!0),ue.fileExtension?(c(),b("div",du,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.fileExtension"))+":",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.fileExtension),3)])):E("",!0),ue.mimeType?(c(),b("div",uu,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.mimeType"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.mimeType),3)])):E("",!0),ue.fileSize?(c(),b("div",cu,[f("div",null,[y(v,{size:"small",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("runData.fileSize"))+": ",1)]),_:1})]),f("div",{class:D(e.$style.binaryValue)},T(ue.fileSize),3)])):E("",!0),f("div",{class:D(e.$style.binaryButtonContainer)},[e.isViewable(q,Oe)?(c(),O(g,{key:0,size:"small",label:e.$locale.baseText("runData.showBinaryData"),"data-test-id":"ndv-view-binary-data",onClick:Un=>e.displayBinaryData(q,Oe)},null,8,["label","onClick"])):E("",!0),e.isDownloadable(q,Oe)?(c(),O(g,{key:1,size:"small",type:"secondary",label:e.$locale.baseText("runData.downloadBinaryData"),"data-test-id":"ndv-download-binary-data",onClick:Un=>e.downloadBinaryData(q,Oe)},null,8,["label","onClick"])):E("",!0)],2)],8,au)],2))),128))],2)]))),128))],2)):E("",!0):(c(),b("div",{key:3,class:D(e.$style.center)},[le(e.$slots,"node-not-run",{},void 0,!0)],2))],2),e.hasNodeRun&&!e.hasRunError&&e.binaryData.length===0&&e.dataCount>e.pageSize&&!e.isSchemaView&&!e.isArtificialRecoveredEventItem?G((c(),b("div",{key:4,class:D(e.$style.pagination),"data-test-id":"ndv-data-pagination"},[y(V,{background:"","hide-on-single-page":!0,"current-page":e.currentPage,"pager-count":5,"page-size":e.pageSize,layout:"prev, pager, next",total:e.dataCount,"onUpdate:currentPage":e.onCurrentPageChange},null,8,["current-page","page-size","total","onUpdate:currentPage"]),f("div",{class:D(e.$style.pageSizeSelector)},[y(m,{size:"mini","model-value":e.pageSize,teleported:"","onUpdate:modelValue":e.onPageSizeChange},{prepend:w(()=>[I(T(e.$locale.baseText("ndv.output.pageSize")),1)]),default:w(()=>[(c(!0),b(Z,null,re(e.pageSizes,W=>(c(),O(N,{key:W,label:W,value:W},null,8,["label","value"]))),128)),y(N,{label:e.$locale.baseText("ndv.output.all"),value:e.dataCount},null,8,["label","value"])]),_:1},8,["model-value","onUpdate:modelValue"])],2)],2)),[[ne,!e.editMode.enabled]]):E("",!0),y(H,{show:e.blockUI,class:D(e.$style.uiBlocker)},null,8,["show","class"])],34)}const pu={$style:ou},Mn=x(Ed,[["render",hu],["__cssModules",pu],["__scopeId","data-v-ea93d802"]]),fu=z({props:{taskData:{},hasStaleData:Boolean,hasPinData:Boolean},computed:{theme(){var e;return(e=this.runTaskData)!=null&&e.error?"danger":"success"},runTaskData(){return this.taskData},runMetadata(){if(!this.runTaskData)return null;const{date:e,time:t}=Ki(this.runTaskData.startTime);return{executionTime:this.runTaskData.executionTime,startTime:`${e} at ${t}`}}}}),gu=["innerHTML"],mu=f("br",null,null,-1),yu=f("br",null,null,-1);function wu(e,t,o,n,s,i){const a=S("n8n-info-tip"),r=S("n8n-text");return e.hasStaleData?(c(),O(a,{key:0,theme:"warning",type:"tooltip","tooltip-placement":"right","data-test-id":"node-run-info-stale"},{default:w(()=>[f("span",{innerHTML:e.$locale.baseText(e.hasPinData?"ndv.output.staleDataWarning.pinData":"ndv.output.staleDataWarning.regular")},null,8,gu)]),_:1})):e.runMetadata?(c(),O(a,{key:1,type:"tooltip",theme:e.theme,"data-test-id":`node-run-info-${e.theme}`,"tooltip-placement":"right"},{default:w(()=>[f("div",null,[y(r,{bold:!0,size:"small"},{default:w(()=>[I(T(e.runTaskData.error?e.$locale.baseText("runData.executionStatus.failed"):e.$locale.baseText("runData.executionStatus.success")),1)]),_:1}),mu,y(r,{bold:!0,size:"small"},{default:w(()=>[I(T(e.$locale.baseText("runData.startTime")+":"),1)]),_:1}),I(" "+T(e.runMetadata.startTime),1),yu,y(r,{bold:!0,size:"small"},{default:w(()=>[I(T(e.$locale.baseText("runData.executionTime")+":"),1)]),_:1}),I(" "+T(e.runMetadata.executionTime)+" "+T(e.$locale.baseText("runData.ms")),1)])]),_:1},8,["theme","data-test-id"])):E("",!0)}const vu=x(fu,[["render",wu]]),_t={REGULAR:"regular",LOGS:"logs"},Nu=z({name:"OutputPanel",components:{RunData:Mn,RunInfo:vu,RunDataAi:ji},props:{runIndex:{type:Number,required:!0},isReadOnly:{type:Boolean},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},sessionId:{type:String},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(e){const t=X(),{activeNode:o}=kt(t),{isSubNodeType:n}=_n({node:o});return{pinnedData:Se(o,{runIndex:e.runIndex,displayMode:t.getPanelDisplayMode("output")}),isSubNodeType:n}},data(){return{outputMode:"regular",outputTypes:[{label:this.$locale.baseText("ndv.output.outType.regular"),value:_t.REGULAR},{label:this.$locale.baseText("ndv.output.outType.logs"),value:_t.LOGS}]}},computed:{...te(J,X,de,j),node(){return this.ndvStore.activeNode},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isTriggerNode(){return this.nodeTypesStore.isTriggerNode(this.node.type)},hasAiMetadata(){if(this.node){const e=this.workflowsStore.getWorkflowResultDataByNodeName(this.node.name);return!e||!Array.isArray(e)||e.length===0?!1:!!e[e.length-1].metadata}return!1},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){return!!(this.nodeType&&this.nodeType.group.includes("schedule"))},isNodeRunning(){return this.node&&this.workflowsStore.isNodeExecuting(this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){var t;if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return(t=e==null?void 0:e.resultData)!=null&&t.runData?e.resultData.runData:null},hasNodeRun(){return this.workflowsStore.subWorkflowExecutionError?!0:!!(this.node&&this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name))},runTaskData(){if(!this.node||this.workflowExecution===null)return null;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<=this.runIndex?null:e[this.node.name][this.runIndex]},runsCount(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length:0},staleData(){if(!this.node)return!1;const e=this.workflowsStore.getParametersLastUpdate(this.node.name);if(!e||!this.runTaskData)return!1;const t=this.runTaskData.startTime;return e>t},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},canPinData(){return this.pinnedData.isValidNodeType.value&&!this.isReadOnly}},methods:{insertTestData(){const e=this.$refs.runData;e&&(e.enterEditMode({origin:"insertTestDataLink"}),this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:this.node.type,pane:"output",type:"insert-test-data"}))},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},openSettings(){this.$emit("openSettings"),this.$telemetry.track("User clicked ndv link",{node_type:this.node.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"output",type:"settings"})},onRunIndexChange(e){this.$emit("runChange",e)},onUpdateOutputMode(e){e===_t.LOGS?gt.emit("setPositionByName","minLeft"):gt.emit("setPositionByName","initial")},activatePane(){this.$emit("activatePane")}}}),ku="_outputTypeSelect_1tinm_10",bu="_titleSection_1tinm_15",Tu="_title_1tinm_15",Su="_noOutputData_1tinm_31",Du="_recoveredOutputData_1tinm_41",Eu={outputTypeSelect:ku,titleSection:bu,title:Tu,noOutputData:Su,recoveredOutputData:Du},Cu=f("br",null,null,-1);function Iu(e,t,o,n,s,i){const a=S("n8n-radio-buttons"),r=S("RunInfo"),l=S("n8n-text"),d=S("RunDataAi"),h=S("RunData");return c(),O(h,{ref:"runData",node:e.node,"run-index":e.runIndex,"linked-runs":e.linkedRuns,"can-link-runs":e.canLinkRuns,"too-much-data-title":e.$locale.baseText("ndv.output.tooMuchData.title"),"no-data-in-branch-message":e.$locale.baseText("ndv.output.noOutputDataInBranch"),"is-executing":e.isNodeRunning,"executing-message":e.$locale.baseText("ndv.output.executing"),"session-id":e.sessionId,"block-u-i":e.blockUI,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isPaneActive,"pane-type":"output","data-output-type":e.outputMode,onActivatePane:e.activatePane,onRunChange:e.onRunIndexChange,onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onTableMounted:t[3]||(t[3]=p=>e.$emit("tableMounted",p)),onItemHover:t[4]||(t[4]=p=>e.$emit("itemHover",p)),onSearch:t[5]||(t[5]=p=>e.$emit("search",p))},Qt({header:w(()=>[f("div",{class:D(e.$style.titleSection)},[e.hasAiMetadata?(c(),O(a,{key:0,modelValue:e.outputMode,"onUpdate:modelValue":[t[0]||(t[0]=p=>e.outputMode=p),e.onUpdateOutputMode],options:e.outputTypes},null,8,["modelValue","options","onUpdate:modelValue"])):(c(),b("span",{key:1,class:D(e.$style.title)},T(e.$locale.baseText(e.outputPanelEditMode.enabled?"ndv.output.edit":"ndv.output")),3)),e.hasNodeRun&&!e.pinnedData.hasData.value&&e.runsCount===1?G((c(),O(r,{key:2,"task-data":e.runTaskData,"has-stale-data":e.staleData,"has-pin-data":e.pinnedData.hasData.value},null,8,["task-data","has-stale-data","has-pin-data"])),[[ne,!e.outputPanelEditMode.enabled]]):E("",!0)],2)]),"node-not-run":w(()=>[e.workflowRunning&&!e.isTriggerNode?(c(),O(l,{key:0,"data-test-id":"ndv-output-waiting"},{default:w(()=>[I(T(e.$locale.baseText("ndv.output.waitingToRun")),1)]),_:1})):E("",!0),e.workflowRunning?E("",!0):(c(),O(l,{key:1,"data-test-id":"ndv-output-run-node-hint"},{default:w(()=>[e.isSubNodeType.value?(c(),b(Z,{key:0},[I(T(e.$locale.baseText("ndv.output.runNodeHintSubNode")),1)],64)):(c(),b(Z,{key:1},[I(T(e.$locale.baseText("ndv.output.runNodeHint"))+" ",1),e.canPinData?(c(),b("span",{key:0,onClick:t[1]||(t[1]=(...p)=>e.insertTestData&&e.insertTestData(...p))},[Cu,I(" "+T(e.$locale.baseText("generic.or"))+" ",1),y(l,{tag:"a",size:"medium",color:"primary"},{default:w(()=>[I(T(e.$locale.baseText("ndv.output.insertTestData")),1)]),_:1})])):E("",!0)],64))]),_:1}))]),"no-output-data":w(()=>[y(l,{bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.output.noOutputData.title")),1)]),_:1}),y(l,null,{default:w(()=>[I(T(e.$locale.baseText("ndv.output.noOutputData.message"))+" ",1),f("a",{onClick:t[2]||(t[2]=(...p)=>e.openSettings&&e.openSettings(...p))},T(e.$locale.baseText("ndv.output.noOutputData.message.settings")),1),I(" "+T(e.$locale.baseText("ndv.output.noOutputData.message.settingsOption")),1)]),_:1})]),"recovered-artificial-output-data":w(()=>[f("div",{class:D(e.$style.recoveredOutputData)},[y(l,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),y(l,null,{default:w(()=>[I(T(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.outputMode==="logs"?{name:"content",fn:w(()=>[y(d,{node:e.node,"run-index":e.runIndex},null,8,["node","run-index"])]),key:"0"}:void 0,!e.pinnedData.hasData.value&&e.runsCount>1?{name:"run-info",fn:w(()=>[y(r,{"task-data":e.runTaskData},null,8,["task-data"])]),key:"1"}:void 0]),1032,["node","run-index","linked-runs","can-link-runs","too-much-data-title","no-data-in-branch-message","is-executing","executing-message","session-id","block-u-i","is-production-execution-preview","is-pane-active","data-output-type","onActivatePane","onRunChange","onLinkRun","onUnlinkRun"])}const Pu={$style:Eu},Ou=x(Nu,[["render",Iu],["__cssModules",Pu]]),$u={},Ru={width:"112",height:"80",viewBox:"0 0 112 80",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},_u=xi('<mask id="mask0_489_46042" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="0" y="0" width="112" height="80"><rect width="112" height="80" fill="url(#paint0_linear_489_46042)"></rect></mask><g mask="url(#mask0_489_46042)"><rect x="-0.5" width="112" height="80" fill="url(#pattern0)" fill-opacity="0.6"></rect></g><defs><pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"><use xlink:href="#image0_489_46042" transform="scale(0.00357143 0.005)"></use></pattern><linearGradient id="paint0_linear_489_46042" x1="90.5" y1="40.4494" x2="112.5" y2="40.4494" gradientUnits="userSpaceOnUse"><stop></stop><stop offset="1" stop-color="white" stop-opacity="0"></stop></linearGradient><image id="image0_489_46042" width="280" height="200" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAADICAYAAAAzx/4XAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABhdSURBVHgB7d0JcFTVngbw/72d4IYa0Ie4IK2llgpodNwtB9AaxVILF7ZxynkgWupojaRwASXQGEBqEAI8LXfBpZQS9IFabjMFkXFfijCKyqjQqIiKShCUpdP3vvPdpXP7pjtk6dPdSX+/qlPpJX07UfrL/yz3XEOIPJNiswaZkbKBtkiluC0qRB1gCJW86ntmjzYM81YvWIhyhgFTwlCxGJGyBcJKhTQxhUrSpJraKSpcVgjDhTQqEyo5U+6prbVExmV6TnWT6ixbnuxmSZ262xCLVTUIUTsxYEoMKpdM4aKCZV5ZUmIMFMoljsGUkMk1c9RArjE39HBchcuYadVVdUKUYwyYEjEhVhstj8gqdbMi8HA8kpTBqmqJC5EGHOQtEeVlMkXSw6WB4UK6cQymBKB6UYMso4OPWYZMrWG4kGasYEpAmWGHB3Xj0ydVzRUizRgwJcAwjaFpD9gyVYjygAHTxTndo9Bium2WLBWiPGDAdHFlkWT4/KK6uVzrQnnCgOniDNuIBu/blr1aiPKEAdPF2Xba1DQeYfVCecOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2hhCXc7ll19eUVZWNto0zYFGJDLIamys8J+LRMrilpWst217WSKRqFu6dGlciDRhwHQho0aNilqWVavC4/I2vGyhCpqpDBrSISLUJYwcOfJWFS6vq5vHS9tURiKRcf3795c1a9a8JUQ5xAqmk0N3qLy8/O/q5iDpIMMwlu7evXuMqmYahCgHOMjbyalwWSE5CBdA18o7HlFOsIvUiY0YMaJWfWnLeEtr9FbdpQrVXXpDiDqIXaROavjw4aPVlwWiiapmBi9ZsqROiDqAXaTOa4popMZjtIUXlQ4GTCfkVS9R0SvqvQ9RuzFgOqe/Sn7k632oi+IYTCfjTUtvkTxJJBI9OG1N7cUKppMpKyurlDzK9/tR18KA6Xzy+oG3LCsqRO3EgOl8KiSPTNOMClE7MWCISJsyIUcsVlvRGJEVhm3Nq5k8fqEUr3wPuHKAl9qNFYwnFqtqMND9MMwF1TW16yfXzLl1Qqw2KkXGtu245Fe9ELUTAybAaPprHbXFmFsekfXV02oX3BX7r6KZSUkmk3WSR42NjQwYajcGTIBl2aubPWjL6EikfJWqalZU3zN7tBSYtyalTvJAVUt1XANDHcExmDTofmRdezhIdZ8GqaCZYog9d3fSWDYzVhWXwnhScrRFQ0sMw3hSiDqAFUyAZUi8Fd9W8O5TIpFYqr7ERa/44sWLFwpRBzBggiJm28YbCtR9QrfFsqwq0WuqEHUQz0UKwFR1MiIdOc8nns/u01VXXTXXNM1bJcdUeM174YUXxglRBzFgQlQ1goDp+GpZQxYmGxPzZsTu0DYL4534iC0uc9lNq1ddo1OEKAfYRQoYpyoYI1djG6r7ZEbKF+CYogm6Smo8ZjA265YcwHFwPCHKkZKrYPCB31cSUTEjlaYtUSNi9rVtqTTcqiUqOWKLzCtLql5XrCov07zDhg2LqYBo9y53akq6asmSJXOFKIe6ZMDEYvdGG6W80jKNioiYJ6vfUs38qDBxA0T7yYJqNqpq+qSqvH9YceG1xsZGBE1bNorihddIm04ZMMEqJILAMFWI2E5wYCwiKoUTV0E2Zlp1VZ0UEIImmUwOUjeHRiKRSnU76j9nlpU1WI2NdapieUuF0UIupCOdijZgUIXslkhFhq5MVPRWIQ3tOb4KlnrVJboiVrjFdxlNmjo7ZphmqutkW9bUaVPGx4QoDwq6ktfvyhimEVV/W/uiKyNuFVKRVC110SbEoJ2zNGywMZ1sSL2dtLdahlFvGtKgwqEe4aCmqqNqqnp9Ww6Y7/EWos5Ca8Bk6cpExa1CoipEdJVQ6Ko0uCFibbAMM94tIvWSkPieQgAho6aqpbUKNd5C1Bl0OGCaDaiaUpHelSlv+mZbcimuWr1t2RvUoGbcNiSOKkQ91pCDSiIuex7LccZbVLjUhR5vT2bm9r8MUZHYY8CgCqmQnRVZujKpKiTVnclTV0b0QlBFsz2ZZbzFCH0N3w4dIo3Riu/Z0+NERScVMM5Je1nWhiRlb21dGcGHWQWHWLJahVVDa7syOjlVkZn5Nw6Nt4S/yQg0LGJECJ+n2nGqdVPtO9XeUW2lagnZw4+R4bYdeE8GDRW9VMCURcoX2PhA5HhA1WvNujLFNtsSZBjetg12+mfYErtq+uTx86QpQFIvkab/ZOgTnqlajWpniBssQY2qrVJtumornMOK9BQ3jE5XrY9q3VXbodo61d5U7TPVtgeO4QcNQ4aKWipgsNmS+qvdnnNaAl2ZtAHVhmIOkZbYKmCM9HCJJ3bvGjtz2sT/FffDv7e4/+3wTegl7lJtt3f/JHHD5VzVjH333Ve6deuGZfjYHU62b99eZts2gmS+ajHVvlZtjGqjVNsnw4+DkxkfVW2OapuF1Qx1IoExmBY3W1LPFV9XRhcracUjpulUMKq8WP3Lr1uGPzx/Gk6CPFu1gaqdrNrB4lYjP6n2iWr/p9pG1W5X7Z9UM4499li59NJL5ZRTTnFC5ssvv5Tly5fL+++/L7t370alMkO1TaqdYqr36969uxx44IG42Bm2xpStW7fK77//fqAKpPHiVkYIpR+897Wl5WBh6FDBNQWMaSJAFhZgQLXYGNbO5AZzn4gkLWv+199+O23xgr/tpR7/V9VuUK1fhtdcLW43BhXOaart07NnT5kzZ44MGTLECQxABTN06FAZM2aM1NfXI817oyFcEEbnn3++DBgwwAmZbdu2yTvvvCNvvPGGbN68WRVU9s3ijt9sFbdqOki1fcUNEoTfL9I0rhOsbogKJhUw06qrcEZuTs7K7exmzpy49a7qe8feWzPxKXErh39TrVq1ngiLCjWv1qNHD+ybggpDGhoasMtcf/X8ieJ9sC+88EI599xzU+ECuH3MMcfIyJEjETCpxw8++GCpqqqSa665RtCl8g0fPlzuuusuWbRoEaoZHOhKcSumY8Ttgh0pbjWD6ul/xJ39+i3wq7CKoYLinrzpUlPNM9xwwQAtQuM/VeuJILjgggucdvTRRzsVyTfffCPLli2T9957D1VHauD3zDPPdLpFYfvtt5+cdtppTpD8+eefzmP9+vWTgQMHpoULoAq69tpr5e2333a6S8r54obLaaHDXqTaNar9TbUnVPtVguGC8SSDBQ3lHwOmueA0MwZdMRN01D777COnnnqq1NTUON2ZIHRr7rzzTidkfAcddJBEIpHmB1cfdARV37595YsvvnAeQ0X0l7/8JeMPc8IJJ8ghhxwin3/+ObZU6KUe6uUfPxqNyo4dO2TdunXGzp07D1UP/4dq34hbiWJ2Cq8x8J4MGSoEbjjVJLhQLhgwGNB1xkVQuYTDBc444ww5++yz5YADDkg9tv/++zthkgnCChUQIITQ3cLxM8FxjjrqKCkvb1oRjdCZMWOGzJs3zxnnufrqq3ENaTyFMZ1LxR2ANv3fif0kKhRWMOnCC+XQMMDrjJ+EuzC+vfbay+n2YEB2zZo1zmP+1HQme++9t1OV+LdRwQTHasJQ7SBg1MyTc//mm2+W66+/3jk+xoHw3GuvvSabNm3CQfp4zRmLsdWkO+sWKhRWMJkFF9JhdsYZL9m4cWPWF5x++ulOpeGHSksBg0BCFwdQoWTrHvmOOOKIVAWDMBoxYkTq2KhcevXq5by3Zz9xK5iI83uoAEL3yKlibNYylF8MmHTh6sWfoXEGWT/99NPUwGwYxkMwJY1qA10m3M80BgPoEmGGqbKy0hkMRmsJxn4wOIxQwXuEAwlhhuDx74obMs7vkFRjMIwVKhR2kVzBpf7BbhICZr1qW5LJZA/MGK1du9ZZOBeGLs5ll13mTEPj9mGHHeaPizSDQBg8eLAzZoNqpn///tISjPvMmjVLNmzYIIMGDWr2PN4Hx/Eg1RAyTsBgkDdVubCzRHnGgMkcLH4Fg9vbxK1iBm7evNlZhZspYODII4902h7fUH3QES4ImdbA2M+wYcOcGSNUMpkEwsw/uT01yEtUKKXeRco0c4SG2ZgrVLtRtb+KNxGDBXXvvvsuVtZKvmEMBqGUrdsVkgpIO5k0/HMK2FWifCvlCiZT5YJp6RGqjVXtEO++3+Vwzg/CepS6ujpnlW2RMkKNqGBYwTRVLvuLe8byveIurouKGzKYkUktcME09EsvveSvrC16lhAVTqlWMMHqxe9O3CbuuT7OdMzxxx/vnAmNLsknn3wiK1eudNah7Nq1ywmZVatWZRxwLQScsrBz507/LjIFJz2ygqGCK+Uukj8Iiq/YcW6keOFyww03yN133+2sUcHgKaqV5557TqZOnepMU3/77bfO1gvFEjDougWmzxEuu4WoCJRiwGSaLbpANWdxyVlnnSUPPfRQ2gswuDp27Fhn1ezEiROdr63xww8/yPr16+Wcc85ptugOA8aYkcIpAlg3Ex68xZQ0zrg++eSTpU+fPi0O7qKCCXTZEC47hKgIlOoYTDBk8MnFMlhnqewll1yS8QVYeYvl+Y8++qjMnDnTmTZuCVb94gzp8847T6qrq9OeQxg888wzcvHFF8tNN90kL7/8ctrzv/zyi0yYMEGuvPJKufHGG+Wrr75q8b3QbcNrPOgrdY4BIurySrmCQbj660XKvcdSS/gzwXPXXXedtAbGabBXjG3bznYLQVjP8v333zu3f/vtN6fLFYSw2LJli1Mpff3119hms8X3QsD8+uuv/l30lRAwzsw0l2pTIZXav7/wJUX8CuYP8SZc8IHvTBBgCKA//vjDuStuBfO7EBWBUvwDF5xd8cdgUttNrlu3TjqTRCIh8Xg8dVfczaawCTnX1VHBlXIFHewqob/iBAy6NnYnOusYAYOBZA+ql58leOUBNQvGVXdUKFxo58In1Pmrj5W6GP/o8IEDs0aYRtYFa3NwlrcH/SR/TwlWMFRwpV7B+PChxEhrI3bzf/7556WjsGudHzLZtnjoKExPYzr7448/9h/CANL/S9OpR9gvk0FDBVPKARP84KHEeEu89SNPPPFEh09oxJYNfsDoqmAwsPvqq6/6U9T42dHVQ1Cmn9+In4NbNVABlGLAhK/57DcsRomrlvzoo4/kvvvuS21RWawwIP3444/7dzG4i8vMImgwI8YTqKngSi1ggpdd9ZvlNVwxEbvxO4tO8MFdunRpq1ft5hsGonH6gjfrhSTEJWhxWYNguLCLRAVV6l0kS9JD5lVxr87oLFybPXu2rFixQnINXSd/gygERXtCDCdfPvvss/5d9JH+W7Ufpel3SS20S80gsZtEeVaqXaRgwwCJ5X3FwMsDqq3CN+JcICzz/+CDDySXcF6Rv8UlBmrb2hVbvXq1cyVIbxNyTK9jqTACxgo1VjBUUKVawQS7R37I+A19DlwhcR0++NiWAdce+uyzzySXgicvtqWCQWU1efJk5+cS9+fHz/uCuDNIflimmmFGbFYuVCilXMH4H0L/Q9no3cbXD1Wbr9pm7LPyyiuvSG1tbcFX+SKIHnzwQXn99df9hzCw+4i4ewYHQ5KDvFQUSn0Mxg+a4IcTAYM+CwZfZqm2BetYsDYGlcN3333XqoMfeuihqbUwuMJAEK4qgEuXADb0Dp9giX1ounfv7rwWx8HF2QAXV3vssceCXaoHxb3o/W7v5/ZD0g9PB8dfqFBatYN0F5TppMdwQ/g0iLv0/sxEIlGOcEFFc+KJJ2a91KsPwYFrUGNnPGy5cPjhh6eewxoZvB7PY9OqK664wgkVHwIFe9DgciWjRo2Sk046yTkDe/z48c64kKdO3IDBVQ8QLAlJr8KcKmbg4Iv+WQXVoFTA2PZbK+verBOiPCjVHe0QHn6I+GMwqOYS3vP+SZAIl9dU66Vme67fsmVL+YIFC+Tnn3+W6dOnOxdZywZVysiRI51qI3ypEYy/IHjuuOOO8DWNUq+96KKLnMua4Htx//777xesz/HOk8Ks0Qxxt2VISnq4sItERaPUr4sUnk0KngDp38bWB4vFvUb1v2/durUcm36j4sBMznHHHZf14AiOcHgEZbvWNaDK8a9XjbGXxYsXC05j8Dyh2iZp6hZlC5emlbxEBVDKAROsYvzxiuAVHYMnIP+k2jOq7VIVxLXbt2/f++mnn3bOMbrttttkwIABohO23sSWDN5sE6qVl6SpagmHS7ARFVSpn02daU1MIktDyDyl2gMqZLbhPKCnnnpKbr/9dmeLh/ZAcNxyyy3Su3dv6devnzz88MPBKiUF2zFg1zoPRpl/C/1smWaQRNhFogLjpWObPoTBv/jB7pIEvqK7hDUn+LTfotoBb775pnOdJAziBi5Av0c//vijzJ8/Xx544AHn/k8//SRTpkxxFt5hn97gda2xQXjghMmNkh4o4XDh+AsVDW7Zmnm62p+V8S8BEqwWMLD6d9UeVu1nDLouX77cuYxJa2FbTgQTAsZ7b6e7g5BZtGiRfPjhh2lnYKN6CWyCtUOyj70EqxeigmPAuIJdinDQBMPGb9jg5RPVPseLsGQfVUZrYYOoWbNmOVPP4p5cWe8dy8a1r1ER4Zh+qIQueWJK5vEWW9g1oiLDLlKTTFPXRuh5/3vQsO2ds7k2LkPiX4wNMLUcvg4SwgLbW2ItDS7g5p16gLDCiU4LVTtBtR5qILcPVuuiizRkyBBnvQwqG7zWg+s3ZQsXdo2oqDBg0vkBgg+tXymINL9YW3DTcKfL88gjj8iLL77oBAMWygXHUABjK9iKEwHj7aGLY8dVW6baN+IO3PZW7SpVDVXgTO4lS5Y44zp4XWBXvL7e+zJYqOgxYJoLhox4t4NB4y/CA2clNFb34vrVbYBuF1IG+898JE1ncmO7CKzK+xd1zB5r167N1IXtJu51nFi9UNFjwGQWDhlfsILBtDVOisSJRPuGno9I8038cUzMPmHnf8wEYd+ZleKGjR8MOJtyobhbX1aqdqB3LASQf0lY7PD9hzBYqBNgwGQXDBm/e+QP/vrXUkIFgg98T0m/UmQ3aQqi4DQ4ggELXbBvrn/1xeDMD74f4YNFfW94x8WxEt7rMO6zSTKfDsCQoaLDgGlZeLVveJUvQgZBgS5LRJoCxsxwnEzbRPiDyb5gFwxVzEbJvAgwKaxgqBNgwLROOBwQMqb31YcP/Z4CxsrS/IDwqx5T0isgW9L3rOGCOuoUGDB7FuyCBM9bagw8jsf8cMk2/tJSwPiCYzzB2apM+9bwrGkqegyY1guGCzQGHiuTpqom05VagwETDppgQISnws0Mr/cXAPK8Iyp6DJjWC6/2Dd72181ASwETrmQyVR/h7SLCxwhu88kxGCpqDJjWCa/ytaR5WIR3xAu/Pjzj01LA7Cmk2DWiToEB03Z+mJiB28GAEckcMMHbVuhxO/S6TCHlf1+msGLQUFFiwLSeX8X4ty1pHiit2TouU7cmU8BI6Lad5StR0WLAtE0wCMKDs209RkvPtTY8GDJU1Bgw7WNnuW+04TVEXR4DJrcYIkQB3HCKiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBdnGFI2gWbjIjZV4jyhAHTxdmGHU9/QKJClCcMmC6uLBmpDz1UOS5W2/qLaBN1AAOmi4vFquLiXuDNV7GfaY0WojxgwJQA27KeDN43DXOoEOUBA6YElNnmwtBDg6rvmT1OiDRjwJQAdJNssdOqGDHMKRNitVEh0ogBUyLKkkZMfQlOWVeUR2QFQ4Z0YsCUCGew15CpoYejCJlJNbWDhEiDtmz1SF2ACpOY+p8+pdkThixMNMrUme6sE1FOMGBK0KSaOXMNMW7N8vRSNe20LGkl62fE7qgXog5gwJSorJUMUQ4xYEoYxl7UP4AF6mZUiDRgwJBU31M7Wv1LQDUTFaIcYsBQSmx6bWVjo3W5mOZAww2bqBB1wD8AobUpv0xPqN8AAAAASUVORK5CYII="></image></defs>',3),Au=[_u];function Mu(e,t){return c(),b("svg",Ru,Au)}const Wu=x($u,[["render",Mu]]),Vu=z({name:"InputPanel",components:{RunData:Mn,NodeExecuteButton:eo,WireMeUp:Wu},props:{currentNodeName:{type:String},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},workflow:{},canLinkRuns:{type:Boolean},sessionId:{type:String},readOnly:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},data(){return{showDraggableHintWithDelay:!1,draggableHintShown:!1,inputMode:"debugging",mappedNode:null,inputModes:[{value:"mapping",label:this.$locale.baseText("ndv.input.mapping")},{value:"debugging",label:this.$locale.baseText("ndv.input.debugging")}]}},computed:{...te(J,X,j,de),focusedMappableInput(){return this.ndvStore.focusedMappableInput},isUserOnboarded(){return this.ndvStore.isMappingOnboarded},isMappingMode(){return this.isActiveNodeConfig&&this.inputMode==="mapping"},showDraggableHint(){const e=[Ht,Ze,os,ns];return!this.currentNode||e.includes(this.currentNode.type)?!1:!!this.focusedMappableInput&&!this.isUserOnboarded},isActiveNodeConfig(){var o,n;let e=((o=this.activeNodeType)==null?void 0:o.inputs)??[],t=((n=this.activeNodeType)==null?void 0:n.outputs)??[];if(this.activeNode!==null&&this.currentWorkflow!==null){const s=this.currentWorkflow.getNode(this.activeNode.name);e=fe(this.currentWorkflow,s,this.activeNodeType),t=Te(this.currentWorkflow,s,this.activeNodeType)}else Array.isArray(e)||(e=[]),Array.isArray(t)||(t=[]);return!!(e.length===0||e.every(s=>this.filterOutConnectionType(s,M.Main))&&t.find(s=>this.filterOutConnectionType(s,M.Main)))},isMappingEnabled(){return this.readOnly?!1:this.isActiveNodeConfig?this.isMappingMode&&this.mappedNode!==null:!0},isExecutingPrevious(){if(!this.workflowRunning)return!1;const e=this.workflowsStore.executedNode,t=this.workflowsStore.executingNode;return this.activeNode&&e===this.activeNode.name&&!this.workflowsStore.isNodeExecuting(this.activeNode.name)?!0:t.length||e?!!this.parentNodes.find(o=>this.workflowsStore.isNodeExecuting(o.name)||o.name===e):!1},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){return this.workflow},activeNode(){return this.ndvStore.activeNode},rootNode(){return this.currentWorkflow.getChildNodes(this.activeNode.name,"ALL_NON_MAIN")[0]},rootNodesParents(){return[...this.currentWorkflow.getParentNodes(this.rootNode,"main")].reverse()},currentNode(){return this.isActiveNodeConfig?this.mappedNode?this.workflowsStore.getNodeByName(this.mappedNode):this.activeNode:this.workflowsStore.getNodeByName(this.currentNodeName)},connectedCurrentNodeOutputs(){const e=this.parentNodes.find(({name:t})=>t===this.currentNodeName);if(e)return e.indicies},parentNodes(){if(!this.activeNode)return[];const e=this.workflow.getParentNodesByDepth(this.activeNode.name);return e.filter(({name:t},o)=>this.activeNode&&t!==this.activeNode.name&&e.findIndex(n=>n.name===t)===o)},currentNodeDepth(){const e=this.parentNodes.find(t=>this.currentNode&&t.name===this.currentNode.name);return e?e.depth:-1},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},isMultiInputNode(){return this.activeNodeType!==null&&this.activeNodeType.inputs.length>1}},watch:{inputMode:{handler(e){this.onRunIndexChange(-1),e==="mapping"?(this.onUnlinkRun(),this.mappedNode=this.rootNodesParents[0]):this.mappedNode=null},immediate:!0},showDraggableHint(e,t){e&&!t?setTimeout(()=>{this.draggableHintShown||(this.showDraggableHintWithDelay=this.showDraggableHint,this.showDraggableHintWithDelay&&(this.draggableHintShown=!0,this.$telemetry.track("User viewed data mapping tooltip",{type:"unexecuted input pane"})))},1e3):e||(this.showDraggableHintWithDelay=!1)}},methods:{filterOutConnectionType(e,t){return e?typeof e=="string"?e!==t:e.type!==t:!1},onInputModeChange(e){this.inputMode=e},onMappedNodeSelected(e){this.mappedNode=e,this.onRunIndexChange(0),this.onUnlinkRun()},getMultipleNodesText(e){var s;if(!e||!this.isMultiInputNode||!this.activeNode||((s=this.activeNodeType)==null?void 0:s.inputNames)===void 0)return"";const n=(this.currentWorkflow.connectionsByDestinationNode[this.activeNode.name].main||[]).reduce((i,a,r)=>a[0]&&a[0].node===e?[...i,r]:i,[]).map(i=>{var a,r;return(r=(a=this.activeNodeType)==null?void 0:a.inputNames)==null?void 0:r[i]});return n.length===0?"":`(${n.join(" & ")})`},onNodeExecute(){this.$emit("execute"),this.activeNode&&this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"executePrevious"})},onRunIndexChange(e){this.$emit("runChange",e)},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},onInputNodeChange(e){const t=this.parentNodes.findIndex(o=>o.name===e)+1;this.$emit("changeInputNode",e,t)},onConnectionHelpClick(){this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"not-connected-help"})},truncate(e){const t=e.substring(0,30);return t.length<e.length?`${t}...`:t},activatePane(){this.$emit("activatePane")}}}),Bu="_mappedNode_13qhk_5",Uu="_titleSection_13qhk_10",Lu="_inputModeTab_13qhk_19",xu="_noOutputData_13qhk_23",Hu="_recoveredOutputData_13qhk_33",Fu="_notConnected_13qhk_42",zu="_title_13qhk_10",Yu={mappedNode:Bu,titleSection:Uu,inputModeTab:Lu,noOutputData:xu,recoveredOutputData:Hu,notConnected:Fu,title:zu},Ku={key:0},ju={key:1},qu=["innerHTML"];function Gu(e,t,o,n,s,i){const a=S("n8n-option"),r=S("n8n-select"),l=S("n8n-radio-buttons"),d=S("n8n-text"),h=S("NodeExecuteButton"),p=S("n8n-tooltip"),g=S("WireMeUp"),N=S("RunData");return c(),O(N,{node:e.currentNode,"run-index":e.runIndex,"linked-runs":e.linkedRuns,"can-link-runs":!e.mappedNode&&e.canLinkRuns,"too-much-data-title":e.$locale.baseText("ndv.input.tooMuchData.title"),"no-data-in-branch-message":e.$locale.baseText("ndv.input.noOutputDataInBranch"),"is-executing":e.isExecutingPrevious,"executing-message":e.$locale.baseText("ndv.input.executingPrevious"),"session-id":e.sessionId,"override-outputs":e.connectedCurrentNodeOutputs,"mapping-enabled":e.isMappingEnabled,"distance-from-active":e.currentNodeDepth,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isPaneActive,"pane-type":"input","data-test-id":"ndv-input-panel",onActivatePane:e.activatePane,onItemHover:t[2]||(t[2]=m=>e.$emit("itemHover",m)),onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onRunChange:e.onRunIndexChange,onTableMounted:t[3]||(t[3]=m=>e.$emit("tableMounted",m)),onSearch:t[4]||(t[4]=m=>e.$emit("search",m))},Qt({header:w(()=>[f("div",{class:D(e.$style.titleSection)},[e.parentNodes.length?(c(),O(r,{key:0,teleported:"",size:"small","model-value":e.currentNodeName,"no-data-text":e.$locale.baseText("ndv.input.noNodesFound"),placeholder:e.$locale.baseText("ndv.input.parentNodes"),filterable:"","data-test-id":"ndv-input-select","onUpdate:modelValue":e.onInputNodeChange},{prepend:w(()=>[f("span",{class:D(e.$style.title)},T(e.$locale.baseText("ndv.input")),3)]),default:w(()=>[(c(!0),b(Z,null,re(e.parentNodes,m=>(c(),O(a,{key:m.name,value:m.name,class:"node-option",label:`${e.truncate(m.name)} ${e.getMultipleNodesText(m.name)}`,"data-test-id":"ndv-input-option"},{default:w(()=>[f("span",null,T(e.truncate(m.name))+" ",1),e.getMultipleNodesText(m.name)?(c(),b("span",Ku,T(e.getMultipleNodesText(m.name)),1)):(c(),b("span",ju,T(e.$locale.baseText("ndv.input.nodeDistance",{adjustToNumber:m.depth})),1))]),_:2},1032,["value","label"]))),128))]),_:1},8,["model-value","no-data-text","placeholder","onUpdate:modelValue"])):(c(),b("span",{key:1,class:D(e.$style.title)},T(e.$locale.baseText("ndv.input")),3)),e.isActiveNodeConfig&&!e.readOnly?(c(),O(l,{key:2,options:e.inputModes,"model-value":e.inputMode,"onUpdate:modelValue":e.onInputModeChange},null,8,["options","model-value","onUpdate:modelValue"])):E("",!0)],2)]),"node-not-run":w(()=>[e.isActiveNodeConfig&&e.rootNode||e.parentNodes.length?(c(),b("div",{key:0,class:D(e.$style.noOutputData)},[y(d,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.noOutputData.title")),1)]),_:1}),e.readOnly?E("",!0):(c(),O(p,{key:0,visible:e.showDraggableHint&&e.showDraggableHintWithDelay},{content:w(()=>[f("div",{innerHTML:e.$locale.baseText("dataMapping.dragFromPreviousHint",{interpolate:{name:e.focusedMappableInput}})},null,8,qu)]),default:w(()=>[y(h,{type:"secondary","hide-icon":"",transparent:!0,"node-name":e.isActiveNodeConfig?e.rootNode:e.currentNodeName,label:e.$locale.baseText("ndv.input.noOutputData.executePrevious"),"telemetry-source":"inputs","data-test-id":"execute-previous-node",onExecute:e.onNodeExecute},null,8,["node-name","label","onExecute"])]),_:1},8,["visible"])),e.readOnly?E("",!0):(c(),O(d,{key:1,tag:"div",size:"small"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.noOutputData.hint")),1)]),_:1}))],2)):(c(),b("div",{key:1,class:D(e.$style.notConnected)},[f("div",null,[y(g)]),y(d,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.notConnected.title")),1)]),_:1}),y(d,{tag:"div"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.notConnected.message"))+" ",1),f("a",{href:"https://docs.n8n.io/workflows/connections/",target:"_blank",onClick:t[1]||(t[1]=(...m)=>e.onConnectionHelpClick&&e.onConnectionHelpClick(...m))},T(e.$locale.baseText("ndv.input.notConnected.learnMore")),1)]),_:1})],2))]),"no-output-data":w(()=>[y(d,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("ndv.input.noOutputData")),1)]),_:1})]),"recovered-artificial-output-data":w(()=>[f("div",{class:D(e.$style.recoveredOutputData)},[y(d,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:w(()=>[I(T(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),y(d,null,{default:w(()=>[I(T(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.isMappingMode?{name:"before-data",fn:w(()=>[(c(),O(On("style"),null,{default:w(()=>[I("button.linkRun { display: none }")]),_:1})),f("div",{class:D(e.$style.mappedNode)},[y(r,{"model-value":e.mappedNode,size:"small",teleported:"","onUpdate:modelValue":e.onMappedNodeSelected,onClick:t[0]||(t[0]=se(()=>{},["stop"]))},{prepend:w(()=>[I(T(e.$locale.baseText("ndv.input.previousNode")),1)]),default:w(()=>[(c(!0),b(Z,null,re(e.rootNodesParents,m=>(c(),O(a,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])],2)]),key:"0"}:void 0]),1032,["node","run-index","linked-runs","can-link-runs","too-much-data-title","no-data-in-branch-message","is-executing","executing-message","session-id","override-outputs","mapping-enabled","distance-from-active","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onUnlinkRun","onRunChange"])}const Ju={$style:Yu},Xu=x(Vu,[["render",Gu],["__cssModules",Ju],["__scopeId","data-v-51727c96"]]),Qu=z({name:"TriggerPanel",components:{NodeExecuteButton:eo,CopyInput:ni,NodeIcon:tt},props:{nodeName:{type:String},sessionId:{type:String}},setup(){const e=ot();return{workflowHelpers:bt({router:e})}},data:()=>({executionsHelpEventBus:mn()}),computed:{...te(J,X,de,j),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},hideContent(){var e,t,o,n;if(!((e=this.nodeType)!=null&&e.triggerPanel))return!1;if((t=this.nodeType)!=null&&t.triggerPanel&&((o=this.nodeType)!=null&&o.triggerPanel.hasOwnProperty("hideContent"))){const s=(n=this.nodeType)==null?void 0:n.triggerPanel.hideContent;if(typeof s=="boolean")return s;if(this.node){const i=this.workflowHelpers.getCurrentWorkflow().expression.getSimpleParameterValue(this.node,s,"internal",{});if(typeof i=="boolean")return i}}return!1},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},serviceName(){return this.nodeType?ft(this.nodeType):""},displayChatButton(){return!!(this.node&&this.node.type===Qe&&this.node.parameters.mode!=="webhook")},isWebhookNode(){return!!(this.node&&this.node.type===_e)},webhookHttpMethod(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.workflowHelpers.getWebhookExpressionValue(this.nodeType.webhooks[0],"httpMethod")},webhookTestUrl(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.workflowHelpers.getWebhookUrl(this.nodeType.webhooks[0],this.node,"test")},isWebhookBasedNode(){var e,t;return!!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)},isPollingNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return!!this.node&&!this.node.disabled&&this.isWebhookBasedNode&&e&&(!t||t===this.nodeName)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isActivelyPolling(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&this.isPollingNode&&this.nodeName===e},isWorkflowActive(){return this.workflowsStore.isWorkflowActive},listeningTitle(){var e;return((e=this.nodeType)==null?void 0:e.name)===Me?this.$locale.baseText("ndv.trigger.webhookNode.formTrigger.listening"):this.$locale.baseText("ndv.trigger.webhookNode.listening")},listeningHint(){var e;switch((e=this.nodeType)==null?void 0:e.name){case Qe:return this.$locale.baseText("ndv.trigger.webhookBasedNode.chatTrigger.serviceHint");case Me:return this.$locale.baseText("ndv.trigger.webhookBasedNode.formTrigger.serviceHint");default:return this.$locale.baseText("ndv.trigger.webhookBasedNode.serviceHint",{interpolate:{service:this.serviceName}})}},header(){var t;const e=this.nodeType?ft(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingEvent"):(t=this.nodeType)!=null&&t.triggerPanel&&typeof this.nodeType.triggerPanel.header=="string"?this.nodeType.triggerPanel.header:this.isWebhookBasedNode?this.$locale.baseText("ndv.trigger.webhookBasedNode.action",{interpolate:{name:e}}):""},subheader(){const e=this.nodeType?ft(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingHint",{interpolate:{name:e}}):""},executionsHelp(){var e,t;if(((t=(e=this.nodeType)==null?void 0:e.triggerPanel)==null?void 0:t.executionsHelp)!==void 0){if(typeof this.nodeType.triggerPanel.executionsHelp=="string")return this.nodeType.triggerPanel.executionsHelp;if(!this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.inactive)return this.nodeType.triggerPanel.executionsHelp.inactive;if(this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.active)return this.nodeType.triggerPanel.executionsHelp.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):""},activationHint(){var e,t;if(this.isActivelyPolling)return"";if((t=(e=this.nodeType)==null?void 0:e.triggerPanel)!=null&&t.activationHint){if(typeof this.nodeType.triggerPanel.activationHint=="string")return this.nodeType.triggerPanel.activationHint;if(!this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.inactive=="string")return this.nodeType.triggerPanel.activationHint.inactive;if(this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.active=="string")return this.nodeType.triggerPanel.activationHint.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):""}},methods:{expandExecutionHelp(){this.$refs.help&&this.executionsHelpEventBus.emit("expand")},openWebhookUrl(){this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-chat"}),window.open(this.webhookTestUrl,"_blank","noreferrer")},onLinkClick(e){var o;if(!e.target)return;const t=e.target;t.localName==="a"&&(o=t.dataset)!=null&&o.key&&(e.stopPropagation(),e.preventDefault(),t.dataset.key==="activate"?this.$emit("activate"):t.dataset.key==="executions"?(this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-executions-log"}),this.ndvStore.activeNodeName=null,this.$router.push({name:K.EXECUTIONS})):t.dataset.key==="settings"&&this.uiStore.openModal(ss))},onTestLinkCopied(){this.$telemetry.track("User copied webhook URL",{pane:"inputs",type:"test url"})},onNodeExecute(){this.$emit("execute")}}}),Zu="_container_2vg29_5",ec="_header_2vg29_22",tc="_action_2vg29_29",oc="_shake_2vg29_33",nc="_accordion_2vg29_54",sc={container:Zu,header:ec,action:tc,shake:oc,accordion:nc},ic={key:"empty"},ac={key:"listening"},rc={key:0},lc={key:1},dc={key:0},uc={key:"default"},cc={key:0,class:"mb-xl"},hc=["textContent"],pc=["innerHTML"];function fc(e,t,o,n,s,i){const a=S("NodeIcon"),r=S("n8n-pulse"),l=S("n8n-text"),d=S("CopyInput"),h=S("NodeExecuteButton"),p=S("n8n-button"),g=S("n8n-spinner"),N=S("n8n-heading"),m=S("n8n-link"),C=S("n8n-info-accordion");return c(),b("div",{class:D(e.$style.container)},[y(Hi,{name:"fade",mode:"out-in"},{default:w(()=>[e.hasIssues||e.hideContent?(c(),b("div",ic)):e.isListeningForEvents?(c(),b("div",ac,[y(r,null,{default:w(()=>[y(a,{"node-type":e.nodeType,size:40},null,8,["node-type"])]),_:1}),e.isWebhookNode?(c(),b("div",rc,[y(l,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:w(()=>[I(T(e.$locale.baseText("ndv.trigger.webhookNode.listening")),1)]),_:1}),f("div",{class:D([e.$style.shake,"mb-xs"])},[y(l,null,{default:w(()=>[I(T(e.$locale.baseText("ndv.trigger.webhookNode.requestHint",{interpolate:{type:e.webhookHttpMethod}})),1)]),_:1})],2),y(d,{value:e.webhookTestUrl,"toast-title":e.$locale.baseText("ndv.trigger.copiedTestUrl"),class:"mb-2xl",size:"medium",collapse:!0,"copy-button-text":e.$locale.baseText("generic.clickToCopy"),onCopy:e.onTestLinkCopied},null,8,["value","toast-title","copy-button-text","onCopy"]),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])])):(c(),b("div",lc,[y(l,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:w(()=>[I(T(e.listeningTitle),1)]),_:1}),f("div",{class:D([e.$style.shake,"mb-xs"])},[y(l,{tag:"div"},{default:w(()=>[I(T(e.listeningHint),1)]),_:1})],2),e.displayChatButton?(c(),b("div",dc,[y(p,{class:"mb-xl",onClick:t[0]||(t[0]=u=>e.openWebhookUrl())},{default:w(()=>[I(T(e.$locale.baseText("ndv.trigger.chatTrigger.openChat")),1)]),_:1})])):E("",!0),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])]))])):(c(),b("div",uc,[e.isActivelyPolling?(c(),b("div",cc,[y(g,{type:"ring"})])):E("",!0),f("div",{class:D(e.$style.action)},[f("div",{class:D(e.$style.header)},[e.header?(c(),O(N,{key:0,tag:"h1",bold:""},{default:w(()=>[I(T(e.header),1)]),_:1})):E("",!0),e.subheader?(c(),O(l,{key:1},{default:w(()=>[f("span",{textContent:T(e.subheader)},null,8,hc)]),_:1})):E("",!0)],2),y(h,{"data-test-id":"trigger-execute-button","node-name":e.nodeName,size:"medium","telemetry-source":"inputs",onExecute:e.onNodeExecute},null,8,["node-name","onExecute"])],2),e.activationHint?(c(),O(l,{key:1,size:"small",onClick:e.onLinkClick},{default:w(()=>[f("span",{innerHTML:e.activationHint},null,8,pc),I(" ")]),_:1},8,["onClick"])):E("",!0),e.activationHint&&e.executionsHelp?(c(),O(m,{key:2,size:"small",onClick:e.expandExecutionHelp},{default:w(()=>[I(T(e.$locale.baseText("ndv.trigger.moreInfo")),1)]),_:1},8,["onClick"])):E("",!0),e.executionsHelp?(c(),O(C,{key:3,ref:"help",class:D(e.$style.accordion),title:e.$locale.baseText("ndv.trigger.executionsHint.question"),description:e.executionsHelp,"event-bus":e.executionsHelpEventBus,"onClick:body":e.onLinkClick},null,8,["class","title","description","event-bus","onClick:body"])):E("",!0)]))]),_:1})],2)}const gc={$style:sc},mc=x(Qu,[["render",fc],["__cssModules",gc],["__scopeId","data-v-4b3bae7d"]]),yc=z({name:"NodeDetailsView",components:{NodeSettings:kr,InputPanel:Xu,OutputPanel:Ou,NDVDraggablePanels:wl,TriggerPanel:mc},mixins:[Go],props:{readOnly:{type:Boolean},renaming:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1}},setup(e,t){var d,h;const o=X(),n=Ee(),s=We(),{activeNode:i}=kt(o),a=Se(i),r=ot(),l=bt({router:r});return{externalHooks:n,nodeHelpers:s,pinnedData:a,workflowHelpers:l,...De(),...Gt(),...(h=(d=Go).setup)==null?void 0:h.call(d,e,t)}},data(){return{settingsEventBus:mn(),redrawRequired:!1,runInputIndex:-1,runOutputIndex:-1,isLinkingEnabled:!0,selectedInput:void 0,triggerWaitingWarningEnabled:!1,isDragging:!1,mainPanelPosition:0,pinDataDiscoveryTooltipVisible:!1,avgInputRowHeight:0,avgOutputRowHeight:0,isInputPaneActive:!1,isOutputPaneActive:!1,isPairedItemHoveringEnabled:!0}},mounted(){ke.on("data-pinning-discovery",this.setIsTooltipVisible)},beforeUnmount(){ke.off("data-pinning-discovery",this.setIsTooltipVisible)},computed:{...te(J,X,de,j,yn),sessionId(){return this.ndvStore.sessionId},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},showTriggerWaitingWarning(){return this.triggerWaitingWarningEnabled&&!!this.activeNodeType&&!this.activeNodeType.group.includes("trigger")&&this.workflowRunning&&this.workflowsStore.executionWaitingForWebhook},activeNode(){return this.ndvStore.activeNode},inputNodeName(){return this.selectedInput||this.parentNode},inputNode(){return this.inputNodeName?this.workflowsStore.getNodeByName(this.inputNodeName):null},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},showTriggerPanel(){var n,s,i,a,r;const e=!!((n=this.activeNodeType)!=null&&n.triggerPanel);if(typeof((s=this.activeNodeType)==null?void 0:s.triggerPanel)=="boolean")return e;const t=!!((a=(i=this.activeNodeType)==null?void 0:i.webhooks)!=null&&a.length),o=(r=this.activeNodeType)==null?void 0:r.polling;return!this.readOnly&&this.isTriggerNode&&(t||o||e)},workflow(){return this.workflowHelpers.getCurrentWorkflow()},hasOutputConnection(){var t,o;if(!this.activeNode)return!1;const e=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);return(((o=(t=Object.values(e))==null?void 0:t[0])==null?void 0:o[0])??[]).length>0},parentNodes(){return this.activeNode?this.workflow.getParentNodesByDepth(this.activeNode.name,1).map(({name:e})=>e)||[]:[]},parentNode(){var e;for(const t of this.parentNodes)if(this.workflowsStore.pinnedWorkflowData[t]||(e=this.workflowRunData)!=null&&e[t])return t;return this.parentNodes[0]},isExecutableTriggerNode(){return this.activeNodeType?is.includes(this.activeNodeType.name):!1},isTriggerNode(){return!!this.activeNodeType&&(this.activeNodeType.group.includes("trigger")||this.activeNodeType.name===Ht)},isActiveStickyNode(){return!!this.ndvStore.activeNode&&this.ndvStore.activeNode.type===ce},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},maxOutputRun(){if(this.activeNode===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.activeNode.name)?0:e[this.activeNode.name].length?e[this.activeNode.name].length-1:0},outputRun(){return this.runOutputIndex===-1?this.maxOutputRun:Math.min(this.runOutputIndex,this.maxOutputRun)},maxInputRun(){if(this.inputNode===null||this.activeNode===null)return 0;const e=this.workflow.getNode(this.activeNode.name),t=Te(this.workflow,e,this.activeNodeType);let o=this.inputNode;const n=this.workflowRunData;return t.some(s=>s!==M.Main)&&(o=this.activeNode),!o||!n||!n.hasOwnProperty(o.name)?0:n[o.name].length?n[o.name].length-1:0},inputRun(){return this.isLinkingEnabled&&this.maxOutputRun===this.maxInputRun?this.outputRun:this.runInputIndex===-1?this.maxInputRun:Math.min(this.runInputIndex,this.maxInputRun)},canLinkRuns(){return this.maxOutputRun>0&&this.maxOutputRun===this.maxInputRun},linked(){return this.isLinkingEnabled&&this.canLinkRuns},inputPanelMargin(){return this.isTriggerNode?0:80},featureRequestUrl(){return this.activeNodeType?`${as}${this.activeNodeType.name}`:""},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isWorkflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isExecutionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},blockUi(){return this.isWorkflowRunning||this.isExecutionWaitingForWebhook},foreignCredentials(){const e=(this.activeNode||{}).credentials,t=this.workflowsStore.usedCredentials,o=[];return e&&this.settingsStore.isEnterpriseFeatureEnabled(wn.Sharing)&&Object.values(e).forEach(n=>{n.id&&t[n.id]&&!t[n.id].currentUserHasAccess&&o.push(n.id)}),o},hasForeignCredential(){return this.foreignCredentials.length>0}},watch:{activeNode(e,t){e&&e.name!==(t==null?void 0:t.name)&&!this.isActiveStickyNode&&(this.runInputIndex=-1,this.runOutputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=void 0,this.triggerWaitingWarningEnabled=!1,this.avgOutputRowHeight=0,this.avgInputRowHeight=0,setTimeout(()=>this.ndvStore.setNDVSessionId(),0),this.externalHooks.run("dataDisplay.nodeTypeChanged",{nodeSubtitle:this.nodeHelpers.getNodeSubtitle(e,this.activeNodeType,this.workflowHelpers.getCurrentWorkflow())}),setTimeout(()=>{var o;if(this.activeNode){const n=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);this.$telemetry.track("User opened node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,is_editable:!this.hasForeignCredential,parameters_pane_position:this.mainPanelPosition,input_first_connector_runs:this.maxInputRun,output_first_connector_runs:this.maxOutputRun,selected_view_inputs:this.isTriggerNode?"trigger":this.ndvStore.inputPanelDisplayMode,selected_view_outputs:this.ndvStore.outputPanelDisplayMode,input_connectors:this.parentNodes.length,output_connectors:(o=n==null?void 0:n.main)==null?void 0:o.length,input_displayed_run_index:this.inputRun,output_displayed_run_index:this.outputRun,data_pinning_tooltip_presented:this.pinDataDiscoveryTooltipVisible,input_displayed_row_height_avg:this.avgInputRowHeight,output_displayed_row_height_avg:this.avgOutputRowHeight})}},2e3)),window.top&&!this.isActiveStickyNode&&window.top.postMessage(JSON.stringify({command:e?"openNDV":"closeNDV"}),"*")},maxOutputRun(){this.runOutputIndex=-1},maxInputRun(){this.runInputIndex=-1},inputNodeName(e){setTimeout(()=>{this.ndvStore.setInputNodeName(e)},0)},inputRun(){setTimeout(()=>{this.ndvStore.setInputRunIndex(this.inputRun)},0)}},methods:{setIsTooltipVisible({isTooltipVisible:e}){this.pinDataDiscoveryTooltipVisible=e},onKeyDown(e){if(e.key==="s"&&this.isCtrlKeyPressed(e)){if(e.stopPropagation(),e.preventDefault(),this.readOnly)return;this.$emit("saveKeyboardShortcut",e)}},onInputItemHover(e){if(e===null||!this.inputNodeName||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.inputNodeName,runIndex:this.inputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onOutputItemHover(e){if(e===null||!this.activeNode||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.activeNode.name,runIndex:this.outputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onInputTableMounted(e){this.avgInputRowHeight=e.avgRowHeight},onOutputTableMounted(e){this.avgOutputRowHeight=e.avgRowHeight},onWorkflowActivate(){this.ndvStore.activeNodeName=null,setTimeout(()=>{this.activateCurrentWorkflow("ndv")},1e3)},onFeatureRequestClick(){window.open(this.featureRequestUrl,"_blank"),this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:M.Main,type:"i-wish-this-node-would"})},onPanelsInit(e){this.mainPanelPosition=e.position},onDragStart(e){this.isDragging=!0,this.mainPanelPosition=e.position},onDragEnd(e){this.isDragging=!1,this.$telemetry.track("User moved parameters pane",{window_width:e.windowWidth,start_position:this.mainPanelPosition,end_position:e.position,node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.mainPanelPosition=e.position},onLinkRunToInput(){this.runOutputIndex=this.runInputIndex,this.isLinkingEnabled=!0,this.trackLinking("input")},onLinkRunToOutput(){this.isLinkingEnabled=!0,this.trackLinking("output")},onUnlinkRun(e){this.runInputIndex=this.runOutputIndex,this.isLinkingEnabled=!1,this.trackLinking(e)},trackLinking(e){this.$telemetry.track("User changed ndv run linking",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,linked:this.linked,pane:e})},onNodeExecute(){setTimeout(()=>{!this.activeNode||!this.workflowRunning||(this.triggerWaitingWarningEnabled=!0)},1e3)},openSettings(){this.settingsEventBus.emit("openSettings")},valueChanged(e){this.$emit("valueChanged",e)},nodeTypeSelected(e){this.$emit("nodeTypeSelected",e)},onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},onOpenConnectionNodeCreator(e,t){this.$emit("openConnectionNodeCreator",e,t)},async close(){var e,t;if(!this.isDragging){if(this.activeNode&&(typeof((e=this.activeNodeType)==null?void 0:e.outputs)=="string"||typeof((t=this.activeNodeType)==null?void 0:t.inputs)=="string"||this.redrawRequired)){const o=this.activeNode.name;setTimeout(()=>{this.$emit("redrawNode",o)},1)}if(this.outputPanelEditMode.enabled&&this.activeNode){if(await this.confirm("",this.$locale.baseText("ndv.pinData.beforeClosing.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.cancel")})===xe){const{value:n}=this.outputPanelEditMode;try{this.pinnedData.setData(Nt(n),"on-ndv-close-modal")}catch(s){console.error(s)}}this.ndvStore.setOutputPanelEditModeEnabled(!1)}await this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.$telemetry.track("User closed node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.triggerWaitingWarningEnabled=!1,this.ndvStore.activeNodeName=null,this.ndvStore.resetNDVSessionId()}},onRunOutputIndexChange(e){this.runOutputIndex=e,this.trackRunChange(e,"output")},onRunInputIndexChange(e){this.runInputIndex=e,this.linked&&(this.runOutputIndex=e),this.trackRunChange(e,"input")},trackRunChange(e,t){this.$telemetry.track("User changed ndv run dropdown",{session_id:this.sessionId,run_index:e,node_type:this.activeNodeType?this.activeNodeType.name:"",pane:t})},onInputNodeChange(e,t){this.runInputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=e,this.$telemetry.track("User changed ndv input dropdown",{node_type:this.activeNode?this.activeNode.type:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId,selection_value:t,input_node_type:this.inputNode?this.inputNode.type:""})},onStopExecution(){this.$emit("stopExecution")},activateInputPane(){this.isInputPaneActive=!0,this.isOutputPaneActive=!1},activateOutputPane(){this.isInputPaneActive=!1,this.isOutputPaneActive=!0},onSearch(e){this.isPairedItemHoveringEnabled=!e}}}),wc="_modalBackground_17uio_5",vc="_triggerWarning_17uio_10",Nc="_backToCanvas_17uio_14",kc="_featureRequest_17uio_35",bc={modalBackground:wc,triggerWarning:vc,backToCanvas:Nc,featureRequest:kc};function Tc(e,t,o,n,s,i){const a=S("n8n-icon"),r=S("n8n-text"),l=S("n8n-tooltip"),d=S("TriggerPanel"),h=S("InputPanel"),p=S("OutputPanel"),g=S("NodeSettings"),N=S("font-awesome-icon"),m=S("NDVDraggablePanels"),C=S("el-dialog");return c(),O(C,{"model-value":(!!e.activeNode||e.renaming)&&!e.isActiveStickyNode,"before-close":e.close,"show-close":!1,class:"data-display-wrapper ndv-wrapper","overlay-class":"data-display-overlay",width:"auto","append-to-body":"","data-test-id":"ndv","data-has-output-connection":e.hasOutputConnection},{default:w(()=>{var u;return[y(l,{placement:"bottom-start",visible:e.showTriggerWaitingWarning,disabled:!e.showTriggerWaitingWarning},{content:w(()=>[f("div",{class:D(e.$style.triggerWarning)},T(e.$locale.baseText("ndv.backToCanvas.waitingForTriggerWarning")),3)]),default:w(()=>[f("div",{class:D(e.$style.backToCanvas),"data-test-id":"back-to-canvas",onClick:t[0]||(t[0]=(...k)=>e.close&&e.close(...k))},[y(a,{icon:"arrow-left",color:"text-xlight",size:"medium"}),y(r,{color:"text-xlight",size:"medium",bold:!0},{default:w(()=>[I(T(e.$locale.baseText("ndv.backToCanvas")),1)]),_:1})],2)]),_:1},8,["visible","disabled"]),e.activeNode?(c(),b("div",{key:0,ref:"container",class:"data-display",tabindex:"0",onKeydownCapture:t[6]||(t[6]=(...k)=>e.onKeyDown&&e.onKeyDown(...k))},[f("div",{class:D(e.$style.modalBackground),onClick:t[1]||(t[1]=(...k)=>e.close&&e.close(...k))},null,2),(c(),O(m,{key:e.activeNode.name,"is-trigger-node":e.isTriggerNode,"hide-input-and-output":e.activeNodeType===null,position:e.isTriggerNode&&!e.showTriggerPanel?0:void 0,"is-draggable":!e.isTriggerNode,"has-double-width":((u=e.activeNodeType)==null?void 0:u.parameterPane)==="wide","node-type":e.activeNodeType,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator,onClose:e.close,onInit:e.onPanelsInit,onDragstart:e.onDragStart,onDragend:e.onDragEnd},Qt({output:w(()=>[y(p,{"data-test-id":"output-panel","can-link-runs":e.canLinkRuns,"run-index":e.outputRun,"linked-runs":e.linked,"session-id":e.sessionId,"is-read-only":e.readOnly||e.hasForeignCredential,"block-u-i":e.blockUi&&e.isTriggerNode&&!e.isExecutableTriggerNode,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isOutputPaneActive,onActivatePane:e.activateOutputPane,onLinkRun:e.onLinkRunToOutput,onUnlinkRun:t[3]||(t[3]=()=>e.onUnlinkRun("output")),onRunChange:e.onRunOutputIndexChange,onOpenSettings:e.openSettings,onTableMounted:e.onOutputTableMounted,onItemHover:e.onOutputItemHover,onSearch:e.onSearch},null,8,["can-link-runs","run-index","linked-runs","session-id","is-read-only","block-u-i","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onTableMounted","onItemHover","onSearch"])]),main:w(()=>[y(g,{"event-bus":e.settingsEventBus,dragging:e.isDragging,"session-id":e.sessionId,"node-type":e.activeNodeType,"foreign-credentials":e.foreignCredentials,"read-only":e.readOnly,"block-u-i":e.blockUi&&e.showTriggerPanel,executable:!e.readOnly,onValueChanged:e.valueChanged,onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution,onRedrawRequired:t[4]||(t[4]=k=>e.redrawRequired=!0),onActivate:e.onWorkflowActivate,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator},null,8,["event-bus","dragging","session-id","node-type","foreign-credentials","read-only","block-u-i","executable","onValueChanged","onExecute","onStopExecution","onActivate","onSwitchSelectedNode","onOpenConnectionNodeCreator"]),e.featureRequestUrl?(c(),b("a",{key:0,class:D(e.$style.featureRequest),target:"_blank",onClick:t[5]||(t[5]=(...k)=>e.onFeatureRequestClick&&e.onFeatureRequestClick(...k))},[y(N,{icon:"lightbulb"}),I(" "+T(e.$locale.baseText("ndv.featureRequest")),1)],2)):E("",!0)]),_:2},[e.showTriggerPanel||!e.isTriggerNode?{name:"input",fn:w(()=>[e.showTriggerPanel?(c(),O(d,{key:0,"node-name":e.activeNode.name,"session-id":e.sessionId,onExecute:e.onNodeExecute,onActivate:e.onWorkflowActivate},null,8,["node-name","session-id","onExecute","onActivate"])):e.isTriggerNode?E("",!0):(c(),O(h,{key:1,workflow:e.workflow,"can-link-runs":e.canLinkRuns,"run-index":e.inputRun,"linked-runs":e.linked,"current-node-name":e.inputNodeName,"session-id":e.sessionId,"read-only":e.readOnly||e.hasForeignCredential,"is-production-execution-preview":e.isProductionExecutionPreview,"is-pane-active":e.isInputPaneActive,onActivatePane:e.activateInputPane,onLinkRun:e.onLinkRunToInput,onUnlinkRun:t[2]||(t[2]=()=>e.onUnlinkRun("input")),onRunChange:e.onRunInputIndexChange,onOpenSettings:e.openSettings,onChangeInputNode:e.onInputNodeChange,onExecute:e.onNodeExecute,onTableMounted:e.onInputTableMounted,onItemHover:e.onInputItemHover,onSearch:e.onSearch},null,8,["workflow","can-link-runs","run-index","linked-runs","current-node-name","session-id","read-only","is-production-execution-preview","is-pane-active","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onChangeInputNode","onExecute","onTableMounted","onItemHover","onSearch"]))]),key:"0"}:void 0]),1032,["is-trigger-node","hide-input-and-output","position","is-draggable","has-double-width","node-type","onSwitchSelectedNode","onOpenConnectionNodeCreator","onClose","onInit","onDragstart","onDragend"]))],544)):E("",!0)]}),_:1},8,["model-value","before-close","data-has-output-connection"])}const Sc={$style:bc},Dc=x(yc,[["render",Tc],["__cssModules",Sc]]),Ec=z({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const o=nt(),{position:n,isOpen:s,actions:i,target:a}=o,r=F(),l=t;Xt(s,()=>{var p,g;s?(p=r.value)==null||p.open():(g=r.value)==null||g.close()},{flush:"post"});function d(p){const g=p;o._dispatchAction(g),l("action",g,o.targetNodes.value)}function h(p){p||o.close()}return(p,g)=>L(s)?(c(),O(Pn,{key:0,to:"body"},[f("div",{class:D(p.$style.contextMenu),style:ee({left:`${L(n)[0]}px`,top:`${L(n)[1]}px`})},[y(L(rs),{ref_key:"dropdown",ref:r,items:L(i),placement:"bottom-start","data-test-id":"context-menu","hide-arrow":L(a).source!=="node-button",onSelect:d,onVisibleChange:h},{activator:w(()=>[f("div",{class:D(p.$style.activator)},null,2)]),_:1},8,["items","hide-arrow"])],6)])):E("",!0)}}),Cc="_contextMenu_2nizv_5",Ic="_activator_2nizv_9",Pc={contextMenu:Cc,activator:Ic},Oc={$style:Pc},$c=x(Ec,[["__cssModules",Oc]]),Rc=(e,t)=>{const o=cs.includes(e);return{type:"N8nAddInput",options:{width:24,height:72,color:t,multiple:o}}},_c=()=>({type:"Rectangle",options:{height:10,width:10,cssClass:"diamond-output-endpoint"}}),Wn=z({data(){return{inputs:[],outputs:[]}},mounted(){if(this.data!==null)try{this.__addNode(this.data)}catch{}},computed:{...te(J,de,jt,j,Jt),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""}},props:{name:{type:String,required:!0},instance:{type:Object},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean},workflow:{type:Object,required:!0}},methods:{__addEndpointTestingData(e,t,o){if(window!=null&&window.Cypress&&"canvas"in e.endpoint){const n=e.endpoint.canvas;this.instance.setAttribute(n,"data-endpoint-name",this.data.name),this.instance.setAttribute(n,"data-input-index",o.toString()),this.instance.setAttribute(n,"data-endpoint-type",t)}},__addInputEndpoints(e,t){const o={},n={},s=fe(this.workflow,this.data,t)||[];this.inputs=s;const i=[...s];i.sort((a,r)=>typeof a=="string"?1:typeof r=="string"||a.required&&!r.required?-1:!a.required&&r.required?1:0),i.forEach((a,r)=>{var A,$;let l;typeof a=="string"?l={type:a}:l=a;const d=l.type,h=d===M.Main?M.Main:"other";o.hasOwnProperty(h)?o[h]++:o[h]=0,n.hasOwnProperty(d)?n[d]++:n[d]=0;const p=o[h],g=n[d],N=s.filter(B=>{const U=typeof B=="string"?B:B.type;return d===M.Main?U===M.Main:U!==M.Main}),m=N.filter(B=>B!==M.Main),C=m.filter(B=>typeof B!="string"&&B.required),u=m.filter(B=>typeof B!="string"&&!B.required),k=this.getSpacerIndexes(C.length,u.length),v=Wo(d,"input",N.length,k)[p],P=Bt(d),_={uuid:Sn(this.nodeId,d,g),anchor:v,maxConnections:l.maxConnections??-1,endpoint:"Rectangle",paintStyle:Ct(t,"--color-foreground-xdark",d),hoverPaintStyle:Ct(t,"--color-primary",d),scope:si(P),source:d!==M.Main,target:!this.isReadOnly&&s.length>1,parameters:{connection:"target",nodeId:this.nodeId,type:d,index:g},enabled:!this.isReadOnly,cssClass:"rect-input-endpoint",dragAllowedWhenFull:!0,hoverClass:"rect-input-endpoint-hover",...this.__getInputConnectionStyle(d,t)},R=(A=this.instance)==null?void 0:A.addEndpoint(this.$refs[this.data.name],_);this.__addEndpointTestingData(R,"input",g),(l.displayName||($=t.inputNames)!=null&&$[r])&&R.addOverlay(ii(l.displayName||t.inputNames[r],d,l.required)),Array.isArray(R)||(R.__meta={nodeName:e.name,nodeId:this.nodeId,index:g,totalEndpoints:N.length,nodeType:e.type})}),i.length===0&&this.instance.manage(this.$refs[this.data.name])},getSpacerIndexes(e,t,o=ls,n=ds){const s=[];if(e>0&&t>0){if(o)s.push(e);else if(e+t<n)for(let i=e;i<n-t;i++)s.push(i)}else if(e>0&&e<n&&t===0)for(let i=0;i<n-e;i++)s.push(i+e);else if(e===0&&t>0&&t<n)for(let i=0;i<n-t;i++)s.push(i);return s},__addOutputEndpoints(e,t){const o={},n={};this.outputs=Te(this.workflow,this.data,t)||[];let s=0;const i=[];this.outputs.forEach((r,l)=>{var h;let d;typeof r=="string"?d={type:r}:d=r,(h=t.outputNames)!=null&&h[l]&&(d.displayName=t.outputNames[l]),d.displayName&&(s=d.displayName.length>s?d.displayName.length:s),i.push(d)});const a=s<4?"short":"medium";this.outputs.forEach((r,l)=>{const d=i[l],h=d.type,p=h===M.Main?M.Main:"other";o.hasOwnProperty(p)?o[p]++:o[p]=0,n.hasOwnProperty(h)?n[h]++:n[h]=0;const g=o[p],N=n[h],m=this.outputs.filter(P=>{const _=typeof P=="string"?P:P.type;return h===M.Main?_===M.Main:_!==M.Main}),C=Wo(h,"output",m.length)[g],u=Bt(h),k={uuid:Ut(this.nodeId,h,N),anchor:C,maxConnections:-1,endpoint:{type:"Dot",options:{radius:t&&m.length>2?7:9}},hoverPaintStyle:je(t,"--color-primary"),scope:u,source:!0,target:h!==M.Main,enabled:!this.isReadOnly,parameters:{connection:"source",nodeId:this.nodeId,type:h,index:N},hoverClass:"dot-output-endpoint-hover",connectionsDirected:!0,dragAllowedWhenFull:!1,...this.__getOutputConnectionStyle(h,d,t)},v=this.instance.addEndpoint(this.$refs[this.data.name],k);if(this.__addEndpointTestingData(v,"output",N),d.displayName){const P=ai(d.displayName,h,d==null?void 0:d.category);v.addOverlay(P)}if(Array.isArray(v)||(v.__meta={nodeName:e.name,nodeId:this.nodeId,index:N,totalEndpoints:m.length,endpointLabelLength:a}),!this.isReadOnly&&h===M.Main){const P={uuid:Ut(this.nodeId,h,N),anchor:C,maxConnections:-1,endpoint:{type:"N8nPlus",options:{dimensions:24,connectedEndpoint:v,showOutputLabel:this.outputs.length===1,size:this.outputs.length>=3?"small":"medium",endpointLabelLength:a,hoverMessage:this.$locale.baseText("nodeBase.clickToAddNodeOrDragToConnect")}},source:!0,target:!1,enabled:!this.isReadOnly,paintStyle:{outlineStroke:"none"},hoverPaintStyle:{outlineStroke:"none"},parameters:{connection:"source",nodeId:this.nodeId,type:h,index:N,category:d==null?void 0:d.category},cssClass:"plus-draggable-endpoint",dragAllowedWhenFull:!1};d!=null&&d.category&&(P.cssClass=`${P.cssClass} ${d==null?void 0:d.category}`);const _=this.instance.addEndpoint(this.$refs[this.data.name],P);this.__addEndpointTestingData(_,"plus",N),Array.isArray(_)||(_.__meta={nodeName:e.name,nodeId:this.nodeId,index:N,nodeType:e.type,totalEndpoints:m.length})}})},__addNode(e){const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion)??this.nodeTypesStore.getNodeType(us);this.__addInputEndpoints(e,t),this.__addOutputEndpoints(e,t)},__getEndpointColor(e){return`--node-type-${e}-color`},__getInputConnectionStyle(e,t){return e===M.Main?{paintStyle:Ct(t,this.__getEndpointColor(M.Main),e)}:Object.values(M).includes(e)?(n=>({endpoint:Rc(n,this.__getEndpointColor(n))}))(e):{}},__getOutputConnectionStyle(e,t,o){const n="output",s=i=>({endpoint:_c(),paintStyle:je(o,this.__getEndpointColor(i)),hoverPaintStyle:je(o,this.__getEndpointColor(i))});return e===M.Main?t.category==="error"?{paintStyle:{...je(o,this.__getEndpointColor(M.Main)),fill:"var(--node-error-output-color)"},cssClass:`dot-${n}-endpoint`}:{paintStyle:je(o,this.__getEndpointColor(M.Main)),cssClass:`dot-${n}-endpoint`}:Object.values(M).includes(e)?s(e):{}},touchEnd(e){De().isTouchDevice&&this.uiStore.isActionActive("dragActive")&&this.uiStore.removeActiveAction("dragActive")},mouseLeftClick(e){const t=De(),o=e.path||e.composedPath&&e.composedPath();for(let n=0;n<o.length;n++)if(o[n].className&&typeof o[n].className=="string"&&o[n].className.includes("no-select-on-click"))return;t.isTouchDevice||(this.uiStore.isActionActive("dragActive")?this.uiStore.removeActiveAction("dragActive"):(t.isCtrlKeyPressed(e)||this.$emit("deselectAllNodes"),this.uiStore.isNodeSelected(this.data.name)?this.$emit("deselectNode",this.name):this.$emit("nodeSelected",this.name)))}}}),Ac=z({name:"Node",components:{TitledList:Vt,FontAwesomeIcon:hs,NodeIcon:tt},mixins:[Wn],props:{isProductionExecutionPreview:{type:Boolean,default:!1},disablePointerEvents:{type:Boolean,default:!1},hideNodeIssues:{type:Boolean,default:!1}},setup(e){const t=j(),o=nt(),n=Ee(),s=We(),i=t.getNodeByName(e.name),a=Se(i),r=De(),{callDebounced:l}=vt();return{contextMenu:o,externalHooks:n,nodeHelpers:s,pinnedData:a,deviceSupport:r,callDebounced:l}},computed:{...te(J,X,de,j),showPinnedDataInfo(){return this.pinnedData.hasData.value&&!this.isProductionExecutionPreview},isDuplicatable(){return this.nodeType?dn.includes(this.nodeType.name)?!1:this.nodeType.maxNodes===void 0||this.sameTypeNodes.length<this.nodeType.maxNodes:!0},isScheduledGroup(){var e;return((e=this.nodeType)==null?void 0:e.group.includes("schedule"))===!0},iconColorDefault(){if(this.isConfigNode)return"var(--color-text-base)"},nodeRunData(){var e;return this.workflowsStore.getWorkflowResultDataByNodeName(((e=this.data)==null?void 0:e.name)||"")||[]},hasIssues(){var e;return this.nodeExecutionStatus&&["crashed","error","failed"].includes(this.nodeExecutionStatus)?!0:this.pinnedData.hasData.value?!1:!!(((e=this.data)==null?void 0:e.issues)!==void 0&&Object.keys(this.data.issues).length)},workflowDataItems(){const e=this.nodeRunData;return e===null?0:e.length},canvasOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},getTriggerNodeTooltip(){if(this.nodeType!==null&&this.nodeType.hasOwnProperty("eventTriggerDescription")){const e=this.$locale.shortNodeType(this.nodeType.name),{eventTriggerDescription:t}=this.nodeType;return this.$locale.nodeText().eventTriggerDescription(e,t||"")}else return this.$locale.baseText("node.waitingForYouToCreateAnEventIn",{interpolate:{nodeType:this.nodeType?ft(this.nodeType):""}})},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isExecuting(){return this.workflowsStore.isNodeExecuting(this.data.name)},isSingleActiveTriggerNode(){return this.workflowsStore.workflowTriggerNodes.filter(t=>{const o=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);return o&&o.eventTriggerDescription!==""&&!t.disabled}).length===1},isManualTypeNode(){return this.data.type===Ze},isConfigNode(){var e;return this.nodeTypesStore.isConfigNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??"")},isConfigurableNode(){var e;return this.nodeTypesStore.isConfigurableNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??"")},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode(((e=this.data)==null?void 0:e.type)||"")},isTriggerNodeTooltipEmpty(){return this.nodeType!==null?this.nodeType.eventTriggerDescription==="":!1},isNodeDisabled(){return this.node&&this.node.disabled},nodeType(){return this.data&&this.nodeTypesStore.getNodeType(this.data.type,this.data.typeVersion)},node(){return this.workflowsStore.nodesByName[this.name]},sameTypeNodes(){return this.workflowsStore.allNodes.filter(e=>e.type===this.data.type)},nodeWrapperClass(){const e={"node-wrapper":!0,"node-wrapper--trigger":this.isTriggerNode,"node-wrapper--configurable":this.isConfigurableNode,"node-wrapper--config":this.isConfigNode};if(this.outputs.length){const o=ge(this.outputs).filter(n=>n!==M.Main);o.length&&o.forEach(n=>{e[`node-wrapper--connection-type-${n}`]=!0})}return e},nodeWrapperStyles(){const e={left:this.position[0]+"px",top:this.position[1]+"px"};if(this.node&&this.nodeType){const t=fe(this.workflow,this.node,this.nodeType)||[],n=ge(t).filter(r=>r!==M.Main);if(n.length){t.filter(l=>typeof l!="string"&&l.required);let r=0;e["--configurable-node-input-count"]=n.length+r}let s=[];this.workflow.nodes[this.node.name]&&(s=Te(this.workflow,this.node,this.nodeType));const a=ge(s).filter(r=>r===M.Main);e["--node-main-output-count"]=a.length}return e},nodeClass(){return{"node-box":!0,disabled:this.data.disabled,executing:this.isExecuting}},nodeExecutionStatus(){var t;const e=(t=this.workflowsStore.getWorkflowRunData)==null?void 0:t[this.name];return e?e.filter(Boolean)[0].executionStatus??"":""},nodeIssues(){var o,n;const e=[],t=(o=this.workflowsStore.getWorkflowRunData)==null?void 0:o[this.name];return t&&t.forEach(s=>{s!=null&&s.error&&e.push(`${s.error.message}${s.error.description?` (${s.error.description})`:""}`)}),((n=this.data)==null?void 0:n.issues)!==void 0&&e.push(...pn(this.data.issues,this.data)),e},nodeDisabledTitle(){return this.data.disabled?this.$locale.baseText("node.enable"):this.$locale.baseText("node.disable")},position(){return this.node?this.node.position:[0,0]},showDisabledLinethrough(){return!this.isConfigurableNode&&!!(this.data.disabled&&this.inputs.length===1&&this.outputs.length===1)},shortNodeType(){return this.$locale.shortNodeType(this.data.type)},nodeTitle(){return this.data.name==="Start"?this.$locale.headerText({key:"headers.start.displayName",fallback:"Start"}):this.data.name},waiting(){const e=this.workflowsStore.getWorkflowExecution;if(e!=null&&e.waitTill){const t=ye(e,"data.resultData.lastNodeExecuted");if(this.name===t){const o=new Date(e.waitTill);return o.toISOString()===ps?this.$locale.baseText("node.theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall"):this.$locale.baseText("node.nodeIsWaitingTill",{interpolate:{date:o.toLocaleDateString(),time:o.toLocaleTimeString()}})}}},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},nodeStyle(){var o,n,s;const e={};let t="--color-foreground-xdark";return(this.isConfigurableNode||this.isConfigNode)&&(t="--color-foreground-dark"),this.data.disabled?t="--color-foreground-base":this.isExecuting||(this.hasIssues&&!this.hideNodeIssues?((s=(n=(o=this.nodeRunData)==null?void 0:o[0])==null?void 0:n.error)==null?void 0:s.functionality)!=="configuration-node"&&(t="--color-danger",e["border-width"]="2px",e["border-style"]="solid"):this.waiting||this.showPinnedDataInfo?t="--color-canvas-node-pinned-border":this.nodeExecutionStatus==="unknown"?t="--color-foreground-xdark":this.workflowDataItems&&(e["border-width"]="2px",e["border-style"]="solid",t="--color-success")),e["border-color"]=`var(${t})`,e},isSelected(){return this.uiStore.getSelectedNodes.find(e=>e.name===this.data.name)!==void 0},shiftOutputCount(){return!!(this.nodeType&&this.outputs.length>2)},shouldShowTriggerTooltip(){return!!this.node&&this.isTriggerNode&&!this.isPollingTypeNode&&!this.pinnedData.hasData.value&&!this.isNodeDisabled&&this.workflowRunning&&this.workflowDataItems===0&&this.isSingleActiveTriggerNode&&!this.isTriggerNodeTooltipEmpty&&!this.hasIssues&&!this.dragging},isContextMenuOpen(){var e;return this.contextMenu.isOpen.value&&this.contextMenu.target.value.source==="node-button"&&this.contextMenu.target.value.node.name===((e=this.data)==null?void 0:e.name)}},watch:{isActive(e,t){!e&&t&&this.setSubtitle()},canvasOffsetPosition(){this.showTriggerNodeTooltip&&(this.showTriggerNodeTooltip=!1,setTimeout(()=>{this.showTriggerNodeTooltip=this.shouldShowTriggerTooltip},200)),this.pinDataDiscoveryTooltipVisible&&(this.pinDataDiscoveryTooltipVisible=!1,setTimeout(()=>{this.pinDataDiscoveryTooltipVisible=!0},200))},shouldShowTriggerTooltip(e){e?setTimeout(()=>{this.showTriggerNodeTooltip=this.shouldShowTriggerTooltip},2500):this.showTriggerNodeTooltip=!1},nodeRunData(e){this.data&&this.$emit("run",{name:this.data.name,data:e,waiting:!!this.waiting})}},created(){Ae(Mt).value||(this.unwatchWorkflowDataItems=this.$watch("workflowDataItems",t=>{this.showPinDataDiscoveryTooltip(t)}))},mounted(){setTimeout(()=>{this.setSubtitle()},0),this.nodeRunData&&setTimeout(()=>{this.$emit("run",{name:this.data&&this.data.name,data:this.nodeRunData,waiting:!!this.waiting})},0)},data(){return{isTouchActive:!1,nodeSubtitle:"",showTriggerNodeTooltip:!1,pinDataDiscoveryTooltipVisible:!1,dragging:!1,unwatchWorkflowDataItems:()=>{}}},methods:{showPinDataDiscoveryTooltip(e){!this.isTriggerNode||this.isManualTypeNode||this.isScheduledGroup||this.uiStore.isModalActive||e===0||(Ae(Mt).value="true",this.pinDataDiscoveryTooltipVisible=!0,this.unwatchWorkflowDataItems())},setSubtitle(){try{const e=this.nodeHelpers.getNodeSubtitle(this.data,this.nodeType,this.workflow)||"";this.nodeSubtitle=e.includes(fs)?"":e}catch{}},disableNode(){this.data!==null&&(this.nodeHelpers.disableNodes([this.data]),this.historyStore.pushCommandToUndo(new ri(this.data.name,!this.data.disabled,this.data.disabled===!0)),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"disable",workflow_id:this.workflowsStore.workflowId}))},executeNode(){this.$emit("runWorkflow",this.data.name,"Node.executeNode"),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"execute",workflow_id:this.workflowsStore.workflowId})},deleteNode(){this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"delete",workflow_id:this.workflowsStore.workflowId}),this.$emit("removeNode",this.data.name)},toggleDisableNode(e){e.currentTarget.blur(),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"disable",workflow_id:this.workflowsStore.workflowId}),this.$emit("toggleDisableNode",this.data)},onClick(e){this.callDebounced(this.onClickDebounced,{debounceTime:50,trailing:!0},e)},onClickDebounced(e){e.detail>=2?this.setNodeActive():this.mouseLeftClick(e)},setNodeActive(){this.ndvStore.activeNodeName=this.data?this.data.name:"",this.pinDataDiscoveryTooltipVisible=!1},touchStart(){this.deviceSupport.isTouchDevice&&!this.deviceSupport.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},openContextMenu(e,t){this.data&&this.contextMenu.open(e,{source:t,node:this.data})}}}),Vn=e=>(Cn("data-v-1142d909"),e=e(),In(),e),Mc=["id","data-name","data-node-type"],Wc={class:"select-background"},Vc={key:0,class:"trigger-icon"},Bc=["innerHTML"],Uc={key:0,class:"node-issues","data-test-id":"node-issues"},Lc={key:1,class:"waiting"},xc=["textContent"],Hc={key:2,class:"node-pin-data-icon"},Fc={key:0,class:"items-count"},zc={key:3},Yc={key:4,class:"data-count"},Kc={key:0,class:"items-count"},jc=["title"],qc={class:"node-trigger-tooltip__wrapper"},Gc=["textContent"],Jc=Vn(()=>f("span",null,null,-1)),Xc=Vn(()=>f("span",null,null,-1)),Qc={class:"node-description"},Zc=["title"],eh={"data-test-id":"canvas-node-box-title"},th={key:0},oh=["title"],nh={class:"node-options-inner"};function sh(e,t,o,n,s,i){var g;const a=S("FontAwesomeIcon"),r=S("n8n-tooltip"),l=S("TitledList"),d=S("NodeIcon"),h=S("n8n-icon-button"),p=Tt("touch");return c(),b("div",{id:e.nodeId,ref:e.data.name,class:D(e.nodeWrapperClass),style:ee(e.nodeWrapperStyles),"data-test-id":"canvas-node","data-name":e.data.name,"data-node-type":(g=e.nodeType)==null?void 0:g.name,onContextmenu:t[4]||(t[4]=N=>e.openContextMenu(N,"node-right-click"))},[G(f("div",Wc,null,512),[[ne,e.isSelected]]),f("div",{class:D({"node-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"menu-open":e.isContextMenuOpen,"disable-pointer-events":e.disablePointerEvents})},[G((c(),b("div",{class:D(e.nodeClass),style:ee(e.nodeStyle),onClick:t[0]||(t[0]=se((...N)=>e.onClick&&e.onClick(...N),["left"]))},[e.isTriggerNode?(c(),b("i",Vc,[y(r,{placement:"bottom"},{content:w(()=>[f("span",{innerHTML:e.$locale.baseText("node.thisIsATriggerNode")},null,8,Bc)]),default:w(()=>[y(a,{icon:"bolt",size:"lg"})]),_:1})])):E("",!0),e.data.disabled?E("",!0):(c(),b("div",{key:1,class:D({"node-info-icon":!0,"shift-icon":e.shiftOutputCount})},[e.hasIssues&&!e.hideNodeIssues?(c(),b("div",Uc,[y(r,{"show-after":500,placement:"bottom"},{content:w(()=>[y(l,{title:`${e.$locale.baseText("node.issues")}:`,items:e.nodeIssues},null,8,["title","items"])]),default:w(()=>[y(a,{icon:"exclamation-triangle"})]),_:1})])):e.waiting||e.nodeExecutionStatus==="waiting"?(c(),b("div",Lc,[y(r,{placement:"bottom"},{content:w(()=>[f("div",{textContent:T(e.waiting)},null,8,xc)]),default:w(()=>[y(a,{icon:"clock"})]),_:1})])):e.showPinnedDataInfo?(c(),b("span",Hc,[y(a,{icon:"thumbtack"}),e.workflowDataItems>1?(c(),b("span",Fc,T(e.workflowDataItems),1)):E("",!0)])):e.nodeExecutionStatus==="unknown"?(c(),b("span",zc)):e.workflowDataItems?(c(),b("span",Yc,[y(a,{icon:"check"}),e.workflowDataItems>1?(c(),b("span",Kc,T(e.workflowDataItems),1)):E("",!0)])):E("",!0)],2)),f("div",{class:"node-executing-info",title:e.$locale.baseText("node.nodeIsExecuting")},[y(a,{icon:"sync-alt",spin:""})],8,jc),f("div",qc,[y(r,{placement:"top","show-after":500,visible:e.showTriggerNodeTooltip,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:w(()=>[f("div",{textContent:T(e.getTriggerNodeTooltip)},null,8,Gc)]),default:w(()=>[Jc]),_:1},8,["visible"]),e.isTriggerNode?(c(),O(r,{key:0,placement:"top",visible:e.pinDataDiscoveryTooltipVisible,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:w(()=>[I(T(e.$locale.baseText("node.discovery.pinData.canvas")),1)]),default:w(()=>[Xc]),_:1},8,["visible"])):E("",!0)]),y(d,{class:"node-icon","node-type":e.nodeType,size:40,shrink:!1,"color-default":e.iconColorDefault,disabled:e.data.disabled},null,8,["node-type","color-default","disabled"])],6)),[[p,e.touchStart,"start"],[p,e.touchEnd,"end"]]),e.showDisabledLinethrough?(c(),b("div",{key:0,class:D({"disabled-linethrough":!0,success:!["unknown"].includes(e.nodeExecutionStatus)&&e.workflowDataItems>0})},null,2)):E("",!0)],2),f("div",Qc,[f("div",{class:"node-name",title:e.nodeTitle},[f("p",eh,T(e.nodeTitle),1),e.data.disabled?(c(),b("p",th,"("+T(e.$locale.baseText("node.disabled"))+")",1)):E("",!0)],8,Zc),e.nodeSubtitle!==void 0?(c(),b("div",{key:0,class:"node-subtitle",title:e.nodeSubtitle},T(e.nodeSubtitle),9,oh)):E("",!0)]),e.isReadOnly?E("",!0):G((c(),b("div",{key:0,class:"node-options no-select-on-click",onContextmenu:t[2]||(t[2]=se(()=>{},["stop"])),onMousedown:t[3]||(t[3]=se(()=>{},["stop"]))},[f("div",nh,[e.isConfigNode?E("",!0):(c(),O(h,{key:0,"data-test-id":"execute-node-button",type:"tertiary",text:"",size:"small",icon:"play",disabled:e.workflowRunning,title:e.$locale.baseText("node.testStep"),onClick:e.executeNode},null,8,["disabled","title","onClick"])),y(h,{"data-test-id":"disable-node-button",type:"tertiary",text:"",size:"small",icon:"power-off",title:e.nodeDisabledTitle,onClick:e.toggleDisableNode},null,8,["title","onClick"]),y(h,{"data-test-id":"delete-node-button",type:"tertiary",size:"small",text:"",icon:"trash",title:e.$locale.baseText("node.delete"),onClick:e.deleteNode},null,8,["title","onClick"]),y(h,{"data-test-id":"overflow-node-button",type:"tertiary",size:"small",text:"",icon:"ellipsis-h",onClick:t[1]||(t[1]=N=>e.openContextMenu(N,"node-button"))})])],544)),[[ne,!e.hideActions]])],46,Mc)}const ih=x(Ac,[["render",sh],["__scopeId","data-v-1142d909"]]),ah=z({name:"Sticky",mixins:[Wn],props:{nodeViewScale:{type:Number},gridSize:{type:Number}},setup(){const e=De(),t=F(),o=F(!1),n=i=>{o.value=i},s=nt(i=>{var a;i==="change_color"&&(n(!0),(a=t.value)==null||a.click())});return{deviceSupport:e,colorPopoverTrigger:t,contextMenu:s,forceActions:o,setForceActions:n}},computed:{...te(J,X,de,j),defaultText(){if(!this.nodeType)return"";const t=this.nodeType.properties.find(o=>o.name==="content");return t&&Dt(t.default)?t.default:""},isSelected(){return this.uiStore.getSelectedNodes.find(e=>e.name===this.data.name)!==void 0},nodeType(){return this.data&&this.nodeTypesStore.getNodeType(this.data.type,this.data.typeVersion)},node(){return this.workflowsStore.getNodeByName(this.name)},position(){return this.node?this.node.position:[0,0]},height(){return this.node&&it(this.node.parameters.height)?this.node.parameters.height:0},width(){return this.node&&it(this.node.parameters.width)?this.node.parameters.width:0},stickySize(){return{height:this.height+"px",width:this.width+"px"}},stickyPosition(){return{left:this.position[0]+"px",top:this.position[1]+"px",zIndex:this.isActive?9999999:-1*Math.floor(this.height*this.width/1e3)}},showActions(){return!(this.hideActions||this.isReadOnly||this.workflowRunning||this.isResizing)||this.forceActions},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")}},data(){return{isResizing:!1,isTouchActive:!1}},methods:{onShowPopover(){this.setForceActions(!0)},onHidePopover(){this.setForceActions(!1)},async deleteNode(){await this.$nextTick(),this.$emit("removeNode",this.data.name)},changeColor(e){this.workflowsStore.updateNodeProperties({name:this.name,properties:{parameters:{...this.node.parameters,color:e}}})},onEdit(e){e&&!this.isActive&&this.node?this.ndvStore.activeNodeName=this.node.name:this.isActive&&!e&&(this.ndvStore.activeNodeName=null)},onMarkdownClick(e,t){if(e){const o=this.name===vn,n=e.querySelector('img[alt="n8n quickstart video"'),s=o&&n?"welcome_video":o&&e.getAttribute("href")==="/templates"?"templates":"other";this.$telemetry.track("User clicked note link",{type:s})}},onInputChange(e){this.node.parameters.content=e,this.setParameters({content:e})},onResizeStart(){this.isResizing=!0,!this.isSelected&&this.node&&this.$emit("nodeSelected",this.node.name,!1,!0)},onResize({height:e,width:t,dX:o,dY:n}){this.node&&((o!==0||n!==0)&&this.setPosition([this.node.position[0]+(o||0),this.node.position[1]+(n||0)]),this.setParameters({height:e,width:t}))},onResizeEnd(){this.isResizing=!1},setParameters(e){if(this.node){const t={content:Dt(e.content)?e.content:this.node.parameters.content,height:it(e.height)?e.height:this.node.parameters.height,width:it(e.width)?e.width:this.node.parameters.width,color:Dt(e.color)?e.color:this.node.parameters.color},o={key:this.node.id,name:this.node.name,value:t};this.workflowsStore.setNodeParameters(o)}},setPosition(e){if(!this.node)return;const t={name:this.node.name,properties:{position:e}};this.workflowsStore.updateNodeProperties(t)},touchStart(){this.deviceSupport.isTouchDevice&&!this.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},onContextMenu(e){this.node&&!this.isActive?this.contextMenu.open(e,{source:"node-right-click",node:this.node}):e.stopPropagation()}}}),rh=["id","data-name"],lh={class:"select-sticky-background"},dh=["title"],uh=["title"],ch={class:"content"},hh=["onClick"];function ph(e,t,o,n,s,i){const a=S("n8n-sticky"),r=S("font-awesome-icon"),l=S("n8n-popover"),d=Tt("touch");return c(),b("div",{id:e.nodeId,ref:e.data.name,class:"sticky-wrapper",style:ee(e.stickyPosition),"data-name":e.data.name,"data-test-id":"sticky"},[f("div",{class:D({"sticky-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"is-read-only":e.isReadOnly}),style:ee(e.stickySize)},[G(f("div",lh,null,512),[[ne,e.isSelected]]),G((c(),b("div",{class:"sticky-box",onClick:t[0]||(t[0]=se((...h)=>e.mouseLeftClick&&e.mouseLeftClick(...h),["left"])),onContextmenu:t[1]||(t[1]=(...h)=>e.onContextMenu&&e.onContextMenu(...h))},[y(a,{id:e.node.id,"model-value":e.node.parameters.content,height:e.node.parameters.height,width:e.node.parameters.width,scale:e.nodeViewScale,"background-color":e.node.parameters.color,"read-only":e.isReadOnly,"default-text":e.defaultText,"edit-mode":e.isActive&&!e.isReadOnly,"grid-size":e.gridSize,onEdit:e.onEdit,onResizestart:e.onResizeStart,onResize:e.onResize,onResizeend:e.onResizeEnd,onMarkdownClick:e.onMarkdownClick,"onUpdate:modelValue":e.onInputChange},null,8,["id","model-value","height","width","scale","background-color","read-only","default-text","edit-mode","grid-size","onEdit","onResizestart","onResize","onResizeend","onMarkdownClick","onUpdate:modelValue"])],32)),[[d,e.touchStart,"start"],[d,e.touchEnd,"end"]]),G(f("div",{class:D({"sticky-options":!0,"no-select-on-click":!0,"force-show":e.forceActions})},[G((c(),b("div",{class:"option","data-test-id":"delete-sticky",title:e.$locale.baseText("node.deleteNode")},[y(r,{icon:"trash"})],8,dh)),[[d,e.deleteNode,"tap"]]),y(l,{effect:"dark","popper-style":{width:"208px"},trigger:"click",placement:"top",onShow:e.onShowPopover,onHide:e.onHidePopover},{reference:w(()=>[f("div",{ref:"colorPopoverTrigger",class:"option","data-test-id":"change-sticky-color",title:e.$locale.baseText("node.changeColor")},[y(r,{icon:"palette"})],8,uh)]),default:w(()=>[f("div",ch,[(c(!0),b(Z,null,re(Array.from({length:7}),(h,p)=>{var g,N;return c(),b("div",{key:p,class:D(["color",`sticky-color-${p+1}`]),"data-test-id":"color",style:ee({"border-width":"1px","border-style":"solid","border-color":"var(--color-foreground-xdark)","background-color":`var(--color-sticky-background-${p+1})`,"box-shadow":p===0&&((g=e.node)==null?void 0:g.parameters.color)===""||p+1===((N=e.node)==null?void 0:N.parameters.color)?`0 0 0 1px var(--color-sticky-background-${p+1})`:"none"}),onClick:m=>e.changeColor(p+1)},null,14,hh)}),128))])]),_:1},8,["onShow","onHide"])],2),[[ne,e.showActions]])],6)],12,rh)}const fh=x(ah,[["render",ph],["__scopeId","data-v-f4958951"]]),gh=60,mh=30,yh=30,wh=15,vh=-20,nn=-200,Nh=-5;function kh(e,t){let o=0,n=0;for(;o<e.length&&n<t.length;){const s=e.charAt(o).toLowerCase(),i=t.charAt(n).toLowerCase();s===i&&o++,++n}return e.length!==0&&t.length!==0&&o===e.length}function bh(e,t){return Bn(e,t,0,0,null,[],256,0,0,5)}function Bn(e,t,o,n,s,i,a,r,l,d){let h=0;if(++l>=d)return{matched:!1,outScore:h};if(o===e.length||n===t.length)return{matched:!1,outScore:h};let p=!1,g=[],N=0,m=!0;for(;o<e.length&&n<t.length;){if(e[o].toLowerCase()===t[n].toLowerCase()){if(r>=a)return{matched:!1,outScore:h};m&&s&&(i=[...s],m=!1);const u=[],k=Bn(e,t,o,n+1,i,u,a,r,l,d),v=k.outScore;k.matched&&((!p||v>N)&&(g=[...u],N=v),p=!0),i[r++]=n,++o}++n}const C=o===e.length;if(C){h=100;let u=vh*i[0];u=u<nn?nn:u,h+=u;const k=t.length-r;h+=Nh*k;for(let v=0;v<r;v++){const P=i[v];if(v>0){const _=i[v-1];P===_+1&&(h+=gh)}if(P>0){const _=t[P-1],R=t[P];_!==_.toUpperCase()&&R!==R.toLowerCase()&&(h+=yh),(_==="_"||_===" ")&&(h+=mh)}else h+=wh}return p&&(!C||N>h)?(i=[...g],h=N,{matched:!0,outScore:h}):C?{matched:!0,outScore:h}:{matched:!1,outScore:h}}return{matched:!1,outScore:h}}function Th(e,t){if(e.hasOwnProperty(t))return e[t];const o=t.split(".");let n=e,s=0;for(;n&&s<o.length;){const i=o[s];n=n[i],s++}return n}function Sh(e,t,o){const n=t.reduce((s,i)=>{let a=[];o.forEach(({key:l,weight:d})=>{const h=Th(i,l);Array.isArray(h)?a=a.concat(h.map(p=>({value:p,weight:d}))):typeof h=="string"&&a.push({value:h,weight:d})});const r=a.reduce((l,{value:d,weight:h})=>{if(!kh(e,d))return l;const p=bh(e,d);p.outScore*=h;const{matched:g,outScore:N}=p;return!l&&g||g&&l&&N>l.outScore?p:l},null);return r&&s.push({score:r.outScore,item:i}),s},[]);return n.sort((s,i)=>i.score-s.score),n}function Xe(e,t,o="node"){var s,i,a;const n={uuid:we(),key:e.name,subcategory:t??((a=(i=(s=e.codex)==null?void 0:s.subcategories)==null?void 0:i[he])==null?void 0:a[0])??et,properties:{...e},type:o};return n}function Dh(e){const t=[he,Ft];return e.reduce((o,n)=>{let s=[et];return t.forEach(i=>{var a,r,l,d;(r=(a=n.codex)==null?void 0:a.categories)!=null&&r.includes(i)&&(s=((d=(l=n.codex)==null?void 0:l.subcategories)==null?void 0:d[i])??[])}),s.forEach(i=>{o[i]||(o[i]=[]),o[i].push(Xe(n,i))}),o},{})}function Lt(e){return e.sort((t,o)=>{var i,a,r,l;if(t.type!=="node"||o.type!=="node")return 0;const n=((a=(i=t.properties)==null?void 0:i.displayName)==null?void 0:a.toLowerCase())||t.key,s=((l=(r=o.properties)==null?void 0:r.displayName)==null?void 0:l.toLowerCase())||o.key;return n.localeCompare(s,void 0,{sensitivity:"base"})})}function sn(e,t){const o=e.toLowerCase().replace("trigger","").trimEnd();return(Sh(o,t,[{key:"properties.displayName",weight:1.3},{key:"properties.codex.alias",weight:1}])||[]).map(({item:s})=>s)}function an(e){return e.map(t=>t.type==="section"?t.children:t).flat()}function Eh(e,t){const o=e.reduce((s,i)=>{const a=t.find(l=>l.items.includes(i.key)),r=(a==null?void 0:a.key)??"other";return s[r]=[...s[r]??[],i],s},{}),n=t.map(s=>({type:"section",key:s.key,title:s.title,children:Lt(o[s.key]??[])})).concat({type:"section",key:"other",title:gs.baseText("nodeCreator.sectionNames.other"),children:Lt(o.other??[])}).filter(s=>s.children.length>0);return n.length<=1?e:n}const wt=Yt(ms.NODE_CREATOR,()=>{const e=F(Fe),t=F([]),o=F({}),n=F(!1),s=F(""),i=Y(()=>Object.values(t.value).map(p=>Xe(p)));function a(p){t.value=p}function r(p){o.value=p}function l(p){n.value=p}function d(p){e.value=p}function h(p){s.value=p}return{openSource:s,selectedView:e,showScrim:n,mergedNodes:t,actions:o,setShowScrim:l,setSelectedView:d,setOpenSource:h,setActions:r,setMergeNodes:a,allNodeCreatorNodes:i}}),Ch=["textContent"],Ih=z({__name:"CanvasAddButton",props:{showTooltip:{type:Boolean},position:{}},setup(e){const t=e,o=wt(),n=Y(()=>({"--trigger-placeholder-left-position":`${t.position[0]}px`,"--trigger-placeholder-top-position":`${t.position[1]}px`}));return(s,i)=>{const a=S("font-awesome-icon"),r=S("n8n-tooltip");return c(),b("div",{ref:"container",class:D(s.$style.canvasAddButton),style:ee(n.value),"data-test-id":"canvas-add-button"},[y(r,{placement:"top",visible:s.showTooltip,disabled:L(o).showScrim,"popper-class":s.$style.tooltip,"show-after":700},{content:w(()=>[I(T(s.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)]),default:w(()=>[f("button",{class:D(s.$style.button),"data-test-id":"canvas-plus-button",onClick:i[0]||(i[0]=l=>s.$emit("click"))},[y(a,{icon:"plus",size:"lg"})],2)]),_:1},8,["visible","disabled","popper-class"]),f("p",{class:D(s.$style.label),textContent:T(s.$locale.baseText("nodeView.canvasAddButton.addFirstStep"))},null,10,Ch)],6)}}}),Ph="_canvasAddButton_mfxxv_5",Oh="_button_mfxxv_17",$h="_label_mfxxv_38",Rh={canvasAddButton:Ph,button:Oh,label:$h},_h={$style:Rh},Ah=x(Ih,[["__cssModules",_h]]);function rn(e,t){return e.filter(o=>{var n,s,i;return!o.hidden&&((i=(s=(n=o.codex)==null?void 0:n.subcategories)==null?void 0:s[Ft])==null?void 0:i.includes(t))}).map(o=>({key:o.name,type:"node",properties:{group:[],name:o.name,displayName:o.displayName,title:o.displayName,description:o.description,icon:o.icon,iconData:o.name.toLowerCase().includes("openai")?{type:"file",icon:"openai",fileBuffer:"/static/open-ai.svg"}:void 0}})).sort((o,n)=>o.properties.displayName.localeCompare(n.properties.displayName))}function fp(e){const t=Ne(),o=J(),n=Dn(),s=rn(o.allLatestNodeTypes,Ms),i=rn(o.allLatestNodeTypes,Ws);return{value:mt,title:t.baseText("nodeCreator.aiPanel.aiNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),info:t.baseText("nodeCreator.aiPanel.infoBox",{interpolate:{link:n.getWebsiteCategoryURL("ai")}}),items:[...s,...i,{key:zt,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.aiOtherNodesDescription")}}]}}function Mh(e){const t=Ne();function o(n){return{connectionType:n,iconProps:{color:`var(--node-type-${n}-color)`},panelClass:`nodes-list-panel-${n}`}}return{value:zt,title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),items:[{key:uo,type:"subcategory",properties:{title:uo,icon:"file-import",...o(M.AiDocument)}},{key:co,type:"subcategory",properties:{title:co,icon:"language",...o(M.AiLanguageModel)}},{key:ho,type:"subcategory",properties:{title:ho,icon:"brain",...o(M.AiMemory)}},{key:po,type:"subcategory",properties:{title:po,icon:"list",...o(M.AiOutputParser)}},{key:fo,type:"subcategory",properties:{title:fo,icon:"search",...o(M.AiRetriever)}},{key:go,type:"subcategory",properties:{title:go,icon:"grip-lines-vertical",...o(M.AiTextSplitter)}},{key:mo,type:"subcategory",properties:{title:mo,icon:"tools",...o(M.AiTool)}},{key:yo,type:"subcategory",properties:{title:yo,icon:"vector-square",...o(M.AiEmbedding)}},{key:wo,type:"subcategory",properties:{title:wo,icon:"project-diagram",...o(M.AiVectorStore)}},{key:vo,type:"subcategory",properties:{title:vo,icon:"code"}}]}}function gp(e){const t=Ne();return{value:Fe,title:t.baseText("nodeCreator.triggerHelperPanel.selectATrigger"),subtitle:t.baseText("nodeCreator.triggerHelperPanel.selectATriggerDescription"),items:[{key:et,type:"subcategory",properties:{forceIncludeNodes:[_e,ys],title:"App Trigger Nodes",icon:"satellite-dish"}},{key:No,type:"node",category:[he],properties:{group:[],name:No,displayName:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDescription"),icon:"fa:clock"}},{key:_e,type:"node",category:[he],properties:{group:[],name:_e,displayName:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDescription"),iconData:{type:"file",icon:"webhook",fileBuffer:"/static/webhook-icon.svg"}}},{key:Me,type:"node",category:[he],properties:{group:[],name:Me,displayName:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDescription"),iconData:{type:"file",icon:"form",fileBuffer:"/static/form-grey.svg"}}},{key:Ze,type:"node",category:[he],properties:{group:[],name:Ze,displayName:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDescription"),icon:"fa:mouse-pointer"}},{key:ko,type:"node",category:[he],properties:{group:[],name:ko,displayName:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDescription"),icon:"fa:sign-out-alt"}},{type:"subcategory",key:bo,category:he,properties:{title:bo,icon:"folder-open"}}]}}function mp(e){const t=Ne(),o={value:Wt,title:t.baseText("nodeCreator.triggerHelperPanel.whatHappensNext"),items:[{key:et,type:"subcategory",properties:{title:"App Regular Nodes",icon:"globe",forceIncludeNodes:[ws,vs]}},{type:"subcategory",key:To,category:he,properties:{title:To,icon:"pen",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Ns,So,ks]},{key:"addOrRemove",title:t.baseText("nodeCreator.sectionNames.transform.addOrRemove"),items:[Do,bs,Ts,Ss]},{key:"combine",title:t.baseText("nodeCreator.sectionNames.transform.combine"),items:[Ds,Es,Eo]},{key:"convert",title:t.baseText("nodeCreator.sectionNames.transform.convert"),items:[At,Cs,Is,Ps,Co,Io,Os,$s]}]}},{type:"subcategory",key:Po,category:he,properties:{title:Po,icon:"code-branch",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Do,Rs,_s,Eo]}]}},{type:"subcategory",key:Oo,category:he,properties:{title:Oo,icon:"file-alt",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[Io,Co]}]}},{type:"subcategory",key:$o,category:he,properties:{title:$o,icon:"toolbox",sections:[{key:"popular",title:t.baseText("nodeCreator.sectionNames.popular"),items:[As,_e,So]}]}}]};return(e??[]).some(s=>{var i,a;return(a=(i=s.codex)==null?void 0:i.categories)==null?void 0:a.includes(Ft)})&&o.items.push({key:mt,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.langchainAiNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.nodesForAi"),tag:t.baseText("nodeCreator.aiPanel.newTag")}}),o.items.push({key:Fe,type:"view",properties:{title:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTrigger"),icon:"bolt",description:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTriggerDescription")}}),o}const Wh="data-keyboard-nav-id",ln=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Escape","Tab"],Vh=Yt("nodeCreatorKeyboardNavigation",()=>{const e=F([]),t=F(null),o=F({});function n(u){return u==null?void 0:u.getAttribute("data-keyboard-nav-type")}function s(u){return(u==null?void 0:u.getAttribute(Wh))||void 0}async function i(){return await new Promise(u=>{m(),setTimeout(()=>{e.value=Array.from(document.querySelectorAll("[data-keyboard-nav-type]")).map(k=>new WeakRef(k)),u()},0)})}function a(u,k){Object.values(o.value).filter(_=>_.keyboardKeys.includes(u)).forEach(_=>{if(!t.value)return;(_.condition===void 0||_.condition(n(k)||"",t.value))&&t.value&&_.handler(t.value,u)})}async function r(u){var A,$,B;const k=u.key;if(!ln.includes(k))return;u.preventDefault(),u.stopPropagation(),await i();const v=e.value.findIndex(U=>s(U==null?void 0:U.deref())===t.value),P=(A=e.value[v])==null?void 0:A.deref(),_=k==="ArrowDown",R=k==="ArrowUp";if(P){if(_){const U=v<e.value.length-1?v+1:0;d(($=e.value[U])==null?void 0:$.deref())}if(R){const U=v>0?v-1:e.value.length-1;d((B=e.value[U])==null?void 0:B.deref())}a(k,P)}}function l(u){t.value=u}function d(u){const k=s(u);k&&(l(k),u!=null&&u.scrollIntoView&&(u==null||u.scrollIntoView({block:"center"})))}async function h(u){var k;await i(),d((k=e.value[u])==null?void 0:k.deref())}function p(){document.addEventListener("keydown",r,{capture:!0})}function g(){m(),document.removeEventListener("keydown",r,{capture:!0})}function N(u,k){k.keyboardKeys.forEach(v=>{if(ln.includes(v))o.value={...o.value,[u]:k};else throw new Error(`Key ${v} is not supported`)})}function m(){e.value=[]}function C(){return e.value.findIndex(u=>s(u==null?void 0:u.deref())===t.value)}return{activeItemId:t,attachKeydownEvent:p,refreshSelectableItems:i,detachKeydownEvent:g,registerKeyHook:N,getActiveItemIndex:C,setActiveItemId:l,setActiveItemIndex:h}}),Bh=Yt("nodeCreatorViewStacks",()=>{const e=wt(),{getActiveItemIndex:t}=Vh(),o=F([]),n=Y(()=>{const u=o.value[o.value.length-1];if(!(u!=null&&u.baselineItems))return u.items?p(u.items):[];if(u.search&&a.value){const k=a.value.length>0?a.value:an(u.baselineItems??[]);return p(sn(u.search||"",k))}return p(u.baselineItems)}),s=Y(()=>{const u=o.value[o.value.length-1];if(!u)return{};const k=an(u.baselineItems??[]);return{...u,items:n.value,hasSearch:k.length>8||(u==null?void 0:u.hasSearch)}}),i=Y(()=>s.value.mode||Fe),a=Y(()=>{const u=o.value[o.value.length-1];return u!=null&&u.searchItems?u.searchItems.map(k=>Xe(k,u.subcategory)):[]}),r=Y(()=>{const u=o.value[o.value.length-1];if(!(u!=null&&u.search))return[];const k=e.mergedNodes.map(P=>Xe(P));return p(sn(u.search||"",k)).filter(P=>!n.value.find(_=>_.key===P.key))}),l=Y(()=>Dh(e.mergedNodes));async function d(u,k,v){var A;const P=Ne();let _,R;k===!0?(_=J().visibleNodeTypesByInputConnectionTypeNames,R={properties:{title:P.baseText("nodeCreator.aiPanel.aiNodes"),icon:"robot"}}):(_=J().visibleNodeTypesByOutputConnectionTypeNames,R=Mh().items.find($=>$.properties.connectionType===u)),await $n(),g({title:R==null?void 0:R.properties.title,rootView:zt,mode:"nodes",items:e.allNodeCreatorNodes,nodeIcon:{iconType:"icon",icon:R==null?void 0:R.properties.icon,color:(A=R==null?void 0:R.properties.iconProps)==null?void 0:A.color},panelClass:R==null?void 0:R.properties.panelClass,baseFilter:$=>{var U;if($.key===Vs)return!1;const B=_[u].includes($.key);return B&&((U=v==null?void 0:v.nodes)!=null&&U.length)?v.nodes.includes($.key):B},itemsMapper($){return{...$,subcategory:u}},preventBack:!0})}function h(){const u=o.value[o.value.length-1];if(!u||!s.value.uuid)return;let k=(u==null?void 0:u.items)??[];if(!(u!=null&&u.items)){const v=(u==null?void 0:u.subcategory)??et,P=l.value[v],_=u.sections;_?k=Eh(P,_):k=P}if((u.forceIncludeNodes??[]).length>0){const v=e.mergedNodes.filter(P=>{var _;return(_=u.forceIncludeNodes)==null?void 0:_.includes(P.name)}).map(P=>Xe(P,u.subcategory));k.push(...v)}u.baseFilter&&(k=k.filter(u.baseFilter)),u.itemsMapper&&(k=k.map(u.itemsMapper)),u.items||(k=Lt(k)),m({baselineItems:k})}function p(u){return u.map(k=>({...k,uuid:`${k.key}-${we()}`}))}function g(u){s.value.uuid&&m({activeIndex:t()});const k=we();o.value.push({...u,uuid:k,transitionDirection:"in",activeIndex:0}),h()}function N(){s.value.uuid&&(o.value.pop(),m({transitionDirection:"out"}))}function m(u){const k=o.value[o.value.length-1],v=o.value.findIndex(P=>P.uuid===k.uuid);k&&Object.keys(u).forEach(P=>{const _=P;o.value[v]={...o.value[v],[P]:u[_]}})}function C(){o.value=[]}return{viewStacks:o,activeViewStack:s,activeViewStackMode:i,globalSearchItemsDiff:r,gotoCompatibleConnectionView:d,resetViewStacks:C,updateCurrentViewStack:m,pushViewStack:g,popViewStack:N}});function Uh(e,t={}){const o=de(),n=F([0,0]),s=De();function i(d){const h=o.nodeViewOffsetPosition,[p,g]=yt(d),N=h[0]+(p-n.value[0]),m=h[1]+(g-n.value[1]);return o.nodeViewOffsetPosition=[N,m],n.value=[p,g],[N,m]}function a(d,h){if(!(s.isCtrlKeyPressed(d)||h)||o.isActionActive("dragActive"))return;d.button!==Bs.MIDDLE&&(o.nodeViewMoveInProgress=!0);const[p,g]=yt(d);n.value=[p,g];const N=L(e);N==null||N.addEventListener("mousemove",l)}function r(d){if(!o.nodeViewMoveInProgress)return;const h=L(e);h==null||h.removeEventListener("mousemove",l),o.nodeViewMoveInProgress=!1}function l(d){const h=L(e);if(!(d.target&&!(h===d.target||h!=null&&h.contains(d.target)))&&!o.isActionActive("dragActive")){if(d.buttons===Ro.MIDDLE&&(o.nodeViewMoveInProgress=!0),d.buttons===Ro.NONE){const p=L(t.onMouseMoveEnd);p==null||p(d);return}i(d)}}return{moveLastPosition:n,onMouseDown:a,onMouseUp:r,onMouseMove:l,panCanvas:i}}const Lh=Ie(async()=>await Ce(()=>import("./NodeCreation-KwIDuMQX.js").then(e=>e.N),__vite__mapDeps([48,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,49]))),xh=Ie(async()=>await Ce(()=>import("./CanvasControls-nkm_s3NJ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,51]))),Hh=Ie(async()=>await Ce(()=>import("./SetupWorkflowCredentialsButton-13o0FsxU.js"),__vite__mapDeps([52,2,3,4,5,6,7,8,1,9,10,11,12,13,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),Fh=z({name:"NodeView",components:{NodeDetailsView:Dc,Node:ih,Sticky:fh,CanvasAddButton:Ah,KeyboardShortcutTooltip:li,NodeCreation:Lh,CanvasControls:xh,ContextMenu:$c,SetupWorkflowCredentialsButton:Hh},async beforeRouteLeave(e,t,o){if(rt(e)===Ye.EXECUTIONS||t.name===K.TEMPLATE_IMPORT||rt(e)===Ye.WORKFLOW&&t.name===K.EXECUTION_DEBUG){o();return}if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=await this.confirm(this.$locale.baseText("generic.unsavedWork.confirmMessage.message"),{title:this.$locale.baseText("generic.unsavedWork.confirmMessage.headline"),type:"warning",confirmButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),cancelButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),showClose:!0});n===xe?(this.workflowsStore.setWorkflowId(Ke),await this.workflowHelpers.saveCurrentWorkflow({},!1)&&await this.settingsStore.fetchPromptsData(),this.uiStore.stateIsDirty=!1,t.name===K.NEW_WORKFLOW?await this.$router.replace({name:K.WORKFLOW,params:{name:this.currentWorkflow}},()=>{this.$router.push(e)}):(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o())):n===Us&&(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),this.workflowsStore.setWorkflowId(Ke),this.resetWorkspace(),this.uiStore.stateIsDirty=!1,o())}else this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o()},setup(){const e=F(null),t=F(null),o=F(null),n=ot(),s=X(),i=Ee(),a=Ne(),r=nt(),l=Nn(),d=We(),h=qt(),{activeNode:p}=kt(s),g=Se(p),N=De(),{callDebounced:m}=vt(),C=Uh(e,{onMouseMoveEnd:o}),u=bt({router:n}),{runWorkflow:k}=kn({router:n});return{locale:a,contextMenu:r,dataSchema:l,nodeHelpers:d,externalHooks:i,clipboard:h,pinnedData:g,deviceSupport:N,canvasPanning:C,nodeViewRootRef:e,nodeViewRef:t,onMouseMoveEnd:o,workflowHelpers:u,runWorkflow:k,callDebounced:m,...Xi(),...di(),...Ls(),...ze(),...Gt(),...Qi(),...Fi()}},watch:{async $route(e,t){this.readOnlyEnvRouteCheck();const o=rt(e),n=!this.uiStore.nodeViewInitialized;let s=t.params.name!==e.params.name&&!(t.params.name==="new"&&this.currentWorkflow===Ke)&&t.name!==K.NEW_WORKFLOW&&e.params.action!=="workflowSave";const i=e.name===K.TEMPLATE_IMPORT;if(o===Ye.WORKFLOW||i){if(s||n||i){if(this.canvasStore.startLoading(),n){const a=this.uiStore.stateIsDirty;this.resetWorkspace(),this.uiStore.stateIsDirty=a}await Promise.all([this.loadCredentials(),this.initView()]),this.canvasStore.stopLoading(),this.blankRedirect&&(this.blankRedirect=!1)}await this.checkAndInitDebugMode()}o===Ye.EXECUTIONS&&(s=t.params.name!==e.params.name&&!(e.params.name==="new"&&t.params.name===void 0),s&&(this.uiStore.nodeViewInitialized=!1))},activeNode(){this.createNodeActive=!1},containsTrigger(e){e===!1&&this.canvasStore.setRecenteredCanvasAddButtonPosition(this.getNodeViewOffsetPosition)},nodeViewScale(e){const t=this.nodeViewRef;t&&(t.style.transform=`scale(${e})`)}},errorCaptured:(e,t,o)=>{console.error("errorCaptured"),console.error(e)},computed:{...te(jt,hi,fn,wt,J,X,xt,yn,Dn,de,j,xs,wt,ci,bn,Jt,ui,Gi,qi,Kt),nativelyNumberSuffixedDefaults(){return this.nodeTypesStore.nativelyNumberSuffixedDefaults},currentUser(){return this.usersStore.currentUser},activeNode(){return this.ndvStore.activeNode},executionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},isDemo(){return this.$route.name===K.DEMO},showCanvasAddButton(){return!this.isLoading&&!this.containsTrigger&&!this.isDemo&&!this.readOnlyEnv},lastSelectedNode(){return this.uiStore.getLastSelectedNode},nodes(){return this.workflowsStore.allNodes},nodesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type!==ce)},stickiesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type===ce)},runButtonText(){return this.workflowRunning?this.executionWaitingForWebhook?this.$locale.baseText("nodeView.runButtonText.waitingForTriggerEvent"):this.$locale.baseText("nodeView.runButtonText.executingWorkflow"):this.$locale.baseText("nodeView.runButtonText.executeWorkflow")},workflowStyle(){const e=this.uiStore.nodeViewOffsetPosition;return{left:e[0]+"px",top:e[1]+"px"}},canvasAddButtonStyle(){return{"pointer-events":this.createNodeActive?"none":"all"}},backgroundStyle(){return pi(this.nodeViewScale,this.uiStore.nodeViewOffsetPosition,this.isExecutionPreview)},workflowClasses(){const e=[];return(this.ctrlKeyPressed||this.moveCanvasKeyPressed)&&(this.uiStore.nodeViewMoveInProgress?e.push("move-in-process"):e.push("move-active")),(this.selectActive||this.ctrlKeyPressed||this.moveCanvasKeyPressed)&&e.push("do-not-select"),this.connectionDragScope.type&&(e.push("connection-drag-scope-active"),e.push(`connection-drag-scope-active-type-${this.connectionDragScope.type}`),e.push(`connection-drag-scope-active-connection-${this.connectionDragScope.connection}`)),e},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){return this.$route.params.name||this.workflowsStore.workflowId},workflowName(){return this.workflowsStore.workflowName},allTriggersDisabled(){return this.triggerNodes.filter(t=>t.disabled).length===this.triggerNodes.length},triggerNodes(){return this.nodes.filter(e=>e.type===Ht||this.nodeTypesStore.isTriggerNode(e.type))},containsTrigger(){return this.triggerNodes.length>0},containsChatNodes(){return!this.executionWaitingForWebhook&&!!this.nodes.find(e=>[Hs,Qe].includes(e.type)&&e.disabled!==!0)},isManualChatOnly(){return this.containsChatNodes&&this.triggerNodes.length===1},isExecutionDisabled(){return!this.containsTrigger||this.allTriggersDisabled},getNodeViewOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},nodeViewScale(){return this.canvasStore.nodeViewScale},instance(){return this.canvasStore.jsPlumbInstance},isLoading(){return this.canvasStore.isLoading},currentWorkflowObject(){return this.workflowsStore.getCurrentWorkflow()},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},isReadOnlyRoute(){var e,t;return((t=(e=this.$route)==null?void 0:e.meta)==null?void 0:t.readOnlyCanvas)===!0}},data(){return{GRID_SIZE:lt,STICKY_NODE_TYPE:ce,createNodeActive:!1,lastClickPosition:[450,450],ctrlKeyPressed:!1,moveCanvasKeyPressed:!1,stopExecutionInProgress:!1,blankRedirect:!1,credentialsUpdated:!1,pullConnActiveNodeName:null,pullConnActive:!1,dropPrevented:!1,connectionDragScope:{type:null,connection:null},renamingActive:!1,showStickyButton:!1,isExecutionPreview:!1,showTriggerMissingTooltip:!1,workflowData:null,activeConnection:null,isInsertingNodes:!1,isProductionExecutionPreview:!1,enterTimer:void 0,exitTimer:void 0,readOnlyNotification:null,suspendRecordingDetachedConnections:!1,NODE_CREATOR_OPEN_SOURCES:me,eventsAttached:!1,unloadTimeout:void 0,canOpenNDV:!0,hideNodeIssues:!1}},async mounted(){var t;this.onMouseMoveEnd=this.mouseUp,this.resetWorkspace(),this.canvasStore.initInstance(this.nodeViewRef),this.titleReset(),window.addEventListener("message",this.onPostMessageReceived),this.clipboard.onPaste.value=this.onClipboardPasteEvent,this.canvasStore.startLoading();const e=this.settingsStore.isPreviewMode&&this.isDemo?[]:[this.loadActiveWorkflows(),this.loadCredentials(),this.loadCredentialTypes(),this.loadVariables(),this.loadSecrets()];this.nodeTypesStore.allNodeTypes.length===0&&e.push(this.loadNodeTypes());try{await Promise.all(e)}catch(o){this.showError(o,this.$locale.baseText("nodeView.showError.mounted1.title"),this.$locale.baseText("nodeView.showError.mounted1.message")+":");return}if(Ji(async()=>{try{try{this.bindCanvasEvents()}catch{}await this.initView(),window.parent&&window.parent.postMessage(JSON.stringify({command:"n8nReady",version:this.rootStore.versionCli}),"*")}catch(o){this.showError(o,this.$locale.baseText("nodeView.showError.mounted2.title"),this.$locale.baseText("nodeView.showError.mounted2.message")+":")}this.canvasStore.stopLoading(),setTimeout(()=>{this.usersStore.showPersonalizationSurvey(),this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})},0)}),this.externalHooks.run("nodeView.mount").catch(o=>{}),((t=this.currentUser)==null?void 0:t.personalizationAnswers)!==null&&this.settingsStore.onboardingCallPromptEnabled&&this.currentUser&&Fs(this.currentUser)<=zs){const o=await this.uiStore.getNextOnboardingPrompt(),n=(o==null?void 0:o.toast_sequence_number)===1?Ys:1e3;o!=null&&o.title&&(o!=null&&o.description)&&setTimeout(async()=>{this.showToast({type:"info",title:o.title,message:o.description,duration:0,customClass:"clickable",closeOnClick:!0,onClick:()=>{this.$telemetry.track("user clicked onboarding toast",{seq_num:o.toast_sequence_number,title:o.title,description:o.description}),this.uiStore.openModal(Ks)}})},n)}Vo.on("pull",this.onSourceControlPull),this.registerCustomAction({key:"openNodeDetail",action:({node:o})=>{this.nodeSelectedByName(o,!0)}}),this.registerCustomAction({key:"openSelectiveNodeCreator",action:this.openSelectiveNodeCreator}),this.readOnlyEnvRouteCheck(),this.canvasStore.isDemo=this.isDemo},activated(){this.uiStore.addFirstStepOnLoad&&this.showTriggerCreator(me.TRIGGER_PLACEHOLDER_BUTTON),this.uiStore.addFirstStepOnLoad=!1,this.bindCanvasEvents(),document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("message",this.onPostMessageReceived),window.addEventListener("pageshow",this.onPageShow),ie.on("newWorkflow",this.newWorkflow),ie.on("importWorkflowData",this.onImportWorkflowDataEvent),ie.on("importWorkflowUrl",this.onImportWorkflowUrlEvent),ie.on("openChat",this.onOpenChat),ae.on("nodeMove",this.onMoveNode),ae.on("revertAddNode",this.onRevertAddNode),ae.on("revertRemoveNode",this.onRevertRemoveNode),ae.on("revertAddConnection",this.onRevertAddConnection),ae.on("revertRemoveConnection",this.onRevertRemoveConnection),ae.on("revertRenameNode",this.onRevertNameChange),ae.on("enableNodeToggle",this.onRevertEnableToggle),ke.on("pin-data",this.addPinDataConnections),ke.on("unpin-data",this.removePinDataConnections),ie.on("saveWorkflow",this.saveCurrentWorkflowExternal),this.canvasStore.isDemo=this.isDemo},deactivated(){this.unbindCanvasEvents(),document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),window.removeEventListener("message",this.onPostMessageReceived),window.removeEventListener("beforeunload",this.onBeforeUnload),window.removeEventListener("pageshow",this.onPageShow),ie.off("newWorkflow",this.newWorkflow),ie.off("importWorkflowData",this.onImportWorkflowDataEvent),ie.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),ie.off("openChat",this.onOpenChat),ae.off("nodeMove",this.onMoveNode),ae.off("revertAddNode",this.onRevertAddNode),ae.off("revertRemoveNode",this.onRevertRemoveNode),ae.off("revertAddConnection",this.onRevertAddConnection),ae.off("revertRemoveConnection",this.onRevertRemoveConnection),ae.off("revertRenameNode",this.onRevertNameChange),ae.off("enableNodeToggle",this.onRevertEnableToggle),ke.off("pin-data",this.addPinDataConnections),ke.off("unpin-data",this.removePinDataConnections),ie.off("saveWorkflow",this.saveCurrentWorkflowExternal)},beforeMount(){this.isDemo||this.pushStore.pushConnect()},beforeUnmount(){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),this.unregisterCustomAction("showNodeCreator"),this.unregisterCustomAction("openNodeDetail"),this.unregisterCustomAction("openSelectiveNodeCreator"),this.isDemo||this.pushStore.pushDisconnect(),this.resetWorkspace(),this.instance.unbind(),this.instance.destroy(),this.uiStore.stateIsDirty=!1,this.workflowsStore.resetChatMessages(),window.removeEventListener("message",this.onPostMessageReceived),ie.off("newWorkflow",this.newWorkflow),ie.off("importWorkflowData",this.onImportWorkflowDataEvent),ie.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),this.workflowsStore.setWorkflowId(Ke),Vo.off("pull",this.onSourceControlPull)},methods:{async openSelectiveNodeCreator({connectiontype:e,node:t,creatorview:o}){const n=t??this.ndvStore.activeNodeName,s=n?this.workflowsStore.getNodeByName(n):null;this.ndvStore.activeNodeName=null,await this.redrawNode(t),setTimeout(()=>{o?this.onToggleNodeCreator({createNodeActive:!0,nodeCreatorView:o}):e&&s&&this.insertNodeAfterSelected({index:0,endpointUuid:`${s.id}-input${e}0`,eventSource:me.NOTICE_ERROR_MESSAGE,outputType:e,sourceId:s.id})})},editAllowedCheck(){var e;if(!((e=this.readOnlyNotification)!=null&&e.visible))return this.isReadOnlyRoute||this.readOnlyEnv?(this.readOnlyNotification=this.showMessage({title:this.$locale.baseText(this.readOnlyEnv?`readOnlyEnv.showMessage.${this.isReadOnlyRoute?"executions":"workflows"}.title`:"readOnly.showMessage.executions.title"),message:this.$locale.baseText(this.readOnlyEnv?`readOnlyEnv.showMessage.${this.isReadOnlyRoute?"executions":"workflows"}.message`:"readOnly.showMessage.executions.message"),type:"info",dangerouslyUseHTMLString:!0}),!1):!0},showTriggerMissingToltip(e){this.showTriggerMissingTooltip=e},onRunNode(e,t){const o=this.workflowsStore.getNodeByName(e),n={node_type:o?o.type:null,workflow_id:this.workflowsStore.workflowId,source:"canvas",session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",n),this.externalHooks.run("nodeView.onRunNode",n),this.runWorkflow({destinationNode:e,source:t})},async onOpenChat(){const e={workflow_id:this.workflowsStore.workflowId};this.$telemetry.track("User clicked chat open button",e),this.externalHooks.run("nodeView.onOpenChat",e),this.uiStore.openModal(js)},async onRunWorkflow(){this.workflowHelpers.getWorkflowDataToSave().then(e=>{const t={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Et(e,this.workflowHelpers.getNodeTypes()).nodeGraph)};this.$telemetry.track("User clicked execute workflow button",t),this.externalHooks.run("nodeView.onRunWorkflow",t)}),await this.runWorkflow({}),this.refreshEndpointsErrorsState()},resetEndpointsErrors(){Object.values(this.instance.getManagedElements()).flatMap(t=>t.endpoints).filter(t=>(t==null?void 0:t.endpoint.type)===fi).forEach(t=>{const o=t==null?void 0:t.endpoint;o&&((t==null?void 0:t.connections)??[]).length>0&&o.resetError()})},refreshEndpointsErrorsState(){const e=this.workflowsStore.allNodes.filter(t=>t.issues);this.resetEndpointsErrors(),e.forEach(t=>{var s;const o=this.instance.getManagedElement(t.id),n=this.instance.getEndpoints(o);Object.keys(((s=t==null?void 0:t.issues)==null?void 0:s.input)??{}).forEach(i=>{n.filter(r=>r._defaultType.scope===i).forEach(r=>{const l=r==null?void 0:r.endpoint;l&&l.setError()})})})},onRunContainerClick(){if(this.containsTrigger&&!this.allTriggersDisabled)return;const e=this.containsTrigger&&this.allTriggersDisabled?this.$locale.baseText("nodeView.addOrEnableTriggerNode"):this.$locale.baseText("nodeView.addATriggerNodeFirst");this.registerCustomAction({key:"showNodeCreator",action:()=>this.showTriggerCreator(me.NO_TRIGGER_EXECUTION_TOOLTIP)});const t=this.showMessage({type:"info",title:this.$locale.baseText("nodeView.cantExecuteNoTrigger"),message:e,duration:3e3,onClick:()=>setTimeout(()=>{this.createNodeActive&&t.close()},0),dangerouslyUseHTMLString:!0})},clearExecutionData(){this.workflowsStore.workflowExecutionData=null,this.nodeHelpers.updateNodesExecutionIssues()},async onSaveKeyboardShortcut(e){let t=await this.workflowHelpers.saveCurrentWorkflow();t&&(await this.settingsStore.fetchPromptsData(),this.$route.name===K.EXECUTION_DEBUG&&await this.$router.replace({name:K.WORKFLOW,params:{name:this.currentWorkflow}})),this.activeNode&&(e.target instanceof HTMLInputElement?t=e.target.readOnly:t=!0,t&&this.showMessage({title:this.$locale.baseText("generic.workflowSaved"),type:"success"}))},showTriggerCreator(e){this.createNodeActive||(this.nodeCreatorStore.setSelectedView(Fe),this.nodeCreatorStore.setShowScrim(!0),this.onToggleNodeCreator({source:e,createNodeActive:!0}))},async openExecution(e){var o,n;this.canvasStore.startLoading(),this.resetWorkspace();let t;try{t=await this.workflowsStore.getExecution(e)}catch(s){this.showError(s,this.$locale.baseText("nodeView.showError.openExecution.title"));return}if(t===void 0)throw new Error(`Execution with id "${e}" could not be found!`);if(this.workflowsStore.setWorkflowName({newName:t.workflowData.name,setStateDirty:!1}),this.workflowsStore.setWorkflowId(Ke),this.workflowsStore.setWorkflowExecutionData(t),t.workflowData.pinData&&this.workflowsStore.setWorkflowPinData(t.workflowData.pinData),t.workflowData.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:t.workflowData.id,ownedBy:t.workflowData.ownedBy}),t.workflowData.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:t.workflowData.id,sharedWith:t.workflowData.sharedWith}),t.workflowData.usedCredentials&&this.workflowsStore.setUsedCredentials(t.workflowData.usedCredentials),await this.addNodes(Re(t.workflowData.nodes),Re(t.workflowData.connections)),await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!1,this.externalHooks.run("execution.open",{workflowId:t.workflowData.id,workflowName:t.workflowData.name,executionId:e}),this.$telemetry.track("User opened read-only execution",{workflow_id:t.workflowData.id,execution_mode:t.mode,execution_finished:t.finished}),!t.finished&&((n=(o=t.data)==null?void 0:o.resultData)!=null&&n.error)){let s=!1;if(t.data.resultData.runData){const i=t.data.resultData.runData;e:for(const a of Object.keys(i))for(const r of i[a])if(r.error){s=!0;break e}}!s&&t.data.resultData.error.stack&&(console.error(`Execution ${e} error:`),console.error(t.data.resultData.error.stack),this.showMessage({title:this.$locale.baseText("nodeView.showError.workflowError"),message:t.data.resultData.error.message,type:"error",duration:0}))}t.waitTill&&this.showMessage({title:this.$locale.baseText("nodeView.thisExecutionHasntFinishedYet"),message:`<a data-action="reload">${this.$locale.baseText("nodeView.refresh")}</a> ${this.$locale.baseText("nodeView.toSeeTheLatestStatus")}.<br/> <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">${this.$locale.baseText("nodeView.moreInfo")}</a>`,type:"warning",duration:0}),this.canvasStore.stopLoading()},async importWorkflowExact(e){if(!e.workflow.nodes||!e.workflow.connections)throw new Error("Invalid workflow object");this.resetWorkspace(),e.workflow.nodes=gi(e.workflow.nodes),await this.addNodes(e.workflow.nodes,e.workflow.connections),e.workflow.pinData&&this.workflowsStore.setWorkflowPinData(e.workflow.pinData),await this.$nextTick(),this.canvasStore.zoomToFit()},async openWorkflowTemplate(e){this.canvasStore.startLoading(),this.canvasStore.setLoadingText(this.$locale.baseText("nodeView.loadingTemplate")),this.resetWorkspace(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=null;let t;try{if(this.externalHooks.run("template.requested",{templateId:e}),t=await this.templatesStore.getFixedWorkflowTemplate(e),!t)throw new Error(this.$locale.baseText("nodeView.workflowTemplateWithIdCouldNotBeFound",{interpolate:{templateId:e}}))}catch(o){this.showError(o,this.$locale.baseText("nodeView.couldntImportWorkflow")),await this.$router.replace({name:K.NEW_WORKFLOW});return}this.$telemetry.track("User inserted workflow template",{source:"workflow",template_id:qs(e),wf_template_repo_session_id:this.templatesStore.previousSessionId},{withPostHog:!0}),this.blankRedirect=!0,await this.$router.replace({name:K.NEW_WORKFLOW,query:{templateId:e}}),await this.addNodes(t.workflow.nodes,t.workflow.connections),this.workflowData=await this.workflowsStore.getNewWorkflowData(t.name)||{},this.workflowsStore.addToWorkflowMetadata({templateId:e}),await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!0,this.externalHooks.run("template.open",{templateId:e,templateName:t.name,workflow:t.workflow}),this.canvasStore.stopLoading()},async openWorkflow(e){this.canvasStore.startLoading();const t=this.workflowsStore.activeWorkflowExecution;this.resetWorkspace(),this.workflowsStore.addWorkflow(e),this.workflowsStore.setActive(e.active||!1),this.workflowsStore.setWorkflowId(e.id),this.workflowsStore.setWorkflowName({newName:e.name,setStateDirty:!1}),this.workflowsStore.setWorkflowSettings(e.settings||{}),this.workflowsStore.setWorkflowPinData(e.pinData||{}),this.workflowsStore.setWorkflowVersionId(e.versionId),this.workflowsStore.setWorkflowMetadata(e.meta),e.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:e.id,ownedBy:e.ownedBy}),e.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:e.id,sharedWith:e.sharedWith}),e.usedCredentials&&this.workflowsStore.setUsedCredentials(e.usedCredentials);const o=e.tags||[],n=o.map(s=>s.id);this.workflowsStore.setWorkflowTagIds(n||[]),this.tagsStore.upsertTags(o),await this.addNodes(e.nodes,e.connections),this.credentialsUpdated||(this.uiStore.stateIsDirty=!1),this.canvasStore.zoomToFit(),this.externalHooks.run("workflow.open",{workflowId:e.id,workflowName:e.name}),(t==null?void 0:t.workflowId)!==e.id?(this.workflowsStore.activeWorkflowExecution=null,this.workflowsStore.currentWorkflowExecutions=[]):this.workflowsStore.activeWorkflowExecution=t,this.canvasStore.stopLoading(),this.collaborationStore.notifyWorkflowOpened(e.id)},touchTap(e){this.deviceSupport.isTouchDevice&&this.mouseDown(e)},mouseDown(e){this.lastClickPosition=this.getMousePositionWithinNodeView(e),e instanceof MouseEvent&&e.button===1&&(this.moveCanvasKeyPressed=!0),this.mouseDownMouseSelect(e,this.moveCanvasKeyPressed),this.canvasPanning.onMouseDown(e,this.moveCanvasKeyPressed),this.createNodeActive=!1},mouseUp(e){e.button===1&&(this.moveCanvasKeyPressed=!1),this.mouseUpMouseSelect(e),this.canvasPanning.onMouseUp(e)},keyUp(e){e.key===this.deviceSupport.controlKeyCode&&(this.ctrlKeyPressed=!1),e.key===" "&&(this.moveCanvasKeyPressed=!1)},async keyDown(e){this.contextMenu.close();const t=this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,o=e.shiftKey&&!e.altKey&&!this.deviceSupport.isCtrlKeyPressed(e),n=this.deviceSupport.isCtrlKeyPressed(e)&&e.altKey&&!e.shiftKey,s=!this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,i=this.isReadOnlyRoute||this.readOnlyEnv;if(e.key==="s"&&t&&!i){if(e.stopPropagation(),e.preventDefault(),this.isReadOnlyRoute||this.readOnlyEnv)return;this.callDebounced(this.onSaveKeyboardShortcut,{debounceTime:1e3},e);return}const a=e.path||e.composedPath&&e.composedPath();for(const l of a)if(l.className&&typeof l.className=="string"&&l.className.includes("ignore-key-press"))return;if(window.document.body.classList.contains("el-popup-parent--hidden"))return;if(e.key==="Escape"&&s){this.createNodeActive=!1,this.activeNode&&(this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.ndvStore.activeNodeName=null);return}if(this.activeNode)return;const r=this.uiStore.getSelectedNodes.map(l=>l&&this.workflowsStore.getNodeByName(l.name)).filter(l=>!!l);if(e.key==="d"&&s&&!i)this.callDebounced(this.toggleActivationNodes,{debounceTime:350},r);else if(e.key==="d"&&t&&!i)r.length>0&&(e.preventDefault(),this.duplicateNodes(r));else if(e.key==="p"&&s&&!i)r.length>0&&(e.preventDefault(),this.togglePinNodes(r,"keyboard-shortcut"));else if((e.key==="Delete"||e.key==="Backspace")&&s&&!i)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.deleteNodes,{debounceTime:500},r);else if(e.key==="Tab"&&s&&!i)this.onToggleNodeCreator({source:me.TAB,createNodeActive:!this.createNodeActive&&!this.isReadOnlyRoute&&!this.readOnlyEnv});else if(e.key==="Enter"&&t&&!i)this.onRunWorkflow();else if(e.key==="S"&&o&&!i)this.onAddNodes({nodes:[{type:ce}],connections:[]});else if(e.key===this.deviceSupport.controlKeyCode)this.ctrlKeyPressed=!0;else if(e.key===" ")this.moveCanvasKeyPressed=!0;else if(e.key==="F2"&&s&&!i){const l=this.lastSelectedNode;l!==null&&l.type!==ce&&this.callDebounced(this.renameNodePrompt,{debounceTime:1500},l.name)}else if(e.key==="a"&&t)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectAllNodes,{debounceTime:1e3});else if(e.key==="c"&&t)this.callDebounced(this.copyNodes,{debounceTime:1e3},r);else if(e.key==="x"&&t&&!i)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.cutNodes,{debounceTime:1e3},r);else if(e.key==="n"&&n){if(e.stopPropagation(),e.preventDefault(),this.isDemo)return;this.$router.currentRoute.name===K.NEW_WORKFLOW?ie.emit("newWorkflow"):this.$router.push({name:K.NEW_WORKFLOW}),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.keyDown.title"),type:"success"})}else if(e.key==="Enter"&&s){const l=this.lastSelectedNode;if(l!==null){if(l.type===ce&&(this.isReadOnlyRoute||this.readOnlyEnv))return;this.ndvStore.activeNodeName=l.name}}else if(e.key==="ArrowRight"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectDownstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowRight"&&s){const l=this.lastSelectedNode;if(l===null)return;const d=this.workflowsStore.outgoingConnectionsByNodeName(l.name);if(d.main===void 0||d.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},d.main[0][0].node,!1,!0)}else if(e.key==="ArrowLeft"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectUpstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowLeft"&&s){const l=this.lastSelectedNode;if(l===null)return;const d=this.workflowHelpers.getCurrentWorkflow();if(!d.connectionsByDestinationNode.hasOwnProperty(l.name))return;const h=d.connectionsByDestinationNode[l.name];if(h.main===void 0||h.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},h.main[0][0].node,!1,!0)}else if(["ArrowUp","ArrowDown"].includes(e.key)&&s){const l=this.lastSelectedNode;if(l===null)return;const d=this.workflowHelpers.getCurrentWorkflow();if(!d.connectionsByDestinationNode.hasOwnProperty(l.name))return;const h=d.connectionsByDestinationNode[l.name];if(!Array.isArray(h.main)||!h.main.length)return;const p=h.main[0][0].node,g=this.workflowsStore.outgoingConnectionsByNodeName(p);if(!Array.isArray(g.main)||!g.main.length)return;let N,m=e.key==="ArrowUp"?-99999999:99999999,C=null;for(const u of g.main)for(const k of u)k.node!==l.name&&(N=this.workflowsStore.getNodeByName(k.node),N&&(e.key==="ArrowUp"?N.position[1]<=l.position[1]&&N.position[1]>m&&(C=N.name,m=N.position[1]):N.position[1]>=l.position[1]&&N.position[1]<m&&(C=N.name,m=N.position[1])));C!==null&&this.callDebounced(this.nodeSelectedByName,{debounceTime:100},C,!1,!0)}},toggleActivationNodes(e){this.editAllowedCheck()&&this.nodeHelpers.disableNodes(e,!0)},togglePinNodes(e,t){if(!this.editAllowedCheck())return;this.historyStore.startRecordingUndo();const o=e.some(n=>!this.workflowsStore.pinDataByNodeName(n.name));for(const n of e){const s=Se(n);if(o){const i=this.dataSchema.getInputDataWithPinned(n);i.length!==0&&s.setData(i,t)}else s.unsetData(t)}this.historyStore.stopRecordingUndo()},deleteNodes(e){this.historyStore.startRecordingUndo(),e.forEach(t=>{this.removeNode(t.name,!0,!1)}),setTimeout(()=>{this.historyStore.stopRecordingUndo()},200)},selectAllNodes(){this.nodes.forEach(e=>{this.nodeSelectedByName(e.name)})},selectUpstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.workflowHelpers.getCurrentWorkflow(),o=this.workflowHelpers.getConnectedNodes("upstream",t,e.name);for(const n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},selectDownstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.workflowHelpers.getCurrentWorkflow(),o=this.workflowHelpers.getConnectedNodes("downstream",t,e.name);for(const n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},pushDownstreamNodes(e,t,o=!1){const n=this.workflowsStore.nodesByName[e],s=this.workflowHelpers.getCurrentWorkflow(),i=this.workflowHelpers.getConnectedNodes("downstream",s,e);for(const a of i){const r=this.workflowsStore.nodesByName[a],l=r.position;if(r.position[0]<n.position[0])continue;const d={name:a,properties:{position:[r.position[0]+t,r.position[1]]}};this.workflowsStore.updateNodeProperties(d),this.onNodeMoved(r),(o&&l[0]!==d.properties.position[0]||l[1]!==d.properties.position[1])&&this.historyStore.pushCommandToUndo(new mi(a,l,d.properties.position),o)}},cutNodes(e){const t=!this.isReadOnlyRoute&&!this.readOnlyEnv;this.copyNodes(e,t),t&&this.deleteNodes(e)},copyNodes(e,t=!1){this.getNodesToSave(e).then(o=>{const n={meta:{...this.workflowsStore.workflow.meta??{},instanceId:this.rootStore.instanceId},...o};this.workflowHelpers.removeForeignCredentialsFromWorkflow(n,this.credentialsStore.allCredentials);const s=JSON.stringify(n,null,2);this.clipboard.copy(s),o.nodes.length>0&&(t||this.showMessage({title:"Copied!",message:"",type:"success"}),this.$telemetry.track("User copied nodes",{node_types:o.nodes.map(i=>i.type),workflow_id:this.workflowsStore.workflowId}))})},async stopExecution(){const e=this.workflowsStore.activeExecutionId;if(e!==null){try{this.stopExecutionInProgress=!0,await this.workflowsStore.stopCurrentExecution(e)}catch(t){const o=await this.workflowsStore.getExecution(e);if(o===void 0)this.workflowsStore.finishActiveExecution({executionId:e,data:{finished:!0,stoppedAt:new Date}}),this.workflowsStore.executingNode.length=0,this.uiStore.removeActiveAction("workflowRunning"),this.titleSet(this.workflowsStore.workflowName,"IDLE"),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.unsaved.title"),message:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.unsaved.message"),type:"success"});else if(o!=null&&o.finished){const n={data:o.data,finished:o.finished,mode:o.mode,startedAt:o.startedAt,stoppedAt:o.stoppedAt},s={data:n,executionId:e,retryOf:o.retryOf};this.workflowsStore.finishActiveExecution(s),this.titleSet(o.workflowData.name,"IDLE"),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(n),this.uiStore.removeActiveAction("workflowRunning"),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.title"),message:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.message"),type:"success"})}else this.showError(t,this.$locale.baseText("nodeView.showError.stopExecution.title"))}this.stopExecutionInProgress=!1,this.workflowHelpers.getWorkflowDataToSave().then(t=>{const o={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Et(t,this.workflowHelpers.getNodeTypes()).nodeGraph)};this.$telemetry.track("User clicked stop workflow execution",o)})}},async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("nodeView.showError.stopWaitingForWebhook.title"));return}},async onClipboardPasteEvent(e){if(this.readOnlyEnv)return;if(rt(this.$route)===Ye.WORKFLOW){let o;if(!this.editAllowedCheck())return;if(e.match(/^http[s]?:\/\/.*\.json$/i)){if(!this.editAllowedCheck()||await this.confirm(this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.message",{interpolate:{plainTextData:e}}),this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.headline"),{type:"warning",confirmButtonText:this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.confirmButtonText"),cancelButtonText:this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.cancelButtonText"),dangerouslyUseHTMLString:!0})!==xe||(o=await this.getWorkflowDataFromUrl(e),o===void 0))return}else try{if(o=JSON.parse(e),!this.editAllowedCheck())return}catch{return}return await this.importWorkflowData(o,"paste",!1)}},async getWorkflowDataFromUrl(e){let t;this.canvasStore.startLoading();try{t=await this.workflowsStore.getWorkflowFromUrl(e)}catch(o){this.canvasStore.stopLoading(),this.showError(o,this.$locale.baseText("nodeView.showError.getWorkflowDataFromUrl.title"));return}return this.canvasStore.stopLoading(),t},async importWorkflowData(e,t,o=!0){if(!(!e.hasOwnProperty("nodes")||!e.hasOwnProperty("connections")))try{const n={};e.nodes&&e.nodes.forEach(l=>{if(l.webhookId&&Gs.includes(l.type)&&Object.values(this.workflowHelpers.getCurrentWorkflow().nodes).some(h=>h.webhookId===l.webhookId)&&(l.webhookId=we()),l.id){const d=we();n[d]=l.id,l.id=d}else l.id=we()}),this.removeUnknownCredentials(e);const s=this.rootStore.instanceId,i=JSON.stringify(Et(e,this.workflowHelpers.getNodeTypes(),{nodeIdMap:n,sourceInstanceId:e.meta&&e.meta.instanceId!==s?e.meta.instanceId:""}).nodeGraph);t==="paste"?this.$telemetry.track("User pasted nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:i}):t==="duplicate"?this.$telemetry.track("User duplicated nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:i}):this.$telemetry.track("User imported workflow",{source:t,workflow_id:this.workflowsStore.workflowId,node_graph_string:i}),this.deselectAllNodes(),this.workflowHelpers.updateNodePositions(e,Ve(this.nodes,this.lastClickPosition));const a=await this.addNodesToWorkflow(e);setTimeout(()=>{a.nodes.forEach(l=>{this.nodeSelectedByName(l.name)})});const r=this.settingsStore.areTagsEnabled;if(o&&r&&Array.isArray(e.tags)){const l=await this.tagsStore.fetchAll(),d=new Set(l.map(m=>m.name)),h=e.tags,p=h.filter(m=>!d.has(m.name)),g=[];for(const m of p){const C=this.tagsStore.create(m.name).then(u=>(l.push(u),u));g.push(C)}await Promise.all(g);const N=h.reduce((m,C)=>{const u=l.find(k=>k.name===C.name);return u&&m.push(u.id),m},[]);this.workflowsStore.addWorkflowTagIds(N),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})})}}catch(n){this.showError(n,this.$locale.baseText("nodeView.showError.importWorkflowData.title"))}},removeUnknownCredentials(e){if(e!=null&&e.nodes){for(const t of e.nodes)if(t.credentials)for(const[o,n]of Object.entries(t.credentials))n.id!==null&&(this.credentialsStore.getCredentialById(n.id)||delete t.credentials[o])}},onDragOver(e){e.preventDefault()},async onDrop(e){if(!e.dataTransfer)return;const t=Nt(e.dataTransfer.getData(Js));if(t){const o=this.getMousePositionWithinNodeView(e),n=[o[0]-qe/2+lt,o[1]-qe/2];await this.onAddNodes(t,!0,n),this.createNodeActive=!1}},nodeDeselectedByName(e){const t=this.workflowsStore.getNodeByName(e);t&&this.nodeDeselected(t)},nodeSelectedByName(e,t=!1,o){o===!0&&this.deselectAllNodes();const n=this.workflowsStore.getNodeByName(e);n&&(this.nodeSelected(n),this.uiStore.lastSelectedNode=n.name,this.uiStore.lastSelectedNodeOutputIndex=null,this.uiStore.lastSelectedNodeEndpointUuid=null,this.canvasStore.lastSelectedConnection=null,this.canvasStore.newNodeInsertPosition=null,t&&(this.ndvStore.activeNodeName=n.name))},showMaxNodeTypeError(e){const t=e.maxNodes;this.showMessage({title:this.$locale.baseText("nodeView.showMessage.showMaxNodeTypeError.title"),message:this.$locale.baseText("nodeView.showMessage.showMaxNodeTypeError.message",{adjustToNumber:t,interpolate:{nodeTypeDataDisplayName:e.displayName}}),type:"error",duration:0})},async getNewNodeWithDefaultCredential(e,t){var i,a,r,l;let o=e.defaultVersion;o===void 0&&(o=Array.isArray(e.version)?e.version.slice(-1)[0]:e.version);const n={id:we(),name:t.name??e.defaults.name,type:e.name,typeVersion:o,position:[0,0],parameters:{}},s=(i=e.credentials)==null?void 0:i.map(d=>this.credentialsStore.getUsableCredentialByType(d.name)).flat();if(s&&s.length===1){const d=s[0],h=this.credentialsStore.getCredentialById(d.id),p={id:h.id,name:h.name},g={[d.type]:p};await this.loadNodesProperties([n].map(C=>({name:C.type,version:C.typeVersion})));const N=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),m=He((N==null?void 0:N.properties)||[],{},!0,!1,n);if(e.credentials){const C=e.credentials.find(k=>k.name===d.type);if((a=C==null?void 0:C.displayOptions)!=null&&a.hide)return n;const u=(r=C==null?void 0:C.displayOptions)==null?void 0:r.show;if(!u)return n.credentials=g,n;if(Object.keys(u).length===1&&u.authentication){n.credentials=g;let k={};for(const v of Object.keys(u)){if(m&&!m[v]){k={},n.credentials=void 0;break}const P=(l=u[v])==null?void 0:l[0];P&&typeof P=="string"&&(k[v]=P),n.parameters={...n.parameters,...k}}}}}return n},async injectNode(e,t={},o=!0,n=!1,s=!1){var d,h;const i=this.nodeTypesStore.getNodeType(e);if(i===null){this.showMessage({title:this.$locale.baseText("nodeView.showMessage.addNodeButton.title"),message:this.$locale.baseText("nodeView.showMessage.addNodeButton.message",{interpolate:{nodeTypeName:e}}),type:"error"});return}if(i.maxNodes!==void 0&&this.workflowHelpers.getNodeTypeCount(e)>=i.maxNodes){this.showMaxNodeTypeError(i);return}const a=await this.getNewNodeWithDefaultCredential(i,{name:t.name}),r=this.lastSelectedNode;if(t.position)a.position=Ve(this.canvasStore.getNodesWithPlaceholderNode(),t.position);else if(r){const p=this.canvasStore.lastSelectedConnection;if(p){const[g]=yi(p);g<=wi&&this.pushDownstreamNodes(r.name,It,n)}if(this.canvasStore.newNodeInsertPosition)a.position=Ve(this.nodes,[this.canvasStore.newNodeInsertPosition[0]+lt,this.canvasStore.newNodeInsertPosition[1]-qe/2]),this.canvasStore.newNodeInsertPosition=null;else{let g=0;const N=this.workflowHelpers.getCurrentWorkflow();if(p){const k=this.nodeTypesStore.getNodeType(r.type,r.typeVersion);if(k){const v=[[-100,100],[-140,0,140],[-240,-100,100,240]],P=Te(N,r,k),R=ge(P).filter(A=>A===M.Main);if(R.length>1){const A=v[R.length-2],$=p.__meta?p.__meta.sourceOutputIndex:0;g=A[$]}}}let m=[];try{m=Te(N,a,i)}catch{}const C=ge(m),u=this.nodeTypesStore.getNodeType(r.type,r.typeVersion);if(C.length>0&&C.every(k=>k!==M.Main)){const k=N.getNode(r.name),v=fe(N,k,u),_=(ge(v)||[]).filter(R=>R!==M.Main).findIndex(R=>m[0]===R);a.position=Ve(this.nodes,[r.position[0]+qe/(Math.max(((d=u==null?void 0:u.inputs)==null?void 0:d.length)??1),1)*_,r.position[1]+It],[100,0])}else{const k=fe(N,r,u),v=ge(k);let P=It;v.find(_=>_!==M.Main)&&(P+=150),a.position=Ve(this.nodes,[r.position[0]+P,r.position[1]+g],[100,0])}}}else{const p=this.nodeTypesStore.isTriggerNode(e)&&!this.containsTrigger?this.canvasStore.canvasAddButtonPosition:this.lastClickPosition;a.position=Ve(this.nodes,p)}const l=this.locale.localizeNodeName(a.name,a.type);if(a.name=this.uniqueNodeName(l),(h=i.webhooks)!=null&&h.length&&(a.webhookId=we()),await this.addNodes([a],void 0,n),this.workflowsStore.setNodePristine(a.name,!0),this.uiStore.stateIsDirty=!0,e===ce)this.$telemetry.trackNodesPanel("nodeView.addSticky",{workflow_id:this.workflowsStore.workflowId});else{this.externalHooks.run("nodeView.addNodeButton",{nodeTypeName:e}),vi().trackAddedTrigger(e);const p={node_type:e,node_version:a.typeVersion,is_auto_add:s,workflow_id:this.workflowsStore.workflowId,drag_and_drop:t.dragAndDrop};r&&(p.input_node_type=r.type),this.$telemetry.trackNodesPanel("nodeView.addNodeButton",p)}return n&&(this.deselectAllNodes(),setTimeout(()=>{this.nodeSelectedByName(a.name,o&&e!==ce)})),a},getConnection(e,t,o,n,s){const i=this.workflowsStore.outgoingConnectionsByNodeName(e)[s];if(i){const a=i[t];if(a)return a.find(r=>r.node===o&&r.index===n)}},connectTwoNodes(e,t,o,n,s){this.uiStore.stateIsDirty=!0;const i=this.workflowsStore.getNodeByName(e),a=this.workflowsStore.getNodeByName(o);if(i&&a&&!this.checkNodeConnectionAllowed(i,a,s)||this.getConnection(e,t,o,n,s))return;const r=[{node:e,type:s,index:t},{node:o,type:s,index:n}];this.__addConnection(r)},async addNode(e,t={},o=!0,n=!1,s=!1){var g;if(!this.editAllowedCheck())return;const i=this.lastSelectedNode,a=this.uiStore.lastSelectedNodeOutputIndex,r=this.uiStore.lastSelectedNodeEndpointUuid,l=this.canvasStore.lastSelectedConnection;this.historyStore.startRecordingUndo();const d=await this.injectNode(e,t,o,n,s);if(!d)return;const h=a||0,p=r||"";if(r&&!s){const N=this.instance.getEndpoint(r);if(N&&this.checkNodeConnectionAllowed(i,d,N.scope)){const m=N.scope,C=this.instance.getManagedElement(d.id),k=this.instance.getEndpoints(C).find(v=>v.scope===m&&N.parameters.connection!==v.parameters.connection);(g=this.instance)==null||g.connect({uuids:[p,(k==null?void 0:k.uuid)||""],detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),this.historyStore.stopRecordingUndo();return}}if(i&&!s){if(await this.$nextTick(),l!=null&&l.__meta){this.__deleteJSPlumbConnection(l,n);const N=l.__meta.targetNodeName,m=l.__meta.targetOutputIndex;this.connectTwoNodes(d.name,0,N,m,M.Main)}this.connectTwoNodes(i.name,h,d.name,0,M.Main)}this.historyStore.stopRecordingUndo()},getNodeCreatorFilter(e,t){let o;const n=this.workflowHelpers.getCurrentWorkflow(),s=n.getNode(e);if(!s)return{nodes:[]};const i=this.nodeTypesStore.getNodeType(s==null?void 0:s.type,s.typeVersion);if(i){const r=fe(n,s,i).filter(l=>!(typeof l=="string"||l.type!==t||!l.filter));r.length&&(o=r[0].filter)}return o},insertNodeAfterSelected(e){var i,a,r;const t=e.outputType??M.Main,o=this.workflowsStore.getNodeById(e.sourceId);if(!o)return;this.uiStore.lastSelectedNode=o.name,this.uiStore.lastSelectedNodeEndpointUuid=e.endpointUuid??((a=(i=e.connection)==null?void 0:i.target.jtk)==null?void 0:a.endpoint.uuid),this.uiStore.lastSelectedNodeOutputIndex=e.index,this.canvasStore.newNodeInsertPosition=null,e.connection&&(this.canvasStore.lastSelectedConnection=e.connection),this.onToggleNodeCreator({source:e.eventSource,createNodeActive:!0,nodeCreatorView:e.nodeCreatorView});const n=((r=e.connection)==null?void 0:r.endpoints[0].parameters.connection)==="source";t!==M.Main&&Object.values(M).includes(t)&&Bh().gotoCompatibleConnectionView(t,n,this.getNodeCreatorFilter(o.name,t)).catch(l=>{})},async onEventConnectionAbort(e){var t,o;try{if(this.dropPrevented){this.dropPrevented=!1;return}if(this.pullConnActiveNodeName){const n=this.workflowsStore.getNodeById(e.parameters.nodeId),s=e.parameters.type??M.Main,i=(t=e==null?void 0:e.connector)==null?void 0:t.overrideTargetEndpoint;if(n){const a=e.parameters.connection==="target",r=a?this.pullConnActiveNodeName:n.name,l=a?n.name:this.pullConnActiveNodeName,d=e.parameters.index;Bo(e),await this.$nextTick(),this.connectTwoNodes(r,d,l,((o=i==null?void 0:i.parameters)==null?void 0:o.index)??0,s),this.pullConnActiveNodeName=null,this.dropPrevented=!1}return}this.insertNodeAfterSelected({sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:me.NODE_CONNECTION_DROP,connection:e,outputType:e.parameters.type})}catch(n){console.error(n)}},checkNodeConnectionAllowed(e,t,o){var s;const n=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);if((s=n==null?void 0:n.inputs)!=null&&s.length){const i=this.workflowHelpers.getCurrentWorkflow(),a=i.getNode(t.name);let r=[];n&&(r=fe(i,a,n));for(const l of r||[])if(!(typeof l=="string"||l.type!==o||!l.filter)&&l.filter.nodes.length&&!l.filter.nodes.includes(e.type))return this.dropPrevented=!0,this.showToast({title:this.$locale.baseText("nodeView.showError.nodeNodeCompatible.title"),message:this.$locale.baseText("nodeView.showError.nodeNodeCompatible.message",{interpolate:{sourceNodeName:e.name,targetNodeName:t.name}}),type:"error",duration:5e3}),!1}return!0},onInterceptBeforeDrop(e){try{let t,o;if(e.connection.endpoints[0].parameters.connection==="target"?(t=e.dropEndpoint.parameters,o=e.connection.endpoints[0].parameters):(t=e.connection.endpoints[0].parameters,o=e.dropEndpoint.parameters),t.type!==o.type||t.connection===o.connection)return this.dropPrevented=!0,!1;const n=this.workflowsStore.getNodeById(t.nodeId),s=this.workflowsStore.getNodeById(o.nodeId),i=(n==null?void 0:n.name)||"",a=(s==null?void 0:s.name)||"";return n&&s&&!this.checkNodeConnectionAllowed(n,s,o.type)?!1:this.getConnection(i,t.index,a,o.index,t.type)?(this.dropPrevented=!0,this.pullConnActiveNodeName=null,!1):!0}catch(t){return console.error(t),!0}},onEventConnection(e){var t,o;try{if(e.sourceEndpoint.parameters.connection==="target"){const l=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=l}const n=e.sourceEndpoint.parameters,s=e.targetEndpoint.parameters,i=(t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name,a=(o=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:o.name;i&&a&&(e.connection.__meta={sourceNodeName:i,sourceOutputIndex:n.index,targetNodeName:a,targetOutputIndex:s.index}),dt(e.connection),Ni(e.targetEndpoint);const r=[{node:i,type:n.type,index:n.index},{node:a,type:s.type,index:s.index}];if(this.dropPrevented=!0,this.workflowsStore.addConnection({connection:r}),!this.isReadOnlyRoute&&!this.readOnlyEnv){ki(e.sourceEndpoint),bi(e.connection,()=>{this.activeConnection=null,this.__deleteJSPlumbConnection(e.connection)},()=>{this.insertNodeAfterSelected({sourceId:e.sourceEndpoint.parameters.nodeId,index:n.index,connection:e.connection,eventSource:me.NODE_CONNECTION_ACTION})});const l=Si(e.connection,Ti);n.type!==M.Main&&(e.connection.setPaintStyle(Di(e.connection,e.sourceEndpoint.parameters.category)),l==null||l.setVisible(!1))}this.dropPrevented=!1,this.isLoading||(this.uiStore.stateIsDirty=!0,this.suspendRecordingDetachedConnections||this.historyStore.pushCommandToUndo(new Ei(r)),this.isInsertingNodes||(this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),setTimeout(()=>{var l,d;Uo(e.source,e.target,(d=(l=e.connection)==null?void 0:l.connector)!=null&&d.hasOwnProperty("canvas")?e.connection.connector.canvas:void 0)},0)))}catch(n){console.error(n)}},addConectionsTestData(){this.instance.connections.forEach(e=>{var t;Uo(e.source,e.target,(t=e==null?void 0:e.connector)!=null&&t.hasOwnProperty("canvas")?e==null?void 0:e.connector.canvas:void 0)})},onDragMove(){const e=this.nodes.length;this.callDebounced(this.updateConnectionsOverlays,{debounceTime:e>20?200:0})},updateConnectionsOverlays(){var e;(e=this.instance)==null||e.connections.forEach(t=>{Lo(t),xo(t),Object.values(t.overlays).forEach(o=>{var n;o.canvas&&((n=this.instance)==null||n.repaint(o.canvas))})})},isConnectionActive(e){var t,o;return!(e!=null&&e.id)||!((t=this.activeConnection)!=null&&t.id)?!1:((o=this.activeConnection)==null?void 0:o.id)===e.id},onConnectionMouseOver(e){try{if(this.exitTimer!==void 0&&(clearTimeout(this.exitTimer),this.exitTimer=void 0),this.isReadOnlyRoute??this.readOnlyEnv??this.enterTimer??!e??this.isConnectionActive(e))return;this.enterTimer=setTimeout(()=>{this.activeConnection&&!this.isConnectionActive(e)&&Pt(this.activeConnection),this.enterTimer=void 0,e&&(Ci(e),this.activeConnection=e)},150)}catch(t){console.error(t)}},onConnectionMouseOut(e){try{if(this.exitTimer||(this.enterTimer&&(clearTimeout(this.enterTimer),this.enterTimer=void 0),this.isReadOnlyRoute??this.readOnlyEnv??!e??!this.isConnectionActive(e)))return;this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,e&&this.isConnectionActive(e)&&(Pt(this.activeConnection),this.activeConnection=null)},500)}catch(t){console.error(t)}},onConnectionMoved(e){var t,o;try{Ho(e.connection);const n=e.connection.parameters,s=e.originalEndpoint.parameters,i=[{node:((t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name)||"",type:n.type,index:n.index},{node:((o=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:o.name)||"",type:s.type,index:s.index}];this.__removeConnection(i,!1)}catch(n){console.error(n)}},onEndpointMouseOver(e,t){!e.isTarget||t.target!==e.endpoint.canvas||this.instance.setHover(e,!0)},onEndpointMouseOut(e){e.isTarget&&this.instance.setHover(e,!1)},async onConnectionDetached(e){var t;try{if(e.sourceEndpoint.parameters.connection==="target"){const n=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=n}const o=Fo(e);if(Ho(e.targetEndpoint),Ii(e.sourceEndpoint,e.connection),e.connection.removeOverlays(),this.__removeConnectionByConnectionInfo(e,!1,!1),this.pullConnActiveNodeName){this.historyStore.startRecordingUndo();const s=this.workflowsStore.getNodeById(e.connection.parameters.nodeId).name,i=e.connection.parameters.index,a=e.connection.connector.overrideTargetEndpoint;o&&this.historyStore.pushCommandToUndo(new ut(o)),this.connectTwoNodes(s,i,this.pullConnActiveNodeName,((t=a==null?void 0:a.parameters)==null?void 0:t.index)??0,M.Main),this.pullConnActiveNodeName=null,await this.$nextTick(),this.historyStore.stopRecordingUndo()}else if(!this.historyStore.bulkInProgress&&!this.suspendRecordingDetachedConnections&&o){const n=new ut(o,this);this.historyStore.pushCommandToUndo(n)}this.nodeHelpers.updateNodesInputIssues()}catch(o){console.error(o)}},onConnectionDrag(e){var t;(t=e.overlays["midpoint-arrow"])==null||t.setVisible(!1);try{this.pullConnActiveNodeName=null,this.pullConnActive=!0,this.canvasStore.newNodeInsertPosition=null,Pt(e),dt(e);const o=e.scope,n=Array.from(document.querySelectorAll(`[data-jtk-scope-${o}=true]`)),i=e.parameters.connection==="source"?"target":"source",a=n.filter(d=>{const h=d.jtk.endpoint;if(!h)return!1;const p=h.parameters.nodeId===e.parameters.nodeId,g=h.parameters.connection;return!p&&g===i}),r=d=>{if(!e)return;const h=a.filter(p=>{const g=p.jtk.endpoint;if(p.classList.contains("jtk-floating-endpoint"))return!1;const N=Yo(p,d,50),m=Yo(g.element,d,30);if(N||m){const C=this.workflowsStore.getNodeById(g.parameters.nodeId);if(C)return!!this.nodeTypesStore.getNodeType(C.type,C.typeVersion)}return!1}).sort((p,g)=>{const N=zo(p,d,50),m=zo(g,d,50);return!(N!=null&&N.y)&&!(m!=null&&m.y)?0:N!=null&&N.y?m!=null&&m.y?m.y-N.y:-1:1});if(h.length>0){const g=h[0].jtk.endpoint,N=this.workflowsStore.getNodeById(g.parameters.nodeId);this.pullConnActiveNodeName=(N==null?void 0:N.name)??null,Pi(e,g)}else Oi(e),this.pullConnActiveNodeName=null},l=d=>{this.pullConnActive=!1,this.canvasStore.newNodeInsertPosition=this.getMousePositionWithinNodeView(d),Bo(e),window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",l),this.connectionDragScope={type:null,connection:null}};window.addEventListener("mousemove",r),window.addEventListener("touchmove",r),window.addEventListener("mouseup",l),window.addEventListener("touchend",r),this.connectionDragScope={type:e.parameters.type,connection:e.parameters.connection}}catch(o){console.error(o)}},onConnectionDragAbortDetached(e){var t;Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>Object.values(o)).filter(o=>o.endpoint.type==="N8nPlus").forEach(o=>setTimeout(()=>o.instance.revalidate(o.element),0))},onPlusEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:me.PLUS_ENDPOINT,outputType:e.scope,endpointUuid:e.uuid})},onAddInputEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:me.ADD_INPUT_ENDPOINT,nodeCreatorView:mt,outputType:e.scope,endpointUuid:e.uuid})},bindCanvasEvents(){this.eventsAttached||(this.instance.bind(ct,this.onEventConnectionAbort),this.instance.bind(_o,this.onInterceptBeforeDrop),this.instance.bind(Ao,this.onEventConnection),this.instance.bind(Jo,this.onDragMove),this.instance.bind(Xo,this.onConnectionMouseOver),this.instance.bind(Qo,this.onConnectionMouseOut),this.instance.bind(Mo,this.onConnectionMoved),this.instance.bind(Zo,this.onEndpointMouseOver),this.instance.bind(en,this.onEndpointMouseOut),this.instance.bind(at,this.onConnectionDetached),this.instance.bind(ht,this.onConnectionDrag),this.instance.bind([ht,ct,at],this.onConnectionDragAbortDetached),this.instance.bind(Ko,this.onPlusEndpointClick),this.instance.bind(jo,this.onAddInputEndpointClick),this.eventsAttached=!0)},unbindCanvasEvents(){this.instance.unbind(ct,this.onEventConnectionAbort),this.instance.unbind(_o,this.onInterceptBeforeDrop),this.instance.unbind(Ao,this.onEventConnection),this.instance.unbind(Jo,this.onDragMove),this.instance.unbind(Xo,this.onConnectionMouseOver),this.instance.unbind(Qo,this.onConnectionMouseOut),this.instance.unbind(Mo,this.onConnectionMoved),this.instance.unbind(Zo,this.onEndpointMouseOver),this.instance.unbind(en,this.onEndpointMouseOut),this.instance.unbind(at,this.onConnectionDetached),this.instance.unbind(ht,this.onConnectionDrag),this.instance.unbind(ht,this.onConnectionDragAbortDetached),this.instance.unbind(ct,this.onConnectionDragAbortDetached),this.instance.unbind(at,this.onConnectionDragAbortDetached),this.instance.unbind(Ko,this.onPlusEndpointClick),this.instance.unbind(jo,this.onAddInputEndpointClick),this.eventsAttached=!1},unbindEndpointEventListeners(e=!0){if(this.instance){const t=this.instance.getManagedElements();for(const o of Object.values(t)){const n=o.endpoints;for(const s of n||[]){const i=s==null?void 0:s.endpoint;i&&i.type===$i&&i.unbindEvents()}}}this.eventsAttached=!1},onBeforeUnload(e){if(!(this.isDemo||window.preventNodeViewBeforeUnload)){if(this.uiStore.stateIsDirty)return this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId),this.unloadTimeout=setTimeout(()=>{this.collaborationStore.notifyWorkflowOpened(this.workflowsStore.workflowId)},5*Xs.SECOND),e.returnValue=!0,!0;this.canvasStore.startLoading(this.$locale.baseText("nodeView.redirecting")),this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId);return}},onUnload(){clearTimeout(this.unloadTimeout)},async newWorkflow(){this.canvasStore.startLoading(),this.resetWorkspace(),this.workflowData=await this.workflowsStore.getNewWorkflowData(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=null,this.uiStore.stateIsDirty=!1,this.canvasStore.setZoomLevel(1,[0,0]),await this.tryToAddWelcomeSticky(),this.uiStore.nodeViewInitialized=!0,this.historyStore.reset(),this.workflowsStore.activeWorkflowExecution=null,this.canvasStore.stopLoading()},async tryToAddWelcomeSticky(){this.canvasStore.zoomToFit()},async initView(){var e,t;if(this.$route.params.action==="workflowSave"){this.uiStore.stateIsDirty=!1;return}if(this.blankRedirect)this.blankRedirect=!1;else if(this.$route.name===K.TEMPLATE_IMPORT){const o=this.$route.params.id;await this.openWorkflowTemplate(o)}else{if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=await this.confirm(this.$locale.baseText("generic.unsavedWork.confirmMessage.message"),{title:this.$locale.baseText("generic.unsavedWork.confirmMessage.headline"),type:"warning",confirmButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),cancelButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),showClose:!0});if(n===xe)await this.workflowHelpers.saveCurrentWorkflow()&&await this.settingsStore.fetchPromptsData();else if(n===Qs)return}let o=null;if(this.$route.params.name&&(o=this.$route.params.name),o!==null){let n;try{n=await this.workflowsStore.fetchWorkflow(o)}catch(s){this.showError(s,this.$locale.baseText("openWorkflow.workflowNotFoundError")),this.$router.push({name:K.NEW_WORKFLOW})}n&&(this.titleSet(n.name,"IDLE"),await this.openWorkflow(n),await this.checkAndInitDebugMode(),(e=n.meta)!=null&&e.onboardingId&&this.$telemetry.track(`User opened workflow from onboarding template with ID ${n.meta.onboardingId}`,{workflow_id:n.id},{withPostHog:!0}))}else((t=this.$route.meta)==null?void 0:t.nodeView)===!0&&await this.newWorkflow()}this.historyStore.reset(),this.uiStore.nodeViewInitialized=!0,document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("beforeunload",this.onBeforeUnload),window.addEventListener("unload",this.onUnload),this.showNotificationForViews([K.WORKFLOW,K.NEW_WORKFLOW])},getOutputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?Ut(n.id,t,o):null},getInputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?Sn(n.id,t,o):null},__addConnection(e){var s;const t=this.getOutputEndpointUUID(e[0].node,e[0].type,e[0].index),o=this.getInputEndpointUUID(e[1].node,e[1].type,e[1].index);if(!t||!o)return;const n=[t,o];(s=this.instance)==null||s.connect({uuids:n,detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})})},__removeConnection(e,t=!1){var o,n;if(t){const s=this.workflowsStore.getNodeByName(e[0].node),i=this.workflowsStore.getNodeByName(e[1].node);if(!s||!i)return;const a=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),r=((o=a==null?void 0:a.outputs)==null?void 0:o[e[0].index])||M.Main,l=typeof r=="string"?r:r.name,d=Bt(l);((n=this.instance)==null?void 0:n.getConnections({scope:d,source:s.id,target:i.id})).forEach(p=>{p.__meta?p.__meta.sourceOutputIndex===e[0].index&&p.__meta.targetOutputIndex===e[1].index&&this.__deleteJSPlumbConnection(p):this.__deleteJSPlumbConnection(p)})}this.workflowsStore.removeConnection({connection:e})},__deleteJSPlumbConnection(e,t=!1){var o,n,s;if(e.removeOverlays(),this.pullConnActiveNodeName=null,(o=this.instance)==null||o.deleteConnection(e),t&&e.__meta){const i=[{index:(n=e.__meta)==null?void 0:n.sourceOutputIndex,node:e.__meta.sourceNodeName,type:M.Main},{index:(s=e.__meta)==null?void 0:s.targetOutputIndex,node:e.__meta.targetNodeName,type:M.Main}],a=new ut(i,this);this.historyStore.pushCommandToUndo(a)}},__removeConnectionByConnectionInfo(e,t=!1,o=!1){const n=Fo(e);n&&(t?this.__deleteJSPlumbConnection(e.connection,o):o&&this.historyStore.pushCommandToUndo(new ut(n)),this.workflowsStore.removeConnection({connection:n}))},async duplicateNodes(e){if(!this.editAllowedCheck())return;const t=Re(await this.getNodesToSave(e));await this.importWorkflowData(t,"duplicate",!1)},getIncomingOutgoingConnections(e){var o,n;const t=this.workflowsStore.getNodeByName(e);if(t){const s=(o=this.instance)==null?void 0:o.getConnections({source:t.id});return{incoming:(n=this.instance)==null?void 0:n.getConnections({target:t.id}),outgoing:s}}return{incoming:[],outgoing:[]}},onNodeMoved(e){const{incoming:t,outgoing:o}=this.getIncomingOutgoingConnections(e.name);[...t,...o].forEach(n=>{xo(n),Lo(n)})},onNodeRun({name:e,data:t,waiting:o}){var r;const n=this.workflowsStore.pinnedWorkflowData;if(n!=null&&n[e]){const{outgoing:l}=this.getIncomingOutgoingConnections(e);l.forEach(d=>{var h;if(((h=d.__meta)==null?void 0:h.sourceNodeName)===e){const p=this.workflowsStore.getWorkflowResultDataByNodeName(e)!==null;Ri({connection:d,overlayIds:[Wi],classNames:p?["has-run"]:[],includeConnector:!0})}});return}const s=e,i=this.workflowsStore.getNodeByName(s),a=i!==null?i.id:"";if(t===null||t.length===0||o){((r=this.instance)==null?void 0:r.getConnections({source:a})).forEach(h=>{dt(h)}),_i(i,this.instance).forEach(h=>{h.endpoint.type==="N8nPlus"&&h.endpoint.clearSuccessOutput()});return}this.nodeHelpers.setSuccessOutput(t,i)},removeNode(e,t=!1,o=!0){if(!this.editAllowedCheck())return;const n=this.workflowsStore.getNodeByName(e);if(!n)return;t&&o&&this.historyStore.startRecordingUndo();const s=[];if(s.includes(n.type)){let p=!1;for(const g of this.nodes)if(g.name!==n.name&&s.includes(g.type)){p=!0;break}if(!p)return}n.type===ce?this.$telemetry.track("User deleted workflow note",{workflow_id:this.workflowsStore.workflowId,is_welcome_note:n.name===vn}):(this.externalHooks.run("node.deleteNode",{node:n}),this.$telemetry.track("User deleted node",{node_type:n.type,workflow_id:this.workflowsStore.workflowId}));let i=!1;const a=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),r=this.workflowHelpers.getCurrentWorkflow(),l=r.getNode(n.name);let d=[],h=[];if(a&&(d=fe(r,l,a),h=Te(r,l,a)),h.length===1&&d.length===1){const{incoming:p,outgoing:g}=this.getIncomingOutgoingConnections(n.name);if(p.length===1&&g.length===1){const N=p[0],m=g[0];if(N.__meta&&m.__meta){i=!0;const C=N.__meta.sourceNodeName,u=N.__meta.sourceOutputIndex,k=m.__meta.targetNodeName,v=m.__meta.targetOutputIndex;setTimeout(()=>{var P;this.connectTwoNodes(C,u,k,v,M.Main),i&&((P=this.instance)==null||P.setSuspendDrawing(!1,!0),i=!1)},100)}}}$n(()=>{var p,g,N;(p=this.instance)==null||p.setSuspendDrawing(!0),(((g=this.instance)==null?void 0:g.endpointsByElement[n.id])||[]).flat().forEach(m=>{var C;return(C=this.instance)==null?void 0:C.deleteEndpoint(m)}),this.workflowsStore.removeAllNodeConnection(n),this.workflowsStore.removeNode(n),this.workflowsStore.clearNodeExecutionData(n.name),i||(N=this.instance)==null||N.setSuspendDrawing(!1,!0),this.uiStore.removeNodeFromSelection(n),t&&this.historyStore.pushCommandToUndo(new Vi(n))}),t&&o&&setTimeout(()=>{this.historyStore.stopRecordingUndo()},i?100:0)},async onSwitchSelectedNode(e){this.nodeSelectedByName(e,!0,!0)},async onOpenConnectionNodeCreator(e,t){await this.openSelectiveNodeCreator({connectiontype:t,node:e})},async redrawNode(e){const t="x____XXXX____x";await this.renameNode(e,t),await this.renameNode(t,e)},valueChanged(e){e.name==="name"&&e.oldValue&&this.renameNode(e.oldValue,e.value)},async renameNodePrompt(e){try{const t=this.prompt(this.$locale.baseText("nodeView.prompt.newName")+":",this.$locale.baseText("nodeView.prompt.renameNode")+`: ${e}`,{customClass:"rename-prompt",confirmButtonText:this.$locale.baseText("nodeView.prompt.rename"),cancelButtonText:this.$locale.baseText("nodeView.prompt.cancel"),inputErrorMessage:this.$locale.baseText("nodeView.prompt.invalidName"),inputValue:e});await this.$nextTick();const o=document.querySelector(".rename-prompt .el-input__inner");o&&(o.focus(),o.select());const n=await t;if((n==null?void 0:n.action)!==xe)return;await this.renameNode(e,n.value,!0)}catch{}},async renameNode(e,t,o=!1){var a;if(e===t)return;this.suspendRecordingDetachedConnections=!0,o&&this.historyStore.startRecordingUndo();const s=((a=this.activeNode)==null?void 0:a.name)===e;s&&(this.renamingActive=!0),t=this.uniqueNodeName(t);const i=this.workflowHelpers.getCurrentWorkflow(!0);i.renameNode(e,t),o&&this.historyStore.pushCommandToUndo(new Tn(e,t)),this.workflowsStore.renameNodeSelectedAndExecution({old:e,new:t}),this.deleteEveryEndpoint(),this.workflowsStore.removeAllConnections({setStateDirty:!1}),this.workflowsStore.removeAllNodes({removePinData:!1,setStateDirty:!0}),await this.$nextTick(),await this.addNodes(Object.values(i.nodes),i.connectionsBySourceNode,!1),this.deselectAllNodes(),this.nodeSelectedByName(t),s&&(this.ndvStore.activeNodeName=t,this.renamingActive=!1),o&&this.historyStore.stopRecordingUndo(),this.suspendRecordingDetachedConnections=!1},deleteEveryEndpoint(){var e,t;this.instance&&((e=this.instance)==null||e.reset(),Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>o).forEach(o=>o.destroy()),this.instance.deleteEveryConnection({fireEvent:!0}))},matchCredentials(e){e.credentials&&Object.entries(e.credentials).forEach(([t,o])=>{const n=this.credentialsStore.getCredentialsByType(t);if(typeof o=="string"&&(o={id:null,name:o},this.credentialsUpdated=!0),o.id){const i=o.id.toString(),a=n.find(r=>r.id===i);if(a){(a.name!==o.name||typeof o.id=="number")&&(e.credentials[t]={id:a.id,name:a.name},this.credentialsUpdated=!0);return}}e.credentials[t]=o;const s=n.filter(i=>i.name===o.name);s.length===1&&(e.credentials[t].id=s[0].id,this.credentialsUpdated=!0)})},async addNodes(e,t,o=!1){var s,i;if(!(e!=null&&e.length))return;this.isInsertingNodes=!0,await this.loadNodesProperties(e.map(a=>({name:a.type,version:a.typeVersion})));let n;e.forEach(a=>{if(a.id||(a.id=we()),n=this.nodeTypesStore.getNodeType(a.type,a.typeVersion),a.hasOwnProperty("disabled")||(a.disabled=!1),a.hasOwnProperty("parameters")||(a.parameters={}),n!==null){let r=null;try{r=He(n.properties,a.parameters,!0,!1,a)}catch(l){console.error(this.$locale.baseText("nodeView.thereWasAProblemLoadingTheNodeParametersOfNode")+`: "${a.name}"`),console.error(l)}a.parameters=r!==null?r:{},[_e,Me].includes(a.type)&&a.parameters.path===""&&(a.parameters.path=a.webhookId)}this.matchCredentials(a),this.workflowsStore.addNode(a),o&&this.historyStore.pushCommandToUndo(new Ai(a))}),await this.$nextTick(),(s=this.instance)==null||s.setSuspendDrawing(!0),t&&await this.addConnections(t),this.nodeHelpers.refreshNodeIssues(),this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),this.isInsertingNodes=!1,(i=this.instance)==null||i.setSuspendDrawing(!1,!0)},async addConnections(e){const t=[];for(const o in e)for(const n in e[o])e[o][n].forEach((s,i)=>{s&&s.forEach(a=>{t.push([{node:o,type:n,index:i},{node:a.node,type:a.type,index:a.index}])})});await this.processConnectionBatch(t),setTimeout(this.addConectionsTestData,0)},async processConnectionBatch(e){for(let o=0;o<e.length;o+=100)e.slice(o,o+100).forEach(s=>{this.__addConnection(s)})},async addNodesToWorkflow(e){const t={},o=[];if(!e.nodes)throw new Error(this.$locale.baseText("nodeView.noNodesGivenToAdd"));const n=this.workflowHelpers.getNodeTypesMaxCount();let s,i;const a=[];await this.loadNodesProperties(e.nodes.map(u=>({name:u.type,version:u.typeVersion}))),e.nodes.forEach(u=>{if(n[u.type]!==void 0)if(n[u.type].exist>=n[u.type].max){t[u.name]=n[u.type].nodeNames[0];return}else n[u.type].exist+=1;s=u.name;const k=this.locale.localizeNodeName(u.name,u.type);i=this.uniqueNodeName(k,o),o.push(i),t[s]=i,a.push(u)});const r={},l=e.connections,d=a.map(u=>u.name);let h,p,g,N,m;for(h of Object.keys(l)){if(!d.includes(h))continue;const u={};for(p of Object.keys(l[h]))for(u[p]=[],g=0;g<l[h][p].length;g++){const k=[];if(l[h][p][g])for(N=0;N<l[h][p][g].length;N++)m=l[h][p][g][N],d.includes(m.node)&&k.push(m);u[p].push(k)}r[h]=u}const C=this.workflowHelpers.getWorkflow(a,r);for(s in t)s!==t[s]&&C.renameNode(s,t[s]);if(e.pinData){let u=!0;for(const k of Object.keys(e.pinData)){if(!u){this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title"));continue}const v=C.nodes[t[k]];try{Se(v).setData(e.pinData[k],"add-nodes"),u=!0}catch(P){u=!1,console.error(P)}}}return this.historyStore.startRecordingUndo(),await this.addNodes(Object.values(C.nodes),C.connectionsBySourceNode,!0),this.historyStore.stopRecordingUndo(),this.uiStore.stateIsDirty=!0,{nodes:Object.values(C.nodes),connections:C.connectionsBySourceNode}},async getNodesToSave(e){const t={nodes:[],connections:{},pinData:{}};let o;const n=[];for(const p of e){o=this.workflowHelpers.getNodeDataToSave(p),n.push(p.name),t.nodes.push(o);const g=this.workflowsStore.pinDataByNodeName(p.name);if(g&&(t.pinData[p.name]=g),o.credentials&&this.settingsStore.isEnterpriseFeatureEnabled(wn.Sharing)){const N=this.workflowsStore.usedCredentials;o.credentials=Object.fromEntries(Object.entries(o.credentials).filter(([m,C])=>{var u;return C.id&&(!N[C.id]||((u=N[C.id])==null?void 0:u.currentUserHasAccess))}))}}let s,i,a,r,l,d,h;return t.nodes.forEach(p=>{if(i=this.workflowsStore.outgoingConnectionsByNodeName(p.name),Object.keys(i).length!==0){h={};for(a of Object.keys(i))for(l=0;l<i[a].length;l++){for(s=[],r=0;r<i[a][l].length;r++)d=i[a][l][r],n.indexOf(d.node)!==-1&&s.push(d);s.length&&(h.hasOwnProperty(a)||(h[a]=[]),h[a][l]=s)}Object.keys(h).length&&(t.connections[p.name]=h)}}),t},resetWorkspace(){if(this.workflowsStore.resetWorkflow(),this.onToggleNodeCreator({createNodeActive:!1}),this.nodeCreatorStore.setShowScrim(!1),this.canvasStore.resetZoom(),this.unbindEndpointEventListeners(),this.deleteEveryEndpoint(),this.executionWaitingForWebhook)try{this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch{}this.workflowsStore.resetState(),this.uiStore.removeActiveAction("workflowRunning"),this.uiStore.resetSelectedNodes(),this.uiStore.nodeViewOffsetPosition=[0,0],this.credentialsUpdated=!1},async loadActiveWorkflows(){await this.workflowsStore.fetchActiveWorkflows()},async loadNodeTypes(){await this.nodeTypesStore.getNodeTypes()},async loadCredentialTypes(){await this.credentialsStore.fetchCredentialTypes(!0)},async loadCredentials(){await this.credentialsStore.fetchAllCredentials()},async loadVariables(){await this.environmentsStore.fetchAllVariables()},async loadSecrets(){await this.externalSecretsStore.fetchAllSecrets()},async loadNodesProperties(e){const t=this.nodeTypesStore.allNodeTypes,o=[];t.forEach(n=>{const s=Array.isArray(n.version)?n.version:[n.version];e.find(i=>i.name===n.name&&s.includes(i.version))&&!n.hasOwnProperty("properties")&&o.push({name:n.name,version:Array.isArray(n.version)?n.version.slice(-1)[0]:n.version})}),o.length>0&&(this.canvasStore.startLoading(),await this.nodeTypesStore.getNodesInformation(o),this.canvasStore.stopLoading())},async onPostMessageReceived(e){var t,o;if(!(!e||typeof e.data!="string"||!((o=(t=e.data)==null?void 0:t.includes)!=null&&o.call(t,'"command"'))))try{const n=JSON.parse(e.data);if(n&&n.command==="openWorkflow")try{await this.importWorkflowExact(n),this.canOpenNDV=n.canOpenNDV??!0,this.hideNodeIssues=n.hideNodeIssues??!1,this.isExecutionPreview=!1}catch(s){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("openWorkflow.workflowImportError")}),"*"),this.showMessage({title:this.$locale.baseText("openWorkflow.workflowImportError"),message:s.message,type:"error"})}else if(n&&n.command==="openExecution")try{this.isProductionExecutionPreview=n.executionMode!=="manual",await this.openExecution(n.executionId),this.canOpenNDV=n.canOpenNDV??!0,this.hideNodeIssues=n.hideNodeIssues??!1,this.isExecutionPreview=!0}catch(s){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("nodeView.showError.openExecution.title")}),"*"),this.showMessage({title:this.$locale.baseText("nodeView.showError.openExecution.title"),message:s.message,type:"error"})}else(n==null?void 0:n.command)==="setActiveExecution"&&(this.workflowsStore.activeWorkflowExecution=n.execution)}catch{}},async onImportWorkflowDataEvent(e){await this.importWorkflowData(e.data,"file")},async onImportWorkflowUrlEvent(e){const t=await this.getWorkflowDataFromUrl(e.url);t!==void 0&&await this.importWorkflowData(t,"url")},addPinDataConnections(e){Object.keys(e).forEach(t=>{var a;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=this.workflowsStore.getWorkflowResultDataByNodeName(t)!==null,s=["pinned"];n&&s.push("has-run"),((a=this.instance)==null?void 0:a.getConnections({source:o.id})).forEach(r=>{Mi(r,{total:e[t].length,iterations:0,classNames:s})})})},removePinDataConnections(e){Object.keys(e).forEach(t=>{var s;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=(s=this.instance)==null?void 0:s.getConnections({source:o.id});this.instance.setSuspendDrawing(!0),n.forEach(dt),this.instance.setSuspendDrawing(!1,!0)})},onToggleNodeCreator({source:e,createNodeActive:t,nodeCreatorView:o}){if(t===this.createNodeActive)return;o||(o=this.containsTrigger?Wt:Fe),this.nodeCreatorStore.setSelectedView(o),this.createNodeActive=t;let n;switch(this.nodeCreatorStore.selectedView){case mt:n="ai";break;case Wt:n="regular";break;default:n="regular"}t&&this.nodeCreatorStore.setOpenSource(e),this.externalHooks.run("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t}),this.$telemetry.trackNodesPanel("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t,workflow_id:this.workflowsStore.workflowId})},async onAddNodes({nodes:e,connections:t},o=!1,n){let s=n;for(const{type:d,isAutoAdd:h,name:p,openDetail:g,position:N}of e){await this.addNode(d,{position:N??s,dragAndDrop:o,name:p},g??!1,!0,h);const m=this.nodes[this.nodes.length-1];s=[m.position[0]+qe*2+lt,m.position[1]]}const i=this.nodes.length-e.length;for(const{from:d,to:h}of t){const p=this.nodes[i+d.nodeIndex],g=this.nodes[i+h.nodeIndex];this.connectTwoNodes(p.name,d.outputIndex??0,g.name,h.inputIndex??0,M.Main)}const a=this.nodes[this.nodes.length-1],l=this.workflowHelpers.getCurrentWorkflow().getParentNodesByDepth(a.name,1);l.length>1&&l.slice(1).forEach((d,h)=>{const p=this.workflowsStore.getNodeByName(d.name);p&&this.onMoveNode({nodeName:p.name,position:[p.position[0],p.position[1]+100*(h+1)]})}),this.addPinDataConnections(this.workflowsStore.pinnedWorkflowData||{})},async saveCurrentWorkflowExternal(e){await this.workflowHelpers.saveCurrentWorkflow(),e==null||e()},setSuspendRecordingDetachedConnections(e){this.suspendRecordingDetachedConnections=e},onMoveNode({nodeName:e,position:t}){this.workflowsStore.updateNodeProperties({name:e,properties:{position:t}});const o=this.workflowsStore.getNodeByName(e);setTimeout(()=>{var n;o&&((n=this.instance)==null||n.repaintEverything(),this.onNodeMoved(o))},0)},onRevertAddNode({node:e}){this.removeNode(e.name,!1)},async onRevertRemoveNode({node:e}){this.workflowsStore.workflow.nodes.find(o=>o.id===e.id)||(e.id=we(),await this.addNodes([e]))},onRevertAddConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__removeConnection(e,!0),this.suspendRecordingDetachedConnections=!1},async onRevertRemoveConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__addConnection(e),this.suspendRecordingDetachedConnections=!1},async onRevertNameChange({currentName:e,newName:t}){await this.renameNode(t,e)},onRevertEnableToggle({nodeName:e,isDisabled:t}){const o=this.workflowsStore.getNodeByName(e);o&&this.nodeHelpers.disableNodes([o])},onPageShow(e){e.persisted&&this.canvasStore.stopLoading()},readOnlyEnvRouteCheck(){this.readOnlyEnv&&[K.NEW_WORKFLOW,K.TEMPLATE_IMPORT].includes(this.$route.name)&&this.$nextTick(async()=>{this.resetWorkspace(),this.uiStore.stateIsDirty=!1,await this.$router.replace({name:K.WORKFLOWS})})},async checkAndInitDebugMode(){this.$route.name===K.EXECUTION_DEBUG&&(this.titleSet(this.workflowName,"DEBUG"),this.workflowsStore.isInDebugMode||(await this.applyExecutionData(this.$route.params.executionId),this.workflowsStore.isInDebugMode=!0))},onContextMenuAction(e,t){switch(e){case"copy":this.copyNodes(t);break;case"delete":this.deleteNodes(t);break;case"duplicate":this.duplicateNodes(t);break;case"execute":this.onRunNode(t[0].name,"NodeView.onContextMenuAction");break;case"open":this.ndvStore.activeNodeName=t[0].name;break;case"rename":this.renameNodePrompt(t[0].name);break;case"toggle_activation":this.toggleActivationNodes(t);break;case"toggle_pin":this.togglePinNodes(t,"context-menu");break;case"add_node":this.onToggleNodeCreator({source:me.CONTEXT_MENU,createNodeActive:!this.isReadOnlyRoute&&!this.readOnlyEnv});break;case"add_sticky":this.onAddNodes({nodes:[{type:ce}],connections:[]});break;case"select_all":this.selectAllNodes();break;case"deselect_all":this.deselectAllNodes();break}}},async onSourceControlPull(){let e=null;this.$route.params.name&&(e=this.$route.params.name);try{if(await Promise.all([this.loadCredentials(),this.loadVariables(),this.tagsStore.fetchAll()]),e!==null&&!this.uiStore.stateIsDirty){const t=await this.workflowsStore.fetchWorkflow(e);t&&(this.titleSet(t.name,"IDLE"),await this.openWorkflow(t))}}catch(t){console.error(t)}}}),zh="_content_59nwu_5",Yh="_shake_59nwu_13",Kh="_setupCredentialsButtonWrapper_59nwu_31",jh={content:zh,shake:Yh,setupCredentialsButtonWrapper:Kh},qh=["textContent"],Gh={key:0,class:"workflow-execute-wrapper"};function Jh(e,t,o,n,s,i){const a=S("CanvasAddButton"),r=S("Node"),l=S("Sticky"),d=S("NodeDetailsView"),h=S("SetupWorkflowCredentialsButton"),p=S("NodeCreation"),g=S("CanvasControls"),N=S("ContextMenu"),m=S("n8n-button"),C=S("KeyboardShortcutTooltip"),u=S("n8n-icon-button"),k=Tt("touch");return c(),b("div",{ref:"nodeViewRootRef",class:D(e.$style.content)},[f("div",{id:"node-view-root",class:"node-view-root do-not-select","data-test-id":"node-view-root",onDragover:t[14]||(t[14]=(...v)=>e.onDragOver&&e.onDragOver(...v)),onDrop:t[15]||(t[15]=(...v)=>e.onDrop&&e.onDrop(...v))},[G((c(),b("div",{class:D(["node-view-wrapper",e.workflowClasses]),"data-test-id":"node-view-wrapper",onTouchstart:t[4]||(t[4]=(...v)=>e.mouseDown&&e.mouseDown(...v)),onTouchend:t[5]||(t[5]=(...v)=>e.mouseUp&&e.mouseUp(...v)),onTouchmove:t[6]||(t[6]=(...v)=>e.canvasPanning.onMouseMove&&e.canvasPanning.onMouseMove(...v)),onMousedown:t[7]||(t[7]=(...v)=>e.mouseDown&&e.mouseDown(...v)),onMouseup:t[8]||(t[8]=(...v)=>e.mouseUp&&e.mouseUp(...v)),onContextmenu:t[9]||(t[9]=(...v)=>e.contextMenu.open&&e.contextMenu.open(...v)),onWheel:t[10]||(t[10]=(...v)=>e.canvasStore.wheelScroll&&e.canvasStore.wheelScroll(...v))},[f("div",{id:"node-view-background",class:"node-view-background",style:ee(e.backgroundStyle),"data-test-id":"node-view-background"},null,4),f("div",{id:"node-view",ref:"nodeViewRef",class:"node-view",style:ee(e.workflowStyle),"data-test-id":"node-view"},[G(y(a,{ref:"canvasAddButton",style:ee(e.canvasAddButtonStyle),"show-tooltip":!e.containsTrigger&&e.showTriggerMissingTooltip,position:e.canvasStore.canvasAddButtonPosition,"data-test-id":"canvas-add-button",onClick:t[0]||(t[0]=v=>e.showTriggerCreator(e.NODE_CREATOR_OPEN_SOURCES.TRIGGER_PLACEHOLDER_BUTTON)),"onHook:mounted":e.canvasStore.setRecenteredCanvasAddButtonPosition},null,8,["style","show-tooltip","position","onHook:mounted"]),[[ne,e.showCanvasAddButton]]),(c(!0),b(Z,null,re(e.nodesToRender,v=>(c(),O(r,{key:`${v.id}_node`,name:v.name,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===v.name,"hide-actions":e.pullConnActive,"is-production-execution-preview":e.isProductionExecutionPreview,workflow:e.currentWorkflowObject,"disable-pointer-events":!e.canOpenNDV,"hide-node-issues":e.hideNodeIssues,onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRunWorkflow:e.onRunNode,onMoved:e.onNodeMoved,onRun:e.onNodeRun,onRemoveNode:t[1]||(t[1]=P=>e.removeNode(P,!0)),onToggleDisableNode:t[2]||(t[2]=P=>e.toggleActivationNodes([P]))},{"custom-tooltip":w(()=>[f("span",{textContent:T(e.$locale.baseText("nodeView.placeholderNode.addTriggerNodeBeforeExecuting"))},null,8,qh)]),_:2},1032,["name","is-read-only","instance","is-active","hide-actions","is-production-execution-preview","workflow","disable-pointer-events","hide-node-issues","onDeselectAllNodes","onDeselectNode","onNodeSelected","onRunWorkflow","onMoved","onRun"]))),128)),(c(!0),b(Z,null,re(e.stickiesToRender,v=>(c(),O(l,{key:`${v.id}_sticky`,name:v.name,workflow:e.currentWorkflowObject,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===v.name,"node-view-scale":e.nodeViewScale,"grid-size":e.GRID_SIZE,"hide-actions":e.pullConnActive,onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRemoveNode:t[3]||(t[3]=P=>e.removeNode(P,!0))},null,8,["name","workflow","is-read-only","instance","is-active","node-view-scale","grid-size","hide-actions","onDeselectAllNodes","onDeselectNode","onNodeSelected"]))),128))],4)],34)),[[k,e.touchTap,"tap"]]),y(d,{"read-only":e.isReadOnlyRoute||e.readOnlyEnv,renaming:e.renamingActive,"is-production-execution-preview":e.isProductionExecutionPreview,onRedrawNode:e.redrawNode,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator,onValueChanged:e.valueChanged,onStopExecution:e.stopExecution,onSaveKeyboardShortcut:e.onSaveKeyboardShortcut},null,8,["read-only","renaming","is-production-execution-preview","onRedrawNode","onSwitchSelectedNode","onOpenConnectionNodeCreator","onValueChanged","onStopExecution","onSaveKeyboardShortcut"]),(c(),O(be,null,{default:w(()=>[f("div",{class:D(e.$style.setupCredentialsButtonWrapper)},[y(h)],2)]),_:1})),(c(),O(be,null,{default:w(()=>[!e.isReadOnlyRoute&&!e.readOnlyEnv?(c(),O(p,{key:0,"create-node-active":e.createNodeActive,"node-view-scale":e.nodeViewScale,onToggleNodeCreator:e.onToggleNodeCreator,onAddNodes:e.onAddNodes},null,8,["create-node-active","node-view-scale","onToggleNodeCreator","onAddNodes"])):E("",!0)]),_:1})),(c(),O(be,null,{default:w(()=>[y(g)]),_:1})),(c(),O(be,null,{default:w(()=>[y(N,{onAction:e.onContextMenuAction},null,8,["onAction"])]),_:1})),!e.isReadOnlyRoute&&!e.readOnlyEnv?(c(),b("div",Gh,[e.isManualChatOnly?E("",!0):(c(),b("span",{key:0,onMouseenter:t[11]||(t[11]=v=>e.showTriggerMissingToltip(!0)),onMouseleave:t[12]||(t[12]=v=>e.showTriggerMissingToltip(!1)),onClick:t[13]||(t[13]=(...v)=>e.onRunContainerClick&&e.onRunContainerClick(...v))},[y(C,{label:e.runButtonText,shortcut:{metaKey:!0,keys:["↵"]}},{default:w(()=>[y(m,{loading:e.workflowRunning,label:e.runButtonText,size:"large",icon:"flask",type:"primary",disabled:e.isExecutionDisabled,"data-test-id":"execute-workflow-button",onClick:se(e.onRunWorkflow,["stop"])},null,8,["loading","label","disabled","onClick"])]),_:1},8,["label"])],32)),e.containsChatNodes?(c(),O(m,{key:1,label:"Chat",size:"large",icon:"comment",type:"primary","data-test-id":"workflow-chat-button",onClick:se(e.onOpenChat,["stop"])},null,8,["onClick"])):E("",!0),e.workflowRunning===!0&&!e.executionWaitingForWebhook?(c(),O(u,{key:2,icon:"stop",size:"large",class:"stop-execution",type:"secondary",title:e.stopExecutionInProgress?e.$locale.baseText("nodeView.stoppingCurrentExecution"):e.$locale.baseText("nodeView.stopCurrentExecution"),loading:e.stopExecutionInProgress,"data-test-id":"stop-execution-button",onClick:se(e.stopExecution,["stop"])},null,8,["title","loading","onClick"])):E("",!0),e.workflowRunning===!0&&e.executionWaitingForWebhook===!0?(c(),O(u,{key:3,class:"stop-execution",icon:"stop",size:"large",title:e.$locale.baseText("nodeView.stopWaitingForWebhookCall"),type:"secondary","data-test-id":"stop-execution-waiting-for-webhook-button",onClick:se(e.stopWaitingForWebhook,["stop"])},null,8,["title","onClick"])):E("",!0),!e.isReadOnlyRoute&&!e.readOnlyEnv&&e.workflowExecution&&!e.workflowRunning&&!e.allTriggersDisabled?(c(),O(u,{key:4,title:e.$locale.baseText("nodeView.deletesTheCurrentExecutionData"),icon:"trash",size:"large","data-test-id":"clear-execution-data-button",onClick:se(e.clearExecutionData,["stop"])},null,8,["title","onClick"])):E("",!0)])):E("",!0)],32)],2)}const Xh={$style:jh},Qh=x(Fh,[["render",Jh],["__cssModules",Xh],["__scopeId","data-v-e052f567"]]),yp=Object.freeze(Object.defineProperty({__proto__:null,default:Qh},Symbol.toStringTag,{value:"Module"}));export{fp as A,Ir as D,yp as N,mp as R,gp as T,_n as a,Bh as b,Vh as c,Mh as d,Se as e,an as f,Lt as s,Xe as t,wt as u};
|
|
8
|
+
//# sourceMappingURL=NodeView-JV8BP6TJ.js.map
|