@tanstack/react-router-devtools 0.0.1-beta.8 → 0.0.1-beta.81

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.
Files changed (76) hide show
  1. package/LICENSE +21 -0
  2. package/build/cjs/{packages/react-router-devtools/src/Explorer.js → Explorer.js} +44 -61
  3. package/build/cjs/Explorer.js.map +1 -0
  4. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -18
  5. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  6. package/build/cjs/{packages/react-router-devtools/src/devtools.js → devtools.js} +176 -275
  7. package/build/cjs/devtools.js.map +1 -0
  8. package/build/cjs/{packages/react-router-devtools/src/index.js → index.js} +0 -0
  9. package/build/cjs/{packages/react-router-devtools/src/index.js.map → index.js.map} +0 -0
  10. package/build/cjs/{packages/react-router-devtools/src/styledComponents.js → styledComponents.js} +9 -37
  11. package/build/cjs/styledComponents.js.map +1 -0
  12. package/build/cjs/{packages/react-router-devtools/src/theme.js → theme.js} +5 -8
  13. package/build/cjs/theme.js.map +1 -0
  14. package/build/cjs/{packages/react-router-devtools/src/useLocalStorage.js → useLocalStorage.js} +2 -9
  15. package/build/cjs/useLocalStorage.js.map +1 -0
  16. package/build/cjs/{packages/react-router-devtools/src/useMediaQuery.js → useMediaQuery.js} +10 -13
  17. package/build/cjs/useMediaQuery.js.map +1 -0
  18. package/build/cjs/{packages/react-router-devtools/src/utils.js → utils.js} +24 -70
  19. package/build/cjs/utils.js.map +1 -0
  20. package/build/esm/index.js +268 -1319
  21. package/build/esm/index.js.map +1 -1
  22. package/build/stats-html.html +59 -49
  23. package/build/stats-react.json +324 -9463
  24. package/build/types/index.d.ts +4 -4
  25. package/build/umd/index.development.js +345 -1291
  26. package/build/umd/index.development.js.map +1 -1
  27. package/build/umd/index.production.js +43 -1
  28. package/build/umd/index.production.js.map +1 -1
  29. package/package.json +6 -8
  30. package/src/devtools.tsx +86 -87
  31. package/src/utils.ts +5 -17
  32. package/build/cjs/node_modules/date-fns/esm/_lib/assign/index.js +0 -30
  33. package/build/cjs/node_modules/date-fns/esm/_lib/assign/index.js.map +0 -1
  34. package/build/cjs/node_modules/date-fns/esm/_lib/cloneObject/index.js +0 -22
  35. package/build/cjs/node_modules/date-fns/esm/_lib/cloneObject/index.js.map +0 -1
  36. package/build/cjs/node_modules/date-fns/esm/_lib/defaultLocale/index.js +0 -20
  37. package/build/cjs/node_modules/date-fns/esm/_lib/defaultLocale/index.js.map +0 -1
  38. package/build/cjs/node_modules/date-fns/esm/_lib/defaultOptions/index.js +0 -21
  39. package/build/cjs/node_modules/date-fns/esm/_lib/defaultOptions/index.js.map +0 -1
  40. package/build/cjs/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -33
  41. package/build/cjs/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js.map +0 -1
  42. package/build/cjs/node_modules/date-fns/esm/_lib/requiredArgs/index.js +0 -22
  43. package/build/cjs/node_modules/date-fns/esm/_lib/requiredArgs/index.js.map +0 -1
  44. package/build/cjs/node_modules/date-fns/esm/compareAsc/index.js +0 -67
  45. package/build/cjs/node_modules/date-fns/esm/compareAsc/index.js.map +0 -1
  46. package/build/cjs/node_modules/date-fns/esm/formatDistanceStrict/index.js +0 -207
  47. package/build/cjs/node_modules/date-fns/esm/formatDistanceStrict/index.js.map +0 -1
  48. package/build/cjs/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js +0 -26
  49. package/build/cjs/node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js.map +0 -1
  50. package/build/cjs/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js +0 -39
  51. package/build/cjs/node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js.map +0 -1
  52. package/build/cjs/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js +0 -65
  53. package/build/cjs/node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js.map +0 -1
  54. package/build/cjs/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js +0 -34
  55. package/build/cjs/node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js.map +0 -1
  56. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js +0 -105
  57. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js.map +0 -1
  58. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js +0 -52
  59. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js.map +0 -1
  60. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js +0 -31
  61. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js.map +0 -1
  62. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js +0 -164
  63. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js.map +0 -1
  64. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js +0 -116
  65. package/build/cjs/node_modules/date-fns/esm/locale/en-US/_lib/match/index.js.map +0 -1
  66. package/build/cjs/node_modules/date-fns/esm/locale/en-US/index.js +0 -47
  67. package/build/cjs/node_modules/date-fns/esm/locale/en-US/index.js.map +0 -1
  68. package/build/cjs/node_modules/date-fns/esm/toDate/index.js +0 -70
  69. package/build/cjs/node_modules/date-fns/esm/toDate/index.js.map +0 -1
  70. package/build/cjs/packages/react-router-devtools/src/Explorer.js.map +0 -1
  71. package/build/cjs/packages/react-router-devtools/src/devtools.js.map +0 -1
  72. package/build/cjs/packages/react-router-devtools/src/styledComponents.js.map +0 -1
  73. package/build/cjs/packages/react-router-devtools/src/theme.js.map +0 -1
  74. package/build/cjs/packages/react-router-devtools/src/useLocalStorage.js.map +0 -1
  75. package/build/cjs/packages/react-router-devtools/src/useMediaQuery.js.map +0 -1
  76. package/build/cjs/packages/react-router-devtools/src/utils.js.map +0 -1
@@ -9,10 +9,10 @@
9
9
  * @license MIT
10
10
  */
