storybook 10.1.0-alpha.9 → 10.1.0-beta.0

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 (198) hide show
  1. package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
  2. package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
  3. package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
  4. package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
  5. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  6. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  7. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  8. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  9. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  10. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  11. package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
  12. package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
  13. package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
  14. package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  15. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  16. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  17. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  18. package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
  19. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  20. package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -0
  21. package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
  22. package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
  23. package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
  24. package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
  25. package/dist/_browser-chunks/{chunk-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
  26. package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
  27. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  28. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  29. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  30. package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
  31. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  32. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  33. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
  34. package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
  35. package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
  36. package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
  37. package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
  38. package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-SM3UWERX.js → builder-manager-BDAQHXFI.js} +510 -1019
  40. package/dist/_node-chunks/camelcase-3C7DZZPX.js +37 -0
  41. package/dist/_node-chunks/chunk-2IIQTGNE.js +6024 -0
  42. package/dist/_node-chunks/chunk-56U5LEMP.js +3043 -0
  43. package/dist/_node-chunks/chunk-7LIRCAQE.js +20 -0
  44. package/dist/_node-chunks/chunk-7RN6TXKP.js +603 -0
  45. package/dist/_node-chunks/chunk-7SJ7PZNL.js +4523 -0
  46. package/dist/_node-chunks/{chunk-HHSTA6QS.js → chunk-BG4RDXG7.js} +8 -10
  47. package/dist/_node-chunks/chunk-CBQKMXLQ.js +18 -0
  48. package/dist/_node-chunks/chunk-CN2IW2KQ.js +1564 -0
  49. package/dist/_node-chunks/chunk-CQMAU6UQ.js +943 -0
  50. package/dist/_node-chunks/{chunk-EBUEXRH5.js → chunk-D6ND3TVY.js} +116 -276
  51. package/dist/_node-chunks/chunk-DC355CYB.js +61 -0
  52. package/dist/_node-chunks/{chunk-SGM3ZCCT.js → chunk-EVK2SBW5.js} +292 -688
  53. package/dist/_node-chunks/chunk-IXWEUXJ2.js +119 -0
  54. package/dist/_node-chunks/{chunk-F6EFOEC7.js → chunk-KVRF22SH.js} +469 -983
  55. package/dist/_node-chunks/chunk-LEDP4QQW.js +919 -0
  56. package/dist/_node-chunks/{chunk-GHIBZRKD.js → chunk-MMVV6DGG.js} +8133 -8887
  57. package/dist/_node-chunks/chunk-O5CGEVRI.js +29 -0
  58. package/dist/_node-chunks/chunk-OZZO56XN.js +299 -0
  59. package/dist/_node-chunks/chunk-POT2EVGD.js +78 -0
  60. package/dist/_node-chunks/chunk-R5YGFSTV.js +3781 -0
  61. package/dist/_node-chunks/chunk-SQCTM2OS.js +23 -0
  62. package/dist/_node-chunks/chunk-UFOFO5H7.js +54 -0
  63. package/dist/_node-chunks/chunk-VBF7ALJF.js +72 -0
  64. package/dist/_node-chunks/chunk-W6MAMTUF.js +70 -0
  65. package/dist/_node-chunks/chunk-WURL4XOT.js +46662 -0
  66. package/dist/_node-chunks/chunk-XGK6MVKR.js +61 -0
  67. package/dist/_node-chunks/chunk-YV3GDSDT.js +765 -0
  68. package/dist/_node-chunks/{chunk-ATDHMMIZ.js → chunk-YWV55YW3.js} +15 -24
  69. package/dist/_node-chunks/dist-KEP4IFRN.js +121 -0
  70. package/dist/_node-chunks/globby-4WUBTDCN.js +3452 -0
  71. package/dist/_node-chunks/lib-JVOEKTYM.js +366 -0
  72. package/dist/_node-chunks/mdx-N42X6CFJ-C5WFYYXR.js +14329 -0
  73. package/dist/_node-chunks/p-limit-LDY632RS.js +116 -0
  74. package/dist/actions/decorator.js +21 -42
  75. package/dist/actions/index.js +3 -3
  76. package/dist/babel/index.d.ts +671 -335
  77. package/dist/babel/index.js +10 -11
  78. package/dist/bin/core.js +601 -1548
  79. package/dist/bin/dispatcher.js +36 -36
  80. package/dist/bin/loader.js +24 -38
  81. package/dist/channels/index.js +98 -234
  82. package/dist/cli/index.d.ts +1479 -133
  83. package/dist/cli/index.js +30 -8540
  84. package/dist/client-logger/index.js +31 -61
  85. package/dist/common/index.d.ts +139 -62
  86. package/dist/common/index.js +66 -51
  87. package/dist/components/index.d.ts +575 -273
  88. package/dist/components/index.js +14863 -4313
  89. package/dist/core-events/index.js +2 -66
  90. package/dist/core-server/index.d.ts +3 -2
  91. package/dist/core-server/index.js +2908 -8518
  92. package/dist/core-server/presets/common-manager.css +2 -2
  93. package/dist/core-server/presets/common-manager.js +2521 -5233
  94. package/dist/core-server/presets/common-override-preset.js +31 -60
  95. package/dist/core-server/presets/common-preset.js +663 -962
  96. package/dist/csf/index.js +534 -1179
  97. package/dist/csf-tools/index.js +9 -9
  98. package/dist/docs-tools/index.js +6 -6
  99. package/dist/highlight/index.js +2 -2
  100. package/dist/instrumenter/index.js +199 -415
  101. package/dist/manager/globals-runtime.js +59044 -67141
  102. package/dist/manager/globals.js +2 -3
  103. package/dist/manager/manager-stores.d.ts +1 -0
  104. package/dist/manager/manager-stores.js +23 -0
  105. package/dist/manager/runtime.js +11511 -10953
  106. package/dist/manager-api/index.d.ts +1811 -2
  107. package/dist/manager-api/index.js +1348 -2401
  108. package/dist/manager-errors.d.ts +9 -0
  109. package/dist/manager-errors.js +3 -3
  110. package/dist/mocking-utils/index.d.ts +1126 -0
  111. package/dist/mocking-utils/index.js +1181 -0
  112. package/dist/node-logger/index.d.ts +192 -24
  113. package/dist/node-logger/index.js +23 -4471
  114. package/dist/preview/globals.js +2 -3
  115. package/dist/preview/runtime.js +10799 -22393
  116. package/dist/preview-api/index.d.ts +68 -69
  117. package/dist/preview-api/index.js +13 -13
  118. package/dist/preview-errors.d.ts +9 -0
  119. package/dist/preview-errors.js +4 -4
  120. package/dist/router/index.js +347 -899
  121. package/dist/server-errors.d.ts +34 -1
  122. package/dist/server-errors.js +17 -10
  123. package/dist/telemetry/index.d.ts +24 -3
  124. package/dist/telemetry/index.js +25 -24
  125. package/dist/test/index.js +6131 -11916
  126. package/dist/theming/create.d.ts +1 -0
  127. package/dist/theming/create.js +4 -4
  128. package/dist/theming/index.d.ts +3366 -2599
  129. package/dist/theming/index.js +501 -1091
  130. package/dist/types/index.d.ts +72 -8
  131. package/dist/types/index.js +27 -12
  132. package/dist/viewport/index.js +3 -3
  133. package/package.json +26 -17
  134. package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
  135. package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
  136. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  137. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  138. package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
  139. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  140. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  141. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  142. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  143. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  144. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  145. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  146. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  147. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  148. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  149. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  150. package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
  151. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  152. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  153. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  154. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  155. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  156. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  157. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  158. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  159. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  160. package/dist/_node-chunks/camelcase-H5QSGQLK.js +0 -18
  161. package/dist/_node-chunks/chunk-3THWHQOC.js +0 -61
  162. package/dist/_node-chunks/chunk-45YUOLTU.js +0 -69
  163. package/dist/_node-chunks/chunk-4QSNCPAU.js +0 -64656
  164. package/dist/_node-chunks/chunk-744PQSOU.js +0 -79
  165. package/dist/_node-chunks/chunk-74Z2U7QG.js +0 -1544
  166. package/dist/_node-chunks/chunk-7MB7TFPO.js +0 -1198
  167. package/dist/_node-chunks/chunk-A7GS4RFT.js +0 -697
  168. package/dist/_node-chunks/chunk-BIA3A5UM.js +0 -61
  169. package/dist/_node-chunks/chunk-C5G7CLWX.js +0 -1657
  170. package/dist/_node-chunks/chunk-DLFUKMYJ.js +0 -1531
  171. package/dist/_node-chunks/chunk-EMRGRXKT.js +0 -111
  172. package/dist/_node-chunks/chunk-EX46EHHY.js +0 -420
  173. package/dist/_node-chunks/chunk-F76QKNOJ.js +0 -304
  174. package/dist/_node-chunks/chunk-HDCRUTEF.js +0 -220
  175. package/dist/_node-chunks/chunk-HUYAOIPH.js +0 -90
  176. package/dist/_node-chunks/chunk-IBJZQZJC.js +0 -101
  177. package/dist/_node-chunks/chunk-KZN2RDDT.js +0 -6712
  178. package/dist/_node-chunks/chunk-LYUNFU3F.js +0 -4741
  179. package/dist/_node-chunks/chunk-N44SIS6K.js +0 -28
  180. package/dist/_node-chunks/chunk-NILZM6KR.js +0 -18
  181. package/dist/_node-chunks/chunk-PC4ZRP6W.js +0 -34
  182. package/dist/_node-chunks/chunk-TJNGOQUH.js +0 -4272
  183. package/dist/_node-chunks/chunk-UBSYLHIL.js +0 -1250
  184. package/dist/_node-chunks/chunk-UTCLXPOC.js +0 -1518
  185. package/dist/_node-chunks/chunk-WOXXODXP.js +0 -5029
  186. package/dist/_node-chunks/chunk-XC4MEUA6.js +0 -1586
  187. package/dist/_node-chunks/chunk-YRXXMKRR.js +0 -2256
  188. package/dist/_node-chunks/dist-SL73W244.js +0 -175
  189. package/dist/_node-chunks/globby-ZSHAUQZ5.js +0 -5222
  190. package/dist/_node-chunks/lib-U2VIPUTI.js +0 -518
  191. package/dist/_node-chunks/mdx-N42X6CFJ-ZLHD33JK.js +0 -22017
  192. package/dist/_node-chunks/p-limit-K5BS5MSV.js +0 -168
  193. package/dist/_node-chunks/plugin-5PD4YIUH.js +0 -129
  194. package/dist/_node-chunks/plugin-MONDT2WL.js +0 -159
  195. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-EUZJRG3W.js +0 -69102
  196. package/dist/_node-chunks/webpack-mock-plugin-T4LDXEHE.js +0 -124
  197. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
  198. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
@@ -1,141 +1,61 @@
1
1
  import {
2
2
  require_main
3
- } from "../_browser-chunks/chunk-Y3M7TW6K.js";
3
+ } from "../_browser-chunks/chunk-3OXGAGBE.js";
4
4
  import {
5
5
  isEqual
6
- } from "../_browser-chunks/chunk-ZNRFDIVA.js";
7
- import "../_browser-chunks/chunk-AB7OOPUX.js";
6
+ } from "../_browser-chunks/chunk-3IAH5M2U.js";
7
+ import "../_browser-chunks/chunk-QKODTO7K.js";
8
8
  import {
9
9
  isPlainObject
10
- } from "../_browser-chunks/chunk-FSBVR7H5.js";
10
+ } from "../_browser-chunks/chunk-GFLS4VP3.js";
11
11
  import {
12
12
  require_memoizerific
13
- } from "../_browser-chunks/chunk-NVV6MIOE.js";
13
+ } from "../_browser-chunks/chunk-WJYERY3R.js";
14
14
  import {
15
15
  dedent
16
- } from "../_browser-chunks/chunk-OPCDBBL3.js";
16
+ } from "../_browser-chunks/chunk-JP7NCOJX.js";
17
17
  import {
18
- __name,
19
18
  __toESM
20
- } from "../_browser-chunks/chunk-MM7DTO55.js";
19
+ } from "../_browser-chunks/chunk-A242L54C.js";
21
20
 
22
21
  // src/router/utils.ts
23
22
  import { once } from "storybook/internal/client-logger";
