AUI.add("liferay-autocomplete-input-caretindex-sel",(e=>{const t=e.config.doc,n=/\r\n/g,o="character",a="inputNode",r=function AutcompleteInputCaretIndex(){};r.prototype={_getCaretIndex(e){e=e||this.get(a);let r=0,c=0;const s=t.selection.createRange(),l=e.getDOM();if(s&&s.parentElement()===l){const e=l.value,t=e.replace(n,"\n"),a=l.createTextRange();a.moveToBookmark(s.getBookmark());const i=l.createTextRange();i.collapse(!1);const g=e.length;a.compareEndPoints("StartToEnd",i)>-1?c=r=g:(c=-a.moveStart(o,-g),c+=t.slice(0,c).split("\n").length-1,a.compareEndPoints("EndToEnd",i)>-1?r=g:(r=-a.moveEnd(o,-g),r+=t.slice(0,r).split("\n").length-1))}return{end:r,start:c}},_setCaretIndex(e,t){const n=(e=e||this.get(a)).getDOM();if(n.createTextRange){const a=e.val().substring(0,t);let r=0;const c=/\r\n/g;for(;null!==c.exec(a);)r++;const s=n.createTextRange();s.move(o,t-r),s.select()}}},e.Base.mix(Liferay.AutoCompleteTextarea,[r])}),"",{requires:["liferay-autocomplete-textarea"]});
//# sourceMappingURL=autocomplete_input_caretindex_sel.js.map