import{$ as b,a4 as x,i as a,r as k,M as l,aI as B}from"./app-JmgyQoR0.js";import{F as v}from"./section-yxO0GkeZ.js";import{b as D,a as w,c as f,e as F,w as G,h as t,t as m,z as n,i as s,j as i,K as c,E as o,u,H as d}from"./vue-y3KLWBaS.js";const M={class:"_formRoot"},I=u("i",{class:"ph-discord-logo ph-bold ph-lg"},null,-1),N={key:0},T=["href"],V=u("i",{class:"ph-github-logo ph-bold ph-lg"},null,-1),E={key:0},H=["href"],P=D({__name:"integration",setup(W){const h=w(null),p=w(null),e=f(()=>b.integrations);function r(_,g){return window.open(`${B}/${g}/${_}`,`${_}_${g}_window`,"height=570, width=520")}function y(){h.value=r("discord","connect")}function $(){r("discord","disconnect")}function C(){p.value=r("github","connect")}function S(){r("github","disconnect")}return F(()=>{document.cookie=`igi=${b.token}; path=/; max-age=31536000;`+(document.location.protocol.startsWith("https")?" secure":""),G(e,()=>{e.value.discord&&h.value&&h.value.close(),e.value.github&&p.value&&p.value.close()})}),f(()=>[]),f(()=>[]),x({title:a.ts.integration,icon:"ph-share-network ph-bold ph-lg"}),(_,g)=>(t(),m("div",M,[n(k).enableDiscordIntegration?(t(),s(v,{key:0},{label:i(()=>[I,c(" Discord")]),default:i(()=>[e.value.discord?(t(),m("p",N,[c(o(n(a).ts.connectedTo)+": ",1),u("a",{href:`https://discord.com/users/${e.value.discord.id}`,rel:"nofollow noopener",target:"_blank"},"@"+o(e.value.discord.username)+"#"+o(e.value.discord.discriminator),9,T)])):d("",!0),e.value.discord?(t(),s(l,{key:1,danger:"",onClick:$},{default:i(()=>[c(o(n(a).ts.disconnectService),1)]),_:1})):(t(),s(l,{key:2,primary:"",onClick:y},{default:i(()=>[c(o(n(a).ts.connectService),1)]),_:1}))]),_:1})):d("",!0),n(k).enableGithubIntegration?(t(),s(v,{key:1},{label:i(()=>[V,c(" GitHub")]),default:i(()=>[e.value.github?(t(),m("p",E,[c(o(n(a).ts.connectedTo)+": ",1),u("a",{href:`https://github.com/${e.value.github.login}`,rel:"nofollow noopener",target:"_blank"},"@"+o(e.value.github.login),9,H)])):d("",!0),e.value.github?(t(),s(l,{key:1,danger:"",onClick:S},{default:i(()=>[c(o(n(a).ts.disconnectService),1)]),_:1})):(t(),s(l,{key:2,primary:"",onClick:C},{default:i(()=>[c(o(n(a).ts.connectService),1)]),_:1}))]),_:1})):d("",!0)]))}});export{P as default};
