import{_asM,EasJ,WasY,oasz,Hasq,DasH,rasy,IasG,cash,fasv,aase,bass,masC,yasS,nasB,zasL,tasP,hasQ,a3asX,dasN,sasD,jasR,FasV,iasK,Casee,a4aste,easO,KasA,Lasse,uasT,gasI,pasne,qasoe,wasU,kasj,TasZ,Jasle,vasie}from"./index-B-jc5mKC.js";import{Lasn}from"./localeText-DmTH4uVF.js";import{dasae}from"./dayjs.min-CrcZDfUc.js";constde={class:"card rounded-3 flex-grow-1 bg-danger-subtle border-danger-subtle border shadow"},re={class:"card-body"},ue={class:"d-flex align-items-center gap-3 inputGroup"},ce=["value"],me={class:"mb-0"},fe={class:"d-flex mt-3"},ge=["disabled"],be={__name:"updateConfigurationName",props:{configurationName:String},emits:["close"],setup(d,{emit:r}){constt=d,f=r,o=J({data:"",valid:!1}),g=Y();z(()=>{q(()=>o.data,b=>{o.valid=/^[a-zA-Z0-9_=+.-]{1,15}$/.test(b)&&b.length>0&&!g.Configurations.find(_=>_.Name===b)})});constu=H(),x=y(!1),c=G(),a=async()=>{o.data&&(x.value=!0,clearInterval(u.Peers.RefreshInterval),awaitL("/api/renameWireguardConfiguration",{ConfigurationName:t.configurationName,NewConfigurationName:o.data},asyncb=>{b.status?(awaitg.getConfigurations(),u.newMessage("Server","Configuration renamed","success"),c.push(`/configuration/${o.data}/peers`)):(u.newMessage("Server",b.message,"danger"),x.value=!1)}))};return(b,_)=>(v(),h("div",de,[e("div",re,[e("p",null,[s(n,{t:"To update this configuration's name, WGDashboard will execute the following operations:"})]),e("ol",null,[e("li",null,[s(n,{t:"Duplicate current configuration's database table and .conf file with the new name"})]),e("li",null,[s(n,{t:"Delete current configuration's database table and .conf file"})])]),e("div",ue,[e("input",{class:"form-control form-control-sm rounded-3",value:d.configurationName,disabled:""},null,8,ce),_[3]||(_[3]=e("h3",{class:"mb-0"},[e("i",{class:"bi bi-arrow-right"})],-1)),C(e("input",{class:B(["form-control form-control-sm rounded-3",[o.data?o.valid?"is-valid":"is-invalid":""]]),id:"newConfigurationName","onUpdate:modelValue":_[0]||(_[0]=w=>o.data=w)},null,2),[[S,o.data]])]),e("div",{class:B(["invalid-feedback",{"d-block":!o.valid&&o.data}])},[s(n,{t:"Configuration name is invalid. Possible reasons:"}),e("ul",me,[e("li",null,[s(n,{t:"Configuration name already exist"})]),e("li",null,[s(n,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])],2),e("div",fe,[e("button",{onClick:_[1]||(_[1]=w=>f("close")),class:"btn btn-sm bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3"},[s(n,{t:"Cancel"})]),e("button",{onClick:_[2]||(_[2]=w=>a()),disabled:!o.data||x.value,class:"btn btn-sm btn-danger rounded-3 ms-auto"},[s(n,{t:"Save"})],8,ge)])])]))}},ve=M(be,[["__scopeId","data-v-33ea9576"]]),pe={name:"Dropdown",props:{width:{type:String,default:"80px"},height:{type:String,default:"auto"},title:{type:String,default:""},disabled:{type:Boolean,default:!1},defaultDisplay:{type:Boolean,default:!1}}},he={class:"title"};functionye(d,r,t,f,o,g){returnv(),h("div",{class:B(["dropdown",{disabled:t.disabled}]),onClick:r[0]||(r[0]=(...u)=>d.toggleDropdown&&d.toggleDropdown(...u)),onFocusout:r[1]||(r[1]=(...u)=>d.hideDropdown&&d.hideDropdown(...u)),tabindex:"0"},[e("div",he,[e("div",null,P(t.title),1)])],34)}constxe=M(pe,[["render",ye]]),_e={components:{Dropdown:xe},name:"CodeEditor",props:{lineNums:{type:Boolean,default:!1},modelValue:{type:String},value:{type:String},theme:{type:String,default:"github-dark"},tabSpaces:{type:Number,default:2},wrap:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},header:{type:Boolean,default:!0},width:{type:String,default:"540px"},height:{type:String,default:"auto"},maxWidth:{type:String},minWidth:{type:String},maxHeight:{type:String},minHeight:{type:String},borderRadius:{type:String,default:"12px"},languages:{type:Array,default:function(){return[["javascript","JS"]]}},langListWidth:{type:String,default:"110px"},langListHeight:{type:String,default:"auto"},langList