import{b4 as v,a9 as h,b as i,a7 as A,M as g,a8 as B,a5 as P}from"./app-QjDgb7aF.js";import{b as $,a as b,j as f,g as y,i as a,p as V,k as c,J as m,D as n,H as I,q as r,u as o,I as T,F as U,G as j}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const D={key:0,class:"_section"},E={class:"_section"},F={style:{"margin-bottom":"16px"}},G={class:"_section"},O={style:{"margin-bottom":"16px"}},J=$({__name:"MkTokenGenerateWindow",props:{title:{default:null},information:{default:null},initialName:{default:null},initialPermissions:{default:null}},emits:["closed","done"],setup(u,{emit:x}){const p=u,_=x,k=b();let d=b(p.initialName),t=b({});if(p.initialPermissions)for(const e of p.initialPermissions)t.value[e]=!0;else for(const e of v.permissions)t.value[e]=!1;function w(){_("done",{name:d.value,permissions:Object.keys(t.value).filter(e=>t.value[e])}),k.value.close()}function C(){for(const e in t.value)t.value[e]=!1}function M(){for(const e in t.value)t.value[e]=!0}return(e,l)=>(f(),y(P,{ref_key:"dialog",ref:k,width:400,height:600,"with-ok-button":!0,"ok-button-disabled":!1,"can-close":!1,onClose:l[1]||(l[1]=s=>k.value.close()),onClosed:l[2]||(l[2]=s=>e.$emit("closed")),onOk:l[3]||(l[3]=s=>w()),style:{padding:"12px"}},{header:a(()=>[m(n(u.title||o(i).ts.generateAccessToken),1)]),default:a(()=>[u.information?(f(),V("div",D,[c(h,{warn:""},{default:a(()=>[m(n(u.information),1)]),_:1})])):I("",!0),r("div",E,[r("div",F,[r("b",null,n(o(i).ts.name),1)]),c(A,{style:{"margin-bottom":"16px"},modelValue:o(d),"onUpdate:modelValue":l[0]||(l[0]=s=>T(d)?d.value=s:d=s)},null,8,["modelValue"])]),r("div",G,[r("div",O,[r("b",null,n(o(i).ts.permission),1)]),c(g,{inline:"",onClick:C},{default:a(()=>[m(n(o(i).ts.disableAll),1)]),_:1}),c(g,{style:{"margin-bottom":"12px"},inline:"",onClick:M},{default:a(()=>[m(n(o(i).ts.enableAll),1)]),_:1}),(f(!0),V(U,null,j(u.initialPermissions||o(v.permissions),s=>(f(),y(B,{style:{"margin-bottom":"6px"},key:s,modelValue:o(t)[s],"onUpdate:modelValue":N=>o(t)[s]=N},{default:a(()=>[m(n(o(i).t(`_permissions.${s}`)),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))])]),_:1},512))}});export{J as default};
//# sourceMappingURL=MkTokenGenerateWindow-Pr3eS6cf.js.map
