/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/textarea-helper@0.3.1/textarea-helper.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(t){"use strict";var e="textarea-helper-caret",i="textarea-helper",r=["box-sizing","height","width","padding-bottom","padding-left","padding-right","padding-top","font-family","font-size","font-style","font-variant","font-weight","word-spacing","letter-spacing","line-height","text-decoration","text-indent","text-transform","direction"],o=function(e){"textarea"===e.nodeName.toLowerCase()&&(this.$text=t(e),this.$mirror=t("<div/>").css({position:"absolute",overflow:"auto","white-space":"pre-wrap","word-wrap":"break-word",top:0,left:-9999}).insertAfter(this.$text))};(function(){this.update=function(){for(var i,o={},n=0;i=r[n];n++)o[i]=this.$text.css(i);this.$mirror.css(o).empty();var s=this.getOriginalCaretPos(),a=this.$text.val(),h=document.createTextNode(a.substring(0,s)),c=document.createTextNode(a.substring(s)),d=t("<span/>").addClass(e).css("position","absolute").html("&nbsp;");this.$mirror.append(h,d,c).scrollTop(this.$text.scrollTop())},this.destroy=function(){return this.$mirror.remove(),this.$text.removeData(i),null},this.caretPos=function(){this.update();var t=this.$mirror.find("."+e),i=t.position();return"rtl"===this.$text.css("direction")&&(i.right=this.$mirror.innerWidth()-i.left-t.width(),i.left="auto"),i},this.height=function(){return this.update(),this.$mirror.css("height",""),this.$mirror.height()},this.getOriginalCaretPos=function(){var t=this.$text[0];if(t.selectionStart)return t.selectionStart;if(document.selection){t.focus();var e=document.selection.createRange();if(null==e)return 0;var i=t.createTextRange(),r=i.duplicate();return i.moveToBookmark(e.getBookmark()),r.setEndPoint("EndToStart",i),r.text.length}return 0}}).call(o.prototype),t.fn.textareaHelper=function(e){return this.each((function(){var e=t(this),r=e.data(i);r||(r=new o(this),e.data(i,r))})),e?this.first().data(i)[e]():this}}(jQuery);
//# sourceMappingURL=/sm/edbacbf7b6fbf3a584e4cf4fe4520c767b6fcc1967653a23658e42e94a6f9634.map