System.register(["./index-legacy-BGUFxny_.js","./FolderTree-legacy-DAN7i0-E.js","./index-legacy-CwkvHJvM.js"],function(e,t){"use strict";var r,n,a,u,l,s,c,i,g,d,h,o,p,b,m,y,f,w,_,x,$,v,C,k;return{setters:[e=>{r=e.j,n=e.bV,a=e.b9,u=e.bq,l=e.D,s=e.ah,c=e.c0,i=e.o,g=e.bR,d=e.bE,h=e.R,o=e.K,p=e.bt,b=e.r,m=e.ao,y=e.b$,f=e.ab,w=e.I,_=e.bQ,x=e.T,$=e.bc,v=e.S,C=e.H},e=>{k=e.a},null],execute:function(){const t=e=>{const t=i();return l(g,{w:"$full",display:"flex",flexDirection:"column",get children(){return[l(d,{get for(){return e.name},display:"flex",alignItems:"center",get children(){return t(`metas.${e.name}`)}}),l(y,{w:"$full",get direction(){return"bool"===e.type?"row":{"@initial":"column","@md":"row"}},gap:"$2",get children(){return[f(()=>f(()=>"string"===e.type)()?l(w,{get id(){return e.name},get value(){return e.value},onInput:t=>e.onChange(t.currentTarget.value)}):f(()=>"bool"===e.type)()?l(_,{get id(){return e.name},get checked(){return e.value},onChange:t=>e.onChange(t.currentTarget.checked)}):l(x,{get id(){return e.name},get value(){return e.value},onChange:t=>e.onChange(t.currentTarget.value)})),l(g,{w:"fit-content",display:"flex",get children(){return l($,{css:{whiteSpace:"nowrap"},get id(){return`${e.name}_sub`},onChange:t=>e.onSub(t.currentTarget.checked),color:"$neutral10",fontSize:"$sm",get checked(){return e.sub},get children(){return t("metas.apply_sub")}})}})]}}),l(v,{get when(){return e.help},get children(){return l(C,{get children(){return t(`metas.${e.name}_help`)}})}})]}})};e("default",()=>{const e=i(),{params:y,back:f}=r(),{id:w}=y,[_,x]=n({id:0,path:"",password:"",p_sub:!1,write:!1,w_sub:!1,hide:"",h_sub:!1,readme:"",r_sub:!1,header:"",header_sub:!1}),[$,v]=a(()=>u.get(`/admin/meta/get?id=${w}`));w&&(async()=>{const e=await v();p(e,x)})();const[C,S]=a(()=>u.post("/admin/meta/"+(w?"update":"create"),_));return l(m,{get loading(){return $()},get children(){return l(s,{w:"$full",alignItems:"start",spacing:"$2",get children(){return[l(c,{get children(){return e("global."+(w?"edit":"add"))}}),l(g,{w:"$full",display:"flex",flexDirection:"column",required:!0,get children(){return[l(d,{for:"path",display:"flex",alignItems:"center",get children(){return e("metas.path")}}),l(k,{id:"path",get value(){return _.path},onChange:e=>x("path",e)})]}}),l(h,{each:[{name:"password",type:"string",sub:"p_sub"},{name:"write",type:"bool",sub:"w_sub"},{name:"hide",type:"text",sub:"h_sub",help:!0},{name:"header",type:"text",sub:"header_sub",help:!0},{name:"readme",type:"text",sub:"r_sub",help:!0}],children:e=>l(t,{get name(){return e.name},get type(){return e.type},get value(){return _[e.name]},onChange:t=>x(e.name,t),get sub(){return _[e.sub]},onSub:t=>x(e.sub,t),get help(){return e.help}})}),l(o,{get loading(){return C()},onClick:async()=>{const t=await S();p(t,()=>{b.success(e("global.save_success")),f()})},get children(){return e("global."+(w?"save":"add"))}})]}})}})})}}});
