@mcp-use/inspector 20.0.0-beta.5 → 20.0.0-beta.50

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 (580) hide show
  1. package/README.md +31 -78
  2. package/dist/app/inspector.css.gz +0 -0
  3. package/dist/app/inspector.js.gz +0 -0
  4. package/dist/app/providers/anthropic.png +0 -0
  5. package/dist/app/providers/google.png +0 -0
  6. package/dist/app/providers/openai.png +0 -0
  7. package/dist/cli.js +332 -1384
  8. package/dist/client/index.d.ts +1405 -50
  9. package/dist/client/index.js +165 -24019
  10. package/dist/server/index.d.ts +79 -7
  11. package/dist/server/index.js +370 -22
  12. package/package.json +77 -35
  13. package/dist/cdn/AnimatePresence-Dcw-FOy8.js +0 -393
  14. package/dist/cdn/ChatTab-B255lH5i.js +0 -6744
  15. package/dist/cdn/CheckboxIndicator-Bt4IICtv.js +0 -251
  16. package/dist/cdn/ConnectionSettingsForm-DF-NS58d.js +0 -929
  17. package/dist/cdn/ConnectionSettingsTab-dI-Cqe79.js +0 -150
  18. package/dist/cdn/ElicitationTab-CL1KJ0bz.js +0 -654
  19. package/dist/cdn/FormContext-tmgN_Vdr.js +0 -135
  20. package/dist/cdn/InspectorContext-UjtEbNod.js +0 -123
  21. package/dist/cdn/JSONDisplay-BFxf5oEu.js +0 -324
  22. package/dist/cdn/ListTabHeader-Cv-GmtGF.js +0 -88
  23. package/dist/cdn/ManufactOAuthCallback-B98kSYCj.js +0 -31
  24. package/dist/cdn/MarkdownRenderer-Ba7nA4Ie.js +0 -3610
  25. package/dist/cdn/NotificationsTab-CeImSrhx.js +0 -290
  26. package/dist/cdn/OAuthCallback-Blc2Asxc.js +0 -58
  27. package/dist/cdn/PromptsTab-BYKnY7Rp.js +0 -901
  28. package/dist/cdn/ResourcesTab-BGualKW-.js +0 -564
  29. package/dist/cdn/SamplingTab-BeZBUeni.js +0 -658
  30. package/dist/cdn/ServerMetadataTab-CvrKX8fz.js +0 -244
  31. package/dist/cdn/StatusIcon-D0-ARyOh.js +0 -66
  32. package/dist/cdn/ToolsTab-j6n4O_3s.js +0 -2033
  33. package/dist/cdn/ViewPreview-DihyG6Qd.js +0 -238
  34. package/dist/cdn/WidgetDebugContext-D4usL_MA.js +0 -324
  35. package/dist/cdn/WidgetWrapper-B4H3Fek7.js +0 -2210
  36. package/dist/cdn/basePath-B8HuhIMu.js +0 -25
  37. package/dist/cdn/bell-CGjAO_0s.js +0 -10
  38. package/dist/cdn/browser-CbQIH4w2.js +0 -42
  39. package/dist/cdn/brush-B_mKhyxG.js +0 -17
  40. package/dist/cdn/card-DgiYnSg-.js +0 -41
  41. package/dist/cdn/cfWorker-Bxcs9rNe.js +0 -10799
  42. package/dist/cdn/checkbox-By0FklhG.js +0 -20
  43. package/dist/cdn/chunk-QUQL4437-XnDcYQEx.js +0 -1508
  44. package/dist/cdn/clock-CmUbSx_B.js +0 -12
  45. package/dist/cdn/code-V_0nf5rg.js +0 -10
  46. package/dist/cdn/createLucideIcon-C5fZZ6oB.js +0 -38
  47. package/dist/cdn/dialog-BsDpuJd3.js +0 -1028
  48. package/dist/cdn/dist-DaMB0Su9.js +0 -616
  49. package/dist/cdn/dist-DbX5yidW.js +0 -2306
  50. package/dist/cdn/external-link-CjmfT6rW.js +0 -17
  51. package/dist/cdn/eye-B7H96av8.js +0 -29
  52. package/dist/cdn/folder-open-B3lu2rG_.js +0 -7
  53. package/dist/cdn/hash-BVQnWi7q.js +0 -33
  54. package/dist/cdn/history-Csw4rb44.js +0 -17
  55. package/dist/cdn/index-browser-DkQOzkvX.js +0 -1934
  56. package/dist/cdn/info-CNiOwqkf.js +0 -19
  57. package/dist/cdn/input-C2OBd4PJ.js +0 -12160
  58. package/dist/cdn/inspector-settings-layout-0VDsjeqb.js +0 -4
  59. package/dist/cdn/inspector.css +0 -2
  60. package/dist/cdn/inspector.js +0 -24523
  61. package/dist/cdn/jsx-runtime-CIxvMpEo.js +0 -180
  62. package/dist/cdn/label-B9Jmm9be.js +0 -60
  63. package/dist/cdn/loader-circle-BLy9A_pp.js +0 -7
  64. package/dist/cdn/manufact-auth-BQMHhbLV.js +0 -423
  65. package/dist/cdn/maximize-2-CH5Lq90B.js +0 -21
  66. package/dist/cdn/maximize-BALCV_ep.js +0 -21
  67. package/dist/cdn/message-square-BnxdpJxZ.js +0 -7
  68. package/dist/cdn/not-found-DEtSM_Wd.js +0 -34
  69. package/dist/cdn/play-vuZ5PLnI.js +0 -7
  70. package/dist/cdn/providerMeta-BQIfHuNL.js +0 -379
  71. package/dist/cdn/providers/anthropic.png +0 -0
  72. package/dist/cdn/providers/google.png +0 -0
  73. package/dist/cdn/providers/openai.png +0 -0
  74. package/dist/cdn/react-BIs9pQ3H.js +0 -926
  75. package/dist/cdn/react-BajV-X4P.js +0 -5425
  76. package/dist/cdn/refresh-cw-BXY-Pa0U.js +0 -21
  77. package/dist/cdn/save-Tgil_AJZ.js +0 -34
  78. package/dist/cdn/schemaHelpers-DTV38jGq.js +0 -16
  79. package/dist/cdn/select-DDdiIPR2.js +0 -2594
  80. package/dist/cdn/servers-Dm72iTpY.js +0 -26
  81. package/dist/cdn/shared-DaILIQPP.js +0 -1700
  82. package/dist/cdn/sheet-Br_l2kry.js +0 -2077
  83. package/dist/cdn/sparkles-BntO2rDR.js +0 -23
  84. package/dist/cdn/spinner-jQtC7EBj.js +0 -15
  85. package/dist/cdn/square-check-big-BvwQ17Bl.js +0 -10
  86. package/dist/cdn/switch-C3IyQuid.js +0 -664
  87. package/dist/cdn/tabs-subtle-CkdI6Mac.js +0 -787
  88. package/dist/cdn/telemetry-DabTAQ8x.js +0 -240
  89. package/dist/cdn/textarea-DSbwcFVt.js +0 -14
  90. package/dist/cdn/trash-2-RwpJY5SL.js +0 -25
  91. package/dist/cdn/useAriaLabelledBy-DqAdnppm.js +0 -29
  92. package/dist/cdn/useCompositeItem-BRqEzYh-.js +0 -26
  93. package/dist/cdn/useConfig-Btmh8wjJ.js +0 -235
  94. package/dist/cdn/useSavedRequests-Ci2I919u.js +0 -51
  95. package/dist/cdn/useViewHostProps-B6SKeeH9.js +0 -349
  96. package/dist/cdn/wrench-DzGmCfnb.js +0 -7
  97. package/dist/cdn/x-C3vRQIYu.js +0 -10
  98. package/dist/cdn/zap-Mb-pbw2X.js +0 -10
  99. package/dist/client/auth/manufact-auth.d.ts +0 -32
  100. package/dist/client/auth/manufact-auth.d.ts.map +0 -1
  101. package/dist/client/chat-history/ChatHistoryHeader.d.ts +0 -4
  102. package/dist/client/chat-history/ChatHistoryHeader.d.ts.map +0 -1
  103. package/dist/client/chat-history/ChatHistoryPanel.d.ts +0 -28
  104. package/dist/client/chat-history/ChatHistoryPanel.d.ts.map +0 -1
  105. package/dist/client/chat-history/ChatHistoryRail.d.ts +0 -5
  106. package/dist/client/chat-history/ChatHistoryRail.d.ts.map +0 -1
  107. package/dist/client/chat-history/ChatList.d.ts +0 -18
  108. package/dist/client/chat-history/ChatList.d.ts.map +0 -1
  109. package/dist/client/chat-history/ChatTitleReveal.d.ts +0 -10
  110. package/dist/client/chat-history/ChatTitleReveal.d.ts.map +0 -1
  111. package/dist/client/chat-history/chat-events-to-inspector-messages.d.ts +0 -13
  112. package/dist/client/chat-history/chat-events-to-inspector-messages.d.ts.map +0 -1
  113. package/dist/client/chat-history/chat-title.d.ts +0 -10
  114. package/dist/client/chat-history/chat-title.d.ts.map +0 -1
  115. package/dist/client/chat-history/providers/local-storage.d.ts +0 -21
  116. package/dist/client/chat-history/providers/local-storage.d.ts.map +0 -1
  117. package/dist/client/chat-history/types.d.ts +0 -39
  118. package/dist/client/chat-history/types.d.ts.map +0 -1
  119. package/dist/client/chat-history/useChatHistory.d.ts +0 -20
  120. package/dist/client/chat-history/useChatHistory.d.ts.map +0 -1
  121. package/dist/client/chat-history/useChatTitleGeneration.d.ts +0 -17
  122. package/dist/client/chat-history/useChatTitleGeneration.d.ts.map +0 -1
  123. package/dist/client/components/AddToClientDropdown.d.ts +0 -52
  124. package/dist/client/components/AddToClientDropdown.d.ts.map +0 -1
  125. package/dist/client/components/ChatTab.d.ts +0 -98
  126. package/dist/client/components/ChatTab.d.ts.map +0 -1
  127. package/dist/client/components/IframeConsole.d.ts +0 -7
  128. package/dist/client/components/IframeConsole.d.ts.map +0 -1
  129. package/dist/client/components/MCPAppsDebugControls.d.ts +0 -19
  130. package/dist/client/components/MCPAppsDebugControls.d.ts.map +0 -1
  131. package/dist/client/components/PromptsTab.d.ts +0 -34
  132. package/dist/client/components/PromptsTab.d.ts.map +0 -1
  133. package/dist/client/components/ResourcesTab.d.ts +0 -31
  134. package/dist/client/components/ResourcesTab.d.ts.map +0 -1
  135. package/dist/client/components/ToolsTab.d.ts +0 -39
  136. package/dist/client/components/ToolsTab.d.ts.map +0 -1
  137. package/dist/client/components/chat/AssistantMessage.d.ts +0 -10
  138. package/dist/client/components/chat/AssistantMessage.d.ts.map +0 -1
  139. package/dist/client/components/chat/ChatHeader.d.ts +0 -70
  140. package/dist/client/components/chat/ChatHeader.d.ts.map +0 -1
  141. package/dist/client/components/chat/ChatInput.d.ts +0 -29
  142. package/dist/client/components/chat/ChatInput.d.ts.map +0 -1
  143. package/dist/client/components/chat/ChatInputArea.d.ts +0 -65
  144. package/dist/client/components/chat/ChatInputArea.d.ts.map +0 -1
  145. package/dist/client/components/chat/ChatLandingForm.d.ts +0 -15
  146. package/dist/client/components/chat/ChatLandingForm.d.ts.map +0 -1
  147. package/dist/client/components/chat/ChatManagedNotice.d.ts +0 -10
  148. package/dist/client/components/chat/ChatManagedNotice.d.ts.map +0 -1
  149. package/dist/client/components/chat/ChatScrollToBottomButton.d.ts +0 -7
  150. package/dist/client/components/chat/ChatScrollToBottomButton.d.ts.map +0 -1
  151. package/dist/client/components/chat/ChatScrollTopFade.d.ts +0 -7
  152. package/dist/client/components/chat/ChatScrollTopFade.d.ts.map +0 -1
  153. package/dist/client/components/chat/ChatTraceView.d.ts +0 -7
  154. package/dist/client/components/chat/ChatTraceView.d.ts.map +0 -1
  155. package/dist/client/components/chat/ConfigurationDialog.d.ts +0 -42
  156. package/dist/client/components/chat/ConfigurationDialog.d.ts.map +0 -1
  157. package/dist/client/components/chat/ConfigureEmptyState.d.ts +0 -6
  158. package/dist/client/components/chat/ConfigureEmptyState.d.ts.map +0 -1
  159. package/dist/client/components/chat/CopyButton.d.ts +0 -10
  160. package/dist/client/components/chat/CopyButton.d.ts.map +0 -1
  161. package/dist/client/components/chat/FloatingChatElicitation.d.ts +0 -10
  162. package/dist/client/components/chat/FloatingChatElicitation.d.ts.map +0 -1
  163. package/dist/client/components/chat/McpReconnectBanner.d.ts +0 -10
  164. package/dist/client/components/chat/McpReconnectBanner.d.ts.map +0 -1
  165. package/dist/client/components/chat/MessageList.d.ts +0 -47
  166. package/dist/client/components/chat/MessageList.d.ts.map +0 -1
  167. package/dist/client/components/chat/MessageMetaActions.d.ts +0 -7
  168. package/dist/client/components/chat/MessageMetaActions.d.ts.map +0 -1
  169. package/dist/client/components/chat/PromptResultsList.d.ts +0 -8
  170. package/dist/client/components/chat/PromptResultsList.d.ts.map +0 -1
  171. package/dist/client/components/chat/PromptsDropdown.d.ts +0 -11
  172. package/dist/client/components/chat/PromptsDropdown.d.ts.map +0 -1
  173. package/dist/client/components/chat/StreamingAssistantContent.d.ts +0 -7
  174. package/dist/client/components/chat/StreamingAssistantContent.d.ts.map +0 -1
  175. package/dist/client/components/chat/SystemPromptButton.d.ts +0 -11
  176. package/dist/client/components/chat/SystemPromptButton.d.ts.map +0 -1
  177. package/dist/client/components/chat/ToolCallDisplay.d.ts +0 -10
  178. package/dist/client/components/chat/ToolCallDisplay.d.ts.map +0 -1
  179. package/dist/client/components/chat/ToolResultRenderer.d.ts +0 -15
  180. package/dist/client/components/chat/ToolResultRenderer.d.ts.map +0 -1
  181. package/dist/client/components/chat/ToolSelector.d.ts +0 -13
  182. package/dist/client/components/chat/ToolSelector.d.ts.map +0 -1
  183. package/dist/client/components/chat/UserMessage.d.ts +0 -10
  184. package/dist/client/components/chat/UserMessage.d.ts.map +0 -1
  185. package/dist/client/components/chat/chat-bar-styles.d.ts +0 -6
  186. package/dist/client/components/chat/chat-bar-styles.d.ts.map +0 -1
  187. package/dist/client/components/chat/chatModeStorage.d.ts +0 -11
  188. package/dist/client/components/chat/chatModeStorage.d.ts.map +0 -1
  189. package/dist/client/components/chat/conversion.d.ts +0 -19
  190. package/dist/client/components/chat/conversion.d.ts.map +0 -1
  191. package/dist/client/components/chat/freeTier.d.ts +0 -32
  192. package/dist/client/components/chat/freeTier.d.ts.map +0 -1
  193. package/dist/client/components/chat/managedChatNotice.d.ts +0 -16
  194. package/dist/client/components/chat/managedChatNotice.d.ts.map +0 -1
  195. package/dist/client/components/chat/providerMeta.d.ts +0 -27
  196. package/dist/client/components/chat/providerMeta.d.ts.map +0 -1
  197. package/dist/client/components/chat/system-prompt/local-storage.d.ts +0 -5
  198. package/dist/client/components/chat/system-prompt/local-storage.d.ts.map +0 -1
  199. package/dist/client/components/chat/system-prompt/types.d.ts +0 -8
  200. package/dist/client/components/chat/system-prompt/types.d.ts.map +0 -1
  201. package/dist/client/components/chat/system-prompt/useLocalSystemPrompt.d.ts +0 -3
  202. package/dist/client/components/chat/system-prompt/useLocalSystemPrompt.d.ts.map +0 -1
  203. package/dist/client/components/chat/system-prompt-default.d.ts +0 -2
  204. package/dist/client/components/chat/system-prompt-default.d.ts.map +0 -1
  205. package/dist/client/components/chat/trace.d.ts +0 -84
  206. package/dist/client/components/chat/trace.d.ts.map +0 -1
  207. package/dist/client/components/chat/types.d.ts +0 -75
  208. package/dist/client/components/chat/types.d.ts.map +0 -1
  209. package/dist/client/components/chat/useChatMessages.d.ts +0 -76
  210. package/dist/client/components/chat/useChatMessages.d.ts.map +0 -1
  211. package/dist/client/components/chat/useChatMessagesClientSide.d.ts +0 -43
  212. package/dist/client/components/chat/useChatMessagesClientSide.d.ts.map +0 -1
  213. package/dist/client/components/chat/useChatScrollToBottom.d.ts +0 -14
  214. package/dist/client/components/chat/useChatScrollToBottom.d.ts.map +0 -1
  215. package/dist/client/components/chat/useConfig.d.ts +0 -24
  216. package/dist/client/components/chat/useConfig.d.ts.map +0 -1
  217. package/dist/client/components/chat/useHostedChatMode.d.ts +0 -14
  218. package/dist/client/components/chat/useHostedChatMode.d.ts.map +0 -1
  219. package/dist/client/components/chat/useManagedCloudModel.d.ts +0 -14
  220. package/dist/client/components/chat/useManagedCloudModel.d.ts.map +0 -1
  221. package/dist/client/components/chat/utils.d.ts +0 -11
  222. package/dist/client/components/chat/utils.d.ts.map +0 -1
  223. package/dist/client/components/elicitation/shared/ElicitationAskUserPanel.d.ts +0 -12
  224. package/dist/client/components/elicitation/shared/ElicitationAskUserPanel.d.ts.map +0 -1
  225. package/dist/client/components/elicitation/shared/elicitationToAskUserQuestions.d.ts +0 -9
  226. package/dist/client/components/elicitation/shared/elicitationToAskUserQuestions.d.ts.map +0 -1
  227. package/dist/client/components/elicitation/shared/schemaHelpers.d.ts +0 -8
  228. package/dist/client/components/elicitation/shared/schemaHelpers.d.ts.map +0 -1
  229. package/dist/client/components/prompts/PromptExecutionPanel.d.ts +0 -13
  230. package/dist/client/components/prompts/PromptExecutionPanel.d.ts.map +0 -1
  231. package/dist/client/components/prompts/PromptInputForm.d.ts +0 -9
  232. package/dist/client/components/prompts/PromptInputForm.d.ts.map +0 -1
  233. package/dist/client/components/prompts/PromptMessageCard.d.ts +0 -29
  234. package/dist/client/components/prompts/PromptMessageCard.d.ts.map +0 -1
  235. package/dist/client/components/prompts/PromptResultDisplay.d.ts +0 -34
  236. package/dist/client/components/prompts/PromptResultDisplay.d.ts.map +0 -1
  237. package/dist/client/components/prompts/PromptsList.d.ts +0 -10
  238. package/dist/client/components/prompts/PromptsList.d.ts.map +0 -1
  239. package/dist/client/components/prompts/SavedPromptsList.d.ts +0 -19
  240. package/dist/client/components/prompts/SavedPromptsList.d.ts.map +0 -1
  241. package/dist/client/components/resources/PropsConfigDialog.d.ts +0 -16
  242. package/dist/client/components/resources/PropsConfigDialog.d.ts.map +0 -1
  243. package/dist/client/components/resources/ResourceResultDisplay.d.ts +0 -30
  244. package/dist/client/components/resources/ResourceResultDisplay.d.ts.map +0 -1
  245. package/dist/client/components/resources/ResourcesList.d.ts +0 -10
  246. package/dist/client/components/resources/ResourcesList.d.ts.map +0 -1
  247. package/dist/client/components/shared/CollapsibleJSON.d.ts +0 -6
  248. package/dist/client/components/shared/CollapsibleJSON.d.ts.map +0 -1
  249. package/dist/client/components/shared/InspectorScrollArea.d.ts +0 -9
  250. package/dist/client/components/shared/InspectorScrollArea.d.ts.map +0 -1
  251. package/dist/client/components/shared/JSONDisplay.d.ts +0 -12
  252. package/dist/client/components/shared/JSONDisplay.d.ts.map +0 -1
  253. package/dist/client/components/shared/ListItem.d.ts +0 -24
  254. package/dist/client/components/shared/ListItem.d.ts.map +0 -1
  255. package/dist/client/components/shared/ListTabHeader.d.ts +0 -47
  256. package/dist/client/components/shared/ListTabHeader.d.ts.map +0 -1
  257. package/dist/client/components/shared/MarkdownRenderer.d.ts +0 -15
  258. package/dist/client/components/shared/MarkdownRenderer.d.ts.map +0 -1
  259. package/dist/client/components/shared/SchemaFormField.d.ts +0 -12
  260. package/dist/client/components/shared/SchemaFormField.d.ts.map +0 -1
  261. package/dist/client/components/shared/SearchTabHeader.d.ts +0 -28
  262. package/dist/client/components/shared/SearchTabHeader.d.ts.map +0 -1
  263. package/dist/client/components/shared/StatusIcon.d.ts +0 -12
  264. package/dist/client/components/shared/StatusIcon.d.ts.map +0 -1
  265. package/dist/client/components/shared/index.d.ts +0 -7
  266. package/dist/client/components/shared/index.d.ts.map +0 -1
  267. package/dist/client/components/tools/SaveRequestDialog.d.ts +0 -11
  268. package/dist/client/components/tools/SaveRequestDialog.d.ts.map +0 -1
  269. package/dist/client/components/tools/SavedRequestsList.d.ts +0 -19
  270. package/dist/client/components/tools/SavedRequestsList.d.ts.map +0 -1
  271. package/dist/client/components/tools/ToolExecutionPanel.d.ts +0 -20
  272. package/dist/client/components/tools/ToolExecutionPanel.d.ts.map +0 -1
  273. package/dist/client/components/tools/ToolInputForm.d.ts +0 -14
  274. package/dist/client/components/tools/ToolInputForm.d.ts.map +0 -1
  275. package/dist/client/components/tools/ToolResultDisplay.d.ts +0 -24
  276. package/dist/client/components/tools/ToolResultDisplay.d.ts.map +0 -1
  277. package/dist/client/components/tools/ToolsList.d.ts +0 -10
  278. package/dist/client/components/tools/ToolsList.d.ts.map +0 -1
  279. package/dist/client/components/tools/schema-utils.d.ts +0 -13
  280. package/dist/client/components/tools/schema-utils.d.ts.map +0 -1
  281. package/dist/client/components/tools/useToolExecution.d.ts +0 -26
  282. package/dist/client/components/tools/useToolExecution.d.ts.map +0 -1
  283. package/dist/client/components/tools/useToolsTabNavigation.d.ts +0 -35
  284. package/dist/client/components/tools/useToolsTabNavigation.d.ts.map +0 -1
  285. package/dist/client/components/ui/MeshGradientCanvas.d.ts +0 -13
  286. package/dist/client/components/ui/MeshGradientCanvas.d.ts.map +0 -1
  287. package/dist/client/components/ui/WidgetWrapper.d.ts +0 -12
  288. package/dist/client/components/ui/WidgetWrapper.d.ts.map +0 -1
  289. package/dist/client/components/ui/alert-dialog.d.ts +0 -15
  290. package/dist/client/components/ui/alert-dialog.d.ts.map +0 -1
  291. package/dist/client/components/ui/ask-user-questions.d.ts +0 -80
  292. package/dist/client/components/ui/ask-user-questions.d.ts.map +0 -1
  293. package/dist/client/components/ui/badge.d.ts +0 -34
  294. package/dist/client/components/ui/badge.d.ts.map +0 -1
  295. package/dist/client/components/ui/blur-fade.d.ts +0 -25
  296. package/dist/client/components/ui/blur-fade.d.ts.map +0 -1
  297. package/dist/client/components/ui/button.d.ts +0 -34
  298. package/dist/client/components/ui/button.d.ts.map +0 -1
  299. package/dist/client/components/ui/chat-message.d.ts +0 -23
  300. package/dist/client/components/ui/chat-message.d.ts.map +0 -1
  301. package/dist/client/components/ui/checkbox.d.ts +0 -4
  302. package/dist/client/components/ui/checkbox.d.ts.map +0 -1
  303. package/dist/client/components/ui/client-icons.d.ts +0 -20
  304. package/dist/client/components/ui/client-icons.d.ts.map +0 -1
  305. package/dist/client/components/ui/command.d.ts +0 -17
  306. package/dist/client/components/ui/command.d.ts.map +0 -1
  307. package/dist/client/components/ui/dialog.d.ts +0 -37
  308. package/dist/client/components/ui/dialog.d.ts.map +0 -1
  309. package/dist/client/components/ui/dropdown-menu.d.ts +0 -25
  310. package/dist/client/components/ui/dropdown-menu.d.ts.map +0 -1
  311. package/dist/client/components/ui/dropdown.d.ts +0 -30
  312. package/dist/client/components/ui/dropdown.d.ts.map +0 -1
  313. package/dist/client/components/ui/file-thumbnail.d.ts +0 -9
  314. package/dist/client/components/ui/file-thumbnail.d.ts.map +0 -1
  315. package/dist/client/components/ui/input.d.ts +0 -4
  316. package/dist/client/components/ui/input.d.ts.map +0 -1
  317. package/dist/client/components/ui/kbd.d.ts +0 -3
  318. package/dist/client/components/ui/kbd.d.ts.map +0 -1
  319. package/dist/client/components/ui/label.d.ts +0 -4
  320. package/dist/client/components/ui/label.d.ts.map +0 -1
  321. package/dist/client/components/ui/menu-item.d.ts +0 -52
  322. package/dist/client/components/ui/menu-item.d.ts.map +0 -1
  323. package/dist/client/components/ui/mesh-tab-background.d.ts +0 -12
  324. package/dist/client/components/ui/mesh-tab-background.d.ts.map +0 -1
  325. package/dist/client/components/ui/not-found.d.ts +0 -9
  326. package/dist/client/components/ui/not-found.d.ts.map +0 -1
  327. package/dist/client/components/ui/popover.d.ts +0 -6
  328. package/dist/client/components/ui/popover.d.ts.map +0 -1
  329. package/dist/client/components/ui/resizable.d.ts +0 -10
  330. package/dist/client/components/ui/resizable.d.ts.map +0 -1
  331. package/dist/client/components/ui/scroll-area.d.ts +0 -4
  332. package/dist/client/components/ui/scroll-area.d.ts.map +0 -1
  333. package/dist/client/components/ui/select.d.ts +0 -52
  334. package/dist/client/components/ui/select.d.ts.map +0 -1
  335. package/dist/client/components/ui/sheet.d.ts +0 -14
  336. package/dist/client/components/ui/sheet.d.ts.map +0 -1
  337. package/dist/client/components/ui/skeleton.d.ts +0 -4
  338. package/dist/client/components/ui/skeleton.d.ts.map +0 -1
  339. package/dist/client/components/ui/spinner.d.ts +0 -3
  340. package/dist/client/components/ui/spinner.d.ts.map +0 -1
  341. package/dist/client/components/ui/switch.d.ts +0 -22
  342. package/dist/client/components/ui/switch.d.ts.map +0 -1
  343. package/dist/client/components/ui/table.d.ts +0 -9
  344. package/dist/client/components/ui/table.d.ts.map +0 -1
  345. package/dist/client/components/ui/tabs-subtle.d.ts +0 -25
  346. package/dist/client/components/ui/tabs-subtle.d.ts.map +0 -1
  347. package/dist/client/components/ui/text-shimmer.d.ts +0 -11
  348. package/dist/client/components/ui/text-shimmer.d.ts.map +0 -1
  349. package/dist/client/components/ui/textarea.d.ts +0 -4
  350. package/dist/client/components/ui/textarea.d.ts.map +0 -1
  351. package/dist/client/components/ui/tooltip.d.ts +0 -43
  352. package/dist/client/components/ui/tooltip.d.ts.map +0 -1
  353. package/dist/client/components/ui-playground/shared/SafeAreaInsetsEditor.d.ts +0 -19
  354. package/dist/client/components/ui-playground/shared/SafeAreaInsetsEditor.d.ts.map +0 -1
  355. package/dist/client/console-log-bus.d.ts +0 -24
  356. package/dist/client/console-log-bus.d.ts.map +0 -1
  357. package/dist/client/constants/debug-options.d.ts +0 -16
  358. package/dist/client/constants/debug-options.d.ts.map +0 -1
  359. package/dist/client/context/InspectorContext.d.ts +0 -134
  360. package/dist/client/context/InspectorContext.d.ts.map +0 -1
  361. package/dist/client/context/ThemeContext.d.ts +0 -17
  362. package/dist/client/context/ThemeContext.d.ts.map +0 -1
  363. package/dist/client/context/WidgetDebugContext.d.ts +0 -121
  364. package/dist/client/context/WidgetDebugContext.d.ts.map +0 -1
  365. package/dist/client/hooks/use-merge-split.d.ts +0 -36
  366. package/dist/client/hooks/use-merge-split.d.ts.map +0 -1
  367. package/dist/client/hooks/use-proximity-hover-index.d.ts +0 -27
  368. package/dist/client/hooks/use-proximity-hover-index.d.ts.map +0 -1
  369. package/dist/client/hooks/use-proximity-hover.d.ts +0 -26
  370. package/dist/client/hooks/use-proximity-hover.d.ts.map +0 -1
  371. package/dist/client/hooks/use-touch-primary.d.ts +0 -2
  372. package/dist/client/hooks/use-touch-primary.d.ts.map +0 -1
  373. package/dist/client/hooks/useDeviceViewport.d.ts +0 -18
  374. package/dist/client/hooks/useDeviceViewport.d.ts.map +0 -1
  375. package/dist/client/hooks/useHostedSession.d.ts +0 -9
  376. package/dist/client/hooks/useHostedSession.d.ts.map +0 -1
  377. package/dist/client/hooks/useIframeConsole.d.ts +0 -24
  378. package/dist/client/hooks/useIframeConsole.d.ts.map +0 -1
  379. package/dist/client/hooks/useKeyboardShortcuts.d.ts +0 -28
  380. package/dist/client/hooks/useKeyboardShortcuts.d.ts.map +0 -1
  381. package/dist/client/hooks/useMCPPrompts.d.ts +0 -94
  382. package/dist/client/hooks/useMCPPrompts.d.ts.map +0 -1
  383. package/dist/client/hooks/useMcpAppsHostContext.d.ts +0 -27
  384. package/dist/client/hooks/useMcpAppsHostContext.d.ts.map +0 -1
  385. package/dist/client/hooks/usePropsLLM.d.ts +0 -20
  386. package/dist/client/hooks/usePropsLLM.d.ts.map +0 -1
  387. package/dist/client/hooks/useResourceProps.d.ts +0 -14
  388. package/dist/client/hooks/useResourceProps.d.ts.map +0 -1
  389. package/dist/client/hooks/useSavedRequests.d.ts +0 -6
  390. package/dist/client/hooks/useSavedRequests.d.ts.map +0 -1
  391. package/dist/client/hooks/useViewHostProps.d.ts +0 -19
  392. package/dist/client/hooks/useViewHostProps.d.ts.map +0 -1
  393. package/dist/client/index.d.ts.map +0 -1
  394. package/dist/client/lib/elevated.d.ts +0 -28
  395. package/dist/client/lib/elevated.d.ts.map +0 -1
  396. package/dist/client/lib/font-weight.d.ts +0 -10
  397. package/dist/client/lib/font-weight.d.ts.map +0 -1
  398. package/dist/client/lib/icon-context.d.ts +0 -15
  399. package/dist/client/lib/icon-context.d.ts.map +0 -1
  400. package/dist/client/lib/shape-context.d.ts +0 -21
  401. package/dist/client/lib/shape-context.d.ts.map +0 -1
  402. package/dist/client/lib/springs.d.ts +0 -32
  403. package/dist/client/lib/springs.d.ts.map +0 -1
  404. package/dist/client/lib/surface-classes.d.ts +0 -2
  405. package/dist/client/lib/surface-classes.d.ts.map +0 -1
  406. package/dist/client/lib/surface-context.d.ts +0 -7
  407. package/dist/client/lib/surface-context.d.ts.map +0 -1
  408. package/dist/client/lib/utils.d.ts +0 -3
  409. package/dist/client/lib/utils.d.ts.map +0 -1
  410. package/dist/client/mcp-apps/csp.d.ts +0 -26
  411. package/dist/client/mcp-apps/csp.d.ts.map +0 -1
  412. package/dist/client/mcp-apps/debug/csp-suggestions.d.ts +0 -17
  413. package/dist/client/mcp-apps/debug/csp-suggestions.d.ts.map +0 -1
  414. package/dist/client/mcp-apps/logging-transport.d.ts +0 -13
  415. package/dist/client/mcp-apps/logging-transport.d.ts.map +0 -1
  416. package/dist/client/rpc-traffic-coalesce.d.ts +0 -7
  417. package/dist/client/rpc-traffic-coalesce.d.ts.map +0 -1
  418. package/dist/client/rpc-traffic-store.d.ts +0 -37
  419. package/dist/client/rpc-traffic-store.d.ts.map +0 -1
  420. package/dist/client/telemetry/capture.d.ts +0 -7
  421. package/dist/client/telemetry/capture.d.ts.map +0 -1
  422. package/dist/client/telemetry/events.d.ts +0 -168
  423. package/dist/client/telemetry/events.d.ts.map +0 -1
  424. package/dist/client/telemetry/index.d.ts +0 -5
  425. package/dist/client/telemetry/index.d.ts.map +0 -1
  426. package/dist/client/telemetry/init.d.ts +0 -2
  427. package/dist/client/telemetry/init.d.ts.map +0 -1
  428. package/dist/client/telemetry/utils.d.ts +0 -7
  429. package/dist/client/telemetry/utils.d.ts.map +0 -1
  430. package/dist/client/types/message-content-block.d.ts +0 -19
  431. package/dist/client/types/message-content-block.d.ts.map +0 -1
  432. package/dist/client/types/pending-requests.d.ts +0 -17
  433. package/dist/client/types/pending-requests.d.ts.map +0 -1
  434. package/dist/client/utils/basePath.d.ts +0 -34
  435. package/dist/client/utils/basePath.d.ts.map +0 -1
  436. package/dist/client/utils/browser.d.ts +0 -5
  437. package/dist/client/utils/browser.d.ts.map +0 -1
  438. package/dist/client/utils/format.d.ts +0 -4
  439. package/dist/client/utils/format.d.ts.map +0 -1
  440. package/dist/client/utils/highlightJson.d.ts +0 -11
  441. package/dist/client/utils/highlightJson.d.ts.map +0 -1
  442. package/dist/client/utils/jsonUtils.d.ts +0 -24
  443. package/dist/client/utils/jsonUtils.d.ts.map +0 -1
  444. package/dist/client/utils/mcpClientUtils.d.ts +0 -131
  445. package/dist/client/utils/mcpClientUtils.d.ts.map +0 -1
  446. package/dist/client/utils/servers.d.ts +0 -14
  447. package/dist/client/utils/servers.d.ts.map +0 -1
  448. package/dist/server/asset-urls.d.ts +0 -18
  449. package/dist/server/asset-urls.d.ts.map +0 -1
  450. package/dist/server/asset-urls.js +0 -17
  451. package/dist/server/cdn-shell.d.ts +0 -18
  452. package/dist/server/cdn-shell.d.ts.map +0 -1
  453. package/dist/server/cdn-shell.js +0 -12
  454. package/dist/server/chunk-DSTNUYWX.js +0 -148
  455. package/dist/server/chunk-H6ZCIKBS.js +0 -63
  456. package/dist/server/chunk-IKTZUWSX.js +0 -0
  457. package/dist/server/chunk-J4FNYLBF.js +0 -54
  458. package/dist/server/chunk-K2F2AJOI.js +0 -619
  459. package/dist/server/chunk-KD7K27XK.js +0 -77
  460. package/dist/server/chunk-M5TZA42I.js +0 -54
  461. package/dist/server/chunk-OWR2BIBW.js +0 -40
  462. package/dist/server/chunk-PKBMQBKP.js +0 -7
  463. package/dist/server/chunk-SQ4XNMLT.js +0 -72
  464. package/dist/server/chunk-UJLXHNQP.js +0 -43
  465. package/dist/server/chunk-WFT4JHYI.js +0 -24
  466. package/dist/server/chunk-XCNS5CIW.js +0 -199
  467. package/dist/server/chunk-ZCGLU5T7.js +0 -156
  468. package/dist/server/cli.d.ts +0 -3
  469. package/dist/server/cli.d.ts.map +0 -1
  470. package/dist/server/cli.js +0 -141
  471. package/dist/server/create-dev-api-app.d.ts +0 -4
  472. package/dist/server/create-dev-api-app.d.ts.map +0 -1
  473. package/dist/server/create-dev-api-app.js +0 -11
  474. package/dist/server/dev-callback-redirect.d.ts +0 -3
  475. package/dist/server/dev-callback-redirect.d.ts.map +0 -1
  476. package/dist/server/dev-callback-redirect.js +0 -18
  477. package/dist/server/favicon-links.d.ts +0 -12
  478. package/dist/server/favicon-links.d.ts.map +0 -1
  479. package/dist/server/favicon-links.js +0 -11
  480. package/dist/server/favicon-static.d.ts +0 -4
  481. package/dist/server/favicon-static.d.ts.map +0 -1
  482. package/dist/server/favicon-static.js +0 -8
  483. package/dist/server/index.d.ts.map +0 -1
  484. package/dist/server/middleware.d.ts +0 -40
  485. package/dist/server/middleware.d.ts.map +0 -1
  486. package/dist/server/middleware.js +0 -17
  487. package/dist/server/proxy/index.d.ts +0 -3
  488. package/dist/server/proxy/index.d.ts.map +0 -1
  489. package/dist/server/proxy/index.js +0 -12
  490. package/dist/server/proxy/mcp-proxy.d.ts +0 -101
  491. package/dist/server/proxy/mcp-proxy.d.ts.map +0 -1
  492. package/dist/server/proxy/mcp-proxy.js +0 -10
  493. package/dist/server/proxy/oauth-proxy.d.ts +0 -26
  494. package/dist/server/proxy/oauth-proxy.d.ts.map +0 -1
  495. package/dist/server/proxy/oauth-proxy.js +0 -9
  496. package/dist/server/proxy-routes.d.ts +0 -16
  497. package/dist/server/proxy-routes.d.ts.map +0 -1
  498. package/dist/server/proxy-routes.js +0 -10
  499. package/dist/server/rpc-log-bus.d.ts +0 -17
  500. package/dist/server/rpc-log-bus.d.ts.map +0 -1
  501. package/dist/server/rpc-log-bus.js +0 -77
  502. package/dist/server/server.d.ts +0 -15
  503. package/dist/server/server.d.ts.map +0 -1
  504. package/dist/server/server.js +0 -66
  505. package/dist/server/static-assets.d.ts +0 -5
  506. package/dist/server/static-assets.d.ts.map +0 -1
  507. package/dist/server/static-assets.js +0 -9
  508. package/dist/server/utils.d.ts +0 -33
  509. package/dist/server/utils.d.ts.map +0 -1
  510. package/dist/server/utils.js +0 -17
  511. package/dist/server/version.d.ts +0 -7
  512. package/dist/server/version.d.ts.map +0 -1
  513. package/dist/server/version.js +0 -9
  514. package/dist/server/vite-dev-api-plugin.d.ts +0 -4
  515. package/dist/server/vite-dev-api-plugin.d.ts.map +0 -1
  516. package/dist/server/vite-dev-api-plugin.js +0 -30
  517. package/dist/web/apple-touch-icon.png +0 -0
  518. package/dist/web/assets/AnimatePresence-C5p0yiY1.js +0 -9
  519. package/dist/web/assets/ChatTab-BCobuZDc.js +0 -18
  520. package/dist/web/assets/ConnectionSettingsTab-BjGkLwVu.js +0 -1
  521. package/dist/web/assets/ElicitationTab-D3ZUKHND.js +0 -1
  522. package/dist/web/assets/FormContext-DH2caWKO.js +0 -1
  523. package/dist/web/assets/ListTabHeader-R17w_JsB.js +0 -1
  524. package/dist/web/assets/ManufactOAuthCallback-CS3ydSZg.js +0 -1
  525. package/dist/web/assets/MarkdownRenderer-BeeBfQhv.js +0 -47
  526. package/dist/web/assets/NotificationsTab-Uj0_DrmK.js +0 -1
  527. package/dist/web/assets/OAuthCallback-C0ljgCiw.js +0 -1
  528. package/dist/web/assets/PromptsTab-Bns2u0G-.js +0 -15
  529. package/dist/web/assets/ResourcesTab-CO24312V.js +0 -2
  530. package/dist/web/assets/SamplingTab-7gtN7FwU.js +0 -1
  531. package/dist/web/assets/ServerMetadataTab-CQwqYSjL.js +0 -1
  532. package/dist/web/assets/ToolsTab-bDdRxI1b.js +0 -8
  533. package/dist/web/assets/ViewPreview-Ba1Ec5uA.js +0 -1
  534. package/dist/web/assets/WidgetWrapper-CYHfzrtb.js +0 -34
  535. package/dist/web/assets/brush--0LobUi4.js +0 -1
  536. package/dist/web/assets/checkbox-CzBkaNKa.js +0 -1
  537. package/dist/web/assets/code-tME-5H6D.js +0 -1
  538. package/dist/web/assets/createLucideIcon-B3b8EU0b.js +0 -1
  539. package/dist/web/assets/dist-C5JjLJN9.js +0 -21
  540. package/dist/web/assets/index-TQ5V7cM9.js +0 -492
  541. package/dist/web/assets/index-fBX3akc8.css +0 -1
  542. package/dist/web/assets/input-CLYhA7PK.js +0 -1
  543. package/dist/web/assets/inspector-settings-layout-yjKRJDai.js +0 -1
  544. package/dist/web/assets/jsx-runtime-Cjj9sGSy.js +0 -1
  545. package/dist/web/assets/label-Cdim77Jw.js +0 -1
  546. package/dist/web/assets/maximize-2-BTT9QQU9.js +0 -1
  547. package/dist/web/assets/maximize-_O55kFcr.js +0 -1
  548. package/dist/web/assets/react-CU_d2d5K.js +0 -1
  549. package/dist/web/assets/refresh-cw-C9wQl8_d.js +0 -1
  550. package/dist/web/assets/save-B-MsgxX9.js +0 -1
  551. package/dist/web/assets/schemaHelpers-DLNTQr_6.js +0 -1
  552. package/dist/web/assets/select-CJ57-Bor.js +0 -1
  553. package/dist/web/assets/shared-BF0rJNdE.js +0 -1
  554. package/dist/web/assets/sparkles-2OAsc1aP.js +0 -1
  555. package/dist/web/assets/tabs-subtle-6D79T1xd.js +0 -1
  556. package/dist/web/assets/textarea-DLAmNVf_.js +0 -1
  557. package/dist/web/assets/useConfig-BAgALiZg.js +0 -1
  558. package/dist/web/assets/useViewHostProps-BYitt_6K.js +0 -1
  559. package/dist/web/assets/zap-Du2Uc5pa.js +0 -1
  560. package/dist/web/favicon-96x96.png +0 -0
  561. package/dist/web/favicon-black.svg +0 -5
  562. package/dist/web/favicon-white.svg +0 -5
  563. package/dist/web/favicon.ico +0 -0
  564. package/dist/web/favicon.svg +0 -5
  565. package/dist/web/index.html +0 -89
  566. package/dist/web/providers/anthropic.png +0 -0
  567. package/dist/web/providers/google.png +0 -0
  568. package/dist/web/providers/openai.png +0 -0
  569. package/dist/web/site.webmanifest +0 -21
  570. package/dist/web/web-app-manifest-192x192.png +0 -0
  571. package/dist/web/web-app-manifest-512x512.png +0 -0
  572. /package/dist/{cdn → app}/apple-touch-icon.png +0 -0
  573. /package/dist/{cdn → app}/favicon-96x96.png +0 -0
  574. /package/dist/{cdn → app}/favicon-black.svg +0 -0
  575. /package/dist/{cdn → app}/favicon-white.svg +0 -0
  576. /package/dist/{cdn → app}/favicon.ico +0 -0
  577. /package/dist/{cdn → app}/favicon.svg +0 -0
  578. /package/dist/{cdn → app}/site.webmanifest +0 -0
  579. /package/dist/{cdn → app}/web-app-manifest-192x192.png +0 -0
  580. /package/dist/{cdn → app}/web-app-manifest-512x512.png +0 -0