11
11
  (function (global, factory) {
12
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@tanstack/react-router')) :
13
- typeof define === 'function' && define.amd ? define(['exports', 'react', '@tanstack/react-router'], factory) :
14
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouterDevtools = {}, global.React, global.ReactRouter));
15
- })(this, (function (exports, React, reactRouter) { 'use strict';
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('use-sync-external-store/shim/with-selector')) :
13
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'use-sync-external-store/shim/with-selector'], factory) :
14
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouterDevtools = {}, global.React, global.withSelector));
15
+ })(this, (function (exports, React, withSelector) { 'use strict';
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
18
 
@@ -34,894 +34,144 @@
34
34
  return Object.freeze(n);
35
35
  }
36
36
 
37
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
38
37
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
38
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
39
39
 
40
40
  function _extends() {
41
41
  _extends = Object.assign ? Object.assign.bind() : function (target) {
42
42
  for (var i = 1; i < arguments.length; i++) {
43
43
  var source = arguments[i];
44
-
45
44
  for (var key in source) {
46
45
  if (Object.prototype.hasOwnProperty.call(source, key)) {
47
46
  target[key] = source[key];
48
47
  }
49
48
  }
50
49
  }
51
-
52
50
  return target;
53
51
  };
54
52
  return _extends.apply(this, arguments);
55
53
  }
56
54
 
57
- function _objectWithoutPropertiesLoose(source, excluded) {
58
- if (source == null) return {};
59
- var target = {};
60
- var sourceKeys = Object.keys(source);
61
- var key, i;
62
-
63
- for (i = 0; i < sourceKeys.length; i++) {
64
- key = sourceKeys[i];
65
- if (excluded.indexOf(key) >= 0) continue;
66
- target[key] = source[key];
67
- }
68
-
69
- return target;
70
- }
71
-
72
- function requiredArgs(required, args) {
73
- if (args.length < required) {
74
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
75
- }
55
+ var prefix = 'Invariant failed';
56
+ function invariant(condition, message) {
57
+ if (condition) {
58
+ return;
59
+ }
60
+ var provided = typeof message === 'function' ? message() : message;
61
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
62
+ throw new Error(value);
76
63
  }
77
64
 
78
65
  /**
79
- * @name toDate
80
- * @category Common Helpers
81
- * @summary Convert the given argument to an instance of Date.
82
- *
83
- * @description
84
- * Convert the given argument to an instance of Date.
85
- *
86
- * If the argument is an instance of Date, the function returns its clone.
66
+ * store
87
67
  *
88
- * If the argument is a number, it is treated as a timestamp.
68
+ * Copyright (c) TanStack
89
69
  *
90
- * If the argument is none of the above, the function returns Invalid Date.
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.
91
72
  *
92
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
93
- *
94
- * @param {Date|Number} argument - the value to convert
95
- * @returns {Date} the parsed date in the local time zone
96
- * @throws {TypeError} 1 argument required
97
- *
98
- * @example
99
- * // Clone the date:
100
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
101
- * //=> Tue Feb 11 2014 11:30:30
102
- *
103
- * @example
104
- * // Convert the timestamp to date:
105
- * const result = toDate(1392098430000)
106
- * //=> Tue Feb 11 2014 11:30:30
73
+ * @license MIT
107
74
  */
75
+ function shallow(objA, objB) {
76
+ if (Object.is(objA, objB)) {
77
+ return true;
78
+ }
79
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
80
+ return false;
81
+ }
108
82
 
109
- function toDate(argument) {
110
- requiredArgs(1, arguments);
111
- var argStr = Object.prototype.toString.call(argument); // Clone the date
112
-
113
- if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
114
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
115
- return new Date(argument.getTime());
116
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
117
- return new Date(argument);
118
- } else {
119
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
120
- // eslint-disable-next-line no-console
121
- 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
122
-
123
- console.warn(new Error().stack);
83
+ // if (objA instanceof Map && objB instanceof Map) {
84
+ // if (objA.size !== objB.size) return false
85
+
86
+ // for (const [key, value] of objA) {
87
+ // if (!Object.is(value, objB.get(key))) {
88
+ // return false
89
+ // }
90
+ // }
91
+ // return true
92
+ // }
93
+
94
+ // if (objA instanceof Set && objB instanceof Set) {
95
+ // if (objA.size !== objB.size) return false
96
+
97
+ // for (const value of objA) {
98
+ // if (!objB.has(value)) {
99
+ // return false
100
+ // }
101
+ // }
102
+ // return true
103
+ // }
104
+
105
+ const keysA = Object.keys(objA);
106
+ if (keysA.length !== Object.keys(objB).length) {
107
+ return false;
108
+ }
109
+ for (let i = 0; i < keysA.length; i++) {
110
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
111
+ return false;
124
112
  }
125
-
126
- return new Date(NaN);
127
113
  }
128
- }
129
-
130
- var defaultOptions = {};
131
- function getDefaultOptions() {
132
- return defaultOptions;
114
+ return true;
133
115
  }
134
116
 
135
117
  /**
136
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
137
- * They usually appear for dates that denote time before the timezones were introduced
138
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
139
- * and GMT+01:00:00 after that date)
118
+ * router
140
119
  *
141
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
142
- * which would lead to incorrect calculations.
120
+ * Copyright (c) TanStack
143
121
  *
144
- * This function returns the timezone offset in milliseconds that takes seconds in account.
122
+ * This source code is licensed under the MIT license found in the
123
+ * LICENSE.md file in the root directory of this source tree.
124
+ *
125
+ * @license MIT
145
126
  */
146
- function getTimezoneOffsetInMilliseconds(date) {
147
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
148
- utcDate.setUTCFullYear(date.getFullYear());
149
- return date.getTime() - utcDate.getTime();
127
+
128
+ function last(arr) {
129
+ return arr[arr.length - 1];
150
130
  }
151
131
 
152
132
  /**
153
- * @name compareAsc
154
- * @category Common Helpers
155
- * @summary Compare the two dates and return -1, 0 or 1.
133
+ * react-store
156
134
  *
157
- * @description
158
- * Compare the two dates and return 1 if the first date is after the second,
159
- * -1 if the first date is before the second or 0 if dates are equal.
135
+ * Copyright (c) TanStack
160
136
  *
161
- * @param {Date|Number} dateLeft - the first date to compare
162
- * @param {Date|Number} dateRight - the second date to compare
163
- * @returns {Number} the result of the comparison
164
- * @throws {TypeError} 2 arguments required
165
- *
166
- * @example
167
- * // Compare 11 February 1987 and 10 July 1989:
168
- * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
169
- * //=> -1
137
+ * This source code is licensed under the MIT license found in the
138
+ * LICENSE.md file in the root directory of this source tree.
170
139
  *
171
- * @example
172
- * // Sort the array of dates:
173
- * const result = [
174
- * new Date(1995, 6, 2),
175
- * new Date(1987, 1, 11),
176
- * new Date(1989, 6, 10)
177
- * ].sort(compareAsc)
178
- * //=> [
179
- * // Wed Feb 11 1987 00:00:00,
180
- * // Mon Jul 10 1989 00:00:00,
181
- * // Sun Jul 02 1995 00:00:00
182
- * // ]
140
+ * @license MIT
183
141
  */
184
142
 
185
- function compareAsc(dirtyDateLeft, dirtyDateRight) {
186
- requiredArgs(2, arguments);
187
- var dateLeft = toDate(dirtyDateLeft);
188
- var dateRight = toDate(dirtyDateRight);
189
- var diff = dateLeft.getTime() - dateRight.getTime();
190
-
191
- if (diff < 0) {
192
- return -1;
193
- } else if (diff > 0) {
194
- return 1; // Return 0 if diff is 0; return NaN if diff is NaN
195
- } else {
196
- return diff;
197
- }
198
- }
199
-
200
- var formatDistanceLocale = {
201
- lessThanXSeconds: {
202
- one: 'less than a second',
203
- other: 'less than {{count}} seconds'
204
- },
205
- xSeconds: {
206
- one: '1 second',
207
- other: '{{count}} seconds'
208
- },
209
- halfAMinute: 'half a minute',
210
- lessThanXMinutes: {
211
- one: 'less than a minute',
212
- other: 'less than {{count}} minutes'
213
- },
214
- xMinutes: {
215
- one: '1 minute',
216
- other: '{{count}} minutes'
217
- },
218
- aboutXHours: {
219
- one: 'about 1 hour',
220
- other: 'about {{count}} hours'
221
- },
222
- xHours: {
223
- one: '1 hour',
224
- other: '{{count}} hours'
225
- },
226
- xDays: {
227
- one: '1 day',
228
- other: '{{count}} days'
229
- },
230
- aboutXWeeks: {
231
- one: 'about 1 week',
232
- other: 'about {{count}} weeks'
233
- },
234
- xWeeks: {
235
- one: '1 week',
236
- other: '{{count}} weeks'
237
- },
238
- aboutXMonths: {
239
- one: 'about 1 month',
240
- other: 'about {{count}} months'
241
- },
242
- xMonths: {
243
- one: '1 month',
244
- other: '{{count}} months'
245
- },
246
- aboutXYears: {
247
- one: 'about 1 year',
248
- other: 'about {{count}} years'
249
- },
250
- xYears: {
251
- one: '1 year',
252
- other: '{{count}} years'
253
- },
254
- overXYears: {
255
- one: 'over 1 year',
256
- other: 'over {{count}} years'
257
- },
258
- almostXYears: {
259
- one: 'almost 1 year',
260
- other: 'almost {{count}} years'
261
- }
262
- };
263
-
264
- var formatDistance = function (token, count, options) {
265
- var result;
266
- var tokenValue = formatDistanceLocale[token];
267
-
268
- if (typeof tokenValue === 'string') {
269
- result = tokenValue;
270
- } else if (count === 1) {
271
- result = tokenValue.one;
272
- } else {
273
- result = tokenValue.other.replace('{{count}}', count.toString());
274
- }
275
-
276
- if (options !== null && options !== void 0 && options.addSuffix) {
277
- if (options.comparison && options.comparison > 0) {
278
- return 'in ' + result;
279
- } else {
280
- return result + ' ago';
281
- }
282
- }
283
-
284
- return result;
285
- };
286
-
287
- var formatDistance$1 = formatDistance;
288
-
289
- function buildFormatLongFn(args) {
290
- return function () {
291
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
292
- // TODO: Remove String()
293
- var width = options.width ? String(options.width) : args.defaultWidth;
294
- var format = args.formats[width] || args.formats[args.defaultWidth];
295
- return format;
296
- };
143
+ function useStore(store, selector = d => d, compareShallow) {
144
+ const slice = withSelector.useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, compareShallow ? shallow : undefined);
145
+ return slice;
297
146
  }
298
147
 
299
- var dateFormats = {
300
- full: 'EEEE, MMMM do, y',
301
- long: 'MMMM do, y',
302
- medium: 'MMM d, y',
303
- short: 'MM/dd/yyyy'
304
- };
305
- var timeFormats = {
306
- full: 'h:mm:ss a zzzz',
307
- long: 'h:mm:ss a z',
308
- medium: 'h:mm:ss a',
309
- short: 'h:mm a'
310
- };
311
- var dateTimeFormats = {
312
- full: "{{date}} 'at' {{time}}",
313
- long: "{{date}} 'at' {{time}}",
314
- medium: '{{date}}, {{time}}',
315
- short: '{{date}}, {{time}}'
316
- };
317
- var formatLong = {
318
- date: buildFormatLongFn({
319
- formats: dateFormats,
320
- defaultWidth: 'full'
321
- }),
322
- time: buildFormatLongFn({
323
- formats: timeFormats,
324
- defaultWidth: 'full'
325
- }),
326
- dateTime: buildFormatLongFn({
327
- formats: dateTimeFormats,
328
- defaultWidth: 'full'
329
- })
330
- };
331
- var formatLong$1 = formatLong;
332
-
333
- var formatRelativeLocale = {
334
- lastWeek: "'last' eeee 'at' p",
335
- yesterday: "'yesterday at' p",
336
- today: "'today at' p",
337
- tomorrow: "'tomorrow at' p",
338
- nextWeek: "eeee 'at' p",
339
- other: 'P'
340
- };
341
-
342
- var formatRelative = function (token, _date, _baseDate, _options) {
343
- return formatRelativeLocale[token];
344
- };
345
-
346
- var formatRelative$1 = formatRelative;
347
-
348
- function buildLocalizeFn(args) {
349
- return function (dirtyIndex, options) {
350
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
351
- var valuesArray;
352
-
353
- if (context === 'formatting' && args.formattingValues) {
354
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
355
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
356
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
357
- } else {
358
- var _defaultWidth = args.defaultWidth;
359
-
360
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
361
-
362
- valuesArray = args.values[_width] || args.values[_defaultWidth];
363
- }
364
-
365
- 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!
366
-
367
- return valuesArray[index];
368
- };
369
- }
370
-
371
- var eraValues = {
372
- narrow: ['B', 'A'],
373
- abbreviated: ['BC', 'AD'],
374
- wide: ['Before Christ', 'Anno Domini']
375
- };
376
- var quarterValues = {
377
- narrow: ['1', '2', '3', '4'],
378
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
379
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
380
- }; // Note: in English, the names of days of the week and months are capitalized.
381
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
382
- // Generally, formatted dates should look like they are in the middle of a sentence,
383
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
384
-
385
- var monthValues = {
386
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
387
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
388
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
389
- };
390
- var dayValues = {
391
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
392
- short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
393
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
394
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
395
- };
396
- var dayPeriodValues = {
397
- narrow: {
398
- am: 'a',
399
- pm: 'p',
400
- midnight: 'mi',
401
- noon: 'n',
402
- morning: 'morning',
403
- afternoon: 'afternoon',
404
- evening: 'evening',
405
- night: 'night'
406
- },
407
- abbreviated: {
408
- am: 'AM',
409
- pm: 'PM',
410
- midnight: 'midnight',
411
- noon: 'noon',
412
- morning: 'morning',
413
- afternoon: 'afternoon',
414
- evening: 'evening',
415
- night: 'night'
416
- },
417
- wide: {
418
- am: 'a.m.',
419
- pm: 'p.m.',
420
- midnight: 'midnight',
421
- noon: 'noon',
422
- morning: 'morning',
423
- afternoon: 'afternoon',
424
- evening: 'evening',
425
- night: 'night'
426
- }
427
- };
428
- var formattingDayPeriodValues = {
429
- narrow: {
430
- am: 'a',
431
- pm: 'p',
432
- midnight: 'mi',
433
- noon: 'n',
434
- morning: 'in the morning',
435
- afternoon: 'in the afternoon',
436
- evening: 'in the evening',
437
- night: 'at night'
438
- },
439
- abbreviated: {
440
- am: 'AM',
441
- pm: 'PM',
442
- midnight: 'midnight',
443
- noon: 'noon',
444
- morning: 'in the morning',
445
- afternoon: 'in the afternoon',
446
- evening: 'in the evening',
447
- night: 'at night'
448
- },
449
- wide: {
450
- am: 'a.m.',
451
- pm: 'p.m.',
452
- midnight: 'midnight',
453
- noon: 'noon',
454
- morning: 'in the morning',
455
- afternoon: 'in the afternoon',
456
- evening: 'in the evening',
457
- night: 'at night'
458
- }
459
- };
460
-
461
- var ordinalNumber = function (dirtyNumber, _options) {
462
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
463
- // if they are different for different grammatical genders,
464
- // use `options.unit`.
465
- //
466
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
467
- // 'day', 'hour', 'minute', 'second'.
468
-
469
- var rem100 = number % 100;
470
-
471
- if (rem100 > 20 || rem100 < 10) {
472
- switch (rem100 % 10) {
473
- case 1:
474
- return number + 'st';
475
-
476
- case 2:
477
- return number + 'nd';
478
-
479
- case 3:
480
- return number + 'rd';
481
- }
482
- }
483
-
484
- return number + 'th';
485
- };
486
-
487
- var localize = {
488
- ordinalNumber: ordinalNumber,
489
- era: buildLocalizeFn({
490
- values: eraValues,
491
- defaultWidth: 'wide'
492
- }),
493
- quarter: buildLocalizeFn({
494
- values: quarterValues,
495
- defaultWidth: 'wide',
496
- argumentCallback: function (quarter) {
497
- return quarter - 1;
498
- }
499
- }),
500
- month: buildLocalizeFn({
501
- values: monthValues,
502
- defaultWidth: 'wide'
503
- }),
504
- day: buildLocalizeFn({
505
- values: dayValues,
506
- defaultWidth: 'wide'
507
- }),
508
- dayPeriod: buildLocalizeFn({
509
- values: dayPeriodValues,
510
- defaultWidth: 'wide',
511
- formattingValues: formattingDayPeriodValues,
512
- defaultFormattingWidth: 'wide'
513
- })
514
- };
515
- var localize$1 = localize;
516
-
517
- function buildMatchFn(args) {
518
- return function (string) {
519
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
520
- var width = options.width;
521
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
522
- var matchResult = string.match(matchPattern);
523
-
524
- if (!matchResult) {
525
- return null;
526
- }
527
-
528
- var matchedString = matchResult[0];
529
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
530
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
531
- return pattern.test(matchedString);
532
- }) : findKey(parsePatterns, function (pattern) {
533
- return pattern.test(matchedString);
534
- });
535
- var value;
536
- value = args.valueCallback ? args.valueCallback(key) : key;
537
- value = options.valueCallback ? options.valueCallback(value) : value;
538
- var rest = string.slice(matchedString.length);
539
- return {
540
- value: value,
541
- rest: rest
542
- };
543
- };
544
- }
545
-
546
- function findKey(object, predicate) {
547
- for (var key in object) {
548
- if (object.hasOwnProperty(key) && predicate(object[key])) {
549
- return key;
550
- }
551
- }
552
-
553
- return undefined;
554
- }
555
-
556
- function findIndex(array, predicate) {
557
- for (var key = 0; key < array.length; key++) {
558
- if (predicate(array[key])) {
559
- return key;
560
- }
561
- }
562
-
563
- return undefined;
564
- }
565
-
566
- function buildMatchPatternFn(args) {
567
- return function (string) {
568
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
569
- var matchResult = string.match(args.matchPattern);
570
- if (!matchResult) return null;
571
- var matchedString = matchResult[0];
572
- var parseResult = string.match(args.parsePattern);
573
- if (!parseResult) return null;
574
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
575
- value = options.valueCallback ? options.valueCallback(value) : value;
576
- var rest = string.slice(matchedString.length);
577
- return {
578
- value: value,
579
- rest: rest
580
- };
581
- };
582
- }
583
-
584
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
585
- var parseOrdinalNumberPattern = /\d+/i;
586
- var matchEraPatterns = {
587
- narrow: /^(b|a)/i,
588
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
589
- wide: /^(before christ|before common era|anno domini|common era)/i
590
- };
591
- var parseEraPatterns = {
592
- any: [/^b/i, /^(a|c)/i]
593
- };
594
- var matchQuarterPatterns = {
595
- narrow: /^[1234]/i,
596
- abbreviated: /^q[1234]/i,
597
- wide: /^[1234](th|st|nd|rd)? quarter/i
598
- };
599
- var parseQuarterPatterns = {
600
- any: [/1/i, /2/i, /3/i, /4/i]
601
- };
602
- var matchMonthPatterns = {
603
- narrow: /^[jfmasond]/i,
604
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
605
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
606
- };
607
- var parseMonthPatterns = {
608
- 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],
609
- 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]
610
- };
611
- var matchDayPatterns = {
612
- narrow: /^[smtwf]/i,
613
- short: /^(su|mo|tu|we|th|fr|sa)/i,
614
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
615
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
616
- };
617
- var parseDayPatterns = {
618
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
619
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
620
- };
621
- var matchDayPeriodPatterns = {
622
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
623
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
624
- };
625
- var parseDayPeriodPatterns = {
626
- any: {
627
- am: /^a/i,
628
- pm: /^p/i,
629
- midnight: /^mi/i,
630
- noon: /^no/i,
631
- morning: /morning/i,
632
- afternoon: /afternoon/i,
633
- evening: /evening/i,
634
- night: /night/i
635
- }
636
- };
637
- var match = {
638
- ordinalNumber: buildMatchPatternFn({
639
- matchPattern: matchOrdinalNumberPattern,
640
- parsePattern: parseOrdinalNumberPattern,
641
- valueCallback: function (value) {
642
- return parseInt(value, 10);
643
- }
644
- }),
645
- era: buildMatchFn({
646
- matchPatterns: matchEraPatterns,
647
- defaultMatchWidth: 'wide',
648
- parsePatterns: parseEraPatterns,
649
- defaultParseWidth: 'any'
650
- }),
651
- quarter: buildMatchFn({
652
- matchPatterns: matchQuarterPatterns,
653
- defaultMatchWidth: 'wide',
654
- parsePatterns: parseQuarterPatterns,
655
- defaultParseWidth: 'any',
656
- valueCallback: function (index) {
657
- return index + 1;
658
- }
659
- }),
660
- month: buildMatchFn({
661
- matchPatterns: matchMonthPatterns,
662
- defaultMatchWidth: 'wide',
663
- parsePatterns: parseMonthPatterns,
664
- defaultParseWidth: 'any'
665
- }),
666
- day: buildMatchFn({
667
- matchPatterns: matchDayPatterns,
668
- defaultMatchWidth: 'wide',
669
- parsePatterns: parseDayPatterns,
670
- defaultParseWidth: 'any'
671
- }),
672
- dayPeriod: buildMatchFn({
673
- matchPatterns: matchDayPeriodPatterns,
674
- defaultMatchWidth: 'any',
675
- parsePatterns: parseDayPeriodPatterns,
676
- defaultParseWidth: 'any'
677
- })
678
- };
679
- var match$1 = match;
680
-
681
148
  /**
682
- * @type {Locale}
683
- * @category Locales
684
- * @summary English locale (United States).
685
- * @language English
686
- * @iso-639-2 eng
687
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
688
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
689
- */
690
- var locale = {
691
- code: 'en-US',
692
- formatDistance: formatDistance$1,
693
- formatLong: formatLong$1,
694
- formatRelative: formatRelative$1,
695
- localize: localize$1,
696
- match: match$1,
697
- options: {
698
- weekStartsOn: 0
699
- /* Sunday */
700
- ,
701
- firstWeekContainsDate: 1
702
- }
703
- };
704
- var defaultLocale = locale;
705
-
706
- function assign(target, object) {
707
- if (target == null) {
708
- throw new TypeError('assign requires that input parameter not be null or undefined');
709
- }
710
-
711
- for (var property in object) {
712
- if (Object.prototype.hasOwnProperty.call(object, property)) {
713
- target[property] = object[property];
714
- }
715
- }
716
-
717
- return target;
718
- }
719
-
720
- function cloneObject(object) {
721
- return assign({}, object);
722
- }
723
-
724
- var MILLISECONDS_IN_MINUTE = 1000 * 60;
725
- var MINUTES_IN_DAY = 60 * 24;
726
- var MINUTES_IN_MONTH = MINUTES_IN_DAY * 30;
727
- var MINUTES_IN_YEAR = MINUTES_IN_DAY * 365;
728
- /**
729
- * @name formatDistanceStrict
730
- * @category Common Helpers
731
- * @summary Return the distance between the given dates in words.
732
- *
733
- * @description
734
- * Return the distance between the given dates in words, using strict units.
735
- * This is like `formatDistance`, but does not use helpers like 'almost', 'over',
736
- * 'less than' and the like.
737
- *
738
- * | Distance between dates | Result |
739
- * |------------------------|---------------------|
740
- * | 0 ... 59 secs | [0..59] seconds |
741
- * | 1 ... 59 mins | [1..59] minutes |
742
- * | 1 ... 23 hrs | [1..23] hours |
743
- * | 1 ... 29 days | [1..29] days |
744
- * | 1 ... 11 months | [1..11] months |
745
- * | 1 ... N years | [1..N] years |
746
- *
747
- * @param {Date|Number} date - the date
748
- * @param {Date|Number} baseDate - the date to compare with
749
- * @param {Object} [options] - an object with options.
750
- * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
751
- * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit
752
- * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units
753
- * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
754
- * @returns {String} the distance in words
755
- * @throws {TypeError} 2 arguments required
756
- * @throws {RangeError} `date` must not be Invalid Date
757
- * @throws {RangeError} `baseDate` must not be Invalid Date
758
- * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'
759
- * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'
760
- * @throws {RangeError} `options.locale` must contain `formatDistance` property
761
- *
762
- * @example
763
- * // What is the distance between 2 July 2014 and 1 January 2015?
764
- * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))
765
- * //=> '6 months'
766
- *
767
- * @example
768
- * // What is the distance between 1 January 2015 00:00:15
769
- * // and 1 January 2015 00:00:00?
770
- * const result = formatDistanceStrict(
771
- * new Date(2015, 0, 1, 0, 0, 15),
772
- * new Date(2015, 0, 1, 0, 0, 0)
773
- * )
774
- * //=> '15 seconds'
149
+ * react-router
775
150
  *
776
- * @example
777
- * // What is the distance from 1 January 2016
778
- * // to 1 January 2015, with a suffix?
779
- * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {
780
- * addSuffix: true
781
- * })
782
- * //=> '1 year ago'
151
+ * Copyright (c) TanStack
783
152
  *
784
- * @example
785
- * // What is the distance from 1 January 2016
786
- * // to 1 January 2015, in minutes?
787
- * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {
788
- * unit: 'minute'
789
- * })
790
- * //=> '525600 minutes'
791
- *
792
- * @example
793
- * // What is the distance from 1 January 2015
794
- * // to 28 January 2015, in months, rounded up?
795
- * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {
796
- * unit: 'month',
797
- * roundingMethod: 'ceil'
798
- * })
799
- * //=> '1 month'
153
+ * This source code is licensed under the MIT license found in the
154
+ * LICENSE.md file in the root directory of this source tree.
800
155
  *
801
- * @example
802
- * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
803
- * import { eoLocale } from 'date-fns/locale/eo'
804
- * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {
805
- * locale: eoLocale
806
- * })
807
- * //=> '1 jaro'
156
+ * @license MIT
808
157
  */
