import{i as a,a4 as C,M as B,v as I,f as p,g as m,n as w}from"./app-JmgyQoR0.js";import{b as j,a as F,c as k,D as u,h as s,i as N,j as r,l as h,t as c,G as P,u as i,E as _,z as y,K as R,F as T,I as V,J as D}from"./vue-y3KLWBaS.js";const E=l=>(V("data-v-f9e0b6ba"),l=l(),D(),l),H={class:"status"},$={key:0,class:"ph-check ph-bold ph-lg icon accepted"},q={key:1,class:"ph-prohibit ph-bold ph-lg icon rejected"},z={key:2,class:"ph-clock ph-bold ph-lg icon requesting"},A=E(()=>i("i",{class:"ph-trash ph-bold ph-lg"},null,-1)),G=j({__name:"relays",setup(l){let b=F([]);async function f(){const{canceled:e,result:n}=await I({title:a.ts.addRelay,type:"url",placeholder:a.ts.inboxUrl});e||p("admin/relays/add",{inbox:n}).then(o=>{d()}).catch(o=>{m({type:"error",text:o.message||o})})}function g(e){p("admin/relays/remove",{inbox:e}).then(()=>{d()}).catch(n=>{m({type:"error",text:n.message||n})})}function d(){p("admin/relays/list").then(e=>{b.value=e})}d();const x=k(()=>[{asFullButton:!0,icon:"ph-plus ph-bold ph-lg",text:a.ts.addRelay,handler:f}]),v=k(()=>[]);return C({title:a.ts.relays,icon:"ph-arrows-merge ph-bold ph-lg"}),(e,n)=>{const o=u("MkPageHeader"),M=u("MkSpacer"),S=u("MkStickyContainer");return s(),N(S,null,{header:r(()=>[h(o,{actions:x.value,tabs:v.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:r(()=>[h(M,{"content-max":800},{default:r(()=>[(s(!0),c(T,null,P(b.value,t=>(s(),c("div",{key:t.inbox,class:"relaycxt _panel _block",style:{padding:"16px"}},[i("div",null,_(t.inbox),1),i("div",H,[t.status==="accepted"?(s(),c("i",$)):t.status==="rejected"?(s(),c("i",q)):(s(),c("i",z)),i("span",null,_(y(a).t(`_relayStatus.${t.status}`)),1)]),h(B,{class:"button",inline:"",danger:"",onClick:J=>g(t.inbox)},{default:r(()=>[A,R(" "+_(y(a).ts.remove),1)]),_:2},1032,["onClick"])]))),128))]),_:1})]),_:1})}}}),U=w(G,[["__scopeId","data-v-f9e0b6ba"]]);export{U as default};
