1import{r as c,o as m,c as p,Q as n,y as g,V as h,a as e,N as o,W as v,M as w,J as x,F as k,P as $,an as S,m as T}from"./vue-vendor-D0krlAb0.js";import{a as A}from"./axios-vendor-D8QQWGbA.js";import{h as C}from"./inertia-vendor-B1UleJax.js";import{_ as N}from"./AuthenticationCard-B-rRTQTN.js";import{_ as V}from"./AuthenticationCardLogo-CcSGOq1J.js";import{c as q,d as I,f as U,b as W}from"./app-BfyP88rG.js";import"./echo-vendor-BBfRIm2m.js";import"./vendor-By_xewFp.js";import"./lodash-vendor-C9X7AA5U.js";import"./tel-input-vendor-Dsa4Ey81.js";import"./vue-i18n-D1druVO5.js";import"./stripe-vendor-CPICCz1r.js";import"./pinia-vendor-BDcgz45G.js";const D={class:"text-lg font-semibold text-slate-900 dark:text-white"},E={class:"mt-1 text-sm font-medium text-slate-700 dark:text-slate-200"},F={class:"mt-3 text-sm text-slate-600 dark:text-slate-300"},B={key:0,class:"mt-2 text-xs text-slate-500 dark:text-slate-400"},H={class:"font-mono text-slate-700 dark:text-slate-200"},j={class:"mt-5"},z=["disabled"],L=["value"],M={class:"mt-6 flex items-center justify-end gap-3"},O=["action"],P=["value"],J=["value"],Q=["value"],Y=["value"],G=["action"],K=["value"],R=["value"],X=["value"],Z=["value"],pe={__name:"OAuthAuthorize",props:{client:{type:Object,required:!0},authToken:{type:String,required:!0},state:{type:String,default:""},csrfToken:{type:String,required:!0},workspaces:{type:Array,default:()=>[]},currentWorkspaceId:{type:Number,default:null},redirectHost:{type:String,default:""},approveUrl:{type:String,required:!0},denyUrl:{type:String,required:!0}},setup(t){var y;const d=t,_=d.workspaces.some(a=>a.id===d.currentWorkspaceId),r=c(_?d.currentWorkspaceId:((y=d.workspaces[0])==null?void 0:y.id)??null),f=c(null),i=c(!1),u=c(""),b=async()=>{var a,l;i.value=!0,u.value="";try{await A.post(route("oauth.mcp-grant.store"),{client_id:d.client.id,team_id:r.value}),f.value.submit()}catch(s){u.value=((l=(a=s==null?void 0:s.response)==null?void 0:a.data)==null?void 0:l.message)??"Your workspace choice could not be saved. Please try again.",i.value=!1}};return(a,l)=>(m(),p(k,null,[n(g(C),{title:a.$t("Connect Claude")},null,8,["title"]),n(N,null,{logo:h(()=>[n(V)]),default:h(()=>[e("h1",D,o(a.$t("Allow this app to access Sales Automation?")),1),e("p",E,o(t.client.name),1),e("p",F,o(a.$t("It will be able to read and change data in the workspace you choose, acting as you.")),1),t.redirectHost?(m(),p("p",B,[v(o(a.$t("After you decide, you will be sent back to:"))+" ",1),e("span",H,o(t.redirectHost),1)])):w("",!0),e("div",j,[n(q,{for:"oauth-workspace",value:a.$t("Workspace")},null,8,["value"]),x(e("select",{id:"oauth-workspace","onUpdate:modelValue":l[0]||(l[0]=s=>r.value=s),disabled:i.value,class:"mt-1 block w-full rounded-xl border-slate-300 bg-white/80 text-sm text-slate-900 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:border-white/10 dark:bg-slate-900/60 dark:text-white"},[(m(!0),p(k,null,$(t.workspaces,s=>(m(),p("option",{key:s.id,value:s.id},o(s.name),9,L))),128))],8,z),[[S,r.value]]),n(I,{class:"mt-2",message:u.value?a.$t(u.value):""},null,8,["message"])]),e("div",M,[e("form",{action:t.denyUrl,method:"post"},[l[1]||(l[1]=e("input",{type:"hidden",name:"_method",value:"DELETE"},null,-1)),e("input",{type:"hidden",name:"_token",value:t.csrfToken},null,8,P),e("input",{type:"hidden",name:"state",value:t.state},null,8,J),e("input",{type:"hidden",name:"client_id",value:t.client.id},null,8,Q),e("input",{type:"hidden",name:"auth_token",value:t.authToken},null,8,Y),n(U,{type:"submit",disabled:i.value},{default:h(()=>[v(o(a.$t("Deny")),1)]),_:1},8,["disabled"])],8,O),n(W,{type:"button",class:T({"opacity-25":i.value}),disabled:i.value||!r.value,onClick:b},{default:h(()=>[v(o(a.$t("Allow")),1)]),_:1},8,["class","disabled"])]),e("form",{ref_key:"approveForm",ref:f,action:t.approveUrl,method:"post",class:"hidden"},[e("input",{type:"hidden",name:"_token",value:t.csrfToken},null,8,K),e("input",{type:"hidden",name:"state",value:t.state},null,8,R),e("input",{type:"hidden",name:"client_id",value:t.client.id},null,8,X),e("input",{type:"hidden",name:"auth_token",value:t.authToken},null,8,Z)],8,G)]),_:1})],64))}};export{pe 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.