@tanstack/router-devtools 0.0.1-alpha.1 → 0.0.1-beta.101

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 (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/build/cjs/{packages/react-router-devtools/src/Explorer.js → Explorer.js} +52 -81
  4. package/build/cjs/Explorer.js.map +1 -0
  5. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -19
  6. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  7. package/build/cjs/devtools.js +637 -0
  8. package/build/cjs/devtools.js.map +1 -0
  9. package/build/cjs/{packages/react-router-devtools/src/index.js → index.js} +1 -1
  10. package/build/cjs/{packages/react-router-devtools/src/styledComponents.js → styledComponents.js} +10 -38
  11. package/build/cjs/styledComponents.js.map +1 -0
  12. package/build/cjs/{packages/react-router-devtools/src/theme.js → theme.js} +6 -9
  13. package/build/cjs/theme.js.map +1 -0
  14. package/build/cjs/{packages/react-router-devtools/src/useLocalStorage.js → useLocalStorage.js} +3 -10
  15. package/build/cjs/useLocalStorage.js.map +1 -0
  16. package/build/cjs/{packages/react-router-devtools/src/useMediaQuery.js → useMediaQuery.js} +13 -12
  17. package/build/cjs/useMediaQuery.js.map +1 -0
  18. package/build/cjs/{packages/react-router-devtools/src/utils.js → utils.js} +30 -35
  19. package/build/cjs/utils.js.map +1 -0
  20. package/build/esm/index.js +390 -1361
  21. package/build/esm/index.js.map +1 -1
  22. package/build/stats-html.html +59 -49
  23. package/build/stats-react.json +223 -9444
  24. package/build/types/Explorer.d.ts +47 -0
  25. package/build/types/devtools.d.ts +65 -0
  26. package/build/types/index.d.ts +1 -76
  27. package/build/types/styledComponents.d.ts +7 -0
  28. package/build/types/theme.d.ts +34 -0
  29. package/build/types/useLocalStorage.d.ts +1 -0
  30. package/build/types/useMediaQuery.d.ts +1 -0
  31. package/build/types/utils.d.ts +23 -0
  32. package/build/umd/index.development.js +429 -1340
  33. package/build/umd/index.development.js.map +1 -1
  34. package/build/umd/index.production.js +22 -2
  35. package/build/umd/index.production.js.map +1 -1
  36. package/package.json +11 -10
  37. package/src/Explorer.tsx +14 -12
  38. package/src/devtools.tsx +354 -345
  39. package/src/useLocalStorage.ts +5 -5
  40. package/src/useMediaQuery.ts +3 -0
  41. package/src/utils.ts +57 -16
  42. package/build/cjs/packages/react-router-devtools/src/Explorer.js.map +0 -1
  43. package/build/cjs/packages/react-router-devtools/src/Logo.js +0 -73
  44. package/build/cjs/packages/react-router-devtools/src/Logo.js.map +0 -1
  45. package/build/cjs/packages/react-router-devtools/src/devtools.js +0 -654
  46. package/build/cjs/packages/react-router-devtools/src/devtools.js.map +0 -1
  47. package/build/cjs/packages/react-router-devtools/src/styledComponents.js.map +0 -1
  48. package/build/cjs/packages/react-router-devtools/src/theme.js.map +0 -1
  49. package/build/cjs/packages/react-router-devtools/src/useLocalStorage.js.map +0 -1
  50. package/build/cjs/packages/react-router-devtools/src/useMediaQuery.js.map +0 -1
  51. package/build/cjs/packages/react-router-devtools/src/utils.js.map +0 -1
  52. package/src/Logo.tsx +0 -37
  53. /package/build/cjs/{packages/react-router-devtools/src/index.js.map → index.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router-devtools
2
+ * router-devtools
3
3
  *
4
4
  * Copyright (c) TanStack
5
5
  *
@@ -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.ReactLocationDevtools = {}, global.React, global.ReactLocation));
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.TanStackRouterDevtools = {}, 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,99 @@
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
- }
76
- }
77
-
78
- /**
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.
87
- *
88
- * If the argument is a number, it is treated as a timestamp.
89
- *
90
- * If the argument is none of the above, the function returns Invalid Date.
91
- *
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
107
- */
108
-
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);
55
+ var prefix = 'Invariant failed';
56
+ function invariant(condition, message) {
57
+ if (condition) {
58
+ return;
124
59
  }
125
-
126
- return new Date(NaN);
127
- }
128
- }
129
-
130
- var defaultOptions = {};
131
- function getDefaultOptions() {
132
- return defaultOptions;
60
+ var provided = typeof message === 'function' ? message() : message;
61
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
62
+ throw new Error(value);
133
63
  }
134
64
 
135
65
  /**
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)
140
- *
141
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
142
- * which would lead to incorrect calculations.
66
+ * react-store
143
67
  *
144
- * This function returns the timezone offset in milliseconds that takes seconds in account.
145
- */
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();
150
- }
151
-
152
- /**
153
- * @name compareAsc
154
- * @category Common Helpers
155
- * @summary Compare the two dates and return -1, 0 or 1.
68
+ * Copyright (c) TanStack
156
69
  *
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.
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.
160
72
  *
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
170
- *
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
- * // ]
73
+ * @license MIT
183
74
  */
184
75
 
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
- }
76
+ function useStore(store, selector = d => d) {
77
+ const slice = withSelector.useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, shallow);
78
+ return slice;
198
79
  }
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'
80
+ function shallow(objA, objB) {
81
+ if (Object.is(objA, objB)) {
82
+ return true;
261
83
  }
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());
84
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
85
+ return false;
274
86
  }
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
- }
87
+ const keysA = Object.keys(objA);
88
+ if (keysA.length !== Object.keys(objB).length) {
89
+ return false;
282
90
  }
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
- };
297
- }
298
-
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';
91
+ for (let i = 0; i < keysA.length; i++) {
92
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
93
+ return false;
481
94
  }
482
95
  }
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;
96
+ return true;
554
97
  }
555
98
 
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
- /**
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
99
  /**
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.
100
+ * router
737
101
  *
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 |
102
+ * Copyright (c) TanStack
746
103
  *
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
104
+ * This source code is licensed under the MIT license found in the
105
+ * LICENSE.md file in the root directory of this source tree.
761
106
  *
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'
775
- *
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'
783
- *
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'
800
- *
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'
107
+ * @license MIT
808
108
  */
809
109
 
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'");
110
+ function last(arr) {
111
+ return arr[arr.length - 1];
904
112
  }
113
+ const routerContext = /*#__PURE__*/React__namespace.createContext(null);
905
114
 
906
115
  const getItem = key => {
907
116
  try {
908
117
  const itemValue = localStorage.getItem(key);
909
-
910
118
  if (typeof itemValue === 'string') {
911
119
  return JSON.parse(itemValue);
912
120
  }
913
-
914
121
  return undefined;
915
- } catch (_unused) {
122
+ } catch {
916
123
  return undefined;
917
124
  }
918
125
  };
919
-
920
126
  function useLocalStorage(key, defaultValue) {
921
127
  const [value, setValue] = React__default["default"].useState();
922
128
  React__default["default"].useEffect(() => {
923
129
  const initialValue = getItem(key);
924
-
925
130
  if (typeof initialValue === 'undefined' || initialValue === null) {
926
131
  setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
927
132
  } else {
@@ -931,22 +136,18 @@
931
136
  const setter = React__default["default"].useCallback(updater => {
932
137
  setValue(old => {
933
138
  let newVal = updater;
934
-
935
139
  if (typeof updater == 'function') {
936
140
  newVal = updater(old);
937
141
  }
938
-
939
142
  try {
940
143
  localStorage.setItem(key, JSON.stringify(newVal));
941
- } catch (_unused2) {}
942
-
144
+ } catch {}
943
145
  return newVal;
944
146
  });
945
147
  }, [key]);
946
148
  return [value, setter];
947
149
  }
948
150
 
949
- const _excluded$3 = ["theme"];
950
151
  const defaultTheme = {
951
152
  background: '#0b1521',
952
153
  backgroundAlt: '#132337',
@@ -961,12 +162,10 @@
961
162
  warning: '#ffb200'
962
163
  };
963
164
  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
-
165
+ function ThemeProvider({
166
+ theme,
167
+ ...rest
168
+ }) {
970
169
  return /*#__PURE__*/React__default["default"].createElement(ThemeContext.Provider, _extends({
971
170
  value: theme
972
171
  }, rest));
@@ -981,70 +180,66 @@
981
180
  if (typeof window !== 'undefined') {
982
181
  return window.matchMedia && window.matchMedia(query).matches;
983
182
  }
984
- }); // Watch for changes
183
+ return;
184
+ });
985
185
 
