import{s as I,r as F}from"./RadioGroup-CrfPAuhp.js";import{d as k,v as f,bq as M,ay as T,az as g,r as P,a2 as q,a as z,at as E,c as V,o as U,ac as O,w as n,f as l,aq as W,h as m,$ as u,z as j,B as A,g as w,t as N,e as G,_ as H,a9 as J,aa as K}from"./index-DGnN4tUo.js";import{u as L,a as Q}from"./form-BL4ki12n.js";import{_ as X}from"./Form-BqQC0MxL.js";import{_ as Y}from"./FormItem-C_vPvRD-.js";import{_ as Z}from"./Space-CL0I_Xfq.js";const le=k({name:"RadioButton",props:F,setup:I,render(){const{mergedClsPrefix:e}=this;return f("label",{class:[`${e}-radio-button`,this.mergedDisabled&&`${e}-radio-button--disabled`,this.renderSafeChecked&&`${e}-radio-button--checked`,this.focus&&[`${e}-radio-button--focus`]]},f("input",{ref:"inputRef",type:"radio",class:`${e}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),f("div",{class:`${e}-radio-button__state-border`}),M(this.$slots.default,t=>!t&&!this.label?null:f("div",{ref:"labelRef",class:`${e}-radio__label`},t||this.label)))}});function ee(e){return{all:e=e||new Map,on:function(t,o){var a=e.get(t);a?a.push(o):e.set(t,[o])},off:function(t,o){var a=e.get(t);a&&(o?a.splice(a.indexOf(o)>>>0,1):e.set(t,[]))},emit:function(t,o){var a=e.get(t);a&&a.slice().map(function(i){i(o)}),(a=e.get("*"))&&a.slice().map(function(i){i(t,o)})}}}const re=ee(),ue=k({__name:"server-name-edit-drawer",props:{visible:{default:!1},visibleModifiers:{},editData:{default:{name:""}},editDataModifiers:{}},emits:T(["updateEdit"],["update:visible","update:editData"]),setup(e,{emit:t}){const o=t,a=g(e,"visible"),i=g(e,"editData"),c=P(!1),r=q({name:""}),{formRef:$,validate:C}=L(),x=z(()=>{const{defaultRequiredRule:d}=Q();return{name:[d]}}),B=async()=>{var p;await C(),c.value=!0;const s={csrfToken:await J(),serverId:i.value.id.toString(),name:r.name},{data:b,error:_}=await K(s,"/servers/updateNamePopup");_||(i.value.name=r.name,o("updateEdit"),(p=window.$message)==null||p.success(u("common.modifySuccess"))),c.value=!1,a.value=!1};return E(()=>i.value.name,d=>{r.name=d}),(d,s)=>{const b=H,_=j,p=Y,R=X,h=A,S=Z,y=W,D=O;return U(),V(D,{show:a.value,"onUpdate:show":s[3]||(s[3]=v=>a.value=v)},{default:n(()=>[l(y,{style:{width:"480px"},title:m(u)("common.edit"),bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":n(()=>[G("span",{onClick:s[0]||(s[0]=()=>a.value=!1)},[l(b,{"local-icon":"material-symbols-light--close-rounded",class:"text-2xl cursor-pointer transform transition-transform duration-300 hover:rotate-90"})])]),footer:n(()=>[l(S,null,{default:n(()=>[l(h,{onClick:B,type:"info",disabled:r.name===i.value.name,loading:c.value},{default:n(()=>[w(N(m(u)("common.confirm")),1)]),_:1},8,["disabled","loading"]),l(h,{onClick:s[2]||(s[2]=()=>a.value=!1)},{default:n(()=>[w(N(m(u)("common.cancel")),1)]),_:1})]),_:1})]),default:n(()=>[l(R,{ref_key:"formRef",ref:$,model:r,rules:x.value,class:"px-1"},{default:n(()=>[l(p,{path:"name",label:m(u)("page.webSite.table.webName")},{default:n(()=>[l(_,{value:r.name,"onUpdate:value":s[1]||(s[1]=v=>r.name=v),disabled:c.value,placeholder:m(u)("page.webSite.table.webName")},null,8,["value","disabled","placeholder"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1},8,["title"])]),_:1},8,["show"])}}});export{ue as _,le as a,re as e};
