import{aA as F,a7 as x,a8 as i,b as S,M as A,P as D,d as E}from"./app-QjDgb7aF.js";import{F as P}from"./section-Dbg05qO2.js";import{b as j,ab as q,a as d,j as J,p as L,k as a,i as o,J as t,I as n,u as s,q as M,D as T}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const W={class:"_formRoot"},z={class:"_formBlock",style:{display:"flex",gap:"var(--margin)","flex-wrap":"wrap"}},X=j({__name:"webhook.edit",props:{webhookId:{}},async setup(I){let g,R;const N=I,u=([g,R]=q(()=>E("i/webhooks/show",{webhookId:N.webhookId})),g=await g,R(),g);let r=d(u.name),p=d(u.url),f=d(u.secret),V=d(u.active),k=d(u.on.includes("follow")),v=d(u.on.includes("followed")),w=d(u.on.includes("note")),b=d(u.on.includes("reply")),B=d(u.on.includes("renote")),y=d(u.on.includes("reaction")),U=d(u.on.includes("mention"));async function C(){const m=[];k.value&&m.push("follow"),v.value&&m.push("followed"),w.value&&m.push("note"),b.value&&m.push("reply"),B.value&&m.push("renote"),y.value&&m.push("reaction"),U.value&&m.push("mention"),D("i/webhooks/update",{name:r.value,url:p.value,secret:f.value,on:m,active:V.value})}return F({title:"Edit webhook",icon:"ph-webhooks-logo ph-bold ph-lg"}),(m,l)=>(J(),L("div",W,[a(x,{modelValue:s(r),"onUpdate:modelValue":l[0]||(l[0]=e=>n(r)?r.value=e:r=e),class:"_formBlock"},{label:o(()=>[...l[11]||(l[11]=[t("Name",-1)])]),_:1},8,["modelValue"]),a(x,{modelValue:s(p),"onUpdate:modelValue":l[1]||(l[1]=e=>n(p)?p.value=e:p=e),type:"url",class:"_formBlock"},{label:o(()=>[...l[12]||(l[12]=[t("URL",-1)])]),_:1},8,["modelValue"]),a(x,{modelValue:s(f),"onUpdate:modelValue":l[2]||(l[2]=e=>n(f)?f.value=e:f=e),class:"_formBlock"},{prefix:o(()=>[...l[13]||(l[13]=[M("i",{class:"ph-lock ph-bold ph-lg"},null,-1)])]),label:o(()=>[...l[14]||(l[14]=[t("Secret",-1)])]),_:1},8,["modelValue"]),a(P,null,{label:o(()=>[...l[15]||(l[15]=[t("Events",-1)])]),default:o(()=>[a(i,{modelValue:s(k),"onUpdate:modelValue":l[3]||(l[3]=e=>n(k)?k.value=e:k=e),class:"_formBlock"},{default:o(()=>[...l[16]||(l[16]=[t("Follow",-1)])]),_:1},8,["modelValue"]),a(i,{modelValue:s(v),"onUpdate:modelValue":l[4]||(l[4]=e=>n(v)?v.value=e:v=e),class:"_formBlock"},{default:o(()=>[...l[17]||(l[17]=[t("Followed",-1)])]),_:1},8,["modelValue"]),a(i,{modelValue:s(w),"onUpdate:modelValue":l[5]||(l[5]=e=>n(w)?w.value=e:w=e),class:"_formBlock"},{default:o(()=>[...l[18]||(l[18]=[t("Note",-1)])]),_:1},8,["modelValue"]),a(i,{modelValue:s(b),"onUpdate:modelValue":l[6]||(l[6]=e=>n(b)?b.value=e:b=e),class:"_formBlock"},{default:o(()=>[...l[19]||(l[19]=[t("Reply",-1)])]),_:1},8,["modelValue"]),a(i,{modelValue:s(B),"onUpdate:modelValue":l[7]||(l[7]=e=>n(B)?B.value=e:B=e),class:"_formBlock"},{default:o(()=>[...l[20]||(l[20]=[t("Renote",-1)])]),_:1},8,["modelValue"]),a(i,{modelValue:s(y),"onUpdate:modelValue":l[8]||(l[8]=e=>n(y)?y.value=e:y=e),class:"_formBlock"},{default:o(()=>[...l[21]||(l[21]=[t("Reaction",-1)])]),_:1},8,["modelValue"]),a(i,{modelValue:s(U),"onUpdate:modelValue":l[9]||(l[9]=e=>n(U)?U.value=e:U=e),class:"_formBlock"},{default:o(()=>[...l[22]||(l[22]=[t("Mention",-1)])]),_:1},8,["modelValue"])]),_:1}),a(i,{modelValue:s(V),"onUpdate:modelValue":l[10]||(l[10]=e=>n(V)?V.value=e:V=e),class:"_formBlock"},{default:o(()=>[...l[23]||(l[23]=[t("Active",-1)])]),_:1},8,["modelValue"]),M("div",z,[a(A,{primary:"",inline:"",onClick:C},{default:o(()=>[l[24]||(l[24]=M("i",{class:"ph-check ph-bold ph-lg"},null,-1)),t(" "+T(s(S).ts.save),1)]),_:1})])]))}});export{X as default};
//# sourceMappingURL=webhook.edit-CF9Z6YvG.js.map