809
-
810
- function formatDistanceStrict(dirtyDate, dirtyBaseDate, options) {
811
- var _ref, _options$locale, _options$roundingMeth;
812
-
813
- requiredArgs(2, arguments);
814
- var defaultOptions = getDefaultOptions();
815
- var locale = (_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 : defaultLocale;
816
-
817
- if (!locale.formatDistance) {
818
- throw new RangeError('locale must contain localize.formatDistance property');
819
- }
820
-
821
- var comparison = compareAsc(dirtyDate, dirtyBaseDate);
822
-
823
- if (isNaN(comparison)) {
824
- throw new RangeError('Invalid time value');
825
- }
826
-
827
- var localizeOptions = assign(cloneObject(options), {
828
- addSuffix: Boolean(options === null || options === void 0 ? void 0 : options.addSuffix),
829
- comparison: comparison
830
- });
831
- var dateLeft;
832
- var dateRight;
833
-
834
- if (comparison > 0) {
835
- dateLeft = toDate(dirtyBaseDate);
836
- dateRight = toDate(dirtyDate);
837
- } else {
838
- dateLeft = toDate(dirtyDate);
839
- dateRight = toDate(dirtyBaseDate);
840
- }
841
-
842
- var roundingMethod = String((_options$roundingMeth = options === null || options === void 0 ? void 0 : options.roundingMethod) !== null && _options$roundingMeth !== void 0 ? _options$roundingMeth : 'round');
843
- var roundingMethodFn;
844
-
845
- if (roundingMethod === 'floor') {
846
- roundingMethodFn = Math.floor;
847
- } else if (roundingMethod === 'ceil') {
848
- roundingMethodFn = Math.ceil;
849
- } else if (roundingMethod === 'round') {
850
- roundingMethodFn = Math.round;
851
- } else {
852
- throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");
853
- }
854
-
855
- var milliseconds = dateRight.getTime() - dateLeft.getTime();
856
- var minutes = milliseconds / MILLISECONDS_IN_MINUTE;
857
- var timezoneOffset = getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft); // Use DST-normalized difference in minutes for years, months and days;
858
- // use regular difference in minutes for hours, minutes and seconds.
859
-
860
- var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE;
861
- var defaultUnit = options === null || options === void 0 ? void 0 : options.unit;
862
- var unit;
863
-
864
- if (!defaultUnit) {
865
- if (minutes < 1) {
866
- unit = 'second';
867
- } else if (minutes < 60) {
868
- unit = 'minute';
869
- } else if (minutes < MINUTES_IN_DAY) {
870
- unit = 'hour';
871
- } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) {
872
- unit = 'day';
873
- } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) {
874
- unit = 'month';
875
- } else {
876
- unit = 'year';
877
- }
878
- } else {
879
- unit = String(defaultUnit);
880
- } // 0 up to 60 seconds
881
-
882
-
883
- if (unit === 'second') {
884
- var seconds = roundingMethodFn(milliseconds / 1000);
885
- return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins
886
- } else if (unit === 'minute') {
887
- var roundedMinutes = roundingMethodFn(minutes);
888
- return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours
889
- } else if (unit === 'hour') {
890
- var hours = roundingMethodFn(minutes / 60);
891
- return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days
892
- } else if (unit === 'day') {
893
- var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY);
894
- return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months
895
- } else if (unit === 'month') {
896
- var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH);
897
- return months === 12 && defaultUnit !== 'month' ? locale.formatDistance('xYears', 1, localizeOptions) : locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date
898
- } else if (unit === 'year') {
899
- var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR);
900
- return locale.formatDistance('xYears', years, localizeOptions);
901
- }
902
-
903
- throw new RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'");
904
- }
158
+ const routerContext = /*#__PURE__*/React__namespace.createContext(null);
905
159
 
