n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 7.51 kB
JavaScript
!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","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./_plugin-vue_export-helper-legacy-DFdC_I5Z.js","./users.store-legacy-azRUgFdP.js","./useRootStore-legacy-CC08el-l.js","./settings.store-legacy-I6rZOvfF.js","./mcp.constants-legacy-Dn0Xumlo.js"],(function(e,t){var n,a,s,o,l,i,r,c,d,u,g,_,p,f,y,v,b,h,x,w,k,m,T,$,C,E,j,V,z,D,N,S,A,I;return{setters:[function(e){n=e.$,a=e.A,s=e.C,o=e.E,l=e.Ft,i=e.N,r=e.S,c=e.Sn,d=e.T,u=e.Wt,g=e.X,_=e._n,p=e.bt,f=e.j,y=e.ot,v=e.w,b=e.yt},function(e){h=e.at},function(e){x=e.Ji,w=e.K,k=e.Qi,m=e.R,T=e.Xi,$=e.Zi},function(e){C=e.t},function(e){E=e.Pn,j=e.Rt},function(e){V=e.T,z=e.c,D=e.t},function(e){N=e.An},function(e){S=e.r}],execute:function(){(A=document.createElement("style")).textContent="._overlay_k3net_125{z-index:1000;background-color:rgba(71,69,84,.75);justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:fixed;top:0;left:0}._consent-dialog_k3net_138{min-width:500px;max-width:70%;padding:var(--spacing--lg);background-color:var(--color--background--light-3);border:var(--border);border-radius:var(--radius--lg);flex-direction:column;align-items:center;display:flex;position:relative}._header_k3net_151{align-items:center;gap:var(--spacing--xs);display:flex}._logo_k3net_157{width:var(--spacing--2xl);height:var(--spacing--2xl);border:var(--border);border-radius:var(--radius);justify-content:center;align-items:center;display:flex}._logo_k3net_157._n8n_k3net_166>div{bottom:var(--spacing--5xs);position:relative}._content_k3net_171{padding:var(--spacing--lg);gap:var(--spacing--sm);flex-direction:column;display:flex}._success_k3net_178{padding:var(--spacing--xl);align-items:center;gap:var(--spacing--2xs);text-align:center;flex-direction:column;display:flex}._text-content_k3net_187{gap:var(--spacing--sm);flex-direction:column;display:flex}._permission-list_k3net_193{gap:var(--spacing--2xs);padding-left:var(--spacing--lg);flex-direction:column;list-style-type:disc;display:flex}._permission-list_k3net_193 li,._docs-link_k3net_205{color:var(--color--text);font-size:var(--font-size--2xs)}._footer_k3net_210{justify-content:center;gap:var(--spacing--sm);flex-direction:column;width:100%;display:flex}._footer_k3net_210 .notice{margin:0}._footer_k3net_210 ._button-group_k3net_220{justify-content:center;gap:var(--spacing--2xs);display:flex}\n/*$vite$:1*/",document.head.appendChild(A);try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(R=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[R]="5ecb2295-5398-4de2-b4f7-bc1a09843232",t._sentryDebugIdIdentifier="sentry-dbid-5ecb2295-5398-4de2-b4f7-bc1a09843232")}catch(t){}var t,R;I=V(N.CONSENT,(()=>{const e=l(null),t=l(!1),n=l(null),a=D();return{fetchConsentDetails:async()=>{t.value=!0,n.value=null;try{return e.value=await async function(e){return await z(e,"GET","/consent/details")}(a.restApiContext),e.value}catch(s){throw n.value=s instanceof Error?s.message:"Failed to load consent details",s}finally{t.value=!1}},approveConsent:async e=>{t.value=!0,n.value=null;try{return await async function(e,t){return await z(e,"POST","/consent/approve",{approved:t})}(a.restApiContext,e)}catch(s){throw n.value=s instanceof Error?s.message:"Failed to process consent",s}finally{t.value=!1}},resetState:()=>{e.value=null,t.value=!1,n.value=null},consentDetails:e,isLoading:t,error:n}})),e("default",C(i({__name:"OAuthConsentView",setup(e){const t=["claude","mcp inspector"],i=["lovable"],C=I(),V=h(),z=j(),D=E(),N=l(!1),A=r((()=>C.error)),R=r((()=>C.isLoading)),L=r((()=>C.consentDetails)),O=r((()=>{const e=L.value?.clientName?.toLowerCase()??"";return t.some((t=>e.includes(t)))?"anthropic":i.some((t=>e.includes(t)))?"lovable":"mcp"})),F=async()=>{try{const e=await C.approveConsent(!0);N.value=!0,window.location.href=e.redirectUrl}catch(e){D.showError(e,V.baseText("oauth.consentView.error.allow"))}},U=async()=>{try{const e=await C.approveConsent(!1);window.location.href=e.redirectUrl}catch(e){D.showError(e,V.baseText("oauth.consentView.error.deny"))}};return g((async()=>{z.set(V.baseText("oauth.consentView.title"));try{await C.fetchConsentDetails()}catch(e){D.showError(e,V.baseText("oauth.consentView.error.fetchDetails"))}})),(e,t)=>{const l=y("n8n-html");return n(),o("div",{class:_(e.$style.overlay)},[s("div",{class:_(e.$style["consent-dialog"])},[s("header",{class:_(e.$style.header)},[s("div",{class:_([e.$style.logo,e.$style.n8n])},[f(u(w),{size:"small",collapsed:!0,"release-channel":"stable"})],2),s("div",{class:_(e.$style.arrow)},[f(u(k),{icon:"arrow-right",size:"large",color:"text-light"})],2),s("div",{class:_(e.$style.logo)},[f(u(k),{icon:O.value,size:"xlarge",color:"text-dark"},null,8,["icon"])],2)],2),N.value?(n(),o("div",{key:0,class:_(e.$style.success),"data-test-id":"consent-success-screen"},[f(u(x),{tag:"h2",size:"large",bold:!0},{default:b((()=>[a(c(u(V).baseText("oauth.consentView.success.title")),1)])),_:1}),f(u(T),{color:"text-base"},{default:b((()=>[a(c(u(V).baseText("oauth.consentView.success.description")),1)])),_:1})],2)):(n(),o("div",{key:1,class:_(e.$style.content),"data-test-id":"consent-content"},[f(u(x),{tag:"h2",size:"large",bold:!0},{default:b((()=>[a(c(u(V).baseText("oauth.consentView.heading",{interpolate:{clientName:L.value?.clientName??""}})),1)])),_:1}),s("div",{class:_(e.$style["text-content"])},[f(u(T),{color:"text-base",size:"small"},{default:b((()=>[a(c(u(V).baseText("oauth.consentView.description",{interpolate:{clientName:L.value?.clientName??""}})),1)])),_:1}),s("ul",{class:_(e.$style["permission-list"])},[s("li",null,c(u(V).baseText("oauth.consentView.action.listWorkflows")),1),s("li",null,c(u(V).baseText("oauth.consentView.action.workflowDetails")),1),s("li",null,c(u(V).baseText("oauth.consentView.action.executeWorkflows")),1)],2),s("p",{class:_(e.$style["docs-link"])},[p(s("span",null,null,512),[[l,u(V).baseText("oauth.consentView.readMore",{interpolate:{docsUrl:u(S)}})]])],2)],2)],2)),N.value?d("",!0):(n(),o("footer",{key:2,class:_(e.$style.footer)},[A.value?(n(),v(u(m),{key:0,theme:"danger","data-test-id":"consent-error-notice",content:A.value},null,8,["content"])):d("",!0),s("div",{class:_(e.$style["button-group"])},[f(u($),{variant:"subtle","data-test-id":"consent-deny-button",size:"large",loading:R.value,disabled:R.value||null!==A.value,onClick:U},{default:b((()=>[a(c(u(V).baseText("generic.deny")),1)])),_:1},8,["loading","disabled"]),f(u($),{variant:"solid","data-test-id":"consent-allow-button",size:"large",loading:R.value,disabled:R.value||null!==A.value,onClick:F},{default:b((()=>[a(c(u(V).baseText("generic.allow")),1)])),_:1},8,["loading","disabled"])],2)],2))],2)],2)}}}),[["__cssModules",{$style:{overlay:"_overlay_k3net_125","consent-dialog":"_consent-dialog_k3net_138",header:"_header_k3net_151",logo:"_logo_k3net_157",n8n:"_n8n_k3net_166",content:"_content_k3net_171",success:"_success_k3net_178","text-content":"_text-content_k3net_187","permission-list":"_permission-list_k3net_193","docs-link":"_docs-link_k3net_205",footer:"_footer_k3net_210","button-group":"_button-group_k3net_220"}}]]))}}}));
//# sourceMappingURL=OAuthConsentView-legacy-DxrUgvHM.js.map