import{l as _}from"./index-8HslT92O.js";import{aA as b,b as a,aB as y,M as u,b7 as x,q as o,b8 as k}from"./app-QjDgb7aF.js";import{a as g,g as v}from"./theme-store-CQRTJOWj.js";import{b as T,j as w,p as B,k as r,i as n,J as d,D as m,u as l,I as C,q as p,a as V}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const M={class:"_formRoot"},N={class:"_formBlock",style:{display:"flex",gap:"var(--margin)","flex-wrap":"wrap"}},J=T({__name:"theme.install",setup(q){let t=V(null);function f(s){let e;try{e=_.parse(s)}catch{return o({type:"error",text:a.ts._theme.invalid}),!1}return k(e)?v().some(i=>i.id===e.id)?(o({type:"info",text:a.ts._theme.alreadyInstalled}),!1):e:(o({type:"error",text:a.ts._theme.invalid}),!1)}function h(s){const e=f(s);e&&x(e,!1)}async function c(s){const e=f(s);e&&(await g(e),o({type:"success",text:a.t("_theme.installed",{name:e.name})}))}return b({title:a.ts._theme.install,icon:"ph-download-simple ph-bold ph-lg"}),(s,e)=>(w(),B("div",M,[r(y,{modelValue:l(t),"onUpdate:modelValue":e[0]||(e[0]=i=>C(t)?t.value=i:t=i),class:"_formBlock"},{label:n(()=>[d(m(l(a).ts._theme.code),1)]),_:1},8,["modelValue"]),p("div",N,[r(u,{disabled:l(t)==null,inline:"",onClick:e[1]||(e[1]=()=>h(l(t)))},{default:n(()=>[e[3]||(e[3]=p("i",{class:"ph-eye ph-bold ph-lg"},null,-1)),d(" "+m(l(a).ts.preview),1)]),_:1},8,["disabled"]),r(u,{disabled:l(t)==null,primary:"",inline:"",onClick:e[2]||(e[2]=()=>c(l(t)))},{default:n(()=>[e[4]||(e[4]=p("i",{class:"ph-check ph-bold ph-lg"},null,-1)),d(" "+m(l(a).ts.install),1)]),_:1},8,["disabled"])])]))}});export{J as default};
//# sourceMappingURL=theme.install-CgvEA02P.js.map
