import{U as e,Wt as t,_ as n,bt as r,d as i,dt as a,f as o,l as s,nt as c,p as l,qt as u,u as d,v as f,z as p}from"./runtime-core.esm-bundler.v79eHMSw.js";import{d as m,u as h}from"./runtime-dom.esm-bundler.BbL3gL8L.js";import{t as g}from"./send.CCZimwoI.js";import{t as _}from"./i18n.DdD8a55v.js";import{t as v}from"./_plugin-vue_export-helper.BDNMzG2s.js";var y={class:`smb2b-composer`},b={class:`smb2b-composer__row`},x=v({__name:`MessageComposer`,props:{modelValue:{type:String,default:``},sending:{type:Boolean,default:!1},rows:{type:Number,default:3},icon:{type:Boolean,default:!1},placeholder:{type:String,default:()=>_(`Write a reply…`)},sendLabel:{type:String,default:()=>_(`Send`)},hint:{type:String,default:()=>_(`Enter to send · Shift+Enter for a new line`)}},emits:[`update:modelValue`,`send`],setup(_,{emit:v}){let x=_,S=v,C=a(!1),w=s(()=>!!x.modelValue.trim()&&!x.sending),T=()=>{w.value&&S(`send`)};return(a,s)=>{let v=e(`el-input`),x=e(`el-button`);return p(),l(`div`,y,[d(`div`,b,[f(v,{"model-value":_.modelValue,type:`textarea`,rows:_.rows,resize:`none`,placeholder:_.placeholder,"onUpdate:modelValue":s[0]||=e=>a.$emit(`update:modelValue`,e),onKeydown:h(m(T,[`exact`,`prevent`]),[`enter`]),onFocus:s[1]||=e=>C.value=!0,onBlur:s[2]||=e=>C.value=!1},null,8,[`model-value`,`rows`,`placeholder`,`onKeydown`]),f(x,{class:`smb2b-composer__send`,type:`primary`,loading:_.sending,disabled:!w.value,onClick:T},{default:c(()=>[_.icon?(p(),i(r(g),{key:0,size:15,class:`smb2b-composer__icon`})):o(``,!0),n(` `+u(_.sendLabel),1)]),_:1},8,[`loading`,`disabled`])]),d(`span`,{class:t([`smb2b-composer__hint`,{"is-visible":C.value}])},u(_.hint),3)])}}},[[`__scopeId`,`data-v-ed28ae5d`]]);export{x as t};