From 60939a8cc3a1ed9ae1aa149759d52502b9a7d467 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 18 Jun 2019 21:26:58 -0400 Subject: [PATCH] Upgrade babel and do a module build (#336) * Upgrade babel and do a module build * Make sure esm icon files have .svg so they can be resolved * Upgrade jest * Fix package.json module property * Make svgr use camelCase * Make sure svgr components go through babel * Dont use style alias anymore * use maxWorkers for jest in CI * Do not check in dist --- .babelrc | 4 - .circleci/config.yml | 10 +- .gitignore | 3 + .npmignore | 33 + babel.config.js | 29 + dist/snacks.js | 1 - dist/sprite.svg | 70 - package.json | 38 +- scripts/release/build_esm.js | 30 + scripts/release/publish_release.js | 34 +- .../__snapshots__/Button.spec.js.snap | 20 - .../__snapshots__/Checkbox.spec.js.snap | 39 - .../__snapshots__/CircleButton.spec.js.snap | 9 - .../__snapshots__/Radio.spec.js.snap | 34 - .../__snapshots__/Switch.spec.js.snap | 34 - .../__snapshots__/FloatingLabel.spec.js.snap | 5 - .../__tests__/__snapshots__/Form.spec.js.snap | 2 - .../__snapshots__/Select.spec.js.snap | 25 - .../__snapshots__/TextField.spec.js.snap | 6 - .../__snapshots__/TextFieldHint.spec.js.snap | 3 - .../__snapshots__/iconSpec.spec.js.snap | 3 - src/components/Loading/LoadingBox.js | 2 +- .../__snapshots__/DropdownMenu.spec.js.snap | 5 - .../NavigationPills.spec.js.snap | 20 - .../__snapshots__/ScrollTrack.spec.js.snap | 11 - svgo.config.js | 5 + webpack.config.js | 33 +- webpack.release.config.js | 41 +- yarn.lock | 3624 +++++++---------- 29 files changed, 1637 insertions(+), 2536 deletions(-) delete mode 100644 .babelrc create mode 100644 .npmignore create mode 100644 babel.config.js delete mode 100644 dist/snacks.js delete mode 100644 dist/sprite.svg create mode 100644 scripts/release/build_esm.js create mode 100644 svgo.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 3e2d9add..00000000 --- a/.babelrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "presets": ["es2015", "stage-2", "react"], - "plugins": ["transform-decorators-legacy"] -} diff --git a/.circleci/config.yml b/.circleci/config.yml index 3e4d21d0..4545765d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,12 +26,12 @@ jobs: # run tests! - run: name: Run tests - command: yarn test - - - run: + command: yarn test:ci + + - run: name: Upload code coverage report command: ./node_modules/.bin/codecov - - - run: + + - run: name: Upload code coverage report - CoverAlls command: ./node_modules/.bin/coveralls < ./coverage/lcov.info diff --git a/.gitignore b/.gitignore index da6b308c..5536792d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ pids *.seed *.pid.lock +# dist +dist + # Directory for instrumented libs generated by jscoverage/JSCover lib-cov diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..222fc5cf --- /dev/null +++ b/.npmignore @@ -0,0 +1,33 @@ +# Logs +*.log + +src +scripts +lib +docs +test +.babelrc +.codeclimate.yml +.codecov.yml +.eslintrc.js +tsconfig.json +prettier.config.js +styleguide.config.js +webpack.config.js +webpack.release.config.js +yarn.lock + +# Coverage directory used by tools like istanbul +coverage + +# Dependency directories +node_modules + +.DS_Store + +# IDE +.idea +.vscode + +# dev build folder +tmp diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..dd23a3de --- /dev/null +++ b/babel.config.js @@ -0,0 +1,29 @@ +module.exports = api => { + const env = api.env() + const isTest = env === 'test' + + return { + presets: [ + [ + '@babel/preset-env', + { + modules: isTest ? 'commonjs' : false, + loose: true, + }, + ], + '@babel/preset-react', + ], + plugins: [ + [ + '@babel/plugin-proposal-decorators', + { + legacy: true, + }, + ], + ['@babel/plugin-proposal-class-properties', { loose: true }], + ['@babel/plugin-proposal-object-rest-spread', { loose: true }], + ['@babel/transform-runtime', { useESModules: isTest ? false : true }], + '@babel/plugin-transform-react-constant-elements', + ], + } +} diff --git a/dist/snacks.js b/dist/snacks.js deleted file mode 100644 index 7b866158..00000000 --- a/dist/snacks.js +++ /dev/null @@ -1 +0,0 @@ -!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("radium"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","radium","react-dom"],t):"object"==typeof exports?exports.Snacks=t(require("react"),require("prop-types"),require("radium"),require("react-dom")):e.Snacks=t(e.react,e["prop-types"],e.radium,e["react-dom"])}("undefined"!=typeof self?self:this,function(e,t,r,n){return function(e){var t={};function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=51)}([function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function assertString(e){if(!("string"==typeof e||e instanceof String))throw new TypeError("This library (validator.js) validates strings only")},e.exports=t.default},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(r,["snacksTheme"]),i=this.themeIsValid()?a:u.default.themeConfig;return l.default.createElement(e,n({ref:c(e)?void 0:function getRef(e){return t.wrapped=e},snacksTheme:i},o))}}]),Wrapped}(),t.displayName="withTheme("+(e.name||e.displayName||"Component")+")",t.propTypes={snacksTheme:s.themePropTypes},r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={GREEN_700:"#177D05",GREEN_600:"#2A9715",GREEN_500:"#43B02A",GREEN_400:"#5FCA44",GREEN_300:"#7FE364",WHITE:"#FFFFFF",GRAY_97:"#F7F7F7",GRAY_93:"#EEEEEE",GRAY_88:"#E0E0E0",GRAY_74:"#BDBDBD",GRAY_46:"#757575",GRAY_20:"#424242",GRAY_13:"#212121",RED_700:"#B30029",RED_600:"#CC0033",RED_500:"#E6003D",RED_400:"#FF195A",RED_300:"#FF467E"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=t.breakpoints={xs:{min:0,max:767},sm:{min:768,max:831},md:{min:832,max:1039},mdLg:{min:1040,max:1247},lg:{min:1248,max:1455},xl:{min:1456}},a=function assertValidSizes(){for(var e=arguments.length,t=Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isTestEnv=t.isNodeEnv=t.supportsCSSGrid=void 0;var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(49));var a=t.supportsCSSGrid=(0,n.default)(function(){return!(!o()&&!i())||void 0!==document.createElement("div").style["grid-template-rows"]}),o=t.isNodeEnv=function isNodeEnv(){return"undefined"==typeof window},i=t.isTestEnv=function isTestEnv(){return(window&&window.navigator&&navigator.userAgent||"").match(/(Node.js|jsdom)/)};t.default={isNodeEnv:o,isTestEnv:i,supportsCSSGrid:a}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(0)),a=_interopRequireDefault(r(3)),o=_interopRequireDefault(r(2)),i=_interopRequireDefault(r(333));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var l={fontSize:"16px",position:"relative",fontFamily:"ic-icons",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textTransform:"none",speak:"none",lineHeight:"1",fontSmoothing:"antialiased",osxFontSmoothing:"grayscale"},u=function Icon(e){var t=e.style,r=e.onClick,a=function getIcon(e){var t=e.name,r=e.code,n=r||i.default[t],a=parseInt(n,16);return String.fromCodePoint(a)}(e);return n.default.createElement("i",{style:[l,t],"aria-hidden":!0,onClick:r},a)};u.propTypes={name:o.default.oneOf(Object.keys(i.default)),code:o.default.string,style:o.default.object,onClick:o.default.func},t.default=(0,a.default)(u)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,a,o,i=function(){function defineProperties(e,t){for(var r=0;r0&&void 0!==arguments[0]&&arguments[0],t=this.nextStatus;if(null!==t){this.nextStatus=null,this.cancelNextCallback();var r=o.default.findDOMNode(this);t===u?this.performEnter(r,e):this.performExit(r)}else this.props.unmountOnExit&&this.state.status===l&&this.setState({status:i})},Transition.prototype.performEnter=function performEnter(e,t){var r=this,n=this.props.enter,a=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,o=this.getTimeouts();t||n?(this.props.onEnter(e,a),this.safeSetState({status:u},function(){r.props.onEntering(e,a),r.onTransitionEnd(e,o.enter,function(){r.safeSetState({status:s},function(){r.props.onEntered(e,a)})})})):this.safeSetState({status:s},function(){r.props.onEntered(e)})},Transition.prototype.performExit=function performExit(e){var t=this,r=this.props.exit,n=this.getTimeouts();r?(this.props.onExit(e),this.safeSetState({status:c},function(){t.props.onExiting(e),t.onTransitionEnd(e,n.exit,function(){t.safeSetState({status:l},function(){t.props.onExited(e)})})})):this.safeSetState({status:l},function(){t.props.onExited(e)})},Transition.prototype.cancelNextCallback=function cancelNextCallback(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},Transition.prototype.safeSetState=function safeSetState(e,t){var r=this;this.pendingState=e,t=this.setNextCallback(t),this.setState(e,function(){r.pendingState=null,t()})},Transition.prototype.setNextCallback=function setNextCallback(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},Transition.prototype.onTransitionEnd=function onTransitionEnd(e,t,r){this.setNextCallback(r),e?(this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},Transition.prototype.render=function render(){var e=this.state.status;if(e===i)return null;var t=this.props,r=t.children,n=function _objectWithoutProperties(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(t,["children"]);if(delete n.in,delete n.mountOnEnter,delete n.unmountOnExit,delete n.appear,delete n.enter,delete n.exit,delete n.timeout,delete n.addEndListener,delete n.onEnter,delete n.onEntering,delete n.onEntered,delete n.onExit,delete n.onExiting,delete n.onExited,"function"==typeof r)return r(e,n);var o=a.default.Children.only(r);return a.default.cloneElement(o,n)},Transition}(a.default.Component);function noop(){}f.contextTypes={transitionGroup:n.object},f.childContextTypes={transitionGroup:function transitionGroup(){}},f.propTypes={},f.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop,onEntering:noop,onEntered:noop,onExit:noop,onExiting:noop,onExited:noop},f.UNMOUNTED=0,f.EXITED=1,f.ENTERING=2,f.ENTERED=3,f.EXITING=4,t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,a,o=Object.assign||function(e){for(var t=1;t=0;r--){var n=t[r];if(this.menuItemIsValid(n))return r}return e}},{key:"menuItemIsValid",value:function menuItemIsValid(e){return e&&!e.props.disabled}},{key:"renderChildren",value:function renderChildren(){var e=this,t=this.props,r=t.children,n=t.onSelect,a=this.state.currentTabIndex,o=0;return l.default.Children.map(r,function(t){if(!l.default.isValidElement(t))throw new Error("Passing invalid element to Menu");if(t.type&&t.type.isSnacksMenuItem){var r=l.default.cloneElement(t,{index:o,focus:a===o,_onClick:n,onMenuItemFocus:e.handleMenuItemFocus});return o+=1,r}return t})}},{key:"render",value:function render(){var e=this,t=this.props,r=t.ariaHidden,n=t.style,a=t.role,o=i({},c,n);return l.default.createElement("div",{ref:function ref(t){return e.menu=t},role:a,style:o,onKeyDown:this.handleKeyDown,onBlur:this.handleBlur,"aria-hidden":r,tabIndex:-1},this.renderChildren())}}]),Menu}(),n.propTypes={ariaHidden:u.default.bool,children:u.default.node.isRequired,onKeyDown:u.default.func,onSelect:u.default.func,onBlur:u.default.func,role:u.default.string,style:u.default.shape({})},n.defaultProps={role:"menu",ariaHidden:!1,style:{},onSelect:function onSelect(){}},a);t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,a,o,i=Object.assign||function(e){for(var t=1;t=0&&r.test(e[a]);)a--;return a=t.min,l=!t.hasOwnProperty("max")||e<=t.max,u=!t.hasOwnProperty("lt")||et.gt;return r.test(e)&&i&&l&&u&&s};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,o=/^[-+]?[0-9]+$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isIP(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,n.default)(e);t=String(t);if(!t)return isIP(e,4)||isIP(e,6);if("4"===t){if(!a.test(e))return!1;var r=e.split(".").sort(function(e,t){return e-t});return r[3]<=255}if("6"===t){var i=e.split(":"),l=!1,u=isIP(i[i.length-1],4),s=u?7:8;if(i.length>s)return!1;if("::"===e)return!0;"::"===e.substr(0,2)?(i.shift(),i.shift(),l=!0):"::"===e.substr(e.length-2)&&(i.pop(),i.pop(),l=!0);for(var c=0;c0&&c=1:i.length===s}return!1};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,o=/^[0-9A-F]{1,4}$/i;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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};t.default=function isByteLength(e,t){(0,a.default)(e);var r=void 0,o=void 0;"object"===(void 0===t?"undefined":n(t))?(r=t.min||0,o=t.max):(r=arguments[1],o=arguments[2]);var i=encodeURI(e).split(/%..|./).length-1;return i>=r&&(void 0===o||i<=o)};var a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function toFloat(e){return(0,n.default)(e),parseFloat(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(2));var a={trackProps:n.default.shape({showLeftArrow:n.default.bool,showRightArrow:n.default.bool,left:n.default.number,parentWidth:n.default.number,trackWidth:n.default.number,trackBounds:n.default.object})};t.default=a},function(e,t,r){(function(e,r){var n=200,a="__lodash_hash_undefined__",o=1,i=2,l=9007199254740991,u="[object Arguments]",s="[object Array]",c="[object AsyncFunction]",f="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",v="[object GeneratorFunction]",g="[object Map]",m="[object Number]",b="[object Null]",_="[object Object]",y="[object Proxy]",x="[object RegExp]",O="[object Set]",w="[object String]",R="[object Symbol]",j="[object Undefined]",P="[object ArrayBuffer]",C="[object DataView]",E=/^\[object .+?Constructor\]$/,S=/^(?:0|[1-9]\d*)$/,D={};D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D[u]=D[s]=D[P]=D[f]=D[C]=D[d]=D[p]=D[h]=D[g]=D[m]=D[_]=D[x]=D[O]=D[w]=D["[object WeakMap]"]=!1;var M="object"==typeof e&&e&&e.Object===Object&&e,z="object"==typeof self&&self&&self.Object===Object&&self,k=M||z||Function("return this")(),q="object"==typeof t&&t&&!t.nodeType&&t,T=q&&"object"==typeof r&&r&&!r.nodeType&&r,A=T&&T.exports===q,F=A&&M.process,B=function(){try{return F&&F.binding&&F.binding("util")}catch(e){}}(),L=B&&B.isTypedArray;function arraySome(e,t){for(var r=-1,n=null==e?0:e.length;++rs))return!1;var f=l.get(e);if(f&&l.get(t))return f==t;var d=-1,p=!0,h=r&i?new SetCache:void 0;for(l.set(e,t),l.set(t,e);++d-1},ListCache.prototype.set=function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},MapCache.prototype.clear=function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(ie||ListCache),string:new Hash}},MapCache.prototype.delete=function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t},MapCache.prototype.get=function mapCacheGet(e){return getMapData(this,e).get(e)},MapCache.prototype.has=function mapCacheHas(e){return getMapData(this,e).has(e)},MapCache.prototype.set=function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},SetCache.prototype.add=SetCache.prototype.push=function setCacheAdd(e){return this.__data__.set(e,a),this},SetCache.prototype.has=function setCacheHas(e){return this.__data__.has(e)},Stack.prototype.clear=function stackClear(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Stack.prototype.get=function stackGet(e){return this.__data__.get(e)},Stack.prototype.has=function stackHas(e){return this.__data__.has(e)},Stack.prototype.set=function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var a=r.__data__;if(!ie||a.length-1&&e%1==0&&e-1&&e%1==0&&e<=l}function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function isObjectLike(e){return null!=e&&"object"==typeof e}var we=L?function baseUnary(e){return function(t){return e(t)}}(L):function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!D[baseGetTag(e)]};function keys(e){return function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}(e)?arrayLikeKeys(e):baseKeys(e)}r.exports=function isEqual(e,t){return baseIsEqual(e,t)}}).call(this,r(125),r(124)(e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,a,o,i=Object.assign||function(e){for(var t=1;t=0;if(r&&n){if(Math.ceil(r)>=n)return t.hideArrows();a?t.hideRightArrow():t.showRightArrow(),o?t.hideLeftArrow():t.showLeftArrow()}},t.onKeyDown=function(e){[39,37].includes(e.keyCode)&&(e.preventDefault(),39===e.keyCode?t.slideForward():t.slideBack())},t.hideArrows=function(){t.setState({showLeftArrow:!1,showRightArrow:!1})},t.hideRightArrow=function(){t.setState({showRightArrow:!1})},t.hideLeftArrow=function(){t.setState({showLeftArrow:!1})},t.showRightArrow=function(){t.setState({showRightArrow:!0})},t.showLeftArrow=function(){t.setState({showLeftArrow:!0})},t.setSliding=function(){t.setState({isSliding:!0})},t.setNotSliding=function(){t.setState({isSliding:!1})},t.slideForward=function(){if(!t.state.isSliding){var e=t.getNodeWidths(),r=e.parentWidth,n=e.trackWidth,a=t.state.left-r+u,o=r-n,i=t.props,l=i.onBeforeNext,u=i.scrollOffset;a<=o&&(a=o);var s={atStart:n<=r,atEnd:o===a,slideTo:a,parentWidth:r,trackWidth:n};t.setSliding(),l(s).then(function(e){return t.afterBeforeNext(e,s)})}},t.afterBeforeNext=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1],n=t.getNodeWidths(),a=n.parentWidth,o=n.trackWidth,l=t.props,u=l.scrollOffset,s=l.onAfterNext,c=e.scrollOffset||u,f=a-o,d=t.state.left-a+c;d<=f&&(d=f),t.updateLeftValue({left:d,callback:s,callbackProps:i({},r,{atStart:o<=a,atEnd:f===d,slideTo:d,parentWidth:a,trackWidth:o})})},t.slideBack=function(){if(!t.state.isSliding){var e=t.getNodeWidths(),r=e.parentWidth,n=e.trackWidth,a=t.props,o=a.onBeforeBack,i=a.scrollOffset,l=t.state.left+r-i;(t.state.left>=0||l>=0)&&(l=0);var u={atStart:0===l,atEnd:!1,slideTo:l,parentWidth:r,trackWidth:n};t.setSliding(),o(u).then(function(e){return t.afterBeforeBack(e,u)})}},t.afterBeforeBack=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1],n=t.getNodeWidths(),a=n.parentWidth,o=n.trackWidth,l=t.props,u=l.scrollOffset,s=l.onAfterBack,c=e.scrollOffset||u,f=t.state.left+a-c;(t.state.left>=0||f>=0)&&(f=0),t.updateLeftValue({left:f,callback:s,callbackProps:i({},r,{slideTo:f,parentWidth:a,trackWidth:o})})},t.renderRightArrow=function(){var e=p.default.slideButtonStyles,r=t.state.showRightArrow,n=t.props,a=n.styles.RightArrow,o=void 0===a?{}:a,i=n.nextButtonContent;return s.default.createElement(b.default,{onClick:t.slideForward,ariaLabel:"next",style:[e.default,e.right,r&&{display:"block"},o],ref:function ref(e){return t.nextButton=e}},i||s.default.createElement(_.default,{name:"arrowRightSmallBold",style:{fontSize:"20px"}}))},t.renderLeftArrow=function(){var e=p.default.slideButtonStyles,r=t.state.showLeftArrow,n=t.props,a=n.styles.LeftArrow,o=void 0===a?{}:a,i=n.backButtonContent;return s.default.createElement(b.default,{onClick:t.slideBack,ariaLabel:"back",style:[e.default,e.left,r&&{display:"block"},o],ref:function ref(e){return t.backButton=e}},i||s.default.createElement(_.default,{name:"arrowLeftSmallBold",style:{fontSize:"20px"}}))},t.state={isSliding:!1,showLeftArrow:!1,showRightArrow:!1,left:e.leftOverride},t}return 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)}(ScrollTrack,u.Component),l(ScrollTrack,[{key:"componentDidMount",value:function componentDidMount(){this.debouncdComputeSlideAttributes=(0,m.default)(this.computeSlideAttributes,200),this.computeSlideAttributes(),(0,g.isNodeEnv)()||window.addEventListener("resize",this.debouncdComputeSlideAttributes)}},{key:"componentWillReceiveProps",value:function componentWillReceiveProps(e){e.leftOverride!==this.props.leftOverride&&(this.setState({left:e.leftOverride}),this.computeSlideAttributes())}},{key:"componentDidUpdate",value:function componentDidUpdate(e){var t=e.children||[],r=this.props.children||[];(0,c.default)(t,r)||this.computeSlideAttributes()}},{key:"componentWillUnmount",value:function componentWillUnmount(){(0,g.isNodeEnv)()||window.removeEventListener("resize",this.debouncdComputeSlideAttributes)}},{key:"updateLeftValue",value:function updateLeftValue(e){var t=this,r=e.left,n=e.callback,a=e.callbackProps;this.setState({left:r},function(){t.computeSlideAttributes(),setTimeout(function(){t.setNotSliding(),n(a)},t.props.scrollSpeed)})}},{key:"render",value:function render(){var e=p.default.containerStyles,t=p.default.innerContainerStyles,r=this.props,n=r.children,a=r.scrollSpeed,o=r.scrollTimingFunction,l=r.style,u=r.styles.Track,c=void 0===u?{}:u;return n?s.default.createElement("div",{ref:"container",style:i({},e,l),onKeyDown:this.onKeyDown},this.renderLeftArrow(),s.default.createElement("div",{style:[{transition:"transform "+a+"ms "+o,transform:"translate3d("+this.state.left+"px, 0, 0)"},t]},s.default.createElement("div",{ref:"track",style:c},this.childrenWithTrackProps)),this.renderRightArrow()):null}},{key:"childrenWithTrackProps",get:function get(){var e=this.getNodeWidths(),t=i({},this.state,e);return s.default.Children.map(this.props.children,function(e){var r="string"==typeof e.type&&e.type[0]===e.type[0].toLowerCase()?{}:{trackProps:t};return s.default.cloneElement(e,r)})}}]),ScrollTrack}(),a.equalWidthTrack=h.default,a.ScrollTrackPropTypes=v.default,a.propTypes={backButtonContent:d.default.node,children:d.default.node,leftOverride:d.default.number,nextButtonContent:d.default.node,onBeforeNext:d.default.func,onBeforeBack:d.default.func,onAfterNext:d.default.func,onAfterBack:d.default.func,scrollOffset:d.default.number,scrollSpeed:d.default.number,scrollTimingFunction:d.default.string,style:d.default.object,styles:d.default.shape({LeftArrow:d.default.object,RightArrow:d.default.object,Track:d.default.object})},a.defaultProps={leftOverride:0,scrollOffset:0,scrollSpeed:150,scrollTimingFunction:"ease-in-out",styles:{LeftArrow:{},RightArrow:{},Track:{}},style:{},onBeforeBack:function onBeforeBack(){return new Promise(function(e){return e()})},onAfterNext:y,onAfterBack:y,onBeforeNext:function onBeforeNext(){return new Promise(function(e){return e()})}},n=o))||n;t.default=x},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["variant","style","children","elementType","fontWeight"]),p=i||c[t],h=n({},l,s[t],f&&{fontWeight:u[f]},r);return a.default.createElement(p,n({style:h},d),o)}Text.propTypes={variant:i.default.oneOf(Object.keys(s)).isRequired,children:i.default.node.isRequired,elementType:i.default.string,fontWeight:i.default.oneOf(Object.keys(u)),style:i.default.shape({})},t.default=(0,o.default)(Text)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,a,o=Object.assign||function(e){for(var t=1;t1?t-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:"mm dd yyyy",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minYear,o=void 0===r?1:r,i=t.maxYear,l=void 0===i?9999:i,u=e.split(/[^dmyHMS]+/).sort(function(e,t){return a.indexOf(e)-a.indexOf(t)});return function(t){var r=[],a={dd:31,mm:12,yy:99,yyyy:l,HH:23,MM:59,SS:59},i={dd:1,mm:1,yy:0,yyyy:o,HH:0,MM:0,SS:0},s=t.split("");u.forEach(function(t){var n=e.indexOf(t),o=parseInt(a[t].toString().substr(0,1),10);parseInt(s[n],10)>o&&(s[n+1]=s[n],s[n]=0,r.push(n))});var c=0,f=u.some(function(r){var u=e.indexOf(r),s=r.length,f=t.substr(u,s).replace(/\D/g,""),d=parseInt(f,10);"mm"===r&&(c=d||0);var p="dd"===r?n[c]:a[r];if("yyyy"===r&&(1!==o||9999!==l)){var h=parseInt(a[r].toString().substring(0,f.length),10),v=parseInt(i[r].toString().substring(0,f.length),10);return dh}return d>p||f.length===s&&d1?c.slice(0,-1).join("-"):c[0]}if(!s[0].length)return!1;(t.all_lowercase||t.yahoo_lowercase)&&(s[0]=s[0].toLowerCase())}else t.all_lowercase&&(s[0]=s[0].toLowerCase());return s.join("@")};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(11));var a={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},o=["icloud.com","me.com"],i=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],l=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"];e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isWhitelisted(e,t){(0,n.default)(e);for(var r=e.length-1;r>=0;r--)if(-1===t.indexOf(e[r]))return!1;return!0};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function whitelist(e,t){return(0,n.default)(e),e.replace(new RegExp("[^"+t+"]+","g"),"")};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function stripLow(e,t){(0,n.default)(e);var r=t?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,a.default)(e,r)};var n=_interopRequireDefault(r(1)),a=_interopRequireDefault(r(32));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function unescape(e){return(0,n.default)(e),e.replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(///g,"/").replace(/\/g,"\\").replace(/`/g,"`")};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function escape(e){return(0,n.default)(e),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function trim(e,t){return(0,n.default)((0,a.default)(e,t),t)};var n=_interopRequireDefault(r(33)),a=_interopRequireDefault(r(34));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.locales=void 0,t.default=function(e,t){if((0,n.default)(e),t in l)return l[t].test(e);if("any"===t){for(var r in l){if(l.hasOwnProperty(r))if(l[r].test(e))return!0}return!1}throw new Error("Invalid locale '"+t+"'")};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^\d{4}$/,o=/^\d{5}$/,i=/^\d{6}$/,l={AT:a,AU:a,BE:a,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:a,CZ:/^\d{3}\s?\d{2}$/,DE:o,DK:a,DZ:o,ES:o,FI:o,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,IL:o,IN:i,IS:/^\d{3}$/,IT:o,JP:/^\d{3}\-\d{4}$/,KE:o,LI:/^(948[5-9]|949[0-7])$/,MX:o,NL:/^\d{4}\s?[a-z]{2}$/i,NO:a,PL:/^\d{2}\-\d{3}$/,PT:/^\d{4}(\-\d{3})?$/,RO:i,RU:i,SA:o,SE:/^\d{3}\s?\d{2}$/,TW:/^\d{3}(\d{2})?$/,US:/^\d{5}(-\d{4})?$/,ZA:a,ZM:o};t.locales=Object.keys(l)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,n.default)(e),!e.includes(","))return!1;var t=e.split(",");return a.test(t[0])&&o.test(t[1])};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,o=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isDataURI(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^\s*data:([a-z]+\/[a-z0-9\-\+]+(;[a-z\-]+=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9!\$&',\(\)\*\+,;=\-\._~:@\/\?%\s]*\s*$/i;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isBase64(e){(0,n.default)(e);var t=e.length;if(!t||t%4!=0||a.test(e))return!1;var r=e.indexOf("=");return-1===r||r===t-1||r===t-2&&"="===e[t-1]};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/[^A-Z0-9+\/=]/i;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isISO31661Alpha2(e){return(0,n.default)(e),a.includes(e.toUpperCase())};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"];e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isISO8601(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isCurrency(e,t){return(0,a.default)(e),function currencyRegex(e){var t="\\d{"+e.digits_after_decimal[0]+"}";e.digits_after_decimal.forEach(function(e,r){0!==r&&(t=t+"|\\d{"+e+"}")});var r="(\\"+e.symbol.replace(/\./g,"\\.")+")"+(e.require_symbol?"":"?"),n="[1-9]\\d{0,2}(\\"+e.thousands_separator+"\\d{3})*",a="("+["0","[1-9]\\d*",n].join("|")+")?",o="(\\"+e.decimal_separator+"("+t+"))"+(e.require_decimal?"":"?"),i=a+(e.allow_decimal||e.require_decimal?o:"");return e.allow_negatives&&!e.parens_for_negatives&&(e.negative_sign_after_digits?i+="-?":e.negative_sign_before_digits&&(i="-?"+i)),e.allow_negative_sign_placeholder?i="( (?!\\-))?"+i:e.allow_space_after_symbol?i=" ?"+i:e.allow_space_after_digits&&(i+="( (?!$))?"),e.symbol_after_digits?i+=r:i=r+i,e.allow_negatives&&(e.parens_for_negatives?i="(\\("+i+"\\)|"+i+")":e.negative_sign_before_digits||e.negative_sign_after_digits||(i="-?"+i)),new RegExp("^(?!-? )(?=.*\\d)"+i+"$")}(t=(0,n.default)(t,o)).test(e)};var n=_interopRequireDefault(r(11)),a=_interopRequireDefault(r(1));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var o={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isMobilePhone(e,t){if((0,n.default)(e),t in a)return a[t].test(e);if("any"===t){for(var r in a)if(a.hasOwnProperty(r)){var o=a[r];if(o.test(e))return!0}return!1}throw new Error("Invalid locale '"+t+"'")};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a={"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-EG":/^((\+?20)|0)?1[012]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,"el-GR":/^(\+?30)?(69\d{8})$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-HK":/^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,"en-IN":/^(\+?91|0)?[789]\d{9}$/,"en-KE":/^(\+?254|0)?[7]\d{8}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)2\d{7,9}$/,"en-PK":/^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"es-ES":/^(\+?34)?(6\d{1}|7[1234])\d{7}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"he-IL":/^(\+972|0)([23489]|5[0248]|77)[1-9]\d{6}/,"hu-HU":/^(\+?36)(20|30|70)\d{7}$/,"id-ID":/^(\+?62|0[1-9])[\s|\d]+$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"ja-JP":/^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"ms-MY":/^(\+?6?01){1}(([145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"nl-BE":/^(\+?32|0)4?\d{8}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^(\+?55|0)\-?[1-9]{2}\-?[2-9]{1}\d{3,4}\-?\d{4}$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"ro-RO":/^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"vi-VN":/^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,"zh-CN":/^(\+?0?86\-?)?1[345789]\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/};a["en-CA"]=a["en-US"],a["fr-BE"]=a["nl-BE"],a["zh-HK"]=a["en-HK"],e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isISSN(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.default)(e);var r=a;if(r=t.require_hyphen?r.replace("?",""):r,!(r=t.case_sensitive?new RegExp(r):new RegExp(r,"i")).test(e))return!1;var o=e.replace("-",""),i=8,l=0,u=!0,s=!1,c=void 0;try{for(var f,d=o[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var p=f.value,h="X"===p.toUpperCase()?10:+p;l+=h*i,--i}}catch(e){s=!0,c=e}finally{try{!u&&d.return&&d.return()}finally{if(s)throw c}}return l%11==0};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a="^\\d{4}-?\\d{3}[\\dX]$";e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isISBN(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,n.default)(e);t=String(t);if(!t)return isISBN(e,10)||isISBN(e,13);var r=e.replace(/[\s-]+/g,"");var l=0;var u=void 0;if("10"===t){if(!a.test(r))return!1;for(u=0;u<9;u++)l+=(u+1)*r.charAt(u);if("X"===r.charAt(9)?l+=100:l+=10*r.charAt(9),l%11==0)return!!r}else if("13"===t){if(!o.test(r))return!1;for(u=0;u<12;u++)l+=i[u%2]*r.charAt(u);if(r.charAt(12)-(10-l%10)%10==0)return!!r}return!1};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^(?:[0-9]{9}X|[0-9]{10})$/,o=/^(?:[0-9]{13})$/,i=[1,3];e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isISIN(e){if((0,n.default)(e),!a.test(e))return!1;for(var t=e.replace(/[A-Z]/g,function(e){return parseInt(e,36)}),r=0,o=void 0,i=void 0,l=!0,u=t.length-2;u>=0;u--)o=t.substring(u,u+1),i=parseInt(o,10),r+=l&&(i*=2)>=10?i+1:i,l=!l;return parseInt(e.substr(e.length-1),10)===(1e4-r)%10};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isCreditCard(e){(0,n.default)(e);var t=e.replace(/[- ]+/g,"");if(!a.test(t))return!1;for(var r=0,o=void 0,i=void 0,l=void 0,u=t.length-1;u>=0;u--)o=t.substring(u,u+1),i=parseInt(o,10),r+=l&&(i*=2)>=10?i%10+1:i,l=!l;return!(r%10!=0||!t)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|62[0-9]{14})$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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};t.default=function isIn(e,t){(0,a.default)(e);var r=void 0;if("[object Array]"===Object.prototype.toString.call(t)){var i=[];for(r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=(0,o.default)(t[r]));return i.indexOf(e)>=0}if("object"===(void 0===t?"undefined":n(t)))return t.hasOwnProperty(e);if(t&&"function"==typeof t.indexOf)return t.indexOf(e)>=0;return!1};var a=_interopRequireDefault(r(1)),o=_interopRequireDefault(r(21));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isBefore(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:String(new Date);(0,n.default)(e);var r=(0,a.default)(t),o=(0,a.default)(e);return!!(o&&r&&o1&&void 0!==arguments[1]?arguments[1]:String(new Date);(0,n.default)(e);var r=(0,a.default)(t),o=(0,a.default)(e);return!!(o&&r&&o>r)};var n=_interopRequireDefault(r(1)),a=_interopRequireDefault(r(22));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isMongoId(e){return(0,n.default)(e),(0,a.default)(e)&&24===e.length};var n=_interopRequireDefault(r(1)),a=_interopRequireDefault(r(35));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isUUID(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";(0,n.default)(e);var r=a[t];return r&&r.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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};t.default=function isLength(e,t){(0,a.default)(e);var r=void 0,o=void 0;"object"===(void 0===t?"undefined":n(t))?(r=t.min||0,o=t.max):(r=arguments[1],o=arguments[2]);var i=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],l=e.length-i.length;return l>=r&&(void 0===o||l<=o)};var a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isEmpty(e){return(0,n.default)(e),0===e.length};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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};t.default=function isJSON(e){(0,a.default)(e);try{var t=JSON.parse(e);return!!t&&"object"===(void 0===t?"undefined":n(t))}catch(e){}return!1};var a=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isHash(e,t){return(0,n.default)(e),new RegExp("^[a-f0-9]{"+a[t]+"}$").test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isMD5(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^[a-f0-9]{32}$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isISRC(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isHexColor(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isDivisibleBy(e,t){return(0,n.default)(e),(0,a.default)(e)%parseInt(t,10)==0};var n=_interopRequireDefault(r(1)),a=_interopRequireDefault(r(41));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isDecimal(e,t){if((0,a.default)(e),(t=(0,n.default)(t,i)).locale in o.decimal)return!l.includes(e.replace(/ /g,""))&&function decimalRegExp(e){return new RegExp("^[-+]?([0-9]+)?(\\"+o.decimal[e.locale]+"[0-9]{"+e.decimal_digits+"})"+(e.force_decimal?"":"?")+"$")}(t).test(e);throw new Error("Invalid locale '"+t.locale+"'")};var n=_interopRequireDefault(r(11)),a=_interopRequireDefault(r(1)),o=r(17);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var i={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},l=["","-","+"];e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isFloat(e,t){(0,n.default)(e),t=t||{};var r=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\"+(t.locale?a.decimal[t.locale]:".")+"[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$");if(""===e||"."===e)return!1;return r.test(e)&&(!t.hasOwnProperty("min")||e>=t.min)&&(!t.hasOwnProperty("max")||e<=t.max)&&(!t.hasOwnProperty("lt")||et.gt)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1)),a=r(17);e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isSurrogatePair(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isMultibyte(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/[^\x00-\x7F]/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isVariableWidth(e){return(0,n.default)(e),a.fullWidth.test(e)&&o.halfWidth.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1)),a=r(37),o=r(36);e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isAscii(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^[\x00-\x7F]+$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isUppercase(e){return(0,n.default)(e),e===e.toUpperCase()};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isLowercase(e){return(0,n.default)(e),e===e.toLowerCase()};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isPort(e){return(0,n.default)(e,{min:0,max:65535})};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(38));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isNumeric(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^[-+]?[0-9]+$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isAlphanumeric(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";if((0,n.default)(e),t in a.alphanumeric)return a.alphanumeric[t].test(e);throw new Error("Invalid locale '"+t+"'")};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1)),a=r(17);e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isAlpha(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";if((0,n.default)(e),t in a.alpha)return a.alpha[t].test(e);throw new Error("Invalid locale '"+t+"'")};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1)),a=r(17);e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isBoolean(e){return(0,n.default)(e),["true","false","1","0"].indexOf(e)>=0};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isMACAddress(e){return(0,n.default)(e),a.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));var a=/^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isURL(e,t){if((0,n.default)(e),!e||e.length>=2083||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;t=(0,i.default)(t,l);var r=void 0,s=void 0,c=void 0,f=void 0,d=void 0,p=void 0,h=void 0,v=void 0;if(h=e.split("#"),e=h.shift(),h=e.split("?"),e=h.shift(),(h=e.split("://")).length>1){if(r=h.shift(),t.require_valid_protocol&&-1===t.protocols.indexOf(r))return!1}else{if(t.require_protocol)return!1;t.allow_protocol_relative_urls&&"//"===e.substr(0,2)&&(h[0]=e.substr(2))}if(""===(e=h.join("://")))return!1;if(h=e.split("/"),""===(e=h.shift())&&!t.require_host)return!0;if((h=e.split("@")).length>1&&(s=h.shift()).indexOf(":")>=0&&s.split(":").length>2)return!1;f=h.join("@"),p=null,v=null;var g=f.match(u);g?(c="",v=g[1],p=g[2]||null):(h=f.split(":"),c=h.shift(),h.length&&(p=h.join(":")));if(null!==p&&(d=parseInt(p,10),!/^[0-9]+$/.test(p)||d<=0||d>65535))return!1;if(!((0,o.default)(c)||(0,a.default)(c,t)||v&&(0,o.default)(v,6)))return!1;if(c=c||v,t.host_whitelist&&!checkHost(c,t.host_whitelist))return!1;if(t.host_blacklist&&checkHost(c,t.host_blacklist))return!1;return!0};var n=_interopRequireDefault(r(1)),a=_interopRequireDefault(r(20)),o=_interopRequireDefault(r(39)),i=_interopRequireDefault(r(11));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var l={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1},u=/^\[([^\]]+)\](?::([0-9]+))?$/;function checkHost(e,t){for(var r=0;r$/i,s=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,c=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,f=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,d=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function matches(e,t,r){(0,n.default)(e),"[object RegExp]"!==Object.prototype.toString.call(t)&&(t=new RegExp(t,r));return t.test(e)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function contains(e,t){return(0,n.default)(e),e.indexOf((0,a.default)(t))>=0};var n=_interopRequireDefault(r(1)),a=_interopRequireDefault(r(21));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function equals(e,t){return(0,n.default)(e),e===t};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function toBoolean(e,t){if((0,n.default)(e),t)return"1"===e||"true"===e;return"0"!==e&&"false"!==e&&""!==e};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function toInt(e,t){return(0,n.default)(e),parseInt(e,t||10)};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r(1));e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(22)),a=_interopRequireDefault(r(41)),o=_interopRequireDefault(r(114)),i=_interopRequireDefault(r(113)),l=_interopRequireDefault(r(112)),u=_interopRequireDefault(r(111)),s=_interopRequireDefault(r(110)),c=_interopRequireDefault(r(109)),f=_interopRequireDefault(r(108)),d=_interopRequireDefault(r(107)),p=_interopRequireDefault(r(39)),h=_interopRequireDefault(r(20)),v=_interopRequireDefault(r(106)),g=_interopRequireDefault(r(105)),m=_interopRequireDefault(r(104)),b=_interopRequireDefault(r(103)),_=_interopRequireDefault(r(102)),y=_interopRequireDefault(r(101)),x=_interopRequireDefault(r(100)),O=_interopRequireDefault(r(99)),w=_interopRequireDefault(r(37)),R=_interopRequireDefault(r(36)),j=_interopRequireDefault(r(98)),P=_interopRequireDefault(r(97)),C=_interopRequireDefault(r(96)),E=_interopRequireDefault(r(38)),S=_interopRequireDefault(r(95)),D=_interopRequireDefault(r(94)),M=_interopRequireDefault(r(35)),z=_interopRequireDefault(r(93)),k=_interopRequireDefault(r(92)),q=_interopRequireDefault(r(91)),T=_interopRequireDefault(r(90)),A=_interopRequireDefault(r(89)),F=_interopRequireDefault(r(88)),B=_interopRequireDefault(r(87)),L=_interopRequireDefault(r(86)),H=_interopRequireDefault(r(40)),V=_interopRequireDefault(r(85)),I=_interopRequireDefault(r(84)),N=_interopRequireDefault(r(83)),W=_interopRequireDefault(r(82)),G=_interopRequireDefault(r(81)),$=_interopRequireDefault(r(80)),U=_interopRequireDefault(r(79)),Y=_interopRequireDefault(r(78)),Z=_interopRequireDefault(r(77)),K=_interopRequireDefault(r(76)),X=_interopRequireDefault(r(75)),J=_interopRequireDefault(r(74)),Q=_interopRequireDefault(r(73)),ee=_interopRequireDefault(r(72)),te=_interopRequireDefault(r(71)),re=_interopRequireDefault(r(70)),ne=_interopRequireDefault(r(69)),ae=_interopRequireDefault(r(34)),oe=_interopRequireDefault(r(33)),ie=_interopRequireDefault(r(68)),le=_interopRequireDefault(r(67)),ue=_interopRequireDefault(r(66)),se=_interopRequireDefault(r(65)),ce=_interopRequireDefault(r(64)),fe=_interopRequireDefault(r(32)),de=_interopRequireDefault(r(63)),pe=_interopRequireDefault(r(62)),he=_interopRequireDefault(r(21));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var ve={version:"9.1.1",toDate:n.default,toFloat:a.default,toInt:o.default,toBoolean:i.default,equals:l.default,contains:u.default,matches:s.default,isEmail:c.default,isURL:f.default,isMACAddress:d.default,isIP:p.default,isFQDN:h.default,isBoolean:v.default,isAlpha:g.default,isAlphanumeric:m.default,isNumeric:b.default,isPort:_.default,isLowercase:y.default,isUppercase:x.default,isAscii:O.default,isFullWidth:w.default,isHalfWidth:R.default,isVariableWidth:j.default,isMultibyte:P.default,isSurrogatePair:C.default,isInt:E.default,isFloat:S.default,isDecimal:D.default,isHexadecimal:M.default,isDivisibleBy:z.default,isHexColor:k.default,isISRC:q.default,isMD5:T.default,isHash:A.default,isJSON:F.default,isEmpty:B.default,isLength:L.default,isByteLength:H.default,isUUID:V.default,isMongoId:I.default,isAfter:N.default,isBefore:W.default,isIn:G.default,isCreditCard:$.default,isISIN:U.default,isISBN:Y.default,isISSN:Z.default,isMobilePhone:K.default,isPostalCode:ne.default,isCurrency:X.default,isISO8601:J.default,isISO31661Alpha2:Q.default,isBase64:ee.default,isDataURI:te.default,isLatLong:re.default,ltrim:ae.default,rtrim:oe.default,trim:ie.default,escape:le.default,unescape:ue.default,stripLow:se.default,whitelist:ce.default,blacklist:fe.default,isWhitelisted:de.default,normalizeEmail:pe.default,toString:he.default};t.default=ve,e.exports=t.default},function(e,t,r){var n;e.exports=(n=r(0),function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(r,a,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(a,"__esModule",{value:!0}),a.conformToMask=void 0;var l=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(r,["render"]);return delete n.mask,delete n.guide,delete n.pipe,delete n.placeholderChar,delete n.keepCharPositions,delete n.value,delete n.onBlur,delete n.onChange,delete n.showMask,e(function(e){return t.inputElement=e},l({onBlur:this.onBlur,onChange:this.onChange,defaultValue:this.props.value},n))}},{key:"onChange",value:function(e){this.textMaskInputElement.update(),"function"==typeof this.props.onChange&&this.props.onChange(e)}},{key:"onBlur",value:function(e){"function"==typeof this.props.onBlur&&this.props.onBlur(e)}}]),t}(d.default.Component);a.default=m,m.propTypes={mask:h.default.oneOfType([h.default.array,h.default.func,h.default.bool,h.default.shape({mask:h.default.oneOfType([h.default.array,h.default.func]),pipe:h.default.func})]).isRequired,guide:h.default.bool,value:h.default.oneOfType([h.default.string,h.default.number]),pipe:h.default.func,placeholderChar:h.default.string,keepCharPositions:h.default.bool,showMask:h.default.bool},m.defaultProps={render:function(e,t){return d.default.createElement("input",l({ref:e},t))}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.placeholderChar="_"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.guide,l=void 0===n||n,u=r.previousConformedValue,s=void 0===u?i:u,c=r.placeholderChar,f=void 0===c?o.placeholderChar:c,d=r.placeholder,p=void 0===d?(0,a.convertMaskToPlaceholder)(t,f):d,h=r.currentCaretPosition,v=r.keepCharPositions,g=!1===l&&void 0!==s,m=e.length,b=s.length,_=p.length,y=t.length,x=m-b,O=x>0,w=h+(O?-x:0),R=w+Math.abs(x);if(!0===v&&!O){for(var j=i,P=w;P=w&&t=0;E--){var S=C[E].char;if(S!==f){var D=E>=w&&b===y;S===p[D?E-x:E]&&C.splice(E,1)}}var M=i,z=!1;e:for(var k=0;k<_;k++){var q=p[k];if(q===f){if(C.length>0)for(;C.length>0;){var T=C.shift(),A=T.char,F=T.isNew;if(A===f&&!0!==g){M+=f;continue e}if(t[k].test(A)){if(!0===v&&!1!==F&&s!==i&&!1!==l&&O){for(var B=C.length,L=null,H=0;H0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.placeholderChar;if(-1!==e.indexOf(t))throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\nThe placeholder character that was received is: "+JSON.stringify(t)+"\n\nThe mask that was received is: "+JSON.stringify(e));return e.map(function(e){return e instanceof RegExp?t:e}).join("")},t.isString=function o(e){return"string"==typeof e||e instanceof String},t.isNumber=function i(e){return"number"==typeof e&&void 0===e.length&&!isNaN(e)},t.processCaretTraps=function a(e){for(var t=[],r=void 0;-1!==(r=e.indexOf(s));)t.push(r),e.splice(r,1);return{maskWithoutCaretTraps:e,indexes:t}};var l=r(1),u=[],s="[]"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function r(e){var t=e.previousConformedValue,r=void 0===t?a:t,o=e.previousPlaceholder,i=void 0===o?a:o,l=e.currentCaretPosition,u=void 0===l?0:l,s=e.conformedValue,c=e.rawValue,f=e.placeholderChar,d=e.placeholder,p=e.indexesOfPipedChars,h=void 0===p?n:p,v=e.caretTrapIndexes,g=void 0===v?n:v;if(0===u)return 0;var m=c.length,b=r.length,_=d.length,y=s.length,x=m-b,O=x>0;if(x>1&&!O&&0!==b)return u;var w=0,R=void 0,j=void 0;if(!O||r!==s&&s!==d){var P=s.toLowerCase(),C=c.toLowerCase(),E=C.substr(0,u).split(a),S=E.filter(function(e){return-1!==P.indexOf(e)});j=S[S.length-1];var D=i.substr(0,S.length).split(a).filter(function(e){return e!==f}).length,M=d.substr(0,S.length).split(a).filter(function(e){return e!==f}).length,z=M!==D,k=void 0!==i[S.length-1]&&void 0!==d[S.length-2]&&i[S.length-1]!==f&&i[S.length-1]!==d[S.length-1]&&i[S.length-1]===d[S.length-2];!O&&(z||k)&&D>0&&d.indexOf(j)>-1&&void 0!==c[u]&&(R=!0,j=c[u]);for(var q=h.map(function(e){return P[e]}),T=q.filter(function(e){return e===j}).length,A=S.filter(function(e){return e===j}).length,F=d.substr(0,d.indexOf(f)).split(a).filter(function(e,t){return e===j&&c[t]!==e}).length,B=F+A+T+(R?1:0),L=0,H=0;H=B)break}}else w=u-x;if(O){for(var I=w,N=w;N<=_;N++)if(d[N]===f&&(I=N),d[N]===f||-1!==g.indexOf(N)||N===_)return I}else if(R){for(var W=w-1;W>=0;W--)if(s[W]===j||-1!==g.indexOf(W)||0===W)return W}else for(var G=w;G>=0;G--)if(d[G-1]===f||-1!==g.indexOf(G)||0===G)return G};var n=[],a=""},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){document.activeElement===e&&(_?y(function(){return e.setSelectionRange(t,t,m)},0):e.setSelectionRange(t,t,m))}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:e,o=n.inputElement,s=n.mask,f=n.guide,m=n.pipe,_=n.placeholderChar,y=void 0===_?h.placeholderChar:_,x=n.keepCharPositions,O=void 0!==x&&x,w=n.showMask,R=void 0!==w&&w;if(void 0===r&&(r=o.value),r!==t.previousConformedValue){(void 0===s?"undefined":u(s))===b&&void 0!==s.pipe&&void 0!==s.mask&&(m=s.pipe,s=s.mask);var j=void 0,P=void 0;if(s instanceof Array&&(j=(0,p.convertMaskToPlaceholder)(s,y)),!1!==s){var C=function a(e){if((0,p.isString)(e))return e;if((0,p.isNumber)(e))return String(e);if(null==e)return g;throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value received was:\n\n "+JSON.stringify(e))}(r),E=o.selectionEnd,S=t.previousConformedValue,D=t.previousPlaceholder,M=void 0;if((void 0===s?"undefined":u(s))===v){if(!1===(P=s(C,{currentCaretPosition:E,previousConformedValue:S,placeholderChar:y})))return;var z=(0,p.processCaretTraps)(P),k=z.maskWithoutCaretTraps,q=z.indexes;P=k,M=q,j=(0,p.convertMaskToPlaceholder)(P,y)}else P=s;var T={previousConformedValue:S,guide:f,placeholderChar:y,pipe:m,placeholder:j,currentCaretPosition:E,keepCharPositions:O},A=(0,d.default)(C,P,T),F=A.conformedValue,B=(void 0===m?"undefined":u(m))===v,L={};B&&(!1===(L=m(F,l({rawValue:C},T)))?L={value:S,rejected:!0}:(0,p.isString)(L)&&(L={value:L}));var H=B?L.value:F,V=(0,c.default)({previousConformedValue:S,previousPlaceholder:D,conformedValue:H,placeholder:j,rawValue:C,currentCaretPosition:E,placeholderChar:y,indexesOfPipedChars:L.indexesOfPipedChars,caretTrapIndexes:M}),I=H===j&&0===V,N=R?j:g,W=I?N:H;t.previousConformedValue=W,t.previousPlaceholder=j,o.value!==W&&(o.value=W,i(o,V))}}}}};var s=r(4),c=n(s),f=r(2),d=n(f),p=r(3),h=r(1),v="function",g="",m="none",b="object",_="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),y="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:setTimeout},function(e,t){"use strict";function r(e){return function(){return e}}var n=function(){};n.thatReturns=r,n.thatReturnsFalse=r(!1),n.thatReturnsTrue=r(!0),n.thatReturnsNull=r(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},function(e,t,r){"use strict";var a=function(e){};e.exports=function n(e,t,r,o,i,l,u,s){if(a(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[r,o,i,l,u,s],d=0;(c=new Error(t.replace(/%s/g,function(){return f[d++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(r,n,a){"use strict";var o=a(6),i=a(7),l=a(10);r.exports=function(){function e(e,t,r,n,a,o){o!==l&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return r.checkPropTypes=o,r.PropTypes=r,r}},function(e,t,r){"use strict";"function"==typeof Symbol&&Symbol.iterator,e.exports=r(8)()},function(e,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){e.exports=n}]))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,a,o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["color","name","size"]),s=l[r];return a.default.createElement(s,n({"aria-hidden":!0,fill:t,width:u[o],height:u[o]},i))}SVGIcon.propTypes={color:i.default.string,name:i.default.oneOf(Object.keys(l)).isRequired,size:i.default.oneOf(Object.keys(u))},SVGIcon.defaultProps={color:"currentColor",size:"standard"},t.default=(0,o.default)(SVGIcon)},function(e,t,r){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0});var a=_interopRequireDefault(r(0)),o=_interopRequireDefault(r(2)),i=_interopRequireDefault(r(3)),l=_interopRequireDefault(r(9));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u=(_defineProperty(n={marginTop:0,marginRight:"auto",marginBottom:0,marginLeft:"auto"},l.default.xs,{width:"100%"}),_defineProperty(n,l.default.sm,{width:l.default.screenWidths.sm}),_defineProperty(n,l.default.md,{width:l.default.screenWidths.md}),_defineProperty(n,l.default.mdLg,{width:l.default.screenWidths.mdLg}),_defineProperty(n,l.default.lg,{width:l.default.screenWidths.lg}),_defineProperty(n,l.default.xl,{width:l.default.screenWidths.xl}),n),s=function Grid(e){return a.default.createElement("div",{style:[u,e.style]},e.children)};s.propTypes={children:o.default.node,style:o.default.object},t.default=(0,i.default)(s)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={html:{fontSize:"16px"},"html, body":{height:"100%",mozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased"},body:{background:"#f7f7f7",fontFamily:'"Open Sans", "Helvetica Neue", Helvetica, sans-serif',color:"#393939",paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,fontSize:"14px"},a:{textDecoration:"none",backgroundColor:"transparent",":hover":{outline:0,textDecoration:"underline"}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=_interopRequireDefault(r(0)),a=_interopRequireDefault(r(2)),o=_interopRequireDefault(r(3)),i=_interopRequireDefault(r(9)),l=r(12);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u=i.default.columnWidth,s=function Column(e){var t=e.sizes;e.sizes.xs&&console.warn("xs size prop passed to Column!","This will be ignored. All columns at xs screen size are full-width. ","Please remove this definition. Sizes passed: ",e.sizes);var r=(0,l.supportsCSSGrid)()?function getSizedStyles(e){var t;return _defineProperty(t={},i.default.sm,{gridColumn:"span "+(e.sm||1)}),_defineProperty(t,i.default.md,{gridColumn:"span "+(e.md||e.sm||1)}),_defineProperty(t,i.default.mdLg,{gridColumn:"span "+(e.mdLg||e.md||e.sm||1)}),_defineProperty(t,i.default.lg,{gridColumn:"span "+(e.lg||e.mdLg||e.md||e.sm||1)}),_defineProperty(t,i.default.xl,{gridColumn:"span "+(e.xl||e.lg||e.mdLg||e.md||e.sm||1)}),t}(t):function getLecacySizedStyles(e){var t;return _defineProperty(t={display:"inline-block"},i.default.xs,{display:"block",width:"100%"}),_defineProperty(t,i.default.sm,{width:(e.sm||1)*u+"px"}),_defineProperty(t,i.default.md,{width:(e.md||e.sm||1)*u+"px"}),_defineProperty(t,i.default.mdLg,{width:(e.mdLg||e.md||e.sm||1)*u+"px"}),_defineProperty(t,i.default.lg,{width:(e.lg||e.mdLg||e.md||e.sm||1)*u+"px"}),_defineProperty(t,i.default.xl,{width:(e.xl||e.lg||e.mdLg||e.md||e.sm||1)*u+"px"}),t}(t);return n.default.createElement("div",{style:[r,e.style]},e.children)};s.propTypes={children:a.default.node,sizes:a.default.shape({xs:a.default.number,sm:a.default.number,md:a.default.number,mdLg:a.default.number,lg:a.default.number,xl:a.default.number}),style:a.default.object},s.defaultProps={sizes:{}},t.default=(0,o.default)(s)},function(e,t,r){"use strict";r.r(t);var n=r(0),a=r.n(n);function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=bound01(e,360),t=bound01(t,100),r=bound01(r,100),0===t)n=a=o=r;else{var i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;n=hue2rgb(l,i,e+1/3),a=hue2rgb(l,i,e),o=hue2rgb(l,i,e-1/3)}return{r:255*n,g:255*a,b:255*o}}(e.h,n,u),f=!0,p="hsl"),e.hasOwnProperty("a")&&(r=e.a));return r=boundAlpha(r),{ok:f,format:e.format||p,r:s(255,c(t.r,0)),g:s(255,c(t.g,0)),b:s(255,c(t.b,0)),a:r}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=u(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=u(this._r)),this._g<1&&(this._g=u(this._g)),this._b<1&&(this._b=u(this._b)),this._ok=r.ok,this._tc_id=l++}function rgbToHsl(e,t,r){e=bound01(e,255),t=bound01(t,255),r=bound01(r,255);var n,a,o=c(e,t,r),i=s(e,t,r),l=(o+i)/2;if(o==i)n=a=0;else{var u=o-i;switch(a=l>.5?u/(2-o-i):u/(o+i),o){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+a)%360,o.push(tinycolor(n));return o}function monochromatic(e,t){t=t||6;for(var r=tinycolor(e).toHsv(),n=r.h,a=r.s,o=r.v,i=[],l=1/t;t--;)i.push(tinycolor({h:n,s:a,v:o})),o=(o+l)%1;return i}tinycolor.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:a.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:a.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:a.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=boundAlpha(e),this._roundA=u(100*this._a)/100,this},toHsv:function(){var e=rgbToHsv(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=rgbToHsv(this._r,this._g,this._b),t=u(360*e.h),r=u(100*e.s),n=u(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=rgbToHsl(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=rgbToHsl(this._r,this._g,this._b),t=u(360*e.h),r=u(100*e.s),n=u(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return rgbToHex(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function rgbaToHex(e,t,r,n,a){var o=[pad2(u(e).toString(16)),pad2(u(t).toString(16)),pad2(u(r).toString(16)),pad2(convertDecimalToHex(n))];if(a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:u(this._r),g:u(this._g),b:u(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+u(this._r)+", "+u(this._g)+", "+u(this._b)+")":"rgba("+u(this._r)+", "+u(this._g)+", "+u(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:u(100*bound01(this._r,255))+"%",g:u(100*bound01(this._g,255))+"%",b:u(100*bound01(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+u(100*bound01(this._r,255))+"%, "+u(100*bound01(this._g,255))+"%, "+u(100*bound01(this._b,255))+"%)":"rgba("+u(100*bound01(this._r,255))+"%, "+u(100*bound01(this._g,255))+"%, "+u(100*bound01(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(p[rgbToHex(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+rgbaToArgbHex(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var a=tinycolor(e);r="#"+rgbaToArgbHex(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return tinycolor(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(lighten,arguments)},brighten:function(){return this._applyModification(brighten,arguments)},darken:function(){return this._applyModification(darken,arguments)},desaturate:function(){return this._applyModification(desaturate,arguments)},saturate:function(){return this._applyModification(saturate,arguments)},greyscale:function(){return this._applyModification(greyscale,arguments)},spin:function(){return this._applyModification(spin,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(analogous,arguments)},complement:function(){return this._applyCombination(complement,arguments)},monochromatic:function(){return this._applyCombination(monochromatic,arguments)},splitcomplement:function(){return this._applyCombination(splitcomplement,arguments)},triad:function(){return this._applyCombination(triad,arguments)},tetrad:function(){return this._applyCombination(tetrad,arguments)}},tinycolor.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:convertToPercentage(e[n]));e=r}return tinycolor(e,t)},tinycolor.equals=function(e,t){return!(!e||!t)&&tinycolor(e).toRgbString()==tinycolor(t).toRgbString()},tinycolor.random=function(){return tinycolor.fromRatio({r:f(),g:f(),b:f()})},tinycolor.mix=function(e,t,r){r=0===r?0:r||50;var n=tinycolor(e).toRgb(),a=tinycolor(t).toRgb(),o=r/100;return tinycolor({r:(a.r-n.r)*o+n.r,g:(a.g-n.g)*o+n.g,b:(a.b-n.b)*o+n.b,a:(a.a-n.a)*o+n.a})},tinycolor.readability=function(e,t){var r=tinycolor(e),n=tinycolor(t);return(a.max(r.getLuminance(),n.getLuminance())+.05)/(a.min(r.getLuminance(),n.getLuminance())+.05)},tinycolor.isReadable=function(e,t,r){var n,a,o=tinycolor.readability(e,t);switch(a=!1,(n=function validateWCAG2Parms(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},tinycolor.mostReadable=function(e,t,r){var n,a,o,i,l=null,u=0;a=(r=r||{}).includeFallbackColors,o=r.level,i=r.size;for(var s=0;su&&(u=n,l=tinycolor(t[s]));return tinycolor.isReadable(e,l,{level:o,size:i})||!a?l:(r.includeFallbackColors=!1,tinycolor.mostReadable(e,["#fff","#000"],r))};var d=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},p=tinycolor.hexNames=function flip(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(d);function boundAlpha(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function bound01(e,t){(function isOnePointZero(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function isPercentage(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=s(t,c(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),a.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function clamp01(e){return s(1,c(0,e))}function parseIntFromHex(e){return parseInt(e,16)}function pad2(e){return 1==e.length?"0"+e:""+e}function convertToPercentage(e){return e<=1&&(e=100*e+"%"),e}function convertDecimalToHex(e){return a.round(255*parseFloat(e)).toString(16)}function convertHexToDecimal(e){return parseIntFromHex(e)/255}var h,v,g,m=(v="[\\s|\\(]+("+(h="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+h+")[,|\\s]+("+h+")\\s*\\)?",g="[\\s|\\(]+("+h+")[,|\\s]+("+h+")[,|\\s]+("+h+")[,|\\s]+("+h+")\\s*\\)?",{CSS_UNIT:new RegExp(h),rgb:new RegExp("rgb"+v),rgba:new RegExp("rgba"+g),hsl:new RegExp("hsl"+v),hsla:new RegExp("hsla"+g),hsv:new RegExp("hsv"+v),hsva:new RegExp("hsva"+g),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function isValidCSSUnit(e){return!!m.CSS_UNIT.exec(e)}void 0!==e&&e.exports?e.exports=tinycolor:void 0===(n=function(){return tinycolor}.call(t,r,t,e))||(e.exports=n)}(Math)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.darken=void 0;var n=_interopRequireDefault(r(329)),a=_interopRequireDefault(r(49));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.darken=(0,a.default)(function(e,t){return(0,n.default)(e).darken(t).toHexString()})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(330);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function get(){return n[e]}})})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={DISCLAIMER_SMALL:{color:"#999",fontSize:10,lineHeight:"1.5em"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={accountFilled:"e044",account:"e043",addToOrderAndroid:"e092",addToOrderFilled:"e093",addToOrder:"e094",adjustment:"e087",alcoholFilled:"e049",alcohol:"e01b",arrowDownSmallBold:"e013",arrowDownSmall:"e014",arrowEnter:"e04a",arrowLeftSmallBold:"e011",arrowLeftSmall:"e012",arrowLeft:"e04b",arrowRightSmallBold:"e00f",arrowRightSmall:"e010",arrowRight:"e027",arrowUpSmallBold:"e00d",arrowUpSmall:"e00e",bagFilled:"e038",bag:"e037",bellFilled:"e047",bell:"e01a",bogoFilled:"e097",bogo:"e02c",browseFilled:"e00c",browse:"e09b",calendar:"e015",carFilled:"e01c",car:"e019",cartFilled:"e02d",cart:"e023",categories:"e0a9",checkBold:"e03c",checkProgressComplete:"e088",checkProgressDashed:"e089",check:"e03b",clockFilled:"e04c",clock:"e017",compassFilled:"e046",creditCardFilled:"e04d",creditCard:"e048",dealsFilled:"e05e",dealsIcon:"e07b",deals:"e04e",emailFilled:"e02f",email:"e084",facebookFilled:"e030",faq:"e031",filterAndroid:"e076",filterFilled:"e078",filter:"e077",flagFilled:"e098",flag:"e08c",gearFilled:"e09c",gear:"e099",gift:"e09e",giftcardFilled:"e0a1",giftcard:"e09f",googleFilled:"e050",google:"e04f",gridFilled:"e08b",grid:"e08a",guaranteedFreshFilled:"e054",guaranteedFresh:"e055",hamburger:"e02e",happy:"e029",helpFilled:"e053",help:"e00b",homeFilled:"e05f",home:"e022",iconExit:"e08d",iconPersonAddFilled:"e090",iconPersonAdd:"e08f",iconPersonFilled:"e091",iconPerson:"e08e",inSeasonFilled:"e079",inSeason:"e070",infoFilled:"e052",info:"e001",instagram:"e073",items:"e0a2",itemsFilled:"e06f",itemsYouveOrdered:"e0a3",lightbulbAndroid:"e07d",lightbulbFilled:"e07e",lightbulb:"e07c",likeFilled:"e081",like:"e080",listsAndRecipesFilled:"e07f",listsAndRecipes:"e002",listsAdd:"e045",locationMarkerFilled:"e051",locationMarker:"e003",lock:"e018",logout:"e004",loyaltyCardFilled:"e056",loyaltyCard:"e021",messageFilled:"e042",message:"e041",minusBold:"e058",minus:"e057",money:"e005",moreFilled:"e059",more:"e006",noFilled:"e03f",no:"e040",noteFilled:"e061",note:"e060",officeFilled:"e063",office:"e062",orderHistory:"e007",orderProblem:"e064",orderReview:"e071",organicFilled:"e05b",organic:"e05a",phoneAndroidFilled:"e066",phoneAndroid:"e065",phoneFilled:"e03d",phoneIphoneFilled:"e06a",phoneIphone:"e06b",phone:"e03e",picture:"e024",pinterestFilled:"e05c",plusBold:"e02b",plus:"e02a",popular:"e072",pricingFilled:"e01e",pricingSameFilled:"e020",pricingSame:"e01f",pricing:"e01d",quickAdd:"e0a6",reactionAdd:"e0a0",receipt:"e028",reccuring:"e0a7",refund:"e085",replaceBold:"e06c",replace:"e067",request:"e086",save:"e0a8",saveFilled:"e0aa",scissors:"e074",search:"e008",shareAndroid2Filled:"e03a",shareAndroid2:"e039",shareAndroidFilled:"e032",shareAndroid:"e033",sort:"e09d",specialsFilled:"e068",specials:"e069",starFilled:"e026",star:"e025",storeFilled:"e075",store:"e009",thumbsDown:"e096",thumbsUp:"e095",ticketFilled:"e036",ticket:"e00a",tipFilled:"e05d",tip:"e016",tobacco:"e035",trashFilled:"e0a5",trash:"e0a4",twitterFilled:"e034",viewFilled:"e083",view:"e082",weight:"e09a",xBold:"e07a",xCircleFilled:"e06e",xCircle:"e06d",x:"e000"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;ta){var s=u-a,c=a-(n.left+n.width);o.left=o.left-s-Math.min(8,c)}i.left=n.left-o.left+l-6-1}else{var f=n.height/2,d=o.height/2;o.top=n.top+f-d,i.top=d-6-1,"right"===e?(o.left=n.left+n.width+16,i.left=-6):(o.left=n.left-o.width-16,i.left=o.width-6-1)}this.setState({overlayRect:o,arrowPosition:i})}},{key:"render",value:function render(){var e=this,t=this.props,r=t.children,n=t.placement,a=this.state.overlayRect,i=f;a.top&&(i=o({},i,{top:a.top,left:a.left}));var s=u.default.Children.only(r);return s=(0,l.cloneElement)(s,{arrowPosition:this.state.arrowPosition,placement:n}),u.default.createElement("div",{style:i,ref:function ref(t){return e.overlay=t}},s)}}]),TooltipPosition}(),n.propTypes={children:c.default.node.isRequired,target:c.default.oneOfType([c.default.node,c.default.func]).isRequired,placement:c.default.oneOf(["top","left","right","bottom"]).isRequired},a);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,a,o=function(){function defineProperties(e,t){for(var r=0;r - - Checkbox - Created with Sketch. - - - - - - - - - CheckboxDisabled - Created with Sketch. - - - - - - - - - - - CheckboxSelected - Created with Sketch. - - - - - - - - - - Radio - Created with Sketch. - - - - - - - - - RadioDisabled - Created with Sketch. - - - - - - - - - - - RadioSelected - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/package.json b/package.json index 456f06fe..1d49e743 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,12 @@ "version": "0.0.125", "description": "The Instacart Component Library for Web", "main": "dist/snacks.js", + "module": "dist/esm/index.js", "scripts": { "analyze-webpack-bundles": "analyze=true npm run start", - "build": "webpack --progress --config webpack.release.config.js", + "build": "yarn build:umd && yarn build:esm", + "build:umd": "webpack --progress --config webpack.release.config.js", + "build:esm": "babel-node scripts/release/build_esm.js", "release:build": "babel-node scripts/release/build_release.js", "release:verifyBuild": "babel-node scripts/release/verify_build.js", "release:publish": "babel-node scripts/release/publish_release.js", @@ -17,6 +20,7 @@ "styleguide:build": "styleguidist build && node scripts/moveBuildAssets.js", "test:watch": "npm test -- --watch --bail", "test": "jest --silent && npm run test:lint", + "test:ci": "jest --silent --maxWorkers=2 && npm run test:lint", "test:generate-coverage-report": "codecov" }, "repository": { @@ -38,16 +42,21 @@ }, "homepage": "https://github.com/instacart/Snacks#readme", "devDependencies": { + "@babel/cli": "7.4.4", + "@babel/core": "^7.0.0", + "@babel/node": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-transform-react-constant-elements": "7.2.0", + "@babel/plugin-transform-runtime": "7.4.4", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", "@instacart/eslint-config": "0.1.9", "@instacart/prettier-config": "0.1.1", - "babel-core": "^6.26.0", - "babel-jest": "^22.4.1", - "babel-loader": "^7.1.4", - "babel-plugin-transform-decorators-legacy": "^1.3.4", - "babel-polyfill": "^6.22.0", - "babel-preset-es2015": "^6.18.0", - "babel-preset-react": "^6.24.1", - "babel-preset-stage-2": "^6.22.0", + "@svgr/cli": "4.3.0", + "@svgr/webpack": "4.3.0", + "babel-jest": "^24.8.0", + "babel-loader": "^8.0.0", "codecov": "^3.1.0", "coveralls": "^3.0.2", "enzyme": "^3.3.0", @@ -56,7 +65,7 @@ "eslint": "5.16.0", "eslint-import-resolver-webpack": "0.11.0", "fs-extra": "^5.0.0", - "jest": "^22.4.2", + "jest": "^24.8.0", "prettier": "1.16.4", "prompt": "^1.0.0", "radium": "^0.22.0", @@ -73,11 +82,11 @@ "webpack-cli": "^3.0.4" }, "dependencies": { + "@babel/runtime": "^7.1.2", "js-yaml": "3.13.1", "lodash.isequal": "^4.5.0", "react-text-mask": "^5.3.0", "semver": "^5.5.0", - "svgr": "^1.9.2", "text-mask-addons": "^3.8.0", "tinycolor2": "^1.4.1", "underscore": "^1.8.3", @@ -91,6 +100,9 @@ "react-transition-group": "^2.2.1" }, "jest": { + "transform": { + "^.+\\.js$": "babel-jest" + }, "coverageDirectory": "./coverage/", "testURL": "http://localhost", "collectCoverage": true, @@ -103,6 +115,8 @@ "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/scripts/test/fileMock.js", "\\.(css|less)$": "/scripts/test/styleMock.js" }, - "setupTestFrameworkScriptFile": "/scripts/test/testSetup.js" + "setupFilesAfterEnv": [ + "/scripts/test/testSetup.js" + ] } } diff --git a/scripts/release/build_esm.js b/scripts/release/build_esm.js new file mode 100644 index 00000000..e512a5af --- /dev/null +++ b/scripts/release/build_esm.js @@ -0,0 +1,30 @@ +const path = require('path') +const fs = require('fs') +const execSync = require('child_process').execSync + +const exec = command => execSync(command, { stdio: 'inherit' }) + +const svgrTempDir = path.resolve(process.cwd(), 'tmp/svgr') +const svgrAssetsDir = path.resolve(svgrTempDir, 'assets') +const svgrComponentsDir = path.resolve(svgrTempDir, 'components') + +function ensureDir(dir) { + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir) + } +} + +// svg will complain if the --out-dir does not exist +ensureDir(svgrAssetsDir) +ensureDir(svgrComponentsDir) + +console.log('Building ESM build...') + +exec('yarn babel --out-dir dist/esm --ignore=**/__tests__/**,**/docs/** src') + +// do these separately so we don't catch the svg font, it has no ignore option +exec('yarn svgr --filename-case=camel --ext="svg.js" -d tmp/svgr/assets src/assets') +exec('yarn svgr --filename-case=camel --ext="svg.js" -d tmp/svgr/components src/components') + +// now babel the icons +exec('yarn babel --out-dir dist/esm tmp/svgr') diff --git a/scripts/release/publish_release.js b/scripts/release/publish_release.js index c30ab1a1..d7b0f545 100644 --- a/scripts/release/publish_release.js +++ b/scripts/release/publish_release.js @@ -1,10 +1,6 @@ import { execSync } from 'child_process' import prompt from 'prompt' -import { - checkError, - confirmResponsePattern, - isPositiveResponse, -} from './utils' +import { checkError, confirmResponsePattern, isPositiveResponse } from './utils' import { version as packageVersion } from '../../package.json' prompt.message = 'Confirm' @@ -13,11 +9,11 @@ const confirmRelease = { name: `This will publish version ${packageVersion} of the Snacks package to the public npm registry. Are you sure you want to publish a new release of Snacks?`, type: 'string', pattern: confirmResponsePattern, - required : true, - default: 'yes' + required: true, + default: 'yes', } -const confirmReleaseCheck = (userResponse) => { +const confirmReleaseCheck = userResponse => { if (!isPositiveResponse(userResponse)) { console.log('Release confirmation failed. Exiting build...') return false @@ -30,10 +26,10 @@ const confirmBuildPassing = { name: 'Is the circleCi build passing? (https://circleci.com/gh/instacart/Snacks/tree/master)', type: 'string', pattern: confirmResponsePattern, - default: 'yes' + default: 'yes', } -const confirmBuildCheck = (userResponse) => { +const confirmBuildCheck = userResponse => { if (!isPositiveResponse(userResponse)) { console.log('CircleCi test passing confirmation failed. Exiting build...') return false @@ -45,10 +41,12 @@ const confirmBuildCheck = (userResponse) => { const confirmTwoAuthCode = { name: 'Two factor authenticator code', type: 'string', - required: true + required: true, } const checkoutAndPullMaster = () => execSync('git checkout master && git pull origin master') +const buildProject = () => execSync('npm run build') +const verifyBuild = () => execSync('npm run release:verifyBuild') const publishRelease = authCode => execSync(`npm publish --otp ${authCode}`) console.log('Beginning npm publish for Snacks 🥕 🍿 🍪 🥜 🍎 🥨 ') @@ -56,9 +54,17 @@ console.log('Press ctrl+c at any point to abort release') checkoutAndPullMaster() prompt.start() prompt.get([confirmRelease, confirmBuildPassing, confirmTwoAuthCode], (err, result) => { - if(checkError(err)) { return prompt.stop() } - if(!confirmReleaseCheck(result[confirmRelease.name])) { return prompt.stop() } - if(!confirmBuildCheck(result[confirmBuildPassing.name])) { return prompt.stop() } + if (checkError(err)) { + return prompt.stop() + } + if (!confirmReleaseCheck(result[confirmRelease.name])) { + return prompt.stop() + } + if (!confirmBuildCheck(result[confirmBuildPassing.name])) { + return prompt.stop() + } + buildProject() + verifyBuild() publishRelease(result[confirmTwoAuthCode.name]) prompt.stop() }) diff --git a/src/components/Buttons/__tests__/__snapshots__/Button.spec.js.snap b/src/components/Buttons/__tests__/__snapshots__/Button.spec.js.snap index a58fda5d..45e80ad3 100644 --- a/src/components/Buttons/__tests__/__snapshots__/Button.spec.js.snap +++ b/src/components/Buttons/__tests__/__snapshots__/Button.spec.js.snap @@ -41,7 +41,6 @@ exports[`Button applies the elementAttributes prop correctly 1`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Hi @@ -98,7 +97,6 @@ exports[`Button can render as a link if an href is provided 1`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Hi @@ -154,7 +152,6 @@ exports[`Button renders all sizes correctly 1`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Primary Button @@ -209,7 +206,6 @@ exports[`Button renders all sizes correctly 2`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Primary Button @@ -264,7 +260,6 @@ exports[`Button renders all sizes correctly 3`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Primary Button @@ -319,7 +314,6 @@ exports[`Button renders all sizes correctly 4`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Primary Button @@ -374,7 +368,6 @@ exports[`Button renders all snacks button variants correctly 1`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Hi @@ -429,7 +422,6 @@ exports[`Button renders all snacks button variants correctly 2`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Hi @@ -484,7 +476,6 @@ exports[`Button renders all snacks button variants correctly 3`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Hi @@ -539,7 +530,6 @@ exports[`Button renders all snacks button variants correctly 4`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Hi @@ -588,7 +578,6 @@ exports[`Button renders correctly when disabled 1`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Hi @@ -643,13 +632,11 @@ exports[`Button renders icons correctly 1`] = ` "whiteSpace": "nowrap", } } - tabIndex={undefined} type="button" > Hi @@ -743,7 +729,6 @@ exports[`Button renders icons correctly 2`] = ` Hi @@ -913,7 +895,6 @@ exports[`Button renders icons correctly 4`] = ` Hi diff --git a/src/components/Buttons/__tests__/__snapshots__/Checkbox.spec.js.snap b/src/components/Buttons/__tests__/__snapshots__/Checkbox.spec.js.snap index d2baf7b7..31dd6de7 100644 --- a/src/components/Buttons/__tests__/__snapshots__/Checkbox.spec.js.snap +++ b/src/components/Buttons/__tests__/__snapshots__/Checkbox.spec.js.snap @@ -29,14 +29,10 @@ exports[`Checkbox generates a label if a child node is supplied 1`] = ` } />