diff --git a/dist/css/react-widgets.css b/dist/css/react-widgets.css deleted file mode 100644 index dd70b6066..000000000 --- a/dist/css/react-widgets.css +++ /dev/null @@ -1 +0,0 @@ -.rw-btn,.rw-input{color:inherit;font:inherit;margin:0}button.rw-input{overflow:visible}button.rw-input,select.rw-input{text-transform:none}button.rw-input,html input[type="button"].rw-input,input[type="reset"].rw-input,input[type="submit"].rw-input{-webkit-appearance:button;cursor:pointer}button[disabled].rw-input,html input[disabled].rw-input{cursor:not-allowed}button.rw-input::-moz-focus-inner,input.rw-input::-moz-focus-inner{border:0;padding:0}@font-face{font-family:'RwWidgets';src:url('../fonts/rw-widgets.eot?v=4.1.0');src:url('../fonts/rw-widgets.eot?#iefix&v=4.1.0') format('embedded-opentype'),url('../fonts/rw-widgets.woff?v=4.1.0') format('woff'),url('../fonts/rw-widgets.ttf?v=4.1.0') format('truetype'),url('../fonts/rw-widgets.svg?v=4.1.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.rw-i{display:inline-block;font-family:RwWidgets;font-style:normal;font-weight:normal;line-height:1em;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.rw-i-caret-down:before{content:'\e803'}.rw-i-caret-up:before{content:'\e800'}.rw-i-caret-left:before{content:'\e801'}.rw-i-caret-right:before{content:'\e802'}.rw-i-clock-o:before{content:'\e805'}.rw-i-calendar:before{content:'\e804'}.rw-i-search:before{content:'\e806'}.rw-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.rw-widget,.rw-widget *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.rw-widget:before,.rw-widget *:before,.rw-widget:after,.rw-widget *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.rw-widget{outline:0;-moz-background-clip:border-box;-webkit-background-clip:border-box;background-clip:border-box}.rw-btn{color:#333;line-height:2.286em;display:inline-block;margin:0;text-align:center;vertical-align:middle;background:none;background-image:none;border:1px solid transparent;padding:0;white-space:nowrap}.rw-rtl{direction:rtl}.rw-input{color:#555;height:2.286em;padding:.429em .857em;background-color:#fff}.rw-input[disabled]{-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed;opacity:1;background-color:#eee;border-color:#ccc}.rw-input[readonly]{cursor:not-allowed}.rw-filter-input{position:relative;width:100%;padding-right:1.9em;border:#ccc 1px solid;border-radius:4px;margin-bottom:2px}.rw-rtl .rw-filter-input{padding-left:1.9em;padding-right:0}.rw-filter-input>.rw-input{width:100%;border:none;outline:none}.rw-filter-input>span{margin-top:-2px}.rw-i.rw-loading{background:url("../img/loading.gif") no-repeat center;width:16px;height:100%}.rw-i.rw-loading:before{content:""}.rw-loading-mask{border-radius:4px;position:relative}.rw-loading-mask:after{content:'';background:url("../img/loader-big.gif") no-repeat center;position:absolute;background-color:#fff;opacity:.7;top:0;left:0;height:100%;width:100%}.rw-now{font-weight:600}.rw-state-focus{background-color:#fff;border:#66afe9 1px solid;color:#333}.rw-state-selected{background-color:#adadad;border:#adadad 1px solid;color:#333}.rw-state-disabled{-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed;opacity:1}.rw-btn,.rw-dropdownlist{cursor:pointer}.rw-btn[disabled],.rw-state-disabled .rw-btn,.rw-state-readonly .rw-btn{-webkit-box-shadow:none;box-shadow:none;pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);opacity:.65}ul.rw-list,.rw-selectlist{margin:0;padding-left:0;list-style:none;padding:5px 0;overflow:auto;outline:0;height:100%}ul.rw-list>li,.rw-selectlist>li{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ul.rw-list>li.rw-list-optgroup,.rw-selectlist>li.rw-list-optgroup{font-weight:bold}ul.rw-list>li.rw-list-option,ul.rw-list>li.rw-list-empty,.rw-selectlist>li.rw-list-option,.rw-selectlist>li.rw-list-empty{padding-left:10px;padding-right:10px}ul.rw-list>li.rw-list-option,.rw-selectlist>li.rw-list-option{cursor:pointer;border:1px solid transparent;border-radius:3px}ul.rw-list>li.rw-list-option:hover,.rw-selectlist>li.rw-list-option:hover{background-color:#e6e6e6;border-color:#adadad}ul.rw-list>li.rw-list-option.rw-state-focus,.rw-selectlist>li.rw-list-option.rw-state-focus{background-color:#fff;border:#66afe9 1px solid;color:#333}ul.rw-list>li.rw-list-option.rw-state-selected,.rw-selectlist>li.rw-list-option.rw-state-selected{background-color:#adadad;border:#adadad 1px solid;color:#333}ul.rw-list.rw-list-grouped>li.rw-list-optgroup,.rw-selectlist.rw-list-grouped>li.rw-list-optgroup{padding-left:10px}ul.rw-list.rw-list-grouped>li.rw-list-option,.rw-selectlist.rw-list-grouped>li.rw-list-option{padding-left:20px}.rw-widget{position:relative}.rw-open.rw-widget,.rw-open>.rw-multiselect-wrapper{border-bottom-right-radius:0;border-bottom-left-radius:0}.rw-open-up.rw-widget,.rw-open-up>.rw-multiselect-wrapper{border-top-right-radius:0;border-top-left-radius:0}.rw-combobox .rw-list,.rw-datetimepicker .rw-list,.rw-numberpicker .rw-list,.rw-dropdownlist .rw-list,.rw-multiselect .rw-list{max-height:200px;height:auto}.rw-widget{background-color:#fff;border:#ccc 1px solid;border-radius:4px}.rw-widget .rw-input{border-bottom-left-radius:4px;border-top-left-radius:4px}.rw-rtl.rw-widget .rw-input{border-bottom-left-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-top-right-radius:4px}.rw-widget>.rw-select{border-left:#ccc 1px solid}.rw-rtl.rw-widget>.rw-select{border-right:#ccc 1px solid;border-left:none}.rw-widget.rw-state-focus,.rw-widget.rw-state-focus:hover{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);border-color:#66afe9;outline:0}.rw-widget.rw-state-readonly,.rw-widget.rw-state-readonly>.rw-multiselect-wrapper{cursor:not-allowed}.rw-widget.rw-state-disabled,.rw-widget.rw-state-disabled:hover,.rw-widget.rw-state-disabled:active{-webkit-box-shadow:none;box-shadow:none;background-color:#eee;border-color:#ccc}.rw-combobox,.rw-datetimepicker,.rw-numberpicker,.rw-dropdownlist{padding-right:1.9em}.rw-combobox.rw-rtl,.rw-datetimepicker.rw-rtl,.rw-numberpicker.rw-rtl,.rw-dropdownlist.rw-rtl{padding-right:0;padding-left:1.9em}.rw-combobox>.rw-input,.rw-datetimepicker>.rw-input,.rw-numberpicker>.rw-input,.rw-dropdownlist>.rw-input{width:100%;border:none;outline:0}.rw-combobox>.rw-input::-moz-placeholder,.rw-datetimepicker>.rw-input::-moz-placeholder,.rw-numberpicker>.rw-input::-moz-placeholder,.rw-dropdownlist>.rw-input::-moz-placeholder{color:#999;opacity:1}.rw-combobox>.rw-input:-ms-input-placeholder,.rw-datetimepicker>.rw-input:-ms-input-placeholder,.rw-numberpicker>.rw-input:-ms-input-placeholder,.rw-dropdownlist>.rw-input:-ms-input-placeholder{color:#999}.rw-combobox>.rw-input::-webkit-input-placeholder,.rw-datetimepicker>.rw-input::-webkit-input-placeholder,.rw-numberpicker>.rw-input::-webkit-input-placeholder,.rw-dropdownlist>.rw-input::-webkit-input-placeholder{color:#999}.rw-placeholder{color:#999}.rw-select{position:absolute;width:1.9em;height:100%;right:0;top:0}.rw-select.rw-btn,.rw-select>.rw-btn{height:100%;vertical-align:middle;outline:0}.rw-rtl .rw-select{left:0;right:auto}.rw-multiselect,.rw-combobox input.rw-input,.rw-datetimepicker input.rw-input,.rw-numberpicker input.rw-input{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.rw-combobox:active,.rw-datetimepicker:active,.rw-dropdownlist:active,.rw-header>.rw-btn:active,.rw-numberpicker .rw-btn.rw-state-active,.rw-combobox:active.rw-state-focus,.rw-datetimepicker:active.rw-state-focus,.rw-dropdownlist:active.rw-state-focus,.rw-header>.rw-btn:active.rw-state-focus,.rw-numberpicker .rw-btn.rw-state-active.rw-state-focus{background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.rw-combobox:hover,.rw-datetimepicker:hover,.rw-numberpicker:hover,.rw-dropdownlist:hover{background-color:#e6e6e6;border-color:#adadad}.rw-dropdownlist.rw-state-disabled,.rw-dropdownlist.rw-state-readonly{cursor:not-allowed}.rw-dropdownlist>.rw-input{line-height:2.286em;background-color:transparent;padding-top:0;padding-bottom:0;padding-right:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rw-dropdownlist.rw-rtl>.rw-input{padding:.429em .857em;padding-top:0;padding-bottom:0;padding-left:0}.rw-dropdownlist>.rw-select,.rw-dropdownlist.rw-rtl>.rw-select{border-width:0}.rw-numberpicker .rw-btn{display:block;height:1.143em;line-height:1.143em;width:100%;border-width:0}.rw-popup{position:absolute;-webkit-box-shadow:0 5px 6px rgba(0,0,0,0.2);box-shadow:0 5px 6px rgba(0,0,0,0.2);border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:#ccc 1px solid;background:#fff;padding:2px;overflow:auto;margin-bottom:10px;left:10px;right:10px}.rw-dropup>.rw-popup{margin-bottom:0;margin-top:10px;border-top-right-radius:3px;border-top-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:0;-webkit-box-shadow:0 0 6px rgba(0,0,0,0.2);box-shadow:0 0 6px rgba(0,0,0,0.2)}.rw-popup-container{position:absolute;top:100%;margin-top:1px;z-index:1005;left:-11px;right:-11px}.rw-popup-container.rw-dropup{top:auto;bottom:100%}.rw-popup-container.rw-calendar-popup{right:auto;width:18em}.rw-datetimepicker .rw-btn{width:1.8em}.rw-datetimepicker.rw-has-neither{padding-left:0;padding-right:0}.rw-datetimepicker.rw-has-neither .rw-input{border-radius:4px}.rw-datetimepicker.rw-has-both{padding-right:3.8em}.rw-datetimepicker.rw-has-both.rw-rtl{padding-right:0;padding-left:3.8em}.rw-datetimepicker.rw-has-both>.rw-select{width:3.8em;height:100%}.rw-calendar{background-color:#fff}.rw-calendar thead>tr{border-bottom:2px solid #ccc}.rw-calendar .rw-header{padding-bottom:5px}.rw-calendar .rw-header .rw-btn-left,.rw-calendar .rw-header .rw-btn-right{width:12.5%}.rw-calendar .rw-header .rw-btn-view{width:75%;background-color:#eee;border-radius:4px}.rw-calendar .rw-header .rw-btn-view[disabled]{-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed}.rw-calendar .rw-footer{border-top:1px solid #ccc}.rw-calendar .rw-footer .rw-btn{width:100%;white-space:normal}.rw-calendar .rw-footer .rw-btn:hover{background-color:#e6e6e6}.rw-calendar .rw-footer .rw-btn[disabled]{-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed}.rw-calendar-grid{height:14.28571429em;table-layout:fixed;width:100%}.rw-calendar-grid th{text-align:right;padding:0 .4em 0 .1em}.rw-calendar-grid .rw-btn{width:100%;text-align:right}.rw-calendar-grid td .rw-btn{border-radius:4px;padding:0 .4em 0 .1em;outline:0}.rw-calendar-grid td .rw-btn:hover{background-color:#e6e6e6}.rw-calendar-grid td .rw-btn.rw-off-range{color:#b3b3b3}.rw-calendar-grid.rw-nav-view .rw-btn{padding:.25em 0 .3em;display:block;overflow:hidden;text-align:center;white-space:normal}.rw-selectlist{padding:2px}.rw-selectlist>ul{height:100%;overflow:auto}.rw-selectlist>ul>li.rw-list-option{position:relative;min-height:27px;cursor:auto;padding-left:5px}.rw-selectlist>ul>li.rw-list-option>label>input{position:absolute;margin:4px 0 0 -20px}.rw-selectlist>ul>li.rw-list-option>label{padding-left:20px;line-height:1.423em;display:inline-block}.rw-selectlist.rw-rtl>ul>li.rw-list-option{padding-left:0;padding-right:5px}.rw-selectlist.rw-rtl>ul>li.rw-list-option>label>input{margin:4px -20px 0 0}.rw-selectlist.rw-rtl>ul>li.rw-list-option>label{padding-left:0;padding-right:20px}.rw-selectlist.rw-rtl>ul>li.rw-list-option{padding-left:0;padding-right:5px}.rw-selectlist.rw-rtl>ul>li.rw-list-option>label>input{margin:4px -20px 0 0}.rw-selectlist.rw-rtl>ul>li.rw-list-option>label{padding-left:0;padding-right:20px}.rw-selectlist.rw-state-disabled>ul>li:hover,.rw-selectlist.rw-state-readonly>ul>li:hover{background:none;border-color:transparent}.rw-multiselect{background-color:#fff}.rw-multiselect:hover{border-color:#adadad}.rw-multiselect-wrapper{border-radius:4px;position:relative;cursor:text}.rw-multiselect-wrapper:before,.rw-multiselect-wrapper:after{content:" ";display:table}.rw-multiselect-wrapper:after{clear:both}.rw-multiselect-wrapper i.rw-loading{position:absolute;right:3px}.rw-multiselect-wrapper>.rw-input{float:left;outline:0;border-width:0;line-height:normal;width:auto;max-width:100%}.rw-multiselect-wrapper>.rw-input::-moz-placeholder{color:#999;opacity:1}.rw-multiselect-wrapper>.rw-input:-ms-input-placeholder{color:#999}.rw-multiselect-wrapper>.rw-input::-webkit-input-placeholder{color:#999}.rw-state-readonly>.rw-multiselect-wrapper,.rw-state-disabled>.rw-multiselect-wrapper{cursor:not-allowed}.rw-rtl .rw-multiselect-wrapper>.rw-input{float:right}.rw-multiselect-create-tag{border-top:1px #ccc solid;padding-top:5px;margin-top:5px}.rw-multiselect-taglist{margin:0;padding-left:0;list-style:none;padding-right:0}.rw-multiselect-taglist>li{display:inline-block;padding-left:5px;padding-right:5px}.rw-multiselect-taglist>li{float:left;display:inline-block;margin:1px;padding:.214em .15em .214em .4em;line-height:1.4em;text-align:center;vertical-align:middle;white-space:nowrap;border-radius:3px;border:1px solid #ccc;background-color:#ccc;cursor:pointer}.rw-multiselect-taglist>li.rw-state-focus{background-color:#fff;border:#66afe9 1px solid;color:#333}.rw-multiselect-taglist>li.rw-state-readonly,.rw-multiselect-taglist>li.rw-state-disabled,.rw-multiselect.rw-state-readonly .rw-multiselect-taglist>li,.rw-multiselect.rw-state-disabled .rw-multiselect-taglist>li{cursor:not-allowed;filter:alpha(opacity=65);opacity:.65}.rw-multiselect-taglist>li .rw-btn{outline:0;font-size:115%;line-height:normal}.rw-rtl .rw-multiselect-taglist>li{float:right} \ No newline at end of file diff --git a/dist/fonts/rw-widgets.eot b/dist/fonts/rw-widgets.eot deleted file mode 100644 index 78b52e1e2..000000000 Binary files a/dist/fonts/rw-widgets.eot and /dev/null differ diff --git a/dist/fonts/rw-widgets.svg b/dist/fonts/rw-widgets.svg deleted file mode 100644 index dc047a1c6..000000000 --- a/dist/fonts/rw-widgets.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - -Copyright (C) 2015 by original authors @ fontello.com - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/fonts/rw-widgets.ttf b/dist/fonts/rw-widgets.ttf deleted file mode 100644 index e6901bfe5..000000000 Binary files a/dist/fonts/rw-widgets.ttf and /dev/null differ diff --git a/dist/fonts/rw-widgets.woff b/dist/fonts/rw-widgets.woff deleted file mode 100644 index fc7902da3..000000000 Binary files a/dist/fonts/rw-widgets.woff and /dev/null differ diff --git a/dist/img/loader-big.gif b/dist/img/loader-big.gif deleted file mode 100644 index 110664548..000000000 Binary files a/dist/img/loader-big.gif and /dev/null differ diff --git a/dist/img/loading.gif b/dist/img/loading.gif deleted file mode 100644 index ded8d36d4..000000000 Binary files a/dist/img/loading.gif and /dev/null differ diff --git a/dist/react-widgets.js b/dist/react-widgets.js deleted file mode 100644 index dec85f06f..000000000 --- a/dist/react-widgets.js +++ /dev/null @@ -1,8985 +0,0 @@ -/*! (c) 2015 Jason Quense | https://github.com/jquense/react-widgets/blob/master/License.txt */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("react"), require("react-dom")); - else if(typeof define === 'function' && define.amd) - define([, ], factory); - else if(typeof exports === 'object') - exports["ReactWidgets"] = factory(require("react"), require("react-dom")); - else - root["ReactWidgets"] = factory(root["React"], root["ReactDOM"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_29__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {'use strict'; - - if (process.env.NODE_ENV !== 'production') { - [Array.prototype.some, Array.prototype.filter, Array.prototype.reduce].forEach(function (method) { - if (!method) throw new Error('One or more ES5 features is not available to ReactWidgets: http://jquense.github.io/react-widgets/docs/#/getting-started/browser'); - }); - } - - module.exports = { - - DropdownList: __webpack_require__(2), - Combobox: __webpack_require__(55), - - Calendar: __webpack_require__(59), - DateTimePicker: __webpack_require__(73), - - NumberPicker: __webpack_require__(76), - - Multiselect: __webpack_require__(79), - SelectList: __webpack_require__(83), - - configure: __webpack_require__(84), - - utils: { - ReplaceTransitionGroup: __webpack_require__(71), - SlideTransition: __webpack_require__(70) - } - }; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) - -/***/ }, -/* 1 */ -/***/ function(module, exports) { - - // shim for using process in browser - - var process = module.exports = {}; - var queue = []; - var draining = false; - var currentQueue; - var queueIndex = -1; - - function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } - } - - function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - currentQueue[queueIndex].run(); - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - clearTimeout(timeout); - } - - process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); - } - }; - - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; - } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - process.versions = {}; - - function noop() {} - - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; - - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; - - // TODO(shtylman) - process.cwd = function () { return '/' }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function() { return 0; }; - - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _domHelpersActiveElement = __webpack_require__(5); - - var _domHelpersActiveElement2 = babelHelpers.interopRequireDefault(_domHelpersActiveElement); - - var _domHelpersQueryContains = __webpack_require__(8); - - var _domHelpersQueryContains2 = babelHelpers.interopRequireDefault(_domHelpersQueryContains); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _Popup = __webpack_require__(12); - - var _Popup2 = babelHelpers.interopRequireDefault(_Popup); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _List = __webpack_require__(32); - - var _List2 = babelHelpers.interopRequireDefault(_List); - - var _ListGroupable = __webpack_require__(38); - - var _ListGroupable2 = babelHelpers.interopRequireDefault(_ListGroupable); - - var _utilValidateListInterface = __webpack_require__(40); - - var _utilValidateListInterface2 = babelHelpers.interopRequireDefault(_utilValidateListInterface); - - var _uncontrollable = __webpack_require__(41); - - var _uncontrollable2 = babelHelpers.interopRequireDefault(_uncontrollable); - - var _utilDataHelpers = __webpack_require__(34); - - var _utilInteraction = __webpack_require__(45); - - var _utilWidgetHelpers = __webpack_require__(35); - - var omit = _util_2['default'].omit; - var pick = _util_2['default'].pick; - var result = _util_2['default'].result; - - var propTypes = { - //-- controlled props ----------- - value: _react2['default'].PropTypes.any, - onChange: _react2['default'].PropTypes.func, - open: _react2['default'].PropTypes.bool, - onToggle: _react2['default'].PropTypes.func, - //------------------------------------ - - data: _react2['default'].PropTypes.array, - valueField: _react2['default'].PropTypes.string, - textField: _utilPropTypes2['default'].accessor, - - valueComponent: _utilPropTypes2['default'].elementType, - itemComponent: _utilPropTypes2['default'].elementType, - listComponent: _utilPropTypes2['default'].elementType, - - groupComponent: _utilPropTypes2['default'].elementType, - groupBy: _utilPropTypes2['default'].accessor, - - onSelect: _react2['default'].PropTypes.func, - - searchTerm: _react2['default'].PropTypes.string, - onSearch: _react2['default'].PropTypes.func, - - busy: _react2['default'].PropTypes.bool, - - delay: _react2['default'].PropTypes.number, - - dropUp: _react2['default'].PropTypes.bool, - duration: _react2['default'].PropTypes.number, //popup - - disabled: _utilPropTypes2['default'].disabled, - - readOnly: _utilPropTypes2['default'].readOnly, - - messages: _react2['default'].PropTypes.shape({ - open: _utilPropTypes2['default'].message, - emptyList: _utilPropTypes2['default'].message, - emptyFilter: _utilPropTypes2['default'].message, - filterPlaceholder: _utilPropTypes2['default'].message - }) - }; - - var DropdownList = _react2['default'].createClass(babelHelpers.createDecoratedObject([{ - key: 'displayName', - initializer: function initializer() { - return 'DropdownList'; - } - }, { - key: 'mixins', - initializer: function initializer() { - return [__webpack_require__(46), __webpack_require__(47), __webpack_require__(48), __webpack_require__(49), __webpack_require__(54), __webpack_require__(37)()]; - } - }, { - key: 'propTypes', - initializer: function initializer() { - return propTypes; - } - }, { - key: 'getDefaultProps', - value: function getDefaultProps() { - return { - delay: 500, - value: '', - open: false, - data: [], - searchTerm: '', - messages: msgs(), - ariaActiveDescendantKey: 'dropdownlist' - }; - } - }, { - key: 'getInitialState', - value: function getInitialState() { - var _props = this.props; - var open = _props.open; - var filter = _props.filter; - var value = _props.value; - var data = _props.data; - var searchTerm = _props.searchTerm; - var valueField = _props.valueField; - - var processed = filter ? this.filter(data, searchTerm) : data, - initialIdx = _utilDataHelpers.dataIndexOf(data, value, valueField); - - return { - filteredData: open && filter ? processed : null, - selectedItem: processed[initialIdx], - focusedItem: processed[initialIdx] || data[0] - }; - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this.refs.list && _utilValidateListInterface2['default'](this.refs.list); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(props) { - var open = props.open; - var filter = props.filter; - var value = props.value; - var data = props.data; - var searchTerm = props.searchTerm; - var valueField = props.valueField; - - var processed = filter ? this.filter(data, searchTerm) : data, - idx = _utilDataHelpers.dataIndexOf(data, value, valueField); - - this.setState({ - filteredData: open && filter ? processed : null, - selectedItem: processed[idx], - focusedItem: processed[! ~idx ? 0 : idx] - }); - } - }, { - key: 'render', - value: function render() { - var _cx, - _this = this; - - var _props2 = this.props; - var className = _props2.className; - var tabIndex = _props2.tabIndex; - var filter = _props2.filter; - var valueField = _props2.valueField; - var textField = _props2.textField; - var groupBy = _props2.groupBy; - var messages = _props2.messages; - var data = _props2.data; - var busy = _props2.busy; - var dropUp = _props2.dropUp; - var placeholder = _props2.placeholder; - var value = _props2.value; - var open = _props2.open; - var disabled = _props2.disabled; - var readOnly = _props2.readOnly; - var ValueComponent = _props2.valueComponent; - var List = _props2.listComponent; - - List = List || groupBy && _ListGroupable2['default'] || _List2['default']; - - var elementProps = omit(this.props, Object.keys(propTypes)); - var listProps = pick(this.props, Object.keys(_utilCompat2['default'].type(List).propTypes)); - var popupProps = pick(this.props, Object.keys(_utilCompat2['default'].type(_Popup2['default']).propTypes)); - - var _state = this.state; - var focusedItem = _state.focusedItem; - var selectedItem = _state.selectedItem; - var focused = _state.focused; - - var items = this._data(), - valueItem = _utilDataHelpers.dataItem(data, value, valueField), - // take value from the raw data - listID = _utilWidgetHelpers.instanceId(this, '__listbox'); - - var shouldRenderList = _utilWidgetHelpers.isFirstFocusedRender(this) || open; - - messages = msgs(messages); - - return _react2['default'].createElement( - 'div', - babelHelpers._extends({}, elementProps, { - ref: 'input', - role: 'combobox', - tabIndex: tabIndex || '0', - 'aria-expanded': open, - 'aria-haspopup': true, - 'aria-owns': listID, - 'aria-busy': !!busy, - 'aria-live': !open && 'polite', - //aria-activedescendant={activeID} - 'aria-autocomplete': 'list', - 'aria-disabled': disabled, - 'aria-readonly': readOnly, - onKeyDown: this._keyDown, - onClick: this._click, - onFocus: this._focus.bind(null, true), - onBlur: this._focus.bind(null, false), - className: _classnames2['default'](className, 'rw-dropdownlist', 'rw-widget', (_cx = { - 'rw-state-disabled': disabled, - 'rw-state-readonly': readOnly, - 'rw-state-focus': focused, - 'rw-rtl': this.isRtl() - - }, _cx['rw-open' + (dropUp ? '-up' : '')] = open, _cx)) }), - _react2['default'].createElement( - 'span', - { className: 'rw-dropdownlist-picker rw-select rw-btn' }, - _react2['default'].createElement( - 'i', - { className: 'rw-i rw-i-caret-down' + (busy ? ' rw-loading' : '') }, - _react2['default'].createElement( - 'span', - { className: 'rw-sr' }, - result(messages.open, this.props) - ) - ) - ), - _react2['default'].createElement( - 'div', - { - className: 'rw-input' - }, - !valueItem && placeholder ? _react2['default'].createElement( - 'span', - { className: 'rw-placeholder' }, - placeholder - ) : this.props.valueComponent ? _react2['default'].createElement(ValueComponent, { item: valueItem }) : _utilDataHelpers.dataText(valueItem, textField) - ), - _react2['default'].createElement( - _Popup2['default'], - babelHelpers._extends({}, popupProps, { - onOpen: function () { - return _this.focus(); - }, - onOpening: function () { - return _this.refs.list.forceUpdate(); - }, - onRequestClose: this.close - }), - _react2['default'].createElement( - 'div', - null, - filter && this._renderFilter(messages), - shouldRenderList && _react2['default'].createElement(List, babelHelpers._extends({ ref: 'list' - }, listProps, { - data: items, - id: listID, - 'aria-live': open && 'polite', - 'aria-labelledby': _utilWidgetHelpers.instanceId(this), - 'aria-hidden': !this.props.open, - selected: selectedItem, - focused: open ? focusedItem : null, - onSelect: this._onSelect, - onMove: this._scrollTo, - messages: { - emptyList: data.length ? messages.emptyFilter : messages.emptyList - } })) - ) - ) - ); - } - }, { - key: '_renderFilter', - value: function _renderFilter(messages) { - var _this2 = this; - - return _react2['default'].createElement( - 'div', - { ref: 'filterWrapper', className: 'rw-filter-input' }, - _react2['default'].createElement( - 'span', - { className: 'rw-select rw-btn' }, - _react2['default'].createElement('i', { className: 'rw-i rw-i-search' }) - ), - _react2['default'].createElement('input', { ref: 'filter', className: 'rw-input', - placeholder: _util_2['default'].result(messages.filterPlaceholder, this.props), - value: this.props.searchTerm, - onChange: function (e) { - return _utilWidgetHelpers.notify(_this2.props.onSearch, e.target.value); - } }) - ); - } - }, { - key: '_focus', - decorators: [_utilInteraction.widgetEnabled], - value: function _focus(focused, e) { - var _this3 = this; - - this.setTimeout('focus', function () { - if (!focused) _this3.close(); - - if (focused !== _this3.state.focused) { - _utilWidgetHelpers.notify(_this3.props[focused ? 'onFocus' : 'onBlur'], e); - _this3.setState({ focused: focused }); - } - }); - } - }, { - key: '_onSelect', - decorators: [_utilInteraction.widgetEditable], - value: function _onSelect(data) { - this.close(); - _utilWidgetHelpers.notify(this.props.onSelect, data); - this.change(data); - this.focus(this); - } - }, { - key: '_click', - decorators: [_utilInteraction.widgetEditable], - value: function _click(e) { - var wrapper = this.refs.filterWrapper; - - if (!this.props.filter || !this.props.open) this.toggle();else if (!_domHelpersQueryContains2['default'](_utilCompat2['default'].findDOMNode(wrapper), e.target)) this.close(); - - _utilWidgetHelpers.notify(this.props.onClick, e); - } - }, { - key: '_keyDown', - decorators: [_utilInteraction.widgetEditable], - value: function _keyDown(e) { - var _this4 = this; - - var self = this, - key = e.key, - alt = e.altKey, - list = this.refs.list, - filtering = this.props.filter, - focusedItem = this.state.focusedItem, - selectedItem = this.state.selectedItem, - isOpen = this.props.open, - closeWithFocus = function closeWithFocus() { - _this4.close(), _utilCompat2['default'].findDOMNode(_this4).focus(); - }; - - if (key === 'End') { - if (isOpen) this.setState({ focusedItem: list.last() });else change(list.last()); - e.preventDefault(); - } else if (key === 'Home') { - if (isOpen) this.setState({ focusedItem: list.first() });else change(list.first()); - e.preventDefault(); - } else if (key === 'Escape' && isOpen) { - closeWithFocus(); - } else if ((key === 'Enter' || key === ' ' && !filtering) && isOpen) { - change(this.state.focusedItem, true); - } else if (key === 'ArrowDown') { - if (alt) this.open();else if (isOpen) this.setState({ focusedItem: list.next(focusedItem) });else change(list.next(selectedItem)); - e.preventDefault(); - } else if (key === 'ArrowUp') { - if (alt) closeWithFocus();else if (isOpen) this.setState({ focusedItem: list.prev(focusedItem) });else change(list.prev(selectedItem)); - e.preventDefault(); - } else if (!(this.props.filter && isOpen)) this.search(String.fromCharCode(e.keyCode), function (item) { - isOpen ? _this4.setState({ focusedItem: item }) : change(item); - }); - - _utilWidgetHelpers.notify(this.props.onKeyDown, [e]); - - function change(item, fromList) { - if (!item) return; - fromList ? self._onSelect(item) : self.change(item); - } - } - }, { - key: 'change', - value: function change(data) { - if (!_util_2['default'].isShallowEqual(data, this.props.value)) { - _utilWidgetHelpers.notify(this.props.onChange, data); - _utilWidgetHelpers.notify(this.props.onSearch, ''); - this.close(); - } - } - }, { - key: 'focus', - value: function focus(target) { - var inst = target || (this.props.filter && this.props.open ? this.refs.filter : this.refs.input); - - if (_domHelpersActiveElement2['default']() !== _utilCompat2['default'].findDOMNode(inst)) _utilCompat2['default'].findDOMNode(inst).focus(); - } - }, { - key: '_data', - value: function _data() { - return this.state.filteredData || this.props.data.concat(); - } - }, { - key: 'search', - value: function search(character, cb) { - var _this5 = this; - - var word = ((this._searchTerm || '') + character).toLowerCase(); - - this._searchTerm = word; - - this.setTimeout('search', function () { - var list = _this5.refs.list, - key = _this5.props.open ? 'focusedItem' : 'selectedItem', - item = list.next(_this5.state[key], word); - - _this5._searchTerm = ''; - if (item) cb(item); - }, this.props.delay); - } - }, { - key: 'open', - value: function open() { - _utilWidgetHelpers.notify(this.props.onToggle, true); - } - }, { - key: 'close', - value: function close() { - _utilWidgetHelpers.notify(this.props.onToggle, false); - } - }, { - key: 'toggle', - value: function toggle() { - this.props.open ? this.close() : this.open(); - } - }])); - - function msgs(msgs) { - return babelHelpers._extends({ - open: 'open dropdown', - filterPlaceholder: '', - emptyList: 'There are no items in this list', - emptyFilter: 'The filter returned no results' - }, msgs); - } - - exports['default'] = _uncontrollable2['default'](DropdownList, { open: 'onToggle', value: 'onChange', searchTerm: 'onSearch' }); - module.exports = exports['default']; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === "object") { - factory(exports); - } else { - factory(root.babelHelpers = {}); - } - })(this, function (global) { - var babelHelpers = global; - - babelHelpers.createDecoratedObject = function (descriptors) { - var target = {}; - - for (var i = 0; i < descriptors.length; i++) { - var descriptor = descriptors[i]; - var decorators = descriptor.decorators; - var key = descriptor.key; - delete descriptor.key; - delete descriptor.decorators; - descriptor.enumerable = true; - descriptor.configurable = true; - if ("value" in descriptor || descriptor.initializer) descriptor.writable = true; - - if (decorators) { - for (var f = 0; f < decorators.length; f++) { - var decorator = decorators[f]; - - if (typeof decorator === "function") { - descriptor = decorator(target, key, descriptor) || descriptor; - } else { - throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator); - } - } - } - - if (descriptor.initializer) { - descriptor.value = descriptor.initializer.call(target); - } - - Object.defineProperty(target, key, descriptor); - } - - return target; - }; - - babelHelpers.objectWithoutProperties = function (obj, keys) { - var target = {}; - - for (var i in obj) { - if (keys.indexOf(i) >= 0) continue; - if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; - target[i] = obj[i]; - } - - return target; - }; - - babelHelpers.interopRequireWildcard = function (obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; - } - } - - newObj["default"] = obj; - return newObj; - } - }; - - babelHelpers.interopRequireDefault = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; - }; - - babelHelpers._extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - babelHelpers.classCallCheck = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - }; - }) - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - module.exports = __WEBPACK_EXTERNAL_MODULE_4__; - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(6); - - exports.__esModule = true; - - /** - * document.activeElement - */ - exports['default'] = activeElement; - - var _ownerDocument = __webpack_require__(7); - - var _ownerDocument2 = babelHelpers.interopRequireDefault(_ownerDocument); - - function activeElement() { - var doc = arguments[0] === undefined ? document : arguments[0]; - - try { - return doc.activeElement; - } catch (e) {} - } - - module.exports = exports['default']; - -/***/ }, -/* 6 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === "object") { - factory(exports); - } else { - factory(root.babelHelpers = {}); - } - })(this, function (global) { - var babelHelpers = global; - - babelHelpers.interopRequireDefault = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; - }; - - babelHelpers._extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - }) - -/***/ }, -/* 7 */ -/***/ function(module, exports) { - - "use strict"; - - exports.__esModule = true; - exports["default"] = ownerDocument; - - function ownerDocument(node) { - return node && node.ownerDocument || document; - } - - module.exports = exports["default"]; - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var canUseDOM = __webpack_require__(9); - - var contains = (function () { - var root = canUseDOM && document.documentElement; - - return root && root.contains ? function (context, node) { - return context.contains(node); - } : root && root.compareDocumentPosition ? function (context, node) { - return context === node || !!(context.compareDocumentPosition(node) & 16); - } : function (context, node) { - if (node) do { - if (node === context) return true; - } while (node = node.parentNode); - - return false; - }; - })(); - - module.exports = contains; - -/***/ }, -/* 9 */ -/***/ function(module, exports) { - - 'use strict'; - module.exports = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { - - var __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2015 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames - */ - - (function () { - 'use strict'; - - function classNames () { - - var classes = ''; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - - var argType = typeof arg; - - if ('string' === argType || 'number' === argType) { - classes += ' ' + arg; - - } else if (Array.isArray(arg)) { - classes += ' ' + classNames.apply(null, arg); - - } else if ('object' === argType) { - for (var key in arg) { - if (arg.hasOwnProperty(key) && arg[key]) { - classes += ' ' + key; - } - } - } - } - - return classes.substr(1); - } - - if (typeof module !== 'undefined' && module.exports) { - module.exports = classNames; - } else if (true){ - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { - return classNames; - }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - window.classNames = classNames; - } - - }()); - - -/***/ }, -/* 11 */ -/***/ function(module, exports) { - - 'use strict'; - var idCount = 0; - - var _ = module.exports = { - - has: has, - - result: function result(value) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - return typeof value === 'function' ? value.apply(undefined, args) : value; - }, - - isShallowEqual: function isShallowEqual(a, b) { - if (a === b) return true; - if (a instanceof Date && b instanceof Date) return a.getTime() === b.getTime(); - - if (typeof a !== 'object' && typeof b !== 'object') return a === b; - - if (typeof a !== typeof b) return false; - - return shallowEqual(a, b); - }, - - transform: function transform(obj, cb, seed) { - _.each(obj, cb.bind(null, seed = seed || (Array.isArray(obj) ? [] : {}))); - return seed; - }, - - each: function each(obj, cb, thisArg) { - if (Array.isArray(obj)) return obj.forEach(cb, thisArg); - - for (var key in obj) if (has(obj, key)) cb.call(thisArg, obj[key], key, obj); - }, - - pick: function pick(obj, keys) { - keys = [].concat(keys); - return _.transform(obj, function (mapped, val, key) { - if (keys.indexOf(key) !== -1) mapped[key] = val; - }, {}); - }, - - omit: function omit(obj, keys) { - keys = [].concat(keys); - return _.transform(obj, function (mapped, val, key) { - if (keys.indexOf(key) === -1) mapped[key] = val; - }, {}); - }, - - find: function find(arr, cb, thisArg) { - var result; - if (Array.isArray(arr)) { - arr.every(function (val, idx) { - if (cb.call(thisArg, val, idx, arr)) return (result = val, false); - return true; - }); - return result; - } else for (var key in arr) if (has(arr, key)) if (cb.call(thisArg, arr[key], key, arr)) return arr[key]; - }, - - chunk: function chunk(array, chunkSize) { - var index = 0, - length = array ? array.length : 0, - result = []; - - chunkSize = Math.max(+chunkSize || 1, 1); - - while (index < length) result.push(array.slice(index, index += chunkSize)); - - return result; - }, - - splat: function splat(obj) { - return obj == null ? [] : [].concat(obj); - }, - - noop: function noop() {}, - - uniqueId: function uniqueId(prefix) { - return '' + ((prefix == null ? '' : prefix) + ++idCount); - } - - }; - - function has(o, k) { - return o ? Object.prototype.hasOwnProperty.call(o, k) : false; - } - - function eql(a, b) { - return a === b; - } - - /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - */ - function shallowEqual(objA, objB) { - - if (objA == null || objB == null) return false; - - var keysA = Object.keys(objA), - keysB = Object.keys(objB); - - if (keysA.length !== keysB.length) return false; - - for (var i = 0; i < keysA.length; i++) if (!has(objB, keysA[i]) || !eql(objA[keysA[i]], objB[keysA[i]])) return false; - - return true; - } - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var React = __webpack_require__(4), - css = __webpack_require__(13), - getHeight = __webpack_require__(20), - config = __webpack_require__(23), - cn = __webpack_require__(10), - compat = __webpack_require__(28); - - var transform = config.animate.transform; - - function properties(prop, value) { - var _ref, _ref2; - - var TRANSLATION_MAP = config.animate.TRANSLATION_MAP; - - if (TRANSLATION_MAP && TRANSLATION_MAP[prop]) return (_ref = {}, _ref[transform] = TRANSLATION_MAP[prop] + '(' + value + ')', _ref); - - return (_ref2 = {}, _ref2[prop] = value, _ref2); - } - - var PopupContent = React.createClass({ - displayName: 'PopupContent', - - render: function render() { - var child = this.props.children; - - if (!child) return React.createElement('span', { className: 'rw-popup rw-widget' }); - - child = React.Children.only(this.props.children); - - return compat.cloneElement(child, { - className: cn(child.props.className, 'rw-popup rw-widget') - }); - } - }); - - module.exports = React.createClass({ - - displayName: 'Popup', - - propTypes: { - open: React.PropTypes.bool, - dropUp: React.PropTypes.bool, - duration: React.PropTypes.number, - - onRequestClose: React.PropTypes.func.isRequired, - onClosing: React.PropTypes.func, - onOpening: React.PropTypes.func, - onClose: React.PropTypes.func, - onOpen: React.PropTypes.func - }, - - getInitialState: function getInitialState() { - return {}; - }, - - getDefaultProps: function getDefaultProps() { - return { - duration: 200, - open: false, - onClosing: function onClosing() {}, - onOpening: function onOpening() {}, - onClose: function onClose() {}, - onOpen: function onOpen() {} - }; - }, - - // componentDidMount(){ - // !this.props.open && this.close(0) - // }, - componentWillMount: function componentWillMount() { - !this.props.open && (this._initialPosition = true); - }, - - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - this.setState({ - contentChanged: childKey(nextProps.children) !== childKey(this.props.children) - }); - }, - - componentDidUpdate: function componentDidUpdate(pvProps) { - var closing = pvProps.open && !this.props.open, - opening = !pvProps.open && this.props.open, - open = this.props.open; - - if (opening) this.open();else if (closing) this.close();else if (open) this.height(); - }, - - render: function render() { - var _props = this.props; - var className = _props.className; - var open = _props.open; - var dropUp = _props.dropUp; - var props = babelHelpers.objectWithoutProperties(_props, ['className', 'open', 'dropUp']); - var display = open ? 'block' : void 0; - - if (this._initialPosition) { - display = 'none'; - } - - return React.createElement( - 'div', - babelHelpers._extends({}, props, { - style: babelHelpers._extends({ - display: display, - height: this.state.height - }, props.style), - className: cn(className, 'rw-popup-container', { 'rw-dropup': dropUp }) - }), - React.createElement( - PopupContent, - { ref: 'content' }, - this.props.children - ) - ); - }, - - reset: function reset() { - var container = compat.findDOMNode(this), - content = compat.findDOMNode(this.refs.content), - style = { display: 'block', overflow: 'hidden' }; - - css(container, style); - this.height(); - css(content, properties('top', this.props.dropUp ? '100%' : '-100%')); - }, - - height: function height() { - var el = compat.findDOMNode(this), - content = compat.findDOMNode(this.refs.content), - margin = parseInt(css(content, 'margin-top'), 10) + parseInt(css(content, 'margin-bottom'), 10); - - var height = getHeight(content) + (isNaN(margin) ? 0 : margin); - - if (this.state.height !== height) { - el.style.height = height + 'px'; - this.setState({ height: height }); - } - }, - - open: function open() { - var self = this, - anim = compat.findDOMNode(this), - el = compat.findDOMNode(this.refs.content); - - this.ORGINAL_POSITION = css(el, 'position'); - this._isOpening = true; - - if (this._initialPosition) { - this._initialPosition = false; - this.reset(); - } else this.height(); - - this.props.onOpening(); - - anim.className += ' rw-popup-animating'; - el.style.position = 'absolute'; - - config.animate(el, { top: 0 }, self.props.duration, 'ease', function () { - if (!self._isOpening) return; - - anim.className = anim.className.replace(/ ?rw-popup-animating/g, ''); - - el.style.position = self.ORGINAL_POSITION; - anim.style.overflow = 'visible'; - self.ORGINAL_POSITION = null; - - self.props.onOpen(); - }); - }, - - close: function close(dur) { - var self = this, - el = compat.findDOMNode(this.refs.content), - anim = compat.findDOMNode(this); - - this.ORGINAL_POSITION = css(el, 'position'); - - this._isOpening = false; - this.height(); - this.props.onClosing(); - - anim.style.overflow = 'hidden'; - anim.className += ' rw-popup-animating'; - el.style.position = 'absolute'; - - config.animate(el, { top: this.props.dropUp ? '100%' : '-100%' }, dur === undefined ? this.props.duration : dur, 'ease', function () { - if (self._isOpening) return; - - el.style.position = self.ORGINAL_POSITION; - anim.className = anim.className.replace(/ ?rw-popup-animating/g, ''); - - anim.style.display = 'none'; - self.ORGINAL_POSITION = null; - self.props.onClose(); - }); - } - - }); - - function childKey(children) { - var nextChildMapping = React.Children.map(children, function (c) { - return c; - }); - for (var key in nextChildMapping) return key; - } - -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var camelize = __webpack_require__(14), - hyphenate = __webpack_require__(16), - _getComputedStyle = __webpack_require__(18), - removeStyle = __webpack_require__(19); - - var has = Object.prototype.hasOwnProperty; - - module.exports = function style(node, property, value) { - var css = '', - props = property; - - if (typeof property === 'string') { - - if (value === undefined) return node.style[camelize(property)] || _getComputedStyle(node).getPropertyValue(hyphenate(property));else (props = {})[property] = value; - } - - for (var key in props) if (has.call(props, key)) { - !props[key] && props[key] !== 0 ? removeStyle(node, hyphenate(key)) : css += hyphenate(key) + ':' + props[key] + ';'; - } - - node.style.cssText += ';' + css; - }; - -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2014-2015, Facebook, Inc. - * All rights reserved. - * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js - */ - - 'use strict'; - var camelize = __webpack_require__(15); - var msPattern = /^-ms-/; - - module.exports = function camelizeStyleName(string) { - return camelize(string.replace(msPattern, 'ms-')); - }; - -/***/ }, -/* 15 */ -/***/ function(module, exports) { - - "use strict"; - - var rHyphen = /-(.)/g; - - module.exports = function camelize(string) { - return string.replace(rHyphen, function (_, chr) { - return chr.toUpperCase(); - }); - }; - -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js - */ - - "use strict"; - - var hyphenate = __webpack_require__(17); - var msPattern = /^ms-/; - - module.exports = function hyphenateStyleName(string) { - return hyphenate(string).replace(msPattern, "-ms-"); - }; - -/***/ }, -/* 17 */ -/***/ function(module, exports) { - - 'use strict'; - - var rUpper = /([A-Z])/g; - - module.exports = function hyphenate(string) { - return string.replace(rUpper, '-$1').toLowerCase(); - }; - -/***/ }, -/* 18 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(6); - - var _utilCamelizeStyle = __webpack_require__(14); - - var _utilCamelizeStyle2 = babelHelpers.interopRequireDefault(_utilCamelizeStyle); - - var rposition = /^(top|right|bottom|left)$/; - var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i; - - module.exports = function _getComputedStyle(node) { - if (!node) throw new TypeError('No Element passed to `getComputedStyle()`'); - var doc = node.ownerDocument; - - return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : { //ie 8 "magic" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72 - getPropertyValue: function getPropertyValue(prop) { - var style = node.style; - - prop = (0, _utilCamelizeStyle2['default'])(prop); - - if (prop == 'float') prop = 'styleFloat'; - - var current = node.currentStyle[prop] || null; - - if (current == null && style && style[prop]) current = style[prop]; - - if (rnumnonpx.test(current) && !rposition.test(prop)) { - // Remember the original values - var left = style.left; - var runStyle = node.runtimeStyle; - var rsLeft = runStyle && runStyle.left; - - // Put in the new values to get a computed value out - if (rsLeft) runStyle.left = node.currentStyle.left; - - style.left = prop === 'fontSize' ? '1em' : current; - current = style.pixelLeft + 'px'; - - // Revert the changed values - style.left = left; - if (rsLeft) runStyle.left = rsLeft; - } - - return current; - } - }; - }; - -/***/ }, -/* 19 */ -/***/ function(module, exports) { - - 'use strict'; - - module.exports = function removeStyle(node, key) { - return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key); - }; - -/***/ }, -/* 20 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var offset = __webpack_require__(21), - getWindow = __webpack_require__(22); - - module.exports = function height(node, client) { - var win = getWindow(node); - return win ? win.innerHeight : client ? node.clientHeight : offset(node).height; - }; - -/***/ }, -/* 21 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var contains = __webpack_require__(8), - getWindow = __webpack_require__(22), - ownerDocument = __webpack_require__(7); - - module.exports = function offset(node) { - var doc = ownerDocument(node), - win = getWindow(doc), - docElem = doc && doc.documentElement, - box = { top: 0, left: 0, height: 0, width: 0 }; - - if (!doc) return; - - // Make sure it's not a disconnected DOM node - if (!contains(docElem, node)) return box; - - if (node.getBoundingClientRect !== undefined) box = node.getBoundingClientRect(); - - if (box.width || box.height) { - - box = { - top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), - left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0), - width: (box.width == null ? node.offsetWidth : box.width) || 0, - height: (box.height == null ? node.offsetHeight : box.height) || 0 - }; - } - - return box; - }; - -/***/ }, -/* 22 */ -/***/ function(module, exports) { - - 'use strict'; - - module.exports = function getWindow(node) { - return node === node.window ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false; - }; - -/***/ }, -/* 23 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _domAnimate = __webpack_require__(24); - - var _domAnimate2 = babelHelpers.interopRequireDefault(_domAnimate); - - function error() { - throw new Error('[React Widgets] You are attempting to use a widget that requires localization (DateTimePicker, NumberPicker)' + 'but there is no localizer set. IN order to use these widgets please install a localizer'); - } - - var dummy = { - parse: error, - format: error, - firstOfWeek: error - }; - - exports['default'] = { - - animate: _domAnimate2['default'], - - locale: { - date: dummy, - number: dummy - } - }; - module.exports = exports['default']; - -/***/ }, -/* 24 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var hyphenate = __webpack_require__(17), - css = __webpack_require__(13), - on = __webpack_require__(25), - off = __webpack_require__(26), - transitionProps = __webpack_require__(27); - - var has = Object.prototype.hasOwnProperty, - reset = {}, - TRANSLATION_MAP = { - left: 'translateX', - right: 'translateX', - top: 'translateY', - bottom: 'translateY' - }; - - reset[transitionProps.property] = reset[transitionProps.duration] = reset[transitionProps.delay] = reset[transitionProps.timing] = ''; - - animate.endEvent = transitionProps.end; - animate.transform = transitionProps.transform; - animate.TRANSLATION_MAP = TRANSLATION_MAP; - - module.exports = animate; - - // super lean animate function for transitions - // doesn't support all translations to keep it matching the jquery API - /** - * code in part from: Zepto 1.1.4 | zeptojs.com/license - */ - function animate(node, properties, duration, easing, callback) { - var cssProperties = [], - fakeEvent = { target: node, currentTarget: node }, - cssValues = {}, - transforms = '', - fired; - - if (typeof easing === 'function') callback = easing, easing = null; - - if (!transitionProps.end) duration = 0; - if (duration === undefined) duration = 200; - - for (var key in properties) if (has.call(properties, key)) { - if (/(top|bottom)/.test(key)) transforms += TRANSLATION_MAP[key] + '(' + properties[key] + ') ';else { - cssValues[key] = properties[key]; - cssProperties.push(hyphenate(key)); - } - } - - if (transforms) { - cssValues[transitionProps.transform] = transforms; - cssProperties.push(transitionProps.transform); - } - - if (duration > 0) { - cssValues[transitionProps.property] = cssProperties.join(', '); - cssValues[transitionProps.duration] = duration / 1000 + 's'; - cssValues[transitionProps.delay] = 0 + 's'; - cssValues[transitionProps.timing] = easing || 'linear'; - - on(node, transitionProps.end, done); - - setTimeout(function () { - if (!fired) done(fakeEvent); - }, duration + 500); - } - - node.clientLeft; // trigger page reflow - css(node, cssValues); - - if (duration <= 0) setTimeout(done.bind(null, fakeEvent), 0); - - function done(event) { - if (event.target !== event.currentTarget) return; - - fired = true; - off(event.target, transitionProps.end, done); - css(node, reset); - callback && callback.call(this); - } - } - -/***/ }, -/* 25 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var canUseDOM = __webpack_require__(9); - var on = function on() {}; - - if (canUseDOM) { - on = (function () { - - if (document.addEventListener) return function (node, eventName, handler, capture) { - return node.addEventListener(eventName, handler, capture || false); - };else if (document.attachEvent) return function (node, eventName, handler) { - return node.attachEvent('on' + eventName, handler); - }; - })(); - } - - module.exports = on; - -/***/ }, -/* 26 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var canUseDOM = __webpack_require__(9); - var off = function off() {}; - - if (canUseDOM) { - - off = (function () { - - if (document.addEventListener) return function (node, eventName, handler, capture) { - return node.removeEventListener(eventName, handler, capture || false); - };else if (document.attachEvent) return function (node, eventName, handler) { - return node.detachEvent('on' + eventName, handler); - }; - })(); - } - - module.exports = off; - -/***/ }, -/* 27 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var canUseDOM = __webpack_require__(9); - - var has = Object.prototype.hasOwnProperty, - transform = 'transform', - transition = {}, - transitionTiming, - transitionDuration, - transitionProperty, - transitionDelay; - - if (canUseDOM) { - transition = getTransitionProperties(); - - transform = transition.prefix + transform; - - transitionProperty = transition.prefix + 'transition-property'; - transitionDuration = transition.prefix + 'transition-duration'; - transitionDelay = transition.prefix + 'transition-delay'; - transitionTiming = transition.prefix + 'transition-timing-function'; - } - - module.exports = { - transform: transform, - end: transition.end, - property: transitionProperty, - timing: transitionTiming, - delay: transitionDelay, - duration: transitionDuration - }; - - function getTransitionProperties() { - var endEvent, - prefix = '', - transitions = { - O: 'otransitionend', - Moz: 'transitionend', - Webkit: 'webkitTransitionEnd', - ms: 'MSTransitionEnd' - }; - - var element = document.createElement('div'); - - for (var vendor in transitions) if (has.call(transitions, vendor)) { - if (element.style[vendor + 'TransitionProperty'] !== undefined) { - prefix = '-' + vendor.toLowerCase() + '-'; - endEvent = transitions[vendor]; - break; - } - } - - if (!endEvent && element.style.transitionProperty !== undefined) endEvent = 'transitionend'; - - return { end: endEvent, prefix: prefix }; - } - -/***/ }, -/* 28 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _reactDom = __webpack_require__(29); - - var _reactDom2 = babelHelpers.interopRequireDefault(_reactDom); - - var _2 = __webpack_require__(11); - - var _3 = babelHelpers.interopRequireDefault(_2); - - var _version = _react2['default'].version.split('.').map(parseFloat); - - module.exports = { - - version: function version() { - return _version; - }, - - type: function type(component) { - if (_version[0] === 0 && _version[1] >= 13) return component; - - return component.type; - }, - - findDOMNode: function findDOMNode(component) { - return _reactDom2['default'].findDOMNode(component); - }, - - cloneElement: function cloneElement(child, props) { - if (_react2['default'].cloneElement) return _react2['default'].cloneElement(child, props); - - //just mutate if pre 0.13 - _3['default'].each(props, function (value, prop) { - return child.props[prop] = value; - }); - - return child; - } - }; - -/***/ }, -/* 29 */ -/***/ function(module, exports) { - - module.exports = __WEBPACK_EXTERNAL_MODULE_29__; - -/***/ }, -/* 30 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _configuration = __webpack_require__(23); - - var _configuration2 = babelHelpers.interopRequireDefault(_configuration); - - var _filter = __webpack_require__(31); - - var _filter2 = babelHelpers.interopRequireDefault(_filter); - - var localizers = _configuration2['default'].locale; - var filterTypes = Object.keys(_filter2['default']).filter(function (i) { - return i !== 'filter'; - }); - - function getInteractionPropType(key) { - var types = [_react.PropTypes.bool, _react.PropTypes.oneOf([key])], - propType = _react.PropTypes.oneOfType(types); - - propType.acceptsArray = _react.PropTypes.oneOfType(types.concat(_react.PropTypes.array)); - - return propType; - } - - module.exports = { - - elementType: createChainableTypeChecker(function (props, propName, componentName) { - - if (typeof props[propName] !== 'function') { - if (_react2['default'].isValidElement(props[propName])) return new Error('Invalid prop `' + propName + '` specified in `' + componentName + '`.' + ' Expected an Element `type`, not an actual Element'); - - if (typeof props[propName] !== 'string') return new Error('Invalid prop `' + propName + '` specified in `' + componentName + '`.' + ' Expected an Element `type` such as a tag name or return value of React.createClass(...)'); - } - return null; - }), - - numberFormat: createChainableTypeChecker(function () { - var _localizers$number; - - return (_localizers$number = localizers.number).propType.apply(_localizers$number, arguments); - }), - - dateFormat: createChainableTypeChecker(function () { - var _localizers$date; - - return (_localizers$date = localizers.date).propType.apply(_localizers$date, arguments); - }), - - disabled: getInteractionPropType('disabled'), - readOnly: getInteractionPropType('readOnly'), - - accessor: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.string, _react2['default'].PropTypes.func]), - - message: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.func, _react2['default'].PropTypes.string]), - - filter: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.func, _react2['default'].PropTypes.bool, _react2['default'].PropTypes.oneOf(filterTypes)]) - }; - - function createChainableTypeChecker(validate) { - - function checkType(isRequired, props, propName, componentName, location) { - componentName = componentName || '<>'; - if (props[propName] == null) { - if (isRequired) { - return new Error('Required prop `' + propName + '` was not specified in `' + componentName + '`.'); - } - } else return validate(props, propName, componentName, location); - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; - } - -/***/ }, -/* 31 */ -/***/ function(module, exports) { - - 'use strict'; - var common = { - eq: function eq(a, b) { - return a === b; - }, - neq: function neq(a, b) { - return a !== b; - }, - gt: function gt(a, b) { - return a > b; - }, - gte: function gte(a, b) { - return a >= b; - }, - lt: function lt(a, b) { - return a < b; - }, - lte: function lte(a, b) { - return a <= b; - }, - - contains: function contains(a, b) { - return a.indexOf(b) !== -1; - }, - - startsWith: function startsWith(a, b) { - return a.lastIndexOf(b, 0) === 0; - }, - - endsWith: function endsWith(a, b) { - var pos = a.length - b.length, - lastIndex = a.indexOf(b, pos); - - return lastIndex !== -1 && lastIndex === pos; - } - }; - - module.exports = common; - -/***/ }, -/* 32 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _ListOption = __webpack_require__(33); - - var _ListOption2 = babelHelpers.interopRequireDefault(_ListOption); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _utilDataHelpers = __webpack_require__(34); - - var _utilWidgetHelpers = __webpack_require__(35); - - var optionId = function optionId(id, idx) { - return id + '__option__' + idx; - }; - - exports['default'] = _react2['default'].createClass({ - - displayName: 'List', - - mixins: [__webpack_require__(36), __webpack_require__(37)()], - - propTypes: { - data: _react2['default'].PropTypes.array, - onSelect: _react2['default'].PropTypes.func, - onMove: _react2['default'].PropTypes.func, - - optionComponent: _utilPropTypes2['default'].elementType, - itemComponent: _utilPropTypes2['default'].elementType, - - selectedIndex: _react2['default'].PropTypes.number, - focusedIndex: _react2['default'].PropTypes.number, - valueField: _react2['default'].PropTypes.string, - textField: _utilPropTypes2['default'].accessor, - - optionID: _react2['default'].PropTypes.func, - - messages: _react2['default'].PropTypes.shape({ - emptyList: _utilPropTypes2['default'].message - }) - }, - - getDefaultProps: function getDefaultProps() { - return { - optID: '', - onSelect: function onSelect() {}, - optionComponent: _ListOption2['default'], - ariaActiveDescendantKey: 'list', - data: [], - messages: { - emptyList: 'There are no items in this list' - } - }; - }, - - componentDidMount: function componentDidMount() { - this.move(); - }, - - componentDidUpdate: function componentDidUpdate() { - var _props = this.props; - var data = _props.data; - var focused = _props.focused; - var idx = data.indexOf(focused); - var activeId = optionId(_utilWidgetHelpers.instanceId(this), idx); - - this.ariaActiveDescendant(idx !== -1 ? activeId : null); - - this.move(); - }, - - render: function render() { - var _props2 = this.props; - var className = _props2.className; - var role = _props2.role; - var data = _props2.data; - var textField = _props2.textField; - var valueField = _props2.valueField; - var focused = _props2.focused; - var selected = _props2.selected; - var messages = _props2.messages; - var onSelect = _props2.onSelect; - var ItemComponent = _props2.itemComponent; - var Option = _props2.optionComponent; - var optionID = _props2.optionID; - var props = babelHelpers.objectWithoutProperties(_props2, ['className', 'role', 'data', 'textField', 'valueField', 'focused', 'selected', 'messages', 'onSelect', 'itemComponent', 'optionComponent', 'optionID']); - var id = _utilWidgetHelpers.instanceId(this); - var items; - - items = !data.length ? _react2['default'].createElement( - 'li', - { className: 'rw-list-empty' }, - _util_2['default'].result(messages.emptyList, this.props) - ) : data.map(function (item, idx) { - var currentId = optionId(id, idx); - - return _react2['default'].createElement( - Option, - { - key: 'item_' + idx, - id: currentId, - dataItem: item, - focused: focused === item, z: true, - selected: selected === item, - onClick: onSelect.bind(null, item) - }, - ItemComponent ? _react2['default'].createElement(ItemComponent, { - item: item, - value: _utilDataHelpers.dataValue(item, valueField), - text: _utilDataHelpers.dataText(item, textField) - }) : _utilDataHelpers.dataText(item, textField) - ); - }); - - return _react2['default'].createElement( - 'ul', - babelHelpers._extends({ - id: id, - tabIndex: '-1', - className: _classnames2['default'](className, 'rw-list'), - role: role === undefined ? 'listbox' : role - }, props), - items - ); - }, - - _data: function _data() { - return this.props.data; - }, - - move: function move() { - var list = _utilCompat2['default'].findDOMNode(this), - idx = this._data().indexOf(this.props.focused), - selected = list.children[idx]; - - if (!selected) return; - - _utilWidgetHelpers.notify(this.props.onMove, [selected, list, this.props.focused]); - } - - }); - module.exports = exports['default']; - -/***/ }, -/* 33 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var ListOption = _react2['default'].createClass({ - displayName: 'ListOption', - - propTypes: { - dataItem: _react2['default'].PropTypes.any, - focused: _react2['default'].PropTypes.bool, - selected: _react2['default'].PropTypes.bool - }, - - render: function render() { - var _props = this.props; - var className = _props.className; - var children = _props.children; - var focused = _props.focused; - var selected = _props.selected; - var props = babelHelpers.objectWithoutProperties(_props, ['className', 'children', 'focused', 'selected']); - - var classes = { - 'rw-state-focus': focused, - 'rw-state-selected': selected - }; - - return _react2['default'].createElement( - 'li', - babelHelpers._extends({ - role: 'option', - tabIndex: '-1', - 'aria-selected': !!selected, - className: _classnames2['default']('rw-list-option', className, classes) - }, props), - children - ); - } - }); - - exports['default'] = ListOption; - module.exports = exports['default']; - -/***/ }, -/* 34 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - exports.dataValue = dataValue; - exports.dataText = dataText; - exports.dataIndexOf = dataIndexOf; - exports.valueMatcher = valueMatcher; - exports.dataItem = dataItem; - - var _ = __webpack_require__(11); - - function accessor(data, field) { - var value = data; - - if (typeof field === 'function') value = field(data);else if (data == null) value = data;else if (typeof field === 'string' && typeof data === 'object' && field in data) value = data[field]; - - return value; - } - - function dataValue(item, valueField) { - return valueField && item && _.has(item, valueField) ? item[valueField] : item; - } - - function dataText(item, textField) { - var value = accessor(item, textField); - return value == null ? '' : value + ''; - } - - function dataIndexOf(data, item, valueField) { - var idx = -1, - len = data.length, - finder = function finder(datum) { - return valueMatcher(item, datum, valueField); - }; - - while (++idx < len) if (finder(data[idx])) return idx; - - return -1; - } - - function valueMatcher(a, b, valueField) { - return _.isShallowEqual(dataValue(a, valueField), dataValue(b, valueField)); - } - - function dataItem(data, item, valueField) { - var first = data[0], - idx; - - // make an attempt to see if we were passed in dataItem vs just a valueField value - // either an object with the right prop, or a primitive - // { valueField: 5 } || "hello" [ "hello" ] - if (_.has(item, valueField) || typeof first === typeof val) return item; - - idx = dataIndexOf(data, dataValue(item, valueField), valueField); - - if (idx !== -1) return data[idx]; - - return item; - } - -/***/ }, -/* 35 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - exports.notify = notify; - exports.instanceId = instanceId; - exports.isFirstFocusedRender = isFirstFocusedRender; - - var _ = __webpack_require__(11); - - function notify(handler, args) { - handler && handler.apply(null, [].concat(args)); - } - - function instanceId(component) { - var suffix = arguments.length <= 1 || arguments[1] === undefined ? '' : arguments[1]; - - component.__id || (component.__id = _.uniqueId('rw_')); - return (component.props.id || component.__id) + suffix; - } - - function isFirstFocusedRender(component) { - return component._firstFocus || component.state.focused && (component._firstFocus = true); - } - -/***/ }, -/* 36 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _utilFilter = __webpack_require__(31); - - var _utilFilter2 = babelHelpers.interopRequireDefault(_utilFilter); - - var _utilDataHelpers = __webpack_require__(34); - - module.exports = { - - propTypes: { - textField: _react2['default'].PropTypes.string - }, - - first: function first() { - return this._data()[0]; - }, - - last: function last() { - var data = this._data(); - return data[data.length - 1]; - }, - - prev: function prev(item, word) { - var textField = this.props.textField, - data = this._data(), - idx = data.indexOf(item); - - if (idx === -1) idx = data.length; - - return word ? findPrevInstance(textField, data, word, idx) : --idx < 0 ? data[0] : data[idx]; - }, - - next: function next(item, word) { - var textField = this.props.textField, - data = this._data(), - idx = data.indexOf(item); - - return word ? findNextInstance(textField, data, word, idx) : ++idx === data.length ? data[data.length - 1] : data[idx]; - } - - }; - - function findNextInstance(textField, data, word, startIndex) { - var matches = _utilFilter2['default'].startsWith, - idx = -1, - len = data.length, - foundStart, - itemText; - - word = word.toLowerCase(); - - while (++idx < len) { - foundStart = foundStart || idx > startIndex; - itemText = foundStart && _utilDataHelpers.dataText(data[idx], textField).toLowerCase(); - - if (foundStart && matches(itemText, word)) return data[idx]; - } - } - - function findPrevInstance(textField, data, word, startIndex) { - var matches = _utilFilter2['default'].startsWith, - idx = data.length, - foundStart, - itemText; - - word = word.toLowerCase(); - - while (--idx >= 0) { - foundStart = foundStart || idx < startIndex; - itemText = foundStart && _utilDataHelpers.dataText(data[idx], textField).toLowerCase(); - - if (foundStart && matches(itemText, word)) return data[idx]; - } - } - -/***/ }, -/* 37 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var shape = _react2['default'].PropTypes.shape({ - //setActive: React.PropTypes.func, - reconcile: _react2['default'].PropTypes.func - }); - - function defaultReconcile(key, id) { - return id; - } - - function flushAriaToNode(id, nodeOrComponent, ctx) { - var node = typeof nodeOrComponent === 'function' ? nodeOrComponent(ctx) : typeof nodeOrComponent === 'string' ? ctx.refs[nodeOrComponent] : ctx; - - if (node) { - if (id) _utilCompat2['default'].findDOMNode(node).setAttribute('aria-activedescendant', id);else _utilCompat2['default'].findDOMNode(node).removeAttribute('aria-activedescendant'); - } - } - - exports['default'] = function (nodeOrComponent) { - var reconcileChildren = arguments.length <= 1 || arguments[1] === undefined ? defaultReconcile : arguments[1]; - - return { - propTypes: { - ariaActiveDescendantKey: _react2['default'].PropTypes.string.isRequired - }, - - contextTypes: { - activeDescendants: shape - }, - - childContextTypes: { - activeDescendants: shape - }, - - ariaActiveDescendant: function ariaActiveDescendant(id) { - var key = arguments.length <= 1 || arguments[1] === undefined ? this.props.ariaActiveDescendantKey : arguments[1]; - var activeDescendants = this.context.activeDescendants; - - var current = this.__ariaActiveDescendantId; - - if (id === undefined) return current; - - id = reconcileChildren.call(this, key, id); - - if (id === undefined) id = current;else { - this.__ariaActiveDescendantId = id; - flushAriaToNode(id, nodeOrComponent, this); - } - - activeDescendants && activeDescendants.reconcile(key, id); - }, - - getChildContext: function getChildContext() { - var _this = this; - - return this._context || (this._context = { - activeDescendants: { - reconcile: function reconcile(key, id) { - return _this.ariaActiveDescendant(id, key); - } - } - }); - } - }; - }; - - module.exports = exports['default']; - -/***/ }, -/* 38 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _ListOption = __webpack_require__(33); - - var _ListOption2 = babelHelpers.interopRequireDefault(_ListOption); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _warning = __webpack_require__(39); - - var _warning2 = babelHelpers.interopRequireDefault(_warning); - - var _utilDataHelpers = __webpack_require__(34); - - var _utilWidgetHelpers = __webpack_require__(35); - - var optionId = function optionId(id, idx) { - return id + '__option__' + idx; - }; - - exports['default'] = _react2['default'].createClass({ - - displayName: 'List', - - mixins: [__webpack_require__(36), __webpack_require__(37)()], - - propTypes: { - data: _react2['default'].PropTypes.array, - onSelect: _react2['default'].PropTypes.func, - onMove: _react2['default'].PropTypes.func, - - optionComponent: _utilPropTypes2['default'].elementType, - itemComponent: _utilPropTypes2['default'].elementType, - groupComponent: _utilPropTypes2['default'].elementType, - - selected: _react2['default'].PropTypes.any, - focused: _react2['default'].PropTypes.any, - - valueField: _react2['default'].PropTypes.string, - textField: _utilPropTypes2['default'].accessor, - - optID: _react2['default'].PropTypes.string, - - groupBy: _utilPropTypes2['default'].accessor, - - messages: _react2['default'].PropTypes.shape({ - emptyList: _utilPropTypes2['default'].message - }) - }, - - getDefaultProps: function getDefaultProps() { - return { - optID: '', - onSelect: function onSelect() {}, - data: [], - optionComponent: _ListOption2['default'], - ariaActiveDescendantKey: 'groupedList', - messages: { - emptyList: 'There are no items in this list' - } - }; - }, - - getInitialState: function getInitialState() { - var keys = []; - - return { - groups: this._group(this.props.groupBy, this.props.data, keys), - - sortedKeys: keys - }; - }, - - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - var keys = []; - - if (nextProps.data !== this.props.data || nextProps.groupBy !== this.props.groupBy) this.setState({ - groups: this._group(nextProps.groupBy, nextProps.data, keys), - sortedKeys: keys - }); - }, - - componentDidMount: function componentDidMount() { - this.move(); - }, - - componentDidUpdate: function componentDidUpdate() { - this.ariaActiveDescendant(this._currentActiveID); - this.move(); - }, - - render: function render() { - var _this = this; - - var _props = this.props; - var className = _props.className; - var role = _props.role; - var data = _props.data; - var messages = _props.messages; - var onSelect = _props.onSelect; - var selectedIndex = _props.selectedIndex; - var props = babelHelpers.objectWithoutProperties(_props, ['className', 'role', 'data', 'messages', 'onSelect', 'selectedIndex']); - var id = _utilWidgetHelpers.instanceId(this);var _state = this.state; - var sortedKeys = _state.sortedKeys; - var groups = _state.groups; - - var items = [], - idx = -1, - group = undefined; - - this._currentActiveID = null; - - if (data.length) { - items = sortedKeys.reduce(function (items, key) { - group = groups[key]; - items.push(_this._renderGroupHeader(key)); - - for (var itemIdx = 0; itemIdx < group.length; itemIdx++) items.push(_this._renderItem(key, group[itemIdx], ++idx)); - - return items; - }, []); - } else items = _react2['default'].createElement( - 'li', - { className: 'rw-list-empty' }, - _util_2['default'].result(messages.emptyList, this.props) - ); - - return _react2['default'].createElement( - 'ul', - babelHelpers._extends({ - ref: 'scrollable', - id: id, - tabIndex: '-1', - className: _classnames2['default'](className, 'rw-list', 'rw-list-grouped'), - role: role === undefined ? 'listbox' : role - }, props), - items - ); - }, - - _renderGroupHeader: function _renderGroupHeader(group) { - var GroupComponent = this.props.groupComponent, - id = _utilWidgetHelpers.instanceId(this); - - return _react2['default'].createElement( - 'li', - { - key: 'item_' + group, - tabIndex: '-1', - role: 'separator', - id: id + '_group_' + group, - className: 'rw-list-optgroup' - }, - GroupComponent ? _react2['default'].createElement(GroupComponent, { item: group }) : group - ); - }, - - _renderItem: function _renderItem(group, item, idx) { - var _props2 = this.props; - var focused = _props2.focused; - var selected = _props2.selected; - var onSelect = _props2.onSelect; - var textField = _props2.textField; - var valueField = _props2.valueField; - var ItemComponent = _props2.itemComponent; - var Option = _props2.optionComponent; - - var currentID = optionId(_utilWidgetHelpers.instanceId(this), idx); - - if (focused === item) this._currentActiveID = currentID; - - return _react2['default'].createElement( - Option, - { - key: 'item_' + group + '_' + idx, - id: currentID, - dataItem: item, - focused: focused === item, - selected: selected === item, - onClick: onSelect.bind(null, item) - }, - ItemComponent ? _react2['default'].createElement(ItemComponent, { - item: item, - value: _utilDataHelpers.dataValue(item, valueField), - text: _utilDataHelpers.dataText(item, textField) - }) : _utilDataHelpers.dataText(item, textField) - ); - }, - - _isIndexOf: function _isIndexOf(idx, item) { - return this.props.data[idx] === item; - }, - - _group: function _group(groupBy, data, keys) { - var iter = typeof groupBy === 'function' ? groupBy : function (item) { - return item[groupBy]; - }; - - // the keys array ensures that groups are rendered in the order they came in - // which means that if you sort the data array it will render sorted, - // so long as you also sorted by group - keys = keys || []; - - _warning2['default'](typeof groupBy !== 'string' || !data.length || _util_2['default'].has(data[0], groupBy), '[React Widgets] You are seem to be trying to group this list by a ' + ('property `' + groupBy + '` that doesn\'t exist in the dataset items, this may be a typo')); - - return data.reduce(function (grps, item) { - var group = iter(item); - - _util_2['default'].has(grps, group) ? grps[group].push(item) : (keys.push(group), grps[group] = [item]); - - return grps; - }, {}); - }, - - _data: function _data() { - var groups = this.state.groups; - - return this.state.sortedKeys.reduce(function (flat, grp) { - return flat.concat(groups[grp]); - }, []); - }, - - move: function move() { - var selected = this.getItemDOMNode(this.props.focused); - - if (!selected) return; - - _utilWidgetHelpers.notify(this.props.onMove, [selected, _utilCompat2['default'].findDOMNode(this), this.props.focused]); - }, - - getItemDOMNode: function getItemDOMNode(item) { - var list = _utilCompat2['default'].findDOMNode(this), - groups = this.state.groups, - idx = -1, - itemIdx, - child; - - this.state.sortedKeys.some(function (group) { - itemIdx = groups[group].indexOf(item); - idx++; - - if (itemIdx !== -1) return !!(child = list.children[idx + itemIdx + 1]); - - idx += groups[group].length; - }); - - return child; - } - - }); - module.exports = exports['default']; - -/***/ }, -/* 39 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - 'use strict'; - - /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - - var warning = function() {}; - - if (process.env.NODE_ENV !== 'production') { - warning = function(condition, format, args) { - var len = arguments.length; - args = new Array(len > 2 ? len - 2 : 0); - for (var key = 2; key < len; key++) { - args[key - 2] = arguments[key]; - } - if (format === undefined) { - throw new Error( - '`warning(condition, format, ...args)` requires a warning ' + - 'message argument' - ); - } - - if (format.length < 10 || (/^[s\W]*$/).test(format)) { - throw new Error( - 'The warning format should be able to uniquely identify this ' + - 'warning. Please, use a more descriptive format than: ' + format - ); - } - - if (!condition) { - var argIndex = 0; - var message = 'Warning: ' + - format.replace(/%s/g, function() { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch(x) {} - } - }; - } - - module.exports = warning; - - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) - -/***/ }, -/* 40 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {'use strict'; - var METHODS = ['next', 'prev', 'first', 'last']; - - module.exports = function validateListComponent(list) { - - if (process.env.NODE_ENV !== 'production') { - METHODS.forEach(function (method) { - return assert(typeof list[method] === 'function', 'List components must implement a `' + method + '()` method'); - }); - } - }; - - function assert(condition, msg) { - var error; - - if (!condition) { - error = new Error(msg); - error.framesToPop = 1; - throw error; - } - } - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) - -/***/ }, -/* 41 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - - var _createUncontrollable = __webpack_require__(42); - - var _createUncontrollable2 = _interopRequireDefault(_createUncontrollable); - - var mixin = { - shouldComponentUpdate: function shouldComponentUpdate() { - //let the setState trigger the update - return !this._notifying; - } - }; - - function set(component, propName, handler, value, args) { - if (handler) { - component._notifying = true; - handler.call.apply(handler, [component, value].concat(args)); - component._notifying = false; - } - - component._values[propName] = value; - component.forceUpdate(); - } - - exports['default'] = _createUncontrollable2['default']([mixin], set); - module.exports = exports['default']; - -/***/ }, -/* 42 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - exports['default'] = createUncontrollable; - - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - - function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - - var _react = __webpack_require__(4); - - var _react2 = _interopRequireDefault(_react); - - var _utils = __webpack_require__(43); - - var utils = _interopRequireWildcard(_utils); - - function createUncontrollable(mixins, set) { - - return uncontrollable; - - function uncontrollable(Component, controlledValues) { - var displayName = Component.displayName || Component.name || 'Component', - basePropTypes = utils.getType(Component).propTypes, - propTypes; - - propTypes = utils.uncontrolledPropTypes(controlledValues, basePropTypes, displayName); - - var component = _react2['default'].createClass({ - - displayName: 'Uncontrolled(' + displayName + ')', - - mixins: mixins, - - propTypes: propTypes, - - componentWillMount: function componentWillMount() { - var props = this.props, - keys = Object.keys(controlledValues); - - this._values = utils.transform(keys, function (values, key) { - values[key] = props[utils.defaultKey(key)]; - }, {}); - }, - - render: function render() { - var _this = this; - - var newProps = {}; - var _props = this.props; - var valueLink = _props.valueLink; - var checkedLink = _props.checkedLink; - - var props = _objectWithoutProperties(_props, ['valueLink', 'checkedLink']); - - utils.each(controlledValues, function (handle, propName) { - var linkPropName = utils.getLinkName(propName), - prop = _this.props[propName]; - - if (linkPropName && !isProp(_this.props, propName) && isProp(_this.props, linkPropName)) { - prop = _this.props[linkPropName].value; - } - - newProps[propName] = prop !== undefined ? prop : _this._values[propName]; - - newProps[handle] = setAndNotify.bind(_this, propName); - }); - - newProps = _extends({}, props, newProps); - - return _react2['default'].createElement(Component, newProps); - } - }); - - component.ControlledComponent = Component; - - return component; - - function setAndNotify(propName, value) { - var linkName = utils.getLinkName(propName), - handler = this.props[controlledValues[propName]]; - - if (linkName && isProp(this.props, linkName) && !handler) { - handler = this.props[linkName].requestChange; - } - - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - - set(this, propName, handler, value, args); - } - - function isProp(props, prop) { - return props[prop] !== undefined; - } - } - } - - module.exports = exports['default']; - -/***/ }, -/* 43 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {'use strict'; - - exports.__esModule = true; - exports.customPropType = customPropType; - exports.uncontrolledPropTypes = uncontrolledPropTypes; - exports.getType = getType; - exports.getLinkName = getLinkName; - exports.defaultKey = defaultKey; - exports.chain = chain; - exports.transform = transform; - exports.each = each; - exports.has = has; - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - - var _react = __webpack_require__(4); - - var _react2 = _interopRequireDefault(_react); - - var _invariant = __webpack_require__(44); - - var _invariant2 = _interopRequireDefault(_invariant); - - function customPropType(handler, propType, name) { - - return function (props, propName, componentName) { - - if (props[propName] !== undefined) { - if (!props[handler]) { - return new Error('You have provided a `' + propName + '` prop to ' + '`' + name + '` without an `' + handler + '` handler. This will render a read-only field. ' + 'If the field should be mutable use `' + defaultKey(propName) + '`. Otherwise, set `' + handler + '`'); - } - - return propType && propType(props, propName, name); - } - }; - } - - function uncontrolledPropTypes(controlledValues, basePropTypes, displayName) { - var propTypes = {}; - - if (process.env.NODE_ENV !== 'production' && basePropTypes) { - transform(controlledValues, function (obj, handler, prop) { - var type = basePropTypes[prop]; - - _invariant2['default'](typeof handler === 'string' && handler.trim().length, 'Uncontrollable - [%s]: the prop `%s` needs a valid handler key name in order to make it uncontrollable', displayName, prop); - - obj[prop] = customPropType(handler, type, displayName); - - if (type !== undefined) obj[defaultKey(prop)] = type; - }, propTypes); - } - - return propTypes; - } - - var version = _react2['default'].version.split('.').map(parseFloat); - - exports.version = version; - - function getType(component) { - if (version[0] === 0 && version[1] >= 13) return component; - - return component.type; - } - - function getLinkName(name) { - return name === 'value' ? 'valueLink' : name === 'checked' ? 'checkedLink' : null; - } - - function defaultKey(key) { - return 'default' + key.charAt(0).toUpperCase() + key.substr(1); - } - - function chain(thisArg, a, b) { - return function chainedFunction() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - a && a.call.apply(a, [thisArg].concat(args)); - b && b.call.apply(b, [thisArg].concat(args)); - }; - } - - function transform(obj, cb, seed) { - each(obj, cb.bind(null, seed = seed || (Array.isArray(obj) ? [] : {}))); - return seed; - } - - function each(obj, cb, thisArg) { - if (Array.isArray(obj)) return obj.forEach(cb, thisArg); - - for (var key in obj) if (has(obj, key)) cb.call(thisArg, obj[key], key, obj); - } - - function has(o, k) { - return o ? Object.prototype.hasOwnProperty.call(o, k) : false; - } - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) - -/***/ }, -/* 44 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule invariant - */ - - 'use strict'; - - /** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - - var invariant = function(condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - 'Invariant Violation: ' + - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } - }; - - module.exports = invariant; - - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) - -/***/ }, -/* 45 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - exports.isDisabled = isDisabled; - exports.isReadOnly = isReadOnly; - exports.isDisabledItem = isDisabledItem; - exports.isReadOnlyItem = isReadOnlyItem; - exports.contains = contains; - exports.move = move; - - var _dataHelpers = __webpack_require__(34); - - function isDisabled(props) { - return props.disabled === true || props.disabled === 'disabled'; - } - - function isReadOnly(props) { - return props.readOnly === true || props.readOnly === 'readOnly'; - } - - function isDisabledItem(item, props) { - return isDisabled(props) || contains(item, props.disabled, props.valueField); - } - - function isReadOnlyItem(item, props) { - return isReadOnly(props) || contains(item, props.readOnly, props.valueField); - } - - function contains(item, values, valueField) { - return Array.isArray(values) ? values.some(function (value) { - return _dataHelpers.valueMatcher(item, value, valueField); - }) : _dataHelpers.valueMatcher(item, values, valueField); - } - - function move(dir, item, props, list) { - var isDisabledOrReadonly = function isDisabledOrReadonly(item) { - return isDisabledItem(item, props) || isReadOnlyItem(item, props); - }, - stop = dir === 'next' ? list.last() : list.first(), - next = list[dir](item); - - while (next !== stop && isDisabledOrReadonly(next)) next = list[dir](next); - - return isDisabledOrReadonly(next) ? item : next; - } - - var widgetEnabled = interactionDecorator(true); - - exports.widgetEnabled = widgetEnabled; - var widgetEditable = interactionDecorator(false); - - exports.widgetEditable = widgetEditable; - function interactionDecorator(disabledOnly) { - function wrap(method) { - return function decoratedMethod() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (!(isDisabled(this.props) || !disabledOnly && isReadOnly(this.props))) return method.apply(this, args); - }; - } - - return function decorate(target, key, desc) { - if (desc.initializer) { - (function () { - var init = desc.initializer; - desc.initializer = function () { - return wrap(init()); - }; - })(); - } else desc.value = wrap(desc.value); - return desc; - }; - } - -/***/ }, -/* 46 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var _require = __webpack_require__(11); - - var has = _require.has; - - module.exports = { - - componentWillUnmount: function componentWillUnmount() { - var timers = this._timers || {}; - - this._unmounted = true; - - for (var k in timers) if (has(timers, k)) clearTimeout(timers[k]); - }, - - setTimeout: function setTimeout(key, cb, duration) { - var timers = this._timers || (this._timers = Object.create(null)); - - if (this._unmounted) return; - - clearTimeout(timers[key]); - timers[key] = window.setTimeout(cb, duration); - } - - }; - -/***/ }, -/* 47 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var _ = __webpack_require__(11); - - //backport PureRenderEqual - module.exports = { - - shouldComponentUpdate: function shouldComponentUpdate(nextProps, nextState) { - return !_.isShallowEqual(this.props, nextProps) || !_.isShallowEqual(this.state, nextState); - } - }; - -/***/ }, -/* 48 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _utilFilter = __webpack_require__(31); - - var _utilFilter2 = babelHelpers.interopRequireDefault(_utilFilter); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _utilDataHelpers = __webpack_require__(34); - - var dflt = function dflt(f) { - return f === true ? 'startsWith' : f ? f : 'eq'; - }; - - module.exports = { - - propTypes: { - data: _react2['default'].PropTypes.array, - value: _react2['default'].PropTypes.any, - filter: _utilPropTypes2['default'].filter, - caseSensitive: _react2['default'].PropTypes.bool, - minLength: _react2['default'].PropTypes.number - }, - - getDefaultProps: function getDefaultProps() { - return { - caseSensitive: false, - minLength: 1 - }; - }, - - filterIndexOf: function filterIndexOf(items, searchTerm) { - var idx = -1, - matches = typeof this.props.filter === 'function' ? this.props.filter : getFilter(_utilFilter2['default'][dflt(this.props.filter)], searchTerm, this); - - if (!searchTerm || !searchTerm.trim() || this.props.filter && searchTerm.length < (this.props.minLength || 1)) return -1; - - items.every(function (item, i) { - if (matches(item, searchTerm, i)) return (idx = i, false); - - return true; - }); - - return idx; - }, - - filter: function filter(items, searchTerm) { - var matches = typeof this.props.filter === 'string' ? getFilter(_utilFilter2['default'][this.props.filter], searchTerm, this) : this.props.filter; - - if (!matches || !searchTerm || !searchTerm.trim() || searchTerm.length < (this.props.minLength || 1)) return items; - - return items.filter(function (item, idx) { - return matches(item, searchTerm, idx); - }); - } - }; - - function getFilter(matcher, searchTerm, ctx) { - searchTerm = !ctx.props.caseSensitive ? searchTerm.toLowerCase() : searchTerm; - - return function (item) { - var val = _utilDataHelpers.dataText(item, ctx.props.textField); - - if (!ctx.props.caseSensitive) val = val.toLowerCase(); - - return matcher(val, searchTerm); - }; - } - -/***/ }, -/* 49 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _domHelpersUtilScrollTo = __webpack_require__(50); - - var _domHelpersUtilScrollTo2 = babelHelpers.interopRequireDefault(_domHelpersUtilScrollTo); - - exports['default'] = { - - _scrollTo: function _scrollTo(selected, list, focused) { - var state = this._scrollState || (this._scrollState = {}), - handler = this.props.onMove, - lastVisible = state.visible, - lastItem = state.focused, - shown, - changed; - - state.visible = !(!list.offsetWidth || !list.offsetHeight); - state.focused = focused; - - changed = lastItem !== focused; - shown = state.visible && !lastVisible; - - if (shown || state.visible && changed) { - if (handler) handler(selected, list, focused);else { - state.scrollCancel && state.scrollCancel(); - state.scrollCancel = _domHelpersUtilScrollTo2['default'](selected, list); - } - } - } - }; - module.exports = exports['default']; - -/***/ }, -/* 50 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var getOffset = __webpack_require__(21), - height = __webpack_require__(20), - getScrollParent = __webpack_require__(51), - scrollTop = __webpack_require__(52), - raf = __webpack_require__(53), - getWindow = __webpack_require__(22); - - module.exports = function scrollTo(selected, scrollParent) { - var offset = getOffset(selected), - poff = { top: 0, left: 0 }, - list, - listScrollTop, - selectedTop, - isWin, - selectedHeight, - listHeight, - bottom; - - if (!selected) return; - - list = scrollParent || getScrollParent(selected); - isWin = getWindow(list); - listScrollTop = scrollTop(list); - - listHeight = height(list, true); - isWin = getWindow(list); - - if (!isWin) poff = getOffset(list); - - offset = { - top: offset.top - poff.top, - left: offset.left - poff.left, - height: offset.height, - width: offset.width - }; - - selectedHeight = offset.height; - selectedTop = offset.top + (isWin ? 0 : listScrollTop); - bottom = selectedTop + selectedHeight; - - listScrollTop = listScrollTop > selectedTop ? selectedTop : bottom > listScrollTop + listHeight ? bottom - listHeight : listScrollTop; - - var id = raf(function () { - return scrollTop(list, listScrollTop); - }); - - return function () { - return raf.cancel(id); - }; - }; - -/***/ }, -/* 51 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var css = __webpack_require__(13), - height = __webpack_require__(20); - - module.exports = function scrollPrarent(node) { - var position = css(node, 'position'), - excludeStatic = position === 'absolute', - ownerDoc = node.ownerDocument; - - if (position === 'fixed') return ownerDoc || document; - - while ((node = node.parentNode) && node.nodeType !== 9) { - - var isStatic = excludeStatic && css(node, 'position') === 'static', - style = css(node, 'overflow') + css(node, 'overflow-y') + css(node, 'overflow-x'); - - if (isStatic) continue; - - if (/(auto|scroll)/.test(style) && height(node) < node.scrollHeight) return node; - } - - return document; - }; - -/***/ }, -/* 52 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var getWindow = __webpack_require__(22); - - module.exports = function scrollTop(node, val) { - var win = getWindow(node); - - if (val === undefined) return win ? 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop : node.scrollTop; - - if (win) win.scrollTo('pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft, val);else node.scrollTop = val; - }; - -/***/ }, -/* 53 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var canUseDOM = __webpack_require__(9); - - var vendors = ['', 'webkit', 'moz', 'o', 'ms'], - cancel = 'clearTimeout', - raf = fallback, - compatRaf; - - var getKey = function getKey(vendor, k) { - return vendor + (!vendor ? k : k[0].toUpperCase() + k.substr(1)) + 'AnimationFrame'; - }; - - if (canUseDOM) { - vendors.some(function (vendor) { - var rafKey = getKey(vendor, 'request'); - - if (rafKey in window) { - cancel = getKey(vendor, 'cancel'); - return raf = function (cb) { - return window[rafKey](cb); - }; - } - }); - } - - /* https://github.com/component/raf */ - var prev = new Date().getTime(); - - function fallback(fn) { - var curr = new Date().getTime(), - ms = Math.max(0, 16 - (curr - prev)), - req = setTimeout(fn, ms); - - prev = curr; - return req; - } - - compatRaf = function (cb) { - return raf(cb); - }; - compatRaf.cancel = function (id) { - return window[cancel](id); - }; - - module.exports = compatRaf; - -/***/ }, -/* 54 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var React = __webpack_require__(4); - - module.exports = { - - propTypes: { - isRtl: React.PropTypes.bool - }, - - contextTypes: { - isRtl: React.PropTypes.bool - }, - - childContextTypes: { - isRtl: React.PropTypes.bool - }, - - getChildContext: function getChildContext() { - return { - isRtl: this.props.isRtl || this.context && this.context.isRtl - }; - }, - - isRtl: function isRtl() { - return !!(this.props.isRtl || this.context && this.context.isRtl); - } - - }; - -/***/ }, -/* 55 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _utilFilter = __webpack_require__(31); - - var _utilFilter2 = babelHelpers.interopRequireDefault(_utilFilter); - - var _Popup = __webpack_require__(12); - - var _Popup2 = babelHelpers.interopRequireDefault(_Popup); - - var _WidgetButton = __webpack_require__(56); - - var _WidgetButton2 = babelHelpers.interopRequireDefault(_WidgetButton); - - var _ComboboxInput = __webpack_require__(57); - - var _ComboboxInput2 = babelHelpers.interopRequireDefault(_ComboboxInput); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _List = __webpack_require__(32); - - var _List2 = babelHelpers.interopRequireDefault(_List); - - var _ListGroupable = __webpack_require__(38); - - var _ListGroupable2 = babelHelpers.interopRequireDefault(_ListGroupable); - - var _utilValidateListInterface = __webpack_require__(40); - - var _utilValidateListInterface2 = babelHelpers.interopRequireDefault(_utilValidateListInterface); - - var _uncontrollable = __webpack_require__(41); - - var _uncontrollable2 = babelHelpers.interopRequireDefault(_uncontrollable); - - var _utilDataHelpers = __webpack_require__(34); - - var _utilInteraction = __webpack_require__(45); - - var _utilWidgetHelpers = __webpack_require__(35); - - var defaultSuggest = function defaultSuggest(f) { - return f === true ? 'startsWith' : f ? f : 'eq'; - }; - - var omit = _util_2['default'].omit; - var pick = _util_2['default'].pick; - - var propTypes = { - //-- controlled props ----------- - value: _react2['default'].PropTypes.any, - onChange: _react2['default'].PropTypes.func, - open: _react2['default'].PropTypes.bool, - onToggle: _react2['default'].PropTypes.func, - //------------------------------------ - - itemComponent: _utilPropTypes2['default'].elementType, - listComponent: _utilPropTypes2['default'].elementType, - - groupComponent: _utilPropTypes2['default'].elementType, - groupBy: _utilPropTypes2['default'].accessor, - - data: _react2['default'].PropTypes.array, - valueField: _react2['default'].PropTypes.string, - textField: _utilPropTypes2['default'].accessor, - name: _react2['default'].PropTypes.string, - - onSelect: _react2['default'].PropTypes.func, - - disabled: _utilPropTypes2['default'].disabled, - readOnly: _utilPropTypes2['default'].readOnly, - - suggest: _utilPropTypes2['default'].filter, - filter: _utilPropTypes2['default'].filter, - - busy: _react2['default'].PropTypes.bool, - - dropUp: _react2['default'].PropTypes.bool, - duration: _react2['default'].PropTypes.number, //popup - - placeholder: _react2['default'].PropTypes.string, - - messages: _react2['default'].PropTypes.shape({ - open: _utilPropTypes2['default'].message, - emptyList: _utilPropTypes2['default'].message, - emptyFilter: _utilPropTypes2['default'].message - }) - }; - - var ComboBox = _react2['default'].createClass(babelHelpers.createDecoratedObject([{ - key: 'displayName', - initializer: function initializer() { - return 'ComboBox'; - } - }, { - key: 'mixins', - initializer: function initializer() { - return [__webpack_require__(46), __webpack_require__(48), __webpack_require__(49), __webpack_require__(54), __webpack_require__(37)('input')]; - } - }, { - key: 'propTypes', - initializer: function initializer() { - return propTypes; - } - }, { - key: 'getInitialState', - value: function getInitialState() { - var _props = this.props; - var value = _props.value; - var data = _props.data; - var valueField = _props.valueField; - var items = this.process(data, value); - var idx = _utilDataHelpers.dataIndexOf(items, value, valueField); - - return { - selectedItem: items[idx], - focusedItem: items[! ~idx ? 0 : idx], - processedData: items, - open: false - }; - } - }, { - key: 'getDefaultProps', - value: function getDefaultProps() { - return { - data: [], - value: '', - open: false, - suggest: false, - filter: false, - delay: 500, - - messages: msgs(), - ariaActiveDescendantKey: 'combobox' - }; - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this.refs.list && _utilValidateListInterface2['default'](this.refs.list); - } - }, { - key: 'shouldComponentUpdate', - value: function shouldComponentUpdate(nextProps, nextState) { - var isSuggesting = this.refs.input && this.refs.input.isSuggesting(), - stateChanged = !_util_2['default'].isShallowEqual(nextState, this.state), - valueChanged = !_util_2['default'].isShallowEqual(nextProps, this.props); - - return isSuggesting || stateChanged || valueChanged; - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - var value = nextProps.value; - var data = nextProps.data; - var valueField = nextProps.valueField; - var textField = nextProps.textField; - - var rawIdx = _utilDataHelpers.dataIndexOf(data, value, valueField), - valueItem = rawIdx === -1 ? nextProps.value : nextProps.data[rawIdx], - isSuggesting = this.refs.input.isSuggesting(), - items = this.process(nextProps.data, nextProps.value, (rawIdx === -1 || isSuggesting) && _utilDataHelpers.dataText(valueItem, textField)), - idx = _utilDataHelpers.dataIndexOf(items, value, valueField), - focused = this.filterIndexOf(items, _utilDataHelpers.dataText(valueItem, textField)); - - this._searchTerm = ''; - - this.setState({ - processedData: items, - selectedItem: items[idx], - focusedItem: items[idx === -1 ? focused !== -1 ? focused : 0 // focus the closest match - : idx] - }); - } - }, { - key: 'render', - value: function render() { - var _cx, - _this = this; - - var _props2 = this.props; - var className = _props2.className; - var tabIndex = _props2.tabIndex; - var filter = _props2.filter; - var suggest = _props2.suggest; - var valueField = _props2.valueField; - var textField = _props2.textField; - var groupBy = _props2.groupBy; - var messages = _props2.messages; - var data = _props2.data; - var busy = _props2.busy; - var dropUp = _props2.dropUp; - var name = _props2.name; - var placeholder = _props2.placeholder; - var value = _props2.value; - var open = _props2.open; - var disabled = _props2.disabled; - var readOnly = _props2.readOnly; - var List = _props2.listComponent; - - List = List || groupBy && _ListGroupable2['default'] || _List2['default']; - - var elementProps = omit(this.props, Object.keys(propTypes)); - var listProps = pick(this.props, Object.keys(_utilCompat2['default'].type(List).propTypes)); - var popupProps = pick(this.props, Object.keys(_utilCompat2['default'].type(_Popup2['default']).propTypes)); - - var _state = this.state; - var focusedItem = _state.focusedItem; - var selectedItem = _state.selectedItem; - var focused = _state.focused; - - var items = this._data(), - valueItem = _utilDataHelpers.dataItem(data, value, valueField), - // take value from the raw data - inputID = _utilWidgetHelpers.instanceId(this, '_input'), - listID = _utilWidgetHelpers.instanceId(this, '_listbox'), - completeType = suggest ? filter ? 'both' : 'inline' : filter ? 'list' : ''; - - var shouldRenderList = _utilWidgetHelpers.isFirstFocusedRender(this) || open; - - messages = msgs(messages); - - return _react2['default'].createElement( - 'div', - babelHelpers._extends({}, elementProps, { - ref: 'element', - onKeyDown: this._keyDown, - onFocus: this._focus.bind(null, true), - onBlur: this._focus.bind(null, false), - tabIndex: '-1', - className: _classnames2['default'](className, 'rw-combobox', 'rw-widget', (_cx = { - 'rw-state-focus': focused, - 'rw-state-disabled': disabled, - 'rw-state-readonly': readOnly, - 'rw-rtl': this.isRtl() - - }, _cx['rw-open' + (dropUp ? '-up' : '')] = open, _cx)) - }), - _react2['default'].createElement( - _WidgetButton2['default'], - { - tabIndex: '-1', - className: 'rw-select', - onClick: this.toggle, - disabled: !!(disabled || readOnly) - }, - _react2['default'].createElement( - 'i', - { className: _classnames2['default']('rw-i rw-i-caret-down', { 'rw-loading': busy }) }, - _react2['default'].createElement( - 'span', - { className: 'rw-sr' }, - _util_2['default'].result(messages.open, this.props) - ) - ) - ), - _react2['default'].createElement(_ComboboxInput2['default'], { - ref: 'input', - id: inputID, - tabIndex: tabIndex, - suggest: suggest, - name: name, - role: 'combobox', - 'aria-owns': listID, - 'aria-busy': !!busy, - 'aria-autocomplete': completeType, - 'aria-expanded': open, - 'aria-haspopup': true, - placeholder: placeholder, - disabled: disabled, - readOnly: readOnly, - className: 'rw-input', - value: _utilDataHelpers.dataText(valueItem, textField), - onChange: this._inputTyping, - onKeyDown: this._inputKeyDown - }), - _react2['default'].createElement( - _Popup2['default'], - babelHelpers._extends({}, popupProps, { - onOpening: function () { - return _this.refs.list.forceUpdate(); - }, - onRequestClose: this.close - }), - _react2['default'].createElement( - 'div', - null, - shouldRenderList && _react2['default'].createElement(List, babelHelpers._extends({ ref: 'list' - }, listProps, { - id: listID, - data: items, - selected: selectedItem, - focused: focusedItem, - 'aria-hidden': !open, - 'aria-labelledby': inputID, - 'aria-live': open && 'polite', - onSelect: this._onSelect, - onMove: this._scrollTo, - messages: { - emptyList: data.length ? messages.emptyFilter : messages.emptyList - } })) - ) - ) - ); - } - }, { - key: '_onSelect', - decorators: [_utilInteraction.widgetEditable], - value: function _onSelect(data) { - this.close(); - _utilWidgetHelpers.notify(this.props.onSelect, data); - this.change(data); - this.focus(); - } - }, { - key: '_inputKeyDown', - value: function _inputKeyDown(e) { - this._deleting = e.key === 'Backspace' || e.key === 'Delete'; - this._isTyping = true; - } - }, { - key: '_inputTyping', - value: function _inputTyping(e) { - var _props3 = this.props; - var data = _props3.data; - var textField = _props3.textField; - - var shouldSuggest = !!this.props.suggest, - strVal = e.target.value, - suggestion; - - suggestion = this._deleting || !shouldSuggest ? strVal : this.suggest(this._data(), strVal); - - suggestion = suggestion || strVal; - - data = _util_2['default'].find(data, function (item) { - return _utilDataHelpers.dataText(item, textField).toLowerCase() === suggestion.toLowerCase(); - }); - - this.change(!this._deleting && data ? data : strVal, true); - - this.open(); - } - }, { - key: 'focus', - value: function focus() { - this.refs.input.focus(); - } - }, { - key: '_focus', - decorators: [_utilInteraction.widgetEnabled], - value: function _focus(focused, e) { - var _this2 = this; - - !focused && this.refs.input.accept(); //not suggesting anymore - - this.setTimeout('focus', function () { - - if (!focused) _this2.close(); - - if (focused !== _this2.state.focused) { - _utilWidgetHelpers.notify(_this2.props[focused ? 'onFocus' : 'onBlur'], e); - _this2.setState({ focused: focused }); - } - }); - } - }, { - key: '_keyDown', - decorators: [_utilInteraction.widgetEditable], - value: function _keyDown(e) { - var self = this, - key = e.key, - alt = e.altKey, - list = this.refs.list, - focusedItem = this.state.focusedItem, - selectedItem = this.state.selectedItem, - isOpen = this.props.open; - - if (key === 'End') if (isOpen) this.setState({ focusedItem: list.last() });else select(list.last(), true);else if (key === 'Home') if (isOpen) this.setState({ focusedItem: list.first() });else select(list.first(), true);else if (key === 'Escape' && isOpen) this.close();else if (key === 'Enter' && isOpen) { - select(this.state.focusedItem, true); - } else if (key === 'ArrowDown') { - if (alt) this.open();else { - if (isOpen) this.setState({ focusedItem: list.next(focusedItem) });else select(list.next(selectedItem), true); - } - } else if (key === 'ArrowUp') { - if (alt) this.close();else { - if (isOpen) this.setState({ focusedItem: list.prev(focusedItem) });else select(list.prev(selectedItem), true); - } - } - - _utilWidgetHelpers.notify(this.props.onKeyDown, [e]); - - function select(item, fromList) { - if (!item) return self.change(_utilCompat2['default'].findDOMNode(self.refs.input).value, false); - - self.refs.input.accept(true); //removes caret - - if (fromList) return self._onSelect(item); - - self.change(item, false); - } - } - }, { - key: 'change', - value: function change(data, typing) { - this._typedChange = !!typing; - _utilWidgetHelpers.notify(this.props.onChange, data); - } - }, { - key: 'open', - value: function open() { - if (!this.props.open) _utilWidgetHelpers.notify(this.props.onToggle, true); - } - }, { - key: 'close', - value: function close() { - if (this.props.open) _utilWidgetHelpers.notify(this.props.onToggle, false); - } - }, { - key: 'toggle', - decorators: [_utilInteraction.widgetEditable], - value: function toggle() { - this.focus(); - - this.props.open ? this.close() : this.open(); - } - }, { - key: 'suggest', - value: function suggest(data, value) { - var _props4 = this.props; - var textField = _props4.textField; - var suggest = _props4.suggest; - var minLength = _props4.minLength; - - var word = _utilDataHelpers.dataText(value, textField), - suggestion; - - suggest = defaultSuggest(suggest); - - if (!(word || '').trim() || word.length < (minLength || 1)) return ''; - - suggestion = typeof value === 'string' ? _util_2['default'].find(data, getFilter(suggest, word, textField)) : value; - - if (suggestion && (!this.state || !this.state.deleting)) return _utilDataHelpers.dataText(suggestion, textField); - - return ''; - } - }, { - key: '_data', - value: function _data() { - return this.state.processedData; - } - }, { - key: 'process', - value: function process(data, values, searchTerm) { - if (this.props.filter && searchTerm) data = this.filter(data, searchTerm); - - return data; - } - }])); - - exports['default'] = _uncontrollable2['default'](ComboBox, { open: 'onToggle', value: 'onChange' }); - - function msgs(msgs) { - return babelHelpers._extends({ - open: 'open combobox', - emptyList: 'There are no items in this list', - emptyFilter: 'The filter returned no results' - }, msgs); - } - - function getFilter(suggest, word, textField) { - return typeof suggest === 'string' ? function (item) { - return _utilFilter2['default'][suggest](_utilDataHelpers.dataText(item, textField).toLowerCase(), word.toLowerCase()); - } : function (item) { - return suggest(item, word); - }; - } - module.exports = exports['default']; - -/***/ }, -/* 56 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - exports['default'] = _react2['default'].createClass({ - displayName: 'WidgetButton', - - render: function render() { - var _props = this.props; - var className = _props.className; - var children = _props.children; - var props = babelHelpers.objectWithoutProperties(_props, ['className', 'children']); - - return _react2['default'].createElement( - 'button', - babelHelpers._extends({}, props, { type: 'button', className: _classnames2['default'](className, 'rw-btn') }), - children - ); - } - }); - module.exports = exports['default']; - -/***/ }, -/* 57 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _utilCaret = __webpack_require__(58); - - var _utilCaret2 = babelHelpers.interopRequireDefault(_utilCaret); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - exports['default'] = _react2['default'].createClass({ - - displayName: 'ComboboxInput', - - propTypes: { - value: _react2['default'].PropTypes.string, - onChange: _react2['default'].PropTypes.func.isRequired - }, - - componentDidUpdate: function componentDidUpdate() { - var input = _utilCompat2['default'].findDOMNode(this), - val = this.props.value; - - if (this.isSuggesting()) { - var start = val.toLowerCase().indexOf(this._last.toLowerCase()) + this._last.length, - end = val.length - start; - - if (start >= 0) { - _utilCaret2['default'](input, start, start + end); - } - } - }, - - getDefaultProps: function getDefaultProps() { - return { - value: '' - }; - }, - - render: function render() { - return _react2['default'].createElement('input', babelHelpers._extends({}, this.props, { - type: 'text', - 'aria-disabled': this.props.disabled, - 'aria-readonly': this.props.readOnly, - className: this.props.className + ' rw-input', - onKeyDown: this.props.onKeyDown, - onChange: this._change, - value: this.props.value == null ? '' : this.props.value - })); - }, - - isSuggesting: function isSuggesting() { - var val = this.props.value, - isSuggestion = this._last != null && val.toLowerCase().indexOf(this._last.toLowerCase()) !== -1; - - return this.props.suggest && isSuggestion; - }, - - accept: function accept(removeCaret) { - var val = _utilCompat2['default'].findDOMNode(this).value || '', - end = val.length; - - this._last = null; - removeCaret && _utilCaret2['default'](_utilCompat2['default'].findDOMNode(this), end, end); - }, - - _change: function _change(e) { - var val = e.target.value, - pl = !!this.props.placeholder; - - // IE fires input events when setting/unsetting placeholders. - // issue #112 - if (pl && !val && val === (this.props.value || '')) return; - - this._last = val; - this.props.onChange(e, val); - }, - - focus: function focus() { - _utilCompat2['default'].findDOMNode(this).focus(); - } - }); - module.exports = exports['default']; - -/***/ }, -/* 58 */ -/***/ function(module, exports) { - - /*eslint-disable no-empty */ - 'use strict'; - - module.exports = function caret(el, start, end) { - if (start === undefined) return get(el); - - set(el, start, end); - }; - - function get(el) { - var start, end, rangeEl, clone; - - if (el.selectionStart !== undefined) { - start = el.selectionStart; - end = el.selectionEnd; - } else { - try { - el.focus(); - rangeEl = el.createTextRange(); - clone = rangeEl.duplicate(); - - rangeEl.moveToBookmark(document.selection.createRange().getBookmark()); - clone.setEndPoint('EndToStart', rangeEl); - - start = clone.text.length; - end = start + rangeEl.text.length; - } catch (e) {/* not focused or not visible */} - } - - return { start: start, end: end }; - } - - function set(el, start, end) { - var rangeEl; - - try { - if (el.selectionStart !== undefined) { - el.focus(); - el.setSelectionRange(start, end); - } else { - el.focus(); - rangeEl = el.createTextRange(); - rangeEl.collapse(true); - rangeEl.moveStart('character', start); - rangeEl.moveEnd('character', end - start); - rangeEl.select(); - } - } catch (e) {/* not focused or not visible */} - } - -/***/ }, -/* 59 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _VIEW, _OPPOSITE_DIRECTION, _MULTIPLIER; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _Header = __webpack_require__(60); - - var _Header2 = babelHelpers.interopRequireDefault(_Header); - - var _Footer = __webpack_require__(62); - - var _Footer2 = babelHelpers.interopRequireDefault(_Footer); - - var _Month = __webpack_require__(63); - - var _Month2 = babelHelpers.interopRequireDefault(_Month); - - var _Year = __webpack_require__(67); - - var _Year2 = babelHelpers.interopRequireDefault(_Year); - - var _Decade = __webpack_require__(68); - - var _Decade2 = babelHelpers.interopRequireDefault(_Decade); - - var _Century = __webpack_require__(69); - - var _Century2 = babelHelpers.interopRequireDefault(_Century); - - var _utilConfiguration = __webpack_require__(23); - - var _utilConfiguration2 = babelHelpers.interopRequireDefault(_utilConfiguration); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _uncontrollable = __webpack_require__(41); - - var _uncontrollable2 = babelHelpers.interopRequireDefault(_uncontrollable); - - var _SlideTransition = __webpack_require__(70); - - var _SlideTransition2 = babelHelpers.interopRequireDefault(_SlideTransition); - - var _utilDates = __webpack_require__(64); - - var _utilDates2 = babelHelpers.interopRequireDefault(_utilDates); - - var _utilConstants = __webpack_require__(66); - - var _utilConstants2 = babelHelpers.interopRequireDefault(_utilConstants); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - //values, omit - - var _utilWidgetHelpers = __webpack_require__(35); - - var _utilInteraction = __webpack_require__(45); - - var dir = _utilConstants2['default'].directions, - values = function values(obj) { - return Object.keys(obj).map(function (k) { - return obj[k]; - }); - }, - invert = function invert(obj) { - return _util_2['default'].transform(obj, function (o, val, key) { - o[val] = key; - }, {}); - }; - - var localizers = _utilConfiguration2['default'].locale, - views = _utilConstants2['default'].calendarViews, - VIEW_OPTIONS = values(views), - ALT_VIEW = invert(_utilConstants2['default'].calendarViewHierarchy), - NEXT_VIEW = _utilConstants2['default'].calendarViewHierarchy, - VIEW_UNIT = _utilConstants2['default'].calendarViewUnits, - VIEW = (_VIEW = {}, _VIEW[views.MONTH] = _Month2['default'], _VIEW[views.YEAR] = _Year2['default'], _VIEW[views.DECADE] = _Decade2['default'], _VIEW[views.CENTURY] = _Century2['default'], _VIEW); - - var ARROWS_TO_DIRECTION = { - ArrowDown: dir.DOWN, - ArrowUp: dir.UP, - ArrowRight: dir.RIGHT, - ArrowLeft: dir.LEFT - }; - - var OPPOSITE_DIRECTION = (_OPPOSITE_DIRECTION = {}, _OPPOSITE_DIRECTION[dir.LEFT] = dir.RIGHT, _OPPOSITE_DIRECTION[dir.RIGHT] = dir.LEFT, _OPPOSITE_DIRECTION); - - var MULTIPLIER = (_MULTIPLIER = {}, _MULTIPLIER[views.YEAR] = 1, _MULTIPLIER[views.DECADE] = 10, _MULTIPLIER[views.CENTURY] = 100, _MULTIPLIER); - - var format = function format(props, f) { - return props[f + 'Format'] || localizers.date.formats[f]; - }; - - var propTypes = { - - disabled: _utilPropTypes2['default'].disabled, - readOnly: _utilPropTypes2['default'].readOnly, - - onChange: _react2['default'].PropTypes.func, - value: _react2['default'].PropTypes.instanceOf(Date), - - min: _react2['default'].PropTypes.instanceOf(Date), - max: _react2['default'].PropTypes.instanceOf(Date), - - initialView: _react2['default'].PropTypes.oneOf(VIEW_OPTIONS), - - finalView: function finalView(props, propname, componentName) { - var err = _react2['default'].PropTypes.oneOf(VIEW_OPTIONS)(props, propname, componentName); - - if (err) return err; - if (VIEW_OPTIONS.indexOf(props[propname]) < VIEW_OPTIONS.indexOf(props.initialView)) return new Error(('The `' + propname + '` prop: `' + props[propname] + '` cannot be \'lower\' than the `initialView`\n prop. This creates a range that cannot be rendered.').replace(/\n\t/g, '')); - }, - - culture: _react2['default'].PropTypes.string, - - footer: _react2['default'].PropTypes.bool, - - dayComponent: _utilPropTypes2['default'].elementType, - headerFormat: _utilPropTypes2['default'].dateFormat, - footerFormat: _utilPropTypes2['default'].dateFormat, - - dayFormat: _utilPropTypes2['default'].dateFormat, - dateFormat: _utilPropTypes2['default'].dateFormat, - monthFormat: _utilPropTypes2['default'].dateFormat, - yearFormat: _utilPropTypes2['default'].dateFormat, - decadeFormat: _utilPropTypes2['default'].dateFormat, - centuryFormat: _utilPropTypes2['default'].dateFormat, - - messages: _react2['default'].PropTypes.shape({ - moveBack: _react2['default'].PropTypes.string, - moveForward: _react2['default'].PropTypes.string - }) - }; - - var Calendar = _react2['default'].createClass(babelHelpers.createDecoratedObject([{ - key: 'displayName', - initializer: function initializer() { - return 'Calendar'; - } - }, { - key: 'mixins', - initializer: function initializer() { - return [__webpack_require__(46), __webpack_require__(47), __webpack_require__(54), __webpack_require__(37)()]; - } - }, { - key: 'propTypes', - initializer: function initializer() { - return propTypes; - } - }, { - key: 'getInitialState', - value: function getInitialState() { - var value = this.inRangeValue(this.props.value); - - return { - selectedIndex: 0, - view: this.props.initialView || 'month', - currentDate: value ? new Date(value) : this.inRangeValue(new Date()) - }; - } - }, { - key: 'getDefaultProps', - value: function getDefaultProps() { - return { - - value: null, - min: new Date(1900, 0, 1), - max: new Date(2099, 11, 31), - - initialView: 'month', - finalView: 'century', - - tabIndex: '0', - footer: false, - - ariaActiveDescendantKey: 'calendar', - messages: msgs({}) - }; - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - var bottom = VIEW_OPTIONS.indexOf(nextProps.initialView), - top = VIEW_OPTIONS.indexOf(nextProps.finalView), - current = VIEW_OPTIONS.indexOf(this.state.view), - view = this.state.view, - val = this.inRangeValue(nextProps.value); - - if (current < bottom) this.setState({ view: view = nextProps.initialView });else if (current > top) this.setState({ view: view = nextProps.finalView }); - - //if the value changes reset views to the new one - if (!_utilDates2['default'].eq(val, dateOrNull(this.props.value), VIEW_UNIT[view])) this.setState({ - currentDate: val ? new Date(val) : new Date() - }); - } - }, { - key: 'render', - value: function render() { - var _this = this; - - var _props = this.props; - var className = _props.className; - var value = _props.value; - var footerFormat = _props.footerFormat; - var disabled = _props.disabled; - var readOnly = _props.readOnly; - var finalView = _props.finalView; - var footer = _props.footer; - var messages = _props.messages; - var min = _props.min; - var max = _props.max; - var culture = _props.culture; - var duration = _props.duration; - var _state = this.state; - var view = _state.view; - var currentDate = _state.currentDate; - var slideDirection = _state.slideDirection; - var focused = _state.focused; - - var View = VIEW[view], - unit = VIEW_UNIT[view], - todaysDate = new Date(), - todayNotInRange = !_utilDates2['default'].inRange(todaysDate, min, max, view); - - unit = unit === 'day' ? 'date' : unit; - - var viewID = _utilWidgetHelpers.instanceId(this, '_calendar'), - labelID = _utilWidgetHelpers.instanceId(this, '_calendar_label'), - key = view + '_' + _utilDates2['default'][view](currentDate); - - var elementProps = _util_2['default'].omit(this.props, Object.keys(propTypes)), - viewProps = _util_2['default'].pick(this.props, Object.keys(_utilCompat2['default'].type(View).propTypes)); - - var isDisabled = disabled || readOnly; - - messages = msgs(this.props.messages); - - return _react2['default'].createElement( - 'div', - babelHelpers._extends({}, elementProps, { - role: 'group', - onKeyDown: this._keyDown, - onFocus: this._focus.bind(null, true), - onBlur: this._focus.bind(null, false), - className: _classnames2['default'](className, 'rw-calendar', 'rw-widget', { - 'rw-state-focus': focused, - 'rw-state-disabled': disabled, - 'rw-state-readonly': readOnly, - 'rw-rtl': this.isRtl() - }) - }), - _react2['default'].createElement(_Header2['default'], { - label: this._label(), - labelId: labelID, - messages: messages, - upDisabled: isDisabled || view === finalView, - prevDisabled: isDisabled || !_utilDates2['default'].inRange(this.nextDate(dir.LEFT), min, max, view), - nextDisabled: isDisabled || !_utilDates2['default'].inRange(this.nextDate(dir.RIGHT), min, max, view), - onViewChange: this.navigate.bind(null, dir.UP, null), - onMoveLeft: this.navigate.bind(null, dir.LEFT, null), - onMoveRight: this.navigate.bind(null, dir.RIGHT, null) - }), - _react2['default'].createElement( - _SlideTransition2['default'], - { - ref: 'animation', - duration: duration, - direction: slideDirection, - onAnimate: function () { - return _this.focus(true); - } - }, - _react2['default'].createElement(View, babelHelpers._extends({}, viewProps, { - tabIndex: '-1', - key: key, - id: viewID, - className: 'rw-calendar-grid', - 'aria-labelledby': labelID, - today: todaysDate, - value: value, - focused: currentDate, - onChange: this.change, - onKeyDown: this._keyDown, - ariaActiveDescendantKey: 'calendarView' - })) - ), - footer && _react2['default'].createElement(_Footer2['default'], { - value: todaysDate, - format: footerFormat, - culture: culture, - disabled: disabled || todayNotInRange, - readOnly: readOnly, - onClick: this.select - }) - ); - } - }, { - key: 'navigate', - decorators: [_utilInteraction.widgetEditable], - value: function navigate(direction, date) { - var view = this.state.view, - slideDir = direction === dir.LEFT || direction === dir.UP ? 'right' : 'left'; - - if (!date) date = [dir.LEFT, dir.RIGHT].indexOf(direction) !== -1 ? this.nextDate(direction) : this.state.currentDate; - - if (direction === dir.DOWN) view = ALT_VIEW[view] || view; - - if (direction === dir.UP) view = NEXT_VIEW[view] || view; - - if (this.isValidView(view) && _utilDates2['default'].inRange(date, this.props.min, this.props.max, view)) { - _utilWidgetHelpers.notify(this.props.onNavigate, [date, slideDir, view]); - this.focus(true); - - this.setState({ - currentDate: date, - slideDirection: slideDir, - view: view - }); - } - } - }, { - key: 'focus', - value: function focus() { - if (+this.props.tabIndex > -1) _utilCompat2['default'].findDOMNode(this).focus(); - - //console.log(document.activeElement) - } - }, { - key: '_focus', - decorators: [_utilInteraction.widgetEnabled], - value: function _focus(focused, e) { - var _this2 = this; - - if (+this.props.tabIndex === -1) return; - - this.setTimeout('focus', function () { - if (focused !== _this2.state.focused) { - _utilWidgetHelpers.notify(_this2.props[focused ? 'onFocus' : 'onBlur'], e); - _this2.setState({ focused: focused }); - } - }); - } - }, { - key: 'change', - decorators: [_utilInteraction.widgetEditable], - value: function change(date) { - if (this.state.view === this.props.initialView) { - _utilWidgetHelpers.notify(this.props.onChange, date); - this.focus(); - return; - } - - this.navigate(dir.DOWN, date); - } - }, { - key: 'select', - decorators: [_utilInteraction.widgetEditable], - value: function select(date) { - var view = this.props.initialView, - slideDir = view !== this.state.view || _utilDates2['default'].gt(date, this.state.currentDate) ? 'left' // move down to a the view - : 'right'; - - _utilWidgetHelpers.notify(this.props.onChange, date); - - if (this.isValidView(view) && _utilDates2['default'].inRange(date, this.props.min, this.props.max, view)) { - this.focus(); - - this.setState({ - currentDate: date, - slideDirection: slideDir, - view: view - }); - } - } - }, { - key: 'nextDate', - value: function nextDate(direction) { - var method = direction === dir.LEFT ? 'subtract' : 'add', - view = this.state.view, - unit = view === views.MONTH ? view : views.YEAR, - multi = MULTIPLIER[view] || 1; - - return _utilDates2['default'][method](this.state.currentDate, 1 * multi, unit); - } - }, { - key: '_keyDown', - decorators: [_utilInteraction.widgetEditable], - value: function _keyDown(e) { - var ctrl = e.ctrlKey, - key = e.key, - direction = ARROWS_TO_DIRECTION[key], - current = this.state.currentDate, - view = this.state.view, - unit = VIEW_UNIT[view], - currentDate = current; - - if (key === 'Enter') { - e.preventDefault(); - return this.change(current); - } - - if (direction) { - if (ctrl) { - e.preventDefault(); - this.navigate(direction); - } else { - if (this.isRtl() && OPPOSITE_DIRECTION[direction]) direction = OPPOSITE_DIRECTION[direction]; - - currentDate = _utilDates2['default'].move(currentDate, this.props.min, this.props.max, view, direction); - - if (!_utilDates2['default'].eq(current, currentDate, unit)) { - e.preventDefault(); - - if (_utilDates2['default'].gt(currentDate, current, view)) this.navigate(dir.RIGHT, currentDate);else if (_utilDates2['default'].lt(currentDate, current, view)) this.navigate(dir.LEFT, currentDate);else this.setState({ currentDate: currentDate }); - } - } - } - - _utilWidgetHelpers.notify(this.props.onKeyDown, [e]); - } - }, { - key: '_label', - value: function _label() { - var _props2 = this.props; - var culture = _props2.culture; - var props = babelHelpers.objectWithoutProperties(_props2, ['culture']); - var view = this.state.view; - var dt = this.state.currentDate; - - if (view === 'month') return localizers.date.format(dt, format(props, 'header'), culture);else if (view === 'year') return localizers.date.format(dt, format(props, 'year'), culture);else if (view === 'decade') return localizers.date.format(_utilDates2['default'].startOf(dt, 'decade'), format(props, 'decade'), culture);else if (view === 'century') return localizers.date.format(_utilDates2['default'].startOf(dt, 'century'), format(props, 'century'), culture); - } - }, { - key: 'inRangeValue', - value: function inRangeValue(_value) { - var value = dateOrNull(_value); - - if (value === null) return value; - - return _utilDates2['default'].max(_utilDates2['default'].min(value, this.props.max), this.props.min); - } - }, { - key: 'isValidView', - value: function isValidView(next) { - var bottom = VIEW_OPTIONS.indexOf(this.props.initialView), - top = VIEW_OPTIONS.indexOf(this.props.finalView), - current = VIEW_OPTIONS.indexOf(next); - - return current >= bottom && current <= top; - } - }])); - - function dateOrNull(dt) { - if (dt && !isNaN(dt.getTime())) return dt; - return null; - } - - function msgs(msgs) { - return babelHelpers._extends({ - moveBack: 'navigate back', - moveForward: 'navigate forward' - }, msgs); - } - - exports['default'] = _uncontrollable2['default'](Calendar, { value: 'onChange' }); - module.exports = exports['default']; - -/***/ }, -/* 60 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - var React = __webpack_require__(4), - Btn = __webpack_require__(56); - - module.exports = React.createClass({ - displayName: 'exports', - - propTypes: { - label: React.PropTypes.string.isRequired, - labelId: React.PropTypes.string, - - upDisabled: React.PropTypes.bool.isRequired, - prevDisabled: React.PropTypes.bool.isRequired, - nextDisabled: React.PropTypes.bool.isRequired, - onViewChange: React.PropTypes.func.isRequired, - onMoveLeft: React.PropTypes.func.isRequired, - onMoveRight: React.PropTypes.func.isRequired, - - messages: React.PropTypes.shape({ - moveBack: React.PropTypes.string, - moveForward: React.PropTypes.string - }) - }, - - mixins: [__webpack_require__(47), __webpack_require__(61)], - - getDefaultProps: function getDefaultProps() { - return { - messages: { - moveBack: 'navigate back', - moveForward: 'navigate forward' - } - }; - }, - - render: function render() { - var _props = this.props; - var messages = _props.messages; - var label = _props.label; - var labelId = _props.labelId; - var onMoveRight = _props.onMoveRight; - var onMoveLeft = _props.onMoveLeft; - var onViewChange = _props.onViewChange; - var prevDisabled = _props.prevDisabled; - var upDisabled = _props.upDisabled; - var nextDisabled = _props.nextDisabled; - - var rtl = this.isRtl(); - - return React.createElement( - 'div', - { className: 'rw-header' }, - React.createElement( - Btn, - { className: 'rw-btn-left', - tabIndex: '-1', - onClick: onMoveLeft, - disabled: prevDisabled, - 'aria-disabled': prevDisabled, - 'aria-label': messages.moveBack, - title: messages.moveBack - }, - React.createElement('i', { 'aria-hidden': 'false', - className: 'rw-i rw-i-caret-' + (rtl ? 'right' : 'left') - }) - ), - React.createElement( - Btn, - { - id: labelId, - tabIndex: '-1', - className: 'rw-btn-view', - disabled: upDisabled, - 'aria-disabled': upDisabled, - 'aria-live': 'polite', - 'aria-atomic': 'true', - onClick: onViewChange - }, - label - ), - React.createElement( - Btn, - { className: 'rw-btn-right', - tabIndex: '-1', - onClick: onMoveRight, - disabled: nextDisabled, - title: messages.moveForward, - 'aria-label': messages.moveForward, - 'aria-disabled': nextDisabled - }, - React.createElement('i', { 'aria-hidden': 'false', - className: 'rw-i rw-i-caret-' + (rtl ? 'left' : 'right') - }) - ) - ); - } - }); - -/***/ }, -/* 61 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - exports['default'] = { - - contextTypes: { - isRtl: _react2['default'].PropTypes.bool - }, - - isRtl: function isRtl() { - return !!this.context.isRtl; - } - - }; - module.exports = exports['default']; - -/***/ }, -/* 62 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var React = __webpack_require__(4), - Btn = __webpack_require__(56), - localizers = __webpack_require__(23).locale; - - var format = function format(props) { - return props.format || localizers.date.formats.footer; - }; - - module.exports = React.createClass({ - - displayName: 'Footer', - - render: function render() { - var now = this.props.value, - formatted = localizers.date.format(now, format(this.props), this.props.culture); - - return React.createElement( - 'div', - { className: 'rw-footer' }, - React.createElement( - Btn, - { tabIndex: '-1', - 'aria-disabled': !!this.props.disabled, - 'aria-readonly': !!this.props.readOnly, - disabled: this.props.disabled, - readOnly: this.props.readOnly, - onClick: this.props.onClick.bind(null, now) - }, - formatted - ) - ); - } - - }); - -/***/ }, -/* 63 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _utilDates = __webpack_require__(64); - - var _utilDates2 = babelHelpers.interopRequireDefault(_utilDates); - - var _utilConfiguration = __webpack_require__(23); - - var _utilConfiguration2 = babelHelpers.interopRequireDefault(_utilConfiguration); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _utilWidgetHelpers = __webpack_require__(35); - - var localizers = _utilConfiguration2['default'].locale, - dayFormat = function dayFormat(props) { - return props.dayFormat || localizers.date.formats.weekday; - }, - dateFormat = function dateFormat(props) { - return props.dateFormat || localizers.date.formats.dayOfMonth; - }; - - var optionId = function optionId(id, date) { - return id + '__month_' + _utilDates2['default'].month(date) + '-' + _utilDates2['default'].date(date); - }; - - var propTypes = { - optionID: _react2['default'].PropTypes.func, - - culture: _react2['default'].PropTypes.string, - value: _react2['default'].PropTypes.instanceOf(Date), - focused: _react2['default'].PropTypes.instanceOf(Date), - min: _react2['default'].PropTypes.instanceOf(Date), - max: _react2['default'].PropTypes.instanceOf(Date), - - dayComponent: _utilPropTypes2['default'].elementType, - - dayFormat: _utilPropTypes2['default'].dateFormat, - dateFormat: _utilPropTypes2['default'].dateFormat, - footerFormat: _utilPropTypes2['default'].dateFormat, - - onChange: _react2['default'].PropTypes.func.isRequired - }; - - var isEqual = function isEqual(dateA, dateB) { - return _utilDates2['default'].eq(dateA, dateB, 'day'); - }; - - var MonthView = _react2['default'].createClass({ - - displayName: 'MonthView', - - statics: { - isEqual: isEqual - }, - - mixins: [__webpack_require__(61), __webpack_require__(37)()], - - propTypes: propTypes, - - componentDidUpdate: function componentDidUpdate() { - var activeId = optionId(_utilWidgetHelpers.instanceId(this), this.props.focused); - this.ariaActiveDescendant(activeId, null); - }, - - render: function render() { - var _props = this.props; - var focused = _props.focused; - var culture = _props.culture; - var month = _utilDates2['default'].visibleDays(focused, culture); - var rows = _util_2['default'].chunk(month, 7); - - var elementProps = _util_2['default'].omit(this.props, Object.keys(propTypes)); - - return _react2['default'].createElement( - 'table', - babelHelpers._extends({}, elementProps, { - role: 'grid' - }), - _react2['default'].createElement( - 'thead', - null, - _react2['default'].createElement( - 'tr', - null, - this._headers(dayFormat(this.props), culture) - ) - ), - _react2['default'].createElement( - 'tbody', - null, - rows.map(this._row) - ) - ); - }, - - _row: function _row(row, rowIdx) { - var _this = this; - - var _props2 = this.props; - var focused = _props2.focused; - var today = _props2.today; - var disabled = _props2.disabled; - var onChange = _props2.onChange; - var value = _props2.value; - var culture = _props2.culture; - var min = _props2.min; - var max = _props2.max; - var Day = _props2.dayComponent; - var id = _utilWidgetHelpers.instanceId(this); - var labelFormat = localizers.date.formats.footer; - - return _react2['default'].createElement( - 'tr', - { key: 'week_' + rowIdx, role: 'row' }, - row.map(function (day, colIdx) { - - var isFocused = isEqual(day, focused), - isSelected = isEqual(day, value), - isToday = isEqual(day, today), - date = localizers.date.format(day, dateFormat(_this.props), culture), - label = localizers.date.format(day, labelFormat, culture); - - var currentID = optionId(id, day); - - return !_utilDates2['default'].inRange(day, min, max) ? _react2['default'].createElement( - 'td', - { key: 'day_' + colIdx, role: 'presentation', className: 'rw-empty-cell' }, - ' ' - ) : _react2['default'].createElement( - 'td', - { - key: 'day_' + colIdx, - role: 'gridcell', - id: currentID, - title: label, - 'aria-selected': isSelected, - 'aria-label': label, - 'aria-readonly': disabled - }, - _react2['default'].createElement( - 'span', - { - 'aria-labelledby': currentID, - onClick: onChange.bind(null, day), - className: _classnames2['default']('rw-btn', { - 'rw-off-range': _utilDates2['default'].month(day) !== _utilDates2['default'].month(focused), - 'rw-state-focus': isFocused, - 'rw-state-selected': isSelected, - 'rw-now': isToday - }) - }, - Day ? _react2['default'].createElement(Day, { date: day, label: date }) : date - ) - ); - }) - ); - }, - - _headers: function _headers(format, culture) { - return [0, 1, 2, 3, 4, 5, 6].map(function (day) { - return _react2['default'].createElement( - 'th', - { key: 'header_' + day }, - localizers.date.format(day, format, culture) - ); - }); - } - - }); - - exports['default'] = MonthView; - module.exports = exports['default']; - -/***/ }, -/* 64 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var dateMath = __webpack_require__(65); - - var _require = __webpack_require__(66); - - var directions = _require.directions; - var calendarViewUnits = _require.calendarViewUnits; - var locale = __webpack_require__(23).locale; - - var dates = module.exports = babelHelpers._extends(dateMath, { - - parse: function parse(date, format, culture) { - return locale.date.parse(date, format, culture); - }, - - format: function format(date, _format, culture) { - return locale.date.format(date, _format, culture); - }, - - monthsInYear: function monthsInYear(year) { - var months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], - date = new Date(year, 0, 1); - - return months.map(function (i) { - return dates.month(date, i); - }); - }, - - firstVisibleDay: function firstVisibleDay(date, culture) { - var firstOfMonth = dates.startOf(date, 'month'); - - return dates.startOf(firstOfMonth, 'week', locale.date.startOfWeek(culture)); - }, - - lastVisibleDay: function lastVisibleDay(date, culture) { - var endOfMonth = dates.endOf(date, 'month'); - - return dates.endOf(endOfMonth, 'week', locale.date.startOfWeek(culture)); - }, - - visibleDays: function visibleDays(date, culture) { - var current = dates.firstVisibleDay(date, culture), - last = dates.lastVisibleDay(date, culture), - days = []; - - while (dates.lte(current, last, 'day')) { - days.push(current); - current = dates.add(current, 1, 'day'); - } - - return days; - }, - - move: function move(date, min, max, unit, direction) { - var isMonth = unit === 'month', - isUpOrDown = direction === directions.UP || direction === directions.DOWN, - rangeUnit = calendarViewUnits[unit], - addUnit = isMonth && isUpOrDown ? 'week' : calendarViewUnits[unit], - amount = isMonth || !isUpOrDown ? 1 : 4, - newDate; - - if (direction === directions.UP || direction === directions.LEFT) amount *= -1; - - newDate = dates.add(date, amount, addUnit); - - return dates.inRange(newDate, min, max, rangeUnit) ? newDate : date; - }, - - merge: function merge(date, time) { - if (time == null && date == null) return null; - - if (time == null) time = new Date(); - if (date == null) date = new Date(); - - date = dates.startOf(date, 'day'); - date = dates.hours(date, dates.hours(time)); - date = dates.minutes(date, dates.minutes(time)); - date = dates.seconds(date, dates.seconds(time)); - return dates.milliseconds(date, dates.milliseconds(time)); - }, - - sameMonth: function sameMonth(dateA, dateB) { - return dates.eq(dateA, dateB, 'month'); - }, - - today: function today() { - return this.startOf(new Date(), 'day'); - }, - - yesterday: function yesterday() { - return this.add(this.startOf(new Date(), 'day'), -1, 'day'); - }, - - tomorrow: function tomorrow() { - return this.add(this.startOf(new Date(), 'day'), 1, 'day'); - } - }); - -/***/ }, -/* 65 */ -/***/ function(module, exports) { - - var MILI = 'milliseconds' - , SECONDS = 'seconds' - , MINUTES = 'minutes' - , HOURS = 'hours' - , DAY = 'day' - , WEEK = 'week' - , MONTH = 'month' - , YEAR = 'year' - , DECADE = 'decade' - , CENTURY = 'century'; - - var dates = module.exports = { - - add: function(date, num, unit) { - date = new Date(date) - - switch (unit){ - case MILI: - case SECONDS: - case MINUTES: - case HOURS: - case YEAR: - return dates[unit](date, dates[unit](date) + num) - case DAY: - return dates.date(date, dates.date(date) + num) - case WEEK: - return dates.date(date, dates.date(date) + (7 * num)) - case MONTH: - return monthMath(date, num) - case DECADE: - return dates.year(date, dates.year(date) + (num * 10)) - case CENTURY: - return dates.year(date, dates.year(date) + (num * 100)) - } - - throw new TypeError('Invalid units: "' + unit + '"') - }, - - subtract: function(date, num, unit) { - return dates.add(date, -num, unit) - }, - - startOf: function(date, unit, firstOfWeek) { - date = new Date(date) - - switch (unit) { - case 'century': - case 'decade': - case 'year': - date = dates.month(date, 0); - case 'month': - date = dates.date(date, 1); - case 'week': - case 'day': - date = dates.hours(date, 0); - case 'hours': - date = dates.minutes(date, 0); - case 'minutes': - date = dates.seconds(date, 0); - case 'seconds': - date = dates.milliseconds(date, 0); - } - - if (unit === DECADE) - date = dates.subtract(date, dates.year(date) % 10, 'year') - - if (unit === CENTURY) - date = dates.subtract(date, dates.year(date) % 100, 'year') - - if (unit === WEEK) - date = dates.weekday(date, 0, firstOfWeek); - - return date - }, - - - endOf: function(date, unit, firstOfWeek){ - date = new Date(date) - date = dates.startOf(date, unit, firstOfWeek) - date = dates.add(date, 1, unit) - date = dates.subtract(date, 1, MILI) - return date - }, - - eq: createComparer(function(a, b){ return a === b }), - neq: createComparer(function(a, b){ return a !== b }), - gt: createComparer(function(a, b){ return a > b }), - gte: createComparer(function(a, b){ return a >= b }), - lt: createComparer(function(a, b){ return a < b }), - lte: createComparer(function(a, b){ return a <= b }), - - min: function(){ - return new Date(Math.min.apply(Math, arguments)) - }, - - max: function(){ - return new Date(Math.max.apply(Math, arguments)) - }, - - inRange: function(day, min, max, unit){ - unit = unit || 'day' - - return (!min || dates.gte(day, min, unit)) - && (!max || dates.lte(day, max, unit)) - }, - - milliseconds: createAccessor('Milliseconds'), - seconds: createAccessor('Seconds'), - minutes: createAccessor('Minutes'), - hours: createAccessor('Hours'), - day: createAccessor('Day'), - date: createAccessor('Date'), - month: createAccessor('Month'), - year: createAccessor('FullYear'), - - decade: function (date, val) { - return val === undefined - ? dates.year(dates.startOf(date, DECADE)) - : dates.add(date, val + 10, YEAR); - }, - - century: function (date, val) { - return val === undefined - ? dates.year(dates.startOf(date, CENTURY)) - : dates.add(date, val + 100, YEAR); - }, - - weekday: function (date, val, firstDay) { - var weekday = (dates.day(date) + 7 - (firstDay || 0) ) % 7; - - return val === undefined - ? weekday - : dates.add(date, val - weekday, DAY); - } - } - - - function monthMath(date, val){ - var current = dates.month(date) - , newMonth = (current + val); - - date = dates.month(date, newMonth) - - if (newMonth < 0 ) newMonth = 12 + val - - //month rollover - if ( dates.month(date) !== ( newMonth % 12)) - date = dates.date(date, 0) //move to last of month - - return date - } - - function createAccessor(method){ - return function(date, val){ - if (val === undefined) - return date['get' + method]() - - date = new Date(date) - date['set' + method](val) - return date - } - } - - function createComparer(operator) { - return function (a, b, unit) { - return operator(+dates.startOf(a, unit), +dates.startOf(b, unit)) - }; - } - - -/***/ }, -/* 66 */ -/***/ function(module, exports) { - - 'use strict'; - - var _calendarViewHierarchy, _calendarViewUnits; - - var views = { - MONTH: 'month', - YEAR: 'year', - DECADE: 'decade', - CENTURY: 'century' - }; - - module.exports = { - - directions: { - LEFT: 'LEFT', - RIGHT: 'RIGHT', - UP: 'UP', - DOWN: 'DOWN' - }, - - datePopups: { - TIME: 'time', - CALENDAR: 'calendar' - }, - - calendarViews: views, - - calendarViewHierarchy: (_calendarViewHierarchy = {}, _calendarViewHierarchy[views.MONTH] = views.YEAR, _calendarViewHierarchy[views.YEAR] = views.DECADE, _calendarViewHierarchy[views.DECADE] = views.CENTURY, _calendarViewHierarchy), - - calendarViewUnits: (_calendarViewUnits = {}, _calendarViewUnits[views.MONTH] = 'day', _calendarViewUnits[views.YEAR] = views.MONTH, _calendarViewUnits[views.DECADE] = views.YEAR, _calendarViewUnits[views.CENTURY] = views.DECADE, _calendarViewUnits) - }; - -/***/ }, -/* 67 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _utilDates = __webpack_require__(64); - - var _utilDates2 = babelHelpers.interopRequireDefault(_utilDates); - - var _utilConfiguration = __webpack_require__(23); - - var _utilConfiguration2 = babelHelpers.interopRequireDefault(_utilConfiguration); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _utilWidgetHelpers = __webpack_require__(35); - - var localizers = _utilConfiguration2['default'].locale; - var format = function format(props) { - return props.monthFormat || localizers.date.formats.month; - }; - - var propTypes = { - optionID: _react2['default'].PropTypes.func, - culture: _react2['default'].PropTypes.string, - value: _react2['default'].PropTypes.instanceOf(Date), - focused: _react2['default'].PropTypes.instanceOf(Date), - min: _react2['default'].PropTypes.instanceOf(Date), - max: _react2['default'].PropTypes.instanceOf(Date), - onChange: _react2['default'].PropTypes.func.isRequired, - - monthFormat: _utilPropTypes2['default'].dateFormat - }; - - var isEqual = function isEqual(dateA, dateB) { - return _utilDates2['default'].eq(dateA, dateB, 'month'); - }; - var optionId = function optionId(id, date) { - return id + '__year_' + _utilDates2['default'].year(date) + '-' + _utilDates2['default'].month(date); - }; - - var YearView = _react2['default'].createClass({ - - displayName: 'YearView', - - mixins: [__webpack_require__(61), __webpack_require__(37)()], - - propTypes: propTypes, - - componentDidUpdate: function componentDidUpdate() { - var activeId = optionId(_utilWidgetHelpers.instanceId(this), this.props.focused); - this.ariaActiveDescendant(activeId); - }, - - render: function render() { - var _props = this.props; - var className = _props.className; - var focused = _props.focused; - var months = _utilDates2['default'].monthsInYear(_utilDates2['default'].year(focused)); - var rows = _util_2['default'].chunk(months, 4); - - var elementProps = _util_2['default'].omit(this.props, Object.keys(propTypes)); - - return _react2['default'].createElement( - 'table', - babelHelpers._extends({}, elementProps, { - role: 'grid', - className: _classnames2['default'](className, 'rw-nav-view') - }), - _react2['default'].createElement( - 'tbody', - null, - rows.map(this._row) - ) - ); - }, - - _row: function _row(row, rowIdx) { - var _this = this; - - var _props2 = this.props; - var focused = _props2.focused; - var disabled = _props2.disabled; - var onChange = _props2.onChange; - var value = _props2.value; - var today = _props2.today; - var culture = _props2.culture; - var min = _props2.min; - var max = _props2.max; - var id = _utilWidgetHelpers.instanceId(this); - var labelFormat = localizers.date.formats.header; - - return _react2['default'].createElement( - 'tr', - { key: rowIdx, role: 'row' }, - row.map(function (date, colIdx) { - var isFocused = isEqual(date, focused), - isSelected = isEqual(date, value), - currentMonth = isEqual(date, today), - label = localizers.date.format(date, labelFormat, culture); - - var currentID = optionId(id, date); - - return _utilDates2['default'].inRange(date, min, max, 'month') ? _react2['default'].createElement( - 'td', - { - key: colIdx, - role: 'gridcell', - id: currentID, - title: label, - 'aria-selected': isSelected, - 'aria-readonly': disabled, - 'aria-label': label - }, - _react2['default'].createElement( - 'span', - { - 'aria-labelledby': currentID, - onClick: onChange.bind(null, date), - className: _classnames2['default']('rw-btn', { - 'rw-state-focus': isFocused, - 'rw-state-selected': isSelected, - 'rw-now': currentMonth - }) - }, - localizers.date.format(date, format(_this.props), culture) - ) - ) : _react2['default'].createElement( - 'td', - { key: colIdx, className: 'rw-empty-cell', role: 'presentation' }, - ' ' - ); - }) - ); - } - - }); - - exports['default'] = YearView; - module.exports = exports['default']; - -/***/ }, -/* 68 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _utilDates = __webpack_require__(64); - - var _utilDates2 = babelHelpers.interopRequireDefault(_utilDates); - - var _utilConfiguration = __webpack_require__(23); - - var _utilConfiguration2 = babelHelpers.interopRequireDefault(_utilConfiguration); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _utilWidgetHelpers = __webpack_require__(35); - - var localizers = _utilConfiguration2['default'].locale; - - var format = function format(props) { - return props.yearFormat || localizers.date.formats.year; - }; - - var propTypes = { - optionID: _react2['default'].PropTypes.func, - culture: _react2['default'].PropTypes.string, - - value: _react2['default'].PropTypes.instanceOf(Date), - focused: _react2['default'].PropTypes.instanceOf(Date), - min: _react2['default'].PropTypes.instanceOf(Date), - max: _react2['default'].PropTypes.instanceOf(Date), - onChange: _react2['default'].PropTypes.func.isRequired, - - yearFormat: _utilPropTypes2['default'].dateFormat - }; - - var isEqual = function isEqual(dataA, dateB) { - return _utilDates2['default'].eq(dataA, dateB, 'year'); - }; - var optionId = function optionId(id, date) { - return id + '__decade_' + _utilDates2['default'].year(date); - }; - - exports['default'] = _react2['default'].createClass({ - - displayName: 'DecadeView', - - mixins: [__webpack_require__(47), __webpack_require__(61), __webpack_require__(37)()], - - propTypes: propTypes, - - componentDidUpdate: function componentDidUpdate() { - var activeId = optionId(_utilWidgetHelpers.instanceId(this), this.props.focused); - this.ariaActiveDescendant(activeId); - }, - - render: function render() { - var _props = this.props; - var className = _props.className; - var focused = _props.focused; - var years = getDecadeYears(focused); - var rows = _util_2['default'].chunk(years, 4); - - var elementProps = _util_2['default'].omit(this.props, Object.keys(propTypes)); - - return _react2['default'].createElement( - 'table', - babelHelpers._extends({}, elementProps, { - role: 'grid', - className: _classnames2['default'](className, 'rw-nav-view') - }), - _react2['default'].createElement( - 'tbody', - null, - rows.map(this._row) - ) - ); - }, - - _row: function _row(row, rowIdx) { - var _this = this; - - var _props2 = this.props; - var focused = _props2.focused; - var disabled = _props2.disabled; - var onChange = _props2.onChange; - var value = _props2.value; - var today = _props2.today; - var culture = _props2.culture; - var min = _props2.min; - var max = _props2.max; - var id = _utilWidgetHelpers.instanceId(this); - - return _react2['default'].createElement( - 'tr', - { key: 'row_' + rowIdx, role: 'row' }, - row.map(function (date, colIdx) { - var isFocused = isEqual(date, focused), - isSelected = isEqual(date, value), - currentYear = isEqual(date, today), - label = localizers.date.format(date, format(_this.props), culture); - - var currentID = optionId(id, date); - - return !_utilDates2['default'].inRange(date, min, max, 'year') ? _react2['default'].createElement( - 'td', - { key: colIdx, role: 'presentation', className: 'rw-empty-cell' }, - ' ' - ) : _react2['default'].createElement( - 'td', - { - key: colIdx, - role: 'gridcell', - id: currentID, - title: label, - 'aria-selected': isSelected, - 'aria-label': label, - 'aria-readonly': disabled - }, - _react2['default'].createElement( - 'span', - { - 'aria-labelledby': currentID, - onClick: onChange.bind(null, date), - className: _classnames2['default']('rw-btn', { - 'rw-off-range': !inDecade(date, focused), - 'rw-state-focus': isFocused, - 'rw-state-selected': isSelected, - 'rw-now': currentYear - }) - }, - label - ) - ); - }) - ); - } - }); - - function inDecade(date, start) { - return _utilDates2['default'].gte(date, _utilDates2['default'].startOf(start, 'decade'), 'year') && _utilDates2['default'].lte(date, _utilDates2['default'].endOf(start, 'decade'), 'year'); - } - - function getDecadeYears(_date) { - var days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], - date = _utilDates2['default'].add(_utilDates2['default'].startOf(_date, 'decade'), -2, 'year'); - - return days.map(function () { - return date = _utilDates2['default'].add(date, 1, 'year'); - }); - } - module.exports = exports['default']; - -/***/ }, -/* 69 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _utilDates = __webpack_require__(64); - - var _utilDates2 = babelHelpers.interopRequireDefault(_utilDates); - - var _utilConfiguration = __webpack_require__(23); - - var _utilConfiguration2 = babelHelpers.interopRequireDefault(_utilConfiguration); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _utilWidgetHelpers = __webpack_require__(35); - - var localizers = _utilConfiguration2['default'].locale; - var format = function format(props) { - return props.decadeFormat || localizers.date.formats.decade; - }; - - var isEqual = function isEqual(dateA, dateB) { - return _utilDates2['default'].eq(dateA, dateB, 'decade'); - }; - var optionId = function optionId(id, date) { - return id + '__century_' + _utilDates2['default'].year(date); - }; - - var propTypes = { - optionID: _react2['default'].PropTypes.func, - culture: _react2['default'].PropTypes.string, - value: _react2['default'].PropTypes.instanceOf(Date), - min: _react2['default'].PropTypes.instanceOf(Date), - max: _react2['default'].PropTypes.instanceOf(Date), - - onChange: _react2['default'].PropTypes.func.isRequired, - decadeFormat: _utilPropTypes2['default'].dateFormat - }; - - exports['default'] = _react2['default'].createClass({ - - displayName: 'CenturyView', - - mixins: [__webpack_require__(47), __webpack_require__(61), __webpack_require__(37)()], - - propTypes: propTypes, - - componentDidUpdate: function componentDidUpdate() { - var activeId = optionId(_utilWidgetHelpers.instanceId(this), this.props.focused); - this.ariaActiveDescendant(activeId); - }, - - render: function render() { - var _props = this.props; - var className = _props.className; - var focused = _props.focused; - var years = getCenturyDecades(focused); - var rows = _util_2['default'].chunk(years, 4); - - var elementProps = _util_2['default'].omit(this.props, Object.keys(propTypes)); - - return _react2['default'].createElement( - 'table', - babelHelpers._extends({}, elementProps, { - role: 'grid', - className: _classnames2['default'](className, 'rw-nav-view') - }), - _react2['default'].createElement( - 'tbody', - null, - rows.map(this._row) - ) - ); - }, - - _row: function _row(row, rowIdx) { - var _this = this; - - var _props2 = this.props; - var focused = _props2.focused; - var disabled = _props2.disabled; - var onChange = _props2.onChange; - var value = _props2.value; - var today = _props2.today; - var culture = _props2.culture; - var min = _props2.min; - var max = _props2.max; - var id = _utilWidgetHelpers.instanceId(this, '_century'); - - return _react2['default'].createElement( - 'tr', - { key: 'row_' + rowIdx, role: 'row' }, - row.map(function (date, colIdx) { - var isFocused = isEqual(date, focused), - isSelected = isEqual(date, value), - currentDecade = isEqual(date, today), - label = localizers.date.format(_utilDates2['default'].startOf(date, 'decade'), format(_this.props), culture); - - var currentID = optionId(id, date); - - return !inRange(date, min, max) ? _react2['default'].createElement( - 'td', - { key: colIdx, role: 'gridcell', className: 'rw-empty-cell' }, - ' ' - ) : _react2['default'].createElement( - 'td', - { - key: colIdx, - role: 'gridcell', - id: currentID, - title: label, - 'aria-selected': isSelected, - 'aria-label': label, - 'aria-readonly': disabled - }, - _react2['default'].createElement( - 'span', - { - 'aria-labelledby': currentID, - onClick: onChange.bind(null, inRangeDate(date, min, max)), - className: _classnames2['default']('rw-btn', { - 'rw-off-range': !inCentury(date, focused), - 'rw-state-focus': isFocused, - 'rw-state-selected': isSelected, - 'rw-now': currentDecade - }) - }, - label - ) - ); - }) - ); - } - - }); - - function inRangeDate(decade, min, max) { - return _utilDates2['default'].max(_utilDates2['default'].min(decade, max), min); - } - - function inRange(decade, min, max) { - return _utilDates2['default'].gte(decade, _utilDates2['default'].startOf(min, 'decade'), 'year') && _utilDates2['default'].lte(decade, _utilDates2['default'].endOf(max, 'decade'), 'year'); - } - - function inCentury(date, start) { - return _utilDates2['default'].gte(date, _utilDates2['default'].startOf(start, 'century'), 'year') && _utilDates2['default'].lte(date, _utilDates2['default'].endOf(start, 'century'), 'year'); - } - - function getCenturyDecades(_date) { - var days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], - date = _utilDates2['default'].add(_utilDates2['default'].startOf(_date, 'century'), -20, 'year'); - - return days.map(function () { - return date = _utilDates2['default'].add(date, 10, 'year'); - }); - } - module.exports = exports['default']; - -/***/ }, -/* 70 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var React = __webpack_require__(4), - ReplaceTransitionGroup = __webpack_require__(71), - compat = __webpack_require__(28), - css = __webpack_require__(13), - getWidth = __webpack_require__(72), - config = __webpack_require__(23); - - var SlideChildGroup = React.createClass({ - displayName: 'SlideChildGroup', - - propTypes: { - direction: React.PropTypes.oneOf(['left', 'right']), - duration: React.PropTypes.number - }, - - componentWillEnter: function componentWillEnter(done) { - var _this = this; - - var node = compat.findDOMNode(this), - width = getWidth(node), - direction = this.props.direction; - - width = direction === 'left' ? width : -width; - - this.ORGINAL_POSITION = node.style.position; - - css(node, { position: 'absolute', left: width + 'px', top: 0 }); - - config.animate(node, { left: 0 }, this.props.duration, function () { - - css(node, { - position: _this.ORGINAL_POSITION, - overflow: 'hidden' - }); - - _this.ORGINAL_POSITION = null; - done && done(); - }); - }, - - componentWillLeave: function componentWillLeave(done) { - var _this2 = this; - - var node = compat.findDOMNode(this), - width = getWidth(node), - direction = this.props.direction; - - width = direction === 'left' ? -width : width; - - this.ORGINAL_POSITION = node.style.position; - - css(node, { position: 'absolute', top: 0, left: 0 }); - - config.animate(node, { left: width + 'px' }, this.props.duration, function () { - css(node, { - position: _this2.ORGINAL_POSITION, - overflow: 'hidden' - }); - - _this2.ORGINAL_POSITION = null; - done && done(); - }); - }, - - render: function render() { - return React.Children.only(this.props.children); - } - - }); - - module.exports = React.createClass({ - displayName: 'exports', - - propTypes: { - direction: React.PropTypes.oneOf(['left', 'right']), - duration: React.PropTypes.number - }, - - getDefaultProps: function getDefaultProps() { - return { - direction: 'left', - duration: 250 - }; - }, - - _wrapChild: function _wrapChild(child, ref) { - return React.createElement( - SlideChildGroup, - { key: child.key, ref: ref, - direction: this.props.direction, - duration: this.props.duration }, - child - ); - }, - - render: function render() { - var _props = this.props; - var style = _props.style; - var children = _props.children; - var props = babelHelpers.objectWithoutProperties(_props, ['style', 'children']); - - style = babelHelpers._extends({}, style, { position: 'relative', overflow: 'hidden' }); - - return React.createElement( - ReplaceTransitionGroup, - babelHelpers._extends({}, props, { - ref: 'container', - childFactory: this._wrapChild, - style: style, - component: 'div' }), - children - ); - }, - - isTransitioning: function isTransitioning() { - return this.isMounted() && this.refs.container.isTransitioning(); - } - }); - -/***/ }, -/* 71 */ -/***/ function(module, exports, __webpack_require__) { - - /** - * A streamlined version of TransitionGroup built for managing at most two active children - * also provides additional hooks for animation start/end - * https://github.com/facebook/react/blob/master/src/addons/transitions/ReactTransitionGroup.js - * relevent code is licensed accordingly - */ - 'use strict'; - - var React = __webpack_require__(4), - css = __webpack_require__(13), - height = __webpack_require__(20), - width = __webpack_require__(72), - compat = __webpack_require__(28), - _ = __webpack_require__(11); - - module.exports = React.createClass({ - - displayName: 'ReplaceTransitionGroup', - - propTypes: { - component: React.PropTypes.oneOfType([React.PropTypes.element, React.PropTypes.string]), - childFactory: React.PropTypes.func, - - onAnimating: React.PropTypes.func, - onAnimate: React.PropTypes.func - }, - - getDefaultProps: function getDefaultProps() { - return { - component: 'span', - childFactory: function childFactory(a) { - return a; - }, - - onAnimating: _.noop, - onAnimate: _.noop - }; - }, - - getInitialState: function getInitialState() { - return { - children: _.splat(this.props.children) - }; - }, - - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - var nextChild = getChild(nextProps.children), - stack = this.state.children.slice(), - next = stack[1], - last = stack[0]; - - var isLastChild = last && key(last) === key(nextChild), - isNextChild = next && key(next) === key(nextChild); - - //no children - if (!last) { - stack.push(nextChild); - this.entering = nextChild; - } else if (last && !next && !isLastChild) { - //new child - stack.push(nextChild); - this.leaving = last; - this.entering = nextChild; - } else if (last && next && !isLastChild && !isNextChild) { - // the child is not the current one, exit the current one, add the new one - // - shift the stack down - stack.shift(); - stack.push(nextChild); - this.leaving = next; - this.entering = nextChild; - } - //new child that just needs to be re-rendered - else if (isLastChild) stack.splice(0, 1, nextChild);else if (isNextChild) stack.splice(1, 1, nextChild); - - if (this.state.children[0] !== stack[0] || this.state.children[1] !== stack[1]) this.setState({ children: stack }); - }, - - componentWillMount: function componentWillMount() { - this.animatingKeys = {}; - this.leaving = null; - this.entering = null; - }, - - componentDidUpdate: function componentDidUpdate() { - var entering = this.entering, - leaving = this.leaving, - first = this.refs[key(entering) || key(leaving)], - node = compat.findDOMNode(this), - el = first && compat.findDOMNode(first); - - if (el) css(node, { - overflow: 'hidden', - height: height(el) + 'px', - width: width(el) + 'px' - }); - - this.props.onAnimating(); - - this.entering = null; - this.leaving = null; - - if (entering) this.performEnter(key(entering)); - if (leaving) this.performLeave(key(leaving)); - }, - - performEnter: function performEnter(key) { - var component = this.refs[key]; - - if (!component) return; - - this.animatingKeys[key] = true; - - if (component.componentWillEnter) component.componentWillEnter(this._handleDoneEntering.bind(this, key));else this._handleDoneEntering(key); - }, - - _tryFinish: function _tryFinish() { - - if (this.isTransitioning()) return; - - if (this.isMounted()) css(compat.findDOMNode(this), { overflow: 'visible', height: '', width: '' }); - - this.props.onAnimate(); - }, - - _handleDoneEntering: function _handleDoneEntering(enterkey) { - var component = this.refs[enterkey]; - - if (component && component.componentDidEnter) component.componentDidEnter(); - - delete this.animatingKeys[enterkey]; - - if (key(this.props.children) !== enterkey) this.performLeave(enterkey); // This was removed before it had fully entered. Remove it. - - this._tryFinish(); - }, - - isTransitioning: function isTransitioning() { - return Object.keys(this.animatingKeys).length !== 0; - }, - - performLeave: function performLeave(key) { - var component = this.refs[key]; - - if (!component) return; - - this.animatingKeys[key] = true; - - if (component.componentWillLeave) component.componentWillLeave(this._handleDoneLeaving.bind(this, key));else this._handleDoneLeaving(key); - }, - - _handleDoneLeaving: function _handleDoneLeaving(leavekey) { - var component = this.refs[leavekey]; - - if (component && component.componentDidLeave) component.componentDidLeave(); - - delete this.animatingKeys[leavekey]; - - if (key(this.props.children) === leavekey) this.performEnter(leavekey); // This entered again before it fully left. Add it again. - - else if (this.isMounted()) this.setState({ - children: this.state.children.filter(function (c) { - return key(c) !== leavekey; - }) - }); - - this._tryFinish(); - }, - - render: function render() { - var _this = this; - - var Component = this.props.component; - return React.createElement( - Component, - this.props, - this.state.children.map(function (c) { - return _this.props.childFactory(c, key(c)); - }) - ); - } - }); - - function getChild(children) { - return React.Children.only(children); - } - - function key(child) { - return child && child.key; - } - -/***/ }, -/* 72 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var offset = __webpack_require__(21), - getWindow = __webpack_require__(22); - - module.exports = function width(node, client) { - var win = getWindow(node); - return win ? win.innerWidth : client ? node.clientWidth : offset(node).width; - }; - -/***/ }, -/* 73 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _invariant = __webpack_require__(44); - - var _invariant2 = babelHelpers.interopRequireDefault(_invariant); - - var _domHelpersActiveElement = __webpack_require__(5); - - var _domHelpersActiveElement2 = babelHelpers.interopRequireDefault(_domHelpersActiveElement); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - //pick, omit, has - - var _utilDates = __webpack_require__(64); - - var _utilDates2 = babelHelpers.interopRequireDefault(_utilDates); - - var _utilConfiguration = __webpack_require__(23); - - var _utilConfiguration2 = babelHelpers.interopRequireDefault(_utilConfiguration); - - var _utilConstants = __webpack_require__(66); - - var _utilConstants2 = babelHelpers.interopRequireDefault(_utilConstants); - - var _Popup = __webpack_require__(12); - - var _Popup2 = babelHelpers.interopRequireDefault(_Popup); - - var _Calendar2 = __webpack_require__(59); - - var _Calendar3 = babelHelpers.interopRequireDefault(_Calendar2); - - var _TimeList = __webpack_require__(74); - - var _TimeList2 = babelHelpers.interopRequireDefault(_TimeList); - - var _DateInput = __webpack_require__(75); - - var _DateInput2 = babelHelpers.interopRequireDefault(_DateInput); - - var _WidgetButton = __webpack_require__(56); - - var _WidgetButton2 = babelHelpers.interopRequireDefault(_WidgetButton); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _uncontrollable = __webpack_require__(41); - - var _uncontrollable2 = babelHelpers.interopRequireDefault(_uncontrollable); - - var _utilInteraction = __webpack_require__(45); - - var _utilWidgetHelpers = __webpack_require__(35); - - var views = _utilConstants2['default'].calendarViews; - var popups = _utilConstants2['default'].datePopups; - - var Calendar = _Calendar3['default'].BaseCalendar; - var localizers = _utilConfiguration2['default'].locale; - var viewEnum = Object.keys(views).map(function (k) { - return views[k]; - }); - - var omit = _util_2['default'].omit; - var pick = _util_2['default'].pick; - - var propTypes = babelHelpers._extends({}, _utilCompat2['default'].type(Calendar).propTypes, { - - //-- controlled props ----------- - value: _react2['default'].PropTypes.instanceOf(Date), - onChange: _react2['default'].PropTypes.func, - open: _react2['default'].PropTypes.oneOf([false, popups.TIME, popups.CALENDAR]), - onToggle: _react2['default'].PropTypes.func, - //------------------------------------ - - onSelect: _react2['default'].PropTypes.func, - - min: _react2['default'].PropTypes.instanceOf(Date), - max: _react2['default'].PropTypes.instanceOf(Date), - - culture: _react2['default'].PropTypes.string, - - format: _utilPropTypes2['default'].dateFormat, - timeFormat: _utilPropTypes2['default'].dateFormat, - editFormat: _utilPropTypes2['default'].dateFormat, - - calendar: _react2['default'].PropTypes.bool, - time: _react2['default'].PropTypes.bool, - - timeComponent: _utilPropTypes2['default'].elementType, - - //popup - dropUp: _react2['default'].PropTypes.bool, - duration: _react2['default'].PropTypes.number, - - placeholder: _react2['default'].PropTypes.string, - name: _react2['default'].PropTypes.string, - - initialView: _react2['default'].PropTypes.oneOf(viewEnum), - finalView: _react2['default'].PropTypes.oneOf(viewEnum), - - disabled: _utilPropTypes2['default'].disabled, - readOnly: _utilPropTypes2['default'].readOnly, - - parse: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.string), _react2['default'].PropTypes.string, _react2['default'].PropTypes.func]), - - 'aria-labelledby': _react2['default'].PropTypes.string, - - messages: _react2['default'].PropTypes.shape({ - calendarButton: _react2['default'].PropTypes.string, - timeButton: _react2['default'].PropTypes.string - }) - }); - - var DateTimePicker = _react2['default'].createClass(babelHelpers.createDecoratedObject([{ - key: 'displayName', - initializer: function initializer() { - return 'DateTimePicker'; - } - }, { - key: 'mixins', - initializer: function initializer() { - return [__webpack_require__(46), __webpack_require__(47), __webpack_require__(49), __webpack_require__(54), __webpack_require__(37)('valueInput', function (key, id) { - var open = this.props.open; - var current = this.ariaActiveDescendant(); - var calIsActive = open === popups.CALENDAR && key === 'calendar'; - var timeIsActive = open === popups.TIME && key === 'timelist'; - - if (!current || (timeIsActive || calIsActive)) return id; - })]; - } - }, { - key: 'propTypes', - initializer: function initializer() { - return propTypes; - } - }, { - key: 'getInitialState', - value: function getInitialState() { - return { - focused: false - }; - } - }, { - key: 'getDefaultProps', - value: function getDefaultProps() { - - return { - value: null, - - min: new Date(1900, 0, 1), - max: new Date(2099, 11, 31), - calendar: true, - time: true, - open: false, - - //calendar override - footer: true, - - messages: { - calendarButton: 'Select Date', - timeButton: 'Select Time' - }, - - ariaActiveDescendantKey: 'dropdownlist' - }; - } - }, { - key: 'render', - value: function render() { - var _cx, - _this = this; - - var _props = this.props; - var className = _props.className; - var calendar = _props.calendar; - var time = _props.time; - var open = _props.open; - var tabIndex = _props.tabIndex; - var value = _props.value; - var editFormat = _props.editFormat; - var timeFormat = _props.timeFormat; - var culture = _props.culture; - var duration = _props.duration; - var step = _props.step; - var messages = _props.messages; - var min = _props.min; - var max = _props.max; - var busy = _props.busy; - var placeholder = _props.placeholder; - var disabled = _props.disabled; - var readOnly = _props.readOnly; - var name = _props.name; - var dropUp = _props.dropUp; - var timeComponent = _props.timeComponent; - var ariaLabelledby = _props['aria-labelledby']; - var focused = this.state.focused; - - var inputID = _utilWidgetHelpers.instanceId(this, '_input'), - timeListID = _utilWidgetHelpers.instanceId(this, '_time_listbox'), - dateListID = _utilWidgetHelpers.instanceId(this, '_cal'), - owns = ''; - - var elementProps = omit(this.props, Object.keys(propTypes)), - calProps = pick(this.props, Object.keys(_utilCompat2['default'].type(Calendar).propTypes)); - - var shouldRenderList = _utilWidgetHelpers.isFirstFocusedRender(this) || open, - disabledOrReadonly = disabled || readOnly, - calendarIsOpen = open === popups.CALENDAR, - timeIsOpen = open === popups.TIME; - - if (calendar) owns += dateListID; - if (time) owns += ' ' + timeListID; - - value = dateOrNull(value); - - return _react2['default'].createElement( - 'div', - babelHelpers._extends({}, elementProps, { - ref: 'element', - tabIndex: '-1', - onKeyDown: this._keyDown, - onFocus: this._focus.bind(null, true), - onBlur: this._focus.bind(null, false), - className: _classnames2['default'](className, 'rw-datetimepicker', 'rw-widget', (_cx = { - 'rw-state-focus': focused, - 'rw-state-disabled': disabled, - 'rw-state-readonly': readOnly, - 'rw-has-both': calendar && time, - 'rw-has-neither': !calendar && !time, - 'rw-rtl': this.isRtl() - - }, _cx['rw-open' + (dropUp ? '-up' : '')] = open, _cx)) - }), - _react2['default'].createElement(_DateInput2['default'], { - ref: 'valueInput', - id: inputID, - tabIndex: tabIndex || 0, - role: 'combobox', - 'aria-labelledby': ariaLabelledby, - 'aria-expanded': !!open, - 'aria-busy': !!busy, - 'aria-owns': owns.trim(), - 'aria-haspopup': true, - placeholder: placeholder, - name: name, - disabled: disabled, - readOnly: readOnly, - value: value, - format: getFormat(this.props), - editFormat: editFormat, - editing: focused, - culture: culture, - parse: this._parse, - onChange: this._change - }), - (calendar || time) && _react2['default'].createElement( - 'span', - { className: 'rw-select' }, - calendar && _react2['default'].createElement( - _WidgetButton2['default'], - { - tabIndex: '-1', - className: 'rw-btn-calendar', - disabled: disabledOrReadonly, - 'aria-disabled': disabledOrReadonly, - 'aria-label': messages.calendarButton, - onClick: this._click.bind(null, popups.CALENDAR) - }, - _react2['default'].createElement('i', { className: 'rw-i rw-i-calendar', - 'aria-hidden': 'true' - }) - ), - time && _react2['default'].createElement( - _WidgetButton2['default'], - { - tabIndex: '-1', - className: 'rw-btn-time', - disabled: disabledOrReadonly, - 'aria-disabled': disabledOrReadonly, - 'aria-label': messages.timeButton, - onClick: this._click.bind(null, popups.TIME) - }, - _react2['default'].createElement('i', { className: 'rw-i rw-i-clock-o', - 'aria-hidden': 'true' - }) - ) - ), - _react2['default'].createElement( - _Popup2['default'], - { - dropUp: dropUp, - open: timeIsOpen, - onRequestClose: this.close, - duration: duration, - onOpening: function () { - return _this.refs.timePopup.forceUpdate(); - } - }, - _react2['default'].createElement( - 'div', - null, - shouldRenderList && _react2['default'].createElement(_TimeList2['default'], { ref: 'timePopup', - id: timeListID, - ariaActiveDescendantKey: 'timelist', - 'aria-labelledby': inputID, - 'aria-live': open && 'polite', - 'aria-hidden': !open, - value: value, - format: timeFormat, - step: step, - min: min, - max: max, - culture: culture, - onMove: this._scrollTo, - preserveDate: !!calendar, - itemComponent: timeComponent, - onSelect: this._selectTime - }) - ) - ), - _react2['default'].createElement( - _Popup2['default'], - { - className: 'rw-calendar-popup', - dropUp: dropUp, - open: calendarIsOpen, - duration: duration, - onRequestClose: this.close - }, - shouldRenderList && _react2['default'].createElement(Calendar, babelHelpers._extends({}, calProps, { - ref: 'calPopup', - tabIndex: '-1', - id: dateListID, - value: value, - 'aria-hidden': !open, - 'aria-live': 'polite', - ariaActiveDescendantKey: 'calendar', - onChange: this._selectDate, - // #75: need to aggressively reclaim focus from the calendar otherwise - // disabled header/footer buttons will drop focus completely from the widget - onNavigate: function () { - return _this.focus(); - } - })) - ) - ); - } - }, { - key: '_change', - decorators: [_utilInteraction.widgetEditable], - value: function _change(date, str, constrain) { - var _props2 = this.props; - var onChange = _props2.onChange; - var value = _props2.value; - - if (constrain) date = this.inRangeValue(date); - - if (onChange) { - if (date == null || value == null) { - if (date != value) //eslint-disable-line eqeqeq - onChange(date, str); - } else if (!_utilDates2['default'].eq(date, value)) onChange(date, str); - } - } - }, { - key: '_keyDown', - decorators: [_utilInteraction.widgetEditable], - value: function _keyDown(e) { - var _props3 = this.props; - var open = _props3.open; - var calendar = _props3.calendar; - var time = _props3.time; - - if (e.key === 'Escape' && open) this.close();else if (e.altKey) { - e.preventDefault(); - - if (e.key === 'ArrowDown') { - if (calendar && time) this.open(open === popups.CALENDAR ? popups.TIME : popups.CALENDAR);else if (time) this.open(popups.TIME);else if (calendar) this.open(popups.CALENDAR); - } else if (e.key === 'ArrowUp') this.close(); - } else if (open) { - if (open === popups.CALENDAR) this.refs.calPopup._keyDown(e); - if (open === popups.TIME) this.refs.timePopup._keyDown(e); - } - - _utilWidgetHelpers.notify(this.props.onKeyDown, [e]); - } - }, { - key: '_focus', - decorators: [_utilInteraction.widgetEnabled], - value: function _focus(focused, e) { - var _this2 = this; - - this.setTimeout('focus', function () { - if (!focused) _this2.close(); - - if (focused !== _this2.state.focused) { - _utilWidgetHelpers.notify(_this2.props[focused ? 'onFocus' : 'onBlur'], e); - _this2.setState({ focused: focused }); - } - }); - } - }, { - key: 'focus', - value: function focus() { - if (_domHelpersActiveElement2['default']() !== _utilCompat2['default'].findDOMNode(this.refs.valueInput)) this.refs.valueInput.focus(); - } - }, { - key: '_selectDate', - decorators: [_utilInteraction.widgetEditable], - value: function _selectDate(date) { - var format = getFormat(this.props), - dateTime = _utilDates2['default'].merge(date, this.props.value), - dateStr = formatDate(date, format, this.props.culture); - - this.close(); - _utilWidgetHelpers.notify(this.props.onSelect, [dateTime, dateStr]); - this._change(dateTime, dateStr, true); - this.focus(); - } - }, { - key: '_selectTime', - decorators: [_utilInteraction.widgetEditable], - value: function _selectTime(datum) { - var format = getFormat(this.props), - dateTime = _utilDates2['default'].merge(this.props.value, datum.date), - dateStr = formatDate(datum.date, format, this.props.culture); - - this.close(); - _utilWidgetHelpers.notify(this.props.onSelect, [dateTime, dateStr]); - this._change(dateTime, dateStr, true); - this.focus(); - } - }, { - key: '_click', - decorators: [_utilInteraction.widgetEditable], - value: function _click(view, e) { - this.focus(); - this.toggle(view, e); - } - }, { - key: '_parse', - value: function _parse(string) { - var format = getFormat(this.props, true), - editFormat = this.props.editFormat, - parse = this.props.parse, - formats = []; - - if (typeof parse === 'function') return parse(string, this.props.culture); - - if (typeof format === 'string') formats.push(format); - - if (typeof editFormat === 'string') formats.push(editFormat); - - if (parse) formats = formats.concat(this.props.parse); - - _invariant2['default'](formats.length, 'React Widgets: there are no specified `parse` formats provided and the `format` prop is a function. ' + 'the DateTimePicker is unable to parse `%s` into a dateTime, ' + 'please provide either a parse function or Globalize.js compatible string for `format`', string); - - return formatsParser(formats, this.props.culture, string); - } - }, { - key: 'toggle', - value: function toggle(view) { - this.props.open ? this.props.open !== view ? this.open(view) : this.close(view) : this.open(view); - } - }, { - key: 'open', - value: function open(view) { - if (this.props.open !== view && this.props[view] === true) _utilWidgetHelpers.notify(this.props.onToggle, view); - } - }, { - key: 'close', - value: function close() { - if (this.props.open) _utilWidgetHelpers.notify(this.props.onToggle, false); - } - }, { - key: 'inRangeValue', - value: function inRangeValue(value) { - if (value == null) return value; - - return _utilDates2['default'].max(_utilDates2['default'].min(value, this.props.max), this.props.min); - } - }])); - - exports['default'] = _uncontrollable2['default'](DateTimePicker, { open: 'onToggle', value: 'onChange' }); - - function getFormat(props) { - var cal = props[popups.CALENDAR] != null ? props.calendar : true, - time = props[popups.TIME] != null ? props.time : true; - - return props.format ? props.format : cal && time || !cal && !time ? localizers.date.formats['default'] : localizers.date.formats[cal ? 'date' : 'time']; - } - - function formatDate(date, format, culture) { - var val = ''; - - if (date instanceof Date && !isNaN(date.getTime())) val = localizers.date.format(date, format, culture); - - return val; - } - - function formatsParser(formats, culture, str) { - var date; - - for (var i = 0; i < formats.length; i++) { - date = localizers.date.parse(str, formats[i], culture); - if (date) return date; - } - return null; - } - - function dateOrNull(dt) { - if (dt && !isNaN(dt.getTime())) return dt; - return null; - } - module.exports = exports['default']; - -/***/ }, -/* 74 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var React = __webpack_require__(4), - dates = __webpack_require__(64), - List = __webpack_require__(32), - localizers = __webpack_require__(23).locale, - CustomPropTypes = __webpack_require__(30); - - var format = function format(props) { - return props.format || localizers.date.formats.time; - }; - - module.exports = React.createClass({ - - displayName: 'TimeList', - - propTypes: { - value: React.PropTypes.instanceOf(Date), - min: React.PropTypes.instanceOf(Date), - max: React.PropTypes.instanceOf(Date), - step: React.PropTypes.number, - itemComponent: CustomPropTypes.elementType, - format: CustomPropTypes.dateFormat, - onSelect: React.PropTypes.func, - preserveDate: React.PropTypes.bool, - culture: React.PropTypes.string - }, - - mixins: [__webpack_require__(46)], - - getDefaultProps: function getDefaultProps() { - return { - step: 30, - onSelect: function onSelect() {}, - min: new Date(1900, 0, 1), - max: new Date(2099, 11, 31), - preserveDate: true, - delay: 300 - }; - }, - - getInitialState: function getInitialState() { - var data = this._dates(this.props), - focusedItem = this._closestDate(data, this.props.value); - - return { - focusedItem: focusedItem || data[0], - dates: data - }; - }, - - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - var data = this._dates(nextProps), - focusedItem = this._closestDate(data, nextProps.value), - valChanged = !dates.eq(nextProps.value, this.props.value, 'minutes'), - minChanged = !dates.eq(nextProps.min, this.props.min, 'minutes'), - maxChanged = !dates.eq(nextProps.max, this.props.max, 'minutes'); - - if (valChanged || minChanged || maxChanged) { - this.setState({ - focusedItem: focusedItem || data[0], - dates: data - }); - } - }, - - render: function render() { - var _props = this.props; - var min = _props.min; - var max = _props.max; - var value = _props.value; - var step = _props.step; - var props = babelHelpers.objectWithoutProperties(_props, ['min', 'max', 'value', 'step']); - - var times = this.state.dates, - date = this._closestDate(times, value); - - return React.createElement(List, babelHelpers._extends({}, props, { - ref: 'list', - data: times, - textField: 'label', - valueField: 'date', - selected: date, - focused: this.state.focusedItem - })); - }, - - _closestDate: function _closestDate(times, date) { - var roundTo = 1000 * 60 * this.props.step, - inst = null, - label; - - if (!date) return null; - - date = new Date(Math.floor(date.getTime() / roundTo) * roundTo); - label = dates.format(date, this.props.format, this.props.culture); - - times.some(function (time) { - if (time.label === label) return inst = time; - }); - - return inst; - }, - - _data: function _data() { - return this.state.dates; - }, - - _dates: function _dates(props) { - var times = [], - i = 0, - values = this._dateValues(props), - start = values.min, - startDay = dates.date(start); - - while (dates.date(start) === startDay && dates.lte(start, values.max)) { - i++; - times.push({ date: start, label: localizers.date.format(start, format(props), props.culture) }); - start = dates.add(start, props.step || 30, 'minutes'); - } - return times; - }, - - _dateValues: function _dateValues(props) { - var value = props.value || dates.today(), - useDate = props.preserveDate, - min = props.min, - max = props.max, - start, - end; - - //compare just the time regradless of whether they fall on the same day - if (!useDate) { - start = dates.startOf(dates.merge(new Date(), min), 'minutes'); - end = dates.startOf(dates.merge(new Date(), max), 'minutes'); - - if (dates.lte(end, start) && dates.gt(max, min, 'day')) end = dates.tomorrow(); - - return { - min: start, - max: end - }; - } - - start = dates.today(); - end = dates.tomorrow(); - //date parts are equal - return { - min: dates.eq(value, min, 'day') ? dates.merge(start, min) : start, - max: dates.eq(value, max, 'day') ? dates.merge(start, max) : end - }; - }, - - _keyDown: function _keyDown(e) { - var _this = this; - - var key = e.key, - character = String.fromCharCode(e.keyCode), - focusedItem = this.state.focusedItem, - list = this.refs.list; - - if (key === 'End') this.setState({ focusedItem: list.last() });else if (key === 'Home') this.setState({ focusedItem: list.first() });else if (key === 'Enter') this.props.onSelect(focusedItem);else if (key === 'ArrowDown') { - e.preventDefault(); - this.setState({ focusedItem: list.next(focusedItem) }); - } else if (key === 'ArrowUp') { - e.preventDefault(); - this.setState({ focusedItem: list.prev(focusedItem) }); - } else { - e.preventDefault(); - - this.search(character, function (item) { - _this.setState({ focusedItem: item }); - }); - } - }, - - scrollTo: function scrollTo() { - this.refs.list.move && this.refs.list.move(); - }, - - search: function search(character, cb) { - var _this2 = this; - - var word = ((this._searchTerm || '') + character).toLowerCase(); - - this._searchTerm = word; - - this.setTimeout('search', function () { - var list = _this2.refs.list, - item = list.next(_this2.state.focusedItem, word); - - _this2._searchTerm = ''; - if (item) cb(item); - }, this.props.delay); - } - - }); - -/***/ }, -/* 75 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var React = __webpack_require__(4), - cx = __webpack_require__(10), - compat = __webpack_require__(28), - localizers = __webpack_require__(23).locale, - CustomPropTypes = __webpack_require__(30); - - module.exports = React.createClass({ - - displayName: 'DatePickerInput', - - propTypes: { - format: CustomPropTypes.dateFormat.isRequired, - editFormat: CustomPropTypes.dateFormat, - parse: React.PropTypes.func.isRequired, - - value: React.PropTypes.instanceOf(Date), - onChange: React.PropTypes.func.isRequired, - culture: React.PropTypes.string - }, - - getDefaultProps: function getDefaultProps() { - return { - textValue: '' - }; - }, - - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - var text = formatDate(nextProps.value, nextProps.editing && nextProps.editFormat ? nextProps.editFormat : nextProps.format, nextProps.culture); - - this.startValue = text; - - this.setState({ - textValue: text - }); - }, - - getInitialState: function getInitialState() { - var text = formatDate(this.props.value, this.props.editing && this.props.editFormat ? this.props.editFormat : this.props.format, this.props.culture); - - this.startValue = text; - - return { - textValue: text - }; - }, - - render: function render() { - var value = this.state.textValue; - - return React.createElement('input', babelHelpers._extends({}, this.props, { - type: 'text', - className: cx({ 'rw-input': true }), - value: value, - 'aria-disabled': this.props.disabled, - 'aria-readonly': this.props.readOnly, - disabled: this.props.disabled, - readOnly: this.props.readOnly, - onChange: this._change, - onBlur: chain(this.props.blur, this._blur, this) })); - }, - - _change: function _change(e) { - this.setState({ textValue: e.target.value }); - this._needsFlush = true; - }, - - _blur: function _blur(e) { - var val = e.target.value, - date; - - if (this._needsFlush) { - this._needsFlush = false; - date = this.props.parse(val); - - this.props.onChange(date, formatDate(date, this.props.format, this.props.culture)); - } - }, - - focus: function focus() { - compat.findDOMNode(this).focus(); - } - - }); - - function isValid(d) { - return !isNaN(d.getTime()); - } - - function formatDate(date, format, culture) { - var val = ''; - - if (date instanceof Date && isValid(date)) val = localizers.date.format(date, format, culture); - - return val; - } - - function chain(a, b, thisArg) { - return function () { - a && a.apply(thisArg, arguments); - b && b.apply(thisArg, arguments); - }; - } - -/***/ }, -/* 76 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _uncontrollable = __webpack_require__(41); - - var _uncontrollable2 = babelHelpers.interopRequireDefault(_uncontrollable); - - var _utilConstants = __webpack_require__(66); - - var _utilConstants2 = babelHelpers.interopRequireDefault(_utilConstants); - - var _utilRepeater = __webpack_require__(77); - - var _utilRepeater2 = babelHelpers.interopRequireDefault(_utilRepeater); - - var _utilConfiguration = __webpack_require__(23); - - var _utilConfiguration2 = babelHelpers.interopRequireDefault(_utilConfiguration); - - var _NumberInput = __webpack_require__(78); - - var _NumberInput2 = babelHelpers.interopRequireDefault(_NumberInput); - - var _WidgetButton = __webpack_require__(56); - - var _WidgetButton2 = babelHelpers.interopRequireDefault(_WidgetButton); - - var _utilInteraction = __webpack_require__(45); - - var _utilWidgetHelpers = __webpack_require__(35); - - var directions = _utilConstants2['default'].directions; - - var localizers = _utilConfiguration2['default'].locale; - - var format = function format(props) { - return props.format || localizers.number.formats['default']; - }; - - var propTypes = { - - // -- controlled props ----------- - value: _react2['default'].PropTypes.number, - onChange: _react2['default'].PropTypes.func, - //------------------------------------ - - min: _react2['default'].PropTypes.number, - max: _react2['default'].PropTypes.number, - step: _react2['default'].PropTypes.number, - - precision: _react2['default'].PropTypes.number, - - culture: _react2['default'].PropTypes.string, - - format: _utilPropTypes2['default'].numberFormat, - - name: _react2['default'].PropTypes.string, - - parse: _react2['default'].PropTypes.func, - - disabled: _utilPropTypes2['default'].disabled, - readOnly: _utilPropTypes2['default'].readOnly, - - messages: _react2['default'].PropTypes.shape({ - increment: _react2['default'].PropTypes.string, - decrement: _react2['default'].PropTypes.string - }) - }; - - var NumberPicker = _react2['default'].createClass(babelHelpers.createDecoratedObject([{ - key: 'displayName', - initializer: function initializer() { - return 'NumberPicker'; - } - }, { - key: 'mixins', - initializer: function initializer() { - return [__webpack_require__(46), __webpack_require__(47), __webpack_require__(54)]; - } - }, { - key: 'propTypes', - initializer: function initializer() { - return propTypes; - } - }, { - key: 'getDefaultProps', - value: function getDefaultProps() { - return { - value: null, - open: false, - - min: -Infinity, - max: Infinity, - step: 1, - - messages: { - increment: 'increment value', - decrement: 'decrement value' - } - }; - } - }, { - key: 'getInitialState', - value: function getInitialState() { - return { - focused: false, - active: false - }; - } - }, { - key: 'render', - value: function render() { - var _$omit = _util_2['default'].omit(this.props, Object.keys(propTypes)); - - var className = _$omit.className; - var onKeyDown = _$omit.onKeyDown; - var onKeyPress = _$omit.onKeyPress; - var onKeyUp = _$omit.onKeyUp; - var props = babelHelpers.objectWithoutProperties(_$omit, ['className', 'onKeyDown', 'onKeyPress', 'onKeyUp']); - var val = this.constrainValue(this.props.value); - - return _react2['default'].createElement( - 'div', - babelHelpers._extends({}, props, { - ref: 'element', - onKeyDown: this._keyDown, - onFocus: this._focus.bind(null, true), - onBlur: this._focus.bind(null, false), - tabIndex: '-1', - className: _classnames2['default'](className, 'rw-numberpicker', 'rw-widget', { - 'rw-state-focus': this.state.focused, - 'rw-state-disabled': this.props.disabled, - 'rw-state-readonly': this.props.readOnly, - 'rw-rtl': this.isRtl() - }) }), - _react2['default'].createElement( - 'span', - { className: 'rw-select' }, - _react2['default'].createElement( - _WidgetButton2['default'], - { - tabIndex: '-1', - className: _classnames2['default']({ 'rw-state-active': this.state.active === directions.UP }), - onMouseDown: this._mouseDown.bind(null, directions.UP), - onMouseUp: this._mouseUp.bind(null, directions.UP), - onClick: this._focus.bind(null, true), - disabled: val === this.props.max || this.props.disabled, - 'aria-disabled': val === this.props.max || this.props.disabled }, - _react2['default'].createElement( - 'i', - { className: 'rw-i rw-i-caret-up' }, - _react2['default'].createElement( - 'span', - { className: 'rw-sr' }, - this.props.messages.increment - ) - ) - ), - _react2['default'].createElement( - _WidgetButton2['default'], - { - tabIndex: '-1', - className: _classnames2['default']({ 'rw-state-active': this.state.active === directions.DOWN }), - onMouseDown: this._mouseDown.bind(null, directions.DOWN), - onMouseUp: this._mouseUp.bind(null, directions.DOWN), - onClick: this._focus.bind(null, true), - disabled: val === this.props.min || this.props.disabled, - 'aria-disabled': val === this.props.min || this.props.disabled }, - _react2['default'].createElement( - 'i', - { className: 'rw-i rw-i-caret-down' }, - _react2['default'].createElement( - 'span', - { className: 'rw-sr' }, - this.props.messages.decrement - ) - ) - ) - ), - _react2['default'].createElement(_NumberInput2['default'], { - ref: 'input', - tabIndex: props.tabIndex, - value: val, - editing: this.state.focused, - format: this.props.format, - parse: this.props.parse, - name: this.props.name, - role: 'spinbutton', - min: this.props.min, - 'aria-valuenow': val, - 'aria-valuemin': isFinite(this.props.min) ? this.props.min : null, - 'aria-valuemax': isFinite(this.props.max) ? this.props.max : null, - 'aria-disabled': this.props.disabled, - 'aria-readonly': this.props.readonly, - disabled: this.props.disabled, - readOnly: this.props.readOnly, - onChange: this.change, - onKeyDown: onKeyDown, - onKeyPress: onKeyPress, - onKeyUp: onKeyUp }) - ); - } - }, { - key: '_mouseDown', - decorators: [_utilInteraction.widgetEditable], - value: function _mouseDown(dir) { - var method = dir === directions.UP ? this.increment : this.decrement; - - this.setState({ active: dir }); - - var val = method.call(this); - - if (!(dir === directions.UP && val === this.props.max || dir === directions.DOWN && val === this.props.min)) { - if (!this._cancelRepeater) this._cancelRepeater = _utilRepeater2['default'](this._mouseDown.bind(null, dir)); - } else this._mouseUp(); - } - }, { - key: '_mouseUp', - decorators: [_utilInteraction.widgetEditable], - value: function _mouseUp() { - this.setState({ active: false }); - this._cancelRepeater && this._cancelRepeater(); - this._cancelRepeater = null; - } - }, { - key: '_focus', - decorators: [_utilInteraction.widgetEnabled], - value: function _focus(focused, e) { - var _this = this; - - focused && _utilCompat2['default'].findDOMNode(this.refs.input).focus(); - - this.setTimeout('focus', function () { - if (focused !== _this.state.focused) { - _utilWidgetHelpers.notify(_this.props[focused ? 'onFocus' : 'onBlur'], e); - _this.setState({ focused: focused }); - } - }, 0); - } - }, { - key: '_keyDown', - decorators: [_utilInteraction.widgetEditable], - value: function _keyDown(e) { - var key = e.key; - - if (key === 'End' && isFinite(this.props.max)) this.change(this.props.max);else if (key === 'Home' && isFinite(this.props.min)) this.change(this.props.min);else if (key === 'ArrowDown') { - e.preventDefault(); - this.decrement(); - } else if (key === 'ArrowUp') { - e.preventDefault(); - this.increment(); - } - } - }, { - key: 'increment', - value: function increment() { - return this.step(this.props.step); - } - }, { - key: 'decrement', - value: function decrement() { - return this.step(-this.props.step); - } - }, { - key: 'step', - value: function step(amount) { - var value = (this.props.value || 0) + amount; - - var decimals = this.props.precision != null ? this.props.precision : localizers.number.precision(format(this.props)); - - this.change(decimals != null ? round(value, decimals) : value); - - return value; - } - }, { - key: 'change', - value: function change(val) { - val = this.constrainValue(val); - - if (this.props.value !== val) _utilWidgetHelpers.notify(this.props.onChange, val); - } - }, { - key: 'constrainValue', - value: function constrainValue(value) { - var max = this.props.max == null ? Infinity : this.props.max, - min = this.props.min == null ? -Infinity : this.props.min; - - if (value == null || value === '') return null; - - return Math.max(Math.min(value, max), min); - } - }])); - - exports['default'] = _uncontrollable2['default'](NumberPicker, { value: 'onChange' }); - - // thank you kendo ui core - // https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.core.js#L1036 - function round(value, precision) { - precision = precision || 0; - - value = ('' + value).split('e'); - value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + precision : precision))); - - value = ('' + value).split('e'); - value = +(value[0] + 'e' + (value[1] ? +value[1] - precision : -precision)); - - return value.toFixed(precision); - } - module.exports = exports['default']; - - //allow for styling, focus stealing keeping me from the normal what have you - -/***/ }, -/* 77 */ -/***/ function(module, exports) { - - // my tests in ie11/chrome/FF indicate that keyDown repeats - // at about 35ms+/- 5ms after an initial 500ms delay. callback fires on the leading edge - "use strict"; - - function Repeater(callback) { - var id, - cancel = function cancel() { - return clearInterval(id); - }; - - id = setInterval(function () { - cancel(); - id = setInterval(callback, 35); - callback(); //fire after everything in case the user cancels on the first call - }, 500); - - return cancel; - } - - module.exports = Repeater; - -/***/ }, -/* 78 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - var React = __webpack_require__(4), - CustomPropTypes = __webpack_require__(30), - localizers = __webpack_require__(23).locale; - - var format = function format(props) { - return props.format || localizers.number.formats['default']; - }; - - module.exports = React.createClass({ - - displayName: 'NumberPickerInput', - - propTypes: { - value: React.PropTypes.number, - - format: CustomPropTypes.numberFormat, - parse: React.PropTypes.func.isRequired, - culture: React.PropTypes.string, - - min: React.PropTypes.number, - - onChange: React.PropTypes.func.isRequired, - onKeyDown: React.PropTypes.func - }, - - getDefaultProps: function getDefaultProps() { - return { - value: null, - editing: false, - parse: function parse(number, culture) { - return localizers.number.parse(number, culture); - } - }; - }, - - getDefaultState: function getDefaultState(props) { - var value = props.editing ? props.value : formatNumber(props.value, format(props), props.culture); - - if (value == null || isNaN(props.value)) value = ''; - - return { - stringValue: '' + value - }; - }, - - getInitialState: function getInitialState() { - return this.getDefaultState(this.props); - }, - - componentWillReceiveProps: function componentWillReceiveProps(nextProps) { - this.setState(this.getDefaultState(nextProps)); - }, - - render: function render() { - var value = this.state.stringValue; - - return React.createElement('input', babelHelpers._extends({}, this.props, { - type: 'text', - className: 'rw-input', - onChange: this._change, - onBlur: this._finish, - 'aria-disabled': this.props.disabled, - 'aria-readonly': this.props.readOnly, - disabled: this.props.disabled, - readOnly: this.props.readOnly, - value: value })); - }, - - _change: function _change(e) { - var val = e.target.value, - number = this.props.parse(e.target.value, this.props.culture), - valid = this.isValid(number); - - if (val == null || val.trim() === '') return this.props.onChange(null); - - if (valid && number !== this.props.value && !this.isAtDelimiter(number, val)) return this.props.onChange(number); - - //console.log(val !== 0 && !val) - if (!isNaN(number) || this.isAtDelimiter(number, val)) this.current(e.target.value); - }, - - _finish: function _finish() { - var str = this.state.stringValue, - number = this.props.parse(str, this.props.culture); - - // if number is below the min - // we need to flush low values and decimal stops, onBlur means i'm done inputing - if (!isNaN(number) && (number < this.props.min || this.isAtDelimiter(number, str))) { - this.props.onChange(number); - } - }, - - isAtDelimiter: function isAtDelimiter(num, str) { - var next; - - if (str.length <= 1) return false; - - next = this.props.parse(str.substr(0, str.length - 1), this.props.culture); - - return typeof next === 'number' && !isNaN(next) && next === num; - }, - - isValid: function isValid(num) { - if (typeof num !== 'number' || isNaN(num)) return false; - return num >= this.props.min; - }, - - //this intermediate state is for when one runs into the decimal or are typing the number - current: function current(val) { - this.setState({ stringValue: val }); - } - - }); - - // function parseLocaleFloat(number, parser, culture) { - // if ( typeof format === 'function') - // return format(number, culture) - - // return config.globalize.parseFloat(number, 10, culture) - // } - - function formatNumber(number, format, culture) { - return localizers.number.format(number, format, culture); - } - -/***/ }, -/* 79 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _Popup = __webpack_require__(12); - - var _Popup2 = babelHelpers.interopRequireDefault(_Popup); - - var _utilDomSupport = __webpack_require__(80); - - var _utilDomSupport2 = babelHelpers.interopRequireDefault(_utilDomSupport); - - var _MultiselectInput = __webpack_require__(81); - - var _MultiselectInput2 = babelHelpers.interopRequireDefault(_MultiselectInput); - - var _MultiselectTagList = __webpack_require__(82); - - var _MultiselectTagList2 = babelHelpers.interopRequireDefault(_MultiselectTagList); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _List = __webpack_require__(32); - - var _List2 = babelHelpers.interopRequireDefault(_List); - - var _ListGroupable = __webpack_require__(38); - - var _ListGroupable2 = babelHelpers.interopRequireDefault(_ListGroupable); - - var _utilValidateListInterface = __webpack_require__(40); - - var _utilValidateListInterface2 = babelHelpers.interopRequireDefault(_utilValidateListInterface); - - var _uncontrollable = __webpack_require__(41); - - var _uncontrollable2 = babelHelpers.interopRequireDefault(_uncontrollable); - - var _utilDataHelpers = __webpack_require__(34); - - var _utilInteraction = __webpack_require__(45); - - var _utilWidgetHelpers = __webpack_require__(35); - - var compatCreate = function compatCreate(props, msgs) { - return typeof msgs.createNew === 'function' ? msgs.createNew(props) : [_react2['default'].createElement( - 'strong', - null, - '"' + props.searchTerm + '"' - ), ' ' + msgs.createNew]; - }; - - var omit = _util_2['default'].omit; - var pick = _util_2['default'].pick; - var splat = _util_2['default'].splat; - - var propTypes = { - data: _react2['default'].PropTypes.array, - //-- controlled props -- - value: _react2['default'].PropTypes.array, - onChange: _react2['default'].PropTypes.func, - - searchTerm: _react2['default'].PropTypes.string, - onSearch: _react2['default'].PropTypes.func, - - open: _react2['default'].PropTypes.bool, - onToggle: _react2['default'].PropTypes.func, - //------------------------------------------- - - valueField: _react2['default'].PropTypes.string, - textField: _utilPropTypes2['default'].accessor, - - tagComponent: _utilPropTypes2['default'].elementType, - itemComponent: _utilPropTypes2['default'].elementType, - listComponent: _utilPropTypes2['default'].elementType, - - groupComponent: _utilPropTypes2['default'].elementType, - groupBy: _utilPropTypes2['default'].accessor, - - createComponent: _utilPropTypes2['default'].elementType, - - onSelect: _react2['default'].PropTypes.func, - onCreate: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.oneOf([false]), _react2['default'].PropTypes.func]), - - dropUp: _react2['default'].PropTypes.bool, - duration: _react2['default'].PropTypes.number, //popup - - placeholder: _react2['default'].PropTypes.string, - - disabled: _utilPropTypes2['default'].disabled.acceptsArray, - - readOnly: _utilPropTypes2['default'].readOnly.acceptsArray, - - messages: _react2['default'].PropTypes.shape({ - open: _utilPropTypes2['default'].message, - emptyList: _utilPropTypes2['default'].message, - emptyFilter: _utilPropTypes2['default'].message, - createNew: _utilPropTypes2['default'].message - }) - }; - - var Multiselect = _react2['default'].createClass(babelHelpers.createDecoratedObject([{ - key: 'displayName', - initializer: function initializer() { - return 'Multiselect'; - } - }, { - key: 'mixins', - initializer: function initializer() { - return [__webpack_require__(46), __webpack_require__(48), __webpack_require__(49), __webpack_require__(54), __webpack_require__(37)('input', function (key, id) { - var myKey = this.props.ariaActiveDescendantKey; - - var createIsActive = (!this._data().length || this.state.focusedItem === null) && key === myKey; - - var tagIsActive = this.state.focusedTag != null && key === 'taglist'; - var listIsActive = this.state.focusedTag == null && key === 'list'; - - if (createIsActive || tagIsActive || listIsActive) return id; - })]; - } - }, { - key: 'propTypes', - initializer: function initializer() { - return propTypes; - } - }, { - key: 'getDefaultProps', - value: function getDefaultProps() { - return { - data: [], - filter: 'startsWith', - value: [], - open: false, - searchTerm: '', - ariaActiveDescendantKey: 'multiselect', - messages: { - createNew: '(create new tag)', - emptyList: 'There are no items in this list', - emptyFilter: 'The filter returned no results', - tagsLabel: 'selected items', - selectedItems: 'selected items', - noneSelected: 'no selected items', - removeLabel: 'remove selected item' - } - }; - } - }, { - key: 'getInitialState', - value: function getInitialState() { - var _props = this.props; - var data = _props.data; - var value = _props.value; - var valueField = _props.valueField; - var searchTerm = _props.searchTerm; - var dataItems = splat(value).map(function (item) { - return _utilDataHelpers.dataItem(data, item, valueField); - }); - var data = this.process(data, dataItems, searchTerm); - - return { - focusedTag: null, - focusedItem: data[0], - processedData: data, - dataItems: dataItems - }; - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this.ariaActiveDescendant(_utilWidgetHelpers.instanceId(this, '__createlist_option')); - - this.refs.list && _utilValidateListInterface2['default'](this.refs.list); - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - // https://github.com/facebook/react/issues/1169 - if (_utilDomSupport2['default'].ios) _utilCompat2['default'].findDOMNode(this.refs.wrapper).onClick = function () {}; - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - var data = nextProps.data; - var value = nextProps.value; - var valueField = nextProps.valueField; - var searchTerm = nextProps.searchTerm; - var values = _util_2['default'].splat(value); - var current = this.state.focusedItem; - var items = this.process(data, values, searchTerm); - - this.setState({ - processedData: items, - focusedItem: items.indexOf(current) === -1 ? items[0] : current, - dataItems: values.map(function (item) { - return _utilDataHelpers.dataItem(data, item, valueField); - }) - }); - } - }, { - key: 'render', - value: function render() { - var _cx, - _this = this; - - var _props2 = this.props; - var searchTerm = _props2.searchTerm; - var maxLength = _props2.maxLength; - var className = _props2.className; - var tabIndex = _props2.tabIndex; - var textField = _props2.textField; - var groupBy = _props2.groupBy; - var messages = _props2.messages; - var data = _props2.data; - var busy = _props2.busy; - var dropUp = _props2.dropUp; - var open = _props2.open; - var disabled = _props2.disabled; - var readOnly = _props2.readOnly; - var TagComponent = _props2.tagComponent; - var List = _props2.listComponent; - - List = List || groupBy && _ListGroupable2['default'] || _List2['default']; - - messages = msgs(messages); - - var elementProps = omit(this.props, Object.keys(propTypes)); - var tagsProps = pick(this.props, ['valueField', 'textField']); - var inputProps = pick(this.props, ['maxLength', 'searchTerm']); - var listProps = pick(this.props, Object.keys(_utilCompat2['default'].type(List).propTypes)); - var popupProps = pick(this.props, Object.keys(_utilCompat2['default'].type(_Popup2['default']).propTypes)); - - var _state = this.state; - var focusedTag = _state.focusedTag; - var focusedItem = _state.focusedItem; - var focused = _state.focused; - var dataItems = _state.dataItems; - - var items = this._data(), - tagsID = _utilWidgetHelpers.instanceId(this, '_taglist'), - listID = _utilWidgetHelpers.instanceId(this, '__listbox'), - createID = _utilWidgetHelpers.instanceId(this, '__createlist'), - createOptionID = _utilWidgetHelpers.instanceId(this, '__createlist_option'); - - var shouldRenderTags = !!dataItems.length, - shouldRenderPopup = _utilWidgetHelpers.isFirstFocusedRender(this) || open, - shouldShowCreate = this._shouldShowCreate(), - createIsFocused = !items.length || focusedItem === null; - - if (focused) { - var notify = dataItems.length ? messages.selectedItems + ': ' + dataItems.map(function (item) { - return _utilDataHelpers.dataText(item, textField); - }).join(', ') : messages.noneSelected; - } - - return _react2['default'].createElement( - 'div', - babelHelpers._extends({}, elementProps, { - ref: 'element', - id: _utilWidgetHelpers.instanceId(this), - onKeyDown: this._keyDown, - onFocus: this._focus.bind(null, true), - onBlur: this._focus.bind(null, false), - tabIndex: '-1', - className: _classnames2['default'](className, 'rw-widget', 'rw-multiselect', (_cx = { - 'rw-state-focus': focused, - 'rw-state-disabled': disabled === true, - 'rw-state-readonly': readOnly === true, - 'rw-rtl': this.isRtl() - }, _cx['rw-open' + (dropUp ? '-up' : '')] = open, _cx)) }), - _react2['default'].createElement( - 'span', - { - ref: 'status', - id: _utilWidgetHelpers.instanceId(this, '__notify'), - role: 'status', - className: 'sr-only', - 'aria-live': 'assertive', - 'aria-atomic': 'true', - 'aria-relevant': 'additions removals text' - }, - notify - ), - _react2['default'].createElement( - 'div', - { className: 'rw-multiselect-wrapper', ref: 'wrapper' }, - busy && _react2['default'].createElement('i', { className: 'rw-i rw-loading' }), - shouldRenderTags && _react2['default'].createElement(_MultiselectTagList2['default'], babelHelpers._extends({}, tagsProps, { - ref: 'tagList', - id: tagsID, - 'aria-label': messages.tagsLabel, - value: dataItems, - focused: focusedTag, - disabled: disabled, - readOnly: readOnly, - onDelete: this._delete, - valueComponent: TagComponent, - ariaActiveDescendantKey: 'taglist' - })), - _react2['default'].createElement(_MultiselectInput2['default'], babelHelpers._extends({}, inputProps, { - ref: 'input', - tabIndex: tabIndex || 0, - role: 'listbox', - 'aria-expanded': open, - 'aria-busy': !!busy, - 'aria-owns': listID + ' ' + _utilWidgetHelpers.instanceId(this, '__notify') + (shouldRenderTags ? ' ' + tagsID : '') + (shouldShowCreate ? ' ' + createID : ''), - 'aria-haspopup': true, - value: searchTerm, - maxLength: maxLength, - disabled: disabled === true, - readOnly: readOnly === true, - placeholder: this._placeholder(), - onKeyDown: this._searchKeyDown, - onKeyUp: this._searchgKeyUp, - onChange: this._typing, - onFocus: this._inputFocus, - onClick: this._inputFocus - })) - ), - _react2['default'].createElement( - _Popup2['default'], - babelHelpers._extends({}, popupProps, { - onOpening: function () { - return _this.refs.list.forceUpdate(); - }, - onRequestClose: this.close - }), - _react2['default'].createElement( - 'div', - null, - shouldRenderPopup && [_react2['default'].createElement(List, babelHelpers._extends({ ref: 'list', - key: '0' - }, listProps, { - readOnly: !!readOnly, - disabled: !!disabled, - id: listID, - 'aria-live': 'polite', - 'aria-labelledby': _utilWidgetHelpers.instanceId(this), - 'aria-hidden': !open, - ariaActiveDescendantKey: 'list', - data: items, - focused: focusedItem, - onSelect: this._onSelect, - onMove: this._scrollTo, - messages: { - emptyList: data.length ? messages.emptyFilter : messages.emptyList - } - })), shouldShowCreate && _react2['default'].createElement( - 'ul', - { role: 'listbox', id: createID, className: 'rw-list rw-multiselect-create-tag', key: '1' }, - _react2['default'].createElement( - 'li', - { onClick: this._onCreate.bind(null, searchTerm), - role: 'option', - id: createOptionID, - className: _classnames2['default']({ - 'rw-list-option': true, - 'rw-state-focus': createIsFocused - }) }, - compatCreate(this.props, messages) - ) - )] - ) - ) - ); - } - }, { - key: '_data', - value: function _data() { - return this.state.processedData; - } - }, { - key: '_delete', - value: function _delete(value) { - this._focus(true); - this.change(this.state.dataItems.filter(function (d) { - return d !== value; - })); - } - }, { - key: '_inputFocus', - value: function _inputFocus() { - this._focus(true); - !this.props.open && this.open(); - } - }, { - key: '_focus', - decorators: [_utilInteraction.widgetEnabled], - value: function _focus(focused, e) { - var _this2 = this; - - if (this.props.disabled === true) return; - - if (focused) this.refs.input.focus(); - - this.setTimeout('focus', function () { - if (!focused) _this2.refs.tagList && _this2.setState({ focusedTag: null }); - - if (focused !== _this2.state.focused) { - focused ? _this2.open() : _this2.close(); - - _utilWidgetHelpers.notify(_this2.props[focused ? 'onFocus' : 'onBlur'], e); - _this2.setState({ focused: focused }); - } - }); - } - }, { - key: '_searchKeyDown', - value: function _searchKeyDown(e) { - if (e.key === 'Backspace' && e.target.value && !this._deletingText) this._deletingText = true; - } - }, { - key: '_searchgKeyUp', - value: function _searchgKeyUp(e) { - if (e.key === 'Backspace' && this._deletingText) this._deletingText = false; - } - }, { - key: '_typing', - value: function _typing(e) { - _utilWidgetHelpers.notify(this.props.onSearch, [e.target.value]); - this.open(); - } - }, { - key: '_onSelect', - decorators: [_utilInteraction.widgetEditable], - value: function _onSelect(data) { - - if (data === undefined) { - if (this.props.onCreate) this._onCreate(this.props.searchTerm); - - return; - } - - _utilWidgetHelpers.notify(this.props.onSelect, data); - this.change(this.state.dataItems.concat(data)); - - this.close(); - this._focus(true); - } - }, { - key: '_onCreate', - decorators: [_utilInteraction.widgetEditable], - value: function _onCreate(tag) { - if (tag.trim() === '') return; - - _utilWidgetHelpers.notify(this.props.onCreate, tag); - this.props.searchTerm && _utilWidgetHelpers.notify(this.props.onSearch, ['']); - - this.close(); - this._focus(true); - } - }, { - key: '_keyDown', - decorators: [_utilInteraction.widgetEditable], - value: function _keyDown(e) { - var key = e.key; - var altKey = e.altKey; - var ctrlKey = e.ctrlKey; - var noSearch = !this.props.searchTerm && !this._deletingText; - var isOpen = this.props.open;var _state2 = this.state; - var focusedTag = _state2.focusedTag; - var focusedItem = _state2.focusedItem; - var _refs = this.refs; - var list = _refs.list; - var tagList = _refs.tagList; - - var nullTag = { focusedTag: null }; - - if (key === 'ArrowDown') { - var next = list.next(focusedItem), - creating = this._shouldShowCreate() && focusedItem === next || focusedItem === null; - - next = creating ? null : next; - - e.preventDefault(); - if (isOpen) this.setState(babelHelpers._extends({ focusedItem: next }, nullTag));else this.open(); - } else if (key === 'ArrowUp') { - var prev = focusedItem === null ? list.last() : list.prev(focusedItem); - - e.preventDefault(); - - if (altKey) this.close();else if (isOpen) this.setState(babelHelpers._extends({ focusedItem: prev }, nullTag)); - } else if (key === 'End') { - if (isOpen) this.setState(babelHelpers._extends({ focusedItem: list.last() }, nullTag));else tagList && this.setState({ focusedTag: tagList.last() }); - } else if (key === 'Home') { - if (isOpen) this.setState(babelHelpers._extends({ focusedItem: list.first() }, nullTag));else tagList && this.setState({ focusedTag: tagList.first() }); - } else if (isOpen && key === 'Enter') ctrlKey && this.props.onCreate || focusedItem === null ? this._onCreate(this.props.searchTerm) : this._onSelect(this.state.focusedItem);else if (key === 'Escape') isOpen ? this.close() : tagList && this.setState(nullTag);else if (noSearch && key === 'ArrowLeft') tagList && this.setState({ focusedTag: tagList.prev(focusedTag) });else if (noSearch && key === 'ArrowRight') tagList && this.setState({ focusedTag: tagList.next(focusedTag) });else if (noSearch && key === 'Delete') tagList && tagList.remove(focusedTag);else if (noSearch && key === 'Backspace') tagList && tagList.removeNext(); - - _utilWidgetHelpers.notify(this.props.onKeyDown, [e]); - } - }, { - key: 'change', - decorators: [_utilInteraction.widgetEditable], - value: function change(data) { - _utilWidgetHelpers.notify(this.props.onChange, [data]); - _utilWidgetHelpers.notify(this.props.onSearch, ['']); - } - }, { - key: 'open', - value: function open() { - if (!(this.props.disabled === true || this.props.readOnly === true)) _utilWidgetHelpers.notify(this.props.onToggle, true); - } - }, { - key: 'close', - value: function close() { - _utilWidgetHelpers.notify(this.props.onToggle, false); - } - }, { - key: 'toggle', - value: function toggle() { - this.props.open ? this.close() : this.open(); - } - }, { - key: 'process', - value: function process(data, values, searchTerm) { - var valueField = this.props.valueField; - - var items = data.filter(function (i) { - return !values.some(function (v) { - return _utilDataHelpers.valueMatcher(i, v, valueField); - }); - }); - - if (searchTerm) items = this.filter(items, searchTerm); - - return items; - } - }, { - key: '_shouldShowCreate', - value: function _shouldShowCreate() { - var _props3 = this.props; - var textField = _props3.textField; - var searchTerm = _props3.searchTerm; - var onCreate = _props3.onCreate; - - if (!onCreate || !searchTerm) return false; - - // if there is an exact match on textFields: "john" => { name: "john" }, don't show - return !this._data().some(function (v) { - return _utilDataHelpers.dataText(v, textField) === searchTerm; - }) && !this.state.dataItems.some(function (v) { - return _utilDataHelpers.dataText(v, textField) === searchTerm; - }); - } - }, { - key: '_placeholder', - value: function _placeholder() { - return (this.props.value || []).length ? '' : this.props.placeholder || ''; - } - }])); - - function msgs(msgs) { - return babelHelpers._extends({ - createNew: '(create new tag)', - emptyList: 'There are no items in this list', - emptyFilter: 'The filter returned no results', - tagsLabel: 'selected items', - selectedItems: 'selected items', - removeLabel: 'remove selected item' - }, msgs); - } - - exports['default'] = _uncontrollable2['default'](Multiselect, { open: 'onToggle', value: 'onChange', searchTerm: 'onSearch' }); - module.exports = exports['default']; - -/***/ }, -/* 80 */ -/***/ function(module, exports) { - - 'use strict'; - - module.exports = { - ios: typeof navigator !== 'undefined' && navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/) - }; - -/***/ }, -/* 81 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - exports['default'] = _react2['default'].createClass({ - - displayName: 'MultiselectInput', - - propTypes: { - value: _react2['default'].PropTypes.string, - maxLength: _react2['default'].PropTypes.number, - onChange: _react2['default'].PropTypes.func.isRequired, - onFocus: _react2['default'].PropTypes.func, - - disabled: _utilPropTypes2['default'].disabled, - readOnly: _utilPropTypes2['default'].readOnly - }, - - componentDidUpdate: function componentDidUpdate() { - this.props.focused && this.focus(); - }, - - render: function render() { - var value = this.props.value, - placeholder = this.props.placeholder, - size = Math.max((value || placeholder).length, 1) + 1; - - return _react2['default'].createElement('input', babelHelpers._extends({}, this.props, { - className: 'rw-input', - autoComplete: 'off', - 'aria-disabled': this.props.disabled, - 'aria-readonly': this.props.readOnly, - disabled: this.props.disabled, - readOnly: this.props.readOnly, - size: size - })); - }, - - focus: function focus() { - _utilCompat2['default'].findDOMNode(this).focus(); - } - - }); - module.exports = exports['default']; - -/***/ }, -/* 82 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _utilWidgetHelpers = __webpack_require__(35); - - var _utilDataHelpers = __webpack_require__(34); - - var _utilInteraction = __webpack_require__(45); - - var optionId = function optionId(id, idx) { - return id + '__option__' + idx; - }; - - exports['default'] = _react2['default'].createClass({ - - displayName: 'MultiselectTagList', - - mixins: [__webpack_require__(47), __webpack_require__(37)()], - - propTypes: { - value: _react2['default'].PropTypes.array, - focused: _react2['default'].PropTypes.number, - - valueField: _react2['default'].PropTypes.string, - textField: _utilPropTypes2['default'].accessor, - - valueComponent: _react2['default'].PropTypes.func, - - disabled: _utilPropTypes2['default'].disabled.acceptsArray, - readOnly: _utilPropTypes2['default'].readOnly.acceptsArray - }, - - getDefaultProps: function getDefaultProps() { - return { - ariaActiveDescendantKey: 'taglist' - }; - }, - - componentDidUpdate: function componentDidUpdate() { - var focused = this.props.focused; - var activeId = optionId(_utilWidgetHelpers.instanceId(this), focused); - - this.ariaActiveDescendant(focused == null || _utilInteraction.isDisabledItem(focused, this.props) ? null : activeId); - }, - - render: function render() { - var _this = this; - - var props = _util_2['default'].omit(this.props, ['value', 'disabled', 'readOnly']); - var _props = this.props; - var focused = _props.focused; - var value = _props.value; - var textField = _props.textField; - var ValueComponent = _props.valueComponent; - - var id = _utilWidgetHelpers.instanceId(this); - - return _react2['default'].createElement( - 'ul', - babelHelpers._extends({}, props, { - role: 'listbox', - tabIndex: '-1', - className: 'rw-multiselect-taglist' - }), - value.map(function (item, i) { - var isDisabled = _utilInteraction.isDisabledItem(item, _this.props), - isReadonly = _utilInteraction.isReadOnlyItem(item, _this.props), - isFocused = !isDisabled && focused === i, - currentID = optionId(id, i); - - return _react2['default'].createElement( - 'li', - { - key: i, - id: currentID, - tabIndex: '-1', - role: 'option', - className: _classnames2['default']({ - 'rw-state-focus': isFocused, - 'rw-state-disabled': isDisabled, - 'rw-state-readonly': isReadonly - }) - }, - ValueComponent ? _react2['default'].createElement(ValueComponent, { item: item }) : _utilDataHelpers.dataText(item, textField), - _react2['default'].createElement( - 'span', - { - tabIndex: '-1', - onClick: !(isDisabled || isReadonly) ? _this._delete.bind(null, item) : undefined, - 'aria-disabled': isDisabled, - 'aria-label': 'Unselect', - disabled: isDisabled - }, - _react2['default'].createElement( - 'span', - { className: 'rw-tag-btn', 'aria-hidden': 'true' }, - '×' - ) - ) - ); - }) - ); - }, - - _delete: function _delete(val) { - this.props.onDelete(val); - }, - - remove: function remove(idx) { - var val = this.props.value[idx]; - - if (val && !(_utilInteraction.isDisabledItem(val, this.props) || _utilInteraction.isReadOnlyItem(val, this.props))) this.props.onDelete(val); - }, - - removeNext: function removeNext() { - var val = this.props.value[this.props.value.length - 1]; - - if (val && !(_utilInteraction.isDisabledItem(val, this.props) || _utilInteraction.isReadOnlyItem(val, this.props))) this.props.onDelete(val); - }, - - clear: function clear() { - this.setState({ focused: null }); - }, - - first: function first() { - var idx = 0, - value = this.props.value, - l = value.length; - - while (idx < l && _utilInteraction.isDisabledItem(value[idx], this.props)) idx++; - - return idx !== l ? idx : null; - }, - - last: function last() { - var value = this.props.value, - idx = value.length - 1; - - while (idx > -1 && _utilInteraction.isDisabledItem(value[idx], this.props)) idx--; - - return idx >= 0 ? idx : null; - }, - - next: function next(current) { - var nextIdx = current + 1, - value = this.props.value, - l = value.length; - - while (nextIdx < l && _utilInteraction.isDisabledItem(nextIdx, this.props)) nextIdx++; - - if (current === null || nextIdx >= l) return null; - - return nextIdx; - }, - - prev: function prev(current) { - var nextIdx = current, - value = this.props.value; - - if (nextIdx === null || nextIdx === 0) nextIdx = value.length; - - nextIdx--; - - while (nextIdx > -1 && _utilInteraction.isDisabledItem(value[nextIdx], this.props)) nextIdx--; - - return nextIdx >= 0 ? nextIdx : null; - } - }); - module.exports = exports['default']; - -/***/ }, -/* 83 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _react = __webpack_require__(4); - - var _react2 = babelHelpers.interopRequireDefault(_react); - - var _util_ = __webpack_require__(11); - - var _util_2 = babelHelpers.interopRequireDefault(_util_); - - var _classnames = __webpack_require__(10); - - var _classnames2 = babelHelpers.interopRequireDefault(_classnames); - - var _uncontrollable = __webpack_require__(41); - - var _uncontrollable2 = babelHelpers.interopRequireDefault(_uncontrollable); - - var _utilCompat = __webpack_require__(28); - - var _utilCompat2 = babelHelpers.interopRequireDefault(_utilCompat); - - var _utilPropTypes = __webpack_require__(30); - - var _utilPropTypes2 = babelHelpers.interopRequireDefault(_utilPropTypes); - - var _List = __webpack_require__(32); - - var _List2 = babelHelpers.interopRequireDefault(_List); - - var _utilValidateListInterface = __webpack_require__(40); - - var _utilValidateListInterface2 = babelHelpers.interopRequireDefault(_utilValidateListInterface); - - var _domHelpersUtilScrollTo = __webpack_require__(50); - - var _domHelpersUtilScrollTo2 = babelHelpers.interopRequireDefault(_domHelpersUtilScrollTo); - - var _utilDataHelpers = __webpack_require__(34); - - var _utilInteraction = __webpack_require__(45); - - var _utilWidgetHelpers = __webpack_require__(35); - - var omit = _util_2['default'].omit; - var pick = _util_2['default'].pick; - - var propTypes = { - - data: _react2['default'].PropTypes.array, - value: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.any, _react2['default'].PropTypes.array]), - onChange: _react2['default'].PropTypes.func, - onMove: _react2['default'].PropTypes.func, - - multiple: _react2['default'].PropTypes.bool, - - itemComponent: _utilPropTypes2['default'].elementType, - listComponent: _utilPropTypes2['default'].elementType, - - valueField: _react2['default'].PropTypes.string, - textField: _utilPropTypes2['default'].accessor, - - busy: _react2['default'].PropTypes.bool, - - filter: _react2['default'].PropTypes.string, - delay: _react2['default'].PropTypes.number, - - disabled: _utilPropTypes2['default'].disabled.acceptsArray, - readOnly: _utilPropTypes2['default'].readOnly.acceptsArray, - - messages: _react2['default'].PropTypes.shape({ - emptyList: _react2['default'].PropTypes.string - }) - }; - - var SelectList = _react2['default'].createClass(babelHelpers.createDecoratedObject([{ - key: 'displayName', - initializer: function initializer() { - return 'SelectList'; - } - }, { - key: 'propTypes', - initializer: function initializer() { - return propTypes; - } - }, { - key: 'mixins', - initializer: function initializer() { - return [__webpack_require__(46), __webpack_require__(54), __webpack_require__(37)()]; - } - }, { - key: 'getDefaultProps', - value: function getDefaultProps() { - return { - delay: 250, - value: [], - data: [], - ariaActiveDescendantKey: 'selectlist', - messages: { - emptyList: 'There are no items in this list' - } - }; - } - }, { - key: 'getDefaultState', - value: function getDefaultState(props) { - var data = props.data; - var value = props.value; - var valueField = props.valueField; - var multiple = props.multiple; - var isRadio = !multiple; - var values = _util_2['default'].splat(value); - var first = isRadio && _utilDataHelpers.dataItem(data, values[0], valueField); - - first = isRadio && first ? first : (this.state || {}).focusedItem || null; - - return { - focusedItem: first, - dataItems: !isRadio && values.map(function (item) { - return _utilDataHelpers.dataItem(data, item, valueField); - }) - }; - } - }, { - key: 'getInitialState', - value: function getInitialState() { - var state = this.getDefaultState(this.props); - - state.ListItem = getListItem(this); - - return state; - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - return this.setState(this.getDefaultState(nextProps)); - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - _utilValidateListInterface2['default'](this.refs.list); - } - }, { - key: 'render', - value: function render() { - var _props = this.props; - var className = _props.className; - var tabIndex = _props.tabIndex; - var busy = _props.busy; - var List = _props.listComponent; - - List = List || _List2['default']; - - var elementProps = omit(this.props, Object.keys(propTypes)); - var listProps = pick(this.props, Object.keys(_utilCompat2['default'].type(List).propTypes)); - - var _state = this.state; - var ListItem = _state.ListItem; - var focusedItem = _state.focusedItem; - var focused = _state.focused; - - var items = this._data(), - listID = _utilWidgetHelpers.instanceId(this, '_listbox'); - - focusedItem = focused && !_utilInteraction.isDisabled(this.props) && !_utilInteraction.isReadOnly(this.props) && focusedItem; - - return _react2['default'].createElement( - 'div', - babelHelpers._extends({}, elementProps, { - onKeyDown: this._keyDown, - onFocus: this._focus.bind(null, true), - onBlur: this._focus.bind(null, false), - role: 'radiogroup', - 'aria-busy': !!busy, - 'aria-disabled': _utilInteraction.isDisabled(this.props), - 'aria-readonly': _utilInteraction.isReadOnly(this.props), - tabIndex: '-1', - className: _classnames2['default'](className, 'rw-widget', 'rw-selectlist', { - 'rw-state-focus': focused, - 'rw-state-disabled': _utilInteraction.isDisabled(this.props), - 'rw-state-readonly': _utilInteraction.isReadOnly(this.props), - 'rw-rtl': this.isRtl(), - 'rw-loading-mask': busy - }) - }), - _react2['default'].createElement(List, babelHelpers._extends({}, listProps, { - ref: 'list', - id: listID, - role: 'radiogroup', - tabIndex: tabIndex || '0', - data: items, - focused: focusedItem, - optionComponent: ListItem, - itemComponent: this.props.itemComponent, - onMove: this._scrollTo - })) - ); - } - }, { - key: '_scrollTo', - value: function _scrollTo(selected, list) { - var handler = this.props.onMove; - - if (handler) handler(selected, list);else { - this._scrollCancel && this._scrollCancel(); - // default behavior is to scroll the whole page not just the widget - this._scrollCancel = _domHelpersUtilScrollTo2['default'](selected); - } - } - }, { - key: '_keyDown', - decorators: [_utilInteraction.widgetEditable], - value: function _keyDown(e) { - var _this = this; - - var key = e.key; - var _props2 = this.props; - var valueField = _props2.valueField; - var multiple = _props2.multiple; - var list = this.refs.list; - var focusedItem = this.state.focusedItem; - var props = this.props; - - var moveItem = function moveItem(dir, item) { - return _utilInteraction.move(dir, item, props, list); - }; - var change = function change(item) { - if (item) _this._change(item, multiple ? !_utilInteraction.contains(item, _this._values(), valueField) // toggle value - : true); - }; - - if (key === 'End') { - e.preventDefault(); - - if (multiple) this.setState({ focusedItem: moveItem('prev', null) });else change(moveItem('prev', null)); - } else if (key === 'Home') { - e.preventDefault(); - - if (multiple) this.setState({ focusedItem: moveItem('next', null) });else change(moveItem('next', null)); - } else if (key === 'Enter' || key === ' ') { - e.preventDefault(); - change(focusedItem); - } else if (key === 'ArrowDown' || key === 'ArrowRight') { - e.preventDefault(); - - if (multiple) this.setState({ focusedItem: moveItem('next', focusedItem) });else change(moveItem('next', focusedItem)); - } else if (key === 'ArrowUp' || key === 'ArrowLeft') { - e.preventDefault(); - - if (multiple) this.setState({ focusedItem: moveItem('prev', focusedItem) });else change(moveItem('prev', focusedItem)); - } else if (multiple && e.keyCode === 65 && e.ctrlKey) { - e.preventDefault(); - this._selectAll(); - } else this.search(String.fromCharCode(e.keyCode)); - } - }, { - key: '_selectAll', - value: function _selectAll() { - var _this2 = this; - - var _props3 = this.props; - var disabled = _props3.disabled; - var readOnly = _props3.readOnly; - var valueField = _props3.valueField; - var values = this.state.dataItems; - var data = this._data(); - var blacklist; - - disabled = disabled || readOnly; - disabled = Array.isArray(disabled) ? disabled : []; - //disabled values that are not selected - blacklist = disabled.filter(function (v) { - return !_utilInteraction.contains(v, values, valueField); - }); - data = data.filter(function (v) { - return !_utilInteraction.contains(v, blacklist, valueField); - }); - - if (data.length === values.length) { - data = disabled.filter(function (item) { - return _utilInteraction.contains(item, values, valueField); - }); - data = data.map(function (item) { - return _utilDataHelpers.dataItem(_this2._data(), item, valueField); - }); - } - - _utilWidgetHelpers.notify(this.props.onChange, [data]); - } - }, { - key: '_change', - value: function _change(item, checked) { - var multiple = this.props.multiple; - var values = this.state.dataItems; - - multiple = !!multiple; - - if (!multiple) return _utilWidgetHelpers.notify(this.props.onChange, checked ? item : null); - - values = checked ? values.concat(item) : values.filter(function (v) { - return v !== item; - }); - - _utilWidgetHelpers.notify(this.props.onChange, [values || []]); - } - }, { - key: '_focus', - decorators: [_utilInteraction.widgetEnabled], - value: function _focus(focused, e) { - var _this3 = this; - - if (focused) _utilCompat2['default'].findDOMNode(this.refs.list).focus(); - - this.setTimeout('focus', function () { - if (focused !== _this3.state.focused) { - _utilWidgetHelpers.notify(_this3.props[focused ? 'onFocus' : 'onBlur'], e); - _this3.setState({ focused: focused }); - } - }); - } - }, { - key: 'search', - value: function search(character) { - var _this4 = this; - - var word = ((this._searchTerm || '') + character).toLowerCase(), - list = this.refs.list; - - this._searchTerm = word; - - this.setTimeout('search', function () { - var focusedItem = list.next(_this4.state.focusedItem, word); - - _this4._searchTerm = ''; - - if (focusedItem) _this4.setState({ focusedItem: focusedItem }); - }, this.props.delay); - } - }, { - key: '_data', - value: function _data() { - return this.props.data; - } - }, { - key: '_values', - value: function _values() { - return this.props.multiple ? this.state.dataItems : this.props.value; - } - }])); - - function getListItem(parent) { - - return _react2['default'].createClass({ - - displayName: 'SelectItem', - - render: function render() { - var _props4 = this.props; - var children = _props4.children; - var focused = _props4.focused; - var selected = _props4.selected; - var item = _props4.dataItem; - var props = babelHelpers.objectWithoutProperties(_props4, ['children', 'focused', 'selected', 'dataItem']); - var _parent$props = parent.props; - var multiple = _parent$props.multiple; - var _parent$props$name = _parent$props.name; - var name = _parent$props$name === undefined ? _utilWidgetHelpers.instanceId(parent, '_name') : _parent$props$name; - - var checked = _utilInteraction.contains(item, parent._values(), parent.props.valueField), - change = parent._change.bind(null, item), - disabled = _utilInteraction.isDisabledItem(item, parent.props), - readonly = _utilInteraction.isReadOnlyItem(item, parent.props), - type = multiple ? 'checkbox' : 'radio'; - - return _react2['default'].createElement( - 'li', - babelHelpers._extends({}, props, { - tabIndex: '-1', - role: type, - 'aria-checked': !!checked, - 'aria-disabled': disabled || readonly, - className: _classnames2['default']('rw-list-option', { - 'rw-state-focus': focused, - 'rw-state-selected': selected, - 'rw-state-disabled': disabled, - 'rw-state-readonly': readonly - }) - }), - _react2['default'].createElement( - 'label', - null, - _react2['default'].createElement('input', { - name: name, - tabIndex: '-1', - role: 'presentation', - type: type, - onChange: onChange, - checked: checked, - disabled: disabled || readonly - }), - children - ) - ); - - function onChange(e) { - if (!disabled && !readonly) change(e.target.checked); - } - } - }); - } - - exports['default'] = _uncontrollable2['default'](SelectList, { value: 'onChange' }); - module.exports = exports['default']; - -/***/ }, -/* 84 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - var babelHelpers = __webpack_require__(3); - - exports.__esModule = true; - - var _utilConfiguration = __webpack_require__(23); - - var _utilConfiguration2 = babelHelpers.interopRequireDefault(_utilConfiguration); - - var _utilLocalizers = __webpack_require__(85); - - var _utilLocalizers2 = babelHelpers.interopRequireDefault(_utilLocalizers); - - var NumberLocalizer = _utilLocalizers2['default'].NumberLocalizer; - var DateLocalizer = _utilLocalizers2['default'].DateLocalizer; - exports['default'] = { - - setAnimate: function setAnimate(animatefn) { - _utilConfiguration2['default'].animate = animatefn; - }, - - setLocalizers: function setLocalizers(_ref) { - var date = _ref.date; - var number = _ref.number; - - this.setDateLocalizer(date); - this.setNumberLocalizer(number); - }, - - setDateLocalizer: function setDateLocalizer(spec) { - _utilConfiguration2['default'].locale.date = new DateLocalizer(spec); - }, - - setNumberLocalizer: function setNumberLocalizer(spec) { - _utilConfiguration2['default'].locale.number = new NumberLocalizer(spec); - } - }; - module.exports = exports['default']; - -/***/ }, -/* 85 */ -/***/ function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {'use strict'; - - var babelHelpers = __webpack_require__(3); - - var invariant = __webpack_require__(44); - - var _require = __webpack_require__(11); - - var has = _require.has; - - var React = __webpack_require__(4); - - var REQUIRED_NUMBER_FORMATS = ['default']; - - var localePropType = React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.func]); - - var REQUIRED_DATE_FORMATS = ['default', 'date', 'time', 'header', 'footer', 'dayOfMonth', 'month', 'year', 'decade', 'century']; - - function _format(localizer, formatter, value, format, culture) { - var result = typeof format === 'function' ? format(value, culture, localizer) : formatter.call(localizer, value, format, culture); - - invariant(result == null || typeof result === 'string', '`localizer format(..)` must return a string, null, or undefined'); - - return result; - } - - function checkFormats(requiredFormats, formats) { - if (process.env.NODE_ENV !== 'production') requiredFormats.forEach(function (f) { - return invariant(has(formats, f), 'localizer missing required format: `%s`', f); - }); - } - - var NumberLocalizer = function NumberLocalizer(_ref) { - var _this = this; - - var format = _ref.format; - var parse = _ref.parse; - var precision = _ref.precision; - var formats = _ref.formats; - var propType = _ref.propType; - babelHelpers.classCallCheck(this, NumberLocalizer); - - invariant(typeof format === 'function', 'number localizer `format(..)` must be a function'); - invariant(typeof parse === 'function', 'number localizer `parse(..)` must be a function'); - - // invariant(typeof precision === 'function' - // , 'number localizer `precision(..)` must be a function') - - checkFormats(REQUIRED_NUMBER_FORMATS, formats); - - this.propType = propType || localePropType; - this.formats = formats; - this.precision = precision || function () { - return null; - }; - - this.format = function (value, str, culture) { - return _format(_this, format, value, str, culture); - }; - - this.parse = function (value, culture) { - var result = parse.call(_this, value, culture); - - invariant(result == null || typeof result === 'number', 'number localizer `parse(..)` must return a number, null, or undefined'); - - return result; - }; - }; - - var DateLocalizer = function DateLocalizer(spec) { - var _this2 = this; - - babelHelpers.classCallCheck(this, DateLocalizer); - - invariant(typeof spec.format === 'function', 'date localizer `format(..)` must be a function'); - invariant(typeof spec.parse === 'function', 'date localizer `parse(..)` must be a function'); - invariant(typeof spec.firstOfWeek === 'function', 'date localizer `firstOfWeek(..)` must be a function'); - checkFormats(REQUIRED_DATE_FORMATS, spec.formats); - - this.propType = spec.propType || localePropType; - this.formats = spec.formats; - this.startOfWeek = spec.firstOfWeek; - - this.format = function (value, format, culture) { - return _format(_this2, spec.format, value, format, culture); - }; - - this.parse = function (value, format, culture) { - var result = spec.parse.call(_this2, value, format, culture); - - invariant(result == null || result instanceof Date && !isNaN(result.getTime()), 'date localizer `parse(..)` must return a valid Date, null, or undefined'); - - return result; - }; - }; - - module.exports = { - NumberLocalizer: NumberLocalizer, DateLocalizer: DateLocalizer - }; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) - -/***/ } -/******/ ]) -}); -; \ No newline at end of file diff --git a/docs/vendor/browser.min.js b/docs/vendor/browser.min.js index 92ec082cb..27513757c 100644 --- a/docs/vendor/browser.min.js +++ b/docs/vendor/browser.min.js @@ -1,42 +1,44 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.babel=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&!isFinite(value)){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":30}],2:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);var PLUS_URL_SAFE="-".charCodeAt(0);var SLASH_URL_SAFE="_".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS||code===PLUS_URL_SAFE)return 62;if(code===SLASH||code===SLASH_URL_SAFE)return 63;if(code0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],3:[function(require,module,exports){},{}],4:[function(require,module,exports){arguments[4][3][0].apply(exports,arguments)},{dup:3}],5:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("is-array");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var rootParent={};Buffer.TYPED_ARRAY_SUPPORT=function(){function Foo(){}try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};arr.constructor=Foo;return arr.foo()===42&&arr.constructor===Foo&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Buffer(arg){if(!(this instanceof Buffer)){if(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg)}this.length=0;this.parent=undefined;if(typeof arg==="number"){return fromNumber(this,arg)}if(typeof arg==="string"){return fromString(this,arg,arguments.length>1?arguments[1]:"utf8")}return fromObject(this,arg)}function fromNumber(that,length){that=allocate(that,length<0?0:checked(length)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i>>1;if(fromPool)that.parent=rootParent;return that}function checked(length){if(length>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return length|0}function SlowBuffer(subject,encoding){if(!(this instanceof SlowBuffer))return new SlowBuffer(subject,encoding);var buf=new Buffer(subject,encoding);delete buf.parent;return buf}Buffer.isBuffer=function isBuffer(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function compare(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError("Arguments must be Buffers")}if(a===b)return 0;var x=a.length;var y=b.length;var i=0;var len=Math.min(x,y);while(i>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;function slowToString(encoding,start,end){var loweredCase=false;start=start|0;end=end===undefined||end===Infinity?this.length:end|0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype.toString=function toString(){var length=this.length|0;if(length===0)return"";if(arguments.length===0)return utf8Slice(this,0,length);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function equals(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(this===b)return true;return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function inspect(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return""};Buffer.prototype.compare=function compare(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");if(this===b)return 0;return Buffer.compare(this,b)};Buffer.prototype.indexOf=function indexOf(val,byteOffset){if(byteOffset>2147483647)byteOffset=2147483647;else if(byteOffset<-2147483648)byteOffset=-2147483648;byteOffset>>=0;if(this.length===0)return-1;if(byteOffset>=this.length)return-1;if(byteOffset<0)byteOffset=Math.max(this.length+byteOffset,0);if(typeof val==="string"){if(val.length===0)return-1;return String.prototype.indexOf.call(this,val,byteOffset)}if(Buffer.isBuffer(val)){return arrayIndexOf(this,val,byteOffset)}if(typeof val==="number"){if(Buffer.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,val,byteOffset)}return arrayIndexOf(this,[val],byteOffset)}function arrayIndexOf(arr,val,byteOffset){var foundIndex=-1;for(var i=0;byteOffset+iremaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;iremaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";var loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"binary":return binaryWrite(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;ilen)end=len;var out="";for(var i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function readIntLE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function readFloatLE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||valuebuf.length)throw new RangeError("index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;byteLength=byteLength|0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var mul=1;var i=0;this[offset]=value&255;while(++i=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else{objectWriteUInt16(this,value,offset,true)}return offset+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else{objectWriteUInt16(this,value,offset,false)}return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else{objectWriteUInt32(this,value,offset,true)}return offset+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else{objectWriteUInt32(this,value,offset,false)}return offset+4};Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0;var mul=1;var sub=value<0?1:0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset|0;if(!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1;var mul=1;var sub=value<0?1:0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else{objectWriteUInt16(this,value,offset,true)}return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else{objectWriteUInt16(this,value,offset,false)}return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else{objectWriteUInt32(this,value,offset,true)}return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset|0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else{objectWriteUInt32(this,value,offset,false)}return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||valuebuf.length)throw new RangeError("index out of range");if(offset<0)throw new RangeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert){checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert){checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart=this.length)throw new RangeError("start out of bounds");if(end<0||end>this.length)throw new RangeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i55295&&codePoint<57344){if(leadSurrogate){if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}else{codePoint=leadSurrogate-55296<<10|codePoint-56320|65536;leadSurrogate=null}}else{if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}else{leadSurrogate=codePoint;continue}}}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=null}if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<2097152){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":2,ieee754:8,"is-array":10}],6:[function(require,module,exports){(function(Buffer){function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;function isBuffer(arg){return Buffer.isBuffer(arg)}exports.isBuffer=isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this,require("buffer").Buffer)},{buffer:5}],7:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],8:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128}},{}],9:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],10:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],11:[function(require,module,exports){module.exports=Array.isArray||function(arr){return Object.prototype.toString.call(arr)=="[object Array]"}},{}],12:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i1){for(var i=1;i0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else{if(state.decoder&&!addToFront&&!encoding)chunk=state.decoder.write(chunk);if(!addToFront)state.reading=false;if(state.flowing&&state.length===0&&!state.sync){stream.emit("data",chunk);stream.read(0)}else{state.length+=state.objectMode?1:chunk.length;if(addToFront)state.buffer.unshift(chunk);else state.buffer.push(chunk);if(state.needReadable)emitReadable(stream)}maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM){n=MAX_HWM}else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=roundUpToNextPowerOf2(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else{return state.length}}return n}Readable.prototype.read=function(n){debug("read",n);var state=this._readableState;var nOrig=n;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){debug("read: emitReadable",state.length,state.ended);if(state.length===0&&state.ended)endReadable(this);else emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){if(state.length===0)endReadable(this);return null}var doRead=state.needReadable;debug("need readable",doRead);if(state.length===0||state.length-n0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(nOrig!==n&&state.ended&&state.length===0)endReadable(this);if(ret!==null)this.emit("data",ret);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&typeof chunk!=="string"&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;emitReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug("emitReadable",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream)}}function emitReadable_(stream){debug("emit readable");stream.emit("readable");flow(stream)}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length=length){if(stringMode)ret=list.join("");else ret=Buffer.concat(list,length);list.length=0}else{if(n0)throw new Error("endReadable called on non-empty stream");if(!state.endEmitted){state.ended=true;processNextTick(endReadableNT,state,stream)}}function endReadableNT(state,stream){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}}function forEach(xs,f){for(var i=0,l=xs.length;i-1))throw new TypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=new Buffer(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:5}],27:[function(require,module,exports){exports.isatty=function(){return false};function ReadStream(){throw new Error("tty.ReadStream is not implemented")}exports.ReadStream=ReadStream;function WriteStream(){throw new Error("tty.ReadStream is not implemented")}exports.WriteStream=WriteStream},{}],28:[function(require,module,exports){(function(global){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){if(!global.localStorage)return false;var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],29:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],30:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":29,_process:14,inherits:9}],31:[function(require,module,exports){(function(global){"use strict";require("./node");var transform=module.exports=require("../transformation");transform.options=require("../transformation/file/options");transform.version=require("../../package").version;transform.transform=transform;transform.run=function(code){var opts=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];opts.sourceMaps="inline";return new Function(transform(code,opts).code)()};transform.load=function(url,callback,opts,hold){if(opts===undefined)opts={};opts.filename=opts.filename||url;var xhr=global.ActiveXObject?new global.ActiveXObject("Microsoft.XMLHTTP"):new global.XMLHttpRequest;xhr.open("GET",url,true);if("overrideMimeType"in xhr)xhr.overrideMimeType("text/plain");xhr.onreadystatechange=function(){if(xhr.readyState!==4)return;var status=xhr.status;if(status===0||status===200){var param=[xhr.responseText,opts];if(!hold)transform.run.apply(transform,param);if(callback)callback(param)}else{throw new Error("Could not load "+url)}};xhr.send(null)};var runScripts=function runScripts(){var scripts=[];var types=["text/ecmascript-6","text/6to5","text/babel","module"];var index=0;var exec=function exec(){var param=scripts[index];if(param instanceof Array){transform.run.apply(transform,param);index++;exec()}};var run=function run(script,i){var opts={};if(script.src){transform.load(script.src,function(param){scripts[i]=param;exec()},opts,true)}else{opts.filename="embedded";scripts[i]=[script.innerHTML,opts]}};var _scripts=global.document.getElementsByTagName("script");for(var i=0;i<_scripts.length;++i){var _script=_scripts[i];if(types.indexOf(_script.type)>=0)scripts.push(_script)}for(i in scripts){run(scripts[i],i)}exec()};if(global.addEventListener){global.addEventListener("DOMContentLoaded",runScripts,false)}else if(global.attachEvent){global.attachEvent("onload",runScripts)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../../package":537,"../transformation":83,"../transformation/file/options":66,"./node":32}],32:[function(require,module,exports){"use strict";exports.__esModule=true;exports.register=register;exports.polyfill=polyfill;exports.transformFile=transformFile;exports.transformFileSync=transformFileSync;exports.parse=parse;function _interopRequire(obj){return obj&&obj.__esModule?obj["default"]:obj}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashLangIsFunction=require("lodash/lang/isFunction");var _lodashLangIsFunction2=_interopRequireDefault(_lodashLangIsFunction);var _transformation=require("../transformation");var _transformation2=_interopRequireDefault(_transformation);var _babylon=require("babylon");var babylon=_interopRequireWildcard(_babylon);var _util=require("../util");var util=_interopRequireWildcard(_util);var _fs=require("fs");var _fs2=_interopRequireDefault(_fs);var _types=require("../types");var t=_interopRequireWildcard(_types);exports.util=util;exports.acorn=babylon;exports.transform=_transformation2["default"];exports.pipeline=_transformation.pipeline;exports.canCompile=_util.canCompile;var _transformationFile=require("../transformation/file");exports.File=_interopRequire(_transformationFile);var _transformationFileOptionsConfig=require("../transformation/file/options/config");exports.options=_interopRequire(_transformationFileOptionsConfig);var _transformationPlugin=require("../transformation/plugin");exports.Plugin=_interopRequire(_transformationPlugin);var _transformationTransformer=require("../transformation/transformer");exports.Transformer=_interopRequire(_transformationTransformer);var _transformationPipeline=require("../transformation/pipeline");exports.Pipeline=_interopRequire(_transformationPipeline);var _traversal=require("../traversal");exports.traverse=_interopRequire(_traversal);var _toolsBuildExternalHelpers=require("../tools/build-external-helpers");exports.buildExternalHelpers=_interopRequire(_toolsBuildExternalHelpers);var _package=require("../../package");exports.version=_package.version;exports.types=t;function register(opts){var callback=require("./register/node-polyfill");if(opts!=null)callback(opts);return callback}function polyfill(){require("../polyfill")}function transformFile(filename,opts,callback){if(_lodashLangIsFunction2["default"](opts)){callback=opts;opts={}}opts.filename=filename; -_fs2["default"].readFile(filename,function(err,code){if(err)return callback(err);var result;try{result=_transformation2["default"](code,opts)}catch(err){return callback(err)}callback(null,result)})}function transformFileSync(filename){var opts=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];opts.filename=filename;return _transformation2["default"](_fs2["default"].readFileSync(filename,"utf8"),opts)}function parse(code){var opts=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];opts.allowHashBang=true;opts.sourceType="module";opts.ecmaVersion=Infinity;opts.plugins={jsx:true,flow:true};opts.features={};for(var key in _transformation2["default"].pipeline.transformers){opts.features[key]=true}var ast=babylon.parse(code,opts);if(opts.onToken){var _opts$onToken;(_opts$onToken=opts.onToken).push.apply(_opts$onToken,ast.tokens)}if(opts.onComment){var _opts$onComment;(_opts$onComment=opts.onComment).push.apply(_opts$onComment,ast.comments)}return ast.program}},{"../../package":537,"../polyfill":61,"../tools/build-external-helpers":62,"../transformation":83,"../transformation/file":63,"../transformation/file/options/config":65,"../transformation/pipeline":97,"../transformation/plugin":99,"../transformation/transformer":100,"../traversal":165,"../types":196,"../util":199,"./register/node-polyfill":34,babylon:539,fs:4,"lodash/lang/isFunction":432}],33:[function(require,module,exports){"use strict";exports.__esModule=true;require("../../polyfill");exports["default"]=function(){};module.exports=exports["default"]},{"../../polyfill":61}],34:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequire(obj){return obj&&obj.__esModule?obj["default"]:obj}require("../../polyfill");var _node=require("./node");exports["default"]=_interopRequire(_node);module.exports=exports["default"]},{"../../polyfill":61,"./node":33}],35:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _repeating=require("repeating");var _repeating2=_interopRequireDefault(_repeating);var _trimRight=require("trim-right");var _trimRight2=_interopRequireDefault(_trimRight);var _lodashLangIsBoolean=require("lodash/lang/isBoolean");var _lodashLangIsBoolean2=_interopRequireDefault(_lodashLangIsBoolean);var _lodashCollectionIncludes=require("lodash/collection/includes");var _lodashCollectionIncludes2=_interopRequireDefault(_lodashCollectionIncludes);var _lodashLangIsNumber=require("lodash/lang/isNumber");var _lodashLangIsNumber2=_interopRequireDefault(_lodashLangIsNumber);var Buffer=function(){function Buffer(position,format){_classCallCheck(this,Buffer);this.parenPushNewlineState=null;this.position=position;this._indent=format.indent.base;this.format=format;this.buf=""}Buffer.prototype.get=function get(){return _trimRight2["default"](this.buf)};Buffer.prototype.getIndent=function getIndent(){if(this.format.compact||this.format.concise){return""}else{return _repeating2["default"](this.format.indent.style,this._indent)}};Buffer.prototype.indentSize=function indentSize(){return this.getIndent().length};Buffer.prototype.indent=function indent(){this._indent++};Buffer.prototype.dedent=function dedent(){this._indent--};Buffer.prototype.semicolon=function semicolon(){this.push(";")};Buffer.prototype.ensureSemicolon=function ensureSemicolon(){if(!this.isLast(";"))this.semicolon()};Buffer.prototype.rightBrace=function rightBrace(){this.newline(true);this.push("}")};Buffer.prototype.keyword=function keyword(name){this.push(name);this.space()};Buffer.prototype.space=function space(force){if(!force&&this.format.compact)return;if(force||this.buf&&!this.isLast(" ")&&!this.isLast("\n")){this.push(" ")}};Buffer.prototype.removeLast=function removeLast(cha){if(this.format.compact)return;if(!this.isLast(cha))return;this.buf=this.buf.substr(0,this.buf.length-1);this.position.unshift(cha)};Buffer.prototype.startTerminatorless=function startTerminatorless(){return this.parenPushNewlineState={printed:false}};Buffer.prototype.endTerminatorless=function endTerminatorless(state){if(state.printed){this.dedent();this.newline();this.push(")")}};Buffer.prototype.newline=function newline(i,removeLast){if(this.format.compact||this.format.retainLines)return;if(this.format.concise){this.space();return}removeLast=removeLast||false;if(_lodashLangIsNumber2["default"](i)){i=Math.min(2,i);if(this.endsWith("{\n")||this.endsWith(":\n"))i--;if(i<=0)return;while(i>0){this._newline(removeLast);i--}return}if(_lodashLangIsBoolean2["default"](i)){removeLast=i}this._newline(removeLast)};Buffer.prototype._newline=function _newline(removeLast){if(this.endsWith("\n\n"))return;if(removeLast&&this.isLast("\n"))this.removeLast("\n");this.removeLast(" ");this._removeSpacesAfterLastNewline();this._push("\n")};Buffer.prototype._removeSpacesAfterLastNewline=function _removeSpacesAfterLastNewline(){var lastNewlineIndex=this.buf.lastIndexOf("\n");if(lastNewlineIndex===-1){return}var index=this.buf.length-1;while(index>lastNewlineIndex){if(this.buf[index]!==" "){break}index--}if(index===lastNewlineIndex){this.buf=this.buf.substring(0,index+1)}};Buffer.prototype.push=function push(str,noIndent){if(!this.format.compact&&this._indent&&!noIndent&&str!=="\n"){var indent=this.getIndent();str=str.replace(/\n/g,"\n"+indent);if(this.isLast("\n"))this._push(indent)}this._push(str)};Buffer.prototype._push=function _push(str){var parenPushNewlineState=this.parenPushNewlineState;if(parenPushNewlineState){for(var i=0;i")}this.space();print.plain(node.returnType)}function FunctionTypeParam(node,print){print.plain(node.name);if(node.optional)this.push("?");this.push(":");this.space();print.plain(node.typeAnnotation)}function InterfaceExtends(node,print){print.plain(node.id);print.plain(node.typeParameters)}exports.ClassImplements=InterfaceExtends;exports.GenericTypeAnnotation=InterfaceExtends;function _interfaceish(node,print){print.plain(node.id);print.plain(node.typeParameters);if(node["extends"].length){this.push(" extends ");print.join(node["extends"],{separator:", "})}this.space();print.plain(node.body)}function InterfaceDeclaration(node,print){this.push("interface ");this._interfaceish(node,print)}function IntersectionTypeAnnotation(node,print){print.join(node.types,{separator:" & "})}function MixedTypeAnnotation(){this.push("mixed")}function NullableTypeAnnotation(node,print){this.push("?");print.plain(node.typeAnnotation)}var _types2=require("./types");exports.NumberLiteralTypeAnnotation=_types2.Literal;function NumberTypeAnnotation(){this.push("number")}function StringLiteralTypeAnnotation(node){this.push(this._stringLiteral(node.value))}function StringTypeAnnotation(){this.push("string")}function TupleTypeAnnotation(node,print){this.push("[");print.join(node.types,{separator:", "});this.push("]")}function TypeofTypeAnnotation(node,print){this.push("typeof ");print.plain(node.argument)}function TypeAlias(node,print){this.push("type ");print.plain(node.id);print.plain(node.typeParameters);this.space();this.push("=");this.space();print.plain(node.right);this.semicolon()}function TypeAnnotation(node,print){this.push(":");this.space();if(node.optional)this.push("?");print.plain(node.typeAnnotation)}function TypeParameterInstantiation(node,print){this.push("<");print.join(node.params,{separator:", ",iterator:function iterator(node){print.plain(node.typeAnnotation)}});this.push(">")}exports.TypeParameterDeclaration=TypeParameterInstantiation;function ObjectTypeAnnotation(node,print){var _this=this;this.push("{");var props=node.properties.concat(node.callProperties,node.indexers);if(props.length){this.space();print.list(props,{separator:false,indent:true,iterator:function iterator(){if(props.length!==1){_this.semicolon();_this.space()}}});this.space()}this.push("}")}function ObjectTypeCallProperty(node,print){if(node["static"])this.push("static ");print.plain(node.value)}function ObjectTypeIndexer(node,print){if(node["static"])this.push("static ");this.push("[");print.plain(node.id);this.push(":");this.space();print.plain(node.key);this.push("]");this.push(":");this.space();print.plain(node.value)}function ObjectTypeProperty(node,print){if(node["static"])this.push("static ");print.plain(node.key);if(node.optional)this.push("?");if(!t.isFunctionTypeAnnotation(node.value)){this.push(":");this.space()}print.plain(node.value)}function QualifiedTypeIdentifier(node,print){print.plain(node.qualification);this.push(".");print.plain(node.id)}function UnionTypeAnnotation(node,print){print.join(node.types,{separator:" | "})}function TypeCastExpression(node,print){this.push("(");print.plain(node.expression);print.plain(node.typeAnnotation);this.push(")")}function VoidTypeAnnotation(node){this.push("void")}},{"../../types":196,"./types":46}],41:[function(require,module,exports){"use strict";exports.__esModule=true;exports.JSXAttribute=JSXAttribute;exports.JSXIdentifier=JSXIdentifier;exports.JSXNamespacedName=JSXNamespacedName;exports.JSXMemberExpression=JSXMemberExpression;exports.JSXSpreadAttribute=JSXSpreadAttribute;exports.JSXExpressionContainer=JSXExpressionContainer;exports.JSXElement=JSXElement;exports.JSXOpeningElement=JSXOpeningElement;exports.JSXClosingElement=JSXClosingElement;exports.JSXEmptyExpression=JSXEmptyExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);function JSXAttribute(node,print){print.plain(node.name);if(node.value){this.push("=");print.plain(node.value)}}function JSXIdentifier(node){this.push(node.name)}function JSXNamespacedName(node,print){print.plain(node.namespace);this.push(":");print.plain(node.name)}function JSXMemberExpression(node,print){print.plain(node.object);this.push(".");print.plain(node.property)}function JSXSpreadAttribute(node,print){this.push("{...");print.plain(node.argument);this.push("}")}function JSXExpressionContainer(node,print){this.push("{");print.plain(node.expression);this.push("}")}function JSXElement(node,print){var open=node.openingElement;print.plain(open);if(open.selfClosing)return;this.indent();var _arr=node.children;for(var _i=0;_i<_arr.length;_i++){var child=_arr[_i];if(t.isLiteral(child)){this.push(child.value,true)}else{print.plain(child)}}this.dedent();print.plain(node.closingElement)}function JSXOpeningElement(node,print){this.push("<");print.plain(node.name);if(node.attributes.length>0){this.push(" ");print.join(node.attributes,{separator:" "})}this.push(node.selfClosing?" />":">")}function JSXClosingElement(node,print){this.push("")}function JSXEmptyExpression(){}},{"../../types":196}],42:[function(require,module,exports){"use strict";exports.__esModule=true;exports._params=_params;exports._method=_method;exports.FunctionExpression=FunctionExpression;exports.ArrowFunctionExpression=ArrowFunctionExpression;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);function _params(node,print){var _this=this;print.plain(node.typeParameters);this.push("(");print.list(node.params,{iterator:function iterator(node){if(node.optional)_this.push("?");print.plain(node.typeAnnotation)}});this.push(")");if(node.returnType){print.plain(node.returnType)}}function _method(node,print){var value=node.value;var kind=node.kind;var key=node.key;if(kind==="method"||kind==="init"){if(value.generator){this.push("*")}}if(kind==="get"||kind==="set"){this.push(kind+" ")}if(value.async)this.push("async ");if(node.computed){this.push("[");print.plain(key);this.push("]")}else{print.plain(key)}this._params(value,print);this.space();print.plain(value.body)}function FunctionExpression(node,print){if(node.async)this.push("async ");this.push("function");if(node.generator)this.push("*");if(node.id){this.push(" ");print.plain(node.id)}else{this.space()}this._params(node,print);this.space();print.plain(node.body)}exports.FunctionDeclaration=FunctionExpression;function ArrowFunctionExpression(node,print){if(node.async)this.push("async ");if(node.params.length===1&&t.isIdentifier(node.params[0])){print.plain(node.params[0])}else{this._params(node,print)}this.push(" => ");var bodyNeedsParens=t.isObjectExpression(node.body);if(bodyNeedsParens){this.push("(")}print.plain(node.body);if(bodyNeedsParens){this.push(")")}}},{"../../types":196}],43:[function(require,module,exports){"use strict";exports.__esModule=true;exports.ImportSpecifier=ImportSpecifier;exports.ImportDefaultSpecifier=ImportDefaultSpecifier;exports.ExportDefaultSpecifier=ExportDefaultSpecifier;exports.ExportSpecifier=ExportSpecifier;exports.ExportNamespaceSpecifier=ExportNamespaceSpecifier;exports.ExportAllDeclaration=ExportAllDeclaration;exports.ExportNamedDeclaration=ExportNamedDeclaration;exports.ExportDefaultDeclaration=ExportDefaultDeclaration;exports.ImportDeclaration=ImportDeclaration;exports.ImportNamespaceSpecifier=ImportNamespaceSpecifier;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);function ImportSpecifier(node,print){print.plain(node.imported);if(node.local&&node.local.name!==node.imported.name){this.push(" as ");print.plain(node.local)}}function ImportDefaultSpecifier(node,print){print.plain(node.local)}function ExportDefaultSpecifier(node,print){print.plain(node.exported)}function ExportSpecifier(node,print){print.plain(node.local);if(node.exported&&node.local.name!==node.exported.name){this.push(" as ");print.plain(node.exported)}}function ExportNamespaceSpecifier(node,print){this.push("* as ");print.plain(node.exported)}function ExportAllDeclaration(node,print){this.push("export *");if(node.exported){this.push(" as ");print.plain(node.exported)}this.push(" from ");print.plain(node.source);this.semicolon()}function ExportNamedDeclaration(node,print){this.push("export ");ExportDeclaration.call(this,node,print)}function ExportDefaultDeclaration(node,print){this.push("export default ");ExportDeclaration.call(this,node,print)}function ExportDeclaration(node,print){var specifiers=node.specifiers;if(node.declaration){var declar=node.declaration;print.plain(declar);if(t.isStatement(declar)||t.isFunction(declar)||t.isClass(declar))return}else{if(node.exportKind==="type"){this.push("type ")}var first=specifiers[0];var hasSpecial=false;if(t.isExportDefaultSpecifier(first)||t.isExportNamespaceSpecifier(first)){hasSpecial=true;print.plain(specifiers.shift());if(specifiers.length){this.push(", ")}}if(specifiers.length||!specifiers.length&&!hasSpecial){this.push("{");if(specifiers.length){this.space();print.join(specifiers,{separator:", "});this.space()}this.push("}")}if(node.source){this.push(" from ");print.plain(node.source)}}this.ensureSemicolon()}function ImportDeclaration(node,print){this.push("import ");if(node.importKind==="type"||node.importKind==="typeof"){this.push(node.importKind+" ")}var specfiers=node.specifiers;if(specfiers&&specfiers.length){var first=node.specifiers[0];if(t.isImportDefaultSpecifier(first)||t.isImportNamespaceSpecifier(first)){print.plain(node.specifiers.shift());if(node.specifiers.length){this.push(", ")}}if(node.specifiers.length){this.push("{");this.space();print.join(node.specifiers,{separator:", "});this.space();this.push("}")}this.push(" from ")}print.plain(node.source);this.semicolon()}function ImportNamespaceSpecifier(node,print){this.push("* as ");print.plain(node.local)}},{"../../types":196}],44:[function(require,module,exports){"use strict";exports.__esModule=true;exports.WithStatement=WithStatement;exports.IfStatement=IfStatement;exports.ForStatement=ForStatement;exports.WhileStatement=WhileStatement;exports.DoWhileStatement=DoWhileStatement;exports.LabeledStatement=LabeledStatement;exports.TryStatement=TryStatement;exports.CatchClause=CatchClause;exports.SwitchStatement=SwitchStatement;exports.SwitchCase=SwitchCase;exports.DebuggerStatement=DebuggerStatement;exports.VariableDeclaration=VariableDeclaration;exports.VariableDeclarator=VariableDeclarator;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _repeating=require("repeating");var _repeating2=_interopRequireDefault(_repeating);var _types=require("../../types");var t=_interopRequireWildcard(_types);function WithStatement(node,print){this.keyword("with");this.push("(");print.plain(node.object);this.push(")");print.block(node.body)}function IfStatement(node,print){this.keyword("if");this.push("(");print.plain(node.test);this.push(")");this.space();print.indentOnComments(node.consequent);if(node.alternate){if(this.isLast("}"))this.space();this.push("else ");print.indentOnComments(node.alternate)}}function ForStatement(node,print){this.keyword("for");this.push("(");print.plain(node.init);this.push(";");if(node.test){this.space();print.plain(node.test)}this.push(";");if(node.update){this.space();print.plain(node.update)}this.push(")");print.block(node.body)}function WhileStatement(node,print){this.keyword("while");this.push("(");print.plain(node.test);this.push(")");print.block(node.body)}var buildForXStatement=function buildForXStatement(op){return function(node,print){this.keyword("for");this.push("(");print.plain(node.left);this.push(" "+op+" ");print.plain(node.right);this.push(")");print.block(node.body)}};var ForInStatement=buildForXStatement("in");exports.ForInStatement=ForInStatement;var ForOfStatement=buildForXStatement("of");exports.ForOfStatement=ForOfStatement;function DoWhileStatement(node,print){this.push("do ");print.plain(node.body);this.space();this.keyword("while");this.push("(");print.plain(node.test);this.push(");")}var buildLabelStatement=function buildLabelStatement(prefix){var key=arguments.length<=1||arguments[1]===undefined?"label":arguments[1];return function(node,print){this.push(prefix);var label=node[key];if(label){this.push(" ");var terminatorState=this.startTerminatorless();print.plain(label);this.endTerminatorless(terminatorState)}this.semicolon()}};var ContinueStatement=buildLabelStatement("continue");exports.ContinueStatement=ContinueStatement;var ReturnStatement=buildLabelStatement("return","argument");exports.ReturnStatement=ReturnStatement;var BreakStatement=buildLabelStatement("break");exports.BreakStatement=BreakStatement;var ThrowStatement=buildLabelStatement("throw","argument");exports.ThrowStatement=ThrowStatement;function LabeledStatement(node,print){print.plain(node.label);this.push(": ");print.plain(node.body)}function TryStatement(node,print){this.keyword("try");print.plain(node.block);this.space();if(node.handlers){print.plain(node.handlers[0])}else{print.plain(node.handler)}if(node.finalizer){this.space();this.push("finally ");print.plain(node.finalizer)}}function CatchClause(node,print){this.keyword("catch");this.push("(");print.plain(node.param);this.push(") ");print.plain(node.body)}function SwitchStatement(node,print){this.keyword("switch");this.push("(");print.plain(node.discriminant);this.push(")");this.space();this.push("{");print.sequence(node.cases,{indent:true,addNewlines:function addNewlines(leading,cas){if(!leading&&node.cases[node.cases.length-1]===cas)return-1}});this.push("}")}function SwitchCase(node,print){if(node.test){this.push("case ");print.plain(node.test);this.push(":")}else{this.push("default:")}if(node.consequent.length){this.newline();print.sequence(node.consequent,{indent:true})}}function DebuggerStatement(){this.push("debugger;")}function VariableDeclaration(node,print,parent){ -this.push(node.kind+" ");var hasInits=false;if(!t.isFor(parent)){var _arr=node.declarations;for(var _i=0;_i<_arr.length;_i++){var declar=_arr[_i];if(declar.init){hasInits=true}}}var sep;if(!this.format.compact&&!this.format.concise&&hasInits&&!this.format.retainLines){sep=",\n"+_repeating2["default"](" ",node.kind.length+1)}print.list(node.declarations,{separator:sep});if(t.isFor(parent)){if(parent.left===node||parent.init===node)return}this.semicolon()}function VariableDeclarator(node,print){print.plain(node.id);print.plain(node.id.typeAnnotation);if(node.init){this.space();this.push("=");this.space();print.plain(node.init)}}},{"../../types":196,repeating:517}],45:[function(require,module,exports){"use strict";exports.__esModule=true;exports.TaggedTemplateExpression=TaggedTemplateExpression;exports.TemplateElement=TemplateElement;exports.TemplateLiteral=TemplateLiteral;function TaggedTemplateExpression(node,print){print.plain(node.tag);print.plain(node.quasi)}function TemplateElement(node){this._push(node.value.raw)}function TemplateLiteral(node,print){this.push("`");var quasis=node.quasis;var len=quasis.length;for(var i=0;i0)this.space();print.plain(elem);if(i1e5;if(format.compact){console.error("[BABEL] "+messages.get("codeGeneratorDeopt",opts.filename,"100KB"))}}if(format.compact){format.indent.adjustMultilineComment=false}return format};CodeGenerator.findCommonStringDelimiter=function findCommonStringDelimiter(code,tokens){var occurences={single:0,"double":0};var checked=0;for(var i=0;i=3)break}if(occurences.single>occurences.double){return"single"}else{return"double"}};CodeGenerator.prototype.generate=function generate(){var ast=this.ast;this.print(ast);if(ast.comments){var comments=[];var _arr=ast.comments;for(var _i=0;_i<_arr.length;_i++){var comment=_arr[_i];if(!comment._displayed)comments.push(comment)}this._printComments(comments)}return{map:this.map.get(),code:this.buffer.get()}};CodeGenerator.prototype.buildPrint=function buildPrint(parent){return new _nodePrinter2["default"](this,parent)};CodeGenerator.prototype.catchUp=function catchUp(node){if(node.loc&&this.format.retainLines&&this.buffer.buf){while(this.position.line=0||comment.value.indexOf("@preserve")>=0){return true}else{return this.format.comments}}};CodeGenerator.prototype._printComments=function _printComments(comments){if(!comments||!comments.length)return;var _arr3=comments;for(var _i3=0;_i3<_arr3.length;_i3++){var comment=_arr3[_i3];if(!this.shouldPrintComment(comment))continue;if(comment._displayed)continue;comment._displayed=true;this.catchUp(comment);this.newline(this.whitespace.getNewlinesBefore(comment));var column=this.position.column;var val=this.generateComment(comment);if(column&&!this.isLast(["\n"," ","[","{"])){this._push(" ");column++}if(comment.type==="CommentBlock"&&this.format.indent.adjustMultilineComment){var offset=comment.loc&&comment.loc.start.column;if(offset){var newlineRegex=new RegExp("\\n\\s{1,"+offset+"}","g");val=val.replace(newlineRegex,"\n")}var indent=Math.max(this.indentSize(),column);val=val.replace(/\n/g,"\n"+_repeating2["default"](" ",indent))}if(column===0){val=this.getIndent()+val}if((this.format.compact||this.format.retainLines)&&comment.type==="CommentLine"){val+="\n"}this._push(val);this.newline(this.whitespace.getNewlinesAfter(comment))}};_createClass(CodeGenerator,null,[{key:"generators",value:{templateLiterals:require("./generators/template-literals"),comprehensions:require("./generators/comprehensions"),expressions:require("./generators/expressions"),statements:require("./generators/statements"),classes:require("./generators/classes"),methods:require("./generators/methods"),modules:require("./generators/modules"),types:require("./generators/types"),flow:require("./generators/flow"),base:require("./generators/base"),jsx:require("./generators/jsx")},enumerable:true}]);return CodeGenerator}();_lodashCollectionEach2["default"](_buffer2["default"].prototype,function(fn,key){CodeGenerator.prototype[key]=function(){return fn.apply(this.buffer,arguments)}});_lodashCollectionEach2["default"](CodeGenerator.generators,function(generator){_lodashObjectExtend2["default"](CodeGenerator.prototype,generator)});module.exports=function(ast,opts,code){var gen=new CodeGenerator(ast,opts,code);return gen.generate()};module.exports.CodeGenerator=CodeGenerator},{"../messages":60,"../types":196,"./buffer":35,"./generators/base":36,"./generators/classes":37,"./generators/comprehensions":38,"./generators/expressions":39,"./generators/flow":40,"./generators/jsx":41,"./generators/methods":42,"./generators/modules":43,"./generators/statements":44,"./generators/template-literals":45,"./generators/types":46,"./node":48,"./node/printer":50,"./position":52,"./source-map":53,"./whitespace":54,"detect-indent":318,"lodash/collection/each":343,"lodash/object/extend":443,repeating:517}],48:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _whitespace=require("./whitespace");var _whitespace2=_interopRequireDefault(_whitespace);var _parentheses=require("./parentheses");var parens=_interopRequireWildcard(_parentheses);var _lodashCollectionEach=require("lodash/collection/each");var _lodashCollectionEach2=_interopRequireDefault(_lodashCollectionEach);var _lodashCollectionSome=require("lodash/collection/some");var _lodashCollectionSome2=_interopRequireDefault(_lodashCollectionSome);var _types=require("../../types");var t=_interopRequireWildcard(_types);var find=function find(obj,node,parent){if(!obj)return;var result;var types=Object.keys(obj);for(var i=0;i","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],function(tier,i){_lodashCollectionEach2["default"](tier,function(op){PRECEDENCE[op]=i})});function NullableTypeAnnotation(node,parent){return t.isArrayTypeAnnotation(parent)}exports.FunctionTypeAnnotation=NullableTypeAnnotation;function UpdateExpression(node,parent){if(t.isMemberExpression(parent)&&parent.object===node){return true}}function ObjectExpression(node,parent){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}return false}function Binary(node,parent){if((t.isCallExpression(parent)||t.isNewExpression(parent))&&parent.callee===node){return true}if(t.isUnaryLike(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isBinary(parent)){var parentOp=parent.operator;var parentPos=PRECEDENCE[parentOp];var nodeOp=node.operator;var nodePos=PRECEDENCE[nodeOp];if(parentPos>nodePos){return true}if(parentPos===nodePos&&parent.right===node){return true}}}function BinaryExpression(node,parent){if(node.operator==="in"){if(t.isVariableDeclarator(parent)){return true}if(t.isFor(parent)){return true}}}function SequenceExpression(node,parent){if(t.isForStatement(parent)){return false}if(t.isExpressionStatement(parent)&&parent.expression===node){return false}return true}function YieldExpression(node,parent){return t.isBinary(parent)||t.isUnaryLike(parent)||t.isCallExpression(parent)||t.isMemberExpression(parent)||t.isNewExpression(parent)||t.isConditionalExpression(parent)||t.isYieldExpression(parent)}function ClassExpression(node,parent){return t.isExpressionStatement(parent)}function UnaryLike(node,parent){return t.isMemberExpression(parent)&&parent.object===node}function FunctionExpression(node,parent){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}}function ConditionalExpression(node,parent){if(t.isUnaryLike(parent)){return true}if(t.isBinary(parent)){return true}if(t.isCallExpression(parent)||t.isNewExpression(parent)){if(parent.callee===node){return true}}if(t.isConditionalExpression(parent)&&parent.test===node){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}return false}function AssignmentExpression(node){if(t.isObjectPattern(node.left)){return true}else{return ConditionalExpression.apply(undefined,arguments)}}},{"../../types":196,"lodash/collection/each":343}],50:[function(require,module,exports){"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var NodePrinter=function(){function NodePrinter(generator,parent){_classCallCheck(this,NodePrinter);this.generator=generator;this.parent=parent}NodePrinter.prototype.printInnerComments=function printInnerComments(){if(!this.parent.innerComments)return;var gen=this.generator;gen.indent();gen._printComments(this.parent.innerComments);gen.dedent()};NodePrinter.prototype.plain=function plain(node,opts){return this.generator.print(node,this.parent,opts)};NodePrinter.prototype.sequence=function sequence(nodes){var opts=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];opts.statement=true;return this.generator.printJoin(this,nodes,opts)};NodePrinter.prototype.join=function join(nodes,opts){return this.generator.printJoin(this,nodes,opts)};NodePrinter.prototype.list=function list(items){var opts=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];if(opts.separator==null){opts.separator=",";if(!this.generator.format.compact)opts.separator+=" "}return this.join(items,opts)};NodePrinter.prototype.block=function block(node){return this.generator.printBlock(this,node)};NodePrinter.prototype.indentOnComments=function indentOnComments(node){return this.generator.printAndIndentOnComments(this,node)};return NodePrinter}();exports["default"]=NodePrinter;module.exports=exports["default"]},{}],51:[function(require,module,exports){"use strict";function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashLangIsBoolean=require("lodash/lang/isBoolean");var _lodashLangIsBoolean2=_interopRequireDefault(_lodashLangIsBoolean);var _lodashCollectionEach=require("lodash/collection/each");var _lodashCollectionEach2=_interopRequireDefault(_lodashCollectionEach);var _lodashCollectionMap=require("lodash/collection/map");var _lodashCollectionMap2=_interopRequireDefault(_lodashCollectionMap);var _types=require("../../types");var t=_interopRequireWildcard(_types);function crawl(node){var state=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];if(t.isMemberExpression(node)){crawl(node.object,state);if(node.computed)crawl(node.property,state)}else if(t.isBinary(node)||t.isAssignmentExpression(node)){crawl(node.left,state);crawl(node.right,state)}else if(t.isCallExpression(node)){state.hasCall=true;crawl(node.callee,state)}else if(t.isFunction(node)){state.hasFunction=true}else if(t.isIdentifier(node)){state.hasHelper=state.hasHelper||isHelper(node.callee)}return state}function isHelper(node){if(t.isMemberExpression(node)){return isHelper(node.object)||isHelper(node.property)}else if(t.isIdentifier(node)){return node.name==="require"||node.name[0]==="_"}else if(t.isCallExpression(node)){return isHelper(node.callee)}else if(t.isBinary(node)||t.isAssignmentExpression(node)){return t.isIdentifier(node.left)&&isHelper(node.left)||isHelper(node.right)}else{return false}}function isType(node){return t.isLiteral(node)||t.isObjectExpression(node)||t.isArrayExpression(node)||t.isIdentifier(node)||t.isMemberExpression(node)}exports.nodes={AssignmentExpression:function AssignmentExpression(node){var state=crawl(node.right);if(state.hasCall&&state.hasHelper||state.hasFunction){return{before:state.hasFunction,after:true}}},SwitchCase:function SwitchCase(node,parent){return{before:node.consequent.length||parent.cases[0]===node}},LogicalExpression:function LogicalExpression(node){if(t.isFunction(node.left)||t.isFunction(node.right)){return{after:true}}},Literal:function Literal(node){if(node.value==="use strict"){return{after:true}}},CallExpression:function CallExpression(node){if(t.isFunction(node.callee)||isHelper(node)){return{before:true,after:true}}},VariableDeclaration:function VariableDeclaration(node){for(var i=0;i=max){i-=max}return i}var Whitespace=function(){function Whitespace(tokens){_classCallCheck(this,Whitespace);this.tokens=tokens;this.used={};this._lastFoundIndex=0}Whitespace.prototype.getNewlinesBefore=function getNewlinesBefore(node){var startToken;var endToken;var tokens=this.tokens;for(var j=0;j")}}).join("\n");if(highlighted){return _chalk2["default"].reset(frame)}else{return frame}};module.exports=exports["default"]},{chalk:217,esutils:322,"js-tokens":333,"line-numbers":335,repeating:517}],56:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashObjectMerge=require("lodash/object/merge");var _lodashObjectMerge2=_interopRequireDefault(_lodashObjectMerge);exports["default"]=function(dest,src){if(!dest||!src)return;return _lodashObjectMerge2["default"](dest,src,function(a,b){if(b&&Array.isArray(a)){var c=a.slice(0);for(var _iterator=b,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[Symbol.iterator]();;){var _ref;if(_isArray){if(_i>=_iterator.length)break;_ref=_iterator[_i++]}else{_i=_iterator.next();if(_i.done)break;_ref=_i.value}var v=_ref;if(a.indexOf(v)<0){c.push(v)}}return c}})};module.exports=exports["default"]},{"lodash/object/merge":447}],57:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../types");var t=_interopRequireWildcard(_types);exports["default"]=function(ast,comments,tokens){if(ast&&ast.type==="Program"){return t.file(ast,comments||[],tokens||[])}else{throw new Error("Not a valid ast?")}};module.exports=exports["default"]},{"../types":196}],58:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=function(){return Object.create(null)};module.exports=exports["default"]},{}],59:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _babylon=require("babylon");var babylon=_interopRequireWildcard(_babylon);exports["default"]=function(code){var opts=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];var parseOpts={allowImportExportEverywhere:opts.looseModules,allowReturnOutsideFunction:opts.looseModules,allowHashBang:true,ecmaVersion:6,strictMode:opts.strictMode,sourceType:opts.sourceType,locations:true,features:opts.features||{},plugins:opts.plugins||{}};if(opts.nonStandard){parseOpts.plugins.jsx=true;parseOpts.plugins.flow=true}return babylon.parse(code,parseOpts)};module.exports=exports["default"]},{babylon:539}],60:[function(require,module,exports){"use strict";exports.__esModule=true;exports.get=get;exports.parseArgs=parseArgs;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _util=require("util");var util=_interopRequireWildcard(_util);var MESSAGES={tailCallReassignmentDeopt:"Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence",JSXNamespacedTags:"Namespace tags are not supported. ReactJSX is not XML.",classesIllegalBareSuper:"Illegal use of bare super",classesIllegalSuperCall:"Direct super call is illegal in non-constructor, use super.$1() instead",scopeDuplicateDeclaration:"Duplicate declaration $1",settersNoRest:"Setters aren't allowed to have a rest",noAssignmentsInForHead:"No assignments allowed in for-in/of head",expectedMemberExpressionOrIdentifier:"Expected type MemberExpression or Identifier",invalidParentForThisNode:"We don't know how to handle this node within the current parent - please open an issue",readOnly:"$1 is read-only",unknownForHead:"Unknown node type $1 in ForStatement",didYouMean:"Did you mean $1?",codeGeneratorDeopt:"Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",missingTemplatesDirectory:"no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues",unsupportedOutputType:"Unsupported output type $1",illegalMethodName:"Illegal method name $1",lostTrackNodePath:"We lost track of this node's position, likely because the AST was directly manipulated",modulesIllegalExportName:"Illegal export $1",modulesDuplicateDeclarations:"Duplicate module declarations with the same source but in different scopes",undeclaredVariable:"Reference to undeclared variable $1",undeclaredVariableType:"Referencing a type alias outside of a type annotation",undeclaredVariableSuggestion:"Reference to undeclared variable $1 - did you mean $2?",traverseNeedsParent:"You must pass a scope and parentPath unless traversing a Program/File got a $1 node",traverseVerifyRootFunction:"You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?",traverseVerifyVisitorProperty:"You passed `traverse()` a visitor object with the property $1 that has the invalid property $2",traverseVerifyNodeType:"You gave us a visitor for the node type $1 but it's not a valid type",pluginIllegalKind:"Illegal kind $1 for plugin $2",pluginIllegalPosition:"Illegal position $1 for plugin $2",pluginKeyCollision:"The plugin $1 collides with another of the same name",pluginNotTransformer:"The plugin $1 didn't export a Plugin instance",pluginUnknown:"Unknown plugin $1",pluginNotFile:"Plugin $1 is resolving to a different Babel version than what is performing the transformation.",pluginInvalidProperty:"Plugin $1 provided an invalid property of $2.",pluginInvalidPropertyVisitor:'Define your visitor methods inside a `visitor` property like so:\n\n new Plugin("foobar", {\n visitor: {\n // define your visitor methods here!\n }\n });\n'};exports.MESSAGES=MESSAGES;function get(key){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}var msg=MESSAGES[key];if(!msg)throw new ReferenceError("Unknown message "+JSON.stringify(key));args=parseArgs(args);return msg.replace(/\$(\d+)/g,function(str,i){return args[--i]})}function parseArgs(args){return args.map(function(val){if(val!=null&&val.inspect){return val.inspect()}else{try{return JSON.stringify(val)||val+""}catch(e){return util.inspect(val)}}})}},{util:30}],61:[function(require,module,exports){(function(global){"use strict";require("core-js/shim");require("regenerator/runtime");if(global._babelPolyfill){throw new Error("only one instance of babel/polyfill is allowed")}global._babelPolyfill=true}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"core-js/shim":314,"regenerator/runtime":510}],62:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _generation=require("../generation");var _generation2=_interopRequireDefault(_generation);var _messages=require("../messages");var messages=_interopRequireWildcard(_messages);var _util=require("../util");var util=_interopRequireWildcard(_util);var _transformationFile=require("../transformation/file");var _transformationFile2=_interopRequireDefault(_transformationFile);var _lodashCollectionEach=require("lodash/collection/each");var _lodashCollectionEach2=_interopRequireDefault(_lodashCollectionEach);var _types=require("../types");var t=_interopRequireWildcard(_types);function buildGlobal(namespace,builder){var body=[];var container=t.functionExpression(null,[t.identifier("global")],t.blockStatement(body));var tree=t.program([t.expressionStatement(t.callExpression(container,[util.template("helper-self-global")]))]);body.push(t.variableDeclaration("var",[t.variableDeclarator(namespace,t.assignmentExpression("=",t.memberExpression(t.identifier("global"),namespace),t.objectExpression([])))]));builder(body);return tree}function buildUmd(namespace,builder){var body=[];body.push(t.variableDeclaration("var",[t.variableDeclarator(namespace,t.identifier("global"))]));builder(body);var container=util.template("umd-commonjs-strict",{FACTORY_PARAMETERS:t.identifier("global"),BROWSER_ARGUMENTS:t.assignmentExpression("=",t.memberExpression(t.identifier("root"),namespace),t.objectExpression({})),COMMON_ARGUMENTS:t.identifier("exports"),AMD_ARGUMENTS:t.arrayExpression([t.literal("exports")]),FACTORY_BODY:body,UMD_ROOT:t.identifier("this")});return t.program([container])}function buildVar(namespace,builder){var body=[];body.push(t.variableDeclaration("var",[t.variableDeclarator(namespace,t.objectExpression({}))]));builder(body);return t.program(body)}function buildHelpers(body,namespace,whitelist){_lodashCollectionEach2["default"](_transformationFile2["default"].helpers,function(name){if(whitelist&&whitelist.indexOf(name)===-1)return;var key=t.identifier(t.toIdentifier(name));body.push(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(namespace,key),util.template("helper-"+name))))})}exports["default"]=function(whitelist){var outputType=arguments.length<=1||arguments[1]===undefined?"global":arguments[1];var namespace=t.identifier("babelHelpers");var builder=function builder(body){return buildHelpers(body,namespace,whitelist)};var tree;var build={global:buildGlobal,umd:buildUmd,"var":buildVar}[outputType];if(build){tree=build(namespace,builder)}else{throw new Error(messages.get("unsupportedOutputType",outputType))}return _generation2["default"](tree).code};module.exports=exports["default"]},{"../generation":47,"../messages":60,"../transformation/file":63,"../types":196,"../util":199,"lodash/collection/each":343}],63:[function(require,module,exports){(function(process){"use strict";exports.__esModule=true;var _createClass=function(){function defineProperties(target,props){for(var i=0;i=0)continue;var group=pass.plugin.metadata.group;if(!pass.canTransform()||!group){stack.push(pass);continue}var mergeStack=[];var _arr4=_stack;for(var _i4=0;_i4<_arr4.length;_i4++){var _pass=_arr4[_i4];if(_pass.plugin.metadata.group===group){mergeStack.push(_pass);ignore.push(_pass)}}var visitors=[];var _arr5=mergeStack;for(var _i5=0;_i5<_arr5.length;_i5++){var _pass2=_arr5[_i5];visitors.push(_pass2.plugin.visitor)}var visitor=_traversal2["default"].visitors.merge(visitors);var mergePlugin=new _plugin2["default"](group,{visitor:visitor});stack.push(mergePlugin.buildPass(this))}return stack};File.prototype.set=function set(key,val){return this.data[key]=val};File.prototype.setDynamic=function setDynamic(key,fn){this.dynamicData[key]=fn};File.prototype.get=function get(key){var data=this.data[key];if(data){return data}else{var dynamic=this.dynamicData[key];if(dynamic){return this.set(key,dynamic())}}};File.prototype.resolveModuleSource=function resolveModuleSource(source){var resolveModuleSource=this.opts.resolveModuleSource;if(resolveModuleSource)source=resolveModuleSource(source,this.opts.filename);return source};File.prototype.addImport=function addImport(source,name,type){name=name||source;var id=this.dynamicImportIds[name];if(!id){source=this.resolveModuleSource(source);id=this.dynamicImportIds[name]=this.scope.generateUidIdentifier(name);var specifiers=[t.importDefaultSpecifier(id)];var declar=t.importDeclaration(specifiers,t.literal(source));declar._blockHoist=3;if(type){var modules=this.dynamicImportTypes[type]=this.dynamicImportTypes[type]||[];modules.push(declar)}if(this.transformers["es6.modules"].canTransform()){this.moduleFormatter.importSpecifier(specifiers[0],declar,this.dynamicImports,this.scope);this.moduleFormatter.hasLocalImports=true}else{this.dynamicImports.push(declar)}}return id};File.prototype.attachAuxiliaryComment=function attachAuxiliaryComment(node){var beforeComment=this.opts.auxiliaryCommentBefore;if(beforeComment){node.leadingComments=node.leadingComments||[];node.leadingComments.push({type:"CommentLine",value:" "+beforeComment})}var afterComment=this.opts.auxiliaryCommentAfter;if(afterComment){node.trailingComments=node.trailingComments||[];node.trailingComments.push({type:"CommentLine",value:" "+afterComment})}return node};File.prototype.addHelper=function addHelper(name){var isSolo=_lodashCollectionIncludes2["default"](File.soloHelpers,name);if(!isSolo&&!_lodashCollectionIncludes2["default"](File.helpers,name)){throw new ReferenceError("Unknown helper "+name)}var declar=this.declarations[name];if(declar)return declar;this.usedHelpers[name]=true;if(!isSolo){var generator=this.get("helperGenerator");var runtime=this.get("helpersNamespace");if(generator){return generator(name)}else if(runtime){var id=t.identifier(t.toIdentifier(name));return t.memberExpression(runtime,id)}}var ref=util.template("helper-"+name);var uid=this.declarations[name]=this.scope.generateUidIdentifier(name);if(t.isFunctionExpression(ref)&&!ref.id){ref.body._compact=true;ref._generated=true;ref.id=uid;ref.type="FunctionDeclaration";this.attachAuxiliaryComment(ref);this.path.unshiftContainer("body",ref)}else{ref._compact=true;this.scope.push({id:uid,init:ref,unique:true})}return uid};File.prototype.addTemplateObject=function addTemplateObject(helperName,strings,raw){var stringIds=raw.elements.map(function(string){return string.value});var name=helperName+"_"+raw.elements.length+"_"+stringIds.join(",");var declar=this.declarations[name];if(declar)return declar;var uid=this.declarations[name]=this.scope.generateUidIdentifier("templateObject");var helperId=this.addHelper(helperName);var init=t.callExpression(helperId,[strings,raw]);init._compact=true;this.scope.push({id:uid,init:init,_blockHoist:1.9});return uid};File.prototype.errorWithNode=function errorWithNode(node,msg){var Error=arguments.length<=2||arguments[2]===undefined?SyntaxError:arguments[2];var err;var loc=node&&(node.loc||node._loc);if(loc){err=new Error("Line "+loc.start.line+": "+msg);err.loc=loc.start}else{err=new Error("There's been an error on a dynamic node. This is almost certainly an internal error. Please report it.")}return err};File.prototype.mergeSourceMap=function mergeSourceMap(map){var opts=this.opts;var inputMap=opts.inputSourceMap;if(inputMap){map.sources[0]=inputMap.file;var inputMapConsumer=new _sourceMap2["default"].SourceMapConsumer(inputMap);var outputMapConsumer=new _sourceMap2["default"].SourceMapConsumer(map);var outputMapGenerator=_sourceMap2["default"].SourceMapGenerator.fromSourceMap(outputMapConsumer);outputMapGenerator.applySourceMap(inputMapConsumer);var mergedMap=outputMapGenerator.toJSON();mergedMap.sources=inputMap.sources;mergedMap.file=inputMap.file;return mergedMap}return map};File.prototype.getModuleFormatter=function getModuleFormatter(type){if(_lodashLangIsFunction2["default"](type)||!_modules2["default"][type]){this.log.deprecate("Custom module formatters are deprecated and will be removed in the next major. Please use Babel plugins instead.")}var ModuleFormatter=_lodashLangIsFunction2["default"](type)?type:_modules2["default"][type];if(!ModuleFormatter){var loc=_tryResolve2["default"].relative(type);if(loc)ModuleFormatter=require(loc)}if(!ModuleFormatter){throw new ReferenceError("Unknown module formatter type "+JSON.stringify(type))}return new ModuleFormatter(this)};File.prototype.parse=function parse(code){var opts=this.opts;var parseOpts={highlightCode:opts.highlightCode,nonStandard:opts.nonStandard,sourceType:opts.sourceType,filename:opts.filename,plugins:{}};var features=parseOpts.features={};for(var key in this.transformers){var transformer=this.transformers[key];features[key]=transformer.canTransform()}parseOpts.looseModules=this.isLoose("es6.modules");parseOpts.strictMode=features.strict;this.log.debug("Parse start");var ast=_helpersParse2["default"](code,parseOpts);this.log.debug("Parse stop");return ast};File.prototype._addAst=function _addAst(ast){this.path=_traversalPath2["default"].get({hub:this.hub,parentPath:null,parent:ast,container:ast,key:"program"}).setContext();this.scope=this.path.scope;this.ast=ast};File.prototype.addAst=function addAst(ast){this.log.debug("Start set AST");this._addAst(ast);this.log.debug("End set AST");this.log.debug("Start module formatter init");var modFormatter=this.moduleFormatter=this.getModuleFormatter(this.opts.modules);if(modFormatter.init&&this.transformers["es6.modules"].canTransform()){modFormatter.init()}this.log.debug("End module formatter init")};File.prototype.transform=function transform(){this.call("pre");var _arr6=this.transformerStack;for(var _i6=0;_i6<_arr6.length;_i6++){var pass=_arr6[_i6];pass.transform()}this.call("post");return this.generate()};File.prototype.wrap=function wrap(code,callback){code=code+"";try{if(this.shouldIgnore()){return this.makeResult({code:code,ignored:true})}else{return callback()}}catch(err){if(err._babel){throw err}else{err._babel=true}var message=err.message=this.opts.filename+": "+err.message;var loc=err.loc;if(loc){err.codeFrame=_helpersCodeFrame2["default"](code,loc.line,loc.column+1,this.opts);message+="\n"+err.codeFrame}if(process.browser){err.message=message}if(err.stack){var newStack=err.stack.replace(err.message,message);try{err.stack=newStack}catch(e){}}throw err}};File.prototype.addCode=function addCode(code){code=(code||"")+"";code=this.parseInputSourceMap(code);this.code=code};File.prototype.parseCode=function parseCode(){this.parseShebang();var ast=this.parse(this.code);this.addAst(ast)};File.prototype.shouldIgnore=function shouldIgnore(){var opts=this.opts;return util.shouldIgnore(opts.filename,opts.ignore,opts.only)};File.prototype.call=function call(key){var _arr7=this.uncollapsedTransformerStack;for(var _i7=0;_i7<_arr7.length;_i7++){var pass=_arr7[_i7];var fn=pass.plugin[key];if(fn)fn(this)}};File.prototype.parseInputSourceMap=function parseInputSourceMap(code){var opts=this.opts;if(opts.inputSourceMap!==false){var inputMap=_convertSourceMap2["default"].fromSource(code);if(inputMap){opts.inputSourceMap=inputMap.toObject();code=_convertSourceMap2["default"].removeComments(code)}}return code};File.prototype.parseShebang=function parseShebang(){var shebangMatch=_shebangRegex2["default"].exec(this.code);if(shebangMatch){this.shebang=shebangMatch[0];this.code=this.code.replace(_shebangRegex2["default"],"")}};File.prototype.makeResult=function makeResult(_ref){var code=_ref.code;var _ref$map=_ref.map;var map=_ref$map===undefined?null:_ref$map;var ast=_ref.ast;var ignored=_ref.ignored;var result={metadata:null,ignored:!!ignored,code:null,ast:null,map:map};if(this.opts.code){result.code=code}if(this.opts.ast){result.ast=ast}if(this.opts.metadata){result.metadata=this.metadata;result.metadata.usedHelpers=Object.keys(this.usedHelpers)}return result};File.prototype.generate=function generate(){var opts=this.opts;var ast=this.ast;var result={ast:ast};if(!opts.code)return this.makeResult(result);this.log.debug("Generation start");var _result=_generation2["default"](ast,opts,this.code);result.code=_result.code;result.map=_result.map;this.log.debug("Generation end");if(this.shebang){result.code=this.shebang+"\n"+result.code}if(result.map){result.map=this.mergeSourceMap(result.map)}if(opts.sourceMaps==="inline"||opts.sourceMaps==="both"){result.code+="\n"+_convertSourceMap2["default"].fromObject(result.map).toComment()}if(opts.sourceMaps==="inline"){result.map=null}return this.makeResult(result)};_createClass(File,null,[{key:"helpers",value:["inherits","defaults","create-class","create-decorated-class","create-decorated-object","define-decorated-property-descriptor","tagged-template-literal","tagged-template-literal-loose","to-array","to-consumable-array","sliced-to-array","sliced-to-array-loose","object-without-properties","has-own","slice","bind","define-property","async-to-generator","interop-export-wildcard","interop-require-wildcard","interop-require-default","typeof","extends","get","set","new-arrow-check","class-call-check","object-destructuring-empty","temporal-undefined","temporal-assert-defined","self-global","default-props","instanceof","interop-require"],enumerable:true},{key:"soloHelpers",value:[],enumerable:true}]);return File}();exports["default"]=File;module.exports=exports["default"]}).call(this,require("_process"))},{"../../generation":47,"../../helpers/code-frame":55,"../../helpers/parse":59,"../../traversal":165,"../../traversal/hub":164,"../../traversal/path":172,"../../types":196,"../../util":199,"../modules":91,"../plugin":99,"./logger":64,"./options/option-manager":67,"./plugin-manager":69,_process:14,"convert-source-map":225,"lodash/collection/includes":345,"lodash/lang/isFunction":432,"lodash/object/defaults":442,path:12,"shebang-regex":520,"source-map":522,"try-resolve":536}],64:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _debugNode=require("debug/node");var _debugNode2=_interopRequireDefault(_debugNode);var verboseDebug=_debugNode2["default"]("babel:verbose");var generalDebug=_debugNode2["default"]("babel");var seenDeprecatedMessages=[];var Logger=function(){function Logger(file,filename){_classCallCheck(this,Logger);this.filename=filename;this.file=file}Logger.prototype._buildMessage=function _buildMessage(msg){var parts="[BABEL] "+this.filename;if(msg)parts+=": "+msg;return parts};Logger.prototype.warn=function warn(msg){console.warn(this._buildMessage(msg))};Logger.prototype.error=function error(msg){var Constructor=arguments.length<=1||arguments[1]===undefined?Error:arguments[1];throw new Constructor(this._buildMessage(msg))};Logger.prototype.deprecate=function deprecate(msg){if(this.file.opts&&this.file.opts.suppressDeprecationMessages)return;msg=this._buildMessage(msg);if(seenDeprecatedMessages.indexOf(msg)>=0)return;seenDeprecatedMessages.push(msg);console.error(msg)};Logger.prototype.verbose=function verbose(msg){if(verboseDebug.enabled)verboseDebug(this._buildMessage(msg))};Logger.prototype.debug=function debug(msg){if(generalDebug.enabled)generalDebug(this._buildMessage(msg))};Logger.prototype.deopt=function deopt(node,msg){this.debug(msg)};return Logger}();exports["default"]=Logger;module.exports=exports["default"]},{"debug/node":316}],65:[function(require,module,exports){module.exports={filename:{type:"filename",description:"filename to use when reading from stdin - this will be used in source-maps, errors etc","default":"unknown",shorthand:"f"},filenameRelative:{hidden:true,type:"string"},inputSourceMap:{hidden:true},extra:{hidden:true,"default":{}},env:{hidden:true,"default":{}},moduleId:{description:"specify a custom name for module ids",type:"string"},getModuleId:{hidden:true},retainLines:{type:"boolean","default":false,description:"retain line numbers - will result in really ugly code"},nonStandard:{type:"boolean","default":true,description:"enable/disable support for JSX and Flow (on by default)"},experimental:{type:"boolean",description:"allow use of experimental transformers","default":false},highlightCode:{description:"enable/disable ANSI syntax highlighting of code frames (on by default)",type:"boolean","default":true},suppressDeprecationMessages:{type:"boolean","default":false,hidden:true},resolveModuleSource:{hidden:true},stage:{description:"ECMAScript proposal stage version to allow [0-4]",shorthand:"e",type:"number","default":2},blacklist:{type:"transformerList",description:"blacklist of transformers to NOT use",shorthand:"b","default":[]},whitelist:{type:"transformerList",optional:true,description:"whitelist of transformers to ONLY use",shorthand:"l"},optional:{type:"transformerList",description:"list of optional transformers to enable","default":[]},modules:{type:"string",description:"module formatter type to use [common]","default":"common",shorthand:"m"},moduleIds:{type:"boolean","default":false,shorthand:"M",description:"insert an explicit id for modules"},loose:{type:"transformerList",description:"list of transformers to enable loose mode ON",shorthand:"L"},jsxPragma:{type:"string",description:"custom pragma to use with JSX (same functionality as @jsx comments)","default":"React.createElement",shorthand:"P"},plugins:{type:"list",description:"","default":[]},ignore:{type:"list",description:"list of glob paths to **not** compile","default":[]},only:{type:"list",description:"list of glob paths to **only** compile"},code:{ -hidden:true,"default":true,type:"boolean"},metadata:{hidden:true,"default":true,type:"boolean"},ast:{hidden:true,"default":true,type:"boolean"},comments:{type:"boolean","default":true,description:"strip/output comments in generated output (on by default)"},shouldPrintComment:{hidden:true,description:"optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"},compact:{type:"booleanString","default":"auto",description:"do not include superfluous whitespace characters and line terminators [true|false|auto]"},keepModuleIdExtensions:{type:"boolean",description:"keep extensions when generating module ids","default":false,shorthand:"k"},auxiliaryComment:{deprecated:"renamed to auxiliaryCommentBefore",shorthand:"a",alias:"auxiliaryCommentBefore"},auxiliaryCommentBefore:{type:"string","default":"",description:"attach a comment before all helper declarations and auxiliary code"},auxiliaryCommentAfter:{type:"string","default":"",description:"attach a comment after all helper declarations and auxiliary code"},externalHelpers:{type:"boolean","default":false,shorthand:"r",description:"uses a reference to `babelHelpers` instead of placing helpers at the top of your code."},metadataUsedHelpers:{deprecated:"Not required anymore as this is enabled by default",type:"boolean","default":false,hidden:true},sourceMap:{alias:"sourceMaps",hidden:true},sourceMaps:{type:"booleanString",description:"[true|false|inline]","default":false,shorthand:"s"},sourceMapName:{alias:"sourceMapTarget",description:"DEPRECATED - Please use sourceMapTarget"},sourceMapTarget:{type:"string",description:"set `file` on returned source map"},sourceFileName:{type:"string",description:"set `sources[0]` on returned source map"},sourceRoot:{type:"filename",description:"the root from which all sources are relative"},moduleRoot:{type:"filename",description:"optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"},breakConfig:{type:"boolean","default":false,hidden:true,description:"stop trying to load .babelrc files"},babelrc:{description:"Specify a custom list of babelrc files to use",type:"list"},sourceType:{description:"","default":"module"}}},{}],66:[function(require,module,exports){"use strict";exports.__esModule=true;exports.validateOption=validateOption;exports.normaliseOptions=normaliseOptions;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _parsers=require("./parsers");var parsers=_interopRequireWildcard(_parsers);var _config=require("./config");var _config2=_interopRequireDefault(_config);exports.config=_config2["default"];function validateOption(key,val,pipeline){var opt=_config2["default"][key];var parser=opt&&parsers[opt.type];if(parser&&parser.validate){return parser.validate(key,val,pipeline)}else{return val}}function normaliseOptions(){var options=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];for(var key in options){var val=options[key];if(val==null)continue;var opt=_config2["default"][key];if(!opt)continue;var parser=parsers[opt.type];if(parser)val=parser(val);options[key]=val}return options}},{"./config":65,"./parsers":68}],67:[function(require,module,exports){(function(process){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _index=require("./index");var _json5=require("json5");var _json52=_interopRequireDefault(_json5);var _pathIsAbsolute=require("path-is-absolute");var _pathIsAbsolute2=_interopRequireDefault(_pathIsAbsolute);var _pathExists=require("path-exists");var _pathExists2=_interopRequireDefault(_pathExists);var _lodashLangClone=require("lodash/lang/clone");var _lodashLangClone2=_interopRequireDefault(_lodashLangClone);var _helpersMerge=require("../../../helpers/merge");var _helpersMerge2=_interopRequireDefault(_helpersMerge);var _config=require("./config");var _config2=_interopRequireDefault(_config);var _path=require("path");var _path2=_interopRequireDefault(_path);var _fs=require("fs");var _fs2=_interopRequireDefault(_fs);var existsCache={};var jsonCache={};var BABELIGNORE_FILENAME=".babelignore";var BABELRC_FILENAME=".babelrc";var PACKAGE_FILENAME="package.json";function exists(filename){var cached=existsCache[filename];if(cached!=null){return cached}else{return existsCache[filename]=_pathExists2["default"].sync(filename)}}var OptionManager=function(){function OptionManager(log,pipeline){_classCallCheck(this,OptionManager);this.resolvedConfigs=[];this.options=OptionManager.createBareOptions();this.pipeline=pipeline;this.log=log}OptionManager.createBareOptions=function createBareOptions(){var opts={};for(var key in _config2["default"]){var opt=_config2["default"][key];opts[key]=_lodashLangClone2["default"](opt["default"])}return opts};OptionManager.prototype.addConfig=function addConfig(loc,key){var json=arguments.length<=2||arguments[2]===undefined?_json52["default"]:arguments[2];if(this.resolvedConfigs.indexOf(loc)>=0)return;var content=_fs2["default"].readFileSync(loc,"utf8");var opts;try{opts=jsonCache[content]=jsonCache[content]||json.parse(content);if(key)opts=opts[key]}catch(err){err.message=loc+": Error while parsing JSON - "+err.message;throw err}this.mergeOptions(opts,loc);this.resolvedConfigs.push(loc)};OptionManager.prototype.mergeOptions=function mergeOptions(opts){var alias=arguments.length<=1||arguments[1]===undefined?"foreign":arguments[1];if(!opts)return;for(var key in opts){if(key[0]==="_")continue;var option=_config2["default"][key];if(!option)this.log.error("Unknown option: "+alias+"."+key,ReferenceError)}_index.normaliseOptions(opts);_helpersMerge2["default"](this.options,opts)};OptionManager.prototype.addIgnoreConfig=function addIgnoreConfig(loc){var file=_fs2["default"].readFileSync(loc,"utf8");var lines=file.split("\n");lines=lines.map(function(line){return line.replace(/#(.*?)$/,"").trim()}).filter(function(line){return!!line});this.mergeOptions({ignore:lines},loc)};OptionManager.prototype.findConfigs=function findConfigs(loc){if(!loc)return;if(!_pathIsAbsolute2["default"](loc)){loc=_path2["default"].join(process.cwd(),loc)}while(loc!==(loc=_path2["default"].dirname(loc))){if(this.options.breakConfig)return;var configLoc=_path2["default"].join(loc,BABELRC_FILENAME);if(exists(configLoc))this.addConfig(configLoc);var pkgLoc=_path2["default"].join(loc,PACKAGE_FILENAME);if(exists(pkgLoc))this.addConfig(pkgLoc,"babel",JSON);var ignoreLoc=_path2["default"].join(loc,BABELIGNORE_FILENAME);if(exists(ignoreLoc))this.addIgnoreConfig(ignoreLoc)}};OptionManager.prototype.normaliseOptions=function normaliseOptions(){var opts=this.options;for(var key in _config2["default"]){var option=_config2["default"][key];var val=opts[key];if(!val&&option.optional)continue;if(this.log&&val&&option.deprecated){this.log.deprecate("Deprecated option "+key+": "+option.deprecated)}if(this.pipeline&&val){val=_index.validateOption(key,val,this.pipeline)}if(option.alias){opts[option.alias]=opts[option.alias]||val}else{opts[key]=val}}};OptionManager.prototype.init=function init(opts){this.mergeOptions(opts,"direct");if(opts.babelrc){var _arr=opts.babelrc;for(var _i=0;_i<_arr.length;_i++){var loc=_arr[_i];this.addConfig(loc)}}if(opts.babelrc!==false){this.findConfigs(opts.filename)}var envKey=process.env.BABEL_ENV||process.env.NODE_ENV||"development";if(this.options.env){this.mergeOptions(this.options.env[envKey],"direct.env."+envKey)}this.normaliseOptions(opts);return this.options};return OptionManager}();exports["default"]=OptionManager;module.exports=exports["default"]}).call(this,require("_process"))},{"../../../helpers/merge":56,"./config":65,"./index":66,_process:14,fs:4,json5:334,"lodash/lang/clone":426,path:12,"path-exists":458,"path-is-absolute":459}],68:[function(require,module,exports){"use strict";exports.__esModule=true;exports.transformerList=transformerList;exports.number=number;exports.boolean=boolean;exports.booleanString=booleanString;exports.list=list;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _slash=require("slash");var _slash2=_interopRequireDefault(_slash);var _util=require("../../../util");var util=_interopRequireWildcard(_util);function transformerList(val){return util.arrayify(val)}transformerList.validate=function(key,val,pipeline){if(val.indexOf("all")>=0||val.indexOf(true)>=0){val=Object.keys(pipeline.transformers)}return pipeline._ensureTransformerNames(key,val)};function number(val){return+val}var filename=_slash2["default"];exports.filename=filename;function boolean(val){return!!val}function booleanString(val){return util.booleanify(val)}function list(val){return util.list(val)}},{"../../../util":199,slash:521}],69:[function(require,module,exports){"use strict";exports.__esModule=true;var _createClass=function(){function defineProperties(target,props){for(var i=0;i=3){callExpr._prettyCall=true}return t.inherits(callExpr,node)}};return visitor};module.exports=exports["default"]},{"../../messages":60,"../../types":196,"./react":79,esutils:322,"lodash/lang/isString":438}],73:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);var visitor={enter:function enter(node,parent,scope,state){if(this.isThisExpression()||this.isReferencedIdentifier({name:"arguments"})){state.found=true;this.stop()}},Function:function Function(){this.skip()}};exports["default"]=function(node,scope){var container=t.functionExpression(null,[],node.body,node.generator,node.async);var callee=container;var args=[];var state={found:false};scope.traverse(node,visitor,state);if(state.found){callee=t.memberExpression(container,t.identifier("apply"));args=[t.thisExpression(),t.identifier("arguments")]}var call=t.callExpression(callee,args);if(node.generator)call=t.yieldExpression(call,true);return t.returnStatement(call)};module.exports=exports["default"]},{"../../types":196}],74:[function(require,module,exports){"use strict";exports.__esModule=true;exports.push=push;exports.hasComputed=hasComputed;exports.toComputedObjectFromClass=toComputedObjectFromClass;exports.toClassObject=toClassObject;exports.toDefineObject=toDefineObject;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashCollectionEach=require("lodash/collection/each");var _lodashCollectionEach2=_interopRequireDefault(_lodashCollectionEach);var _lodashObjectHas=require("lodash/object/has");var _lodashObjectHas2=_interopRequireDefault(_lodashObjectHas);var _types=require("../../types");var t=_interopRequireWildcard(_types);function push(mutatorMap,node,kind,file){var alias=t.toKeyAlias(node);var map={};if(_lodashObjectHas2["default"](mutatorMap,alias))map=mutatorMap[alias];mutatorMap[alias]=map;map._inherits=map._inherits||[];map._inherits.push(node);map._key=node.key;if(node.computed){map._computed=true}if(node.decorators){var decorators=map.decorators=map.decorators||t.arrayExpression([]);decorators.elements=decorators.elements.concat(node.decorators.map(function(dec){return dec.expression}).reverse())}if(map.value||map.initializer){throw file.errorWithNode(node,"Key conflict with sibling node")}if(node.value){if(node.kind==="init")kind="value";if(node.kind==="get")kind="get";if(node.kind==="set")kind="set";t.inheritsComments(node.value,node);map[kind]=node.value}return map}function hasComputed(mutatorMap){for(var key in mutatorMap){if(mutatorMap[key]._computed){return true}}return false}function toComputedObjectFromClass(obj){var objExpr=t.arrayExpression([]);for(var i=0;i=0}function pullFlag(node,flag){var flags=node.regex.flags.split("");if(node.regex.flags.indexOf(flag)<0)return;_lodashArrayPull2["default"](flags,flag);node.regex.flags=flags.join("")}},{"../../types":196,"lodash/array/pull":340}],81:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../types");var t=_interopRequireWildcard(_types);var awaitVisitor={Function:function Function(){this.skip()},AwaitExpression:function AwaitExpression(node){node.type="YieldExpression";if(node.all){node.all=false;node.argument=t.callExpression(t.memberExpression(t.identifier("Promise"),t.identifier("all")),[node.argument])}}};var referenceVisitor={ReferencedIdentifier:function ReferencedIdentifier(node,parent,scope,state){var name=state.id.name;if(node.name===name&&scope.bindingIdentifierEquals(name,state.id)){return state.ref=state.ref||scope.generateUidIdentifier(name)}}};exports["default"]=function(path,callId){var node=path.node;node.async=false;node.generator=true;path.traverse(awaitVisitor,state);var call=t.callExpression(callId,[node]);var id=node.id;node.id=null;if(t.isFunctionDeclaration(node)){var declar=t.variableDeclaration("let",[t.variableDeclarator(id,call)]);declar._blockHoist=true;return declar}else{if(id){var state={id:id};path.traverse(referenceVisitor,state);if(state.ref){path.scope.parent.push({id:state.ref});return t.assignmentExpression("=",state.ref,call)}}return call}};module.exports=exports["default"]},{"../../types":196}],82:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _messages=require("../../messages");var messages=_interopRequireWildcard(_messages);var _types=require("../../types");var t=_interopRequireWildcard(_types);function isIllegalBareSuper(node,parent){if(!t.isSuper(node))return false;if(t.isMemberExpression(parent,{computed:false}))return false;if(t.isCallExpression(parent,{callee:node}))return false;return true}function isMemberExpressionSuper(node){return t.isMemberExpression(node)&&t.isSuper(node.object)}var visitor={enter:function enter(node,parent,scope,state){var topLevel=state.topLevel;var self=state.self;if(t.isFunction(node)&&!t.isArrowFunctionExpression(node)){self.traverseLevel(this,false);return this.skip()}if(t.isProperty(node,{method:true})||t.isMethodDefinition(node)){return this.skip()}var getThisReference=topLevel?t.thisExpression:self.getThisReference.bind(self);var callback=self.specHandle;if(self.isLoose)callback=self.looseHandle;var result=callback.call(self,this,getThisReference);if(result)this.hasSuper=true;if(result===true)return;return result}};var ReplaceSupers=function(){function ReplaceSupers(opts){var inClass=arguments.length<=1||arguments[1]===undefined?false:arguments[1];_classCallCheck(this,ReplaceSupers);this.topLevelThisReference=opts.topLevelThisReference;this.methodPath=opts.methodPath;this.methodNode=opts.methodNode;this.superRef=opts.superRef;this.isStatic=opts.isStatic;this.hasSuper=false;this.inClass=inClass;this.isLoose=opts.isLoose;this.scope=opts.scope;this.file=opts.file;this.opts=opts}ReplaceSupers.prototype.getObjectRef=function getObjectRef(){return this.opts.objectRef||this.opts.getObjectRef()};ReplaceSupers.prototype.setSuperProperty=function setSuperProperty(property,value,isComputed,thisExpression){return t.callExpression(this.file.addHelper("set"),[t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("getPrototypeOf")),[this.isStatic?this.getObjectRef():t.memberExpression(this.getObjectRef(),t.identifier("prototype"))]),isComputed?property:t.literal(property.name),value,thisExpression])};ReplaceSupers.prototype.getSuperProperty=function getSuperProperty(property,isComputed,thisExpression){return t.callExpression(this.file.addHelper("get"),[t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("getPrototypeOf")),[this.isStatic?this.getObjectRef():t.memberExpression(this.getObjectRef(),t.identifier("prototype"))]),isComputed?property:t.literal(property.name),thisExpression])};ReplaceSupers.prototype.replace=function replace(){this.traverseLevel(this.methodPath.get("value"),true)};ReplaceSupers.prototype.traverseLevel=function traverseLevel(path,topLevel){var state={self:this,topLevel:topLevel};path.traverse(visitor,state)};ReplaceSupers.prototype.getThisReference=function getThisReference(){if(this.topLevelThisReference){return this.topLevelThisReference}else{var ref=this.topLevelThisReference=this.scope.generateUidIdentifier("this");this.methodNode.value.body.body.unshift(t.variableDeclaration("var",[t.variableDeclarator(this.topLevelThisReference,t.thisExpression())]));return ref}};ReplaceSupers.prototype.getLooseSuperProperty=function getLooseSuperProperty(id,parent){var methodNode=this.methodNode;var methodName=methodNode.key;var superRef=this.superRef||t.identifier("Function");if(parent.property===id){return}else if(t.isCallExpression(parent,{callee:id})){parent.arguments.unshift(t.thisExpression());if(methodName.name==="constructor"){if(parent.arguments.length===2&&t.isSpreadElement(parent.arguments[1])&&t.isIdentifier(parent.arguments[1].argument,{name:"arguments"})){parent.arguments[1]=parent.arguments[1].argument;return t.memberExpression(superRef,t.identifier("apply"))}else{return t.memberExpression(superRef,t.identifier("call"))}}else{id=superRef;if(!methodNode["static"]){id=t.memberExpression(id,t.identifier("prototype"))}id=t.memberExpression(id,methodName,methodNode.computed);return t.memberExpression(id,t.identifier("call"))}}else if(t.isMemberExpression(parent)&&!methodNode["static"]){return t.memberExpression(superRef,t.identifier("prototype"))}else{return superRef}};ReplaceSupers.prototype.looseHandle=function looseHandle(path,getThisReference){var node=path.node;if(path.isSuper()){return this.getLooseSuperProperty(node,path.parent)}else if(path.isCallExpression()){var callee=node.callee;if(!t.isMemberExpression(callee))return;if(!t.isSuper(callee.object))return;t.appendToMemberExpression(callee,t.identifier("call"));node.arguments.unshift(getThisReference());return true}};ReplaceSupers.prototype.specHandleAssignmentExpression=function specHandleAssignmentExpression(ref,path,node,getThisReference){if(node.operator==="="){return this.setSuperProperty(node.left.property,node.right,node.left.computed,getThisReference())}else{ref=ref||path.scope.generateUidIdentifier("ref");return[t.variableDeclaration("var",[t.variableDeclarator(ref,node.left)]),t.expressionStatement(t.assignmentExpression("=",node.left,t.binaryExpression(node.operator[0],ref,node.right)))]}};ReplaceSupers.prototype.specHandle=function specHandle(path,getThisReference){var methodNode=this.methodNode;var property;var computed;var args;var thisReference;var parent=path.parent;var node=path.node;if(isIllegalBareSuper(node,parent)){throw path.errorWithNode(messages.get("classesIllegalBareSuper"))}if(t.isCallExpression(node)){var callee=node.callee;if(t.isSuper(callee)){property=methodNode.key;computed=methodNode.computed;args=node.arguments;if(methodNode.key.name!=="constructor"||!this.inClass){var methodName=methodNode.key.name||"METHOD_NAME";throw this.file.errorWithNode(node,messages.get("classesIllegalSuperCall",methodName))}}else if(isMemberExpressionSuper(callee)){property=callee.property;computed=callee.computed;args=node.arguments}}else if(t.isMemberExpression(node)&&t.isSuper(node.object)){property=node.property;computed=node.computed}else if(t.isUpdateExpression(node)&&isMemberExpressionSuper(node.argument)){var binary=t.binaryExpression(node.operator[0],node.argument,t.literal(1));if(node.prefix){return this.specHandleAssignmentExpression(null,path,binary,getThisReference)}else{var ref=path.scope.generateUidIdentifier("ref");return this.specHandleAssignmentExpression(ref,path,binary,getThisReference).concat(t.expressionStatement(ref))}}else if(t.isAssignmentExpression(node)&&isMemberExpressionSuper(node.left)){return this.specHandleAssignmentExpression(null,path,node,getThisReference)}if(!property)return;thisReference=getThisReference();var superProperty=this.getSuperProperty(property,computed,thisReference);if(args){if(args.length===1&&t.isSpreadElement(args[0])){return t.callExpression(t.memberExpression(superProperty,t.identifier("apply")),[thisReference,args[0].argument])}else{return t.callExpression(t.memberExpression(superProperty,t.identifier("call")),[thisReference].concat(args))}}else{return superProperty}};return ReplaceSupers}();exports["default"]=ReplaceSupers;module.exports=exports["default"]},{"../../messages":60,"../../types":196}],83:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _pipeline=require("./pipeline");var _pipeline2=_interopRequireDefault(_pipeline);var _transformers=require("./transformers");var _transformers2=_interopRequireDefault(_transformers);var _transformersDeprecated=require("./transformers/deprecated");var _transformersDeprecated2=_interopRequireDefault(_transformersDeprecated);var _transformersAliases=require("./transformers/aliases");var _transformersAliases2=_interopRequireDefault(_transformersAliases);var _transformersFilters=require("./transformers/filters");var filters=_interopRequireWildcard(_transformersFilters);var pipeline=new _pipeline2["default"];for(var key in _transformers2["default"]){var transformer=_transformers2["default"][key];if(typeof transformer==="object"){var metadata=transformer.metadata=transformer.metadata||{};metadata.group=metadata.group||"builtin-basic"}}pipeline.addTransformers(_transformers2["default"]);pipeline.addDeprecated(_transformersDeprecated2["default"]);pipeline.addAliases(_transformersAliases2["default"]);pipeline.addFilter(filters.internal);pipeline.addFilter(filters.blacklist);pipeline.addFilter(filters.whitelist);pipeline.addFilter(filters.stage);pipeline.addFilter(filters.optional);var transform=pipeline.transform.bind(pipeline);transform.fromAst=pipeline.transformFromAst.bind(pipeline);transform.pipeline=pipeline;exports["default"]=transform;module.exports=exports["default"]},{"./pipeline":97,"./transformers":143,"./transformers/aliases":101,"./transformers/deprecated":102,"./transformers/filters":142}],84:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _libMetadata=require("./lib/metadata");var metadataVisitor=_interopRequireWildcard(_libMetadata);var _messages=require("../../messages");var messages=_interopRequireWildcard(_messages);var _libRemaps=require("./lib/remaps");var _libRemaps2=_interopRequireDefault(_libRemaps);var _helpersObject=require("../../helpers/object");var _helpersObject2=_interopRequireDefault(_helpersObject);var _util=require("../../util");var util=_interopRequireWildcard(_util);var _types=require("../../types");var t=_interopRequireWildcard(_types);var DefaultFormatter=function(){function DefaultFormatter(file){_classCallCheck(this,DefaultFormatter);this.sourceScopes=_helpersObject2["default"]();this.defaultIds=_helpersObject2["default"]();this.ids=_helpersObject2["default"]();this.remaps=new _libRemaps2["default"](file,this);this.scope=file.scope;this.file=file;this.hasNonDefaultExports=false;this.hasLocalExports=false;this.hasLocalImports=false;this.localExports=_helpersObject2["default"]();this.localImports=_helpersObject2["default"]();this.metadata=file.metadata.modules;this.getMetadata()}DefaultFormatter.prototype.addScope=function addScope(path){var source=path.node.source&&path.node.source.value;if(!source)return;var existingScope=this.sourceScopes[source];if(existingScope&&existingScope!==path.scope){throw path.errorWithNode(messages.get("modulesDuplicateDeclarations"))}this.sourceScopes[source]=path.scope};DefaultFormatter.prototype.isModuleType=function isModuleType(node,type){var modules=this.file.dynamicImportTypes[type];return modules&&modules.indexOf(node)>=0};DefaultFormatter.prototype.transform=function transform(){this.remapAssignments()};DefaultFormatter.prototype.doDefaultExportInterop=function doDefaultExportInterop(node){return(t.isExportDefaultDeclaration(node)||t.isSpecifierDefault(node))&&!this.noInteropRequireExport&&!this.hasNonDefaultExports};DefaultFormatter.prototype.getMetadata=function getMetadata(){var has=false;var _arr=this.file.ast.program.body;for(var _i=0;_i<_arr.length;_i++){var node=_arr[_i];if(t.isModuleDeclaration(node)){has=true;break}}if(has||this.isLoose()){this.file.path.traverse(metadataVisitor,this)}};DefaultFormatter.prototype.remapAssignments=function remapAssignments(){if(this.hasLocalExports||this.hasLocalImports){this.remaps.run()}};DefaultFormatter.prototype.remapExportAssignment=function remapExportAssignment(node,exported){var assign=node;for(var i=0;i=0)continue;var msgType="pluginInvalidProperty";if(t.TYPES.indexOf(key)>=0)msgType="pluginInvalidPropertyVisitor";throw new Error(messages.get(msgType,name,key))}for(var key in plugin.metadata){if(VALID_METADATA_PROPERTES.indexOf(key)>=0)continue;throw new Error(messages.get("pluginInvalidProperty",name,"metadata."+key))}};Plugin.prototype.normalize=function normalize(visitor){_traversal2["default"].explode(visitor);return visitor};Plugin.prototype.buildPass=function buildPass(file){if(!(file instanceof _file2["default"])){throw new TypeError(messages.get("pluginNotFile",this.key))}return new _pluginPass2["default"](file,this)};return Plugin}();exports["default"]=Plugin;module.exports=exports["default"]},{"../messages":60,"../traversal":165,"../types":196,"./file":63,"./plugin-pass":98,"lodash/lang/clone":426,"lodash/object/assign":441}],100:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _plugin=require("./plugin");var _plugin2=_interopRequireDefault(_plugin);var Transformer=function Transformer(key,obj){_classCallCheck(this,Transformer);var plugin={};plugin.metadata=obj.metadata;delete obj.metadata;plugin.visitor=obj;return new _plugin2["default"](key,plugin)};exports["default"]=Transformer;module.exports=exports["default"]},{"./plugin":99}],101:[function(require,module,exports){module.exports={useStrict:"strict","es5.runtime":"runtime","es6.runtime":"runtime","minification.inlineExpressions":"minification.constantFolding"}},{}],102:[function(require,module,exports){module.exports={selfContained:"runtime","unicode-regex":"regex.unicode","spec.typeofSymbol":"es6.spec.symbols","es6.symbols":"es6.spec.symbols","es6.blockScopingTDZ":"es6.spec.blockScoping","utility.inlineExpressions":"minification.constantFolding","utility.deadCodeElimination":"minification.deadCodeElimination","utility.removeConsoleCalls":"minification.removeConsole","utility.removeDebugger":"minification.removeDebugger","es6.parameters.rest":"es6.parameters","es6.parameters.default":"es6.parameters"}},{}],103:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={group:"builtin-trailing"};exports.metadata=metadata;var visitor={MemberExpression:{exit:function exit(node){var prop=node.property;if(!node.computed&&t.isIdentifier(prop)&&!t.isValidIdentifier(prop.name)){node.property=t.literal(prop.name);node.computed=true}}}};exports.visitor=visitor},{"../../../types":196}],104:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={group:"builtin-trailing"};exports.metadata=metadata;var visitor={Property:{exit:function exit(node){var key=node.key;if(!node.computed&&t.isIdentifier(key)&&!t.isValidIdentifier(key.name)){node.key=t.literal(key.name)}}}};exports.visitor=visitor},{"../../../types":196}],105:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _helpersDefineMap=require("../../helpers/define-map");var defineMap=_interopRequireWildcard(_helpersDefineMap);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var visitor={ObjectExpression:function ObjectExpression(node,parent,scope,file){var hasAny=false;var _arr=node.properties;for(var _i=0;_i<_arr.length;_i++){var prop=_arr[_i];if(prop.kind==="get"||prop.kind==="set"){hasAny=true;break}}if(!hasAny)return;var mutatorMap={};node.properties=node.properties.filter(function(prop){if(prop.kind==="get"||prop.kind==="set"){defineMap.push(mutatorMap,prop,prop.kind,file);return false}else{return true}});return t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("defineProperties")),[node,defineMap.toDefineObject(mutatorMap)])}};exports.visitor=visitor},{"../../../types":196,"../../helpers/define-map":74}],106:[function(require,module,exports){"use strict";exports.__esModule=true;var visitor={ArrowFunctionExpression:function ArrowFunctionExpression(node){this.ensureBlock();node.expression=false;node.type="FunctionExpression";node.shadow=node.shadow||true}};exports.visitor=visitor},{}],107:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]; -}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _traversal=require("../../../traversal");var _traversal2=_interopRequireDefault(_traversal);var _helpersObject=require("../../../helpers/object");var _helpersObject2=_interopRequireDefault(_helpersObject);var _util=require("../../../util");var util=_interopRequireWildcard(_util);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var _lodashObjectValues=require("lodash/object/values");var _lodashObjectValues2=_interopRequireDefault(_lodashObjectValues);var _lodashObjectExtend=require("lodash/object/extend");var _lodashObjectExtend2=_interopRequireDefault(_lodashObjectExtend);function isLet(node,parent){if(!t.isVariableDeclaration(node))return false;if(node._let)return true;if(node.kind!=="let")return false;if(isLetInitable(node,parent)){for(var i=0;i=0){return}loopText=loopText+"|"+node.label.name}else{if(state.ignoreLabeless)return;if(state.inSwitchCase)return;if(t.isBreakStatement(node)&&t.isSwitchCase(parent))return}state.hasBreakContinue=true;state.map[loopText]=node;replace=t.literal(loopText)}if(this.isReturnStatement()){state.hasReturn=true;replace=t.objectExpression([t.property("init",t.identifier("v"),node.argument||t.identifier("undefined"))])}if(replace){replace=t.returnStatement(replace);this.skip();return t.inherits(replace,node)}}};var BlockScoping=function(){function BlockScoping(loopPath,blockPath,parent,scope,file){_classCallCheck(this,BlockScoping);this.parent=parent;this.scope=scope;this.file=file;this.blockPath=blockPath;this.block=blockPath.node;this.outsideLetReferences=_helpersObject2["default"]();this.hasLetReferences=false;this.letReferences=this.block._letReferences=_helpersObject2["default"]();this.body=[];if(loopPath){this.loopParent=loopPath.parent;this.loopLabel=t.isLabeledStatement(this.loopParent)&&this.loopParent.label;this.loopPath=loopPath;this.loop=loopPath.node}}BlockScoping.prototype.run=function run(){var block=this.block;if(block._letDone)return;block._letDone=true;var needsClosure=this.getLetReferences();if(t.isFunction(this.parent)||t.isProgram(this.block))return;if(!this.hasLetReferences)return;if(needsClosure){this.wrapClosure()}else{this.remap()}if(this.loopLabel&&!t.isLabeledStatement(this.loopParent)){return t.labeledStatement(this.loopLabel,this.loop)}};BlockScoping.prototype.remap=function remap(){var hasRemaps=false;var letRefs=this.letReferences;var scope=this.scope;var remaps=_helpersObject2["default"]();for(var key in letRefs){var ref=letRefs[key];if(scope.parentHasBinding(key)||scope.hasGlobal(key)){var uid=scope.generateUidIdentifier(ref.name).name;ref.name=uid;hasRemaps=true;remaps[key]=remaps[uid]={binding:ref,uid:uid}}}if(!hasRemaps)return;var loop=this.loop;if(loop){traverseReplace(loop.right,loop,scope,remaps);traverseReplace(loop.test,loop,scope,remaps);traverseReplace(loop.update,loop,scope,remaps)}this.blockPath.traverse(replaceVisitor,remaps)};BlockScoping.prototype.wrapClosure=function wrapClosure(){var block=this.block;var outsideRefs=this.outsideLetReferences;if(this.loop){for(var name in outsideRefs){var id=outsideRefs[name];if(this.scope.hasGlobal(id.name)||this.scope.parentHasBinding(id.name)){delete outsideRefs[id.name];delete this.letReferences[id.name];this.scope.rename(id.name);this.letReferences[id.name]=id;outsideRefs[id.name]=id}}}this.has=this.checkLoop();this.hoistVarDeclarations();var params=_lodashObjectValues2["default"](outsideRefs);var args=_lodashObjectValues2["default"](outsideRefs);var fn=t.functionExpression(null,params,t.blockStatement(block.body));fn.shadow=true;this.addContinuations(fn);block.body=this.body;var ref=fn;if(this.loop){ref=this.scope.generateUidIdentifier("loop");this.loopPath.insertBefore(t.variableDeclaration("var",[t.variableDeclarator(ref,fn)]))}var call=t.callExpression(ref,args);var ret=this.scope.generateUidIdentifier("ret");var hasYield=_traversal2["default"].hasType(fn.body,this.scope,"YieldExpression",t.FUNCTION_TYPES);if(hasYield){fn.generator=true;call=t.yieldExpression(call,true)}var hasAsync=_traversal2["default"].hasType(fn.body,this.scope,"AwaitExpression",t.FUNCTION_TYPES);if(hasAsync){fn.async=true;call=t.awaitExpression(call)}this.buildClosure(ret,call)};BlockScoping.prototype.buildClosure=function buildClosure(ret,call){var has=this.has;if(has.hasReturn||has.hasBreakContinue){this.buildHas(ret,call)}else{this.body.push(t.expressionStatement(call))}};BlockScoping.prototype.addContinuations=function addContinuations(fn){var state={reassignments:{},outsideReferences:this.outsideLetReferences};this.scope.traverse(fn,continuationVisitor,state);for(var i=0;i=spreadPropIndex)break;if(t.isSpreadProperty(prop))continue;var key=prop.key;if(t.isIdentifier(key)&&!prop.computed)key=t.literal(prop.key.name);keys.push(key)}keys=t.arrayExpression(keys);var value=t.callExpression(this.file.addHelper("object-without-properties"),[objRef,keys]);this.nodes.push(this.buildVariableAssignment(spreadProp.argument,value))};DestructuringTransformer.prototype.pushObjectProperty=function pushObjectProperty(prop,propRef){if(t.isLiteral(prop.key))prop.computed=true;var pattern=prop.value;var objRef=t.memberExpression(propRef,prop.key,prop.computed);if(t.isPattern(pattern)){this.push(pattern,objRef)}else{this.nodes.push(this.buildVariableAssignment(pattern,objRef))}};DestructuringTransformer.prototype.pushObjectPattern=function pushObjectPattern(pattern,objRef){if(!pattern.properties.length){this.nodes.push(t.expressionStatement(t.callExpression(this.file.addHelper("object-destructuring-empty"),[objRef])))}if(pattern.properties.length>1&&!this.scope.isStatic(objRef)){var temp=this.scope.generateUidIdentifierBasedOnNode(objRef);this.nodes.push(this.buildVariableDeclaration(temp,objRef));objRef=temp}for(var i=0;iarr.elements.length)return;if(pattern.elements.length0){elemRef=t.callExpression(t.memberExpression(elemRef,t.identifier("slice")),[t.literal(i)])}elem=elem.argument}else{elemRef=t.memberExpression(arrayRef,t.literal(i),true)}this.push(elem,elemRef)}};DestructuringTransformer.prototype.init=function init(pattern,ref){if(!t.isArrayExpression(ref)&&!t.isMemberExpression(ref)){var memo=this.scope.maybeGenerateMemoised(ref,true);if(memo){this.nodes.push(this.buildVariableDeclaration(memo,ref));ref=memo}}this.push(pattern,ref);return this.nodes};return DestructuringTransformer}()},{"../../../messages":60,"../../../types":196}],113:[function(require,module,exports){"use strict";exports.__esModule=true;exports._ForOfStatementArray=_ForOfStatementArray;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _messages=require("../../../messages");var messages=_interopRequireWildcard(_messages);var _util=require("../../../util");var util=_interopRequireWildcard(_util);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var visitor={ForOfStatement:function ForOfStatement(node,parent,scope,file){if(this.get("right").isArrayExpression()){return _ForOfStatementArray.call(this,node,scope,file)}var callback=spec;if(file.isLoose("es6.forOf"))callback=loose;var build=callback(node,parent,scope,file);var declar=build.declar;var loop=build.loop;var block=loop.body;this.ensureBlock();if(declar){block.body.push(declar)}block.body=block.body.concat(node.body.body);t.inherits(loop,node);t.inherits(loop.body,node.body);if(build.replaceParent){this.parentPath.replaceWithMultiple(build.node);this.dangerouslyRemove()}else{return build.node}}};exports.visitor=visitor;function _ForOfStatementArray(node,scope,file){var nodes=[];var right=node.right;if(!t.isIdentifier(right)||!scope.hasBinding(right.name)){var uid=scope.generateUidIdentifier("arr");nodes.push(t.variableDeclaration("var",[t.variableDeclarator(uid,right)]));right=uid}var iterationKey=scope.generateUidIdentifier("i");var loop=util.template("for-of-array",{BODY:node.body,KEY:iterationKey,ARR:right});t.inherits(loop,node);t.ensureBlock(loop);var iterationValue=t.memberExpression(right,iterationKey,true);var left=node.left;if(t.isVariableDeclaration(left)){left.declarations[0].init=iterationValue;loop.body.body.unshift(left)}else{loop.body.body.unshift(t.expressionStatement(t.assignmentExpression("=",left,iterationValue)))}if(this.parentPath.isLabeledStatement()){loop=t.labeledStatement(this.parentPath.node.label,loop)}nodes.push(loop);return nodes}var loose=function loose(node,parent,scope,file){var left=node.left;var declar,id;if(t.isIdentifier(left)||t.isPattern(left)||t.isMemberExpression(left)){id=left}else if(t.isVariableDeclaration(left)){id=scope.generateUidIdentifier("ref");declar=t.variableDeclaration(left.kind,[t.variableDeclarator(left.declarations[0].id,id)])}else{throw file.errorWithNode(left,messages.get("unknownForHead",left.type))}var iteratorKey=scope.generateUidIdentifier("iterator");var isArrayKey=scope.generateUidIdentifier("isArray");var loop=util.template("for-of-loose",{LOOP_OBJECT:iteratorKey,IS_ARRAY:isArrayKey,OBJECT:node.right,INDEX:scope.generateUidIdentifier("i"),ID:id});if(!declar){loop.body.body.shift()}return{declar:declar,node:loop,loop:loop}};var spec=function spec(node,parent,scope,file){var left=node.left;var declar;var stepKey=scope.generateUidIdentifier("step");var stepValue=t.memberExpression(stepKey,t.identifier("value"));if(t.isIdentifier(left)||t.isPattern(left)||t.isMemberExpression(left)){declar=t.expressionStatement(t.assignmentExpression("=",left,stepValue))}else if(t.isVariableDeclaration(left)){declar=t.variableDeclaration(left.kind,[t.variableDeclarator(left.declarations[0].id,stepValue)])}else{throw file.errorWithNode(left,messages.get("unknownForHead",left.type))}var iteratorKey=scope.generateUidIdentifier("iterator");var template=util.template("for-of",{ITERATOR_HAD_ERROR_KEY:scope.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:scope.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:scope.generateUidIdentifier("iteratorError"),ITERATOR_KEY:iteratorKey,STEP_KEY:stepKey,OBJECT:node.right,BODY:null});var isLabeledParent=t.isLabeledStatement(parent);var tryBody=template[3].block.body;var loop=tryBody[0];if(isLabeledParent){tryBody[0]=t.labeledStatement(parent.label,loop)}return{replaceParent:isLabeledParent,declar:declar,loop:loop,node:template}}},{"../../../messages":60,"../../../types":196,"../../../util":199}],114:[function(require,module,exports){"use strict";exports.__esModule=true;var metadata={group:"builtin-pre"};exports.metadata=metadata;var visitor={Literal:function Literal(node){if(typeof node.value==="number"&&/^0[ob]/i.test(node.raw)){node.raw=undefined}if(typeof node.value==="string"&&/\\[u]/gi.test(node.raw)){node.raw=undefined}}};exports.visitor=visitor},{}],115:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);function keepBlockHoist(node,nodes){if(node._blockHoist){for(var i=0;ilastNonDefaultParam}var lastNonDefaultParam=_helpersGetFunctionArity2["default"](node);var params=this.get("params");for(var i=0;i",len,start),t.binaryExpression("-",len,start),t.literal(0))}var loop=util.template("rest",{ARRAY_TYPE:restParam.typeAnnotation,ARGUMENTS:argsId,ARRAY_KEY:arrKey,ARRAY_LEN:arrLen,START:start,ARRAY:rest,KEY:key,LEN:len});if(state.deopted){loop._blockHoist=node.params.length+1;node.body.body.unshift(loop)}else{loop._blockHoist=1;var target=this.getEarliestCommonAncestorFrom(state.references).getStatementParent();var highestLoop;target.findParent(function(path){if(path.isLoop()){highestLoop=path}else if(path.isFunction()){return true}});if(highestLoop)target=highestLoop;target.insertBefore(loop)}}};exports.visitor=visitor},{"../../../../types":196,"../../../../util":199}],120:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);function loose(node,body,objId){var _arr=node.properties;for(var _i=0;_i<_arr.length;_i++){var prop=_arr[_i];body.push(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(objId,prop.key,prop.computed||t.isLiteral(prop.key)),prop.value)))}}function spec(node,body,objId,initProps,file){var _arr2=node.properties;for(var _i2=0;_i2<_arr2.length;_i2++){var prop=_arr2[_i2];if(t.isLiteral(t.toComputedKey(prop),{value:"__proto__"})){initProps.push(prop);continue}var key=prop.key;if(t.isIdentifier(key)&&!prop.computed){key=t.literal(key.name)}var bodyNode=t.callExpression(file.addHelper("define-property"),[objId,key,prop.value]);body.push(t.expressionStatement(bodyNode))}if(body.length===1){var first=body[0].expression;if(t.isCallExpression(first)){first.arguments[0]=t.objectExpression(initProps);return first}}}var visitor={ObjectExpression:{exit:function exit(node,parent,scope,file){var hasComputed=false;var _arr3=node.properties;for(var _i3=0;_i3<_arr3.length;_i3++){var prop=_arr3[_i3];hasComputed=t.isProperty(prop,{computed:true,kind:"init"});if(hasComputed)break}if(!hasComputed)return;var initProps=[];var stopInits=false;node.properties=node.properties.filter(function(prop){if(prop.computed){stopInits=true}if(prop.kind!=="init"||!stopInits){initProps.push(prop);return false}else{return true}});var objId=scope.generateUidIdentifierBasedOnNode(parent);var body=[];var callback=spec;if(file.isLoose("es6.properties.computed"))callback=loose;var result=callback(node,body,objId,initProps,file);if(result)return result;body.unshift(t.variableDeclaration("var",[t.variableDeclarator(objId,t.objectExpression(initProps))]));body.push(t.expressionStatement(objId));return body}}};exports.visitor=visitor},{"../../../types":196}],121:[function(require,module,exports){"use strict";exports.__esModule=true;var visitor={Property:function Property(node){if(node.method){node.method=false}if(node.shorthand){node.shorthand=false}}};exports.visitor=visitor},{}],122:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _helpersRegex=require("../../helpers/regex");var regex=_interopRequireWildcard(_helpersRegex);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var visitor={Literal:function Literal(node){if(!regex.is(node,"y"))return;return t.newExpression(t.identifier("RegExp"),[t.literal(node.regex.pattern),t.literal(node.regex.flags)])}};exports.visitor=visitor},{"../../../types":196,"../../helpers/regex":80}],123:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _regexpuRewritePattern=require("regexpu/rewrite-pattern");var _regexpuRewritePattern2=_interopRequireDefault(_regexpuRewritePattern);var _helpersRegex=require("../../helpers/regex");var regex=_interopRequireWildcard(_helpersRegex);var visitor={Literal:function Literal(node){if(!regex.is(node,"u"))return;node.regex.pattern=_regexpuRewritePattern2["default"](node.regex.pattern,node.regex.flags);regex.pullFlag(node,"u")}};exports.visitor=visitor},{"../../helpers/regex":80,"regexpu/rewrite-pattern":516}],124:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={group:"builtin-pre",optional:true};exports.metadata=metadata;var visitor={ArrowFunctionExpression:function ArrowFunctionExpression(node,parent,scope,file){if(node.shadow)return;node.shadow={"this":false};var boundThis=t.thisExpression();boundThis._forceShadow=this;t.ensureBlock(node);this.get("body").unshiftContainer("body",t.expressionStatement(t.callExpression(file.addHelper("new-arrow-check"),[t.thisExpression(),boundThis])));return t.callExpression(t.memberExpression(node,t.identifier("bind")),[t.thisExpression()])}};exports.visitor=visitor},{"../../../types":196}],125:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);function buildAssert(node,file){return t.callExpression(file.addHelper("temporal-assert-defined"),[node,t.literal(node.name),file.addHelper("temporal-undefined")])}function references(node,scope,state){var declared=state.letRefs[node.name];if(!declared)return false;return scope.getBindingIdentifier(node.name)===declared}var refVisitor={ReferencedIdentifier:function ReferencedIdentifier(node,parent,scope,state){if(t.isFor(parent)&&parent.left===node)return;if(!references(node,scope,state))return;var assert=buildAssert(node,state.file);this.skip();if(t.isUpdateExpression(parent)){if(parent._ignoreBlockScopingTDZ)return;this.parentPath.replaceWith(t.sequenceExpression([assert,parent]))}else{return t.logicalExpression("&&",assert,node)}},AssignmentExpression:{exit:function exit(node,parent,scope,state){if(node._ignoreBlockScopingTDZ)return;var nodes=[];var ids=this.getBindingIdentifiers();for(var name in ids){var id=ids[name];if(references(id,scope,state)){nodes.push(buildAssert(id,state.file))}}if(nodes.length){node._ignoreBlockScopingTDZ=true;nodes.push(node);return nodes.map(t.expressionStatement)}}}};var metadata={optional:true,group:"builtin-advanced"};exports.metadata=metadata;var visitor={"Program|Loop|BlockStatement":{exit:function exit(node,parent,scope,file){var letRefs=node._letReferences;if(!letRefs)return;this.traverse(refVisitor,{letRefs:letRefs,file:file})}}};exports.visitor=visitor},{"../../../types":196}],126:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types"); -var t=_interopRequireWildcard(_types);var metadata={group:"builtin-pre",optional:true};exports.metadata=metadata;var visitor={Program:function Program(){var id=this.scope.generateUidIdentifier("null");this.unshiftContainer("body",[t.variableDeclaration("var",[t.variableDeclarator(id,t.literal(null))]),t.exportNamedDeclaration(null,[t.exportSpecifier(id,t.identifier("__proto__"))])])}};exports.visitor=visitor},{"../../../types":196}],127:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={optional:true};exports.metadata=metadata;var visitor={UnaryExpression:function UnaryExpression(node,parent,scope,file){if(node._ignoreSpecSymbols)return;if(this.parentPath.isBinaryExpression()&&t.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator)>=0){var opposite=this.getOpposite();if(opposite.isLiteral()&&opposite.node.value!=="symbol"&&opposite.node.value!=="object")return}if(node.operator==="typeof"){var call=t.callExpression(file.addHelper("typeof"),[node.argument]);if(this.get("argument").isIdentifier()){var undefLiteral=t.literal("undefined");var unary=t.unaryExpression("typeof",node.argument);unary._ignoreSpecSymbols=true;return t.conditionalExpression(t.binaryExpression("===",unary,undefLiteral),undefLiteral,call)}else{return call}}},BinaryExpression:function BinaryExpression(node,parent,scope,file){if(node.operator==="instanceof"){return t.callExpression(file.addHelper("instanceof"),[node.left,node.right])}},"VariableDeclaration|FunctionDeclaration":function VariableDeclarationFunctionDeclaration(node){if(node._generated)this.skip()}};exports.visitor=visitor},{"../../../types":196}],128:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={optional:true,group:"builtin-pre"};exports.metadata=metadata;var visitor={TemplateLiteral:function TemplateLiteral(node,parent){if(t.isTaggedTemplateExpression(parent))return;for(var i=0;i0){var declarations=_lodashArrayFlatten2["default"](_lodashCollectionMap2["default"](this.vars,function(decl){return decl.declarations}));var assignment=_lodashCollectionReduceRight2["default"](declarations,function(expr,decl){return t.assignmentExpression("=",decl.id,expr)},t.identifier("undefined"));var statement=t.expressionStatement(assignment);statement._blockHoist=Infinity;body.unshift(statement)}var paramDecls=this.paramDecls;if(paramDecls.length>0){var paramDecl=t.variableDeclaration("var",paramDecls);paramDecl._blockHoist=Infinity;body.unshift(paramDecl)}body.unshift(t.expressionStatement(t.assignmentExpression("=",this.getAgainId(),t.literal(false))));node.body=util.template("tail-call-body",{FUNCTION_ID:this.getFunctionId(),AGAIN_ID:this.getAgainId(),BLOCK:node.body});var topVars=[];if(this.needsThis){var _arr=this.thisPaths;for(var _i=0;_i<_arr.length;_i++){var path=_arr[_i];path.replaceWith(this.getThisId())}topVars.push(t.variableDeclarator(this.getThisId(),t.thisExpression()))}if(this.needsArguments||this.setsArguments){var _arr2=this.argumentsPaths;for(var _i2=0;_i2<_arr2.length;_i2++){var _path=_arr2[_i2];_path.replaceWith(this.argumentsId)}var decl=t.variableDeclarator(this.argumentsId);if(this.argumentsId){decl.init=t.identifier("arguments");decl.init._shadowedFunctionLiteral=this.path}topVars.push(decl)}var leftId=this.leftId;if(leftId){topVars.push(t.variableDeclarator(leftId))}if(topVars.length>0){node.body.body.unshift(t.variableDeclaration("var",topVars))}};TailCallTransformer.prototype.subTransform=function subTransform(node){if(!node)return;var handler=this["subTransform"+node.type];if(handler)return handler.call(this,node)};TailCallTransformer.prototype.subTransformConditionalExpression=function subTransformConditionalExpression(node){var callConsequent=this.subTransform(node.consequent);var callAlternate=this.subTransform(node.alternate);if(!callConsequent&&!callAlternate){return}node.type="IfStatement";node.consequent=callConsequent?t.toBlock(callConsequent):returnBlock(node.consequent);if(callAlternate){node.alternate=t.isIfStatement(callAlternate)?callAlternate:t.toBlock(callAlternate)}else{node.alternate=returnBlock(node.alternate)}return[node]};TailCallTransformer.prototype.subTransformLogicalExpression=function subTransformLogicalExpression(node){var callRight=this.subTransform(node.right);if(!callRight)return;var leftId=this.getLeftId();var testExpr=t.assignmentExpression("=",leftId,node.left);if(node.operator==="&&"){testExpr=t.unaryExpression("!",testExpr)}return[t.ifStatement(testExpr,returnBlock(leftId))].concat(callRight)};TailCallTransformer.prototype.subTransformSequenceExpression=function subTransformSequenceExpression(node){var seq=node.expressions;var lastCall=this.subTransform(seq[seq.length-1]);if(!lastCall){return}if(--seq.length===1){node=seq[0]}return[t.expressionStatement(node)].concat(lastCall)};TailCallTransformer.prototype.subTransformCallExpression=function subTransformCallExpression(node){var callee=node.callee;var thisBinding,args;if(t.isMemberExpression(callee,{computed:false})&&t.isIdentifier(callee.property)){switch(callee.property.name){case"call":args=t.arrayExpression(node.arguments.slice(1));break;case"apply":args=node.arguments[1]||t.identifier("undefined");this.needsArguments=true;break;default:return}thisBinding=node.arguments[0];callee=callee.object}if(!t.isIdentifier(callee)||!this.scope.bindingIdentifierEquals(callee.name,this.ownerId)){return}this.hasTailRecursion=true;if(this.hasDeopt())return;var body=[];if(this.needsThis&&!t.isThisExpression(thisBinding)){body.push(t.expressionStatement(t.assignmentExpression("=",this.getThisId(),thisBinding||t.identifier("undefined"))))}if(!args){args=t.arrayExpression(node.arguments)}var argumentsId=this.getArgumentsId();var params=this.getParams();if(this.needsArguments){body.push(t.expressionStatement(t.assignmentExpression("=",argumentsId,args)))}if(t.isArrayExpression(args)){var elems=args.elements;while(elems.length1){var root=buildBinaryExpression(nodes.shift(),nodes.shift());var _arr3=nodes;for(var _i3=0;_i3<_arr3.length;_i3++){var _node=_arr3[_i3];root=buildBinaryExpression(root,_node)}this.replaceWith(root)}else{return nodes[0]}}};exports.visitor=visitor},{"../../../types":196}],132:[function(require,module,exports){"use strict";exports.__esModule=true;var metadata={stage:2};exports.metadata=metadata},{}],133:[function(require,module,exports){"use strict";exports.__esModule=true;var metadata={stage:0,dependencies:["es6.classes"]};exports.metadata=metadata},{}],134:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _helpersBuildComprehension=require("../../helpers/build-comprehension");var _helpersBuildComprehension2=_interopRequireDefault(_helpersBuildComprehension);var _traversal=require("../../../traversal");var _traversal2=_interopRequireDefault(_traversal);var _util=require("../../../util");var util=_interopRequireWildcard(_util);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={stage:0};exports.metadata=metadata;var visitor={ComprehensionExpression:function ComprehensionExpression(node,parent,scope){var callback=array;if(node.generator)callback=generator;return callback(node,parent,scope)}};exports.visitor=visitor;function generator(node){var body=[];var container=t.functionExpression(null,[],t.blockStatement(body),true);container.shadow=true;body.push(_helpersBuildComprehension2["default"](node,function(){return t.expressionStatement(t.yieldExpression(node.body))}));return t.callExpression(container,[])}function array(node,parent,scope){var uid=scope.generateUidIdentifierBasedOnNode(parent);var container=util.template("array-comprehension-container",{KEY:uid});container.callee.shadow=true;var block=container.callee.body;var body=block.body;if(_traversal2["default"].hasType(node,scope,"YieldExpression",t.FUNCTION_TYPES)){container.callee.generator=true;container=t.yieldExpression(container,true)}var returnStatement=body.pop();body.push(_helpersBuildComprehension2["default"](node,function(){return util.template("array-push",{STATEMENT:node.body,KEY:uid},true)}));body.push(returnStatement);return container}},{"../../../traversal":165,"../../../types":196,"../../../util":199,"../../helpers/build-comprehension":71}],135:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _helpersMemoiseDecorators=require("../../helpers/memoise-decorators");var _helpersMemoiseDecorators2=_interopRequireDefault(_helpersMemoiseDecorators);var _helpersDefineMap=require("../../helpers/define-map");var defineMap=_interopRequireWildcard(_helpersDefineMap);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={dependencies:["es6.classes"],optional:true,stage:1};exports.metadata=metadata;var visitor={ObjectExpression:function ObjectExpression(node,parent,scope,file){var hasDecorators=false;for(var i=0;i=1){nodes.push(node)}return nodes}};exports.visitor=visitor},{"../../../types":196}],139:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={optional:true,stage:0};exports.metadata=metadata;function getTempId(scope){var id=scope.path.getData("functionBind");if(id)return id;id=scope.generateDeclaredUidIdentifier("context");return scope.path.setData("functionBind",id)}function getStaticContext(bind,scope){var object=bind.object||bind.callee.object;return scope.isStatic(object)&&object}function inferBindContext(bind,scope){var staticContext=getStaticContext(bind,scope);if(staticContext)return staticContext;var tempId=getTempId(scope);if(bind.object){bind.callee=t.sequenceExpression([t.assignmentExpression("=",tempId,bind.object),bind.callee])}else{bind.callee.object=t.assignmentExpression("=",tempId,bind.callee.object)}return tempId}var visitor={CallExpression:function CallExpression(node,parent,scope){var bind=node.callee;if(!t.isBindExpression(bind))return;var context=inferBindContext(bind,scope);node.callee=t.memberExpression(bind.callee,t.identifier("call"));node.arguments.unshift(context)},BindExpression:function BindExpression(node,parent,scope){var context=inferBindContext(node,scope);return t.callExpression(t.memberExpression(node.callee,t.identifier("bind")),[context])}};exports.visitor=visitor},{"../../../types":196}],140:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={stage:2,dependencies:["es6.destructuring"]};exports.metadata=metadata;var hasSpread=function hasSpread(node){for(var i=0;i=opts.stage)return true}function optional(transformer,opts){if(transformer.metadata.optional&&!_lodashCollectionIncludes2["default"](opts.optional,transformer.key))return false}},{"lodash/collection/includes":345}],143:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]={"minification.constantFolding":require("babel-plugin-constant-folding"),strict:require("./other/strict"),eval:require("babel-plugin-eval"),_validation:require("./internal/validation"),_hoistDirectives:require("./internal/hoist-directives"),"minification.removeDebugger":require("babel-plugin-remove-debugger"),"minification.removeConsole":require("babel-plugin-remove-console"),"utility.inlineEnvironmentVariables":require("babel-plugin-inline-environment-variables"),"minification.deadCodeElimination":require("babel-plugin-dead-code-elimination"),_modules:require("./internal/modules"),"react.displayName":require("babel-plugin-react-display-name"),"es6.spec.modules":require("./es6/spec.modules"),"es6.spec.arrowFunctions":require("./es6/spec.arrow-functions"),"es6.spec.templateLiterals":require("./es6/spec.template-literals"),"es6.templateLiterals":require("./es6/template-literals"),"es6.literals":require("./es6/literals"),"validation.undeclaredVariableCheck":require("babel-plugin-undeclared-variables-check"),"spec.functionName":require("./spec/function-name"),"es7.classProperties":require("./es7/class-properties"),"es7.trailingFunctionCommas":require("./es7/trailing-function-commas"),"es7.asyncFunctions":require("./es7/async-functions"),"es7.decorators":require("./es7/decorators"),"validation.react":require("./validation/react"),"es6.arrowFunctions":require("./es6/arrow-functions"),"spec.blockScopedFunctions":require("./spec/block-scoped-functions"),"optimisation.react.constantElements":require("babel-plugin-react-constant-elements"),"optimisation.react.inlineElements":require("./optimisation/react.inline-elements"),"es7.comprehensions":require("./es7/comprehensions"),"es6.classes":require("./es6/classes"),asyncToGenerator:require("./other/async-to-generator"),bluebirdCoroutines:require("./other/bluebird-coroutines"),"es6.objectSuper":require("./es6/object-super"),"es7.objectRestSpread":require("./es7/object-rest-spread"),"es7.exponentiationOperator":require("./es7/exponentiation-operator"),"es5.properties.mutators":require("./es5/properties.mutators"),"es6.properties.shorthand":require("./es6/properties.shorthand"),"es6.properties.computed":require("./es6/properties.computed"),"optimisation.flow.forOf":require("./optimisation/flow.for-of"),"es6.forOf":require("./es6/for-of"),"es6.regex.sticky":require("./es6/regex.sticky"),"es6.regex.unicode":require("./es6/regex.unicode"),"es6.constants":require("./es6/constants"),"es7.exportExtensions":require("./es7/export-extensions"),"spec.protoToAssign":require("babel-plugin-proto-to-assign"),"es7.doExpressions":require("./es7/do-expressions"),"es6.spec.symbols":require("./es6/spec.symbols"),"es7.functionBind":require("./es7/function-bind"),"spec.undefinedToVoid":require("babel-plugin-undefined-to-void"),"es6.spread":require("./es6/spread"),"es6.parameters":require("./es6/parameters"),"es6.destructuring":require("./es6/destructuring"),"es6.blockScoping":require("./es6/block-scoping"),"es6.spec.blockScoping":require("./es6/spec.block-scoping"),reactCompat:require("./other/react-compat"),react:require("./other/react"),regenerator:require("./other/regenerator"),runtime:require("babel-plugin-runtime"),"es6.modules":require("./es6/modules"),_moduleFormatter:require("./internal/module-formatter"),"es6.tailCall":require("./es6/tail-call"),_shadowFunctions:require("./internal/shadow-functions"),"es3.propertyLiterals":require("./es3/property-literals"),"es3.memberExpressionLiterals":require("./es3/member-expression-literals"),"minification.memberExpressionLiterals":require("babel-plugin-member-expression-literals"), -"minification.propertyLiterals":require("babel-plugin-property-literals"),_blockHoist:require("./internal/block-hoist"),jscript:require("babel-plugin-jscript"),flow:require("./other/flow"),"optimisation.modules.system":require("./optimisation/modules.system")};module.exports=exports["default"]},{"./es3/member-expression-literals":103,"./es3/property-literals":104,"./es5/properties.mutators":105,"./es6/arrow-functions":106,"./es6/block-scoping":107,"./es6/classes":108,"./es6/constants":111,"./es6/destructuring":112,"./es6/for-of":113,"./es6/literals":114,"./es6/modules":115,"./es6/object-super":116,"./es6/parameters":118,"./es6/properties.computed":120,"./es6/properties.shorthand":121,"./es6/regex.sticky":122,"./es6/regex.unicode":123,"./es6/spec.arrow-functions":124,"./es6/spec.block-scoping":125,"./es6/spec.modules":126,"./es6/spec.symbols":127,"./es6/spec.template-literals":128,"./es6/spread":129,"./es6/tail-call":130,"./es6/template-literals":131,"./es7/async-functions":132,"./es7/class-properties":133,"./es7/comprehensions":134,"./es7/decorators":135,"./es7/do-expressions":136,"./es7/exponentiation-operator":137,"./es7/export-extensions":138,"./es7/function-bind":139,"./es7/object-rest-spread":140,"./es7/trailing-function-commas":141,"./internal/block-hoist":144,"./internal/hoist-directives":145,"./internal/module-formatter":146,"./internal/modules":147,"./internal/shadow-functions":148,"./internal/validation":149,"./optimisation/flow.for-of":150,"./optimisation/modules.system":151,"./optimisation/react.inline-elements":152,"./other/async-to-generator":153,"./other/bluebird-coroutines":154,"./other/flow":155,"./other/react":157,"./other/react-compat":156,"./other/regenerator":158,"./other/strict":159,"./spec/block-scoped-functions":160,"./spec/function-name":161,"./validation/react":162,"babel-plugin-constant-folding":200,"babel-plugin-dead-code-elimination":201,"babel-plugin-eval":202,"babel-plugin-inline-environment-variables":203,"babel-plugin-jscript":204,"babel-plugin-member-expression-literals":205,"babel-plugin-property-literals":206,"babel-plugin-proto-to-assign":207,"babel-plugin-react-constant-elements":208,"babel-plugin-react-display-name":209,"babel-plugin-remove-console":210,"babel-plugin-remove-debugger":211,"babel-plugin-runtime":213,"babel-plugin-undeclared-variables-check":214,"babel-plugin-undefined-to-void":216}],144:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashCollectionSortBy=require("lodash/collection/sortBy");var _lodashCollectionSortBy2=_interopRequireDefault(_lodashCollectionSortBy);var metadata={group:"builtin-trailing"};exports.metadata=metadata;var visitor={Block:{exit:function exit(node){var hasChange=false;for(var i=0;i=0){comment.value=comment.value.replace(FLOW_DIRECTIVE,"");if(!comment.value.replace(/\*/g,"").trim())comment._displayed=true}}},Flow:function Flow(){this.dangerouslyRemove()},ClassProperty:function ClassProperty(node){node.typeAnnotation=null;if(!node.value)this.dangerouslyRemove()},Class:function Class(node){node["implements"]=null},Function:function Function(node){for(var i=0;i0){nodePath=nodePath.get(keysAlongPath.pop())}return nodePath}},{"../../../types":196,regenerator:467}],159:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var metadata={group:"builtin-pre"};exports.metadata=metadata;var THIS_BREAK_KEYS=["FunctionExpression","FunctionDeclaration","ClassProperty"];function isUseStrict(node){if(!t.isLiteral(node))return false;if(node.raw&&node.rawValue===node.value){return node.rawValue==="use strict"}else{return node.value==="use strict"}}var visitor={Program:{enter:function enter(program){var first=program.body[0];var directive;if(t.isExpressionStatement(first)&&isUseStrict(first.expression)){directive=first}else{directive=t.expressionStatement(t.literal("use strict"));this.unshiftContainer("body",directive);if(first){directive.leadingComments=first.leadingComments;first.leadingComments=[]}}directive._blockHoist=Infinity}},ThisExpression:function ThisExpression(){if(!this.findParent(function(path){return!path.is("shadow")&&THIS_BREAK_KEYS.indexOf(path.type)>=0})){return t.identifier("undefined")}}};exports.visitor=visitor},{"../../../types":196}],160:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);function statementList(key,path){var paths=path.get(key);for(var i=0;i=0)continue;visited.push(path.node);if(path.visit()){stop=true;break}}var _arr3=queue;for(var _i3=0;_i3<_arr3.length;_i3++){var path=_arr3[_i3];path.shiftContext()}this.queue=null;return stop};TraversalContext.prototype.visitSingle=function visitSingle(node,key){if(this.shouldVisit(node[key])){var path=this.create(node,node,key);path.visit();path.shiftContext()}};TraversalContext.prototype.visit=function visit(node,key){var nodes=node[key];if(!nodes)return;if(Array.isArray(nodes)){return this.visitMultiple(nodes,node,key)}else{return this.visitSingle(node,key)}};return TraversalContext}();exports["default"]=TraversalContext;module.exports=exports["default"]},{"../types":196,"./path":172}],164:[function(require,module,exports){"use strict";exports.__esModule=true;function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var Hub=function Hub(file){_classCallCheck(this,Hub);this.file=file};exports["default"]=Hub;module.exports=exports["default"]},{}],165:[function(require,module,exports){"use strict";exports.__esModule=true;exports["default"]=traverse;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _context=require("./context");var _context2=_interopRequireDefault(_context);var _visitors=require("./visitors");var visitors=_interopRequireWildcard(_visitors);var _messages=require("../messages");var messages=_interopRequireWildcard(_messages);var _lodashCollectionIncludes=require("lodash/collection/includes");var _lodashCollectionIncludes2=_interopRequireDefault(_lodashCollectionIncludes);var _types=require("../types");var t=_interopRequireWildcard(_types);function traverse(parent,opts,scope,state,parentPath){if(!parent)return;if(!opts)opts={};if(!opts.noScope&&!scope){if(parent.type!=="Program"&&parent.type!=="File"){throw new Error(messages.get("traverseNeedsParent",parent.type))}}visitors.explode(opts);if(Array.isArray(parent)){for(var i=0;icurrentKeyIndex){earliest=path}}return earliest})}function getDeepestCommonAncestorFrom(paths,filter){var _this=this;if(!paths.length){return this}if(paths.length===1){return paths[0]}var minDepth=Infinity;var lastCommonIndex,lastCommon;var ancestries=paths.map(function(path){var ancestry=[];do{ancestry.unshift(path)}while((path=path.parentPath)&&path!==_this);if(ancestry.length-1}function visit(){if(this.isBlacklisted())return false;if(this.opts.shouldSkip&&this.opts.shouldSkip(this))return false;this.call("enter");if(this.shouldSkip){return this.shouldStop}var node=this.node;var opts=this.opts;if(node){if(Array.isArray(node)){for(var i=0;i":return left>right;case"<=":return left<=right;case">=":return left>=right;case"==":return left==right;case"!=":return left!=right;case"===":return left===right;case"!==":return left!==right}}if(path.isCallExpression()){var callee=path.get("callee");var context;var func;if(callee.isIdentifier()&&!path.scope.getBinding(callee.node.name,true)&&VALID_CALLEES.indexOf(callee.node.name)>=0){func=global[node.callee.name]}if(callee.isMemberExpression()){var object=callee.get("object");var property=callee.get("property");if(object.isIdentifier()&&property.isIdentifier()&&VALID_CALLEES.indexOf(object.node.name)>=0){context=global[object.node.name];func=context[property.node.name]}if(object.isLiteral()&&property.isIdentifier()){var type=typeof object.node.value;if(type==="string"||type==="number"){context=object.node.value;func=context[property.node.name]}}}if(func){var args=path.get("arguments").map(evaluate);if(!confident)return;return func.apply(context,args)}}confident=false}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],171:[function(require,module,exports){"use strict";exports.__esModule=true;exports.getStatementParent=getStatementParent;exports.getOpposite=getOpposite;exports.getCompletionRecords=getCompletionRecords;exports.getSibling=getSibling;exports.get=get;exports._getKey=_getKey;exports._getPattern=_getPattern;exports.getBindingIdentifiers=getBindingIdentifiers;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _index=require("./index");var _index2=_interopRequireDefault(_index);var _types=require("../../types");var t=_interopRequireWildcard(_types);function getStatementParent(){var path=this;do{if(!path.parentPath||Array.isArray(path.container)&&path.isStatement()){break}else{path=path.parentPath}}while(path);if(path&&(path.isProgram()||path.isFile())){throw new Error("File/Program node, we can't possibly find a statement parent to this")}return path}function getOpposite(){if(this.key==="left"){return this.getSibling("right")}else if(this.key==="right"){return this.getSibling("left")}}function getCompletionRecords(){var paths=[];var add=function add(path){if(path)paths=paths.concat(path.getCompletionRecords())};if(this.isIfStatement()){add(this.get("consequent"));add(this.get("alternate"))}else if(this.isDoExpression()||this.isFor()||this.isWhile()){add(this.get("body"))}else if(this.isProgram()||this.isBlockStatement()){add(this.get("body").pop())}else if(this.isFunction()){return this.get("body").getCompletionRecords()}else if(this.isTryStatement()){add(this.get("block"));add(this.get("handler"));add(this.get("finalizer"))}else{paths.push(this)}return paths}function getSibling(key){return _index2["default"].get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:key})}function get(key,context){if(context===true)context=this.context;var parts=key.split(".");if(parts.length===1){return this._getKey(key,context)}else{return this._getPattern(parts,context)}}function _getKey(key,context){var _this=this;var node=this.node;var container=node[key];if(Array.isArray(container)){return container.map(function(_,i){return _index2["default"].get({listKey:key,parentPath:_this,parent:node,container:container,key:i}).setContext(context)})}else{return _index2["default"].get({parentPath:this,parent:node,container:node,key:key}).setContext(context)}}function _getPattern(parts,context){var path=this;var _arr=parts;for(var _i=0;_i<_arr.length;_i++){var part=_arr[_i];if(part==="."){path=path.parentPath}else{if(Array.isArray(path)){path=path[part]}else{path=path.get(part,context)}}}return path}function getBindingIdentifiers(duplicates){return t.getBindingIdentifiers(this.node,duplicates)}},{"../../types":196,"./index":172}],172:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _libVirtualTypes=require("./lib/virtual-types");var virtualTypes=_interopRequireWildcard(_libVirtualTypes);var _index=require("../index");var _index2=_interopRequireDefault(_index);var _lodashObjectAssign=require("lodash/object/assign");var _lodashObjectAssign2=_interopRequireDefault(_lodashObjectAssign);var _scope=require("../scope");var _scope2=_interopRequireDefault(_scope);var _types=require("../../types");var t=_interopRequireWildcard(_types);var NodePath=function(){function NodePath(hub,parent){_classCallCheck(this,NodePath);this.contexts=[];this.parent=parent;this.data={};this.hub=hub;this.shouldSkip=false;this.shouldStop=false;this.removed=false;this.state=null;this.opts=null;this.skipKeys=null;this.parentPath=null;this.context=null;this.container=null;this.listKey=null;this.inList=false;this.parentKey=null;this.key=null;this.node=null;this.scope=null;this.type=null;this.typeAnnotation=null}NodePath.get=function get(_ref){var hub=_ref.hub;var parentPath=_ref.parentPath;var parent=_ref.parent;var container=_ref.container;var listKey=_ref.listKey;var key=_ref.key;if(!hub&&parentPath){hub=parentPath.hub}var targetNode=container[key];var paths=parent._paths=parent._paths||[];var path;for(var i=0;i=0)continue;visitedScopes.push(violationScope);constantViolations.push(violation);if(violationScope===path.scope){constantViolations=[violation];break}}constantViolations=constantViolations.concat(functionConstantViolations);var _arr2=constantViolations;for(var _i2=0;_i2<_arr2.length;_i2++){var violation=_arr2[_i2];types.push(violation.getTypeAnnotation())}}if(types.length){return t.createUnionTypeAnnotation(types)}}function getConstantViolationsBefore(binding,path,functions){var violations=binding.constantViolations.slice();violations.unshift(binding.path);return violations.filter(function(violation){violation=violation.resolve();var status=violation._guessExecutionStatusRelativeTo(path);if(functions&&status==="function")functions.push(violation);return status==="before"})}function inferAnnotationFromBinaryExpression(name,path){var operator=path.node.operator;var right=path.get("right").resolve();var left=path.get("left").resolve();var target;if(left.isIdentifier({name:name})){target=right}else if(right.isIdentifier({name:name})){target=left}if(target){if(operator==="==="){return target.getTypeAnnotation()}else if(t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator)>=0){return t.numberTypeAnnotation()}else{return}}else{if(operator!=="===")return}var typeofPath;var typePath;if(left.isUnaryExpression({operator:"typeof"})){typeofPath=left;typePath=right}else if(right.isUnaryExpression({operator:"typeof"})){typeofPath=right;typePath=left}if(!typePath&&!typeofPath)return;typePath=typePath.resolve();if(!typePath.isLiteral())return;var typeValue=typePath.node.value;if(typeof typeValue!=="string")return;if(!typeofPath.get("argument").isIdentifier({name:name}))return;return t.createTypeAnnotationBasedOnTypeof(typePath.node.value)}function getParentConditionalPath(path){var parentPath;while(parentPath=path.parentPath){if(parentPath.isIfStatement()||parentPath.isConditionalExpression()){if(path.key==="test"){return}else{return parentPath}}else{path=parentPath}}}function getConditionalAnnotation(path,name){var ifStatement=getParentConditionalPath(path);if(!ifStatement)return;var test=ifStatement.get("test");var paths=[test];var types=[];do{var _path=paths.shift().resolve();if(_path.isLogicalExpression()){paths.push(_path.get("left"));paths.push(_path.get("right"))}if(_path.isBinaryExpression()){var type=inferAnnotationFromBinaryExpression(name,_path);if(type)types.push(type)}}while(paths.length);if(types.length){return{typeAnnotation:t.createUnionTypeAnnotation(types),ifStatement:ifStatement}}else{return getConditionalAnnotation(ifStatement,name)}}module.exports=exports["default"]},{"../../../types":196}],175:[function(require,module,exports){"use strict";exports.__esModule=true;exports.VariableDeclarator=VariableDeclarator;exports.TypeCastExpression=TypeCastExpression;exports.NewExpression=NewExpression;exports.TemplateLiteral=TemplateLiteral;exports.UnaryExpression=UnaryExpression;exports.BinaryExpression=BinaryExpression;exports.LogicalExpression=LogicalExpression;exports.ConditionalExpression=ConditionalExpression;exports.SequenceExpression=SequenceExpression;exports.AssignmentExpression=AssignmentExpression;exports.UpdateExpression=UpdateExpression;exports.Literal=Literal;exports.ObjectExpression=ObjectExpression;exports.ArrayExpression=ArrayExpression;exports.RestElement=RestElement;exports.CallExpression=CallExpression;exports.TaggedTemplateExpression=TaggedTemplateExpression;function _interopRequire(obj){return obj&&obj.__esModule?obj["default"]:obj}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var _infererReference=require("./inferer-reference");exports.Identifier=_interopRequire(_infererReference);function VariableDeclarator(){var id=this.get("id");if(id.isIdentifier()){return this.get("init").getTypeAnnotation()}else{return}}function TypeCastExpression(node){return node.typeAnnotation}TypeCastExpression.validParent=true;function NewExpression(node){if(this.get("callee").isIdentifier()){return t.genericTypeAnnotation(node.callee)}}function TemplateLiteral(){return t.stringTypeAnnotation()}function UnaryExpression(node){var operator=node.operator;if(operator==="void"){return t.voidTypeAnnotation()}else if(t.NUMBER_UNARY_OPERATORS.indexOf(operator)>=0){return t.numberTypeAnnotation()}else if(t.STRING_UNARY_OPERATORS.indexOf(operator)>=0){return t.stringTypeAnnotation()}else if(t.BOOLEAN_UNARY_OPERATORS.indexOf(operator)>=0){return t.booleanTypeAnnotation()}}function BinaryExpression(node){var operator=node.operator;if(t.NUMBER_BINARY_OPERATORS.indexOf(operator)>=0){return t.numberTypeAnnotation()}else if(t.BOOLEAN_BINARY_OPERATORS.indexOf(operator)>=0){return t.booleanTypeAnnotation()}else if(operator==="+"){var right=this.get("right");var left=this.get("left");if(left.isBaseType("number")&&right.isBaseType("number")){return t.numberTypeAnnotation()}else if(left.isBaseType("string")||right.isBaseType("string")){return t.stringTypeAnnotation()}return t.unionTypeAnnotation([t.stringTypeAnnotation(),t.numberTypeAnnotation()])}}function LogicalExpression(){return t.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(),this.get("right").getTypeAnnotation()])}function ConditionalExpression(){return t.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(),this.get("alternate").getTypeAnnotation()])}function SequenceExpression(node){return this.get("expressions").pop().getTypeAnnotation()}function AssignmentExpression(node){return this.get("right").getTypeAnnotation()}function UpdateExpression(node){var operator=node.operator;if(operator==="++"||operator==="--"){return t.numberTypeAnnotation()}}function Literal(node){var value=node.value;if(typeof value==="string")return t.stringTypeAnnotation();if(typeof value==="number")return t.numberTypeAnnotation();if(typeof value==="boolean")return t.booleanTypeAnnotation();if(value===null)return t.voidTypeAnnotation();if(node.regex)return t.genericTypeAnnotation(t.identifier("RegExp"))}function ObjectExpression(){return t.genericTypeAnnotation(t.identifier("Object"))}function ArrayExpression(){return t.genericTypeAnnotation(t.identifier("Array"))}function RestElement(){return ArrayExpression()}RestElement.validParent=true;function Func(){return t.genericTypeAnnotation(t.identifier("Function"))}exports.Function=Func;exports.Class=Func;function CallExpression(){return resolveCall(this.get("callee"))}function TaggedTemplateExpression(){return resolveCall(this.get("tag"))}function resolveCall(callee){callee=callee.resolve();if(callee.isFunction()){if(callee.is("async")){if(callee.is("generator")){return t.genericTypeAnnotation(t.identifier("AsyncIterator"))}else{return t.genericTypeAnnotation(t.identifier("Promise"))}}else{if(callee.node.returnType){return callee.node.returnType}else{}}}}},{"../../../types":196,"./inferer-reference":174}],176:[function(require,module,exports){"use strict";exports.__esModule=true;exports.matchesPattern=matchesPattern;exports.has=has;exports.isnt=isnt;exports.equals=equals;exports.isNodeType=isNodeType;exports.canHaveVariableDeclarationOrExpression=canHaveVariableDeclarationOrExpression;exports.isCompletionRecord=isCompletionRecord;exports.isStatementOrBlock=isStatementOrBlock;exports.referencesImport=referencesImport;exports.getSource=getSource;exports.willIMaybeExecuteBefore=willIMaybeExecuteBefore;exports._guessExecutionStatusRelativeTo=_guessExecutionStatusRelativeTo;exports.resolve=resolve;exports._resolve=_resolve;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashCollectionIncludes=require("lodash/collection/includes");var _lodashCollectionIncludes2=_interopRequireDefault(_lodashCollectionIncludes);var _types=require("../../types");var t=_interopRequireWildcard(_types);function matchesPattern(pattern,allowPartial){if(!this.isMemberExpression())return false;var parts=pattern.split(".");var search=[this.node];var i=0;function matches(name){var part=parts[i];return part==="*"||name===part}while(search.length){var node=search.shift();if(allowPartial&&i===parts.length){return true}if(t.isIdentifier(node)){ -if(!matches(node.name))return false}else if(t.isLiteral(node)){if(!matches(node.value))return false}else if(t.isMemberExpression(node)){if(node.computed&&!t.isLiteral(node.property)){return false}else{search.unshift(node.property);search.unshift(node.object);continue}}else if(t.isThisExpression(node)){if(!matches("this"))return false}else{return false}if(++i>parts.length){return false}}return i===parts.length}function has(key){var val=this.node[key];if(val&&Array.isArray(val)){return!!val.length}else{return!!val}}var is=has;exports.is=is;function isnt(key){return!this.has(key)}function equals(key,value){return this.node[key]===value}function isNodeType(type){return t.isType(this.type,type)}function canHaveVariableDeclarationOrExpression(){return(this.key==="init"||this.key==="left")&&this.parentPath.isFor()}function isCompletionRecord(allowInsideFunction){var path=this;var first=true;do{var container=path.container;if(path.isFunction()&&!first){return!!allowInsideFunction}first=false;if(Array.isArray(container)&&path.key!==container.length-1){return false}}while((path=path.parentPath)&&!path.isProgram());return true}function isStatementOrBlock(){if(this.parentPath.isLabeledStatement()||t.isBlockStatement(this.container)){return false}else{return _lodashCollectionIncludes2["default"](t.STATEMENT_OR_BLOCK_KEYS,this.key)}}function referencesImport(moduleSource,importName){if(!this.isReferencedIdentifier())return false;var binding=this.scope.getBinding(this.node.name);if(!binding||binding.kind!=="module")return false;var path=binding.path;var parent=path.parentPath;if(!parent.isImportDeclaration())return false;if(parent.node.source.value===moduleSource){if(!importName)return true}else{return false}if(path.isImportDefaultSpecifier()&&importName==="default"){return true}if(path.isImportNamespaceSpecifier()&&importName==="*"){return true}if(path.isImportSpecifier()&&path.node.imported.name===importName){return true}return false}function getSource(){var node=this.node;if(node.end){return this.hub.file.code.slice(node.start,node.end)}else{return""}}function willIMaybeExecuteBefore(target){return this._guessExecutionStatusRelativeTo(target)!=="after"}function _guessExecutionStatusRelativeTo(target){var targetFuncParent=target.scope.getFunctionParent();var selfFuncParent=this.scope.getFunctionParent();if(targetFuncParent!==selfFuncParent){return"function"}var targetPaths=target.getAncestry();var selfPaths=this.getAncestry();var commonPath;var targetIndex;var selfIndex;for(selfIndex=0;selfIndex=0){commonPath=selfPath;break}}if(!commonPath){return"before"}var targetRelationship=targetPaths[targetIndex-1];var selfRelationship=selfPaths[selfIndex-1];if(!targetRelationship||!selfRelationship){return"before"}if(targetRelationship.listKey&&targetRelationship.container===selfRelationship.container){return targetRelationship.key>selfRelationship.key?"before":"after"}var targetKeyPosition=t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key);var selfKeyPosition=t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key);return targetKeyPosition>selfKeyPosition?"before":"after"}function resolve(dangerous,resolved){return this._resolve(dangerous,resolved)||this}function _resolve(dangerous,resolved){if(resolved&&resolved.indexOf(this)>=0)return;resolved=resolved||[];resolved.push(this);if(this.isVariableDeclarator()){if(this.get("id").isIdentifier()){return this.get("init").resolve(dangerous,resolved)}else{}}else if(this.isReferencedIdentifier()){var binding=this.scope.getBinding(this.node.name);if(!binding)return;if(!binding.constant)return;if(binding.kind==="module")return;if(binding.path!==this){return binding.path.resolve(dangerous,resolved)}}else if(this.isTypeCastExpression()){return this.get("expression").resolve(dangerous,resolved)}else if(dangerous&&this.isMemberExpression()){var targetKey=this.toComputedKey();if(!t.isLiteral(targetKey))return;var targetName=targetKey.value;var target=this.get("object").resolve(dangerous,resolved);if(target.isObjectExpression()){var props=target.get("properties");var _arr=props;for(var _i=0;_i<_arr.length;_i++){var prop=_arr[_i];if(!prop.isProperty())continue;var key=prop.get("key");var match=prop.isnt("computed")&&key.isIdentifier({name:targetName});match=match||key.isLiteral({value:targetName});if(match)return prop.get("value").resolve(dangerous,resolved)}}else if(target.isArrayExpression()&&!isNaN(+targetName)){var elems=target.get("elements");var elem=elems[targetName];if(elem)return elem.resolve(dangerous,resolved)}}}},{"../../types":196,"lodash/collection/includes":345}],177:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var _transformationHelpersReact=require("../../../transformation/helpers/react");var react=_interopRequireWildcard(_transformationHelpersReact);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var referenceVisitor={ReferencedIdentifier:function ReferencedIdentifier(node,parent,scope,state){if(this.isJSXIdentifier()&&react.isCompatTag(node.name)){return}var binding=scope.getBinding(node.name);if(!binding)return;if(binding!==state.scope.getBinding(node.name))return;if(binding.constant){state.bindings[node.name]=binding}else{var _arr=binding.constantViolations;for(var _i=0;_i<_arr.length;_i++){var violationPath=_arr[_i];state.breakOnScopePaths=state.breakOnScopePaths.concat(violationPath.getAncestry())}}}};var PathHoister=function(){function PathHoister(path,scope){_classCallCheck(this,PathHoister);this.breakOnScopePaths=[];this.bindings={};this.scopes=[];this.scope=scope;this.path=path}PathHoister.prototype.isCompatibleScope=function isCompatibleScope(scope){for(var key in this.bindings){var binding=this.bindings[key];if(!scope.bindingIdentifierEquals(key,binding.identifier)){return false}}return true};PathHoister.prototype.getCompatibleScopes=function getCompatibleScopes(){var scope=this.path.scope;do{if(this.isCompatibleScope(scope)){this.scopes.push(scope)}else{break}if(this.breakOnScopePaths.indexOf(scope.path)>=0){break}}while(scope=scope.parent)};PathHoister.prototype.getAttachmentPath=function getAttachmentPath(){var scopes=this.scopes;var scope=scopes.pop();if(!scope)return;if(scope.path.isFunction()){if(this.hasOwnParamBindings(scope)){if(this.scope===scope)return;return scope.path.get("body").get("body")[0]}else{return this.getNextScopeStatementParent()}}else if(scope.path.isProgram()){return this.getNextScopeStatementParent()}};PathHoister.prototype.getNextScopeStatementParent=function getNextScopeStatementParent(){var scope=this.scopes.pop();if(scope)return scope.path.getStatementParent()};PathHoister.prototype.hasOwnParamBindings=function hasOwnParamBindings(scope){for(var name in this.bindings){if(!scope.hasOwnBinding(name))continue;var binding=this.bindings[name];if(binding.kind==="param")return true}return false};PathHoister.prototype.run=function run(){var node=this.path.node;if(node._hoisted)return;node._hoisted=true;this.path.traverse(referenceVisitor,this);this.getCompatibleScopes();var attachTo=this.getAttachmentPath();if(!attachTo)return;if(attachTo.getFunctionParent()===this.path.getFunctionParent())return;var uid=attachTo.scope.generateUidIdentifier("ref");attachTo.insertBefore([t.variableDeclaration("var",[t.variableDeclarator(uid,this.path.node)])]);var parent=this.path.parentPath;if(parent.isJSXElement()&&this.path.container===parent.node.children){uid=t.JSXExpressionContainer(uid)}this.path.replaceWith(uid)};return PathHoister}();exports["default"]=PathHoister;module.exports=exports["default"]},{"../../../transformation/helpers/react":79,"../../../types":196}],178:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _types=require("../../../types");var t=_interopRequireWildcard(_types);var pre=[function(self){if(self.key==="body"&&(self.isBlockStatement()||self.isClassBody())){self.node.body=[];return true}},function(self,parent){var replace=false;replace=replace||self.key==="body"&&parent.isArrowFunctionExpression();replace=replace||self.key==="argument"&&parent.isThrowStatement();if(replace){self.replaceWith(t.identifier("undefined"));return true}}];exports.pre=pre;var post=[function(self,parent){var removeParent=false;removeParent=removeParent||self.key==="test"&&(parent.isWhile()||parent.isSwitchCase());removeParent=removeParent||self.key==="declaration"&&parent.isExportDeclaration();removeParent=removeParent||self.key==="body"&&parent.isLabeledStatement();removeParent=removeParent||self.listKey==="declarations"&&parent.isVariableDeclaration()&&parent.node.declarations.length===0;removeParent=removeParent||self.key==="expression"&&parent.isExpressionStatement();removeParent=removeParent||self.key==="test"&&parent.isIfStatement();if(removeParent){parent.dangerouslyRemove();return true}},function(self,parent){if(parent.isSequenceExpression()&&parent.node.expressions.length===1){parent.replaceWith(parent.node.expressions[0]);return true}},function(self,parent){if(parent.isBinary()){if(self.key==="left"){parent.replaceWith(parent.node.right)}else{parent.replaceWith(parent.node.left)}return true}}];exports.post=post},{"../../../types":196}],179:[function(require,module,exports){"use strict";exports.__esModule=true;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _transformationHelpersReact=require("../../../transformation/helpers/react");var react=_interopRequireWildcard(_transformationHelpersReact);var _types=require("../../../types");var t=_interopRequireWildcard(_types);var ReferencedIdentifier={types:["Identifier","JSXIdentifier"],checkPath:function checkPath(_ref,opts){var node=_ref.node;var parent=_ref.parent;if(!t.isIdentifier(node,opts)){if(t.isJSXIdentifier(node,opts)){if(react.isCompatTag(node.name))return false}else{return false}}return t.isReferenced(node,parent)}};exports.ReferencedIdentifier=ReferencedIdentifier;var BindingIdentifier={types:["Identifier"],checkPath:function checkPath(_ref2){var node=_ref2.node;var parent=_ref2.parent;return t.isBinding(node,parent)}};exports.BindingIdentifier=BindingIdentifier;var Statement={types:["Statement"],checkPath:function checkPath(_ref3){var node=_ref3.node;var parent=_ref3.parent;if(t.isStatement(node)){if(t.isVariableDeclaration(node)){if(t.isForXStatement(parent,{left:node}))return false;if(t.isForStatement(parent,{init:node}))return false}return true}else{return false}}};exports.Statement=Statement;var Expression={types:["Expression"],checkPath:function checkPath(path){if(path.isIdentifier()){return path.isReferencedIdentifier()}else{return t.isExpression(path.node)}}};exports.Expression=Expression;var Scope={types:["Scopable"],checkPath:function checkPath(path){return t.isScope(path.node,path.parent)}};exports.Scope=Scope;var Referenced={checkPath:function checkPath(path){return t.isReferenced(path.node,path.parent)}};exports.Referenced=Referenced;var BlockScoped={checkPath:function checkPath(path){return t.isBlockScoped(path.node)}};exports.BlockScoped=BlockScoped;var Var={types:["VariableDeclaration"],checkPath:function checkPath(path){return t.isVar(path.node)}};exports.Var=Var;var DirectiveLiteral={types:["Literal"],checkPath:function checkPath(path){return path.isLiteral()&&path.parentPath.isExpressionStatement()}};exports.DirectiveLiteral=DirectiveLiteral;var Directive={types:["ExpressionStatement"],checkPath:function checkPath(path){return path.get("expression").isLiteral()}};exports.Directive=Directive;var User={checkPath:function checkPath(path){return path.node&&!!path.node.loc}};exports.User=User;var Generated={checkPath:function checkPath(path){return!path.isUser()}};exports.Generated=Generated;var Flow={types:["Flow","ImportDeclaration","ExportDeclaration"],checkPath:function checkPath(_ref4){var node=_ref4.node;if(t.isFlow(node)){return true}else if(t.isImportDeclaration(node)){return node.importKind==="type"||node.importKind==="typeof"}else if(t.isExportDeclaration(node)){return node.exportKind==="type"}else{return false}}};exports.Flow=Flow},{"../../../transformation/helpers/react":79,"../../../types":196}],180:[function(require,module,exports){"use strict";exports.__esModule=true;exports.insertBefore=insertBefore;exports._containerInsert=_containerInsert;exports._containerInsertBefore=_containerInsertBefore;exports._containerInsertAfter=_containerInsertAfter;exports._maybePopFromStatements=_maybePopFromStatements;exports.insertAfter=insertAfter;exports.updateSiblingKeys=updateSiblingKeys;exports._verifyNodeList=_verifyNodeList;exports.unshiftContainer=unshiftContainer;exports.pushContainer=pushContainer;exports.hoist=hoist;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _libHoister=require("./lib/hoister");var _libHoister2=_interopRequireDefault(_libHoister);var _index=require("./index");var _index2=_interopRequireDefault(_index);var _types=require("../../types");var t=_interopRequireWildcard(_types);function insertBefore(nodes){this._assertUnremoved();nodes=this._verifyNodeList(nodes);if(this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement()){return this.parentPath.insertBefore(nodes)}else if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&this.key==="init"){if(this.node)nodes.push(this.node);this.replaceExpressionWithStatements(nodes)}else{this._maybePopFromStatements(nodes);if(Array.isArray(this.container)){return this._containerInsertBefore(nodes)}else if(this.isStatementOrBlock()){if(this.node)nodes.push(this.node);this.node=this.container[this.key]=t.blockStatement(nodes)}else{throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?")}}return[this]}function _containerInsert(from,nodes){this.updateSiblingKeys(from,nodes.length);var paths=[];for(var i=0;i=fromIndex){path.key+=incrementBy}}}function _verifyNodeList(nodes){if(nodes.constructor!==Array){nodes=[nodes]}for(var i=0;i1)id+=i;return"_"+id};Scope.prototype.generateUidIdentifierBasedOnNode=function generateUidIdentifierBasedOnNode(parent,defaultName){var node=parent;if(t.isAssignmentExpression(parent)){node=parent.left}else if(t.isVariableDeclarator(parent)){node=parent.id}else if(t.isProperty(node)){node=node.key}var parts=[];var add=function add(node){if(t.isModuleDeclaration(node)){if(node.source){add(node.source)}else if(node.specifiers&&node.specifiers.length){var _arr4=node.specifiers;for(var _i4=0;_i4<_arr4.length;_i4++){var specifier=_arr4[_i4];add(specifier)}}else if(node.declaration){add(node.declaration)}}else if(t.isModuleSpecifier(node)){add(node.local)}else if(t.isMemberExpression(node)){add(node.object);add(node.property)}else if(t.isIdentifier(node)){parts.push(node.name)}else if(t.isLiteral(node)){parts.push(node.value)}else if(t.isCallExpression(node)){add(node.callee)}else if(t.isObjectExpression(node)||t.isObjectPattern(node)){var _arr5=node.properties;for(var _i5=0;_i5<_arr5.length;_i5++){var prop=_arr5[_i5];add(prop.key||prop.argument)}}};add(node);var id=parts.join("$");id=id.replace(/^_/,"")||defaultName||"ref";return this.generateUidIdentifier(id)};Scope.prototype.isStatic=function isStatic(node){if(t.isThisExpression(node)||t.isSuper(node)){return true}if(t.isIdentifier(node)){var binding=this.getBinding(node.name);if(binding){return binding.constant}else{return this.hasBinding(node.name)}}return false};Scope.prototype.maybeGenerateMemoised=function maybeGenerateMemoised(node,dontPush){if(this.isStatic(node)){return null}else{var id=this.generateUidIdentifierBasedOnNode(node);if(!dontPush)this.push({id:id});return id}};Scope.prototype.checkBlockScopedCollisions=function checkBlockScopedCollisions(local,kind,name,id){if(kind==="param")return;if(kind==="hoisted"&&local.kind==="let")return;var duplicate=false;if(!duplicate)duplicate=kind==="let"||local.kind==="let"||local.kind==="const"||local.kind==="module";if(!duplicate)duplicate=local.kind==="param"&&(kind==="let"||kind==="const");if(duplicate){throw this.hub.file.errorWithNode(id,messages.get("scopeDuplicateDeclaration",name),TypeError)}};Scope.prototype.rename=function rename(oldName,newName,block){newName=newName||this.generateUidIdentifier(oldName).name;var info=this.getBinding(oldName);if(!info)return;var state={newName:newName,oldName:oldName,binding:info.identifier,info:info};var scope=info.scope;scope.traverse(block||scope.block,renameVisitor,state);if(!block){scope.removeOwnBinding(oldName);scope.bindings[newName]=info;state.binding.name=newName}var file=this.hub.file;if(file){this._renameFromMap(file.moduleFormatter.localImports,oldName,newName,state.binding)}};Scope.prototype._renameFromMap=function _renameFromMap(map,oldName,newName,value){if(map[oldName]){map[newName]=value;map[oldName]=null}};Scope.prototype.dump=function dump(){var sep=_repeating2["default"]("-",60);console.log(sep);var scope=this;do{console.log("#",scope.block.type);for(var name in scope.bindings){var binding=scope.bindings[name];console.log(" -",name,{constant:binding.constant,references:binding.references,kind:binding.kind})}}while(scope=scope.parent);console.log(sep)};Scope.prototype.toArray=function toArray(node,i){var file=this.hub.file;if(t.isIdentifier(node)){var binding=this.getBinding(node.name);if(binding&&binding.constant&&binding.path.isGenericType("Array"))return node}if(t.isArrayExpression(node)){return node}if(t.isIdentifier(node,{name:"arguments"})){return t.callExpression(t.memberExpression(file.addHelper("slice"),t.identifier("call")),[node])}var helperName="to-array";var args=[node];if(i===true){helperName="to-consumable-array"}else if(i){args.push(t.literal(i));helperName="sliced-to-array";if(this.hub.file.isLoose("es6.forOf"))helperName+="-loose"}return t.callExpression(file.addHelper(helperName),args)};Scope.prototype.registerDeclaration=function registerDeclaration(path){if(path.isLabeledStatement()){this.registerBinding("label",path)}else if(path.isFunctionDeclaration()){this.registerBinding("hoisted",path)}else if(path.isVariableDeclaration()){var declarations=path.get("declarations");var _arr6=declarations;for(var _i6=0;_i6<_arr6.length;_i6++){var declar=_arr6[_i6];this.registerBinding(path.node.kind,declar)}}else if(path.isClassDeclaration()){this.registerBinding("let",path)}else if(path.isImportDeclaration()){var specifiers=path.get("specifiers");var _arr7=specifiers;for(var _i7=0;_i7<_arr7.length;_i7++){var specifier=_arr7[_i7];this.registerBinding("module",specifier)}}else if(path.isExportDeclaration()){var declar=path.get("declaration");if(declar.isClassDeclaration()||declar.isFunctionDeclaration()||declar.isVariableDeclaration()){this.registerDeclaration(declar)}}else{this.registerBinding("unknown",path)}};Scope.prototype.registerConstantViolation=function registerConstantViolation(root,left,right){var ids=left.getBindingIdentifiers();for(var name in ids){var binding=this.getBinding(name);if(binding)binding.reassign(root,left,right)}};Scope.prototype.registerBinding=function registerBinding(kind,path){if(!kind)throw new ReferenceError("no `kind`");if(path.isVariableDeclaration()){var declarators=path.get("declarations");var _arr8=declarators;for(var _i8=0;_i8<_arr8.length;_i8++){var declar=_arr8[_i8];this.registerBinding(kind,declar)}return}var parent=this.getProgramParent();var ids=path.getBindingIdentifiers(true);for(var name in ids){var _arr9=ids[name];for(var _i9=0;_i9<_arr9.length;_i9++){var id=_arr9[_i9];var local=this.getOwnBinding(name);if(local){if(local.identifier===id)continue;this.checkBlockScopedCollisions(local,kind,name,id)}parent.references[name]=true;this.bindings[name]=new _binding2["default"]({identifier:id,existing:local,scope:this,path:path,kind:kind})}}};Scope.prototype.addGlobal=function addGlobal(node){this.globals[node.name]=node};Scope.prototype.hasUid=function hasUid(name){var scope=this;do{if(scope.uids[name])return true}while(scope=scope.parent);return false};Scope.prototype.hasGlobal=function hasGlobal(name){var scope=this;do{if(scope.globals[name])return true}while(scope=scope.parent);return false};Scope.prototype.hasReference=function hasReference(name){var scope=this;do{if(scope.references[name])return true}while(scope=scope.parent);return false};Scope.prototype.isPure=function isPure(node,constantsOnly){if(t.isIdentifier(node)){var binding=this.getBinding(node.name);if(!binding)return false;if(constantsOnly)return binding.constant;return true}else if(t.isClass(node)){return!node.superClass||this.isPure(node.superClass,constantsOnly)}else if(t.isBinary(node)){return this.isPure(node.left,constantsOnly)&&this.isPure(node.right,constantsOnly)}else if(t.isArrayExpression(node)){var _arr10=node.elements;for(var _i10=0;_i10<_arr10.length;_i10++){var elem=_arr10[_i10];if(!this.isPure(elem,constantsOnly))return false}return true}else if(t.isObjectExpression(node)){var _arr11=node.properties;for(var _i11=0;_i11<_arr11.length;_i11++){var prop=_arr11[_i11];if(!this.isPure(prop,constantsOnly))return false}return true}else if(t.isProperty(node)){if(node.computed&&!this.isPure(node.key,constantsOnly))return false;return this.isPure(node.value,constantsOnly)}else{return t.isPure(node)}};Scope.prototype.setData=function setData(key,val){return this.data[key]=val};Scope.prototype.getData=function getData(key){var scope=this;do{var data=scope.data[key];if(data!=null)return data}while(scope=scope.parent)};Scope.prototype.removeData=function removeData(key){var scope=this;do{var data=scope.data[key];if(data!=null)scope.data[key]=null}while(scope=scope.parent)};Scope.prototype.init=function init(){if(!this.references)this.crawl()};Scope.prototype.crawl=function crawl(){var path=this.path;var info=this.block._scopeInfo;if(info)return _lodashObjectExtend2["default"](this,info);info=this.block._scopeInfo={references:_helpersObject2["default"](),bindings:_helpersObject2["default"](),globals:_helpersObject2["default"](),uids:_helpersObject2["default"](),data:_helpersObject2["default"]()};_lodashObjectExtend2["default"](this,info);if(path.isLoop()){var _arr12=t.FOR_INIT_KEYS;for(var _i12=0;_i12<_arr12.length;_i12++){var key=_arr12[_i12];var node=path.get(key);if(node.isBlockScoped())this.registerBinding(node.node.kind,node)}}if(path.isFunctionExpression()&&path.has("id")){if(!t.isProperty(path.parent,{method:true})){this.registerBinding("var",path)}}if(path.isClassExpression()&&path.has("id")){this.registerBinding("var",path)}if(path.isFunction()){var params=path.get("params");var _arr13=params;for(var _i13=0;_i13<_arr13.length;_i13++){var param=_arr13[_i13];this.registerBinding("param",param)}}if(path.isCatchClause()){this.registerBinding("let",path)}if(path.isComprehensionExpression()){this.registerBinding("let",path)}var parent=this.getProgramParent();if(parent.crawling)return;this.crawling=true;path.traverse(collectorVisitor);this.crawling=false};Scope.prototype.push=function push(opts){var path=this.path;if(path.isSwitchStatement()){path=this.getFunctionParent().path}if(path.isLoop()||path.isCatchClause()||path.isFunction()){t.ensureBlock(path.node);path=path.get("body")}if(!path.isBlockStatement()&&!path.isProgram()){path=this.getBlockParent().path}var unique=opts.unique;var kind=opts.kind||"var";var blockHoist=opts._blockHoist==null?2:opts._blockHoist;var dataKey="declaration:"+kind+":"+blockHoist;var declar=!unique&&path.getData(dataKey);if(!declar){declar=t.variableDeclaration(kind,[]);declar._generated=true;declar._blockHoist=blockHoist;this.hub.file.attachAuxiliaryComment(declar);var _path$unshiftContainer=path.unshiftContainer("body",[declar]);var declarPath=_path$unshiftContainer[0];this.registerBinding(kind,declarPath);if(!unique)path.setData(dataKey,declar)}declar.declarations.push(t.variableDeclarator(opts.id,opts.init))};Scope.prototype.getProgramParent=function getProgramParent(){var scope=this;do{if(scope.path.isProgram()){return scope}}while(scope=scope.parent);throw new Error("We couldn't find a Function or Program...")};Scope.prototype.getFunctionParent=function getFunctionParent(){var scope=this;do{if(scope.path.isFunctionParent()){return scope}}while(scope=scope.parent);throw new Error("We couldn't find a Function or Program...")};Scope.prototype.getBlockParent=function getBlockParent(){var scope=this;do{if(scope.path.isBlockParent()){return scope}}while(scope=scope.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")};Scope.prototype.getAllBindings=function getAllBindings(){var ids=_helpersObject2["default"]();var scope=this;do{_lodashObjectDefaults2["default"](ids,scope.bindings);scope=scope.parent}while(scope);return ids};Scope.prototype.getAllBindingsOfKind=function getAllBindingsOfKind(){var ids=_helpersObject2["default"]();var _arr14=arguments;for(var _i14=0;_i14<_arr14.length;_i14++){var kind=_arr14[_i14];var scope=this;do{for(var name in scope.bindings){var binding=scope.bindings[name];if(binding.kind===kind)ids[name]=binding}scope=scope.parent}while(scope)}return ids};Scope.prototype.bindingIdentifierEquals=function bindingIdentifierEquals(name,node){return this.getBindingIdentifier(name)===node};Scope.prototype.getBinding=function getBinding(name){var scope=this;do{var binding=scope.getOwnBinding(name);if(binding)return binding}while(scope=scope.parent)};Scope.prototype.getOwnBinding=function getOwnBinding(name){return this.bindings[name]};Scope.prototype.getBindingIdentifier=function getBindingIdentifier(name){var info=this.getBinding(name);return info&&info.identifier};Scope.prototype.getOwnBindingIdentifier=function getOwnBindingIdentifier(name){var binding=this.bindings[name];return binding&&binding.identifier};Scope.prototype.hasOwnBinding=function hasOwnBinding(name){return!!this.getOwnBinding(name)};Scope.prototype.hasBinding=function hasBinding(name,noGlobals){if(!name)return false;if(this.hasOwnBinding(name))return true;if(this.parentHasBinding(name,noGlobals))return true;if(this.hasUid(name))return true;if(!noGlobals&&_lodashCollectionIncludes2["default"](Scope.globals,name))return true;if(!noGlobals&&_lodashCollectionIncludes2["default"](Scope.contextVariables,name))return true;return false};Scope.prototype.parentHasBinding=function parentHasBinding(name,noGlobals){return this.parent&&this.parent.hasBinding(name,noGlobals)};Scope.prototype.moveBindingTo=function moveBindingTo(name,scope){var info=this.getBinding(name);if(info){info.scope.removeOwnBinding(name);info.scope=scope;scope.bindings[name]=info}};Scope.prototype.removeOwnBinding=function removeOwnBinding(name){delete this.bindings[name]};Scope.prototype.removeBinding=function removeBinding(name){var info=this.getBinding(name);if(info){info.scope.removeOwnBinding(name)}var scope=this;do{if(scope.uids[name]){scope.uids[name]=false}}while(scope=scope.parent)};_createClass(Scope,null,[{key:"globals",value:_lodashArrayFlatten2["default"]([_globals2["default"].builtin,_globals2["default"].browser,_globals2["default"].node].map(Object.keys)),enumerable:true},{key:"contextVariables",value:["arguments","undefined","Infinity","NaN"],enumerable:true}]);return Scope}();exports["default"]=Scope;module.exports=exports["default"]},{"../../helpers/object":58,"../../messages":60,"../../types":196,"../index":165,"./binding":183,globals:324,"lodash/array/flatten":338,"lodash/collection/includes":345,"lodash/object/defaults":442,"lodash/object/extend":443,repeating:517}],185:[function(require,module,exports){"use strict";exports.__esModule=true;exports.explode=explode;exports.verify=verify;exports.merge=merge;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}var _pathLibVirtualTypes=require("./path/lib/virtual-types");var virtualTypes=_interopRequireWildcard(_pathLibVirtualTypes);var _messages=require("../messages");var messages=_interopRequireWildcard(_messages);var _types=require("../types");var t=_interopRequireWildcard(_types);var _lodashLangClone=require("lodash/lang/clone");var _lodashLangClone2=_interopRequireDefault(_lodashLangClone);function explode(visitor){if(visitor._exploded)return visitor;visitor._exploded=true;for(var nodeType in visitor){if(shouldIgnoreKey(nodeType))continue;var parts=nodeType.split("|");if(parts.length===1)continue;var fns=visitor[nodeType];delete visitor[nodeType];var _arr=parts;for(var _i=0;_i<_arr.length;_i++){var part=_arr[_i];visitor[part]=fns}}verify(visitor);delete visitor.__esModule;ensureEntranceObjects(visitor);ensureCallbackArrays(visitor);var _arr2=Object.keys(visitor);for(var _i2=0;_i2<_arr2.length;_i2++){var nodeType=_arr2[_i2];if(shouldIgnoreKey(nodeType))continue;var wrapper=virtualTypes[nodeType];if(!wrapper)continue;var fns=visitor[nodeType];for(var type in fns){fns[type]=wrapCheck(wrapper,fns[type])}delete visitor[nodeType];if(wrapper.types){var _arr4=wrapper.types;for(var _i4=0;_i4<_arr4.length;_i4++){var type=_arr4[_i4];if(visitor[type]){mergePair(visitor[type],fns)}else{visitor[type]=fns}}}else{mergePair(visitor,fns)}}for(var nodeType in visitor){if(shouldIgnoreKey(nodeType))continue;var fns=visitor[nodeType];var aliases=t.FLIPPED_ALIAS_KEYS[nodeType];if(!aliases)continue;delete visitor[nodeType];var _arr3=aliases;for(var _i3=0;_i3<_arr3.length;_i3++){var alias=_arr3[_i3];var existing=visitor[alias];if(existing){mergePair(existing,fns)}else{visitor[alias]=_lodashLangClone2["default"](fns)}}}for(var nodeType in visitor){if(shouldIgnoreKey(nodeType))continue;ensureCallbackArrays(visitor[nodeType])}return visitor}function verify(visitor){if(visitor._verified)return;if(typeof visitor==="function"){throw new Error(messages.get("traverseVerifyRootFunction"))}for(var nodeType in visitor){if(shouldIgnoreKey(nodeType))continue;if(t.TYPES.indexOf(nodeType)<0){throw new Error(messages.get("traverseVerifyNodeType",nodeType))}var visitors=visitor[nodeType];if(typeof visitors==="object"){for(var visitorKey in visitors){if(visitorKey==="enter"||visitorKey==="exit")continue;throw new Error(messages.get("traverseVerifyVisitorProperty",nodeType,visitorKey))}}}visitor._verified=true}function merge(visitors){var rootVisitor={};var _arr5=visitors;for(var _i5=0;_i5<_arr5.length;_i5++){var visitor=_arr5[_i5];explode(visitor);for(var type in visitor){var nodeVisitor=rootVisitor[type]=rootVisitor[type]||{};mergePair(nodeVisitor,visitor[type])}}return rootVisitor}function ensureEntranceObjects(obj){for(var key in obj){if(shouldIgnoreKey(key))continue;var fns=obj[key];if(typeof fns==="function"){obj[key]={enter:fns}}}}function ensureCallbackArrays(obj){if(obj.enter&&!Array.isArray(obj.enter))obj.enter=[obj.enter];if(obj.exit&&!Array.isArray(obj.exit))obj.exit=[obj.exit]}function wrapCheck(wrapper,fn){return function(){if(wrapper.checkPath(this)){return fn.apply(this,arguments)}}}function shouldIgnoreKey(key){if(key[0]==="_")return true;if(key==="enter"||key==="exit"||key==="shouldSkip")return true;if(key==="blacklist"||key==="noScope"||key==="skipKeys")return true;return false}function mergePair(dest,src){for(var key in src){dest[key]=[].concat(dest[key]||[],src[key])}}},{"../messages":60,"../types":196,"./path/lib/virtual-types":179,"lodash/lang/clone":426}],186:[function(require,module,exports){"use strict";exports.__esModule=true;exports.toComputedKey=toComputedKey;exports.toSequenceExpression=toSequenceExpression;exports.toKeyAlias=toKeyAlias;exports.toIdentifier=toIdentifier;exports.toBindingIdentifierName=toBindingIdentifierName;exports.toStatement=toStatement;exports.toExpression=toExpression;exports.toBlock=toBlock;exports.valueToNode=valueToNode;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashLangIsPlainObject=require("lodash/lang/isPlainObject");var _lodashLangIsPlainObject2=_interopRequireDefault(_lodashLangIsPlainObject);var _lodashLangIsNumber=require("lodash/lang/isNumber");var _lodashLangIsNumber2=_interopRequireDefault(_lodashLangIsNumber);var _lodashLangIsRegExp=require("lodash/lang/isRegExp");var _lodashLangIsRegExp2=_interopRequireDefault(_lodashLangIsRegExp);var _lodashLangIsString=require("lodash/lang/isString");var _lodashLangIsString2=_interopRequireDefault(_lodashLangIsString);var _traversal=require("../traversal");var _traversal2=_interopRequireDefault(_traversal);var _index=require("./index");var t=_interopRequireWildcard(_index);function toComputedKey(node){var key=arguments.length<=1||arguments[1]===undefined?node.key||node.property:arguments[1];return function(){if(!node.computed){if(t.isIdentifier(key))key=t.literal(key.name)}return key}()}function toSequenceExpression(nodes,scope){var declars=[];var bailed=false;var result=convert(nodes);if(bailed)return;for(var i=0;i=0){continue}if(t.isAnyTypeAnnotation(node)){return[node]}if(t.isFlowBaseAnnotation(node)){bases[node.type]=node;continue}if(t.isUnionTypeAnnotation(node)){if(typeGroups.indexOf(node.types)<0){nodes=nodes.concat(node.types);typeGroups.push(node.types)}continue}if(t.isGenericTypeAnnotation(node)){var _name=node.id.name;if(generics[_name]){var existing=generics[_name];if(existing.typeParameters){if(node.typeParameters){existing.typeParameters.params=removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params))}}else{existing=node.typeParameters}}else{generics[_name]=node}continue}types.push(node)}for(var type in bases){types.push(bases[type])}for(var _name2 in generics){types.push(generics[_name2])}return types}function createTypeAnnotationBasedOnTypeof(type){if(type==="string"){return t.stringTypeAnnotation()}else if(type==="number"){return t.numberTypeAnnotation()}else if(type==="undefined"){return t.voidTypeAnnotation()}else if(type==="boolean"){return t.booleanTypeAnnotation()}else if(type==="function"){return t.genericTypeAnnotation(t.identifier("Function"))}else if(type==="object"){return t.genericTypeAnnotation(t.identifier("Object"))}else if(type==="symbol"){return t.genericTypeAnnotation(t.identifier("Symbol"))}else{throw new Error("Invalid typeof value")}}},{"./index":196}],196:[function(require,module,exports){"use strict";exports.__esModule=true;exports.is=is;exports.isType=isType;exports.shallowEqual=shallowEqual;exports.appendToMemberExpression=appendToMemberExpression;exports.prependToMemberExpression=prependToMemberExpression;exports.ensureBlock=ensureBlock;exports.clone=clone;exports.cloneDeep=cloneDeep;exports.buildMatchMemberExpression=buildMatchMemberExpression;exports.removeComments=removeComments;exports.inheritsComments=inheritsComments;exports.inheritTrailingComments=inheritTrailingComments;exports.inheritLeadingComments=inheritLeadingComments;exports.inheritInnerComments=inheritInnerComments;exports.inherits=inherits;function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _toFastProperties=require("to-fast-properties");var _toFastProperties2=_interopRequireDefault(_toFastProperties);var _lodashArrayCompact=require("lodash/array/compact");var _lodashArrayCompact2=_interopRequireDefault(_lodashArrayCompact);var _lodashObjectAssign=require("lodash/object/assign");var _lodashObjectAssign2=_interopRequireDefault(_lodashObjectAssign);var _lodashCollectionEach=require("lodash/collection/each");var _lodashCollectionEach2=_interopRequireDefault(_lodashCollectionEach);var _lodashArrayUniq=require("lodash/array/uniq");var _lodashArrayUniq2=_interopRequireDefault(_lodashArrayUniq);require("./definitions/init");var _definitions=require("./definitions");var t=exports;function registerType(type,skipAliasCheck){var is=t["is"+type]=function(node,opts){return t.is(type,node,opts,skipAliasCheck)};t["assert"+type]=function(node,opts){opts=opts||{};if(!is(node,opts)){throw new Error("Expected type "+JSON.stringify(type)+" with option "+JSON.stringify(opts))}}}var STATEMENT_OR_BLOCK_KEYS=["consequent","body","alternate"];exports.STATEMENT_OR_BLOCK_KEYS=STATEMENT_OR_BLOCK_KEYS;var FLATTENABLE_KEYS=["body","expressions"];exports.FLATTENABLE_KEYS=FLATTENABLE_KEYS;var FOR_INIT_KEYS=["left","init"];exports.FOR_INIT_KEYS=FOR_INIT_KEYS;var COMMENT_KEYS=["leadingComments","trailingComments","innerComments"];exports.COMMENT_KEYS=COMMENT_KEYS;var INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["_scopeInfo","_paths","start","loc","end"]};exports.INHERIT_KEYS=INHERIT_KEYS;var BOOLEAN_NUMBER_BINARY_OPERATORS=[">","<",">=","<="];exports.BOOLEAN_NUMBER_BINARY_OPERATORS=BOOLEAN_NUMBER_BINARY_OPERATORS;var EQUALITY_BINARY_OPERATORS=["==","===","!=","!=="];exports.EQUALITY_BINARY_OPERATORS=EQUALITY_BINARY_OPERATORS;var COMPARISON_BINARY_OPERATORS=EQUALITY_BINARY_OPERATORS.concat(["in","instanceof"]);exports.COMPARISON_BINARY_OPERATORS=COMPARISON_BINARY_OPERATORS;var BOOLEAN_BINARY_OPERATORS=[].concat(COMPARISON_BINARY_OPERATORS,BOOLEAN_NUMBER_BINARY_OPERATORS);exports.BOOLEAN_BINARY_OPERATORS=BOOLEAN_BINARY_OPERATORS;var NUMBER_BINARY_OPERATORS=["-","/","*","**","&","|",">>",">>>","<<","^"];exports.NUMBER_BINARY_OPERATORS=NUMBER_BINARY_OPERATORS;var BOOLEAN_UNARY_OPERATORS=["delete","!"];exports.BOOLEAN_UNARY_OPERATORS=BOOLEAN_UNARY_OPERATORS;var NUMBER_UNARY_OPERATORS=["+","-","++","--","~"];exports.NUMBER_UNARY_OPERATORS=NUMBER_UNARY_OPERATORS;var STRING_UNARY_OPERATORS=["typeof"];exports.STRING_UNARY_OPERATORS=STRING_UNARY_OPERATORS;exports.VISITOR_KEYS=_definitions.VISITOR_KEYS;exports.BUILDER_KEYS=_definitions.BUILDER_KEYS;exports.ALIAS_KEYS=_definitions.ALIAS_KEYS;_lodashCollectionEach2["default"](t.VISITOR_KEYS,function(keys,type){registerType(type,true)});t.FLIPPED_ALIAS_KEYS={};_lodashCollectionEach2["default"](t.ALIAS_KEYS,function(aliases,type){_lodashCollectionEach2["default"](aliases,function(alias){var types=t.FLIPPED_ALIAS_KEYS[alias]=t.FLIPPED_ALIAS_KEYS[alias]||[];types.push(type)})});_lodashCollectionEach2["default"](t.FLIPPED_ALIAS_KEYS,function(types,type){t[type.toUpperCase()+"_TYPES"]=types;registerType(type,false)});var TYPES=Object.keys(t.VISITOR_KEYS).concat(Object.keys(t.FLIPPED_ALIAS_KEYS));exports.TYPES=TYPES;function is(type,node,opts,skipAliasCheck){if(!node)return false;var matches=isType(node.type,type);if(!matches)return false;if(typeof opts==="undefined"){return true}else{return t.shallowEqual(node,opts)}}function isType(nodeType,targetType){if(nodeType===targetType)return true;var aliases=t.FLIPPED_ALIAS_KEYS[targetType];if(aliases){if(aliases[0]===nodeType)return true;var _arr=aliases;for(var _i=0;_i<_arr.length;_i++){var alias=_arr[_i];if(nodeType===alias)return true}}return false}_lodashCollectionEach2["default"](t.VISITOR_KEYS,function(keys,type){if(t.BUILDER_KEYS[type])return;var defs={};_lodashCollectionEach2["default"](keys,function(key){defs[key]=null});t.BUILDER_KEYS[type]=defs});_lodashCollectionEach2["default"](t.BUILDER_KEYS,function(keys,type){var builder=function builder(){var node={};node.type=type;var i=0;for(var key in keys){var arg=arguments[i++];if(arg===undefined)arg=keys[key];node[key]=arg}return node};t[type]=builder;t[type[0].toLowerCase()+type.slice(1)]=builder});function shallowEqual(actual,expected){var keys=Object.keys(expected);var _arr2=keys;for(var _i2=0;_i2<_arr2.length;_i2++){var key=_arr2[_i2];if(actual[key]!==expected[key]){return false}}return true}function appendToMemberExpression(member,append,computed){member.object=t.memberExpression(member.object,member.property,member.computed);member.property=append;member.computed=!!computed;return member}function prependToMemberExpression(member,prepend){member.object=t.memberExpression(prepend,member.object);return member}function ensureBlock(node){var key=arguments.length<=1||arguments[1]===undefined?"body":arguments[1];return node[key]=t.toBlock(node[key],node)}function clone(node){var newNode={};for(var key in node){if(key[0]==="_")continue;newNode[key]=node[key]}return newNode}function cloneDeep(node){var newNode={};for(var key in node){if(key[0]==="_")continue;var val=node[key];if(val){if(val.type){val=t.cloneDeep(val)}else if(Array.isArray(val)){val=val.map(t.cloneDeep)}}newNode[key]=val}return newNode}function buildMatchMemberExpression(match,allowPartial){var parts=match.split(".");return function(member){if(!t.isMemberExpression(member))return false;var search=[member];var i=0;while(search.length){var node=search.shift();if(allowPartial&&i===parts.length){return true}if(t.isIdentifier(node)){if(parts[i]!==node.name)return false}else if(t.isLiteral(node)){if(parts[i]!==node.value)return false}else if(t.isMemberExpression(node)){if(node.computed&&!t.isLiteral(node.property)){return false}else{search.push(node.object);search.push(node.property);continue}}else{return false}if(++i>parts.length){return false}}return true}}function removeComments(node){var _arr3=COMMENT_KEYS;for(var _i3=0;_i3<_arr3.length;_i3++){var key=_arr3[_i3];delete node[key]}return node}function inheritsComments(child,parent){inheritTrailingComments(child,parent);inheritLeadingComments(child,parent);inheritInnerComments(child,parent);return child}function inheritTrailingComments(child,parent){_inheritComments("trailingComments",child,parent)}function inheritLeadingComments(child,parent){_inheritComments("leadingComments",child,parent)}function inheritInnerComments(child,parent){_inheritComments("innerComments",child,parent)}function _inheritComments(key,child,parent){if(child&&parent){child[key]=_lodashArrayUniq2["default"](_lodashArrayCompact2["default"]([].concat(child[key],parent[key])))}}function inherits(child,parent){if(!child||!parent)return child;var _arr4=t.INHERIT_KEYS.optional;for(var _i4=0;_i4<_arr4.length;_i4++){var key=_arr4[_i4];if(child[key]==null){child[key]=parent[key]}}var _arr5=t.INHERIT_KEYS.force;for(var _i5=0;_i5<_arr5.length;_i5++){var key=_arr5[_i5];child[key]=parent[key]}t.inheritsComments(child,parent);return child}_toFastProperties2["default"](t);_toFastProperties2["default"](t.VISITOR_KEYS);_lodashObjectAssign2["default"](t,require("./retrievers"));_lodashObjectAssign2["default"](t,require("./validators"));_lodashObjectAssign2["default"](t,require("./converters"));_lodashObjectAssign2["default"](t,require("./flow"))},{"./converters":186,"./definitions":191,"./definitions/init":192,"./flow":195,"./retrievers":197,"./validators":198,"lodash/array/compact":337,"lodash/array/uniq":341,"lodash/collection/each":343,"lodash/object/assign":441,"to-fast-properties":534}],197:[function(require,module,exports){"use strict";exports.__esModule=true;exports.getBindingIdentifiers=getBindingIdentifiers;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _helpersObject=require("../helpers/object");var _helpersObject2=_interopRequireDefault(_helpersObject);var _index=require("./index");var t=_interopRequireWildcard(_index);function getBindingIdentifiers(node,duplicates){var search=[].concat(node);var ids=_helpersObject2["default"]();while(search.length){var id=search.shift();if(!id)continue;var key=t.getBindingIdentifiers.keys[id.type];if(t.isIdentifier(id)){if(duplicates){var _ids=ids[id.name]=ids[id.name]||[];_ids.push(id)}else{ids[id.name]=id}}else if(t.isExportDeclaration(id)){if(t.isDeclaration(node.declaration)){search.push(node.declaration)}}else if(key&&id[key]){search=search.concat(id[key])}}return ids}getBindingIdentifiers.keys={DeclareClass:"id",DeclareFunction:"id",DeclareModule:"id",DeclareVariable:"id",InterfaceDeclaration:"id",TypeAlias:"id",ComprehensionExpression:"blocks",ComprehensionBlock:"left",CatchClause:"param",LabeledStatement:"label",UnaryExpression:"argument",AssignmentExpression:"left",ImportSpecifier:"local",ImportNamespaceSpecifier:"local",ImportDefaultSpecifier:"local",ImportDeclaration:"specifiers",FunctionDeclaration:"id",FunctionExpression:"id",ClassDeclaration:"id",ClassExpression:"id",RestElement:"argument",UpdateExpression:"argument",SpreadProperty:"argument",Property:"value",AssignmentPattern:"left",ArrayPattern:"elements",ObjectPattern:"properties",VariableDeclaration:"declarations",VariableDeclarator:"id"}},{"../helpers/object":58,"./index":196}],198:[function(require,module,exports){"use strict";exports.__esModule=true;exports.isBinding=isBinding;exports.isReferenced=isReferenced;exports.isValidIdentifier=isValidIdentifier;exports.isLet=isLet;exports.isBlockScoped=isBlockScoped;exports.isVar=isVar;exports.isSpecifierDefault=isSpecifierDefault;exports.isScope=isScope;exports.isImmutable=isImmutable;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _retrievers=require("./retrievers");var _esutils=require("esutils");var _esutils2=_interopRequireDefault(_esutils);var _index=require("./index");var t=_interopRequireWildcard(_index);function isBinding(node,parent){var bindingKey=_retrievers.getBindingIdentifiers.keys[parent.type];if(bindingKey){return parent[bindingKey]===node}else{return false}}function isReferenced(node,parent){switch(parent.type){case"MemberExpression":case"JSXMemberExpression":if(parent.property===node&&parent.computed){return true}else if(parent.object===node){return true}else{return false}case"MetaProperty":return false;case"Property":if(parent.key===node){return parent.computed}case"VariableDeclarator":return parent.id!==node;case"ArrowFunctionExpression":case"FunctionDeclaration":case"FunctionExpression":var _arr=parent.params;for(var _i=0;_i<_arr.length;_i++){var param=_arr[_i];if(param===node)return false}return parent.id!==node;case"ExportSpecifier":if(parent.source){return false}else{return parent.local===node}case"JSXAttribute":return parent.name!==node;case"ClassProperty":return parent.value===node;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return false;case"ClassDeclaration":case"ClassExpression":return parent.id!==node;case"MethodDefinition":return parent.key===node&&parent.computed;case"LabeledStatement":return false;case"CatchClause":return parent.param!==node;case"RestElement":return false;case"AssignmentExpression":return parent.right===node;case"AssignmentPattern":return false;case"ObjectPattern":case"ArrayPattern":return false}return true}function isValidIdentifier(name){if(typeof name!=="string"||_esutils2["default"].keyword.isReservedWordES6(name,true)){return false}else{return _esutils2["default"].keyword.isIdentifierNameES6(name)}}function isLet(node){return t.isVariableDeclaration(node)&&(node.kind!=="var"||node._let)}function isBlockScoped(node){return t.isFunctionDeclaration(node)||t.isClassDeclaration(node)||t.isLet(node)}function isVar(node){return t.isVariableDeclaration(node,{kind:"var"})&&!node._let}function isSpecifierDefault(specifier){return t.isImportDefaultSpecifier(specifier)||t.isIdentifier(specifier.imported||specifier.exported,{name:"default"})}function isScope(node,parent){if(t.isBlockStatement(node)&&t.isFunction(parent,{body:node})){return false}return t.isScopable(node)}function isImmutable(node){if(t.isType(node.type,"Immutable"))return true;if(t.isLiteral(node)){if(node.regex){return false}else{return true}}else if(t.isIdentifier(node)){if(node.name==="undefined"){return true}else{return false}}return false}},{"./index":196,"./retrievers":197,esutils:322}],199:[function(require,module,exports){(function(__dirname){"use strict";exports.__esModule=true;exports.canCompile=canCompile;exports.list=list;exports.regexify=regexify;exports.arrayify=arrayify;exports.booleanify=booleanify;exports.shouldIgnore=shouldIgnore;exports.template=template;exports.parseTemplate=parseTemplate;function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj["default"]=obj;return newObj}}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _lodashStringEscapeRegExp=require("lodash/string/escapeRegExp");var _lodashStringEscapeRegExp2=_interopRequireDefault(_lodashStringEscapeRegExp);var _lodashStringStartsWith=require("lodash/string/startsWith");var _lodashStringStartsWith2=_interopRequireDefault(_lodashStringStartsWith);var _lodashLangCloneDeep=require("lodash/lang/cloneDeep");var _lodashLangCloneDeep2=_interopRequireDefault(_lodashLangCloneDeep);var _lodashLangIsBoolean=require("lodash/lang/isBoolean");var _lodashLangIsBoolean2=_interopRequireDefault(_lodashLangIsBoolean);var _messages=require("./messages");var messages=_interopRequireWildcard(_messages);var _minimatch=require("minimatch");var _minimatch2=_interopRequireDefault(_minimatch);var _lodashCollectionContains=require("lodash/collection/contains");var _lodashCollectionContains2=_interopRequireDefault(_lodashCollectionContains);var _traversal=require("./traversal");var _traversal2=_interopRequireDefault(_traversal);var _lodashLangIsString=require("lodash/lang/isString");var _lodashLangIsString2=_interopRequireDefault(_lodashLangIsString);var _lodashLangIsRegExp=require("lodash/lang/isRegExp");var _lodashLangIsRegExp2=_interopRequireDefault(_lodashLangIsRegExp);var _lodashLangIsEmpty=require("lodash/lang/isEmpty");var _lodashLangIsEmpty2=_interopRequireDefault(_lodashLangIsEmpty);var _helpersParse=require("./helpers/parse");var _helpersParse2=_interopRequireDefault(_helpersParse);var _path=require("path");var _path2=_interopRequireDefault(_path);var _lodashObjectHas=require("lodash/object/has");var _lodashObjectHas2=_interopRequireDefault(_lodashObjectHas);var _fs=require("fs");var _fs2=_interopRequireDefault(_fs);var _types=require("./types");var t=_interopRequireWildcard(_types);var _slash=require("slash");var _slash2=_interopRequireDefault(_slash);var _pathExists=require("path-exists");var _pathExists2=_interopRequireDefault(_pathExists);var _util=require("util");exports.inherits=_util.inherits;exports.inspect=_util.inspect;function canCompile(filename,altExts){var exts=altExts||canCompile.EXTENSIONS;var ext=_path2["default"].extname(filename);return _lodashCollectionContains2["default"](exts,ext)}canCompile.EXTENSIONS=[".js",".jsx",".es6",".es"];function list(val){if(!val){return[]}else if(Array.isArray(val)){return val}else if(typeof val==="string"){return val.split(",")}else{return[val]}}function regexify(val){if(!val)return new RegExp(/.^/);if(Array.isArray(val))val=new RegExp(val.map(_lodashStringEscapeRegExp2["default"]).join("|"),"i");if(_lodashLangIsString2["default"](val)){val=_slash2["default"](val);if(_lodashStringStartsWith2["default"](val,"./")||_lodashStringStartsWith2["default"](val,"*/"))val=val.slice(2);if(_lodashStringStartsWith2["default"](val,"**/"))val=val.slice(3);var regex=_minimatch2["default"].makeRe(val,{nocase:true});return new RegExp(regex.source.slice(1,-1),"i")}if(_lodashLangIsRegExp2["default"](val))return val;throw new TypeError("illegal type for regexify")}function arrayify(val,mapFn){if(!val)return[];if(_lodashLangIsBoolean2["default"](val))return arrayify([val],mapFn);if(_lodashLangIsString2["default"](val))return arrayify(list(val),mapFn);if(Array.isArray(val)){if(mapFn)val=val.map(mapFn);return val}return[val]}function booleanify(val){if(val==="true")return true;if(val==="false")return false;return val}function shouldIgnore(filename,ignore,only){filename=_slash2["default"](filename);if(only){var _arr=only;for(var _i=0;_i<_arr.length;_i++){var pattern=_arr[_i];if(_shouldIgnore(pattern,filename))return false}return true}else if(ignore.length){var _arr2=ignore;for(var _i2=0;_i2<_arr2.length;_i2++){var pattern=_arr2[_i2];if(_shouldIgnore(pattern,filename))return true}}return false}function _shouldIgnore(pattern,filename){if(typeof pattern==="function"){return pattern(filename)}else{return pattern.test(filename)}}var templateVisitor={noScope:true,enter:function enter(node,parent,scope,nodes){if(t.isExpressionStatement(node)){node=node.expression}if(t.isIdentifier(node)&&_lodashObjectHas2["default"](nodes,node.name)){this.skip();this.replaceInline(nodes[node.name])}},exit:function exit(node){_traversal2["default"].clearNode(node)}};function template(name,nodes,keepExpression){var ast=exports.templates[name];if(!ast)throw new ReferenceError("unknown template "+name);if(nodes===true){keepExpression=true;nodes=null}ast=_lodashLangCloneDeep2["default"](ast);if(!_lodashLangIsEmpty2["default"](nodes)){_traversal2["default"](ast,templateVisitor,null,nodes)}if(ast.body.length>1)return ast.body;var node=ast.body[0];if(!keepExpression&&t.isExpressionStatement(node)){return node.expression}else{return node}}function parseTemplate(loc,code){var ast=_helpersParse2["default"](code,{filename:loc,looseModules:true}).program;ast=_traversal2["default"].removeProperties(ast);return ast}function loadTemplates(){var templates={};var templatesLoc=_path2["default"].join(__dirname,"transformation/templates");if(!_pathExists2["default"].sync(templatesLoc)){throw new ReferenceError(messages.get("missingTemplatesDirectory"))}var _arr3=_fs2["default"].readdirSync(templatesLoc);for(var _i3=0;_i3<_arr3.length;_i3++){var name=_arr3[_i3];if(name[0]===".")return;var key=_path2["default"].basename(name,_path2["default"].extname(name));var loc=_path2["default"].join(templatesLoc,name);var code=_fs2["default"].readFileSync(loc,"utf8");templates[key]=parseTemplate(loc,code)}return templates}try{exports.templates=require("../templates.json")}catch(err){if(err.code!=="MODULE_NOT_FOUND")throw err;exports.templates=loadTemplates()}}).call(this,"/lib")},{"../templates.json":538,"./helpers/parse":59,"./messages":60,"./traversal":165,"./types":196,fs:4,"lodash/collection/contains":342,"lodash/lang/cloneDeep":427,"lodash/lang/isBoolean":430,"lodash/lang/isEmpty":431,"lodash/lang/isRegExp":437,"lodash/lang/isString":438,"lodash/object/has":444,"lodash/string/escapeRegExp":450,"lodash/string/startsWith":451,minimatch:454,path:12,"path-exists":458,slash:521,util:30}],200:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=function(_ref){var Plugin=_ref.Plugin;var t=_ref.types;return new Plugin("constant-folding",{metadata:{group:"builtin-prepass",experimental:true},visitor:{AssignmentExpression:function AssignmentExpression(){var left=this.get("left");if(!left.isIdentifier())return;var binding=this.scope.getBinding(left.node.name);if(!binding||binding.hasDeoptValue)return;var evaluated=this.get("right").evaluate();if(evaluated.confident){binding.setValue(evaluated.value)}else{binding.deoptValue()}},IfStatement:function IfStatement(){var evaluated=this.get("test").evaluate();if(!evaluated.confident){return this.skip()}if(evaluated.value){this.skipKey("alternate")}else{this.skipKey("consequent")}},Scopable:{enter:function enter(){var funcScope=this.scope.getFunctionParent();for(var name in this.scope.bindings){var binding=this.scope.bindings[name];var deopt=false;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=binding.constantViolations[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var path=_step.value;var funcViolationScope=path.scope.getFunctionParent();if(funcViolationScope!==funcScope){deopt=true;break}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator["return"]){_iterator["return"]()}}finally{if(_didIteratorError){throw _iteratorError}}}if(deopt)binding.deoptValue()}},exit:function exit(){for(var name in this.scope.bindings){var binding=this.scope.bindings[name];binding.clearValue()}}},Expression:{exit:function exit(){var res=this.evaluate();if(res.confident)return t.valueToNode(res.value)}}}})};module.exports=exports["default"]},{}],201:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=function(_ref){var Plugin=_ref.Plugin;var t=_ref.types;function toStatements(node){if(t.isBlockStatement(node)){var hasBlockScoped=false;for(var i=0;i1||!binding.constant)return;if(binding.kind==="param"||binding.kind==="module")return; -var replacement=binding.path.node;if(t.isVariableDeclarator(replacement)){replacement=replacement.init}if(!replacement)return;if(!scope.isPure(replacement,true))return;if(t.isClass(replacement)||t.isFunction(replacement)){if(binding.path.scope.parent!==scope)return}if(this.findParent(function(path){return path.node===replacement})){return}t.toExpression(replacement);scope.removeBinding(node.name);binding.path.dangerouslyRemove();return replacement},"ClassDeclaration|FunctionDeclaration":function ClassDeclarationFunctionDeclaration(node,parent,scope){var binding=scope.getBinding(node.id.name);if(binding&&!binding.referenced){this.dangerouslyRemove()}},VariableDeclarator:function VariableDeclarator(node,parent,scope){if(!t.isIdentifier(node.id)||!scope.isPure(node.init,true))return;visitor["ClassDeclaration|FunctionDeclaration"].apply(this,arguments)},ConditionalExpression:function ConditionalExpression(node){var evaluateTest=this.get("test").evaluateTruthy();if(evaluateTest===true){return node.consequent}else if(evaluateTest===false){return node.alternate}},BlockStatement:function BlockStatement(){var paths=this.get("body");var purge=false;for(var i=0;i3)continue;if(distance<=shortest)continue;closest=name;shortest=distance}var msg;if(closest){msg=messages.get("undeclaredVariableSuggestion",node.name,closest)}else{msg=messages.get("undeclaredVariable",node.name)}throw this.errorWithNode(msg,ReferenceError)}}})};module.exports=exports["default"]},{leven:215}],215:[function(require,module,exports){"use strict";var arr=[];var charCodeCache=[];module.exports=function(a,b){if(a===b){return 0}var aLen=a.length;var bLen=b.length;if(aLen===0){return bLen}if(bLen===0){return aLen}var bCharCode;var ret;var tmp;var tmp2;var i=0;var j=0;while(iret?tmp2>ret?ret+1:tmp2:tmp2>tmp?tmp+1:tmp2}}return ret}},{}],216:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=function(_ref){var Plugin=_ref.Plugin;var t=_ref.types;return new Plugin("undefined-to-void",{metadata:{group:"builtin-basic"},visitor:{ReferencedIdentifier:function ReferencedIdentifier(node,parent){if(node.name==="undefined"){return t.unaryExpression("void",t.literal(0),true)}}}})};module.exports=exports["default"]},{}],217:[function(require,module,exports){(function(process){"use strict";var escapeStringRegexp=require("escape-string-regexp");var ansiStyles=require("ansi-styles");var stripAnsi=require("strip-ansi");var hasAnsi=require("has-ansi");var supportsColor=require("supports-color");var defineProps=Object.defineProperties;var isSimpleWindowsTerm=process.platform==="win32"&&!/^xterm/i.test(process.env.TERM);function Chalk(options){this.enabled=!options||options.enabled===undefined?supportsColor:options.enabled}if(isSimpleWindowsTerm){ansiStyles.blue.open=""}var styles=function(){var ret={};Object.keys(ansiStyles).forEach(function(key){ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),"g");ret[key]={get:function(){return build.call(this,this._styles.concat(key))}}});return ret}();var proto=defineProps(function chalk(){},styles);function build(_styles){var builder=function builder(){return applyStyle.apply(builder,arguments)};builder._styles=_styles;builder.enabled=this.enabled;builder.__proto__=proto;return builder}function applyStyle(){var args=arguments;var argsLen=args.length;var str=argsLen!==0&&String(arguments[0]);if(argsLen>1){for(var a=1;a<]/g}},{}],222:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex")();module.exports=function(str){return typeof str==="string"?str.replace(ansiRegex,""):str}},{"ansi-regex":223}],223:[function(require,module,exports){arguments[4][221][0].apply(exports,arguments)},{dup:221}],224:[function(require,module,exports){(function(process){"use strict";var argv=process.argv;var terminator=argv.indexOf("--");var hasFlag=function(flag){flag="--"+flag;var pos=argv.indexOf(flag);return pos!==-1&&(terminator!==-1?pos0;i--){line=lines[i];if(~line.indexOf("sourceMappingURL=data:"))return exports.fromComment(line)}}Converter.prototype.toJSON=function(space){return JSON.stringify(this.sourcemap,null,space)};Converter.prototype.toBase64=function(){var json=this.toJSON();return new Buffer(json).toString("base64")};Converter.prototype.toComment=function(options){var base64=this.toBase64();var data="sourceMappingURL=data:application/json;base64,"+base64;return options&&options.multiline?"/*# "+data+" */":"//# "+data};Converter.prototype.toObject=function(){return JSON.parse(this.toJSON())};Converter.prototype.addProperty=function(key,value){if(this.sourcemap.hasOwnProperty(key))throw new Error("property %s already exists on the sourcemap, use set property instead");return this.setProperty(key,value)};Converter.prototype.setProperty=function(key,value){this.sourcemap[key]=value;return this};Converter.prototype.getProperty=function(key){return this.sourcemap[key]};exports.fromObject=function(obj){return new Converter(obj)};exports.fromJSON=function(json){return new Converter(json,{isJSON:true})};exports.fromBase64=function(base64){return new Converter(base64,{isEncoded:true})};exports.fromComment=function(comment){comment=comment.replace(/^\/\*/g,"//").replace(/\*\/$/g,"");return new Converter(comment,{isEncoded:true,hasComment:true})};exports.fromMapFileComment=function(comment,dir){return new Converter(comment,{commentFileDir:dir,isFileComment:true,isJSON:true})};exports.fromSource=function(content,largeSource){if(largeSource)return convertFromLargeSource(content);var m=content.match(commentRx);commentRx.lastIndex=0;return m?exports.fromComment(m.pop()):null};exports.fromMapFileSource=function(content,dir){var m=content.match(mapFileCommentRx);mapFileCommentRx.lastIndex=0;return m?exports.fromMapFileComment(m.pop(),dir):null};exports.removeComments=function(src){commentRx.lastIndex=0;return src.replace(commentRx,"")};exports.removeMapFileComments=function(src){mapFileCommentRx.lastIndex=0;return src.replace(mapFileCommentRx,"")};Object.defineProperty(exports,"commentRegex",{get:function getCommentRegex(){commentRx.lastIndex=0;return commentRx}});Object.defineProperty(exports,"mapFileCommentRegex",{get:function getMapFileCommentRegex(){mapFileCommentRx.lastIndex=0;return mapFileCommentRx}})}).call(this,require("buffer").Buffer)},{buffer:5,fs:4,path:12}],226:[function(require,module,exports){var $=require("./$");module.exports=function(IS_INCLUDES){return function($this,el,fromIndex){var O=$.toObject($this),length=$.toLength(O.length),index=$.toIndex(fromIndex,length),value;if(IS_INCLUDES&&el!=el)while(length>index){value=O[index++];if(value!=value)return true}else for(;length>index;index++)if(IS_INCLUDES||index in O){if(O[index]===el)return IS_INCLUDES||index}return!IS_INCLUDES&&-1}}},{"./$":247}],227:[function(require,module,exports){var $=require("./$"),ctx=require("./$.ctx");module.exports=function(TYPE){var IS_MAP=TYPE==1,IS_FILTER=TYPE==2,IS_SOME=TYPE==3,IS_EVERY=TYPE==4,IS_FIND_INDEX=TYPE==6,NO_HOLES=TYPE==5||IS_FIND_INDEX;return function($this,callbackfn,that){var O=Object($.assertDefined($this)),self=$.ES5Object(O),f=ctx(callbackfn,that,3),length=$.toLength(self.length),index=0,result=IS_MAP?Array(length):IS_FILTER?[]:undefined,val,res;for(;length>index;index++)if(NO_HOLES||index in self){val=self[index];res=f(val,index,O);if(TYPE){if(IS_MAP)result[index]=res;else if(res)switch(TYPE){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(IS_EVERY)return false}}return IS_FIND_INDEX?-1:IS_SOME||IS_EVERY?IS_EVERY:result}}},{"./$":247,"./$.ctx":235}],228:[function(require,module,exports){var $=require("./$");function assert(condition,msg1,msg2){if(!condition)throw TypeError(msg2?msg1+msg2:msg1)}assert.def=$.assertDefined;assert.fn=function(it){if(!$.isFunction(it))throw TypeError(it+" is not a function!");return it};assert.obj=function(it){if(!$.isObject(it))throw TypeError(it+" is not an object!");return it};assert.inst=function(it,Constructor,name){if(!(it instanceof Constructor))throw TypeError(name+": use the 'new' operator!");return it};module.exports=assert},{"./$":247}],229:[function(require,module,exports){var $=require("./$"),enumKeys=require("./$.enum-keys");module.exports=Object.assign||function assign(target,source){var T=Object($.assertDefined(target)),l=arguments.length,i=1;while(l>i){var S=$.ES5Object(arguments[i++]),keys=enumKeys(S),length=keys.length,j=0,key;while(length>j)T[key=keys[j++]]=S[key]}return T}},{"./$":247,"./$.enum-keys":238}],230:[function(require,module,exports){var $=require("./$"),TAG=require("./$.wks")("toStringTag"),toString={}.toString;function cof(it){return toString.call(it).slice(8,-1)}cof.classof=function(it){var O,T;return it==undefined?it===undefined?"Undefined":"Null":typeof(T=(O=Object(it))[TAG])=="string"?T:cof(O)};cof.set=function(it,tag,stat){if(it&&!$.has(it=stat?it:it.prototype,TAG))$.hide(it,TAG,tag)};module.exports=cof},{"./$":247,"./$.wks":265}],231:[function(require,module,exports){"use strict";var $=require("./$"),ctx=require("./$.ctx"),safe=require("./$.uid").safe,assert=require("./$.assert"),forOf=require("./$.for-of"),step=require("./$.iter").step,$has=$.has,set=$.set,isObject=$.isObject,hide=$.hide,isExtensible=Object.isExtensible||isObject,ID=safe("id"),O1=safe("O1"),LAST=safe("last"),FIRST=safe("first"),ITER=safe("iter"),SIZE=$.DESC?safe("size"):"size",id=0;function fastKey(it,create){if(!isObject(it))return typeof it=="symbol"?it:(typeof it=="string"?"S":"P")+it;if(!$has(it,ID)){if(!isExtensible(it))return"F";if(!create)return"E";hide(it,ID,++id)}return"O"+it[ID]}function getEntry(that,key){var index=fastKey(key),entry;if(index!=="F")return that[O1][index];for(entry=that[FIRST];entry;entry=entry.n){if(entry.k==key)return entry}}module.exports={getConstructor:function(wrapper,NAME,IS_MAP,ADDER){var C=wrapper(function(that,iterable){assert.inst(that,C,NAME);set(that,O1,$.create(null));set(that,SIZE,0);set(that,LAST,undefined);set(that,FIRST,undefined);if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that)});require("./$.mix")(C.prototype,{clear:function clear(){for(var that=this,data=that[O1],entry=that[FIRST];entry;entry=entry.n){entry.r=true;if(entry.p)entry.p=entry.p.n=undefined;delete data[entry.i]}that[FIRST]=that[LAST]=undefined;that[SIZE]=0},"delete":function(key){var that=this,entry=getEntry(that,key);if(entry){var next=entry.n,prev=entry.p;delete that[O1][entry.i];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that[FIRST]==entry)that[FIRST]=next;if(that[LAST]==entry)that[LAST]=prev;that[SIZE]--}return!!entry},forEach:function forEach(callbackfn){var f=ctx(callbackfn,arguments[1],3),entry;while(entry=entry?entry.n:this[FIRST]){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function has(key){return!!getEntry(this,key)}});if($.DESC)$.setDesc(C.prototype,"size",{ -get:function(){return assert.def(this[SIZE])}});return C},def:function(that,key,value){var entry=getEntry(that,key),prev,index;if(entry){entry.v=value}else{that[LAST]=entry={i:index=fastKey(key,true),k:key,v:value,p:prev=that[LAST],n:undefined,r:false};if(!that[FIRST])that[FIRST]=entry;if(prev)prev.n=entry;that[SIZE]++;if(index!=="F")that[O1][index]=entry}return that},getEntry:getEntry,setIter:function(C,NAME,IS_MAP){require("./$.iter-define")(C,NAME,function(iterated,kind){set(this,ITER,{o:iterated,k:kind})},function(){var iter=this[ITER],kind=iter.k,entry=iter.l;while(entry&&entry.r)entry=entry.p;if(!iter.o||!(iter.l=entry=entry?entry.n:iter.o[FIRST])){iter.o=undefined;return step(1)}if(kind=="keys")return step(0,entry.k);if(kind=="values")return step(0,entry.v);return step(0,[entry.k,entry.v])},IS_MAP?"entries":"values",!IS_MAP,true)}}},{"./$":247,"./$.assert":228,"./$.ctx":235,"./$.for-of":239,"./$.iter":246,"./$.iter-define":244,"./$.mix":249,"./$.uid":263}],232:[function(require,module,exports){var $def=require("./$.def"),forOf=require("./$.for-of");module.exports=function(NAME){$def($def.P,NAME,{toJSON:function toJSON(){var arr=[];forOf(this,false,arr.push,arr);return arr}})}},{"./$.def":236,"./$.for-of":239}],233:[function(require,module,exports){"use strict";var $=require("./$"),safe=require("./$.uid").safe,assert=require("./$.assert"),forOf=require("./$.for-of"),$has=$.has,isObject=$.isObject,hide=$.hide,isExtensible=Object.isExtensible||isObject,id=0,ID=safe("id"),WEAK=safe("weak"),LEAK=safe("leak"),method=require("./$.array-methods"),find=method(5),findIndex=method(6);function findFrozen(store,key){return find(store.array,function(it){return it[0]===key})}function leakStore(that){return that[LEAK]||hide(that,LEAK,{array:[],get:function(key){var entry=findFrozen(this,key);if(entry)return entry[1]},has:function(key){return!!findFrozen(this,key)},set:function(key,value){var entry=findFrozen(this,key);if(entry)entry[1]=value;else this.array.push([key,value])},"delete":function(key){var index=findIndex(this.array,function(it){return it[0]===key});if(~index)this.array.splice(index,1);return!!~index}})[LEAK]}module.exports={getConstructor:function(wrapper,NAME,IS_MAP,ADDER){var C=wrapper(function(that,iterable){$.set(assert.inst(that,C,NAME),ID,id++);if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that)});require("./$.mix")(C.prototype,{"delete":function(key){if(!isObject(key))return false;if(!isExtensible(key))return leakStore(this)["delete"](key);return $has(key,WEAK)&&$has(key[WEAK],this[ID])&&delete key[WEAK][this[ID]]},has:function has(key){if(!isObject(key))return false;if(!isExtensible(key))return leakStore(this).has(key);return $has(key,WEAK)&&$has(key[WEAK],this[ID])}});return C},def:function(that,key,value){if(!isExtensible(assert.obj(key))){leakStore(that).set(key,value)}else{$has(key,WEAK)||hide(key,WEAK,{});key[WEAK][that[ID]]=value}return that},leakStore:leakStore,WEAK:WEAK,ID:ID}},{"./$":247,"./$.array-methods":227,"./$.assert":228,"./$.for-of":239,"./$.mix":249,"./$.uid":263}],234:[function(require,module,exports){"use strict";var $=require("./$"),$def=require("./$.def"),BUGGY=require("./$.iter").BUGGY,forOf=require("./$.for-of"),species=require("./$.species"),assertInstance=require("./$.assert").inst;module.exports=function(NAME,wrapper,methods,common,IS_MAP,IS_WEAK){var Base=$.g[NAME],C=Base,ADDER=IS_MAP?"set":"add",proto=C&&C.prototype,O={};function fixMethod(KEY){var fn=proto[KEY];require("./$.redef")(proto,KEY,KEY=="delete"?function(a){return fn.call(this,a===0?0:a)}:KEY=="has"?function has(a){return fn.call(this,a===0?0:a)}:KEY=="get"?function get(a){return fn.call(this,a===0?0:a)}:KEY=="add"?function add(a){fn.call(this,a===0?0:a);return this}:function set(a,b){fn.call(this,a===0?0:a,b);return this})}if(!$.isFunction(C)||!(IS_WEAK||!BUGGY&&proto.forEach&&proto.entries)){C=common.getConstructor(wrapper,NAME,IS_MAP,ADDER);require("./$.mix")(C.prototype,methods)}else{var inst=new C,chain=inst[ADDER](IS_WEAK?{}:-0,1),buggyZero;if(!require("./$.iter-detect")(function(iter){new C(iter)})){C=wrapper(function(target,iterable){assertInstance(target,C,NAME);var that=new Base;if(iterable!=undefined)forOf(iterable,IS_MAP,that[ADDER],that);return that});C.prototype=proto;proto.constructor=C}IS_WEAK||inst.forEach(function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixMethod("delete");fixMethod("has");IS_MAP&&fixMethod("get")}if(buggyZero||chain!==inst)fixMethod(ADDER)}require("./$.cof").set(C,NAME);O[NAME]=C;$def($def.G+$def.W+$def.F*(C!=Base),O);species(C);species($.core[NAME]);if(!IS_WEAK)common.setIter(C,NAME,IS_MAP);return C}},{"./$":247,"./$.assert":228,"./$.cof":230,"./$.def":236,"./$.for-of":239,"./$.iter":246,"./$.iter-detect":245,"./$.mix":249,"./$.redef":252,"./$.species":257}],235:[function(require,module,exports){var assertFunction=require("./$.assert").fn;module.exports=function(fn,that,length){assertFunction(fn);if(~length&&that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},{"./$.assert":228}],236:[function(require,module,exports){var $=require("./$"),global=$.g,core=$.core,isFunction=$.isFunction,$redef=require("./$.redef");function ctx(fn,that){return function(){return fn.apply(that,arguments)}}global.core=core;$def.F=1;$def.G=2;$def.S=4;$def.P=8;$def.B=16;$def.W=32;function $def(type,name,source){var key,own,out,exp,isGlobal=type&$def.G,isProto=type&$def.P,target=isGlobal?global:type&$def.S?global[name]:(global[name]||{}).prototype,exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&$def.F)&&target&&key in target;out=(own?target:source)[key];if(type&$def.B&&own)exp=ctx(out,global);else exp=isProto&&isFunction(out)?ctx(Function.call,out):out;if(target&&!own)$redef(target,key,out);if(exports[key]!=out)$.hide(exports,key,exp);if(isProto)(exports.prototype||(exports.prototype={}))[key]=out}}module.exports=$def},{"./$":247,"./$.redef":252}],237:[function(require,module,exports){var $=require("./$"),document=$.g.document,isObject=$.isObject,is=isObject(document)&&isObject(document.createElement);module.exports=function(it){return is?document.createElement(it):{}}},{"./$":247}],238:[function(require,module,exports){var $=require("./$");module.exports=function(it){var keys=$.getKeys(it),getDesc=$.getDesc,getSymbols=$.getSymbols;if(getSymbols)$.each.call(getSymbols(it),function(key){if(getDesc(it,key).enumerable)keys.push(key)});return keys}},{"./$":247}],239:[function(require,module,exports){var ctx=require("./$.ctx"),get=require("./$.iter").get,call=require("./$.iter-call");module.exports=function(iterable,entries,fn,that){var iterator=get(iterable),f=ctx(fn,that,entries?2:1),step;while(!(step=iterator.next()).done){if(call(iterator,f,step.value,entries)===false){return call.close(iterator)}}}},{"./$.ctx":235,"./$.iter":246,"./$.iter-call":243}],240:[function(require,module,exports){module.exports=function($){$.FW=true;$.path=$.g;return $}},{}],241:[function(require,module,exports){var $=require("./$"),toString={}.toString,getNames=$.getNames;var windowNames=typeof window=="object"&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];function getWindowNames(it){try{return getNames(it)}catch(e){return windowNames.slice()}}module.exports.get=function getOwnPropertyNames(it){if(windowNames&&toString.call(it)=="[object Window]")return getWindowNames(it);return getNames($.toObject(it))}},{"./$":247}],242:[function(require,module,exports){module.exports=function(fn,args,that){var un=that===undefined;switch(args.length){case 0:return un?fn():fn.call(that);case 1:return un?fn(args[0]):fn.call(that,args[0]);case 2:return un?fn(args[0],args[1]):fn.call(that,args[0],args[1]);case 3:return un?fn(args[0],args[1],args[2]):fn.call(that,args[0],args[1],args[2]);case 4:return un?fn(args[0],args[1],args[2],args[3]):fn.call(that,args[0],args[1],args[2],args[3]);case 5:return un?fn(args[0],args[1],args[2],args[3],args[4]):fn.call(that,args[0],args[1],args[2],args[3],args[4])}return fn.apply(that,args)}},{}],243:[function(require,module,exports){var assertObject=require("./$.assert").obj;function close(iterator){var ret=iterator["return"];if(ret!==undefined)assertObject(ret.call(iterator))}function call(iterator,fn,value,entries){try{return entries?fn(assertObject(value)[0],value[1]):fn(value)}catch(e){close(iterator);throw e}}call.close=close;module.exports=call},{"./$.assert":228}],244:[function(require,module,exports){var $def=require("./$.def"),$redef=require("./$.redef"),$=require("./$"),cof=require("./$.cof"),$iter=require("./$.iter"),SYMBOL_ITERATOR=require("./$.wks")("iterator"),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",Iterators=$iter.Iterators;module.exports=function(Base,NAME,Constructor,next,DEFAULT,IS_SET,FORCE){$iter.create(Constructor,NAME,next);function createMethod(kind){function $$(that){return new Constructor(that,kind)}switch(kind){case KEYS:return function keys(){return $$(this)};case VALUES:return function values(){return $$(this)}}return function entries(){return $$(this)}}var TAG=NAME+" Iterator",proto=Base.prototype,_native=proto[SYMBOL_ITERATOR]||proto[FF_ITERATOR]||DEFAULT&&proto[DEFAULT],_default=_native||createMethod(DEFAULT),methods,key;if(_native){var IteratorPrototype=$.getProto(_default.call(new Base));cof.set(IteratorPrototype,TAG,true);if($.FW&&$.has(proto,FF_ITERATOR))$iter.set(IteratorPrototype,$.that)}if($.FW||FORCE)$iter.set(proto,_default);Iterators[NAME]=_default;Iterators[TAG]=$.that;if(DEFAULT){methods={keys:IS_SET?_default:createMethod(KEYS),values:DEFAULT==VALUES?_default:createMethod(VALUES),entries:DEFAULT!=VALUES?_default:createMethod("entries")};if(FORCE)for(key in methods){if(!(key in proto))$redef(proto,key,methods[key])}else $def($def.P+$def.F*$iter.BUGGY,NAME,methods)}}},{"./$":247,"./$.cof":230,"./$.def":236,"./$.iter":246,"./$.redef":252,"./$.wks":265}],245:[function(require,module,exports){var SYMBOL_ITERATOR=require("./$.wks")("iterator"),SAFE_CLOSING=false;try{var riter=[7][SYMBOL_ITERATOR]();riter["return"]=function(){SAFE_CLOSING=true};Array.from(riter,function(){throw 2})}catch(e){}module.exports=function(exec){if(!SAFE_CLOSING)return false;var safe=false;try{var arr=[7],iter=arr[SYMBOL_ITERATOR]();iter.next=function(){safe=true};arr[SYMBOL_ITERATOR]=function(){return iter};exec(arr)}catch(e){}return safe}},{"./$.wks":265}],246:[function(require,module,exports){"use strict";var $=require("./$"),cof=require("./$.cof"),classof=cof.classof,assert=require("./$.assert"),assertObject=assert.obj,SYMBOL_ITERATOR=require("./$.wks")("iterator"),FF_ITERATOR="@@iterator",Iterators=require("./$.shared")("iterators"),IteratorPrototype={};setIterator(IteratorPrototype,$.that);function setIterator(O,value){$.hide(O,SYMBOL_ITERATOR,value);if(FF_ITERATOR in[])$.hide(O,FF_ITERATOR,value)}module.exports={BUGGY:"keys"in[]&&!("next"in[].keys()),Iterators:Iterators,step:function(done,value){return{value:value,done:!!done}},is:function(it){var O=Object(it),Symbol=$.g.Symbol;return(Symbol&&Symbol.iterator||FF_ITERATOR)in O||SYMBOL_ITERATOR in O||$.has(Iterators,classof(O))},get:function(it){var Symbol=$.g.Symbol,getIter;if(it!=undefined){getIter=it[Symbol&&Symbol.iterator||FF_ITERATOR]||it[SYMBOL_ITERATOR]||Iterators[classof(it)]}assert($.isFunction(getIter),it," is not iterable!");return assertObject(getIter.call(it))},set:setIterator,create:function(Constructor,NAME,next,proto){Constructor.prototype=$.create(proto||IteratorPrototype,{next:$.desc(1,next)});cof.set(Constructor,NAME+" Iterator")}}},{"./$":247,"./$.assert":228,"./$.cof":230,"./$.shared":256,"./$.wks":265}],247:[function(require,module,exports){"use strict";var global=typeof self!="undefined"?self:Function("return this")(),core={},defineProperty=Object.defineProperty,hasOwnProperty={}.hasOwnProperty,ceil=Math.ceil,floor=Math.floor,max=Math.max,min=Math.min;var DESC=!!function(){try{return defineProperty({},"a",{get:function(){return 2}}).a==2}catch(e){}}();var hide=createDefiner(1);function toInteger(it){return isNaN(it=+it)?0:(it>0?floor:ceil)(it)}function desc(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}function simpleSet(object,key,value){object[key]=value;return object}function createDefiner(bitmap){return DESC?function(object,key,value){return $.setDesc(object,key,desc(bitmap,value))}:simpleSet}function isObject(it){return it!==null&&(typeof it=="object"||typeof it=="function")}function isFunction(it){return typeof it=="function"}function assertDefined(it){if(it==undefined)throw TypeError("Can't call method on "+it);return it}var $=module.exports=require("./$.fw")({g:global,core:core,html:global.document&&document.documentElement,isObject:isObject,isFunction:isFunction,that:function(){return this},toInteger:toInteger,toLength:function(it){return it>0?min(toInteger(it),9007199254740991):0},toIndex:function(index,length){index=toInteger(index);return index<0?max(index+length,0):min(index,length)},has:function(it,key){return hasOwnProperty.call(it,key)},create:Object.create,getProto:Object.getPrototypeOf,DESC:DESC,desc:desc,getDesc:Object.getOwnPropertyDescriptor,setDesc:defineProperty,setDescs:Object.defineProperties,getKeys:Object.keys,getNames:Object.getOwnPropertyNames,getSymbols:Object.getOwnPropertySymbols,assertDefined:assertDefined,ES5Object:Object,toObject:function(it){return $.ES5Object(assertDefined(it))},hide:hide,def:createDefiner(0),set:global.Symbol?simpleSet:hide,each:[].forEach});if(typeof __e!="undefined")__e=core;if(typeof __g!="undefined")__g=global},{"./$.fw":240}],248:[function(require,module,exports){var $=require("./$");module.exports=function(object,el){var O=$.toObject(object),keys=$.getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}},{"./$":247}],249:[function(require,module,exports){var $redef=require("./$.redef");module.exports=function(target,src){for(var key in src)$redef(target,key,src[key]);return target}},{"./$.redef":252}],250:[function(require,module,exports){var $=require("./$"),assertObject=require("./$.assert").obj;module.exports=function ownKeys(it){assertObject(it);var keys=$.getNames(it),getSymbols=$.getSymbols;return getSymbols?keys.concat(getSymbols(it)):keys}},{"./$":247,"./$.assert":228}],251:[function(require,module,exports){"use strict";var $=require("./$"),invoke=require("./$.invoke"),assertFunction=require("./$.assert").fn;module.exports=function(){var fn=assertFunction(this),length=arguments.length,pargs=Array(length),i=0,_=$.path._,holder=false;while(length>i)if((pargs[i]=arguments[i++])===_)holder=true;return function(){var that=this,_length=arguments.length,j=0,k=0,args;if(!holder&&!_length)return invoke(fn,pargs,that);args=pargs.slice();if(holder)for(;length>j;j++)if(args[j]===_)args[j]=arguments[k++];while(_length>k)args.push(arguments[k++]);return invoke(fn,args,that)}}},{"./$":247,"./$.assert":228,"./$.invoke":242}],252:[function(require,module,exports){var $=require("./$"),tpl=String({}.hasOwnProperty),SRC=require("./$.uid").safe("src"),_toString=Function.toString;function $redef(O,key,val,safe){if($.isFunction(val)){var base=O[key];$.hide(val,SRC,base?String(base):tpl.replace(/hasOwnProperty/,String(key)));if(!("name"in val))val.name=key}if(O===$.g){O[key]=val}else{if(!safe)delete O[key];$.hide(O,key,val)}}$redef(Function.prototype,"toString",function toString(){return $.has(this,SRC)?this[SRC]:_toString.call(this)});$.core.inspectSource=function(it){return _toString.call(it)};module.exports=$redef},{"./$":247,"./$.uid":263}],253:[function(require,module,exports){"use strict";module.exports=function(regExp,replace,isStatic){var replacer=replace===Object(replace)?function(part){return replace[part]}:replace;return function(it){return String(isStatic?it:this).replace(regExp,replacer)}}},{}],254:[function(require,module,exports){module.exports=Object.is||function is(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}},{}],255:[function(require,module,exports){var $=require("./$"),assert=require("./$.assert");function check(O,proto){assert.obj(O);assert(proto===null||$.isObject(proto),proto,": can't set as prototype!")}module.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(buggy,set){try{set=require("./$.ctx")(Function.call,$.getDesc(Object.prototype,"__proto__").set,2);set({},[])}catch(e){buggy=true}return function setPrototypeOf(O,proto){check(O,proto);if(buggy)O.__proto__=proto;else set(O,proto);return O}}():undefined),check:check}},{"./$":247,"./$.assert":228,"./$.ctx":235}],256:[function(require,module,exports){var $=require("./$"),SHARED="__core-js_shared__",store=$.g[SHARED]||($.g[SHARED]={});module.exports=function(key){return store[key]||(store[key]={})}},{"./$":247}],257:[function(require,module,exports){var $=require("./$"),SPECIES=require("./$.wks")("species");module.exports=function(C){if($.DESC&&!(SPECIES in C))$.setDesc(C,SPECIES,{configurable:true,get:$.that})}},{"./$":247,"./$.wks":265}],258:[function(require,module,exports){var $=require("./$");module.exports=function(TO_STRING){return function(that,pos){var s=String($.assertDefined(that)),i=$.toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return TO_STRING?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?TO_STRING?s.charAt(i):a:TO_STRING?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}},{"./$":247}],259:[function(require,module,exports){var $=require("./$"),repeat=require("./$.string-repeat");module.exports=function(that,minLength,fillChar,left){var S=String($.assertDefined(that));if(minLength===undefined)return S;var intMinLength=$.toInteger(minLength);var fillLen=intMinLength-S.length;if(fillLen<0||fillLen===Infinity){throw new RangeError("Cannot satisfy string length "+minLength+" for string: "+S)}var sFillStr=fillChar===undefined?" ":String(fillChar);var sFillVal=repeat.call(sFillStr,Math.ceil(fillLen/sFillStr.length));if(sFillVal.length>fillLen)sFillVal=left?sFillVal.slice(sFillVal.length-fillLen):sFillVal.slice(0,fillLen);return left?sFillVal.concat(S):S.concat(sFillVal)}},{"./$":247,"./$.string-repeat":260}],260:[function(require,module,exports){"use strict";var $=require("./$");module.exports=function repeat(count){var str=String($.assertDefined(this)),res="",n=$.toInteger(count);if(n<0||n==Infinity)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res}},{"./$":247}],261:[function(require,module,exports){"use strict";var $=require("./$"),ctx=require("./$.ctx"),cof=require("./$.cof"),invoke=require("./$.invoke"),cel=require("./$.dom-create"),global=$.g,isFunction=$.isFunction,html=$.html,process=global.process,setTask=global.setImmediate,clearTask=global.clearImmediate,MessageChannel=global.MessageChannel,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",defer,channel,port;function run(){var id=+this;if($.has(queue,id)){var fn=queue[id];delete queue[id];fn()}}function listner(event){run.call(event.data)}if(!isFunction(setTask)||!isFunction(clearTask)){setTask=function(fn){var args=[],i=1;while(arguments.length>i)args.push(arguments[i++]);queue[++counter]=function(){invoke(isFunction(fn)?fn:Function(fn),args)};defer(counter);return counter};clearTask=function(id){delete queue[id]};if(cof(process)=="process"){defer=function(id){process.nextTick(ctx(run,id,1))}}else if(global.addEventListener&&isFunction(global.postMessage)&&!global.importScripts){defer=function(id){global.postMessage(id,"*")};global.addEventListener("message",listner,false)}else if(isFunction(MessageChannel)){channel=new MessageChannel;port=channel.port2;channel.port1.onmessage=listner;defer=ctx(port.postMessage,port,1)}else if(ONREADYSTATECHANGE in cel("script")){defer=function(id){html.appendChild(cel("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this);run.call(id)}}}else{defer=function(id){setTimeout(ctx(run,id,1),0)}}}module.exports={set:setTask,clear:clearTask}},{"./$":247,"./$.cof":230,"./$.ctx":235,"./$.dom-create":237,"./$.invoke":242}],262:[function(require,module,exports){module.exports=function(exec){try{exec();return false}catch(e){return true}}},{}],263:[function(require,module,exports){var sid=0;function uid(key){return"Symbol(".concat(key===undefined?"":key,")_",(++sid+Math.random()).toString(36))}uid.safe=require("./$").g.Symbol||uid;module.exports=uid},{"./$":247}],264:[function(require,module,exports){var UNSCOPABLES=require("./$.wks")("unscopables");if(!(UNSCOPABLES in[]))require("./$").hide(Array.prototype,UNSCOPABLES,{});module.exports=function(key){[][UNSCOPABLES][key]=true}},{"./$":247,"./$.wks":265}],265:[function(require,module,exports){var global=require("./$").g,store=require("./$.shared")("wks");module.exports=function(name){return store[name]||(store[name]=global.Symbol&&global.Symbol[name]||require("./$.uid").safe("Symbol."+name))}},{"./$":247,"./$.shared":256,"./$.uid":263}],266:[function(require,module,exports){var $=require("./$"),cel=require("./$.dom-create"),cof=require("./$.cof"),$def=require("./$.def"),invoke=require("./$.invoke"),arrayMethod=require("./$.array-methods"),IE_PROTO=require("./$.uid").safe("__proto__"),assert=require("./$.assert"),assertObject=assert.obj,ObjectProto=Object.prototype,html=$.html,A=[],_slice=A.slice,_join=A.join,classof=cof.classof,has=$.has,defineProperty=$.setDesc,getOwnDescriptor=$.getDesc,defineProperties=$.setDescs,isFunction=$.isFunction,isObject=$.isObject,toObject=$.toObject,toLength=$.toLength,toIndex=$.toIndex,IE8_DOM_DEFINE=false,$indexOf=require("./$.array-includes")(false),$forEach=arrayMethod(0),$map=arrayMethod(1),$filter=arrayMethod(2),$some=arrayMethod(3),$every=arrayMethod(4);if(!$.DESC){try{IE8_DOM_DEFINE=defineProperty(cel("div"),"x",{get:function(){return 8}}).x==8}catch(e){}$.setDesc=function(O,P,Attributes){if(IE8_DOM_DEFINE)try{return defineProperty(O,P,Attributes)}catch(e){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported!");if("value"in Attributes)assertObject(O)[P]=Attributes.value;return O};$.getDesc=function(O,P){if(IE8_DOM_DEFINE)try{return getOwnDescriptor(O,P)}catch(e){}if(has(O,P))return $.desc(!ObjectProto.propertyIsEnumerable.call(O,P),O[P])};$.setDescs=defineProperties=function(O,Properties){assertObject(O);var keys=$.getKeys(Properties),length=keys.length,i=0,P;while(length>i)$.setDesc(O,P=keys[i++],Properties[P]);return O}}$def($def.S+$def.F*!$.DESC,"Object",{getOwnPropertyDescriptor:$.getDesc,defineProperty:$.setDesc,defineProperties:defineProperties});var keys1=("constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,"+"toLocaleString,toString,valueOf").split(","),keys2=keys1.concat("length","prototype"),keysLen1=keys1.length;var createDict=function(){var iframe=cel("iframe"),i=keysLen1,gt=">",iframeDocument;iframe.style.display="none";html.appendChild(iframe);iframe.src="javascript:";iframeDocument=iframe.contentWindow.document;iframeDocument.open();iframeDocument.write("