UNPKG

377 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory(require("react"), require("react-dom"));
4 else if(typeof define === 'function' && define.amd)
5 define(["react", "react-dom"], factory);
6 else if(typeof exports === 'object')
7 exports["rc-calendar"] = factory(require("react"), require("react-dom"));
8 else
9 root["rc-calendar"] = factory(root["React"], root["ReactDOM"]);
10})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_39__) {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, {
50/******/ configurable: false,
51/******/ enumerable: true,
52/******/ get: getter
53/******/ });
54/******/ }
55/******/ };
56/******/
57/******/ // getDefaultExport function for compatibility with non-harmony modules
58/******/ __webpack_require__.n = function(module) {
59/******/ var getter = module && module.__esModule ?
60/******/ function getDefault() { return module['default']; } :
61/******/ function getModuleExports() { return module; };
62/******/ __webpack_require__.d(getter, 'a', getter);
63/******/ return getter;
64/******/ };
65/******/
66/******/ // Object.prototype.hasOwnProperty.call
67/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68/******/
69/******/ // __webpack_public_path__
70/******/ __webpack_require__.p = "";
71/******/
72/******/ // Load entry module and return exports
73/******/ return __webpack_require__(__webpack_require__.s = 58);
74/******/ })
75/************************************************************************/
76/******/ ([
77/* 0 */
78/***/ (function(module, exports) {
79
80module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
81
82/***/ }),
83/* 1 */
84/***/ (function(module, exports, __webpack_require__) {
85
86"use strict";
87
88
89exports.__esModule = true;
90
91exports.default = function (instance, Constructor) {
92 if (!(instance instanceof Constructor)) {
93 throw new TypeError("Cannot call a class as a function");
94 }
95};
96
97/***/ }),
98/* 2 */
99/***/ (function(module, exports, __webpack_require__) {
100
101"use strict";
102
103
104exports.__esModule = true;
105
106var _typeof2 = __webpack_require__(49);
107
108var _typeof3 = _interopRequireDefault(_typeof2);
109
110function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
111
112exports.default = function (self, call) {
113 if (!self) {
114 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
115 }
116
117 return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
118};
119
120/***/ }),
121/* 3 */
122/***/ (function(module, exports, __webpack_require__) {
123
124"use strict";
125
126
127exports.__esModule = true;
128
129var _setPrototypeOf = __webpack_require__(92);
130
131var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
132
133var _create = __webpack_require__(96);
134
135var _create2 = _interopRequireDefault(_create);
136
137var _typeof2 = __webpack_require__(49);
138
139var _typeof3 = _interopRequireDefault(_typeof2);
140
141function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
142
143exports.default = function (subClass, superClass) {
144 if (typeof superClass !== "function" && superClass !== null) {
145 throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
146 }
147
148 subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
149 constructor: {
150 value: subClass,
151 enumerable: false,
152 writable: true,
153 configurable: true
154 }
155 });
156 if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
157};
158
159/***/ }),
160/* 4 */
161/***/ (function(module, exports, __webpack_require__) {
162
163/* WEBPACK VAR INJECTION */(function(process) {/**
164 * Copyright (c) 2013-present, Facebook, Inc.
165 *
166 * This source code is licensed under the MIT license found in the
167 * LICENSE file in the root directory of this source tree.
168 */
169
170if (process.env.NODE_ENV !== 'production') {
171 var ReactIs = __webpack_require__(54);
172
173 // By explicitly using `prop-types` you are opting into new development behavior.
174 // http://fb.me/prop-types-in-prod
175 var throwOnDirectAccess = true;
176 module.exports = __webpack_require__(101)(ReactIs.isElement, throwOnDirectAccess);
177} else {
178 // By explicitly using `prop-types` you are opting into new production behavior.
179 // http://fb.me/prop-types-in-prod
180 module.exports = __webpack_require__(104)();
181}
182
183/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))
184
185/***/ }),
186/* 5 */
187/***/ (function(module, exports) {
188
189// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
190var global = module.exports = typeof window != 'undefined' && window.Math == Math
191 ? window : typeof self != 'undefined' && self.Math == Math ? self
192 // eslint-disable-next-line no-new-func
193 : Function('return this')();
194if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
195
196
197/***/ }),
198/* 6 */
199/***/ (function(module, exports) {
200
201var core = module.exports = { version: '2.6.5' };
202if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
203
204
205/***/ }),
206/* 7 */
207/***/ (function(module, exports) {
208
209var hasOwnProperty = {}.hasOwnProperty;
210module.exports = function (it, key) {
211 return hasOwnProperty.call(it, key);
212};
213
214
215/***/ }),
216/* 8 */
217/***/ (function(module, exports, __webpack_require__) {
218
219var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
220 Copyright (c) 2017 Jed Watson.
221 Licensed under the MIT License (MIT), see
222 http://jedwatson.github.io/classnames
223*/
224/* global define */
225
226(function () {
227 'use strict';
228
229 var hasOwn = {}.hasOwnProperty;
230
231 function classNames () {
232 var classes = [];
233
234 for (var i = 0; i < arguments.length; i++) {
235 var arg = arguments[i];
236 if (!arg) continue;
237
238 var argType = typeof arg;
239
240 if (argType === 'string' || argType === 'number') {
241 classes.push(arg);
242 } else if (Array.isArray(arg) && arg.length) {
243 var inner = classNames.apply(null, arg);
244 if (inner) {
245 classes.push(inner);
246 }
247 } else if (argType === 'object') {
248 for (var key in arg) {
249 if (hasOwn.call(arg, key) && arg[key]) {
250 classes.push(key);
251 }
252 }
253 }
254 }
255
256 return classes.join(' ');
257 }
258
259 if (typeof module !== 'undefined' && module.exports) {
260 classNames.default = classNames;
261 module.exports = classNames;
262 } else if (true) {
263 // register as 'classnames', consistent with npm package name
264 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
265 return classNames;
266 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
267 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
268 } else {
269 window.classNames = classNames;
270 }
271}());
272
273
274/***/ }),
275/* 9 */
276/***/ (function(module, exports, __webpack_require__) {
277
278var dP = __webpack_require__(10);
279var createDesc = __webpack_require__(21);
280module.exports = __webpack_require__(12) ? function (object, key, value) {
281 return dP.f(object, key, createDesc(1, value));
282} : function (object, key, value) {
283 object[key] = value;
284 return object;
285};
286
287
288/***/ }),
289/* 10 */
290/***/ (function(module, exports, __webpack_require__) {
291
292var anObject = __webpack_require__(17);
293var IE8_DOM_DEFINE = __webpack_require__(43);
294var toPrimitive = __webpack_require__(27);
295var dP = Object.defineProperty;
296
297exports.f = __webpack_require__(12) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
298 anObject(O);
299 P = toPrimitive(P, true);
300 anObject(Attributes);
301 if (IE8_DOM_DEFINE) try {
302 return dP(O, P, Attributes);
303 } catch (e) { /* empty */ }
304 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
305 if ('value' in Attributes) O[P] = Attributes.value;
306 return O;
307};
308
309
310/***/ }),
311/* 11 */
312/***/ (function(module, exports) {
313
314module.exports = function (it) {
315 return typeof it === 'object' ? it !== null : typeof it === 'function';
316};
317
318
319/***/ }),
320/* 12 */
321/***/ (function(module, exports, __webpack_require__) {
322
323// Thank's IE8 for his funny defineProperty
324module.exports = !__webpack_require__(18)(function () {
325 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
326});
327
328
329/***/ }),
330/* 13 */
331/***/ (function(module, exports, __webpack_require__) {
332
333// to indexed object, toObject with fallback for non-array-like ES3 strings
334var IObject = __webpack_require__(46);
335var defined = __webpack_require__(28);
336module.exports = function (it) {
337 return IObject(defined(it));
338};
339
340
341/***/ }),
342/* 14 */
343/***/ (function(module, exports, __webpack_require__) {
344
345var store = __webpack_require__(31)('wks');
346var uid = __webpack_require__(24);
347var Symbol = __webpack_require__(5).Symbol;
348var USE_SYMBOL = typeof Symbol == 'function';
349
350var $exports = module.exports = function (name) {
351 return store[name] || (store[name] =
352 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
353};
354
355$exports.store = store;
356
357
358/***/ }),
359/* 15 */
360/***/ (function(module, __webpack_exports__, __webpack_require__) {
361
362"use strict";
363/* harmony export (immutable) */ __webpack_exports__["e"] = getTodayTime;
364/* harmony export (immutable) */ __webpack_exports__["d"] = getTitleString;
365/* harmony export (immutable) */ __webpack_exports__["f"] = getTodayTimeStr;
366/* harmony export (immutable) */ __webpack_exports__["b"] = getMonthName;
367/* harmony export (immutable) */ __webpack_exports__["h"] = syncTime;
368/* harmony export (immutable) */ __webpack_exports__["c"] = getTimeConfig;
369/* unused harmony export isTimeValidByConfig */
370/* unused harmony export isTimeValid */
371/* harmony export (immutable) */ __webpack_exports__["g"] = isAllowedDate;
372/* harmony export (immutable) */ __webpack_exports__["a"] = formatDate;
373/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(26);
374/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
375/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment__ = __webpack_require__(20);
376/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);
377
378
379
380var defaultDisabledTime = {
381 disabledHours: function disabledHours() {
382 return [];
383 },
384 disabledMinutes: function disabledMinutes() {
385 return [];
386 },
387 disabledSeconds: function disabledSeconds() {
388 return [];
389 }
390};
391
392function getTodayTime(value) {
393 var today = __WEBPACK_IMPORTED_MODULE_1_moment___default()();
394 today.locale(value.locale()).utcOffset(value.utcOffset());
395 return today;
396}
397
398function getTitleString(value) {
399 return value.format('LL');
400}
401
402function getTodayTimeStr(value) {
403 var today = getTodayTime(value);
404 return getTitleString(today);
405}
406
407function getMonthName(month) {
408 var locale = month.locale();
409 var localeData = month.localeData();
410 return localeData[locale === 'zh-cn' ? 'months' : 'monthsShort'](month);
411}
412
413function syncTime(from, to) {
414 if (!__WEBPACK_IMPORTED_MODULE_1_moment___default.a.isMoment(from) || !__WEBPACK_IMPORTED_MODULE_1_moment___default.a.isMoment(to)) return;
415 to.hour(from.hour());
416 to.minute(from.minute());
417 to.second(from.second());
418}
419
420function getTimeConfig(value, disabledTime) {
421 var disabledTimeConfig = disabledTime ? disabledTime(value) : {};
422 disabledTimeConfig = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, defaultDisabledTime, disabledTimeConfig);
423 return disabledTimeConfig;
424}
425
426function isTimeValidByConfig(value, disabledTimeConfig) {
427 var invalidTime = false;
428 if (value) {
429 var hour = value.hour();
430 var minutes = value.minute();
431 var seconds = value.second();
432 var disabledHours = disabledTimeConfig.disabledHours();
433 if (disabledHours.indexOf(hour) === -1) {
434 var disabledMinutes = disabledTimeConfig.disabledMinutes(hour);
435 if (disabledMinutes.indexOf(minutes) === -1) {
436 var disabledSeconds = disabledTimeConfig.disabledSeconds(hour, minutes);
437 invalidTime = disabledSeconds.indexOf(seconds) !== -1;
438 } else {
439 invalidTime = true;
440 }
441 } else {
442 invalidTime = true;
443 }
444 }
445 return !invalidTime;
446}
447
448function isTimeValid(value, disabledTime) {
449 var disabledTimeConfig = getTimeConfig(value, disabledTime);
450 return isTimeValidByConfig(value, disabledTimeConfig);
451}
452
453function isAllowedDate(value, disabledDate, disabledTime) {
454 if (disabledDate) {
455 if (disabledDate(value)) {
456 return false;
457 }
458 }
459 if (disabledTime) {
460 if (!isTimeValid(value, disabledTime)) {
461 return false;
462 }
463 }
464 return true;
465}
466
467function formatDate(value, format) {
468 if (!value) {
469 return '';
470 }
471
472 if (Array.isArray(format)) {
473 format = format[0];
474 }
475
476 return value.format(format);
477}
478
479/***/ }),
480/* 16 */
481/***/ (function(module, exports, __webpack_require__) {
482
483var global = __webpack_require__(5);
484var core = __webpack_require__(6);
485var ctx = __webpack_require__(42);
486var hide = __webpack_require__(9);
487var has = __webpack_require__(7);
488var PROTOTYPE = 'prototype';
489
490var $export = function (type, name, source) {
491 var IS_FORCED = type & $export.F;
492 var IS_GLOBAL = type & $export.G;
493 var IS_STATIC = type & $export.S;
494 var IS_PROTO = type & $export.P;
495 var IS_BIND = type & $export.B;
496 var IS_WRAP = type & $export.W;
497 var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
498 var expProto = exports[PROTOTYPE];
499 var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
500 var key, own, out;
501 if (IS_GLOBAL) source = name;
502 for (key in source) {
503 // contains in native
504 own = !IS_FORCED && target && target[key] !== undefined;
505 if (own && has(exports, key)) continue;
506 // export native or passed
507 out = own ? target[key] : source[key];
508 // prevent global pollution for namespaces
509 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
510 // bind timers to global for call from export context
511 : IS_BIND && own ? ctx(out, global)
512 // wrap global constructors for prevent change them in library
513 : IS_WRAP && target[key] == out ? (function (C) {
514 var F = function (a, b, c) {
515 if (this instanceof C) {
516 switch (arguments.length) {
517 case 0: return new C();
518 case 1: return new C(a);
519 case 2: return new C(a, b);
520 } return new C(a, b, c);
521 } return C.apply(this, arguments);
522 };
523 F[PROTOTYPE] = C[PROTOTYPE];
524 return F;
525 // make static versions for prototype methods
526 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
527 // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
528 if (IS_PROTO) {
529 (exports.virtual || (exports.virtual = {}))[key] = out;
530 // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
531 if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
532 }
533 }
534};
535// type bitmap
536$export.F = 1; // forced
537$export.G = 2; // global
538$export.S = 4; // static
539$export.P = 8; // proto
540$export.B = 16; // bind
541$export.W = 32; // wrap
542$export.U = 64; // safe
543$export.R = 128; // real proto method for `library`
544module.exports = $export;
545
546
547/***/ }),
548/* 17 */
549/***/ (function(module, exports, __webpack_require__) {
550
551var isObject = __webpack_require__(11);
552module.exports = function (it) {
553 if (!isObject(it)) throw TypeError(it + ' is not an object!');
554 return it;
555};
556
557
558/***/ }),
559/* 18 */
560/***/ (function(module, exports) {
561
562module.exports = function (exec) {
563 try {
564 return !!exec();
565 } catch (e) {
566 return true;
567 }
568};
569
570
571/***/ }),
572/* 19 */
573/***/ (function(module, exports) {
574
575// shim for using process in browser
576var process = module.exports = {};
577
578// cached from whatever global is present so that test runners that stub it
579// don't break things. But we need to wrap it in a try catch in case it is
580// wrapped in strict mode code which doesn't define any globals. It's inside a
581// function because try/catches deoptimize in certain engines.
582
583var cachedSetTimeout;
584var cachedClearTimeout;
585
586function defaultSetTimout() {
587 throw new Error('setTimeout has not been defined');
588}
589function defaultClearTimeout () {
590 throw new Error('clearTimeout has not been defined');
591}
592(function () {
593 try {
594 if (typeof setTimeout === 'function') {
595 cachedSetTimeout = setTimeout;
596 } else {
597 cachedSetTimeout = defaultSetTimout;
598 }
599 } catch (e) {
600 cachedSetTimeout = defaultSetTimout;
601 }
602 try {
603 if (typeof clearTimeout === 'function') {
604 cachedClearTimeout = clearTimeout;
605 } else {
606 cachedClearTimeout = defaultClearTimeout;
607 }
608 } catch (e) {
609 cachedClearTimeout = defaultClearTimeout;
610 }
611} ())
612function runTimeout(fun) {
613 if (cachedSetTimeout === setTimeout) {
614 //normal enviroments in sane situations
615 return setTimeout(fun, 0);
616 }
617 // if setTimeout wasn't available but was latter defined
618 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
619 cachedSetTimeout = setTimeout;
620 return setTimeout(fun, 0);
621 }
622 try {
623 // when when somebody has screwed with setTimeout but no I.E. maddness
624 return cachedSetTimeout(fun, 0);
625 } catch(e){
626 try {
627 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
628 return cachedSetTimeout.call(null, fun, 0);
629 } catch(e){
630 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
631 return cachedSetTimeout.call(this, fun, 0);
632 }
633 }
634
635
636}
637function runClearTimeout(marker) {
638 if (cachedClearTimeout === clearTimeout) {
639 //normal enviroments in sane situations
640 return clearTimeout(marker);
641 }
642 // if clearTimeout wasn't available but was latter defined
643 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
644 cachedClearTimeout = clearTimeout;
645 return clearTimeout(marker);
646 }
647 try {
648 // when when somebody has screwed with setTimeout but no I.E. maddness
649 return cachedClearTimeout(marker);
650 } catch (e){
651 try {
652 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
653 return cachedClearTimeout.call(null, marker);
654 } catch (e){
655 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
656 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
657 return cachedClearTimeout.call(this, marker);
658 }
659 }
660
661
662
663}
664var queue = [];
665var draining = false;
666var currentQueue;
667var queueIndex = -1;
668
669function cleanUpNextTick() {
670 if (!draining || !currentQueue) {
671 return;
672 }
673 draining = false;
674 if (currentQueue.length) {
675 queue = currentQueue.concat(queue);
676 } else {
677 queueIndex = -1;
678 }
679 if (queue.length) {
680 drainQueue();
681 }
682}
683
684function drainQueue() {
685 if (draining) {
686 return;
687 }
688 var timeout = runTimeout(cleanUpNextTick);
689 draining = true;
690
691 var len = queue.length;
692 while(len) {
693 currentQueue = queue;
694 queue = [];
695 while (++queueIndex < len) {
696 if (currentQueue) {
697 currentQueue[queueIndex].run();
698 }
699 }
700 queueIndex = -1;
701 len = queue.length;
702 }
703 currentQueue = null;
704 draining = false;
705 runClearTimeout(timeout);
706}
707
708process.nextTick = function (fun) {
709 var args = new Array(arguments.length - 1);
710 if (arguments.length > 1) {
711 for (var i = 1; i < arguments.length; i++) {
712 args[i - 1] = arguments[i];
713 }
714 }
715 queue.push(new Item(fun, args));
716 if (queue.length === 1 && !draining) {
717 runTimeout(drainQueue);
718 }
719};
720
721// v8 likes predictible objects
722function Item(fun, array) {
723 this.fun = fun;
724 this.array = array;
725}
726Item.prototype.run = function () {
727 this.fun.apply(null, this.array);
728};
729process.title = 'browser';
730process.browser = true;
731process.env = {};
732process.argv = [];
733process.version = ''; // empty string to avoid regexp issues
734process.versions = {};
735
736function noop() {}
737
738process.on = noop;
739process.addListener = noop;
740process.once = noop;
741process.off = noop;
742process.removeListener = noop;
743process.removeAllListeners = noop;
744process.emit = noop;
745process.prependListener = noop;
746process.prependOnceListener = noop;
747
748process.listeners = function (name) { return [] }
749
750process.binding = function (name) {
751 throw new Error('process.binding is not supported');
752};
753
754process.cwd = function () { return '/' };
755process.chdir = function (dir) {
756 throw new Error('process.chdir is not supported');
757};
758process.umask = function() { return 0; };
759
760
761/***/ }),
762/* 20 */
763/***/ (function(module, exports) {
764
765//! moment.js
766
767;(function (global, factory) {
768 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
769 typeof define === 'function' && define.amd ? define(factory) :
770 global.moment = factory()
771}(this, (function () { 'use strict';
772
773 var hookCallback;
774
775 function hooks () {
776 return hookCallback.apply(null, arguments);
777 }
778
779 // This is done to register the method called with moment()
780 // without creating circular dependencies.
781 function setHookCallback (callback) {
782 hookCallback = callback;
783 }
784
785 function isArray(input) {
786 return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
787 }
788
789 function isObject(input) {
790 // IE8 will treat undefined and null as object if it wasn't for
791 // input != null
792 return input != null && Object.prototype.toString.call(input) === '[object Object]';
793 }
794
795 function isObjectEmpty(obj) {
796 if (Object.getOwnPropertyNames) {
797 return (Object.getOwnPropertyNames(obj).length === 0);
798 } else {
799 var k;
800 for (k in obj) {
801 if (obj.hasOwnProperty(k)) {
802 return false;
803 }
804 }
805 return true;
806 }
807 }
808
809 function isUndefined(input) {
810 return input === void 0;
811 }
812
813 function isNumber(input) {
814 return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
815 }
816
817 function isDate(input) {
818 return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
819 }
820
821 function map(arr, fn) {
822 var res = [], i;
823 for (i = 0; i < arr.length; ++i) {
824 res.push(fn(arr[i], i));
825 }
826 return res;
827 }
828
829 function hasOwnProp(a, b) {
830 return Object.prototype.hasOwnProperty.call(a, b);
831 }
832
833 function extend(a, b) {
834 for (var i in b) {
835 if (hasOwnProp(b, i)) {
836 a[i] = b[i];
837 }
838 }
839
840 if (hasOwnProp(b, 'toString')) {
841 a.toString = b.toString;
842 }
843
844 if (hasOwnProp(b, 'valueOf')) {
845 a.valueOf = b.valueOf;
846 }
847
848 return a;
849 }
850
851 function createUTC (input, format, locale, strict) {
852 return createLocalOrUTC(input, format, locale, strict, true).utc();
853 }
854
855 function defaultParsingFlags() {
856 // We need to deep clone this object.
857 return {
858 empty : false,
859 unusedTokens : [],
860 unusedInput : [],
861 overflow : -2,
862 charsLeftOver : 0,
863 nullInput : false,
864 invalidMonth : null,
865 invalidFormat : false,
866 userInvalidated : false,
867 iso : false,
868 parsedDateParts : [],
869 meridiem : null,
870 rfc2822 : false,
871 weekdayMismatch : false
872 };
873 }
874
875 function getParsingFlags(m) {
876 if (m._pf == null) {
877 m._pf = defaultParsingFlags();
878 }
879 return m._pf;
880 }
881
882 var some;
883 if (Array.prototype.some) {
884 some = Array.prototype.some;
885 } else {
886 some = function (fun) {
887 var t = Object(this);
888 var len = t.length >>> 0;
889
890 for (var i = 0; i < len; i++) {
891 if (i in t && fun.call(this, t[i], i, t)) {
892 return true;
893 }
894 }
895
896 return false;
897 };
898 }
899
900 function isValid(m) {
901 if (m._isValid == null) {
902 var flags = getParsingFlags(m);
903 var parsedParts = some.call(flags.parsedDateParts, function (i) {
904 return i != null;
905 });
906 var isNowValid = !isNaN(m._d.getTime()) &&
907 flags.overflow < 0 &&
908 !flags.empty &&
909 !flags.invalidMonth &&
910 !flags.invalidWeekday &&
911 !flags.weekdayMismatch &&
912 !flags.nullInput &&
913 !flags.invalidFormat &&
914 !flags.userInvalidated &&
915 (!flags.meridiem || (flags.meridiem && parsedParts));
916
917 if (m._strict) {
918 isNowValid = isNowValid &&
919 flags.charsLeftOver === 0 &&
920 flags.unusedTokens.length === 0 &&
921 flags.bigHour === undefined;
922 }
923
924 if (Object.isFrozen == null || !Object.isFrozen(m)) {
925 m._isValid = isNowValid;
926 }
927 else {
928 return isNowValid;
929 }
930 }
931 return m._isValid;
932 }
933
934 function createInvalid (flags) {
935 var m = createUTC(NaN);
936 if (flags != null) {
937 extend(getParsingFlags(m), flags);
938 }
939 else {
940 getParsingFlags(m).userInvalidated = true;
941 }
942
943 return m;
944 }
945
946 // Plugins that add properties should also add the key here (null value),
947 // so we can properly clone ourselves.
948 var momentProperties = hooks.momentProperties = [];
949
950 function copyConfig(to, from) {
951 var i, prop, val;
952
953 if (!isUndefined(from._isAMomentObject)) {
954 to._isAMomentObject = from._isAMomentObject;
955 }
956 if (!isUndefined(from._i)) {
957 to._i = from._i;
958 }
959 if (!isUndefined(from._f)) {
960 to._f = from._f;
961 }
962 if (!isUndefined(from._l)) {
963 to._l = from._l;
964 }
965 if (!isUndefined(from._strict)) {
966 to._strict = from._strict;
967 }
968 if (!isUndefined(from._tzm)) {
969 to._tzm = from._tzm;
970 }
971 if (!isUndefined(from._isUTC)) {
972 to._isUTC = from._isUTC;
973 }
974 if (!isUndefined(from._offset)) {
975 to._offset = from._offset;
976 }
977 if (!isUndefined(from._pf)) {
978 to._pf = getParsingFlags(from);
979 }
980 if (!isUndefined(from._locale)) {
981 to._locale = from._locale;
982 }
983
984 if (momentProperties.length > 0) {
985 for (i = 0; i < momentProperties.length; i++) {
986 prop = momentProperties[i];
987 val = from[prop];
988 if (!isUndefined(val)) {
989 to[prop] = val;
990 }
991 }
992 }
993
994 return to;
995 }
996
997 var updateInProgress = false;
998
999 // Moment prototype object
1000 function Moment(config) {
1001 copyConfig(this, config);
1002 this._d = new Date(config._d != null ? config._d.getTime() : NaN);
1003 if (!this.isValid()) {
1004 this._d = new Date(NaN);
1005 }
1006 // Prevent infinite loop in case updateOffset creates new moment
1007 // objects.
1008 if (updateInProgress === false) {
1009 updateInProgress = true;
1010 hooks.updateOffset(this);
1011 updateInProgress = false;
1012 }
1013 }
1014
1015 function isMoment (obj) {
1016 return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
1017 }
1018
1019 function absFloor (number) {
1020 if (number < 0) {
1021 // -0 -> 0
1022 return Math.ceil(number) || 0;
1023 } else {
1024 return Math.floor(number);
1025 }
1026 }
1027
1028 function toInt(argumentForCoercion) {
1029 var coercedNumber = +argumentForCoercion,
1030 value = 0;
1031
1032 if (coercedNumber !== 0 && isFinite(coercedNumber)) {
1033 value = absFloor(coercedNumber);
1034 }
1035
1036 return value;
1037 }
1038
1039 // compare two arrays, return the number of differences
1040 function compareArrays(array1, array2, dontConvert) {
1041 var len = Math.min(array1.length, array2.length),
1042 lengthDiff = Math.abs(array1.length - array2.length),
1043 diffs = 0,
1044 i;
1045 for (i = 0; i < len; i++) {
1046 if ((dontConvert && array1[i] !== array2[i]) ||
1047 (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
1048 diffs++;
1049 }
1050 }
1051 return diffs + lengthDiff;
1052 }
1053
1054 function warn(msg) {
1055 if (hooks.suppressDeprecationWarnings === false &&
1056 (typeof console !== 'undefined') && console.warn) {
1057 console.warn('Deprecation warning: ' + msg);
1058 }
1059 }
1060
1061 function deprecate(msg, fn) {
1062 var firstTime = true;
1063
1064 return extend(function () {
1065 if (hooks.deprecationHandler != null) {
1066 hooks.deprecationHandler(null, msg);
1067 }
1068 if (firstTime) {
1069 var args = [];
1070 var arg;
1071 for (var i = 0; i < arguments.length; i++) {
1072 arg = '';
1073 if (typeof arguments[i] === 'object') {
1074 arg += '\n[' + i + '] ';
1075 for (var key in arguments[0]) {
1076 arg += key + ': ' + arguments[0][key] + ', ';
1077 }
1078 arg = arg.slice(0, -2); // Remove trailing comma and space
1079 } else {
1080 arg = arguments[i];
1081 }
1082 args.push(arg);
1083 }
1084 warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
1085 firstTime = false;
1086 }
1087 return fn.apply(this, arguments);
1088 }, fn);
1089 }
1090
1091 var deprecations = {};
1092
1093 function deprecateSimple(name, msg) {
1094 if (hooks.deprecationHandler != null) {
1095 hooks.deprecationHandler(name, msg);
1096 }
1097 if (!deprecations[name]) {
1098 warn(msg);
1099 deprecations[name] = true;
1100 }
1101 }
1102
1103 hooks.suppressDeprecationWarnings = false;
1104 hooks.deprecationHandler = null;
1105
1106 function isFunction(input) {
1107 return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
1108 }
1109
1110 function set (config) {
1111 var prop, i;
1112 for (i in config) {
1113 prop = config[i];
1114 if (isFunction(prop)) {
1115 this[i] = prop;
1116 } else {
1117 this['_' + i] = prop;
1118 }
1119 }
1120 this._config = config;
1121 // Lenient ordinal parsing accepts just a number in addition to
1122 // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
1123 // TODO: Remove "ordinalParse" fallback in next major release.
1124 this._dayOfMonthOrdinalParseLenient = new RegExp(
1125 (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
1126 '|' + (/\d{1,2}/).source);
1127 }
1128
1129 function mergeConfigs(parentConfig, childConfig) {
1130 var res = extend({}, parentConfig), prop;
1131 for (prop in childConfig) {
1132 if (hasOwnProp(childConfig, prop)) {
1133 if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
1134 res[prop] = {};
1135 extend(res[prop], parentConfig[prop]);
1136 extend(res[prop], childConfig[prop]);
1137 } else if (childConfig[prop] != null) {
1138 res[prop] = childConfig[prop];
1139 } else {
1140 delete res[prop];
1141 }
1142 }
1143 }
1144 for (prop in parentConfig) {
1145 if (hasOwnProp(parentConfig, prop) &&
1146 !hasOwnProp(childConfig, prop) &&
1147 isObject(parentConfig[prop])) {
1148 // make sure changes to properties don't modify parent config
1149 res[prop] = extend({}, res[prop]);
1150 }
1151 }
1152 return res;
1153 }
1154
1155 function Locale(config) {
1156 if (config != null) {
1157 this.set(config);
1158 }
1159 }
1160
1161 var keys;
1162
1163 if (Object.keys) {
1164 keys = Object.keys;
1165 } else {
1166 keys = function (obj) {
1167 var i, res = [];
1168 for (i in obj) {
1169 if (hasOwnProp(obj, i)) {
1170 res.push(i);
1171 }
1172 }
1173 return res;
1174 };
1175 }
1176
1177 var defaultCalendar = {
1178 sameDay : '[Today at] LT',
1179 nextDay : '[Tomorrow at] LT',
1180 nextWeek : 'dddd [at] LT',
1181 lastDay : '[Yesterday at] LT',
1182 lastWeek : '[Last] dddd [at] LT',
1183 sameElse : 'L'
1184 };
1185
1186 function calendar (key, mom, now) {
1187 var output = this._calendar[key] || this._calendar['sameElse'];
1188 return isFunction(output) ? output.call(mom, now) : output;
1189 }
1190
1191 var defaultLongDateFormat = {
1192 LTS : 'h:mm:ss A',
1193 LT : 'h:mm A',
1194 L : 'MM/DD/YYYY',
1195 LL : 'MMMM D, YYYY',
1196 LLL : 'MMMM D, YYYY h:mm A',
1197 LLLL : 'dddd, MMMM D, YYYY h:mm A'
1198 };
1199
1200 function longDateFormat (key) {
1201 var format = this._longDateFormat[key],
1202 formatUpper = this._longDateFormat[key.toUpperCase()];
1203
1204 if (format || !formatUpper) {
1205 return format;
1206 }
1207
1208 this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
1209 return val.slice(1);
1210 });
1211
1212 return this._longDateFormat[key];
1213 }
1214
1215 var defaultInvalidDate = 'Invalid date';
1216
1217 function invalidDate () {
1218 return this._invalidDate;
1219 }
1220
1221 var defaultOrdinal = '%d';
1222 var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
1223
1224 function ordinal (number) {
1225 return this._ordinal.replace('%d', number);
1226 }
1227
1228 var defaultRelativeTime = {
1229 future : 'in %s',
1230 past : '%s ago',
1231 s : 'a few seconds',
1232 ss : '%d seconds',
1233 m : 'a minute',
1234 mm : '%d minutes',
1235 h : 'an hour',
1236 hh : '%d hours',
1237 d : 'a day',
1238 dd : '%d days',
1239 M : 'a month',
1240 MM : '%d months',
1241 y : 'a year',
1242 yy : '%d years'
1243 };
1244
1245 function relativeTime (number, withoutSuffix, string, isFuture) {
1246 var output = this._relativeTime[string];
1247 return (isFunction(output)) ?
1248 output(number, withoutSuffix, string, isFuture) :
1249 output.replace(/%d/i, number);
1250 }
1251
1252 function pastFuture (diff, output) {
1253 var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
1254 return isFunction(format) ? format(output) : format.replace(/%s/i, output);
1255 }
1256
1257 var aliases = {};
1258
1259 function addUnitAlias (unit, shorthand) {
1260 var lowerCase = unit.toLowerCase();
1261 aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
1262 }
1263
1264 function normalizeUnits(units) {
1265 return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
1266 }
1267
1268 function normalizeObjectUnits(inputObject) {
1269 var normalizedInput = {},
1270 normalizedProp,
1271 prop;
1272
1273 for (prop in inputObject) {
1274 if (hasOwnProp(inputObject, prop)) {
1275 normalizedProp = normalizeUnits(prop);
1276 if (normalizedProp) {
1277 normalizedInput[normalizedProp] = inputObject[prop];
1278 }
1279 }
1280 }
1281
1282 return normalizedInput;
1283 }
1284
1285 var priorities = {};
1286
1287 function addUnitPriority(unit, priority) {
1288 priorities[unit] = priority;
1289 }
1290
1291 function getPrioritizedUnits(unitsObj) {
1292 var units = [];
1293 for (var u in unitsObj) {
1294 units.push({unit: u, priority: priorities[u]});
1295 }
1296 units.sort(function (a, b) {
1297 return a.priority - b.priority;
1298 });
1299 return units;
1300 }
1301
1302 function zeroFill(number, targetLength, forceSign) {
1303 var absNumber = '' + Math.abs(number),
1304 zerosToFill = targetLength - absNumber.length,
1305 sign = number >= 0;
1306 return (sign ? (forceSign ? '+' : '') : '-') +
1307 Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
1308 }
1309
1310 var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
1311
1312 var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
1313
1314 var formatFunctions = {};
1315
1316 var formatTokenFunctions = {};
1317
1318 // token: 'M'
1319 // padded: ['MM', 2]
1320 // ordinal: 'Mo'
1321 // callback: function () { this.month() + 1 }
1322 function addFormatToken (token, padded, ordinal, callback) {
1323 var func = callback;
1324 if (typeof callback === 'string') {
1325 func = function () {
1326 return this[callback]();
1327 };
1328 }
1329 if (token) {
1330 formatTokenFunctions[token] = func;
1331 }
1332 if (padded) {
1333 formatTokenFunctions[padded[0]] = function () {
1334 return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
1335 };
1336 }
1337 if (ordinal) {
1338 formatTokenFunctions[ordinal] = function () {
1339 return this.localeData().ordinal(func.apply(this, arguments), token);
1340 };
1341 }
1342 }
1343
1344 function removeFormattingTokens(input) {
1345 if (input.match(/\[[\s\S]/)) {
1346 return input.replace(/^\[|\]$/g, '');
1347 }
1348 return input.replace(/\\/g, '');
1349 }
1350
1351 function makeFormatFunction(format) {
1352 var array = format.match(formattingTokens), i, length;
1353
1354 for (i = 0, length = array.length; i < length; i++) {
1355 if (formatTokenFunctions[array[i]]) {
1356 array[i] = formatTokenFunctions[array[i]];
1357 } else {
1358 array[i] = removeFormattingTokens(array[i]);
1359 }
1360 }
1361
1362 return function (mom) {
1363 var output = '', i;
1364 for (i = 0; i < length; i++) {
1365 output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
1366 }
1367 return output;
1368 };
1369 }
1370
1371 // format date using native date object
1372 function formatMoment(m, format) {
1373 if (!m.isValid()) {
1374 return m.localeData().invalidDate();
1375 }
1376
1377 format = expandFormat(format, m.localeData());
1378 formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
1379
1380 return formatFunctions[format](m);
1381 }
1382
1383 function expandFormat(format, locale) {
1384 var i = 5;
1385
1386 function replaceLongDateFormatTokens(input) {
1387 return locale.longDateFormat(input) || input;
1388 }
1389
1390 localFormattingTokens.lastIndex = 0;
1391 while (i >= 0 && localFormattingTokens.test(format)) {
1392 format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
1393 localFormattingTokens.lastIndex = 0;
1394 i -= 1;
1395 }
1396
1397 return format;
1398 }
1399
1400 var match1 = /\d/; // 0 - 9
1401 var match2 = /\d\d/; // 00 - 99
1402 var match3 = /\d{3}/; // 000 - 999
1403 var match4 = /\d{4}/; // 0000 - 9999
1404 var match6 = /[+-]?\d{6}/; // -999999 - 999999
1405 var match1to2 = /\d\d?/; // 0 - 99
1406 var match3to4 = /\d\d\d\d?/; // 999 - 9999
1407 var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
1408 var match1to3 = /\d{1,3}/; // 0 - 999
1409 var match1to4 = /\d{1,4}/; // 0 - 9999
1410 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
1411
1412 var matchUnsigned = /\d+/; // 0 - inf
1413 var matchSigned = /[+-]?\d+/; // -inf - inf
1414
1415 var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
1416 var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
1417
1418 var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
1419
1420 // any word (or two) characters or numbers including two/three word month in arabic.
1421 // includes scottish gaelic two word and hyphenated months
1422 var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
1423
1424 var regexes = {};
1425
1426 function addRegexToken (token, regex, strictRegex) {
1427 regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
1428 return (isStrict && strictRegex) ? strictRegex : regex;
1429 };
1430 }
1431
1432 function getParseRegexForToken (token, config) {
1433 if (!hasOwnProp(regexes, token)) {
1434 return new RegExp(unescapeFormat(token));
1435 }
1436
1437 return regexes[token](config._strict, config._locale);
1438 }
1439
1440 // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
1441 function unescapeFormat(s) {
1442 return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
1443 return p1 || p2 || p3 || p4;
1444 }));
1445 }
1446
1447 function regexEscape(s) {
1448 return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
1449 }
1450
1451 var tokens = {};
1452
1453 function addParseToken (token, callback) {
1454 var i, func = callback;
1455 if (typeof token === 'string') {
1456 token = [token];
1457 }
1458 if (isNumber(callback)) {
1459 func = function (input, array) {
1460 array[callback] = toInt(input);
1461 };
1462 }
1463 for (i = 0; i < token.length; i++) {
1464 tokens[token[i]] = func;
1465 }
1466 }
1467
1468 function addWeekParseToken (token, callback) {
1469 addParseToken(token, function (input, array, config, token) {
1470 config._w = config._w || {};
1471 callback(input, config._w, config, token);
1472 });
1473 }
1474
1475 function addTimeToArrayFromToken(token, input, config) {
1476 if (input != null && hasOwnProp(tokens, token)) {
1477 tokens[token](input, config._a, config, token);
1478 }
1479 }
1480
1481 var YEAR = 0;
1482 var MONTH = 1;
1483 var DATE = 2;
1484 var HOUR = 3;
1485 var MINUTE = 4;
1486 var SECOND = 5;
1487 var MILLISECOND = 6;
1488 var WEEK = 7;
1489 var WEEKDAY = 8;
1490
1491 // FORMATTING
1492
1493 addFormatToken('Y', 0, 0, function () {
1494 var y = this.year();
1495 return y <= 9999 ? '' + y : '+' + y;
1496 });
1497
1498 addFormatToken(0, ['YY', 2], 0, function () {
1499 return this.year() % 100;
1500 });
1501
1502 addFormatToken(0, ['YYYY', 4], 0, 'year');
1503 addFormatToken(0, ['YYYYY', 5], 0, 'year');
1504 addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
1505
1506 // ALIASES
1507
1508 addUnitAlias('year', 'y');
1509
1510 // PRIORITIES
1511
1512 addUnitPriority('year', 1);
1513
1514 // PARSING
1515
1516 addRegexToken('Y', matchSigned);
1517 addRegexToken('YY', match1to2, match2);
1518 addRegexToken('YYYY', match1to4, match4);
1519 addRegexToken('YYYYY', match1to6, match6);
1520 addRegexToken('YYYYYY', match1to6, match6);
1521
1522 addParseToken(['YYYYY', 'YYYYYY'], YEAR);
1523 addParseToken('YYYY', function (input, array) {
1524 array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
1525 });
1526 addParseToken('YY', function (input, array) {
1527 array[YEAR] = hooks.parseTwoDigitYear(input);
1528 });
1529 addParseToken('Y', function (input, array) {
1530 array[YEAR] = parseInt(input, 10);
1531 });
1532
1533 // HELPERS
1534
1535 function daysInYear(year) {
1536 return isLeapYear(year) ? 366 : 365;
1537 }
1538
1539 function isLeapYear(year) {
1540 return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
1541 }
1542
1543 // HOOKS
1544
1545 hooks.parseTwoDigitYear = function (input) {
1546 return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
1547 };
1548
1549 // MOMENTS
1550
1551 var getSetYear = makeGetSet('FullYear', true);
1552
1553 function getIsLeapYear () {
1554 return isLeapYear(this.year());
1555 }
1556
1557 function makeGetSet (unit, keepTime) {
1558 return function (value) {
1559 if (value != null) {
1560 set$1(this, unit, value);
1561 hooks.updateOffset(this, keepTime);
1562 return this;
1563 } else {
1564 return get(this, unit);
1565 }
1566 };
1567 }
1568
1569 function get (mom, unit) {
1570 return mom.isValid() ?
1571 mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
1572 }
1573
1574 function set$1 (mom, unit, value) {
1575 if (mom.isValid() && !isNaN(value)) {
1576 if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
1577 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
1578 }
1579 else {
1580 mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
1581 }
1582 }
1583 }
1584
1585 // MOMENTS
1586
1587 function stringGet (units) {
1588 units = normalizeUnits(units);
1589 if (isFunction(this[units])) {
1590 return this[units]();
1591 }
1592 return this;
1593 }
1594
1595
1596 function stringSet (units, value) {
1597 if (typeof units === 'object') {
1598 units = normalizeObjectUnits(units);
1599 var prioritized = getPrioritizedUnits(units);
1600 for (var i = 0; i < prioritized.length; i++) {
1601 this[prioritized[i].unit](units[prioritized[i].unit]);
1602 }
1603 } else {
1604 units = normalizeUnits(units);
1605 if (isFunction(this[units])) {
1606 return this[units](value);
1607 }
1608 }
1609 return this;
1610 }
1611
1612 function mod(n, x) {
1613 return ((n % x) + x) % x;
1614 }
1615
1616 var indexOf;
1617
1618 if (Array.prototype.indexOf) {
1619 indexOf = Array.prototype.indexOf;
1620 } else {
1621 indexOf = function (o) {
1622 // I know
1623 var i;
1624 for (i = 0; i < this.length; ++i) {
1625 if (this[i] === o) {
1626 return i;
1627 }
1628 }
1629 return -1;
1630 };
1631 }
1632
1633 function daysInMonth(year, month) {
1634 if (isNaN(year) || isNaN(month)) {
1635 return NaN;
1636 }
1637 var modMonth = mod(month, 12);
1638 year += (month - modMonth) / 12;
1639 return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2);
1640 }
1641
1642 // FORMATTING
1643
1644 addFormatToken('M', ['MM', 2], 'Mo', function () {
1645 return this.month() + 1;
1646 });
1647
1648 addFormatToken('MMM', 0, 0, function (format) {
1649 return this.localeData().monthsShort(this, format);
1650 });
1651
1652 addFormatToken('MMMM', 0, 0, function (format) {
1653 return this.localeData().months(this, format);
1654 });
1655
1656 // ALIASES
1657
1658 addUnitAlias('month', 'M');
1659
1660 // PRIORITY
1661
1662 addUnitPriority('month', 8);
1663
1664 // PARSING
1665
1666 addRegexToken('M', match1to2);
1667 addRegexToken('MM', match1to2, match2);
1668 addRegexToken('MMM', function (isStrict, locale) {
1669 return locale.monthsShortRegex(isStrict);
1670 });
1671 addRegexToken('MMMM', function (isStrict, locale) {
1672 return locale.monthsRegex(isStrict);
1673 });
1674
1675 addParseToken(['M', 'MM'], function (input, array) {
1676 array[MONTH] = toInt(input) - 1;
1677 });
1678
1679 addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
1680 var month = config._locale.monthsParse(input, token, config._strict);
1681 // if we didn't find a month name, mark the date as invalid.
1682 if (month != null) {
1683 array[MONTH] = month;
1684 } else {
1685 getParsingFlags(config).invalidMonth = input;
1686 }
1687 });
1688
1689 // LOCALES
1690
1691 var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
1692 var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
1693 function localeMonths (m, format) {
1694 if (!m) {
1695 return isArray(this._months) ? this._months :
1696 this._months['standalone'];
1697 }
1698 return isArray(this._months) ? this._months[m.month()] :
1699 this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
1700 }
1701
1702 var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
1703 function localeMonthsShort (m, format) {
1704 if (!m) {
1705 return isArray(this._monthsShort) ? this._monthsShort :
1706 this._monthsShort['standalone'];
1707 }
1708 return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
1709 this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
1710 }
1711
1712 function handleStrictParse(monthName, format, strict) {
1713 var i, ii, mom, llc = monthName.toLocaleLowerCase();
1714 if (!this._monthsParse) {
1715 // this is not used
1716 this._monthsParse = [];
1717 this._longMonthsParse = [];
1718 this._shortMonthsParse = [];
1719 for (i = 0; i < 12; ++i) {
1720 mom = createUTC([2000, i]);
1721 this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
1722 this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
1723 }
1724 }
1725
1726 if (strict) {
1727 if (format === 'MMM') {
1728 ii = indexOf.call(this._shortMonthsParse, llc);
1729 return ii !== -1 ? ii : null;
1730 } else {
1731 ii = indexOf.call(this._longMonthsParse, llc);
1732 return ii !== -1 ? ii : null;
1733 }
1734 } else {
1735 if (format === 'MMM') {
1736 ii = indexOf.call(this._shortMonthsParse, llc);
1737 if (ii !== -1) {
1738 return ii;
1739 }
1740 ii = indexOf.call(this._longMonthsParse, llc);
1741 return ii !== -1 ? ii : null;
1742 } else {
1743 ii = indexOf.call(this._longMonthsParse, llc);
1744 if (ii !== -1) {
1745 return ii;
1746 }
1747 ii = indexOf.call(this._shortMonthsParse, llc);
1748 return ii !== -1 ? ii : null;
1749 }
1750 }
1751 }
1752
1753 function localeMonthsParse (monthName, format, strict) {
1754 var i, mom, regex;
1755
1756 if (this._monthsParseExact) {
1757 return handleStrictParse.call(this, monthName, format, strict);
1758 }
1759
1760 if (!this._monthsParse) {
1761 this._monthsParse = [];
1762 this._longMonthsParse = [];
1763 this._shortMonthsParse = [];
1764 }
1765
1766 // TODO: add sorting
1767 // Sorting makes sure if one month (or abbr) is a prefix of another
1768 // see sorting in computeMonthsParse
1769 for (i = 0; i < 12; i++) {
1770 // make the regex if we don't have it already
1771 mom = createUTC([2000, i]);
1772 if (strict && !this._longMonthsParse[i]) {
1773 this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
1774 this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
1775 }
1776 if (!strict && !this._monthsParse[i]) {
1777 regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
1778 this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
1779 }
1780 // test the regex
1781 if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
1782 return i;
1783 } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
1784 return i;
1785 } else if (!strict && this._monthsParse[i].test(monthName)) {
1786 return i;
1787 }
1788 }
1789 }
1790
1791 // MOMENTS
1792
1793 function setMonth (mom, value) {
1794 var dayOfMonth;
1795
1796 if (!mom.isValid()) {
1797 // No op
1798 return mom;
1799 }
1800
1801 if (typeof value === 'string') {
1802 if (/^\d+$/.test(value)) {
1803 value = toInt(value);
1804 } else {
1805 value = mom.localeData().monthsParse(value);
1806 // TODO: Another silent failure?
1807 if (!isNumber(value)) {
1808 return mom;
1809 }
1810 }
1811 }
1812
1813 dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
1814 mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
1815 return mom;
1816 }
1817
1818 function getSetMonth (value) {
1819 if (value != null) {
1820 setMonth(this, value);
1821 hooks.updateOffset(this, true);
1822 return this;
1823 } else {
1824 return get(this, 'Month');
1825 }
1826 }
1827
1828 function getDaysInMonth () {
1829 return daysInMonth(this.year(), this.month());
1830 }
1831
1832 var defaultMonthsShortRegex = matchWord;
1833 function monthsShortRegex (isStrict) {
1834 if (this._monthsParseExact) {
1835 if (!hasOwnProp(this, '_monthsRegex')) {
1836 computeMonthsParse.call(this);
1837 }
1838 if (isStrict) {
1839 return this._monthsShortStrictRegex;
1840 } else {
1841 return this._monthsShortRegex;
1842 }
1843 } else {
1844 if (!hasOwnProp(this, '_monthsShortRegex')) {
1845 this._monthsShortRegex = defaultMonthsShortRegex;
1846 }
1847 return this._monthsShortStrictRegex && isStrict ?
1848 this._monthsShortStrictRegex : this._monthsShortRegex;
1849 }
1850 }
1851
1852 var defaultMonthsRegex = matchWord;
1853 function monthsRegex (isStrict) {
1854 if (this._monthsParseExact) {
1855 if (!hasOwnProp(this, '_monthsRegex')) {
1856 computeMonthsParse.call(this);
1857 }
1858 if (isStrict) {
1859 return this._monthsStrictRegex;
1860 } else {
1861 return this._monthsRegex;
1862 }
1863 } else {
1864 if (!hasOwnProp(this, '_monthsRegex')) {
1865 this._monthsRegex = defaultMonthsRegex;
1866 }
1867 return this._monthsStrictRegex && isStrict ?
1868 this._monthsStrictRegex : this._monthsRegex;
1869 }
1870 }
1871
1872 function computeMonthsParse () {
1873 function cmpLenRev(a, b) {
1874 return b.length - a.length;
1875 }
1876
1877 var shortPieces = [], longPieces = [], mixedPieces = [],
1878 i, mom;
1879 for (i = 0; i < 12; i++) {
1880 // make the regex if we don't have it already
1881 mom = createUTC([2000, i]);
1882 shortPieces.push(this.monthsShort(mom, ''));
1883 longPieces.push(this.months(mom, ''));
1884 mixedPieces.push(this.months(mom, ''));
1885 mixedPieces.push(this.monthsShort(mom, ''));
1886 }
1887 // Sorting makes sure if one month (or abbr) is a prefix of another it
1888 // will match the longer piece.
1889 shortPieces.sort(cmpLenRev);
1890 longPieces.sort(cmpLenRev);
1891 mixedPieces.sort(cmpLenRev);
1892 for (i = 0; i < 12; i++) {
1893 shortPieces[i] = regexEscape(shortPieces[i]);
1894 longPieces[i] = regexEscape(longPieces[i]);
1895 }
1896 for (i = 0; i < 24; i++) {
1897 mixedPieces[i] = regexEscape(mixedPieces[i]);
1898 }
1899
1900 this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
1901 this._monthsShortRegex = this._monthsRegex;
1902 this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
1903 this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
1904 }
1905
1906 function createDate (y, m, d, h, M, s, ms) {
1907 // can't just apply() to create a date:
1908 // https://stackoverflow.com/q/181348
1909 var date;
1910 // the date constructor remaps years 0-99 to 1900-1999
1911 if (y < 100 && y >= 0) {
1912 // preserve leap years using a full 400 year cycle, then reset
1913 date = new Date(y + 400, m, d, h, M, s, ms);
1914 if (isFinite(date.getFullYear())) {
1915 date.setFullYear(y);
1916 }
1917 } else {
1918 date = new Date(y, m, d, h, M, s, ms);
1919 }
1920
1921 return date;
1922 }
1923
1924 function createUTCDate (y) {
1925 var date;
1926 // the Date.UTC function remaps years 0-99 to 1900-1999
1927 if (y < 100 && y >= 0) {
1928 var args = Array.prototype.slice.call(arguments);
1929 // preserve leap years using a full 400 year cycle, then reset
1930 args[0] = y + 400;
1931 date = new Date(Date.UTC.apply(null, args));
1932 if (isFinite(date.getUTCFullYear())) {
1933 date.setUTCFullYear(y);
1934 }
1935 } else {
1936 date = new Date(Date.UTC.apply(null, arguments));
1937 }
1938
1939 return date;
1940 }
1941
1942 // start-of-first-week - start-of-year
1943 function firstWeekOffset(year, dow, doy) {
1944 var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
1945 fwd = 7 + dow - doy,
1946 // first-week day local weekday -- which local weekday is fwd
1947 fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
1948
1949 return -fwdlw + fwd - 1;
1950 }
1951
1952 // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
1953 function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
1954 var localWeekday = (7 + weekday - dow) % 7,
1955 weekOffset = firstWeekOffset(year, dow, doy),
1956 dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
1957 resYear, resDayOfYear;
1958
1959 if (dayOfYear <= 0) {
1960 resYear = year - 1;
1961 resDayOfYear = daysInYear(resYear) + dayOfYear;
1962 } else if (dayOfYear > daysInYear(year)) {
1963 resYear = year + 1;
1964 resDayOfYear = dayOfYear - daysInYear(year);
1965 } else {
1966 resYear = year;
1967 resDayOfYear = dayOfYear;
1968 }
1969
1970 return {
1971 year: resYear,
1972 dayOfYear: resDayOfYear
1973 };
1974 }
1975
1976 function weekOfYear(mom, dow, doy) {
1977 var weekOffset = firstWeekOffset(mom.year(), dow, doy),
1978 week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
1979 resWeek, resYear;
1980
1981 if (week < 1) {
1982 resYear = mom.year() - 1;
1983 resWeek = week + weeksInYear(resYear, dow, doy);
1984 } else if (week > weeksInYear(mom.year(), dow, doy)) {
1985 resWeek = week - weeksInYear(mom.year(), dow, doy);
1986 resYear = mom.year() + 1;
1987 } else {
1988 resYear = mom.year();
1989 resWeek = week;
1990 }
1991
1992 return {
1993 week: resWeek,
1994 year: resYear
1995 };
1996 }
1997
1998 function weeksInYear(year, dow, doy) {
1999 var weekOffset = firstWeekOffset(year, dow, doy),
2000 weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
2001 return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
2002 }
2003
2004 // FORMATTING
2005
2006 addFormatToken('w', ['ww', 2], 'wo', 'week');
2007 addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
2008
2009 // ALIASES
2010
2011 addUnitAlias('week', 'w');
2012 addUnitAlias('isoWeek', 'W');
2013
2014 // PRIORITIES
2015
2016 addUnitPriority('week', 5);
2017 addUnitPriority('isoWeek', 5);
2018
2019 // PARSING
2020
2021 addRegexToken('w', match1to2);
2022 addRegexToken('ww', match1to2, match2);
2023 addRegexToken('W', match1to2);
2024 addRegexToken('WW', match1to2, match2);
2025
2026 addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
2027 week[token.substr(0, 1)] = toInt(input);
2028 });
2029
2030 // HELPERS
2031
2032 // LOCALES
2033
2034 function localeWeek (mom) {
2035 return weekOfYear(mom, this._week.dow, this._week.doy).week;
2036 }
2037
2038 var defaultLocaleWeek = {
2039 dow : 0, // Sunday is the first day of the week.
2040 doy : 6 // The week that contains Jan 6th is the first week of the year.
2041 };
2042
2043 function localeFirstDayOfWeek () {
2044 return this._week.dow;
2045 }
2046
2047 function localeFirstDayOfYear () {
2048 return this._week.doy;
2049 }
2050
2051 // MOMENTS
2052
2053 function getSetWeek (input) {
2054 var week = this.localeData().week(this);
2055 return input == null ? week : this.add((input - week) * 7, 'd');
2056 }
2057
2058 function getSetISOWeek (input) {
2059 var week = weekOfYear(this, 1, 4).week;
2060 return input == null ? week : this.add((input - week) * 7, 'd');
2061 }
2062
2063 // FORMATTING
2064
2065 addFormatToken('d', 0, 'do', 'day');
2066
2067 addFormatToken('dd', 0, 0, function (format) {
2068 return this.localeData().weekdaysMin(this, format);
2069 });
2070
2071 addFormatToken('ddd', 0, 0, function (format) {
2072 return this.localeData().weekdaysShort(this, format);
2073 });
2074
2075 addFormatToken('dddd', 0, 0, function (format) {
2076 return this.localeData().weekdays(this, format);
2077 });
2078
2079 addFormatToken('e', 0, 0, 'weekday');
2080 addFormatToken('E', 0, 0, 'isoWeekday');
2081
2082 // ALIASES
2083
2084 addUnitAlias('day', 'd');
2085 addUnitAlias('weekday', 'e');
2086 addUnitAlias('isoWeekday', 'E');
2087
2088 // PRIORITY
2089 addUnitPriority('day', 11);
2090 addUnitPriority('weekday', 11);
2091 addUnitPriority('isoWeekday', 11);
2092
2093 // PARSING
2094
2095 addRegexToken('d', match1to2);
2096 addRegexToken('e', match1to2);
2097 addRegexToken('E', match1to2);
2098 addRegexToken('dd', function (isStrict, locale) {
2099 return locale.weekdaysMinRegex(isStrict);
2100 });
2101 addRegexToken('ddd', function (isStrict, locale) {
2102 return locale.weekdaysShortRegex(isStrict);
2103 });
2104 addRegexToken('dddd', function (isStrict, locale) {
2105 return locale.weekdaysRegex(isStrict);
2106 });
2107
2108 addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
2109 var weekday = config._locale.weekdaysParse(input, token, config._strict);
2110 // if we didn't get a weekday name, mark the date as invalid
2111 if (weekday != null) {
2112 week.d = weekday;
2113 } else {
2114 getParsingFlags(config).invalidWeekday = input;
2115 }
2116 });
2117
2118 addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
2119 week[token] = toInt(input);
2120 });
2121
2122 // HELPERS
2123
2124 function parseWeekday(input, locale) {
2125 if (typeof input !== 'string') {
2126 return input;
2127 }
2128
2129 if (!isNaN(input)) {
2130 return parseInt(input, 10);
2131 }
2132
2133 input = locale.weekdaysParse(input);
2134 if (typeof input === 'number') {
2135 return input;
2136 }
2137
2138 return null;
2139 }
2140
2141 function parseIsoWeekday(input, locale) {
2142 if (typeof input === 'string') {
2143 return locale.weekdaysParse(input) % 7 || 7;
2144 }
2145 return isNaN(input) ? null : input;
2146 }
2147
2148 // LOCALES
2149 function shiftWeekdays (ws, n) {
2150 return ws.slice(n, 7).concat(ws.slice(0, n));
2151 }
2152
2153 var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
2154 function localeWeekdays (m, format) {
2155 var weekdays = isArray(this._weekdays) ? this._weekdays :
2156 this._weekdays[(m && m !== true && this._weekdays.isFormat.test(format)) ? 'format' : 'standalone'];
2157 return (m === true) ? shiftWeekdays(weekdays, this._week.dow)
2158 : (m) ? weekdays[m.day()] : weekdays;
2159 }
2160
2161 var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
2162 function localeWeekdaysShort (m) {
2163 return (m === true) ? shiftWeekdays(this._weekdaysShort, this._week.dow)
2164 : (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
2165 }
2166
2167 var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
2168 function localeWeekdaysMin (m) {
2169 return (m === true) ? shiftWeekdays(this._weekdaysMin, this._week.dow)
2170 : (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
2171 }
2172
2173 function handleStrictParse$1(weekdayName, format, strict) {
2174 var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
2175 if (!this._weekdaysParse) {
2176 this._weekdaysParse = [];
2177 this._shortWeekdaysParse = [];
2178 this._minWeekdaysParse = [];
2179
2180 for (i = 0; i < 7; ++i) {
2181 mom = createUTC([2000, 1]).day(i);
2182 this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
2183 this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
2184 this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
2185 }
2186 }
2187
2188 if (strict) {
2189 if (format === 'dddd') {
2190 ii = indexOf.call(this._weekdaysParse, llc);
2191 return ii !== -1 ? ii : null;
2192 } else if (format === 'ddd') {
2193 ii = indexOf.call(this._shortWeekdaysParse, llc);
2194 return ii !== -1 ? ii : null;
2195 } else {
2196 ii = indexOf.call(this._minWeekdaysParse, llc);
2197 return ii !== -1 ? ii : null;
2198 }
2199 } else {
2200 if (format === 'dddd') {
2201 ii = indexOf.call(this._weekdaysParse, llc);
2202 if (ii !== -1) {
2203 return ii;
2204 }
2205 ii = indexOf.call(this._shortWeekdaysParse, llc);
2206 if (ii !== -1) {
2207 return ii;
2208 }
2209 ii = indexOf.call(this._minWeekdaysParse, llc);
2210 return ii !== -1 ? ii : null;
2211 } else if (format === 'ddd') {
2212 ii = indexOf.call(this._shortWeekdaysParse, llc);
2213 if (ii !== -1) {
2214 return ii;
2215 }
2216 ii = indexOf.call(this._weekdaysParse, llc);
2217 if (ii !== -1) {
2218 return ii;
2219 }
2220 ii = indexOf.call(this._minWeekdaysParse, llc);
2221 return ii !== -1 ? ii : null;
2222 } else {
2223 ii = indexOf.call(this._minWeekdaysParse, llc);
2224 if (ii !== -1) {
2225 return ii;
2226 }
2227 ii = indexOf.call(this._weekdaysParse, llc);
2228 if (ii !== -1) {
2229 return ii;
2230 }
2231 ii = indexOf.call(this._shortWeekdaysParse, llc);
2232 return ii !== -1 ? ii : null;
2233 }
2234 }
2235 }
2236
2237 function localeWeekdaysParse (weekdayName, format, strict) {
2238 var i, mom, regex;
2239
2240 if (this._weekdaysParseExact) {
2241 return handleStrictParse$1.call(this, weekdayName, format, strict);
2242 }
2243
2244 if (!this._weekdaysParse) {
2245 this._weekdaysParse = [];
2246 this._minWeekdaysParse = [];
2247 this._shortWeekdaysParse = [];
2248 this._fullWeekdaysParse = [];
2249 }
2250
2251 for (i = 0; i < 7; i++) {
2252 // make the regex if we don't have it already
2253
2254 mom = createUTC([2000, 1]).day(i);
2255 if (strict && !this._fullWeekdaysParse[i]) {
2256 this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');
2257 this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');
2258 this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');
2259 }
2260 if (!this._weekdaysParse[i]) {
2261 regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
2262 this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
2263 }
2264 // test the regex
2265 if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
2266 return i;
2267 } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
2268 return i;
2269 } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
2270 return i;
2271 } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
2272 return i;
2273 }
2274 }
2275 }
2276
2277 // MOMENTS
2278
2279 function getSetDayOfWeek (input) {
2280 if (!this.isValid()) {
2281 return input != null ? this : NaN;
2282 }
2283 var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
2284 if (input != null) {
2285 input = parseWeekday(input, this.localeData());
2286 return this.add(input - day, 'd');
2287 } else {
2288 return day;
2289 }
2290 }
2291
2292 function getSetLocaleDayOfWeek (input) {
2293 if (!this.isValid()) {
2294 return input != null ? this : NaN;
2295 }
2296 var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
2297 return input == null ? weekday : this.add(input - weekday, 'd');
2298 }
2299
2300 function getSetISODayOfWeek (input) {
2301 if (!this.isValid()) {
2302 return input != null ? this : NaN;
2303 }
2304
2305 // behaves the same as moment#day except
2306 // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
2307 // as a setter, sunday should belong to the previous week.
2308
2309 if (input != null) {
2310 var weekday = parseIsoWeekday(input, this.localeData());
2311 return this.day(this.day() % 7 ? weekday : weekday - 7);
2312 } else {
2313 return this.day() || 7;
2314 }
2315 }
2316
2317 var defaultWeekdaysRegex = matchWord;
2318 function weekdaysRegex (isStrict) {
2319 if (this._weekdaysParseExact) {
2320 if (!hasOwnProp(this, '_weekdaysRegex')) {
2321 computeWeekdaysParse.call(this);
2322 }
2323 if (isStrict) {
2324 return this._weekdaysStrictRegex;
2325 } else {
2326 return this._weekdaysRegex;
2327 }
2328 } else {
2329 if (!hasOwnProp(this, '_weekdaysRegex')) {
2330 this._weekdaysRegex = defaultWeekdaysRegex;
2331 }
2332 return this._weekdaysStrictRegex && isStrict ?
2333 this._weekdaysStrictRegex : this._weekdaysRegex;
2334 }
2335 }
2336
2337 var defaultWeekdaysShortRegex = matchWord;
2338 function weekdaysShortRegex (isStrict) {
2339 if (this._weekdaysParseExact) {
2340 if (!hasOwnProp(this, '_weekdaysRegex')) {
2341 computeWeekdaysParse.call(this);
2342 }
2343 if (isStrict) {
2344 return this._weekdaysShortStrictRegex;
2345 } else {
2346 return this._weekdaysShortRegex;
2347 }
2348 } else {
2349 if (!hasOwnProp(this, '_weekdaysShortRegex')) {
2350 this._weekdaysShortRegex = defaultWeekdaysShortRegex;
2351 }
2352 return this._weekdaysShortStrictRegex && isStrict ?
2353 this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
2354 }
2355 }
2356
2357 var defaultWeekdaysMinRegex = matchWord;
2358 function weekdaysMinRegex (isStrict) {
2359 if (this._weekdaysParseExact) {
2360 if (!hasOwnProp(this, '_weekdaysRegex')) {
2361 computeWeekdaysParse.call(this);
2362 }
2363 if (isStrict) {
2364 return this._weekdaysMinStrictRegex;
2365 } else {
2366 return this._weekdaysMinRegex;
2367 }
2368 } else {
2369 if (!hasOwnProp(this, '_weekdaysMinRegex')) {
2370 this._weekdaysMinRegex = defaultWeekdaysMinRegex;
2371 }
2372 return this._weekdaysMinStrictRegex && isStrict ?
2373 this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
2374 }
2375 }
2376
2377
2378 function computeWeekdaysParse () {
2379 function cmpLenRev(a, b) {
2380 return b.length - a.length;
2381 }
2382
2383 var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
2384 i, mom, minp, shortp, longp;
2385 for (i = 0; i < 7; i++) {
2386 // make the regex if we don't have it already
2387 mom = createUTC([2000, 1]).day(i);
2388 minp = this.weekdaysMin(mom, '');
2389 shortp = this.weekdaysShort(mom, '');
2390 longp = this.weekdays(mom, '');
2391 minPieces.push(minp);
2392 shortPieces.push(shortp);
2393 longPieces.push(longp);
2394 mixedPieces.push(minp);
2395 mixedPieces.push(shortp);
2396 mixedPieces.push(longp);
2397 }
2398 // Sorting makes sure if one weekday (or abbr) is a prefix of another it
2399 // will match the longer piece.
2400 minPieces.sort(cmpLenRev);
2401 shortPieces.sort(cmpLenRev);
2402 longPieces.sort(cmpLenRev);
2403 mixedPieces.sort(cmpLenRev);
2404 for (i = 0; i < 7; i++) {
2405 shortPieces[i] = regexEscape(shortPieces[i]);
2406 longPieces[i] = regexEscape(longPieces[i]);
2407 mixedPieces[i] = regexEscape(mixedPieces[i]);
2408 }
2409
2410 this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
2411 this._weekdaysShortRegex = this._weekdaysRegex;
2412 this._weekdaysMinRegex = this._weekdaysRegex;
2413
2414 this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
2415 this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
2416 this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
2417 }
2418
2419 // FORMATTING
2420
2421 function hFormat() {
2422 return this.hours() % 12 || 12;
2423 }
2424
2425 function kFormat() {
2426 return this.hours() || 24;
2427 }
2428
2429 addFormatToken('H', ['HH', 2], 0, 'hour');
2430 addFormatToken('h', ['hh', 2], 0, hFormat);
2431 addFormatToken('k', ['kk', 2], 0, kFormat);
2432
2433 addFormatToken('hmm', 0, 0, function () {
2434 return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
2435 });
2436
2437 addFormatToken('hmmss', 0, 0, function () {
2438 return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
2439 zeroFill(this.seconds(), 2);
2440 });
2441
2442 addFormatToken('Hmm', 0, 0, function () {
2443 return '' + this.hours() + zeroFill(this.minutes(), 2);
2444 });
2445
2446 addFormatToken('Hmmss', 0, 0, function () {
2447 return '' + this.hours() + zeroFill(this.minutes(), 2) +
2448 zeroFill(this.seconds(), 2);
2449 });
2450
2451 function meridiem (token, lowercase) {
2452 addFormatToken(token, 0, 0, function () {
2453 return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
2454 });
2455 }
2456
2457 meridiem('a', true);
2458 meridiem('A', false);
2459
2460 // ALIASES
2461
2462 addUnitAlias('hour', 'h');
2463
2464 // PRIORITY
2465 addUnitPriority('hour', 13);
2466
2467 // PARSING
2468
2469 function matchMeridiem (isStrict, locale) {
2470 return locale._meridiemParse;
2471 }
2472
2473 addRegexToken('a', matchMeridiem);
2474 addRegexToken('A', matchMeridiem);
2475 addRegexToken('H', match1to2);
2476 addRegexToken('h', match1to2);
2477 addRegexToken('k', match1to2);
2478 addRegexToken('HH', match1to2, match2);
2479 addRegexToken('hh', match1to2, match2);
2480 addRegexToken('kk', match1to2, match2);
2481
2482 addRegexToken('hmm', match3to4);
2483 addRegexToken('hmmss', match5to6);
2484 addRegexToken('Hmm', match3to4);
2485 addRegexToken('Hmmss', match5to6);
2486
2487 addParseToken(['H', 'HH'], HOUR);
2488 addParseToken(['k', 'kk'], function (input, array, config) {
2489 var kInput = toInt(input);
2490 array[HOUR] = kInput === 24 ? 0 : kInput;
2491 });
2492 addParseToken(['a', 'A'], function (input, array, config) {
2493 config._isPm = config._locale.isPM(input);
2494 config._meridiem = input;
2495 });
2496 addParseToken(['h', 'hh'], function (input, array, config) {
2497 array[HOUR] = toInt(input);
2498 getParsingFlags(config).bigHour = true;
2499 });
2500 addParseToken('hmm', function (input, array, config) {
2501 var pos = input.length - 2;
2502 array[HOUR] = toInt(input.substr(0, pos));
2503 array[MINUTE] = toInt(input.substr(pos));
2504 getParsingFlags(config).bigHour = true;
2505 });
2506 addParseToken('hmmss', function (input, array, config) {
2507 var pos1 = input.length - 4;
2508 var pos2 = input.length - 2;
2509 array[HOUR] = toInt(input.substr(0, pos1));
2510 array[MINUTE] = toInt(input.substr(pos1, 2));
2511 array[SECOND] = toInt(input.substr(pos2));
2512 getParsingFlags(config).bigHour = true;
2513 });
2514 addParseToken('Hmm', function (input, array, config) {
2515 var pos = input.length - 2;
2516 array[HOUR] = toInt(input.substr(0, pos));
2517 array[MINUTE] = toInt(input.substr(pos));
2518 });
2519 addParseToken('Hmmss', function (input, array, config) {
2520 var pos1 = input.length - 4;
2521 var pos2 = input.length - 2;
2522 array[HOUR] = toInt(input.substr(0, pos1));
2523 array[MINUTE] = toInt(input.substr(pos1, 2));
2524 array[SECOND] = toInt(input.substr(pos2));
2525 });
2526
2527 // LOCALES
2528
2529 function localeIsPM (input) {
2530 // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
2531 // Using charAt should be more compatible.
2532 return ((input + '').toLowerCase().charAt(0) === 'p');
2533 }
2534
2535 var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
2536 function localeMeridiem (hours, minutes, isLower) {
2537 if (hours > 11) {
2538 return isLower ? 'pm' : 'PM';
2539 } else {
2540 return isLower ? 'am' : 'AM';
2541 }
2542 }
2543
2544
2545 // MOMENTS
2546
2547 // Setting the hour should keep the time, because the user explicitly
2548 // specified which hour they want. So trying to maintain the same hour (in
2549 // a new timezone) makes sense. Adding/subtracting hours does not follow
2550 // this rule.
2551 var getSetHour = makeGetSet('Hours', true);
2552
2553 var baseConfig = {
2554 calendar: defaultCalendar,
2555 longDateFormat: defaultLongDateFormat,
2556 invalidDate: defaultInvalidDate,
2557 ordinal: defaultOrdinal,
2558 dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
2559 relativeTime: defaultRelativeTime,
2560
2561 months: defaultLocaleMonths,
2562 monthsShort: defaultLocaleMonthsShort,
2563
2564 week: defaultLocaleWeek,
2565
2566 weekdays: defaultLocaleWeekdays,
2567 weekdaysMin: defaultLocaleWeekdaysMin,
2568 weekdaysShort: defaultLocaleWeekdaysShort,
2569
2570 meridiemParse: defaultLocaleMeridiemParse
2571 };
2572
2573 // internal storage for locale config files
2574 var locales = {};
2575 var localeFamilies = {};
2576 var globalLocale;
2577
2578 function normalizeLocale(key) {
2579 return key ? key.toLowerCase().replace('_', '-') : key;
2580 }
2581
2582 // pick the locale from the array
2583 // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
2584 // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
2585 function chooseLocale(names) {
2586 var i = 0, j, next, locale, split;
2587
2588 while (i < names.length) {
2589 split = normalizeLocale(names[i]).split('-');
2590 j = split.length;
2591 next = normalizeLocale(names[i + 1]);
2592 next = next ? next.split('-') : null;
2593 while (j > 0) {
2594 locale = loadLocale(split.slice(0, j).join('-'));
2595 if (locale) {
2596 return locale;
2597 }
2598 if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
2599 //the next array item is better than a shallower substring of this one
2600 break;
2601 }
2602 j--;
2603 }
2604 i++;
2605 }
2606 return globalLocale;
2607 }
2608
2609 function loadLocale(name) {
2610 var oldLocale = null;
2611 // TODO: Find a better way to register and load all the locales in Node
2612 if (!locales[name] && (typeof module !== 'undefined') &&
2613 module && module.exports) {
2614 try {
2615 oldLocale = globalLocale._abbr;
2616 var aliasedRequire = require;
2617 aliasedRequire('./locale/' + name);
2618 getSetGlobalLocale(oldLocale);
2619 } catch (e) {}
2620 }
2621 return locales[name];
2622 }
2623
2624 // This function will load locale and then set the global locale. If
2625 // no arguments are passed in, it will simply return the current global
2626 // locale key.
2627 function getSetGlobalLocale (key, values) {
2628 var data;
2629 if (key) {
2630 if (isUndefined(values)) {
2631 data = getLocale(key);
2632 }
2633 else {
2634 data = defineLocale(key, values);
2635 }
2636
2637 if (data) {
2638 // moment.duration._locale = moment._locale = data;
2639 globalLocale = data;
2640 }
2641 else {
2642 if ((typeof console !== 'undefined') && console.warn) {
2643 //warn user if arguments are passed but the locale could not be set
2644 console.warn('Locale ' + key + ' not found. Did you forget to load it?');
2645 }
2646 }
2647 }
2648
2649 return globalLocale._abbr;
2650 }
2651
2652 function defineLocale (name, config) {
2653 if (config !== null) {
2654 var locale, parentConfig = baseConfig;
2655 config.abbr = name;
2656 if (locales[name] != null) {
2657 deprecateSimple('defineLocaleOverride',
2658 'use moment.updateLocale(localeName, config) to change ' +
2659 'an existing locale. moment.defineLocale(localeName, ' +
2660 'config) should only be used for creating a new locale ' +
2661 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
2662 parentConfig = locales[name]._config;
2663 } else if (config.parentLocale != null) {
2664 if (locales[config.parentLocale] != null) {
2665 parentConfig = locales[config.parentLocale]._config;
2666 } else {
2667 locale = loadLocale(config.parentLocale);
2668 if (locale != null) {
2669 parentConfig = locale._config;
2670 } else {
2671 if (!localeFamilies[config.parentLocale]) {
2672 localeFamilies[config.parentLocale] = [];
2673 }
2674 localeFamilies[config.parentLocale].push({
2675 name: name,
2676 config: config
2677 });
2678 return null;
2679 }
2680 }
2681 }
2682 locales[name] = new Locale(mergeConfigs(parentConfig, config));
2683
2684 if (localeFamilies[name]) {
2685 localeFamilies[name].forEach(function (x) {
2686 defineLocale(x.name, x.config);
2687 });
2688 }
2689
2690 // backwards compat for now: also set the locale
2691 // make sure we set the locale AFTER all child locales have been
2692 // created, so we won't end up with the child locale set.
2693 getSetGlobalLocale(name);
2694
2695
2696 return locales[name];
2697 } else {
2698 // useful for testing
2699 delete locales[name];
2700 return null;
2701 }
2702 }
2703
2704 function updateLocale(name, config) {
2705 if (config != null) {
2706 var locale, tmpLocale, parentConfig = baseConfig;
2707 // MERGE
2708 tmpLocale = loadLocale(name);
2709 if (tmpLocale != null) {
2710 parentConfig = tmpLocale._config;
2711 }
2712 config = mergeConfigs(parentConfig, config);
2713 locale = new Locale(config);
2714 locale.parentLocale = locales[name];
2715 locales[name] = locale;
2716
2717 // backwards compat for now: also set the locale
2718 getSetGlobalLocale(name);
2719 } else {
2720 // pass null for config to unupdate, useful for tests
2721 if (locales[name] != null) {
2722 if (locales[name].parentLocale != null) {
2723 locales[name] = locales[name].parentLocale;
2724 } else if (locales[name] != null) {
2725 delete locales[name];
2726 }
2727 }
2728 }
2729 return locales[name];
2730 }
2731
2732 // returns locale data
2733 function getLocale (key) {
2734 var locale;
2735
2736 if (key && key._locale && key._locale._abbr) {
2737 key = key._locale._abbr;
2738 }
2739
2740 if (!key) {
2741 return globalLocale;
2742 }
2743
2744 if (!isArray(key)) {
2745 //short-circuit everything else
2746 locale = loadLocale(key);
2747 if (locale) {
2748 return locale;
2749 }
2750 key = [key];
2751 }
2752
2753 return chooseLocale(key);
2754 }
2755
2756 function listLocales() {
2757 return keys(locales);
2758 }
2759
2760 function checkOverflow (m) {
2761 var overflow;
2762 var a = m._a;
2763
2764 if (a && getParsingFlags(m).overflow === -2) {
2765 overflow =
2766 a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
2767 a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
2768 a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
2769 a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
2770 a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
2771 a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
2772 -1;
2773
2774 if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
2775 overflow = DATE;
2776 }
2777 if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
2778 overflow = WEEK;
2779 }
2780 if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
2781 overflow = WEEKDAY;
2782 }
2783
2784 getParsingFlags(m).overflow = overflow;
2785 }
2786
2787 return m;
2788 }
2789
2790 // Pick the first defined of two or three arguments.
2791 function defaults(a, b, c) {
2792 if (a != null) {
2793 return a;
2794 }
2795 if (b != null) {
2796 return b;
2797 }
2798 return c;
2799 }
2800
2801 function currentDateArray(config) {
2802 // hooks is actually the exported moment object
2803 var nowValue = new Date(hooks.now());
2804 if (config._useUTC) {
2805 return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
2806 }
2807 return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
2808 }
2809
2810 // convert an array to a date.
2811 // the array should mirror the parameters below
2812 // note: all values past the year are optional and will default to the lowest possible value.
2813 // [year, month, day , hour, minute, second, millisecond]
2814 function configFromArray (config) {
2815 var i, date, input = [], currentDate, expectedWeekday, yearToUse;
2816
2817 if (config._d) {
2818 return;
2819 }
2820
2821 currentDate = currentDateArray(config);
2822
2823 //compute day of the year from weeks and weekdays
2824 if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
2825 dayOfYearFromWeekInfo(config);
2826 }
2827
2828 //if the day of the year is set, figure out what it is
2829 if (config._dayOfYear != null) {
2830 yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
2831
2832 if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
2833 getParsingFlags(config)._overflowDayOfYear = true;
2834 }
2835
2836 date = createUTCDate(yearToUse, 0, config._dayOfYear);
2837 config._a[MONTH] = date.getUTCMonth();
2838 config._a[DATE] = date.getUTCDate();
2839 }
2840
2841 // Default to current date.
2842 // * if no year, month, day of month are given, default to today
2843 // * if day of month is given, default month and year
2844 // * if month is given, default only year
2845 // * if year is given, don't default anything
2846 for (i = 0; i < 3 && config._a[i] == null; ++i) {
2847 config._a[i] = input[i] = currentDate[i];
2848 }
2849
2850 // Zero out whatever was not defaulted, including time
2851 for (; i < 7; i++) {
2852 config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
2853 }
2854
2855 // Check for 24:00:00.000
2856 if (config._a[HOUR] === 24 &&
2857 config._a[MINUTE] === 0 &&
2858 config._a[SECOND] === 0 &&
2859 config._a[MILLISECOND] === 0) {
2860 config._nextDay = true;
2861 config._a[HOUR] = 0;
2862 }
2863
2864 config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
2865 expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
2866
2867 // Apply timezone offset from input. The actual utcOffset can be changed
2868 // with parseZone.
2869 if (config._tzm != null) {
2870 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2871 }
2872
2873 if (config._nextDay) {
2874 config._a[HOUR] = 24;
2875 }
2876
2877 // check for mismatching day of week
2878 if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
2879 getParsingFlags(config).weekdayMismatch = true;
2880 }
2881 }
2882
2883 function dayOfYearFromWeekInfo(config) {
2884 var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
2885
2886 w = config._w;
2887 if (w.GG != null || w.W != null || w.E != null) {
2888 dow = 1;
2889 doy = 4;
2890
2891 // TODO: We need to take the current isoWeekYear, but that depends on
2892 // how we interpret now (local, utc, fixed offset). So create
2893 // a now version of current config (take local/utc/offset flags, and
2894 // create now).
2895 weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
2896 week = defaults(w.W, 1);
2897 weekday = defaults(w.E, 1);
2898 if (weekday < 1 || weekday > 7) {
2899 weekdayOverflow = true;
2900 }
2901 } else {
2902 dow = config._locale._week.dow;
2903 doy = config._locale._week.doy;
2904
2905 var curWeek = weekOfYear(createLocal(), dow, doy);
2906
2907 weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
2908
2909 // Default to current week.
2910 week = defaults(w.w, curWeek.week);
2911
2912 if (w.d != null) {
2913 // weekday -- low day numbers are considered next week
2914 weekday = w.d;
2915 if (weekday < 0 || weekday > 6) {
2916 weekdayOverflow = true;
2917 }
2918 } else if (w.e != null) {
2919 // local weekday -- counting starts from beginning of week
2920 weekday = w.e + dow;
2921 if (w.e < 0 || w.e > 6) {
2922 weekdayOverflow = true;
2923 }
2924 } else {
2925 // default to beginning of week
2926 weekday = dow;
2927 }
2928 }
2929 if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
2930 getParsingFlags(config)._overflowWeeks = true;
2931 } else if (weekdayOverflow != null) {
2932 getParsingFlags(config)._overflowWeekday = true;
2933 } else {
2934 temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
2935 config._a[YEAR] = temp.year;
2936 config._dayOfYear = temp.dayOfYear;
2937 }
2938 }
2939
2940 // iso 8601 regex
2941 // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
2942 var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
2943 var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
2944
2945 var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
2946
2947 var isoDates = [
2948 ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
2949 ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
2950 ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
2951 ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
2952 ['YYYY-DDD', /\d{4}-\d{3}/],
2953 ['YYYY-MM', /\d{4}-\d\d/, false],
2954 ['YYYYYYMMDD', /[+-]\d{10}/],
2955 ['YYYYMMDD', /\d{8}/],
2956 // YYYYMM is NOT allowed by the standard
2957 ['GGGG[W]WWE', /\d{4}W\d{3}/],
2958 ['GGGG[W]WW', /\d{4}W\d{2}/, false],
2959 ['YYYYDDD', /\d{7}/]
2960 ];
2961
2962 // iso time formats and regexes
2963 var isoTimes = [
2964 ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
2965 ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
2966 ['HH:mm:ss', /\d\d:\d\d:\d\d/],
2967 ['HH:mm', /\d\d:\d\d/],
2968 ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
2969 ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
2970 ['HHmmss', /\d\d\d\d\d\d/],
2971 ['HHmm', /\d\d\d\d/],
2972 ['HH', /\d\d/]
2973 ];
2974
2975 var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
2976
2977 // date from iso format
2978 function configFromISO(config) {
2979 var i, l,
2980 string = config._i,
2981 match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
2982 allowTime, dateFormat, timeFormat, tzFormat;
2983
2984 if (match) {
2985 getParsingFlags(config).iso = true;
2986
2987 for (i = 0, l = isoDates.length; i < l; i++) {
2988 if (isoDates[i][1].exec(match[1])) {
2989 dateFormat = isoDates[i][0];
2990 allowTime = isoDates[i][2] !== false;
2991 break;
2992 }
2993 }
2994 if (dateFormat == null) {
2995 config._isValid = false;
2996 return;
2997 }
2998 if (match[3]) {
2999 for (i = 0, l = isoTimes.length; i < l; i++) {
3000 if (isoTimes[i][1].exec(match[3])) {
3001 // match[2] should be 'T' or space
3002 timeFormat = (match[2] || ' ') + isoTimes[i][0];
3003 break;
3004 }
3005 }
3006 if (timeFormat == null) {
3007 config._isValid = false;
3008 return;
3009 }
3010 }
3011 if (!allowTime && timeFormat != null) {
3012 config._isValid = false;
3013 return;
3014 }
3015 if (match[4]) {
3016 if (tzRegex.exec(match[4])) {
3017 tzFormat = 'Z';
3018 } else {
3019 config._isValid = false;
3020 return;
3021 }
3022 }
3023 config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
3024 configFromStringAndFormat(config);
3025 } else {
3026 config._isValid = false;
3027 }
3028 }
3029
3030 // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
3031 var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
3032
3033 function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
3034 var result = [
3035 untruncateYear(yearStr),
3036 defaultLocaleMonthsShort.indexOf(monthStr),
3037 parseInt(dayStr, 10),
3038 parseInt(hourStr, 10),
3039 parseInt(minuteStr, 10)
3040 ];
3041
3042 if (secondStr) {
3043 result.push(parseInt(secondStr, 10));
3044 }
3045
3046 return result;
3047 }
3048
3049 function untruncateYear(yearStr) {
3050 var year = parseInt(yearStr, 10);
3051 if (year <= 49) {
3052 return 2000 + year;
3053 } else if (year <= 999) {
3054 return 1900 + year;
3055 }
3056 return year;
3057 }
3058
3059 function preprocessRFC2822(s) {
3060 // Remove comments and folding whitespace and replace multiple-spaces with a single space
3061 return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, '');
3062 }
3063
3064 function checkWeekday(weekdayStr, parsedInput, config) {
3065 if (weekdayStr) {
3066 // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
3067 var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
3068 weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
3069 if (weekdayProvided !== weekdayActual) {
3070 getParsingFlags(config).weekdayMismatch = true;
3071 config._isValid = false;
3072 return false;
3073 }
3074 }
3075 return true;
3076 }
3077
3078 var obsOffsets = {
3079 UT: 0,
3080 GMT: 0,
3081 EDT: -4 * 60,
3082 EST: -5 * 60,
3083 CDT: -5 * 60,
3084 CST: -6 * 60,
3085 MDT: -6 * 60,
3086 MST: -7 * 60,
3087 PDT: -7 * 60,
3088 PST: -8 * 60
3089 };
3090
3091 function calculateOffset(obsOffset, militaryOffset, numOffset) {
3092 if (obsOffset) {
3093 return obsOffsets[obsOffset];
3094 } else if (militaryOffset) {
3095 // the only allowed military tz is Z
3096 return 0;
3097 } else {
3098 var hm = parseInt(numOffset, 10);
3099 var m = hm % 100, h = (hm - m) / 100;
3100 return h * 60 + m;
3101 }
3102 }
3103
3104 // date and time from ref 2822 format
3105 function configFromRFC2822(config) {
3106 var match = rfc2822.exec(preprocessRFC2822(config._i));
3107 if (match) {
3108 var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
3109 if (!checkWeekday(match[1], parsedArray, config)) {
3110 return;
3111 }
3112
3113 config._a = parsedArray;
3114 config._tzm = calculateOffset(match[8], match[9], match[10]);
3115
3116 config._d = createUTCDate.apply(null, config._a);
3117 config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
3118
3119 getParsingFlags(config).rfc2822 = true;
3120 } else {
3121 config._isValid = false;
3122 }
3123 }
3124
3125 // date from iso format or fallback
3126 function configFromString(config) {
3127 var matched = aspNetJsonRegex.exec(config._i);
3128
3129 if (matched !== null) {
3130 config._d = new Date(+matched[1]);
3131 return;
3132 }
3133
3134 configFromISO(config);
3135 if (config._isValid === false) {
3136 delete config._isValid;
3137 } else {
3138 return;
3139 }
3140
3141 configFromRFC2822(config);
3142 if (config._isValid === false) {
3143 delete config._isValid;
3144 } else {
3145 return;
3146 }
3147
3148 // Final attempt, use Input Fallback
3149 hooks.createFromInputFallback(config);
3150 }
3151
3152 hooks.createFromInputFallback = deprecate(
3153 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
3154 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
3155 'discouraged and will be removed in an upcoming major release. Please refer to ' +
3156 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
3157 function (config) {
3158 config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
3159 }
3160 );
3161
3162 // constant that refers to the ISO standard
3163 hooks.ISO_8601 = function () {};
3164
3165 // constant that refers to the RFC 2822 form
3166 hooks.RFC_2822 = function () {};
3167
3168 // date from string and format string
3169 function configFromStringAndFormat(config) {
3170 // TODO: Move this to another part of the creation flow to prevent circular deps
3171 if (config._f === hooks.ISO_8601) {
3172 configFromISO(config);
3173 return;
3174 }
3175 if (config._f === hooks.RFC_2822) {
3176 configFromRFC2822(config);
3177 return;
3178 }
3179 config._a = [];
3180 getParsingFlags(config).empty = true;
3181
3182 // This array is used to make a Date, either with `new Date` or `Date.UTC`
3183 var string = '' + config._i,
3184 i, parsedInput, tokens, token, skipped,
3185 stringLength = string.length,
3186 totalParsedInputLength = 0;
3187
3188 tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
3189
3190 for (i = 0; i < tokens.length; i++) {
3191 token = tokens[i];
3192 parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
3193 // console.log('token', token, 'parsedInput', parsedInput,
3194 // 'regex', getParseRegexForToken(token, config));
3195 if (parsedInput) {
3196 skipped = string.substr(0, string.indexOf(parsedInput));
3197 if (skipped.length > 0) {
3198 getParsingFlags(config).unusedInput.push(skipped);
3199 }
3200 string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
3201 totalParsedInputLength += parsedInput.length;
3202 }
3203 // don't parse if it's not a known token
3204 if (formatTokenFunctions[token]) {
3205 if (parsedInput) {
3206 getParsingFlags(config).empty = false;
3207 }
3208 else {
3209 getParsingFlags(config).unusedTokens.push(token);
3210 }
3211 addTimeToArrayFromToken(token, parsedInput, config);
3212 }
3213 else if (config._strict && !parsedInput) {
3214 getParsingFlags(config).unusedTokens.push(token);
3215 }
3216 }
3217
3218 // add remaining unparsed input length to the string
3219 getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
3220 if (string.length > 0) {
3221 getParsingFlags(config).unusedInput.push(string);
3222 }
3223
3224 // clear _12h flag if hour is <= 12
3225 if (config._a[HOUR] <= 12 &&
3226 getParsingFlags(config).bigHour === true &&
3227 config._a[HOUR] > 0) {
3228 getParsingFlags(config).bigHour = undefined;
3229 }
3230
3231 getParsingFlags(config).parsedDateParts = config._a.slice(0);
3232 getParsingFlags(config).meridiem = config._meridiem;
3233 // handle meridiem
3234 config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
3235
3236 configFromArray(config);
3237 checkOverflow(config);
3238 }
3239
3240
3241 function meridiemFixWrap (locale, hour, meridiem) {
3242 var isPm;
3243
3244 if (meridiem == null) {
3245 // nothing to do
3246 return hour;
3247 }
3248 if (locale.meridiemHour != null) {
3249 return locale.meridiemHour(hour, meridiem);
3250 } else if (locale.isPM != null) {
3251 // Fallback
3252 isPm = locale.isPM(meridiem);
3253 if (isPm && hour < 12) {
3254 hour += 12;
3255 }
3256 if (!isPm && hour === 12) {
3257 hour = 0;
3258 }
3259 return hour;
3260 } else {
3261 // this is not supposed to happen
3262 return hour;
3263 }
3264 }
3265
3266 // date from string and array of format strings
3267 function configFromStringAndArray(config) {
3268 var tempConfig,
3269 bestMoment,
3270
3271 scoreToBeat,
3272 i,
3273 currentScore;
3274
3275 if (config._f.length === 0) {
3276 getParsingFlags(config).invalidFormat = true;
3277 config._d = new Date(NaN);
3278 return;
3279 }
3280
3281 for (i = 0; i < config._f.length; i++) {
3282 currentScore = 0;
3283 tempConfig = copyConfig({}, config);
3284 if (config._useUTC != null) {
3285 tempConfig._useUTC = config._useUTC;
3286 }
3287 tempConfig._f = config._f[i];
3288 configFromStringAndFormat(tempConfig);
3289
3290 if (!isValid(tempConfig)) {
3291 continue;
3292 }
3293
3294 // if there is any input that was not parsed add a penalty for that format
3295 currentScore += getParsingFlags(tempConfig).charsLeftOver;
3296
3297 //or tokens
3298 currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
3299
3300 getParsingFlags(tempConfig).score = currentScore;
3301
3302 if (scoreToBeat == null || currentScore < scoreToBeat) {
3303 scoreToBeat = currentScore;
3304 bestMoment = tempConfig;
3305 }
3306 }
3307
3308 extend(config, bestMoment || tempConfig);
3309 }
3310
3311 function configFromObject(config) {
3312 if (config._d) {
3313 return;
3314 }
3315
3316 var i = normalizeObjectUnits(config._i);
3317 config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
3318 return obj && parseInt(obj, 10);
3319 });
3320
3321 configFromArray(config);
3322 }
3323
3324 function createFromConfig (config) {
3325 var res = new Moment(checkOverflow(prepareConfig(config)));
3326 if (res._nextDay) {
3327 // Adding is smart enough around DST
3328 res.add(1, 'd');
3329 res._nextDay = undefined;
3330 }
3331
3332 return res;
3333 }
3334
3335 function prepareConfig (config) {
3336 var input = config._i,
3337 format = config._f;
3338
3339 config._locale = config._locale || getLocale(config._l);
3340
3341 if (input === null || (format === undefined && input === '')) {
3342 return createInvalid({nullInput: true});
3343 }
3344
3345 if (typeof input === 'string') {
3346 config._i = input = config._locale.preparse(input);
3347 }
3348
3349 if (isMoment(input)) {
3350 return new Moment(checkOverflow(input));
3351 } else if (isDate(input)) {
3352 config._d = input;
3353 } else if (isArray(format)) {
3354 configFromStringAndArray(config);
3355 } else if (format) {
3356 configFromStringAndFormat(config);
3357 } else {
3358 configFromInput(config);
3359 }
3360
3361 if (!isValid(config)) {
3362 config._d = null;
3363 }
3364
3365 return config;
3366 }
3367
3368 function configFromInput(config) {
3369 var input = config._i;
3370 if (isUndefined(input)) {
3371 config._d = new Date(hooks.now());
3372 } else if (isDate(input)) {
3373 config._d = new Date(input.valueOf());
3374 } else if (typeof input === 'string') {
3375 configFromString(config);
3376 } else if (isArray(input)) {
3377 config._a = map(input.slice(0), function (obj) {
3378 return parseInt(obj, 10);
3379 });
3380 configFromArray(config);
3381 } else if (isObject(input)) {
3382 configFromObject(config);
3383 } else if (isNumber(input)) {
3384 // from milliseconds
3385 config._d = new Date(input);
3386 } else {
3387 hooks.createFromInputFallback(config);
3388 }
3389 }
3390
3391 function createLocalOrUTC (input, format, locale, strict, isUTC) {
3392 var c = {};
3393
3394 if (locale === true || locale === false) {
3395 strict = locale;
3396 locale = undefined;
3397 }
3398
3399 if ((isObject(input) && isObjectEmpty(input)) ||
3400 (isArray(input) && input.length === 0)) {
3401 input = undefined;
3402 }
3403 // object construction must be done this way.
3404 // https://github.com/moment/moment/issues/1423
3405 c._isAMomentObject = true;
3406 c._useUTC = c._isUTC = isUTC;
3407 c._l = locale;
3408 c._i = input;
3409 c._f = format;
3410 c._strict = strict;
3411
3412 return createFromConfig(c);
3413 }
3414
3415 function createLocal (input, format, locale, strict) {
3416 return createLocalOrUTC(input, format, locale, strict, false);
3417 }
3418
3419 var prototypeMin = deprecate(
3420 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
3421 function () {
3422 var other = createLocal.apply(null, arguments);
3423 if (this.isValid() && other.isValid()) {
3424 return other < this ? this : other;
3425 } else {
3426 return createInvalid();
3427 }
3428 }
3429 );
3430
3431 var prototypeMax = deprecate(
3432 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
3433 function () {
3434 var other = createLocal.apply(null, arguments);
3435 if (this.isValid() && other.isValid()) {
3436 return other > this ? this : other;
3437 } else {
3438 return createInvalid();
3439 }
3440 }
3441 );
3442
3443 // Pick a moment m from moments so that m[fn](other) is true for all
3444 // other. This relies on the function fn to be transitive.
3445 //
3446 // moments should either be an array of moment objects or an array, whose
3447 // first element is an array of moment objects.
3448 function pickBy(fn, moments) {
3449 var res, i;
3450 if (moments.length === 1 && isArray(moments[0])) {
3451 moments = moments[0];
3452 }
3453 if (!moments.length) {
3454 return createLocal();
3455 }
3456 res = moments[0];
3457 for (i = 1; i < moments.length; ++i) {
3458 if (!moments[i].isValid() || moments[i][fn](res)) {
3459 res = moments[i];
3460 }
3461 }
3462 return res;
3463 }
3464
3465 // TODO: Use [].sort instead?
3466 function min () {
3467 var args = [].slice.call(arguments, 0);
3468
3469 return pickBy('isBefore', args);
3470 }
3471
3472 function max () {
3473 var args = [].slice.call(arguments, 0);
3474
3475 return pickBy('isAfter', args);
3476 }
3477
3478 var now = function () {
3479 return Date.now ? Date.now() : +(new Date());
3480 };
3481
3482 var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
3483
3484 function isDurationValid(m) {
3485 for (var key in m) {
3486 if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
3487 return false;
3488 }
3489 }
3490
3491 var unitHasDecimal = false;
3492 for (var i = 0; i < ordering.length; ++i) {
3493 if (m[ordering[i]]) {
3494 if (unitHasDecimal) {
3495 return false; // only allow non-integers for smallest unit
3496 }
3497 if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
3498 unitHasDecimal = true;
3499 }
3500 }
3501 }
3502
3503 return true;
3504 }
3505
3506 function isValid$1() {
3507 return this._isValid;
3508 }
3509
3510 function createInvalid$1() {
3511 return createDuration(NaN);
3512 }
3513
3514 function Duration (duration) {
3515 var normalizedInput = normalizeObjectUnits(duration),
3516 years = normalizedInput.year || 0,
3517 quarters = normalizedInput.quarter || 0,
3518 months = normalizedInput.month || 0,
3519 weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
3520 days = normalizedInput.day || 0,
3521 hours = normalizedInput.hour || 0,
3522 minutes = normalizedInput.minute || 0,
3523 seconds = normalizedInput.second || 0,
3524 milliseconds = normalizedInput.millisecond || 0;
3525
3526 this._isValid = isDurationValid(normalizedInput);
3527
3528 // representation for dateAddRemove
3529 this._milliseconds = +milliseconds +
3530 seconds * 1e3 + // 1000
3531 minutes * 6e4 + // 1000 * 60
3532 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
3533 // Because of dateAddRemove treats 24 hours as different from a
3534 // day when working around DST, we need to store them separately
3535 this._days = +days +
3536 weeks * 7;
3537 // It is impossible to translate months into days without knowing
3538 // which months you are are talking about, so we have to store
3539 // it separately.
3540 this._months = +months +
3541 quarters * 3 +
3542 years * 12;
3543
3544 this._data = {};
3545
3546 this._locale = getLocale();
3547
3548 this._bubble();
3549 }
3550
3551 function isDuration (obj) {
3552 return obj instanceof Duration;
3553 }
3554
3555 function absRound (number) {
3556 if (number < 0) {
3557 return Math.round(-1 * number) * -1;
3558 } else {
3559 return Math.round(number);
3560 }
3561 }
3562
3563 // FORMATTING
3564
3565 function offset (token, separator) {
3566 addFormatToken(token, 0, 0, function () {
3567 var offset = this.utcOffset();
3568 var sign = '+';
3569 if (offset < 0) {
3570 offset = -offset;
3571 sign = '-';
3572 }
3573 return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
3574 });
3575 }
3576
3577 offset('Z', ':');
3578 offset('ZZ', '');
3579
3580 // PARSING
3581
3582 addRegexToken('Z', matchShortOffset);
3583 addRegexToken('ZZ', matchShortOffset);
3584 addParseToken(['Z', 'ZZ'], function (input, array, config) {
3585 config._useUTC = true;
3586 config._tzm = offsetFromString(matchShortOffset, input);
3587 });
3588
3589 // HELPERS
3590
3591 // timezone chunker
3592 // '+10:00' > ['10', '00']
3593 // '-1530' > ['-15', '30']
3594 var chunkOffset = /([\+\-]|\d\d)/gi;
3595
3596 function offsetFromString(matcher, string) {
3597 var matches = (string || '').match(matcher);
3598
3599 if (matches === null) {
3600 return null;
3601 }
3602
3603 var chunk = matches[matches.length - 1] || [];
3604 var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
3605 var minutes = +(parts[1] * 60) + toInt(parts[2]);
3606
3607 return minutes === 0 ?
3608 0 :
3609 parts[0] === '+' ? minutes : -minutes;
3610 }
3611
3612 // Return a moment from input, that is local/utc/zone equivalent to model.
3613 function cloneWithOffset(input, model) {
3614 var res, diff;
3615 if (model._isUTC) {
3616 res = model.clone();
3617 diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
3618 // Use low-level api, because this fn is low-level api.
3619 res._d.setTime(res._d.valueOf() + diff);
3620 hooks.updateOffset(res, false);
3621 return res;
3622 } else {
3623 return createLocal(input).local();
3624 }
3625 }
3626
3627 function getDateOffset (m) {
3628 // On Firefox.24 Date#getTimezoneOffset returns a floating point.
3629 // https://github.com/moment/moment/pull/1871
3630 return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
3631 }
3632
3633 // HOOKS
3634
3635 // This function will be called whenever a moment is mutated.
3636 // It is intended to keep the offset in sync with the timezone.
3637 hooks.updateOffset = function () {};
3638
3639 // MOMENTS
3640
3641 // keepLocalTime = true means only change the timezone, without
3642 // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
3643 // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
3644 // +0200, so we adjust the time as needed, to be valid.
3645 //
3646 // Keeping the time actually adds/subtracts (one hour)
3647 // from the actual represented time. That is why we call updateOffset
3648 // a second time. In case it wants us to change the offset again
3649 // _changeInProgress == true case, then we have to adjust, because
3650 // there is no such time in the given timezone.
3651 function getSetOffset (input, keepLocalTime, keepMinutes) {
3652 var offset = this._offset || 0,
3653 localAdjust;
3654 if (!this.isValid()) {
3655 return input != null ? this : NaN;
3656 }
3657 if (input != null) {
3658 if (typeof input === 'string') {
3659 input = offsetFromString(matchShortOffset, input);
3660 if (input === null) {
3661 return this;
3662 }
3663 } else if (Math.abs(input) < 16 && !keepMinutes) {
3664 input = input * 60;
3665 }
3666 if (!this._isUTC && keepLocalTime) {
3667 localAdjust = getDateOffset(this);
3668 }
3669 this._offset = input;
3670 this._isUTC = true;
3671 if (localAdjust != null) {
3672 this.add(localAdjust, 'm');
3673 }
3674 if (offset !== input) {
3675 if (!keepLocalTime || this._changeInProgress) {
3676 addSubtract(this, createDuration(input - offset, 'm'), 1, false);
3677 } else if (!this._changeInProgress) {
3678 this._changeInProgress = true;
3679 hooks.updateOffset(this, true);
3680 this._changeInProgress = null;
3681 }
3682 }
3683 return this;
3684 } else {
3685 return this._isUTC ? offset : getDateOffset(this);
3686 }
3687 }
3688
3689 function getSetZone (input, keepLocalTime) {
3690 if (input != null) {
3691 if (typeof input !== 'string') {
3692 input = -input;
3693 }
3694
3695 this.utcOffset(input, keepLocalTime);
3696
3697 return this;
3698 } else {
3699 return -this.utcOffset();
3700 }
3701 }
3702
3703 function setOffsetToUTC (keepLocalTime) {
3704 return this.utcOffset(0, keepLocalTime);
3705 }
3706
3707 function setOffsetToLocal (keepLocalTime) {
3708 if (this._isUTC) {
3709 this.utcOffset(0, keepLocalTime);
3710 this._isUTC = false;
3711
3712 if (keepLocalTime) {
3713 this.subtract(getDateOffset(this), 'm');
3714 }
3715 }
3716 return this;
3717 }
3718
3719 function setOffsetToParsedOffset () {
3720 if (this._tzm != null) {
3721 this.utcOffset(this._tzm, false, true);
3722 } else if (typeof this._i === 'string') {
3723 var tZone = offsetFromString(matchOffset, this._i);
3724 if (tZone != null) {
3725 this.utcOffset(tZone);
3726 }
3727 else {
3728 this.utcOffset(0, true);
3729 }
3730 }
3731 return this;
3732 }
3733
3734 function hasAlignedHourOffset (input) {
3735 if (!this.isValid()) {
3736 return false;
3737 }
3738 input = input ? createLocal(input).utcOffset() : 0;
3739
3740 return (this.utcOffset() - input) % 60 === 0;
3741 }
3742
3743 function isDaylightSavingTime () {
3744 return (
3745 this.utcOffset() > this.clone().month(0).utcOffset() ||
3746 this.utcOffset() > this.clone().month(5).utcOffset()
3747 );
3748 }
3749
3750 function isDaylightSavingTimeShifted () {
3751 if (!isUndefined(this._isDSTShifted)) {
3752 return this._isDSTShifted;
3753 }
3754
3755 var c = {};
3756
3757 copyConfig(c, this);
3758 c = prepareConfig(c);
3759
3760 if (c._a) {
3761 var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
3762 this._isDSTShifted = this.isValid() &&
3763 compareArrays(c._a, other.toArray()) > 0;
3764 } else {
3765 this._isDSTShifted = false;
3766 }
3767
3768 return this._isDSTShifted;
3769 }
3770
3771 function isLocal () {
3772 return this.isValid() ? !this._isUTC : false;
3773 }
3774
3775 function isUtcOffset () {
3776 return this.isValid() ? this._isUTC : false;
3777 }
3778
3779 function isUtc () {
3780 return this.isValid() ? this._isUTC && this._offset === 0 : false;
3781 }
3782
3783 // ASP.NET json date format regex
3784 var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
3785
3786 // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
3787 // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
3788 // and further modified to allow for strings containing both week and day
3789 var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
3790
3791 function createDuration (input, key) {
3792 var duration = input,
3793 // matching against regexp is expensive, do it on demand
3794 match = null,
3795 sign,
3796 ret,
3797 diffRes;
3798
3799 if (isDuration(input)) {
3800 duration = {
3801 ms : input._milliseconds,
3802 d : input._days,
3803 M : input._months
3804 };
3805 } else if (isNumber(input)) {
3806 duration = {};
3807 if (key) {
3808 duration[key] = input;
3809 } else {
3810 duration.milliseconds = input;
3811 }
3812 } else if (!!(match = aspNetRegex.exec(input))) {
3813 sign = (match[1] === '-') ? -1 : 1;
3814 duration = {
3815 y : 0,
3816 d : toInt(match[DATE]) * sign,
3817 h : toInt(match[HOUR]) * sign,
3818 m : toInt(match[MINUTE]) * sign,
3819 s : toInt(match[SECOND]) * sign,
3820 ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
3821 };
3822 } else if (!!(match = isoRegex.exec(input))) {
3823 sign = (match[1] === '-') ? -1 : 1;
3824 duration = {
3825 y : parseIso(match[2], sign),
3826 M : parseIso(match[3], sign),
3827 w : parseIso(match[4], sign),
3828 d : parseIso(match[5], sign),
3829 h : parseIso(match[6], sign),
3830 m : parseIso(match[7], sign),
3831 s : parseIso(match[8], sign)
3832 };
3833 } else if (duration == null) {// checks for null or undefined
3834 duration = {};
3835 } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
3836 diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
3837
3838 duration = {};
3839 duration.ms = diffRes.milliseconds;
3840 duration.M = diffRes.months;
3841 }
3842
3843 ret = new Duration(duration);
3844
3845 if (isDuration(input) && hasOwnProp(input, '_locale')) {
3846 ret._locale = input._locale;
3847 }
3848
3849 return ret;
3850 }
3851
3852 createDuration.fn = Duration.prototype;
3853 createDuration.invalid = createInvalid$1;
3854
3855 function parseIso (inp, sign) {
3856 // We'd normally use ~~inp for this, but unfortunately it also
3857 // converts floats to ints.
3858 // inp may be undefined, so careful calling replace on it.
3859 var res = inp && parseFloat(inp.replace(',', '.'));
3860 // apply sign while we're at it
3861 return (isNaN(res) ? 0 : res) * sign;
3862 }
3863
3864 function positiveMomentsDifference(base, other) {
3865 var res = {};
3866
3867 res.months = other.month() - base.month() +
3868 (other.year() - base.year()) * 12;
3869 if (base.clone().add(res.months, 'M').isAfter(other)) {
3870 --res.months;
3871 }
3872
3873 res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
3874
3875 return res;
3876 }
3877
3878 function momentsDifference(base, other) {
3879 var res;
3880 if (!(base.isValid() && other.isValid())) {
3881 return {milliseconds: 0, months: 0};
3882 }
3883
3884 other = cloneWithOffset(other, base);
3885 if (base.isBefore(other)) {
3886 res = positiveMomentsDifference(base, other);
3887 } else {
3888 res = positiveMomentsDifference(other, base);
3889 res.milliseconds = -res.milliseconds;
3890 res.months = -res.months;
3891 }
3892
3893 return res;
3894 }
3895
3896 // TODO: remove 'name' arg after deprecation is removed
3897 function createAdder(direction, name) {
3898 return function (val, period) {
3899 var dur, tmp;
3900 //invert the arguments, but complain about it
3901 if (period !== null && !isNaN(+period)) {
3902 deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
3903 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
3904 tmp = val; val = period; period = tmp;
3905 }
3906
3907 val = typeof val === 'string' ? +val : val;
3908 dur = createDuration(val, period);
3909 addSubtract(this, dur, direction);
3910 return this;
3911 };
3912 }
3913
3914 function addSubtract (mom, duration, isAdding, updateOffset) {
3915 var milliseconds = duration._milliseconds,
3916 days = absRound(duration._days),
3917 months = absRound(duration._months);
3918
3919 if (!mom.isValid()) {
3920 // No op
3921 return;
3922 }
3923
3924 updateOffset = updateOffset == null ? true : updateOffset;
3925
3926 if (months) {
3927 setMonth(mom, get(mom, 'Month') + months * isAdding);
3928 }
3929 if (days) {
3930 set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
3931 }
3932 if (milliseconds) {
3933 mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
3934 }
3935 if (updateOffset) {
3936 hooks.updateOffset(mom, days || months);
3937 }
3938 }
3939
3940 var add = createAdder(1, 'add');
3941 var subtract = createAdder(-1, 'subtract');
3942
3943 function getCalendarFormat(myMoment, now) {
3944 var diff = myMoment.diff(now, 'days', true);
3945 return diff < -6 ? 'sameElse' :
3946 diff < -1 ? 'lastWeek' :
3947 diff < 0 ? 'lastDay' :
3948 diff < 1 ? 'sameDay' :
3949 diff < 2 ? 'nextDay' :
3950 diff < 7 ? 'nextWeek' : 'sameElse';
3951 }
3952
3953 function calendar$1 (time, formats) {
3954 // We want to compare the start of today, vs this.
3955 // Getting start-of-today depends on whether we're local/utc/offset or not.
3956 var now = time || createLocal(),
3957 sod = cloneWithOffset(now, this).startOf('day'),
3958 format = hooks.calendarFormat(this, sod) || 'sameElse';
3959
3960 var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
3961
3962 return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
3963 }
3964
3965 function clone () {
3966 return new Moment(this);
3967 }
3968
3969 function isAfter (input, units) {
3970 var localInput = isMoment(input) ? input : createLocal(input);
3971 if (!(this.isValid() && localInput.isValid())) {
3972 return false;
3973 }
3974 units = normalizeUnits(units) || 'millisecond';
3975 if (units === 'millisecond') {
3976 return this.valueOf() > localInput.valueOf();
3977 } else {
3978 return localInput.valueOf() < this.clone().startOf(units).valueOf();
3979 }
3980 }
3981
3982 function isBefore (input, units) {
3983 var localInput = isMoment(input) ? input : createLocal(input);
3984 if (!(this.isValid() && localInput.isValid())) {
3985 return false;
3986 }
3987 units = normalizeUnits(units) || 'millisecond';
3988 if (units === 'millisecond') {
3989 return this.valueOf() < localInput.valueOf();
3990 } else {
3991 return this.clone().endOf(units).valueOf() < localInput.valueOf();
3992 }
3993 }
3994
3995 function isBetween (from, to, units, inclusivity) {
3996 var localFrom = isMoment(from) ? from : createLocal(from),
3997 localTo = isMoment(to) ? to : createLocal(to);
3998 if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
3999 return false;
4000 }
4001 inclusivity = inclusivity || '()';
4002 return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) &&
4003 (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units));
4004 }
4005
4006 function isSame (input, units) {
4007 var localInput = isMoment(input) ? input : createLocal(input),
4008 inputMs;
4009 if (!(this.isValid() && localInput.isValid())) {
4010 return false;
4011 }
4012 units = normalizeUnits(units) || 'millisecond';
4013 if (units === 'millisecond') {
4014 return this.valueOf() === localInput.valueOf();
4015 } else {
4016 inputMs = localInput.valueOf();
4017 return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
4018 }
4019 }
4020
4021 function isSameOrAfter (input, units) {
4022 return this.isSame(input, units) || this.isAfter(input, units);
4023 }
4024
4025 function isSameOrBefore (input, units) {
4026 return this.isSame(input, units) || this.isBefore(input, units);
4027 }
4028
4029 function diff (input, units, asFloat) {
4030 var that,
4031 zoneDelta,
4032 output;
4033
4034 if (!this.isValid()) {
4035 return NaN;
4036 }
4037
4038 that = cloneWithOffset(input, this);
4039
4040 if (!that.isValid()) {
4041 return NaN;
4042 }
4043
4044 zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
4045
4046 units = normalizeUnits(units);
4047
4048 switch (units) {
4049 case 'year': output = monthDiff(this, that) / 12; break;
4050 case 'month': output = monthDiff(this, that); break;
4051 case 'quarter': output = monthDiff(this, that) / 3; break;
4052 case 'second': output = (this - that) / 1e3; break; // 1000
4053 case 'minute': output = (this - that) / 6e4; break; // 1000 * 60
4054 case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60
4055 case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst
4056 case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst
4057 default: output = this - that;
4058 }
4059
4060 return asFloat ? output : absFloor(output);
4061 }
4062
4063 function monthDiff (a, b) {
4064 // difference in months
4065 var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
4066 // b is in (anchor - 1 month, anchor + 1 month)
4067 anchor = a.clone().add(wholeMonthDiff, 'months'),
4068 anchor2, adjust;
4069
4070 if (b - anchor < 0) {
4071 anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
4072 // linear across the month
4073 adjust = (b - anchor) / (anchor - anchor2);
4074 } else {
4075 anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
4076 // linear across the month
4077 adjust = (b - anchor) / (anchor2 - anchor);
4078 }
4079
4080 //check for negative zero, return zero if negative zero
4081 return -(wholeMonthDiff + adjust) || 0;
4082 }
4083
4084 hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
4085 hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
4086
4087 function toString () {
4088 return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
4089 }
4090
4091 function toISOString(keepOffset) {
4092 if (!this.isValid()) {
4093 return null;
4094 }
4095 var utc = keepOffset !== true;
4096 var m = utc ? this.clone().utc() : this;
4097 if (m.year() < 0 || m.year() > 9999) {
4098 return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
4099 }
4100 if (isFunction(Date.prototype.toISOString)) {
4101 // native implementation is ~50x faster, use it when we can
4102 if (utc) {
4103 return this.toDate().toISOString();
4104 } else {
4105 return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z'));
4106 }
4107 }
4108 return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
4109 }
4110
4111 /**
4112 * Return a human readable representation of a moment that can
4113 * also be evaluated to get a new moment which is the same
4114 *
4115 * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
4116 */
4117 function inspect () {
4118 if (!this.isValid()) {
4119 return 'moment.invalid(/* ' + this._i + ' */)';
4120 }
4121 var func = 'moment';
4122 var zone = '';
4123 if (!this.isLocal()) {
4124 func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
4125 zone = 'Z';
4126 }
4127 var prefix = '[' + func + '("]';
4128 var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
4129 var datetime = '-MM-DD[T]HH:mm:ss.SSS';
4130 var suffix = zone + '[")]';
4131
4132 return this.format(prefix + year + datetime + suffix);
4133 }
4134
4135 function format (inputString) {
4136 if (!inputString) {
4137 inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
4138 }
4139 var output = formatMoment(this, inputString);
4140 return this.localeData().postformat(output);
4141 }
4142
4143 function from (time, withoutSuffix) {
4144 if (this.isValid() &&
4145 ((isMoment(time) && time.isValid()) ||
4146 createLocal(time).isValid())) {
4147 return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
4148 } else {
4149 return this.localeData().invalidDate();
4150 }
4151 }
4152
4153 function fromNow (withoutSuffix) {
4154 return this.from(createLocal(), withoutSuffix);
4155 }
4156
4157 function to (time, withoutSuffix) {
4158 if (this.isValid() &&
4159 ((isMoment(time) && time.isValid()) ||
4160 createLocal(time).isValid())) {
4161 return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
4162 } else {
4163 return this.localeData().invalidDate();
4164 }
4165 }
4166
4167 function toNow (withoutSuffix) {
4168 return this.to(createLocal(), withoutSuffix);
4169 }
4170
4171 // If passed a locale key, it will set the locale for this
4172 // instance. Otherwise, it will return the locale configuration
4173 // variables for this instance.
4174 function locale (key) {
4175 var newLocaleData;
4176
4177 if (key === undefined) {
4178 return this._locale._abbr;
4179 } else {
4180 newLocaleData = getLocale(key);
4181 if (newLocaleData != null) {
4182 this._locale = newLocaleData;
4183 }
4184 return this;
4185 }
4186 }
4187
4188 var lang = deprecate(
4189 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
4190 function (key) {
4191 if (key === undefined) {
4192 return this.localeData();
4193 } else {
4194 return this.locale(key);
4195 }
4196 }
4197 );
4198
4199 function localeData () {
4200 return this._locale;
4201 }
4202
4203 var MS_PER_SECOND = 1000;
4204 var MS_PER_MINUTE = 60 * MS_PER_SECOND;
4205 var MS_PER_HOUR = 60 * MS_PER_MINUTE;
4206 var MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
4207
4208 // actual modulo - handles negative numbers (for dates before 1970):
4209 function mod$1(dividend, divisor) {
4210 return (dividend % divisor + divisor) % divisor;
4211 }
4212
4213 function localStartOfDate(y, m, d) {
4214 // the date constructor remaps years 0-99 to 1900-1999
4215 if (y < 100 && y >= 0) {
4216 // preserve leap years using a full 400 year cycle, then reset
4217 return new Date(y + 400, m, d) - MS_PER_400_YEARS;
4218 } else {
4219 return new Date(y, m, d).valueOf();
4220 }
4221 }
4222
4223 function utcStartOfDate(y, m, d) {
4224 // Date.UTC remaps years 0-99 to 1900-1999
4225 if (y < 100 && y >= 0) {
4226 // preserve leap years using a full 400 year cycle, then reset
4227 return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
4228 } else {
4229 return Date.UTC(y, m, d);
4230 }
4231 }
4232
4233 function startOf (units) {
4234 var time;
4235 units = normalizeUnits(units);
4236 if (units === undefined || units === 'millisecond' || !this.isValid()) {
4237 return this;
4238 }
4239
4240 var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
4241
4242 switch (units) {
4243 case 'year':
4244 time = startOfDate(this.year(), 0, 1);
4245 break;
4246 case 'quarter':
4247 time = startOfDate(this.year(), this.month() - this.month() % 3, 1);
4248 break;
4249 case 'month':
4250 time = startOfDate(this.year(), this.month(), 1);
4251 break;
4252 case 'week':
4253 time = startOfDate(this.year(), this.month(), this.date() - this.weekday());
4254 break;
4255 case 'isoWeek':
4256 time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
4257 break;
4258 case 'day':
4259 case 'date':
4260 time = startOfDate(this.year(), this.month(), this.date());
4261 break;
4262 case 'hour':
4263 time = this._d.valueOf();
4264 time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR);
4265 break;
4266 case 'minute':
4267 time = this._d.valueOf();
4268 time -= mod$1(time, MS_PER_MINUTE);
4269 break;
4270 case 'second':
4271 time = this._d.valueOf();
4272 time -= mod$1(time, MS_PER_SECOND);
4273 break;
4274 }
4275
4276 this._d.setTime(time);
4277 hooks.updateOffset(this, true);
4278 return this;
4279 }
4280
4281 function endOf (units) {
4282 var time;
4283 units = normalizeUnits(units);
4284 if (units === undefined || units === 'millisecond' || !this.isValid()) {
4285 return this;
4286 }
4287
4288 var startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
4289
4290 switch (units) {
4291 case 'year':
4292 time = startOfDate(this.year() + 1, 0, 1) - 1;
4293 break;
4294 case 'quarter':
4295 time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
4296 break;
4297 case 'month':
4298 time = startOfDate(this.year(), this.month() + 1, 1) - 1;
4299 break;
4300 case 'week':
4301 time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
4302 break;
4303 case 'isoWeek':
4304 time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
4305 break;
4306 case 'day':
4307 case 'date':
4308 time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
4309 break;
4310 case 'hour':
4311 time = this._d.valueOf();
4312 time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1;
4313 break;
4314 case 'minute':
4315 time = this._d.valueOf();
4316 time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
4317 break;
4318 case 'second':
4319 time = this._d.valueOf();
4320 time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
4321 break;
4322 }
4323
4324 this._d.setTime(time);
4325 hooks.updateOffset(this, true);
4326 return this;
4327 }
4328
4329 function valueOf () {
4330 return this._d.valueOf() - ((this._offset || 0) * 60000);
4331 }
4332
4333 function unix () {
4334 return Math.floor(this.valueOf() / 1000);
4335 }
4336
4337 function toDate () {
4338 return new Date(this.valueOf());
4339 }
4340
4341 function toArray () {
4342 var m = this;
4343 return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
4344 }
4345
4346 function toObject () {
4347 var m = this;
4348 return {
4349 years: m.year(),
4350 months: m.month(),
4351 date: m.date(),
4352 hours: m.hours(),
4353 minutes: m.minutes(),
4354 seconds: m.seconds(),
4355 milliseconds: m.milliseconds()
4356 };
4357 }
4358
4359 function toJSON () {
4360 // new Date(NaN).toJSON() === null
4361 return this.isValid() ? this.toISOString() : null;
4362 }
4363
4364 function isValid$2 () {
4365 return isValid(this);
4366 }
4367
4368 function parsingFlags () {
4369 return extend({}, getParsingFlags(this));
4370 }
4371
4372 function invalidAt () {
4373 return getParsingFlags(this).overflow;
4374 }
4375
4376 function creationData() {
4377 return {
4378 input: this._i,
4379 format: this._f,
4380 locale: this._locale,
4381 isUTC: this._isUTC,
4382 strict: this._strict
4383 };
4384 }
4385
4386 // FORMATTING
4387
4388 addFormatToken(0, ['gg', 2], 0, function () {
4389 return this.weekYear() % 100;
4390 });
4391
4392 addFormatToken(0, ['GG', 2], 0, function () {
4393 return this.isoWeekYear() % 100;
4394 });
4395
4396 function addWeekYearFormatToken (token, getter) {
4397 addFormatToken(0, [token, token.length], 0, getter);
4398 }
4399
4400 addWeekYearFormatToken('gggg', 'weekYear');
4401 addWeekYearFormatToken('ggggg', 'weekYear');
4402 addWeekYearFormatToken('GGGG', 'isoWeekYear');
4403 addWeekYearFormatToken('GGGGG', 'isoWeekYear');
4404
4405 // ALIASES
4406
4407 addUnitAlias('weekYear', 'gg');
4408 addUnitAlias('isoWeekYear', 'GG');
4409
4410 // PRIORITY
4411
4412 addUnitPriority('weekYear', 1);
4413 addUnitPriority('isoWeekYear', 1);
4414
4415
4416 // PARSING
4417
4418 addRegexToken('G', matchSigned);
4419 addRegexToken('g', matchSigned);
4420 addRegexToken('GG', match1to2, match2);
4421 addRegexToken('gg', match1to2, match2);
4422 addRegexToken('GGGG', match1to4, match4);
4423 addRegexToken('gggg', match1to4, match4);
4424 addRegexToken('GGGGG', match1to6, match6);
4425 addRegexToken('ggggg', match1to6, match6);
4426
4427 addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
4428 week[token.substr(0, 2)] = toInt(input);
4429 });
4430
4431 addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
4432 week[token] = hooks.parseTwoDigitYear(input);
4433 });
4434
4435 // MOMENTS
4436
4437 function getSetWeekYear (input) {
4438 return getSetWeekYearHelper.call(this,
4439 input,
4440 this.week(),
4441 this.weekday(),
4442 this.localeData()._week.dow,
4443 this.localeData()._week.doy);
4444 }
4445
4446 function getSetISOWeekYear (input) {
4447 return getSetWeekYearHelper.call(this,
4448 input, this.isoWeek(), this.isoWeekday(), 1, 4);
4449 }
4450
4451 function getISOWeeksInYear () {
4452 return weeksInYear(this.year(), 1, 4);
4453 }
4454
4455 function getWeeksInYear () {
4456 var weekInfo = this.localeData()._week;
4457 return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
4458 }
4459
4460 function getSetWeekYearHelper(input, week, weekday, dow, doy) {
4461 var weeksTarget;
4462 if (input == null) {
4463 return weekOfYear(this, dow, doy).year;
4464 } else {
4465 weeksTarget = weeksInYear(input, dow, doy);
4466 if (week > weeksTarget) {
4467 week = weeksTarget;
4468 }
4469 return setWeekAll.call(this, input, week, weekday, dow, doy);
4470 }
4471 }
4472
4473 function setWeekAll(weekYear, week, weekday, dow, doy) {
4474 var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
4475 date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
4476
4477 this.year(date.getUTCFullYear());
4478 this.month(date.getUTCMonth());
4479 this.date(date.getUTCDate());
4480 return this;
4481 }
4482
4483 // FORMATTING
4484
4485 addFormatToken('Q', 0, 'Qo', 'quarter');
4486
4487 // ALIASES
4488
4489 addUnitAlias('quarter', 'Q');
4490
4491 // PRIORITY
4492
4493 addUnitPriority('quarter', 7);
4494
4495 // PARSING
4496
4497 addRegexToken('Q', match1);
4498 addParseToken('Q', function (input, array) {
4499 array[MONTH] = (toInt(input) - 1) * 3;
4500 });
4501
4502 // MOMENTS
4503
4504 function getSetQuarter (input) {
4505 return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
4506 }
4507
4508 // FORMATTING
4509
4510 addFormatToken('D', ['DD', 2], 'Do', 'date');
4511
4512 // ALIASES
4513
4514 addUnitAlias('date', 'D');
4515
4516 // PRIORITY
4517 addUnitPriority('date', 9);
4518
4519 // PARSING
4520
4521 addRegexToken('D', match1to2);
4522 addRegexToken('DD', match1to2, match2);
4523 addRegexToken('Do', function (isStrict, locale) {
4524 // TODO: Remove "ordinalParse" fallback in next major release.
4525 return isStrict ?
4526 (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :
4527 locale._dayOfMonthOrdinalParseLenient;
4528 });
4529
4530 addParseToken(['D', 'DD'], DATE);
4531 addParseToken('Do', function (input, array) {
4532 array[DATE] = toInt(input.match(match1to2)[0]);
4533 });
4534
4535 // MOMENTS
4536
4537 var getSetDayOfMonth = makeGetSet('Date', true);
4538
4539 // FORMATTING
4540
4541 addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
4542
4543 // ALIASES
4544
4545 addUnitAlias('dayOfYear', 'DDD');
4546
4547 // PRIORITY
4548 addUnitPriority('dayOfYear', 4);
4549
4550 // PARSING
4551
4552 addRegexToken('DDD', match1to3);
4553 addRegexToken('DDDD', match3);
4554 addParseToken(['DDD', 'DDDD'], function (input, array, config) {
4555 config._dayOfYear = toInt(input);
4556 });
4557
4558 // HELPERS
4559
4560 // MOMENTS
4561
4562 function getSetDayOfYear (input) {
4563 var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
4564 return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
4565 }
4566
4567 // FORMATTING
4568
4569 addFormatToken('m', ['mm', 2], 0, 'minute');
4570
4571 // ALIASES
4572
4573 addUnitAlias('minute', 'm');
4574
4575 // PRIORITY
4576
4577 addUnitPriority('minute', 14);
4578
4579 // PARSING
4580
4581 addRegexToken('m', match1to2);
4582 addRegexToken('mm', match1to2, match2);
4583 addParseToken(['m', 'mm'], MINUTE);
4584
4585 // MOMENTS
4586
4587 var getSetMinute = makeGetSet('Minutes', false);
4588
4589 // FORMATTING
4590
4591 addFormatToken('s', ['ss', 2], 0, 'second');
4592
4593 // ALIASES
4594
4595 addUnitAlias('second', 's');
4596
4597 // PRIORITY
4598
4599 addUnitPriority('second', 15);
4600
4601 // PARSING
4602
4603 addRegexToken('s', match1to2);
4604 addRegexToken('ss', match1to2, match2);
4605 addParseToken(['s', 'ss'], SECOND);
4606
4607 // MOMENTS
4608
4609 var getSetSecond = makeGetSet('Seconds', false);
4610
4611 // FORMATTING
4612
4613 addFormatToken('S', 0, 0, function () {
4614 return ~~(this.millisecond() / 100);
4615 });
4616
4617 addFormatToken(0, ['SS', 2], 0, function () {
4618 return ~~(this.millisecond() / 10);
4619 });
4620
4621 addFormatToken(0, ['SSS', 3], 0, 'millisecond');
4622 addFormatToken(0, ['SSSS', 4], 0, function () {
4623 return this.millisecond() * 10;
4624 });
4625 addFormatToken(0, ['SSSSS', 5], 0, function () {
4626 return this.millisecond() * 100;
4627 });
4628 addFormatToken(0, ['SSSSSS', 6], 0, function () {
4629 return this.millisecond() * 1000;
4630 });
4631 addFormatToken(0, ['SSSSSSS', 7], 0, function () {
4632 return this.millisecond() * 10000;
4633 });
4634 addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
4635 return this.millisecond() * 100000;
4636 });
4637 addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
4638 return this.millisecond() * 1000000;
4639 });
4640
4641
4642 // ALIASES
4643
4644 addUnitAlias('millisecond', 'ms');
4645
4646 // PRIORITY
4647
4648 addUnitPriority('millisecond', 16);
4649
4650 // PARSING
4651
4652 addRegexToken('S', match1to3, match1);
4653 addRegexToken('SS', match1to3, match2);
4654 addRegexToken('SSS', match1to3, match3);
4655
4656 var token;
4657 for (token = 'SSSS'; token.length <= 9; token += 'S') {
4658 addRegexToken(token, matchUnsigned);
4659 }
4660
4661 function parseMs(input, array) {
4662 array[MILLISECOND] = toInt(('0.' + input) * 1000);
4663 }
4664
4665 for (token = 'S'; token.length <= 9; token += 'S') {
4666 addParseToken(token, parseMs);
4667 }
4668 // MOMENTS
4669
4670 var getSetMillisecond = makeGetSet('Milliseconds', false);
4671
4672 // FORMATTING
4673
4674 addFormatToken('z', 0, 0, 'zoneAbbr');
4675 addFormatToken('zz', 0, 0, 'zoneName');
4676
4677 // MOMENTS
4678
4679 function getZoneAbbr () {
4680 return this._isUTC ? 'UTC' : '';
4681 }
4682
4683 function getZoneName () {
4684 return this._isUTC ? 'Coordinated Universal Time' : '';
4685 }
4686
4687 var proto = Moment.prototype;
4688
4689 proto.add = add;
4690 proto.calendar = calendar$1;
4691 proto.clone = clone;
4692 proto.diff = diff;
4693 proto.endOf = endOf;
4694 proto.format = format;
4695 proto.from = from;
4696 proto.fromNow = fromNow;
4697 proto.to = to;
4698 proto.toNow = toNow;
4699 proto.get = stringGet;
4700 proto.invalidAt = invalidAt;
4701 proto.isAfter = isAfter;
4702 proto.isBefore = isBefore;
4703 proto.isBetween = isBetween;
4704 proto.isSame = isSame;
4705 proto.isSameOrAfter = isSameOrAfter;
4706 proto.isSameOrBefore = isSameOrBefore;
4707 proto.isValid = isValid$2;
4708 proto.lang = lang;
4709 proto.locale = locale;
4710 proto.localeData = localeData;
4711 proto.max = prototypeMax;
4712 proto.min = prototypeMin;
4713 proto.parsingFlags = parsingFlags;
4714 proto.set = stringSet;
4715 proto.startOf = startOf;
4716 proto.subtract = subtract;
4717 proto.toArray = toArray;
4718 proto.toObject = toObject;
4719 proto.toDate = toDate;
4720 proto.toISOString = toISOString;
4721 proto.inspect = inspect;
4722 proto.toJSON = toJSON;
4723 proto.toString = toString;
4724 proto.unix = unix;
4725 proto.valueOf = valueOf;
4726 proto.creationData = creationData;
4727 proto.year = getSetYear;
4728 proto.isLeapYear = getIsLeapYear;
4729 proto.weekYear = getSetWeekYear;
4730 proto.isoWeekYear = getSetISOWeekYear;
4731 proto.quarter = proto.quarters = getSetQuarter;
4732 proto.month = getSetMonth;
4733 proto.daysInMonth = getDaysInMonth;
4734 proto.week = proto.weeks = getSetWeek;
4735 proto.isoWeek = proto.isoWeeks = getSetISOWeek;
4736 proto.weeksInYear = getWeeksInYear;
4737 proto.isoWeeksInYear = getISOWeeksInYear;
4738 proto.date = getSetDayOfMonth;
4739 proto.day = proto.days = getSetDayOfWeek;
4740 proto.weekday = getSetLocaleDayOfWeek;
4741 proto.isoWeekday = getSetISODayOfWeek;
4742 proto.dayOfYear = getSetDayOfYear;
4743 proto.hour = proto.hours = getSetHour;
4744 proto.minute = proto.minutes = getSetMinute;
4745 proto.second = proto.seconds = getSetSecond;
4746 proto.millisecond = proto.milliseconds = getSetMillisecond;
4747 proto.utcOffset = getSetOffset;
4748 proto.utc = setOffsetToUTC;
4749 proto.local = setOffsetToLocal;
4750 proto.parseZone = setOffsetToParsedOffset;
4751 proto.hasAlignedHourOffset = hasAlignedHourOffset;
4752 proto.isDST = isDaylightSavingTime;
4753 proto.isLocal = isLocal;
4754 proto.isUtcOffset = isUtcOffset;
4755 proto.isUtc = isUtc;
4756 proto.isUTC = isUtc;
4757 proto.zoneAbbr = getZoneAbbr;
4758 proto.zoneName = getZoneName;
4759 proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
4760 proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
4761 proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
4762 proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
4763 proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
4764
4765 function createUnix (input) {
4766 return createLocal(input * 1000);
4767 }
4768
4769 function createInZone () {
4770 return createLocal.apply(null, arguments).parseZone();
4771 }
4772
4773 function preParsePostFormat (string) {
4774 return string;
4775 }
4776
4777 var proto$1 = Locale.prototype;
4778
4779 proto$1.calendar = calendar;
4780 proto$1.longDateFormat = longDateFormat;
4781 proto$1.invalidDate = invalidDate;
4782 proto$1.ordinal = ordinal;
4783 proto$1.preparse = preParsePostFormat;
4784 proto$1.postformat = preParsePostFormat;
4785 proto$1.relativeTime = relativeTime;
4786 proto$1.pastFuture = pastFuture;
4787 proto$1.set = set;
4788
4789 proto$1.months = localeMonths;
4790 proto$1.monthsShort = localeMonthsShort;
4791 proto$1.monthsParse = localeMonthsParse;
4792 proto$1.monthsRegex = monthsRegex;
4793 proto$1.monthsShortRegex = monthsShortRegex;
4794 proto$1.week = localeWeek;
4795 proto$1.firstDayOfYear = localeFirstDayOfYear;
4796 proto$1.firstDayOfWeek = localeFirstDayOfWeek;
4797
4798 proto$1.weekdays = localeWeekdays;
4799 proto$1.weekdaysMin = localeWeekdaysMin;
4800 proto$1.weekdaysShort = localeWeekdaysShort;
4801 proto$1.weekdaysParse = localeWeekdaysParse;
4802
4803 proto$1.weekdaysRegex = weekdaysRegex;
4804 proto$1.weekdaysShortRegex = weekdaysShortRegex;
4805 proto$1.weekdaysMinRegex = weekdaysMinRegex;
4806
4807 proto$1.isPM = localeIsPM;
4808 proto$1.meridiem = localeMeridiem;
4809
4810 function get$1 (format, index, field, setter) {
4811 var locale = getLocale();
4812 var utc = createUTC().set(setter, index);
4813 return locale[field](utc, format);
4814 }
4815
4816 function listMonthsImpl (format, index, field) {
4817 if (isNumber(format)) {
4818 index = format;
4819 format = undefined;
4820 }
4821
4822 format = format || '';
4823
4824 if (index != null) {
4825 return get$1(format, index, field, 'month');
4826 }
4827
4828 var i;
4829 var out = [];
4830 for (i = 0; i < 12; i++) {
4831 out[i] = get$1(format, i, field, 'month');
4832 }
4833 return out;
4834 }
4835
4836 // ()
4837 // (5)
4838 // (fmt, 5)
4839 // (fmt)
4840 // (true)
4841 // (true, 5)
4842 // (true, fmt, 5)
4843 // (true, fmt)
4844 function listWeekdaysImpl (localeSorted, format, index, field) {
4845 if (typeof localeSorted === 'boolean') {
4846 if (isNumber(format)) {
4847 index = format;
4848 format = undefined;
4849 }
4850
4851 format = format || '';
4852 } else {
4853 format = localeSorted;
4854 index = format;
4855 localeSorted = false;
4856
4857 if (isNumber(format)) {
4858 index = format;
4859 format = undefined;
4860 }
4861
4862 format = format || '';
4863 }
4864
4865 var locale = getLocale(),
4866 shift = localeSorted ? locale._week.dow : 0;
4867
4868 if (index != null) {
4869 return get$1(format, (index + shift) % 7, field, 'day');
4870 }
4871
4872 var i;
4873 var out = [];
4874 for (i = 0; i < 7; i++) {
4875 out[i] = get$1(format, (i + shift) % 7, field, 'day');
4876 }
4877 return out;
4878 }
4879
4880 function listMonths (format, index) {
4881 return listMonthsImpl(format, index, 'months');
4882 }
4883
4884 function listMonthsShort (format, index) {
4885 return listMonthsImpl(format, index, 'monthsShort');
4886 }
4887
4888 function listWeekdays (localeSorted, format, index) {
4889 return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
4890 }
4891
4892 function listWeekdaysShort (localeSorted, format, index) {
4893 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
4894 }
4895
4896 function listWeekdaysMin (localeSorted, format, index) {
4897 return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
4898 }
4899
4900 getSetGlobalLocale('en', {
4901 dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
4902 ordinal : function (number) {
4903 var b = number % 10,
4904 output = (toInt(number % 100 / 10) === 1) ? 'th' :
4905 (b === 1) ? 'st' :
4906 (b === 2) ? 'nd' :
4907 (b === 3) ? 'rd' : 'th';
4908 return number + output;
4909 }
4910 });
4911
4912 // Side effect imports
4913
4914 hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
4915 hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
4916
4917 var mathAbs = Math.abs;
4918
4919 function abs () {
4920 var data = this._data;
4921
4922 this._milliseconds = mathAbs(this._milliseconds);
4923 this._days = mathAbs(this._days);
4924 this._months = mathAbs(this._months);
4925
4926 data.milliseconds = mathAbs(data.milliseconds);
4927 data.seconds = mathAbs(data.seconds);
4928 data.minutes = mathAbs(data.minutes);
4929 data.hours = mathAbs(data.hours);
4930 data.months = mathAbs(data.months);
4931 data.years = mathAbs(data.years);
4932
4933 return this;
4934 }
4935
4936 function addSubtract$1 (duration, input, value, direction) {
4937 var other = createDuration(input, value);
4938
4939 duration._milliseconds += direction * other._milliseconds;
4940 duration._days += direction * other._days;
4941 duration._months += direction * other._months;
4942
4943 return duration._bubble();
4944 }
4945
4946 // supports only 2.0-style add(1, 's') or add(duration)
4947 function add$1 (input, value) {
4948 return addSubtract$1(this, input, value, 1);
4949 }
4950
4951 // supports only 2.0-style subtract(1, 's') or subtract(duration)
4952 function subtract$1 (input, value) {
4953 return addSubtract$1(this, input, value, -1);
4954 }
4955
4956 function absCeil (number) {
4957 if (number < 0) {
4958 return Math.floor(number);
4959 } else {
4960 return Math.ceil(number);
4961 }
4962 }
4963
4964 function bubble () {
4965 var milliseconds = this._milliseconds;
4966 var days = this._days;
4967 var months = this._months;
4968 var data = this._data;
4969 var seconds, minutes, hours, years, monthsFromDays;
4970
4971 // if we have a mix of positive and negative values, bubble down first
4972 // check: https://github.com/moment/moment/issues/2166
4973 if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
4974 (milliseconds <= 0 && days <= 0 && months <= 0))) {
4975 milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
4976 days = 0;
4977 months = 0;
4978 }
4979
4980 // The following code bubbles up values, see the tests for
4981 // examples of what that means.
4982 data.milliseconds = milliseconds % 1000;
4983
4984 seconds = absFloor(milliseconds / 1000);
4985 data.seconds = seconds % 60;
4986
4987 minutes = absFloor(seconds / 60);
4988 data.minutes = minutes % 60;
4989
4990 hours = absFloor(minutes / 60);
4991 data.hours = hours % 24;
4992
4993 days += absFloor(hours / 24);
4994
4995 // convert days to months
4996 monthsFromDays = absFloor(daysToMonths(days));
4997 months += monthsFromDays;
4998 days -= absCeil(monthsToDays(monthsFromDays));
4999
5000 // 12 months -> 1 year
5001 years = absFloor(months / 12);
5002 months %= 12;
5003
5004 data.days = days;
5005 data.months = months;
5006 data.years = years;
5007
5008 return this;
5009 }
5010
5011 function daysToMonths (days) {
5012 // 400 years have 146097 days (taking into account leap year rules)
5013 // 400 years have 12 months === 4800
5014 return days * 4800 / 146097;
5015 }
5016
5017 function monthsToDays (months) {
5018 // the reverse of daysToMonths
5019 return months * 146097 / 4800;
5020 }
5021
5022 function as (units) {
5023 if (!this.isValid()) {
5024 return NaN;
5025 }
5026 var days;
5027 var months;
5028 var milliseconds = this._milliseconds;
5029
5030 units = normalizeUnits(units);
5031
5032 if (units === 'month' || units === 'quarter' || units === 'year') {
5033 days = this._days + milliseconds / 864e5;
5034 months = this._months + daysToMonths(days);
5035 switch (units) {
5036 case 'month': return months;
5037 case 'quarter': return months / 3;
5038 case 'year': return months / 12;
5039 }
5040 } else {
5041 // handle milliseconds separately because of floating point math errors (issue #1867)
5042 days = this._days + Math.round(monthsToDays(this._months));
5043 switch (units) {
5044 case 'week' : return days / 7 + milliseconds / 6048e5;
5045 case 'day' : return days + milliseconds / 864e5;
5046 case 'hour' : return days * 24 + milliseconds / 36e5;
5047 case 'minute' : return days * 1440 + milliseconds / 6e4;
5048 case 'second' : return days * 86400 + milliseconds / 1000;
5049 // Math.floor prevents floating point math errors here
5050 case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
5051 default: throw new Error('Unknown unit ' + units);
5052 }
5053 }
5054 }
5055
5056 // TODO: Use this.as('ms')?
5057 function valueOf$1 () {
5058 if (!this.isValid()) {
5059 return NaN;
5060 }
5061 return (
5062 this._milliseconds +
5063 this._days * 864e5 +
5064 (this._months % 12) * 2592e6 +
5065 toInt(this._months / 12) * 31536e6
5066 );
5067 }
5068
5069 function makeAs (alias) {
5070 return function () {
5071 return this.as(alias);
5072 };
5073 }
5074
5075 var asMilliseconds = makeAs('ms');
5076 var asSeconds = makeAs('s');
5077 var asMinutes = makeAs('m');
5078 var asHours = makeAs('h');
5079 var asDays = makeAs('d');
5080 var asWeeks = makeAs('w');
5081 var asMonths = makeAs('M');
5082 var asQuarters = makeAs('Q');
5083 var asYears = makeAs('y');
5084
5085 function clone$1 () {
5086 return createDuration(this);
5087 }
5088
5089 function get$2 (units) {
5090 units = normalizeUnits(units);
5091 return this.isValid() ? this[units + 's']() : NaN;
5092 }
5093
5094 function makeGetter(name) {
5095 return function () {
5096 return this.isValid() ? this._data[name] : NaN;
5097 };
5098 }
5099
5100 var milliseconds = makeGetter('milliseconds');
5101 var seconds = makeGetter('seconds');
5102 var minutes = makeGetter('minutes');
5103 var hours = makeGetter('hours');
5104 var days = makeGetter('days');
5105 var months = makeGetter('months');
5106 var years = makeGetter('years');
5107
5108 function weeks () {
5109 return absFloor(this.days() / 7);
5110 }
5111
5112 var round = Math.round;
5113 var thresholds = {
5114 ss: 44, // a few seconds to seconds
5115 s : 45, // seconds to minute
5116 m : 45, // minutes to hour
5117 h : 22, // hours to day
5118 d : 26, // days to month
5119 M : 11 // months to year
5120 };
5121
5122 // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
5123 function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
5124 return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
5125 }
5126
5127 function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
5128 var duration = createDuration(posNegDuration).abs();
5129 var seconds = round(duration.as('s'));
5130 var minutes = round(duration.as('m'));
5131 var hours = round(duration.as('h'));
5132 var days = round(duration.as('d'));
5133 var months = round(duration.as('M'));
5134 var years = round(duration.as('y'));
5135
5136 var a = seconds <= thresholds.ss && ['s', seconds] ||
5137 seconds < thresholds.s && ['ss', seconds] ||
5138 minutes <= 1 && ['m'] ||
5139 minutes < thresholds.m && ['mm', minutes] ||
5140 hours <= 1 && ['h'] ||
5141 hours < thresholds.h && ['hh', hours] ||
5142 days <= 1 && ['d'] ||
5143 days < thresholds.d && ['dd', days] ||
5144 months <= 1 && ['M'] ||
5145 months < thresholds.M && ['MM', months] ||
5146 years <= 1 && ['y'] || ['yy', years];
5147
5148 a[2] = withoutSuffix;
5149 a[3] = +posNegDuration > 0;
5150 a[4] = locale;
5151 return substituteTimeAgo.apply(null, a);
5152 }
5153
5154 // This function allows you to set the rounding function for relative time strings
5155 function getSetRelativeTimeRounding (roundingFunction) {
5156 if (roundingFunction === undefined) {
5157 return round;
5158 }
5159 if (typeof(roundingFunction) === 'function') {
5160 round = roundingFunction;
5161 return true;
5162 }
5163 return false;
5164 }
5165
5166 // This function allows you to set a threshold for relative time strings
5167 function getSetRelativeTimeThreshold (threshold, limit) {
5168 if (thresholds[threshold] === undefined) {
5169 return false;
5170 }
5171 if (limit === undefined) {
5172 return thresholds[threshold];
5173 }
5174 thresholds[threshold] = limit;
5175 if (threshold === 's') {
5176 thresholds.ss = limit - 1;
5177 }
5178 return true;
5179 }
5180
5181 function humanize (withSuffix) {
5182 if (!this.isValid()) {
5183 return this.localeData().invalidDate();
5184 }
5185
5186 var locale = this.localeData();
5187 var output = relativeTime$1(this, !withSuffix, locale);
5188
5189 if (withSuffix) {
5190 output = locale.pastFuture(+this, output);
5191 }
5192
5193 return locale.postformat(output);
5194 }
5195
5196 var abs$1 = Math.abs;
5197
5198 function sign(x) {
5199 return ((x > 0) - (x < 0)) || +x;
5200 }
5201
5202 function toISOString$1() {
5203 // for ISO strings we do not use the normal bubbling rules:
5204 // * milliseconds bubble up until they become hours
5205 // * days do not bubble at all
5206 // * months bubble up until they become years
5207 // This is because there is no context-free conversion between hours and days
5208 // (think of clock changes)
5209 // and also not between days and months (28-31 days per month)
5210 if (!this.isValid()) {
5211 return this.localeData().invalidDate();
5212 }
5213
5214 var seconds = abs$1(this._milliseconds) / 1000;
5215 var days = abs$1(this._days);
5216 var months = abs$1(this._months);
5217 var minutes, hours, years;
5218
5219 // 3600 seconds -> 60 minutes -> 1 hour
5220 minutes = absFloor(seconds / 60);
5221 hours = absFloor(minutes / 60);
5222 seconds %= 60;
5223 minutes %= 60;
5224
5225 // 12 months -> 1 year
5226 years = absFloor(months / 12);
5227 months %= 12;
5228
5229
5230 // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
5231 var Y = years;
5232 var M = months;
5233 var D = days;
5234 var h = hours;
5235 var m = minutes;
5236 var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
5237 var total = this.asSeconds();
5238
5239 if (!total) {
5240 // this is the same as C#'s (Noda) and python (isodate)...
5241 // but not other JS (goog.date)
5242 return 'P0D';
5243 }
5244
5245 var totalSign = total < 0 ? '-' : '';
5246 var ymSign = sign(this._months) !== sign(total) ? '-' : '';
5247 var daysSign = sign(this._days) !== sign(total) ? '-' : '';
5248 var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
5249
5250 return totalSign + 'P' +
5251 (Y ? ymSign + Y + 'Y' : '') +
5252 (M ? ymSign + M + 'M' : '') +
5253 (D ? daysSign + D + 'D' : '') +
5254 ((h || m || s) ? 'T' : '') +
5255 (h ? hmsSign + h + 'H' : '') +
5256 (m ? hmsSign + m + 'M' : '') +
5257 (s ? hmsSign + s + 'S' : '');
5258 }
5259
5260 var proto$2 = Duration.prototype;
5261
5262 proto$2.isValid = isValid$1;
5263 proto$2.abs = abs;
5264 proto$2.add = add$1;
5265 proto$2.subtract = subtract$1;
5266 proto$2.as = as;
5267 proto$2.asMilliseconds = asMilliseconds;
5268 proto$2.asSeconds = asSeconds;
5269 proto$2.asMinutes = asMinutes;
5270 proto$2.asHours = asHours;
5271 proto$2.asDays = asDays;
5272 proto$2.asWeeks = asWeeks;
5273 proto$2.asMonths = asMonths;
5274 proto$2.asQuarters = asQuarters;
5275 proto$2.asYears = asYears;
5276 proto$2.valueOf = valueOf$1;
5277 proto$2._bubble = bubble;
5278 proto$2.clone = clone$1;
5279 proto$2.get = get$2;
5280 proto$2.milliseconds = milliseconds;
5281 proto$2.seconds = seconds;
5282 proto$2.minutes = minutes;
5283 proto$2.hours = hours;
5284 proto$2.days = days;
5285 proto$2.weeks = weeks;
5286 proto$2.months = months;
5287 proto$2.years = years;
5288 proto$2.humanize = humanize;
5289 proto$2.toISOString = toISOString$1;
5290 proto$2.toString = toISOString$1;
5291 proto$2.toJSON = toISOString$1;
5292 proto$2.locale = locale;
5293 proto$2.localeData = localeData;
5294
5295 proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
5296 proto$2.lang = lang;
5297
5298 // Side effect imports
5299
5300 // FORMATTING
5301
5302 addFormatToken('X', 0, 0, 'unix');
5303 addFormatToken('x', 0, 0, 'valueOf');
5304
5305 // PARSING
5306
5307 addRegexToken('x', matchSigned);
5308 addRegexToken('X', matchTimestamp);
5309 addParseToken('X', function (input, array, config) {
5310 config._d = new Date(parseFloat(input, 10) * 1000);
5311 });
5312 addParseToken('x', function (input, array, config) {
5313 config._d = new Date(toInt(input));
5314 });
5315
5316 // Side effect imports
5317
5318
5319 hooks.version = '2.24.0';
5320
5321 setHookCallback(createLocal);
5322
5323 hooks.fn = proto;
5324 hooks.min = min;
5325 hooks.max = max;
5326 hooks.now = now;
5327 hooks.utc = createUTC;
5328 hooks.unix = createUnix;
5329 hooks.months = listMonths;
5330 hooks.isDate = isDate;
5331 hooks.locale = getSetGlobalLocale;
5332 hooks.invalid = createInvalid;
5333 hooks.duration = createDuration;
5334 hooks.isMoment = isMoment;
5335 hooks.weekdays = listWeekdays;
5336 hooks.parseZone = createInZone;
5337 hooks.localeData = getLocale;
5338 hooks.isDuration = isDuration;
5339 hooks.monthsShort = listMonthsShort;
5340 hooks.weekdaysMin = listWeekdaysMin;
5341 hooks.defineLocale = defineLocale;
5342 hooks.updateLocale = updateLocale;
5343 hooks.locales = listLocales;
5344 hooks.weekdaysShort = listWeekdaysShort;
5345 hooks.normalizeUnits = normalizeUnits;
5346 hooks.relativeTimeRounding = getSetRelativeTimeRounding;
5347 hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
5348 hooks.calendarFormat = getCalendarFormat;
5349 hooks.prototype = proto;
5350
5351 // currently HTML5 input type only supports 24-hour formats
5352 hooks.HTML5_FMT = {
5353 DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
5354 DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
5355 DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
5356 DATE: 'YYYY-MM-DD', // <input type="date" />
5357 TIME: 'HH:mm', // <input type="time" />
5358 TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
5359 TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
5360 WEEK: 'GGGG-[W]WW', // <input type="week" />
5361 MONTH: 'YYYY-MM' // <input type="month" />
5362 };
5363
5364 return hooks;
5365
5366})));
5367
5368
5369/***/ }),
5370/* 21 */
5371/***/ (function(module, exports) {
5372
5373module.exports = function (bitmap, value) {
5374 return {
5375 enumerable: !(bitmap & 1),
5376 configurable: !(bitmap & 2),
5377 writable: !(bitmap & 4),
5378 value: value
5379 };
5380};
5381
5382
5383/***/ }),
5384/* 22 */
5385/***/ (function(module, exports, __webpack_require__) {
5386
5387// 19.1.2.14 / 15.2.3.14 Object.keys(O)
5388var $keys = __webpack_require__(45);
5389var enumBugKeys = __webpack_require__(32);
5390
5391module.exports = Object.keys || function keys(O) {
5392 return $keys(O, enumBugKeys);
5393};
5394
5395
5396/***/ }),
5397/* 23 */
5398/***/ (function(module, exports) {
5399
5400module.exports = true;
5401
5402
5403/***/ }),
5404/* 24 */
5405/***/ (function(module, exports) {
5406
5407var id = 0;
5408var px = Math.random();
5409module.exports = function (key) {
5410 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
5411};
5412
5413
5414/***/ }),
5415/* 25 */
5416/***/ (function(module, exports) {
5417
5418exports.f = {}.propertyIsEnumerable;
5419
5420
5421/***/ }),
5422/* 26 */
5423/***/ (function(module, exports, __webpack_require__) {
5424
5425"use strict";
5426
5427
5428exports.__esModule = true;
5429
5430var _assign = __webpack_require__(62);
5431
5432var _assign2 = _interopRequireDefault(_assign);
5433
5434function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5435
5436exports.default = _assign2.default || function (target) {
5437 for (var i = 1; i < arguments.length; i++) {
5438 var source = arguments[i];
5439
5440 for (var key in source) {
5441 if (Object.prototype.hasOwnProperty.call(source, key)) {
5442 target[key] = source[key];
5443 }
5444 }
5445 }
5446
5447 return target;
5448};
5449
5450/***/ }),
5451/* 27 */
5452/***/ (function(module, exports, __webpack_require__) {
5453
5454// 7.1.1 ToPrimitive(input [, PreferredType])
5455var isObject = __webpack_require__(11);
5456// instead of the ES6 spec version, we didn't implement @@toPrimitive case
5457// and the second argument - flag - preferred type is a string
5458module.exports = function (it, S) {
5459 if (!isObject(it)) return it;
5460 var fn, val;
5461 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
5462 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
5463 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
5464 throw TypeError("Can't convert object to primitive value");
5465};
5466
5467
5468/***/ }),
5469/* 28 */
5470/***/ (function(module, exports) {
5471
5472// 7.2.1 RequireObjectCoercible(argument)
5473module.exports = function (it) {
5474 if (it == undefined) throw TypeError("Can't call method on " + it);
5475 return it;
5476};
5477
5478
5479/***/ }),
5480/* 29 */
5481/***/ (function(module, exports) {
5482
5483// 7.1.4 ToInteger
5484var ceil = Math.ceil;
5485var floor = Math.floor;
5486module.exports = function (it) {
5487 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
5488};
5489
5490
5491/***/ }),
5492/* 30 */
5493/***/ (function(module, exports, __webpack_require__) {
5494
5495var shared = __webpack_require__(31)('keys');
5496var uid = __webpack_require__(24);
5497module.exports = function (key) {
5498 return shared[key] || (shared[key] = uid(key));
5499};
5500
5501
5502/***/ }),
5503/* 31 */
5504/***/ (function(module, exports, __webpack_require__) {
5505
5506var core = __webpack_require__(6);
5507var global = __webpack_require__(5);
5508var SHARED = '__core-js_shared__';
5509var store = global[SHARED] || (global[SHARED] = {});
5510
5511(module.exports = function (key, value) {
5512 return store[key] || (store[key] = value !== undefined ? value : {});
5513})('versions', []).push({
5514 version: core.version,
5515 mode: __webpack_require__(23) ? 'pure' : 'global',
5516 copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
5517});
5518
5519
5520/***/ }),
5521/* 32 */
5522/***/ (function(module, exports) {
5523
5524// IE 8- don't enum bug keys
5525module.exports = (
5526 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
5527).split(',');
5528
5529
5530/***/ }),
5531/* 33 */
5532/***/ (function(module, exports) {
5533
5534exports.f = Object.getOwnPropertySymbols;
5535
5536
5537/***/ }),
5538/* 34 */
5539/***/ (function(module, exports) {
5540
5541module.exports = {};
5542
5543
5544/***/ }),
5545/* 35 */
5546/***/ (function(module, exports, __webpack_require__) {
5547
5548// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
5549var anObject = __webpack_require__(17);
5550var dPs = __webpack_require__(75);
5551var enumBugKeys = __webpack_require__(32);
5552var IE_PROTO = __webpack_require__(30)('IE_PROTO');
5553var Empty = function () { /* empty */ };
5554var PROTOTYPE = 'prototype';
5555
5556// Create object with fake `null` prototype: use iframe Object with cleared prototype
5557var createDict = function () {
5558 // Thrash, waste and sodomy: IE GC bug
5559 var iframe = __webpack_require__(44)('iframe');
5560 var i = enumBugKeys.length;
5561 var lt = '<';
5562 var gt = '>';
5563 var iframeDocument;
5564 iframe.style.display = 'none';
5565 __webpack_require__(76).appendChild(iframe);
5566 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
5567 // createDict = iframe.contentWindow.Object;
5568 // html.removeChild(iframe);
5569 iframeDocument = iframe.contentWindow.document;
5570 iframeDocument.open();
5571 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
5572 iframeDocument.close();
5573 createDict = iframeDocument.F;
5574 while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
5575 return createDict();
5576};
5577
5578module.exports = Object.create || function create(O, Properties) {
5579 var result;
5580 if (O !== null) {
5581 Empty[PROTOTYPE] = anObject(O);
5582 result = new Empty();
5583 Empty[PROTOTYPE] = null;
5584 // add "__proto__" for Object.getPrototypeOf polyfill
5585 result[IE_PROTO] = O;
5586 } else result = createDict();
5587 return Properties === undefined ? result : dPs(result, Properties);
5588};
5589
5590
5591/***/ }),
5592/* 36 */
5593/***/ (function(module, exports, __webpack_require__) {
5594
5595var def = __webpack_require__(10).f;
5596var has = __webpack_require__(7);
5597var TAG = __webpack_require__(14)('toStringTag');
5598
5599module.exports = function (it, tag, stat) {
5600 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
5601};
5602
5603
5604/***/ }),
5605/* 37 */
5606/***/ (function(module, exports, __webpack_require__) {
5607
5608exports.f = __webpack_require__(14);
5609
5610
5611/***/ }),
5612/* 38 */
5613/***/ (function(module, exports, __webpack_require__) {
5614
5615var global = __webpack_require__(5);
5616var core = __webpack_require__(6);
5617var LIBRARY = __webpack_require__(23);
5618var wksExt = __webpack_require__(37);
5619var defineProperty = __webpack_require__(10).f;
5620module.exports = function (name) {
5621 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
5622 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
5623};
5624
5625
5626/***/ }),
5627/* 39 */
5628/***/ (function(module, exports) {
5629
5630module.exports = __WEBPACK_EXTERNAL_MODULE_39__;
5631
5632/***/ }),
5633/* 40 */
5634/***/ (function(module, exports, __webpack_require__) {
5635
5636"use strict";
5637/**
5638 * Copyright (c) 2013-present, Facebook, Inc.
5639 *
5640 * This source code is licensed under the MIT license found in the
5641 * LICENSE file in the root directory of this source tree.
5642 */
5643
5644
5645
5646var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
5647
5648module.exports = ReactPropTypesSecret;
5649
5650
5651/***/ }),
5652/* 41 */
5653/***/ (function(module, __webpack_exports__, __webpack_require__) {
5654
5655"use strict";
5656/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return polyfill; });
5657/**
5658 * Copyright (c) 2013-present, Facebook, Inc.
5659 *
5660 * This source code is licensed under the MIT license found in the
5661 * LICENSE file in the root directory of this source tree.
5662 */
5663
5664function componentWillMount() {
5665 // Call this.constructor.gDSFP to support sub-classes.
5666 var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
5667 if (state !== null && state !== undefined) {
5668 this.setState(state);
5669 }
5670}
5671
5672function componentWillReceiveProps(nextProps) {
5673 // Call this.constructor.gDSFP to support sub-classes.
5674 // Use the setState() updater to ensure state isn't stale in certain edge cases.
5675 function updater(prevState) {
5676 var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
5677 return state !== null && state !== undefined ? state : null;
5678 }
5679 // Binding "this" is important for shallow renderer support.
5680 this.setState(updater.bind(this));
5681}
5682
5683function componentWillUpdate(nextProps, nextState) {
5684 try {
5685 var prevProps = this.props;
5686 var prevState = this.state;
5687 this.props = nextProps;
5688 this.state = nextState;
5689 this.__reactInternalSnapshotFlag = true;
5690 this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
5691 prevProps,
5692 prevState
5693 );
5694 } finally {
5695 this.props = prevProps;
5696 this.state = prevState;
5697 }
5698}
5699
5700// React may warn about cWM/cWRP/cWU methods being deprecated.
5701// Add a flag to suppress these warnings for this special case.
5702componentWillMount.__suppressDeprecationWarning = true;
5703componentWillReceiveProps.__suppressDeprecationWarning = true;
5704componentWillUpdate.__suppressDeprecationWarning = true;
5705
5706function polyfill(Component) {
5707 var prototype = Component.prototype;
5708
5709 if (!prototype || !prototype.isReactComponent) {
5710 throw new Error('Can only polyfill class components');
5711 }
5712
5713 if (
5714 typeof Component.getDerivedStateFromProps !== 'function' &&
5715 typeof prototype.getSnapshotBeforeUpdate !== 'function'
5716 ) {
5717 return Component;
5718 }
5719
5720 // If new component APIs are defined, "unsafe" lifecycles won't be called.
5721 // Error if any of these lifecycles are present,
5722 // Because they would work differently between older and newer (16.3+) versions of React.
5723 var foundWillMountName = null;
5724 var foundWillReceivePropsName = null;
5725 var foundWillUpdateName = null;
5726 if (typeof prototype.componentWillMount === 'function') {
5727 foundWillMountName = 'componentWillMount';
5728 } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
5729 foundWillMountName = 'UNSAFE_componentWillMount';
5730 }
5731 if (typeof prototype.componentWillReceiveProps === 'function') {
5732 foundWillReceivePropsName = 'componentWillReceiveProps';
5733 } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
5734 foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
5735 }
5736 if (typeof prototype.componentWillUpdate === 'function') {
5737 foundWillUpdateName = 'componentWillUpdate';
5738 } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
5739 foundWillUpdateName = 'UNSAFE_componentWillUpdate';
5740 }
5741 if (
5742 foundWillMountName !== null ||
5743 foundWillReceivePropsName !== null ||
5744 foundWillUpdateName !== null
5745 ) {
5746 var componentName = Component.displayName || Component.name;
5747 var newApiName =
5748 typeof Component.getDerivedStateFromProps === 'function'
5749 ? 'getDerivedStateFromProps()'
5750 : 'getSnapshotBeforeUpdate()';
5751
5752 throw Error(
5753 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
5754 componentName +
5755 ' uses ' +
5756 newApiName +
5757 ' but also contains the following legacy lifecycles:' +
5758 (foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
5759 (foundWillReceivePropsName !== null
5760 ? '\n ' + foundWillReceivePropsName
5761 : '') +
5762 (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
5763 '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
5764 'https://fb.me/react-async-component-lifecycle-hooks'
5765 );
5766 }
5767
5768 // React <= 16.2 does not support static getDerivedStateFromProps.
5769 // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
5770 // Newer versions of React will ignore these lifecycles if gDSFP exists.
5771 if (typeof Component.getDerivedStateFromProps === 'function') {
5772 prototype.componentWillMount = componentWillMount;
5773 prototype.componentWillReceiveProps = componentWillReceiveProps;
5774 }
5775
5776 // React <= 16.2 does not support getSnapshotBeforeUpdate.
5777 // As a workaround, use cWU to invoke the new lifecycle.
5778 // Newer versions of React will ignore that lifecycle if gSBU exists.
5779 if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
5780 if (typeof prototype.componentDidUpdate !== 'function') {
5781 throw new Error(
5782 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
5783 );
5784 }
5785
5786 prototype.componentWillUpdate = componentWillUpdate;
5787
5788 var componentDidUpdate = prototype.componentDidUpdate;
5789
5790 prototype.componentDidUpdate = function componentDidUpdatePolyfill(
5791 prevProps,
5792 prevState,
5793 maybeSnapshot
5794 ) {
5795 // 16.3+ will not execute our will-update method;
5796 // It will pass a snapshot value to did-update though.
5797 // Older versions will require our polyfilled will-update value.
5798 // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
5799 // Because for <= 15.x versions this might be a "prevContext" object.
5800 // We also can't just check "__reactInternalSnapshot",
5801 // Because get-snapshot might return a falsy value.
5802 // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
5803 var snapshot = this.__reactInternalSnapshotFlag
5804 ? this.__reactInternalSnapshot
5805 : maybeSnapshot;
5806
5807 componentDidUpdate.call(this, prevProps, prevState, snapshot);
5808 };
5809 }
5810
5811 return Component;
5812}
5813
5814
5815
5816
5817/***/ }),
5818/* 42 */
5819/***/ (function(module, exports, __webpack_require__) {
5820
5821// optional / simple context binding
5822var aFunction = __webpack_require__(65);
5823module.exports = function (fn, that, length) {
5824 aFunction(fn);
5825 if (that === undefined) return fn;
5826 switch (length) {
5827 case 1: return function (a) {
5828 return fn.call(that, a);
5829 };
5830 case 2: return function (a, b) {
5831 return fn.call(that, a, b);
5832 };
5833 case 3: return function (a, b, c) {
5834 return fn.call(that, a, b, c);
5835 };
5836 }
5837 return function (/* ...args */) {
5838 return fn.apply(that, arguments);
5839 };
5840};
5841
5842
5843/***/ }),
5844/* 43 */
5845/***/ (function(module, exports, __webpack_require__) {
5846
5847module.exports = !__webpack_require__(12) && !__webpack_require__(18)(function () {
5848 return Object.defineProperty(__webpack_require__(44)('div'), 'a', { get: function () { return 7; } }).a != 7;
5849});
5850
5851
5852/***/ }),
5853/* 44 */
5854/***/ (function(module, exports, __webpack_require__) {
5855
5856var isObject = __webpack_require__(11);
5857var document = __webpack_require__(5).document;
5858// typeof document.createElement is 'object' in old IE
5859var is = isObject(document) && isObject(document.createElement);
5860module.exports = function (it) {
5861 return is ? document.createElement(it) : {};
5862};
5863
5864
5865/***/ }),
5866/* 45 */
5867/***/ (function(module, exports, __webpack_require__) {
5868
5869var has = __webpack_require__(7);
5870var toIObject = __webpack_require__(13);
5871var arrayIndexOf = __webpack_require__(67)(false);
5872var IE_PROTO = __webpack_require__(30)('IE_PROTO');
5873
5874module.exports = function (object, names) {
5875 var O = toIObject(object);
5876 var i = 0;
5877 var result = [];
5878 var key;
5879 for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
5880 // Don't enum bug & hidden keys
5881 while (names.length > i) if (has(O, key = names[i++])) {
5882 ~arrayIndexOf(result, key) || result.push(key);
5883 }
5884 return result;
5885};
5886
5887
5888/***/ }),
5889/* 46 */
5890/***/ (function(module, exports, __webpack_require__) {
5891
5892// fallback for non-array-like ES3 and non-enumerable old V8 strings
5893var cof = __webpack_require__(47);
5894// eslint-disable-next-line no-prototype-builtins
5895module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
5896 return cof(it) == 'String' ? it.split('') : Object(it);
5897};
5898
5899
5900/***/ }),
5901/* 47 */
5902/***/ (function(module, exports) {
5903
5904var toString = {}.toString;
5905
5906module.exports = function (it) {
5907 return toString.call(it).slice(8, -1);
5908};
5909
5910
5911/***/ }),
5912/* 48 */
5913/***/ (function(module, exports, __webpack_require__) {
5914
5915// 7.1.13 ToObject(argument)
5916var defined = __webpack_require__(28);
5917module.exports = function (it) {
5918 return Object(defined(it));
5919};
5920
5921
5922/***/ }),
5923/* 49 */
5924/***/ (function(module, exports, __webpack_require__) {
5925
5926"use strict";
5927
5928
5929exports.__esModule = true;
5930
5931var _iterator = __webpack_require__(70);
5932
5933var _iterator2 = _interopRequireDefault(_iterator);
5934
5935var _symbol = __webpack_require__(82);
5936
5937var _symbol2 = _interopRequireDefault(_symbol);
5938
5939var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
5940
5941function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5942
5943exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
5944 return typeof obj === "undefined" ? "undefined" : _typeof(obj);
5945} : function (obj) {
5946 return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
5947};
5948
5949/***/ }),
5950/* 50 */
5951/***/ (function(module, exports, __webpack_require__) {
5952
5953"use strict";
5954
5955var LIBRARY = __webpack_require__(23);
5956var $export = __webpack_require__(16);
5957var redefine = __webpack_require__(51);
5958var hide = __webpack_require__(9);
5959var Iterators = __webpack_require__(34);
5960var $iterCreate = __webpack_require__(74);
5961var setToStringTag = __webpack_require__(36);
5962var getPrototypeOf = __webpack_require__(77);
5963var ITERATOR = __webpack_require__(14)('iterator');
5964var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
5965var FF_ITERATOR = '@@iterator';
5966var KEYS = 'keys';
5967var VALUES = 'values';
5968
5969var returnThis = function () { return this; };
5970
5971module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
5972 $iterCreate(Constructor, NAME, next);
5973 var getMethod = function (kind) {
5974 if (!BUGGY && kind in proto) return proto[kind];
5975 switch (kind) {
5976 case KEYS: return function keys() { return new Constructor(this, kind); };
5977 case VALUES: return function values() { return new Constructor(this, kind); };
5978 } return function entries() { return new Constructor(this, kind); };
5979 };
5980 var TAG = NAME + ' Iterator';
5981 var DEF_VALUES = DEFAULT == VALUES;
5982 var VALUES_BUG = false;
5983 var proto = Base.prototype;
5984 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
5985 var $default = $native || getMethod(DEFAULT);
5986 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
5987 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
5988 var methods, key, IteratorPrototype;
5989 // Fix native
5990 if ($anyNative) {
5991 IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
5992 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
5993 // Set @@toStringTag to native iterators
5994 setToStringTag(IteratorPrototype, TAG, true);
5995 // fix for some old engines
5996 if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
5997 }
5998 }
5999 // fix Array#{values, @@iterator}.name in V8 / FF
6000 if (DEF_VALUES && $native && $native.name !== VALUES) {
6001 VALUES_BUG = true;
6002 $default = function values() { return $native.call(this); };
6003 }
6004 // Define iterator
6005 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
6006 hide(proto, ITERATOR, $default);
6007 }
6008 // Plug for library
6009 Iterators[NAME] = $default;
6010 Iterators[TAG] = returnThis;
6011 if (DEFAULT) {
6012 methods = {
6013 values: DEF_VALUES ? $default : getMethod(VALUES),
6014 keys: IS_SET ? $default : getMethod(KEYS),
6015 entries: $entries
6016 };
6017 if (FORCED) for (key in methods) {
6018 if (!(key in proto)) redefine(proto, key, methods[key]);
6019 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
6020 }
6021 return methods;
6022};
6023
6024
6025/***/ }),
6026/* 51 */
6027/***/ (function(module, exports, __webpack_require__) {
6028
6029module.exports = __webpack_require__(9);
6030
6031
6032/***/ }),
6033/* 52 */
6034/***/ (function(module, exports, __webpack_require__) {
6035
6036// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
6037var $keys = __webpack_require__(45);
6038var hiddenKeys = __webpack_require__(32).concat('length', 'prototype');
6039
6040exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
6041 return $keys(O, hiddenKeys);
6042};
6043
6044
6045/***/ }),
6046/* 53 */
6047/***/ (function(module, exports, __webpack_require__) {
6048
6049var pIE = __webpack_require__(25);
6050var createDesc = __webpack_require__(21);
6051var toIObject = __webpack_require__(13);
6052var toPrimitive = __webpack_require__(27);
6053var has = __webpack_require__(7);
6054var IE8_DOM_DEFINE = __webpack_require__(43);
6055var gOPD = Object.getOwnPropertyDescriptor;
6056
6057exports.f = __webpack_require__(12) ? gOPD : function getOwnPropertyDescriptor(O, P) {
6058 O = toIObject(O);
6059 P = toPrimitive(P, true);
6060 if (IE8_DOM_DEFINE) try {
6061 return gOPD(O, P);
6062 } catch (e) { /* empty */ }
6063 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
6064};
6065
6066
6067/***/ }),
6068/* 54 */
6069/***/ (function(module, exports, __webpack_require__) {
6070
6071"use strict";
6072/* WEBPACK VAR INJECTION */(function(process) {
6073
6074if (process.env.NODE_ENV === 'production') {
6075 module.exports = __webpack_require__(99);
6076} else {
6077 module.exports = __webpack_require__(100);
6078}
6079
6080/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))
6081
6082/***/ }),
6083/* 55 */
6084/***/ (function(module, __webpack_exports__, __webpack_require__) {
6085
6086"use strict";
6087/**
6088 * @ignore
6089 * some key-codes definition and utils from closure-library
6090 * @author yiminghe@gmail.com
6091 */
6092
6093var KeyCode = {
6094 /**
6095 * MAC_ENTER
6096 */
6097 MAC_ENTER: 3,
6098 /**
6099 * BACKSPACE
6100 */
6101 BACKSPACE: 8,
6102 /**
6103 * TAB
6104 */
6105 TAB: 9,
6106 /**
6107 * NUMLOCK on FF/Safari Mac
6108 */
6109 NUM_CENTER: 12, // NUMLOCK on FF/Safari Mac
6110 /**
6111 * ENTER
6112 */
6113 ENTER: 13,
6114 /**
6115 * SHIFT
6116 */
6117 SHIFT: 16,
6118 /**
6119 * CTRL
6120 */
6121 CTRL: 17,
6122 /**
6123 * ALT
6124 */
6125 ALT: 18,
6126 /**
6127 * PAUSE
6128 */
6129 PAUSE: 19,
6130 /**
6131 * CAPS_LOCK
6132 */
6133 CAPS_LOCK: 20,
6134 /**
6135 * ESC
6136 */
6137 ESC: 27,
6138 /**
6139 * SPACE
6140 */
6141 SPACE: 32,
6142 /**
6143 * PAGE_UP
6144 */
6145 PAGE_UP: 33, // also NUM_NORTH_EAST
6146 /**
6147 * PAGE_DOWN
6148 */
6149 PAGE_DOWN: 34, // also NUM_SOUTH_EAST
6150 /**
6151 * END
6152 */
6153 END: 35, // also NUM_SOUTH_WEST
6154 /**
6155 * HOME
6156 */
6157 HOME: 36, // also NUM_NORTH_WEST
6158 /**
6159 * LEFT
6160 */
6161 LEFT: 37, // also NUM_WEST
6162 /**
6163 * UP
6164 */
6165 UP: 38, // also NUM_NORTH
6166 /**
6167 * RIGHT
6168 */
6169 RIGHT: 39, // also NUM_EAST
6170 /**
6171 * DOWN
6172 */
6173 DOWN: 40, // also NUM_SOUTH
6174 /**
6175 * PRINT_SCREEN
6176 */
6177 PRINT_SCREEN: 44,
6178 /**
6179 * INSERT
6180 */
6181 INSERT: 45, // also NUM_INSERT
6182 /**
6183 * DELETE
6184 */
6185 DELETE: 46, // also NUM_DELETE
6186 /**
6187 * ZERO
6188 */
6189 ZERO: 48,
6190 /**
6191 * ONE
6192 */
6193 ONE: 49,
6194 /**
6195 * TWO
6196 */
6197 TWO: 50,
6198 /**
6199 * THREE
6200 */
6201 THREE: 51,
6202 /**
6203 * FOUR
6204 */
6205 FOUR: 52,
6206 /**
6207 * FIVE
6208 */
6209 FIVE: 53,
6210 /**
6211 * SIX
6212 */
6213 SIX: 54,
6214 /**
6215 * SEVEN
6216 */
6217 SEVEN: 55,
6218 /**
6219 * EIGHT
6220 */
6221 EIGHT: 56,
6222 /**
6223 * NINE
6224 */
6225 NINE: 57,
6226 /**
6227 * QUESTION_MARK
6228 */
6229 QUESTION_MARK: 63, // needs localization
6230 /**
6231 * A
6232 */
6233 A: 65,
6234 /**
6235 * B
6236 */
6237 B: 66,
6238 /**
6239 * C
6240 */
6241 C: 67,
6242 /**
6243 * D
6244 */
6245 D: 68,
6246 /**
6247 * E
6248 */
6249 E: 69,
6250 /**
6251 * F
6252 */
6253 F: 70,
6254 /**
6255 * G
6256 */
6257 G: 71,
6258 /**
6259 * H
6260 */
6261 H: 72,
6262 /**
6263 * I
6264 */
6265 I: 73,
6266 /**
6267 * J
6268 */
6269 J: 74,
6270 /**
6271 * K
6272 */
6273 K: 75,
6274 /**
6275 * L
6276 */
6277 L: 76,
6278 /**
6279 * M
6280 */
6281 M: 77,
6282 /**
6283 * N
6284 */
6285 N: 78,
6286 /**
6287 * O
6288 */
6289 O: 79,
6290 /**
6291 * P
6292 */
6293 P: 80,
6294 /**
6295 * Q
6296 */
6297 Q: 81,
6298 /**
6299 * R
6300 */
6301 R: 82,
6302 /**
6303 * S
6304 */
6305 S: 83,
6306 /**
6307 * T
6308 */
6309 T: 84,
6310 /**
6311 * U
6312 */
6313 U: 85,
6314 /**
6315 * V
6316 */
6317 V: 86,
6318 /**
6319 * W
6320 */
6321 W: 87,
6322 /**
6323 * X
6324 */
6325 X: 88,
6326 /**
6327 * Y
6328 */
6329 Y: 89,
6330 /**
6331 * Z
6332 */
6333 Z: 90,
6334 /**
6335 * META
6336 */
6337 META: 91, // WIN_KEY_LEFT
6338 /**
6339 * WIN_KEY_RIGHT
6340 */
6341 WIN_KEY_RIGHT: 92,
6342 /**
6343 * CONTEXT_MENU
6344 */
6345 CONTEXT_MENU: 93,
6346 /**
6347 * NUM_ZERO
6348 */
6349 NUM_ZERO: 96,
6350 /**
6351 * NUM_ONE
6352 */
6353 NUM_ONE: 97,
6354 /**
6355 * NUM_TWO
6356 */
6357 NUM_TWO: 98,
6358 /**
6359 * NUM_THREE
6360 */
6361 NUM_THREE: 99,
6362 /**
6363 * NUM_FOUR
6364 */
6365 NUM_FOUR: 100,
6366 /**
6367 * NUM_FIVE
6368 */
6369 NUM_FIVE: 101,
6370 /**
6371 * NUM_SIX
6372 */
6373 NUM_SIX: 102,
6374 /**
6375 * NUM_SEVEN
6376 */
6377 NUM_SEVEN: 103,
6378 /**
6379 * NUM_EIGHT
6380 */
6381 NUM_EIGHT: 104,
6382 /**
6383 * NUM_NINE
6384 */
6385 NUM_NINE: 105,
6386 /**
6387 * NUM_MULTIPLY
6388 */
6389 NUM_MULTIPLY: 106,
6390 /**
6391 * NUM_PLUS
6392 */
6393 NUM_PLUS: 107,
6394 /**
6395 * NUM_MINUS
6396 */
6397 NUM_MINUS: 109,
6398 /**
6399 * NUM_PERIOD
6400 */
6401 NUM_PERIOD: 110,
6402 /**
6403 * NUM_DIVISION
6404 */
6405 NUM_DIVISION: 111,
6406 /**
6407 * F1
6408 */
6409 F1: 112,
6410 /**
6411 * F2
6412 */
6413 F2: 113,
6414 /**
6415 * F3
6416 */
6417 F3: 114,
6418 /**
6419 * F4
6420 */
6421 F4: 115,
6422 /**
6423 * F5
6424 */
6425 F5: 116,
6426 /**
6427 * F6
6428 */
6429 F6: 117,
6430 /**
6431 * F7
6432 */
6433 F7: 118,
6434 /**
6435 * F8
6436 */
6437 F8: 119,
6438 /**
6439 * F9
6440 */
6441 F9: 120,
6442 /**
6443 * F10
6444 */
6445 F10: 121,
6446 /**
6447 * F11
6448 */
6449 F11: 122,
6450 /**
6451 * F12
6452 */
6453 F12: 123,
6454 /**
6455 * NUMLOCK
6456 */
6457 NUMLOCK: 144,
6458 /**
6459 * SEMICOLON
6460 */
6461 SEMICOLON: 186, // needs localization
6462 /**
6463 * DASH
6464 */
6465 DASH: 189, // needs localization
6466 /**
6467 * EQUALS
6468 */
6469 EQUALS: 187, // needs localization
6470 /**
6471 * COMMA
6472 */
6473 COMMA: 188, // needs localization
6474 /**
6475 * PERIOD
6476 */
6477 PERIOD: 190, // needs localization
6478 /**
6479 * SLASH
6480 */
6481 SLASH: 191, // needs localization
6482 /**
6483 * APOSTROPHE
6484 */
6485 APOSTROPHE: 192, // needs localization
6486 /**
6487 * SINGLE_QUOTE
6488 */
6489 SINGLE_QUOTE: 222, // needs localization
6490 /**
6491 * OPEN_SQUARE_BRACKET
6492 */
6493 OPEN_SQUARE_BRACKET: 219, // needs localization
6494 /**
6495 * BACKSLASH
6496 */
6497 BACKSLASH: 220, // needs localization
6498 /**
6499 * CLOSE_SQUARE_BRACKET
6500 */
6501 CLOSE_SQUARE_BRACKET: 221, // needs localization
6502 /**
6503 * WIN_KEY
6504 */
6505 WIN_KEY: 224,
6506 /**
6507 * MAC_FF_META
6508 */
6509 MAC_FF_META: 224, // Firefox (Gecko) fires this for the meta key instead of 91
6510 /**
6511 * WIN_IME
6512 */
6513 WIN_IME: 229
6514};
6515
6516/*
6517 whether text and modified key is entered at the same time.
6518 */
6519KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) {
6520 var keyCode = e.keyCode;
6521 if (e.altKey && !e.ctrlKey || e.metaKey ||
6522 // Function keys don't generate text
6523 keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
6524 return false;
6525 }
6526
6527 // The following keys are quite harmless, even in combination with
6528 // CTRL, ALT or SHIFT.
6529 switch (keyCode) {
6530 case KeyCode.ALT:
6531 case KeyCode.CAPS_LOCK:
6532 case KeyCode.CONTEXT_MENU:
6533 case KeyCode.CTRL:
6534 case KeyCode.DOWN:
6535 case KeyCode.END:
6536 case KeyCode.ESC:
6537 case KeyCode.HOME:
6538 case KeyCode.INSERT:
6539 case KeyCode.LEFT:
6540 case KeyCode.MAC_FF_META:
6541 case KeyCode.META:
6542 case KeyCode.NUMLOCK:
6543 case KeyCode.NUM_CENTER:
6544 case KeyCode.PAGE_DOWN:
6545 case KeyCode.PAGE_UP:
6546 case KeyCode.PAUSE:
6547 case KeyCode.PRINT_SCREEN:
6548 case KeyCode.RIGHT:
6549 case KeyCode.SHIFT:
6550 case KeyCode.UP:
6551 case KeyCode.WIN_KEY:
6552 case KeyCode.WIN_KEY_RIGHT:
6553 return false;
6554 default:
6555 return true;
6556 }
6557};
6558
6559/*
6560 whether character is entered.
6561 */
6562KeyCode.isCharacterKey = function isCharacterKey(keyCode) {
6563 if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
6564 return true;
6565 }
6566
6567 if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
6568 return true;
6569 }
6570
6571 if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
6572 return true;
6573 }
6574
6575 // Safari sends zero key code for non-latin characters.
6576 if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
6577 return true;
6578 }
6579
6580 switch (keyCode) {
6581 case KeyCode.SPACE:
6582 case KeyCode.QUESTION_MARK:
6583 case KeyCode.NUM_PLUS:
6584 case KeyCode.NUM_MINUS:
6585 case KeyCode.NUM_PERIOD:
6586 case KeyCode.NUM_DIVISION:
6587 case KeyCode.SEMICOLON:
6588 case KeyCode.DASH:
6589 case KeyCode.EQUALS:
6590 case KeyCode.COMMA:
6591 case KeyCode.PERIOD:
6592 case KeyCode.SLASH:
6593 case KeyCode.APOSTROPHE:
6594 case KeyCode.SINGLE_QUOTE:
6595 case KeyCode.OPEN_SQUARE_BRACKET:
6596 case KeyCode.BACKSLASH:
6597 case KeyCode.CLOSE_SQUARE_BRACKET:
6598 return true;
6599 default:
6600 return false;
6601 }
6602};
6603
6604/* harmony default export */ __webpack_exports__["a"] = (KeyCode);
6605
6606/***/ }),
6607/* 56 */
6608/***/ (function(module, __webpack_exports__, __webpack_require__) {
6609
6610"use strict";
6611/* harmony default export */ __webpack_exports__["a"] = ({
6612 DATE_ROW_COUNT: 6,
6613 DATE_COL_COUNT: 7
6614});
6615
6616/***/ }),
6617/* 57 */
6618/***/ (function(module, __webpack_exports__, __webpack_require__) {
6619
6620"use strict";
6621/* harmony export (immutable) */ __webpack_exports__["a"] = mapSelf;
6622/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
6623/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
6624
6625
6626function mirror(o) {
6627 return o;
6628}
6629
6630function mapSelf(children) {
6631 // return ReactFragment
6632 return __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.map(children, mirror);
6633}
6634
6635/***/ }),
6636/* 58 */
6637/***/ (function(module, exports, __webpack_require__) {
6638
6639__webpack_require__(59);
6640module.exports = __webpack_require__(60);
6641
6642
6643/***/ }),
6644/* 59 */
6645/***/ (function(module, exports) {
6646
6647// removed by extract-text-webpack-plugin
6648
6649/***/ }),
6650/* 60 */
6651/***/ (function(module, __webpack_exports__, __webpack_require__) {
6652
6653"use strict";
6654Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
6655/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Calendar__ = __webpack_require__(61);
6656
6657
6658/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__Calendar__["a" /* default */]);
6659
6660/***/ }),
6661/* 61 */
6662/***/ (function(module, __webpack_exports__, __webpack_require__) {
6663
6664"use strict";
6665/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(26);
6666/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
6667/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
6668/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
6669/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
6670/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
6671/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3);
6672/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
6673/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
6674/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
6675/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom__ = __webpack_require__(39);
6676/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react_dom__);
6677/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(4);
6678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
6679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__ = __webpack_require__(55);
6680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_react_lifecycles_compat__ = __webpack_require__(41);
6681/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__date_DateTable__ = __webpack_require__(105);
6682/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__calendar_CalendarHeader__ = __webpack_require__(108);
6683/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__calendar_CalendarFooter__ = __webpack_require__(113);
6684/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__mixin_CalendarMixin__ = __webpack_require__(117);
6685/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__mixin_CommonMixin__ = __webpack_require__(118);
6686/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__date_DateInput__ = __webpack_require__(120);
6687/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__util__ = __webpack_require__(15);
6688/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__util_toTime__ = __webpack_require__(121);
6689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_moment__ = __webpack_require__(20);
6690/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_17_moment__);
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710function noop() {}
6711
6712var Calendar = function (_React$Component) {
6713 __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(Calendar, _React$Component);
6714
6715 function Calendar(props) {
6716 __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Calendar);
6717
6718 var _this = __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props));
6719
6720 _initialiseProps.call(_this);
6721
6722 _this.state = {
6723 mode: _this.props.mode || 'date',
6724 value: props.value || props.defaultValue || __WEBPACK_IMPORTED_MODULE_17_moment___default()(),
6725 selectedValue: props.selectedValue || props.defaultSelectedValue
6726 };
6727 return _this;
6728 }
6729
6730 Calendar.prototype.componentDidMount = function componentDidMount() {
6731 if (this.props.showDateInput) {
6732 this.saveFocusElement(__WEBPACK_IMPORTED_MODULE_14__date_DateInput__["a" /* default */].getInstance());
6733 }
6734 };
6735
6736 Calendar.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, state) {
6737 var value = nextProps.value,
6738 selectedValue = nextProps.selectedValue;
6739
6740 var newState = {};
6741
6742 if ('mode' in nextProps && state.mode !== nextProps.mode) {
6743 newState = { mode: nextProps.mode };
6744 }
6745 if ('value' in nextProps) {
6746 newState.value = value || nextProps.defaultValue || Object(__WEBPACK_IMPORTED_MODULE_12__mixin_CalendarMixin__["d" /* getNowByCurrentStateValue */])(state.value);
6747 }
6748 if ('selectedValue' in nextProps) {
6749 newState.selectedValue = selectedValue;
6750 }
6751
6752 return newState;
6753 };
6754
6755 Calendar.prototype.render = function render() {
6756 var props = this.props,
6757 state = this.state;
6758 var locale = props.locale,
6759 prefixCls = props.prefixCls,
6760 disabledDate = props.disabledDate,
6761 dateInputPlaceholder = props.dateInputPlaceholder,
6762 timePicker = props.timePicker,
6763 disabledTime = props.disabledTime,
6764 clearIcon = props.clearIcon,
6765 renderFooter = props.renderFooter;
6766 var value = state.value,
6767 selectedValue = state.selectedValue,
6768 mode = state.mode;
6769
6770 var showTimePicker = mode === 'time';
6771 var disabledTimeConfig = showTimePicker && disabledTime && timePicker ? Object(__WEBPACK_IMPORTED_MODULE_15__util__["c" /* getTimeConfig */])(selectedValue, disabledTime) : null;
6772
6773 var timePickerEle = null;
6774
6775 if (timePicker && showTimePicker) {
6776 var timePickerProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({
6777 showHour: true,
6778 showSecond: true,
6779 showMinute: true
6780 }, timePicker.props, disabledTimeConfig, {
6781 onChange: this.onDateInputChange,
6782 value: selectedValue,
6783 disabledTime: disabledTime
6784 });
6785
6786 if (timePicker.props.defaultValue !== undefined) {
6787 timePickerProps.defaultOpenValue = timePicker.props.defaultValue;
6788 }
6789
6790 timePickerEle = __WEBPACK_IMPORTED_MODULE_4_react___default.a.cloneElement(timePicker, timePickerProps);
6791 }
6792
6793 var dateInputElement = props.showDateInput ? __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_14__date_DateInput__["a" /* default */], {
6794 format: this.getFormat(),
6795 key: 'date-input',
6796 value: value,
6797 locale: locale,
6798 placeholder: dateInputPlaceholder,
6799 showClear: true,
6800 disabledTime: disabledTime,
6801 disabledDate: disabledDate,
6802 onClear: this.onClear,
6803 prefixCls: prefixCls,
6804 selectedValue: selectedValue,
6805 onChange: this.onDateInputChange,
6806 onSelect: this.onDateInputSelect,
6807 clearIcon: clearIcon
6808 }) : null;
6809
6810 var children = [];
6811 if (props.renderSidebar) {
6812 children.push(props.renderSidebar());
6813 }
6814 children.push(__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
6815 'div',
6816 { className: prefixCls + '-panel', key: 'panel' },
6817 dateInputElement,
6818 __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
6819 'div',
6820 {
6821 tabIndex: this.props.focusablePanel ? 0 : undefined,
6822 className: prefixCls + '-date-panel'
6823 },
6824 __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__calendar_CalendarHeader__["a" /* default */], {
6825 locale: locale,
6826 mode: mode,
6827 value: value,
6828 onValueChange: this.setValue,
6829 onPanelChange: this.onPanelChange,
6830 renderFooter: renderFooter,
6831 showTimePicker: showTimePicker,
6832 prefixCls: prefixCls
6833 }),
6834 timePicker && showTimePicker ? __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
6835 'div',
6836 { className: prefixCls + '-time-picker' },
6837 __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
6838 'div',
6839 { className: prefixCls + '-time-picker-panel' },
6840 timePickerEle
6841 )
6842 ) : null,
6843 __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
6844 'div',
6845 { className: prefixCls + '-body' },
6846 __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__date_DateTable__["a" /* default */], {
6847 locale: locale,
6848 value: value,
6849 selectedValue: selectedValue,
6850 prefixCls: prefixCls,
6851 dateRender: props.dateRender,
6852 onSelect: this.onDateTableSelect,
6853 disabledDate: disabledDate,
6854 showWeekNumber: props.showWeekNumber
6855 })
6856 ),
6857 __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__calendar_CalendarFooter__["a" /* default */], {
6858 showOk: props.showOk,
6859 mode: mode,
6860 renderFooter: props.renderFooter,
6861 locale: locale,
6862 prefixCls: prefixCls,
6863 showToday: props.showToday,
6864 disabledTime: disabledTime,
6865 showTimePicker: showTimePicker,
6866 showDateInput: props.showDateInput,
6867 timePicker: timePicker,
6868 selectedValue: selectedValue,
6869 value: value,
6870 disabledDate: disabledDate,
6871 okDisabled: props.showOk !== false && (!selectedValue || !this.isAllowedDate(selectedValue)),
6872 onOk: this.onOk,
6873 onSelect: this.onSelect,
6874 onToday: this.onToday,
6875 onOpenTimePicker: this.openTimePicker,
6876 onCloseTimePicker: this.closeTimePicker
6877 })
6878 )
6879 ));
6880
6881 return this.renderRoot({
6882 children: children,
6883 className: props.showWeekNumber ? prefixCls + '-week-number' : ''
6884 });
6885 };
6886
6887 return Calendar;
6888}(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component);
6889
6890Calendar.propTypes = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, __WEBPACK_IMPORTED_MODULE_12__mixin_CalendarMixin__["b" /* calendarMixinPropTypes */], __WEBPACK_IMPORTED_MODULE_13__mixin_CommonMixin__["c" /* propType */], {
6891 prefixCls: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
6892 className: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
6893 style: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
6894 defaultValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
6895 value: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
6896 selectedValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
6897 defaultSelectedValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
6898 mode: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOf(['time', 'date', 'month', 'year', 'decade']),
6899 locale: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
6900 showDateInput: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
6901 showWeekNumber: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
6902 showToday: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
6903 showOk: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
6904 onSelect: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6905 onOk: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6906 onKeyDown: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6907 timePicker: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.element,
6908 dateInputPlaceholder: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
6909 onClear: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6910 onChange: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6911 onPanelChange: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6912 disabledDate: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6913 disabledTime: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
6914 dateRender: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6915 renderFooter: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6916 renderSidebar: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
6917 clearIcon: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node,
6918 focusablePanel: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
6919 onBlur: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func
6920});
6921Calendar.defaultProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, __WEBPACK_IMPORTED_MODULE_12__mixin_CalendarMixin__["a" /* calendarMixinDefaultProps */], __WEBPACK_IMPORTED_MODULE_13__mixin_CommonMixin__["b" /* defaultProp */], {
6922 showToday: true,
6923 showDateInput: true,
6924 timePicker: null,
6925 onOk: noop,
6926 onPanelChange: noop,
6927 focusablePanel: true
6928});
6929
6930var _initialiseProps = function _initialiseProps() {
6931 var _this2 = this;
6932
6933 this.onPanelChange = function (value, mode) {
6934 var props = _this2.props,
6935 state = _this2.state;
6936
6937 if (!('mode' in props)) {
6938 _this2.setState({ mode: mode });
6939 }
6940 props.onPanelChange(value || state.value, mode);
6941 };
6942
6943 this.onKeyDown = function (event) {
6944 if (event.target.nodeName.toLowerCase() === 'input') {
6945 return undefined;
6946 }
6947 var keyCode = event.keyCode;
6948 // mac
6949 var ctrlKey = event.ctrlKey || event.metaKey;
6950 var disabledDate = _this2.props.disabledDate;
6951 var value = _this2.state.value;
6952
6953 switch (keyCode) {
6954 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].DOWN:
6955 _this2.goTime(1, 'weeks');
6956 event.preventDefault();
6957 return 1;
6958 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].UP:
6959 _this2.goTime(-1, 'weeks');
6960 event.preventDefault();
6961 return 1;
6962 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].LEFT:
6963 if (ctrlKey) {
6964 _this2.goTime(-1, 'years');
6965 } else {
6966 _this2.goTime(-1, 'days');
6967 }
6968 event.preventDefault();
6969 return 1;
6970 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].RIGHT:
6971 if (ctrlKey) {
6972 _this2.goTime(1, 'years');
6973 } else {
6974 _this2.goTime(1, 'days');
6975 }
6976 event.preventDefault();
6977 return 1;
6978 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].HOME:
6979 _this2.setValue(Object(__WEBPACK_IMPORTED_MODULE_16__util_toTime__["b" /* goStartMonth */])(_this2.state.value));
6980 event.preventDefault();
6981 return 1;
6982 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].END:
6983 _this2.setValue(Object(__WEBPACK_IMPORTED_MODULE_16__util_toTime__["a" /* goEndMonth */])(_this2.state.value));
6984 event.preventDefault();
6985 return 1;
6986 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].PAGE_DOWN:
6987 _this2.goTime(1, 'month');
6988 event.preventDefault();
6989 return 1;
6990 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].PAGE_UP:
6991 _this2.goTime(-1, 'month');
6992 event.preventDefault();
6993 return 1;
6994 case __WEBPACK_IMPORTED_MODULE_7_rc_util_es_KeyCode__["a" /* default */].ENTER:
6995 if (!disabledDate || !disabledDate(value)) {
6996 _this2.onSelect(value, {
6997 source: 'keyboard'
6998 });
6999 }
7000 event.preventDefault();
7001 return 1;
7002 default:
7003 _this2.props.onKeyDown(event);
7004 return 1;
7005 }
7006 };
7007
7008 this.onClear = function () {
7009 _this2.onSelect(null);
7010 _this2.props.onClear();
7011 };
7012
7013 this.onOk = function () {
7014 var selectedValue = _this2.state.selectedValue;
7015
7016 if (_this2.isAllowedDate(selectedValue)) {
7017 _this2.props.onOk(selectedValue);
7018 }
7019 };
7020
7021 this.onDateInputChange = function (value) {
7022 _this2.onSelect(value, {
7023 source: 'dateInput'
7024 });
7025 };
7026
7027 this.onDateInputSelect = function (value) {
7028 _this2.onSelect(value, {
7029 source: 'dateInputSelect'
7030 });
7031 };
7032
7033 this.onDateTableSelect = function (value) {
7034 var timePicker = _this2.props.timePicker;
7035 var selectedValue = _this2.state.selectedValue;
7036
7037 if (!selectedValue && timePicker) {
7038 var timePickerDefaultValue = timePicker.props.defaultValue;
7039 if (timePickerDefaultValue) {
7040 Object(__WEBPACK_IMPORTED_MODULE_15__util__["h" /* syncTime */])(timePickerDefaultValue, value);
7041 }
7042 }
7043 _this2.onSelect(value);
7044 };
7045
7046 this.onToday = function () {
7047 var value = _this2.state.value;
7048
7049 var now = Object(__WEBPACK_IMPORTED_MODULE_15__util__["e" /* getTodayTime */])(value);
7050 _this2.onSelect(now, {
7051 source: 'todayButton'
7052 });
7053 };
7054
7055 this.onBlur = function (event) {
7056 setTimeout(function () {
7057 var dateInput = __WEBPACK_IMPORTED_MODULE_14__date_DateInput__["a" /* default */].getInstance();
7058 var rootInstance = _this2.rootInstance;
7059
7060 if (!rootInstance || rootInstance.contains(document.activeElement) || dateInput && dateInput.contains(document.activeElement)) {
7061 // focused element is still part of Calendar
7062 return;
7063 }
7064
7065 if (_this2.props.onBlur) {
7066 _this2.props.onBlur(event);
7067 }
7068 }, 0);
7069 };
7070
7071 this.getRootDOMNode = function () {
7072 return __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.findDOMNode(_this2);
7073 };
7074
7075 this.openTimePicker = function () {
7076 _this2.onPanelChange(null, 'time');
7077 };
7078
7079 this.closeTimePicker = function () {
7080 _this2.onPanelChange(null, 'date');
7081 };
7082
7083 this.goTime = function (direction, unit) {
7084 _this2.setValue(Object(__WEBPACK_IMPORTED_MODULE_16__util_toTime__["c" /* goTime */])(_this2.state.value, direction, unit));
7085 };
7086};
7087
7088Object(__WEBPACK_IMPORTED_MODULE_8_react_lifecycles_compat__["a" /* polyfill */])(Calendar);
7089
7090/* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_12__mixin_CalendarMixin__["c" /* calendarMixinWrapper */])(Object(__WEBPACK_IMPORTED_MODULE_13__mixin_CommonMixin__["a" /* commonMixinWrapper */])(Calendar)));
7091
7092/***/ }),
7093/* 62 */
7094/***/ (function(module, exports, __webpack_require__) {
7095
7096module.exports = { "default": __webpack_require__(63), __esModule: true };
7097
7098/***/ }),
7099/* 63 */
7100/***/ (function(module, exports, __webpack_require__) {
7101
7102__webpack_require__(64);
7103module.exports = __webpack_require__(6).Object.assign;
7104
7105
7106/***/ }),
7107/* 64 */
7108/***/ (function(module, exports, __webpack_require__) {
7109
7110// 19.1.3.1 Object.assign(target, source)
7111var $export = __webpack_require__(16);
7112
7113$export($export.S + $export.F, 'Object', { assign: __webpack_require__(66) });
7114
7115
7116/***/ }),
7117/* 65 */
7118/***/ (function(module, exports) {
7119
7120module.exports = function (it) {
7121 if (typeof it != 'function') throw TypeError(it + ' is not a function!');
7122 return it;
7123};
7124
7125
7126/***/ }),
7127/* 66 */
7128/***/ (function(module, exports, __webpack_require__) {
7129
7130"use strict";
7131
7132// 19.1.2.1 Object.assign(target, source, ...)
7133var getKeys = __webpack_require__(22);
7134var gOPS = __webpack_require__(33);
7135var pIE = __webpack_require__(25);
7136var toObject = __webpack_require__(48);
7137var IObject = __webpack_require__(46);
7138var $assign = Object.assign;
7139
7140// should work with symbols and should have deterministic property order (V8 bug)
7141module.exports = !$assign || __webpack_require__(18)(function () {
7142 var A = {};
7143 var B = {};
7144 // eslint-disable-next-line no-undef
7145 var S = Symbol();
7146 var K = 'abcdefghijklmnopqrst';
7147 A[S] = 7;
7148 K.split('').forEach(function (k) { B[k] = k; });
7149 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
7150}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
7151 var T = toObject(target);
7152 var aLen = arguments.length;
7153 var index = 1;
7154 var getSymbols = gOPS.f;
7155 var isEnum = pIE.f;
7156 while (aLen > index) {
7157 var S = IObject(arguments[index++]);
7158 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
7159 var length = keys.length;
7160 var j = 0;
7161 var key;
7162 while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
7163 } return T;
7164} : $assign;
7165
7166
7167/***/ }),
7168/* 67 */
7169/***/ (function(module, exports, __webpack_require__) {
7170
7171// false -> Array#indexOf
7172// true -> Array#includes
7173var toIObject = __webpack_require__(13);
7174var toLength = __webpack_require__(68);
7175var toAbsoluteIndex = __webpack_require__(69);
7176module.exports = function (IS_INCLUDES) {
7177 return function ($this, el, fromIndex) {
7178 var O = toIObject($this);
7179 var length = toLength(O.length);
7180 var index = toAbsoluteIndex(fromIndex, length);
7181 var value;
7182 // Array#includes uses SameValueZero equality algorithm
7183 // eslint-disable-next-line no-self-compare
7184 if (IS_INCLUDES && el != el) while (length > index) {
7185 value = O[index++];
7186 // eslint-disable-next-line no-self-compare
7187 if (value != value) return true;
7188 // Array#indexOf ignores holes, Array#includes - not
7189 } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
7190 if (O[index] === el) return IS_INCLUDES || index || 0;
7191 } return !IS_INCLUDES && -1;
7192 };
7193};
7194
7195
7196/***/ }),
7197/* 68 */
7198/***/ (function(module, exports, __webpack_require__) {
7199
7200// 7.1.15 ToLength
7201var toInteger = __webpack_require__(29);
7202var min = Math.min;
7203module.exports = function (it) {
7204 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
7205};
7206
7207
7208/***/ }),
7209/* 69 */
7210/***/ (function(module, exports, __webpack_require__) {
7211
7212var toInteger = __webpack_require__(29);
7213var max = Math.max;
7214var min = Math.min;
7215module.exports = function (index, length) {
7216 index = toInteger(index);
7217 return index < 0 ? max(index + length, 0) : min(index, length);
7218};
7219
7220
7221/***/ }),
7222/* 70 */
7223/***/ (function(module, exports, __webpack_require__) {
7224
7225module.exports = { "default": __webpack_require__(71), __esModule: true };
7226
7227/***/ }),
7228/* 71 */
7229/***/ (function(module, exports, __webpack_require__) {
7230
7231__webpack_require__(72);
7232__webpack_require__(78);
7233module.exports = __webpack_require__(37).f('iterator');
7234
7235
7236/***/ }),
7237/* 72 */
7238/***/ (function(module, exports, __webpack_require__) {
7239
7240"use strict";
7241
7242var $at = __webpack_require__(73)(true);
7243
7244// 21.1.3.27 String.prototype[@@iterator]()
7245__webpack_require__(50)(String, 'String', function (iterated) {
7246 this._t = String(iterated); // target
7247 this._i = 0; // next index
7248// 21.1.5.2.1 %StringIteratorPrototype%.next()
7249}, function () {
7250 var O = this._t;
7251 var index = this._i;
7252 var point;
7253 if (index >= O.length) return { value: undefined, done: true };
7254 point = $at(O, index);
7255 this._i += point.length;
7256 return { value: point, done: false };
7257});
7258
7259
7260/***/ }),
7261/* 73 */
7262/***/ (function(module, exports, __webpack_require__) {
7263
7264var toInteger = __webpack_require__(29);
7265var defined = __webpack_require__(28);
7266// true -> String#at
7267// false -> String#codePointAt
7268module.exports = function (TO_STRING) {
7269 return function (that, pos) {
7270 var s = String(defined(that));
7271 var i = toInteger(pos);
7272 var l = s.length;
7273 var a, b;
7274 if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
7275 a = s.charCodeAt(i);
7276 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
7277 ? TO_STRING ? s.charAt(i) : a
7278 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
7279 };
7280};
7281
7282
7283/***/ }),
7284/* 74 */
7285/***/ (function(module, exports, __webpack_require__) {
7286
7287"use strict";
7288
7289var create = __webpack_require__(35);
7290var descriptor = __webpack_require__(21);
7291var setToStringTag = __webpack_require__(36);
7292var IteratorPrototype = {};
7293
7294// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
7295__webpack_require__(9)(IteratorPrototype, __webpack_require__(14)('iterator'), function () { return this; });
7296
7297module.exports = function (Constructor, NAME, next) {
7298 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
7299 setToStringTag(Constructor, NAME + ' Iterator');
7300};
7301
7302
7303/***/ }),
7304/* 75 */
7305/***/ (function(module, exports, __webpack_require__) {
7306
7307var dP = __webpack_require__(10);
7308var anObject = __webpack_require__(17);
7309var getKeys = __webpack_require__(22);
7310
7311module.exports = __webpack_require__(12) ? Object.defineProperties : function defineProperties(O, Properties) {
7312 anObject(O);
7313 var keys = getKeys(Properties);
7314 var length = keys.length;
7315 var i = 0;
7316 var P;
7317 while (length > i) dP.f(O, P = keys[i++], Properties[P]);
7318 return O;
7319};
7320
7321
7322/***/ }),
7323/* 76 */
7324/***/ (function(module, exports, __webpack_require__) {
7325
7326var document = __webpack_require__(5).document;
7327module.exports = document && document.documentElement;
7328
7329
7330/***/ }),
7331/* 77 */
7332/***/ (function(module, exports, __webpack_require__) {
7333
7334// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
7335var has = __webpack_require__(7);
7336var toObject = __webpack_require__(48);
7337var IE_PROTO = __webpack_require__(30)('IE_PROTO');
7338var ObjectProto = Object.prototype;
7339
7340module.exports = Object.getPrototypeOf || function (O) {
7341 O = toObject(O);
7342 if (has(O, IE_PROTO)) return O[IE_PROTO];
7343 if (typeof O.constructor == 'function' && O instanceof O.constructor) {
7344 return O.constructor.prototype;
7345 } return O instanceof Object ? ObjectProto : null;
7346};
7347
7348
7349/***/ }),
7350/* 78 */
7351/***/ (function(module, exports, __webpack_require__) {
7352
7353__webpack_require__(79);
7354var global = __webpack_require__(5);
7355var hide = __webpack_require__(9);
7356var Iterators = __webpack_require__(34);
7357var TO_STRING_TAG = __webpack_require__(14)('toStringTag');
7358
7359var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
7360 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
7361 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
7362 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
7363 'TextTrackList,TouchList').split(',');
7364
7365for (var i = 0; i < DOMIterables.length; i++) {
7366 var NAME = DOMIterables[i];
7367 var Collection = global[NAME];
7368 var proto = Collection && Collection.prototype;
7369 if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
7370 Iterators[NAME] = Iterators.Array;
7371}
7372
7373
7374/***/ }),
7375/* 79 */
7376/***/ (function(module, exports, __webpack_require__) {
7377
7378"use strict";
7379
7380var addToUnscopables = __webpack_require__(80);
7381var step = __webpack_require__(81);
7382var Iterators = __webpack_require__(34);
7383var toIObject = __webpack_require__(13);
7384
7385// 22.1.3.4 Array.prototype.entries()
7386// 22.1.3.13 Array.prototype.keys()
7387// 22.1.3.29 Array.prototype.values()
7388// 22.1.3.30 Array.prototype[@@iterator]()
7389module.exports = __webpack_require__(50)(Array, 'Array', function (iterated, kind) {
7390 this._t = toIObject(iterated); // target
7391 this._i = 0; // next index
7392 this._k = kind; // kind
7393// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
7394}, function () {
7395 var O = this._t;
7396 var kind = this._k;
7397 var index = this._i++;
7398 if (!O || index >= O.length) {
7399 this._t = undefined;
7400 return step(1);
7401 }
7402 if (kind == 'keys') return step(0, index);
7403 if (kind == 'values') return step(0, O[index]);
7404 return step(0, [index, O[index]]);
7405}, 'values');
7406
7407// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
7408Iterators.Arguments = Iterators.Array;
7409
7410addToUnscopables('keys');
7411addToUnscopables('values');
7412addToUnscopables('entries');
7413
7414
7415/***/ }),
7416/* 80 */
7417/***/ (function(module, exports) {
7418
7419module.exports = function () { /* empty */ };
7420
7421
7422/***/ }),
7423/* 81 */
7424/***/ (function(module, exports) {
7425
7426module.exports = function (done, value) {
7427 return { value: value, done: !!done };
7428};
7429
7430
7431/***/ }),
7432/* 82 */
7433/***/ (function(module, exports, __webpack_require__) {
7434
7435module.exports = { "default": __webpack_require__(83), __esModule: true };
7436
7437/***/ }),
7438/* 83 */
7439/***/ (function(module, exports, __webpack_require__) {
7440
7441__webpack_require__(84);
7442__webpack_require__(89);
7443__webpack_require__(90);
7444__webpack_require__(91);
7445module.exports = __webpack_require__(6).Symbol;
7446
7447
7448/***/ }),
7449/* 84 */
7450/***/ (function(module, exports, __webpack_require__) {
7451
7452"use strict";
7453
7454// ECMAScript 6 symbols shim
7455var global = __webpack_require__(5);
7456var has = __webpack_require__(7);
7457var DESCRIPTORS = __webpack_require__(12);
7458var $export = __webpack_require__(16);
7459var redefine = __webpack_require__(51);
7460var META = __webpack_require__(85).KEY;
7461var $fails = __webpack_require__(18);
7462var shared = __webpack_require__(31);
7463var setToStringTag = __webpack_require__(36);
7464var uid = __webpack_require__(24);
7465var wks = __webpack_require__(14);
7466var wksExt = __webpack_require__(37);
7467var wksDefine = __webpack_require__(38);
7468var enumKeys = __webpack_require__(86);
7469var isArray = __webpack_require__(87);
7470var anObject = __webpack_require__(17);
7471var isObject = __webpack_require__(11);
7472var toIObject = __webpack_require__(13);
7473var toPrimitive = __webpack_require__(27);
7474var createDesc = __webpack_require__(21);
7475var _create = __webpack_require__(35);
7476var gOPNExt = __webpack_require__(88);
7477var $GOPD = __webpack_require__(53);
7478var $DP = __webpack_require__(10);
7479var $keys = __webpack_require__(22);
7480var gOPD = $GOPD.f;
7481var dP = $DP.f;
7482var gOPN = gOPNExt.f;
7483var $Symbol = global.Symbol;
7484var $JSON = global.JSON;
7485var _stringify = $JSON && $JSON.stringify;
7486var PROTOTYPE = 'prototype';
7487var HIDDEN = wks('_hidden');
7488var TO_PRIMITIVE = wks('toPrimitive');
7489var isEnum = {}.propertyIsEnumerable;
7490var SymbolRegistry = shared('symbol-registry');
7491var AllSymbols = shared('symbols');
7492var OPSymbols = shared('op-symbols');
7493var ObjectProto = Object[PROTOTYPE];
7494var USE_NATIVE = typeof $Symbol == 'function';
7495var QObject = global.QObject;
7496// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
7497var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
7498
7499// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
7500var setSymbolDesc = DESCRIPTORS && $fails(function () {
7501 return _create(dP({}, 'a', {
7502 get: function () { return dP(this, 'a', { value: 7 }).a; }
7503 })).a != 7;
7504}) ? function (it, key, D) {
7505 var protoDesc = gOPD(ObjectProto, key);
7506 if (protoDesc) delete ObjectProto[key];
7507 dP(it, key, D);
7508 if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
7509} : dP;
7510
7511var wrap = function (tag) {
7512 var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
7513 sym._k = tag;
7514 return sym;
7515};
7516
7517var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
7518 return typeof it == 'symbol';
7519} : function (it) {
7520 return it instanceof $Symbol;
7521};
7522
7523var $defineProperty = function defineProperty(it, key, D) {
7524 if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
7525 anObject(it);
7526 key = toPrimitive(key, true);
7527 anObject(D);
7528 if (has(AllSymbols, key)) {
7529 if (!D.enumerable) {
7530 if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
7531 it[HIDDEN][key] = true;
7532 } else {
7533 if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
7534 D = _create(D, { enumerable: createDesc(0, false) });
7535 } return setSymbolDesc(it, key, D);
7536 } return dP(it, key, D);
7537};
7538var $defineProperties = function defineProperties(it, P) {
7539 anObject(it);
7540 var keys = enumKeys(P = toIObject(P));
7541 var i = 0;
7542 var l = keys.length;
7543 var key;
7544 while (l > i) $defineProperty(it, key = keys[i++], P[key]);
7545 return it;
7546};
7547var $create = function create(it, P) {
7548 return P === undefined ? _create(it) : $defineProperties(_create(it), P);
7549};
7550var $propertyIsEnumerable = function propertyIsEnumerable(key) {
7551 var E = isEnum.call(this, key = toPrimitive(key, true));
7552 if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
7553 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
7554};
7555var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
7556 it = toIObject(it);
7557 key = toPrimitive(key, true);
7558 if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
7559 var D = gOPD(it, key);
7560 if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
7561 return D;
7562};
7563var $getOwnPropertyNames = function getOwnPropertyNames(it) {
7564 var names = gOPN(toIObject(it));
7565 var result = [];
7566 var i = 0;
7567 var key;
7568 while (names.length > i) {
7569 if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
7570 } return result;
7571};
7572var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
7573 var IS_OP = it === ObjectProto;
7574 var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
7575 var result = [];
7576 var i = 0;
7577 var key;
7578 while (names.length > i) {
7579 if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
7580 } return result;
7581};
7582
7583// 19.4.1.1 Symbol([description])
7584if (!USE_NATIVE) {
7585 $Symbol = function Symbol() {
7586 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
7587 var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
7588 var $set = function (value) {
7589 if (this === ObjectProto) $set.call(OPSymbols, value);
7590 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
7591 setSymbolDesc(this, tag, createDesc(1, value));
7592 };
7593 if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
7594 return wrap(tag);
7595 };
7596 redefine($Symbol[PROTOTYPE], 'toString', function toString() {
7597 return this._k;
7598 });
7599
7600 $GOPD.f = $getOwnPropertyDescriptor;
7601 $DP.f = $defineProperty;
7602 __webpack_require__(52).f = gOPNExt.f = $getOwnPropertyNames;
7603 __webpack_require__(25).f = $propertyIsEnumerable;
7604 __webpack_require__(33).f = $getOwnPropertySymbols;
7605
7606 if (DESCRIPTORS && !__webpack_require__(23)) {
7607 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
7608 }
7609
7610 wksExt.f = function (name) {
7611 return wrap(wks(name));
7612 };
7613}
7614
7615$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
7616
7617for (var es6Symbols = (
7618 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
7619 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
7620).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
7621
7622for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
7623
7624$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
7625 // 19.4.2.1 Symbol.for(key)
7626 'for': function (key) {
7627 return has(SymbolRegistry, key += '')
7628 ? SymbolRegistry[key]
7629 : SymbolRegistry[key] = $Symbol(key);
7630 },
7631 // 19.4.2.5 Symbol.keyFor(sym)
7632 keyFor: function keyFor(sym) {
7633 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
7634 for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
7635 },
7636 useSetter: function () { setter = true; },
7637 useSimple: function () { setter = false; }
7638});
7639
7640$export($export.S + $export.F * !USE_NATIVE, 'Object', {
7641 // 19.1.2.2 Object.create(O [, Properties])
7642 create: $create,
7643 // 19.1.2.4 Object.defineProperty(O, P, Attributes)
7644 defineProperty: $defineProperty,
7645 // 19.1.2.3 Object.defineProperties(O, Properties)
7646 defineProperties: $defineProperties,
7647 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
7648 getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
7649 // 19.1.2.7 Object.getOwnPropertyNames(O)
7650 getOwnPropertyNames: $getOwnPropertyNames,
7651 // 19.1.2.8 Object.getOwnPropertySymbols(O)
7652 getOwnPropertySymbols: $getOwnPropertySymbols
7653});
7654
7655// 24.3.2 JSON.stringify(value [, replacer [, space]])
7656$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
7657 var S = $Symbol();
7658 // MS Edge converts symbol values to JSON as {}
7659 // WebKit converts symbol values to JSON as null
7660 // V8 throws on boxed symbols
7661 return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
7662})), 'JSON', {
7663 stringify: function stringify(it) {
7664 var args = [it];
7665 var i = 1;
7666 var replacer, $replacer;
7667 while (arguments.length > i) args.push(arguments[i++]);
7668 $replacer = replacer = args[1];
7669 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
7670 if (!isArray(replacer)) replacer = function (key, value) {
7671 if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
7672 if (!isSymbol(value)) return value;
7673 };
7674 args[1] = replacer;
7675 return _stringify.apply($JSON, args);
7676 }
7677});
7678
7679// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
7680$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(9)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
7681// 19.4.3.5 Symbol.prototype[@@toStringTag]
7682setToStringTag($Symbol, 'Symbol');
7683// 20.2.1.9 Math[@@toStringTag]
7684setToStringTag(Math, 'Math', true);
7685// 24.3.3 JSON[@@toStringTag]
7686setToStringTag(global.JSON, 'JSON', true);
7687
7688
7689/***/ }),
7690/* 85 */
7691/***/ (function(module, exports, __webpack_require__) {
7692
7693var META = __webpack_require__(24)('meta');
7694var isObject = __webpack_require__(11);
7695var has = __webpack_require__(7);
7696var setDesc = __webpack_require__(10).f;
7697var id = 0;
7698var isExtensible = Object.isExtensible || function () {
7699 return true;
7700};
7701var FREEZE = !__webpack_require__(18)(function () {
7702 return isExtensible(Object.preventExtensions({}));
7703});
7704var setMeta = function (it) {
7705 setDesc(it, META, { value: {
7706 i: 'O' + ++id, // object ID
7707 w: {} // weak collections IDs
7708 } });
7709};
7710var fastKey = function (it, create) {
7711 // return primitive with prefix
7712 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
7713 if (!has(it, META)) {
7714 // can't set metadata to uncaught frozen object
7715 if (!isExtensible(it)) return 'F';
7716 // not necessary to add metadata
7717 if (!create) return 'E';
7718 // add missing metadata
7719 setMeta(it);
7720 // return object ID
7721 } return it[META].i;
7722};
7723var getWeak = function (it, create) {
7724 if (!has(it, META)) {
7725 // can't set metadata to uncaught frozen object
7726 if (!isExtensible(it)) return true;
7727 // not necessary to add metadata
7728 if (!create) return false;
7729 // add missing metadata
7730 setMeta(it);
7731 // return hash weak collections IDs
7732 } return it[META].w;
7733};
7734// add metadata on freeze-family methods calling
7735var onFreeze = function (it) {
7736 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
7737 return it;
7738};
7739var meta = module.exports = {
7740 KEY: META,
7741 NEED: false,
7742 fastKey: fastKey,
7743 getWeak: getWeak,
7744 onFreeze: onFreeze
7745};
7746
7747
7748/***/ }),
7749/* 86 */
7750/***/ (function(module, exports, __webpack_require__) {
7751
7752// all enumerable object keys, includes symbols
7753var getKeys = __webpack_require__(22);
7754var gOPS = __webpack_require__(33);
7755var pIE = __webpack_require__(25);
7756module.exports = function (it) {
7757 var result = getKeys(it);
7758 var getSymbols = gOPS.f;
7759 if (getSymbols) {
7760 var symbols = getSymbols(it);
7761 var isEnum = pIE.f;
7762 var i = 0;
7763 var key;
7764 while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
7765 } return result;
7766};
7767
7768
7769/***/ }),
7770/* 87 */
7771/***/ (function(module, exports, __webpack_require__) {
7772
7773// 7.2.2 IsArray(argument)
7774var cof = __webpack_require__(47);
7775module.exports = Array.isArray || function isArray(arg) {
7776 return cof(arg) == 'Array';
7777};
7778
7779
7780/***/ }),
7781/* 88 */
7782/***/ (function(module, exports, __webpack_require__) {
7783
7784// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
7785var toIObject = __webpack_require__(13);
7786var gOPN = __webpack_require__(52).f;
7787var toString = {}.toString;
7788
7789var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
7790 ? Object.getOwnPropertyNames(window) : [];
7791
7792var getWindowNames = function (it) {
7793 try {
7794 return gOPN(it);
7795 } catch (e) {
7796 return windowNames.slice();
7797 }
7798};
7799
7800module.exports.f = function getOwnPropertyNames(it) {
7801 return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
7802};
7803
7804
7805/***/ }),
7806/* 89 */
7807/***/ (function(module, exports) {
7808
7809
7810
7811/***/ }),
7812/* 90 */
7813/***/ (function(module, exports, __webpack_require__) {
7814
7815__webpack_require__(38)('asyncIterator');
7816
7817
7818/***/ }),
7819/* 91 */
7820/***/ (function(module, exports, __webpack_require__) {
7821
7822__webpack_require__(38)('observable');
7823
7824
7825/***/ }),
7826/* 92 */
7827/***/ (function(module, exports, __webpack_require__) {
7828
7829module.exports = { "default": __webpack_require__(93), __esModule: true };
7830
7831/***/ }),
7832/* 93 */
7833/***/ (function(module, exports, __webpack_require__) {
7834
7835__webpack_require__(94);
7836module.exports = __webpack_require__(6).Object.setPrototypeOf;
7837
7838
7839/***/ }),
7840/* 94 */
7841/***/ (function(module, exports, __webpack_require__) {
7842
7843// 19.1.3.19 Object.setPrototypeOf(O, proto)
7844var $export = __webpack_require__(16);
7845$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(95).set });
7846
7847
7848/***/ }),
7849/* 95 */
7850/***/ (function(module, exports, __webpack_require__) {
7851
7852// Works with __proto__ only. Old v8 can't work with null proto objects.
7853/* eslint-disable no-proto */
7854var isObject = __webpack_require__(11);
7855var anObject = __webpack_require__(17);
7856var check = function (O, proto) {
7857 anObject(O);
7858 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
7859};
7860module.exports = {
7861 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
7862 function (test, buggy, set) {
7863 try {
7864 set = __webpack_require__(42)(Function.call, __webpack_require__(53).f(Object.prototype, '__proto__').set, 2);
7865 set(test, []);
7866 buggy = !(test instanceof Array);
7867 } catch (e) { buggy = true; }
7868 return function setPrototypeOf(O, proto) {
7869 check(O, proto);
7870 if (buggy) O.__proto__ = proto;
7871 else set(O, proto);
7872 return O;
7873 };
7874 }({}, false) : undefined),
7875 check: check
7876};
7877
7878
7879/***/ }),
7880/* 96 */
7881/***/ (function(module, exports, __webpack_require__) {
7882
7883module.exports = { "default": __webpack_require__(97), __esModule: true };
7884
7885/***/ }),
7886/* 97 */
7887/***/ (function(module, exports, __webpack_require__) {
7888
7889__webpack_require__(98);
7890var $Object = __webpack_require__(6).Object;
7891module.exports = function create(P, D) {
7892 return $Object.create(P, D);
7893};
7894
7895
7896/***/ }),
7897/* 98 */
7898/***/ (function(module, exports, __webpack_require__) {
7899
7900var $export = __webpack_require__(16);
7901// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
7902$export($export.S, 'Object', { create: __webpack_require__(35) });
7903
7904
7905/***/ }),
7906/* 99 */
7907/***/ (function(module, exports, __webpack_require__) {
7908
7909"use strict";
7910/** @license React v16.8.6
7911 * react-is.production.min.js
7912 *
7913 * Copyright (c) Facebook, Inc. and its affiliates.
7914 *
7915 * This source code is licensed under the MIT license found in the
7916 * LICENSE file in the root directory of this source tree.
7917 */
7918
7919Object.defineProperty(exports,"__esModule",{value:!0});
7920var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):
792160115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;
7922exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k};
7923exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f};
7924exports.isSuspense=function(a){return t(a)===p};
7925
7926
7927/***/ }),
7928/* 100 */
7929/***/ (function(module, exports, __webpack_require__) {
7930
7931"use strict";
7932/* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.8.6
7933 * react-is.development.js
7934 *
7935 * Copyright (c) Facebook, Inc. and its affiliates.
7936 *
7937 * This source code is licensed under the MIT license found in the
7938 * LICENSE file in the root directory of this source tree.
7939 */
7940
7941
7942
7943
7944
7945if (process.env.NODE_ENV !== "production") {
7946 (function() {
7947'use strict';
7948
7949Object.defineProperty(exports, '__esModule', { value: true });
7950
7951// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
7952// nor polyfill, then a plain number is used for performance.
7953var hasSymbol = typeof Symbol === 'function' && Symbol.for;
7954
7955var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
7956var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
7957var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
7958var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
7959var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
7960var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
7961var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
7962var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
7963var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
7964var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
7965var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
7966var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
7967var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
7968
7969function isValidElementType(type) {
7970 return typeof type === 'string' || typeof type === 'function' ||
7971 // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
7972 type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
7973}
7974
7975/**
7976 * Forked from fbjs/warning:
7977 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
7978 *
7979 * Only change is we use console.warn instead of console.error,
7980 * and do nothing when 'console' is not supported.
7981 * This really simplifies the code.
7982 * ---
7983 * Similar to invariant but only logs a warning if the condition is not met.
7984 * This can be used to log issues in development environments in critical
7985 * paths. Removing the logging code for production environments will keep the
7986 * same logic and follow the same code paths.
7987 */
7988
7989var lowPriorityWarning = function () {};
7990
7991{
7992 var printWarning = function (format) {
7993 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
7994 args[_key - 1] = arguments[_key];
7995 }
7996
7997 var argIndex = 0;
7998 var message = 'Warning: ' + format.replace(/%s/g, function () {
7999 return args[argIndex++];
8000 });
8001 if (typeof console !== 'undefined') {
8002 console.warn(message);
8003 }
8004 try {
8005 // --- Welcome to debugging React ---
8006 // This error was thrown as a convenience so that you can use this stack
8007 // to find the callsite that caused this warning to fire.
8008 throw new Error(message);
8009 } catch (x) {}
8010 };
8011
8012 lowPriorityWarning = function (condition, format) {
8013 if (format === undefined) {
8014 throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
8015 }
8016 if (!condition) {
8017 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
8018 args[_key2 - 2] = arguments[_key2];
8019 }
8020
8021 printWarning.apply(undefined, [format].concat(args));
8022 }
8023 };
8024}
8025
8026var lowPriorityWarning$1 = lowPriorityWarning;
8027
8028function typeOf(object) {
8029 if (typeof object === 'object' && object !== null) {
8030 var $$typeof = object.$$typeof;
8031 switch ($$typeof) {
8032 case REACT_ELEMENT_TYPE:
8033 var type = object.type;
8034
8035 switch (type) {
8036 case REACT_ASYNC_MODE_TYPE:
8037 case REACT_CONCURRENT_MODE_TYPE:
8038 case REACT_FRAGMENT_TYPE:
8039 case REACT_PROFILER_TYPE:
8040 case REACT_STRICT_MODE_TYPE:
8041 case REACT_SUSPENSE_TYPE:
8042 return type;
8043 default:
8044 var $$typeofType = type && type.$$typeof;
8045
8046 switch ($$typeofType) {
8047 case REACT_CONTEXT_TYPE:
8048 case REACT_FORWARD_REF_TYPE:
8049 case REACT_PROVIDER_TYPE:
8050 return $$typeofType;
8051 default:
8052 return $$typeof;
8053 }
8054 }
8055 case REACT_LAZY_TYPE:
8056 case REACT_MEMO_TYPE:
8057 case REACT_PORTAL_TYPE:
8058 return $$typeof;
8059 }
8060 }
8061
8062 return undefined;
8063}
8064
8065// AsyncMode is deprecated along with isAsyncMode
8066var AsyncMode = REACT_ASYNC_MODE_TYPE;
8067var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
8068var ContextConsumer = REACT_CONTEXT_TYPE;
8069var ContextProvider = REACT_PROVIDER_TYPE;
8070var Element = REACT_ELEMENT_TYPE;
8071var ForwardRef = REACT_FORWARD_REF_TYPE;
8072var Fragment = REACT_FRAGMENT_TYPE;
8073var Lazy = REACT_LAZY_TYPE;
8074var Memo = REACT_MEMO_TYPE;
8075var Portal = REACT_PORTAL_TYPE;
8076var Profiler = REACT_PROFILER_TYPE;
8077var StrictMode = REACT_STRICT_MODE_TYPE;
8078var Suspense = REACT_SUSPENSE_TYPE;
8079
8080var hasWarnedAboutDeprecatedIsAsyncMode = false;
8081
8082// AsyncMode should be deprecated
8083function isAsyncMode(object) {
8084 {
8085 if (!hasWarnedAboutDeprecatedIsAsyncMode) {
8086 hasWarnedAboutDeprecatedIsAsyncMode = true;
8087 lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
8088 }
8089 }
8090 return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
8091}
8092function isConcurrentMode(object) {
8093 return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
8094}
8095function isContextConsumer(object) {
8096 return typeOf(object) === REACT_CONTEXT_TYPE;
8097}
8098function isContextProvider(object) {
8099 return typeOf(object) === REACT_PROVIDER_TYPE;
8100}
8101function isElement(object) {
8102 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
8103}
8104function isForwardRef(object) {
8105 return typeOf(object) === REACT_FORWARD_REF_TYPE;
8106}
8107function isFragment(object) {
8108 return typeOf(object) === REACT_FRAGMENT_TYPE;
8109}
8110function isLazy(object) {
8111 return typeOf(object) === REACT_LAZY_TYPE;
8112}
8113function isMemo(object) {
8114 return typeOf(object) === REACT_MEMO_TYPE;
8115}
8116function isPortal(object) {
8117 return typeOf(object) === REACT_PORTAL_TYPE;
8118}
8119function isProfiler(object) {
8120 return typeOf(object) === REACT_PROFILER_TYPE;
8121}
8122function isStrictMode(object) {
8123 return typeOf(object) === REACT_STRICT_MODE_TYPE;
8124}
8125function isSuspense(object) {
8126 return typeOf(object) === REACT_SUSPENSE_TYPE;
8127}
8128
8129exports.typeOf = typeOf;
8130exports.AsyncMode = AsyncMode;
8131exports.ConcurrentMode = ConcurrentMode;
8132exports.ContextConsumer = ContextConsumer;
8133exports.ContextProvider = ContextProvider;
8134exports.Element = Element;
8135exports.ForwardRef = ForwardRef;
8136exports.Fragment = Fragment;
8137exports.Lazy = Lazy;
8138exports.Memo = Memo;
8139exports.Portal = Portal;
8140exports.Profiler = Profiler;
8141exports.StrictMode = StrictMode;
8142exports.Suspense = Suspense;
8143exports.isValidElementType = isValidElementType;
8144exports.isAsyncMode = isAsyncMode;
8145exports.isConcurrentMode = isConcurrentMode;
8146exports.isContextConsumer = isContextConsumer;
8147exports.isContextProvider = isContextProvider;
8148exports.isElement = isElement;
8149exports.isForwardRef = isForwardRef;
8150exports.isFragment = isFragment;
8151exports.isLazy = isLazy;
8152exports.isMemo = isMemo;
8153exports.isPortal = isPortal;
8154exports.isProfiler = isProfiler;
8155exports.isStrictMode = isStrictMode;
8156exports.isSuspense = isSuspense;
8157 })();
8158}
8159
8160/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))
8161
8162/***/ }),
8163/* 101 */
8164/***/ (function(module, exports, __webpack_require__) {
8165
8166"use strict";
8167/* WEBPACK VAR INJECTION */(function(process) {/**
8168 * Copyright (c) 2013-present, Facebook, Inc.
8169 *
8170 * This source code is licensed under the MIT license found in the
8171 * LICENSE file in the root directory of this source tree.
8172 */
8173
8174
8175
8176var ReactIs = __webpack_require__(54);
8177var assign = __webpack_require__(102);
8178
8179var ReactPropTypesSecret = __webpack_require__(40);
8180var checkPropTypes = __webpack_require__(103);
8181
8182var has = Function.call.bind(Object.prototype.hasOwnProperty);
8183var printWarning = function() {};
8184
8185if (process.env.NODE_ENV !== 'production') {
8186 printWarning = function(text) {
8187 var message = 'Warning: ' + text;
8188 if (typeof console !== 'undefined') {
8189 console.error(message);
8190 }
8191 try {
8192 // --- Welcome to debugging React ---
8193 // This error was thrown as a convenience so that you can use this stack
8194 // to find the callsite that caused this warning to fire.
8195 throw new Error(message);
8196 } catch (x) {}
8197 };
8198}
8199
8200function emptyFunctionThatReturnsNull() {
8201 return null;
8202}
8203
8204module.exports = function(isValidElement, throwOnDirectAccess) {
8205 /* global Symbol */
8206 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
8207 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
8208
8209 /**
8210 * Returns the iterator method function contained on the iterable object.
8211 *
8212 * Be sure to invoke the function with the iterable as context:
8213 *
8214 * var iteratorFn = getIteratorFn(myIterable);
8215 * if (iteratorFn) {
8216 * var iterator = iteratorFn.call(myIterable);
8217 * ...
8218 * }
8219 *
8220 * @param {?object} maybeIterable
8221 * @return {?function}
8222 */
8223 function getIteratorFn(maybeIterable) {
8224 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
8225 if (typeof iteratorFn === 'function') {
8226 return iteratorFn;
8227 }
8228 }
8229
8230 /**
8231 * Collection of methods that allow declaration and validation of props that are
8232 * supplied to React components. Example usage:
8233 *
8234 * var Props = require('ReactPropTypes');
8235 * var MyArticle = React.createClass({
8236 * propTypes: {
8237 * // An optional string prop named "description".
8238 * description: Props.string,
8239 *
8240 * // A required enum prop named "category".
8241 * category: Props.oneOf(['News','Photos']).isRequired,
8242 *
8243 * // A prop named "dialog" that requires an instance of Dialog.
8244 * dialog: Props.instanceOf(Dialog).isRequired
8245 * },
8246 * render: function() { ... }
8247 * });
8248 *
8249 * A more formal specification of how these methods are used:
8250 *
8251 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
8252 * decl := ReactPropTypes.{type}(.isRequired)?
8253 *
8254 * Each and every declaration produces a function with the same signature. This
8255 * allows the creation of custom validation functions. For example:
8256 *
8257 * var MyLink = React.createClass({
8258 * propTypes: {
8259 * // An optional string or URI prop named "href".
8260 * href: function(props, propName, componentName) {
8261 * var propValue = props[propName];
8262 * if (propValue != null && typeof propValue !== 'string' &&
8263 * !(propValue instanceof URI)) {
8264 * return new Error(
8265 * 'Expected a string or an URI for ' + propName + ' in ' +
8266 * componentName
8267 * );
8268 * }
8269 * }
8270 * },
8271 * render: function() {...}
8272 * });
8273 *
8274 * @internal
8275 */
8276
8277 var ANONYMOUS = '<<anonymous>>';
8278
8279 // Important!
8280 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
8281 var ReactPropTypes = {
8282 array: createPrimitiveTypeChecker('array'),
8283 bool: createPrimitiveTypeChecker('boolean'),
8284 func: createPrimitiveTypeChecker('function'),
8285 number: createPrimitiveTypeChecker('number'),
8286 object: createPrimitiveTypeChecker('object'),
8287 string: createPrimitiveTypeChecker('string'),
8288 symbol: createPrimitiveTypeChecker('symbol'),
8289
8290 any: createAnyTypeChecker(),
8291 arrayOf: createArrayOfTypeChecker,
8292 element: createElementTypeChecker(),
8293 elementType: createElementTypeTypeChecker(),
8294 instanceOf: createInstanceTypeChecker,
8295 node: createNodeChecker(),
8296 objectOf: createObjectOfTypeChecker,
8297 oneOf: createEnumTypeChecker,
8298 oneOfType: createUnionTypeChecker,
8299 shape: createShapeTypeChecker,
8300 exact: createStrictShapeTypeChecker,
8301 };
8302
8303 /**
8304 * inlined Object.is polyfill to avoid requiring consumers ship their own
8305 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
8306 */
8307 /*eslint-disable no-self-compare*/
8308 function is(x, y) {
8309 // SameValue algorithm
8310 if (x === y) {
8311 // Steps 1-5, 7-10
8312 // Steps 6.b-6.e: +0 != -0
8313 return x !== 0 || 1 / x === 1 / y;
8314 } else {
8315 // Step 6.a: NaN == NaN
8316 return x !== x && y !== y;
8317 }
8318 }
8319 /*eslint-enable no-self-compare*/
8320
8321 /**
8322 * We use an Error-like object for backward compatibility as people may call
8323 * PropTypes directly and inspect their output. However, we don't use real
8324 * Errors anymore. We don't inspect their stack anyway, and creating them
8325 * is prohibitively expensive if they are created too often, such as what
8326 * happens in oneOfType() for any type before the one that matched.
8327 */
8328 function PropTypeError(message) {
8329 this.message = message;
8330 this.stack = '';
8331 }
8332 // Make `instanceof Error` still work for returned errors.
8333 PropTypeError.prototype = Error.prototype;
8334
8335 function createChainableTypeChecker(validate) {
8336 if (process.env.NODE_ENV !== 'production') {
8337 var manualPropTypeCallCache = {};
8338 var manualPropTypeWarningCount = 0;
8339 }
8340 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
8341 componentName = componentName || ANONYMOUS;
8342 propFullName = propFullName || propName;
8343
8344 if (secret !== ReactPropTypesSecret) {
8345 if (throwOnDirectAccess) {
8346 // New behavior only for users of `prop-types` package
8347 var err = new Error(
8348 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
8349 'Use `PropTypes.checkPropTypes()` to call them. ' +
8350 'Read more at http://fb.me/use-check-prop-types'
8351 );
8352 err.name = 'Invariant Violation';
8353 throw err;
8354 } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
8355 // Old behavior for people using React.PropTypes
8356 var cacheKey = componentName + ':' + propName;
8357 if (
8358 !manualPropTypeCallCache[cacheKey] &&
8359 // Avoid spamming the console because they are often not actionable except for lib authors
8360 manualPropTypeWarningCount < 3
8361 ) {
8362 printWarning(
8363 'You are manually calling a React.PropTypes validation ' +
8364 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
8365 'and will throw in the standalone `prop-types` package. ' +
8366 'You may be seeing this warning due to a third-party PropTypes ' +
8367 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
8368 );
8369 manualPropTypeCallCache[cacheKey] = true;
8370 manualPropTypeWarningCount++;
8371 }
8372 }
8373 }
8374 if (props[propName] == null) {
8375 if (isRequired) {
8376 if (props[propName] === null) {
8377 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
8378 }
8379 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
8380 }
8381 return null;
8382 } else {
8383 return validate(props, propName, componentName, location, propFullName);
8384 }
8385 }
8386
8387 var chainedCheckType = checkType.bind(null, false);
8388 chainedCheckType.isRequired = checkType.bind(null, true);
8389
8390 return chainedCheckType;
8391 }
8392
8393 function createPrimitiveTypeChecker(expectedType) {
8394 function validate(props, propName, componentName, location, propFullName, secret) {
8395 var propValue = props[propName];
8396 var propType = getPropType(propValue);
8397 if (propType !== expectedType) {
8398 // `propValue` being instance of, say, date/regexp, pass the 'object'
8399 // check, but we can offer a more precise error message here rather than
8400 // 'of type `object`'.
8401 var preciseType = getPreciseType(propValue);
8402
8403 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
8404 }
8405 return null;
8406 }
8407 return createChainableTypeChecker(validate);
8408 }
8409
8410 function createAnyTypeChecker() {
8411 return createChainableTypeChecker(emptyFunctionThatReturnsNull);
8412 }
8413
8414 function createArrayOfTypeChecker(typeChecker) {
8415 function validate(props, propName, componentName, location, propFullName) {
8416 if (typeof typeChecker !== 'function') {
8417 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
8418 }
8419 var propValue = props[propName];
8420 if (!Array.isArray(propValue)) {
8421 var propType = getPropType(propValue);
8422 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
8423 }
8424 for (var i = 0; i < propValue.length; i++) {
8425 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
8426 if (error instanceof Error) {
8427 return error;
8428 }
8429 }
8430 return null;
8431 }
8432 return createChainableTypeChecker(validate);
8433 }
8434
8435 function createElementTypeChecker() {
8436 function validate(props, propName, componentName, location, propFullName) {
8437 var propValue = props[propName];
8438 if (!isValidElement(propValue)) {
8439 var propType = getPropType(propValue);
8440 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
8441 }
8442 return null;
8443 }
8444 return createChainableTypeChecker(validate);
8445 }
8446
8447 function createElementTypeTypeChecker() {
8448 function validate(props, propName, componentName, location, propFullName) {
8449 var propValue = props[propName];
8450 if (!ReactIs.isValidElementType(propValue)) {
8451 var propType = getPropType(propValue);
8452 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
8453 }
8454 return null;
8455 }
8456 return createChainableTypeChecker(validate);
8457 }
8458
8459 function createInstanceTypeChecker(expectedClass) {
8460 function validate(props, propName, componentName, location, propFullName) {
8461 if (!(props[propName] instanceof expectedClass)) {
8462 var expectedClassName = expectedClass.name || ANONYMOUS;
8463 var actualClassName = getClassName(props[propName]);
8464 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
8465 }
8466 return null;
8467 }
8468 return createChainableTypeChecker(validate);
8469 }
8470
8471 function createEnumTypeChecker(expectedValues) {
8472 if (!Array.isArray(expectedValues)) {
8473 if (process.env.NODE_ENV !== 'production') {
8474 if (arguments.length > 1) {
8475 printWarning(
8476 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
8477 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
8478 );
8479 } else {
8480 printWarning('Invalid argument supplied to oneOf, expected an array.');
8481 }
8482 }
8483 return emptyFunctionThatReturnsNull;
8484 }
8485
8486 function validate(props, propName, componentName, location, propFullName) {
8487 var propValue = props[propName];
8488 for (var i = 0; i < expectedValues.length; i++) {
8489 if (is(propValue, expectedValues[i])) {
8490 return null;
8491 }
8492 }
8493
8494 var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
8495 var type = getPreciseType(value);
8496 if (type === 'symbol') {
8497 return String(value);
8498 }
8499 return value;
8500 });
8501 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
8502 }
8503 return createChainableTypeChecker(validate);
8504 }
8505
8506 function createObjectOfTypeChecker(typeChecker) {
8507 function validate(props, propName, componentName, location, propFullName) {
8508 if (typeof typeChecker !== 'function') {
8509 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
8510 }
8511 var propValue = props[propName];
8512 var propType = getPropType(propValue);
8513 if (propType !== 'object') {
8514 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
8515 }
8516 for (var key in propValue) {
8517 if (has(propValue, key)) {
8518 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
8519 if (error instanceof Error) {
8520 return error;
8521 }
8522 }
8523 }
8524 return null;
8525 }
8526 return createChainableTypeChecker(validate);
8527 }
8528
8529 function createUnionTypeChecker(arrayOfTypeCheckers) {
8530 if (!Array.isArray(arrayOfTypeCheckers)) {
8531 process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
8532 return emptyFunctionThatReturnsNull;
8533 }
8534
8535 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
8536 var checker = arrayOfTypeCheckers[i];
8537 if (typeof checker !== 'function') {
8538 printWarning(
8539 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
8540 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
8541 );
8542 return emptyFunctionThatReturnsNull;
8543 }
8544 }
8545
8546 function validate(props, propName, componentName, location, propFullName) {
8547 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
8548 var checker = arrayOfTypeCheckers[i];
8549 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
8550 return null;
8551 }
8552 }
8553
8554 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
8555 }
8556 return createChainableTypeChecker(validate);
8557 }
8558
8559 function createNodeChecker() {
8560 function validate(props, propName, componentName, location, propFullName) {
8561 if (!isNode(props[propName])) {
8562 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
8563 }
8564 return null;
8565 }
8566 return createChainableTypeChecker(validate);
8567 }
8568
8569 function createShapeTypeChecker(shapeTypes) {
8570 function validate(props, propName, componentName, location, propFullName) {
8571 var propValue = props[propName];
8572 var propType = getPropType(propValue);
8573 if (propType !== 'object') {
8574 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
8575 }
8576 for (var key in shapeTypes) {
8577 var checker = shapeTypes[key];
8578 if (!checker) {
8579 continue;
8580 }
8581 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
8582 if (error) {
8583 return error;
8584 }
8585 }
8586 return null;
8587 }
8588 return createChainableTypeChecker(validate);
8589 }
8590
8591 function createStrictShapeTypeChecker(shapeTypes) {
8592 function validate(props, propName, componentName, location, propFullName) {
8593 var propValue = props[propName];
8594 var propType = getPropType(propValue);
8595 if (propType !== 'object') {
8596 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
8597 }
8598 // We need to check all keys in case some are required but missing from
8599 // props.
8600 var allKeys = assign({}, props[propName], shapeTypes);
8601 for (var key in allKeys) {
8602 var checker = shapeTypes[key];
8603 if (!checker) {
8604 return new PropTypeError(
8605 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
8606 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
8607 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
8608 );
8609 }
8610 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
8611 if (error) {
8612 return error;
8613 }
8614 }
8615 return null;
8616 }
8617
8618 return createChainableTypeChecker(validate);
8619 }
8620
8621 function isNode(propValue) {
8622 switch (typeof propValue) {
8623 case 'number':
8624 case 'string':
8625 case 'undefined':
8626 return true;
8627 case 'boolean':
8628 return !propValue;
8629 case 'object':
8630 if (Array.isArray(propValue)) {
8631 return propValue.every(isNode);
8632 }
8633 if (propValue === null || isValidElement(propValue)) {
8634 return true;
8635 }
8636
8637 var iteratorFn = getIteratorFn(propValue);
8638 if (iteratorFn) {
8639 var iterator = iteratorFn.call(propValue);
8640 var step;
8641 if (iteratorFn !== propValue.entries) {
8642 while (!(step = iterator.next()).done) {
8643 if (!isNode(step.value)) {
8644 return false;
8645 }
8646 }
8647 } else {
8648 // Iterator will provide entry [k,v] tuples rather than values.
8649 while (!(step = iterator.next()).done) {
8650 var entry = step.value;
8651 if (entry) {
8652 if (!isNode(entry[1])) {
8653 return false;
8654 }
8655 }
8656 }
8657 }
8658 } else {
8659 return false;
8660 }
8661
8662 return true;
8663 default:
8664 return false;
8665 }
8666 }
8667
8668 function isSymbol(propType, propValue) {
8669 // Native Symbol.
8670 if (propType === 'symbol') {
8671 return true;
8672 }
8673
8674 // falsy value can't be a Symbol
8675 if (!propValue) {
8676 return false;
8677 }
8678
8679 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
8680 if (propValue['@@toStringTag'] === 'Symbol') {
8681 return true;
8682 }
8683
8684 // Fallback for non-spec compliant Symbols which are polyfilled.
8685 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
8686 return true;
8687 }
8688
8689 return false;
8690 }
8691
8692 // Equivalent of `typeof` but with special handling for array and regexp.
8693 function getPropType(propValue) {
8694 var propType = typeof propValue;
8695 if (Array.isArray(propValue)) {
8696 return 'array';
8697 }
8698 if (propValue instanceof RegExp) {
8699 // Old webkits (at least until Android 4.0) return 'function' rather than
8700 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
8701 // passes PropTypes.object.
8702 return 'object';
8703 }
8704 if (isSymbol(propType, propValue)) {
8705 return 'symbol';
8706 }
8707 return propType;
8708 }
8709
8710 // This handles more types than `getPropType`. Only used for error messages.
8711 // See `createPrimitiveTypeChecker`.
8712 function getPreciseType(propValue) {
8713 if (typeof propValue === 'undefined' || propValue === null) {
8714 return '' + propValue;
8715 }
8716 var propType = getPropType(propValue);
8717 if (propType === 'object') {
8718 if (propValue instanceof Date) {
8719 return 'date';
8720 } else if (propValue instanceof RegExp) {
8721 return 'regexp';
8722 }
8723 }
8724 return propType;
8725 }
8726
8727 // Returns a string that is postfixed to a warning about an invalid type.
8728 // For example, "undefined" or "of type array"
8729 function getPostfixForTypeWarning(value) {
8730 var type = getPreciseType(value);
8731 switch (type) {
8732 case 'array':
8733 case 'object':
8734 return 'an ' + type;
8735 case 'boolean':
8736 case 'date':
8737 case 'regexp':
8738 return 'a ' + type;
8739 default:
8740 return type;
8741 }
8742 }
8743
8744 // Returns class name of the object, if any.
8745 function getClassName(propValue) {
8746 if (!propValue.constructor || !propValue.constructor.name) {
8747 return ANONYMOUS;
8748 }
8749 return propValue.constructor.name;
8750 }
8751
8752 ReactPropTypes.checkPropTypes = checkPropTypes;
8753 ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
8754 ReactPropTypes.PropTypes = ReactPropTypes;
8755
8756 return ReactPropTypes;
8757};
8758
8759/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))
8760
8761/***/ }),
8762/* 102 */
8763/***/ (function(module, exports, __webpack_require__) {
8764
8765"use strict";
8766/*
8767object-assign
8768(c) Sindre Sorhus
8769@license MIT
8770*/
8771
8772
8773/* eslint-disable no-unused-vars */
8774var getOwnPropertySymbols = Object.getOwnPropertySymbols;
8775var hasOwnProperty = Object.prototype.hasOwnProperty;
8776var propIsEnumerable = Object.prototype.propertyIsEnumerable;
8777
8778function toObject(val) {
8779 if (val === null || val === undefined) {
8780 throw new TypeError('Object.assign cannot be called with null or undefined');
8781 }
8782
8783 return Object(val);
8784}
8785
8786function shouldUseNative() {
8787 try {
8788 if (!Object.assign) {
8789 return false;
8790 }
8791
8792 // Detect buggy property enumeration order in older V8 versions.
8793
8794 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
8795 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
8796 test1[5] = 'de';
8797 if (Object.getOwnPropertyNames(test1)[0] === '5') {
8798 return false;
8799 }
8800
8801 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
8802 var test2 = {};
8803 for (var i = 0; i < 10; i++) {
8804 test2['_' + String.fromCharCode(i)] = i;
8805 }
8806 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
8807 return test2[n];
8808 });
8809 if (order2.join('') !== '0123456789') {
8810 return false;
8811 }
8812
8813 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
8814 var test3 = {};
8815 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
8816 test3[letter] = letter;
8817 });
8818 if (Object.keys(Object.assign({}, test3)).join('') !==
8819 'abcdefghijklmnopqrst') {
8820 return false;
8821 }
8822
8823 return true;
8824 } catch (err) {
8825 // We don't expect any of the above to throw, but better to be safe.
8826 return false;
8827 }
8828}
8829
8830module.exports = shouldUseNative() ? Object.assign : function (target, source) {
8831 var from;
8832 var to = toObject(target);
8833 var symbols;
8834
8835 for (var s = 1; s < arguments.length; s++) {
8836 from = Object(arguments[s]);
8837
8838 for (var key in from) {
8839 if (hasOwnProperty.call(from, key)) {
8840 to[key] = from[key];
8841 }
8842 }
8843
8844 if (getOwnPropertySymbols) {
8845 symbols = getOwnPropertySymbols(from);
8846 for (var i = 0; i < symbols.length; i++) {
8847 if (propIsEnumerable.call(from, symbols[i])) {
8848 to[symbols[i]] = from[symbols[i]];
8849 }
8850 }
8851 }
8852 }
8853
8854 return to;
8855};
8856
8857
8858/***/ }),
8859/* 103 */
8860/***/ (function(module, exports, __webpack_require__) {
8861
8862"use strict";
8863/* WEBPACK VAR INJECTION */(function(process) {/**
8864 * Copyright (c) 2013-present, Facebook, Inc.
8865 *
8866 * This source code is licensed under the MIT license found in the
8867 * LICENSE file in the root directory of this source tree.
8868 */
8869
8870
8871
8872var printWarning = function() {};
8873
8874if (process.env.NODE_ENV !== 'production') {
8875 var ReactPropTypesSecret = __webpack_require__(40);
8876 var loggedTypeFailures = {};
8877 var has = Function.call.bind(Object.prototype.hasOwnProperty);
8878
8879 printWarning = function(text) {
8880 var message = 'Warning: ' + text;
8881 if (typeof console !== 'undefined') {
8882 console.error(message);
8883 }
8884 try {
8885 // --- Welcome to debugging React ---
8886 // This error was thrown as a convenience so that you can use this stack
8887 // to find the callsite that caused this warning to fire.
8888 throw new Error(message);
8889 } catch (x) {}
8890 };
8891}
8892
8893/**
8894 * Assert that the values match with the type specs.
8895 * Error messages are memorized and will only be shown once.
8896 *
8897 * @param {object} typeSpecs Map of name to a ReactPropType
8898 * @param {object} values Runtime values that need to be type-checked
8899 * @param {string} location e.g. "prop", "context", "child context"
8900 * @param {string} componentName Name of the component for error messages.
8901 * @param {?Function} getStack Returns the component stack.
8902 * @private
8903 */
8904function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
8905 if (process.env.NODE_ENV !== 'production') {
8906 for (var typeSpecName in typeSpecs) {
8907 if (has(typeSpecs, typeSpecName)) {
8908 var error;
8909 // Prop type validation may throw. In case they do, we don't want to
8910 // fail the render phase where it didn't fail before. So we log it.
8911 // After these have been cleaned up, we'll let them throw.
8912 try {
8913 // This is intentionally an invariant that gets caught. It's the same
8914 // behavior as without this statement except with a better message.
8915 if (typeof typeSpecs[typeSpecName] !== 'function') {
8916 var err = Error(
8917 (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
8918 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
8919 );
8920 err.name = 'Invariant Violation';
8921 throw err;
8922 }
8923 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
8924 } catch (ex) {
8925 error = ex;
8926 }
8927 if (error && !(error instanceof Error)) {
8928 printWarning(
8929 (componentName || 'React class') + ': type specification of ' +
8930 location + ' `' + typeSpecName + '` is invalid; the type checker ' +
8931 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
8932 'You may have forgotten to pass an argument to the type checker ' +
8933 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
8934 'shape all require an argument).'
8935 );
8936 }
8937 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
8938 // Only monitor this failure once because there tends to be a lot of the
8939 // same error.
8940 loggedTypeFailures[error.message] = true;
8941
8942 var stack = getStack ? getStack() : '';
8943
8944 printWarning(
8945 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
8946 );
8947 }
8948 }
8949 }
8950 }
8951}
8952
8953/**
8954 * Resets warning cache when testing.
8955 *
8956 * @private
8957 */
8958checkPropTypes.resetWarningCache = function() {
8959 if (process.env.NODE_ENV !== 'production') {
8960 loggedTypeFailures = {};
8961 }
8962}
8963
8964module.exports = checkPropTypes;
8965
8966/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))
8967
8968/***/ }),
8969/* 104 */
8970/***/ (function(module, exports, __webpack_require__) {
8971
8972"use strict";
8973/**
8974 * Copyright (c) 2013-present, Facebook, Inc.
8975 *
8976 * This source code is licensed under the MIT license found in the
8977 * LICENSE file in the root directory of this source tree.
8978 */
8979
8980
8981
8982var ReactPropTypesSecret = __webpack_require__(40);
8983
8984function emptyFunction() {}
8985function emptyFunctionWithReset() {}
8986emptyFunctionWithReset.resetWarningCache = emptyFunction;
8987
8988module.exports = function() {
8989 function shim(props, propName, componentName, location, propFullName, secret) {
8990 if (secret === ReactPropTypesSecret) {
8991 // It is still safe when called from React.
8992 return;
8993 }
8994 var err = new Error(
8995 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
8996 'Use PropTypes.checkPropTypes() to call them. ' +
8997 'Read more at http://fb.me/use-check-prop-types'
8998 );
8999 err.name = 'Invariant Violation';
9000 throw err;
9001 };
9002 shim.isRequired = shim;
9003 function getShim() {
9004 return shim;
9005 };
9006 // Important!
9007 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
9008 var ReactPropTypes = {
9009 array: shim,
9010 bool: shim,
9011 func: shim,
9012 number: shim,
9013 object: shim,
9014 string: shim,
9015 symbol: shim,
9016
9017 any: shim,
9018 arrayOf: getShim,
9019 element: shim,
9020 elementType: shim,
9021 instanceOf: getShim,
9022 node: shim,
9023 objectOf: getShim,
9024 oneOf: getShim,
9025 oneOfType: getShim,
9026 shape: getShim,
9027 exact: getShim,
9028
9029 checkPropTypes: emptyFunctionWithReset,
9030 resetWarningCache: emptyFunction
9031 };
9032
9033 ReactPropTypes.PropTypes = ReactPropTypes;
9034
9035 return ReactPropTypes;
9036};
9037
9038
9039/***/ }),
9040/* 105 */
9041/***/ (function(module, __webpack_exports__, __webpack_require__) {
9042
9043"use strict";
9044/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
9045/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
9046/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
9047/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
9048/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
9049/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
9050/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
9051/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
9052/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__DateTHead__ = __webpack_require__(106);
9053/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DateTBody__ = __webpack_require__(107);
9054
9055
9056
9057
9058
9059
9060
9061
9062var DateTable = function (_React$Component) {
9063 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(DateTable, _React$Component);
9064
9065 function DateTable() {
9066 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, DateTable);
9067
9068 return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
9069 }
9070
9071 DateTable.prototype.render = function render() {
9072 var props = this.props;
9073 var prefixCls = props.prefixCls;
9074 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9075 'table',
9076 { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
9077 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__DateTHead__["a" /* default */], props),
9078 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__DateTBody__["a" /* default */], props)
9079 );
9080 };
9081
9082 return DateTable;
9083}(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
9084
9085/* harmony default export */ __webpack_exports__["a"] = (DateTable);
9086
9087/***/ }),
9088/* 106 */
9089/***/ (function(module, __webpack_exports__, __webpack_require__) {
9090
9091"use strict";
9092/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
9093/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
9094/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
9095/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
9096/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
9097/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
9098/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
9099/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
9100/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__DateConstants__ = __webpack_require__(56);
9101/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment__ = __webpack_require__(20);
9102/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_moment__);
9103
9104
9105
9106
9107
9108
9109
9110var DateTHead = function (_React$Component) {
9111 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(DateTHead, _React$Component);
9112
9113 function DateTHead() {
9114 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, DateTHead);
9115
9116 return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
9117 }
9118
9119 DateTHead.prototype.render = function render() {
9120 var props = this.props;
9121 var value = props.value;
9122 var localeData = value.localeData();
9123 var prefixCls = props.prefixCls;
9124 var veryShortWeekdays = [];
9125 var weekDays = [];
9126 var firstDayOfWeek = localeData.firstDayOfWeek();
9127 var showWeekNumberEl = void 0;
9128 var now = __WEBPACK_IMPORTED_MODULE_5_moment___default()();
9129 for (var dateColIndex = 0; dateColIndex < __WEBPACK_IMPORTED_MODULE_4__DateConstants__["a" /* default */].DATE_COL_COUNT; dateColIndex++) {
9130 var index = (firstDayOfWeek + dateColIndex) % __WEBPACK_IMPORTED_MODULE_4__DateConstants__["a" /* default */].DATE_COL_COUNT;
9131 now.day(index);
9132 veryShortWeekdays[dateColIndex] = localeData.weekdaysMin(now);
9133 weekDays[dateColIndex] = localeData.weekdaysShort(now);
9134 }
9135
9136 if (props.showWeekNumber) {
9137 showWeekNumberEl = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9138 'th',
9139 {
9140 role: 'columnheader',
9141 className: prefixCls + '-column-header ' + prefixCls + '-week-number-header'
9142 },
9143 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9144 'span',
9145 { className: prefixCls + '-column-header-inner' },
9146 'x'
9147 )
9148 );
9149 }
9150 var weekDaysEls = weekDays.map(function (day, xindex) {
9151 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9152 'th',
9153 {
9154 key: xindex,
9155 role: 'columnheader',
9156 title: day,
9157 className: prefixCls + '-column-header'
9158 },
9159 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9160 'span',
9161 { className: prefixCls + '-column-header-inner' },
9162 veryShortWeekdays[xindex]
9163 )
9164 );
9165 });
9166 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9167 'thead',
9168 null,
9169 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9170 'tr',
9171 { role: 'row' },
9172 showWeekNumberEl,
9173 weekDaysEls
9174 )
9175 );
9176 };
9177
9178 return DateTHead;
9179}(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
9180
9181/* harmony default export */ __webpack_exports__["a"] = (DateTHead);
9182
9183/***/ }),
9184/* 107 */
9185/***/ (function(module, __webpack_exports__, __webpack_require__) {
9186
9187"use strict";
9188/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
9189/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
9190/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
9191/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
9192/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
9193/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
9194/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
9195/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
9196/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(4);
9197/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
9198/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(8);
9199/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
9200/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__DateConstants__ = __webpack_require__(56);
9201/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util___ = __webpack_require__(15);
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211function isSameDay(one, two) {
9212 return one && two && one.isSame(two, 'day');
9213}
9214
9215function beforeCurrentMonthYear(current, today) {
9216 if (current.year() < today.year()) {
9217 return 1;
9218 }
9219 return current.year() === today.year() && current.month() < today.month();
9220}
9221
9222function afterCurrentMonthYear(current, today) {
9223 if (current.year() > today.year()) {
9224 return 1;
9225 }
9226 return current.year() === today.year() && current.month() > today.month();
9227}
9228
9229function getIdFromDate(date) {
9230 return 'rc-calendar-' + date.year() + '-' + date.month() + '-' + date.date();
9231}
9232
9233var DateTBody = function (_React$Component) {
9234 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(DateTBody, _React$Component);
9235
9236 function DateTBody() {
9237 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, DateTBody);
9238
9239 return __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
9240 }
9241
9242 DateTBody.prototype.render = function render() {
9243 var props = this.props;
9244 var contentRender = props.contentRender,
9245 prefixCls = props.prefixCls,
9246 selectedValue = props.selectedValue,
9247 value = props.value,
9248 showWeekNumber = props.showWeekNumber,
9249 dateRender = props.dateRender,
9250 disabledDate = props.disabledDate,
9251 hoverValue = props.hoverValue;
9252
9253 var iIndex = void 0;
9254 var jIndex = void 0;
9255 var current = void 0;
9256 var dateTable = [];
9257 var today = Object(__WEBPACK_IMPORTED_MODULE_7__util___["e" /* getTodayTime */])(value);
9258 var cellClass = prefixCls + '-cell';
9259 var weekNumberCellClass = prefixCls + '-week-number-cell';
9260 var dateClass = prefixCls + '-date';
9261 var todayClass = prefixCls + '-today';
9262 var selectedClass = prefixCls + '-selected-day';
9263 var selectedDateClass = prefixCls + '-selected-date'; // do not move with mouse operation
9264 var selectedStartDateClass = prefixCls + '-selected-start-date';
9265 var selectedEndDateClass = prefixCls + '-selected-end-date';
9266 var inRangeClass = prefixCls + '-in-range-cell';
9267 var lastMonthDayClass = prefixCls + '-last-month-cell';
9268 var nextMonthDayClass = prefixCls + '-next-month-btn-day';
9269 var disabledClass = prefixCls + '-disabled-cell';
9270 var firstDisableClass = prefixCls + '-disabled-cell-first-of-row';
9271 var lastDisableClass = prefixCls + '-disabled-cell-last-of-row';
9272 var lastDayOfMonthClass = prefixCls + '-last-day-of-month';
9273 var month1 = value.clone();
9274 month1.date(1);
9275 var day = month1.day();
9276 var lastMonthDiffDay = (day + 7 - value.localeData().firstDayOfWeek()) % 7;
9277 // calculate last month
9278 var lastMonth1 = month1.clone();
9279 lastMonth1.add(0 - lastMonthDiffDay, 'days');
9280 var passed = 0;
9281
9282 for (iIndex = 0; iIndex < __WEBPACK_IMPORTED_MODULE_6__DateConstants__["a" /* default */].DATE_ROW_COUNT; iIndex++) {
9283 for (jIndex = 0; jIndex < __WEBPACK_IMPORTED_MODULE_6__DateConstants__["a" /* default */].DATE_COL_COUNT; jIndex++) {
9284 current = lastMonth1;
9285 if (passed) {
9286 current = current.clone();
9287 current.add(passed, 'days');
9288 }
9289 dateTable.push(current);
9290 passed++;
9291 }
9292 }
9293 var tableHtml = [];
9294 passed = 0;
9295
9296 for (iIndex = 0; iIndex < __WEBPACK_IMPORTED_MODULE_6__DateConstants__["a" /* default */].DATE_ROW_COUNT; iIndex++) {
9297 var _cx;
9298
9299 var isCurrentWeek = void 0;
9300 var weekNumberCell = void 0;
9301 var isActiveWeek = false;
9302 var dateCells = [];
9303 if (showWeekNumber) {
9304 weekNumberCell = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9305 'td',
9306 {
9307 key: dateTable[passed].week(),
9308 role: 'gridcell',
9309 className: weekNumberCellClass
9310 },
9311 dateTable[passed].week()
9312 );
9313 }
9314 for (jIndex = 0; jIndex < __WEBPACK_IMPORTED_MODULE_6__DateConstants__["a" /* default */].DATE_COL_COUNT; jIndex++) {
9315 var next = null;
9316 var last = null;
9317 current = dateTable[passed];
9318 if (jIndex < __WEBPACK_IMPORTED_MODULE_6__DateConstants__["a" /* default */].DATE_COL_COUNT - 1) {
9319 next = dateTable[passed + 1];
9320 }
9321 if (jIndex > 0) {
9322 last = dateTable[passed - 1];
9323 }
9324 var cls = cellClass;
9325 var disabled = false;
9326 var selected = false;
9327
9328 if (isSameDay(current, today)) {
9329 cls += ' ' + todayClass;
9330 isCurrentWeek = true;
9331 }
9332
9333 var isBeforeCurrentMonthYear = beforeCurrentMonthYear(current, value);
9334 var isAfterCurrentMonthYear = afterCurrentMonthYear(current, value);
9335
9336 if (selectedValue && Array.isArray(selectedValue)) {
9337 var rangeValue = hoverValue.length ? hoverValue : selectedValue;
9338 if (!isBeforeCurrentMonthYear && !isAfterCurrentMonthYear) {
9339 var startValue = rangeValue[0];
9340 var endValue = rangeValue[1];
9341 if (startValue) {
9342 if (isSameDay(current, startValue)) {
9343 selected = true;
9344 isActiveWeek = true;
9345 cls += ' ' + selectedStartDateClass;
9346 }
9347 }
9348 if (startValue || endValue) {
9349 if (isSameDay(current, endValue)) {
9350 selected = true;
9351 isActiveWeek = true;
9352 cls += ' ' + selectedEndDateClass;
9353 } else if ((startValue === null || startValue === undefined) && current.isBefore(endValue, 'day')) {
9354 cls += ' ' + inRangeClass;
9355 } else if ((endValue === null || endValue === undefined) && current.isAfter(startValue, 'day')) {
9356 cls += ' ' + inRangeClass;
9357 } else if (current.isAfter(startValue, 'day') && current.isBefore(endValue, 'day')) {
9358 cls += ' ' + inRangeClass;
9359 }
9360 }
9361 }
9362 } else if (isSameDay(current, value)) {
9363 // keyboard change value, highlight works
9364 selected = true;
9365 isActiveWeek = true;
9366 }
9367
9368 if (isSameDay(current, selectedValue)) {
9369 cls += ' ' + selectedDateClass;
9370 }
9371
9372 if (isBeforeCurrentMonthYear) {
9373 cls += ' ' + lastMonthDayClass;
9374 }
9375
9376 if (isAfterCurrentMonthYear) {
9377 cls += ' ' + nextMonthDayClass;
9378 }
9379
9380 if (current.clone().endOf('month').date() === current.date()) {
9381 cls += ' ' + lastDayOfMonthClass;
9382 }
9383
9384 if (disabledDate) {
9385 if (disabledDate(current, value)) {
9386 disabled = true;
9387
9388 if (!last || !disabledDate(last, value)) {
9389 cls += ' ' + firstDisableClass;
9390 }
9391
9392 if (!next || !disabledDate(next, value)) {
9393 cls += ' ' + lastDisableClass;
9394 }
9395 }
9396 }
9397
9398 if (selected) {
9399 cls += ' ' + selectedClass;
9400 }
9401
9402 if (disabled) {
9403 cls += ' ' + disabledClass;
9404 }
9405
9406 var dateHtml = void 0;
9407 if (dateRender) {
9408 dateHtml = dateRender(current, value);
9409 } else {
9410 var content = contentRender ? contentRender(current, value) : current.date();
9411 dateHtml = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9412 'div',
9413 {
9414 key: getIdFromDate(current),
9415 className: dateClass,
9416 'aria-selected': selected,
9417 'aria-disabled': disabled
9418 },
9419 content
9420 );
9421 }
9422
9423 dateCells.push(__WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9424 'td',
9425 {
9426 key: passed,
9427 onClick: disabled ? undefined : props.onSelect.bind(null, current),
9428 onMouseEnter: disabled ? undefined : props.onDayHover && props.onDayHover.bind(null, current) || undefined,
9429 role: 'gridcell',
9430 title: Object(__WEBPACK_IMPORTED_MODULE_7__util___["d" /* getTitleString */])(current),
9431 className: cls
9432 },
9433 dateHtml
9434 ));
9435
9436 passed++;
9437 }
9438
9439 tableHtml.push(__WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9440 'tr',
9441 {
9442 key: iIndex,
9443 role: 'row',
9444 className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()((_cx = {}, _cx[prefixCls + '-current-week'] = isCurrentWeek, _cx[prefixCls + '-active-week'] = isActiveWeek, _cx))
9445 },
9446 weekNumberCell,
9447 dateCells
9448 ));
9449 }
9450 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9451 'tbody',
9452 { className: prefixCls + '-tbody' },
9453 tableHtml
9454 );
9455 };
9456
9457 return DateTBody;
9458}(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
9459
9460DateTBody.propTypes = {
9461 contentRender: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9462 dateRender: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9463 disabledDate: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9464 prefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
9465 selectedValue: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object, __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object)]),
9466 value: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
9467 hoverValue: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any,
9468 showWeekNumber: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool
9469};
9470DateTBody.defaultProps = {
9471 hoverValue: []
9472};
9473/* harmony default export */ __webpack_exports__["a"] = (DateTBody);
9474
9475/***/ }),
9476/* 108 */
9477/***/ (function(module, __webpack_exports__, __webpack_require__) {
9478
9479"use strict";
9480/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
9481/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
9482/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
9483/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
9484/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
9485/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
9486/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
9487/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
9488/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(4);
9489/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
9490/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_rc_util_es_Children_mapSelf__ = __webpack_require__(57);
9491/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__month_MonthPanel__ = __webpack_require__(109);
9492/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__year_YearPanel__ = __webpack_require__(111);
9493/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__decade_DecadePanel__ = __webpack_require__(112);
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504function goMonth(direction) {
9505 var next = this.props.value.clone();
9506 next.add(direction, 'months');
9507 this.props.onValueChange(next);
9508}
9509
9510function goYear(direction) {
9511 var next = this.props.value.clone();
9512 next.add(direction, 'years');
9513 this.props.onValueChange(next);
9514}
9515
9516function showIf(condition, el) {
9517 return condition ? el : null;
9518}
9519
9520var CalendarHeader = function (_React$Component) {
9521 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(CalendarHeader, _React$Component);
9522
9523 function CalendarHeader(props) {
9524 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, CalendarHeader);
9525
9526 var _this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props));
9527
9528 _initialiseProps.call(_this);
9529
9530 _this.nextMonth = goMonth.bind(_this, 1);
9531 _this.previousMonth = goMonth.bind(_this, -1);
9532 _this.nextYear = goYear.bind(_this, 1);
9533 _this.previousYear = goYear.bind(_this, -1);
9534
9535 _this.state = { yearPanelReferer: null };
9536 return _this;
9537 }
9538
9539 CalendarHeader.prototype.render = function render() {
9540 var _this2 = this;
9541
9542 var props = this.props;
9543 var prefixCls = props.prefixCls,
9544 locale = props.locale,
9545 mode = props.mode,
9546 value = props.value,
9547 showTimePicker = props.showTimePicker,
9548 enableNext = props.enableNext,
9549 enablePrev = props.enablePrev,
9550 disabledMonth = props.disabledMonth,
9551 renderFooter = props.renderFooter;
9552
9553
9554 var panel = null;
9555 if (mode === 'month') {
9556 panel = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__month_MonthPanel__["a" /* default */], {
9557 locale: locale,
9558 value: value,
9559 rootPrefixCls: prefixCls,
9560 onSelect: this.onMonthSelect,
9561 onYearPanelShow: function onYearPanelShow() {
9562 return _this2.showYearPanel('month');
9563 },
9564 disabledDate: disabledMonth,
9565 cellRender: props.monthCellRender,
9566 contentRender: props.monthCellContentRender,
9567 renderFooter: renderFooter,
9568 changeYear: this.changeYear
9569 });
9570 }
9571 if (mode === 'year') {
9572 panel = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__year_YearPanel__["a" /* default */], {
9573 locale: locale,
9574 defaultValue: value,
9575 rootPrefixCls: prefixCls,
9576 onSelect: this.onYearSelect,
9577 onDecadePanelShow: this.showDecadePanel,
9578 renderFooter: renderFooter
9579 });
9580 }
9581 if (mode === 'decade') {
9582 panel = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8__decade_DecadePanel__["a" /* default */], {
9583 locale: locale,
9584 defaultValue: value,
9585 rootPrefixCls: prefixCls,
9586 onSelect: this.onDecadeSelect,
9587 renderFooter: renderFooter
9588 });
9589 }
9590
9591 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9592 'div',
9593 { className: prefixCls + '-header' },
9594 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9595 'div',
9596 { style: { position: 'relative' } },
9597 showIf(enablePrev && !showTimePicker, __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
9598 className: prefixCls + '-prev-year-btn',
9599 role: 'button',
9600 onClick: this.previousYear,
9601 title: locale.previousYear
9602 })),
9603 showIf(enablePrev && !showTimePicker, __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
9604 className: prefixCls + '-prev-month-btn',
9605 role: 'button',
9606 onClick: this.previousMonth,
9607 title: locale.previousMonth
9608 })),
9609 this.monthYearElement(showTimePicker),
9610 showIf(enableNext && !showTimePicker, __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
9611 className: prefixCls + '-next-month-btn',
9612 onClick: this.nextMonth,
9613 title: locale.nextMonth
9614 })),
9615 showIf(enableNext && !showTimePicker, __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
9616 className: prefixCls + '-next-year-btn',
9617 onClick: this.nextYear,
9618 title: locale.nextYear
9619 }))
9620 ),
9621 panel
9622 );
9623 };
9624
9625 return CalendarHeader;
9626}(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
9627
9628CalendarHeader.propTypes = {
9629 prefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
9630 value: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
9631 onValueChange: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9632 showTimePicker: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
9633 onPanelChange: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9634 locale: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
9635 enablePrev: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any,
9636 enableNext: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any,
9637 disabledMonth: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9638 renderFooter: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9639 onMonthSelect: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func
9640};
9641CalendarHeader.defaultProps = {
9642 enableNext: 1,
9643 enablePrev: 1,
9644 onPanelChange: function onPanelChange() {},
9645 onValueChange: function onValueChange() {}
9646};
9647
9648var _initialiseProps = function _initialiseProps() {
9649 var _this3 = this;
9650
9651 this.onMonthSelect = function (value) {
9652 _this3.props.onPanelChange(value, 'date');
9653 if (_this3.props.onMonthSelect) {
9654 _this3.props.onMonthSelect(value);
9655 } else {
9656 _this3.props.onValueChange(value);
9657 }
9658 };
9659
9660 this.onYearSelect = function (value) {
9661 var referer = _this3.state.yearPanelReferer;
9662 _this3.setState({ yearPanelReferer: null });
9663 _this3.props.onPanelChange(value, referer);
9664 _this3.props.onValueChange(value);
9665 };
9666
9667 this.onDecadeSelect = function (value) {
9668 _this3.props.onPanelChange(value, 'year');
9669 _this3.props.onValueChange(value);
9670 };
9671
9672 this.changeYear = function (direction) {
9673 if (direction > 0) {
9674 _this3.nextYear();
9675 } else {
9676 _this3.previousYear();
9677 }
9678 };
9679
9680 this.monthYearElement = function (showTimePicker) {
9681 var props = _this3.props;
9682 var prefixCls = props.prefixCls;
9683 var locale = props.locale;
9684 var value = props.value;
9685 var localeData = value.localeData();
9686 var monthBeforeYear = locale.monthBeforeYear;
9687 var selectClassName = prefixCls + '-' + (monthBeforeYear ? 'my-select' : 'ym-select');
9688 var timeClassName = showTimePicker ? ' ' + prefixCls + '-time-status' : '';
9689 var year = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9690 'a',
9691 {
9692 className: prefixCls + '-year-select' + timeClassName,
9693 role: 'button',
9694 onClick: showTimePicker ? null : function () {
9695 return _this3.showYearPanel('date');
9696 },
9697 title: showTimePicker ? null : locale.yearSelect
9698 },
9699 value.format(locale.yearFormat)
9700 );
9701 var month = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9702 'a',
9703 {
9704 className: prefixCls + '-month-select' + timeClassName,
9705 role: 'button',
9706 onClick: showTimePicker ? null : _this3.showMonthPanel,
9707 title: showTimePicker ? null : locale.monthSelect
9708 },
9709 locale.monthFormat ? value.format(locale.monthFormat) : localeData.monthsShort(value)
9710 );
9711 var day = void 0;
9712 if (showTimePicker) {
9713 day = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9714 'a',
9715 {
9716 className: prefixCls + '-day-select' + timeClassName,
9717 role: 'button'
9718 },
9719 value.format(locale.dayFormat)
9720 );
9721 }
9722 var my = [];
9723 if (monthBeforeYear) {
9724 my = [month, day, year];
9725 } else {
9726 my = [year, month, day];
9727 }
9728 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9729 'span',
9730 { className: selectClassName },
9731 Object(__WEBPACK_IMPORTED_MODULE_5_rc_util_es_Children_mapSelf__["a" /* default */])(my)
9732 );
9733 };
9734
9735 this.showMonthPanel = function () {
9736 // null means that users' interaction doesn't change value
9737 _this3.props.onPanelChange(null, 'month');
9738 };
9739
9740 this.showYearPanel = function (referer) {
9741 _this3.setState({ yearPanelReferer: referer });
9742 _this3.props.onPanelChange(null, 'year');
9743 };
9744
9745 this.showDecadePanel = function () {
9746 _this3.props.onPanelChange(null, 'decade');
9747 };
9748};
9749
9750/* harmony default export */ __webpack_exports__["a"] = (CalendarHeader);
9751
9752/***/ }),
9753/* 109 */
9754/***/ (function(module, __webpack_exports__, __webpack_require__) {
9755
9756"use strict";
9757/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
9758/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
9759/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
9760/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
9761/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
9762/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
9763/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
9764/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
9765/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(4);
9766/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
9767/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_lifecycles_compat__ = __webpack_require__(41);
9768/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__MonthTable__ = __webpack_require__(110);
9769
9770
9771
9772
9773
9774
9775
9776
9777function goYear(direction) {
9778 this.props.changeYear(direction);
9779}
9780
9781function noop() {}
9782
9783var MonthPanel = function (_React$Component) {
9784 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(MonthPanel, _React$Component);
9785
9786 function MonthPanel(props) {
9787 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, MonthPanel);
9788
9789 var _this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props));
9790
9791 _this.setAndSelectValue = function (value) {
9792 _this.setValue(value);
9793 _this.props.onSelect(value);
9794 };
9795
9796 _this.setValue = function (value) {
9797 if ('value' in _this.props) {
9798 _this.setState({
9799 value: value
9800 });
9801 }
9802 };
9803
9804 _this.nextYear = goYear.bind(_this, 1);
9805 _this.previousYear = goYear.bind(_this, -1);
9806 _this.prefixCls = props.rootPrefixCls + '-month-panel';
9807
9808 _this.state = {
9809 value: props.value || props.defaultValue
9810 };
9811 return _this;
9812 }
9813
9814 MonthPanel.getDerivedStateFromProps = function getDerivedStateFromProps(props) {
9815 var newState = {};
9816
9817 if ('value' in props) {
9818 newState = {
9819 value: props.value
9820 };
9821 }
9822
9823 return newState;
9824 };
9825
9826 MonthPanel.prototype.render = function render() {
9827 var props = this.props;
9828 var value = this.state.value;
9829 var locale = props.locale,
9830 cellRender = props.cellRender,
9831 contentRender = props.contentRender,
9832 renderFooter = props.renderFooter;
9833
9834 var year = value.year();
9835 var prefixCls = this.prefixCls;
9836
9837 var footer = renderFooter && renderFooter('month');
9838
9839 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9840 'div',
9841 { className: prefixCls, style: props.style },
9842 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9843 'div',
9844 null,
9845 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9846 'div',
9847 { className: prefixCls + '-header' },
9848 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
9849 className: prefixCls + '-prev-year-btn',
9850 role: 'button',
9851 onClick: this.previousYear,
9852 title: locale.previousYear
9853 }),
9854 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9855 'a',
9856 {
9857 className: prefixCls + '-year-select',
9858 role: 'button',
9859 onClick: props.onYearPanelShow,
9860 title: locale.yearSelect
9861 },
9862 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9863 'span',
9864 { className: prefixCls + '-year-select-content' },
9865 year
9866 ),
9867 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9868 'span',
9869 { className: prefixCls + '-year-select-arrow' },
9870 'x'
9871 )
9872 ),
9873 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
9874 className: prefixCls + '-next-year-btn',
9875 role: 'button',
9876 onClick: this.nextYear,
9877 title: locale.nextYear
9878 })
9879 ),
9880 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9881 'div',
9882 { className: prefixCls + '-body' },
9883 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__MonthTable__["a" /* default */], {
9884 disabledDate: props.disabledDate,
9885 onSelect: this.setAndSelectValue,
9886 locale: locale,
9887 value: value,
9888 cellRender: cellRender,
9889 contentRender: contentRender,
9890 prefixCls: prefixCls
9891 })
9892 ),
9893 footer && __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
9894 'div',
9895 { className: prefixCls + '-footer' },
9896 footer
9897 )
9898 )
9899 );
9900 };
9901
9902 return MonthPanel;
9903}(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
9904
9905MonthPanel.propTypes = {
9906 onChange: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9907 disabledDate: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9908 onSelect: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9909 renderFooter: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
9910 rootPrefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
9911 value: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
9912 defaultValue: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object
9913};
9914MonthPanel.defaultProps = {
9915 onChange: noop,
9916 onSelect: noop
9917};
9918
9919
9920Object(__WEBPACK_IMPORTED_MODULE_5_react_lifecycles_compat__["a" /* polyfill */])(MonthPanel);
9921
9922/* harmony default export */ __webpack_exports__["a"] = (MonthPanel);
9923
9924/***/ }),
9925/* 110 */
9926/***/ (function(module, __webpack_exports__, __webpack_require__) {
9927
9928"use strict";
9929/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
9930/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
9931/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
9932/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
9933/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
9934/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
9935/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
9936/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
9937/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(4);
9938/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
9939/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(8);
9940/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
9941/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_index__ = __webpack_require__(15);
9942
9943
9944
9945
9946
9947
9948
9949
9950var ROW = 4;
9951var COL = 3;
9952
9953function chooseMonth(month) {
9954 var next = this.state.value.clone();
9955 next.month(month);
9956 this.setAndSelectValue(next);
9957}
9958
9959function noop() {}
9960
9961var MonthTable = function (_Component) {
9962 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(MonthTable, _Component);
9963
9964 function MonthTable(props) {
9965 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, MonthTable);
9966
9967 var _this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _Component.call(this, props));
9968
9969 _this.state = {
9970 value: props.value
9971 };
9972 return _this;
9973 }
9974
9975 MonthTable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
9976 if ('value' in nextProps) {
9977 this.setState({
9978 value: nextProps.value
9979 });
9980 }
9981 };
9982
9983 MonthTable.prototype.setAndSelectValue = function setAndSelectValue(value) {
9984 this.setState({
9985 value: value
9986 });
9987 this.props.onSelect(value);
9988 };
9989
9990 MonthTable.prototype.months = function months() {
9991 var value = this.state.value;
9992 var current = value.clone();
9993 var months = [];
9994 var index = 0;
9995 for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {
9996 months[rowIndex] = [];
9997 for (var colIndex = 0; colIndex < COL; colIndex++) {
9998 current.month(index);
9999 var content = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["b" /* getMonthName */])(current);
10000 months[rowIndex][colIndex] = {
10001 value: index,
10002 content: content,
10003 title: content
10004 };
10005 index++;
10006 }
10007 }
10008 return months;
10009 };
10010
10011 MonthTable.prototype.render = function render() {
10012 var _this2 = this;
10013
10014 var props = this.props;
10015 var value = this.state.value;
10016 var today = Object(__WEBPACK_IMPORTED_MODULE_6__util_index__["e" /* getTodayTime */])(value);
10017 var months = this.months();
10018 var currentMonth = value.month();
10019 var prefixCls = props.prefixCls,
10020 locale = props.locale,
10021 contentRender = props.contentRender,
10022 cellRender = props.cellRender;
10023
10024 var monthsEls = months.map(function (month, index) {
10025 var tds = month.map(function (monthData) {
10026 var _classNameMap;
10027
10028 var disabled = false;
10029 if (props.disabledDate) {
10030 var testValue = value.clone();
10031 testValue.month(monthData.value);
10032 disabled = props.disabledDate(testValue);
10033 }
10034 var classNameMap = (_classNameMap = {}, _classNameMap[prefixCls + '-cell'] = 1, _classNameMap[prefixCls + '-cell-disabled'] = disabled, _classNameMap[prefixCls + '-selected-cell'] = monthData.value === currentMonth, _classNameMap[prefixCls + '-current-cell'] = today.year() === value.year() && monthData.value === today.month(), _classNameMap);
10035 var cellEl = void 0;
10036 if (cellRender) {
10037 var currentValue = value.clone();
10038 currentValue.month(monthData.value);
10039 cellEl = cellRender(currentValue, locale);
10040 } else {
10041 var content = void 0;
10042 if (contentRender) {
10043 var _currentValue = value.clone();
10044 _currentValue.month(monthData.value);
10045 content = contentRender(_currentValue, locale);
10046 } else {
10047 content = monthData.content;
10048 }
10049 cellEl = __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10050 'a',
10051 { className: prefixCls + '-month' },
10052 content
10053 );
10054 }
10055 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10056 'td',
10057 {
10058 role: 'gridcell',
10059 key: monthData.value,
10060 onClick: disabled ? null : chooseMonth.bind(_this2, monthData.value),
10061 title: monthData.title,
10062 className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(classNameMap)
10063 },
10064 cellEl
10065 );
10066 });
10067 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10068 'tr',
10069 { key: index, role: 'row' },
10070 tds
10071 );
10072 });
10073
10074 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10075 'table',
10076 { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
10077 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10078 'tbody',
10079 { className: prefixCls + '-tbody' },
10080 monthsEls
10081 )
10082 );
10083 };
10084
10085 return MonthTable;
10086}(__WEBPACK_IMPORTED_MODULE_3_react__["Component"]);
10087
10088MonthTable.defaultProps = {
10089 onSelect: noop
10090};
10091MonthTable.propTypes = {
10092 onSelect: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
10093 cellRender: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
10094 prefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
10095 value: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object
10096};
10097/* harmony default export */ __webpack_exports__["a"] = (MonthTable);
10098
10099/***/ }),
10100/* 111 */
10101/***/ (function(module, __webpack_exports__, __webpack_require__) {
10102
10103"use strict";
10104/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
10105/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
10106/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
10107/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
10108/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
10109/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
10110/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
10111/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
10112/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(4);
10113/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
10114/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(8);
10115/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
10116
10117
10118
10119
10120
10121
10122var ROW = 4;
10123var COL = 3;
10124
10125function goYear(direction) {
10126 var value = this.state.value.clone();
10127 value.add(direction, 'year');
10128 this.setState({
10129 value: value
10130 });
10131}
10132
10133function chooseYear(year) {
10134 var value = this.state.value.clone();
10135 value.year(year);
10136 value.month(this.state.value.month());
10137 this.props.onSelect(value);
10138}
10139
10140var YearPanel = function (_React$Component) {
10141 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(YearPanel, _React$Component);
10142
10143 function YearPanel(props) {
10144 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, YearPanel);
10145
10146 var _this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props));
10147
10148 _this.prefixCls = props.rootPrefixCls + '-year-panel';
10149 _this.state = {
10150 value: props.value || props.defaultValue
10151 };
10152 _this.nextDecade = goYear.bind(_this, 10);
10153 _this.previousDecade = goYear.bind(_this, -10);
10154 return _this;
10155 }
10156
10157 YearPanel.prototype.years = function years() {
10158 var value = this.state.value;
10159 var currentYear = value.year();
10160 var startYear = parseInt(currentYear / 10, 10) * 10;
10161 var previousYear = startYear - 1;
10162 var years = [];
10163 var index = 0;
10164 for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {
10165 years[rowIndex] = [];
10166 for (var colIndex = 0; colIndex < COL; colIndex++) {
10167 var year = previousYear + index;
10168 var content = String(year);
10169 years[rowIndex][colIndex] = {
10170 content: content,
10171 year: year,
10172 title: content
10173 };
10174 index++;
10175 }
10176 }
10177 return years;
10178 };
10179
10180 YearPanel.prototype.render = function render() {
10181 var _this2 = this;
10182
10183 var props = this.props;
10184 var value = this.state.value;
10185 var locale = props.locale,
10186 renderFooter = props.renderFooter;
10187
10188 var years = this.years();
10189 var currentYear = value.year();
10190 var startYear = parseInt(currentYear / 10, 10) * 10;
10191 var endYear = startYear + 9;
10192 var prefixCls = this.prefixCls;
10193
10194 var yeasEls = years.map(function (row, index) {
10195 var tds = row.map(function (yearData) {
10196 var _classNameMap;
10197
10198 var classNameMap = (_classNameMap = {}, _classNameMap[prefixCls + '-cell'] = 1, _classNameMap[prefixCls + '-selected-cell'] = yearData.year === currentYear, _classNameMap[prefixCls + '-last-decade-cell'] = yearData.year < startYear, _classNameMap[prefixCls + '-next-decade-cell'] = yearData.year > endYear, _classNameMap);
10199 var clickHandler = void 0;
10200 if (yearData.year < startYear) {
10201 clickHandler = _this2.previousDecade;
10202 } else if (yearData.year > endYear) {
10203 clickHandler = _this2.nextDecade;
10204 } else {
10205 clickHandler = chooseYear.bind(_this2, yearData.year);
10206 }
10207 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10208 'td',
10209 {
10210 role: 'gridcell',
10211 title: yearData.title,
10212 key: yearData.content,
10213 onClick: clickHandler,
10214 className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(classNameMap)
10215 },
10216 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10217 'a',
10218 {
10219 className: prefixCls + '-year'
10220 },
10221 yearData.content
10222 )
10223 );
10224 });
10225 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10226 'tr',
10227 { key: index, role: 'row' },
10228 tds
10229 );
10230 });
10231
10232 var footer = renderFooter && renderFooter('year');
10233
10234 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10235 'div',
10236 { className: this.prefixCls },
10237 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10238 'div',
10239 null,
10240 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10241 'div',
10242 { className: prefixCls + '-header' },
10243 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
10244 className: prefixCls + '-prev-decade-btn',
10245 role: 'button',
10246 onClick: this.previousDecade,
10247 title: locale.previousDecade
10248 }),
10249 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10250 'a',
10251 {
10252 className: prefixCls + '-decade-select',
10253 role: 'button',
10254 onClick: props.onDecadePanelShow,
10255 title: locale.decadeSelect
10256 },
10257 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10258 'span',
10259 { className: prefixCls + '-decade-select-content' },
10260 startYear,
10261 '-',
10262 endYear
10263 ),
10264 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10265 'span',
10266 { className: prefixCls + '-decade-select-arrow' },
10267 'x'
10268 )
10269 ),
10270 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
10271 className: prefixCls + '-next-decade-btn',
10272 role: 'button',
10273 onClick: this.nextDecade,
10274 title: locale.nextDecade
10275 })
10276 ),
10277 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10278 'div',
10279 { className: prefixCls + '-body' },
10280 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10281 'table',
10282 { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
10283 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10284 'tbody',
10285 { className: prefixCls + '-tbody' },
10286 yeasEls
10287 )
10288 )
10289 ),
10290 footer && __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10291 'div',
10292 { className: prefixCls + '-footer' },
10293 footer
10294 )
10295 )
10296 );
10297 };
10298
10299 return YearPanel;
10300}(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
10301
10302/* harmony default export */ __webpack_exports__["a"] = (YearPanel);
10303
10304
10305YearPanel.propTypes = {
10306 rootPrefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
10307 value: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
10308 defaultValue: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
10309 renderFooter: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func
10310};
10311
10312YearPanel.defaultProps = {
10313 onSelect: function onSelect() {}
10314};
10315
10316/***/ }),
10317/* 112 */
10318/***/ (function(module, __webpack_exports__, __webpack_require__) {
10319
10320"use strict";
10321/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
10322/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
10323/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
10324/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
10325/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
10326/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
10327/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
10328/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
10329/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(4);
10330/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
10331/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(8);
10332/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
10333
10334
10335
10336
10337
10338var ROW = 4;
10339var COL = 3;
10340
10341
10342function goYear(direction) {
10343 var next = this.state.value.clone();
10344 next.add(direction, 'years');
10345 this.setState({
10346 value: next
10347 });
10348}
10349
10350function chooseDecade(year, event) {
10351 var next = this.state.value.clone();
10352 next.year(year);
10353 next.month(this.state.value.month());
10354 this.props.onSelect(next);
10355 event.preventDefault();
10356}
10357
10358var DecadePanel = function (_React$Component) {
10359 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(DecadePanel, _React$Component);
10360
10361 function DecadePanel(props) {
10362 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, DecadePanel);
10363
10364 var _this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props));
10365
10366 _this.state = {
10367 value: props.value || props.defaultValue
10368 };
10369
10370 // bind methods
10371 _this.prefixCls = props.rootPrefixCls + '-decade-panel';
10372 _this.nextCentury = goYear.bind(_this, 100);
10373 _this.previousCentury = goYear.bind(_this, -100);
10374 return _this;
10375 }
10376
10377 DecadePanel.prototype.render = function render() {
10378 var _this2 = this;
10379
10380 var value = this.state.value;
10381 var _props = this.props,
10382 locale = _props.locale,
10383 renderFooter = _props.renderFooter;
10384
10385 var currentYear = value.year();
10386 var startYear = parseInt(currentYear / 100, 10) * 100;
10387 var preYear = startYear - 10;
10388 var endYear = startYear + 99;
10389 var decades = [];
10390 var index = 0;
10391 var prefixCls = this.prefixCls;
10392
10393 for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {
10394 decades[rowIndex] = [];
10395 for (var colIndex = 0; colIndex < COL; colIndex++) {
10396 var startDecade = preYear + index * 10;
10397 var endDecade = preYear + index * 10 + 9;
10398 decades[rowIndex][colIndex] = {
10399 startDecade: startDecade,
10400 endDecade: endDecade
10401 };
10402 index++;
10403 }
10404 }
10405
10406 var footer = renderFooter && renderFooter('decade');
10407
10408 var decadesEls = decades.map(function (row, decadeIndex) {
10409 var tds = row.map(function (decadeData) {
10410 var _classNameMap;
10411
10412 var dStartDecade = decadeData.startDecade;
10413 var dEndDecade = decadeData.endDecade;
10414 var isLast = dStartDecade < startYear;
10415 var isNext = dEndDecade > endYear;
10416 var classNameMap = (_classNameMap = {}, _classNameMap[prefixCls + '-cell'] = 1, _classNameMap[prefixCls + '-selected-cell'] = dStartDecade <= currentYear && currentYear <= dEndDecade, _classNameMap[prefixCls + '-last-century-cell'] = isLast, _classNameMap[prefixCls + '-next-century-cell'] = isNext, _classNameMap);
10417 var content = dStartDecade + '-' + dEndDecade;
10418 var clickHandler = void 0;
10419 if (isLast) {
10420 clickHandler = _this2.previousCentury;
10421 } else if (isNext) {
10422 clickHandler = _this2.nextCentury;
10423 } else {
10424 clickHandler = chooseDecade.bind(_this2, dStartDecade);
10425 }
10426 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10427 'td',
10428 {
10429 key: dStartDecade,
10430 onClick: clickHandler,
10431 role: 'gridcell',
10432 className: __WEBPACK_IMPORTED_MODULE_5_classnames___default()(classNameMap)
10433 },
10434 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10435 'a',
10436 {
10437 className: prefixCls + '-decade'
10438 },
10439 content
10440 )
10441 );
10442 });
10443 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10444 'tr',
10445 { key: decadeIndex, role: 'row' },
10446 tds
10447 );
10448 });
10449
10450 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10451 'div',
10452 { className: this.prefixCls },
10453 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10454 'div',
10455 { className: prefixCls + '-header' },
10456 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
10457 className: prefixCls + '-prev-century-btn',
10458 role: 'button',
10459 onClick: this.previousCentury,
10460 title: locale.previousCentury
10461 }),
10462 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10463 'div',
10464 { className: prefixCls + '-century' },
10465 startYear,
10466 '-',
10467 endYear
10468 ),
10469 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('a', {
10470 className: prefixCls + '-next-century-btn',
10471 role: 'button',
10472 onClick: this.nextCentury,
10473 title: locale.nextCentury
10474 })
10475 ),
10476 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10477 'div',
10478 { className: prefixCls + '-body' },
10479 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10480 'table',
10481 { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
10482 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10483 'tbody',
10484 { className: prefixCls + '-tbody' },
10485 decadesEls
10486 )
10487 )
10488 ),
10489 footer && __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10490 'div',
10491 { className: prefixCls + '-footer' },
10492 footer
10493 )
10494 );
10495 };
10496
10497 return DecadePanel;
10498}(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
10499
10500/* harmony default export */ __webpack_exports__["a"] = (DecadePanel);
10501
10502
10503DecadePanel.propTypes = {
10504 locale: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
10505 value: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
10506 defaultValue: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
10507 rootPrefixCls: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
10508 renderFooter: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func
10509};
10510
10511DecadePanel.defaultProps = {
10512 onSelect: function onSelect() {}
10513};
10514
10515/***/ }),
10516/* 113 */
10517/***/ (function(module, __webpack_exports__, __webpack_require__) {
10518
10519"use strict";
10520/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(26);
10521/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
10522/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
10523/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__);
10524/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
10525/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn__);
10526/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__ = __webpack_require__(3);
10527/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits__);
10528/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react__ = __webpack_require__(0);
10529/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react__);
10530/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom__ = __webpack_require__(39);
10531/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react_dom__);
10532/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types__ = __webpack_require__(4);
10533/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_prop_types__);
10534/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_rc_util_es_Children_mapSelf__ = __webpack_require__(57);
10535/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames__ = __webpack_require__(8);
10536/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_classnames__);
10537/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__calendar_TodayButton__ = __webpack_require__(114);
10538/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__calendar_OkButton__ = __webpack_require__(115);
10539/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__calendar_TimePickerButton__ = __webpack_require__(116);
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553var CalendarFooter = function (_React$Component) {
10554 __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_inherits___default()(CalendarFooter, _React$Component);
10555
10556 function CalendarFooter() {
10557 __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, CalendarFooter);
10558
10559 return __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.apply(this, arguments));
10560 }
10561
10562 CalendarFooter.prototype.onSelect = function onSelect(value) {
10563 this.props.onSelect(value);
10564 };
10565
10566 CalendarFooter.prototype.getRootDOMNode = function getRootDOMNode() {
10567 return __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.findDOMNode(this);
10568 };
10569
10570 CalendarFooter.prototype.render = function render() {
10571 var props = this.props;
10572 var value = props.value,
10573 prefixCls = props.prefixCls,
10574 showOk = props.showOk,
10575 timePicker = props.timePicker,
10576 renderFooter = props.renderFooter,
10577 mode = props.mode;
10578
10579 var footerEl = null;
10580 var extraFooter = renderFooter && renderFooter(mode);
10581 if (props.showToday || timePicker || extraFooter) {
10582 var _cx;
10583
10584 var nowEl = void 0;
10585 if (props.showToday) {
10586 nowEl = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__calendar_TodayButton__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, props, { value: value }));
10587 }
10588 var okBtn = void 0;
10589 if (showOk === true || showOk !== false && !!props.timePicker) {
10590 okBtn = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_10__calendar_OkButton__["a" /* default */], props);
10591 }
10592 var timePickerBtn = void 0;
10593 if (!!props.timePicker) {
10594 timePickerBtn = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_11__calendar_TimePickerButton__["a" /* default */], props);
10595 }
10596
10597 var footerBtn = void 0;
10598 if (nowEl || timePickerBtn || okBtn || extraFooter) {
10599 footerBtn = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
10600 'span',
10601 { className: prefixCls + '-footer-btn' },
10602 extraFooter,
10603 Object(__WEBPACK_IMPORTED_MODULE_7_rc_util_es_Children_mapSelf__["a" /* default */])([nowEl, timePickerBtn, okBtn])
10604 );
10605 }
10606 var cls = __WEBPACK_IMPORTED_MODULE_8_classnames___default()(prefixCls + '-footer', (_cx = {}, _cx[prefixCls + '-footer-show-ok'] = okBtn, _cx));
10607 footerEl = __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(
10608 'div',
10609 { className: cls },
10610 footerBtn
10611 );
10612 }
10613 return footerEl;
10614 };
10615
10616 return CalendarFooter;
10617}(__WEBPACK_IMPORTED_MODULE_4_react___default.a.Component);
10618
10619CalendarFooter.propTypes = {
10620 prefixCls: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,
10621 showDateInput: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
10622 disabledTime: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
10623 timePicker: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.element,
10624 selectedValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,
10625 showOk: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,
10626 onSelect: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
10627 value: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
10628 renderFooter: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,
10629 defaultValue: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,
10630 mode: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string
10631};
10632/* harmony default export */ __webpack_exports__["a"] = (CalendarFooter);
10633
10634/***/ }),
10635/* 114 */
10636/***/ (function(module, __webpack_exports__, __webpack_require__) {
10637
10638"use strict";
10639/* harmony export (immutable) */ __webpack_exports__["a"] = TodayButton;
10640/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
10641/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
10642/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util___ = __webpack_require__(15);
10643
10644
10645
10646function TodayButton(_ref) {
10647 var prefixCls = _ref.prefixCls,
10648 locale = _ref.locale,
10649 value = _ref.value,
10650 timePicker = _ref.timePicker,
10651 disabled = _ref.disabled,
10652 disabledDate = _ref.disabledDate,
10653 onToday = _ref.onToday,
10654 text = _ref.text;
10655
10656 var localeNow = (!text && timePicker ? locale.now : text) || locale.today;
10657 var disabledToday = disabledDate && !Object(__WEBPACK_IMPORTED_MODULE_1__util___["g" /* isAllowedDate */])(Object(__WEBPACK_IMPORTED_MODULE_1__util___["e" /* getTodayTime */])(value), disabledDate);
10658 var isDisabled = disabledToday || disabled;
10659 var disabledTodayClass = isDisabled ? prefixCls + '-today-btn-disabled' : '';
10660 return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
10661 'a',
10662 {
10663 className: prefixCls + '-today-btn ' + disabledTodayClass,
10664 role: 'button',
10665 onClick: isDisabled ? null : onToday,
10666 title: Object(__WEBPACK_IMPORTED_MODULE_1__util___["f" /* getTodayTimeStr */])(value)
10667 },
10668 localeNow
10669 );
10670}
10671
10672/***/ }),
10673/* 115 */
10674/***/ (function(module, __webpack_exports__, __webpack_require__) {
10675
10676"use strict";
10677/* harmony export (immutable) */ __webpack_exports__["a"] = OkButton;
10678/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
10679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
10680
10681
10682function OkButton(_ref) {
10683 var prefixCls = _ref.prefixCls,
10684 locale = _ref.locale,
10685 okDisabled = _ref.okDisabled,
10686 onOk = _ref.onOk;
10687
10688 var className = prefixCls + "-ok-btn";
10689 if (okDisabled) {
10690 className += " " + prefixCls + "-ok-btn-disabled";
10691 }
10692 return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
10693 "a",
10694 {
10695 className: className,
10696 role: "button",
10697 onClick: okDisabled ? null : onOk
10698 },
10699 locale.ok
10700 );
10701}
10702
10703/***/ }),
10704/* 116 */
10705/***/ (function(module, __webpack_exports__, __webpack_require__) {
10706
10707"use strict";
10708/* harmony export (immutable) */ __webpack_exports__["a"] = TimePickerButton;
10709/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
10710/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
10711/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classnames__ = __webpack_require__(8);
10712/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_classnames__);
10713
10714
10715
10716function TimePickerButton(_ref) {
10717 var _classnames;
10718
10719 var prefixCls = _ref.prefixCls,
10720 locale = _ref.locale,
10721 showTimePicker = _ref.showTimePicker,
10722 onOpenTimePicker = _ref.onOpenTimePicker,
10723 onCloseTimePicker = _ref.onCloseTimePicker,
10724 timePickerDisabled = _ref.timePickerDisabled;
10725
10726 var className = __WEBPACK_IMPORTED_MODULE_1_classnames___default()((_classnames = {}, _classnames[prefixCls + '-time-picker-btn'] = true, _classnames[prefixCls + '-time-picker-btn-disabled'] = timePickerDisabled, _classnames));
10727 var onClick = null;
10728 if (!timePickerDisabled) {
10729 onClick = showTimePicker ? onCloseTimePicker : onOpenTimePicker;
10730 }
10731 return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(
10732 'a',
10733 {
10734 className: className,
10735 role: 'button',
10736 onClick: onClick
10737 },
10738 showTimePicker ? locale.dateSelect : locale.timeSelect
10739 );
10740}
10741
10742/***/ }),
10743/* 117 */
10744/***/ (function(module, __webpack_exports__, __webpack_require__) {
10745
10746"use strict";
10747/* harmony export (immutable) */ __webpack_exports__["d"] = getNowByCurrentStateValue;
10748/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return calendarMixinPropTypes; });
10749/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return calendarMixinDefaultProps; });
10750/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return calendarMixinWrapper; });
10751/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
10752/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
10753/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
10754/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
10755/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
10756/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
10757/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
10758/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
10759/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(4);
10760/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
10761/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames__ = __webpack_require__(8);
10762/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_classnames__);
10763/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_moment__ = __webpack_require__(20);
10764/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_moment__);
10765/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util_index__ = __webpack_require__(15);
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775function noop() {}
10776
10777function getNowByCurrentStateValue(value) {
10778 var ret = void 0;
10779 if (value) {
10780 ret = Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["e" /* getTodayTime */])(value);
10781 } else {
10782 ret = __WEBPACK_IMPORTED_MODULE_6_moment___default()();
10783 }
10784 return ret;
10785}
10786
10787var calendarMixinPropTypes = {
10788 value: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
10789 defaultValue: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
10790 onKeyDown: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func
10791};
10792
10793var calendarMixinDefaultProps = {
10794 onKeyDown: noop
10795};
10796
10797var calendarMixinWrapper = function calendarMixinWrapper(ComposeComponent) {
10798 var _class, _temp2;
10799
10800 return _temp2 = _class = function (_ComposeComponent) {
10801 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(_class, _ComposeComponent);
10802
10803 function _class() {
10804 var _temp, _this, _ret;
10805
10806 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, _class);
10807
10808 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
10809 args[_key] = arguments[_key];
10810 }
10811
10812 return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _ComposeComponent.call.apply(_ComposeComponent, [this].concat(args))), _this), _this.onSelect = function (value, cause) {
10813 if (value) {
10814 _this.setValue(value);
10815 }
10816 _this.setSelectedValue(value, cause);
10817 }, _this.renderRoot = function (newProps) {
10818 var _className;
10819
10820 var props = _this.props;
10821 var prefixCls = props.prefixCls;
10822
10823 var className = (_className = {}, _className[prefixCls] = 1, _className[prefixCls + '-hidden'] = !props.visible, _className[props.className] = !!props.className, _className[newProps.className] = !!newProps.className, _className);
10824
10825 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
10826 'div',
10827 {
10828 ref: _this.saveRoot,
10829 className: '' + __WEBPACK_IMPORTED_MODULE_5_classnames___default()(className),
10830 style: _this.props.style,
10831 tabIndex: '0',
10832 onKeyDown: _this.onKeyDown,
10833 onBlur: _this.onBlur
10834 },
10835 newProps.children
10836 );
10837 }, _this.setSelectedValue = function (selectedValue, cause) {
10838 // if (this.isAllowedDate(selectedValue)) {
10839 if (!('selectedValue' in _this.props)) {
10840 _this.setState({
10841 selectedValue: selectedValue
10842 });
10843 }
10844 if (_this.props.onSelect) {
10845 _this.props.onSelect(selectedValue, cause);
10846 }
10847 // }
10848 }, _this.setValue = function (value) {
10849 var originalValue = _this.state.value;
10850 if (!('value' in _this.props)) {
10851 _this.setState({
10852 value: value
10853 });
10854 }
10855 if (originalValue && value && !originalValue.isSame(value) || !originalValue && value || originalValue && !value) {
10856 _this.props.onChange(value);
10857 }
10858 }, _this.isAllowedDate = function (value) {
10859 var disabledDate = _this.props.disabledDate;
10860 var disabledTime = _this.props.disabledTime;
10861 return Object(__WEBPACK_IMPORTED_MODULE_7__util_index__["g" /* isAllowedDate */])(value, disabledDate, disabledTime);
10862 }, _temp), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
10863 }
10864
10865 _class.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
10866 // Use origin function if provided
10867 if (ComposeComponent.getDerivedStateFromProps) {
10868 return ComposeComponent.getDerivedStateFromProps(nextProps, prevState);
10869 }
10870
10871 var value = nextProps.value,
10872 selectedValue = nextProps.selectedValue;
10873
10874 var newState = {};
10875
10876 if ('value' in nextProps) {
10877 newState.value = value || nextProps.defaultValue || getNowByCurrentStateValue(prevState.value);
10878 }
10879 if ('selectedValue' in nextProps) {
10880 newState.selectedValue = selectedValue;
10881 }
10882
10883 return newState;
10884 };
10885
10886 return _class;
10887 }(ComposeComponent), _class.displayName = 'CalendarMixinWrapper', _class.defaultProps = ComposeComponent.defaultProps, _temp2;
10888};
10889
10890/***/ }),
10891/* 118 */
10892/***/ (function(module, __webpack_exports__, __webpack_require__) {
10893
10894"use strict";
10895/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return propType; });
10896/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return defaultProp; });
10897/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return commonMixinWrapper; });
10898/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
10899/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
10900/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
10901/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
10902/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
10903/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
10904/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(4);
10905/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
10906/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__locale_en_US__ = __webpack_require__(119);
10907
10908
10909
10910
10911
10912
10913function noop() {}
10914
10915var propType = {
10916 className: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
10917 locale: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
10918 style: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
10919 visible: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
10920 onSelect: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
10921 prefixCls: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
10922 onChange: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
10923 onOk: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func
10924};
10925
10926var defaultProp = {
10927 locale: __WEBPACK_IMPORTED_MODULE_4__locale_en_US__["a" /* default */],
10928 style: {},
10929 visible: true,
10930 prefixCls: 'rc-calendar',
10931 className: '',
10932 onSelect: noop,
10933 onChange: noop,
10934 onClear: noop,
10935 renderFooter: function renderFooter() {
10936 return null;
10937 },
10938 renderSidebar: function renderSidebar() {
10939 return null;
10940 }
10941};
10942
10943var commonMixinWrapper = function commonMixinWrapper(ComposeComponent) {
10944 var _class, _temp2;
10945
10946 return _temp2 = _class = function (_ComposeComponent) {
10947 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(_class, _ComposeComponent);
10948
10949 function _class() {
10950 var _temp, _this, _ret;
10951
10952 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, _class);
10953
10954 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
10955 args[_key] = arguments[_key];
10956 }
10957
10958 return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _ComposeComponent.call.apply(_ComposeComponent, [this].concat(args))), _this), _this.getFormat = function () {
10959 var format = _this.props.format;
10960 var _this$props = _this.props,
10961 locale = _this$props.locale,
10962 timePicker = _this$props.timePicker;
10963
10964 if (!format) {
10965 if (timePicker) {
10966 format = locale.dateTimeFormat;
10967 } else {
10968 format = locale.dateFormat;
10969 }
10970 }
10971 return format;
10972 }, _this.focus = function () {
10973 if (_this.focusElement) {
10974 _this.focusElement.focus();
10975 } else if (_this.rootInstance) {
10976 _this.rootInstance.focus();
10977 }
10978 }, _this.saveFocusElement = function (focusElement) {
10979 _this.focusElement = focusElement;
10980 }, _this.saveRoot = function (root) {
10981 _this.rootInstance = root;
10982 }, _temp), __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);
10983 }
10984
10985 _class.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
10986 return this.props.visible || nextProps.visible;
10987 };
10988
10989 return _class;
10990 }(ComposeComponent), _class.displayName = 'CommonMixinWrapper', _class.defaultProps = ComposeComponent.defaultProps, _class.getDerivedStateFromProps = ComposeComponent.getDerivedStateFromProps, _temp2;
10991};
10992
10993/***/ }),
10994/* 119 */
10995/***/ (function(module, __webpack_exports__, __webpack_require__) {
10996
10997"use strict";
10998/* harmony default export */ __webpack_exports__["a"] = ({
10999 today: 'Today',
11000 now: 'Now',
11001 backToToday: 'Back to today',
11002 ok: 'Ok',
11003 clear: 'Clear',
11004 month: 'Month',
11005 year: 'Year',
11006 timeSelect: 'select time',
11007 dateSelect: 'select date',
11008 weekSelect: 'Choose a week',
11009 monthSelect: 'Choose a month',
11010 yearSelect: 'Choose a year',
11011 decadeSelect: 'Choose a decade',
11012 yearFormat: 'YYYY',
11013 dateFormat: 'M/D/YYYY',
11014 dayFormat: 'D',
11015 dateTimeFormat: 'M/D/YYYY HH:mm:ss',
11016 monthBeforeYear: true,
11017 previousMonth: 'Previous month (PageUp)',
11018 nextMonth: 'Next month (PageDown)',
11019 previousYear: 'Last year (Control + left)',
11020 nextYear: 'Next year (Control + right)',
11021 previousDecade: 'Last decade',
11022 nextDecade: 'Next decade',
11023 previousCentury: 'Last century',
11024 nextCentury: 'Next century'
11025});
11026
11027/***/ }),
11028/* 120 */
11029/***/ (function(module, __webpack_exports__, __webpack_require__) {
11030
11031"use strict";
11032/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__ = __webpack_require__(1);
11033/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck__);
11034/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(2);
11035/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn__);
11036/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__ = __webpack_require__(3);
11037/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits__);
11038/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react__ = __webpack_require__(0);
11039/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_react__);
11040/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react_dom__ = __webpack_require__(39);
11041/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_react_dom__);
11042/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types__ = __webpack_require__(4);
11043/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_prop_types__);
11044/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_rc_util_es_KeyCode__ = __webpack_require__(55);
11045/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_react_lifecycles_compat__ = __webpack_require__(41);
11046/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_moment__ = __webpack_require__(20);
11047/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_moment__);
11048/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util__ = __webpack_require__(15);
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060var cachedSelectionStart = void 0;
11061var cachedSelectionEnd = void 0;
11062var dateInputInstance = void 0;
11063
11064var DateInput = function (_React$Component) {
11065 __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_inherits___default()(DateInput, _React$Component);
11066
11067 function DateInput(props) {
11068 __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_classCallCheck___default()(this, DateInput);
11069
11070 var _this = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_possibleConstructorReturn___default()(this, _React$Component.call(this, props));
11071
11072 _initialiseProps.call(_this);
11073
11074 var selectedValue = props.selectedValue;
11075
11076 _this.state = {
11077 str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(selectedValue, _this.props.format),
11078 invalid: false,
11079 hasFocus: false
11080 };
11081 return _this;
11082 }
11083
11084 DateInput.prototype.componentDidUpdate = function componentDidUpdate() {
11085 if (dateInputInstance && this.state.hasFocus && !this.state.invalid && !(cachedSelectionStart === 0 && cachedSelectionEnd === 0)) {
11086 dateInputInstance.setSelectionRange(cachedSelectionStart, cachedSelectionEnd);
11087 }
11088 };
11089
11090 DateInput.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, state) {
11091 var newState = {};
11092
11093 if (dateInputInstance) {
11094 cachedSelectionStart = dateInputInstance.selectionStart;
11095 cachedSelectionEnd = dateInputInstance.selectionEnd;
11096 }
11097 // when popup show, click body will call this, bug!
11098 var selectedValue = nextProps.selectedValue;
11099 if (!state.hasFocus) {
11100 newState = {
11101 str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(selectedValue, nextProps.format),
11102 invalid: false
11103 };
11104 }
11105
11106 return newState;
11107 };
11108
11109 DateInput.getInstance = function getInstance() {
11110 return dateInputInstance;
11111 };
11112
11113 DateInput.prototype.render = function render() {
11114 var props = this.props;
11115 var _state = this.state,
11116 invalid = _state.invalid,
11117 str = _state.str;
11118 var locale = props.locale,
11119 prefixCls = props.prefixCls,
11120 placeholder = props.placeholder,
11121 clearIcon = props.clearIcon;
11122
11123 var invalidClass = invalid ? prefixCls + '-input-invalid' : '';
11124 return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
11125 'div',
11126 { className: prefixCls + '-input-wrap' },
11127 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
11128 'div',
11129 { className: prefixCls + '-date-input-wrap' },
11130 __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('input', {
11131 ref: this.saveDateInput,
11132 className: prefixCls + '-input ' + invalidClass,
11133 value: str,
11134 disabled: props.disabled,
11135 placeholder: placeholder,
11136 onChange: this.onInputChange,
11137 onKeyDown: this.onKeyDown,
11138 onFocus: this.onFocus,
11139 onBlur: this.onBlur
11140 })
11141 ),
11142 props.showClear ? __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(
11143 'a',
11144 {
11145 role: 'button',
11146 title: locale.clear,
11147 onClick: this.onClear
11148 },
11149 clearIcon || __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('span', { className: prefixCls + '-clear-btn' })
11150 ) : null
11151 );
11152 };
11153
11154 return DateInput;
11155}(__WEBPACK_IMPORTED_MODULE_3_react___default.a.Component);
11156
11157DateInput.propTypes = {
11158 prefixCls: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
11159 timePicker: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
11160 value: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
11161 disabledTime: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.any,
11162 format: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string)]),
11163 locale: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
11164 disabledDate: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
11165 onChange: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
11166 onClear: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
11167 placeholder: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.string,
11168 onSelect: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.func,
11169 selectedValue: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.object,
11170 clearIcon: __WEBPACK_IMPORTED_MODULE_5_prop_types___default.a.node
11171};
11172
11173var _initialiseProps = function _initialiseProps() {
11174 var _this2 = this;
11175
11176 this.onClear = function () {
11177 _this2.setState({
11178 str: ''
11179 });
11180 _this2.props.onClear(null);
11181 };
11182
11183 this.onInputChange = function (event) {
11184 var str = event.target.value;
11185 var _props = _this2.props,
11186 disabledDate = _props.disabledDate,
11187 format = _props.format,
11188 onChange = _props.onChange,
11189 selectedValue = _props.selectedValue;
11190
11191 // 没有内容,合法并直接退出
11192
11193 if (!str) {
11194 onChange(null);
11195 _this2.setState({
11196 invalid: false,
11197 str: str
11198 });
11199 return;
11200 }
11201
11202 // 不合法直接退出
11203 var parsed = __WEBPACK_IMPORTED_MODULE_8_moment___default()(str, format, true);
11204 if (!parsed.isValid()) {
11205 _this2.setState({
11206 invalid: true,
11207 str: str
11208 });
11209 return;
11210 }
11211
11212 var value = _this2.props.value.clone();
11213 value.year(parsed.year()).month(parsed.month()).date(parsed.date()).hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());
11214
11215 if (!value || disabledDate && disabledDate(value)) {
11216 _this2.setState({
11217 invalid: true,
11218 str: str
11219 });
11220 return;
11221 }
11222
11223 if (selectedValue !== value || selectedValue && value && !selectedValue.isSame(value)) {
11224 _this2.setState({
11225 invalid: false,
11226 str: str
11227 });
11228 onChange(value);
11229 }
11230 };
11231
11232 this.onFocus = function () {
11233 _this2.setState({ hasFocus: true });
11234 };
11235
11236 this.onBlur = function () {
11237 _this2.setState(function (prevState, prevProps) {
11238 return {
11239 hasFocus: false,
11240 str: Object(__WEBPACK_IMPORTED_MODULE_9__util__["a" /* formatDate */])(prevProps.value, prevProps.format)
11241 };
11242 });
11243 };
11244
11245 this.onKeyDown = function (_ref) {
11246 var keyCode = _ref.keyCode;
11247 var _props2 = _this2.props,
11248 onSelect = _props2.onSelect,
11249 value = _props2.value,
11250 disabledDate = _props2.disabledDate;
11251
11252 if (keyCode === __WEBPACK_IMPORTED_MODULE_6_rc_util_es_KeyCode__["a" /* default */].ENTER && onSelect) {
11253 var validateDate = !disabledDate || !disabledDate(value);
11254 if (validateDate) {
11255 onSelect(value.clone());
11256 }
11257 }
11258 };
11259
11260 this.getRootDOMNode = function () {
11261 return __WEBPACK_IMPORTED_MODULE_4_react_dom___default.a.findDOMNode(_this2);
11262 };
11263
11264 this.focus = function () {
11265 if (dateInputInstance) {
11266 dateInputInstance.focus();
11267 }
11268 };
11269
11270 this.saveDateInput = function (dateInput) {
11271 dateInputInstance = dateInput;
11272 };
11273};
11274
11275Object(__WEBPACK_IMPORTED_MODULE_7_react_lifecycles_compat__["a" /* polyfill */])(DateInput);
11276
11277/* harmony default export */ __webpack_exports__["a"] = (DateInput);
11278
11279/***/ }),
11280/* 121 */
11281/***/ (function(module, __webpack_exports__, __webpack_require__) {
11282
11283"use strict";
11284/* harmony export (immutable) */ __webpack_exports__["b"] = goStartMonth;
11285/* harmony export (immutable) */ __webpack_exports__["a"] = goEndMonth;
11286/* harmony export (immutable) */ __webpack_exports__["c"] = goTime;
11287/* unused harmony export includesTime */
11288function goStartMonth(time) {
11289 return time.clone().startOf('month');
11290}
11291
11292function goEndMonth(time) {
11293 return time.clone().endOf('month');
11294}
11295
11296function goTime(time, direction, unit) {
11297 return time.clone().add(direction, unit);
11298}
11299
11300function includesTime() {
11301 var timeList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
11302 var time = arguments[1];
11303 var unit = arguments[2];
11304
11305 return timeList.some(function (t) {
11306 return t.isSame(time, unit);
11307 });
11308}
11309
11310/***/ })
11311/******/ ])["default"];
11312});
11313//# sourceMappingURL=rc-calendar.js.map
\No newline at end of file