24
- var import_memoizerific = __toESM(require_memoizerific(), 1);
25
- var import_picoquery = __toESM(require_main(), 1);
26
- var splitPathRegex = /\/([^/]+)\/(?:(.*)_)?([^/]+)?/;
27
- var parsePath = (0, import_memoizerific.default)(1e3)((path) => {
28
- const result = {
23
+ var import_memoizerific = __toESM(require_memoizerific(), 1), import_picoquery = __toESM(require_main(), 1);
24
+ var splitPathRegex = /\/([^/]+)\/(?:(.*)_)?([^/]+)?/, parsePath = (0, import_memoizerific.default)(1e3)((path) => {
25
+ let result = {
29
26
  viewMode: void 0,
30
27
  storyId: void 0,
31
28
  refId: void 0
32
29
  };
33
30
  if (path) {
34
- const [, viewMode, refId, storyId] = path.toLowerCase().match(splitPathRegex) || [];
35
- if (viewMode) {
36
- Object.assign(result, {
37
- viewMode,
38
- storyId,
39
- refId
40
- });
41
- }
31
+ let [, viewMode, refId, storyId] = path.toLowerCase().match(splitPathRegex) || [];
32
+ viewMode && Object.assign(result, {
33
+ viewMode,
34
+ storyId,
35
+ refId
36
+ });
42
37
  }
43
38
  return result;
44
- });
45
- var DEEPLY_EQUAL = Symbol("Deeply equal");
46
- var deepDiff = /* @__PURE__ */ __name((value, update) => {
47
- if (typeof value !== typeof update) {
39
+ }), DEEPLY_EQUAL = Symbol("Deeply equal"), deepDiff = (value, update) => {
40
+ if (typeof value != typeof update)
48
41
  return update;
49
- }
50
- if (isEqual(value, update)) {
42
+ if (isEqual(value, update))
51
43
  return DEEPLY_EQUAL;
52
- }
53
44
  if (Array.isArray(value) && Array.isArray(update)) {
54
- const res = update.reduce((acc, upd, index) => {
55
- const diff = deepDiff(value[index], upd);
56
- if (diff !== DEEPLY_EQUAL) {
57
- acc[index] = diff;
58
- }
59
- return acc;
45
+ let res = update.reduce((acc, upd, index) => {
46
+ let diff = deepDiff(value[index], upd);
47
+ return diff !== DEEPLY_EQUAL && (acc[index] = diff), acc;
60
48
  }, new Array(update.length));
61
- if (update.length >= value.length) {
62
- return res;
63
- }
64
- return res.concat(new Array(value.length - update.length).fill(void 0));
65
- }
66
- if (isPlainObject(value) && isPlainObject(update)) {
67
- return Object.keys({ ...value, ...update }).reduce((acc, key) => {
68
- const diff = deepDiff(value?.[key], update?.[key]);
69
- return diff === DEEPLY_EQUAL ? acc : Object.assign(acc, { [key]: diff });
70
- }, {});
71
- }
72
- return update;
73
- }, "deepDiff");
74
- var VALIDATION_REGEXP = /^[a-zA-Z0-9 _-]*$/;
75
- var NUMBER_REGEXP = /^-?[0-9]+(\.[0-9]+)?$/;
76
- var HEX_REGEXP = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i;
77
- var COLOR_REGEXP = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i;
78
- var validateArgs = /* @__PURE__ */ __name((key = "", value) => {
79
- if (key === null) {
80
- return false;
81
- }
82
- if (key === "" || !VALIDATION_REGEXP.test(key)) {
83
- return false;
84
- }
85
- if (value === null || value === void 0) {
86
- return true;
87
- }
88
- if (value instanceof Date) {
89
- return true;
90
- }
91
- if (typeof value === "number" || typeof value === "boolean") {
92
- return true;
93
- }
94
- if (typeof value === "string") {
95
- return VALIDATION_REGEXP.test(value) || NUMBER_REGEXP.test(value) || HEX_REGEXP.test(value) || COLOR_REGEXP.test(value);
96
- }
97
- if (Array.isArray(value)) {
98
- return value.every((v) => validateArgs(key, v));
99
- }
100
- if (isPlainObject(value)) {
101
- return Object.entries(value).every(([k, v]) => validateArgs(k, v));
102
- }
103
- return false;
104
- }, "validateArgs");
105
- var encodeSpecialValues = /* @__PURE__ */ __name((value) => {
106
- if (value === void 0) {
107
- return "!undefined";
108
- }
109
- if (value === null) {
110
- return "!null";
111
- }
112
- if (typeof value === "string") {
113
- if (HEX_REGEXP.test(value)) {
114
- return `!hex(${value.slice(1)})`;
115
- }
116
- if (COLOR_REGEXP.test(value)) {
117
- return `!${value.replace(/[\s%]/g, "")}`;
118
- }
119
- return value;
120
- }
121
- if (typeof value === "boolean") {
122
- return `!${value}`;
123
- }
124
- if (value instanceof Date) {
125
- return `!date(${value.toISOString()})`;
126
- }
127
- if (Array.isArray(value)) {
128
- return value.map(encodeSpecialValues);
129
- }
130
- if (isPlainObject(value)) {
131
- return Object.entries(value).reduce(
132
- (acc, [key, val]) => Object.assign(acc, { [key]: encodeSpecialValues(val) }),
133
- {}
134
- );
135
- }
136
- return value;
137
- }, "encodeSpecialValues");
138
- var decodeKnownQueryChar = /* @__PURE__ */ __name((chr) => {
49
+ return update.length >= value.length ? res : res.concat(new Array(value.length - update.length).fill(void 0));
50
+ }
51
+ return isPlainObject(value) && isPlainObject(update) ? Object.keys({ ...value, ...update }).reduce((acc, key) => {
52
+ let diff = deepDiff(value?.[key], update?.[key]);
53
+ return diff === DEEPLY_EQUAL ? acc : Object.assign(acc, { [key]: diff });
54
+ }, {}) : update;
55
+ }, VALIDATION_REGEXP = /^[a-zA-Z0-9 _-]*$/, NUMBER_REGEXP = /^-?[0-9]+(\.[0-9]+)?$/, HEX_REGEXP = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, COLOR_REGEXP = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i, validateArgs = (key = "", value) => key === null || key === "" || !VALIDATION_REGEXP.test(key) ? !1 : value == null || value instanceof Date || typeof value == "number" || typeof value == "boolean" ? !0 : typeof value == "string" ? VALIDATION_REGEXP.test(value) || NUMBER_REGEXP.test(value) || HEX_REGEXP.test(value) || COLOR_REGEXP.test(value) : Array.isArray(value) ? value.every((v) => validateArgs(key, v)) : isPlainObject(value) ? Object.entries(value).every(([k, v]) => validateArgs(k, v)) : !1, encodeSpecialValues = (value) => value === void 0 ? "!undefined" : value === null ? "!null" : typeof value == "string" ? HEX_REGEXP.test(value) ? `!hex(${value.slice(1)})` : COLOR_REGEXP.test(value) ? `!${value.replace(/[\s%]/g, "")}` : value : typeof value == "boolean" ? `!${value}` : value instanceof Date ? `!date(${value.toISOString()})` : Array.isArray(value) ? value.map(encodeSpecialValues) : isPlainObject(value) ? Object.entries(value).reduce(
56
+ (acc, [key, val]) => Object.assign(acc, { [key]: encodeSpecialValues(val) }),
57
+ {}
58
+ ) : value, decodeKnownQueryChar = (chr) => {
139
59
  switch (chr) {
140
60
  case "%20":
141
61
  return "+";
@@ -149,57 +69,33 @@ var decodeKnownQueryChar = /* @__PURE__ */ __name((chr) => {
149
69
  return ":";
150
70
  }
151
71
  return chr;
152
- }, "decodeKnownQueryChar");
153
- var knownQueryChar = /%[0-9A-F]{2}/g;
154
- var buildArgsParam = /* @__PURE__ */ __name((initialArgs, args) => {
155
- const update = deepDiff(initialArgs, args);
156
- if (!update || update === DEEPLY_EQUAL) {
72
+ }, knownQueryChar = /%[0-9A-F]{2}/g, buildArgsParam = (initialArgs, args) => {
73
+ let update = deepDiff(initialArgs, args);
74
+ if (!update || update === DEEPLY_EQUAL)
157
75
  return "";
158
- }
159
- const object = Object.entries(update).reduce((acc, [key, value]) => {
160
- if (validateArgs(key, value)) {
161
- return Object.assign(acc, { [key]: value });
162
- }
163
- once.warn(dedent`
76
+ let object = Object.entries(update).reduce((acc, [key, value]) => validateArgs(key, value) ? Object.assign(acc, { [key]: value }) : (once.warn(dedent`
164
77
  Omitted potentially unsafe URL args.
165
78
 
166
79
  More info: https://storybook.js.org/docs/writing-stories/args?ref=error#setting-args-through-the-url
167
- `);
168
- return acc;
169
- }, {});
80
+ `), acc), {});
170
81
  return (0, import_picoquery.stringify)(encodeSpecialValues(object), {
171
82
  delimiter: ";",
172
83
  // we don't actually create multiple query params
173
- nesting: true,
84
+ nesting: !0,
174
85
  nestingSyntax: "js"
175
86
  // encode objects using dot notation: obj.key=val
176
87
  }).replace(knownQueryChar, decodeKnownQueryChar).split(";").map((part) => part.replace("=", ":")).join(";");
177
- }, "buildArgsParam");
178
- var queryFromString = (0, import_memoizerific.default)(1e3)((s) => s !== void 0 ? (0, import_picoquery.parse)(s) : {});
179
- var queryFromLocation = /* @__PURE__ */ __name((location) => {
180
- return queryFromString(location.search ? location.search.slice(1) : "");
181
- }, "queryFromLocation");
182
- var stringifyQuery = /* @__PURE__ */ __name((query) => {
183
- const queryStr = (0, import_picoquery.stringify)(query);
88
+ }, queryFromString = (0, import_memoizerific.default)(1e3)((s) => s !== void 0 ? (0, import_picoquery.parse)(s) : {}), queryFromLocation = (location) => queryFromString(location.search ? location.search.slice(1) : ""), stringifyQuery = (query) => {
89
+ let queryStr = (0, import_picoquery.stringify)(query);
184
90
  return queryStr ? "?" + queryStr : "";
185
- }, "stringifyQuery");
186
- var getMatch = (0, import_memoizerific.default)(1e3)((current, target, startsWith = true) => {
91
+ }, getMatch = (0, import_memoizerific.default)(1e3)((current, target, startsWith = !0) => {
187
92
  if (startsWith) {
188
- if (typeof target !== "string") {
93
+ if (typeof target != "string")
189
94
  throw new Error("startsWith only works with string targets");
190
- }
191
- const startsWithTarget = current && current.startsWith(target);
192
- if (startsWithTarget) {
193
- return { path: current };
194
- }
195
- return null;
196
- }
197
- const currentIsTarget = typeof target === "string" && current === target;
198
- const matchTarget = current && target && current.match(target);
199
- if (currentIsTarget || matchTarget) {
200
- return { path: current };
95
+ return current && current.startsWith(target) ? { path: current } : null;
201
96
  }
202
- return null;
97
+ let currentIsTarget = typeof target == "string" && current === target, matchTarget = current && target && current.match(target);
98
+ return currentIsTarget || matchTarget ? { path: current } : null;
203
99
  });
204
100
 
205
101
  // src/router/router.tsx
@@ -214,31 +110,22 @@ import * as React from "react";
214
110
 
215
111
  // ../node_modules/@remix-run/router/dist/router.js
216
112
  function _extends() {
217
- _extends = Object.assign ? Object.assign.bind() : function(target) {
113
+ return _extends = Object.assign ? Object.assign.bind() : function(target) {
218
114
  for (var i = 1; i < arguments.length; i++) {
219
115
  var source = arguments[i];
220
- for (var key in source) {
221
- if (Object.prototype.hasOwnProperty.call(source, key)) {
222
- target[key] = source[key];
223
- }
224
- }
116
+ for (var key in source)
117
+ Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
225
118
  }
226
119
  return target;
227
- };
228
- return _extends.apply(this, arguments);
120
+ }, _extends.apply(this, arguments);
229
121
  }
230
- __name(_extends, "_extends");
231
122
  var Action;
232
123
  (function(Action2) {
233
- Action2["Pop"] = "POP";
234
- Action2["Push"] = "PUSH";
235
- Action2["Replace"] = "REPLACE";
124
+ Action2.Pop = "POP", Action2.Push = "PUSH", Action2.Replace = "REPLACE";
236
125
  })(Action || (Action = {}));
237
126
  var PopStateEventType = "popstate";
238
127
  function createBrowserHistory(options) {
239
- if (options === void 0) {
240
- options = {};
241
- }
128
+ options === void 0 && (options = {});
242
129
  function createBrowserLocation(window2, globalHistory) {
243
130
  let {
244
131
  pathname,
@@ -257,34 +144,27 @@ function createBrowserHistory(options) {
257
144
  globalHistory.state && globalHistory.state.key || "default"
258
145
  );
259
146
  }
260
- __name(createBrowserLocation, "createBrowserLocation");
261
147
  function createBrowserHref(window2, to) {
262
- return typeof to === "string" ? to : createPath(to);
148
+ return typeof to == "string" ? to : createPath(to);
263
149
  }
264
- __name(createBrowserHref, "createBrowserHref");
265
150
  return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);
266
151
  }
267
- __name(createBrowserHistory, "createBrowserHistory");
268
152
  function invariant(value, message) {
269
- if (value === false || value === null || typeof value === "undefined") {
153
+ if (value === !1 || value === null || typeof value > "u")
270
154
  throw new Error(message);
271
- }
272
155
  }
273
- __name(invariant, "invariant");
274
156
  function warning(cond, message) {
275
157
  if (!cond) {
276
- if (typeof console !== "undefined") console.warn(message);
158
+ typeof console < "u" && console.warn(message);
277
159
  try {
278
160
  throw new Error(message);
279
- } catch (e) {
161
+ } catch {
280
162
  }
281
163
  }
282
164
  }
283
- __name(warning, "warning");
284
165
  function createKey() {
285
166
  return Math.random().toString(36).substr(2, 8);
286
167
  }
287
- __name(createKey, "createKey");
288
168
  function getHistoryState(location, index) {
289
169
  return {
290
170
  usr: location.state,
@@ -292,16 +172,12 @@ function getHistoryState(location, index) {
292
172
  idx: index
293
173
  };
294
174
  }
295
- __name(getHistoryState, "getHistoryState");
296
175
  function createLocation(current, to, state, key) {
297
- if (state === void 0) {
298
- state = null;
299
- }
300
- let location = _extends({
301
- pathname: typeof current === "string" ? current : current.pathname,
176
+ return state === void 0 && (state = null), _extends({
177
+ pathname: typeof current == "string" ? current : current.pathname,
302
178
  search: "",
303
179
  hash: ""
304
- }, typeof to === "string" ? parsePath2(to) : to, {
180
+ }, typeof to == "string" ? parsePath2(to) : to, {
305
181
  state,
306
182
  // TODO: This could be cleaned up. push/replace should probably just take
307
183
  // full Locations now and avoid the need to run through this flow at all
@@ -309,127 +185,81 @@ function createLocation(current, to, state, key) {
309
185
  // keep as is for the time being and just let any incoming keys take precedence
310
186
  key: to && to.key || key || createKey()
311
187
  });
312
- return location;
313
188
  }
314
- __name(createLocation, "createLocation");
315
189
  function createPath(_ref) {
316
190
  let {
317
191
  pathname = "/",
318
192
  search = "",
319
193
  hash = ""
320
194
  } = _ref;
321
- if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search;
322
- if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash;
323
- return pathname;
195
+ return search && search !== "?" && (pathname += search.charAt(0) === "?" ? search : "?" + search), hash && hash !== "#" && (pathname += hash.charAt(0) === "#" ? hash : "#" + hash), pathname;
324
196
  }
325
- __name(createPath, "createPath");
326
197
  function parsePath2(path) {
327
198
  let parsedPath = {};
328
199
  if (path) {
329
200
  let hashIndex = path.indexOf("#");
330
- if (hashIndex >= 0) {
331
- parsedPath.hash = path.substr(hashIndex);
332
- path = path.substr(0, hashIndex);
333
- }
201
+ hashIndex >= 0 && (parsedPath.hash = path.substr(hashIndex), path = path.substr(0, hashIndex));
334
202
  let searchIndex = path.indexOf("?");
335
- if (searchIndex >= 0) {
336
- parsedPath.search = path.substr(searchIndex);
337
- path = path.substr(0, searchIndex);
338
- }
339
- if (path) {
340
- parsedPath.pathname = path;
341
- }
203
+ searchIndex >= 0 && (parsedPath.search = path.substr(searchIndex), path = path.substr(0, searchIndex)), path && (parsedPath.pathname = path);
342
204
  }
343
205
  return parsedPath;
344
206
  }
345
- __name(parsePath2, "parsePath");
346
207
  function getUrlBasedHistory(getLocation, createHref, validateLocation, options) {
347
- if (options === void 0) {
348
- options = {};
349
- }
208
+ options === void 0 && (options = {});
350
209
  let {
351
210
  window: window2 = document.defaultView,
352
- v5Compat = false
353
- } = options;
354
- let globalHistory = window2.history;
355
- let action = Action.Pop;
356
- let listener = null;
357
- let index = getIndex();
358
- if (index == null) {
359
- index = 0;
360
- globalHistory.replaceState(_extends({}, globalHistory.state, {
361
- idx: index
362
- }), "");
363
- }
211
+ v5Compat = !1
212
+ } = options, globalHistory = window2.history, action = Action.Pop, listener = null, index = getIndex();
213
+ index == null && (index = 0, globalHistory.replaceState(_extends({}, globalHistory.state, {
214
+ idx: index
215
+ }), ""));
364
216
  function getIndex() {
365
- let state = globalHistory.state || {
217
+ return (globalHistory.state || {
366
218
  idx: null
367
- };
368
- return state.idx;
219
+ }).idx;
369
220
  }
370
- __name(getIndex, "getIndex");
371
221
  function handlePop() {
372
222
  action = Action.Pop;
373
- let nextIndex = getIndex();
374
- let delta = nextIndex == null ? null : nextIndex - index;
375
- index = nextIndex;
376
- if (listener) {
377
- listener({
378
- action,
379
- location: history.location,
380
- delta
381
- });
382
- }
223
+ let nextIndex = getIndex(), delta = nextIndex == null ? null : nextIndex - index;
224
+ index = nextIndex, listener && listener({
225
+ action,
226
+ location: history.location,
227
+ delta
228
+ });
383
229
  }
384
- __name(handlePop, "handlePop");
385
230
  function push(to, state) {
386
231
  action = Action.Push;
387
232
  let location = createLocation(history.location, to, state);
388
- if (validateLocation) validateLocation(location, to);
389
- index = getIndex() + 1;
390
- let historyState = getHistoryState(location, index);
391
- let url = history.createHref(location);
233
+ validateLocation && validateLocation(location, to), index = getIndex() + 1;
234
+ let historyState = getHistoryState(location, index), url = history.createHref(location);
392
235
  try {
393
236
  globalHistory.pushState(historyState, "", url);
394
237
  } catch (error) {
395
- if (error instanceof DOMException && error.name === "DataCloneError") {
238
+ if (error instanceof DOMException && error.name === "DataCloneError")
396
239
  throw error;
397
- }
398
240
  window2.location.assign(url);
399
241
  }
400
- if (v5Compat && listener) {
401
- listener({
402
- action,
403
- location: history.location,
404
- delta: 1
405
- });
406
- }
242
+ v5Compat && listener && listener({
243
+ action,
244
+ location: history.location,
245
+ delta: 1
246
+ });
407
247
  }
408
- __name(push, "push");
409
248
  function replace(to, state) {
410
249
  action = Action.Replace;
411
250
  let location = createLocation(history.location, to, state);
412
- if (validateLocation) validateLocation(location, to);
413
- index = getIndex();
414
- let historyState = getHistoryState(location, index);
415
- let url = history.createHref(location);
416
- globalHistory.replaceState(historyState, "", url);
417
- if (v5Compat && listener) {
418
- listener({
419
- action,
420
- location: history.location,
421
- delta: 0
422
- });
423
- }
251
+ validateLocation && validateLocation(location, to), index = getIndex();
252
+ let historyState = getHistoryState(location, index), url = history.createHref(location);
253
+ globalHistory.replaceState(historyState, "", url), v5Compat && listener && listener({
254
+ action,
255
+ location: history.location,
256
+ delta: 0
257
+ });
424
258
  }
425
- __name(replace, "replace");
426
259
  function createURL(to) {
427
- let base = window2.location.origin !== "null" ? window2.location.origin : window2.location.href;
428
- let href = typeof to === "string" ? to : createPath(to);
429
- invariant(base, "No window.location.(origin|href) available to create URL for href: " + href);
430
- return new URL(href, base);
260
+ let base = window2.location.origin !== "null" ? window2.location.origin : window2.location.href, href = typeof to == "string" ? to : createPath(to);
261
+ return invariant(base, "No window.location.(origin|href) available to create URL for href: " + href), new URL(href, base);
431
262
  }
432
- __name(createURL, "createURL");
433
263
  let history = {
434
264
  get action() {
435
265
  return action;
@@ -438,14 +268,10 @@ function getUrlBasedHistory(getLocation, createHref, validateLocation, options)
438
268
  return getLocation(window2, globalHistory);
439
269
  },
440
270
  listen(fn) {
441
- if (listener) {
271
+ if (listener)
442
272
  throw new Error("A history only accepts one active listener");
443
- }
444
- window2.addEventListener(PopStateEventType, handlePop);
445
- listener = fn;
446
- return () => {
447
- window2.removeEventListener(PopStateEventType, handlePop);
448
- listener = null;
273
+ return window2.addEventListener(PopStateEventType, handlePop), listener = fn, () => {
274
+ window2.removeEventListener(PopStateEventType, handlePop), listener = null;
449
275
  };
450
276
  },
451
277
  createHref(to) {
@@ -468,306 +294,197 @@ function getUrlBasedHistory(getLocation, createHref, validateLocation, options)
468
294
  };
469
295
  return history;
470
296
  }
471
- __name(getUrlBasedHistory, "getUrlBasedHistory");
472
297
  var ResultType;
473
298
  (function(ResultType2) {
474
- ResultType2["data"] = "data";
475
- ResultType2["deferred"] = "deferred";
476
- ResultType2["redirect"] = "redirect";
477
- ResultType2["error"] = "error";
299
+ ResultType2.data = "data", ResultType2.deferred = "deferred", ResultType2.redirect = "redirect", ResultType2.error = "error";
478
300
  })(ResultType || (ResultType = {}));
479
301
  function stripBasename(pathname, basename) {
480
302
  if (basename === "/") return pathname;
481
- if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
303
+ if (!pathname.toLowerCase().startsWith(basename.toLowerCase()))
482
304
  return null;
483
- }
484
- let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
485
- let nextChar = pathname.charAt(startIndex);
486
- if (nextChar && nextChar !== "/") {
487
- return null;
488
- }
489
- return pathname.slice(startIndex) || "/";
305
+ let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length, nextChar = pathname.charAt(startIndex);
306
+ return nextChar && nextChar !== "/" ? null : pathname.slice(startIndex) || "/";
490
307
  }
491
- __name(stripBasename, "stripBasename");
492
308
  function resolvePath(to, fromPathname) {
493
- if (fromPathname === void 0) {
494
- fromPathname = "/";
495
- }
309
+ fromPathname === void 0 && (fromPathname = "/");
496
310
  let {
497
311
  pathname: toPathname,
498
312
  search = "",
499
313
  hash = ""
500
- } = typeof to === "string" ? parsePath2(to) : to;
501
- let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
314
+ } = typeof to == "string" ? parsePath2(to) : to;
502
315
  return {
503
- pathname,
316
+ pathname: toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname,
504
317
  search: normalizeSearch(search),
505
318
  hash: normalizeHash(hash)
506
319
  };
507
320
  }
508
- __name(resolvePath, "resolvePath");
509
321
  function resolvePathname(relativePath, fromPathname) {
510
322
  let segments = fromPathname.replace(/\/+$/, "").split("/");
511
- let relativeSegments = relativePath.split("/");
512
- relativeSegments.forEach((segment) => {
513
- if (segment === "..") {
514
- if (segments.length > 1) segments.pop();
515
- } else if (segment !== ".") {
516
- segments.push(segment);
517
- }
518
- });
519
- return segments.length > 1 ? segments.join("/") : "/";
323
+ return relativePath.split("/").forEach((segment) => {
324
+ segment === ".." ? segments.length > 1 && segments.pop() : segment !== "." && segments.push(segment);
325
+ }), segments.length > 1 ? segments.join("/") : "/";
520
326
  }
521
- __name(resolvePathname, "resolvePathname");
522
327
  function getInvalidPathError(char, field, dest, path) {
523
328
  return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
524
329
  }
525
- __name(getInvalidPathError, "getInvalidPathError");
526
330
  function getPathContributingMatches(matches) {
527
331
  return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);
528
332
  }
529
- __name(getPathContributingMatches, "getPathContributingMatches");
530
333
  function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
531
- if (isPathRelative === void 0) {
532
- isPathRelative = false;
533
- }
334
+ isPathRelative === void 0 && (isPathRelative = !1);
534
335
  let to;
535
- if (typeof toArg === "string") {
536
- to = parsePath2(toArg);
537
- } else {
538
- to = _extends({}, toArg);
539
- invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));
540
- invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));
541
- invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));
542
- }
543
- let isEmptyPath = toArg === "" || to.pathname === "";
544
- let toPathname = isEmptyPath ? "/" : to.pathname;
545
- let from;
546
- if (isPathRelative || toPathname == null) {
336
+ typeof toArg == "string" ? to = parsePath2(toArg) : (to = _extends({}, toArg), invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to)), invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to)), invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to)));
337
+ let isEmptyPath = toArg === "" || to.pathname === "", toPathname = isEmptyPath ? "/" : to.pathname, from;
338
+ if (isPathRelative || toPathname == null)
547
339
  from = locationPathname;