906
160
  const getItem = key => {
907
161
  try {
908
162
  const itemValue = localStorage.getItem(key);
909
-
910
163
  if (typeof itemValue === 'string') {
911
164
  return JSON.parse(itemValue);
912
165
  }
913
-
914
166
  return undefined;
915
- } catch (_unused) {
167
+ } catch {
916
168
  return undefined;
917
169
  }
918
170
  };
919
-
920
171
  function useLocalStorage(key, defaultValue) {
921
172
  const [value, setValue] = React__default["default"].useState();
922
173
  React__default["default"].useEffect(() => {
923
174
  const initialValue = getItem(key);
924
-
925
175
  if (typeof initialValue === 'undefined' || initialValue === null) {
926
176
  setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
927
177
  } else {
@@ -931,22 +181,18 @@
931
181
  const setter = React__default["default"].useCallback(updater => {
932
182
  setValue(old => {
933
183
  let newVal = updater;
934
-
935
184
  if (typeof updater == 'function') {
936
185
  newVal = updater(old);
937
186
  }
938
-
939
187
  try {
940
188
  localStorage.setItem(key, JSON.stringify(newVal));
941
- } catch (_unused2) {}
942
-
189
+ } catch {}
943
190
  return newVal;
944
191
  });
945
192
  }, [key]);
946
193
  return [value, setter];
947
194
  }
948
195
 
949
- const _excluded$3 = ["theme"];
950
196
  const defaultTheme = {
951
197
  background: '#0b1521',
952
198
  backgroundAlt: '#132337',
@@ -961,12 +207,10 @@
961
207
  warning: '#ffb200'
962
208
  };
963
209
  const ThemeContext = /*#__PURE__*/React__default["default"].createContext(defaultTheme);
964
- function ThemeProvider(_ref) {
965
- let {
966
- theme
967
- } = _ref,
968
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
969
-
210
+ function ThemeProvider({
211
+ theme,
212
+ ...rest
213
+ }) {
970
214
  return /*#__PURE__*/React__default["default"].createElement(ThemeContext.Provider, _extends({
971
215
  value: theme
972
216
  }, rest));
@@ -981,74 +225,62 @@
981
225
  if (typeof window !== 'undefined') {
982
226
  return window.matchMedia && window.matchMedia(query).matches;
983
227
  }
984
-
985
228
  return;
986
- }); // Watch for changes
229
+ });
987
230
 
231
+ // Watch for changes
988
232
  React__default["default"].useEffect(() => {
989
233
  if (typeof window !== 'undefined') {
990
234
  if (!window.matchMedia) {
991
235
  return;
992
- } // Create a matcher
993
-
994
-
995
- const matcher = window.matchMedia(query); // Create our handler
236
+ }
996
237
 
997
- const onChange = _ref => {
998
- let {
999
- matches
1000
- } = _ref;
1001
- return setIsMatch(matches);
1002
- }; // Listen for changes
238
+ // Create a matcher
239
+ const matcher = window.matchMedia(query);
1003
240
 
241
+ // Create our handler
242
+ const onChange = ({
243
+ matches
244
+ }) => setIsMatch(matches);
1004
245
 
246
+ // Listen for changes
1005
247
  matcher.addListener(onChange);
1006
248
  return () => {
1007
249
  // Stop listening for changes
1008
250
  matcher.removeListener(onChange);
1009
251
  };
1010
252
  }
1011
-
1012
253
  return;
1013
254
  }, [isMatch, query, setIsMatch]);
1014
255
  return isMatch;
1015
256
  }
1016
257
 
1017
- const _excluded$2 = ["style"];
1018
258
  const isServer$1 = typeof window === 'undefined';
1019
259
  function getStatusColor(match, theme) {
1020
- return match.isPending ? theme.warning : match.isFetching ? theme.active : match.status === 'error' ? theme.danger : match.status === 'success' ? theme.success : theme.gray;
1021
- } // export function getQueryStatusLabel(query: Query) {
1022
- // return query.state.isFetching
1023
- // ? 'fetching'
1024
- // : !query.getObserversCount()
1025
- // ? 'inactive'
1026
- // : query.isStale()
1027
- // ? 'stale'
1028
- // : 'fresh'
1029
- // }
1030
-
1031
- function styled(type, newStyles, queries) {
1032
- if (queries === void 0) {
1033
- queries = {};
1034
- }
1035
-
1036
- return /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
1037
- let {
1038
- style
1039
- } = _ref,
1040
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1041
-
260
+ return match.state.status === 'pending' ? theme.active : match.state.status === 'error' ? theme.danger : match.state.status === 'success' ? theme.success : theme.gray;
261
+ }
262
+ function styled(type, newStyles, queries = {}) {
263
+ return /*#__PURE__*/React__default["default"].forwardRef(({
264
+ style,
265
+ ...rest
266
+ }, ref) => {
1042
267
  const theme = useTheme();
1043
- const mediaStyles = Object.entries(queries).reduce((current, _ref2) => {
1044
- let [key, value] = _ref2;
268
+ const mediaStyles = Object.entries(queries).reduce((current, [key, value]) => {
1045
269
  // eslint-disable-next-line react-hooks/rules-of-hooks
1046
- return useMediaQuery(key) ? _extends({}, current, typeof value === 'function' ? value(rest, theme) : value) : current;
270
+ return useMediaQuery(key) ? {
271
+ ...current,
272
+ ...(typeof value === 'function' ? value(rest, theme) : value)
273
+ } : current;
1047
274
  }, {});
1048
- return /*#__PURE__*/React__default["default"].createElement(type, _extends({}, rest, {
1049
- style: _extends({}, typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles, style, mediaStyles),
275
+ return /*#__PURE__*/React__default["default"].createElement(type, {
276
+ ...rest,
277
+ style: {
278
+ ...(typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles),
279
+ ...style,
280
+ ...mediaStyles
281
+ },
1050
282
  ref
1051
- }));
283
+ });
1052
284
  });
1053
285
  }
1054
286
  function useIsMounted() {
@@ -1062,22 +294,22 @@
1062
294
  }, []);
1063
295
  return isMounted;
1064
296
  }
297
+
1065
298
  /**
1066
299
  * Displays a string regardless the type of the data
1067
300
  * @param {unknown} value Value to be stringified
1068
301
  */
1069
-
1070
302
  const displayValue = value => {
1071
303
  const name = Object.getOwnPropertyNames(Object(value));
1072
- const newValue = typeof value === 'bigint' ? value.toString() + "n" : value;
304
+ const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value;
1073
305
  return JSON.stringify(newValue, name);
1074
306
  };