@@ -1,1508 +0,0 @@
1
- import { s as e, t } from "./react-BIs9pQ3H.js";
2
- //#region ../../node_modules/.pnpm/react-router@7.16.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/development/chunk-QUQL4437.mjs
3
- var n = /* @__PURE__ */ e(t(), 1), r = "popstate";
4
- function i(e) {
5
- return typeof e == "object" && !!e && "pathname" in e && "search" in e && "hash" in e && "state" in e && "key" in e;
6
- }
7
- function a(e = {}) {
8
- function t(e, t) {
9
- let n = t.state?.masked, { pathname: r, search: i, hash: a } = n || e.location;
10
- return u("", {
11
- pathname: r,
12
- search: i,
13
- hash: a
14
- }, t.state && t.state.usr || null, t.state && t.state.key || "default", n ? {
15
- pathname: e.location.pathname,
16
- search: e.location.search,
17
- hash: e.location.hash
18
- } : void 0);
19
- }
20
- function n(e, t) {
21
- return typeof t == "string" ? t : d(t);
22
- }
23
- return p(t, n, null, e);
24
- }
25
- function o(e, t) {
26
- if (e === !1 || e == null) throw Error(t);
27
- }
28
- function s(e, t) {
29
- if (!e) {
30
- typeof console < "u" && console.warn(t);
31
- try {
32
- throw Error(t);
33
- } catch {}
34
- }
35
- }
36
- function c() {
37
- return Math.random().toString(36).substring(2, 10);
38
- }
39
- function l(e, t) {
40
- return {
41
- usr: e.state,
42
- key: e.key,
43
- idx: t,
44
- masked: e.mask ? {
45
- pathname: e.pathname,
46
- search: e.search,
47
- hash: e.hash
48
- } : void 0
49
- };
50
- }
51
- function u(e, t, n = null, r, i) {
52
- return {
53
- pathname: typeof e == "string" ? e : e.pathname,
54
- search: "",
55
- hash: "",
56
- ...typeof t == "string" ? f(t) : t,
57
- state: n,
58
- key: t && t.key || r || c(),
59
- mask: i
60
- };
61
- }
62
- function d({ pathname: e = "/", search: t = "", hash: n = "" }) {
63
- return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), n && n !== "#" && (e += n.charAt(0) === "#" ? n : "#" + n), e;
64
- }
65
- function f(e) {
66
- let t = {};
67
- if (e) {
68
- let n = e.indexOf("#");
69
- n >= 0 && (t.hash = e.substring(n), e = e.substring(0, n));
70
- let r = e.indexOf("?");
71
- r >= 0 && (t.search = e.substring(r), e = e.substring(0, r)), e && (t.pathname = e);
72
- }
73
- return t;
74
- }
75
- function p(e, t, n, a = {}) {
76
- let { window: o = document.defaultView, v5Compat: s = !1 } = a, c = o.history, d = "POP", f = null, p = h();
77
- p ?? (p = 0, c.replaceState({
78
- ...c.state,
79
- idx: p
80
- }, ""));
81
- function h() {
82
- return (c.state || { idx: null }).idx;
83
- }
84
- function g() {
85
- d = "POP";
86
- let e = h(), t = e == null ? null : e - p;
87
- p = e, f && f({
88
- action: d,
89
- location: b.location,
90
- delta: t
91
- });
92
- }
93
- function _(e, t) {
94
- d = "PUSH";
95
- let r = i(e) ? e : u(b.location, e, t);
96
- n && n(r, e), p = h() + 1;
97
- let a = l(r, p), m = b.createHref(r.mask || r);
98
- try {
99
- c.pushState(a, "", m);
100
- } catch (e) {
101
- if (e instanceof DOMException && e.name === "DataCloneError") throw e;
102
- o.location.assign(m);
103
- }
104
- s && f && f({
105
- action: d,
106
- location: b.location,
107
- delta: 1
108
- });
109
- }
110
- function v(e, t) {
111
- d = "REPLACE";
112
- let r = i(e) ? e : u(b.location, e, t);
113
- n && n(r, e), p = h();
114
- let a = l(r, p), o = b.createHref(r.mask || r);
115
- c.replaceState(a, "", o), s && f && f({
116
- action: d,
117
- location: b.location,
118
- delta: 0
119
- });
120
- }
121
- function y(e) {
122
- return m(o, e);
123
- }
124
- let b = {
125
- get action() {
126
- return d;
127
- },
128
- get location() {
129
- return e(o, c);
130
- },
131
- listen(e) {
132
- if (f) throw Error("A history only accepts one active listener");
133
- return o.addEventListener(r, g), f = e, () => {
134
- o.removeEventListener(r, g), f = null;
135
- };
136
- },
137
- createHref(e) {
138
- return t(o, e);
139
- },
140
- createURL: y,
141
- encodeLocation(e) {
142
- let t = y(e);
143
- return {
144
- pathname: t.pathname,
145
- search: t.search,
146
- hash: t.hash
147
- };
148
- },
149
- push: _,
150
- replace: v,
151
- go(e) {
152
- return c.go(e);
153
- }
154
- };
155
- return b;
156
- }
157
- function m(e, t, n = !1) {
158
- let r = "http://localhost";
159
- e && (r = e.location.origin === "null" ? e.location.href : e.location.origin), o(r, "No window.location.(origin|href) available to create URL");
160
- let i = typeof t == "string" ? t : d(t);
161
- return i = i.replace(/ $/, "%20"), !n && i.startsWith("//") && (i = r + i), new URL(i, r);
162
- }
163
- function h(e, t, n = "/") {
164
- return g(e, t, n, !1);
165
- }
166
- function g(e, t, n, r, i) {
167
- let a = k((typeof t == "string" ? f(t) : t).pathname || "/", n);
168
- if (a == null) return null;
169
- let o = i ?? v(e), s = null, c = ae(a);
170
- for (let e = 0; s == null && e < o.length; ++e) s = re(o[e], c, r);
171
- return s;
172
- }
173
- function _(e, t) {
174
- let { route: n, pathname: r, params: i } = e;
175
- return {
176
- id: n.id,
177
- pathname: r,
178
- params: i,
179
- data: t[n.id],
180
- loaderData: t[n.id],
181
- handle: n.handle
182
- };
183
- }
184
- function v(e) {
185
- let t = y(e);
186
- return x(t), t;
187
- }
188
- function y(e, t = [], n = [], r = "", i = !1) {
189
- let a = (e, a, s = i, c) => {
190
- let l = {
191
- relativePath: c === void 0 ? e.path || "" : c,
192
- caseSensitive: e.caseSensitive === !0,
193
- childrenIndex: a,
194
- route: e
195
- };
196
- if (l.relativePath.startsWith("/")) {
197
- if (!l.relativePath.startsWith(r) && s) return;
198
- o(l.relativePath.startsWith(r), `Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`), l.relativePath = l.relativePath.slice(r.length);
199
- }
200
- let u = j([r, l.relativePath]), d = n.concat(l);
201
- e.children && e.children.length > 0 && (o(e.index !== !0, `Index routes must not have child routes. Please remove all child routes from route path "${u}".`), y(e.children, t, d, u, s)), !(e.path == null && !e.index) && t.push({
202
- path: u,
203
- score: D(u, e.index),
204
- routesMeta: d
205
- });
206
- };
207
- return e.forEach((e, t) => {
208
- if (e.path === "" || !e.path?.includes("?")) a(e, t);
209
- else for (let n of b(e.path)) a(e, t, !0, n);
210
- }), t;
211
- }
212
- function b(e) {
213
- let t = e.split("/");
214
- if (t.length === 0) return [];
215
- let [n, ...r] = t, i = n.endsWith("?"), a = n.replace(/\?$/, "");
216
- if (r.length === 0) return i ? [a, ""] : [a];
217
- let o = b(r.join("/")), s = [];
218
- return s.push(...o.map((e) => e === "" ? a : [a, e].join("/"))), i && s.push(...o), s.map((t) => e.startsWith("/") && t === "" ? "/" : t);
219
- }
220
- function x(e) {
221
- e.sort((e, t) => e.score === t.score ? ne(e.routesMeta.map((e) => e.childrenIndex), t.routesMeta.map((e) => e.childrenIndex)) : t.score - e.score);
222
- }
223
- var S = /^:[\w-]+$/, C = 3, ee = 2, w = 1, T = 10, te = -2, E = (e) => e === "*";
224
- function D(e, t) {
225
- let n = e.split("/"), r = n.length;
226
- return n.some(E) && (r += te), t && (r += ee), n.filter((e) => !E(e)).reduce((e, t) => e + (S.test(t) ? C : t === "" ? w : T), r);
227
- }
228
- function ne(e, t) {
229
- return e.length === t.length && e.slice(0, -1).every((e, n) => e === t[n]) ? e[e.length - 1] - t[t.length - 1] : 0;
230
- }
231
- function re(e, t, n = !1) {
232
- let { routesMeta: r } = e, i = {}, a = "/", o = [];
233
- for (let e = 0; e < r.length; ++e) {
234
- let s = r[e], c = e === r.length - 1, l = a === "/" ? t : t.slice(a.length) || "/", u = O({
235
- path: s.relativePath,
236
- caseSensitive: s.caseSensitive,
237
- end: c
238
- }, l), d = s.route;
239
- if (!u && c && n && !r[r.length - 1].route.index && (u = O({
240
- path: s.relativePath,
241
- caseSensitive: s.caseSensitive,
242
- end: !1
243
- }, l)), !u) return null;
244
- Object.assign(i, u.params), o.push({
245
- params: i,
246
- pathname: j([a, u.pathname]),
247
- pathnameBase: pe(j([a, u.pathnameBase])),
248
- route: d
249
- }), u.pathnameBase !== "/" && (a = j([a, u.pathnameBase]));
250
- }
251
- return o;
252
- }
253
- function O(e, t) {
254
- typeof e == "string" && (e = {
255
- path: e,
256
- caseSensitive: !1,
257
- end: !0
258
- });
259
- let [n, r] = ie(e.path, e.caseSensitive, e.end), i = t.match(n);
260
- if (!i) return null;
261
- let a = i[0], o = a.replace(/(.)\/+$/, "$1"), s = i.slice(1);
262
- return {
263
- params: r.reduce((e, { paramName: t, isOptional: n }, r) => {
264
- if (t === "*") {
265
- let e = s[r] || "";
266
- o = a.slice(0, a.length - e.length).replace(/(.)\/+$/, "$1");
267
- }
268
- let i = s[r];
269
- return n && !i ? e[t] = void 0 : e[t] = (i || "").replace(/%2F/g, "/"), e;
270
- }, {}),
271
- pathname: a,
272
- pathnameBase: o,
273
- pattern: e
274
- };
275
- }
276
- function ie(e, t = !1, n = !0) {
277
- s(e === "*" || !e.endsWith("*") || e.endsWith("/*"), `Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`);
278
- let r = [], i = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (e, t, n, i, a) => {
279
- if (r.push({
280
- paramName: t,
281
- isOptional: n != null
282
- }), n) {
283
- let t = a.charAt(i + e.length);
284
- return t && t !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
285
- }
286
- return "/([^\\/]+)";
287
- }).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
288
- return e.endsWith("*") ? (r.push({ paramName: "*" }), i += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : e !== "" && e !== "/" && (i += "(?:(?=\\/|$))"), [new RegExp(i, t ? void 0 : "i"), r];
289
- }
290
- function ae(e) {
291
- try {
292
- return e.split("/").map((e) => decodeURIComponent(e).replace(/\//g, "%2F")).join("/");
293
- } catch (t) {
294
- return s(!1, `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`), e;
295
- }
296
- }
297
- function k(e, t) {
298
- if (t === "/") return e;
299
- if (!e.toLowerCase().startsWith(t.toLowerCase())) return null;
300
- let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n);
301
- return r && r !== "/" ? null : e.slice(n) || "/";
302
- }
303
- var oe = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
304
- function se(e, t = "/") {
305
- let { pathname: n, search: r = "", hash: i = "" } = typeof e == "string" ? f(e) : e, a;
306
- return n ? (n = fe(n), a = n.startsWith("/") ? ce(n.substring(1), "/") : ce(n, t)) : a = t, {
307
- pathname: a,
308
- search: me(r),
309
- hash: he(i)
310
- };
311
- }
312
- function ce(e, t) {
313
- let n = M(t).split("/");
314
- return e.split("/").forEach((e) => {
315
- e === ".." ? n.length > 1 && n.pop() : e !== "." && n.push(e);
316
- }), n.length > 1 ? n.join("/") : "/";
317
- }
318
- function le(e, t, n, r) {
319
- return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
320
- }
321
- function ue(e) {
322
- return e.filter((e, t) => t === 0 || e.route.path && e.route.path.length > 0);
323
- }
324
- function de(e) {
325
- let t = ue(e);
326
- return t.map((e, n) => n === t.length - 1 ? e.pathname : e.pathnameBase);
327
- }
328
- function A(e, t, n, r = !1) {
329
- let i;
330
- typeof e == "string" ? i = f(e) : (i = { ...e }, o(!i.pathname || !i.pathname.includes("?"), le("?", "pathname", "search", i)), o(!i.pathname || !i.pathname.includes("#"), le("#", "pathname", "hash", i)), o(!i.search || !i.search.includes("#"), le("#", "search", "hash", i)));
331
- let a = e === "" || i.pathname === "", s = a ? "/" : i.pathname, c;
332
- if (s == null) c = n;
333
- else {
334
- let e = t.length - 1;
335
- if (!r && s.startsWith("..")) {
336
- let t = s.split("/");
337
- for (; t[0] === "..";) t.shift(), --e;
338
- i.pathname = t.join("/");
339
- }
340
- c = e >= 0 ? t[e] : "/";
341
- }
342
- let l = se(i, c), u = s && s !== "/" && s.endsWith("/"), d = (a || s === ".") && n.endsWith("/");
343
- return !l.pathname.endsWith("/") && (u || d) && (l.pathname += "/"), l;
344
- }
345
- var fe = (e) => e.replace(/\/\/+/g, "/"), j = (e) => fe(e.join("/")), M = (e) => e.replace(/\/+$/, ""), pe = (e) => M(e).replace(/^\/*/, "/"), me = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, he = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, ge = class {
346
- constructor(e, t, n, r = !1) {
347
- this.status = e, this.statusText = t || "", this.internal = r, n instanceof Error ? (this.data = n.toString(), this.error = n) : this.data = n;
348
- }
349
- };
350
- function _e(e) {
351
- return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
352
- }
353
- function ve(e) {
354
- return j(e.map((e) => e.route.path).filter(Boolean)) || "/";
355
- }
356
- var ye = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
357
- function be(e, t) {
358
- let n = e;
359
- if (typeof n != "string" || !oe.test(n)) return {
360
- absoluteURL: void 0,
361
- isExternal: !1,
362
- to: n
363
- };
364
- let r = n, i = !1;
365
- if (ye) try {
366
- let e = new URL(window.location.href), r = n.startsWith("//") ? new URL(e.protocol + n) : new URL(n), a = k(r.pathname, t);
367
- r.origin === e.origin && a != null ? n = a + r.search + r.hash : i = !0;
368
- } catch {
369
- s(!1, `<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`);
370
- }
371
- return {
372
- absoluteURL: r,
373
- isExternal: i,
374
- to: n
375
- };
376
- }
377
- Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
378
- var xe = [
379
- "POST",
380
- "PUT",
381
- "PATCH",
382
- "DELETE"
383
- ];
384
- new Set(xe);
385
- var Se = ["GET", ...xe];
386
- new Set(Se);
387
- var N = n.createContext(null);
388
- N.displayName = "DataRouter";
389
- var P = n.createContext(null);
390
- P.displayName = "DataRouterState";
391
- var Ce = n.createContext(!1);
392
- function we() {
393
- return n.useContext(Ce);
394
- }
395
- var Te = n.createContext({ isTransitioning: !1 });
396
- Te.displayName = "ViewTransition";
397
- var Ee = n.createContext(/* @__PURE__ */ new Map());
398
- Ee.displayName = "Fetchers";
399
- var De = n.createContext(null);
400
- De.displayName = "Await";
401
- var F = n.createContext(null);
402
- F.displayName = "Navigation";
403
- var I = n.createContext(null);
404
- I.displayName = "Location";
405
- var L = n.createContext({
406
- outlet: null,
407
- matches: [],
408
- isDataRoute: !1
409
- });
410
- L.displayName = "Route";
411
- var R = n.createContext(null);
412
- R.displayName = "RouteError";
413
- var Oe = "REACT_ROUTER_ERROR", ke = "REDIRECT", Ae = "ROUTE_ERROR_RESPONSE";
414
- function je(e) {
415
- if (e.startsWith(`${Oe}:${ke}:{`)) try {
416
- let t = JSON.parse(e.slice(28));
417
- if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean") return t;
418
- } catch {}
419
- }
420
- function Me(e) {
421
- if (e.startsWith(`${Oe}:${Ae}:{`)) try {
422
- let t = JSON.parse(e.slice(40));
423
- if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string") return new ge(t.status, t.statusText, t.data);
424
- } catch {}
425
- }
426
- function Ne(e, { relative: t } = {}) {
427
- o(z(), "useHref() may be used only in the context of a <Router> component.");
428
- let { basename: r, navigator: i } = n.useContext(F), { hash: a, pathname: s, search: c } = H(e, { relative: t }), l = s;
429
- return r !== "/" && (l = s === "/" ? r : j([r, s])), i.createHref({
430
- pathname: l,
431
- search: c,
432
- hash: a
433
- });
434
- }
435
- function z() {
436
- return n.useContext(I) != null;
437
- }
438
- function B() {
439
- return o(z(), "useLocation() may be used only in the context of a <Router> component."), n.useContext(I).location;
440
- }
441
- var Pe = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
442
- function Fe(e) {
443
- n.useContext(F).static || n.useLayoutEffect(e);
444
- }
445
- function V() {
446
- let { isDataRoute: e } = n.useContext(L);
447
- return e ? $e() : Ie();
448
- }
449
- function Ie() {
450
- o(z(), "useNavigate() may be used only in the context of a <Router> component.");
451
- let e = n.useContext(N), { basename: t, navigator: r } = n.useContext(F), { matches: i } = n.useContext(L), { pathname: a } = B(), c = JSON.stringify(de(i)), l = n.useRef(!1);
452
- return Fe(() => {
453
- l.current = !0;
454
- }), n.useCallback((n, i = {}) => {
455
- if (s(l.current, Pe), !l.current) return;
456
- if (typeof n == "number") {
457
- r.go(n);
458
- return;
459
- }
460
- let o = A(n, JSON.parse(c), a, i.relative === "path");
461
- e == null && t !== "/" && (o.pathname = o.pathname === "/" ? t : j([t, o.pathname])), (i.replace ? r.replace : r.push)(o, i.state, i);
462
- }, [
463
- t,
464
- r,
465
- c,
466
- a,
467
- e
468
- ]);
469
- }
470
- n.createContext(null);
471
- function Le() {
472
- let { matches: e } = n.useContext(L);
473
- return e[e.length - 1]?.params ?? {};
474
- }
475
- function H(e, { relative: t } = {}) {
476
- let { matches: r } = n.useContext(L), { pathname: i } = B(), a = JSON.stringify(de(r));
477
- return n.useMemo(() => A(e, JSON.parse(a), i, t === "path"), [
478
- e,
479
- a,
480
- i,
481
- t
482
- ]);
483
- }
484
- function Re(e, t) {
485
- return ze(e, t);
486
- }
487
- function ze(e, t, r) {
488
- o(z(), "useRoutes() may be used only in the context of a <Router> component.");
489
- let { navigator: i } = n.useContext(F), { matches: a } = n.useContext(L), c = a[a.length - 1], l = c ? c.params : {}, u = c ? c.pathname : "/", d = c ? c.pathnameBase : "/", p = c && c.route;
490
- {
491
- let e = p && p.path || "";
492
- tt(u, !p || e.endsWith("*") || e.endsWith("*?"), `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
493
-
494
- Please change the parent <Route path="${e}"> to <Route path="${e === "/" ? "*" : `${e}/*`}">.`);
495
- }
496
- let m = B(), g;
497
- if (t) {
498
- let e = typeof t == "string" ? f(t) : t;
499
- o(d === "/" || e.pathname?.startsWith(d), `When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${e.pathname}" was given in the \`location\` prop.`), g = e;
500
- } else g = m;
501
- let _ = g.pathname || "/", v = _;
502
- if (d !== "/") {
503
- let e = d.replace(/^\//, "").split("/");
504
- v = "/" + _.replace(/^\//, "").split("/").slice(e.length).join("/");
505
- }
506
- let y = r && r.state.matches.length ? r.state.matches.map((e) => Object.assign(e, { route: r.manifest[e.route.id] || e.route })) : h(e, { pathname: v });
507
- s(p || y != null, `No routes matched location "${g.pathname}${g.search}${g.hash}" `), s(y == null || y[y.length - 1].route.element !== void 0 || y[y.length - 1].route.Component !== void 0 || y[y.length - 1].route.lazy !== void 0, `Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);
508
- let b = Ge(y && y.map((e) => Object.assign({}, e, {
509
- params: Object.assign({}, l, e.params),
510
- pathname: j([d, i.encodeLocation ? i.encodeLocation(e.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")).pathname : e.pathname]),
511
- pathnameBase: e.pathnameBase === "/" ? d : j([d, i.encodeLocation ? i.encodeLocation(e.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")).pathname : e.pathnameBase])
512
- })), a, r);
513
- return t && b ? /* @__PURE__ */ n.createElement(I.Provider, { value: {
514
- location: {
515
- pathname: "/",
516
- search: "",
517
- hash: "",
518
- state: null,
519
- key: "default",
520
- mask: void 0,
521
- ...g
522
- },
523
- navigationType: "POP"
524
- } }, b) : b;
525
- }
526
- function Be() {
527
- let e = Qe(), t = _e(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, i = "rgba(200,200,200, 0.5)", a = {
528
- padding: "0.5rem",
529
- backgroundColor: i
530
- }, o = {
531
- padding: "2px 4px",
532
- backgroundColor: i
533
- }, s = null;
534
- return console.error("Error handled by React Router default ErrorBoundary:", e), s = /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ n.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ n.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ n.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ n.createElement("h3", { style: { fontStyle: "italic" } }, t), r ? /* @__PURE__ */ n.createElement("pre", { style: a }, r) : null, s);
535
- }
536
- var Ve = /* @__PURE__ */ n.createElement(Be, null), He = class extends n.Component {
537
- constructor(e) {
538
- super(e), this.state = {
539
- location: e.location,
540
- revalidation: e.revalidation,
541
- error: e.error
542
- };
543
- }
544
- static getDerivedStateFromError(e) {
545
- return { error: e };
546
- }
547
- static getDerivedStateFromProps(e, t) {
548
- return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
549
- error: e.error,
550
- location: e.location,
551
- revalidation: e.revalidation
552
- } : {
553
- error: e.error === void 0 ? t.error : e.error,
554
- location: t.location,
555
- revalidation: e.revalidation || t.revalidation
556
- };
557
- }
558
- componentDidCatch(e, t) {
559
- this.props.onError ? this.props.onError(e, t) : console.error("React Router caught the following error during render", e);
560
- }
561
- render() {
562
- let e = this.state.error;
563
- if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
564
- let t = Me(e.digest);
565
- t && (e = t);
566
- }
567
- let t = e === void 0 ? this.props.children : /* @__PURE__ */ n.createElement(L.Provider, { value: this.props.routeContext }, /* @__PURE__ */ n.createElement(R.Provider, {
568
- value: e,
569
- children: this.props.component
570
- }));
571
- return this.context ? /* @__PURE__ */ n.createElement(Ue, { error: e }, t) : t;
572
- }
573
- };
574
- He.contextType = Ce;
575
- var U = /* @__PURE__ */ new WeakMap();
576
- function Ue({ children: e, error: t }) {
577
- let { basename: r } = n.useContext(F);
578
- if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
579
- let e = je(t.digest);
580
- if (e) {
581
- let i = U.get(t);
582
- if (i) throw i;
583
- let a = be(e.location, r);
584
- if (ye && !U.get(t)) if (a.isExternal || e.reloadDocument) window.location.href = a.absoluteURL || a.to;
585
- else {
586
- let n = Promise.resolve().then(() => window.__reactRouterDataRouter.navigate(a.to, { replace: e.replace }));
587
- throw U.set(t, n), n;
588
- }
589
- return /* @__PURE__ */ n.createElement("meta", {
590
- httpEquiv: "refresh",
591
- content: `0;url=${a.absoluteURL || a.to}`
592
- });
593
- }
594
- }
595
- return e;
596
- }
597
- function We({ routeContext: e, match: t, children: r }) {
598
- let i = n.useContext(N);
599
- return i && i.static && i.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (i.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ n.createElement(L.Provider, { value: e }, r);
600
- }
601
- function Ge(e, t = [], r) {
602
- let i = r?.state;
603
- if (e == null) {
604
- if (!i) return null;
605
- if (i.errors) e = i.matches;
606
- else if (t.length === 0 && !i.initialized && i.matches.length > 0) e = i.matches;
607
- else return null;
608
- }
609
- let a = e, s = i?.errors;
610
- if (s != null) {
611
- let e = a.findIndex((e) => e.route.id && s?.[e.route.id] !== void 0);
612
- o(e >= 0, `Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`), a = a.slice(0, Math.min(a.length, e + 1));
613
- }
614
- let c = !1, l = -1;
615
- if (r && i) {
616
- c = i.renderFallback;
617
- for (let e = 0; e < a.length; e++) {
618
- let t = a[e];
619
- if ((t.route.HydrateFallback || t.route.hydrateFallbackElement) && (l = e), t.route.id) {
620
- let { loaderData: e, errors: n } = i, o = t.route.loader && !e.hasOwnProperty(t.route.id) && (!n || n[t.route.id] === void 0);
621
- if (t.route.lazy || o) {
622
- r.isStatic && (c = !0), a = l >= 0 ? a.slice(0, l + 1) : [a[0]];
623
- break;
624
- }
625
- }
626
- }
627
- }
628
- let u = r?.onError, d = i && u ? (e, t) => {
629
- u(e, {
630
- location: i.location,
631
- params: i.matches?.[0]?.params ?? {},
632
- pattern: ve(i.matches),
633
- errorInfo: t
634
- });
635
- } : void 0;
636
- return a.reduceRight((e, r, o) => {
637
- let u, f = !1, p = null, m = null;
638
- i && (u = s && r.route.id ? s[r.route.id] : void 0, p = r.route.errorElement || Ve, c && (l < 0 && o === 0 ? (tt("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), f = !0, m = null) : l === o && (f = !0, m = r.route.hydrateFallbackElement || null)));
639
- let h = t.concat(a.slice(0, o + 1)), g = () => {
640
- let t;
641
- return t = u ? p : f ? m : r.route.Component ? /* @__PURE__ */ n.createElement(r.route.Component, null) : r.route.element ? r.route.element : e, /* @__PURE__ */ n.createElement(We, {
642
- match: r,
643
- routeContext: {
644
- outlet: e,
645
- matches: h,
646
- isDataRoute: i != null
647
- },
648
- children: t
649
- });
650
- };
651
- return i && (r.route.ErrorBoundary || r.route.errorElement || o === 0) ? /* @__PURE__ */ n.createElement(He, {
652
- location: i.location,
653
- revalidation: i.revalidation,
654
- component: p,
655
- error: u,
656
- children: g(),
657
- routeContext: {
658
- outlet: null,
659
- matches: h,
660
- isDataRoute: !0
661
- },
662
- onError: d
663
- }) : g();
664
- }, null);
665
- }
666
- function W(e) {
667
- return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
668
- }
669
- function Ke(e) {
670
- let t = n.useContext(N);
671
- return o(t, W(e)), t;
672
- }
673
- function G(e) {
674
- let t = n.useContext(P);
675
- return o(t, W(e)), t;
676
- }
677
- function qe(e) {
678
- let t = n.useContext(L);
679
- return o(t, W(e)), t;
680
- }
681
- function Je(e) {
682
- let t = qe(e), n = t.matches[t.matches.length - 1];
683
- return o(n.route.id, `${e} can only be used on routes that contain a unique "id"`), n.route.id;
684
- }
685
- function Ye() {
686
- return Je("useRouteId");
687
- }
688
- function Xe() {
689
- let e = G("useNavigation");
690
- return n.useMemo(() => {
691
- let { matches: t, historyAction: n, ...r } = e.navigation;
692
- return r;
693
- }, [e.navigation]);
694
- }
695
- function Ze() {
696
- let { matches: e, loaderData: t } = G("useMatches");
697
- return n.useMemo(() => e.map((e) => _(e, t)), [e, t]);
698
- }
699
- function Qe() {
700
- let e = n.useContext(R), t = G("useRouteError"), r = Je("useRouteError");
701
- return e === void 0 ? t.errors?.[r] : e;
702
- }
703
- function $e() {
704
- let { router: e } = Ke("useNavigate"), t = Je("useNavigate"), r = n.useRef(!1);
705
- return Fe(() => {
706
- r.current = !0;
707
- }), n.useCallback(async (n, i = {}) => {
708
- s(r.current, Pe), r.current && (typeof n == "number" ? await e.navigate(n) : await e.navigate(n, {
709
- fromRouteId: t,
710
- ...i
711
- }));
712
- }, [e, t]);
713
- }
714
- var et = {};
715
- function tt(e, t, n) {
716
- !t && !et[e] && (et[e] = !0, s(!1, n));
717
- }
718
- n.memo(nt);
719
- function nt({ routes: e, manifest: t, future: n, state: r, isStatic: i, onError: a }) {
720
- return ze(e, void 0, {
721
- manifest: t,
722
- state: r,
723
- isStatic: i,
724
- onError: a,
725
- future: n
726
- });
727
- }
728
- function rt(e) {
729
- o(!1, "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.");
730
- }
731
- function it({ basename: e = "/", children: t = null, location: r, navigationType: i = "POP", navigator: a, static: c = !1, useTransitions: l }) {
732
- o(!z(), "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");
733
- let u = e.replace(/^\/*/, "/"), d = n.useMemo(() => ({
734
- basename: u,
735
- navigator: a,
736
- static: c,
737
- useTransitions: l,
738
- future: {}
739
- }), [
740
- u,
741
- a,
742
- c,
743
- l
744
- ]);
745
- typeof r == "string" && (r = f(r));
746
- let { pathname: p = "/", search: m = "", hash: h = "", state: g = null, key: _ = "default", mask: v } = r, y = n.useMemo(() => {
747
- let e = k(p, u);
748
- return e == null ? null : {
749
- location: {
750
- pathname: e,
751
- search: m,
752
- hash: h,
753
- state: g,
754
- key: _,
755
- mask: v
756
- },
757
- navigationType: i
758
- };
759
- }, [
760
- u,
761
- p,
762
- m,
763
- h,
764
- g,
765
- _,
766
- i,
767
- v
768
- ]);
769
- return s(y != null, `<Router basename="${u}"> is not able to match the URL "${p}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`), y == null ? null : /* @__PURE__ */ n.createElement(F.Provider, { value: d }, /* @__PURE__ */ n.createElement(I.Provider, {
770
- children: t,
771
- value: y
772
- }));
773
- }
774
- function at({ children: e, location: t }) {
775
- return Re(ot(e), t);
776
- }
777
- n.Component;
778
- function ot(e, t = []) {
779
- let r = [];
780
- return n.Children.forEach(e, (e, i) => {
781
- if (!n.isValidElement(e)) return;
782
- let a = [...t, i];
783
- if (e.type === n.Fragment) {
784
- r.push.apply(r, ot(e.props.children, a));
785
- return;
786
- }
787
- o(e.type === rt, `[${typeof e.type == "string" ? e.type : e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`), o(!e.props.index || !e.props.children, "An index route cannot have child routes.");
788
- let s = {
789
- id: e.props.id || a.join("-"),
790
- caseSensitive: e.props.caseSensitive,
791
- element: e.props.element,
792
- Component: e.props.Component,
793
- index: e.props.index,
794
- path: e.props.path,
795
- middleware: e.props.middleware,
796
- loader: e.props.loader,
797
- action: e.props.action,
798
- hydrateFallbackElement: e.props.hydrateFallbackElement,
799
- HydrateFallback: e.props.HydrateFallback,
800
- errorElement: e.props.errorElement,
801
- ErrorBoundary: e.props.ErrorBoundary,
802
- hasErrorBoundary: e.props.hasErrorBoundary === !0 || e.props.ErrorBoundary != null || e.props.errorElement != null,
803
- shouldRevalidate: e.props.shouldRevalidate,
804
- handle: e.props.handle,
805
- lazy: e.props.lazy
806
- };
807
- e.props.children && (s.children = ot(e.props.children, a)), r.push(s);
808
- }), r;
809
- }
810
- var K = "get", q = "application/x-www-form-urlencoded";
811
- function J(e) {
812
- return typeof HTMLElement < "u" && e instanceof HTMLElement;
813
- }
814
- function st(e) {
815
- return J(e) && e.tagName.toLowerCase() === "button";
816
- }
817
- function ct(e) {
818
- return J(e) && e.tagName.toLowerCase() === "form";
819
- }
820
- function lt(e) {
821
- return J(e) && e.tagName.toLowerCase() === "input";
822
- }
823
- function ut(e) {
824
- return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
825
- }
826
- function dt(e, t) {
827
- return e.button === 0 && (!t || t === "_self") && !ut(e);
828
- }
829
- function ft(e = "") {
830
- return new URLSearchParams(typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((t, n) => {
831
- let r = e[n];
832
- return t.concat(Array.isArray(r) ? r.map((e) => [n, e]) : [[n, r]]);
833
- }, []));
834
- }
835
- function pt(e, t) {
836
- let n = ft(e);
837
- return t && t.forEach((e, r) => {
838
- n.has(r) || t.getAll(r).forEach((e) => {
839
- n.append(r, e);
840
- });
841
- }), n;
842
- }
843
- var Y = null;
844
- function mt() {
845
- if (Y === null) try {
846
- new FormData(document.createElement("form"), 0), Y = !1;
847
- } catch {
848
- Y = !0;
849
- }
850
- return Y;
851
- }
852
- var ht = /* @__PURE__ */ new Set([
853
- "application/x-www-form-urlencoded",
854
- "multipart/form-data",
855
- "text/plain"
856
- ]);
857
- function gt(e) {
858
- return e != null && !ht.has(e) ? (s(!1, `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${q}"`), null) : e;
859
- }
860
- function _t(e, t) {
861
- let n, r, i, a, o;
862
- if (ct(e)) {
863
- let o = e.getAttribute("action");
864
- r = o ? k(o, t) : null, n = e.getAttribute("method") || K, i = gt(e.getAttribute("enctype")) || q, a = new FormData(e);
865
- } else if (st(e) || lt(e) && (e.type === "submit" || e.type === "image")) {
866
- let o = e.form;
867
- if (o == null) throw Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>");
868
- let s = e.getAttribute("formaction") || o.getAttribute("action");
869
- if (r = s ? k(s, t) : null, n = e.getAttribute("formmethod") || o.getAttribute("method") || K, i = gt(e.getAttribute("formenctype")) || gt(o.getAttribute("enctype")) || q, a = new FormData(o, e), !mt()) {
870
- let { name: t, type: n, value: r } = e;
871
- if (n === "image") {
872
- let e = t ? `${t}.` : "";
873
- a.append(`${e}x`, "0"), a.append(`${e}y`, "0");
874
- } else t && a.append(t, r);
875
- }
876
- } else if (J(e)) throw Error("Cannot submit element that is not <form>, <button>, or <input type=\"submit|image\">");
877
- else n = K, r = null, i = q, o = e;
878
- return a && i === "text/plain" && (o = a, a = void 0), {
879
- action: r,
880
- method: n.toLowerCase(),
881
- encType: i,
882
- formData: a,
883
- body: o
884
- };
885
- }
886
- Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
887
- var vt = {
888
- "&": "\\u0026",
889
- ">": "\\u003e",
890
- "<": "\\u003c",
891
- "\u2028": "\\u2028",
892
- "\u2029": "\\u2029"
893
- }, yt = /[&><\u2028\u2029]/g;
894
- function bt(e) {
895
- return e.replace(yt, (e) => vt[e]);
896
- }
897
- function xt(e, t) {
898
- if (e === !1 || e == null) throw Error(t);
899
- }
900
- function St(e, t, n, r) {
901
- let i = typeof e == "string" ? new URL(e, typeof window > "u" ? "server://singlefetch/" : window.location.origin) : e;
902
- return n ? i.pathname.endsWith("/") ? i.pathname = `${i.pathname}_.${r}` : i.pathname = `${i.pathname}.${r}` : i.pathname === "/" ? i.pathname = `_root.${r}` : t && k(i.pathname, t) === "/" ? i.pathname = `${M(t)}/_root.${r}` : i.pathname = `${M(i.pathname)}.${r}`, i;
903
- }
904
- async function Ct(e, t) {
905
- if (e.id in t) return t[e.id];
906
- try {
907
- let n = await import(
908
- /* @vite-ignore */
909
- /* webpackIgnore: true */
910
- e.module
911
- );
912
- return t[e.id] = n, n;
913
- } catch (t) {
914
- return console.error(`Error loading route module \`${e.module}\`, reloading page...`), console.error(t), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {});
915
- }
916
- }
917
- function wt(e) {
918
- return e != null && typeof e.page == "string";
919
- }
920
- function Tt(e) {
921
- return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
922
- }
923
- async function Et(e, t, n) {
924
- return jt((await Promise.all(e.map(async (e) => {
925
- let r = t.routes[e.route.id];
926
- if (r) {
927
- let e = await Ct(r, n);
928
- return e.links ? e.links() : [];
929
- }
930
- return [];
931
- }))).flat(1).filter(Tt).filter((e) => e.rel === "stylesheet" || e.rel === "preload").map((e) => e.rel === "stylesheet" ? {
932
- ...e,
933
- rel: "prefetch",
934
- as: "style"
935
- } : {
936
- ...e,
937
- rel: "prefetch"
938
- }));
939
- }
940
- function Dt(e, t, n, r, i, a) {
941
- let o = (e, t) => n[t] ? e.route.id !== n[t].route.id : !0, s = (e, t) => n[t].pathname !== e.pathname || n[t].route.path?.endsWith("*") && n[t].params["*"] !== e.params["*"];
942
- return a === "assets" ? t.filter((e, t) => o(e, t) || s(e, t)) : a === "data" ? t.filter((t, a) => {
943
- let c = r.routes[t.route.id];
944
- if (!c || !c.hasLoader) return !1;
945
- if (o(t, a) || s(t, a)) return !0;
946
- if (t.route.shouldRevalidate) {
947
- let r = t.route.shouldRevalidate({
948
- currentUrl: new URL(i.pathname + i.search + i.hash, window.origin),
949
- currentParams: n[0]?.params || {},
950
- nextUrl: new URL(e, window.origin),
951
- nextParams: t.params,
952
- defaultShouldRevalidate: !0
953
- });
954
- if (typeof r == "boolean") return r;
955
- }
956
- return !0;
957
- }) : [];
958
- }
959
- function Ot(e, t, { includeHydrateFallback: n } = {}) {
960
- return kt(e.map((e) => {
961
- let r = t.routes[e.route.id];
962
- if (!r) return [];
963
- let i = [r.module];
964
- return r.clientActionModule && (i = i.concat(r.clientActionModule)), r.clientLoaderModule && (i = i.concat(r.clientLoaderModule)), n && r.hydrateFallbackModule && (i = i.concat(r.hydrateFallbackModule)), r.imports && (i = i.concat(r.imports)), i;
965
- }).flat(1));
966
- }
967
- function kt(e) {
968
- return [...new Set(e)];
969
- }
970
- function At(e) {
971
- let t = {}, n = Object.keys(e).sort();
972
- for (let r of n) t[r] = e[r];
973
- return t;
974
- }
975
- function jt(e, t) {
976
- let n = /* @__PURE__ */ new Set(), r = new Set(t);
977
- return e.reduce((e, i) => {
978
- if (t && !wt(i) && i.as === "script" && i.href && r.has(i.href)) return e;
979
- let a = JSON.stringify(At(i));
980
- return n.has(a) || (n.add(a), e.push({
981
- key: a,
982
- link: i
983
- })), e;
984
- }, []);
985
- }
986
- function X() {
987
- let e = n.useContext(N);
988
- return xt(e, "You must render this element inside a <DataRouterContext.Provider> element"), e;
989
- }
990
- function Mt() {
991
- let e = n.useContext(P);
992
- return xt(e, "You must render this element inside a <DataRouterStateContext.Provider> element"), e;
993
- }
994
- var Z = n.createContext(void 0);
995
- Z.displayName = "FrameworkContext";
996
- function Nt() {
997
- let e = n.useContext(Z);
998
- return xt(e, "You must render this element inside a <HydratedRouter> element"), e;
999
- }
1000
- function Pt(e, t) {
1001
- let r = n.useContext(Z), [i, a] = n.useState(!1), [o, s] = n.useState(!1), { onFocus: c, onBlur: l, onMouseEnter: u, onMouseLeave: d, onTouchStart: f } = t, p = n.useRef(null);
1002
- n.useEffect(() => {
1003
- if (e === "render" && s(!0), e === "viewport") {
1004
- let e = new IntersectionObserver((e) => {
1005
- e.forEach((e) => {
1006
- s(e.isIntersecting);
1007
- });
1008
- }, { threshold: .5 });
1009
- return p.current && e.observe(p.current), () => {
1010
- e.disconnect();
1011
- };
1012
- }
1013
- }, [e]), n.useEffect(() => {
1014
- if (i) {
1015
- let e = setTimeout(() => {
1016
- s(!0);
1017
- }, 100);
1018
- return () => {
1019
- clearTimeout(e);
1020
- };
1021
- }
1022
- }, [i]);
1023
- let m = () => {
1024
- a(!0);
1025
- }, h = () => {
1026
- a(!1), s(!1);
1027
- };
1028
- return r ? e === "intent" ? [
1029
- o,
1030
- p,
1031
- {
1032
- onFocus: Q(c, m),
1033
- onBlur: Q(l, h),
1034
- onMouseEnter: Q(u, m),
1035
- onMouseLeave: Q(d, h),
1036
- onTouchStart: Q(f, m)
1037
- }
1038
- ] : [
1039
- o,
1040
- p,
1041
- {}
1042
- ] : [
1043
- !1,
1044
- p,
1045
- {}
1046
- ];
1047
- }
1048
- function Q(e, t) {
1049
- return (n) => {
1050
- e && e(n), n.defaultPrevented || t(n);
1051
- };
1052
- }
1053
- function Ft({ page: e, ...t }) {
1054
- let r = we(), { router: i } = X(), a = n.useMemo(() => h(i.routes, e, i.basename), [
1055
- i.routes,
1056
- e,
1057
- i.basename
1058
- ]);
1059
- return a ? r ? /* @__PURE__ */ n.createElement(Lt, {
1060
- page: e,
1061
- matches: a,
1062
- ...t
1063
- }) : /* @__PURE__ */ n.createElement(Rt, {
1064
- page: e,
1065
- matches: a,
1066
- ...t
1067
- }) : null;
1068
- }
1069
- function It(e) {
1070
- let { manifest: t, routeModules: r } = Nt(), [i, a] = n.useState([]);
1071
- return n.useEffect(() => {
1072
- let n = !1;
1073
- return Et(e, t, r).then((e) => {
1074
- n || a(e);
1075
- }), () => {
1076
- n = !0;
1077
- };
1078
- }, [
1079
- e,
1080
- t,
1081
- r
1082
- ]), i;
1083
- }
1084
- function Lt({ page: e, matches: t, ...r }) {
1085
- let i = B(), { future: a } = Nt(), { basename: o } = X(), s = n.useMemo(() => {
1086
- if (e === i.pathname + i.search + i.hash) return [];
1087
- let n = St(e, o, a.v8_trailingSlashAwareDataRequests, "rsc"), r = !1, s = [];
1088
- for (let e of t) typeof e.route.shouldRevalidate == "function" ? r = !0 : s.push(e.route.id);
1089
- return r && s.length > 0 && n.searchParams.set("_routes", s.join(",")), [n.pathname + n.search];
1090
- }, [
1091
- o,
1092
- a.v8_trailingSlashAwareDataRequests,
1093
- e,
1094
- i,
1095
- t
1096
- ]);
1097
- return /* @__PURE__ */ n.createElement(n.Fragment, null, s.map((e) => /* @__PURE__ */ n.createElement("link", {
1098
- key: e,
1099
- rel: "prefetch",
1100
- as: "fetch",
1101
- href: e,
1102
- ...r
1103
- })));
1104
- }
1105
- function Rt({ page: e, matches: t, ...r }) {
1106
- let i = B(), { future: a, manifest: o, routeModules: s } = Nt(), { basename: c } = X(), { loaderData: l, matches: u } = Mt(), d = n.useMemo(() => Dt(e, t, u, o, i, "data"), [
1107
- e,
1108
- t,
1109
- u,
1110
- o,
1111
- i
1112
- ]), f = n.useMemo(() => Dt(e, t, u, o, i, "assets"), [
1113
- e,
1114
- t,
1115
- u,
1116
- o,
1117
- i
1118
- ]), p = n.useMemo(() => {
1119
- if (e === i.pathname + i.search + i.hash) return [];
1120
- let n = /* @__PURE__ */ new Set(), r = !1;
1121
- if (t.forEach((e) => {
1122
- let t = o.routes[e.route.id];
1123
- !t || !t.hasLoader || (!d.some((t) => t.route.id === e.route.id) && e.route.id in l && s[e.route.id]?.shouldRevalidate || t.hasClientLoader ? r = !0 : n.add(e.route.id));
1124
- }), n.size === 0) return [];
1125
- let u = St(e, c, a.v8_trailingSlashAwareDataRequests, "data");
1126
- return r && n.size > 0 && u.searchParams.set("_routes", t.filter((e) => n.has(e.route.id)).map((e) => e.route.id).join(",")), [u.pathname + u.search];
1127
- }, [
1128
- c,
1129
- a.v8_trailingSlashAwareDataRequests,
1130
- l,
1131
- i,
1132
- o,
1133
- d,
1134
- t,
1135
- e,
1136
- s
1137
- ]), m = n.useMemo(() => Ot(f, o), [f, o]), h = It(f);
1138
- return /* @__PURE__ */ n.createElement(n.Fragment, null, p.map((e) => /* @__PURE__ */ n.createElement("link", {
1139
- key: e,
1140
- rel: "prefetch",
1141
- as: "fetch",
1142
- href: e,
1143
- ...r
1144
- })), m.map((e) => /* @__PURE__ */ n.createElement("link", {
1145
- key: e,
1146
- rel: "modulepreload",
1147
- href: e,
1148
- ...r
1149
- })), h.map(({ key: e, link: t }) => /* @__PURE__ */ n.createElement("link", {
1150
- key: e,
1151
- nonce: r.nonce,
1152
- ...t,
1153
- crossOrigin: t.crossOrigin ?? r.crossOrigin
1154
- })));
1155
- }
1156
- function zt(...e) {
1157
- return (t) => {
1158
- e.forEach((e) => {
1159
- typeof e == "function" ? e(t) : e != null && (e.current = t);
1160
- });
1161
- };
1162
- }
1163
- n.Component;
1164
- var Bt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
1165
- try {
1166
- Bt && (window.__reactRouterVersion = "7.16.0");
1167
- } catch {}
1168
- function Vt({ basename: e, children: t, useTransitions: r, window: i }) {
1169
- let o = n.useRef();
1170
- o.current ??= a({
1171
- window: i,
1172
- v5Compat: !0
1173
- });
1174
- let s = o.current, [c, l] = n.useState({
1175
- action: s.action,
1176
- location: s.location
1177
- }), u = n.useCallback((e) => {
1178
- r === !1 ? l(e) : n.startTransition(() => l(e));
1179
- }, [r]);
1180
- return n.useLayoutEffect(() => s.listen(u), [s, u]), /* @__PURE__ */ n.createElement(it, {
1181
- basename: e,
1182
- children: t,
1183
- location: c.location,
1184
- navigationType: c.action,
1185
- navigator: s,
1186
- useTransitions: r
1187
- });
1188
- }
1189
- function Ht({ basename: e, children: t, history: r, useTransitions: i }) {
1190
- let [a, o] = n.useState({
1191
- action: r.action,
1192
- location: r.location
1193
- }), s = n.useCallback((e) => {
1194
- i === !1 ? o(e) : n.startTransition(() => o(e));
1195
- }, [i]);
1196
- return n.useLayoutEffect(() => r.listen(s), [r, s]), /* @__PURE__ */ n.createElement(it, {
1197
- basename: e,
1198
- children: t,
1199
- location: a.location,
1200
- navigationType: a.action,
1201
- navigator: r,
1202
- useTransitions: i
1203
- });
1204
- }
1205
- Ht.displayName = "unstable_HistoryRouter";
1206
- var Ut = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Wt = n.forwardRef(function({ onClick: e, discover: t = "render", prefetch: r = "none", relative: i, reloadDocument: a, replace: o, mask: s, state: c, target: l, to: u, preventScrollReset: d, viewTransition: f, defaultShouldRevalidate: p, ...m }, h) {
1207
- let { basename: g, navigator: _, useTransitions: v } = n.useContext(F), y = typeof u == "string" && Ut.test(u), b = be(u, g);
1208
- u = b.to;
1209
- let x = Ne(u, { relative: i }), S = B(), C = null;
1210
- if (s) {
1211
- let e = A(s, [], S.mask ? S.mask.pathname : "/", !0);
1212
- g !== "/" && (e.pathname = e.pathname === "/" ? g : j([g, e.pathname])), C = _.createHref(e);
1213
- }
1214
- let [ee, w, T] = Pt(r, m), te = Zt(u, {
1215
- replace: o,
1216
- mask: s,
1217
- state: c,
1218
- target: l,
1219
- preventScrollReset: d,
1220
- relative: i,
1221
- viewTransition: f,
1222
- defaultShouldRevalidate: p,
1223
- useTransitions: v
1224
- });
1225
- function E(t) {
1226
- e && e(t), t.defaultPrevented || te(t);
1227
- }
1228
- let D = !(b.isExternal || a), ne = /* @__PURE__ */ n.createElement("a", {
1229
- ...m,
1230
- ...T,
1231
- href: (D ? C : void 0) || b.absoluteURL || x,
1232
- onClick: D ? E : e,
1233
- ref: zt(h, w),
1234
- target: l,
1235
- "data-discover": !y && t === "render" ? "true" : void 0
1236
- });
1237
- return ee && !y ? /* @__PURE__ */ n.createElement(n.Fragment, null, ne, /* @__PURE__ */ n.createElement(Ft, { page: x })) : ne;
1238
- });
1239
- Wt.displayName = "Link";
1240
- var Gt = n.forwardRef(function({ "aria-current": e = "page", caseSensitive: t = !1, className: r = "", end: i = !1, style: a, to: o, viewTransition: s, children: c, ...l }, u) {
1241
- let d = H(o, { relative: l.relative }), f = B(), p = n.useContext(P), { navigator: m, basename: h } = n.useContext(F), g = p != null && cn(d) && s === !0, _ = m.encodeLocation ? m.encodeLocation(d).pathname : d.pathname, v = f.pathname, y = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
1242
- t || (v = v.toLowerCase(), y = y ? y.toLowerCase() : null, _ = _.toLowerCase()), y && h && (y = k(y, h) || y);
1243
- let b = _ !== "/" && _.endsWith("/") ? _.length - 1 : _.length, x = v === _ || !i && v.startsWith(_) && v.charAt(b) === "/", S = y != null && (y === _ || !i && y.startsWith(_) && y.charAt(_.length) === "/"), C = {
1244
- isActive: x,
1245
- isPending: S,
1246
- isTransitioning: g
1247
- }, ee = x ? e : void 0, w;
1248
- w = typeof r == "function" ? r(C) : [
1249
- r,
1250
- x ? "active" : null,
1251
- S ? "pending" : null,
1252
- g ? "transitioning" : null
1253
- ].filter(Boolean).join(" ");
1254
- let T = typeof a == "function" ? a(C) : a;
1255
- return /* @__PURE__ */ n.createElement(Wt, {
1256
- ...l,
1257
- "aria-current": ee,
1258
- className: w,
1259
- ref: u,
1260
- style: T,
1261
- to: o,
1262
- viewTransition: s
1263
- }, typeof c == "function" ? c(C) : c);
1264
- });
1265
- Gt.displayName = "NavLink";
1266
- var Kt = n.forwardRef(({ discover: e = "render", fetcherKey: t, navigate: r, reloadDocument: i, replace: a, state: o, method: s = K, action: c, onSubmit: l, relative: u, preventScrollReset: d, viewTransition: f, defaultShouldRevalidate: p, ...m }, h) => {
1267
- let { useTransitions: g } = n.useContext(F), _ = tn(), v = nn(c, { relative: u }), y = s.toLowerCase() === "get" ? "get" : "post", b = typeof c == "string" && Ut.test(c);
1268
- return /* @__PURE__ */ n.createElement("form", {
1269
- ref: h,
1270
- method: y,
1271
- action: v,
1272
- onSubmit: i ? l : (e) => {
1273
- if (l && l(e), e.defaultPrevented) return;
1274
- e.preventDefault();
1275
- let i = e.nativeEvent.submitter, c = i?.getAttribute("formmethod") || s, m = () => _(i || e.currentTarget, {
1276
- fetcherKey: t,
1277
- method: c,
1278
- navigate: r,
1279
- replace: a,
1280
- state: o,
1281
- relative: u,
1282
- preventScrollReset: d,
1283
- viewTransition: f,
1284
- defaultShouldRevalidate: p
1285
- });
1286
- g && r !== !1 ? n.startTransition(() => m()) : m();
1287
- },
1288
- ...m,
1289
- "data-discover": !b && e === "render" ? "true" : void 0
1290
- });
1291
- });
1292
- Kt.displayName = "Form";
1293
- function qt({ getKey: e, storageKey: t, ...r }) {
1294
- let i = n.useContext(Z), { basename: a } = n.useContext(F), o = B(), s = Ze();
1295
- on({
1296
- getKey: e,
1297
- storageKey: t
1298
- });
1299
- let c = n.useMemo(() => {
1300
- if (!i || !e) return null;
1301
- let t = an(o, s, a, e);
1302
- return t === o.key ? null : t;
1303
- }, []);
1304
- if (!i || i.isSpaMode) return null;
1305
- let l = ((e, t) => {
1306
- if (!window.history.state || !window.history.state.key) {
1307
- let e = Math.random().toString(32).slice(2);
1308
- window.history.replaceState({ key: e }, "");
1309
- }
1310
- try {
1311
- let n = JSON.parse(sessionStorage.getItem(e) || "{}")[t || window.history.state.key];
1312
- typeof n == "number" && window.scrollTo(0, n);
1313
- } catch (t) {
1314
- console.error(t), sessionStorage.removeItem(e);
1315
- }
1316
- }).toString();
1317
- return /* @__PURE__ */ n.createElement("script", {
1318
- ...r,
1319
- suppressHydrationWarning: !0,
1320
- dangerouslySetInnerHTML: { __html: `(${l})(${bt(JSON.stringify(t || rn))}, ${bt(JSON.stringify(c))})` }
1321
- });
1322
- }
1323
- qt.displayName = "ScrollRestoration";
1324
- function Jt(e) {
1325
- return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1326
- }
1327
- function Yt(e) {
1328
- let t = n.useContext(N);
1329
- return o(t, Jt(e)), t;
1330
- }
1331
- function Xt(e) {
1332
- let t = n.useContext(P);
1333
- return o(t, Jt(e)), t;
1334
- }
1335
- function Zt(e, { target: t, replace: r, mask: i, state: a, preventScrollReset: o, relative: s, viewTransition: c, defaultShouldRevalidate: l, useTransitions: u } = {}) {
1336
- let f = V(), p = B(), m = H(e, { relative: s });
1337
- return n.useCallback((h) => {
1338
- if (dt(h, t)) {
1339
- h.preventDefault();
1340
- let t = r === void 0 ? d(p) === d(m) : r, g = () => f(e, {
1341
- replace: t,
1342
- mask: i,
1343
- state: a,
1344
- preventScrollReset: o,
1345
- relative: s,
1346
- viewTransition: c,
1347
- defaultShouldRevalidate: l
1348
- });
1349
- u ? n.startTransition(() => g()) : g();
1350
- }
1351
- }, [
1352
- p,
1353
- f,
1354
- m,
1355
- r,
1356
- i,
1357
- a,
1358
- t,
1359
- e,
1360
- o,
1361
- s,
1362
- c,
1363
- l,
1364
- u
1365
- ]);
1366
- }
1367
- function Qt(e) {
1368
- s(typeof URLSearchParams < "u", "You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");
1369
- let t = n.useRef(ft(e)), r = n.useRef(!1), i = B(), a = n.useMemo(() => pt(i.search, r.current ? null : t.current), [i.search]), o = V();
1370
- return [a, n.useCallback((e, t) => {
1371
- let n = ft(typeof e == "function" ? e(new URLSearchParams(a)) : e);
1372
- r.current = !0, o("?" + n, t);
1373
- }, [o, a])];
1374
- }
1375
- var $t = 0, en = () => `__${String(++$t)}__`;
1376
- function tn() {
1377
- let { router: e } = Yt("useSubmit"), { basename: t } = n.useContext(F), r = Ye(), i = e.fetch, a = e.navigate;
1378
- return n.useCallback(async (e, n = {}) => {
1379
- let { action: o, method: s, encType: c, formData: l, body: u } = _t(e, t);
1380
- n.navigate === !1 ? await i(n.fetcherKey || en(), r, n.action || o, {
1381
- defaultShouldRevalidate: n.defaultShouldRevalidate,
1382
- preventScrollReset: n.preventScrollReset,
1383
- formData: l,
1384
- body: u,
1385
- formMethod: n.method || s,
1386
- formEncType: n.encType || c,
1387
- flushSync: n.flushSync
1388
- }) : await a(n.action || o, {
1389
- defaultShouldRevalidate: n.defaultShouldRevalidate,
1390
- preventScrollReset: n.preventScrollReset,
1391
- formData: l,
1392
- body: u,
1393
- formMethod: n.method || s,
1394
- formEncType: n.encType || c,
1395
- replace: n.replace,
1396
- state: n.state,
1397
- fromRouteId: r,
1398
- flushSync: n.flushSync,
1399
- viewTransition: n.viewTransition
1400
- });
1401
- }, [
1402
- i,
1403
- a,
1404
- t,
1405
- r
1406
- ]);
1407
- }
1408
- function nn(e, { relative: t } = {}) {
1409
- let { basename: r } = n.useContext(F), i = n.useContext(L);
1410
- o(i, "useFormAction must be used inside a RouteContext");
1411
- let [a] = i.matches.slice(-1), s = { ...H(e || ".", { relative: t }) }, c = B();
1412
- if (e == null) {
1413
- s.search = c.search;
1414
- let e = new URLSearchParams(s.search), t = e.getAll("index");
1415
- if (t.some((e) => e === "")) {
1416
- e.delete("index"), t.filter((e) => e).forEach((t) => e.append("index", t));
1417
- let n = e.toString();
1418
- s.search = n ? `?${n}` : "";
1419
- }
1420
- }
1421
- return (!e || e === ".") && a.route.index && (s.search = s.search ? s.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (s.pathname = s.pathname === "/" ? r : j([r, s.pathname])), d(s);
1422
- }
1423
- var rn = "react-router-scroll-positions", $ = {};
1424
- function an(e, t, n, r) {
1425
- let i = null;
1426
- return r && (i = r(n === "/" ? e : {
1427
- ...e,
1428
- pathname: k(e.pathname, n) || e.pathname
1429
- }, t)), i ??= e.key, i;
1430
- }
1431
- function on({ getKey: e, storageKey: t } = {}) {
1432
- let { router: r } = Yt("useScrollRestoration"), { restoreScrollPosition: i, preventScrollReset: a } = Xt("useScrollRestoration"), { basename: o } = n.useContext(F), c = B(), l = Ze(), u = Xe();
1433
- n.useEffect(() => (window.history.scrollRestoration = "manual", () => {
1434
- window.history.scrollRestoration = "auto";
1435
- }), []), sn(n.useCallback(() => {
1436
- if (u.state === "idle") {
1437
- let t = an(c, l, o, e);
1438
- $[t] = window.scrollY;
1439
- }
1440
- try {
1441
- sessionStorage.setItem(t || rn, JSON.stringify($));
1442
- } catch (e) {
1443
- s(!1, `Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`);
1444
- }
1445
- window.history.scrollRestoration = "auto";
1446
- }, [
1447
- u.state,
1448
- e,
1449
- o,
1450
- c,
1451
- l,
1452
- t
1453
- ])), typeof document < "u" && (n.useLayoutEffect(() => {
1454
- try {
1455
- let e = sessionStorage.getItem(t || rn);
1456
- e && ($ = JSON.parse(e));
1457
- } catch {}
1458
- }, [t]), n.useLayoutEffect(() => {
1459
- let t = r?.enableScrollRestoration($, () => window.scrollY, e ? (t, n) => an(t, n, o, e) : void 0);
1460
- return () => t && t();
1461
- }, [
1462
- r,
1463
- o,
1464
- e
1465
- ]), n.useLayoutEffect(() => {
1466
- if (i !== !1) {
1467
- if (typeof i == "number") {
1468
- window.scrollTo(0, i);
1469
- return;
1470
- }
1471
- try {
1472
- if (c.hash) {
1473
- let e = document.getElementById(decodeURIComponent(c.hash.slice(1)));
1474
- if (e) {
1475
- e.scrollIntoView();
1476
- return;
1477
- }
1478
- }
1479
- } catch {
1480
- s(!1, `"${c.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`);
1481
- }
1482
- a !== !0 && window.scrollTo(0, 0);
1483
- }
1484
- }, [
1485
- c,
1486
- i,
1487
- a
1488
- ]));
1489
- }
1490
- function sn(e, t) {
1491
- let { capture: r } = t || {};
1492
- n.useEffect(() => {
1493
- let t = r == null ? void 0 : { capture: r };
1494
- return window.addEventListener("pagehide", e, t), () => {
1495
- window.removeEventListener("pagehide", e, t);
1496
- };
1497
- }, [e, r]);
1498
- }
1499
- function cn(e, { relative: t } = {}) {
1500
- let r = n.useContext(Te);
1501
- o(r != null, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");
1502
- let { basename: i } = Yt("useViewTransitionState"), a = H(e, { relative: t });
1503
- if (!r.isTransitioning) return !1;
1504
- let s = k(r.currentLocation.pathname, i) || r.currentLocation.pathname, c = k(r.nextLocation.pathname, i) || r.nextLocation.pathname;
1505
- return O(a.pathname, c) != null || O(a.pathname, s) != null;
1506
- }
1507
- //#endregion
1508
- export { B as a, Qt as c, at as i, Wt as n, V as o, rt as r, Le as s, Vt as t };