1import{b,c as f,D as I,o as r,e as d,f as e,A as u,z as p,F as D,B as i,q as S,J as z,M as B,m as M}from"./vue-C6nllh_u.js";import{a as T}from"./vue-router-A_znAoLq.js";import{t as q,aN as V,ae as g,aB as P}from"./public-shell-DffRkNN5.js";import{m as R,t as $}from"./api-C_0bJB54.js";import"./timezone-8aG20R5G.js";import"./axios-pRYd_7-C.js";import"./content-Eu3Uj9Gq.js";import"./guestSession-DwsUpiJF.js";import"./mixpanel-CC0U2lnZ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"7c7a840cab72dfbf1e05cb33c0b815fac74b80f2"};var c=new a.Error().stack;c&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[c]="1ed9fbf5-53e8-426b-b21d-7a4e65ea9e54",a._sentryDebugIdIdentifier="sentry-dbid-1ed9fbf5-53e8-426b-b21d-7a4e65ea9e54")}catch{}})();const j={class:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 px-4 py-10"},U={class:"w-full max-w-md"},F={class:"card !p-0 overflow-hidden"},L={class:"p-6 sm:p-7"},W={class:"flex items-center gap-3 mb-5"},X={class:"flex h-11 w-11 items-center justify-center rounded-xl bg-sky-50 text-sky-600 dark:bg-sky-900/30 dark:text-sky-300"},Y={class:"min-w-0"},J={class:"text-sm text-gray-500 dark:text-gray-400 truncate"},O={key:0,class:"text-sm text-red-600 dark:text-red-400"},G={class:"text-sm text-gray-700 dark:text-gray-300 mb-3"},H={class:"font-semibold"},K={class:"rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800/40 p-3 mb-4"},Q={class:"text-xs text-red-800 dark:text-red-300"},Z={class:"rounded-xl border border-gray-200 dark:border-gray-700 p-4 mb-4 space-y-3"},ee={class:"flex items-start gap-3"},te={key:0,class:"flex items-start gap-3"},se={class:"flex items-start gap-3"},ae={class:"text-sm text-gray-500 dark:text-gray-400"},re={key:0,class:"flex items-start gap-3 rounded-xl border border-gray-200 dark:border-gray-700 p-4 mb-5 cursor-pointer"},oe={class:"flex gap-3"},ne=["disabled"],de=["disabled"],ie={key:1},xe={__name:"ConnectMcp",setup(a){const c=T(),o=b(!1),s=c.query,x=String(s.client_id||""),C=String(s.client_name||""),_=String(s.redirect_uri||""),v=String(s.code_challenge||""),A=String(s.code_challenge_method||"S256");String(s.scope||"notes.read");const N=s.state!=null?String(s.state):"",m=b(!1),l=b(!1),k=f(()=>!x||!_||!v),h=f(()=>C||"An application"),E=f(()=>q()?.email||"your account");I(async()=>{try{(await R.getMySubscription())?.plan?.features?.mcpAccess==="readwrite"&&(m.value=!0)}catch{m.value=!1}});const w=async y=>{if(!k.value){o.value=!0;try{const t=m.value&&l.value,n=await $.approveConsent({client_id:x,redirect_uri:_,code_challenge:v,code_challenge_method:A,scope:t?"notes.read notes.write":"notes.read",state:N,response_type:"code",approved:y});if(n?.redirect){window.location.href=n.redirect;return}throw new Error("No redirect returned")}catch{V("Could not complete the connection. Please try again.","error"),o.value=!1}}};return(y,t)=>(r(),d("div",j,[e("div",U,[e("div",F,[e("div",L,[e("div",W,[e("span",X,[u(g,{name:"mcp",size:22})]),e("div",Y,[t[3]||(t[3]=e("h1",{class:"text-lg font-bold text-gray-900 dark:text-gray-100 leading-tight"}," Connect to XpressNotes ",-1)),e("p",J,p(E.value),1)])]),k.value?(r(),d("p",O," This connection request is missing required information or is invalid. Please start the connection again from your app. ")):(r(),d(D,{key:1},[e("p",G,[e("span",H,p(h.value),1),t[4]||(t[4]=i(" wants permission to access your XpressNotes account. ",-1))]),e("div",K,[e("p",Q," Only approve if you started this from "+p(h.value)+". ",1)]),e("div",Z,[e("div",ee,[u(g,{name:"search",size:18,class:"mt-0.5 text-emerald-600 dark:text-emerald-400"}),t[5]||(t[5]=e("p",{class:"text-sm text-gray-700 dark:text-gray-300"},[e("span",{class:"font-medium"},"Read"),i(" your notes, notebooks, and diaries. ")],-1))]),l.value?(r(),d("div",te,[u(g,{name:"edit",size:18,class:"mt-0.5 text-amber-600 dark:text-amber-400"}),t[6]||(t[6]=e("p",{class:"text-sm text-gray-700 dark:text-gray-300"},[e("span",{class:"font-medium"},"Create, edit, and delete"),i(" notes, and upload images, videos, and files, on your behalf. ")],-1))])):S("",!0),e("div",se,[u(g,{name:"lock",size:18,class:"mt-0.5 text-gray-400"}),e("p",ae,[t[7]||(t[7]=i(" It ",-1)),t[8]||(t[8]=e("span",{class:"font-medium"},"cannot",-1)),i(" "+p(l.value?"read or change locked notes, and cannot touch your account or billing.":"read locked notes, and cannot create, edit, or delete anything."),1)])])]),m.value?(r(),d("label",re,[z(e("input",{type:"checkbox","onUpdate:modelValue":t[0]||(t[0]=n=>l.value=n),class:"mt-0.5 h-4 w-4 flex-shrink-0"},null,512),[[B,l.value]]),t[9]||(t[9]=e("span",{class:"text-sm text-gray-700 dark:text-gray-300"},[e("span",{class:"font-medium"},"Allow editing"),i(" â let this app create, edit, and delete notes, and upload images, videos, and files. ")],-1))])):S("",!0),t[10]||(t[10]=e("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-5"}," You can disconnect this app anytime from Apps & devices in your account. ",-1)),e("div",oe,[e("button",{type:"button",class:"flex-1 rounded-lg border border-gray-300 dark:border-gray-600 px-4 py-2.5 text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-800 disabled:opacity-50",disabled:o.value,onClick:t[1]||(t[1]=n=>w(!1))}," Deny ",8,ne),e("button",{type:"button",class:"flex-1 rounded-lg bg-xn-primary px-4 py-2.5 text-sm font-semibold text-white hover:bg-xn-primary-dark disabled:opacity-60 inline-flex items-center justify-center gap-2",disabled:o.value,onClick:t[2]||(t[2]=n=>w(!0))},[o.value?(r(),M(P,{key:0,size:"sm"})):(r(),d("span",ie,"Approve"))],8,de)])],64))])])])]))}};export{xe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.