import{s as g,b as f,X as N,$ as r,w as _,x,y as R,z as w,F as m,aN as D,B as V,M as $}from"./en-Dy5_N6qX.js";import{n as k,r as y}from"./main-BpQs1T8X.js";const C=g({__name:"chat-rename-dialog",props:{chatName:{}},emits:["select","validate"],setup(d,{emit:u}){const{chatsNameMaxLength:o}=y,{$tr:s}=f(N),c=d,n=u,a=r({oldName:c.chatName,newName:c.chatName}),i=r(!1);function h(e){return!!e||s("validation.text.required")}function p(e){return k(e)<o||s("validation.text.length",{length:o.toString()})}function v(){n("select",a.value)}return n("select",a.value),_(()=>i.value,e=>n("validate",e),{immediate:!0}),(e,t)=>(x(),R("div",{class:V(e.$style.chatRenameDialog)},[w(m(D),{modelValue:a.value.newName,"onUpdate:modelValue":t[0]||(t[0]=l=>a.value.newName=l),rules:[h,p],placeholder:m(s)("chat.rename.dialog.input.placeholder"),onChange:v,"onUpdate:valid":t[1]||(t[1]=l=>i.value=l)},null,8,["modelValue","rules","placeholder"])],2))}}),M="_chatRenameDialog_ovbsh_1",q={chatRenameDialog:M},z={$style:q},L=$(C,[["__cssModules",z]]);export{L as default};
