define(["layoutManager","browser","css!./emby-textarea","registerElement"],function(layoutManager,browser){"use strict";function autoGrow(textarea,maxLines){function reset(){textarea.rows=1,offset=self.getOffset(textarea),self.rows=textarea.rows||1,self.lineHeight=textarea.scrollHeight/self.rows-offset/self.rows,self.maxAllowedHeight=self.lineHeight*maxLines-offset}function autogrowFn(){if((!self.lineHeight||self.lineHeight<=0)&&reset(),self.lineHeight<=0)return textarea.style.overflowY="scroll",textarea.style.height="auto",void(textarea.rows=3);var newHeight=0,hasGrown=!1;textarea.scrollHeight-offset>self.maxAllowedHeight?(textarea.style.overflowY="scroll",newHeight=self.maxAllowedHeight):(textarea.style.overflowY="hidden",textarea.style.height="auto",newHeight=textarea.scrollHeight,hasGrown=!0),textarea.style.height=newHeight+"px"}var self=this;void 0===maxLines&&(maxLines=999),self.getOffset=function(textarea){for(var style=window.getComputedStyle(textarea,null),props=["paddingTop","paddingBottom"],offset=0,i=0;i