186
+ // Watch for changes
986
187
  React__default["default"].useEffect(() => {
987
188
  if (typeof window !== 'undefined') {
988
189
  if (!window.matchMedia) {
989
190
  return;
990
- } // Create a matcher
991
-
992
-
993
- const matcher = window.matchMedia(query); // Create our handler
191
+ }
994
192
 
995
- const onChange = _ref => {
996
- let {
997
- matches
998
- } = _ref;
999
- return setIsMatch(matches);
1000
- }; // Listen for changes
193
+ // Create a matcher
194
+ const matcher = window.matchMedia(query);
1001
195
 
196
+ // Create our handler
197
+ const onChange = ({
198
+ matches
199
+ }) => setIsMatch(matches);
1002
200
 
201
+ // Listen for changes
1003
202
  matcher.addListener(onChange);
1004
203
  return () => {
1005
204
  // Stop listening for changes
1006
205
  matcher.removeListener(onChange);
1007
206
  };
1008
207
  }
208
+ return;
1009
209
  }, [isMatch, query, setIsMatch]);
1010
210
  return isMatch;
1011
211
  }
1012
212
 
1013
- const _excluded$2 = ["style"];
1014
213
  const isServer$1 = typeof window === 'undefined';
1015
214
  function getStatusColor(match, theme) {
1016
- return match.isPending ? theme.warning : match.isFetching ? theme.active : match.status === 'error' ? theme.danger : match.status === 'success' ? theme.success : theme.gray;
1017
- } // export function getQueryStatusLabel(query: Query) {
1018
- // return query.state.isFetching
1019
- // ? 'fetching'
1020
- // : !query.getObserversCount()
1021
- // ? 'inactive'
1022
- // : query.isStale()
1023
- // ? 'stale'
1024
- // : 'fresh'
1025
- // }
1026
-
1027
- function styled(type, newStyles, queries) {
1028
- if (queries === void 0) {
1029
- queries = {};
1030
- }
1031
-
1032
- return /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
1033
- let {
1034
- style
1035
- } = _ref,
1036
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
1037
-
215
+ return match.state.status === 'pending' ? theme.active : match.state.status === 'error' ? theme.danger : match.state.status === 'success' ? theme.success : theme.gray;
216
+ }
217
+ function getRouteStatusColor(matches, route, theme) {
218
+ const found = matches.find(d => d.route === route);
219
+ return found ? found.route.status === 'pending' ? theme.active : found.state.status === 'error' ? theme.danger : found.state.status === 'success' ? theme.success : theme.gray : theme.gray;
220
+ }
221
+ function styled(type, newStyles, queries = {}) {
222
+ return /*#__PURE__*/React__default["default"].forwardRef(({
223
+ style,
224
+ ...rest
225
+ }, ref) => {
1038
226
  const theme = useTheme();
1039
- const mediaStyles = Object.entries(queries).reduce((current, _ref2) => {
1040
- let [key, value] = _ref2;
227
+ const mediaStyles = Object.entries(queries).reduce((current, [key, value]) => {
1041
228
  // eslint-disable-next-line react-hooks/rules-of-hooks
1042
- return useMediaQuery(key) ? _extends({}, current, typeof value === 'function' ? value(rest, theme) : value) : current;
229
+ return useMediaQuery(key) ? {
230
+ ...current,
231
+ ...(typeof value === 'function' ? value(rest, theme) : value)
232
+ } : current;
1043
233
  }, {});
1044
- return /*#__PURE__*/React__default["default"].createElement(type, _extends({}, rest, {
1045
- style: _extends({}, typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles, style, mediaStyles),
234
+ return /*#__PURE__*/React__default["default"].createElement(type, {
235
+ ...rest,
236
+ style: {
237
+ ...(typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles),
238
+ ...style,
239
+ ...mediaStyles
240
+ },
1046
241
  ref
1047
- }));
242
+ });
1048
243
  });
1049
244
  }
1050
245
  function useIsMounted() {
@@ -1058,22 +253,22 @@
1058
253
  }, []);
1059
254
  return isMounted;
1060
255
  }
256
+
1061
257
  /**
1062
258
  * Displays a string regardless the type of the data
1063
259
  * @param {unknown} value Value to be stringified
1064
260
  */
1065
-
1066
261
  const displayValue = value => {
1067
262
  const name = Object.getOwnPropertyNames(Object(value));
1068
- const newValue = typeof value === 'bigint' ? value.toString() + "n" : value;
263
+ const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value;
1069
264
  return JSON.stringify(newValue, name);
1070
265
  };
266
+
1071
267
  /**
1072
268
  * This hook is a safe useState version which schedules state updates in microtasks
1073
269
  * to prevent updating a component state while React is rendering different components
1074
270
  * or when the component is not mounted anymore.
1075
271
  */
1076
-
1077
272
  function useSafeState(initialState) {
1078
273
  const isMounted = useIsMounted();
1079
274
  const [state, setState] = React__default["default"].useState(initialState);
@@ -1086,11 +281,11 @@
1086
281
  }, [isMounted]);
1087
282
  return [state, safeSetState];
1088
283
  }
284
+
1089
285
  /**
1090
286
  * Schedules a microtask.
1091
287
  * This can be useful to schedule state updates after rendering.
1092
288
  */
