@tanstack/react-router-devtools 0.0.1-beta.49 → 0.0.1-beta.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,4390 +62,107 @@
62
62
  throw new Error(value);
63
63
  }
64
64
 
65
- function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];{var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}}function r(n){return !!n&&!!n[Q]}function t(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function O(n){g(n),n.p.forEach(S),n.p=null;}function g(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s){if(c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1;}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1;}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=R(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.D[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.g=B,this.F=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=R(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?O(c):g(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.F&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.g=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un;an.produce;an.produceWithPatches.bind(an);var sn=an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
66
-
67
- /**
68
- * router-core
69
- *
70
- * Copyright (c) TanStack
71
- *
72
- * This source code is licensed under the MIT license found in the
73
- * LICENSE.md file in the root directory of this source tree.
74
- *
75
- * @license MIT
76
- */
77
-
78
- function last(arr) {
79
- return arr[arr.length - 1];
80
- }
81
- function warning(cond, message) {
82
- if (cond) {
83
- if (typeof console !== 'undefined') console.warn(message);
84
- try {
85
- throw new Error(message);
86
- } catch {}
87
- }
88
- return true;
89
- }
90
-
91
- sn(false);
92
-
93
- /**
94
- * react-router
95
- *
96
- * Copyright (c) TanStack
97
- *
98
- * This source code is licensed under the MIT license found in the
99
- * LICENSE.md file in the root directory of this source tree.
100
- *
101
- * @license MIT
102
- */
103
-
104
- function useStore(store, selector = d => d, compareShallow) {
105
- const slice = withSelector.useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, compareShallow ? shallow : undefined);
106
- return slice;
107
- }
108
- function shallow(objA, objB) {
109
- if (Object.is(objA, objB)) {
110
- return true;
111
- }
112
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
113
- return false;
114
- }
115
-
116
- // if (objA instanceof Map && objB instanceof Map) {
117
- // if (objA.size !== objB.size) return false
118
-
119
- // for (const [key, value] of objA) {
120
- // if (!Object.is(value, objB.get(key))) {
121
- // return false
122
- // }
123
- // }
124
- // return true
125
- // }
126
-
127
- // if (objA instanceof Set && objB instanceof Set) {
128
- // if (objA.size !== objB.size) return false
129
-
130
- // for (const value of objA) {
131
- // if (!objB.has(value)) {
132
- // return false
133
- // }
134
- // }
135
- // return true
136
- // }
137
-
138
- const keysA = Object.keys(objA);
139
- if (keysA.length !== Object.keys(objB).length) {
140
- return false;
141
- }
142
- for (let i = 0; i < keysA.length; i++) {
143
- if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
144
- return false;
145
- }
146
- }
147
- return true;
148
- }
149
- const routerContext = /*#__PURE__*/React__namespace.createContext(null);
150
- function useRouter() {
151
- const value = React__namespace.useContext(routerContext);
152
- warning(!value, 'useRouter must be used inside a <Router> component!');
153
- return value.router;
154
- }
155
- function useRouterStore(selector, shallow) {
156
- const router = useRouter();
157
- return useStore(router.store, selector, shallow);
158
- }
159
-
160
- function toInteger(dirtyNumber) {
161
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
162
- return NaN;
163
- }
164
-
165
- var number = Number(dirtyNumber);
166
-
167
- if (isNaN(number)) {
168
- return number;
169
- }
170
-
171
- return number < 0 ? Math.ceil(number) : Math.floor(number);
172
- }
173
-
174
- function requiredArgs(required, args) {
175
- if (args.length < required) {
176
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
177
- }
178
- }
179
-
180
- function _typeof$w(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$w = function _typeof(obj) { return typeof obj; }; } else { _typeof$w = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$w(obj); }
181
- /**
182
- * @name toDate
183
- * @category Common Helpers
184
- * @summary Convert the given argument to an instance of Date.
185
- *
186
- * @description
187
- * Convert the given argument to an instance of Date.
188
- *
189
- * If the argument is an instance of Date, the function returns its clone.
190
- *
191
- * If the argument is a number, it is treated as a timestamp.
192
- *
193
- * If the argument is none of the above, the function returns Invalid Date.
194
- *
195
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
196
- *
197
- * @param {Date|Number} argument - the value to convert
198
- * @returns {Date} the parsed date in the local time zone
199
- * @throws {TypeError} 1 argument required
200
- *
201
- * @example
202
- * // Clone the date:
203
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
204
- * //=> Tue Feb 11 2014 11:30:30
205
- *
206
- * @example
207
- * // Convert the timestamp to date:
208
- * const result = toDate(1392098430000)
209
- * //=> Tue Feb 11 2014 11:30:30
210
- */
211
-
212
- function toDate(argument) {
213
- requiredArgs(1, arguments);
214
- var argStr = Object.prototype.toString.call(argument); // Clone the date
215
-
216
- if (argument instanceof Date || _typeof$w(argument) === 'object' && argStr === '[object Date]') {
217
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
218
- return new Date(argument.getTime());
219
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
220
- return new Date(argument);
221
- } else {
222
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
223
- // eslint-disable-next-line no-console
224
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console
225
-
226
- console.warn(new Error().stack);
227
- }
228
-
229
- return new Date(NaN);
230
- }
231
- }
232
-
233
- var defaultOptions = {};
234
- function getDefaultOptions() {
235
- return defaultOptions;
236
- }
237
-
238
- /**
239
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
240
- * They usually appear for dates that denote time before the timezones were introduced
241
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
242
- * and GMT+01:00:00 after that date)
243
- *
244
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
245
- * which would lead to incorrect calculations.
246
- *
247
- * This function returns the timezone offset in milliseconds that takes seconds in account.
248
- */
249
- function getTimezoneOffsetInMilliseconds(date) {
250
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
251
- utcDate.setUTCFullYear(date.getFullYear());
252
- return date.getTime() - utcDate.getTime();
253
- }
254
-
255
- /**
256
- * @name compareAsc
257
- * @category Common Helpers
258
- * @summary Compare the two dates and return -1, 0 or 1.
259
- *
260
- * @description
261
- * Compare the two dates and return 1 if the first date is after the second,
262
- * -1 if the first date is before the second or 0 if dates are equal.
263
- *
264
- * @param {Date|Number} dateLeft - the first date to compare
265
- * @param {Date|Number} dateRight - the second date to compare
266
- * @returns {Number} the result of the comparison
267
- * @throws {TypeError} 2 arguments required
268
- *
269
- * @example
270
- * // Compare 11 February 1987 and 10 July 1989:
271
- * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
272
- * //=> -1
273
- *
274
- * @example
275
- * // Sort the array of dates:
276
- * const result = [
277
- * new Date(1995, 6, 2),
278
- * new Date(1987, 1, 11),
279
- * new Date(1989, 6, 10)
280
- * ].sort(compareAsc)
281
- * //=> [
282
- * // Wed Feb 11 1987 00:00:00,
283
- * // Mon Jul 10 1989 00:00:00,
284
- * // Sun Jul 02 1995 00:00:00
285
- * // ]
286
- */
287
-
288
- function compareAsc(dirtyDateLeft, dirtyDateRight) {
289
- requiredArgs(2, arguments);
290
- var dateLeft = toDate(dirtyDateLeft);
291
- var dateRight = toDate(dirtyDateRight);
292
- var diff = dateLeft.getTime() - dateRight.getTime();
293
-
294
- if (diff < 0) {
295
- return -1;
296
- } else if (diff > 0) {
297
- return 1; // Return 0 if diff is 0; return NaN if diff is NaN
298
- } else {
299
- return diff;
300
- }
301
- }
302
-
303
- /**
304
- * Days in 1 week.
305
- *
306
- * @name daysInWeek
307
- * @constant
308
- * @type {number}
309
- * @default
310
- */
311
- /**
312
- * Milliseconds in 1 minute
313
- *
314
- * @name millisecondsInMinute
315
- * @constant
316
- * @type {number}
317
- * @default
318
- */
319
-
320
- var millisecondsInMinute = 60000;
321
- /**
322
- * Milliseconds in 1 hour
323
- *
324
- * @name millisecondsInHour
325
- * @constant
326
- * @type {number}
327
- * @default
328
- */
329
-
330
- var millisecondsInHour = 3600000;
331
- /**
332
- * Milliseconds in 1 second
333
- *
334
- * @name millisecondsInSecond
335
- * @constant
336
- * @type {number}
337
- * @default
338
- */
339
-
340
- var millisecondsInSecond = 1000;
341
-
342
- function startOfUTCISOWeek(dirtyDate) {
343
- requiredArgs(1, arguments);
344
- var weekStartsOn = 1;
345
- var date = toDate(dirtyDate);
346
- var day = date.getUTCDay();
347
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
348
- date.setUTCDate(date.getUTCDate() - diff);
349
- date.setUTCHours(0, 0, 0, 0);
350
- return date;
351
- }
352
-
353
- function getUTCISOWeekYear(dirtyDate) {
354
- requiredArgs(1, arguments);
355
- var date = toDate(dirtyDate);
356
- var year = date.getUTCFullYear();
357
- var fourthOfJanuaryOfNextYear = new Date(0);
358
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
359
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
360
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
361
- var fourthOfJanuaryOfThisYear = new Date(0);
362
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
363
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
364
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
365
-
366
- if (date.getTime() >= startOfNextYear.getTime()) {
367
- return year + 1;
368
- } else if (date.getTime() >= startOfThisYear.getTime()) {
369
- return year;
370
- } else {
371
- return year - 1;
372
- }
373
- }
374
-
375
- function startOfUTCISOWeekYear(dirtyDate) {
376
- requiredArgs(1, arguments);
377
- var year = getUTCISOWeekYear(dirtyDate);
378
- var fourthOfJanuary = new Date(0);
379
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
380
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
381
- var date = startOfUTCISOWeek(fourthOfJanuary);
382
- return date;
383
- }
384
-
385
- var MILLISECONDS_IN_WEEK$1 = 604800000;
386
- function getUTCISOWeek(dirtyDate) {
387
- requiredArgs(1, arguments);
388
- var date = toDate(dirtyDate);
389
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
390
- // because the number of milliseconds in a week is not constant
391
- // (e.g. it's different in the week of the daylight saving time clock shift)
392
-
393
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
394
- }
395
-
396
- function startOfUTCWeek(dirtyDate, options) {
397
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
398
-
399
- requiredArgs(1, arguments);
400
- var defaultOptions = getDefaultOptions();
401
- var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
402
-
403
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
404
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
405
- }
406
-
407
- var date = toDate(dirtyDate);
408
- var day = date.getUTCDay();
409
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
410
- date.setUTCDate(date.getUTCDate() - diff);
411
- date.setUTCHours(0, 0, 0, 0);
412
- return date;
413
- }
414
-
415
- function getUTCWeekYear(dirtyDate, options) {
416
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
417
-
418
- requiredArgs(1, arguments);
419
- var date = toDate(dirtyDate);
420
- var year = date.getUTCFullYear();
421
- var defaultOptions = getDefaultOptions();
422
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
423
-
424
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
425
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
426
- }
427
-
428
- var firstWeekOfNextYear = new Date(0);
429
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
430
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
431
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
432
- var firstWeekOfThisYear = new Date(0);
433
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
434
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
435
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
436
-
437
- if (date.getTime() >= startOfNextYear.getTime()) {
438
- return year + 1;
439
- } else if (date.getTime() >= startOfThisYear.getTime()) {
440
- return year;
441
- } else {
442
- return year - 1;
443
- }
444
- }
445
-
446
- function startOfUTCWeekYear(dirtyDate, options) {
447
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
448
-
449
- requiredArgs(1, arguments);
450
- var defaultOptions = getDefaultOptions();
451
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
452
- var year = getUTCWeekYear(dirtyDate, options);
453
- var firstWeek = new Date(0);
454
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
455
- firstWeek.setUTCHours(0, 0, 0, 0);
456
- var date = startOfUTCWeek(firstWeek, options);
457
- return date;
458
- }
459
-
460
- var MILLISECONDS_IN_WEEK = 604800000;
461
- function getUTCWeek(dirtyDate, options) {
462
- requiredArgs(1, arguments);
463
- var date = toDate(dirtyDate);
464
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
465
- // because the number of milliseconds in a week is not constant
466
- // (e.g. it's different in the week of the daylight saving time clock shift)
467
-
468
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
469
- }
470
-
471
- var formatDistanceLocale = {
472
- lessThanXSeconds: {
473
- one: 'less than a second',
474
- other: 'less than {{count}} seconds'
475
- },
476
- xSeconds: {
477
- one: '1 second',
478
- other: '{{count}} seconds'
479
- },
480
- halfAMinute: 'half a minute',
481
- lessThanXMinutes: {
482
- one: 'less than a minute',
483
- other: 'less than {{count}} minutes'
484
- },
485
- xMinutes: {
486
- one: '1 minute',
487
- other: '{{count}} minutes'
488
- },
489
- aboutXHours: {
490
- one: 'about 1 hour',
491
- other: 'about {{count}} hours'
492
- },
493
- xHours: {
494
- one: '1 hour',
495
- other: '{{count}} hours'
496
- },
497
- xDays: {
498
- one: '1 day',
499
- other: '{{count}} days'
500
- },
501
- aboutXWeeks: {
502
- one: 'about 1 week',
503
- other: 'about {{count}} weeks'
504
- },
505
- xWeeks: {
506
- one: '1 week',
507
- other: '{{count}} weeks'
508
- },
509
- aboutXMonths: {
510
- one: 'about 1 month',
511
- other: 'about {{count}} months'
512
- },
513
- xMonths: {
514
- one: '1 month',
515
- other: '{{count}} months'
516
- },
517
- aboutXYears: {
518
- one: 'about 1 year',
519
- other: 'about {{count}} years'
520
- },
521
- xYears: {
522
- one: '1 year',
523
- other: '{{count}} years'
524
- },
525
- overXYears: {
526
- one: 'over 1 year',
527
- other: 'over {{count}} years'
528
- },
529
- almostXYears: {
530
- one: 'almost 1 year',
531
- other: 'almost {{count}} years'
532
- }
533
- };
534
-
535
- var formatDistance = function formatDistance(token, count, options) {
536
- var result;
537
- var tokenValue = formatDistanceLocale[token];
538
-
539
- if (typeof tokenValue === 'string') {
540
- result = tokenValue;
541
- } else if (count === 1) {
542
- result = tokenValue.one;
543
- } else {
544
- result = tokenValue.other.replace('{{count}}', count.toString());
545
- }
546
-
547
- if (options !== null && options !== void 0 && options.addSuffix) {
548
- if (options.comparison && options.comparison > 0) {
549
- return 'in ' + result;
550
- } else {
551
- return result + ' ago';
552
- }
553
- }
554
-
555
- return result;
556
- };
557
-
558
- function buildFormatLongFn(args) {
559
- return function () {
560
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
561
- // TODO: Remove String()
562
- var width = options.width ? String(options.width) : args.defaultWidth;
563
- var format = args.formats[width] || args.formats[args.defaultWidth];
564
- return format;
565
- };
566
- }
567
-
568
- var dateFormats = {
569
- full: 'EEEE, MMMM do, y',
570
- long: 'MMMM do, y',
571
- medium: 'MMM d, y',
572
- short: 'MM/dd/yyyy'
573
- };
574
- var timeFormats = {
575
- full: 'h:mm:ss a zzzz',
576
- long: 'h:mm:ss a z',
577
- medium: 'h:mm:ss a',
578
- short: 'h:mm a'
579
- };
580
- var dateTimeFormats = {
581
- full: "{{date}} 'at' {{time}}",
582
- long: "{{date}} 'at' {{time}}",
583
- medium: '{{date}}, {{time}}',
584
- short: '{{date}}, {{time}}'
585
- };
586
- var formatLong = {
587
- date: buildFormatLongFn({
588
- formats: dateFormats,
589
- defaultWidth: 'full'
590
- }),
591
- time: buildFormatLongFn({
592
- formats: timeFormats,
593
- defaultWidth: 'full'
594
- }),
595
- dateTime: buildFormatLongFn({
596
- formats: dateTimeFormats,
597
- defaultWidth: 'full'
598
- })
599
- };
600
-
601
- var formatRelativeLocale = {
602
- lastWeek: "'last' eeee 'at' p",
603
- yesterday: "'yesterday at' p",
604
- today: "'today at' p",
605
- tomorrow: "'tomorrow at' p",
606
- nextWeek: "eeee 'at' p",
607
- other: 'P'
608
- };
609
-
610
- var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
611
- return formatRelativeLocale[token];
612
- };
613
-
614
- function buildLocalizeFn(args) {
615
- return function (dirtyIndex, options) {
616
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
617
- var valuesArray;
618
-
619
- if (context === 'formatting' && args.formattingValues) {
620
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
621
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
622
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
623
- } else {
624
- var _defaultWidth = args.defaultWidth;
625
-
626
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
627
-
628
- valuesArray = args.values[_width] || args.values[_defaultWidth];
629
- }
630
-
631
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
632
-
633
- return valuesArray[index];
634
- };
635
- }
636
-
637
- var eraValues = {
638
- narrow: ['B', 'A'],
639
- abbreviated: ['BC', 'AD'],
640
- wide: ['Before Christ', 'Anno Domini']
641
- };
642
- var quarterValues = {
643
- narrow: ['1', '2', '3', '4'],
644
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
645
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
646
- }; // Note: in English, the names of days of the week and months are capitalized.
647
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
648
- // Generally, formatted dates should look like they are in the middle of a sentence,
649
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
650
-
651
- var monthValues = {
652
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
653
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
654
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
655
- };
656
- var dayValues = {
657
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
658
- short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
659
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
660
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
661
- };
662
- var dayPeriodValues = {
663
- narrow: {
664
- am: 'a',
665
- pm: 'p',
666
- midnight: 'mi',
667
- noon: 'n',
668
- morning: 'morning',
669
- afternoon: 'afternoon',
670
- evening: 'evening',
671
- night: 'night'
672
- },
673
- abbreviated: {
674
- am: 'AM',
675
- pm: 'PM',
676
- midnight: 'midnight',
677
- noon: 'noon',
678
- morning: 'morning',
679
- afternoon: 'afternoon',
680
- evening: 'evening',
681
- night: 'night'
682
- },
683
- wide: {
684
- am: 'a.m.',
685
- pm: 'p.m.',
686
- midnight: 'midnight',
687
- noon: 'noon',
688
- morning: 'morning',
689
- afternoon: 'afternoon',
690
- evening: 'evening',
691
- night: 'night'
692
- }
693
- };
694
- var formattingDayPeriodValues = {
695
- narrow: {
696
- am: 'a',
697
- pm: 'p',
698
- midnight: 'mi',
699
- noon: 'n',
700
- morning: 'in the morning',
701
- afternoon: 'in the afternoon',
702
- evening: 'in the evening',
703
- night: 'at night'
704
- },
705
- abbreviated: {
706
- am: 'AM',
707
- pm: 'PM',
708
- midnight: 'midnight',
709
- noon: 'noon',
710
- morning: 'in the morning',
711
- afternoon: 'in the afternoon',
712
- evening: 'in the evening',
713
- night: 'at night'
714
- },
715
- wide: {
716
- am: 'a.m.',
717
- pm: 'p.m.',
718
- midnight: 'midnight',
719
- noon: 'noon',
720
- morning: 'in the morning',
721
- afternoon: 'in the afternoon',
722
- evening: 'in the evening',
723
- night: 'at night'
724
- }
725
- };
726
-
727
- var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
728
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
729
- // if they are different for different grammatical genders,
730
- // use `options.unit`.
731
- //
732
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
733
- // 'day', 'hour', 'minute', 'second'.
734
-
735
- var rem100 = number % 100;
736
-
737
- if (rem100 > 20 || rem100 < 10) {
738
- switch (rem100 % 10) {
739
- case 1:
740
- return number + 'st';
741
-
742
- case 2:
743
- return number + 'nd';
744
-
745
- case 3:
746
- return number + 'rd';
747
- }
748
- }
749
-
750
- return number + 'th';
751
- };
752
-
753
- var localize = {
754
- ordinalNumber: ordinalNumber,
755
- era: buildLocalizeFn({
756
- values: eraValues,
757
- defaultWidth: 'wide'
758
- }),
759
- quarter: buildLocalizeFn({
760
- values: quarterValues,
761
- defaultWidth: 'wide',
762
- argumentCallback: function argumentCallback(quarter) {
763
- return quarter - 1;
764
- }
765
- }),
766
- month: buildLocalizeFn({
767
- values: monthValues,
768
- defaultWidth: 'wide'
769
- }),
770
- day: buildLocalizeFn({
771
- values: dayValues,
772
- defaultWidth: 'wide'
773
- }),
774
- dayPeriod: buildLocalizeFn({
775
- values: dayPeriodValues,
776
- defaultWidth: 'wide',
777
- formattingValues: formattingDayPeriodValues,
778
- defaultFormattingWidth: 'wide'
779
- })
780
- };
781
-
782
- function buildMatchFn(args) {
783
- return function (string) {
784
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
785
- var width = options.width;
786
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
787
- var matchResult = string.match(matchPattern);
788
-
789
- if (!matchResult) {
790
- return null;
791
- }
792
-
793
- var matchedString = matchResult[0];
794
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
795
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
796
- return pattern.test(matchedString);
797
- }) : findKey(parsePatterns, function (pattern) {
798
- return pattern.test(matchedString);
799
- });
800
- var value;
801
- value = args.valueCallback ? args.valueCallback(key) : key;
802
- value = options.valueCallback ? options.valueCallback(value) : value;
803
- var rest = string.slice(matchedString.length);
804
- return {
805
- value: value,
806
- rest: rest
807
- };
808
- };
809
- }
810
-
811
- function findKey(object, predicate) {
812
- for (var key in object) {
813
- if (object.hasOwnProperty(key) && predicate(object[key])) {
814
- return key;
815
- }
816
- }
817
-
818
- return undefined;
819
- }
820
-
821
- function findIndex(array, predicate) {
822
- for (var key = 0; key < array.length; key++) {
823
- if (predicate(array[key])) {
824
- return key;
825
- }
826
- }
827
-
828
- return undefined;
829
- }
830
-
831
- function buildMatchPatternFn(args) {
832
- return function (string) {
833
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
834
- var matchResult = string.match(args.matchPattern);
835
- if (!matchResult) return null;
836
- var matchedString = matchResult[0];
837
- var parseResult = string.match(args.parsePattern);
838
- if (!parseResult) return null;
839
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
840
- value = options.valueCallback ? options.valueCallback(value) : value;
841
- var rest = string.slice(matchedString.length);
842
- return {
843
- value: value,
844
- rest: rest
845
- };
846
- };
847
- }
848
-
849
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
850
- var parseOrdinalNumberPattern = /\d+/i;
851
- var matchEraPatterns = {
852
- narrow: /^(b|a)/i,
853
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
854
- wide: /^(before christ|before common era|anno domini|common era)/i
855
- };
856
- var parseEraPatterns = {
857
- any: [/^b/i, /^(a|c)/i]
858
- };
859
- var matchQuarterPatterns = {
860
- narrow: /^[1234]/i,
861
- abbreviated: /^q[1234]/i,
862
- wide: /^[1234](th|st|nd|rd)? quarter/i
863
- };
864
- var parseQuarterPatterns = {
865
- any: [/1/i, /2/i, /3/i, /4/i]
866
- };
867
- var matchMonthPatterns = {
868
- narrow: /^[jfmasond]/i,
869
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
870
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
871
- };
872
- var parseMonthPatterns = {
873
- narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
874
- any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
875
- };
876
- var matchDayPatterns = {
877
- narrow: /^[smtwf]/i,
878
- short: /^(su|mo|tu|we|th|fr|sa)/i,
879
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
880
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
881
- };
882
- var parseDayPatterns = {
883
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
884
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
885
- };
886
- var matchDayPeriodPatterns = {
887
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
888
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
889
- };
890
- var parseDayPeriodPatterns = {
891
- any: {
892
- am: /^a/i,
893
- pm: /^p/i,
894
- midnight: /^mi/i,
895
- noon: /^no/i,
896
- morning: /morning/i,
897
- afternoon: /afternoon/i,
898
- evening: /evening/i,
899
- night: /night/i
900
- }
901
- };
902
- var match = {
903
- ordinalNumber: buildMatchPatternFn({
904
- matchPattern: matchOrdinalNumberPattern,
905
- parsePattern: parseOrdinalNumberPattern,
906
- valueCallback: function valueCallback(value) {
907
- return parseInt(value, 10);
908
- }
909
- }),
910
- era: buildMatchFn({
911
- matchPatterns: matchEraPatterns,
912
- defaultMatchWidth: 'wide',
913
- parsePatterns: parseEraPatterns,
914
- defaultParseWidth: 'any'
915
- }),
916
- quarter: buildMatchFn({
917
- matchPatterns: matchQuarterPatterns,
918
- defaultMatchWidth: 'wide',
919
- parsePatterns: parseQuarterPatterns,
920
- defaultParseWidth: 'any',
921
- valueCallback: function valueCallback(index) {
922
- return index + 1;
923
- }
924
- }),
925
- month: buildMatchFn({
926
- matchPatterns: matchMonthPatterns,
927
- defaultMatchWidth: 'wide',
928
- parsePatterns: parseMonthPatterns,
929
- defaultParseWidth: 'any'
930
- }),
931
- day: buildMatchFn({
932
- matchPatterns: matchDayPatterns,
933
- defaultMatchWidth: 'wide',
934
- parsePatterns: parseDayPatterns,
935
- defaultParseWidth: 'any'
936
- }),
937
- dayPeriod: buildMatchFn({
938
- matchPatterns: matchDayPeriodPatterns,
939
- defaultMatchWidth: 'any',
940
- parsePatterns: parseDayPeriodPatterns,
941
- defaultParseWidth: 'any'
942
- })
943
- };
944
-
945
- /**
946
- * @type {Locale}
947
- * @category Locales
948
- * @summary English locale (United States).
949
- * @language English
950
- * @iso-639-2 eng
951
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
952
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
953
- */
954
- var locale = {
955
- code: 'en-US',
956
- formatDistance: formatDistance,
957
- formatLong: formatLong,
958
- formatRelative: formatRelative,
959
- localize: localize,
960
- match: match,
961
- options: {
962
- weekStartsOn: 0
963
- /* Sunday */
964
- ,
965
- firstWeekContainsDate: 1
966
- }
967
- };
968
-
969
- function assign(target, object) {
970
- if (target == null) {
971
- throw new TypeError('assign requires that input parameter not be null or undefined');
972
- }
973
-
974
- for (var property in object) {
975
- if (Object.prototype.hasOwnProperty.call(object, property)) {
976
- target[property] = object[property];
977
- }
978
- }
979
-
980
- return target;
981
- }
982
-
983
- function cloneObject(object) {
984
- return assign({}, object);
985
- }
986
-
987
- var MILLISECONDS_IN_MINUTE = 1000 * 60;
988
- var MINUTES_IN_DAY = 60 * 24;
989
- var MINUTES_IN_MONTH = MINUTES_IN_DAY * 30;
990
- var MINUTES_IN_YEAR = MINUTES_IN_DAY * 365;
991
- /**
992
- * @name formatDistanceStrict
993
- * @category Common Helpers
994
- * @summary Return the distance between the given dates in words.
995
- *
996
- * @description
997
- * Return the distance between the given dates in words, using strict units.
998
- * This is like `formatDistance`, but does not use helpers like 'almost', 'over',
999
- * 'less than' and the like.
1000
- *
1001
- * | Distance between dates | Result |
1002
- * |------------------------|---------------------|
1003
- * | 0 ... 59 secs | [0..59] seconds |
1004
- * | 1 ... 59 mins | [1..59] minutes |
1005
- * | 1 ... 23 hrs | [1..23] hours |
1006
- * | 1 ... 29 days | [1..29] days |
1007
- * | 1 ... 11 months | [1..11] months |
1008
- * | 1 ... N years | [1..N] years |
1009
- *
1010
- * @param {Date|Number} date - the date
1011
- * @param {Date|Number} baseDate - the date to compare with
1012
- * @param {Object} [options] - an object with options.
1013
- * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
1014
- * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit
1015
- * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units
1016
- * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
1017
- * @returns {String} the distance in words
1018
- * @throws {TypeError} 2 arguments required
1019
- * @throws {RangeError} `date` must not be Invalid Date
1020
- * @throws {RangeError} `baseDate` must not be Invalid Date
1021
- * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'
1022
- * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'
1023
- * @throws {RangeError} `options.locale` must contain `formatDistance` property
1024
- *
1025
- * @example
1026
- * // What is the distance between 2 July 2014 and 1 January 2015?
1027
- * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))
1028
- * //=> '6 months'
1029
- *
1030
- * @example
1031
- * // What is the distance between 1 January 2015 00:00:15
1032
- * // and 1 January 2015 00:00:00?
1033
- * const result = formatDistanceStrict(
1034
- * new Date(2015, 0, 1, 0, 0, 15),
1035
- * new Date(2015, 0, 1, 0, 0, 0)
1036
- * )
1037
- * //=> '15 seconds'
1038
- *
1039
- * @example
1040
- * // What is the distance from 1 January 2016
1041
- * // to 1 January 2015, with a suffix?
1042
- * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {
1043
- * addSuffix: true
1044
- * })
1045
- * //=> '1 year ago'
1046
- *
1047
- * @example
1048
- * // What is the distance from 1 January 2016
1049
- * // to 1 January 2015, in minutes?
1050
- * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {
1051
- * unit: 'minute'
1052
- * })
1053
- * //=> '525600 minutes'
1054
- *
1055
- * @example
1056
- * // What is the distance from 1 January 2015
1057
- * // to 28 January 2015, in months, rounded up?
1058
- * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {
1059
- * unit: 'month',
1060
- * roundingMethod: 'ceil'
1061
- * })
1062
- * //=> '1 month'
1063
- *
1064
- * @example
1065
- * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
1066
- * import { eoLocale } from 'date-fns/locale/eo'
1067
- * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {
1068
- * locale: eoLocale
1069
- * })
1070
- * //=> '1 jaro'
1071
- */
1072
-
1073
- function formatDistanceStrict(dirtyDate, dirtyBaseDate, options) {
1074
- var _ref, _options$locale, _options$roundingMeth;
1075
-
1076
- requiredArgs(2, arguments);
1077
- var defaultOptions = getDefaultOptions();
1078
- var locale$1 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : locale;
1079
-
1080
- if (!locale$1.formatDistance) {
1081
- throw new RangeError('locale must contain localize.formatDistance property');
1082
- }
1083
-
1084
- var comparison = compareAsc(dirtyDate, dirtyBaseDate);
1085
-
1086
- if (isNaN(comparison)) {
1087
- throw new RangeError('Invalid time value');
1088
- }
1089
-
1090
- var localizeOptions = assign(cloneObject(options), {
1091
- addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix),
1092
- comparison: comparison
1093
- });
1094
- var dateLeft;
1095
- var dateRight;
1096
-
1097
- if (comparison > 0) {
1098
- dateLeft = toDate(dirtyBaseDate);
1099
- dateRight = toDate(dirtyDate);
1100
- } else {
1101
- dateLeft = toDate(dirtyDate);
1102
- dateRight = toDate(dirtyBaseDate);
1103
- }
1104
-
1105
- var roundingMethod = String((_options$roundingMeth = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth !== void 0 ? _options$roundingMeth : 'round');
1106
- var roundingMethodFn;
1107
-
1108
- if (roundingMethod === 'floor') {
1109
- roundingMethodFn = Math.floor;
1110
- } else if (roundingMethod === 'ceil') {
1111
- roundingMethodFn = Math.ceil;
1112
- } else if (roundingMethod === 'round') {
1113
- roundingMethodFn = Math.round;
1114
- } else {
1115
- throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");
1116
- }
1117
-
1118
- var milliseconds = dateRight.getTime() - dateLeft.getTime();
1119
- var minutes = milliseconds / MILLISECONDS_IN_MINUTE;
1120
- var timezoneOffset = getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft); // Use DST-normalized difference in minutes for years, months and days;
1121
- // use regular difference in minutes for hours, minutes and seconds.
1122
-
1123
- var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE;
1124
- var defaultUnit = options === null || options === void 0 ? void 0 : options.unit;
1125
- var unit;
1126
-
1127
- if (!defaultUnit) {
1128
- if (minutes < 1) {
1129
- unit = 'second';
1130
- } else if (minutes < 60) {
1131
- unit = 'minute';
1132
- } else if (minutes < MINUTES_IN_DAY) {
1133
- unit = 'hour';
1134
- } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) {
1135
- unit = 'day';
1136
- } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) {
1137
- unit = 'month';
1138
- } else {
1139
- unit = 'year';
1140
- }
1141
- } else {
1142
- unit = String(defaultUnit);
1143
- } // 0 up to 60 seconds
1144
-
1145
-
1146
- if (unit === 'second') {
1147
- var seconds = roundingMethodFn(milliseconds / 1000);
1148
- return locale$1.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins
1149
- } else if (unit === 'minute') {
1150
- var roundedMinutes = roundingMethodFn(minutes);
1151
- return locale$1.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours
1152
- } else if (unit === 'hour') {
1153
- var hours = roundingMethodFn(minutes / 60);
1154
- return locale$1.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days
1155
- } else if (unit === 'day') {
1156
- var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY);
1157
- return locale$1.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months
1158
- } else if (unit === 'month') {
1159
- var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH);
1160
- return months === 12 && defaultUnit !== 'month' ? locale$1.formatDistance('xYears', 1, localizeOptions) : locale$1.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date
1161
- } else if (unit === 'year') {
1162
- var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR);
1163
- return locale$1.formatDistance('xYears', years, localizeOptions);
1164
- }
1165
-
1166
- throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'");
1167
- }
1168
-
1169
- function _typeof$v(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$v = function _typeof(obj) { return typeof obj; }; } else { _typeof$v = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$v(obj); }
1170
-
1171
- function _inherits$v(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$v(subClass, superClass); }
1172
-
1173
- function _setPrototypeOf$v(o, p) { _setPrototypeOf$v = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$v(o, p); }
1174
-
1175
- function _createSuper$v(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$v(); return function _createSuperInternal() { var Super = _getPrototypeOf$v(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$v(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$v(this, result); }; }
1176
-
1177
- function _possibleConstructorReturn$v(self, call) { if (call && (_typeof$v(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$v(self); }
1178
-
1179
- function _assertThisInitialized$v(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1180
-
1181
- function _isNativeReflectConstruct$v() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1182
-
1183
- function _getPrototypeOf$v(o) { _getPrototypeOf$v = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$v(o); }
1184
-
1185
- function _classCallCheck$w(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1186
-
1187
- function _defineProperties$w(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1188
-
1189
- function _createClass$w(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$w(Constructor.prototype, protoProps); if (staticProps) _defineProperties$w(Constructor, staticProps); return Constructor; }
1190
-
1191
- function _defineProperty$v(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1192
- var Setter = /*#__PURE__*/function () {
1193
- function Setter() {
1194
- _classCallCheck$w(this, Setter);
1195
-
1196
- _defineProperty$v(this, "subPriority", 0);
1197
- }
1198
-
1199
- _createClass$w(Setter, [{
1200
- key: "validate",
1201
- value: function validate(_utcDate, _options) {
1202
- return true;
1203
- }
1204
- }]);
1205
-
1206
- return Setter;
1207
- }();
1208
- var ValueSetter = /*#__PURE__*/function (_Setter) {
1209
- _inherits$v(ValueSetter, _Setter);
1210
-
1211
- var _super = _createSuper$v(ValueSetter);
1212
-
1213
- function ValueSetter(value, validateValue, setValue, priority, subPriority) {
1214
- var _this;
1215
-
1216
- _classCallCheck$w(this, ValueSetter);
1217
-
1218
- _this = _super.call(this);
1219
- _this.value = value;
1220
- _this.validateValue = validateValue;
1221
- _this.setValue = setValue;
1222
- _this.priority = priority;
1223
-
1224
- if (subPriority) {
1225
- _this.subPriority = subPriority;
1226
- }
1227
-
1228
- return _this;
1229
- }
1230
-
1231
- _createClass$w(ValueSetter, [{
1232
- key: "validate",
1233
- value: function validate(utcDate, options) {
1234
- return this.validateValue(utcDate, this.value, options);
1235
- }
1236
- }, {
1237
- key: "set",
1238
- value: function set(utcDate, flags, options) {
1239
- return this.setValue(utcDate, flags, this.value, options);
1240
- }
1241
- }]);
1242
-
1243
- return ValueSetter;
1244
- }(Setter);
1245
-
1246
- function _classCallCheck$v(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1247
-
1248
- function _defineProperties$v(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1249
-
1250
- function _createClass$v(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$v(Constructor.prototype, protoProps); if (staticProps) _defineProperties$v(Constructor, staticProps); return Constructor; }
1251
- var Parser = /*#__PURE__*/function () {
1252
- function Parser() {
1253
- _classCallCheck$v(this, Parser);
1254
- }
1255
-
1256
- _createClass$v(Parser, [{
1257
- key: "run",
1258
- value: function run(dateString, token, match, options) {
1259
- var result = this.parse(dateString, token, match, options);
1260
-
1261
- if (!result) {
1262
- return null;
1263
- }
1264
-
1265
- return {
1266
- setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
1267
- rest: result.rest
1268
- };
1269
- }
1270
- }, {
1271
- key: "validate",
1272
- value: function validate(_utcDate, _value, _options) {
1273
- return true;
1274
- }
1275
- }]);
1276
-
1277
- return Parser;
1278
- }();
1279
-
1280
- function _typeof$u(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$u = function _typeof(obj) { return typeof obj; }; } else { _typeof$u = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$u(obj); }
1281
-
1282
- function _classCallCheck$u(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1283
-
1284
- function _defineProperties$u(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1285
-
1286
- function _createClass$u(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$u(Constructor.prototype, protoProps); if (staticProps) _defineProperties$u(Constructor, staticProps); return Constructor; }
1287
-
1288
- function _inherits$u(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$u(subClass, superClass); }
1289
-
1290
- function _setPrototypeOf$u(o, p) { _setPrototypeOf$u = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$u(o, p); }
1291
-
1292
- function _createSuper$u(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$u(); return function _createSuperInternal() { var Super = _getPrototypeOf$u(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$u(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$u(this, result); }; }
1293
-
1294
- function _possibleConstructorReturn$u(self, call) { if (call && (_typeof$u(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$u(self); }
1295
-
1296
- function _assertThisInitialized$u(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1297
-
1298
- function _isNativeReflectConstruct$u() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1299
-
1300
- function _getPrototypeOf$u(o) { _getPrototypeOf$u = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$u(o); }
1301
-
1302
- function _defineProperty$u(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1303
- var EraParser = /*#__PURE__*/function (_Parser) {
1304
- _inherits$u(EraParser, _Parser);
1305
-
1306
- var _super = _createSuper$u(EraParser);
1307
-
1308
- function EraParser() {
1309
- var _this;
1310
-
1311
- _classCallCheck$u(this, EraParser);
1312
-
1313
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1314
- args[_key] = arguments[_key];
1315
- }
1316
-
1317
- _this = _super.call.apply(_super, [this].concat(args));
1318
-
1319
- _defineProperty$u(_assertThisInitialized$u(_this), "priority", 140);
1320
-
1321
- _defineProperty$u(_assertThisInitialized$u(_this), "incompatibleTokens", ['R', 'u', 't', 'T']);
1322
-
1323
- return _this;
1324
- }
1325
-
1326
- _createClass$u(EraParser, [{
1327
- key: "parse",
1328
- value: function parse(dateString, token, match) {
1329
- switch (token) {
1330
- // AD, BC
1331
- case 'G':
1332
- case 'GG':
1333
- case 'GGG':
1334
- return match.era(dateString, {
1335
- width: 'abbreviated'
1336
- }) || match.era(dateString, {
1337
- width: 'narrow'
1338
- });
1339
- // A, B
1340
-
1341
- case 'GGGGG':
1342
- return match.era(dateString, {
1343
- width: 'narrow'
1344
- });
1345
- // Anno Domini, Before Christ
1346
-
1347
- case 'GGGG':
1348
- default:
1349
- return match.era(dateString, {
1350
- width: 'wide'
1351
- }) || match.era(dateString, {
1352
- width: 'abbreviated'
1353
- }) || match.era(dateString, {
1354
- width: 'narrow'
1355
- });
1356
- }
1357
- }
1358
- }, {
1359
- key: "set",
1360
- value: function set(date, flags, value) {
1361
- flags.era = value;
1362
- date.setUTCFullYear(value, 0, 1);
1363
- date.setUTCHours(0, 0, 0, 0);
1364
- return date;
1365
- }
1366
- }]);
1367
-
1368
- return EraParser;
1369
- }(Parser);
1370
-
1371
- var numericPatterns = {
1372
- month: /^(1[0-2]|0?\d)/,
1373
- // 0 to 12
1374
- date: /^(3[0-1]|[0-2]?\d)/,
1375
- // 0 to 31
1376
- dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
1377
- // 0 to 366
1378
- week: /^(5[0-3]|[0-4]?\d)/,
1379
- // 0 to 53
1380
- hour23h: /^(2[0-3]|[0-1]?\d)/,
1381
- // 0 to 23
1382
- hour24h: /^(2[0-4]|[0-1]?\d)/,
1383
- // 0 to 24
1384
- hour11h: /^(1[0-1]|0?\d)/,
1385
- // 0 to 11
1386
- hour12h: /^(1[0-2]|0?\d)/,
1387
- // 0 to 12
1388
- minute: /^[0-5]?\d/,
1389
- // 0 to 59
1390
- second: /^[0-5]?\d/,
1391
- // 0 to 59
1392
- singleDigit: /^\d/,
1393
- // 0 to 9
1394
- twoDigits: /^\d{1,2}/,
1395
- // 0 to 99
1396
- threeDigits: /^\d{1,3}/,
1397
- // 0 to 999
1398
- fourDigits: /^\d{1,4}/,
1399
- // 0 to 9999
1400
- anyDigitsSigned: /^-?\d+/,
1401
- singleDigitSigned: /^-?\d/,
1402
- // 0 to 9, -0 to -9
1403
- twoDigitsSigned: /^-?\d{1,2}/,
1404
- // 0 to 99, -0 to -99
1405
- threeDigitsSigned: /^-?\d{1,3}/,
1406
- // 0 to 999, -0 to -999
1407
- fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
1408
-
1409
- };
1410
- var timezonePatterns = {
1411
- basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
1412
- basic: /^([+-])(\d{2})(\d{2})|Z/,
1413
- basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
1414
- extended: /^([+-])(\d{2}):(\d{2})|Z/,
1415
- extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
1416
- };
1417
-
1418
- function mapValue(parseFnResult, mapFn) {
1419
- if (!parseFnResult) {
1420
- return parseFnResult;
1421
- }
1422
-
1423
- return {
1424
- value: mapFn(parseFnResult.value),
1425
- rest: parseFnResult.rest
1426
- };
1427
- }
1428
- function parseNumericPattern(pattern, dateString) {
1429
- var matchResult = dateString.match(pattern);
1430
-
1431
- if (!matchResult) {
1432
- return null;
1433
- }
1434
-
1435
- return {
1436
- value: parseInt(matchResult[0], 10),
1437
- rest: dateString.slice(matchResult[0].length)
1438
- };
1439
- }
1440
- function parseTimezonePattern(pattern, dateString) {
1441
- var matchResult = dateString.match(pattern);
1442
-
1443
- if (!matchResult) {
1444
- return null;
1445
- } // Input is 'Z'
1446
-
1447
-
1448
- if (matchResult[0] === 'Z') {
1449
- return {
1450
- value: 0,
1451
- rest: dateString.slice(1)
1452
- };
1453
- }
1454
-
1455
- var sign = matchResult[1] === '+' ? 1 : -1;
1456
- var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
1457
- var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
1458
- var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
1459
- return {
1460
- value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
1461
- rest: dateString.slice(matchResult[0].length)
1462
- };
1463
- }
1464
- function parseAnyDigitsSigned(dateString) {
1465
- return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
1466
- }
1467
- function parseNDigits(n, dateString) {
1468
- switch (n) {
1469
- case 1:
1470
- return parseNumericPattern(numericPatterns.singleDigit, dateString);
1471
-
1472
- case 2:
1473
- return parseNumericPattern(numericPatterns.twoDigits, dateString);
1474
-
1475
- case 3:
1476
- return parseNumericPattern(numericPatterns.threeDigits, dateString);
1477
-
1478
- case 4:
1479
- return parseNumericPattern(numericPatterns.fourDigits, dateString);
1480
-
1481
- default:
1482
- return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), dateString);
1483
- }
1484
- }
1485
- function parseNDigitsSigned(n, dateString) {
1486
- switch (n) {
1487
- case 1:
1488
- return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
1489
-
1490
- case 2:
1491
- return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
1492
-
1493
- case 3:
1494
- return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
1495
-
1496
- case 4:
1497
- return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
1498
-
1499
- default:
1500
- return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), dateString);
1501
- }
1502
- }
1503
- function dayPeriodEnumToHours(dayPeriod) {
1504
- switch (dayPeriod) {
1505
- case 'morning':
1506
- return 4;
1507
-
1508
- case 'evening':
1509
- return 17;
1510
-
1511
- case 'pm':
1512
- case 'noon':
1513
- case 'afternoon':
1514
- return 12;
1515
-
1516
- case 'am':
1517
- case 'midnight':
1518
- case 'night':
1519
- default:
1520
- return 0;
1521
- }
1522
- }
1523
- function normalizeTwoDigitYear(twoDigitYear, currentYear) {
1524
- var isCommonEra = currentYear > 0; // Absolute number of the current year:
1525
- // 1 -> 1 AC
1526
- // 0 -> 1 BC
1527
- // -1 -> 2 BC
1528
-
1529
- var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
1530
- var result;
1531
-
1532
- if (absCurrentYear <= 50) {
1533
- result = twoDigitYear || 100;
1534
- } else {
1535
- var rangeEnd = absCurrentYear + 50;
1536
- var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
1537
- var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
1538
- result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
1539
- }
1540
-
1541
- return isCommonEra ? result : 1 - result;
1542
- }
1543
- function isLeapYearIndex(year) {
1544
- return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
1545
- }
1546
-
1547
- function _typeof$t(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$t = function _typeof(obj) { return typeof obj; }; } else { _typeof$t = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$t(obj); }
1548
-
1549
- function _classCallCheck$t(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1550
-
1551
- function _defineProperties$t(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1552
-
1553
- function _createClass$t(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$t(Constructor.prototype, protoProps); if (staticProps) _defineProperties$t(Constructor, staticProps); return Constructor; }
1554
-
1555
- function _inherits$t(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$t(subClass, superClass); }
1556
-
1557
- function _setPrototypeOf$t(o, p) { _setPrototypeOf$t = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$t(o, p); }
1558
-
1559
- function _createSuper$t(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$t(); return function _createSuperInternal() { var Super = _getPrototypeOf$t(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$t(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$t(this, result); }; }
1560
-
1561
- function _possibleConstructorReturn$t(self, call) { if (call && (_typeof$t(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$t(self); }
1562
-
1563
- function _assertThisInitialized$t(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1564
-
1565
- function _isNativeReflectConstruct$t() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1566
-
1567
- function _getPrototypeOf$t(o) { _getPrototypeOf$t = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$t(o); }
1568
-
1569
- function _defineProperty$t(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1570
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
1571
- // | Year | y | yy | yyy | yyyy | yyyyy |
1572
- // |----------|-------|----|-------|-------|-------|
1573
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
1574
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
1575
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
1576
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
1577
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
1578
- var YearParser = /*#__PURE__*/function (_Parser) {
1579
- _inherits$t(YearParser, _Parser);
1580
-
1581
- var _super = _createSuper$t(YearParser);
1582
-
1583
- function YearParser() {
1584
- var _this;
1585
-
1586
- _classCallCheck$t(this, YearParser);
1587
-
1588
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1589
- args[_key] = arguments[_key];
1590
- }
1591
-
1592
- _this = _super.call.apply(_super, [this].concat(args));
1593
-
1594
- _defineProperty$t(_assertThisInitialized$t(_this), "priority", 130);
1595
-
1596
- _defineProperty$t(_assertThisInitialized$t(_this), "incompatibleTokens", ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
1597
-
1598
- return _this;
1599
- }
1600
-
1601
- _createClass$t(YearParser, [{
1602
- key: "parse",
1603
- value: function parse(dateString, token, match) {
1604
- var valueCallback = function valueCallback(year) {
1605
- return {
1606
- year: year,
1607
- isTwoDigitYear: token === 'yy'
1608
- };
1609
- };
1610
-
1611
- switch (token) {
1612
- case 'y':
1613
- return mapValue(parseNDigits(4, dateString), valueCallback);
1614
-
1615
- case 'yo':
1616
- return mapValue(match.ordinalNumber(dateString, {
1617
- unit: 'year'
1618
- }), valueCallback);
1619
-
1620
- default:
1621
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
1622
- }
1623
- }
1624
- }, {
1625
- key: "validate",
1626
- value: function validate(_date, value) {
1627
- return value.isTwoDigitYear || value.year > 0;
1628
- }
1629
- }, {
1630
- key: "set",
1631
- value: function set(date, flags, value) {
1632
- var currentYear = date.getUTCFullYear();
1633
-
1634
- if (value.isTwoDigitYear) {
1635
- var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
1636
- date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
1637
- date.setUTCHours(0, 0, 0, 0);
1638
- return date;
1639
- }
1640
-
1641
- var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
1642
- date.setUTCFullYear(year, 0, 1);
1643
- date.setUTCHours(0, 0, 0, 0);
1644
- return date;
1645
- }
1646
- }]);
1647
-
1648
- return YearParser;
1649
- }(Parser);
1650
-
1651
- function _typeof$s(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$s = function _typeof(obj) { return typeof obj; }; } else { _typeof$s = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$s(obj); }
1652
-
1653
- function _classCallCheck$s(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1654
-
1655
- function _defineProperties$s(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1656
-
1657
- function _createClass$s(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$s(Constructor.prototype, protoProps); if (staticProps) _defineProperties$s(Constructor, staticProps); return Constructor; }
1658
-
1659
- function _inherits$s(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$s(subClass, superClass); }
1660
-
1661
- function _setPrototypeOf$s(o, p) { _setPrototypeOf$s = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$s(o, p); }
1662
-
1663
- function _createSuper$s(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$s(); return function _createSuperInternal() { var Super = _getPrototypeOf$s(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$s(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$s(this, result); }; }
1664
-
1665
- function _possibleConstructorReturn$s(self, call) { if (call && (_typeof$s(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$s(self); }
1666
-
1667
- function _assertThisInitialized$s(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1668
-
1669
- function _isNativeReflectConstruct$s() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1670
-
1671
- function _getPrototypeOf$s(o) { _getPrototypeOf$s = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$s(o); }
1672
-
1673
- function _defineProperty$s(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1674
- // Local week-numbering year
1675
- var LocalWeekYearParser = /*#__PURE__*/function (_Parser) {
1676
- _inherits$s(LocalWeekYearParser, _Parser);
1677
-
1678
- var _super = _createSuper$s(LocalWeekYearParser);
1679
-
1680
- function LocalWeekYearParser() {
1681
- var _this;
1682
-
1683
- _classCallCheck$s(this, LocalWeekYearParser);
1684
-
1685
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1686
- args[_key] = arguments[_key];
1687
- }
1688
-
1689
- _this = _super.call.apply(_super, [this].concat(args));
1690
-
1691
- _defineProperty$s(_assertThisInitialized$s(_this), "priority", 130);
1692
-
1693
- _defineProperty$s(_assertThisInitialized$s(_this), "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
1694
-
1695
- return _this;
1696
- }
1697
-
1698
- _createClass$s(LocalWeekYearParser, [{
1699
- key: "parse",
1700
- value: function parse(dateString, token, match) {
1701
- var valueCallback = function valueCallback(year) {
1702
- return {
1703
- year: year,
1704
- isTwoDigitYear: token === 'YY'
1705
- };
1706
- };
1707
-
1708
- switch (token) {
1709
- case 'Y':
1710
- return mapValue(parseNDigits(4, dateString), valueCallback);
1711
-
1712
- case 'Yo':
1713
- return mapValue(match.ordinalNumber(dateString, {
1714
- unit: 'year'
1715
- }), valueCallback);
1716
-
1717
- default:
1718
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
1719
- }
1720
- }
1721
- }, {
1722
- key: "validate",
1723
- value: function validate(_date, value) {
1724
- return value.isTwoDigitYear || value.year > 0;
1725
- }
1726
- }, {
1727
- key: "set",
1728
- value: function set(date, flags, value, options) {
1729
- var currentYear = getUTCWeekYear(date, options);
1730
-
1731
- if (value.isTwoDigitYear) {
1732
- var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
1733
- date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
1734
- date.setUTCHours(0, 0, 0, 0);
1735
- return startOfUTCWeek(date, options);
1736
- }
1737
-
1738
- var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
1739
- date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
1740
- date.setUTCHours(0, 0, 0, 0);
1741
- return startOfUTCWeek(date, options);
1742
- }
1743
- }]);
1744
-
1745
- return LocalWeekYearParser;
1746
- }(Parser);
1747
-
1748
- function _typeof$r(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$r = function _typeof(obj) { return typeof obj; }; } else { _typeof$r = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$r(obj); }
1749
-
1750
- function _classCallCheck$r(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1751
-
1752
- function _defineProperties$r(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1753
-
1754
- function _createClass$r(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$r(Constructor.prototype, protoProps); if (staticProps) _defineProperties$r(Constructor, staticProps); return Constructor; }
1755
-
1756
- function _inherits$r(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$r(subClass, superClass); }
1757
-
1758
- function _setPrototypeOf$r(o, p) { _setPrototypeOf$r = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$r(o, p); }
1759
-
1760
- function _createSuper$r(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$r(); return function _createSuperInternal() { var Super = _getPrototypeOf$r(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$r(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$r(this, result); }; }
1761
-
1762
- function _possibleConstructorReturn$r(self, call) { if (call && (_typeof$r(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$r(self); }
1763
-
1764
- function _assertThisInitialized$r(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1765
-
1766
- function _isNativeReflectConstruct$r() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1767
-
1768
- function _getPrototypeOf$r(o) { _getPrototypeOf$r = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$r(o); }
1769
-
1770
- function _defineProperty$r(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1771
-
1772
- var ISOWeekYearParser = /*#__PURE__*/function (_Parser) {
1773
- _inherits$r(ISOWeekYearParser, _Parser);
1774
-
1775
- var _super = _createSuper$r(ISOWeekYearParser);
1776
-
1777
- function ISOWeekYearParser() {
1778
- var _this;
1779
-
1780
- _classCallCheck$r(this, ISOWeekYearParser);
1781
-
1782
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1783
- args[_key] = arguments[_key];
1784
- }
1785
-
1786
- _this = _super.call.apply(_super, [this].concat(args));
1787
-
1788
- _defineProperty$r(_assertThisInitialized$r(_this), "priority", 130);
1789
-
1790
- _defineProperty$r(_assertThisInitialized$r(_this), "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
1791
-
1792
- return _this;
1793
- }
1794
-
1795
- _createClass$r(ISOWeekYearParser, [{
1796
- key: "parse",
1797
- value: function parse(dateString, token) {
1798
- if (token === 'R') {
1799
- return parseNDigitsSigned(4, dateString);
1800
- }
1801
-
1802
- return parseNDigitsSigned(token.length, dateString);
1803
- }
1804
- }, {
1805
- key: "set",
1806
- value: function set(_date, _flags, value) {
1807
- var firstWeekOfYear = new Date(0);
1808
- firstWeekOfYear.setUTCFullYear(value, 0, 4);
1809
- firstWeekOfYear.setUTCHours(0, 0, 0, 0);
1810
- return startOfUTCISOWeek(firstWeekOfYear);
1811
- }
1812
- }]);
1813
-
1814
- return ISOWeekYearParser;
1815
- }(Parser);
1816
-
1817
- function _typeof$q(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$q = function _typeof(obj) { return typeof obj; }; } else { _typeof$q = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$q(obj); }
1818
-
1819
- function _classCallCheck$q(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1820
-
1821
- function _defineProperties$q(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1822
-
1823
- function _createClass$q(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$q(Constructor.prototype, protoProps); if (staticProps) _defineProperties$q(Constructor, staticProps); return Constructor; }
1824
-
1825
- function _inherits$q(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$q(subClass, superClass); }
1826
-
1827
- function _setPrototypeOf$q(o, p) { _setPrototypeOf$q = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$q(o, p); }
1828
-
1829
- function _createSuper$q(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$q(); return function _createSuperInternal() { var Super = _getPrototypeOf$q(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$q(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$q(this, result); }; }
1830
-
1831
- function _possibleConstructorReturn$q(self, call) { if (call && (_typeof$q(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$q(self); }
1832
-
1833
- function _assertThisInitialized$q(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1834
-
1835
- function _isNativeReflectConstruct$q() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1836
-
1837
- function _getPrototypeOf$q(o) { _getPrototypeOf$q = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$q(o); }
1838
-
1839
- function _defineProperty$q(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1840
- var ExtendedYearParser = /*#__PURE__*/function (_Parser) {
1841
- _inherits$q(ExtendedYearParser, _Parser);
1842
-
1843
- var _super = _createSuper$q(ExtendedYearParser);
1844
-
1845
- function ExtendedYearParser() {
1846
- var _this;
1847
-
1848
- _classCallCheck$q(this, ExtendedYearParser);
1849
-
1850
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1851
- args[_key] = arguments[_key];
1852
- }
1853
-
1854
- _this = _super.call.apply(_super, [this].concat(args));
1855
-
1856
- _defineProperty$q(_assertThisInitialized$q(_this), "priority", 130);
1857
-
1858
- _defineProperty$q(_assertThisInitialized$q(_this), "incompatibleTokens", ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
1859
-
1860
- return _this;
1861
- }
1862
-
1863
- _createClass$q(ExtendedYearParser, [{
1864
- key: "parse",
1865
- value: function parse(dateString, token) {
1866
- if (token === 'u') {
1867
- return parseNDigitsSigned(4, dateString);
1868
- }
1869
-
1870
- return parseNDigitsSigned(token.length, dateString);
1871
- }
1872
- }, {
1873
- key: "set",
1874
- value: function set(date, _flags, value) {
1875
- date.setUTCFullYear(value, 0, 1);
1876
- date.setUTCHours(0, 0, 0, 0);
1877
- return date;
1878
- }
1879
- }]);
1880
-
1881
- return ExtendedYearParser;
1882
- }(Parser);
1883
-
1884
- function _typeof$p(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$p = function _typeof(obj) { return typeof obj; }; } else { _typeof$p = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$p(obj); }
1885
-
1886
- function _classCallCheck$p(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1887
-
1888
- function _defineProperties$p(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1889
-
1890
- function _createClass$p(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$p(Constructor.prototype, protoProps); if (staticProps) _defineProperties$p(Constructor, staticProps); return Constructor; }
1891
-
1892
- function _inherits$p(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$p(subClass, superClass); }
1893
-
1894
- function _setPrototypeOf$p(o, p) { _setPrototypeOf$p = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$p(o, p); }
1895
-
1896
- function _createSuper$p(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$p(); return function _createSuperInternal() { var Super = _getPrototypeOf$p(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$p(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$p(this, result); }; }
1897
-
1898
- function _possibleConstructorReturn$p(self, call) { if (call && (_typeof$p(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$p(self); }
1899
-
1900
- function _assertThisInitialized$p(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1901
-
1902
- function _isNativeReflectConstruct$p() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1903
-
1904
- function _getPrototypeOf$p(o) { _getPrototypeOf$p = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$p(o); }
1905
-
1906
- function _defineProperty$p(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1907
- var QuarterParser = /*#__PURE__*/function (_Parser) {
1908
- _inherits$p(QuarterParser, _Parser);
1909
-
1910
- var _super = _createSuper$p(QuarterParser);
1911
-
1912
- function QuarterParser() {
1913
- var _this;
1914
-
1915
- _classCallCheck$p(this, QuarterParser);
1916
-
1917
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1918
- args[_key] = arguments[_key];
1919
- }
1920
-
1921
- _this = _super.call.apply(_super, [this].concat(args));
1922
-
1923
- _defineProperty$p(_assertThisInitialized$p(_this), "priority", 120);
1924
-
1925
- _defineProperty$p(_assertThisInitialized$p(_this), "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
1926
-
1927
- return _this;
1928
- }
1929
-
1930
- _createClass$p(QuarterParser, [{
1931
- key: "parse",
1932
- value: function parse(dateString, token, match) {
1933
- switch (token) {
1934
- // 1, 2, 3, 4
1935
- case 'Q':
1936
- case 'QQ':
1937
- // 01, 02, 03, 04
1938
- return parseNDigits(token.length, dateString);
1939
- // 1st, 2nd, 3rd, 4th
1940
-
1941
- case 'Qo':
1942
- return match.ordinalNumber(dateString, {
1943
- unit: 'quarter'
1944
- });
1945
- // Q1, Q2, Q3, Q4
1946
-
1947
- case 'QQQ':
1948
- return match.quarter(dateString, {
1949
- width: 'abbreviated',
1950
- context: 'formatting'
1951
- }) || match.quarter(dateString, {
1952
- width: 'narrow',
1953
- context: 'formatting'
1954
- });
1955
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1956
-
1957
- case 'QQQQQ':
1958
- return match.quarter(dateString, {
1959
- width: 'narrow',
1960
- context: 'formatting'
1961
- });
1962
- // 1st quarter, 2nd quarter, ...
1963
-
1964
- case 'QQQQ':
1965
- default:
1966
- return match.quarter(dateString, {
1967
- width: 'wide',
1968
- context: 'formatting'
1969
- }) || match.quarter(dateString, {
1970
- width: 'abbreviated',
1971
- context: 'formatting'
1972
- }) || match.quarter(dateString, {
1973
- width: 'narrow',
1974
- context: 'formatting'
1975
- });
1976
- }
1977
- }
1978
- }, {
1979
- key: "validate",
1980
- value: function validate(_date, value) {
1981
- return value >= 1 && value <= 4;
1982
- }
1983
- }, {
1984
- key: "set",
1985
- value: function set(date, _flags, value) {
1986
- date.setUTCMonth((value - 1) * 3, 1);
1987
- date.setUTCHours(0, 0, 0, 0);
1988
- return date;
1989
- }
1990
- }]);
1991
-
1992
- return QuarterParser;
1993
- }(Parser);
1994
-
1995
- function _typeof$o(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$o = function _typeof(obj) { return typeof obj; }; } else { _typeof$o = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$o(obj); }
1996
-
1997
- function _classCallCheck$o(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1998
-
1999
- function _defineProperties$o(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2000
-
2001
- function _createClass$o(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$o(Constructor.prototype, protoProps); if (staticProps) _defineProperties$o(Constructor, staticProps); return Constructor; }
2002
-
2003
- function _inherits$o(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$o(subClass, superClass); }
2004
-
2005
- function _setPrototypeOf$o(o, p) { _setPrototypeOf$o = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$o(o, p); }
2006
-
2007
- function _createSuper$o(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$o(); return function _createSuperInternal() { var Super = _getPrototypeOf$o(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$o(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$o(this, result); }; }
2008
-
2009
- function _possibleConstructorReturn$o(self, call) { if (call && (_typeof$o(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$o(self); }
2010
-
2011
- function _assertThisInitialized$o(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2012
-
2013
- function _isNativeReflectConstruct$o() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2014
-
2015
- function _getPrototypeOf$o(o) { _getPrototypeOf$o = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$o(o); }
2016
-
2017
- function _defineProperty$o(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2018
- var StandAloneQuarterParser = /*#__PURE__*/function (_Parser) {
2019
- _inherits$o(StandAloneQuarterParser, _Parser);
2020
-
2021
- var _super = _createSuper$o(StandAloneQuarterParser);
2022
-
2023
- function StandAloneQuarterParser() {
2024
- var _this;
2025
-
2026
- _classCallCheck$o(this, StandAloneQuarterParser);
2027
-
2028
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2029
- args[_key] = arguments[_key];
2030
- }
2031
-
2032
- _this = _super.call.apply(_super, [this].concat(args));
2033
-
2034
- _defineProperty$o(_assertThisInitialized$o(_this), "priority", 120);
2035
-
2036
- _defineProperty$o(_assertThisInitialized$o(_this), "incompatibleTokens", ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
2037
-
2038
- return _this;
2039
- }
2040
-
2041
- _createClass$o(StandAloneQuarterParser, [{
2042
- key: "parse",
2043
- value: function parse(dateString, token, match) {
2044
- switch (token) {
2045
- // 1, 2, 3, 4
2046
- case 'q':
2047
- case 'qq':
2048
- // 01, 02, 03, 04
2049
- return parseNDigits(token.length, dateString);
2050
- // 1st, 2nd, 3rd, 4th
2051
-
2052
- case 'qo':
2053
- return match.ordinalNumber(dateString, {
2054
- unit: 'quarter'
2055
- });
2056
- // Q1, Q2, Q3, Q4
2057
-
2058
- case 'qqq':
2059
- return match.quarter(dateString, {
2060
- width: 'abbreviated',
2061
- context: 'standalone'
2062
- }) || match.quarter(dateString, {
2063
- width: 'narrow',
2064
- context: 'standalone'
2065
- });
2066
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2067
-
2068
- case 'qqqqq':
2069
- return match.quarter(dateString, {
2070
- width: 'narrow',
2071
- context: 'standalone'
2072
- });
2073
- // 1st quarter, 2nd quarter, ...
2074
-
2075
- case 'qqqq':
2076
- default:
2077
- return match.quarter(dateString, {
2078
- width: 'wide',
2079
- context: 'standalone'
2080
- }) || match.quarter(dateString, {
2081
- width: 'abbreviated',
2082
- context: 'standalone'
2083
- }) || match.quarter(dateString, {
2084
- width: 'narrow',
2085
- context: 'standalone'
2086
- });
2087
- }
2088
- }
2089
- }, {
2090
- key: "validate",
2091
- value: function validate(_date, value) {
2092
- return value >= 1 && value <= 4;
2093
- }
2094
- }, {
2095
- key: "set",
2096
- value: function set(date, _flags, value) {
2097
- date.setUTCMonth((value - 1) * 3, 1);
2098
- date.setUTCHours(0, 0, 0, 0);
2099
- return date;
2100
- }
2101
- }]);
2102
-
2103
- return StandAloneQuarterParser;
2104
- }(Parser);
2105
-
2106
- function _typeof$n(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$n = function _typeof(obj) { return typeof obj; }; } else { _typeof$n = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$n(obj); }
2107
-
2108
- function _classCallCheck$n(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2109
-
2110
- function _defineProperties$n(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2111
-
2112
- function _createClass$n(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$n(Constructor.prototype, protoProps); if (staticProps) _defineProperties$n(Constructor, staticProps); return Constructor; }
2113
-
2114
- function _inherits$n(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$n(subClass, superClass); }
2115
-
2116
- function _setPrototypeOf$n(o, p) { _setPrototypeOf$n = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$n(o, p); }
2117
-
2118
- function _createSuper$n(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$n(); return function _createSuperInternal() { var Super = _getPrototypeOf$n(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$n(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$n(this, result); }; }
2119
-
2120
- function _possibleConstructorReturn$n(self, call) { if (call && (_typeof$n(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$n(self); }
2121
-
2122
- function _assertThisInitialized$n(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2123
-
2124
- function _isNativeReflectConstruct$n() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2125
-
2126
- function _getPrototypeOf$n(o) { _getPrototypeOf$n = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$n(o); }
2127
-
2128
- function _defineProperty$n(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2129
- var MonthParser = /*#__PURE__*/function (_Parser) {
2130
- _inherits$n(MonthParser, _Parser);
2131
-
2132
- var _super = _createSuper$n(MonthParser);
2133
-
2134
- function MonthParser() {
2135
- var _this;
2136
-
2137
- _classCallCheck$n(this, MonthParser);
2138
-
2139
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2140
- args[_key] = arguments[_key];
2141
- }
2142
-
2143
- _this = _super.call.apply(_super, [this].concat(args));
2144
-
2145
- _defineProperty$n(_assertThisInitialized$n(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
2146
-
2147
- _defineProperty$n(_assertThisInitialized$n(_this), "priority", 110);
2148
-
2149
- return _this;
2150
- }
2151
-
2152
- _createClass$n(MonthParser, [{
2153
- key: "parse",
2154
- value: function parse(dateString, token, match) {
2155
- var valueCallback = function valueCallback(value) {
2156
- return value - 1;
2157
- };
2158
-
2159
- switch (token) {
2160
- // 1, 2, ..., 12
2161
- case 'M':
2162
- return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
2163
- // 01, 02, ..., 12
2164
-
2165
- case 'MM':
2166
- return mapValue(parseNDigits(2, dateString), valueCallback);
2167
- // 1st, 2nd, ..., 12th
2168
-
2169
- case 'Mo':
2170
- return mapValue(match.ordinalNumber(dateString, {
2171
- unit: 'month'
2172
- }), valueCallback);
2173
- // Jan, Feb, ..., Dec
2174
-
2175
- case 'MMM':
2176
- return match.month(dateString, {
2177
- width: 'abbreviated',
2178
- context: 'formatting'
2179
- }) || match.month(dateString, {
2180
- width: 'narrow',
2181
- context: 'formatting'
2182
- });
2183
- // J, F, ..., D
2184
-
2185
- case 'MMMMM':
2186
- return match.month(dateString, {
2187
- width: 'narrow',
2188
- context: 'formatting'
2189
- });
2190
- // January, February, ..., December
2191
-
2192
- case 'MMMM':
2193
- default:
2194
- return match.month(dateString, {
2195
- width: 'wide',
2196
- context: 'formatting'
2197
- }) || match.month(dateString, {
2198
- width: 'abbreviated',
2199
- context: 'formatting'
2200
- }) || match.month(dateString, {
2201
- width: 'narrow',
2202
- context: 'formatting'
2203
- });
2204
- }
2205
- }
2206
- }, {
2207
- key: "validate",
2208
- value: function validate(_date, value) {
2209
- return value >= 0 && value <= 11;
2210
- }
2211
- }, {
2212
- key: "set",
2213
- value: function set(date, _flags, value) {
2214
- date.setUTCMonth(value, 1);
2215
- date.setUTCHours(0, 0, 0, 0);
2216
- return date;
2217
- }
2218
- }]);
2219
-
2220
- return MonthParser;
2221
- }(Parser);
2222
-
2223
- function _typeof$m(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$m = function _typeof(obj) { return typeof obj; }; } else { _typeof$m = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$m(obj); }
2224
-
2225
- function _classCallCheck$m(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2226
-
2227
- function _defineProperties$m(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2228
-
2229
- function _createClass$m(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$m(Constructor.prototype, protoProps); if (staticProps) _defineProperties$m(Constructor, staticProps); return Constructor; }
2230
-
2231
- function _inherits$m(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$m(subClass, superClass); }
2232
-
2233
- function _setPrototypeOf$m(o, p) { _setPrototypeOf$m = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$m(o, p); }
2234
-
2235
- function _createSuper$m(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$m(); return function _createSuperInternal() { var Super = _getPrototypeOf$m(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$m(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$m(this, result); }; }
2236
-
2237
- function _possibleConstructorReturn$m(self, call) { if (call && (_typeof$m(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$m(self); }
2238
-
2239
- function _assertThisInitialized$m(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2240
-
2241
- function _isNativeReflectConstruct$m() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2242
-
2243
- function _getPrototypeOf$m(o) { _getPrototypeOf$m = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$m(o); }
2244
-
2245
- function _defineProperty$m(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2246
- var StandAloneMonthParser = /*#__PURE__*/function (_Parser) {
2247
- _inherits$m(StandAloneMonthParser, _Parser);
2248
-
2249
- var _super = _createSuper$m(StandAloneMonthParser);
2250
-
2251
- function StandAloneMonthParser() {
2252
- var _this;
2253
-
2254
- _classCallCheck$m(this, StandAloneMonthParser);
2255
-
2256
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2257
- args[_key] = arguments[_key];
2258
- }
2259
-
2260
- _this = _super.call.apply(_super, [this].concat(args));
2261
-
2262
- _defineProperty$m(_assertThisInitialized$m(_this), "priority", 110);
2263
-
2264
- _defineProperty$m(_assertThisInitialized$m(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
2265
-
2266
- return _this;
2267
- }
2268
-
2269
- _createClass$m(StandAloneMonthParser, [{
2270
- key: "parse",
2271
- value: function parse(dateString, token, match) {
2272
- var valueCallback = function valueCallback(value) {
2273
- return value - 1;
2274
- };
2275
-
2276
- switch (token) {
2277
- // 1, 2, ..., 12
2278
- case 'L':
2279
- return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
2280
- // 01, 02, ..., 12
2281
-
2282
- case 'LL':
2283
- return mapValue(parseNDigits(2, dateString), valueCallback);
2284
- // 1st, 2nd, ..., 12th
2285
-
2286
- case 'Lo':
2287
- return mapValue(match.ordinalNumber(dateString, {
2288
- unit: 'month'
2289
- }), valueCallback);
2290
- // Jan, Feb, ..., Dec
2291
-
2292
- case 'LLL':
2293
- return match.month(dateString, {
2294
- width: 'abbreviated',
2295
- context: 'standalone'
2296
- }) || match.month(dateString, {
2297
- width: 'narrow',
2298
- context: 'standalone'
2299
- });
2300
- // J, F, ..., D
2301
-
2302
- case 'LLLLL':
2303
- return match.month(dateString, {
2304
- width: 'narrow',
2305
- context: 'standalone'
2306
- });
2307
- // January, February, ..., December
2308
-
2309
- case 'LLLL':
2310
- default:
2311
- return match.month(dateString, {
2312
- width: 'wide',
2313
- context: 'standalone'
2314
- }) || match.month(dateString, {
2315
- width: 'abbreviated',
2316
- context: 'standalone'
2317
- }) || match.month(dateString, {
2318
- width: 'narrow',
2319
- context: 'standalone'
2320
- });
2321
- }
2322
- }
2323
- }, {
2324
- key: "validate",
2325
- value: function validate(_date, value) {
2326
- return value >= 0 && value <= 11;
2327
- }
2328
- }, {
2329
- key: "set",
2330
- value: function set(date, _flags, value) {
2331
- date.setUTCMonth(value, 1);
2332
- date.setUTCHours(0, 0, 0, 0);
2333
- return date;
2334
- }
2335
- }]);
2336
-
2337
- return StandAloneMonthParser;
2338
- }(Parser);
2339
-
2340
- function setUTCWeek(dirtyDate, dirtyWeek, options) {
2341
- requiredArgs(2, arguments);
2342
- var date = toDate(dirtyDate);
2343
- var week = toInteger(dirtyWeek);
2344
- var diff = getUTCWeek(date, options) - week;
2345
- date.setUTCDate(date.getUTCDate() - diff * 7);
2346
- return date;
2347
- }
2348
-
2349
- function _typeof$l(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$l = function _typeof(obj) { return typeof obj; }; } else { _typeof$l = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$l(obj); }
2350
-
2351
- function _classCallCheck$l(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2352
-
2353
- function _defineProperties$l(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2354
-
2355
- function _createClass$l(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$l(Constructor.prototype, protoProps); if (staticProps) _defineProperties$l(Constructor, staticProps); return Constructor; }
2356
-
2357
- function _inherits$l(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$l(subClass, superClass); }
2358
-
2359
- function _setPrototypeOf$l(o, p) { _setPrototypeOf$l = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$l(o, p); }
2360
-
2361
- function _createSuper$l(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$l(); return function _createSuperInternal() { var Super = _getPrototypeOf$l(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$l(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$l(this, result); }; }
2362
-
2363
- function _possibleConstructorReturn$l(self, call) { if (call && (_typeof$l(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$l(self); }
2364
-
2365
- function _assertThisInitialized$l(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2366
-
2367
- function _isNativeReflectConstruct$l() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2368
-
2369
- function _getPrototypeOf$l(o) { _getPrototypeOf$l = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$l(o); }
2370
-
2371
- function _defineProperty$l(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2372
-
2373
- var LocalWeekParser = /*#__PURE__*/function (_Parser) {
2374
- _inherits$l(LocalWeekParser, _Parser);
2375
-
2376
- var _super = _createSuper$l(LocalWeekParser);
2377
-
2378
- function LocalWeekParser() {
2379
- var _this;
2380
-
2381
- _classCallCheck$l(this, LocalWeekParser);
2382
-
2383
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2384
- args[_key] = arguments[_key];
2385
- }
2386
-
2387
- _this = _super.call.apply(_super, [this].concat(args));
2388
-
2389
- _defineProperty$l(_assertThisInitialized$l(_this), "priority", 100);
2390
-
2391
- _defineProperty$l(_assertThisInitialized$l(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
2392
-
2393
- return _this;
2394
- }
2395
-
2396
- _createClass$l(LocalWeekParser, [{
2397
- key: "parse",
2398
- value: function parse(dateString, token, match) {
2399
- switch (token) {
2400
- case 'w':
2401
- return parseNumericPattern(numericPatterns.week, dateString);
2402
-
2403
- case 'wo':
2404
- return match.ordinalNumber(dateString, {
2405
- unit: 'week'
2406
- });
2407
-
2408
- default:
2409
- return parseNDigits(token.length, dateString);
2410
- }
2411
- }
2412
- }, {
2413
- key: "validate",
2414
- value: function validate(_date, value) {
2415
- return value >= 1 && value <= 53;
2416
- }
2417
- }, {
2418
- key: "set",
2419
- value: function set(date, _flags, value, options) {
2420
- return startOfUTCWeek(setUTCWeek(date, value, options), options);
2421
- }
2422
- }]);
2423
-
2424
- return LocalWeekParser;
2425
- }(Parser);
2426
-
2427
- function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
2428
- requiredArgs(2, arguments);
2429
- var date = toDate(dirtyDate);
2430
- var isoWeek = toInteger(dirtyISOWeek);
2431
- var diff = getUTCISOWeek(date) - isoWeek;
2432
- date.setUTCDate(date.getUTCDate() - diff * 7);
2433
- return date;
2434
- }
2435
-
2436
- function _typeof$k(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$k = function _typeof(obj) { return typeof obj; }; } else { _typeof$k = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$k(obj); }
2437
-
2438
- function _classCallCheck$k(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2439
-
2440
- function _defineProperties$k(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2441
-
2442
- function _createClass$k(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$k(Constructor.prototype, protoProps); if (staticProps) _defineProperties$k(Constructor, staticProps); return Constructor; }
2443
-
2444
- function _inherits$k(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$k(subClass, superClass); }
2445
-
2446
- function _setPrototypeOf$k(o, p) { _setPrototypeOf$k = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$k(o, p); }
2447
-
2448
- function _createSuper$k(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$k(); return function _createSuperInternal() { var Super = _getPrototypeOf$k(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$k(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$k(this, result); }; }
2449
-
2450
- function _possibleConstructorReturn$k(self, call) { if (call && (_typeof$k(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$k(self); }
2451
-
2452
- function _assertThisInitialized$k(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2453
-
2454
- function _isNativeReflectConstruct$k() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2455
-
2456
- function _getPrototypeOf$k(o) { _getPrototypeOf$k = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$k(o); }
2457
-
2458
- function _defineProperty$k(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2459
-
2460
- var ISOWeekParser = /*#__PURE__*/function (_Parser) {
2461
- _inherits$k(ISOWeekParser, _Parser);
2462
-
2463
- var _super = _createSuper$k(ISOWeekParser);
2464
-
2465
- function ISOWeekParser() {
2466
- var _this;
2467
-
2468
- _classCallCheck$k(this, ISOWeekParser);
2469
-
2470
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2471
- args[_key] = arguments[_key];
2472
- }
2473
-
2474
- _this = _super.call.apply(_super, [this].concat(args));
2475
-
2476
- _defineProperty$k(_assertThisInitialized$k(_this), "priority", 100);
2477
-
2478
- _defineProperty$k(_assertThisInitialized$k(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
2479
-
2480
- return _this;
2481
- }
2482
-
2483
- _createClass$k(ISOWeekParser, [{
2484
- key: "parse",
2485
- value: function parse(dateString, token, match) {
2486
- switch (token) {
2487
- case 'I':
2488
- return parseNumericPattern(numericPatterns.week, dateString);
2489
-
2490
- case 'Io':
2491
- return match.ordinalNumber(dateString, {
2492
- unit: 'week'
2493
- });
2494
-
2495
- default:
2496
- return parseNDigits(token.length, dateString);
2497
- }
2498
- }
2499
- }, {
2500
- key: "validate",
2501
- value: function validate(_date, value) {
2502
- return value >= 1 && value <= 53;
2503
- }
2504
- }, {
2505
- key: "set",
2506
- value: function set(date, _flags, value) {
2507
- return startOfUTCISOWeek(setUTCISOWeek(date, value));
2508
- }
2509
- }]);
2510
-
2511
- return ISOWeekParser;
2512
- }(Parser);
2513
-
2514
- function _typeof$j(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$j = function _typeof(obj) { return typeof obj; }; } else { _typeof$j = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$j(obj); }
2515
-
2516
- function _classCallCheck$j(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2517
-
2518
- function _defineProperties$j(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2519
-
2520
- function _createClass$j(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$j(Constructor.prototype, protoProps); if (staticProps) _defineProperties$j(Constructor, staticProps); return Constructor; }
2521
-
2522
- function _inherits$j(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$j(subClass, superClass); }
2523
-
2524
- function _setPrototypeOf$j(o, p) { _setPrototypeOf$j = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$j(o, p); }
2525
-
2526
- function _createSuper$j(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$j(); return function _createSuperInternal() { var Super = _getPrototypeOf$j(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$j(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$j(this, result); }; }
2527
-
2528
- function _possibleConstructorReturn$j(self, call) { if (call && (_typeof$j(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$j(self); }
2529
-
2530
- function _assertThisInitialized$j(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2531
-
2532
- function _isNativeReflectConstruct$j() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2533
-
2534
- function _getPrototypeOf$j(o) { _getPrototypeOf$j = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$j(o); }
2535
-
2536
- function _defineProperty$j(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2537
- var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2538
- var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // Day of the month
2539
-
2540
- var DateParser = /*#__PURE__*/function (_Parser) {
2541
- _inherits$j(DateParser, _Parser);
2542
-
2543
- var _super = _createSuper$j(DateParser);
2544
-
2545
- function DateParser() {
2546
- var _this;
2547
-
2548
- _classCallCheck$j(this, DateParser);
2549
-
2550
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2551
- args[_key] = arguments[_key];
2552
- }
2553
-
2554
- _this = _super.call.apply(_super, [this].concat(args));
2555
-
2556
- _defineProperty$j(_assertThisInitialized$j(_this), "priority", 90);
2557
-
2558
- _defineProperty$j(_assertThisInitialized$j(_this), "subPriority", 1);
2559
-
2560
- _defineProperty$j(_assertThisInitialized$j(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
2561
-
2562
- return _this;
2563
- }
2564
-
2565
- _createClass$j(DateParser, [{
2566
- key: "parse",
2567
- value: function parse(dateString, token, match) {
2568
- switch (token) {
2569
- case 'd':
2570
- return parseNumericPattern(numericPatterns.date, dateString);
2571
-
2572
- case 'do':
2573
- return match.ordinalNumber(dateString, {
2574
- unit: 'date'
2575
- });
2576
-
2577
- default:
2578
- return parseNDigits(token.length, dateString);
2579
- }
2580
- }
2581
- }, {
2582
- key: "validate",
2583
- value: function validate(date, value) {
2584
- var year = date.getUTCFullYear();
2585
- var isLeapYear = isLeapYearIndex(year);
2586
- var month = date.getUTCMonth();
2587
-
2588
- if (isLeapYear) {
2589
- return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
2590
- } else {
2591
- return value >= 1 && value <= DAYS_IN_MONTH[month];
2592
- }
2593
- }
2594
- }, {
2595
- key: "set",
2596
- value: function set(date, _flags, value) {
2597
- date.setUTCDate(value);
2598
- date.setUTCHours(0, 0, 0, 0);
2599
- return date;
2600
- }
2601
- }]);
2602
-
2603
- return DateParser;
2604
- }(Parser);
2605
-
2606
- function _typeof$i(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$i = function _typeof(obj) { return typeof obj; }; } else { _typeof$i = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$i(obj); }
2607
-
2608
- function _classCallCheck$i(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2609
-
2610
- function _defineProperties$i(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2611
-
2612
- function _createClass$i(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$i(Constructor.prototype, protoProps); if (staticProps) _defineProperties$i(Constructor, staticProps); return Constructor; }
2613
-
2614
- function _inherits$i(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$i(subClass, superClass); }
2615
-
2616
- function _setPrototypeOf$i(o, p) { _setPrototypeOf$i = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$i(o, p); }
2617
-
2618
- function _createSuper$i(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$i(); return function _createSuperInternal() { var Super = _getPrototypeOf$i(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$i(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$i(this, result); }; }
2619
-
2620
- function _possibleConstructorReturn$i(self, call) { if (call && (_typeof$i(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$i(self); }
2621
-
2622
- function _assertThisInitialized$i(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2623
-
2624
- function _isNativeReflectConstruct$i() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2625
-
2626
- function _getPrototypeOf$i(o) { _getPrototypeOf$i = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$i(o); }
2627
-
2628
- function _defineProperty$i(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2629
- var DayOfYearParser = /*#__PURE__*/function (_Parser) {
2630
- _inherits$i(DayOfYearParser, _Parser);
2631
-
2632
- var _super = _createSuper$i(DayOfYearParser);
2633
-
2634
- function DayOfYearParser() {
2635
- var _this;
2636
-
2637
- _classCallCheck$i(this, DayOfYearParser);
2638
-
2639
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2640
- args[_key] = arguments[_key];
2641
- }
2642
-
2643
- _this = _super.call.apply(_super, [this].concat(args));
2644
-
2645
- _defineProperty$i(_assertThisInitialized$i(_this), "priority", 90);
2646
-
2647
- _defineProperty$i(_assertThisInitialized$i(_this), "subpriority", 1);
2648
-
2649
- _defineProperty$i(_assertThisInitialized$i(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']);
2650
-
2651
- return _this;
2652
- }
2653
-
2654
- _createClass$i(DayOfYearParser, [{
2655
- key: "parse",
2656
- value: function parse(dateString, token, match) {
2657
- switch (token) {
2658
- case 'D':
2659
- case 'DD':
2660
- return parseNumericPattern(numericPatterns.dayOfYear, dateString);
2661
-
2662
- case 'Do':
2663
- return match.ordinalNumber(dateString, {
2664
- unit: 'date'
2665
- });
2666
-
2667
- default:
2668
- return parseNDigits(token.length, dateString);
2669
- }
2670
- }
2671
- }, {
2672
- key: "validate",
2673
- value: function validate(date, value) {
2674
- var year = date.getUTCFullYear();
2675
- var isLeapYear = isLeapYearIndex(year);
2676
-
2677
- if (isLeapYear) {
2678
- return value >= 1 && value <= 366;
2679
- } else {
2680
- return value >= 1 && value <= 365;
2681
- }
2682
- }
2683
- }, {
2684
- key: "set",
2685
- value: function set(date, _flags, value) {
2686
- date.setUTCMonth(0, value);
2687
- date.setUTCHours(0, 0, 0, 0);
2688
- return date;
2689
- }
2690
- }]);
2691
-
2692
- return DayOfYearParser;
2693
- }(Parser);
2694
-
2695
- function setUTCDay(dirtyDate, dirtyDay, options) {
2696
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
2697
-
2698
- requiredArgs(2, arguments);
2699
- var defaultOptions = getDefaultOptions();
2700
- var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2701
-
2702
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2703
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2704
- }
2705
-
2706
- var date = toDate(dirtyDate);
2707
- var day = toInteger(dirtyDay);
2708
- var currentDay = date.getUTCDay();
2709
- var remainder = day % 7;
2710
- var dayIndex = (remainder + 7) % 7;
2711
- var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
2712
- date.setUTCDate(date.getUTCDate() + diff);
2713
- return date;
2714
- }
2715
-
2716
- function _typeof$h(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$h = function _typeof(obj) { return typeof obj; }; } else { _typeof$h = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$h(obj); }
2717
-
2718
- function _classCallCheck$h(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2719
-
2720
- function _defineProperties$h(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2721
-
2722
- function _createClass$h(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$h(Constructor.prototype, protoProps); if (staticProps) _defineProperties$h(Constructor, staticProps); return Constructor; }
2723
-
2724
- function _inherits$h(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$h(subClass, superClass); }
2725
-
2726
- function _setPrototypeOf$h(o, p) { _setPrototypeOf$h = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$h(o, p); }
2727
-
2728
- function _createSuper$h(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$h(); return function _createSuperInternal() { var Super = _getPrototypeOf$h(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$h(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$h(this, result); }; }
2729
-
2730
- function _possibleConstructorReturn$h(self, call) { if (call && (_typeof$h(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$h(self); }
2731
-
2732
- function _assertThisInitialized$h(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2733
-
2734
- function _isNativeReflectConstruct$h() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2735
-
2736
- function _getPrototypeOf$h(o) { _getPrototypeOf$h = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$h(o); }
2737
-
2738
- function _defineProperty$h(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2739
-
2740
- var DayParser = /*#__PURE__*/function (_Parser) {
2741
- _inherits$h(DayParser, _Parser);
2742
-
2743
- var _super = _createSuper$h(DayParser);
2744
-
2745
- function DayParser() {
2746
- var _this;
2747
-
2748
- _classCallCheck$h(this, DayParser);
2749
-
2750
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2751
- args[_key] = arguments[_key];
2752
- }
2753
-
2754
- _this = _super.call.apply(_super, [this].concat(args));
2755
-
2756
- _defineProperty$h(_assertThisInitialized$h(_this), "priority", 90);
2757
-
2758
- _defineProperty$h(_assertThisInitialized$h(_this), "incompatibleTokens", ['D', 'i', 'e', 'c', 't', 'T']);
2759
-
2760
- return _this;
2761
- }
2762
-
2763
- _createClass$h(DayParser, [{
2764
- key: "parse",
2765
- value: function parse(dateString, token, match) {
2766
- switch (token) {
2767
- // Tue
2768
- case 'E':
2769
- case 'EE':
2770
- case 'EEE':
2771
- return match.day(dateString, {
2772
- width: 'abbreviated',
2773
- context: 'formatting'
2774
- }) || match.day(dateString, {
2775
- width: 'short',
2776
- context: 'formatting'
2777
- }) || match.day(dateString, {
2778
- width: 'narrow',
2779
- context: 'formatting'
2780
- });
2781
- // T
2782
-
2783
- case 'EEEEE':
2784
- return match.day(dateString, {
2785
- width: 'narrow',
2786
- context: 'formatting'
2787
- });
2788
- // Tu
2789
-
2790
- case 'EEEEEE':
2791
- return match.day(dateString, {
2792
- width: 'short',
2793
- context: 'formatting'
2794
- }) || match.day(dateString, {
2795
- width: 'narrow',
2796
- context: 'formatting'
2797
- });
2798
- // Tuesday
2799
-
2800
- case 'EEEE':
2801
- default:
2802
- return match.day(dateString, {
2803
- width: 'wide',
2804
- context: 'formatting'
2805
- }) || match.day(dateString, {
2806
- width: 'abbreviated',
2807
- context: 'formatting'
2808
- }) || match.day(dateString, {
2809
- width: 'short',
2810
- context: 'formatting'
2811
- }) || match.day(dateString, {
2812
- width: 'narrow',
2813
- context: 'formatting'
2814
- });
2815
- }
2816
- }
2817
- }, {
2818
- key: "validate",
2819
- value: function validate(_date, value) {
2820
- return value >= 0 && value <= 6;
2821
- }
2822
- }, {
2823
- key: "set",
2824
- value: function set(date, _flags, value, options) {
2825
- date = setUTCDay(date, value, options);
2826
- date.setUTCHours(0, 0, 0, 0);
2827
- return date;
2828
- }
2829
- }]);
2830
-
2831
- return DayParser;
2832
- }(Parser);
2833
-
2834
- function _typeof$g(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$g = function _typeof(obj) { return typeof obj; }; } else { _typeof$g = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$g(obj); }
2835
-
2836
- function _classCallCheck$g(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2837
-
2838
- function _defineProperties$g(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2839
-
2840
- function _createClass$g(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$g(Constructor.prototype, protoProps); if (staticProps) _defineProperties$g(Constructor, staticProps); return Constructor; }
2841
-
2842
- function _inherits$g(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$g(subClass, superClass); }
2843
-
2844
- function _setPrototypeOf$g(o, p) { _setPrototypeOf$g = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$g(o, p); }
2845
-
2846
- function _createSuper$g(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$g(); return function _createSuperInternal() { var Super = _getPrototypeOf$g(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$g(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$g(this, result); }; }
2847
-
2848
- function _possibleConstructorReturn$g(self, call) { if (call && (_typeof$g(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$g(self); }
2849
-
2850
- function _assertThisInitialized$g(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2851
-
2852
- function _isNativeReflectConstruct$g() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2853
-
2854
- function _getPrototypeOf$g(o) { _getPrototypeOf$g = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$g(o); }
2855
-
2856
- function _defineProperty$g(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2857
-
2858
- var LocalDayParser = /*#__PURE__*/function (_Parser) {
2859
- _inherits$g(LocalDayParser, _Parser);
2860
-
2861
- var _super = _createSuper$g(LocalDayParser);
2862
-
2863
- function LocalDayParser() {
2864
- var _this;
2865
-
2866
- _classCallCheck$g(this, LocalDayParser);
2867
-
2868
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2869
- args[_key] = arguments[_key];
2870
- }
2871
-
2872
- _this = _super.call.apply(_super, [this].concat(args));
2873
-
2874
- _defineProperty$g(_assertThisInitialized$g(_this), "priority", 90);
2875
-
2876
- _defineProperty$g(_assertThisInitialized$g(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']);
2877
-
2878
- return _this;
2879
- }
2880
-
2881
- _createClass$g(LocalDayParser, [{
2882
- key: "parse",
2883
- value: function parse(dateString, token, match, options) {
2884
- var valueCallback = function valueCallback(value) {
2885
- var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
2886
- return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
2887
- };
2888
-
2889
- switch (token) {
2890
- // 3
2891
- case 'e':
2892
- case 'ee':
2893
- // 03
2894
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
2895
- // 3rd
2896
-
2897
- case 'eo':
2898
- return mapValue(match.ordinalNumber(dateString, {
2899
- unit: 'day'
2900
- }), valueCallback);
2901
- // Tue
2902
-
2903
- case 'eee':
2904
- return match.day(dateString, {
2905
- width: 'abbreviated',
2906
- context: 'formatting'
2907
- }) || match.day(dateString, {
2908
- width: 'short',
2909
- context: 'formatting'
2910
- }) || match.day(dateString, {
2911
- width: 'narrow',
2912
- context: 'formatting'
2913
- });
2914
- // T
2915
-
2916
- case 'eeeee':
2917
- return match.day(dateString, {
2918
- width: 'narrow',
2919
- context: 'formatting'
2920
- });
2921
- // Tu
2922
-
2923
- case 'eeeeee':
2924
- return match.day(dateString, {
2925
- width: 'short',
2926
- context: 'formatting'
2927
- }) || match.day(dateString, {
2928
- width: 'narrow',
2929
- context: 'formatting'
2930
- });
2931
- // Tuesday
2932
-
2933
- case 'eeee':
2934
- default:
2935
- return match.day(dateString, {
2936
- width: 'wide',
2937
- context: 'formatting'
2938
- }) || match.day(dateString, {
2939
- width: 'abbreviated',
2940
- context: 'formatting'
2941
- }) || match.day(dateString, {
2942
- width: 'short',
2943
- context: 'formatting'
2944
- }) || match.day(dateString, {
2945
- width: 'narrow',
2946
- context: 'formatting'
2947
- });
2948
- }
2949
- }
2950
- }, {
2951
- key: "validate",
2952
- value: function validate(_date, value) {
2953
- return value >= 0 && value <= 6;
2954
- }
2955
- }, {
2956
- key: "set",
2957
- value: function set(date, _flags, value, options) {
2958
- date = setUTCDay(date, value, options);
2959
- date.setUTCHours(0, 0, 0, 0);
2960
- return date;
2961
- }
2962
- }]);
2963
-
2964
- return LocalDayParser;
2965
- }(Parser);
2966
-
2967
- function _typeof$f(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$f = function _typeof(obj) { return typeof obj; }; } else { _typeof$f = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$f(obj); }
2968
-
2969
- function _classCallCheck$f(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2970
-
2971
- function _defineProperties$f(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2972
-
2973
- function _createClass$f(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$f(Constructor.prototype, protoProps); if (staticProps) _defineProperties$f(Constructor, staticProps); return Constructor; }
2974
-
2975
- function _inherits$f(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$f(subClass, superClass); }
2976
-
2977
- function _setPrototypeOf$f(o, p) { _setPrototypeOf$f = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$f(o, p); }
2978
-
2979
- function _createSuper$f(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); return function _createSuperInternal() { var Super = _getPrototypeOf$f(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$f(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$f(this, result); }; }
2980
-
2981
- function _possibleConstructorReturn$f(self, call) { if (call && (_typeof$f(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$f(self); }
2982
-
2983
- function _assertThisInitialized$f(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2984
-
2985
- function _isNativeReflectConstruct$f() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2986
-
2987
- function _getPrototypeOf$f(o) { _getPrototypeOf$f = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$f(o); }
2988
-
2989
- function _defineProperty$f(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2990
-
2991
- var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser) {
2992
- _inherits$f(StandAloneLocalDayParser, _Parser);
2993
-
2994
- var _super = _createSuper$f(StandAloneLocalDayParser);
2995
-
2996
- function StandAloneLocalDayParser() {
2997
- var _this;
2998
-
2999
- _classCallCheck$f(this, StandAloneLocalDayParser);
3000
-
3001
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3002
- args[_key] = arguments[_key];
3003
- }
3004
-
3005
- _this = _super.call.apply(_super, [this].concat(args));
3006
-
3007
- _defineProperty$f(_assertThisInitialized$f(_this), "priority", 90);
3008
-
3009
- _defineProperty$f(_assertThisInitialized$f(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']);
3010
-
3011
- return _this;
3012
- }
3013
-
3014
- _createClass$f(StandAloneLocalDayParser, [{
3015
- key: "parse",
3016
- value: function parse(dateString, token, match, options) {
3017
- var valueCallback = function valueCallback(value) {
3018
- var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
3019
- return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
3020
- };
3021
-
3022
- switch (token) {
3023
- // 3
3024
- case 'c':
3025
- case 'cc':
3026
- // 03
3027
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
3028
- // 3rd
3029
-
3030
- case 'co':
3031
- return mapValue(match.ordinalNumber(dateString, {
3032
- unit: 'day'
3033
- }), valueCallback);
3034
- // Tue
3035
-
3036
- case 'ccc':
3037
- return match.day(dateString, {
3038
- width: 'abbreviated',
3039
- context: 'standalone'
3040
- }) || match.day(dateString, {
3041
- width: 'short',
3042
- context: 'standalone'
3043
- }) || match.day(dateString, {
3044
- width: 'narrow',
3045
- context: 'standalone'
3046
- });
3047
- // T
3048
-
3049
- case 'ccccc':
3050
- return match.day(dateString, {
3051
- width: 'narrow',
3052
- context: 'standalone'
3053
- });
3054
- // Tu
3055
-
3056
- case 'cccccc':
3057
- return match.day(dateString, {
3058
- width: 'short',
3059
- context: 'standalone'
3060
- }) || match.day(dateString, {
3061
- width: 'narrow',
3062
- context: 'standalone'
3063
- });
3064
- // Tuesday
3065
-
3066
- case 'cccc':
3067
- default:
3068
- return match.day(dateString, {
3069
- width: 'wide',
3070
- context: 'standalone'
3071
- }) || match.day(dateString, {
3072
- width: 'abbreviated',
3073
- context: 'standalone'
3074
- }) || match.day(dateString, {
3075
- width: 'short',
3076
- context: 'standalone'
3077
- }) || match.day(dateString, {
3078
- width: 'narrow',
3079
- context: 'standalone'
3080
- });
3081
- }
3082
- }
3083
- }, {
3084
- key: "validate",
3085
- value: function validate(_date, value) {
3086
- return value >= 0 && value <= 6;
3087
- }
3088
- }, {
3089
- key: "set",
3090
- value: function set(date, _flags, value, options) {
3091
- date = setUTCDay(date, value, options);
3092
- date.setUTCHours(0, 0, 0, 0);
3093
- return date;
3094
- }
3095
- }]);
3096
-
3097
- return StandAloneLocalDayParser;
3098
- }(Parser);
3099
-
3100
- function setUTCISODay(dirtyDate, dirtyDay) {
3101
- requiredArgs(2, arguments);
3102
- var day = toInteger(dirtyDay);
3103
-
3104
- if (day % 7 === 0) {
3105
- day = day - 7;
3106
- }
3107
-
3108
- var weekStartsOn = 1;
3109
- var date = toDate(dirtyDate);
3110
- var currentDay = date.getUTCDay();
3111
- var remainder = day % 7;
3112
- var dayIndex = (remainder + 7) % 7;
3113
- var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
3114
- date.setUTCDate(date.getUTCDate() + diff);
3115
- return date;
3116
- }
3117
-
3118
- function _typeof$e(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$e = function _typeof(obj) { return typeof obj; }; } else { _typeof$e = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$e(obj); }
3119
-
3120
- function _classCallCheck$e(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3121
-
3122
- function _defineProperties$e(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3123
-
3124
- function _createClass$e(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$e(Constructor.prototype, protoProps); if (staticProps) _defineProperties$e(Constructor, staticProps); return Constructor; }
3125
-
3126
- function _inherits$e(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$e(subClass, superClass); }
3127
-
3128
- function _setPrototypeOf$e(o, p) { _setPrototypeOf$e = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$e(o, p); }
3129
-
3130
- function _createSuper$e(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$e(); return function _createSuperInternal() { var Super = _getPrototypeOf$e(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$e(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$e(this, result); }; }
3131
-
3132
- function _possibleConstructorReturn$e(self, call) { if (call && (_typeof$e(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$e(self); }
3133
-
3134
- function _assertThisInitialized$e(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3135
-
3136
- function _isNativeReflectConstruct$e() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3137
-
3138
- function _getPrototypeOf$e(o) { _getPrototypeOf$e = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$e(o); }
3139
-
3140
- function _defineProperty$e(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3141
-
3142
- var ISODayParser = /*#__PURE__*/function (_Parser) {
3143
- _inherits$e(ISODayParser, _Parser);
3144
-
3145
- var _super = _createSuper$e(ISODayParser);
3146
-
3147
- function ISODayParser() {
3148
- var _this;
3149
-
3150
- _classCallCheck$e(this, ISODayParser);
3151
-
3152
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3153
- args[_key] = arguments[_key];
3154
- }
3155
-
3156
- _this = _super.call.apply(_super, [this].concat(args));
3157
-
3158
- _defineProperty$e(_assertThisInitialized$e(_this), "priority", 90);
3159
-
3160
- _defineProperty$e(_assertThisInitialized$e(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']);
3161
-
3162
- return _this;
3163
- }
3164
-
3165
- _createClass$e(ISODayParser, [{
3166
- key: "parse",
3167
- value: function parse(dateString, token, match) {
3168
- var valueCallback = function valueCallback(value) {
3169
- if (value === 0) {
3170
- return 7;
3171
- }
3172
-
3173
- return value;
3174
- };
3175
-
3176
- switch (token) {
3177
- // 2
3178
- case 'i':
3179
- case 'ii':
3180
- // 02
3181
- return parseNDigits(token.length, dateString);
3182
- // 2nd
3183
-
3184
- case 'io':
3185
- return match.ordinalNumber(dateString, {
3186
- unit: 'day'
3187
- });
3188
- // Tue
3189
-
3190
- case 'iii':
3191
- return mapValue(match.day(dateString, {
3192
- width: 'abbreviated',
3193
- context: 'formatting'
3194
- }) || match.day(dateString, {
3195
- width: 'short',
3196
- context: 'formatting'
3197
- }) || match.day(dateString, {
3198
- width: 'narrow',
3199
- context: 'formatting'
3200
- }), valueCallback);
3201
- // T
3202
-
3203
- case 'iiiii':
3204
- return mapValue(match.day(dateString, {
3205
- width: 'narrow',
3206
- context: 'formatting'
3207
- }), valueCallback);
3208
- // Tu
3209
-
3210
- case 'iiiiii':
3211
- return mapValue(match.day(dateString, {
3212
- width: 'short',
3213
- context: 'formatting'
3214
- }) || match.day(dateString, {
3215
- width: 'narrow',
3216
- context: 'formatting'
3217
- }), valueCallback);
3218
- // Tuesday
3219
-
3220
- case 'iiii':
3221
- default:
3222
- return mapValue(match.day(dateString, {
3223
- width: 'wide',
3224
- context: 'formatting'
3225
- }) || match.day(dateString, {
3226
- width: 'abbreviated',
3227
- context: 'formatting'
3228
- }) || match.day(dateString, {
3229
- width: 'short',
3230
- context: 'formatting'
3231
- }) || match.day(dateString, {
3232
- width: 'narrow',
3233
- context: 'formatting'
3234
- }), valueCallback);
3235
- }
3236
- }
3237
- }, {
3238
- key: "validate",
3239
- value: function validate(_date, value) {
3240
- return value >= 1 && value <= 7;
3241
- }
3242
- }, {
3243
- key: "set",
3244
- value: function set(date, _flags, value) {
3245
- date = setUTCISODay(date, value);
3246
- date.setUTCHours(0, 0, 0, 0);
3247
- return date;
3248
- }
3249
- }]);
3250
-
3251
- return ISODayParser;
3252
- }(Parser);
3253
-
3254
- function _typeof$d(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$d = function _typeof(obj) { return typeof obj; }; } else { _typeof$d = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$d(obj); }
3255
-
3256
- function _classCallCheck$d(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3257
-
3258
- function _defineProperties$d(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3259
-
3260
- function _createClass$d(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$d(Constructor.prototype, protoProps); if (staticProps) _defineProperties$d(Constructor, staticProps); return Constructor; }
3261
-
3262
- function _inherits$d(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$d(subClass, superClass); }
3263
-
3264
- function _setPrototypeOf$d(o, p) { _setPrototypeOf$d = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$d(o, p); }
3265
-
3266
- function _createSuper$d(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$d(); return function _createSuperInternal() { var Super = _getPrototypeOf$d(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$d(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$d(this, result); }; }
3267
-
3268
- function _possibleConstructorReturn$d(self, call) { if (call && (_typeof$d(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$d(self); }
3269
-
3270
- function _assertThisInitialized$d(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3271
-
3272
- function _isNativeReflectConstruct$d() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3273
-
3274
- function _getPrototypeOf$d(o) { _getPrototypeOf$d = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$d(o); }
3275
-
3276
- function _defineProperty$d(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3277
- var AMPMParser = /*#__PURE__*/function (_Parser) {
3278
- _inherits$d(AMPMParser, _Parser);
3279
-
3280
- var _super = _createSuper$d(AMPMParser);
3281
-
3282
- function AMPMParser() {
3283
- var _this;
3284
-
3285
- _classCallCheck$d(this, AMPMParser);
3286
-
3287
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3288
- args[_key] = arguments[_key];
3289
- }
3290
-
3291
- _this = _super.call.apply(_super, [this].concat(args));
3292
-
3293
- _defineProperty$d(_assertThisInitialized$d(_this), "priority", 80);
3294
-
3295
- _defineProperty$d(_assertThisInitialized$d(_this), "incompatibleTokens", ['b', 'B', 'H', 'k', 't', 'T']);
3296
-
3297
- return _this;
3298
- }
3299
-
3300
- _createClass$d(AMPMParser, [{
3301
- key: "parse",
3302
- value: function parse(dateString, token, match) {
3303
- switch (token) {
3304
- case 'a':
3305
- case 'aa':
3306
- case 'aaa':
3307
- return match.dayPeriod(dateString, {
3308
- width: 'abbreviated',
3309
- context: 'formatting'
3310
- }) || match.dayPeriod(dateString, {
3311
- width: 'narrow',
3312
- context: 'formatting'
3313
- });
3314
-
3315
- case 'aaaaa':
3316
- return match.dayPeriod(dateString, {
3317
- width: 'narrow',
3318
- context: 'formatting'
3319
- });
3320
-
3321
- case 'aaaa':
3322
- default:
3323
- return match.dayPeriod(dateString, {
3324
- width: 'wide',
3325
- context: 'formatting'
3326
- }) || match.dayPeriod(dateString, {
3327
- width: 'abbreviated',
3328
- context: 'formatting'
3329
- }) || match.dayPeriod(dateString, {
3330
- width: 'narrow',
3331
- context: 'formatting'
3332
- });
3333
- }
3334
- }
3335
- }, {
3336
- key: "set",
3337
- value: function set(date, _flags, value) {
3338
- date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
3339
- return date;
3340
- }
3341
- }]);
3342
-
3343
- return AMPMParser;
3344
- }(Parser);
3345
-
3346
- function _typeof$c(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$c = function _typeof(obj) { return typeof obj; }; } else { _typeof$c = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$c(obj); }
3347
-
3348
- function _classCallCheck$c(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3349
-
3350
- function _defineProperties$c(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3351
-
3352
- function _createClass$c(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$c(Constructor.prototype, protoProps); if (staticProps) _defineProperties$c(Constructor, staticProps); return Constructor; }
3353
-
3354
- function _inherits$c(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$c(subClass, superClass); }
3355
-
3356
- function _setPrototypeOf$c(o, p) { _setPrototypeOf$c = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$c(o, p); }
3357
-
3358
- function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf$c(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$c(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$c(this, result); }; }
3359
-
3360
- function _possibleConstructorReturn$c(self, call) { if (call && (_typeof$c(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$c(self); }
3361
-
3362
- function _assertThisInitialized$c(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3363
-
3364
- function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3365
-
3366
- function _getPrototypeOf$c(o) { _getPrototypeOf$c = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$c(o); }
3367
-
3368
- function _defineProperty$c(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3369
- var AMPMMidnightParser = /*#__PURE__*/function (_Parser) {
3370
- _inherits$c(AMPMMidnightParser, _Parser);
3371
-
3372
- var _super = _createSuper$c(AMPMMidnightParser);
3373
-
3374
- function AMPMMidnightParser() {
3375
- var _this;
3376
-
3377
- _classCallCheck$c(this, AMPMMidnightParser);
3378
-
3379
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3380
- args[_key] = arguments[_key];
3381
- }
3382
-
3383
- _this = _super.call.apply(_super, [this].concat(args));
3384
-
3385
- _defineProperty$c(_assertThisInitialized$c(_this), "priority", 80);
3386
-
3387
- _defineProperty$c(_assertThisInitialized$c(_this), "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']);
3388
-
3389
- return _this;
3390
- }
3391
-
3392
- _createClass$c(AMPMMidnightParser, [{
3393
- key: "parse",
3394
- value: function parse(dateString, token, match) {
3395
- switch (token) {
3396
- case 'b':
3397
- case 'bb':
3398
- case 'bbb':
3399
- return match.dayPeriod(dateString, {
3400
- width: 'abbreviated',
3401
- context: 'formatting'
3402
- }) || match.dayPeriod(dateString, {
3403
- width: 'narrow',
3404
- context: 'formatting'
3405
- });
3406
-
3407
- case 'bbbbb':
3408
- return match.dayPeriod(dateString, {
3409
- width: 'narrow',
3410
- context: 'formatting'
3411
- });
3412
-
3413
- case 'bbbb':
3414
- default:
3415
- return match.dayPeriod(dateString, {
3416
- width: 'wide',
3417
- context: 'formatting'
3418
- }) || match.dayPeriod(dateString, {
3419
- width: 'abbreviated',
3420
- context: 'formatting'
3421
- }) || match.dayPeriod(dateString, {
3422
- width: 'narrow',
3423
- context: 'formatting'
3424
- });
3425
- }
3426
- }
3427
- }, {
3428
- key: "set",
3429
- value: function set(date, _flags, value) {
3430
- date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
3431
- return date;
3432
- }
3433
- }]);
3434
-
3435
- return AMPMMidnightParser;
3436
- }(Parser);
3437
-
3438
- function _typeof$b(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$b = function _typeof(obj) { return typeof obj; }; } else { _typeof$b = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$b(obj); }
3439
-
3440
- function _classCallCheck$b(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3441
-
3442
- function _defineProperties$b(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3443
-
3444
- function _createClass$b(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$b(Constructor.prototype, protoProps); if (staticProps) _defineProperties$b(Constructor, staticProps); return Constructor; }
3445
-
3446
- function _inherits$b(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$b(subClass, superClass); }
3447
-
3448
- function _setPrototypeOf$b(o, p) { _setPrototypeOf$b = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$b(o, p); }
3449
-
3450
- function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); return function _createSuperInternal() { var Super = _getPrototypeOf$b(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$b(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$b(this, result); }; }
3451
-
3452
- function _possibleConstructorReturn$b(self, call) { if (call && (_typeof$b(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$b(self); }
3453
-
3454
- function _assertThisInitialized$b(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3455
-
3456
- function _isNativeReflectConstruct$b() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3457
-
3458
- function _getPrototypeOf$b(o) { _getPrototypeOf$b = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$b(o); }
3459
-
3460
- function _defineProperty$b(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3461
-
3462
- var DayPeriodParser = /*#__PURE__*/function (_Parser) {
3463
- _inherits$b(DayPeriodParser, _Parser);
3464
-
3465
- var _super = _createSuper$b(DayPeriodParser);
3466
-
3467
- function DayPeriodParser() {
3468
- var _this;
3469
-
3470
- _classCallCheck$b(this, DayPeriodParser);
3471
-
3472
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3473
- args[_key] = arguments[_key];
3474
- }
3475
-
3476
- _this = _super.call.apply(_super, [this].concat(args));
3477
-
3478
- _defineProperty$b(_assertThisInitialized$b(_this), "priority", 80);
3479
-
3480
- _defineProperty$b(_assertThisInitialized$b(_this), "incompatibleTokens", ['a', 'b', 't', 'T']);
3481
-
3482
- return _this;
3483
- }
3484
-
3485
- _createClass$b(DayPeriodParser, [{
3486
- key: "parse",
3487
- value: function parse(dateString, token, match) {
3488
- switch (token) {
3489
- case 'B':
3490
- case 'BB':
3491
- case 'BBB':
3492
- return match.dayPeriod(dateString, {
3493
- width: 'abbreviated',
3494
- context: 'formatting'
3495
- }) || match.dayPeriod(dateString, {
3496
- width: 'narrow',
3497
- context: 'formatting'
3498
- });
3499
-
3500
- case 'BBBBB':
3501
- return match.dayPeriod(dateString, {
3502
- width: 'narrow',
3503
- context: 'formatting'
3504
- });
3505
-
3506
- case 'BBBB':
3507
- default:
3508
- return match.dayPeriod(dateString, {
3509
- width: 'wide',
3510
- context: 'formatting'
3511
- }) || match.dayPeriod(dateString, {
3512
- width: 'abbreviated',
3513
- context: 'formatting'
3514
- }) || match.dayPeriod(dateString, {
3515
- width: 'narrow',
3516
- context: 'formatting'
3517
- });
3518
- }
3519
- }
3520
- }, {
3521
- key: "set",
3522
- value: function set(date, _flags, value) {
3523
- date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
3524
- return date;
3525
- }
3526
- }]);
3527
-
3528
- return DayPeriodParser;
3529
- }(Parser);
3530
-
3531
- function _typeof$a(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$a = function _typeof(obj) { return typeof obj; }; } else { _typeof$a = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$a(obj); }
3532
-
3533
- function _classCallCheck$a(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3534
-
3535
- function _defineProperties$a(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3536
-
3537
- function _createClass$a(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$a(Constructor.prototype, protoProps); if (staticProps) _defineProperties$a(Constructor, staticProps); return Constructor; }
3538
-
3539
- function _inherits$a(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$a(subClass, superClass); }
3540
-
3541
- function _setPrototypeOf$a(o, p) { _setPrototypeOf$a = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$a(o, p); }
3542
-
3543
- function _createSuper$a(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); return function _createSuperInternal() { var Super = _getPrototypeOf$a(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$a(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$a(this, result); }; }
3544
-
3545
- function _possibleConstructorReturn$a(self, call) { if (call && (_typeof$a(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$a(self); }
3546
-
3547
- function _assertThisInitialized$a(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3548
-
3549
- function _isNativeReflectConstruct$a() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3550
-
3551
- function _getPrototypeOf$a(o) { _getPrototypeOf$a = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$a(o); }
3552
-
3553
- function _defineProperty$a(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3554
- var Hour1to12Parser = /*#__PURE__*/function (_Parser) {
3555
- _inherits$a(Hour1to12Parser, _Parser);
3556
-
3557
- var _super = _createSuper$a(Hour1to12Parser);
3558
-
3559
- function Hour1to12Parser() {
3560
- var _this;
3561
-
3562
- _classCallCheck$a(this, Hour1to12Parser);
3563
-
3564
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3565
- args[_key] = arguments[_key];
3566
- }
3567
-
3568
- _this = _super.call.apply(_super, [this].concat(args));
3569
-
3570
- _defineProperty$a(_assertThisInitialized$a(_this), "priority", 70);
3571
-
3572
- _defineProperty$a(_assertThisInitialized$a(_this), "incompatibleTokens", ['H', 'K', 'k', 't', 'T']);
3573
-
3574
- return _this;
3575
- }
3576
-
3577
- _createClass$a(Hour1to12Parser, [{
3578
- key: "parse",
3579
- value: function parse(dateString, token, match) {
3580
- switch (token) {
3581
- case 'h':
3582
- return parseNumericPattern(numericPatterns.hour12h, dateString);
3583
-
3584
- case 'ho':
3585
- return match.ordinalNumber(dateString, {
3586
- unit: 'hour'
3587
- });
3588
-
3589
- default:
3590
- return parseNDigits(token.length, dateString);
3591
- }
3592
- }
3593
- }, {
3594
- key: "validate",
3595
- value: function validate(_date, value) {
3596
- return value >= 1 && value <= 12;
3597
- }
3598
- }, {
3599
- key: "set",
3600
- value: function set(date, _flags, value) {
3601
- var isPM = date.getUTCHours() >= 12;
3602
-
3603
- if (isPM && value < 12) {
3604
- date.setUTCHours(value + 12, 0, 0, 0);
3605
- } else if (!isPM && value === 12) {
3606
- date.setUTCHours(0, 0, 0, 0);
3607
- } else {
3608
- date.setUTCHours(value, 0, 0, 0);
3609
- }
3610
-
3611
- return date;
3612
- }
3613
- }]);
3614
-
3615
- return Hour1to12Parser;
3616
- }(Parser);
3617
-
3618
- function _typeof$9(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$9 = function _typeof(obj) { return typeof obj; }; } else { _typeof$9 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$9(obj); }
3619
-
3620
- function _classCallCheck$9(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3621
-
3622
- function _defineProperties$9(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3623
-
3624
- function _createClass$9(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$9(Constructor.prototype, protoProps); if (staticProps) _defineProperties$9(Constructor, staticProps); return Constructor; }
3625
-
3626
- function _inherits$9(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$9(subClass, superClass); }
3627
-
3628
- function _setPrototypeOf$9(o, p) { _setPrototypeOf$9 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$9(o, p); }
3629
-
3630
- function _createSuper$9(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); return function _createSuperInternal() { var Super = _getPrototypeOf$9(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$9(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$9(this, result); }; }
3631
-
3632
- function _possibleConstructorReturn$9(self, call) { if (call && (_typeof$9(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$9(self); }
3633
-
3634
- function _assertThisInitialized$9(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3635
-
3636
- function _isNativeReflectConstruct$9() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3637
-
3638
- function _getPrototypeOf$9(o) { _getPrototypeOf$9 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$9(o); }
3639
-
3640
- function _defineProperty$9(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3641
- var Hour0to23Parser = /*#__PURE__*/function (_Parser) {
3642
- _inherits$9(Hour0to23Parser, _Parser);
3643
-
3644
- var _super = _createSuper$9(Hour0to23Parser);
3645
-
3646
- function Hour0to23Parser() {
3647
- var _this;
3648
-
3649
- _classCallCheck$9(this, Hour0to23Parser);
3650
-
3651
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3652
- args[_key] = arguments[_key];
3653
- }
3654
-
3655
- _this = _super.call.apply(_super, [this].concat(args));
3656
-
3657
- _defineProperty$9(_assertThisInitialized$9(_this), "priority", 70);
3658
-
3659
- _defineProperty$9(_assertThisInitialized$9(_this), "incompatibleTokens", ['a', 'b', 'h', 'K', 'k', 't', 'T']);
3660
-
3661
- return _this;
3662
- }
3663
-
3664
- _createClass$9(Hour0to23Parser, [{
3665
- key: "parse",
3666
- value: function parse(dateString, token, match) {
3667
- switch (token) {
3668
- case 'H':
3669
- return parseNumericPattern(numericPatterns.hour23h, dateString);
3670
-
3671
- case 'Ho':
3672
- return match.ordinalNumber(dateString, {
3673
- unit: 'hour'
3674
- });
3675
-
3676
- default:
3677
- return parseNDigits(token.length, dateString);
3678
- }
3679
- }
3680
- }, {
3681
- key: "validate",
3682
- value: function validate(_date, value) {
3683
- return value >= 0 && value <= 23;
3684
- }
3685
- }, {
3686
- key: "set",
3687
- value: function set(date, _flags, value) {
3688
- date.setUTCHours(value, 0, 0, 0);
3689
- return date;
3690
- }
3691
- }]);
3692
-
3693
- return Hour0to23Parser;
3694
- }(Parser);
3695
-
3696
- function _typeof$8(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$8 = function _typeof(obj) { return typeof obj; }; } else { _typeof$8 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$8(obj); }
3697
-
3698
- function _classCallCheck$8(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3699
-
3700
- function _defineProperties$8(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3701
-
3702
- function _createClass$8(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$8(Constructor.prototype, protoProps); if (staticProps) _defineProperties$8(Constructor, staticProps); return Constructor; }
3703
-
3704
- function _inherits$8(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$8(subClass, superClass); }
3705
-
3706
- function _setPrototypeOf$8(o, p) { _setPrototypeOf$8 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$8(o, p); }
3707
-
3708
- function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf$8(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$8(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$8(this, result); }; }
3709
-
3710
- function _possibleConstructorReturn$8(self, call) { if (call && (_typeof$8(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$8(self); }
3711
-
3712
- function _assertThisInitialized$8(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3713
-
3714
- function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3715
-
3716
- function _getPrototypeOf$8(o) { _getPrototypeOf$8 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$8(o); }
3717
-
3718
- function _defineProperty$8(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3719
- var Hour0To11Parser = /*#__PURE__*/function (_Parser) {
3720
- _inherits$8(Hour0To11Parser, _Parser);
3721
-
3722
- var _super = _createSuper$8(Hour0To11Parser);
3723
-
3724
- function Hour0To11Parser() {
3725
- var _this;
3726
-
3727
- _classCallCheck$8(this, Hour0To11Parser);
3728
-
3729
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3730
- args[_key] = arguments[_key];
3731
- }
3732
-
3733
- _this = _super.call.apply(_super, [this].concat(args));
3734
-
3735
- _defineProperty$8(_assertThisInitialized$8(_this), "priority", 70);
3736
-
3737
- _defineProperty$8(_assertThisInitialized$8(_this), "incompatibleTokens", ['h', 'H', 'k', 't', 'T']);
3738
-
3739
- return _this;
3740
- }
3741
-
3742
- _createClass$8(Hour0To11Parser, [{
3743
- key: "parse",
3744
- value: function parse(dateString, token, match) {
3745
- switch (token) {
3746
- case 'K':
3747
- return parseNumericPattern(numericPatterns.hour11h, dateString);
3748
-
3749
- case 'Ko':
3750
- return match.ordinalNumber(dateString, {
3751
- unit: 'hour'
3752
- });
3753
-
3754
- default:
3755
- return parseNDigits(token.length, dateString);
3756
- }
3757
- }
3758
- }, {
3759
- key: "validate",
3760
- value: function validate(_date, value) {
3761
- return value >= 0 && value <= 11;
3762
- }
3763
- }, {
3764
- key: "set",
3765
- value: function set(date, _flags, value) {
3766
- var isPM = date.getUTCHours() >= 12;
3767
-
3768
- if (isPM && value < 12) {
3769
- date.setUTCHours(value + 12, 0, 0, 0);
3770
- } else {
3771
- date.setUTCHours(value, 0, 0, 0);
3772
- }
3773
-
3774
- return date;
3775
- }
3776
- }]);
3777
-
3778
- return Hour0To11Parser;
3779
- }(Parser);
3780
-
3781
- function _typeof$7(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$7 = function _typeof(obj) { return typeof obj; }; } else { _typeof$7 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$7(obj); }
3782
-
3783
- function _classCallCheck$7(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3784
-
3785
- function _defineProperties$7(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3786
-
3787
- function _createClass$7(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$7(Constructor.prototype, protoProps); if (staticProps) _defineProperties$7(Constructor, staticProps); return Constructor; }
3788
-
3789
- function _inherits$7(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$7(subClass, superClass); }
3790
-
3791
- function _setPrototypeOf$7(o, p) { _setPrototypeOf$7 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$7(o, p); }
3792
-
3793
- function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf$7(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$7(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$7(this, result); }; }
3794
-
3795
- function _possibleConstructorReturn$7(self, call) { if (call && (_typeof$7(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$7(self); }
3796
-
3797
- function _assertThisInitialized$7(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3798
-
3799
- function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3800
-
3801
- function _getPrototypeOf$7(o) { _getPrototypeOf$7 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$7(o); }
3802
-
3803
- function _defineProperty$7(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3804
- var Hour1To24Parser = /*#__PURE__*/function (_Parser) {
3805
- _inherits$7(Hour1To24Parser, _Parser);
3806
-
3807
- var _super = _createSuper$7(Hour1To24Parser);
3808
-
3809
- function Hour1To24Parser() {
3810
- var _this;
3811
-
3812
- _classCallCheck$7(this, Hour1To24Parser);
3813
-
3814
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3815
- args[_key] = arguments[_key];
3816
- }
3817
-
3818
- _this = _super.call.apply(_super, [this].concat(args));
3819
-
3820
- _defineProperty$7(_assertThisInitialized$7(_this), "priority", 70);
3821
-
3822
- _defineProperty$7(_assertThisInitialized$7(_this), "incompatibleTokens", ['a', 'b', 'h', 'H', 'K', 't', 'T']);
3823
-
3824
- return _this;
3825
- }
3826
-
3827
- _createClass$7(Hour1To24Parser, [{
3828
- key: "parse",
3829
- value: function parse(dateString, token, match) {
3830
- switch (token) {
3831
- case 'k':
3832
- return parseNumericPattern(numericPatterns.hour24h, dateString);
3833
-
3834
- case 'ko':
3835
- return match.ordinalNumber(dateString, {
3836
- unit: 'hour'
3837
- });
3838
-
3839
- default:
3840
- return parseNDigits(token.length, dateString);
3841
- }
3842
- }
3843
- }, {
3844
- key: "validate",
3845
- value: function validate(_date, value) {
3846
- return value >= 1 && value <= 24;
3847
- }
3848
- }, {
3849
- key: "set",
3850
- value: function set(date, _flags, value) {
3851
- var hours = value <= 24 ? value % 24 : value;
3852
- date.setUTCHours(hours, 0, 0, 0);
3853
- return date;
3854
- }
3855
- }]);
3856
-
3857
- return Hour1To24Parser;
3858
- }(Parser);
3859
-
3860
- function _typeof$6(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$6 = function _typeof(obj) { return typeof obj; }; } else { _typeof$6 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$6(obj); }
3861
-
3862
- function _classCallCheck$6(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3863
-
3864
- function _defineProperties$6(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3865
-
3866
- function _createClass$6(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$6(Constructor.prototype, protoProps); if (staticProps) _defineProperties$6(Constructor, staticProps); return Constructor; }
3867
-
3868
- function _inherits$6(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$6(subClass, superClass); }
3869
-
3870
- function _setPrototypeOf$6(o, p) { _setPrototypeOf$6 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$6(o, p); }
3871
-
3872
- function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf$6(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$6(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$6(this, result); }; }
3873
-
3874
- function _possibleConstructorReturn$6(self, call) { if (call && (_typeof$6(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$6(self); }
3875
-
3876
- function _assertThisInitialized$6(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3877
-
3878
- function _isNativeReflectConstruct$6() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3879
-
3880
- function _getPrototypeOf$6(o) { _getPrototypeOf$6 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$6(o); }
3881
-
3882
- function _defineProperty$6(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3883
- var MinuteParser = /*#__PURE__*/function (_Parser) {
3884
- _inherits$6(MinuteParser, _Parser);
3885
-
3886
- var _super = _createSuper$6(MinuteParser);
3887
-
3888
- function MinuteParser() {
3889
- var _this;
3890
-
3891
- _classCallCheck$6(this, MinuteParser);
3892
-
3893
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3894
- args[_key] = arguments[_key];
3895
- }
3896
-
3897
- _this = _super.call.apply(_super, [this].concat(args));
3898
-
3899
- _defineProperty$6(_assertThisInitialized$6(_this), "priority", 60);
3900
-
3901
- _defineProperty$6(_assertThisInitialized$6(_this), "incompatibleTokens", ['t', 'T']);
3902
-
3903
- return _this;
3904
- }
3905
-
3906
- _createClass$6(MinuteParser, [{
3907
- key: "parse",
3908
- value: function parse(dateString, token, match) {
3909
- switch (token) {
3910
- case 'm':
3911
- return parseNumericPattern(numericPatterns.minute, dateString);
3912
-
3913
- case 'mo':
3914
- return match.ordinalNumber(dateString, {
3915
- unit: 'minute'
3916
- });
3917
-
3918
- default:
3919
- return parseNDigits(token.length, dateString);
3920
- }
3921
- }
3922
- }, {
3923
- key: "validate",
3924
- value: function validate(_date, value) {
3925
- return value >= 0 && value <= 59;
3926
- }
3927
- }, {
3928
- key: "set",
3929
- value: function set(date, _flags, value) {
3930
- date.setUTCMinutes(value, 0, 0);
3931
- return date;
3932
- }
3933
- }]);
3934
-
3935
- return MinuteParser;
3936
- }(Parser);
3937
-
3938
- function _typeof$5(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$5 = function _typeof(obj) { return typeof obj; }; } else { _typeof$5 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$5(obj); }
3939
-
3940
- function _classCallCheck$5(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3941
-
3942
- function _defineProperties$5(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3943
-
3944
- function _createClass$5(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$5(Constructor.prototype, protoProps); if (staticProps) _defineProperties$5(Constructor, staticProps); return Constructor; }
3945
-
3946
- function _inherits$5(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$5(subClass, superClass); }
3947
-
3948
- function _setPrototypeOf$5(o, p) { _setPrototypeOf$5 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$5(o, p); }
3949
-
3950
- function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf$5(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$5(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$5(this, result); }; }
3951
-
3952
- function _possibleConstructorReturn$5(self, call) { if (call && (_typeof$5(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$5(self); }
3953
-
3954
- function _assertThisInitialized$5(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3955
-
3956
- function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3957
-
3958
- function _getPrototypeOf$5(o) { _getPrototypeOf$5 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$5(o); }
3959
-
3960
- function _defineProperty$5(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3961
- var SecondParser = /*#__PURE__*/function (_Parser) {
3962
- _inherits$5(SecondParser, _Parser);
3963
-
3964
- var _super = _createSuper$5(SecondParser);
3965
-
3966
- function SecondParser() {
3967
- var _this;
3968
-
3969
- _classCallCheck$5(this, SecondParser);
3970
-
3971
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3972
- args[_key] = arguments[_key];
3973
- }
3974
-
3975
- _this = _super.call.apply(_super, [this].concat(args));
3976
-
3977
- _defineProperty$5(_assertThisInitialized$5(_this), "priority", 50);
3978
-
3979
- _defineProperty$5(_assertThisInitialized$5(_this), "incompatibleTokens", ['t', 'T']);
3980
-
3981
- return _this;
3982
- }
3983
-
3984
- _createClass$5(SecondParser, [{
3985
- key: "parse",
3986
- value: function parse(dateString, token, match) {
3987
- switch (token) {
3988
- case 's':
3989
- return parseNumericPattern(numericPatterns.second, dateString);
3990
-
3991
- case 'so':
3992
- return match.ordinalNumber(dateString, {
3993
- unit: 'second'
3994
- });
3995
-
3996
- default:
3997
- return parseNDigits(token.length, dateString);
3998
- }
3999
- }
4000
- }, {
4001
- key: "validate",
4002
- value: function validate(_date, value) {
4003
- return value >= 0 && value <= 59;
4004
- }
4005
- }, {
4006
- key: "set",
4007
- value: function set(date, _flags, value) {
4008
- date.setUTCSeconds(value, 0);
4009
- return date;
4010
- }
4011
- }]);
4012
-
4013
- return SecondParser;
4014
- }(Parser);
4015
-
4016
- function _typeof$4(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$4 = function _typeof(obj) { return typeof obj; }; } else { _typeof$4 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$4(obj); }
4017
-
4018
- function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4019
-
4020
- function _defineProperties$4(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4021
-
4022
- function _createClass$4(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$4(Constructor.prototype, protoProps); if (staticProps) _defineProperties$4(Constructor, staticProps); return Constructor; }
4023
-
4024
- function _inherits$4(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$4(subClass, superClass); }
4025
-
4026
- function _setPrototypeOf$4(o, p) { _setPrototypeOf$4 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$4(o, p); }
4027
-
4028
- function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); return function _createSuperInternal() { var Super = _getPrototypeOf$4(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$4(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$4(this, result); }; }
4029
-
4030
- function _possibleConstructorReturn$4(self, call) { if (call && (_typeof$4(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$4(self); }
4031
-
4032
- function _assertThisInitialized$4(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4033
-
4034
- function _isNativeReflectConstruct$4() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4035
-
4036
- function _getPrototypeOf$4(o) { _getPrototypeOf$4 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$4(o); }
4037
-
4038
- function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4039
- var FractionOfSecondParser = /*#__PURE__*/function (_Parser) {
4040
- _inherits$4(FractionOfSecondParser, _Parser);
4041
-
4042
- var _super = _createSuper$4(FractionOfSecondParser);
4043
-
4044
- function FractionOfSecondParser() {
4045
- var _this;
4046
-
4047
- _classCallCheck$4(this, FractionOfSecondParser);
4048
-
4049
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4050
- args[_key] = arguments[_key];
4051
- }
4052
-
4053
- _this = _super.call.apply(_super, [this].concat(args));
4054
-
4055
- _defineProperty$4(_assertThisInitialized$4(_this), "priority", 30);
4056
-
4057
- _defineProperty$4(_assertThisInitialized$4(_this), "incompatibleTokens", ['t', 'T']);
4058
-
4059
- return _this;
4060
- }
4061
-
4062
- _createClass$4(FractionOfSecondParser, [{
4063
- key: "parse",
4064
- value: function parse(dateString, token) {
4065
- var valueCallback = function valueCallback(value) {
4066
- return Math.floor(value * Math.pow(10, -token.length + 3));
4067
- };
4068
-
4069
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
4070
- }
4071
- }, {
4072
- key: "set",
4073
- value: function set(date, _flags, value) {
4074
- date.setUTCMilliseconds(value);
4075
- return date;
4076
- }
4077
- }]);
4078
-
4079
- return FractionOfSecondParser;
4080
- }(Parser);
4081
-
4082
- function _typeof$3(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$3 = function _typeof(obj) { return typeof obj; }; } else { _typeof$3 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$3(obj); }
4083
-
4084
- function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4085
-
4086
- function _defineProperties$3(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4087
-
4088
- function _createClass$3(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$3(Constructor.prototype, protoProps); if (staticProps) _defineProperties$3(Constructor, staticProps); return Constructor; }
4089
-
4090
- function _inherits$3(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$3(subClass, superClass); }
4091
-
4092
- function _setPrototypeOf$3(o, p) { _setPrototypeOf$3 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$3(o, p); }
4093
-
4094
- function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf$3(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$3(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$3(this, result); }; }
4095
-
4096
- function _possibleConstructorReturn$3(self, call) { if (call && (_typeof$3(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$3(self); }
4097
-
4098
- function _assertThisInitialized$3(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4099
-
4100
- function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4101
-
4102
- function _getPrototypeOf$3(o) { _getPrototypeOf$3 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$3(o); }
4103
-
4104
- function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4105
-
4106
- var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser) {
4107
- _inherits$3(ISOTimezoneWithZParser, _Parser);
4108
-
4109
- var _super = _createSuper$3(ISOTimezoneWithZParser);
4110
-
4111
- function ISOTimezoneWithZParser() {
4112
- var _this;
4113
-
4114
- _classCallCheck$3(this, ISOTimezoneWithZParser);
4115
-
4116
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4117
- args[_key] = arguments[_key];
4118
- }
4119
-
4120
- _this = _super.call.apply(_super, [this].concat(args));
4121
-
4122
- _defineProperty$3(_assertThisInitialized$3(_this), "priority", 10);
4123
-
4124
- _defineProperty$3(_assertThisInitialized$3(_this), "incompatibleTokens", ['t', 'T', 'x']);
65
+ /**
66
+ * router
67
+ *
68
+ * Copyright (c) TanStack
69
+ *
70
+ * This source code is licensed under the MIT license found in the
71
+ * LICENSE.md file in the root directory of this source tree.
72
+ *
73
+ * @license MIT
74
+ */
4125
75
 
4126
- return _this;
76
+ function last(arr) {
77
+ return arr[arr.length - 1];
78
+ }
79
+ function warning(cond, message) {
80
+ if (cond) {
81
+ if (typeof console !== 'undefined') console.warn(message);
82
+ try {
83
+ throw new Error(message);
84
+ } catch {}
4127
85
  }
86
+ return true;
87
+ }
4128
88
 
4129
- _createClass$3(ISOTimezoneWithZParser, [{
4130
- key: "parse",
4131
- value: function parse(dateString, token) {
4132
- switch (token) {
4133
- case 'X':
4134
- return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
4135
-
4136
- case 'XX':
4137
- return parseTimezonePattern(timezonePatterns.basic, dateString);
4138
-
4139
- case 'XXXX':
4140
- return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
4141
-
4142
- case 'XXXXX':
4143
- return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
4144
-
4145
- case 'XXX':
4146
- default:
4147
- return parseTimezonePattern(timezonePatterns.extended, dateString);
4148
- }
4149
- }
4150
- }, {
4151
- key: "set",
4152
- value: function set(date, flags, value) {
4153
- if (flags.timestampIsSet) {
4154
- return date;
4155
- }
4156
-
4157
- return new Date(date.getTime() - value);
4158
- }
4159
- }]);
4160
-
4161
- return ISOTimezoneWithZParser;
4162
- }(Parser);
4163
-
4164
- function _typeof$2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
4165
-
4166
- function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4167
-
4168
- function _defineProperties$2(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4169
-
4170
- function _createClass$2(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$2(Constructor.prototype, protoProps); if (staticProps) _defineProperties$2(Constructor, staticProps); return Constructor; }
4171
-
4172
- function _inherits$2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$2(subClass, superClass); }
4173
-
4174
- function _setPrototypeOf$2(o, p) { _setPrototypeOf$2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$2(o, p); }
4175
-
4176
- function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf$2(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$2(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$2(this, result); }; }
4177
-
4178
- function _possibleConstructorReturn$2(self, call) { if (call && (_typeof$2(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$2(self); }
4179
-
4180
- function _assertThisInitialized$2(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4181
-
4182
- function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4183
-
4184
- function _getPrototypeOf$2(o) { _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$2(o); }
4185
-
4186
- function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4187
-
4188
- var ISOTimezoneParser = /*#__PURE__*/function (_Parser) {
4189
- _inherits$2(ISOTimezoneParser, _Parser);
4190
-
4191
- var _super = _createSuper$2(ISOTimezoneParser);
4192
-
4193
- function ISOTimezoneParser() {
4194
- var _this;
4195
-
4196
- _classCallCheck$2(this, ISOTimezoneParser);
4197
-
4198
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4199
- args[_key] = arguments[_key];
4200
- }
4201
-
4202
- _this = _super.call.apply(_super, [this].concat(args));
4203
-
4204
- _defineProperty$2(_assertThisInitialized$2(_this), "priority", 10);
4205
-
4206
- _defineProperty$2(_assertThisInitialized$2(_this), "incompatibleTokens", ['t', 'T', 'X']);
89
+ /**
90
+ * react-store
91
+ *
92
+ * Copyright (c) TanStack
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE.md file in the root directory of this source tree.
96
+ *
97
+ * @license MIT
98
+ */
4207
99
 
4208
- return _this;
100
+ function useStore(store, selector = d => d, compareShallow) {
101
+ const slice = withSelector.useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, compareShallow ? shallow : undefined);
102
+ return slice;
103
+ }
104
+ function shallow(objA, objB) {
105
+ if (Object.is(objA, objB)) {
106
+ return true;
4209
107
  }
4210
-
4211
- _createClass$2(ISOTimezoneParser, [{
4212
- key: "parse",
4213
- value: function parse(dateString, token) {
4214
- switch (token) {
4215
- case 'x':
4216
- return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
4217
-
4218
- case 'xx':
4219
- return parseTimezonePattern(timezonePatterns.basic, dateString);
4220
-
4221
- case 'xxxx':
4222
- return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
4223
-
4224
- case 'xxxxx':
4225
- return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
4226
-
4227
- case 'xxx':
4228
- default:
4229
- return parseTimezonePattern(timezonePatterns.extended, dateString);
4230
- }
4231
- }
4232
- }, {
4233
- key: "set",
4234
- value: function set(date, flags, value) {
4235
- if (flags.timestampIsSet) {
4236
- return date;
4237
- }
4238
-
4239
- return new Date(date.getTime() - value);
4240
- }
4241
- }]);
4242
-
4243
- return ISOTimezoneParser;
4244
- }(Parser);
4245
-
4246
- function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
4247
-
4248
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4249
-
4250
- function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4251
-
4252
- function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
4253
-
4254
- function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
4255
-
4256
- function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
4257
-
4258
- function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf$1(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$1(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$1(this, result); }; }
4259
-
4260
- function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
4261
-
4262
- function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4263
-
4264
- function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4265
-
4266
- function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
4267
-
4268
- function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4269
- var TimestampSecondsParser = /*#__PURE__*/function (_Parser) {
4270
- _inherits$1(TimestampSecondsParser, _Parser);
4271
-
4272
- var _super = _createSuper$1(TimestampSecondsParser);
4273
-
4274
- function TimestampSecondsParser() {
4275
- var _this;
4276
-
4277
- _classCallCheck$1(this, TimestampSecondsParser);
4278
-
4279
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4280
- args[_key] = arguments[_key];
4281
- }
4282
-
4283
- _this = _super.call.apply(_super, [this].concat(args));
4284
-
4285
- _defineProperty$1(_assertThisInitialized$1(_this), "priority", 40);
4286
-
4287
- _defineProperty$1(_assertThisInitialized$1(_this), "incompatibleTokens", '*');
4288
-
4289
- return _this;
108
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
109
+ return false;
4290
110
  }
4291
111
 
4292
- _createClass$1(TimestampSecondsParser, [{
4293
- key: "parse",
4294
- value: function parse(dateString) {
4295
- return parseAnyDigitsSigned(dateString);
4296
- }
4297
- }, {
4298
- key: "set",
4299
- value: function set(_date, _flags, value) {
4300
- return [new Date(value * 1000), {
4301
- timestampIsSet: true
4302
- }];
4303
- }
4304
- }]);
4305
-
4306
- return TimestampSecondsParser;
4307
- }(Parser);
4308
-
4309
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4310
-
4311
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4312
-
4313
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4314
-
4315
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
4316
-
4317
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
4318
-
4319
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
4320
-
4321
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
4322
-
4323
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
4324
-
4325
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4326
-
4327
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4328
-
4329
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4330
-
4331
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4332
- var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser) {
4333
- _inherits(TimestampMillisecondsParser, _Parser);
4334
-
4335
- var _super = _createSuper(TimestampMillisecondsParser);
4336
-
4337
- function TimestampMillisecondsParser() {
4338
- var _this;
4339
-
4340
- _classCallCheck(this, TimestampMillisecondsParser);
4341
-
4342
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4343
- args[_key] = arguments[_key];
4344
- }
112
+ // if (objA instanceof Map && objB instanceof Map) {
113
+ // if (objA.size !== objB.size) return false
4345
114
 
4346
- _this = _super.call.apply(_super, [this].concat(args));
115
+ // for (const [key, value] of objA) {
116
+ // if (!Object.is(value, objB.get(key))) {
117
+ // return false
118
+ // }
119
+ // }
120
+ // return true
121
+ // }
4347
122
 
4348
- _defineProperty(_assertThisInitialized(_this), "priority", 20);
123
+ // if (objA instanceof Set && objB instanceof Set) {
124
+ // if (objA.size !== objB.size) return false
4349
125
 
4350
- _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", '*');
126
+ // for (const value of objA) {
127
+ // if (!objB.has(value)) {
128
+ // return false
129
+ // }
130
+ // }
131
+ // return true
132
+ // }
4351
133
 
4352
- return _this;
134
+ const keysA = Object.keys(objA);
135
+ if (keysA.length !== Object.keys(objB).length) {
136
+ return false;
4353
137
  }
4354
-
4355
- _createClass(TimestampMillisecondsParser, [{
4356
- key: "parse",
4357
- value: function parse(dateString) {
4358
- return parseAnyDigitsSigned(dateString);
4359
- }
4360
- }, {
4361
- key: "set",
4362
- value: function set(_date, _flags, value) {
4363
- return [new Date(value), {
4364
- timestampIsSet: true
4365
- }];
138
+ for (let i = 0; i < keysA.length; i++) {
139
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
140
+ return false;
4366
141
  }
4367
- }]);
4368
-
4369
- return TimestampMillisecondsParser;
4370
- }(Parser);
142
+ }
143
+ return true;
144
+ }
4371
145
 
4372
- /*
4373
- * | | Unit | | Unit |
4374
- * |-----|--------------------------------|-----|--------------------------------|
4375
- * | a | AM, PM | A* | Milliseconds in day |
4376
- * | b | AM, PM, noon, midnight | B | Flexible day period |
4377
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
4378
- * | d | Day of month | D | Day of year |
4379
- * | e | Local day of week | E | Day of week |
4380
- * | f | | F* | Day of week in month |
4381
- * | g* | Modified Julian day | G | Era |
4382
- * | h | Hour [1-12] | H | Hour [0-23] |
4383
- * | i! | ISO day of week | I! | ISO week of year |
4384
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
4385
- * | k | Hour [1-24] | K | Hour [0-11] |
4386
- * | l* | (deprecated) | L | Stand-alone month |
4387
- * | m | Minute | M | Month |
4388
- * | n | | N | |
4389
- * | o! | Ordinal number modifier | O* | Timezone (GMT) |
4390
- * | p | | P | |
4391
- * | q | Stand-alone quarter | Q | Quarter |
4392
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
4393
- * | s | Second | S | Fraction of second |
4394
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
4395
- * | u | Extended year | U* | Cyclic year |
4396
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
4397
- * | w | Local week of year | W* | Week of month |
4398
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
4399
- * | y | Year (abs) | Y | Local week-numbering year |
4400
- * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
146
+ /**
147
+ * react-router
4401
148
  *
4402
- * Letters marked by * are not implemented but reserved by Unicode standard.
149
+ * Copyright (c) TanStack
150
+ *
151
+ * This source code is licensed under the MIT license found in the
152
+ * LICENSE.md file in the root directory of this source tree.
4403
153
  *
4404
- * Letters marked by ! are non-standard, but implemented by date-fns:
4405
- * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
4406
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
4407
- * i.e. 7 for Sunday, 1 for Monday, etc.
4408
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
4409
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
4410
- * `R` is supposed to be used in conjunction with `I` and `i`
4411
- * for universal ISO week-numbering date, whereas
4412
- * `Y` is supposed to be used in conjunction with `w` and `e`
4413
- * for week-numbering date specific to the locale.
154
+ * @license MIT
4414
155
  */
4415
-
4416
- ({
4417
- G: new EraParser(),
4418
- y: new YearParser(),
4419
- Y: new LocalWeekYearParser(),
4420
- R: new ISOWeekYearParser(),
4421
- u: new ExtendedYearParser(),
4422
- Q: new QuarterParser(),
4423
- q: new StandAloneQuarterParser(),
4424
- M: new MonthParser(),
4425
- L: new StandAloneMonthParser(),
4426
- w: new LocalWeekParser(),
4427
- I: new ISOWeekParser(),
4428
- d: new DateParser(),
4429
- D: new DayOfYearParser(),
4430
- E: new DayParser(),
4431
- e: new LocalDayParser(),
4432
- c: new StandAloneLocalDayParser(),
4433
- i: new ISODayParser(),
4434
- a: new AMPMParser(),
4435
- b: new AMPMMidnightParser(),
4436
- B: new DayPeriodParser(),
4437
- h: new Hour1to12Parser(),
4438
- H: new Hour0to23Parser(),
4439
- K: new Hour0To11Parser(),
4440
- k: new Hour1To24Parser(),
4441
- m: new MinuteParser(),
4442
- s: new SecondParser(),
4443
- S: new FractionOfSecondParser(),
4444
- X: new ISOTimezoneWithZParser(),
4445
- x: new ISOTimezoneParser(),
4446
- t: new TimestampSecondsParser(),
4447
- T: new TimestampMillisecondsParser()
4448
- });
156
+ const routerContext = /*#__PURE__*/React__namespace.createContext(null);
157
+ function useRouter() {
158
+ const value = React__namespace.useContext(routerContext);
159
+ warning(!value, 'useRouter must be used inside a <Router> component!');
160
+ return value.router;
161
+ }
162
+ function useRouterStore(selector, shallow) {
163
+ const router = useRouter();
164
+ return useStore(router.store, selector, shallow);
165
+ }
4449
166
 
4450
167
  const getItem = key => {
4451
168
  try {
@@ -4547,19 +264,8 @@
4547
264
 
4548
265
  const isServer$1 = typeof window === 'undefined';
4549
266
  function getStatusColor(match, theme) {
4550
- return match.store.state.isFetching ? theme.active : match.store.state.status === 'error' ? theme.danger : match.store.state.status === 'success' ? theme.success : theme.gray;
267
+ return match.store.state.status === 'pending' ? theme.active : match.store.state.status === 'error' ? theme.danger : match.store.state.status === 'success' ? theme.success : theme.gray;
4551
268
  }
4552
-
4553
- // export function getQueryStatusLabel(query: Query) {
4554
- // return query.state.isFetching
4555
- // ? 'fetching'
4556
- // : !query.getObserversCount()
4557
- // ? 'inactive'
4558
- // : query.isStale()
4559
- // ? 'stale'
4560
- // : 'fresh'
4561
- // }
4562
-
4563
269
  function styled(type, newStyles, queries = {}) {
4564
270
  return /*#__PURE__*/React__default["default"].forwardRef(({
4565
271
  style,
@@ -4633,25 +339,6 @@
4633
339
  throw error;
4634
340
  }));
4635
341
  }
4636
- function multiSortBy(arr, accessors = [d => d]) {
4637
- return arr.map((d, i) => [d, i]).sort(([a, ai], [b, bi]) => {
4638
- for (const accessor of accessors) {
4639
- const ao = accessor(a);
4640
- const bo = accessor(b);
4641
- if (typeof ao === 'undefined') {
4642
- if (typeof bo === 'undefined') {
4643
- continue;
4644
- }
4645
- return 1;
4646
- }
4647
- if (ao === bo) {
4648
- continue;
4649
- }
4650
- return ao > bo ? 1 : -1;
4651
- }
4652
- return ai - bi;
4653
- }).map(([d]) => d);
4654
- }
4655
342
 
4656
343
  const Panel = styled('div', (_props, theme) => ({
4657
344
  fontSize: 'clamp(12px, 1.5vw, 14px)',
@@ -5137,11 +824,22 @@
5137
824
  React__default["default"].useEffect(() => {
5138
825
  setActiveMatchId('');
5139
826
  }, [activeRouteId]);
5140
- const activeMatch = Object.values(router.store.state.matchCache)?.find(d => d.match.id === activeMatchId)?.match ?? router.store.state.currentMatches?.find(d => d.route.id === activeRouteId);
5141
- const matchCacheValues = multiSortBy(Object.keys(router.store.state.matchCache).filter(key => {
5142
- const cacheEntry = router.store.state.matchCache[key];
5143
- return cacheEntry.gc > Date.now();
5144
- }).map(key => router.store.state.matchCache[key]), [d => d.match.store.state.isFetching ? -1 : 1, d => -d.match.store.state.updatedAt]);
827
+ const allMatches = React__default["default"].useMemo(() => [...Object.values(router.store.state.currentMatches), ...Object.values(router.store.state.pendingMatches ?? [])], [router.store.state.currentMatches, router.store.state.pendingMatches]);
828
+ const activeMatch = allMatches?.find(d => d.id === activeMatchId) || allMatches?.find(d => d.route.id === activeRouteId);
829
+
830
+ // const matchCacheValues = multiSortBy(
831
+ // Object.keys(router.store.state.matchCache)
832
+ // .filter((key) => {
833
+ // const cacheEntry = router.store.state.matchCache[key]!
834
+ // return cacheEntry.gc > Date.now()
835
+ // })
836
+ // .map((key) => router.store.state.matchCache[key]!),
837
+ // [
838
+ // (d) => (d.match.store.state.isFetching ? -1 : 1),
839
+ // (d) => -d.match.store.state.updatedAt!,
840
+ // ],
841
+ // )
842
+
5145
843
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
5146
844
  theme: defaultTheme
5147
845
  }, /*#__PURE__*/React__default["default"].createElement(Panel, _extends({
@@ -5336,73 +1034,6 @@
5336
1034
  padding: '.5em'
5337
1035
  }
5338
1036
  }, `${match.id}`));
5339
- })) : null, matchCacheValues.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
5340
- style: {
5341
- marginTop: '2rem',
5342
- padding: '.5em',
5343
- background: defaultTheme.backgroundAlt,
5344
- position: 'sticky',
5345
- top: 0,
5346
- bottom: 0,
5347
- zIndex: 1,
5348
- display: 'flex',
5349
- alignItems: 'center',
5350
- justifyContent: 'space-between'
5351
- }
5352
- }, /*#__PURE__*/React__default["default"].createElement("div", null, "Match Cache"), /*#__PURE__*/React__default["default"].createElement(Button, {
5353
- onClick: () => {
5354
- router.store.setState(s => s.matchCache = {});
5355
- }
5356
- }, "Clear")), matchCacheValues.map((d, i) => {
5357
- const {
5358
- match,
5359
- gc
5360
- } = d;
5361
- return /*#__PURE__*/React__default["default"].createElement("div", {
5362
- key: match.id || i,
5363
- role: "button",
5364
- "aria-label": `Open match details for ${match.id}`,
5365
- onClick: () => setActiveMatchId(activeMatchId === match.id ? '' : match.id),
5366
- style: {
5367
- display: 'flex',
5368
- borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
5369
- cursor: 'pointer',
5370
- background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
5371
- }
5372
- }, /*#__PURE__*/React__default["default"].createElement("div", {
5373
- style: {
5374
- display: 'flex',
5375
- flexDirection: 'column',
5376
- padding: '.5rem',
5377
- gap: '.3rem'
5378
- }
5379
- }, /*#__PURE__*/React__default["default"].createElement("div", {
5380
- style: {
5381
- display: 'flex',
5382
- alignItems: 'center',
5383
- gap: '.5rem'
5384
- }
5385
- }, /*#__PURE__*/React__default["default"].createElement("div", {
5386
- style: {
5387
- flex: '0 0 auto',
5388
- width: '1.3rem',
5389
- height: '1.3rem',
5390
- background: getStatusColor(match, defaultTheme),
5391
- alignItems: 'center',
5392
- justifyContent: 'center',
5393
- fontWeight: 'bold',
5394
- borderRadius: '.25rem',
5395
- transition: 'all .2s ease-out'
5396
- }
5397
- }), /*#__PURE__*/React__default["default"].createElement(Code, null, `${match.id}`)), /*#__PURE__*/React__default["default"].createElement("span", {
5398
- style: {
5399
- fontSize: '.7rem',
5400
- opacity: '.5',
5401
- lineHeight: 1
5402
- }
5403
- }, "Expires", ' ', formatDistanceStrict(new Date(gc), new Date(), {
5404
- addSuffix: true
5405
- }))));
5406
1037
  })) : null), activeMatch ? /*#__PURE__*/React__default["default"].createElement(ActivePanel, null, /*#__PURE__*/React__default["default"].createElement("div", {
5407
1038
  style: {
5408
1039
  padding: '.5em',
@@ -5428,10 +1059,6 @@
5428
1059
  style: {
5429
1060
  opacity: '.5'
5430
1061
  }
5431
- }, "Invalid"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.getIsInvalid().toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
5432
- style: {
5433
- opacity: '.5'
5434
- }
5435
1062
  }, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.store.state.updatedAt ? new Date(activeMatch.store.state.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
5436
1063
  style: {
5437
1064
  background: defaultTheme.backgroundAlt,
@@ -5446,15 +1073,6 @@
5446
1073
  padding: '0.5em'
5447
1074
  }
5448
1075
  }, /*#__PURE__*/React__default["default"].createElement(Button, {
5449
- type: "button",
5450
- onClick: () => {
5451
- activeMatch.invalidate();
5452
- },
5453
- style: {
5454
- background: defaultTheme.warning,
5455
- color: defaultTheme.inputTextColor
5456
- }
5457
- }, "Invalidate"), ' ', /*#__PURE__*/React__default["default"].createElement(Button, {
5458
1076
  type: "button",
5459
1077
  onClick: () => activeMatch.load(),
5460
1078
  style: {
@@ -5496,29 +1114,6 @@
5496
1114
  bottom: 0,
5497
1115
  zIndex: 1
5498
1116
  }
5499
- }, "All Loader Data"), /*#__PURE__*/React__default["default"].createElement("div", {
5500
- style: {
5501
- padding: '.5em'
5502
- }
5503
- }, Object.keys(last(router.store.state.currentMatches)?.store.state.loaderData || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
5504
- value: last(router.store.state.currentMatches)?.store.state.loaderData || {},
5505
- defaultExpanded: Object.keys(last(router.store.state.currentMatches)?.store.state.loaderData || {}).reduce((obj, next) => {
5506
- obj[next] = {};
5507
- return obj;
5508
- }, {})
5509
- }) : /*#__PURE__*/React__default["default"].createElement("em", {
5510
- style: {
5511
- opacity: 0.5
5512
- }
5513
- }, '{ }')), /*#__PURE__*/React__default["default"].createElement("div", {
5514
- style: {
5515
- padding: '.5em',
5516
- background: defaultTheme.backgroundAlt,
5517
- position: 'sticky',
5518
- top: 0,
5519
- bottom: 0,
5520
- zIndex: 1
5521
- }
5522
1117
  }, "Search Params"), /*#__PURE__*/React__default["default"].createElement("div", {
5523
1118
  style: {
5524
1119
  padding: '.5em'