548
- } else {
340
+ else {
549
341
  let routePathnameIndex = routePathnames.length - 1;
550
342
  if (toPathname.startsWith("..")) {
551
343
  let toSegments = toPathname.split("/");
552
- while (toSegments[0] === "..") {
553
- toSegments.shift();
554
- routePathnameIndex -= 1;
555
- }
344
+ for (; toSegments[0] === ".."; )
345
+ toSegments.shift(), routePathnameIndex -= 1;
556
346
  to.pathname = toSegments.join("/");
557
347
  }
558
348
  from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
559
349
  }
560
- let path = resolvePath(to, from);
561
- let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
562
- let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
563
- if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
564
- path.pathname += "/";
565
- }
566
- return path;
350
+ let path = resolvePath(to, from), hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"), hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
351
+ return !path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash) && (path.pathname += "/"), path;
567
352
  }
568
- __name(resolveTo, "resolveTo");
569
- var joinPaths = /* @__PURE__ */ __name((paths) => paths.join("/").replace(/\/\/+/g, "/"), "joinPaths");
570
- var normalizeSearch = /* @__PURE__ */ __name((search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search, "normalizeSearch");
571
- var normalizeHash = /* @__PURE__ */ __name((hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash, "normalizeHash");
353
+ var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
354
+ var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search, normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
572
355
  function isRouteErrorResponse(error) {
573
- return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
356
+ return error != null && typeof error.status == "number" && typeof error.statusText == "string" && typeof error.internal == "boolean" && "data" in error;
574
357
  }
575
- __name(isRouteErrorResponse, "isRouteErrorResponse");
576
- var validMutationMethodsArr = ["post", "put", "patch", "delete"];
577
- var validMutationMethods = new Set(validMutationMethodsArr);
578
- var validRequestMethodsArr = ["get", ...validMutationMethodsArr];
579
- var validRequestMethods = new Set(validRequestMethodsArr);
358
+ var validMutationMethodsArr = ["post", "put", "patch", "delete"], validMutationMethods = new Set(validMutationMethodsArr), validRequestMethodsArr = ["get", ...validMutationMethodsArr], validRequestMethods = new Set(validRequestMethodsArr);
580
359
  var UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");
581
360
 
582
361
  // ../node_modules/react-router/dist/index.js
583
362
  function _extends2() {
584
- _extends2 = Object.assign ? Object.assign.bind() : function(target) {
363
+ return _extends2 = Object.assign ? Object.assign.bind() : function(target) {
585
364
  for (var i = 1; i < arguments.length; i++) {
586
365
  var source = arguments[i];
587
- for (var key in source) {
588
- if (Object.prototype.hasOwnProperty.call(source, key)) {
589
- target[key] = source[key];
590
- }
591
- }
366
+ for (var key in source)
367
+ Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
592
368
  }
593
369
  return target;
594
- };
595
- return _extends2.apply(this, arguments);
370
+ }, _extends2.apply(this, arguments);
596
371
  }
597
- __name(_extends2, "_extends");
598
372
  var DataRouterContext = React.createContext(null);
599
- if (process.env.NODE_ENV !== "production") {
600
- DataRouterContext.displayName = "DataRouter";
601
- }
373
+ process.env.NODE_ENV !== "production" && (DataRouterContext.displayName = "DataRouter");
602
374
  var DataRouterStateContext = React.createContext(null);
603
- if (process.env.NODE_ENV !== "production") {
604
- DataRouterStateContext.displayName = "DataRouterState";
605
- }
375
+ process.env.NODE_ENV !== "production" && (DataRouterStateContext.displayName = "DataRouterState");
606
376
  var AwaitContext = React.createContext(null);
607
- if (process.env.NODE_ENV !== "production") {
608
- AwaitContext.displayName = "Await";
609
- }
377
+ process.env.NODE_ENV !== "production" && (AwaitContext.displayName = "Await");
610
378
  var NavigationContext = React.createContext(null);
611
- if (process.env.NODE_ENV !== "production") {
612
- NavigationContext.displayName = "Navigation";
613
- }
379
+ process.env.NODE_ENV !== "production" && (NavigationContext.displayName = "Navigation");
614
380
  var LocationContext = React.createContext(null);
615
- if (process.env.NODE_ENV !== "production") {
616
- LocationContext.displayName = "Location";
617
- }
381
+ process.env.NODE_ENV !== "production" && (LocationContext.displayName = "Location");
618
382
  var RouteContext = React.createContext({
619
383
  outlet: null,
620
384
  matches: [],
621
- isDataRoute: false
385
+ isDataRoute: !1
622
386
  });
623
- if (process.env.NODE_ENV !== "production") {
624
- RouteContext.displayName = "Route";
625
- }
387
+ process.env.NODE_ENV !== "production" && (RouteContext.displayName = "Route");
626
388
  var RouteErrorContext = React.createContext(null);
627
- if (process.env.NODE_ENV !== "production") {
628
- RouteErrorContext.displayName = "RouteError";
629
- }
389
+ process.env.NODE_ENV !== "production" && (RouteErrorContext.displayName = "RouteError");
630
390
  function useHref(to, _temp) {
631
391
  let {
632
392
  relative
633
393
  } = _temp === void 0 ? {} : _temp;
634
- !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
635
- false,
394
+ useInRouterContext() || (process.env.NODE_ENV !== "production" ? invariant(
395
+ !1,
636
396
  // TODO: This error is probably because they somehow have 2 versions of the
637
397
  // router loaded. We can help them understand how to avoid that.
638
398
  "useHref() may be used only in the context of a <Router> component."
639
- ) : invariant(false) : void 0;
399
+ ) : invariant(!1));
640
400
  let {
641
401
  basename,
642
402
  navigator
643
- } = React.useContext(NavigationContext);
644
- let {
403
+ } = React.useContext(NavigationContext), {
645
404
  hash,
646
405
  pathname,
647
406
  search
648
407
  } = useResolvedPath(to, {
649
408
  relative
650
- });
651
- let joinedPathname = pathname;
652
- if (basename !== "/") {
653
- joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
654
- }
655
- return navigator.createHref({
409
+ }), joinedPathname = pathname;
410
+ return basename !== "/" && (joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname])), navigator.createHref({
656
411
  pathname: joinedPathname,
657
412
  search,
658
413
  hash
659
414
  });