1093
-
1094
289
  function scheduleMicrotask(callback) {
1095
290
  Promise.resolve().then(callback).catch(error => setTimeout(() => {
1096
291
  throw error;
@@ -1099,7 +294,7 @@
1099
294
 
1100
295
  const Panel = styled('div', (_props, theme) => ({
1101
296
  fontSize: 'clamp(12px, 1.5vw, 14px)',
1102
- fontFamily: "sans-serif",
297
+ fontFamily: `sans-serif`,
1103
298
  display: 'flex',
1104
299
  backgroundColor: theme.background,
1105
300
  color: theme.foreground
@@ -1108,10 +303,11 @@
1108
303
  flexDirection: 'column'
1109
304
  },
1110
305
  '(max-width: 600px)': {
1111
- fontSize: '.9em' // flexDirection: 'column',
1112
-
306
+ fontSize: '.9em'
307
+ // flexDirection: 'column',
1113
308
  }
1114
309
  });
310
+
1115
311
  const ActivePanel = styled('div', () => ({
1116
312
  flex: '1 1 500px',
1117
313
  display: 'flex',
@@ -1120,7 +316,7 @@
1120
316
  height: '100%'
1121
317
  }), {
1122
318
  '(max-width: 700px)': (_props, theme) => ({
1123
- borderTop: "2px solid " + theme.gray
319
+ borderTop: `2px solid ${theme.gray}`
1124
320
  })
1125
321
  });
1126
322
  const Button = styled('button', (props, theme) => ({
@@ -1134,10 +330,13 @@
1134
330
  padding: '.5em',
1135
331
  opacity: props.disabled ? '.5' : undefined,
1136
332
  cursor: 'pointer'
1137
- })); // export const QueryKeys = styled('span', {
333
+ }));
334
+
335
+ // export const QueryKeys = styled('span', {
1138
336
  // display: 'inline-block',
1139
337
  // fontSize: '0.9em',
1140
338
  // })
339
+
1141
340
  // export const QueryKey = styled('span', {
1142
341
  // display: 'inline-flex',
1143
342
  // alignItems: 'center',
@@ -1150,40 +349,7 @@
1150
349
  const Code = styled('code', {
1151
350
  fontSize: '.9em'
1152
351
  });
1153
- styled('input', (_props, theme) => ({
1154
- backgroundColor: theme.inputBackgroundColor,
1155
- border: 0,
1156
- borderRadius: '.2em',
1157
- color: theme.inputTextColor,
1158
- fontSize: '.9em',
1159
- lineHeight: "1.3",
1160
- padding: '.3em .4em'
1161
- }));
1162
- styled('select', (_props, theme) => ({
1163
- display: "inline-block",
1164
- fontSize: ".9em",
1165
- fontFamily: "sans-serif",
1166
- fontWeight: 'normal',
1167
- lineHeight: "1.3",
1168
- padding: ".3em 1.5em .3em .5em",
1169
- height: 'auto',
1170
- border: 0,
1171
- borderRadius: ".2em",
1172
- appearance: "none",
1173
- WebkitAppearance: 'none',
1174
- backgroundColor: theme.inputBackgroundColor,
1175
- 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>\")",
1176
- backgroundRepeat: "no-repeat",
1177
- backgroundPosition: "right .55em center",
1178
- backgroundSize: ".65em auto, 100%",
1179
- color: theme.inputTextColor
1180
- }), {
1181
- '(max-width: 500px)': {
1182
- display: 'none'
1183
- }
1184
- });
1185
352
 
1186
- const _excluded$1 = ["value", "defaultExpanded", "renderer", "pageSize"];
1187
353
  const Entry = styled('div', {
1188
354
  fontFamily: 'Menlo, monospace',
1189
355
  fontSize: '.7rem',
@@ -1219,20 +385,17 @@
1219
385
  color: 'grey',
1220
386
  fontSize: '.7em'
1221
387
  });
1222
- const Expander = _ref => {
1223
- let {
1224
- expanded,
1225
- style = {}
1226
- } = _ref;
1227
- return /*#__PURE__*/React__namespace.createElement("span", {
1228
- style: _extends({
1229
- display: 'inline-block',
1230
- transition: 'all .1s ease',
1231
- transform: "rotate(" + (expanded ? 90 : 0) + "deg) " + (style.transform || '')
1232
- }, style)
1233
- }, "\u25B6");
1234
- };
1235
-
388
+ const Expander = ({
389
+ expanded,
390
+ style = {}
391
+ }) => /*#__PURE__*/React__namespace.createElement("span", {
392
+ style: {
393
+ display: 'inline-block',
394
+ transition: 'all .1s ease',
395
+ transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
396
+ ...style
397
+ }
398
+ }, "\u25B6");
1236
399
  /**
1237
400
  * Chunk elements in the array by size
1238
401
  *
@@ -1246,53 +409,40 @@
1246
409
  if (size < 1) return [];
1247
410
  let i = 0;
1248
411
  const result = [];
1249
-
1250
412
  while (i < array.length) {
1251
413
  result.push(array.slice(i, i + size));
1252
414
  i = i + size;
1253
415
  }
1254
-
1255
416
  return result;
1256
417
  }
1257
- const DefaultRenderer = _ref2 => {
1258
- let {
1259
- HandleEntry,
1260
- label,
1261
- value,
1262
- subEntries = [],
1263
- subEntryPages = [],
1264
- type,
1265
- expanded = false,
1266
- toggleExpanded,
1267
- pageSize,
1268
- renderer
1269
- } = _ref2;
418
+ const DefaultRenderer = ({
419
+ handleEntry,
420
+ label,
421
+ value,
422
+ subEntries = [],
423
+ subEntryPages = [],
424
+ type,
425
+ expanded = false,
426
+ toggleExpanded,
427
+ pageSize,
428
+ renderer
429
+ }) => {
1270
430
  const [expandedPages, setExpandedPages] = React__namespace.useState([]);
1271
431
  const [valueSnapshot, setValueSnapshot] = React__namespace.useState(undefined);
1272
-
1273
432
  const refreshValueSnapshot = () => {
1274
433
  setValueSnapshot(value());
1275
434
  };
1276
-
1277
- return /*#__PURE__*/React__namespace.createElement(Entry, {
1278
- key: label
1279
- }, subEntryPages.length ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ExpandButton, {
435
+ return /*#__PURE__*/React__namespace.createElement(Entry, null, subEntryPages.length ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ExpandButton, {
1280
436
  onClick: () => toggleExpanded()
1281
437
  }, /*#__PURE__*/React__namespace.createElement(Expander, {
1282
438
  expanded: expanded
1283
- }), " ", 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 => /*#__PURE__*/React__namespace.createElement(HandleEntry, {
1284
- key: entry.label,
1285
- entry: entry
1286
- }))) : /*#__PURE__*/React__namespace.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React__namespace.createElement("div", {
439
+ }), " ", 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", {
1287
440
  key: index
1288
441
  }, /*#__PURE__*/React__namespace.createElement(Entry, null, /*#__PURE__*/React__namespace.createElement(LabelButton, {
1289
442
  onClick: () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index])
1290
443
  }, /*#__PURE__*/React__namespace.createElement(Expander, {
1291
444
  expanded: expanded
1292
- }), " [", index * pageSize, " ...", ' ', index * pageSize + pageSize - 1, "]"), expandedPages.includes(index) ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, entries.map(entry => /*#__PURE__*/React__namespace.createElement(HandleEntry, {
1293
- key: entry.label,
1294
- entry: entry
1295
- }))) : null)))) : null) : type === 'function' ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Explorer, {
445
+ }), " [", index * pageSize, " ...", ' ', index * pageSize + pageSize - 1, "]"), expandedPages.includes(index) ? /*#__PURE__*/React__namespace.createElement(SubEntries, null, entries.map(entry => handleEntry(entry))) : null)))) : null) : type === 'function' ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Explorer, {
1296
446
  renderer: renderer,
1297
447
  label: /*#__PURE__*/React__namespace.createElement("button", {
1298
448
  onClick: refreshValueSnapshot,
@@ -1306,34 +456,29 @@
1306
456
  defaultExpanded: {}
1307
457
  })) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Label, null, label, ":"), " ", /*#__PURE__*/React__namespace.createElement(Value, null, displayValue(value))));
1308
458
  };
1309
-
1310
459
  function isIterable(x) {
1311
460
  return Symbol.iterator in x;
1312
461
  }
1313
-
1314
- function Explorer(_ref3) {
1315
- let {
1316
- value,
1317
- defaultExpanded,
1318
- renderer = DefaultRenderer,
1319
- pageSize = 100
1320
- } = _ref3,
1321
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
1322
-
462
+ function Explorer({
463
+ value,
464
+ defaultExpanded,
465
+ renderer = DefaultRenderer,
466
+ pageSize = 100,
467
+ ...rest
468
+ }) {
1323
469
  const [expanded, setExpanded] = React__namespace.useState(Boolean(defaultExpanded));
1324
470
  const toggleExpanded = React__namespace.useCallback(() => setExpanded(old => !old), []);
1325
471
  let type = typeof value;
1326
472
  let subEntries = [];
1327
-
1328
473
  const makeProperty = sub => {
1329
474
  const subDefaultExpanded = defaultExpanded === true ? {
1330
475
  [sub.label]: true
1331
- } : defaultExpanded == null ? void 0 : defaultExpanded[sub.label];
1332
- return _extends({}, sub, {
476
+ } : defaultExpanded?.[sub.label];
477
+ return {
478
+ ...sub,
1333
479
  defaultExpanded: subDefaultExpanded
1334
- });
480
+ };
1335
481
  };
1336
-
1337
482
  if (Array.isArray(value)) {
1338
483
  type = 'array';
1339
484
  subEntries = value.map((d, i) => makeProperty({
@@ -1348,87 +493,68 @@
1348
493
  }));
1349
494
  } else if (typeof value === 'object' && value !== null) {
1350
495
  type = 'object';
1351
- subEntries = Object.entries(value).map(_ref4 => {
1352
- let [key, val] = _ref4;
1353
- return makeProperty({
1354
- label: key,
1355
- value: val
1356
- });
1357
- });
496
+ subEntries = Object.entries(value).map(([key, val]) => makeProperty({
497
+ label: key,
498
+ value: val
499
+ }));
1358
500
  }
1359
-
1360
501
  const subEntryPages = chunkArray(subEntries, pageSize);
1361
- return renderer(_extends({
1362
- HandleEntry: _ref5 => {
1363
- let {
1364
- entry
1365
- } = _ref5;
1366
- return /*#__PURE__*/React__namespace.createElement(Explorer, _extends({
1367
- value: value,
1368
- renderer: renderer
1369
- }, rest, entry));
1370
- },
502
+ return renderer({
503
+ handleEntry: entry => /*#__PURE__*/React__namespace.createElement(Explorer, _extends({
504
+ key: entry.label,
505
+ value: value,
506
+ renderer: renderer
507
+ }, rest, entry)),
1371
508
  type,
1372
509
  subEntries,
1373
510
  subEntryPages,
1374
511
  value,
1375
512
  expanded,
1376
513
  toggleExpanded,
1377
- pageSize
1378
- }, rest));
514
+ pageSize,
515
+ ...rest
516
+ });
1379
517
  }
1380
518
 
