“use strict”;Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e};var quadraticFormula=function(e,t,r){return(-t-Math.sqrt(Math.pow(t,2)+4*e*r))/(2*e)},degreesToRadians=function(e){return e*Math.PI/180},radiansToDegrees=function(e){return 180*e/Math.PI},isNegative=function(e){return-Math.abs(e)==e},average=function(e){var t=0,r=!0,n=!1,o=void 0;try{for(var a,i=e();!(r=(a=i.next()).done);r=!0){t+=a.value}}catch(e){n=!0,o=e}finally{try{!r&&i.return&&i.return()}finally{if(n)throw o}}return t/e.length},_createClass=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t;n.enumerable=n.enumerable||!1,n.configurable=!0,“value”in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError(“this hasn't been initialised - super() hasn't been called”);return!t||“object”!=typeof t&&“function”!=typeof t?e:t}function _inherits(e,t){if(“function”!=typeof t&&null!==t)throw new TypeError(“Super expression must either be null or a function, not ”+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var MathError=function(e){function a(){var e;_classCallCheck(this,a);for(var t=arguments.length,r=Array(t),n=0;n=arguments;var o=_possibleConstructorReturn(this,(e=a.__proto__||Object.getPrototypeOf(a)).call.apply(e,.concat®));return o.name=“MathError”,Error.captureStackTrace(o,a),o}return _inherits(a,Error),_createClass(a,[{key:Symbol.toStringTag,get:function(){return this.name}}]),a}(),random=function(e,t){if(!isFinite(e))throw new MathError(“`min` must be finite!”);if(null==t)t=e,e=0;else if(!isFinite(t))throw new MathError(“`max` must be finite!”);return e+Math.floor(Math.random()*(t-e+1))},mult=function(e){for(var t=e,r=1;r;return t},add=function(e){for(var t=0,r=0;r;return t};function _classCallCheck$1(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}var RailMath=function e(){_classCallCheck$1(this,e)};Object.setPrototypeOf(RailMath,{quadraticFormula:quadraticFormula,degreesToRadians:degreesToRadians,radiansToDegrees:radiansToDegrees,isNegative:isNegative,average:average,random:random,mult:mult,add:add});var _typeof=“function”==typeof Symbol&&“symbol”==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&“function”==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?“symbol”:typeof e},isObjectLike=function(e){return!!e&&“object”==(void 0===e?“undefined”:_typeof(e))},isUndefined=function(e){return void 0===e},getTag=function(e){return Object.prototype.toString.call(e)},isFunction=function(e){return“[object Function]”==getTag(e)},isBoolean=function(e){return“[object Boolean]”==getTag(e)},isNumber=function(e){return“[object Number]”==getTag(e)},isObject=function(e){return“[object Object]”==getTag(e)},isString=function(e){return“[object String]”==getTag(e)},isArray=function(e){return“[object Array]”==getTag(e)},isNaN=function(e){return NaN===e};function _classCallCheck$2(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}var Type=function e(){_classCallCheck$2(this,e)};Object.setPrototypeOf(Type,{isObjectLike:isObjectLike,isUndefined:isUndefined,isFunction:isFunction,isBoolean:isBoolean,isNumber:isNumber,isObject:isObject,isString:isString,isArray:isArray,isNaN:isNaN});var phoneNumber=/^(+?( |-|.)?d{1,2}( |-|.)?)?((?d{3})?|d{3})( |-|.)?(d{3}( |-|.)?d{4})$/gi,email=/^(+)@([a-zA-Z0-9_-.]+).({2,5})$/gi,cssColor=/^(#{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?((-?d+%?+){2,3}s*+%?))$/gi,camelCase=/^()|[s-_]+(w)/gi,validatePhoneNumber=function(e){return phoneNumber.test(e)},validateCssColor=function(e){return cssColor.test(e)},validateEmail=function(e){return email.test(e)};function _classCallCheck$3(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}var Validation=function e(){_classCallCheck$3(this,e)};Object.setPrototypeOf(Validation,{validatePhoneNumber:validatePhoneNumber,validateCssColor:validateCssColor,validateEmail:validateEmail});var toString=function(e){return null==e?“”:“”+e},escapeRegexOps=function(e){return toString(e).replace(/[|\{}()^$+*?.]/gi,“\$&”)},isPalindrome=function(e){for(var t=(e=e.replace(//g,“”).toLowerCase()).length,r=0;r!==e)return!1;return!0},charset=“abcdefghijklmnopqrstuvwxyz0123456789”.split(“”),randomString=function(){for(var e=0<arguments.length&&void 0!==arguments?arguments:7,t=[],r=0;r<e;r++){var n=charset;switch(Math.floor(2*Math.random())){case 0:n=n.toLowerCase();break;case 1:n=n.toUpperCase();break;default:throw new MathError(“Math.random() failed.”)}t.push(n)}return t.join(“”)},isUpperCase=function(e){return(e=toString(e))===e.toUpperCase()},upperFirst=function(e){return toString(e).replace(/^w/gi,function(e){return e.toUpperCase()})},capitalize=function(e){return upperFirst(e.toLowerCase())},lowerFirst=function(e){return e.replace(/^w/gi,function(e){return e.toLowerCase()})},pascalCase=function(e){return 1===(e=(e=toString(e)).replace(/()/g,“ $1”)).length?e.toUpperCase():(e=(e=e.replace(/^+|[W_]+$/g,“”).toLowerCase()).charAt(0).toUpperCase()+e.slice(1)).replace(/+(w|$)/g,function(e,t){return t.toUpperCase()})},camelCase$1=function(e){return e.replace(camelCase,function(e,t,r){return r?r.toUpperCase():t.toLowerCase()})},kebabCase=function(e){return e.replace(/()([A-Z])/gi,“$1-$2”).replace(/+/gi,“-”).toLowerCase()},titleCase=function(e){return toString(e).toLowerCase().replace(/(?:^|s|-)S/g,function(e){return e.toUpperCase()})},chars=function(e){return toString(e).split(“”)},swapCase=function(e){var t=chars(e),r=[],n=!0,o=!1,a=void 0;try{for(var i,s=t();!(n=(i=s.next()).done);n=!0){var c=i.value;r.push(isUpperCase©?c.toLowerCase():c.toUpperCase())}}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}return r.join(“”)},endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},truncate=function(e){var t=1<arguments.length&&void 0!==arguments?arguments:150;return e.length>t?e.slice(0,t):e},surround=function(e,t){return.join(“”)},reverse=function(e){return chars(e).reverse().join(“”)},repeat=function(){var e=0<arguments.length&&void 0!==arguments?arguments:“”,t=1<arguments.length&&void 0!==arguments?arguments:1;if(!isFinite(t))throw new MathError(“`count` must be a finite number!”);return Array(0<=t?parseInt(t,10)+1:-1).join(e)},count=function(e){var t=1<arguments.length&&void 0!==arguments?arguments:“”,r=2<arguments.length&&void 0!==arguments?arguments:0,n=arguments;n=null===n?e.length:n;var o=e.slice(r,n);if(“[object RegExp]”!=getTag(t))return o.slice(r,n).split(t).length-1;t.global||(t=new RegExp(t.source,(t.ignoreCase?“i”:“”)+(t.multiLine?“m”:“”)+“g”));var a=0;return o.replace(t,function(){a++}),a},map=function(e,t){return 0===(e=toString(e)).length||“function”!=typeof t?e:e.replace(/./g,t)};function _classCallCheck$4(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}var RailString=function e(){_classCallCheck$4(this,e)};Object.setPrototypeOf(RailString,{escapeRegexOps:escapeRegexOps,isPalindrome:isPalindrome,randomString:randomString,isUpperCase:isUpperCase,capitalize:capitalize,lowerFirst:lowerFirst,upperFirst:upperFirst,pascalCase:pascalCase,camelCase:camelCase$1,kebabCase:kebabCase,titleCase:titleCase,swapCase:swapCase,endsWith:endsWith,truncate:truncate,surround:surround,toString:toString,reverse:reverse,repeat:repeat,count:count,chars:chars,map:map});var isEmptyObject=function(e){for(var t in e)return!1;return!0},cloneObject=function(e){return Object.assign({},e)},_createClass$1=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t;n.enumerable=n.enumerable||!1,n.configurable=!0,“value”in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();function _classCallCheck$5(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}function _possibleConstructorReturn$1(e,t){if(!e)throw new ReferenceError(“this hasn't been initialised - super() hasn't been called”);return!t||“object”!=typeof t&&“function”!=typeof t?e:t}function _inherits$1(e,t){if(“function”!=typeof t&&null!==t)throw new TypeError(“Super expression must either be null or a function, not ”+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var ValueError=function(e){function a(){var e;_classCallCheck$5(this,a);for(var t=arguments.length,r=Array(t),n=0;n=arguments;var o=_possibleConstructorReturn$1(this,(e=a.__proto__||Object.getPrototypeOf(a)).call.apply(e,.concat®));return o.name=“ValueError”,Error.captureStackTrace(o,a),o}return _inherits$1(a,Error),_createClass$1(a,[{key:Symbol.toStringTag,get:function(){return this.name}}]),a}(),filterOut=function(e,t){switch(getTag(t)){case“[object Array]”:var r=function(t){e=e.filter(function(e){return e!==t})},n=!0,o=!1,a=void 0;try{for(var i,s=t();!(n=(i=s.next()).done);n=!0){r(i.value)}}catch(e){o=!0,a=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw a}}break;case“[object String]”:e=e.filter(function(e){return e!==t});break;case“[object RegExp]”:e=e.filter(function(e){return!t.test(e.toString())});break;default:throw new ValueError(“`toRemove` must be one of type: {Array|String|RegExp}”)}return e},has=function(e,t){return null!=e&&Object.prototype.hasOwnProperty.call(e,t)},keys=function(e){if(!isObject(e))return[];if(Object.keys)return Object.keys(e);var t=[];for(var r in e)has(e,r)&&t.push®;return t},invert=function(e){for(var t={},r=keys(e),n=0,o=r.length;n]]=r;return t};function _classCallCheck$6(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}var Iter=function e(){_classCallCheck$6(this,e)};Object.setPrototypeOf(Iter,{isEmptyObject:isEmptyObject,cloneObject:cloneObject,filterOut:filterOut,invert:invert,keys:keys});var _createClass$2=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t;n.enumerable=n.enumerable||!1,n.configurable=!0,“value”in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();function _classCallCheck$7(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}var Person=function(){function o(e,t,r,n){_classCallCheck$7(this,o),this.firstName=upperFirst(e.toLowerCase()),this.lastName=upperFirst(t.toLowerCase()),this._birthYear=r,this._sex=0===n?“Male”:“Female”}return _createClass$2(o,null,[{key:“age”,get:function(){var e=(new Date).getFullYear();return 0<=e-this._birthYear?e-this._birthYear:0}},{key:“name”,get:function(){return this.firstName+“ ”+this.lastName}}]),o}(),_createClass$3=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t;n.enumerable=n.enumerable||!1,n.configurable=!0,“value”in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();function _classCallCheck$8(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}function _possibleConstructorReturn$2(e,t){if(!e)throw new ReferenceError(“this hasn't been initialised - super() hasn't been called”);return!t||“object”!=typeof t&&“function”!=typeof t?e:t}function _inherits$2(e,t){if(“function”!=typeof t&&null!==t)throw new TypeError(“Super expression must either be null or a function, not ”+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Employee=function(e){function c(e,t,r,n,o){var a=5<arguments.length&&void 0!==arguments&&arguments,i=6<arguments.length&&void 0!==arguments?arguments:14;_classCallCheck$8(this,c);var s=_possibleConstructorReturn$2(this,(c.__proto__||Object.getPrototypeOf©).call(this,e,t,r,n));return s.isManager=a,s.job=upperFirst(o.toLowerCase()),s.salary=i,s}return _inherits$2(c,Person),_createClass$3(c,[{key:“promotion”,value:function(e){1<arguments.length&&void 0!==arguments&&arguments&&(this.isManager=!0),this.job=upperFirst(e.toLowerCase()),this.salary+=.2*this.salary}},{key:“getRaise”,value:function(e){return this.salary+=e,this.salary}}]),c}(),_createClass$4=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t;n.enumerable=n.enumerable||!1,n.configurable=!0,“value”in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();function _classCallCheck$9(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}function _possibleConstructorReturn$3(e,t){if(!e)throw new ReferenceError(“this hasn't been initialised - super() hasn't been called”);return!t||“object”!=typeof t&&“function”!=typeof t?e:t}function _inherits$3(e,t){if(“function”!=typeof t&&null!==t)throw new TypeError(“Super expression must either be null or a function, not ”+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var VariableNotDefinedError=function(e){function a(){var e;_classCallCheck$9(this,a);for(var t=arguments.length,r=Array(t),n=0;n=arguments;var o=_possibleConstructorReturn$3(this,(e=a.__proto__||Object.getPrototypeOf(a)).call.apply(e,.concat®));return o.name=“VariableNotDefinedError”,Error.captureStackTrace(o,a),o}return _inherits$3(a,Error),_createClass$4(a,[{key:Symbol.toStringTag,get:function(){return this.name}}]),a}(),_createClass$5=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t;n.enumerable=n.enumerable||!1,n.configurable=!0,“value”in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}();function _classCallCheck$a(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}function _possibleConstructorReturn$4(e,t){if(!e)throw new ReferenceError(“this hasn't been initialised - super() hasn't been called”);return!t||“object”!=typeof t&&“function”!=typeof t?e:t}function _inherits$4(e,t){if(“function”!=typeof t&&null!==t)throw new TypeError(“Super expression must either be null or a function, not ”+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var User=function(e){function u(e,t,r,n,o,a,i){var s=7<arguments.length&&void 0!==arguments?arguments:null;_classCallCheck$a(this,u);var c=_possibleConstructorReturn$4(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,e,t,r,n));return c.email=validateEmail(o)?o:null,c.phone=s,c._password=i||randomString(),c.username=a,c}return _inherits$4(u,Person),_createClass$5(u,[{key:“setUsername”,value:function(e){if(!e)throw new VariableNotDefinedError(“You must supply a value for `newUsername`!”);return this.username=e,this.username}}]),u}(),abstracts={Employee:Employee,Person:Person,User:User};function _classCallCheck$b(e,t){if(!(e instanceof t))throw new TypeError(“Cannot call a class as a function”)}var _=function e(){_classCallCheck$b(this,e)};_.Validation=Validation,_.String=RailString,_.Math=RailMath,_.Type=Type,_.Iter=Iter,_.abstracts=abstracts,module.exports=_;