AUI.add("aui-form-textarea",function(C){var F=C.Lang,D=C.ClassNameManager.getClassName,L="textarea",I=D(L),E=[D(L,"height","monitor"),D("field","text","input"),D("helper","hidden","accessible")].join(" "),M="&nbsp;&nbsp;",J="&nbsp;\n&nbsp;",B='<pre class="'+E+'">',K="</pre>",H='<textarea autocomplete="off" class="{cssClass}" name="{name}"></textarea>';var G=C.Component.create({NAME:L,ATTRS:{autoSize:{value:true},height:{value:"auto"},maxHeight:{value:1000,setter:"_setAutoDimension"},minHeight:{value:45,setter:"_setAutoDimension"},width:{value:"auto",setter:"_setAutoDimension"}},HTML_PARSER:{node:"textarea"},EXTENDS:C.Textfield,prototype:{FIELD_TEMPLATE:H,renderUI:function(){var A=this;G.superclass.renderUI.call(A);if(A.get("autoSize")){A._renderHeightMonitor();}},bindUI:function(){var A=this;G.superclass.bindUI.call(A);if(A.get("autoSize")){A.get("node").on("keyup",A._onKeyup,A);}A.after("adjustSize",A._uiAutoSize);A.after("heightChange",A._afterHeightChange);A.after("widthChange",A._afterWidthChange);},syncUI:function(){var N=this;G.superclass.syncUI.call(N);N._setAutoDimension(N.get("minHeight"),"minHeight");N._setAutoDimension(N.get("maxHeight"),"maxHeight");var O=N.get("width");var A=N.get("minHeight");N._setAutoDimension(O,"width");N._uiSetDim("height",A);N._uiSetDim("width",O);},_afterHeightChange:function(N){var A=this;A._uiSetDim("height",N.newVal,N.prevVal);},_afterWidthChange:function(N){var A=this;A._uiSetDim("width",N.newVal,N.prevVal);},_onKeyup:function(N){var A=this;A.fire("adjustSize");},_renderHeightMonitor:function(){var N=this;var P=C.Node.create(B+K);var R=N.get("node");C.getBody().append(P);N._heightMonitor=P;var A=R.getComputedStyle("fontFamily");var S=R.getComputedStyle("fontSize");var O=R.getComputedStyle("fontWeight");var Q=R.getComputedStyle("fontSize");R.setStyle("height",N.get("minHeight")+"px");P.setStyles({fontFamily:A,fontSize:S,fontWeight:O});if("outerHTML" in P.getDOM()){N._updateContent=N._updateOuterContent;}else{N._updateContent=N._updateInnerContent;}},_setAutoDimension:function(O,N){var A=this;A["_"+N]=O;},_uiAutoSize:function(){var N=this;var R=N.get("node");var O=N._heightMonitor;var S=N._minHeight;var Q=N._maxHeight;var P=R.val();var T=document.createTextNode(P);O.set("innerHTML","");O.appendChild(T);O.setStyle("width",R.getComputedStyle("width"));P=O.get("innerHTML");if(!P.length){P=M;}else{P+=J;}N._updateContent(P);var A=Math.max(O.get("offsetHeight"),S);A=Math.min(A,Q);if(A!=N._lastHeight){N._lastHeight=A;N._uiSetDim("height",A);}},_uiSetDim:function(O,N){var A=this;var P=A.get("node");if(F.isNumber(N)){N+="px";}P.setStyle(O,N);},_updateInnerContent:function(N){var A=this;return A._heightMonitor.set("innerHTML",N);},_updateOuterContent:function(N){var A=this;N=N.replace(/\n/g,"<br />");return A._updateInnerContent(N);}}});C.Textarea=G;},"1.0.1",{skinnable:true,requires:["aui-form-textfield"]});