519
+ const isServer = typeof window === 'undefined';
1381
520
  function Logo(props) {
1382
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
1383
- width: "40px",
1384
- height: "40px",
1385
- viewBox: "0 0 190 190",
1386
- version: "1.1"
1387
- }, props), /*#__PURE__*/React__namespace.createElement("g", {
1388
- stroke: "none",
1389
- strokeWidth: "1",
1390
- fill: "none",
1391
- fillRule: "evenodd"
1392
- }, /*#__PURE__*/React__namespace.createElement("g", {
1393
- id: "og-white",
1394
- transform: "translate(-28.000000, -21.000000)"
1395
- }, /*#__PURE__*/React__namespace.createElement("g", {
1396
- id: "Group-2",
1397
- transform: "translate(28.000000, 31.000000)"
1398
- }, /*#__PURE__*/React__namespace.createElement("path", {
1399
- d: "M39.7239712,51.3436237 C36.631224,36.362877 35.9675112,24.8727722 37.9666331,16.5293551 C39.1555965,11.5671678 41.3293088,7.51908462 44.6346064,4.59846305 C48.1241394,1.51504777 52.5360327,0.00201216606 57.493257,0.00201216606 C65.6712013,0.00201216606 74.2682602,3.72732143 83.4557246,10.8044264 C87.2031203,13.6910458 91.0924366,17.170411 95.1316515,21.2444746 C95.4531404,20.8310265 95.8165416,20.4410453 96.2214301,20.0806152 C107.64098,9.91497158 117.255245,3.59892716 125.478408,1.16365068 C130.367899,-0.284364005 134.958526,-0.422317978 139.138936,0.983031021 C143.551631,2.46646844 147.06766,5.53294888 149.548314,9.82810912 C153.642288,16.9166735 154.721918,26.2310983 153.195595,37.7320243 C152.573451,42.4199112 151.50985,47.5263831 150.007094,53.0593153 C150.574045,53.1277086 151.142416,53.2532808 151.705041,53.4395297 C166.193932,58.2358678 176.453582,63.3937462 182.665021,69.2882839 C186.360669,72.7953831 188.773972,76.6998434 189.646365,81.0218204 C190.567176,85.5836746 189.669313,90.1593316 187.191548,94.4512967 C183.105211,101.529614 175.591643,107.11221 164.887587,111.534031 C160.589552,113.309539 155.726579,114.917559 150.293259,116.363748 C150.541176,116.92292 150.733521,117.516759 150.862138,118.139758 C153.954886,133.120505 154.618598,144.61061 152.619477,152.954027 C151.430513,157.916214 149.256801,161.964297 145.951503,164.884919 C142.46197,167.968334 138.050077,169.48137 133.092853,169.48137 C124.914908,169.48137 116.31785,165.756061 107.130385,158.678956 C103.343104,155.761613 99.4108655,152.238839 95.3254337,148.108619 C94.9050753,148.765474 94.3889681,149.376011 93.7785699,149.919385 C82.3590198,160.085028 72.744755,166.401073 64.5215915,168.836349 C59.6321009,170.284364 55.0414736,170.422318 50.8610636,169.016969 C46.4483686,167.533532 42.9323404,164.467051 40.4516862,160.171891 C36.3577116,153.083327 35.2780823,143.768902 36.8044053,132.267976 C37.449038,127.410634 38.56762,122.103898 40.1575891,116.339009 C39.5361041,116.276104 38.9120754,116.144816 38.2949591,115.940529 C23.8060684,111.144191 13.5464184,105.986312 7.33497892,100.091775 C3.63933121,96.5846754 1.22602752,92.6802151 0.353635235,88.3582381 C-0.567176333,83.7963839 0.330686581,79.2207269 2.80845236,74.9287618 C6.89478863,67.8504443 14.4083565,62.2678481 25.1124133,57.8460273 C29.5385143,56.0176154 34.5637208,54.366822 40.1939394,52.8874674 C39.9933393,52.3969171 39.8349374,51.8811235 39.7239712,51.3436237 Z",
1400
- id: "Path",
1401
- fill: "#002C4B",
1402
- fillRule: "nonzero",
1403
- transform: "translate(95.000000, 85.000000) scale(-1, 1) translate(-95.000000, -85.000000) "
1404
- }), /*#__PURE__*/React__namespace.createElement("path", {
1405
- d: "M76.1109918,91 L89.6216773,114.999606 L80.3968824,115 C78.6058059,115 76.9515387,114.041975 76.0601262,112.488483 L69.9456773,101.831606 L76.1109918,91 Z M118.814677,103.999606 L113.944933,112.488483 C113.053521,114.041975 111.399254,115 109.608177,115 L97.1836773,114.999606 L91,104 L118.814677,103.999606 Z M102.995798,71 L111,84.540954 L103.052984,98 L87.0061086,98 L79,84.3838793 L86.9562003,71 L102.995798,71 Z M124.136677,74.2726062 L128.577138,82.0115174 C129.461464,83.5526583 129.461464,85.4473417 128.577138,86.9884826 L122.257677,97.9996062 L110,98 L124.136677,74.2726062 Z M80,72 L66.1336773,95.1896062 L61.4279211,86.9884826 C60.543596,85.4473417 60.543596,83.5526583 61.4279211,82.0115174 L67.1716773,71.9996062 L80,72 Z M109.608177,54 C111.399254,54 113.053521,54.958025 113.944933,56.5115174 L120.835677,68.5206062 L114.929178,79 L100.820677,53.9996062 L109.608177,54 Z M93.7696773,53.9996062 L100,65 L71.1886773,64.9996062 L76.0601262,56.5115174 C76.9515387,54.958025 78.6058059,54 80.3968824,54 L93.7696773,53.9996062 Z",
1406
- id: "Polygon-3",
1407
- fill: "#FFD94C"
1408
- }), /*#__PURE__*/React__namespace.createElement("path", {
1409
- d: "M54.8601729,98.3577578 C56.1715224,97.6082856 57.8360246,98.0746014 58.5779424,99.3993034 L58.5779424,99.3993034 L59.0525843,100.24352 C62.8563392,106.982993 66.8190116,113.380176 70.9406016,119.435068 C75.8078808,126.585427 81.28184,133.82411 87.3624792,141.151115 C88.3168778,142.30114 88.1849437,144.011176 87.065686,144.997937 L87.065686,144.997937 L86.4542085,145.534625 C66.3465389,163.103314 53.2778188,166.612552 47.2480482,156.062341 C41.3500652,145.742717 43.4844915,126.982888 53.6513274,99.7828526 C53.876818,99.1795821 54.3045861,98.675291 54.8601729,98.3577578 Z M140.534177,119.041504 C141.986131,118.785177 143.375496,119.742138 143.65963,121.194242 L143.65963,121.194242 L143.812815,121.986376 C148.782365,147.995459 145.283348,161 133.315764,161 C121.609745,161 106.708724,149.909007 88.6127018,127.727022 C88.2113495,127.235047 87.9945723,126.617371 88,125.981509 C88.013158,124.480686 89.2357854,123.274651 90.730918,123.287756 L90.730918,123.287756 L91.6846544,123.294531 C99.3056979,123.335994 106.714387,123.071591 113.910723,122.501323 C122.409039,121.82788 131.283523,120.674607 140.534177,119.041504 Z M147.408726,63.8119663 C147.932139,62.4026903 149.508386,61.6634537 150.954581,62.149012 L150.954581,62.149012 L151.742552,62.4154854 C177.583763,71.217922 187.402356,80.8916805 181.198332,91.4367609 C175.129904,101.751366 157.484347,109.260339 128.26166,113.963678 C127.613529,114.067994 126.948643,113.945969 126.382735,113.618843 C125.047025,112.846729 124.602046,111.158214 125.388848,109.847438 L125.388848,109.847438 L125.889328,109.0105 C129.877183,102.31633 133.481358,95.6542621 136.701854,89.0242957 C140.50501,81.1948179 144.073967,72.7907081 147.408726,63.8119663 Z M61.7383398,56.0363218 C62.3864708,55.9320063 63.0513565,56.0540315 63.6172646,56.3811573 C64.9529754,57.153271 65.3979538,58.8417862 64.6111517,60.1525615 L64.6111517,60.1525615 L64.1106718,60.9895001 C60.1228168,67.6836699 56.5186416,74.3457379 53.2981462,80.9757043 C49.49499,88.8051821 45.9260328,97.2092919 42.5912744,106.188034 C42.0678608,107.59731 40.4916142,108.336546 39.045419,107.850988 L39.045419,107.850988 L38.2574475,107.584515 C12.4162372,98.782078 2.59764398,89.1083195 8.80166786,78.5632391 C14.8700957,68.2486335 32.515653,60.7396611 61.7383398,56.0363218 Z M103.545792,24.4653746 C123.653461,6.89668641 136.722181,3.38744778 142.751952,13.9376587 C148.649935,24.2572826 146.515508,43.0171122 136.348673,70.2171474 C136.123182,70.8204179 135.695414,71.324709 135.139827,71.6422422 C133.828478,72.3917144 132.163975,71.9253986 131.422058,70.6006966 L131.422058,70.6006966 L130.947416,69.7564798 C127.143661,63.0170065 123.180988,56.6198239 119.059398,50.564932 C114.192119,43.4145727 108.71816,36.1758903 102.637521,28.8488847 C101.683122,27.6988602 101.815056,25.9888243 102.934314,25.0020629 L102.934314,25.0020629 Z M57.6842361,8 C69.3902551,8 84.2912758,19.0909926 102.387298,41.2729777 C102.788651,41.7649527 103.005428,42.3826288 103,43.0184911 C102.986842,44.5193144 101.764215,45.7253489 100.269082,45.7122445 L100.269082,45.7122445 L99.3153456,45.7054689 C91.6943021,45.6640063 84.2856126,45.9284091 77.0892772,46.4986773 C68.5909612,47.17212 59.7164767,48.325393 50.4658235,49.9584962 C49.0138691,50.2148231 47.6245044,49.2578618 47.3403697,47.805758 L47.3403697,47.805758 L47.1871846,47.0136235 C42.2176347,21.0045412 45.7166519,8 57.6842361,8 Z",
1410
- id: "Combined-Shape",
1411
- fill: "#FF4154"
1412
- })))));
521
+ return /*#__PURE__*/React__default["default"].createElement("div", _extends({}, props, {
522
+ style: {
523
+ ...(props.style ?? {}),
524
+ display: 'flex',
525
+ alignItems: 'center',
526
+ flexDirection: 'column',
527
+ fontSize: '0.8rem',
528
+ fontWeight: 'bolder',
529
+ lineHeight: '1'
530
+ }
531
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
532
+ style: {
533
+ letterSpacing: '-0.05rem'
534
+ }
535
+ }, "TANSTACK"), /*#__PURE__*/React__default["default"].createElement("div", {
536
+ style: {
537
+ backgroundImage: 'linear-gradient(to right, var(--tw-gradient-stops))',
538
+ // @ts-ignore
539
+ '--tw-gradient-from': '#84cc16',
540
+ '--tw-gradient-stops': 'var(--tw-gradient-from), var(--tw-gradient-to)',
541
+ '--tw-gradient-to': '#10b981',
542
+ WebkitBackgroundClip: 'text',
543
+ color: 'transparent',
544
+ letterSpacing: '0.1rem',
545
+ marginRight: '-0.2rem'
546
+ }
547
+ }, "ROUTER"));
1413
548
  }
