(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
'use strict';

var _autoResize = require('./auto-resize.js');

// initialize all elements
var componentsList = document.querySelectorAll(_autoResize.AutoResize.getSelector()); // Import all components

for (var i = 0; i < componentsList.length; i++) {
	new _autoResize.AutoResize(componentsList[i]);
}
},{"./auto-resize.js":2}],2:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

/**
 * auto-resize.js
 * Script to automatically resize input boxes on change
 */

/**
* Declare constants
*/
var attributeBase = 'data-rs-auto-resize';

var AutoResize = exports.AutoResize = function () {
	function AutoResize(element) {
		_classCallCheck(this, AutoResize);

		this.element = element;
		this.addEventHandlers();
	}

	/**
  * Add event handlers
  */


	_createClass(AutoResize, [{
		key: 'addEventHandlers',
		value: function addEventHandlers() {
			var _this = this;

			this.element.addEventListener('input', function () {
				_this.resizeElement();
			});
			// on window resize, recalculate content height
			window.addEventListener('resize', function () {
				_this.resizeElement();
			});
		}

		/**
   * Get selector
   */

	}, {
		key: 'resizeElement',


		/**
   * Resize element
   */
		value: function resizeElement() {
			// style height first set to auto, necessary for code to work correctly
			this.element.style.height = 'auto';
			this.element.style.height = this.element.scrollHeight + 4 + 'px';
		}
	}], [{
		key: 'getSelector',
		value: function getSelector() {
			return '[' + attributeBase + ']';
		}
	}]);

	return AutoResize;
}();
},{}]},{},[1]);