660
415
  }
661
- __name(useHref, "useHref");
662
416
  function useInRouterContext() {
663
417
  return React.useContext(LocationContext) != null;
664
418
  }
665
- __name(useInRouterContext, "useInRouterContext");
666
419
  function useLocation() {
667
- !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
668
- false,
420
+ return useInRouterContext() || (process.env.NODE_ENV !== "production" ? invariant(
421
+ !1,
669
422
  // TODO: This error is probably because they somehow have 2 versions of the
670
423
  // router loaded. We can help them understand how to avoid that.
671
424
  "useLocation() may be used only in the context of a <Router> component."
672
- ) : invariant(false) : void 0;
673
- return React.useContext(LocationContext).location;
425
+ ) : invariant(!1)), React.useContext(LocationContext).location;
674
426
  }
675
- __name(useLocation, "useLocation");
676
427
  var navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
677
428
  function useIsomorphicLayoutEffect(cb) {
678
- let isStatic = React.useContext(NavigationContext).static;
679
- if (!isStatic) {
680
- React.useLayoutEffect(cb);
681
- }
429
+ React.useContext(NavigationContext).static || React.useLayoutEffect(cb);
682
430
  }
683
- __name(useIsomorphicLayoutEffect, "useIsomorphicLayoutEffect");
684
431
  function useNavigate() {
685
432
  let {
686
433
  isDataRoute
687
434
  } = React.useContext(RouteContext);
688
435
  return isDataRoute ? useNavigateStable() : useNavigateUnstable();
689
436
  }
690
- __name(useNavigate, "useNavigate");
691
437
  function useNavigateUnstable() {
692
- !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
693
- false,
438
+ useInRouterContext() || (process.env.NODE_ENV !== "production" ? invariant(
439
+ !1,
694
440
  // TODO: This error is probably because they somehow have 2 versions of the
695
441
  // router loaded. We can help them understand how to avoid that.
696
442
  "useNavigate() may be used only in the context of a <Router> component."
697
- ) : invariant(false) : void 0;
698
- let dataRouterContext = React.useContext(DataRouterContext);
699
- let {
443
+ ) : invariant(!1));
444
+ let dataRouterContext = React.useContext(DataRouterContext), {
700
445
  basename,
701
446
  navigator
702
- } = React.useContext(NavigationContext);
703
- let {
447
+ } = React.useContext(NavigationContext), {
704
448
  matches
705
- } = React.useContext(RouteContext);
706
- let {
449
+ } = React.useContext(RouteContext), {
707
450
  pathname: locationPathname
708
- } = useLocation();
709
- let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));
710
- let activeRef = React.useRef(false);
711
- useIsomorphicLayoutEffect(() => {
712
- activeRef.current = true;
713
- });
714
- let navigate = React.useCallback(function(to, options) {
715
- if (options === void 0) {
716
- options = {};
717
- }
718
- process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
719
- if (!activeRef.current) return;
720
- if (typeof to === "number") {
451
+ } = useLocation(), routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase)), activeRef = React.useRef(!1);
452
+ return useIsomorphicLayoutEffect(() => {
453
+ activeRef.current = !0;
454
+ }), React.useCallback(function(to, options) {
455
+ if (options === void 0 && (options = {}), process.env.NODE_ENV !== "production" && warning(activeRef.current, navigateEffectWarning), !activeRef.current) return;
456
+ if (typeof to == "number") {
721
457
  navigator.go(to);
722
458
  return;
723
459
  }
724
460
  let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
725
- if (dataRouterContext == null && basename !== "/") {
726
- path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
727
- }
728
- (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);
461
+ dataRouterContext == null && basename !== "/" && (path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname])), (options.replace ? navigator.replace : navigator.push)(path, options.state, options);
729
462
  }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);
730
- return navigate;
731
463
  }
732
- __name(useNavigateUnstable, "useNavigateUnstable");
733
464
  var OutletContext = React.createContext(null);
734
465
  function useResolvedPath(to, _temp2) {
735
466
  let {
736
467
  relative
737
- } = _temp2 === void 0 ? {} : _temp2;
738
- let {
468
+ } = _temp2 === void 0 ? {} : _temp2, {
739
469
  matches
740
- } = React.useContext(RouteContext);
741
- let {
470
+ } = React.useContext(RouteContext), {
742
471
  pathname: locationPathname
743
- } = useLocation();
744
- let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));
472
+ } = useLocation(), routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match) => match.pathnameBase));
745
473
  return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
746
474
  }