1414
-
1415
- const _excluded = ["style"],
1416
- _excluded2 = ["style", "onClick"],
1417
- _excluded3 = ["style", "onClick"],
1418
- _excluded4 = ["isOpen", "setIsOpen", "handleDragStart", "useRouter"],
1419
- _excluded5 = ["listeners", "buildLocation", "mount", "update", "buildNext", "navigate", "cancelMatches", "loadLocation", "cleanPreloadCache", "loadRoute", "matchRoutes", "loadMatches", "invalidateRoute", "resolvePath", "matchRoute", "buildLink", "__experimental__createSnapshot", "destroy"],
1420
- _excluded6 = ["cancel", "load", "router", "Link", "MatchRoute", "buildLink", "linkProps", "matchRoute", "navigate"];
1421
- const isServer = typeof window === 'undefined';
1422
- function TanStackRouterDevtools(_ref) {
1423
- let {
1424
- initialIsOpen,
1425
- panelProps = {},
1426
- closeButtonProps = {},
1427
- toggleButtonProps = {},
1428
- position = 'bottom-left',
1429
- containerElement: Container = 'footer',
1430
- useRouter: useRouterImpl = reactRouter.useRouter
1431
- } = _ref;
549
+ function TanStackRouterDevtools({
550
+ initialIsOpen,
551
+ panelProps = {},
552
+ closeButtonProps = {},
553
+ toggleButtonProps = {},
554
+ position = 'bottom-left',
555
+ containerElement: Container = 'footer',
556
+ router
557
+ }) {
1432
558
  const rootRef = React__default["default"].useRef(null);
1433
559
  const panelRef = React__default["default"].useRef(null);
1434
560
  const [isOpen, setIsOpen] = useLocalStorage('tanstackRouterDevtoolsOpen', initialIsOpen);
@@ -1436,61 +562,51 @@
1436
562
  const [isResolvedOpen, setIsResolvedOpen] = useSafeState(false);
1437
563
  const [isResizing, setIsResizing] = useSafeState(false);
1438
564
  const isMounted = useIsMounted();
1439
-
1440
- const _handleDragStart = (panelElement, startEvent) => {
1441
- var _panelElement$getBoun;
1442
-
565
+ const handleDragStart = (panelElement, startEvent) => {
1443
566
  if (startEvent.button !== 0) return; // Only allow left click for drag
1444
567
 
1445
568
  setIsResizing(true);
1446
569
  const dragInfo = {
1447
- originalHeight: (_panelElement$getBoun = panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) != null ? _panelElement$getBoun : 0,
570
+ originalHeight: panelElement?.getBoundingClientRect().height ?? 0,
1448
571
  pageY: startEvent.pageY
1449
572
  };
1450
-
1451
573
  const run = moveEvent => {
1452
574
  const delta = dragInfo.pageY - moveEvent.pageY;
1453
- const newHeight = (dragInfo == null ? void 0 : dragInfo.originalHeight) + delta;
575
+ const newHeight = dragInfo?.originalHeight + delta;
1454
576
  setDevtoolsHeight(newHeight);
1455
-
1456
577
  if (newHeight < 70) {
1457
578
  setIsOpen(false);
1458
579
  } else {
1459
580
  setIsOpen(true);
1460
581
  }
1461
582
  };
1462
-
1463
583
  const unsub = () => {
1464
584
  setIsResizing(false);
1465
585
  document.removeEventListener('mousemove', run);
1466
586
  document.removeEventListener('mouseUp', unsub);
1467
587
  };
1468
-
1469
588
  document.addEventListener('mousemove', run);
1470
589
  document.addEventListener('mouseup', unsub);
1471
590
  };
1472
-
1473
591
  React__default["default"].useEffect(() => {
1474
- setIsResolvedOpen(isOpen != null ? isOpen : false);
1475
- }, [isOpen, isResolvedOpen, setIsResolvedOpen]); // Toggle panel visibility before/after transition (depending on direction).
1476
- // Prevents focusing in a closed panel.
592
+ setIsResolvedOpen(isOpen ?? false);
593
+ }, [isOpen, isResolvedOpen, setIsResolvedOpen]);
1477
594
 
595
+ // Toggle panel visibility before/after transition (depending on direction).
596
+ // Prevents focusing in a closed panel.
1478
597
  React__default["default"].useEffect(() => {
1479
598
  const ref = panelRef.current;
1480
-
1481
599
  if (ref) {
1482
600
  const handlePanelTransitionStart = () => {
1483
601
  if (ref && isResolvedOpen) {
1484
602
  ref.style.visibility = 'visible';
1485
603
  }
1486
604
  };
1487
-
1488
605
  const handlePanelTransitionEnd = () => {
1489
606
  if (ref && !isResolvedOpen) {
1490
607
  ref.style.visibility = 'hidden';
1491
608
  }
1492
609
  };
1493
-
1494
610
  ref.addEventListener('transitionstart', handlePanelTransitionStart);
1495
611
  ref.addEventListener('transitionend', handlePanelTransitionEnd);
1496
612
  return () => {
@@ -1498,62 +614,46 @@
1498
614
  ref.removeEventListener('transitionend', handlePanelTransitionEnd);
1499
615
  };
1500
616
  }
1501
-
1502
617
  return;
1503
618
  }, [isResolvedOpen]);
1504
619
  React__default["default"][isServer ? 'useEffect' : 'useLayoutEffect'](() => {
1505
620
  if (isResolvedOpen) {
1506
- var _rootRef$current, _rootRef$current$pare;
1507
-
1508
- const previousValue = (_rootRef$current = rootRef.current) == null ? void 0 : (_rootRef$current$pare = _rootRef$current.parentElement) == null ? void 0 : _rootRef$current$pare.style.paddingBottom;
1509
-
621
+ const previousValue = rootRef.current?.parentElement?.style.paddingBottom;
1510
622
  const run = () => {
1511
- var _panelRef$current, _rootRef$current2;
1512
-
1513
- const containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height;
1514
-
1515
- if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
1516
- rootRef.current.parentElement.style.paddingBottom = containerHeight + "px";
623
+ const containerHeight = panelRef.current?.getBoundingClientRect().height;
624
+ if (rootRef.current?.parentElement) {
625
+ rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
1517
626
  }
1518
627
  };
1519
-
1520
628
  run();
1521
-
1522
629
  if (typeof window !== 'undefined') {
1523
630
  window.addEventListener('resize', run);
1524
631
  return () => {
1525
- var _rootRef$current3;
1526
-
1527
632
  window.removeEventListener('resize', run);
1528
-
1529
- if ((_rootRef$current3 = rootRef.current) != null && _rootRef$current3.parentElement && typeof previousValue === 'string') {
633
+ if (rootRef.current?.parentElement && typeof previousValue === 'string') {
1530
634
  rootRef.current.parentElement.style.paddingBottom = previousValue;
1531
635
  }
1532
636
  };
1533
637
  }
1534
638
  }
1535
-
1536
639
  return;
1537
640
  }, [isResolvedOpen]);
1538
-
1539
641
  const {
1540
- style: panelStyle = {}
1541
- } = panelProps,
1542
- otherPanelProps = _objectWithoutPropertiesLoose(panelProps, _excluded);
1543
-
642
+ style: panelStyle = {},
643
+ ...otherPanelProps
644
+ } = panelProps;
1544
645
  const {
1545
646
  style: closeButtonStyle = {},
1546
- onClick: onCloseClick
1547
- } = closeButtonProps,
1548
- otherCloseButtonProps = _objectWithoutPropertiesLoose(closeButtonProps, _excluded2);
1549
-
647
+ onClick: onCloseClick,
648
+ ...otherCloseButtonProps
649
+ } = closeButtonProps;
1550
650
  const {
1551
651
  style: toggleButtonStyle = {},
1552
- onClick: onToggleClick
1553
- } = toggleButtonProps,
1554
- otherToggleButtonProps = _objectWithoutPropertiesLoose(toggleButtonProps, _excluded3); // Do not render on the server
1555
-
652
+ onClick: onToggleClick,
653
+ ...otherToggleButtonProps
654
+ } = toggleButtonProps;
1556
655
 
656
+ // Do not render on the server
1557
657
  if (!isMounted()) return null;