307
+
1075
308
  /**
1076
309
  * This hook is a safe useState version which schedules state updates in microtasks
1077
310
  * to prevent updating a component state while React is rendering different components
1078
311
  * or when the component is not mounted anymore.
1079
312
  */
1080
-
1081
313
  function useSafeState(initialState) {
1082
314
  const isMounted = useIsMounted();
1083
315
  const [state, setState] = React__default["default"].useState(initialState);
@@ -1090,55 +322,20 @@
1090
322
  }, [isMounted]);
1091
323
  return [state, safeSetState];
1092
324
  }
325
+
1093
326
  /**
1094
327
  * Schedules a microtask.
1095
328
  * This can be useful to schedule state updates after rendering.
1096
329
  */
1097
-
1098
330
  function scheduleMicrotask(callback) {
1099
331
  Promise.resolve().then(callback).catch(error => setTimeout(() => {
1100
332
  throw error;
1101
333
  }));
1102
334
  }
1103
335
 
1104
- function multiSortBy(arr, accessors) {
1105
- if (accessors === void 0) {
1106
- accessors = [d => d];
1107
- }
1108
-
1109
- return arr.map((d, i) => [d, i]).sort((_ref3, _ref4) => {
1110
- let [a, ai] = _ref3;
1111
- let [b, bi] = _ref4;
1112
-
1113
- for (const accessor of accessors) {
1114
- const ao = accessor(a);
1115
- const bo = accessor(b);
1116
-
1117
- if (typeof ao === 'undefined') {
1118
- if (typeof bo === 'undefined') {
1119
- continue;
1120
- }
1121
-
1122
- return 1;
1123
- }
1124
-
1125
- if (ao === bo) {
1126
- continue;
1127
- }
1128
-
1129
- return ao > bo ? 1 : -1;
1130
- }
1131
-
1132
- return ai - bi;
1133
- }).map(_ref5 => {
1134
- let [d] = _ref5;
1135
- return d;
1136
- });
1137
- }
1138
-
1139
336
  const Panel = styled('div', (_props, theme) => ({
1140
337
  fontSize: 'clamp(12px, 1.5vw, 14px)',
1141
- fontFamily: "sans-serif",
338
+ fontFamily: `sans-serif`,
1142
339
  display: 'flex',
1143
340
  backgroundColor: theme.background,
1144
341
  color: theme.foreground
@@ -1147,10 +344,11 @@
1147
344
  flexDirection: 'column'
1148
345
  },
1149
346
  '(max-width: 600px)': {
1150
- fontSize: '.9em' // flexDirection: 'column',
1151
-
347
+ fontSize: '.9em'
348
+ // flexDirection: 'column',
1152
349
  }
1153
350
  });
351
+
1154
352
  const ActivePanel = styled('div', () => ({
1155
353
  flex: '1 1 500px',
1156
354
  display: 'flex',
@@ -1159,7 +357,7 @@
1159
357
  height: '100%'
1160
358
  }), {
1161
359
  '(max-width: 700px)': (_props, theme) => ({
1162
- borderTop: "2px solid " + theme.gray
360
+ borderTop: `2px solid ${theme.gray}`
1163
361
  })
1164
362
  });
1165
363
  const Button = styled('button', (props, theme) => ({
@@ -1173,10 +371,13 @@
1173
371
  padding: '.5em',
1174
372
  opacity: props.disabled ? '.5' : undefined,
1175
373
  cursor: 'pointer'
1176
- })); // export const QueryKeys = styled('span', {
374
+ }));
375
+
376
+ // export const QueryKeys = styled('span', {
1177
377
  // display: 'inline-block',
1178
378
  // fontSize: '0.9em',
1179
379
  // })
380
+
1180
381
  // export const QueryKey = styled('span', {
1181
382
  // display: 'inline-flex',
1182
383
  // alignItems: 'center',
@@ -1189,40 +390,7 @@
1189
390
  const Code = styled('code', {
1190
391
  fontSize: '.9em'
1191
392
  });
1192
- styled('input', (_props, theme) => ({
1193
- backgroundColor: theme.inputBackgroundColor,
1194
- border: 0,
1195
- borderRadius: '.2em',
1196
- color: theme.inputTextColor,
1197
- fontSize: '.9em',
1198
- lineHeight: "1.3",
1199
- padding: '.3em .4em'
1200
- }));
1201
- styled('select', (_props, theme) => ({
1202
- display: "inline-block",
1203
- fontSize: ".9em",
1204
- fontFamily: "sans-serif",
1205
- fontWeight: 'normal',
1206
- lineHeight: "1.3",
1207
- padding: ".3em 1.5em .3em .5em",
1208
- height: 'auto',
1209
- border: 0,
1210
- borderRadius: ".2em",
1211
- appearance: "none",
1212
- WebkitAppearance: 'none',
1213
- backgroundColor: theme.inputBackgroundColor,
1214
- backgroundImage: "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")",
1215
- backgroundRepeat: "no-repeat",
1216
- backgroundPosition: "right .55em center",
1217
- backgroundSize: ".65em auto, 100%",
1218
- color: theme.inputTextColor
1219
- }), {
1220
- '(max-width: 500px)': {
1221
- display: 'none'
1222
- }
1223
- });
1224
393
 
1225
- const _excluded$1 = ["value", "defaultExpanded", "renderer", "pageSize"];
1226
394
  const Entry = styled('div', {
1227
395
  fontFamily: 'Menlo, monospace',
1228
396
  fontSize: '.7rem',
@@ -1258,20 +426,17 @@
1258
426
  color: 'grey',
1259
427
  fontSize: '.7em'
1260
428
  });
1261
- const Expander = _ref => {
1262
- let {
1263
- expanded,
1264
- style = {}
1265
- } = _ref;
1266
- return /*#__PURE__*/React__namespace.createElement("span", {
1267
- style: _extends({
1268
- display: 'inline-block',
1269
- transition: 'all .1s ease',
1270
- transform: "rotate(" + (expanded ? 90 : 0) + "deg) " + (style.transform || '')
1271
- }, style)
1272
- }, "\u25B6");
1273
- };
1274
-
429
+ const Expander = ({
430
+ expanded,
431
+ style = {}
432
+ }) => /*#__PURE__*/React__namespace.createElement("span", {
433
+ style: {
434
+ display: 'inline-block',
435
+ transition: 'all .1s ease',
436
+ transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
437
+ ...style
438
+ }
439
+ }, "\u25B6");
1275
440
  /**
1276
441
  * Chunk elements in the array by size
1277
442
  *
@@ -1285,39 +450,34 @@
1285
450
  if (size < 1) return [];
1286
451
  let i = 0;
1287
452
  const result = [];
1288
-
1289
453
  while (i < array.length) {
1290
454
  result.push(array.slice(i, i + size));
1291
455
  i = i + size;
1292
456
  }
1293
-
1294
457
  return result;
1295
458
  }
1296
- const DefaultRenderer = _ref2 => {
1297
- let {
1298
- handleEntry,
1299
- label,
1300
- value,
1301
- subEntries = [],
1302
- subEntryPages = [],
1303
- type,
1304
- expanded = false,
1305
- toggleExpanded,
1306
- pageSize,
1307
- renderer
1308
- } = _ref2;
459
+ const DefaultRenderer = ({
460
+ handleEntry,
461
+ label,
462
+ value,
463
+ subEntries = [],
464
+ subEntryPages = [],
465
+ type,
466
+ expanded = false,
467
+ toggleExpanded,
468
+ pageSize,
469
+ renderer
470
+ }) => {
1309
471
  const [expandedPages, setExpandedPages] = React__namespace.useState([]);
1310
472
  const [valueSnapshot, setValueSnapshot] = React__namespace.useState(undefined);
1311
-
1312
473
  const refreshValueSnapshot = () => {
1313
474
  setValueSnapshot(value());
1314
475
  };
1315
-
1316
476
  return /*#__PURE__*/React__namespace.createElement(Entry, null, subEntryPages.length ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ExpandButton, {
1317
477
  onClick: () => toggleExpanded()
1318
478
  }, /*#__PURE__*/React__namespace.createElement(Expander, {
1319
479
  expanded: expanded
1320
- }), " ", label, ' ', /*#__PURE__*/React__namespace.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? "items" : "item")), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntries.map((entry, index) => handleEntry(entry))) : /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React__namespace.createElement("div", {
480
+ }), " ", label, ' ', /*#__PURE__*/React__namespace.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? `items` : `item`)), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntries.map((entry, index) => handleEntry(entry))) : /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React__namespace.createElement("div", {
1321
481
  key: index
1322
482
  }, /*#__PURE__*/React__namespace.createElement(Entry, null, /*#__PURE__*/React__namespace.createElement(LabelButton, {
1323
483
  onClick: () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index])
@@ -1337,34 +497,29 @@
1337
497
  defaultExpanded: {}
1338
498
  })) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Label, null, label, ":"), " ", /*#__PURE__*/React__namespace.createElement(Value, null, displayValue(value))));
1339
499
  };
1340
-
1341
500
  function isIterable(x) {
1342
501
  return Symbol.iterator in x;
1343
502
  }