747
- __name(useResolvedPath, "useResolvedPath");
748
475
  function DefaultErrorComponent() {
749
- let error = useRouteError();
750
- let message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);
751
- let stack = error instanceof Error ? error.stack : null;
752
- let lightgrey = "rgba(200,200,200, 0.5)";
753
- let preStyles = {
476
+ let error = useRouteError(), message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error), stack = error instanceof Error ? error.stack : null, lightgrey = "rgba(200,200,200, 0.5)", preStyles = {
754
477
  padding: "0.5rem",
755
478
  backgroundColor: lightgrey
756
- };
757
- let codeStyles = {
479
+ }, codeStyles = {
758
480
  padding: "2px 4px",
759
481
  backgroundColor: lightgrey
760
- };
761
- let devInfo = null;
762
- if (process.env.NODE_ENV !== "production") {
763
- console.error("Error handled by React Router default ErrorBoundary:", error);
764
- devInfo = React.createElement(React.Fragment, null, React.createElement("p", null, "\u{1F4BF} Hey developer \u{1F44B}"), React.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", React.createElement("code", {
765
- style: codeStyles
766
- }, "ErrorBoundary"), " or", " ", React.createElement("code", {
767
- style: codeStyles
768
- }, "errorElement"), " prop on your route."));
769
- }
770
- return React.createElement(React.Fragment, null, React.createElement("h2", null, "Unexpected Application Error!"), React.createElement("h3", {
482
+ }, devInfo = null;
483
+ return process.env.NODE_ENV !== "production" && (console.error("Error handled by React Router default ErrorBoundary:", error), devInfo = React.createElement(React.Fragment, null, React.createElement("p", null, "\u{1F4BF} Hey developer \u{1F44B}"), React.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", React.createElement("code", {
484
+ style: codeStyles
485
+ }, "ErrorBoundary"), " or", " ", React.createElement("code", {
486
+ style: codeStyles
487
+ }, "errorElement"), " prop on your route."))), React.createElement(React.Fragment, null, React.createElement("h2", null, "Unexpected Application Error!"), React.createElement("h3", {
771
488
  style: {
772
489
  fontStyle: "italic"
773
490
  }
@@ -775,65 +492,37 @@ function DefaultErrorComponent() {
775
492
  style: preStyles
776
493
  }, stack) : null, devInfo);
777
494
  }
778
- __name(DefaultErrorComponent, "DefaultErrorComponent");
779
495
  var defaultErrorElement = React.createElement(DefaultErrorComponent, null);
780
- var DataRouterHook = function(DataRouterHook3) {
781
- DataRouterHook3["UseBlocker"] = "useBlocker";
782
- DataRouterHook3["UseRevalidator"] = "useRevalidator";
783
- DataRouterHook3["UseNavigateStable"] = "useNavigate";
784
- return DataRouterHook3;
785
- }(DataRouterHook || {});
786
- var DataRouterStateHook = function(DataRouterStateHook3) {
787
- DataRouterStateHook3["UseBlocker"] = "useBlocker";
788
- DataRouterStateHook3["UseLoaderData"] = "useLoaderData";
789
- DataRouterStateHook3["UseActionData"] = "useActionData";
790
- DataRouterStateHook3["UseRouteError"] = "useRouteError";
791
- DataRouterStateHook3["UseNavigation"] = "useNavigation";
792
- DataRouterStateHook3["UseRouteLoaderData"] = "useRouteLoaderData";
793
- DataRouterStateHook3["UseMatches"] = "useMatches";
794
- DataRouterStateHook3["UseRevalidator"] = "useRevalidator";
795
- DataRouterStateHook3["UseNavigateStable"] = "useNavigate";
796
- DataRouterStateHook3["UseRouteId"] = "useRouteId";
797
- return DataRouterStateHook3;
798
- }(DataRouterStateHook || {});
496
+ var DataRouterHook = (function(DataRouterHook3) {
497
+ return DataRouterHook3.UseBlocker = "useBlocker", DataRouterHook3.UseRevalidator = "useRevalidator", DataRouterHook3.UseNavigateStable = "useNavigate", DataRouterHook3;
498
+ })(DataRouterHook || {}), DataRouterStateHook = (function(DataRouterStateHook3) {
499
+ return DataRouterStateHook3.UseBlocker = "useBlocker", DataRouterStateHook3.UseLoaderData = "useLoaderData", DataRouterStateHook3.UseActionData = "useActionData", DataRouterStateHook3.UseRouteError = "useRouteError", DataRouterStateHook3.UseNavigation = "useNavigation", DataRouterStateHook3.UseRouteLoaderData = "useRouteLoaderData", DataRouterStateHook3.UseMatches = "useMatches", DataRouterStateHook3.UseRevalidator = "useRevalidator", DataRouterStateHook3.UseNavigateStable = "useNavigate", DataRouterStateHook3.UseRouteId = "useRouteId", DataRouterStateHook3;
500
+ })(DataRouterStateHook || {});
799
501
  function getDataRouterConsoleError(hookName) {
800
502
  return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
801
503
  }
802
- __name(getDataRouterConsoleError, "getDataRouterConsoleError");
803
504
  function useDataRouterContext(hookName) {
804
505
  let ctx = React.useContext(DataRouterContext);
805
- !ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
806
- return ctx;
506
+ return ctx || (process.env.NODE_ENV !== "production" ? invariant(!1, getDataRouterConsoleError(hookName)) : invariant(!1)), ctx;
807
507
  }
808
- __name(useDataRouterContext, "useDataRouterContext");
809
508
  function useDataRouterState(hookName) {
810
509
  let state = React.useContext(DataRouterStateContext);
811
- !state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
812
- return state;
510
+ return state || (process.env.NODE_ENV !== "production" ? invariant(!1, getDataRouterConsoleError(hookName)) : invariant(!1)), state;
813
511
  }
814
- __name(useDataRouterState, "useDataRouterState");
815
512
  function useRouteContext(hookName) {
816
513
  let route = React.useContext(RouteContext);
817
- !route ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
818
- return route;
514
+ return route || (process.env.NODE_ENV !== "production" ? invariant(!1, getDataRouterConsoleError(hookName)) : invariant(!1)), route;
819
515
  }
820
- __name(useRouteContext, "useRouteContext");
821
516
  function useCurrentRouteId(hookName) {
822
- let route = useRouteContext(hookName);
823
- let thisRoute = route.matches[route.matches.length - 1];
824
- !thisRoute.route.id ? process.env.NODE_ENV !== "production" ? invariant(false, hookName + ' can only be used on routes that contain a unique "id"') : invariant(false) : void 0;
825
- return thisRoute.route.id;
517
+ let route = useRouteContext(hookName), thisRoute = route.matches[route.matches.length - 1];
518
+ return thisRoute.route.id || (process.env.NODE_ENV !== "production" ? invariant(!1, hookName + ' can only be used on routes that contain a unique "id"') : invariant(!1)), thisRoute.route.id;
826
519
  }
827
- __name(useCurrentRouteId, "useCurrentRouteId");
828
520
  function useRouteId() {
829
521
  return useCurrentRouteId(DataRouterStateHook.UseRouteId);
830
522
  }
831
- __name(useRouteId, "useRouteId");
832
523
  function useNavigation() {
833
- let state = useDataRouterState(DataRouterStateHook.UseNavigation);
834
- return state.navigation;
524
+ return useDataRouterState(DataRouterStateHook.UseNavigation).navigation;
835
525
  }
836
- __name(useNavigation, "useNavigation");
837
526
  function useMatches() {
838
527
  let {
839
528
  matches,
@@ -853,46 +542,24 @@ function useMatches() {
853
542
  };
854
543
  }), [matches, loaderData]);
855
544
  }
856
- __name(useMatches, "useMatches");
857
545
  function useRouteError() {
858
546
  var _state$errors;
859
- let error = React.useContext(RouteErrorContext);
860
- let state = useDataRouterState(DataRouterStateHook.UseRouteError);
861
- let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);
862
- if (error) {
863
- return error;
864
- }
865
- return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];
547
+ let error = React.useContext(RouteErrorContext), state = useDataRouterState(DataRouterStateHook.UseRouteError), routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);
548
+ return error || ((_state$errors = state.errors) == null ? void 0 : _state$errors[routeId]);
866
549
  }
867
- __name(useRouteError, "useRouteError");
868
550
  function useNavigateStable() {
869
551
  let {
870
552
  router
871
- } = useDataRouterContext(DataRouterHook.UseNavigateStable);
872
- let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);
873
- let activeRef = React.useRef(false);
874
- useIsomorphicLayoutEffect(() => {
875
- activeRef.current = true;
876
- });
877
- let navigate = React.useCallback(function(to, options) {
878
- if (options === void 0) {
879
- options = {};
880
- }
881
- process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
882
- if (!activeRef.current) return;
883
- if (typeof to === "number") {
884
- router.navigate(to);
885
- } else {
886
- router.navigate(to, _extends2({
887
- fromRouteId: id
888
- }, options));
889
- }
553
+ } = useDataRouterContext(DataRouterHook.UseNavigateStable), id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable), activeRef = React.useRef(!1);
554
+ return useIsomorphicLayoutEffect(() => {
555
+ activeRef.current = !0;
556
+ }), React.useCallback(function(to, options) {
557
+ options === void 0 && (options = {}), process.env.NODE_ENV !== "production" && warning(activeRef.current, navigateEffectWarning), activeRef.current && (typeof to == "number" ? router.navigate(to) : router.navigate(to, _extends2({
558
+ fromRouteId: id
559
+ }, options)));
890
560
  }, [router, id]);
891
- return navigate;
892
561
  }