1558
658
  return /*#__PURE__*/React__default["default"].createElement(Container, {
1559
659
  ref: rootRef,
@@ -1563,36 +663,39 @@
1563
663
  }, /*#__PURE__*/React__default["default"].createElement(TanStackRouterDevtoolsPanel, _extends({
1564
664
  ref: panelRef
1565
665
  }, otherPanelProps, {
1566
- useRouter: useRouterImpl,
1567
- style: _extends({
666
+ router: router,
667
+ style: {
1568
668
  position: 'fixed',
1569
669
  bottom: '0',
1570
670
  right: '0',
1571
671
  zIndex: 99999,
1572
672
  width: '100%',
1573
- height: devtoolsHeight != null ? devtoolsHeight : 500,
673
+ height: devtoolsHeight ?? 500,
1574
674
  maxHeight: '90%',
1575
675
  boxShadow: '0 0 20px rgba(0,0,0,.3)',
1576
- borderTop: "1px solid " + defaultTheme.gray,
676
+ borderTop: `1px solid ${defaultTheme.gray}`,
1577
677
  transformOrigin: 'top',
1578
678
  // visibility will be toggled after transitions, but set initial state here
1579
- visibility: isOpen ? 'visible' : 'hidden'
1580
- }, panelStyle, isResizing ? {
1581
- transition: "none"
1582
- } : {
1583
- transition: "all .2s ease"
1584
- }, isResolvedOpen ? {
1585
- opacity: 1,
1586
- pointerEvents: 'all',
1587
- transform: "translateY(0) scale(1)"
1588
- } : {
1589
- opacity: 0,
1590
- pointerEvents: 'none',
1591
- transform: "translateY(15px) scale(1.02)"
1592
- }),
679
+ visibility: isOpen ? 'visible' : 'hidden',
680
+ ...panelStyle,
681
+ ...(isResizing ? {
682
+ transition: `none`
683
+ } : {
684
+ transition: `all .2s ease`
685
+ }),
686
+ ...(isResolvedOpen ? {
687
+ opacity: 1,
688
+ pointerEvents: 'all',
689
+ transform: `translateY(0) scale(1)`
690
+ } : {
691
+ opacity: 0,
692
+ pointerEvents: 'none',
693
+ transform: `translateY(15px) scale(1.02)`
694
+ })
695
+ },
1593
696
  isOpen: isResolvedOpen,
1594
697
  setIsOpen: setIsOpen,
1595
- handleDragStart: e => _handleDragStart(panelRef.current, e)
698
+ handleDragStart: e => handleDragStart(panelRef.current, e)
1596
699
  })), isResolvedOpen ? /*#__PURE__*/React__default["default"].createElement(Button, _extends({
1597
700
  type: "button",
1598
701
  "aria-label": "Close TanStack Router Devtools"
@@ -1601,20 +704,22 @@
1601
704
  setIsOpen(false);
1602
705
  onCloseClick && onCloseClick(e);
1603
706
  },
1604
- style: _extends({
707
+ style: {
1605
708
  position: 'fixed',
1606
709
  zIndex: 99999,
1607
710
  margin: '.5em',
1608
- bottom: 0
1609
- }, position === 'top-right' ? {
1610
- right: '0'
1611
- } : position === 'top-left' ? {
1612
- left: '0'
1613
- } : position === 'bottom-right' ? {
1614
- right: '0'
1615
- } : {
1616
- left: '0'
1617
- }, closeButtonStyle)
711
+ bottom: 0,
712
+ ...(position === 'top-right' ? {
713
+ right: '0'
714
+ } : position === 'top-left' ? {
715
+ left: '0'
716
+ } : position === 'bottom-right' ? {
717
+ right: '0'
718
+ } : {
719
+ left: '0'
720
+ }),
721
+ ...closeButtonStyle
722
+ }
1618
723
  }), "Close") : null), !isResolvedOpen ? /*#__PURE__*/React__default["default"].createElement("button", _extends({
1619
724
  type: "button"
1620
725
  }, otherToggleButtonProps, {
@@ -1623,7 +728,7 @@
1623
728
  setIsOpen(true);
1624
729
  onToggleClick && onToggleClick(e);
1625
730
  },
1626
- style: _extends({
731
+ style: {
1627
732
  appearance: 'none',
1628
733
  background: 'none',
1629
734
  border: 0,
@@ -1634,46 +739,95 @@
1634
739
  fontSize: '1.5em',
1635
740
  margin: '.5em',
1636
741
  cursor: 'pointer',
1637
- width: 'fit-content'
1638
- }, position === 'top-right' ? {
1639
- top: '0',
1640
- right: '0'
1641
- } : position === 'top-left' ? {
1642
- top: '0',
1643
- left: '0'
1644
- } : position === 'bottom-right' ? {
1645
- bottom: '0',
1646
- right: '0'
1647
- } : {
1648
- bottom: '0',
1649
- left: '0'
1650
- }, toggleButtonStyle)
742
+ width: 'fit-content',
743
+ ...(position === 'top-right' ? {
744
+ top: '0',
745
+ right: '0'
746
+ } : position === 'top-left' ? {
747
+ top: '0',
748
+ left: '0'
749
+ } : position === 'bottom-right' ? {
750
+ bottom: '0',
751
+ right: '0'
752
+ } : {
753
+ bottom: '0',
754
+ left: '0'
755
+ }),
756
+ ...toggleButtonStyle
757
+ }
1651
758
  }), /*#__PURE__*/React__default["default"].createElement(Logo, {
1652
759
  "aria-hidden": true
1653
760
  })) : null);
1654
761
  }