1344
-
1345
- function Explorer(_ref3) {
1346
- let {
1347
- value,
1348
- defaultExpanded,
1349
- renderer = DefaultRenderer,
1350
- pageSize = 100
1351
- } = _ref3,
1352
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
1353
-
503
+ function Explorer({
504
+ value,
505
+ defaultExpanded,
506
+ renderer = DefaultRenderer,
507
+ pageSize = 100,
508
+ ...rest
509
+ }) {
1354
510
  const [expanded, setExpanded] = React__namespace.useState(Boolean(defaultExpanded));
1355
511
  const toggleExpanded = React__namespace.useCallback(() => setExpanded(old => !old), []);
1356
512
  let type = typeof value;
1357
513
  let subEntries = [];
1358
-
1359
514
  const makeProperty = sub => {
1360
515
  const subDefaultExpanded = defaultExpanded === true ? {
1361
516
  [sub.label]: true
1362
- } : defaultExpanded == null ? void 0 : defaultExpanded[sub.label];
1363
- return _extends({}, sub, {
517
+ } : defaultExpanded?.[sub.label];
518
+ return {
519
+ ...sub,
1364
520
  defaultExpanded: subDefaultExpanded
1365
- });
521
+ };
1366
522
  };
1367
-
1368
523
  if (Array.isArray(value)) {
1369
524
  type = 'array';
1370
525
  subEntries = value.map((d, i) => makeProperty({
@@ -1379,17 +534,13 @@
1379
534
  }));
1380
535
  } else if (typeof value === 'object' && value !== null) {
1381
536
  type = 'object';
1382
- subEntries = Object.entries(value).map(_ref4 => {
1383
- let [key, val] = _ref4;
1384
- return makeProperty({
1385
- label: key,
1386
- value: val
1387
- });
1388
- });
537
+ subEntries = Object.entries(value).map(([key, val]) => makeProperty({
538
+ label: key,
539
+ value: val
540
+ }));
1389
541
  }
1390
-
1391
542
  const subEntryPages = chunkArray(subEntries, pageSize);
1392
- return renderer(_extends({
543
+ return renderer({
1393
544
  handleEntry: entry => /*#__PURE__*/React__namespace.createElement(Explorer, _extends({
1394
545
  key: entry.label,
1395
546
  value: value,
@@ -1401,51 +552,50 @@
1401
552
  value,
1402
553
  expanded,
1403
554
  toggleExpanded,
1404
- pageSize
1405
- }, rest));
555
+ pageSize,
556
+ ...rest
557
+ });
1406
558
  }
1407
559
 
1408
- const _excluded = ["style"],
1409
- _excluded2 = ["style", "onClick"],
1410
- _excluded3 = ["style", "onClick"],
1411
- _excluded4 = ["isOpen", "setIsOpen", "handleDragStart", "router"];
1412
560
  const isServer = typeof window === 'undefined';
1413
-
1414
561
  function Logo(props) {
1415
- var _props$style;
1416
-
1417
562
  return /*#__PURE__*/React__default["default"].createElement("div", _extends({}, props, {
1418
- style: _extends({}, (_props$style = props.style) != null ? _props$style : {}, {
563
+ style: {
564
+ ...(props.style ?? {}),
1419
565
  display: 'flex',
1420
566
  alignItems: 'center',
1421
567
  flexDirection: 'column',
1422
- fontSize: '0.7rem',
1423
- fontWeight: '900',
568
+ fontSize: '0.8rem',
569
+ fontWeight: 'bolder',
1424
570
  lineHeight: '1'
1425
- })
571
+ }
1426
572
  }), /*#__PURE__*/React__default["default"].createElement("div", {
1427
573
  style: {
1428
574
  letterSpacing: '-0.05rem'
1429
575
  }
1430
576
  }, "TANSTACK"), /*#__PURE__*/React__default["default"].createElement("div", {
1431
- className: "text-transparent bg-clip-text bg-gradient-to-r from-lime-500 to-emerald-500",
1432
577
  style: {
578
+ backgroundImage: 'linear-gradient(to right, var(--tw-gradient-stops))',
579
+ // @ts-ignore
580
+ '--tw-gradient-from': '#84cc16',
581
+ '--tw-gradient-stops': 'var(--tw-gradient-from), var(--tw-gradient-to)',
582
+ '--tw-gradient-to': '#10b981',
583
+ WebkitBackgroundClip: 'text',
584
+ color: 'transparent',
1433
585
  letterSpacing: '0.1rem',
1434
586
  marginRight: '-0.2rem'
1435
587
  }
1436
588
  }, "ROUTER"));
1437
589
  }
1438
-
1439
- function TanStackRouterDevtools(_ref) {
1440
- let {
1441
- initialIsOpen,
1442
- panelProps = {},
1443
- closeButtonProps = {},
1444
- toggleButtonProps = {},
1445
- position = 'bottom-left',
1446
- containerElement: Container = 'footer',
1447
- router
1448
- } = _ref;
590
+ function TanStackRouterDevtools({
591
+ initialIsOpen,
592
+ panelProps = {},
593
+ closeButtonProps = {},
594
+ toggleButtonProps = {},
595
+ position = 'bottom-left',
596
+ containerElement: Container = 'footer',
597
+ router
598
+ }) {
1449
599
  const rootRef = React__default["default"].useRef(null);
1450
600
  const panelRef = React__default["default"].useRef(null);
1451
601
  const [isOpen, setIsOpen] = useLocalStorage('tanstackRouterDevtoolsOpen', initialIsOpen);
@@ -1453,61 +603,51 @@
1453
603
  const [isResolvedOpen, setIsResolvedOpen] = useSafeState(false);
1454
604
  const [isResizing, setIsResizing] = useSafeState(false);
1455
605
  const isMounted = useIsMounted();
1456
-
1457
- const _handleDragStart = (panelElement, startEvent) => {
1458
- var _panelElement$getBoun;
1459
-
606
+ const handleDragStart = (panelElement, startEvent) => {
1460
607
  if (startEvent.button !== 0) return; // Only allow left click for drag
1461
608
 
1462
609
  setIsResizing(true);
1463
610
  const dragInfo = {
1464
- originalHeight: (_panelElement$getBoun = panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) != null ? _panelElement$getBoun : 0,
611
+ originalHeight: panelElement?.getBoundingClientRect().height ?? 0,
1465
612
  pageY: startEvent.pageY
1466
613
  };
1467
-
1468
614
  const run = moveEvent => {
1469
615
  const delta = dragInfo.pageY - moveEvent.pageY;
1470
- const newHeight = (dragInfo == null ? void 0 : dragInfo.originalHeight) + delta;
616
+ const newHeight = dragInfo?.originalHeight + delta;
1471
617
  setDevtoolsHeight(newHeight);
1472
-
1473
618
  if (newHeight < 70) {
1474
619
  setIsOpen(false);
1475
620
  } else {
1476
621
  setIsOpen(true);
1477
622
  }
1478
623
  };
1479
-
1480
624
  const unsub = () => {
1481
625
  setIsResizing(false);
1482
626
  document.removeEventListener('mousemove', run);
1483
627
  document.removeEventListener('mouseUp', unsub);
1484
628
  };
1485
-
1486
629
  document.addEventListener('mousemove', run);
1487
630
  document.addEventListener('mouseup', unsub);
1488
631
  };
1489
-
1490
632
  React__default["default"].useEffect(() => {
1491
- setIsResolvedOpen(isOpen != null ? isOpen : false);
1492
- }, [isOpen, isResolvedOpen, setIsResolvedOpen]); // Toggle panel visibility before/after transition (depending on direction).
1493
- // Prevents focusing in a closed panel.
633
+ setIsResolvedOpen(isOpen ?? false);
634
+ }, [isOpen, isResolvedOpen, setIsResolvedOpen]);
1494
635
 
636
+ // Toggle panel visibility before/after transition (depending on direction).
637
+ // Prevents focusing in a closed panel.
1495
638
  React__default["default"].useEffect(() => {
1496
639
  const ref = panelRef.current;
1497
-
1498
640
  if (ref) {
1499
641
  const handlePanelTransitionStart = () => {
1500
642
  if (ref && isResolvedOpen) {
1501
643
  ref.style.visibility = 'visible';
1502
644
  }
1503
645
  };
1504
-
1505
646
  const handlePanelTransitionEnd = () => {
1506
647
  if (ref && !isResolvedOpen) {
1507
648
  ref.style.visibility = 'hidden';
1508
649
  }
1509
650
  };
1510
-
1511
651
  ref.addEventListener('transitionstart', handlePanelTransitionStart);
1512
652
  ref.addEventListener('transitionend', handlePanelTransitionEnd);
1513
653
  return () => {
@@ -1515,62 +655,46 @@
1515
655
  ref.removeEventListener('transitionend', handlePanelTransitionEnd);
1516
656
  };
1517
657
  }
1518
-
1519
658
  return;
1520
659
  }, [isResolvedOpen]);
1521
660
  React__default["default"][isServer ? 'useEffect' : 'useLayoutEffect'](() => {
1522
661
  if (isResolvedOpen) {
1523
- var _rootRef$current, _rootRef$current$pare;
1524
-
1525
- const previousValue = (_rootRef$current = rootRef.current) == null ? void 0 : (_rootRef$current$pare = _rootRef$current.parentElement) == null ? void 0 : _rootRef$current$pare.style.paddingBottom;
1526
-
662
+ const previousValue = rootRef.current?.parentElement?.style.paddingBottom;
1527
663
  const run = () => {
1528
- var _panelRef$current, _rootRef$current2;
1529
-
1530
- const containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height;
1531
-
1532
- if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
1533
- rootRef.current.parentElement.style.paddingBottom = containerHeight + "px";
664
+ const containerHeight = panelRef.current?.getBoundingClientRect().height;
665
+ if (rootRef.current?.parentElement) {
666
+ rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
1534
667
  }
1535
668
  };
1536
-
1537
669
  run();
1538
-
1539
670
  if (typeof window !== 'undefined') {
1540
671
  window.addEventListener('resize', run);
1541
672
  return () => {
1542
- var _rootRef$current3;
1543
-
1544
673
  window.removeEventListener('resize', run);
1545
-
1546
- if ((_rootRef$current3 = rootRef.current) != null && _rootRef$current3.parentElement && typeof previousValue === 'string') {
674
+ if (rootRef.current?.parentElement && typeof previousValue === 'string') {
1547
675
  rootRef.current.parentElement.style.paddingBottom = previousValue;
1548
676
  }
1549
677
  };
1550
678
  }
1551
679
  }
1552
-
1553
680
  return;
1554
681
  }, [isResolvedOpen]);
1555
-
1556
682
  const {
1557
- style: panelStyle = {}
1558
- } = panelProps,
1559
- otherPanelProps = _objectWithoutPropertiesLoose(panelProps, _excluded);
1560
-
683
+ style: panelStyle = {},
684
+ ...otherPanelProps
685
+ } = panelProps;
1561
686
  const {
1562
687
  style: closeButtonStyle = {},
1563
- onClick: onCloseClick
1564
- } = closeButtonProps,
1565
- otherCloseButtonProps = _objectWithoutPropertiesLoose(closeButtonProps, _excluded2);
1566
-
688
+ onClick: onCloseClick,
689
+ ...otherCloseButtonProps
690
+ } = closeButtonProps;
1567
691
  const {
1568
692
  style: toggleButtonStyle = {},
1569
- onClick: onToggleClick
1570
- } = toggleButtonProps,
1571
- otherToggleButtonProps = _objectWithoutPropertiesLoose(toggleButtonProps, _excluded3); // Do not render on the server
1572
-
693
+ onClick: onToggleClick,
694
+ ...otherToggleButtonProps
695
+ } = toggleButtonProps;
1573
696
 
697
+ // Do not render on the server
1574
698
  if (!isMounted()) return null;
1575
699
  return /*#__PURE__*/React__default["default"].createElement(Container, {
1576
700
  ref: rootRef,
@@ -1581,35 +705,38 @@
1581
705
  ref: panelRef
1582
706
  }, otherPanelProps, {
1583
707
  router: router,
1584
- style: _extends({
708
+ style: {
1585
709
  position: 'fixed',
1586
710
  bottom: '0',
1587
711
  right: '0',
1588
712
  zIndex: 99999,
1589
713
  width: '100%',
1590
- height: devtoolsHeight != null ? devtoolsHeight : 500,
714
+ height: devtoolsHeight ?? 500,
1591
715
  maxHeight: '90%',
1592
716
  boxShadow: '0 0 20px rgba(0,0,0,.3)',
1593
- borderTop: "1px solid " + defaultTheme.gray,
717
+ borderTop: `1px solid ${defaultTheme.gray}`,
1594
718
  transformOrigin: 'top',
1595
719
  // visibility will be toggled after transitions, but set initial state here
1596
- visibility: isOpen ? 'visible' : 'hidden'
1597
- }, panelStyle, isResizing ? {
1598
- transition: "none"
1599
- } : {
1600
- transition: "all .2s ease"
1601
- }, isResolvedOpen ? {
1602
- opacity: 1,
1603
- pointerEvents: 'all',
1604
- transform: "translateY(0) scale(1)"
1605
- } : {
1606
- opacity: 0,
1607
- pointerEvents: 'none',
1608
- transform: "translateY(15px) scale(1.02)"
1609
- }),
720
+ visibility: isOpen ? 'visible' : 'hidden',
721
+ ...panelStyle,
722
+ ...(isResizing ? {
723
+ transition: `none`
724
+ } : {
725
+ transition: `all .2s ease`
726
+ }),
727
+ ...(isResolvedOpen ? {
728
+ opacity: 1,
729
+ pointerEvents: 'all',
730
+ transform: `translateY(0) scale(1)`
731
+ } : {
732
+ opacity: 0,
733
+ pointerEvents: 'none',
734
+ transform: `translateY(15px) scale(1.02)`
735
+ })
736
+ },
1610
737
  isOpen: isResolvedOpen,
1611
738
  setIsOpen: setIsOpen,
1612
- handleDragStart: e => _handleDragStart(panelRef.current, e)
739
+ handleDragStart: e => handleDragStart(panelRef.current, e)
1613
740
  })), isResolvedOpen ? /*#__PURE__*/React__default["default"].createElement(Button, _extends({
1614
741
  type: "button",
1615
742
  "aria-label": "Close TanStack Router Devtools"
@@ -1618,20 +745,22 @@
1618
745
  setIsOpen(false);
1619
746
  onCloseClick && onCloseClick(e);
1620
747
  },
1621
- style: _extends({
748
+ style: {
1622
749
  position: 'fixed',
1623
750
  zIndex: 99999,
1624
751
  margin: '.5em',
1625
- bottom: 0
1626
- }, position === 'top-right' ? {
1627
- right: '0'
1628
- } : position === 'top-left' ? {
1629
- left: '0'
1630
- } : position === 'bottom-right' ? {
1631
- right: '0'
1632
- } : {
1633
- left: '0'
1634
- }, closeButtonStyle)
752
+ bottom: 0,
753
+ ...(position === 'top-right' ? {
754
+ right: '0'
755
+ } : position === 'top-left' ? {
756
+ left: '0'
757
+ } : position === 'bottom-right' ? {
758
+ right: '0'
759
+ } : {
760
+ left: '0'
761
+ }),
762
+ ...closeButtonStyle
763
+ }
1635
764
  }), "Close") : null), !isResolvedOpen ? /*#__PURE__*/React__default["default"].createElement("button", _extends({
1636
765
  type: "button"
1637
766
  }, otherToggleButtonProps, {
@@ -1640,7 +769,7 @@
1640
769
  setIsOpen(true);
1641
770
  onToggleClick && onToggleClick(e);
1642
771
  },
1643
- style: _extends({
772
+ style: {
1644
773
  appearance: 'none',
1645
774
  background: 'none',
1646
775
  border: 0,
@@ -1651,65 +780,95 @@
1651
780
  fontSize: '1.5em',
1652
781
  margin: '.5em',
1653
782
  cursor: 'pointer',
1654
- width: 'fit-content'
1655
- }, position === 'top-right' ? {
1656
- top: '0',
1657
- right: '0'
1658
- } : position === 'top-left' ? {
1659
- top: '0',
1660
- left: '0'
1661
- } : position === 'bottom-right' ? {
1662
- bottom: '0',
1663
- right: '0'
1664
- } : {
1665
- bottom: '0',
1666
- left: '0'
1667
- }, toggleButtonStyle)
783
+ width: 'fit-content',
784
+ ...(position === 'top-right' ? {
785
+ top: '0',
786
+ right: '0'
787
+ } : position === 'top-left' ? {
788
+ top: '0',
789
+ left: '0'
790
+ } : position === 'bottom-right' ? {
791
+ bottom: '0',
792
+ right: '0'
793
+ } : {
794
+ bottom: '0',
795
+ left: '0'
796
+ }),
797
+ ...toggleButtonStyle
798
+ }
1668
799
  }), /*#__PURE__*/React__default["default"].createElement(Logo, {
1669
800
  "aria-hidden": true
1670
801
  })) : null);
