var U=Object.defineProperty;var n=(S,d)=>U(S,"name",{value:d,configurable:!0});import{s as D,u as O}from"./vendor-vue-ByIfjd1d.js";import{r as P,a as w,s as g}from"./vendor-primevue-RJTR6wkG.js";import{e as z,g as E,O as G,dl as H,di as J,bk as K}from"./index-xLwXl4ov.js";import{u as M}from"./serverConfigStore-CqEQuh1m.js";import{bq as Q,w as $,d8 as W,p as f,d as r,q as u,c as l,F as C,z as y,br as t,s as h,e as a,t as i,A as p}from"./vendor-other-yzRpIrj2.js";import"./vendor-xterm-CWYFmgbN.js";import"./vendor-three-b7sMVVQK.js";import"./vendor-tiptap-DcddbIvp.js";const X={class:"flex flex-col gap-2"},Y={class:"flex justify-end gap-2"},Z={class:"flex items-center justify-between"},ue=Q({__name:"ServerConfigPanel",setup(S){const d=z(),b=M(),x=E(),{serverConfigsByCategory:V,serverConfigValues:A,launchArgs:T,commandLineArgs:m,modifiedConfigs:v}=D(b);let k=!1;const B=n(()=>{b.revertChanges()},"revertChanges"),I=n(async()=>{k=!0,await K().restartApp()},"restartApp");$(T,async e=>{await d.set("Comfy.Server.LaunchArgs",e)}),$(A,async e=>{await d.set("Comfy.Server.ServerConfigValues",e)});const{copyToClipboard:q}=G(),L=n(async()=>{await q(m.value)},"copyCommandLineArgs"),{t:c}=O();W(()=>{k||v.value.length!==0&&x.add({severity:"warn",summary:c("serverConfig.restartRequiredToastSummary"),detail:c("serverConfig.restartRequiredToastDetail"),life:1e4})});const j=n(e=>({...e,name:c(`serverConfigItems.${e.id}.name`,e.name),tooltip:e.tooltip?c(`serverConfigItems.${e.id}.tooltip`,e.tooltip):void 0}),"translateItem");return(e,_)=>(r(),f(J,{value:"Server-Config",class:"server-config-panel"},{header:u(()=>[a("div",X,[t(v).length>0?(r(),f(t(w),{key:0,severity:"info","pt:text":"w-full"},{default:u(()=>[a("p",null,i(e.$t("serverConfig.modifiedConfigs")),1),a("ul",null,[(r(!0),l(C,null,y(t(v),s=>(r(),l("li",{key:s.id},i(s.name)+": "+i(s.initialValue)+" → "+i(s.value),1))),128))]),a("div",Y,[p(t(g),{label:e.$t("serverConfig.revertChanges"),outlined:"",onClick:B},null,8,["label"]),p(t(g),{label:e.$t("serverConfig.restart"),outlined:"",severity:"danger",onClick:I},null,8,["label"])])]),_:1})):h("",!0),t(m)?(r(),f(t(w),{key:1,severity:"secondary","pt:text":"w-full"},{icon:u(()=>_[0]||(_[0]=[a("i",{class:"icon-[lucide--terminal] text-xl font-bold"},null,-1)])),default:u(()=>[a("div",Z,[a("p",null,i(t(m)),1),p(t(g),{icon:"pi pi-clipboard",severity:"secondary",text:"",onClick:L})])]),_:1})):h("",!0)])]),default:u(()=>[(r(!0),l(C,null,y(Object.entries(t(V)),([s,F],N)=>(r(),l("div",{key:s},[N>0?(r(),f(t(P),{key:0})):h("",!0),a("h3",null,i(e.$t(`serverConfigCategories.${s}`,s)),1),(r(!0),l(C,null,y(F,o=>(r(),l("div",{key:o.name,class:"mb-4"},[p(H,{id:o.id,"form-value":o.value,"onUpdate:formValue":n(R=>o.value=R,"onUpdate:formValue"),item:j(o),"label-class":{"text-highlight":o.initialValue!==o.value}},null,8,["id","form-value","onUpdate:formValue","item","label-class"])]))),128))]))),128))]),_:1}))}});export{ue as default};
//# sourceMappingURL=ServerConfigPanel-GHUyRIIQ.js.map
