UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 7.01 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./chunk-legacy-Dz3fjYb5.js","./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./_plugin-vue_export-helper-legacy-DFdC_I5Z.js","./users.store-legacy-azRUgFdP.js","./nodeTransforms-legacy-BzsOh7r-.js","./templateTransforms-legacy-Ab-iJUKf.js","./NodeIcon-legacy-CCBkNBDS.js","./CredentialPicker-legacy-C36WcueE.js"],(function(e,t){var n,a,l,i,s,r,d,c,o,u,p,y,_,g,f,v,m,b,h,C,$,k,I,T,w,S,x,j,N,O,B,D,E,F,q,A,M,P,R,z;function K(e,t){return a(),s("i",R)}return{setters:[function(e){n=e.o},function(e){a=e.$,l=e.A,i=e.C,s=e.E,r=e.Ft,d=e.N,c=e.S,o=e.Sn,u=e.T,p=e.Wt,y=e._n,_=e.bt,g=e.j,f=e.ot,v=e.w,m=e.yt},function(e){b=e.at,h=e.ot},function(e){C=e.Ji,$=e.R},function(e){k=e.t},function(e){I=e.Bi,T=e.Q,w=e.fr,S=e.it,x=e.w},function(e){j=e.i},function(e){N=e.n,O=e.r},function(e){B=e.t},function(e){D=e.t}],execute:function(){(E=document.createElement("style")).textContent="._notice_e6am5_125{margin-top:0}i[data-v-563d175d]{color:var(--color--success)}._container_atvc6_125{list-style:none}._heading_atvc6_129{margin-bottom:var(--spacing--2xs);align-items:center;display:flex}._headingOrder_atvc6_135{font-weight:var(--font-weight--bold);margin-right:var(--spacing--xs)}._headingIcon_atvc6_140{margin-right:var(--spacing--2xs)}._description_atvc6_144{margin-bottom:var(--spacing--lg);font-size:var(--font-size--sm);color:var(--color--text)}._credentials_atvc6_150{align-items:center;max-width:400px;display:flex}._credentialPicker_atvc6_156{flex:1}._credentialOk_atvc6_160{margin-left:var(--spacing--2xs);font-size:24px}._invisible_atvc6_165{visibility:hidden}\n/*$vite$:1*/",document.head.appendChild(E);try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(U=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[U]="b0facb90-0d2a-481b-b564-eeb81cad6d38",t._sentryDebugIdIdentifier="sentry-dbid-b0facb90-0d2a-481b-b564-eeb81cad6d38")}catch(t){}var t,U;F=n(T(),1),q=(e,t)=>t.map((t=>({node:t,requiredCredentials:j(e,t)}))).filter((({requiredCredentials:e})=>e.length>0)),A=e=>{const t=new Map;for(const{node:n,requiredCredentials:a}of e){const e=n.credentials?O(n.credentials):{};for(const l of a){const a=l.name,i=e[l.name]??"",s=N(a,i);let r=t.get(s);r||(r={key:s,nodeTypeName:n.type,credentialName:i,credentialType:a,usedBy:[]},t.set(s,r)),r.usedBy.push(n)}}return t},M=(e,t)=>{const n=new Map;for(const a of e){const e=a.nodeTypeName,l=t(e)??e,i=n.get(l);i?i.credentials.push(a):n.set(l,{appName:l,credentials:[a]})}return Array.from(n.values())},e("i",(e=>{const t=r({}),n=x(),a=S(),l=(e,t)=>{const a=n.getNodeType(e,t);return a?I(a.displayName):e},i=c((()=>(0,F.default)(e.value?q(n,e.value):[],(({node:e})=>e.position[0])))),s=c((()=>A(i.value))),d=c((()=>Array.from(s.value.values()))),o=c((()=>M(d.value,l))),u=c((()=>{const e={};for(const[n,l]of Object.entries(t.value)){const t=a.getCredentialById(l);t&&(e[n]={id:l,name:t.name})}return e})),p=c((()=>Object.keys(t.value).length));return{appCredentials:o,credentialOverrides:u,credentialUsages:d,credentialsByKey:s,nodesRequiringCredentialsSorted:i,numFilledCredentials:p,selectedCredentialIdByKey:t,setSelectedCredentialId:(e,n)=>{t.value[e]=n},unsetSelectedCredential:e=>{delete t.value[e]}}})),P=(e,t)=>{const{i18n:n,formatFn:a}=t;if(0===e.length)return"";if(1===e.length)return a(e[0]);const l=e.slice(0,-1),i=e[e.length-1];return`${l.map(a).join(", ")} ${n.baseText("generic.and")} ${a(i)}`},e("r",k(d({__name:"AppsRequiringCredsNotice",props:{appCredentials:{},source:{}},setup(e){const t=b(),n=e,l=c((()=>"builder"===n.source?"templateSetup.instructions.builder":"templateSetup.instructions")),s=e=>`<b>${e.credentials.length}x ${e.appName}</b>`,r=c((()=>P(n.appCredentials,{formatFn:s,i18n:t})));return(e,t)=>{const n=f("n8n-html");return a(),v(p($),{class:y(e.$style.notice),theme:"info"},{default:m((()=>[g(p(h),{tag:"span",keypath:l.value,scope:"global"},{default:m((()=>[_(i("span",null,null,512),[[n,r.value]])])),_:1},8,["keypath"])])),_:1},8,["class"])}}}),[["__cssModules",{$style:{notice:"_notice_e6am5_125"}}]])),R={class:"el-icon-success"},e("n",z=k({},[["render",K],["__scopeId","data-v-563d175d"]])),e("t",k(d({__name:"SetupTemplateFormStep",props:{order:{},credentials:{},selectedCredentialId:{default:null},source:{}},emits:["credentialSelected","credentialDeselected"],setup(e,{emit:t}){const n=e,r=t,d=x(),v=b(),$=w(),k=c((()=>n.credentials.usedBy[0])),T=c((()=>d.getNodeType(k.value.type,k.value.typeVersion))),S=c((()=>T.value?I(T.value.displayName):k.value.type)),j=c((()=>P(n.credentials.usedBy,{formatFn:e=>`<b>${e.name}</b>`,i18n:v}))),N=c((()=>"builder"===n.source?"templateSetup.credential.description.builder":"templateSetup.credential.description")),O=()=>{$.track("User opened Credential modal",{source:"cred_setup",credentialType:n.credentials.credentialType,new_credential:!n.selectedCredentialId})};return(t,d)=>{const c=f("n8n-html");return a(),s("li",{class:y(t.$style.container),"data-test-id":"setup-credentials-form-step"},[g(p(C),{tag:"h2",size:"large"},{default:m((()=>[T.value?(a(),s("div",{key:0,class:y(t.$style.heading),"data-test-id":"credential-step-heading"},[i("span",{class:y(t.$style.headingOrder)},o(e.order)+".",3),i("span",{class:y(t.$style.headingIcon)},[g(B,{"node-type":T.value},null,8,["node-type"])],2),l(" "+o(S.value),1)],2)):u("",!0)])),_:1}),i("p",{class:y(t.$style.description),"data-test-id":"credential-step-description"},[g(p(h),{tag:"span",keypath:N.value,plural:e.credentials.usedBy.length,scope:"global"},{default:m((()=>[_(i("span",null,null,512),[[c,j.value]])])),_:1},8,["keypath","plural"])],2),i("div",{class:y(t.$style.credentials)},[g(D,{class:y(t.$style.credentialPicker),"app-name":S.value,"credential-type":n.credentials.credentialType,"selected-credential-id":e.selectedCredentialId,onCredentialSelected:d[0]||(d[0]=e=>r("credentialSelected",{credentialUsageKey:t.$props.credentials.key,credentialId:e})),onCredentialDeselected:d[1]||(d[1]=e=>r("credentialDeselected",{credentialUsageKey:t.$props.credentials.key})),onCredentialModalOpened:O},null,8,["class","app-name","credential-type","selected-credential-id"]),g(z,{class:y({[t.$style.credentialOk]:!0,[t.$style.invisible]:!e.selectedCredentialId})},null,8,["class"])],2)],2)}}}),[["__cssModules",{$style:{container:"_container_atvc6_125",heading:"_heading_atvc6_129",headingOrder:"_headingOrder_atvc6_135",headingIcon:"_headingIcon_atvc6_140",description:"_description_atvc6_144",credentials:"_credentials_atvc6_150",credentialPicker:"_credentialPicker_atvc6_156",credentialOk:"_credentialOk_atvc6_160",invisible:"_invisible_atvc6_165"}}]]))}}})); //# sourceMappingURL=SetupTemplateFormStep-legacy-6Z9edR1H.js.map