893
- __name(useNavigateStable, "useNavigateStable");
894
- var START_TRANSITION = "startTransition";
895
- var startTransitionImpl = React[START_TRANSITION];
562
+ var START_TRANSITION = "startTransition", startTransitionImpl = React[START_TRANSITION];
896
563
  function Router(_ref5) {
897
564
  let {
898
565
  basename: basenameProp = "/",
@@ -900,31 +567,24 @@ function Router(_ref5) {
900
567
  location: locationProp,
901
568
  navigationType = Action.Pop,
902
569
  navigator,
903
- static: staticProp = false
570
+ static: staticProp = !1
904
571
  } = _ref5;
905
- !!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : invariant(false) : void 0;
906
- let basename = basenameProp.replace(/^\/*/, "/");
907
- let navigationContext = React.useMemo(() => ({
572
+ useInRouterContext() && (process.env.NODE_ENV !== "production" ? invariant(!1, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : invariant(!1));
573
+ let basename = basenameProp.replace(/^\/*/, "/"), navigationContext = React.useMemo(() => ({
908
574
  basename,
909
575
  navigator,
910
576
  static: staticProp
911
577
  }), [basename, navigator, staticProp]);
912
- if (typeof locationProp === "string") {
913
- locationProp = parsePath2(locationProp);
914
- }
578
+ typeof locationProp == "string" && (locationProp = parsePath2(locationProp));
915
579
  let {
916
580
  pathname = "/",
917
581
  search = "",
918
582
  hash = "",
919
583
  state = null,
920
584
  key = "default"
921
- } = locationProp;
922
- let locationContext = React.useMemo(() => {
585
+ } = locationProp, locationContext = React.useMemo(() => {
923
586
  let trailingPathname = stripBasename(pathname, basename);
924
- if (trailingPathname == null) {
925
- return null;
926
- }
927
- return {
587
+ return trailingPathname == null ? null : {
928
588
  location: {
929
589
  pathname: trailingPathname,
930
590
  search,
@@ -935,133 +595,86 @@ function Router(_ref5) {
935
595
  navigationType
936
596
  };
937
597
  }, [basename, pathname, search, hash, state, key, navigationType]);
938
- process.env.NODE_ENV !== "production" ? warning(locationContext != null, '<Router basename="' + basename + '"> is not able to match the URL ' + ('"' + pathname + search + hash + '" because it does not start with the ') + "basename, so the <Router> won't render anything.") : void 0;
939
- if (locationContext == null) {
940
- return null;
941
- }
942
- return React.createElement(NavigationContext.Provider, {
598
+ return process.env.NODE_ENV !== "production" && warning(locationContext != null, '<Router basename="' + basename + '"> is not able to match the URL ' + ('"' + pathname + search + hash + '" because it does not start with the ') + "basename, so the <Router> won't render anything."), locationContext == null ? null : React.createElement(NavigationContext.Provider, {
943
599
  value: navigationContext
944
600
  }, React.createElement(LocationContext.Provider, {
945
601
  children,
946
602
  value: locationContext
947
603
  }));
948
604
  }
949
- __name(Router, "Router");
950
- var AwaitRenderStatus = function(AwaitRenderStatus2) {
951
- AwaitRenderStatus2[AwaitRenderStatus2["pending"] = 0] = "pending";
952
- AwaitRenderStatus2[AwaitRenderStatus2["success"] = 1] = "success";
953
- AwaitRenderStatus2[AwaitRenderStatus2["error"] = 2] = "error";
954
- return AwaitRenderStatus2;
955
- }(AwaitRenderStatus || {});
956
- var neverSettledPromise = new Promise(() => {
605
+ var AwaitRenderStatus = (function(AwaitRenderStatus2) {
606
+ return AwaitRenderStatus2[AwaitRenderStatus2.pending = 0] = "pending", AwaitRenderStatus2[AwaitRenderStatus2.success = 1] = "success", AwaitRenderStatus2[AwaitRenderStatus2.error = 2] = "error", AwaitRenderStatus2;
607
+ })(AwaitRenderStatus || {}), neverSettledPromise = new Promise(() => {
957
608
  });
958
609
 
959
610
  // ../node_modules/react-router-dom/dist/index.js
960
611
  function _extends3() {
961
- _extends3 = Object.assign ? Object.assign.bind() : function(target) {
612
+ return _extends3 = Object.assign ? Object.assign.bind() : function(target) {
962
613
  for (var i = 1; i < arguments.length; i++) {
963
614
  var source = arguments[i];
964
- for (var key in source) {
965
- if (Object.prototype.hasOwnProperty.call(source, key)) {
966
- target[key] = source[key];
967
- }
968
- }
615
+ for (var key in source)
616
+ Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]);
969
617
  }
970
618
  return target;
971
- };
972
- return _extends3.apply(this, arguments);
619
+ }, _extends3.apply(this, arguments);
973
620
  }
974
- __name(_extends3, "_extends");
975
621
  function _objectWithoutPropertiesLoose(source, excluded) {
976
622
  if (source == null) return {};
977
- var target = {};
978
- var sourceKeys = Object.keys(source);
979
- var key, i;
980
- for (i = 0; i < sourceKeys.length; i++) {
981
- key = sourceKeys[i];
982
- if (excluded.indexOf(key) >= 0) continue;
983
- target[key] = source[key];
984
- }
623
+ var target = {}, sourceKeys = Object.keys(source), key, i;
624
+ for (i = 0; i < sourceKeys.length; i++)
625
+ key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
985
626
  return target;
986
627
  }
987
- __name(_objectWithoutPropertiesLoose, "_objectWithoutPropertiesLoose");
988
- var defaultMethod = "get";
989
- var defaultEncType = "application/x-www-form-urlencoded";
628
+ var defaultMethod = "get", defaultEncType = "application/x-www-form-urlencoded";
990
629
  function isHtmlElement(object) {
991
- return object != null && typeof object.tagName === "string";
630
+ return object != null && typeof object.tagName == "string";
992
631
  }
993
- __name(isHtmlElement, "isHtmlElement");
994
632
  function isButtonElement(object) {
995
633
  return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
996
634
  }
997
- __name(isButtonElement, "isButtonElement");
998
635
  function isFormElement(object) {
999
636
  return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
1000
637
  }
1001
- __name(isFormElement, "isFormElement");
1002
638
  function isInputElement(object) {
1003
639
  return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
1004
640
  }
1005
- __name(isInputElement, "isInputElement");
1006
641
  function isModifiedEvent(event) {
1007
642
  return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
1008
643
  }
1009
- __name(isModifiedEvent, "isModifiedEvent");
1010
644
  function shouldProcessLinkClick(event, target) {
1011
645
  return event.button === 0 && // Ignore everything but left clicks
1012
646
  (!target || target === "_self") && // Let browser handle "target=_blank" etc.
1013
647
  !isModifiedEvent(event);
1014
648
  }
1015
- __name(shouldProcessLinkClick, "shouldProcessLinkClick");
1016
649
  var _formDataSupportsSubmitter = null;
1017
650
  function isFormDataSubmitterSupported() {
1018
- if (_formDataSupportsSubmitter === null) {
651
+ if (_formDataSupportsSubmitter === null)
1019
652
  try {
1020
653
  new FormData(
1021
654
  document.createElement("form"),
1022
655
  // @ts-expect-error if FormData supports the submitter parameter, this will throw
1023
656
  0
1024
- );
1025
- _formDataSupportsSubmitter = false;
1026
- } catch (e) {
1027
- _formDataSupportsSubmitter = true;
657
+ ), _formDataSupportsSubmitter = !1;
658
+ } catch {
659
+ _formDataSupportsSubmitter = !0;
1028
660
  }
1029
- }
1030
661
  return _formDataSupportsSubmitter;
1031
662
  }
1032
- __name(isFormDataSubmitterSupported, "isFormDataSubmitterSupported");
1033
663
  var supportedFormEncTypes = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
1034
664
  function getFormEncType(encType) {
1035
- if (encType != null && !supportedFormEncTypes.has(encType)) {
1036
- process.env.NODE_ENV !== "production" ? warning(false, '"' + encType + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + defaultEncType + '"')) : void 0;
1037
- return null;
1038
- }
1039
- return encType;
665
+ return encType != null && !supportedFormEncTypes.has(encType) ? (process.env.NODE_ENV !== "production" && warning(!1, '"' + encType + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + defaultEncType + '"')), null) : encType;
1040
666
  }
1041
- __name(getFormEncType, "getFormEncType");
1042
667
  function getFormSubmissionInfo(target, basename) {
1043
- let method;
1044
- let action;
1045
- let encType;
1046
- let formData;
1047
- let body;
668
+ let method, action, encType, formData, body;
1048
669
  if (isFormElement(target)) {
1049
670
  let attr = target.getAttribute("action");
1050
- action = attr ? stripBasename(attr, basename) : null;
1051
- method = target.getAttribute("method") || defaultMethod;
1052
- encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
1053
- formData = new FormData(target);
671
+ action = attr ? stripBasename(attr, basename) : null, method = target.getAttribute("method") || defaultMethod, encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType, formData = new FormData(target);
1054
672
  } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
1055
673
  let form = target.form;
1056
- if (form == null) {
674
+ if (form == null)
1057
675
  throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
1058
- }
1059
676
  let attr = target.getAttribute("formaction") || form.getAttribute("action");
1060
- action = attr ? stripBasename(attr, basename) : null;
1061
- method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
1062
- encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
1063
- formData = new FormData(form, target);
1064
- if (!isFormDataSubmitterSupported()) {
677
+ if (action = attr ? stripBasename(attr, basename) : null, method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod, encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType, formData = new FormData(form, target), !isFormDataSubmitterSupported()) {
1065
678
  let {
1066
679
  name,
1067
680
  type,
@@ -1069,25 +682,15 @@ function getFormSubmissionInfo(target, basename) {
1069
682
  } = target;
1070
683
  if (type === "image") {
1071
684
  let prefix = name ? name + "." : "";
1072
- formData.append(prefix + "x", "0");
1073
- formData.append(prefix + "y", "0");
1074
- } else if (name) {
1075
- formData.append(name, value);
1076
- }
685
+ formData.append(prefix + "x", "0"), formData.append(prefix + "y", "0");
686
+ } else name && formData.append(name, value);
1077
687
  }
1078
- } else if (isHtmlElement(target)) {
1079
- throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
1080
688
  } else {
1081
- method = defaultMethod;
1082
- action = null;
1083
- encType = defaultEncType;
1084
- body = target;
1085
- }
1086
- if (formData && encType === "text/plain") {
1087
- body = formData;
1088
- formData = void 0;
689
+ if (isHtmlElement(target))
690
+ throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
691
+ method = defaultMethod, action = null, encType = defaultEncType, body = target;
1089
692
  }
1090
- return {
693
+ return formData && encType === "text/plain" && (body = formData, formData = void 0), {
1091
694
  action,
1092
695
  method: method.toLowerCase(),
1093
696
  encType,
@@ -1095,39 +698,28 @@ function getFormSubmissionInfo(target, basename) {
1095
698
  body
1096
699
  };
1097
700
  }
1098
- __name(getFormSubmissionInfo, "getFormSubmissionInfo");
1099
- var _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"];
1100
- var _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];
1101
- var _excluded3 = ["reloadDocument", "replace", "state", "method", "action", "onSubmit", "submit", "relative", "preventScrollReset"];
1102
- var START_TRANSITION2 = "startTransition";
1103
- var startTransitionImpl2 = React2[START_TRANSITION2];
701
+ var _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"], _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"], _excluded3 = ["reloadDocument", "replace", "state", "method", "action", "onSubmit", "submit", "relative", "preventScrollReset"];
702
+ var START_TRANSITION2 = "startTransition", startTransitionImpl2 = React2[START_TRANSITION2];
1104
703
  function BrowserRouter(_ref) {
1105
704
  let {
1106
705
  basename,
1107
706
  children,
1108
707
  future,
1109
708
  window: window2
1110
- } = _ref;
1111
- let historyRef = React2.useRef();
1112
- if (historyRef.current == null) {
1113
- historyRef.current = createBrowserHistory({
1114
- window: window2,
1115
- v5Compat: true
1116
- });
1117
- }
1118
- let history = historyRef.current;
1119
- let [state, setStateImpl] = React2.useState({
709
+ } = _ref, historyRef = React2.useRef();
710
+ historyRef.current == null && (historyRef.current = createBrowserHistory({
711
+ window: window2,
712
+ v5Compat: !0
713
+ }));
714
+ let history = historyRef.current, [state, setStateImpl] = React2.useState({
1120
715
  action: history.action,
1121
716
  location: history.location
1122
- });
1123
- let {
717
+ }), {
1124
718
  v7_startTransition
1125
- } = future || {};
1126
- let setState = React2.useCallback((newState) => {
719
+ } = future || {}, setState = React2.useCallback((newState) => {
1127
720
  v7_startTransition && startTransitionImpl2 ? startTransitionImpl2(() => setStateImpl(newState)) : setStateImpl(newState);
1128
721
  }, [setStateImpl, v7_startTransition]);
1129
- React2.useLayoutEffect(() => history.listen(setState), [history, setState]);
1130
- return React2.createElement(Router, {
722
+ return React2.useLayoutEffect(() => history.listen(setState), [history, setState]), React2.createElement(Router, {
1131
723
  basename,
1132
724
  children,
1133
725
  location: state.location,
@@ -1135,26 +727,21 @@ function BrowserRouter(_ref) {
1135
727
  navigator: history
1136
728
  });
1137
729
  }
1138
- __name(BrowserRouter, "BrowserRouter");
1139
730
  function HistoryRouter(_ref3) {
1140
731
  let {
1141
732
  basename,
1142
733
  children,
1143
734
  future,
1144
735
  history
1145
- } = _ref3;
1146
- let [state, setStateImpl] = React2.useState({
736
+ } = _ref3, [state, setStateImpl] = React2.useState({
1147
737
  action: history.action,
1148
738
  location: history.location
1149
- });
1150
- let {
739
+ }), {
1151
740
  v7_startTransition
1152
- } = future || {};
1153
- let setState = React2.useCallback((newState) => {
741
+ } = future || {}, setState = React2.useCallback((newState) => {
1154
742
  v7_startTransition && startTransitionImpl2 ? startTransitionImpl2(() => setStateImpl(newState)) : setStateImpl(newState);
1155
743
  }, [setStateImpl, v7_startTransition]);
1156
- React2.useLayoutEffect(() => history.listen(setState), [history, setState]);
1157
- return React2.createElement(Router, {
744
+ return React2.useLayoutEffect(() => history.listen(setState), [history, setState]), React2.createElement(Router, {
1158
745
  basename,
1159
746
  children,
1160
747
  location: state.location,
@@ -1162,13 +749,8 @@ function HistoryRouter(_ref3) {
1162
749
  navigator: history
1163
750
  });
1164
751
  }
1165
- __name(HistoryRouter, "HistoryRouter");
1166
- if (process.env.NODE_ENV !== "production") {
1167
- HistoryRouter.displayName = "unstable_HistoryRouter";
1168
- }
1169
- var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
1170
- var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1171
- var Link = React2.forwardRef(/* @__PURE__ */ __name(function LinkWithRef(_ref4, ref) {
752
+ process.env.NODE_ENV !== "production" && (HistoryRouter.displayName = "unstable_HistoryRouter");
753
+ var isBrowser = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Link = React2.forwardRef(function(_ref4, ref) {
1172
754
  let {
1173
755
  onClick,
1174
756
  relative,
@@ -1178,33 +760,19 @@ var Link = React2.forwardRef(/* @__PURE__ */ __name(function LinkWithRef(_ref4,
1178
760
  target,
1179
761
  to,
1180
762
  preventScrollReset
1181
- } = _ref4, rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
1182
- let {
763
+ } = _ref4, rest = _objectWithoutPropertiesLoose(_ref4, _excluded), {
1183
764
  basename
1184
- } = React2.useContext(NavigationContext);
1185
- let absoluteHref;
1186
- let isExternal = false;
1187
- if (typeof to === "string" && ABSOLUTE_URL_REGEX.test(to)) {
1188
- absoluteHref = to;
1189
- if (isBrowser) {
1190
- try {
1191
- let currentUrl = new URL(window.location.href);
1192
- let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
1193
- let path = stripBasename(targetUrl.pathname, basename);
1194
- if (targetUrl.origin === currentUrl.origin && path != null) {
1195
- to = path + targetUrl.search + targetUrl.hash;
1196
- } else {
1197
- isExternal = true;
1198
- }
1199
- } catch (e) {
1200
- process.env.NODE_ENV !== "production" ? warning(false, '<Link to="' + to + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.') : void 0;
1201
- }
765
+ } = React2.useContext(NavigationContext), absoluteHref, isExternal = !1;
766
+ if (typeof to == "string" && ABSOLUTE_URL_REGEX.test(to) && (absoluteHref = to, isBrowser))
767
+ try {
768
+ let currentUrl = new URL(window.location.href), targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to), path = stripBasename(targetUrl.pathname, basename);
769
+ targetUrl.origin === currentUrl.origin && path != null ? to = path + targetUrl.search + targetUrl.hash : isExternal = !0;
770
+ } catch {
771
+ process.env.NODE_ENV !== "production" && warning(!1, '<Link to="' + to + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.');
1202
772
  }
1203
- }
1204
773
  let href = useHref(to, {
1205
774
  relative
1206
- });
1207
- let internalOnClick = useLinkClickHandler(to, {
775
+ }), internalOnClick = useLinkClickHandler(to, {
1208
776
  replace,
1209
777
  state,
1210
778
  target,
@@ -1212,12 +780,8 @@ var Link = React2.forwardRef(/* @__PURE__ */ __name(function LinkWithRef(_ref4,
1212
780
  relative
1213
781
  });
1214
782
  function handleClick(event) {
1215
- if (onClick) onClick(event);
1216
- if (!event.defaultPrevented) {
1217
- internalOnClick(event);
1218
- }
783
+ onClick && onClick(event), event.defaultPrevented || internalOnClick(event);
1219
784
  }
1220
- __name(handleClick, "handleClick");
1221
785
  return (
1222
786
  // eslint-disable-next-line jsx-a11y/anchor-has-content
1223
787
  React2.createElement("a", _extends3({}, rest, {
@@ -1227,49 +791,29 @@ var Link = React2.forwardRef(/* @__PURE__ */ __name(function LinkWithRef(_ref4,
1227
791
  target
1228
792
  }))
1229
793
  );
1230
- }, "LinkWithRef"));
1231
- if (process.env.NODE_ENV !== "production") {
1232
- Link.displayName = "Link";
1233
- }
1234
- var NavLink = React2.forwardRef(/* @__PURE__ */ __name(function NavLinkWithRef(_ref5, ref) {
794
+ });
795
+ process.env.NODE_ENV !== "production" && (Link.displayName = "Link");
796
+ var NavLink = React2.forwardRef(function(_ref5, ref) {
1235
797
  let {
1236
798
  "aria-current": ariaCurrentProp = "page",
1237
- caseSensitive = false,
799
+ caseSensitive = !1,
1238
800
  className: classNameProp = "",
1239
- end = false,
801
+ end = !1,
1240
802
  style: styleProp,
1241
803
  to,
1242
804
  children
1243
- } = _ref5, rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
1244
- let path = useResolvedPath(to, {
805
+ } = _ref5, rest = _objectWithoutPropertiesLoose(_ref5, _excluded2), path = useResolvedPath(to, {
1245
806
  relative: rest.relative
1246
- });
1247
- let location = useLocation();
1248
- let routerState = React2.useContext(DataRouterStateContext);
1249
- let {
807
+ }), location = useLocation(), routerState = React2.useContext(DataRouterStateContext), {
1250
808
  navigator
1251
- } = React2.useContext(NavigationContext);
1252
- let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
1253
- let locationPathname = location.pathname;
1254
- let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
1255
- if (!caseSensitive) {
1256
- locationPathname = locationPathname.toLowerCase();
1257
- nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
1258
- toPathname = toPathname.toLowerCase();
1259
- }
1260
- let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";
1261
- let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
1262
- let ariaCurrent = isActive ? ariaCurrentProp : void 0;
1263
- let className;
1264
- if (typeof classNameProp === "function") {
1265
- className = classNameProp({
1266
- isActive,
1267
- isPending
1268
- });
1269
- } else {
1270
- className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" ");
1271
- }
1272
- let style = typeof styleProp === "function" ? styleProp({
809
+ } = React2.useContext(NavigationContext), toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname, locationPathname = location.pathname, nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
810
+ caseSensitive || (locationPathname = locationPathname.toLowerCase(), nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null, toPathname = toPathname.toLowerCase());
811
+ let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/", isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/"), ariaCurrent = isActive ? ariaCurrentProp : void 0, className;
812
+ typeof classNameProp == "function" ? className = classNameProp({
813
+ isActive,
814
+ isPending
815
+ }) : className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" ");
816
+ let style = typeof styleProp == "function" ? styleProp({
1273
817
  isActive,
1274
818
  isPending
1275
819
  }) : styleProp;
@@ -1279,14 +823,12 @@ var NavLink = React2.forwardRef(/* @__PURE__ */ __name(function NavLinkWithRef(_
1279
823
  ref,
1280
824
  style,
1281
825
  to
1282
- }), typeof children === "function" ? children({
826
+ }), typeof children == "function" ? children({
1283
827
  isActive,
1284
828
  isPending
1285
829
  }) : children);
1286
- }, "NavLinkWithRef"));
1287
- if (process.env.NODE_ENV !== "production") {
1288
- NavLink.displayName = "NavLink";
1289
- }
830
+ });
831
+ process.env.NODE_ENV !== "production" && (NavLink.displayName = "NavLink");
1290
832
  var Form = React2.forwardRef((props, ref) => {
1291
833
  let submit = useSubmit();
1292
834
  return React2.createElement(FormImpl, _extends3({}, props, {
@@ -1294,9 +836,7 @@ var Form = React2.forwardRef((props, ref) => {
1294
836
  ref
1295
837
  }));
1296
838
  });
1297
- if (process.env.NODE_ENV !== "production") {
1298
- Form.displayName = "Form";
1299
- }
839
+ process.env.NODE_ENV !== "production" && (Form.displayName = "Form");
1300
840
  var FormImpl = React2.forwardRef((_ref6, forwardedRef) => {
1301
841
  let {
1302
842
  reloadDocument,
@@ -1308,78 +848,58 @@ var FormImpl = React2.forwardRef((_ref6, forwardedRef) => {
1308
848
  submit,
1309
849
  relative,
1310
850
  preventScrollReset
1311
- } = _ref6, props = _objectWithoutPropertiesLoose(_ref6, _excluded3);
1312
- let formMethod = method.toLowerCase() === "get" ? "get" : "post";
1313
- let formAction = useFormAction(action, {
851
+ } = _ref6, props = _objectWithoutPropertiesLoose(_ref6, _excluded3), formMethod = method.toLowerCase() === "get" ? "get" : "post", formAction = useFormAction(action, {
1314
852
  relative
1315
853
  });
1316
- let submitHandler = /* @__PURE__ */ __name((event) => {
1317
- onSubmit && onSubmit(event);
1318
- if (event.defaultPrevented) return;
1319
- event.preventDefault();
1320
- let submitter = event.nativeEvent.submitter;
1321
- let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
1322
- submit(submitter || event.currentTarget, {
1323
- method: submitMethod,
1324
- replace,
1325
- state,
1326
- relative,
1327
- preventScrollReset
1328
- });
1329
- }, "submitHandler");
1330
854
  return React2.createElement("form", _extends3({
1331
855
  ref: forwardedRef,
1332
856
  method: formMethod,
1333
857
  action: formAction,
1334
- onSubmit: reloadDocument ? onSubmit : submitHandler
858
+ onSubmit: reloadDocument ? onSubmit : (event) => {
859
+ if (onSubmit && onSubmit(event), event.defaultPrevented) return;
860
+ event.preventDefault();
861
+ let submitter = event.nativeEvent.submitter, submitMethod = submitter?.getAttribute("formmethod") || method;
862
+ submit(submitter || event.currentTarget, {
863
+ method: submitMethod,
864
+ replace,
865
+ state,
866
+ relative,
867
+ preventScrollReset
868
+ });
869
+ }
1335
870
  }, props));
1336
871
  });
1337
- if (process.env.NODE_ENV !== "production") {
1338
- FormImpl.displayName = "FormImpl";
1339
- }
872
+ process.env.NODE_ENV !== "production" && (FormImpl.displayName = "FormImpl");
1340
873
  function ScrollRestoration(_ref7) {
1341
874
  let {
1342
875
  getKey,
1343
876
  storageKey
1344
877
  } = _ref7;
1345
- useScrollRestoration({
878
+ return useScrollRestoration({
1346
879
  getKey,
1347
880
  storageKey
1348
- });
1349
- return null;
1350
- }
1351
- __name(ScrollRestoration, "ScrollRestoration");
1352
- if (process.env.NODE_ENV !== "production") {
1353
- ScrollRestoration.displayName = "ScrollRestoration";
881
+ }), null;
1354
882
  }
883
+ process.env.NODE_ENV !== "production" && (ScrollRestoration.displayName = "ScrollRestoration");
1355
884
  var DataRouterHook2;
1356
885
  (function(DataRouterHook3) {
1357
- DataRouterHook3["UseScrollRestoration"] = "useScrollRestoration";
1358
- DataRouterHook3["UseSubmit"] = "useSubmit";
1359
- DataRouterHook3["UseSubmitFetcher"] = "useSubmitFetcher";
1360
- DataRouterHook3["UseFetcher"] = "useFetcher";
886
+ DataRouterHook3.UseScrollRestoration = "useScrollRestoration", DataRouterHook3.UseSubmit = "useSubmit", DataRouterHook3.UseSubmitFetcher = "useSubmitFetcher", DataRouterHook3.UseFetcher = "useFetcher";
1361
887
  })(DataRouterHook2 || (DataRouterHook2 = {}));
1362
888
  var DataRouterStateHook2;
1363
889
  (function(DataRouterStateHook3) {
1364
- DataRouterStateHook3["UseFetchers"] = "useFetchers";
1365
- DataRouterStateHook3["UseScrollRestoration"] = "useScrollRestoration";
890
+ DataRouterStateHook3.UseFetchers = "useFetchers", DataRouterStateHook3.UseScrollRestoration = "useScrollRestoration";
1366
891
  })(DataRouterStateHook2 || (DataRouterStateHook2 = {}));
1367
892
  function getDataRouterConsoleError2(hookName) {
1368
893
  return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
1369
894
  }
1370
- __name(getDataRouterConsoleError2, "getDataRouterConsoleError");
1371
895
  function useDataRouterContext2(hookName) {
1372
896
  let ctx = React2.useContext(DataRouterContext);
1373
- !ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;
1374
- return ctx;
897
+ return ctx || (process.env.NODE_ENV !== "production" ? invariant(!1, getDataRouterConsoleError2(hookName)) : invariant(!1)), ctx;
1375
898
  }
1376
- __name(useDataRouterContext2, "useDataRouterContext");
1377
899
  function useDataRouterState2(hookName) {
1378
900
  let state = React2.useContext(DataRouterStateContext);
1379
- !state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;
1380
- return state;
901
+ return state || (process.env.NODE_ENV !== "production" ? invariant(!1, getDataRouterConsoleError2(hookName)) : invariant(!1)), state;
1381
902
  }
1382
- __name(useDataRouterState2, "useDataRouterState");
1383
903
  function useLinkClickHandler(to, _temp) {
1384
904
  let {
1385
905
  target,
@@ -1387,10 +907,7 @@ function useLinkClickHandler(to, _temp) {
1387
907
  state,
1388
908
  preventScrollReset,
1389
909
  relative
1390
- } = _temp === void 0 ? {} : _temp;
1391
- let navigate = useNavigate();
1392
- let location = useLocation();
1393
- let path = useResolvedPath(to, {
910
+ } = _temp === void 0 ? {} : _temp, navigate = useNavigate(), location = useLocation(), path = useResolvedPath(to, {
1394
911
  relative
1395
912
  });
1396
913
  return React2.useCallback((event) => {
@@ -1406,26 +923,18 @@ function useLinkClickHandler(to, _temp) {
1406
923
  }
1407
924
  }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]);
1408
925
  }
1409
- __name(useLinkClickHandler, "useLinkClickHandler");
1410
926
  function validateClientSideSubmission() {
1411
- if (typeof document === "undefined") {
927
+ if (typeof document > "u")
1412
928
  throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
1413
- }
1414
929
  }
1415
- __name(validateClientSideSubmission, "validateClientSideSubmission");
1416
930
  function useSubmit() {
1417
931
  let {
1418
932
  router
1419
- } = useDataRouterContext2(DataRouterHook2.UseSubmit);
1420
- let {
933
+ } = useDataRouterContext2(DataRouterHook2.UseSubmit), {
1421
934
  basename
1422
- } = React2.useContext(NavigationContext);
1423
- let currentRouteId = useRouteId();
935
+ } = React2.useContext(NavigationContext), currentRouteId = useRouteId();
1424
936
  return React2.useCallback(function(target, options) {
1425
- if (options === void 0) {
1426
- options = {};
1427
- }
1428
- validateClientSideSubmission();
937
+ options === void 0 && (options = {}), validateClientSideSubmission();
1429
938
  let {
1430
939
  action,
1431
940
  method,
@@ -1445,98 +954,61 @@ function useSubmit() {
1445
954
  });
1446
955
  }, [router, basename, currentRouteId]);
1447
956
  }
1448
- __name(useSubmit, "useSubmit");
1449
957
  function useFormAction(action, _temp2) {
1450
958
  let {
1451
959
  relative
1452
- } = _temp2 === void 0 ? {} : _temp2;
1453
- let {
960
+ } = _temp2 === void 0 ? {} : _temp2, {
1454
961
  basename
1455
- } = React2.useContext(NavigationContext);
1456
- let routeContext = React2.useContext(RouteContext);
1457
- !routeContext ? process.env.NODE_ENV !== "production" ? invariant(false, "useFormAction must be used inside a RouteContext") : invariant(false) : void 0;
1458
- let [match] = routeContext.matches.slice(-1);
1459
- let path = _extends3({}, useResolvedPath(action ? action : ".", {
962
+ } = React2.useContext(NavigationContext), routeContext = React2.useContext(RouteContext);
963
+ routeContext || (process.env.NODE_ENV !== "production" ? invariant(!1, "useFormAction must be used inside a RouteContext") : invariant(!1));
964
+ let [match] = routeContext.matches.slice(-1), path = _extends3({}, useResolvedPath(action || ".", {
1460
965
  relative
1461
- }));
1462
- let location = useLocation();
1463
- if (action == null) {
1464
- path.search = location.search;
1465
- if (match.route.index) {
1466
- let params = new URLSearchParams(path.search);
1467
- params.delete("index");
1468
- path.search = params.toString() ? "?" + params.toString() : "";
1469
- }
1470
- }
1471
- if ((!action || action === ".") && match.route.index) {
1472
- path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
1473
- }
1474
- if (basename !== "/") {
1475
- path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
966
+ })), location = useLocation();
967
+ if (action == null && (path.search = location.search, match.route.index)) {
968
+ let params = new URLSearchParams(path.search);
969
+ params.delete("index"), path.search = params.toString() ? "?" + params.toString() : "";
1476
970
  }
1477
- return createPath(path);
971
+ return (!action || action === ".") && match.route.index && (path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"), basename !== "/" && (path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname])), createPath(path);
1478
972
  }
1479
- __name(useFormAction, "useFormAction");
1480
- var SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
1481
- var savedScrollPositions = {};
973
+ var SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions", savedScrollPositions = {};
1482
974
  function useScrollRestoration(_temp3) {
1483
975
  let {
1484
976
  getKey,
1485
977
  storageKey
1486
- } = _temp3 === void 0 ? {} : _temp3;
1487
- let {
978
+ } = _temp3 === void 0 ? {} : _temp3, {
1488
979
  router
1489
- } = useDataRouterContext2(DataRouterHook2.UseScrollRestoration);
1490
- let {
980
+ } = useDataRouterContext2(DataRouterHook2.UseScrollRestoration), {
1491
981
  restoreScrollPosition,
1492
982
  preventScrollReset
1493
- } = useDataRouterState2(DataRouterStateHook2.UseScrollRestoration);
1494
- let {
983
+ } = useDataRouterState2(DataRouterStateHook2.UseScrollRestoration), {
1495
984
  basename
1496
- } = React2.useContext(NavigationContext);
1497
- let location = useLocation();
1498
- let matches = useMatches();
1499
- let navigation = useNavigation();
1500
- React2.useEffect(() => {
1501
- window.history.scrollRestoration = "manual";
1502
- return () => {
1503
- window.history.scrollRestoration = "auto";
1504
- };
1505
- }, []);
1506
- usePageHide(React2.useCallback(() => {
985
+ } = React2.useContext(NavigationContext), location = useLocation(), matches = useMatches(), navigation = useNavigation();
986
+ React2.useEffect(() => (window.history.scrollRestoration = "manual", () => {
987
+ window.history.scrollRestoration = "auto";
988
+ }), []), usePageHide(React2.useCallback(() => {
1507
989
  if (navigation.state === "idle") {
1508
990
  let key = (getKey ? getKey(location, matches) : null) || location.key;
1509
991
  savedScrollPositions[key] = window.scrollY;
1510
992
  }
1511
- sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));
1512
- window.history.scrollRestoration = "auto";
1513
- }, [storageKey, getKey, navigation.state, location, matches]));
1514
- if (typeof document !== "undefined") {
1515
- React2.useLayoutEffect(() => {
1516
- try {
1517
- let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);
1518
- if (sessionPositions) {
1519
- savedScrollPositions = JSON.parse(sessionPositions);
1520
- }
1521
- } catch (e) {
1522
- }
1523
- }, [storageKey]);
1524
- React2.useLayoutEffect(() => {
1525
- let getKeyWithoutBasename = getKey && basename !== "/" ? (location2, matches2) => getKey(
1526
- // Strip the basename to match useLocation()
1527
- _extends3({}, location2, {
1528
- pathname: stripBasename(location2.pathname, basename) || location2.pathname
1529
- }),
1530
- matches2
1531
- ) : getKey;
1532
- let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);
1533
- return () => disableScrollRestoration && disableScrollRestoration();
1534
- }, [router, basename, getKey]);
1535
- React2.useLayoutEffect(() => {
1536
- if (restoreScrollPosition === false) {
1537
- return;
1538
- }
1539
- if (typeof restoreScrollPosition === "number") {
993
+ sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions)), window.history.scrollRestoration = "auto";
994
+ }, [storageKey, getKey, navigation.state, location, matches])), typeof document < "u" && (React2.useLayoutEffect(() => {
995
+ try {
996
+ let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);
997
+ sessionPositions && (savedScrollPositions = JSON.parse(sessionPositions));
998
+ } catch {
999
+ }
1000
+ }, [storageKey]), React2.useLayoutEffect(() => {
1001
+ let getKeyWithoutBasename = getKey && basename !== "/" ? (location2, matches2) => getKey(
1002
+ // Strip the basename to match useLocation()
1003
+ _extends3({}, location2, {
1004
+ pathname: stripBasename(location2.pathname, basename) || location2.pathname
1005
+ }),
1006
+ matches2
1007
+ ) : getKey, disableScrollRestoration = router?.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);
1008
+ return () => disableScrollRestoration && disableScrollRestoration();
1009
+ }, [router, basename, getKey]), React2.useLayoutEffect(() => {
1010
+ if (restoreScrollPosition !== !1) {
1011
+ if (typeof restoreScrollPosition == "number") {
1540
1012
  window.scrollTo(0, restoreScrollPosition);
1541
1013
  return;
1542
1014
  }
@@ -1547,14 +1019,10 @@ function useScrollRestoration(_temp3) {
1547
1019
  return;
1548
1020
  }
1549
1021
  }
1550
- if (preventScrollReset === true) {
1551
- return;
1552
- }
1553
- window.scrollTo(0, 0);
1554
- }, [location, restoreScrollPosition, preventScrollReset]);
1555
- }
1022
+ preventScrollReset !== !0 && window.scrollTo(0, 0);
1023
+ }
1024
+ }, [location, restoreScrollPosition, preventScrollReset]));
1556
1025
  }
1557
- __name(useScrollRestoration, "useScrollRestoration");
1558
1026
  function usePageHide(callback, options) {
1559
1027
  let {
1560
1028
  capture
@@ -1563,44 +1031,31 @@ function usePageHide(callback, options) {
1563
1031
  let opts = capture != null ? {
1564
1032
  capture
1565
1033
  } : void 0;
1566
- window.addEventListener("pagehide", callback, opts);
1567
- return () => {
1034
+ return window.addEventListener("pagehide", callback, opts), () => {
1568
1035
  window.removeEventListener("pagehide", callback, opts);
1569
1036
  };
1570
1037
  }, [callback, capture]);
1571
1038
  }
1572
- __name(usePageHide, "usePageHide");
1573
1039
 
1574
1040
  // src/router/router.tsx
1575
- var { document: document2 } = global;
1576
- var getBase = /* @__PURE__ */ __name(() => `${document2.location.pathname}?`, "getBase");
1577
- var useNavigate2 = /* @__PURE__ */ __name(() => {
1578
- const navigate = useNavigate();
1041
+ var { document: document2 } = global, getBase = () => `${document2.location.pathname}?`, useNavigate2 = () => {
1042
+ let navigate = useNavigate();
1579
1043
  return useCallback3((to, { plain, ...options } = {}) => {
1580
- if (typeof to === "string" && to.startsWith("#")) {
1581
- if (to === "#") {
1582
- navigate(document2.location.search);
1583
- } else {
1584
- document2.location.hash = to;
1585
- }
1586
- return void 0;
1044
+ if (typeof to == "string" && to.startsWith("#")) {
1045
+ to === "#" ? navigate(document2.location.search) : document2.location.hash = to;
1046
+ return;
1587
1047
  }
1588
- if (typeof to === "string") {
1589
- const target = plain ? to : `?path=${to}`;
1048
+ if (typeof to == "string") {
1049
+ let target = plain ? to : `?path=${to}`;
1590
1050
  return navigate(target, options);
1591
1051
  }
1592
- if (typeof to === "number") {
1052
+ if (typeof to == "number")
1593
1053
  return navigate(to);
1594
- }
1595
- return void 0;
1596
1054
  }, []);
1597
- }, "useNavigate");
1598
- var Link2 = /* @__PURE__ */ __name(({ to, children, ...rest }) => React3.createElement(Link, { to: `${getBase()}path=${to}`, ...rest }, children), "Link");
1055
+ }, Link2 = ({ to, children, ...rest }) => React3.createElement(Link, { to: `${getBase()}path=${to}`, ...rest }, children);
1599
1056
  Link2.displayName = "QueryLink";
1600
- var Location = /* @__PURE__ */ __name(({ children }) => {
1601
- const location = useLocation();
1602
- const { path, singleStory } = queryFromLocation(location);
1603
- const { viewMode, storyId, refId } = parsePath(path);
1057
+ var Location = ({ children }) => {
1058
+ let location = useLocation(), { path, singleStory } = queryFromLocation(location), { viewMode, storyId, refId } = parsePath(path);
1604
1059
  return React3.createElement(React3.Fragment, null, children({
1605
1060
  path: path || "/",
1606
1061
  location,
@@ -1609,32 +1064,25 @@ var Location = /* @__PURE__ */ __name(({ children }) => {
1609
1064
  refId,
1610
1065
  singleStory: singleStory === "true"
1611
1066
  }));
1612
- }, "Location");
1067
+ };
1613
1068
  Location.displayName = "QueryLocation";
1614
1069
  function Match({
1615
1070
  children,
1616
1071
  path: targetPath,
1617
- startsWith = false
1072
+ startsWith = !1
1618
1073
  }) {
1619
1074
  return React3.createElement(Location, null, ({ path: urlPath, ...rest }) => children({
1620
1075
  match: getMatch(urlPath, targetPath, startsWith),
1621
1076
  ...rest
1622
1077
  }));
1623
1078
  }
1624
- __name(Match, "Match");
1625
1079
  Match.displayName = "QueryMatch";
1626
1080
  function Route2(input) {
1627
- const { children, ...rest } = input;
1628
- if (rest.startsWith === void 0) {
1629
- rest.startsWith = false;
1630
- }
1631
- const matchProps = rest;
1632
- return React3.createElement(Match, { ...matchProps }, ({ match }) => match ? children : null);
1081
+ let { children, ...rest } = input;
1082
+ return rest.startsWith === void 0 && (rest.startsWith = !1), React3.createElement(Match, { ...rest }, ({ match }) => match ? children : null);
1633
1083
  }
1634
- __name(Route2, "Route");
1635
1084
  Route2.displayName = "Route";
1636
- var LocationProvider = /* @__PURE__ */ __name((...args) => BrowserRouter(...args), "LocationProvider");
1637
- var BaseLocationProvider = /* @__PURE__ */ __name((...args) => Router(...args), "BaseLocationProvider");
1085
+ var LocationProvider = (...args) => BrowserRouter(...args), BaseLocationProvider = (...args) => Router(...args);
1638
1086
  export {
1639
1087
  BaseLocationProvider,
1640
1088
  DEEPLY_EQUAL,