AUI.add("liferay-autocomplete-input-caretoffset",(t=>{const e=t.Node,r=["boxSizing","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","letterSpacing","lineHeight","maxHeight","minHeight","padding","textDecoration","textIndent","textTransform","width","wordSpacing"],i="inputNode",o=function AutcompleteInputCaretOffset(){};o.prototype={_applyMirrorContent(){const t=this;let e=t.get(i).val(),r=t._getCaretIndex().start;return r===e.length?e+=t.TPL_CARET:(t.get("caretAtTerm")&&(r=t._getPrevTrigger(e,r).index+1),e=e.substring(0,r)+t.TPL_CARET+e.substring(r+1)),t._inputMirror.html(e),e},_applyMirrorStyles(){const t=this.get(i),e=this._inputMirror;r.forEach((r=>{e.setStyle(r,t.getStyle(r))}))},_createInputMirror(){const r=this;if(!r._inputMirror){const i=e.create(r.TPL_INPUT_MIRROR);t.getBody().append(i),r._inputMirror=i}},_getCaretOffset(t){const e=this;e._createInputMirror(),e._applyMirrorStyles(),e._applyMirrorContent();const r=(t=t||e.get(i)).getDOM(),o=r.scrollLeft,n=r.scrollTop,a=e._inputMirror.one(".input-caret").getDOM();return{x:a.offsetLeft+o,y:a.offsetTop-n}},TPL_CARET:'<span class="input-caret">&nbsp</span>',TPL_INPUT_MIRROR:'<div class="liferay-autocomplete-input-mirror"></div>'},t.Base.mix(Liferay.AutoCompleteTextarea,[o])}),"",{requires:["liferay-autocomplete-textarea"]});
//# sourceMappingURL=autocomplete_input_caretoffset.js.map