(function($){var defaults={className:"autosizejs",append:"",callback:false,resizeDelay:10},copy='',typographyStyles=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],mirrored,mirror=$(copy).data("autosize",true)[0];mirror.style.lineHeight="99px";if($(mirror).css("lineHeight")==="99px"){typographyStyles.push("lineHeight")}mirror.style.lineHeight="";$.fn.autosize=function(options){if(!this.length){return this}options=$.extend({},defaults,options||{});if(mirror.parentNode!==document.body){$(document.body).append(mirror)}return this.each(function(){var ta=this,$ta=$(ta),maxHeight,minHeight,boxOffset=0,callback=$.isFunction(options.callback),originalStyles={height:ta.style.height,overflow:ta.style.overflow,overflowY:ta.style.overflowY,wordWrap:ta.style.wordWrap,resize:ta.style.resize},timeout,width=$ta.width();if($ta.data("autosize")){return}$ta.data("autosize",true);if($ta.css("box-sizing")==="border-box"||$ta.css("-moz-box-sizing")==="border-box"||$ta.css("-webkit-box-sizing")==="border-box"){boxOffset=$ta.outerHeight()-$ta.height()}minHeight=Math.max(parseInt($ta.css("minHeight"),10)-boxOffset||0,$ta.height());$ta.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:$ta.css("resize")==="none"||$ta.css("resize")==="vertical"?"none":"horizontal"});function setWidth(){var style,width;if("getComputedStyle"in window){style=window.getComputedStyle(ta,null);width=ta.getBoundingClientRect().width;$.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(i,val){width-=parseInt(style[val],10)});mirror.style.width=width+"px"}else{mirror.style.width=Math.max($ta.width(),0)+"px"}}function initMirror(){var styles={};mirrored=ta;mirror.className=options.className;maxHeight=parseInt($ta.css("maxHeight"),10);$.each(typographyStyles,function(i,val){styles[val]=$ta.css(val)});$(mirror).css(styles);setWidth();if(window.chrome){var width=ta.style.width;ta.style.width="0px";var ignore=ta.offsetWidth;ta.style.width=width}}function adjust(){var height,original;if(mirrored!==ta){initMirror()}else{setWidth()}mirror.value=ta.value+options.append;mirror.style.overflowY=ta.style.overflowY;original=parseInt(ta.style.height,10);mirror.scrollTop=0;mirror.scrollTop=9e4;height=mirror.scrollTop;if(maxHeight&&height>maxHeight){ta.style.overflowY="scroll";height=maxHeight}else{ta.style.overflowY="hidden";if(height