import{b as m,a8 as M,a9 as D,a7 as v,M as U,d as I,P as F,br as G,aA as P}from"./app-QjDgb7aF.js";import{F as V}from"./suspense-jJyLIr98.js";import{b as y,j as C,g as B,i as e,q as d,k as s,J as u,D as f,u as t,I as g,p as w,F as R,H,a as p,E as _,f as S}from"./vue-Cm77DuTi.js";import{F as x}from"./folder-DKyFtE95.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const A={class:"_formRoot"},E=y({__name:"integrations.github",setup(h){let b=p(""),n=p(!1),i=p(null),r=p(null);async function k(){const a=await I("admin/meta");b.value=a.uri,n.value=a.enableGithubIntegration,i.value=a.githubClientId,r.value=a.githubClientSecret}function c(){F("admin/update-meta",{enableGithubIntegration:n.value,githubClientId:i.value,githubClientSecret:r.value}).then(()=>{G()})}return(a,l)=>(C(),B(V,{p:k},{default:e(()=>[d("div",A,[s(M,{modelValue:t(n),"onUpdate:modelValue":l[0]||(l[0]=o=>g(n)?n.value=o:n=o),class:"_formBlock"},{label:e(()=>[u(f(t(m).ts.enable),1)]),_:1},8,["modelValue"]),t(n)?(C(),w(R,{key:0},[s(D,{class:"_formBlock"},{default:e(()=>[u("Callback URL: "+f(`${t(b)}/api/gh/cb`),1)]),_:1}),s(v,{modelValue:t(i),"onUpdate:modelValue":l[1]||(l[1]=o=>g(i)?i.value=o:i=o),class:"_formBlock"},{prefix:e(()=>[...l[3]||(l[3]=[d("i",{class:"ph-key ph-bold ph-lg"},null,-1)])]),label:e(()=>[...l[4]||(l[4]=[u("Client ID",-1)])]),_:1},8,["modelValue"]),s(v,{modelValue:t(r),"onUpdate:modelValue":l[2]||(l[2]=o=>g(r)?r.value=o:r=o),class:"_formBlock"},{prefix:e(()=>[...l[5]||(l[5]=[d("i",{class:"ph-key ph-bold ph-lg"},null,-1)])]),label:e(()=>[...l[6]||(l[6]=[u("Client Secret",-1)])]),_:1},8,["modelValue"])],64)):H("",!0),s(U,{primary:"",class:"_formBlock",onClick:c},{default:e(()=>[l[7]||(l[7]=d("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1)),u(" "+f(t(m).ts.save),1)]),_:1})])]),_:1}))}}),L={class:"_formRoot"},T=y({__name:"integrations.discord",setup(h){let b=p(""),n=p(!1),i=p(null),r=p(null);async function k(){const a=await I("admin/meta");b.value=a.uri,n.value=a.enableDiscordIntegration,i.value=a.discordClientId,r.value=a.discordClientSecret}function c(){F("admin/update-meta",{enableDiscordIntegration:n.value,discordClientId:i.value,discordClientSecret:r.value}).then(()=>{G()})}return(a,l)=>(C(),B(V,{p:k},{default:e(()=>[d("div",L,[s(M,{modelValue:t(n),"onUpdate:modelValue":l[0]||(l[0]=o=>g(n)?n.value=o:n=o),class:"_formBlock"},{label:e(()=>[u(f(t(m).ts.enable),1)]),_:1},8,["modelValue"]),t(n)?(C(),w(R,{key:0},[s(D,{class:"_formBlock"},{default:e(()=>[u("Callback URL: "+f(`${t(b)}/api/dc/cb`),1)]),_:1}),s(v,{modelValue:t(i),"onUpdate:modelValue":l[1]||(l[1]=o=>g(i)?i.value=o:i=o),class:"_formBlock"},{prefix:e(()=>[...l[3]||(l[3]=[d("i",{class:"ph-key ph-bold ph-lg"},null,-1)])]),label:e(()=>[...l[4]||(l[4]=[u("Client ID",-1)])]),_:1},8,["modelValue"]),s(v,{modelValue:t(r),"onUpdate:modelValue":l[2]||(l[2]=o=>g(r)?r.value=o:r=o),class:"_formBlock"},{prefix:e(()=>[...l[5]||(l[5]=[d("i",{class:"ph-key ph-bold ph-lg"},null,-1)])]),label:e(()=>[...l[6]||(l[6]=[u("Client Secret",-1)])]),_:1},8,["modelValue"])],64)):H("",!0),s(U,{primary:"",class:"_formBlock",onClick:c},{default:e(()=>[l[7]||(l[7]=d("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1)),u(" "+f(t(m).ts.save),1)]),_:1})])]),_:1}))}}),O=y({__name:"integrations",setup(h){let b=p(!1),n=p(!1);async function i(){const c=await I("admin/meta");b.value=c.enableGithubIntegration,n.value=c.enableDiscordIntegration}const r=S(()=>[]),k=S(()=>[]);return P({title:m.ts.integration,icon:"ph-plug ph-bold ph-lg"}),(c,a)=>{const l=_("MkPageHeader"),o=_("MkSpacer"),N=_("MkStickyContainer");return C(),B(N,null,{header:e(()=>[s(l,{actions:r.value,tabs:k.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:e(()=>[s(o,{"content-max":700,"margin-min":16,"margin-max":32},{default:e(()=>[s(V,{p:i},{default:e(()=>[s(x,{class:"_formBlock"},{icon:e(()=>[...a[0]||(a[0]=[d("i",{class:"ph-github-logo ph-bold ph-lg"},null,-1)])]),label:e(()=>[...a[1]||(a[1]=[u("GitHub",-1)])]),suffix:e(()=>[u(f(t(b)?t(m).ts.enabled:t(m).ts.disabled),1)]),default:e(()=>[s(E)]),_:1}),s(x,{class:"_formBlock"},{icon:e(()=>[...a[2]||(a[2]=[d("i",{class:"ph-discord-logo ph-bold ph-lg"},null,-1)])]),label:e(()=>[...a[3]||(a[3]=[u("Discord",-1)])]),suffix:e(()=>[u(f(t(n)?t(m).ts.enabled:t(m).ts.disabled),1)]),default:e(()=>[s(T)]),_:1})]),_:1})]),_:1})]),_:1})}}});export{O as default};
//# sourceMappingURL=integrations-1iTLAm7D.js.map