1671
802
  }
1672
803
  const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default["default"].forwardRef(function TanStackRouterDevtoolsPanel(props, ref) {
1673
- var _Object$values$find$m, _Object$values, _Object$values$find, _router$state$matches, _router$state$pending, _router$state$pending2, _last, _last2, _last3, _last4, _last5, _last6;
1674
-
1675
804
  const {
1676
805
  isOpen = true,
806
+ setIsOpen,
1677
807
  handleDragStart,
1678
- router
1679
- } = props,
1680
- panelProps = _objectWithoutPropertiesLoose(props, _excluded4);
1681
-
1682
- const rerender = React__default["default"].useReducer(() => ({}), {})[1];
1683
- React__default["default"].useEffect(() => {
1684
- let interval = setInterval(() => {
1685
- router.cleanMatchCache(); // router.notify()
1686
-
1687
- rerender();
1688
- }, 250);
1689
- return () => {
1690
- clearInterval(interval);
1691
- };
1692
- }, []);
808
+ router: userRouter,
809
+ ...panelProps
810
+ } = props;
811
+ const routerContextValue = React__default["default"].useContext(routerContext);
812
+ const router = userRouter ?? routerContextValue?.router;
813
+ invariant(router, 'No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.');
814
+ useStore(router.__store);
1693
815
  const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
1694
816
  const [activeMatchId, setActiveMatchId] = useLocalStorage('tanstackRouterDevtoolsActiveMatchId', '');
1695
817
  React__default["default"].useEffect(() => {
1696
818
  setActiveMatchId('');
1697
819
  }, [activeRouteId]);
1698
- const activeMatch = (_Object$values$find$m = (_Object$values = Object.values(router.matchCache)) == null ? void 0 : (_Object$values$find = _Object$values.find(d => d.match.matchId === activeMatchId)) == null ? void 0 : _Object$values$find.match) != null ? _Object$values$find$m : (_router$state$matches = router.state.matches) == null ? void 0 : _router$state$matches.find(d => d.routeId === activeRouteId);
1699
- const matchCacheValues = multiSortBy(Object.keys(router.matchCache).filter(key => {
1700
- const cacheEntry = router.matchCache[key];
1701
- return cacheEntry.gc > Date.now();
1702
- }).map(key => router.matchCache[key]), [d => d.match.isFetching ? -1 : 1, d => -d.match.updatedAt]);
820
+ const allMatches = React__default["default"].useMemo(() => [...Object.values(router.state.currentMatches), ...Object.values(router.state.pendingMatches ?? [])], [router.state.currentMatches, router.state.pendingMatches]);
821
+ const activeMatch = allMatches?.find(d => d.id === activeMatchId) || allMatches?.find(d => d.route.id === activeRouteId);
1703
822
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
1704
823
  theme: defaultTheme
1705
- }, /*#__PURE__*/React__default["default"].createElement("script", {
1706
- src: "https://cdn.tailwindcss.com"
1707
- }), /*#__PURE__*/React__default["default"].createElement(Panel, _extends({
824
+ }, /*#__PURE__*/React__default["default"].createElement(Panel, _extends({
1708
825
  ref: ref,
1709
826
  className: "TanStackRouterDevtoolsPanel"
1710
827
  }, panelProps), /*#__PURE__*/React__default["default"].createElement("style", {
1711
828
  dangerouslySetInnerHTML: {
1712
- __html: "\n\n .TanStackRouterDevtoolsPanel * {\n scrollbar-color: " + defaultTheme.backgroundAlt + " " + defaultTheme.gray + ";\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {\n width: 1em;\n height: 1em;\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {\n background: " + defaultTheme.backgroundAlt + ";\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {\n background: " + defaultTheme.gray + ";\n border-radius: .5em;\n border: 3px solid " + defaultTheme.backgroundAlt + ";\n }\n\n .TanStackRouterDevtoolsPanel table {\n width: 100%;\n }\n\n .TanStackRouterDevtoolsPanel table tr {\n border-bottom: 2px dotted rgba(255, 255, 255, .2);\n }\n\n .TanStackRouterDevtoolsPanel table tr:last-child {\n border-bottom: none\n }\n\n .TanStackRouterDevtoolsPanel table td {\n padding: .25rem .5rem;\n border-right: 2px dotted rgba(255, 255, 255, .05);\n }\n\n .TanStackRouterDevtoolsPanel table td:last-child {\n border-right: none\n }\n\n "
829
+ __html: `
830
+
831
+ .TanStackRouterDevtoolsPanel * {
832
+ scrollbar-color: ${defaultTheme.backgroundAlt} ${defaultTheme.gray};
833
+ }
834
+
835
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {
836
+ width: 1em;
837
+ height: 1em;
838
+ }
839
+
840
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {
841
+ background: ${defaultTheme.backgroundAlt};
842
+ }
843
+
844
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {
845
+ background: ${defaultTheme.gray};
846
+ border-radius: .5em;
847
+ border: 3px solid ${defaultTheme.backgroundAlt};
848
+ }
849
+
850
+ .TanStackRouterDevtoolsPanel table {
851
+ width: 100%;
852
+ }
853
+
854
+ .TanStackRouterDevtoolsPanel table tr {
855
+ border-bottom: 2px dotted rgba(255, 255, 255, .2);
856
+ }
857
+
858
+ .TanStackRouterDevtoolsPanel table tr:last-child {
859
+ border-bottom: none
860
+ }
861
+
862
+ .TanStackRouterDevtoolsPanel table td {
863
+ padding: .25rem .5rem;
864
+ border-right: 2px dotted rgba(255, 255, 255, .05);
865
+ }
866
+
867
+ .TanStackRouterDevtoolsPanel table td:last-child {
868
+ border-right: none
869
+ }
870
+
871
+ `
1713
872
  }
1714
873
  }), /*#__PURE__*/React__default["default"].createElement("div", {
1715
874
  style: {
@@ -1729,13 +888,17 @@
1729
888
  minHeight: '40%',
1730
889
  maxHeight: '100%',
1731
890
  overflow: 'auto',
1732
- borderRight: "1px solid " + defaultTheme.grayAlt,
891
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1733
892
  display: 'flex',
1734
893
  flexDirection: 'column'
1735
894
  }
1736
895
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1737
- className: "flex justify-start gap-2 p-2 items-center",
1738
896
  style: {
897
+ display: 'flex',
898
+ justifyContent: 'start',
899
+ gap: '1rem',
900
+ padding: '1rem',
901
+ alignItems: 'center',
1739
902
  background: defaultTheme.backgroundAlt
1740
903
  }
1741
904
  }, /*#__PURE__*/React__default["default"].createElement(Logo, {
@@ -1768,7 +931,7 @@
1768
931
  minHeight: '40%',
1769
932
  maxHeight: '100%',
1770
933
  overflow: 'auto',
1771
- borderRight: "1px solid " + defaultTheme.grayAlt,
934
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1772
935
  display: 'flex',
1773
936
  flexDirection: 'column'
1774
937
  }
@@ -1780,15 +943,15 @@
1780
943
  top: 0,
1781
944
  zIndex: 1
1782
945
  }
1783
- }, "Active Matches"), router.state.matches.map((match, i) => {
946
+ }, "Active Matches"), router.state.currentMatches.map((match, i) => {
1784
947
  return /*#__PURE__*/React__default["default"].createElement("div", {
1785
- key: match.routeId || i,
948
+ key: match.route.id || i,
1786
949
  role: "button",
1787
- "aria-label": "Open match details for " + match.routeId,
1788
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
950
+ "aria-label": `Open match details for ${match.route.id}`,
951
+ onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
1789
952
  style: {
1790
953
  display: 'flex',
1791
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
954
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1792
955
  cursor: 'pointer',
1793
956
  alignItems: 'center',
1794
957
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
@@ -1810,8 +973,8 @@
1810
973
  style: {
1811
974
  padding: '.5em'
1812
975
  }
1813
- }, "" + match.matchId));
1814
- }), (_router$state$pending = router.state.pending) != null && _router$state$pending.matches.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
976
+ }, `${match.id}`));
977
+ }), router.state.pendingMatches?.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
1815
978
  style: {
1816
979
  marginTop: '2rem',
1817
980
  padding: '.5em',
@@ -1820,15 +983,15 @@
1820
983
  top: 0,
1821
984
  zIndex: 1
1822
985
  }
