(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 _untouched = require('./untouched');

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

for (var i = 0; i < componentsList.length; i++) {
	new _untouched.Untouched(componentsList[i]);
}
},{"./untouched":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"); } }

/**
 * untouched.js
 * Removes 'untouched' class from select elements for styling purposes
 */

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

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

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

	/**
 * Declare classes
 */


	_createClass(Untouched, [{
		key: 'addEventHandlers',


		/**
   * Add event handlers
   */
		value: function addEventHandlers() {
			var _this = this;

			this.element.addEventListener('focus', function () {
				_this.removeUntouchedClass(_this.element);
			});
			this.element.addEventListener('click', function () {
				_this.removeUntouchedClass(_this.element);
			});
			this.element.addEventListener('keyup', function () {
				_this.removeUntouchedClass(_this.element);
			});
			this.element.addEventListener('change', function () {
				_this.removeUntouchedClass(_this.element);
			});
		}

		/**
   * Remove untouched class
   */

	}, {
		key: 'removeUntouchedClass',
		value: function removeUntouchedClass(element) {
			element.classList.remove(this.classes.untouched);
		}

		/**
   * Get selector
   */

	}, {
		key: 'classes',
		get: function get() {
			return {
				untouched: 'untouched'
			};
		}
	}], [{
		key: 'getSelector',
		value: function getSelector() {
			return '[' + attributeBase + ']';
		}
	}]);

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