762
+ function RouteComp({
763
+ route,
764
+ isRoot,
765
+ matches,
766
+ activeRouteId,
767
+ setActiveRouteId
768
+ }) {
769
+ const isActive = matches.find(d => d.route === route);
770
+ return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("div", {
771
+ role: "button",
772
+ "aria-label": `Open match details for ${route.id}`,
773
+ onClick: () => setActiveRouteId(activeRouteId === route.id ? '' : route.id),
774
+ style: {
775
+ display: 'flex',
776
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
777
+ cursor: 'pointer',
778
+ alignItems: 'center',
779
+ background: route.id === activeRouteId ? 'rgba(255,255,255,.1)' : undefined
780
+ }
781
+ }, isRoot ? null : /*#__PURE__*/React__default["default"].createElement("div", {
782
+ style: {
783
+ flex: '0 0 auto',
784
+ width: '.7rem',
785
+ height: '.7rem',
786
+ margin: '.5rem .75rem',
787
+ alignItems: 'center',
788
+ justifyContent: 'center',
789
+ fontWeight: 'bold',
790
+ borderRadius: '100%',
791
+ transition: 'all .2s ease-out',
792
+ background: getRouteStatusColor(matches, route, defaultTheme),
793
+ opacity: isActive ? 1 : 0.3
794
+ }
795
+ }), /*#__PURE__*/React__default["default"].createElement(Code, {
796
+ style: {
797
+ padding: '.25rem 0',
798
+ paddingLeft: isRoot ? '.5rem' : 0,
799
+ opacity: isActive ? 1 : 0.7
800
+ }
801
+ }, `${route.id}`)), route.children?.length ? /*#__PURE__*/React__default["default"].createElement("div", {
802
+ style: {
803
+ marginLeft: isRoot ? 0 : '1rem',
804
+ borderLeft: isRoot ? '' : `solid 1px ${defaultTheme.grayAlt}`
805
+ }
806
+ }, route.children.map(r => /*#__PURE__*/React__default["default"].createElement(RouteComp, {
807
+ key: r.id,
808
+ route: r,
809
+ matches: matches,
810
+ activeRouteId: activeRouteId,
811
+ setActiveRouteId: setActiveRouteId
812
+ }))) : null);
813
+ }
1655
814
  const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default["default"].forwardRef(function TanStackRouterDevtoolsPanel(props, ref) {
1656
- var _router$state$matches, _router$state$pending, _last, _last2, _last3, _last4, _last5, _last6;
1657
-
1658
815
  const {
1659
816
  isOpen = true,
817
+ setIsOpen,
1660
818
  handleDragStart,
1661
- useRouter
1662
- } = props,
1663
- panelProps = _objectWithoutPropertiesLoose(props, _excluded4);
1664
-
1665
- const router = useRouter();
1666
- React__default["default"].useEffect(() => {
1667
- let interval = setInterval(() => {
1668
- router.cleanPreloadCache();
1669
- router.notify();
1670
- }, 1000);
1671
- return () => {
1672
- clearInterval(interval);
1673
- };
1674
- }, []);
819
+ router: userRouter,
820
+ ...panelProps
821
+ } = props;
822
+ const routerContextValue = React__default["default"].useContext(routerContext);
823
+ const router = userRouter ?? routerContextValue?.router;
824
+ 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.');
825
+ useStore(router.__store);
826
+ const [showMatches, setShowMatches] = useLocalStorage('tanstackRouterDevtoolsShowMatches', true);
1675
827
  const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
1676
- const activeMatch = (_router$state$matches = router.state.matches) == null ? void 0 : _router$state$matches.find(d => d.routeId === activeRouteId);
828
+ const allMatches = React__default["default"].useMemo(() => [...Object.values(router.state.currentMatches), ...Object.values(router.state.pendingMatches ?? [])], [router.state.currentMatches, router.state.pendingMatches]);
829
+ const activeMatch = allMatches?.find(d => d.route.id === activeRouteId);
830
+ const hasSearch = Object.keys(last(router.state.currentMatches)?.state.search || {}).length;
1677
831
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
1678
832
  theme: defaultTheme
1679
833
  }, /*#__PURE__*/React__default["default"].createElement(Panel, _extends({
@@ -1681,7 +835,49 @@
1681
835
  className: "TanStackRouterDevtoolsPanel"
1682
836
  }, panelProps), /*#__PURE__*/React__default["default"].createElement("style", {
1683
837
  dangerouslySetInnerHTML: {
1684
- __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 "
838
+ __html: `
839
+
840
+ .TanStackRouterDevtoolsPanel * {
841
+ scrollbar-color: ${defaultTheme.backgroundAlt} ${defaultTheme.gray};
842
+ }
843
+
844
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {
845
+ width: 1em;
846
+ height: 1em;
847
+ }
848
+
849
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {
850
+ background: ${defaultTheme.backgroundAlt};
851
+ }
852
+
853
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {
854
+ background: ${defaultTheme.gray};
855
+ border-radius: .5em;
856
+ border: 3px solid ${defaultTheme.backgroundAlt};
857
+ }
858
+
859
+ .TanStackRouterDevtoolsPanel table {
860
+ width: 100%;
861
+ }
862
+
863
+ .TanStackRouterDevtoolsPanel table tr {
864
+ border-bottom: 2px dotted rgba(255, 255, 255, .2);
865
+ }
866
+
867
+ .TanStackRouterDevtoolsPanel table tr:last-child {
868
+ border-bottom: none
869
+ }
870
+
871
+ .TanStackRouterDevtoolsPanel table td {
872
+ padding: .25rem .5rem;
873
+ border-right: 2px dotted rgba(255, 255, 255, .05);
874
+ }
875
+
876
+ .TanStackRouterDevtoolsPanel table td:last-child {
877
+ border-right: none
878
+ }
879
+
880
+ `
1685
881
  }
1686
882
  }), /*#__PURE__*/React__default["default"].createElement("div", {
1687
883
  style: {
@@ -1701,30 +897,27 @@
1701
897
  minHeight: '40%',
1702
898
  maxHeight: '100%',
1703
899
  overflow: 'auto',
1704
- borderRight: "1px solid " + defaultTheme.grayAlt,
900
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1705
901
  display: 'flex',
1706
902
  flexDirection: 'column'
1707
903
  }
1708
904
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1709
905
  style: {
1710
- padding: '.5em',
1711
- background: defaultTheme.backgroundAlt,
1712
906
  display: 'flex',
1713
- justifyContent: 'space-between',
1714
- alignItems: 'center'
907
+ justifyContent: 'start',
908
+ gap: '1rem',
909
+ padding: '1rem',
910
+ alignItems: 'center',
911
+ background: defaultTheme.backgroundAlt
1715
912
  }
1716
913
  }, /*#__PURE__*/React__default["default"].createElement(Logo, {
1717
- "aria-hidden": true,
1718
- style: {
1719
- marginRight: '.5em'
1720
- }
914
+ "aria-hidden": true
1721
915
  }), /*#__PURE__*/React__default["default"].createElement("div", {
1722
916
  style: {
1723
- marginRight: 'auto',
1724
917
  fontSize: 'clamp(.8rem, 2vw, 1.3rem)',
1725
918
  fontWeight: 'bold'
1726
919
  }
1727
- }, "TanStack Router", ' ', /*#__PURE__*/React__default["default"].createElement("span", {
920
+ }, /*#__PURE__*/React__default["default"].createElement("span", {
1728
921
  style: {
1729
922
  fontWeight: 100
1730
923
  }
@@ -1739,11 +932,7 @@
1739
932
  }
1740
933
  }, /*#__PURE__*/React__default["default"].createElement(Explorer, {
1741
934
  label: "Router",
1742
- value: (() => {
1743
- const rest = _objectWithoutPropertiesLoose(router, _excluded5);
1744
-
1745
- return rest;
1746
- })(),
935
+ value: router,
1747
936
  defaultExpanded: {}
1748
937
  })))), /*#__PURE__*/React__default["default"].createElement("div", {
1749
938
  style: {
@@ -1751,7 +940,7 @@
1751
940
  minHeight: '40%',
1752
941
  maxHeight: '100%',
1753
942
  overflow: 'auto',
1754
- borderRight: "1px solid " + defaultTheme.grayAlt,
943
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1755
944
  display: 'flex',
1756
945
  flexDirection: 'column'
1757
946
  }
@@ -1761,17 +950,44 @@
1761
950
  background: defaultTheme.backgroundAlt,
1762
951
  position: 'sticky',
1763
952
  top: 0,
1764
- zIndex: 1
953
+ zIndex: 1,
954
+ display: 'flex',
955
+ alignItems: 'center',
956
+ gap: '.5rem'
957
+ }
958
+ }, /*#__PURE__*/React__default["default"].createElement("button", {
959
+ type: "button",
960
+ onClick: () => {
961
+ setShowMatches(false);
962
+ },
963
+ disabled: !showMatches,
964
+ style: {
965
+ opacity: showMatches ? 0.5 : 1
1765
966
  }
1766
- }, "Current Matches"), router.state.matches.map((match, i) => {
967
+ }, "Routes"), "/", /*#__PURE__*/React__default["default"].createElement("button", {
968
+ type: "button",
969
+ onClick: () => {
970
+ setShowMatches(true);
971
+ },
972
+ disabled: showMatches,
973
+ style: {
974
+ opacity: !showMatches ? 0.5 : 1
975
+ }
976
+ }, "Matches")), !showMatches ? /*#__PURE__*/React__default["default"].createElement(RouteComp, {
977
+ route: router.routeTree,
978
+ isRoot: true,
979
+ matches: allMatches,
980
+ activeRouteId: activeRouteId,
981
+ setActiveRouteId: setActiveRouteId
982
+ }) : /*#__PURE__*/React__default["default"].createElement("div", null, router.state.currentMatches.map((match, i) => {
1767
983
  return /*#__PURE__*/React__default["default"].createElement("div", {
1768
- key: match.routeId || i,
984
+ key: match.route.id || i,
1769
985
  role: "button",
1770
- "aria-label": "Open match details for " + match.routeId,
1771
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
986
+ "aria-label": `Open match details for ${match.route.id}`,
987
+ onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
1772
988
  style: {
1773
989
  display: 'flex',
1774
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
990
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1775
991
  cursor: 'pointer',
1776
992
  alignItems: 'center',
1777
993
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
@@ -1793,8 +1009,8 @@
1793
1009
  style: {
1794
1010
  padding: '.5em'
1795
1011
  }
1796
- }, "" + match.matchId));
1797
- }), /*#__PURE__*/React__default["default"].createElement("div", {
1012
+ }, `${match.id}`));
1013
+ }), router.state.pendingMatches?.length ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
1798
1014
  style: {
1799
1015
  marginTop: '2rem',
1800
1016
  padding: '.5em',
@@ -1803,15 +1019,15 @@
1803
1019
  top: 0,
1804
1020
  zIndex: 1
1805
1021
  }
