UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 4.39 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(["./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./users.store-legacy-azRUgFdP.js","./constants-legacy-2_ytuuS3.js","./useRootStore-legacy-CC08el-l.js","./settings.store-legacy-I6rZOvfF.js"],(function(e,t){var a,s,n,l,i,o,r,u,c,d,f,v,h,w,g,b,m,p,y;return{setters:[function(e){a=e.Ft,s=e.S},function(e){n=e.Pn,l=e.fr,i=e.r,o=e.t,r=e.vr},function(e){u=e.Ds,c=e.Es,d=e.Ra,f=e.oc,v=e.qs},function(e){h=e.T,w=e.t},function(e){g=e.An,b=e.c,m=e.s,p=e.t}],execute:function(){try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(N=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[N]="7c59b1b2-dbec-4600-9436-aaa910748c43",t._sentryDebugIdIdentifier="sentry-dbid-7c59b1b2-dbec-4600-9436-aaa910748c43")}catch(t){}var t,N;y=/^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,e("t",h(g.VERSIONS,(()=>{const e=a({enabled:!1,whatsNewEnabled:!1,endpoint:"",whatsNewEndpoint:"",infoUrl:""}),h=a([]),g=a(),N=a({title:"",createdAt:(new Date).toISOString(),updatedAt:null,calloutText:"",footer:"",items:[]}),A=a(),S=l(),{showToast:V,showMessage:C}=n(),I=i(),E=p(),k=o(),T=r(f),D=r(v),j=s((()=>"stable"===E.settings.releaseChannel&&h.value.length>0)),W=s((()=>{if(!j.value||!g.value||!z.value)return!1;if(g.value.hasSecurityIssue)return!0;const e=g.value.name.match(y),t=z.value.name.match(y);if(!e?.groups||!t?.groups)return!1;if(Number(e.groups.major)!==Number(t.groups.major))return!0;const a=Number(e.groups.minor);return Number(t.groups.minor)-a>=2})),z=s((()=>h.value[0]??g.value)),R=s((()=>e.value.enabled)),U=s((()=>e.value.infoUrl)),Z=s((()=>T.value?d(T.value,{fallbackValue:[]}):[])),_=s((()=>D.value?d(D.value,{fallbackValue:[]}):[])),x=s((()=>N.value.items)),F=async()=>{try{const{enabled:t,endpoint:a}=e.value;if(t&&a){const e=w(),t=e.versionCli,s=e.instanceId;O({versions:await m(a,t,s),currentVersion:t})}}catch(t){console.error("Failed to fetch versions:",t)}},O=e=>{h.value=e.versions.filter((t=>t.name!==e.currentVersion)),g.value=e.versions.find((t=>t.name===e.currentVersion))},M=()=>{D.value=JSON.stringify(x.value.map((e=>e.id)))},P=()=>{const e=k.currentUser?.createdAt;let t=!1;if(e){const a=new Date(e).getTime();t=x.value.some((e=>(e.updatedAt?new Date(e.updatedAt).getTime():0)>a))}else t=!0;const a=x.value.every((e=>_.value.includes(e.id)));return t&&!a},$=async()=>{try{const{enabled:t,whatsNewEnabled:a,whatsNewEndpoint:s}=e.value;if(t&&a&&s){const e=w(),t=e.versionCli,a=e.instanceId,n=await b(s,t,a);n.items?.length>0&&((e=>{N.value=e})(n),P()&&(A.value=C({title:N.value.title,message:N.value.calloutText,duration:0,position:"bottom-left",customClass:"clickable whats-new-notification",onClick:()=>{const e=N.value.items[0]?.id??0;S.track("User clicked on what's new notification",{article_id:e}),I.openModalWithData({name:u,data:{articleId:e}})},onClose:()=>{M()}})))}}catch(t){console.error("Failed to fetch Whats New section:",t)}};return{currentVersion:g,latestVersion:z,nextVersions:h,hasVersionUpdates:j,hasSignificantUpdates:W,areNotificationsEnabled:R,infoUrl:U,fetchVersions:F,setVersions:O,initialize:t=>{e.value=t},checkForNewVersions:async()=>{if(R.value&&(await Promise.all([F(),$()]),g.value&&g.value.hasSecurityIssue&&h.value.length)){const e=g.value.securityIssueFixVersion;let t="Please update to latest version.";e&&(t=`Please update to version ${e} or higher.`),t=`${t} <a class="primary-color">More info</a>`,V({title:"Critical update available",message:t,onClick:()=>{I.openModal(c)},closeOnClick:!0,customClass:"clickable",type:"warning",duration:0})}},fetchWhatsNew:$,whatsNew:N,whatsNewArticles:x,isWhatsNewArticleRead:e=>Z.value.includes(e),setWhatsNewArticleRead:e=>{Z.value.includes(e)||(T.value=JSON.stringify([...Z.value,e]))},closeWhatsNewCallout:()=>{A.value?.close(),A.value=void 0},shouldShowWhatsNewCallout:P,dismissWhatsNewCallout:M}})))}}})); //# sourceMappingURL=versions.store-legacy-4XCrklbY.js.map