UNPKG

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