import{l as w}from"./index-8HslT92O.js";import{b9 as x,aA as D,b as a,af as F,a7 as I,aB as g,M as R,as as S,at as y}from"./app-QjDgb7aF.js";import{g as $,r as j}from"./theme-store-CQRTJOWj.js";import{b as q,a as T,j as s,p as i,k as f,i as u,q as p,u as l,F as h,G as B,D as n,J as m,g as C,H as _,f as k}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const A={class:"_formRoot"},E=["label"],G=["value"],H=["label"],J=["value"],W=q({__name:"theme.manage",setup(L){const d=T($()),v=x(),r=T(null),V=k(()=>[...d.value,...v.value]),t=k(()=>r.value==null?null:V.value.find(c=>c.id===r.value)),b=k(()=>t.value==null?null:w.stringify(t.value,null,"	"));async function M(){await S(b.value??""),await y()}function N(){j(t.value),d.value=d.value.filter(c=>c.id!==r.value),r.value=null,y()}return D({title:a.ts._theme.manage,icon:"ph-folder-notch-open ph-bold ph-lg"}),(c,o)=>(s(),i("div",A,[f(F,{modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=e=>r.value=e),class:"_formBlock"},{label:u(()=>[m(n(l(a).ts.theme),1)]),default:u(()=>[p("optgroup",{label:l(a).ts._theme.installedThemes},[(s(!0),i(h,null,B(d.value,e=>(s(),i("option",{key:e.id,value:e.id},n(e.name),9,G))),128))],8,E),p("optgroup",{label:l(a).ts._theme.builtinThemes},[(s(!0),i(h,null,B(l(v),e=>(s(),i("option",{key:e.id,value:e.id},n(e.name),9,J))),128))],8,H)]),_:1},8,["modelValue"]),t.value?(s(),i(h,{key:0},[f(I,{readonly:"","model-value":t.value.author,class:"_formBlock"},{label:u(()=>[m(n(l(a).ts.author),1)]),_:1},8,["model-value"]),t.value.desc?(s(),C(g,{key:0,readonly:"","model-value":t.value.desc,class:"_formBlock"},{label:u(()=>[m(n(l(a).ts._theme.description),1)]),_:1},8,["model-value"])):_("",!0),f(g,{readonly:"",tall:"","model-value":b.value,class:"_formBlock"},{label:u(()=>[m(n(l(a).ts._theme.code),1)]),caption:u(()=>[p("button",{class:"_textButton",onClick:o[1]||(o[1]=e=>M())},n(l(a).ts.copy),1)]),_:1},8,["model-value"]),l(v).some(e=>e.id==t.value.id)?_("",!0):(s(),C(R,{key:1,class:"_formBlock",danger:"",onClick:o[2]||(o[2]=e=>N())},{default:u(()=>[o[3]||(o[3]=p("i",{class:"ph-trash ph-bold ph-lg"},null,-1)),m(" "+n(l(a).ts.uninstall),1)]),_:1}))],64)):_("",!0)]))}});export{W as default};
//# sourceMappingURL=theme.manage-awcEYOzU.js.map