1806
- }, "Pending Matches"), (_router$state$pending = router.state.pending) == null ? void 0 : _router$state$pending.matches.map((match, i) => {
1022
+ }, "Pending Matches"), router.state.pendingMatches?.map((match, i) => {
1807
1023
  return /*#__PURE__*/React__default["default"].createElement("div", {
1808
- key: match.routeId || i,
1024
+ key: match.route.id || i,
1809
1025
  role: "button",
1810
- "aria-label": "Open match details for " + match.routeId,
1811
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
1026
+ "aria-label": `Open match details for ${match.route.id}`,
1027
+ onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
1812
1028
  style: {
1813
1029
  display: 'flex',
1814
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
1030
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
1815
1031
  cursor: 'pointer',
1816
1032
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1817
1033
  }
@@ -1832,77 +1048,14 @@
1832
1048
  style: {
1833
1049
  padding: '.5em'
1834
1050
  }
1835
- }, "" + match.matchId));
1836
- }), /*#__PURE__*/React__default["default"].createElement("div", {
1837
- style: {
1838
- marginTop: '2rem',
1839
- padding: '.5em',
1840
- background: defaultTheme.backgroundAlt,
1841
- position: 'sticky',
1842
- top: 0,
1843
- zIndex: 1
1844
- }
1845
- }, "Preloading Matches"), Object.keys(router.preloadCache).filter(key => {
1846
- var _cacheEntry$match$upd;
1847
-
1848
- const cacheEntry = router.preloadCache[key];
1849
- return ((_cacheEntry$match$upd = cacheEntry.match.updatedAt) != null ? _cacheEntry$match$upd : Date.now()) + cacheEntry.maxAge > Date.now();
1850
- }).map((key, i) => {
1851
- var _match$updatedAt;
1852
-
1853
- const {
1854
- match,
1855
- maxAge
1856
- } = router.preloadCache[key];
1857
- return /*#__PURE__*/React__default["default"].createElement("div", {
1858
- key: match.matchId || i,
1859
- role: "button",
1860
- "aria-label": "Open match details for " + match.matchId,
1861
- onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
1862
- style: {
1863
- display: 'flex',
1864
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
1865
- cursor: 'pointer',
1866
- background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
1867
- }
1868
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1869
- style: {
1870
- display: 'flex',
1871
- flexDirection: 'column',
1872
- padding: '.5rem',
1873
- gap: '.3rem'
1874
- }
1875
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1876
- style: {
1877
- display: 'flex',
1878
- alignItems: 'center',
1879
- gap: '.5rem'
1880
- }
1881
- }, /*#__PURE__*/React__default["default"].createElement("div", {
1882
- style: {
1883
- flex: '0 0 auto',
1884
- width: '1.3rem',
1885
- height: '1.3rem',
1886
- background: getStatusColor(match, defaultTheme),
1887
- alignItems: 'center',
1888
- justifyContent: 'center',
1889
- fontWeight: 'bold',
1890
- borderRadius: '.25rem',
1891
- transition: 'all .2s ease-out'
1892
- }
1893
- }), /*#__PURE__*/React__default["default"].createElement(Code, null, "" + match.matchId)), /*#__PURE__*/React__default["default"].createElement("span", {
1894
- style: {
1895
- opacity: '.5'
1896
- }
1897
- }, "Expires", ' ', formatDistanceStrict(new Date(), new Date(((_match$updatedAt = match.updatedAt) != null ? _match$updatedAt : Date.now()) + maxAge), {
1898
- addSuffix: true
1899
- }))));
1900
- })), activeMatch ? /*#__PURE__*/React__default["default"].createElement(ActivePanel, null, /*#__PURE__*/React__default["default"].createElement("div", {
1051
+ }, `${match.id}`));
1052
+ })) : null)), activeMatch ? /*#__PURE__*/React__default["default"].createElement(ActivePanel, null, /*#__PURE__*/React__default["default"].createElement("div", {
1901
1053
  style: {
1902
1054
  padding: '.5em',
1903
1055
  background: defaultTheme.backgroundAlt,
1904
1056
  position: 'sticky',
1905
1057
  top: 0,
1058
+ bottom: 0,
1906
1059
  zIndex: 1
1907
1060
  }
1908
1061
  }, "Match Details"), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("table", null, /*#__PURE__*/React__default["default"].createElement("tbody", null, /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
@@ -1913,56 +1066,21 @@
1913
1066
  style: {
1914
1067
  lineHeight: '1.8em'
1915
1068
  }
1916
- }, JSON.stringify(activeMatch.matchId, null, 2)))), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1069
+ }, JSON.stringify(activeMatch.id, null, 2)))), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1917
1070
  style: {
1918
1071
  opacity: '.5'
1919
1072
  }
1920
- }, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1073
+ }, "Status"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.state.status)), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1921
1074
  style: {
1922
1075
  opacity: '.5'
1923
1076
  }
1924
- }, "Pending"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.isPending.toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1925
- style: {
1926
- opacity: '.5'
1927
- }
1928
- }, "Invalid"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.isInvalid.toString())), /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", {
1929
- style: {
1930
- opacity: '.5'
1931
- }
1932
- }, "Last Updated"), /*#__PURE__*/React__default["default"].createElement("td", null, activeMatch.updatedAt ? new Date(activeMatch.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default["default"].createElement("div", {
1933
- style: {
1934
- background: defaultTheme.backgroundAlt,
1935
- padding: '.5em',
1936
- position: 'sticky',
1937
- top: 0,
1938
- zIndex: 1
1939
- }
1940
- }, "Actions"), /*#__PURE__*/React__default["default"].createElement("div", {
1941
- style: {
1942
- padding: '0.5em'
1943
- }
1944
- }, /*#__PURE__*/React__default["default"].createElement(Button, {
1945
- type: "button",
1946
- onClick: () => {
1947
- router.invalidateRoute(activeMatch);
1948
- router.notify();
1949
- },
1950
- style: {
1951
- background: defaultTheme.warning,
1952
- color: defaultTheme.inputTextColor
1953
- }
1954
- }, "Invalidate"), ' ', /*#__PURE__*/React__default["default"].createElement(Button, {
1955
- type: "button",
1956
- onClick: () => router.reload(),
1957
- style: {
1958
- background: defaultTheme.gray
1959
- }
1960
- }, "Reload")), /*#__PURE__*/React__default["default"].createElement("div", {
1077
+ }, "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", {
1961
1078
  style: {
1962
1079
  background: defaultTheme.backgroundAlt,
1963
1080
  padding: '.5em',
1964
1081
  position: 'sticky',
1965
1082
  top: 0,
1083
+ bottom: 0,
1966
1084
  zIndex: 1
1967
1085
  }
1968
1086
  }, "Explorer"), /*#__PURE__*/React__default["default"].createElement("div", {
@@ -1971,19 +1089,15 @@
1971
1089
  }
1972
1090
  }, /*#__PURE__*/React__default["default"].createElement(Explorer, {
1973
1091
  label: "Match",
1974
- value: (() => {
1975
- const rest = _objectWithoutPropertiesLoose(activeMatch, _excluded6);
1976
-
1977
- return rest;
1978
- })(),
1092
+ value: activeMatch,
1979
1093
  defaultExpanded: {}
1980
- }))) : null, /*#__PURE__*/React__default["default"].createElement("div", {
1094
+ }))) : null, hasSearch ? /*#__PURE__*/React__default["default"].createElement("div", {
1981
1095
  style: {
1982
1096
  flex: '1 1 500px',
1983
1097
  minHeight: '40%',
1984
1098
  maxHeight: '100%',
1985
1099
  overflow: 'auto',
1986
- borderRight: "1px solid " + defaultTheme.grayAlt,
1100
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1987
1101
  display: 'flex',
1988
1102
  flexDirection: 'column'
1989
1103
  }
@@ -1993,45 +1107,20 @@
1993
1107
  background: defaultTheme.backgroundAlt,
1994
1108
  position: 'sticky',
1995
1109
  top: 0,
1996
- zIndex: 1
1997
- }
1998
- }, "Loader Data"), /*#__PURE__*/React__default["default"].createElement("div", {
1999
- style: {
2000
- padding: '.5em'
2001
- }
2002
- }, Object.keys(((_last = reactRouter.last(router.state.matches)) == null ? void 0 : _last.loaderData) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2003
- value: ((_last2 = reactRouter.last(router.state.matches)) == null ? void 0 : _last2.loaderData) || {},
2004
- defaultExpanded: Object.keys(((_last3 = reactRouter.last(router.state.matches)) == null ? void 0 : _last3.loaderData) || {}).reduce((obj, next) => {
2005
- obj[next] = {};
2006
- return obj;
2007
- }, {})
2008
- }) : /*#__PURE__*/React__default["default"].createElement("em", {
2009
- style: {
2010
- opacity: 0.5
2011
- }
2012
- }, '{ }')), /*#__PURE__*/React__default["default"].createElement("div", {
2013
- style: {
2014
- padding: '.5em',
2015
- background: defaultTheme.backgroundAlt,
2016
- position: 'sticky',
2017
- top: 0,
1110
+ bottom: 0,
2018
1111
  zIndex: 1
2019
1112
  }
2020
1113
  }, "Search Params"), /*#__PURE__*/React__default["default"].createElement("div", {
2021
1114
  style: {
2022
1115
  padding: '.5em'
2023
1116
  }
2024
- }, Object.keys(((_last4 = reactRouter.last(router.state.matches)) == null ? void 0 : _last4.search) || {}).length ? /*#__PURE__*/React__default["default"].createElement(Explorer, {
2025
- value: ((_last5 = reactRouter.last(router.state.matches)) == null ? void 0 : _last5.search) || {},
2026
- defaultExpanded: Object.keys(((_last6 = reactRouter.last(router.state.matches)) == null ? void 0 : _last6.search) || {}).reduce((obj, next) => {
1117
+ }, /*#__PURE__*/React__default["default"].createElement(Explorer, {
1118
+ value: last(router.state.currentMatches)?.state.search || {},
1119
+ defaultExpanded: Object.keys(last(router.state.currentMatches)?.state.search || {}).reduce((obj, next) => {
2027
1120
  obj[next] = {};
2028
1121
  return obj;
2029
1122
  }, {})
2030
- }) : /*#__PURE__*/React__default["default"].createElement("em", {
2031
- style: {
2032
- opacity: 0.5
2033
- }
2034
- }, '{ }')))));
1123
+ }))) : null));
2035
1124
  });
2036
1125
 
2037
1126
  exports.TanStackRouterDevtools = TanStackRouterDevtools;