1823
- }, "Pending Matches"), (_router$state$pending2 = router.state.pending) == null ? void 0 : _router$state$pending2.matches.map((match, i) => {
986
+ }, "Pending Matches"), router.state.pendingMatches?.map((match, i) => {
1824
987
  return /*#__PURE__*/React__default["default"].createElement("div", {
1825
- key: match.routeId || i,
988
+ key: match.route.id || i,
1826
989
  role: "button",
1827
- "aria-label": "Open match details for " + match.routeId,
1828
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
990
+ "aria-label": `Open match details for ${match.route.id}`,
991
+ onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
1829
992
  style: {
1830
993
  display: 'flex',
1831
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
994
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1832
995
  cursor: 'pointer',
1833
996
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1834
997
  }
@@ -1849,75 +1012,7 @@
1849
1012
  style: {
1850
1013
  padding: '.5em'
1851
1014
  }
1852
- }, "" + match.matchId));
1853
- })) : null, matchCacheValues.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
1854
- style: {
1855
- marginTop: '2rem',
1856
- padding: '.5em',
1857
- background: defaultTheme.backgroundAlt,
1858
- position: 'sticky',
1859
- top: 0,
1860
- bottom: 0,
1861
- zIndex: 1,
1862
- display: 'flex',
1863
- alignItems: 'center',
1864
- justifyContent: 'space-between'
1865
- }
1866
- }, /*#__PURE__*/React__default["default"].createElement("div", null, "Match Cache"), /*#__PURE__*/React__default["default"].createElement(Button, {
1867
- onClick: () => {
1868
- router.matchCache = {};
1869
- router.notify();
1870
- }
1871
- }, "Clear")), matchCacheValues.map((d, i) => {
1872
- const {
1873
- match,
1874
- gc
1875
- } = d;
1876
- return /*#__PURE__*/React__default["default"].createElement("div", {
1877
- key: match.matchId || i,
1878
- role: "button",
1879
- "aria-label": "Open match details for " + match.matchId,
1880
- onClick: () => setActiveMatchId(activeMatchId === match.matchId ? '' : match.matchId),
1881
- style: {
1882
- display: 'flex',
1883
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
1884
- cursor: 'pointer',
1885
- background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1886
- }
1887
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1888
- style: {
1889
- display: 'flex',
1890
- flexDirection: 'column',
1891
- padding: '.5rem',
1892
- gap: '.3rem'
1893
- }
1894
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1895
- style: {
1896
- display: 'flex',
1897
- alignItems: 'center',
1898
- gap: '.5rem'
1899
- }
1900
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1901
- style: {
1902
- flex: '0 0 auto',
1903
- width: '1.3rem',
1904
- height: '1.3rem',
1905
- background: getStatusColor(match, defaultTheme),
1906
- alignItems: 'center',
1907
- justifyContent: 'center',
1908
- fontWeight: 'bold',
1909
- borderRadius: '.25rem',
1910
- transition: 'all .2s ease-out'
1911
- }
1912
- }), /*#__PURE__*/React__default["default"].createElement(Code, null, "" + match.matchId)), /*#__PURE__*/React__default["default"].createElement("span", {
1913
- style: {
1914
- fontSize: '.7rem',
1915
- opacity: '.5',
1916
- lineHeight: 1
1917
- }
1918
- }, "Expires", ' ', formatDistanceStrict(new Date(gc), new Date(), {
1919
- addSuffix: true
1920
- }))));
1015
+ }, `${match.id}`));
1921
1016
  })) : null), activeMatch ? /*#__PURE__*/React__default["default"].createElement(ActivePanel, null, /*#__PURE__*/React__default["default"].createElement("div", {
1922
1017
  style: {
1923
1018
  padding: '.5em',
@@ -1935,23 +1030,15 @@
1935
1030
  style: {
1936
1031
  lineHeight: '1.8em'
1937
1032
  }
1938
- }, JSON.stringify(activeMatch.matchId, null, 2)))), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1939
- style: {
1940
- opacity: '.5'
1941
- }
1942
- }, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1943
- style: {
1944
- opacity: '.5'
1945
- }
1946
- }, "Pending"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.isPending.toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1033
+ }, JSON.stringify(activeMatch.id, null, 2)))), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1947
1034
  style: {
1948
1035
  opacity: '.5'
1949
1036
  }
1950
- }, "Invalid"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.isInvalid.toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1037
+ }, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.state.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1951
1038
  style: {
1952
1039
  opacity: '.5'
1953
1040
  }
1954
- }, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.updatedAt ? new Date(activeMatch.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
1041
+ }, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.state.updatedAt ? new Date(activeMatch.state.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
1955
1042
  style: {
1956
1043
  background: defaultTheme.backgroundAlt,
1957
1044
  padding: '.5em',
@@ -1965,16 +1052,6 @@
1965
1052
  padding: '0.5em'
1966
1053
  }
1967
1054
  }, /*#__PURE__*/React__default["default"].createElement(Button, {
1968
- type: "button",
1969
- onClick: () => {
1970
- activeMatch.invalidate();
1971
- router.notify();
1972
- },
1973
- style: {
1974
- background: defaultTheme.warning,
1975
- color: defaultTheme.inputTextColor
1976
- }
1977
- }, "Invalidate"), ' ', /*#__PURE__*/React__default["default"].createElement(Button, {
1978
1055
  type: "button",
1979
1056
  onClick: () => activeMatch.load(),
1980
1057
  style: {
@@ -2003,7 +1080,7 @@
2003
1080
  minHeight: '40%',
2004
1081
  maxHeight: '100%',
2005
1082
  overflow: 'auto',
2006
- borderRight: "1px solid " + defaultTheme.grayAlt,
1083
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
2007
1084
  display: 'flex',
2008
1085
  flexDirection: 'column'
2009
1086
  }
@@ -2016,36 +1093,13 @@
2016
1093
  bottom: 0,
2017
1094
  zIndex: 1
2018
1095
  }
2019
- }, "All Loader Data"), /*#__PURE__*/React__default["default"].createElement("div", {
2020
- style: {
2021
- padding: '.5em'
2022
- }
2023
- }, Object.keys(((_last = reactRouter.last(router.state.matches)) == null ? void 0 : _last.loaderData) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2024
- value: ((_last2 = reactRouter.last(router.state.matches)) == null ? void 0 : _last2.loaderData) || {},
2025
- defaultExpanded: Object.keys(((_last3 = reactRouter.last(router.state.matches)) == null ? void 0 : _last3.loaderData) || {}).reduce((obj, next) => {
2026
- obj[next] = {};
2027
- return obj;
2028
- }, {})
2029
- }) : /*#__PURE__*/React__default["default"].createElement("em", {
2030
- style: {
2031
- opacity: 0.5
2032
- }
2033
- }, '{ }')), /*#__PURE__*/React__default["default"].createElement("div", {
2034
- style: {
2035
- padding: '.5em',
2036
- background: defaultTheme.backgroundAlt,
2037
- position: 'sticky',
2038
- top: 0,
2039
- bottom: 0,
2040
- zIndex: 1
2041
- }
2042
1096
  }, "Search Params"), /*#__PURE__*/React__default["default"].createElement("div", {
2043
1097
  style: {
2044
1098
  padding: '.5em'
2045
1099
  }
2046
- }, Object.keys(((_last4 = reactRouter.last(router.state.matches)) == null ? void 0 : _last4.search) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2047
- value: ((_last5 = reactRouter.last(router.state.matches)) == null ? void 0 : _last5.search) || {},
2048
- defaultExpanded: Object.keys(((_last6 = reactRouter.last(router.state.matches)) == null ? void 0 : _last6.search) || {}).reduce((obj, next) => {
1100
+ }, Object.keys(last(router.state.currentMatches)?.state.search || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
1101
+ value: last(router.state.currentMatches)?.state.search || {},
1102
+ defaultExpanded: Object.keys(last(router.state.currentMatches)?.state.search || {}).reduce((obj, next) => {
2049
1103
  obj[next] = {};
2050
1104
  return obj;
2051
1105
  }, {})