import{P as i,b as f}from"./bootstrap-DToyB3NB.js";import{a4 as h,a5 as w,x as O,P as b,Y as k,J as S}from"../jse/index-index-DT9LOzen.js";var z=function(n,u){var o={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&u.indexOf(t)<0&&(o[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,t=Object.getOwnPropertySymbols(n);r<t.length;r++)u.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(n,t[r])&&(o[t[r]]=n[t[r]]);return o};const K=h({compatConfig:{MODE:3},props:{disabled:i.looseBool,type:i.string,value:i.any,tag:{type:String,default:"input"},size:i.string,onChange:Function,onInput:Function,onBlur:Function,onFocus:Function,onKeydown:Function,onCompositionstart:Function,onCompositionend:Function,onKeyup:Function,onPaste:Function,onMousedown:Function},emits:["change","input","blur","keydown","focus","compositionstart","compositionend","keyup","paste","mousedown"],setup(n,u){let{expose:o}=u;const t=w(null);return o({focus:()=>{t.value&&t.value.focus()},blur:()=>{t.value&&t.value.blur()},input:t,setSelectionRange:(l,c,d)=>{var v;(v=t.value)===null||v===void 0||v.setSelectionRange(l,c,d)},select:()=>{var l;(l=t.value)===null||l===void 0||l.select()},getSelectionStart:()=>{var l;return(l=t.value)===null||l===void 0?void 0:l.selectionStart},getSelectionEnd:()=>{var l;return(l=t.value)===null||l===void 0?void 0:l.selectionEnd},getScrollTop:()=>{var l;return(l=t.value)===null||l===void 0?void 0:l.scrollTop}}),()=>{const{tag:l,value:c}=n,d=z(n,["tag","value"]);return O(l,f(f({},d),{},{ref:t,value:c}),null)}}});function V(){const n=document.documentElement.clientWidth,u=window.innerHeight||document.documentElement.clientHeight;return{width:n,height:u}}function $(n){const u=n.getBoundingClientRect(),o=document.documentElement;return{left:u.left+(window.scrollX||o.scrollLeft)-(o.clientLeft||document.body.clientLeft||0),top:u.top+(window.scrollY||o.scrollTop)-(o.clientTop||document.body.clientTop||0)}}function M(n){return Object.keys(n).reduce((u,o)=>{const t=n[o];return typeof t=="undefined"||t===null||(u+=`${o}: ${n[o]};`),u},"")}var L=function(n,u){var o={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&u.indexOf(t)<0&&(o[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,t=Object.getOwnPropertySymbols(n);r<t.length;r++)u.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(n,t[r])&&(o[t[r]]=n[t[r]]);return o};const Y=h({compatConfig:{MODE:3},inheritAttrs:!1,props:{disabled:i.looseBool,type:i.string,value:i.any,lazy:i.bool.def(!0),tag:{type:String,default:"input"},size:i.string,style:i.oneOfType([String,Object]),class:i.string},emits:["change","input","blur","keydown","focus","compositionstart","compositionend","keyup","paste","mousedown"],setup(n,u){let{emit:o,attrs:t,expose:r}=u;const a=w(null),g=b(),s=b(!1);k([()=>n.value,s],()=>{s.value||(g.value=n.value)},{immediate:!0});const l=e=>{o("change",e)},c=e=>{s.value=!0,e.target.composing=!0,o("compositionstart",e)},d=e=>{s.value=!1,e.target.composing=!1,o("compositionend",e);const p=document.createEvent("HTMLEvents");p.initEvent("input",!0,!0),e.target.dispatchEvent(p),l(e)},v=e=>{if(s.value&&n.lazy){g.value=e.target.value;return}o("input",e)},_=e=>{o("blur",e)},E=e=>{o("focus",e)},C=()=>{a.value&&a.value.focus()},P=()=>{a.value&&a.value.blur()},F=e=>{o("keydown",e)},j=e=>{o("keyup",e)},T=(e,p,y)=>{var m;(m=a.value)===null||m===void 0||m.setSelectionRange(e,p,y)},x=()=>{var e;(e=a.value)===null||e===void 0||e.select()};r({focus:C,blur:P,input:S(()=>{var e;return(e=a.value)===null||e===void 0?void 0:e.input}),setSelectionRange:T,select:x,getSelectionStart:()=>{var e;return(e=a.value)===null||e===void 0?void 0:e.getSelectionStart()},getSelectionEnd:()=>{var e;return(e=a.value)===null||e===void 0?void 0:e.getSelectionEnd()},getScrollTop:()=>{var e;return(e=a.value)===null||e===void 0?void 0:e.getScrollTop()}});const B=e=>{o("mousedown",e)},R=e=>{o("paste",e)},I=S(()=>n.style&&typeof n.style!="string"?M(n.style):n.style);return()=>{const{style:e,lazy:p}=n,y=L(n,["style","lazy"]);return O(K,f(f(f({},y),t),{},{style:I.value,onInput:v,onChange:l,onBlur:_,onFocus:E,ref:a,value:g.value,onCompositionstart:c,onCompositionend:d,onKeyup:j,onKeydown:F,onPaste:R,onMousedown:B}),null)}}});export{Y as B,$ as a,V as g};
