zudoku 0.0.0-reset-hash-value.ac516c6d → 0.0.0-z179c4f85

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 (818) hide show
  1. package/client.d.ts +8 -0
  2. package/dist/app/entry.server.js +14 -1
  3. package/dist/app/entry.server.js.map +1 -1
  4. package/dist/app/main.d.ts +91 -1
  5. package/dist/app/main.js +5 -1
  6. package/dist/app/main.js.map +1 -1
  7. package/dist/app/sentry.js +1 -1
  8. package/dist/cli/common/version-check.js +12 -3
  9. package/dist/cli/common/version-check.js.map +1 -1
  10. package/dist/config/config.d.ts +15 -44
  11. package/dist/config/validators/BuildSchema.d.ts +5 -4
  12. package/dist/config/validators/BuildSchema.js +23 -5
  13. package/dist/config/validators/BuildSchema.js.map +1 -1
  14. package/dist/config/validators/InputNavigationSchema.d.ts +83 -81
  15. package/dist/config/validators/InputNavigationSchema.js +1 -0
  16. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  17. package/dist/config/validators/NavigationSchema.js +8 -5
  18. package/dist/config/validators/NavigationSchema.js.map +1 -1
  19. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  20. package/dist/config/validators/validate.d.ts +243 -20
  21. package/dist/config/validators/validate.js +52 -10
  22. package/dist/config/validators/validate.js.map +1 -1
  23. package/dist/config/validators/validate.test.js +43 -0
  24. package/dist/config/validators/validate.test.js.map +1 -1
  25. package/dist/flat-config.d.ts +39 -4
  26. package/dist/index.d.ts +2 -1
  27. package/dist/index.js +2 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/lib/auth/issuer.js +3 -0
  30. package/dist/lib/auth/issuer.js.map +1 -1
  31. package/dist/lib/authentication/authentication.d.ts +19 -10
  32. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  33. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  34. package/dist/lib/authentication/components/OAuthErrorPage.js +1 -1
  35. package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -1
  36. package/dist/lib/authentication/components/SignIn.js +8 -5
  37. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  38. package/dist/lib/authentication/components/SignOut.js +6 -6
  39. package/dist/lib/authentication/components/SignOut.js.map +1 -1
  40. package/dist/lib/authentication/components/SignUp.js +7 -5
  41. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  42. package/dist/lib/authentication/hook.d.ts +5 -2
  43. package/dist/lib/authentication/hook.js +22 -8
  44. package/dist/lib/authentication/hook.js.map +1 -1
  45. package/dist/lib/authentication/providers/auth0.js +18 -9
  46. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  47. package/dist/lib/authentication/providers/azureb2c.d.ts +4 -4
  48. package/dist/lib/authentication/providers/azureb2c.js +3 -3
  49. package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
  50. package/dist/lib/authentication/providers/clerk.js +2 -24
  51. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  52. package/dist/lib/authentication/providers/firebase.d.ts +4 -0
  53. package/dist/lib/authentication/providers/firebase.js +273 -0
  54. package/dist/lib/authentication/providers/firebase.js.map +1 -0
  55. package/dist/lib/authentication/providers/openid.d.ts +7 -7
  56. package/dist/lib/authentication/providers/openid.js +3 -3
  57. package/dist/lib/authentication/providers/openid.js.map +1 -1
  58. package/dist/lib/authentication/providers/supabase/SupabaseAuthUI.d.ts +8 -0
  59. package/dist/lib/authentication/providers/supabase/SupabaseAuthUI.js +39 -0
  60. package/dist/lib/authentication/providers/supabase/SupabaseAuthUI.js.map +1 -0
  61. package/dist/lib/authentication/providers/supabase.js +36 -46
  62. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  63. package/dist/lib/authentication/state.d.ts +1 -5
  64. package/dist/lib/authentication/state.js +2 -14
  65. package/dist/lib/authentication/state.js.map +1 -1
  66. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  67. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  68. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  69. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +29 -0
  70. package/dist/lib/authentication/ui/ZudokuAuthUi.js +160 -0
  71. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -0
  72. package/dist/lib/authentication/ui/icons/Apple.d.ts +3 -0
  73. package/dist/lib/authentication/ui/icons/Apple.js +4 -0
  74. package/dist/lib/authentication/ui/icons/Apple.js.map +1 -0
  75. package/dist/lib/authentication/ui/icons/Facebook.d.ts +3 -0
  76. package/dist/lib/authentication/ui/icons/Facebook.js +4 -0
  77. package/dist/lib/authentication/ui/icons/Facebook.js.map +1 -0
  78. package/dist/lib/authentication/ui/icons/Github.d.ts +3 -0
  79. package/dist/lib/authentication/ui/icons/Github.js +4 -0
  80. package/dist/lib/authentication/ui/icons/Github.js.map +1 -0
  81. package/dist/lib/authentication/ui/icons/Google.d.ts +3 -0
  82. package/dist/lib/authentication/ui/icons/Google.js +4 -0
  83. package/dist/lib/authentication/ui/icons/Google.js.map +1 -0
  84. package/dist/lib/authentication/ui/icons/Microsoft.d.ts +3 -0
  85. package/dist/lib/authentication/ui/icons/Microsoft.js +4 -0
  86. package/dist/lib/authentication/ui/icons/Microsoft.js.map +1 -0
  87. package/dist/lib/authentication/ui/icons/X.d.ts +3 -0
  88. package/dist/lib/authentication/ui/icons/X.js +4 -0
  89. package/dist/lib/authentication/ui/icons/X.js.map +1 -0
  90. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  91. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  92. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  93. package/dist/lib/components/Autocomplete.d.ts +3 -1
  94. package/dist/lib/components/Autocomplete.js +6 -2
  95. package/dist/lib/components/Autocomplete.js.map +1 -1
  96. package/dist/lib/components/Heading.d.ts +1 -1
  97. package/dist/lib/components/Layout.js +3 -2
  98. package/dist/lib/components/Layout.js.map +1 -1
  99. package/dist/lib/components/Mermaid.d.ts +7 -0
  100. package/dist/lib/components/Mermaid.js +42 -0
  101. package/dist/lib/components/Mermaid.js.map +1 -0
  102. package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
  103. package/dist/lib/components/PagefindSearchMeta.js +7 -0
  104. package/dist/lib/components/PagefindSearchMeta.js.map +1 -0
  105. package/dist/lib/components/Pagination.js +2 -2
  106. package/dist/lib/components/Pagination.js.map +1 -1
  107. package/dist/lib/components/Zudoku.js +5 -8
  108. package/dist/lib/components/Zudoku.js.map +1 -1
  109. package/dist/lib/components/index.d.ts +7 -2
  110. package/dist/lib/components/index.js +4 -0
  111. package/dist/lib/components/index.js.map +1 -1
  112. package/dist/lib/components/navigation/NavigationItem.js +4 -4
  113. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  114. package/dist/lib/components/navigation/Toc.js +1 -1
  115. package/dist/lib/components/navigation/Toc.js.map +1 -1
  116. package/dist/lib/core/RouteGuard.d.ts +1 -1
  117. package/dist/lib/core/RouteGuard.js +22 -25
  118. package/dist/lib/core/RouteGuard.js.map +1 -1
  119. package/dist/lib/core/ZudokuContext.d.ts +1 -0
  120. package/dist/lib/core/ZudokuContext.js +2 -0
  121. package/dist/lib/core/ZudokuContext.js.map +1 -1
  122. package/dist/lib/core/__internal.d.ts +1 -1
  123. package/dist/lib/core/plugins.d.ts +3 -3
  124. package/dist/lib/core/react-query.d.ts +1 -0
  125. package/dist/lib/core/react-query.js +2 -0
  126. package/dist/lib/core/react-query.js.map +1 -0
  127. package/dist/lib/errors/ErrorAlert.js +1 -1
  128. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  129. package/dist/lib/errors/ErrorMessage.js +16 -0
  130. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  131. package/dist/lib/errors/RouterError.d.ts +3 -1
  132. package/dist/lib/errors/RouterError.js +3 -2
  133. package/dist/lib/errors/RouterError.js.map +1 -1
  134. package/dist/lib/hooks/index.d.ts +4 -2
  135. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  136. package/dist/lib/oas/graphql/circular.js +32 -10
  137. package/dist/lib/oas/graphql/circular.js.map +1 -1
  138. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  139. package/dist/lib/oas/graphql/circular.test.js +152 -0
  140. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  141. package/dist/lib/oas/graphql/index.js +7 -3
  142. package/dist/lib/oas/graphql/index.js.map +1 -1
  143. package/dist/lib/oas/parser/index.d.ts +1 -0
  144. package/dist/lib/oas/parser/index.js +7 -3
  145. package/dist/lib/oas/parser/index.js.map +1 -1
  146. package/dist/lib/plugins/api-keys/ProtectedRoute.js +4 -1
  147. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
  148. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  149. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  150. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  151. package/dist/lib/plugins/api-keys/index.js +36 -22
  152. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  153. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  154. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  155. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  156. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  157. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  158. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  159. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  160. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  161. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  162. package/dist/lib/plugins/markdown/MdxPage.d.ts +2 -1
  163. package/dist/lib/plugins/markdown/MdxPage.js +3 -2
  164. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  165. package/dist/lib/plugins/markdown/index.d.ts +1 -0
  166. package/dist/lib/plugins/markdown/index.js +1 -1
  167. package/dist/lib/plugins/markdown/index.js.map +1 -1
  168. package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +1 -0
  169. package/dist/lib/plugins/openapi/CollapsibleCode.js +2 -1
  170. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
  171. package/dist/lib/plugins/openapi/DownloadSchemaButton.d.ts +3 -0
  172. package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
  173. package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
  174. package/dist/lib/plugins/openapi/Endpoint.js +3 -6
  175. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  176. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.d.ts +5 -0
  177. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +10 -0
  178. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js.map +1 -0
  179. package/dist/lib/plugins/openapi/OasProvider.js +22 -13
  180. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  181. package/dist/lib/plugins/openapi/OperationList.js +20 -6
  182. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  183. package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
  184. package/dist/lib/plugins/openapi/OperationListItem.js +4 -3
  185. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  186. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  187. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  188. package/dist/lib/plugins/openapi/ParameterList.js +7 -4
  189. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  190. package/dist/lib/plugins/openapi/ParameterListItem.js +17 -6
  191. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  192. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +9 -2
  193. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +5 -2
  194. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  195. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +4 -2
  196. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +26 -4
  197. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  198. package/dist/lib/plugins/openapi/SchemaList.js +2 -1
  199. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
  200. package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -2
  201. package/dist/lib/plugins/openapi/Sidecar.js +64 -28
  202. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  203. package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
  204. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  205. package/dist/lib/plugins/openapi/SidecarExamples.d.ts +9 -2
  206. package/dist/lib/plugins/openapi/SidecarExamples.js +24 -43
  207. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  208. package/dist/lib/plugins/openapi/components/ConstValue.js +1 -1
  209. package/dist/lib/plugins/openapi/components/ConstValue.js.map +1 -1
  210. package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
  211. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
  212. package/dist/lib/plugins/openapi/components/NonHighlightedCode.d.ts +4 -0
  213. package/dist/lib/plugins/openapi/components/NonHighlightedCode.js +5 -0
  214. package/dist/lib/plugins/openapi/components/NonHighlightedCode.js.map +1 -0
  215. package/dist/lib/plugins/openapi/components/ResponseContent.js +5 -6
  216. package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -1
  217. package/dist/lib/plugins/openapi/index.js +15 -14
  218. package/dist/lib/plugins/openapi/index.js.map +1 -1
  219. package/dist/lib/plugins/openapi/interfaces.d.ts +29 -13
  220. package/dist/lib/plugins/openapi/playground/BodyPanel.js +67 -15
  221. package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
  222. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +2 -2
  223. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -1
  224. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -1
  225. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  226. package/dist/lib/plugins/openapi/playground/Headers.js +23 -83
  227. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  228. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +10 -2
  229. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +8 -1
  230. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  231. package/dist/lib/plugins/openapi/playground/PathParams.js +2 -3
  232. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  233. package/dist/lib/plugins/openapi/playground/Playground.d.ts +7 -0
  234. package/dist/lib/plugins/openapi/playground/Playground.js +70 -28
  235. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  236. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -2
  237. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  238. package/dist/lib/plugins/openapi/playground/QueryParams.js +16 -40
  239. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  240. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +2 -1
  241. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +10 -2
  242. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -1
  243. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.d.ts +8 -0
  244. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js +19 -0
  245. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js.map +1 -0
  246. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +1 -1
  247. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -1
  248. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.d.ts +1 -0
  249. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js +540 -0
  250. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js.map +1 -0
  251. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.d.ts +40 -0
  252. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js +205 -0
  253. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js.map +1 -0
  254. package/dist/lib/plugins/openapi/playground/result-panel/Highlight.d.ts +1 -1
  255. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js +1 -1
  256. package/dist/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.js.map +1 -1
  257. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +23 -21
  258. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  259. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +1 -1
  260. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  261. package/dist/lib/plugins/openapi/playground/useRememberSkipLoginDialog.js +2 -0
  262. package/dist/lib/plugins/openapi/playground/useRememberSkipLoginDialog.js.map +1 -1
  263. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +1 -1
  264. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  265. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +17 -8
  266. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  267. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
  268. package/dist/lib/plugins/openapi/schema/SchemaView.js +31 -16
  269. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  270. package/dist/lib/plugins/openapi/schema/UnionView.js +2 -5
  271. package/dist/lib/plugins/openapi/schema/UnionView.js.map +1 -1
  272. package/dist/lib/plugins/openapi/schema/union-helpers.js +0 -1
  273. package/dist/lib/plugins/openapi/schema/union-helpers.js.map +1 -1
  274. package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
  275. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  276. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  277. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  278. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  279. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +9 -11
  280. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  281. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +6 -1
  282. package/dist/lib/plugins/openapi/util/getRoutes.js +29 -2
  283. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  284. package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
  285. package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
  286. package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
  287. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
  288. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  289. package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
  290. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  291. package/dist/lib/shiki.d.ts +2 -2
  292. package/dist/lib/shiki.js +31 -14
  293. package/dist/lib/shiki.js.map +1 -1
  294. package/dist/lib/ui/Badge.d.ts +3 -3
  295. package/dist/lib/ui/Badge.js +9 -7
  296. package/dist/lib/ui/Badge.js.map +1 -1
  297. package/dist/lib/ui/Button.d.ts +2 -2
  298. package/dist/lib/ui/Button.js +10 -8
  299. package/dist/lib/ui/Button.js.map +1 -1
  300. package/dist/lib/ui/ButtonGroup.d.ts +11 -0
  301. package/dist/lib/ui/ButtonGroup.js +28 -0
  302. package/dist/lib/ui/ButtonGroup.js.map +1 -0
  303. package/dist/lib/ui/Callout.d.ts +5 -5
  304. package/dist/lib/ui/Callout.js +5 -5
  305. package/dist/lib/ui/Callout.js.map +1 -1
  306. package/dist/lib/ui/Checkbox.d.ts +2 -2
  307. package/dist/lib/ui/Checkbox.js +4 -4
  308. package/dist/lib/ui/Checkbox.js.map +1 -1
  309. package/dist/lib/ui/CodeBlock.d.ts +0 -1
  310. package/dist/lib/ui/CodeBlock.js +1 -1
  311. package/dist/lib/ui/CodeBlock.js.map +1 -1
  312. package/dist/lib/ui/Collapsible.d.ts +4 -4
  313. package/dist/lib/ui/Collapsible.js +11 -4
  314. package/dist/lib/ui/Collapsible.js.map +1 -1
  315. package/dist/lib/ui/Command.d.ts +3 -3
  316. package/dist/lib/ui/Command.js +2 -2
  317. package/dist/lib/ui/Command.js.map +1 -1
  318. package/dist/lib/ui/Dialog.d.ts +12 -18
  319. package/dist/lib/ui/Dialog.js +30 -17
  320. package/dist/lib/ui/Dialog.js.map +1 -1
  321. package/dist/lib/ui/DropdownMenu.d.ts +21 -23
  322. package/dist/lib/ui/DropdownMenu.js +47 -32
  323. package/dist/lib/ui/DropdownMenu.js.map +1 -1
  324. package/dist/lib/ui/EmbeddedCodeBlock.d.ts +3 -2
  325. package/dist/lib/ui/EmbeddedCodeBlock.js +4 -3
  326. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  327. package/dist/lib/ui/Frame.d.ts +8 -0
  328. package/dist/lib/ui/Frame.js +22 -0
  329. package/dist/lib/ui/Frame.js.map +1 -0
  330. package/dist/lib/ui/Item.d.ts +23 -0
  331. package/dist/lib/ui/Item.js +67 -0
  332. package/dist/lib/ui/Item.js.map +1 -0
  333. package/dist/lib/ui/Kbd.d.ts +3 -0
  334. package/dist/lib/ui/Kbd.js +10 -0
  335. package/dist/lib/ui/Kbd.js.map +1 -0
  336. package/dist/lib/ui/NativeSelect.d.ts +5 -0
  337. package/dist/lib/ui/NativeSelect.js +14 -0
  338. package/dist/lib/ui/NativeSelect.js.map +1 -0
  339. package/dist/lib/ui/ReactComponentDoc.d.ts +1 -1
  340. package/dist/lib/ui/ReactComponentDoc.js +2 -2
  341. package/dist/lib/ui/ReactComponentDoc.js.map +1 -1
  342. package/dist/lib/ui/Select.d.ts +13 -11
  343. package/dist/lib/ui/Select.js +34 -23
  344. package/dist/lib/ui/Select.js.map +1 -1
  345. package/dist/lib/ui/Separator.d.ts +4 -0
  346. package/dist/lib/ui/Separator.js +8 -0
  347. package/dist/lib/ui/Separator.js.map +1 -0
  348. package/dist/lib/ui/SyntaxHighlight.d.ts +1 -0
  349. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  350. package/dist/lib/ui/Tooltip.d.ts +7 -7
  351. package/dist/lib/ui/Tooltip.js +16 -10
  352. package/dist/lib/ui/Tooltip.js.map +1 -1
  353. package/dist/lib/util/MdxComponents.d.ts +3 -1
  354. package/dist/lib/util/MdxComponents.js +5 -2
  355. package/dist/lib/util/MdxComponents.js.map +1 -1
  356. package/dist/lib/util/createVariantComponent.d.ts +5 -2
  357. package/dist/lib/util/createVariantComponent.js +5 -2
  358. package/dist/lib/util/createVariantComponent.js.map +1 -1
  359. package/dist/lib/util/flattenAllOf.d.ts +4 -0
  360. package/dist/lib/util/flattenAllOf.js +88 -0
  361. package/dist/lib/util/flattenAllOf.js.map +1 -0
  362. package/dist/lib/util/flattenAllOf.test.d.ts +1 -0
  363. package/dist/lib/util/flattenAllOf.test.js +587 -0
  364. package/dist/lib/util/flattenAllOf.test.js.map +1 -0
  365. package/dist/lib/util/invariant.d.ts +1 -1
  366. package/dist/lib/util/invariant.js +2 -2
  367. package/dist/lib/util/invariant.js.map +1 -1
  368. package/dist/lib/util/readFrontmatter.d.ts +6 -0
  369. package/dist/lib/util/readFrontmatter.js +12 -0
  370. package/dist/lib/util/readFrontmatter.js.map +1 -0
  371. package/dist/lib/util/syncZustandState.d.ts +5 -0
  372. package/dist/lib/util/syncZustandState.js +14 -0
  373. package/dist/lib/util/syncZustandState.js.map +1 -0
  374. package/dist/vite/api/SchemaManager.d.ts +9 -1
  375. package/dist/vite/api/SchemaManager.js +58 -21
  376. package/dist/vite/api/SchemaManager.js.map +1 -1
  377. package/dist/vite/api/SchemaManager.test.js +69 -2
  378. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  379. package/dist/vite/config.js +13 -1
  380. package/dist/vite/config.js.map +1 -1
  381. package/dist/vite/dev-server.js +25 -0
  382. package/dist/vite/dev-server.js.map +1 -1
  383. package/dist/vite/error-handler.js +1 -5
  384. package/dist/vite/error-handler.js.map +1 -1
  385. package/dist/vite/mdx/remark-last-modified.js +57 -3
  386. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  387. package/dist/vite/mdx/remark-link-rewrite.js +1 -1
  388. package/dist/vite/pagefind-dev-index.d.ts +16 -0
  389. package/dist/vite/pagefind-dev-index.js +68 -0
  390. package/dist/vite/pagefind-dev-index.js.map +1 -0
  391. package/dist/vite/plugin-api-keys.js +5 -1
  392. package/dist/vite/plugin-api-keys.js.map +1 -1
  393. package/dist/vite/plugin-api.js +55 -8
  394. package/dist/vite/plugin-api.js.map +1 -1
  395. package/dist/vite/plugin-docs.js +1 -1
  396. package/dist/vite/plugin-docs.js.map +1 -1
  397. package/dist/vite/plugin-frontmatter.js +3 -5
  398. package/dist/vite/plugin-frontmatter.js.map +1 -1
  399. package/dist/vite/plugin-markdown-export.js +8 -7
  400. package/dist/vite/plugin-markdown-export.js.map +1 -1
  401. package/dist/vite/plugin-mdx.js +36 -30
  402. package/dist/vite/plugin-mdx.js.map +1 -1
  403. package/dist/vite/plugin-theme.js +10 -1
  404. package/dist/vite/plugin-theme.js.map +1 -1
  405. package/dist/vite/prerender/prerender.js +1 -19
  406. package/dist/vite/prerender/prerender.js.map +1 -1
  407. package/dist/vite/prerender/utils.d.ts +2 -0
  408. package/dist/vite/prerender/utils.js +30 -0
  409. package/dist/vite/prerender/utils.js.map +1 -0
  410. package/dist/vite/prerender/worker.js +3 -0
  411. package/dist/vite/prerender/worker.js.map +1 -1
  412. package/dist/vite/zuplo.d.ts +13 -0
  413. package/dist/vite/zuplo.js +15 -0
  414. package/dist/vite/zuplo.js.map +1 -0
  415. package/lib/ActionButton-B0CXL1Lq.js +25 -0
  416. package/lib/ActionButton-B0CXL1Lq.js.map +1 -0
  417. package/lib/Button-GUVe7pmt.js +54 -0
  418. package/lib/Button-GUVe7pmt.js.map +1 -0
  419. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  420. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  421. package/lib/ClaudeLogo-DHxJUhN_.js +69 -0
  422. package/lib/ClaudeLogo-DHxJUhN_.js.map +1 -0
  423. package/lib/{Command-CJY6q3PF.js → Command-N6VujV30.js} +26 -26
  424. package/lib/Command-N6VujV30.js.map +1 -0
  425. package/lib/Dialog-hlvmmQ_c.js +144 -0
  426. package/lib/Dialog-hlvmmQ_c.js.map +1 -0
  427. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  428. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  429. package/lib/DropdownMenu-DN0jNrjj.js +104 -0
  430. package/lib/DropdownMenu-DN0jNrjj.js.map +1 -0
  431. package/lib/Frame-DKlOmSkU.js +205 -0
  432. package/lib/Frame-DKlOmSkU.js.map +1 -0
  433. package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
  434. package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
  435. package/lib/IndexingDialog-D0YdGfbn.js +100 -0
  436. package/lib/IndexingDialog-D0YdGfbn.js.map +1 -0
  437. package/lib/Input-Cx-GeKoF.js +22 -0
  438. package/lib/Input-Cx-GeKoF.js.map +1 -0
  439. package/lib/MdxPage-CD36PJ17.js +210 -0
  440. package/lib/MdxPage-CD36PJ17.js.map +1 -0
  441. package/lib/Mermaid-Koc3z8mU.js +102 -0
  442. package/lib/Mermaid-Koc3z8mU.js.map +1 -0
  443. package/lib/{OAuthErrorPage-DJUOdr6Q.js → OAuthErrorPage-4mN5DA86.js} +16 -16
  444. package/lib/OAuthErrorPage-4mN5DA86.js.map +1 -0
  445. package/lib/OasProvider-DSe-hk5Y.js +40 -0
  446. package/lib/OasProvider-DSe-hk5Y.js.map +1 -0
  447. package/lib/OperationList-CaknPbvq.js +5823 -0
  448. package/lib/OperationList-CaknPbvq.js.map +1 -0
  449. package/lib/RouteGuard--A04ESy8.js +77 -0
  450. package/lib/RouteGuard--A04ESy8.js.map +1 -0
  451. package/lib/{SchemaList-1eLKXqn8.js → SchemaList-Dw3-CJPb.js} +28 -27
  452. package/lib/SchemaList-Dw3-CJPb.js.map +1 -0
  453. package/lib/SchemaView-DyJkiQkD.js +438 -0
  454. package/lib/SchemaView-DyJkiQkD.js.map +1 -0
  455. package/lib/Secret-BDBqq4p3.js +243 -0
  456. package/lib/Secret-BDBqq4p3.js.map +1 -0
  457. package/lib/Separator-BXt1LYnm.js +27 -0
  458. package/lib/Separator-BXt1LYnm.js.map +1 -0
  459. package/lib/SignUp-DRvN-8cq.js +50 -0
  460. package/lib/SignUp-DRvN-8cq.js.map +1 -0
  461. package/lib/{SyntaxHighlight-B0laqAqK.js → SyntaxHighlight-klTH8c6-.js} +1781 -1697
  462. package/lib/SyntaxHighlight-klTH8c6-.js.map +1 -0
  463. package/lib/{Toc-KzXCRqrX.js → Toc-PbuF-u9x.js} +6 -6
  464. package/lib/Toc-PbuF-u9x.js.map +1 -0
  465. package/lib/ZudokuContext-BZB1TWdT.js +387 -0
  466. package/lib/ZudokuContext-BZB1TWdT.js.map +1 -0
  467. package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js +9 -0
  468. package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +1 -0
  469. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  470. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  471. package/lib/{circular-D6wbrxuf.js → circular-DFquXeY2.js} +6459 -6030
  472. package/lib/circular-DFquXeY2.js.map +1 -0
  473. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  474. package/lib/cn-5-Gd1Dss.js.map +1 -0
  475. package/lib/createServer-BXZ0CAUn.js +16693 -0
  476. package/lib/createServer-BXZ0CAUn.js.map +1 -0
  477. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  478. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  479. package/lib/{errors-XqO6MsfU.js → errors-rWHkzVTd.js} +3 -3
  480. package/lib/{errors-XqO6MsfU.js.map → errors-rWHkzVTd.js.map} +1 -1
  481. package/lib/firebase-BmGU1FuD.js +7614 -0
  482. package/lib/firebase-BmGU1FuD.js.map +1 -0
  483. package/lib/hook-BGlHBdET.js +52 -0
  484. package/lib/hook-BGlHBdET.js.map +1 -0
  485. package/lib/{ErrorAlert-VBJ8aHH7.js → index-BDsEwofZ.js} +5503 -4505
  486. package/lib/index-BDsEwofZ.js.map +1 -0
  487. package/lib/index-BQB9hb6n.js +3677 -0
  488. package/lib/index-BQB9hb6n.js.map +1 -0
  489. package/lib/index-CrcNWbel.js.map +1 -1
  490. package/lib/index-DBjOT2H1.js +133 -0
  491. package/lib/index-DBjOT2H1.js.map +1 -0
  492. package/lib/{index-C5L4favO.js → index-DRBOFufT.js} +2 -2
  493. package/lib/{index-C5L4favO.js.map → index-DRBOFufT.js.map} +1 -1
  494. package/lib/index.esm-BYObtETB.js.map +1 -1
  495. package/lib/{index.esm-BnYHxCYC.js → index.esm-B_0dvNjB.js} +20 -20
  496. package/lib/{index.esm-BnYHxCYC.js.map → index.esm-B_0dvNjB.js.map} +1 -1
  497. package/lib/index.esm-Cx8B1YJQ.js +34 -0
  498. package/lib/index.esm-Cx8B1YJQ.js.map +1 -0
  499. package/lib/{invariant-Bm-FVUQE.js → invariant-BJAl77rw.js} +6 -6
  500. package/lib/invariant-BJAl77rw.js.map +1 -0
  501. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  502. package/lib/{mutation-CdGPxHNX.js → mutation-BISOc7OM.js} +70 -44
  503. package/lib/mutation-BISOc7OM.js.map +1 -0
  504. package/lib/ui/Accordion.js +1 -1
  505. package/lib/ui/ActionButton.js +2 -2
  506. package/lib/ui/Alert.js +1 -1
  507. package/lib/ui/AlertDialog.js +1 -1
  508. package/lib/ui/Badge.js +27 -13
  509. package/lib/ui/Badge.js.map +1 -1
  510. package/lib/ui/Breadcrumb.js +1 -1
  511. package/lib/ui/Button.js +28 -25
  512. package/lib/ui/Button.js.map +1 -1
  513. package/lib/ui/ButtonGroup.js +77 -0
  514. package/lib/ui/ButtonGroup.js.map +1 -0
  515. package/lib/ui/Callout.js +19 -19
  516. package/lib/ui/Callout.js.map +1 -1
  517. package/lib/ui/Card.js +1 -1
  518. package/lib/ui/Carousel.js +1 -1
  519. package/lib/ui/Carousel.js.map +1 -1
  520. package/lib/ui/Checkbox.js +29 -26
  521. package/lib/ui/Checkbox.js.map +1 -1
  522. package/lib/ui/CodeBlock.js +217 -7
  523. package/lib/ui/CodeBlock.js.map +1 -1
  524. package/lib/ui/Collapsible.js +32 -5
  525. package/lib/ui/Collapsible.js.map +1 -1
  526. package/lib/ui/Command.js +5 -5
  527. package/lib/ui/Command.js.map +1 -1
  528. package/lib/ui/Dialog.js +136 -106
  529. package/lib/ui/Dialog.js.map +1 -1
  530. package/lib/ui/Drawer.js +3 -3
  531. package/lib/ui/DropdownMenu.js +227 -140
  532. package/lib/ui/DropdownMenu.js.map +1 -1
  533. package/lib/ui/EmbeddedCodeBlock.js +36 -32
  534. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  535. package/lib/ui/Form.js +1 -1
  536. package/lib/ui/Frame.js +81 -0
  537. package/lib/ui/Frame.js.map +1 -0
  538. package/lib/ui/HoverCard.js +1 -1
  539. package/lib/ui/Input.js +1 -1
  540. package/lib/ui/Item.js +188 -0
  541. package/lib/ui/Item.js.map +1 -0
  542. package/lib/ui/Kbd.js +32 -0
  543. package/lib/ui/Kbd.js.map +1 -0
  544. package/lib/ui/Label.js +1 -1
  545. package/lib/ui/NativeSelect.js +57 -0
  546. package/lib/ui/NativeSelect.js.map +1 -0
  547. package/lib/ui/Pagination.js +1 -1
  548. package/lib/ui/Popover.js +1 -1
  549. package/lib/ui/Progress.js +1 -1
  550. package/lib/ui/RadioGroup.js +1 -1
  551. package/lib/ui/ReactComponentDoc.js +13 -13
  552. package/lib/ui/ReactComponentDoc.js.map +1 -1
  553. package/lib/ui/ScrollArea.js +1 -1
  554. package/lib/ui/Secret.js +1 -1
  555. package/lib/ui/Select.js +166 -116
  556. package/lib/ui/Select.js.map +1 -1
  557. package/lib/ui/Separator.js +27 -0
  558. package/lib/ui/Separator.js.map +1 -0
  559. package/lib/ui/Skeleton.js +1 -1
  560. package/lib/ui/Slider.js +1 -1
  561. package/lib/ui/Switch.js +1 -1
  562. package/lib/ui/SyntaxHighlight.js +4 -4
  563. package/lib/ui/Tabs.js +11 -11
  564. package/lib/ui/Textarea.js +1 -1
  565. package/lib/ui/Toggle.js +1 -1
  566. package/lib/ui/ToggleGroup.js +1 -1
  567. package/lib/ui/Tooltip.js +55 -28
  568. package/lib/ui/Tooltip.js.map +1 -1
  569. package/lib/ui/Value.js +1 -1
  570. package/lib/ui/util.js +1 -1
  571. package/lib/useMutation-CFMGlAMW.js +119 -0
  572. package/lib/useMutation-CFMGlAMW.js.map +1 -0
  573. package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
  574. package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
  575. package/lib/zudoku.__internal.js +826 -1325
  576. package/lib/zudoku.__internal.js.map +1 -1
  577. package/lib/zudoku.auth-auth0.js +19 -19
  578. package/lib/zudoku.auth-auth0.js.map +1 -1
  579. package/lib/zudoku.auth-azureb2c.js +28 -28
  580. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  581. package/lib/zudoku.auth-clerk.js +41 -64
  582. package/lib/zudoku.auth-clerk.js.map +1 -1
  583. package/lib/zudoku.auth-firebase.js +10 -0
  584. package/lib/zudoku.auth-firebase.js.map +1 -0
  585. package/lib/zudoku.auth-openid.js +52 -55
  586. package/lib/zudoku.auth-openid.js.map +1 -1
  587. package/lib/zudoku.auth-supabase.js +107 -60
  588. package/lib/zudoku.auth-supabase.js.map +1 -1
  589. package/lib/zudoku.components.js +23 -21
  590. package/lib/zudoku.hooks.js +11 -24
  591. package/lib/zudoku.hooks.js.map +1 -1
  592. package/lib/zudoku.mermaid.js +10 -0
  593. package/lib/zudoku.mermaid.js.map +1 -0
  594. package/lib/zudoku.plugin-api-catalog.js +8 -8
  595. package/lib/zudoku.plugin-api-keys.js +607 -543
  596. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  597. package/lib/zudoku.plugin-custom-pages.js +1 -1
  598. package/lib/zudoku.plugin-markdown.js +10 -9
  599. package/lib/zudoku.plugin-markdown.js.map +1 -1
  600. package/lib/zudoku.plugin-openapi.js +6 -7
  601. package/lib/zudoku.plugin-openapi.js.map +1 -1
  602. package/lib/zudoku.plugin-redirect.js +1 -1
  603. package/lib/zudoku.plugin-search-pagefind.js +185 -226
  604. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  605. package/lib/zudoku.plugins.js.map +1 -1
  606. package/lib/zudoku.react-query.js +440 -0
  607. package/lib/zudoku.react-query.js.map +1 -0
  608. package/lib/zudoku.router.js +1130 -1404
  609. package/lib/zudoku.router.js.map +1 -1
  610. package/package.json +76 -45
  611. package/src/app/entry.server.tsx +16 -6
  612. package/src/app/main.css +61 -9
  613. package/src/app/main.tsx +5 -1
  614. package/src/app/sentry.ts +1 -1
  615. package/src/lib/auth/issuer.ts +3 -0
  616. package/src/lib/authentication/authentication.ts +29 -5
  617. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  618. package/src/lib/authentication/components/OAuthErrorPage.tsx +1 -1
  619. package/src/lib/authentication/components/SignIn.tsx +10 -5
  620. package/src/lib/authentication/components/SignOut.tsx +7 -6
  621. package/src/lib/authentication/components/SignUp.tsx +8 -8
  622. package/src/lib/authentication/hook.ts +37 -10
  623. package/src/lib/authentication/providers/auth0.tsx +23 -11
  624. package/src/lib/authentication/providers/azureb2c.tsx +10 -3
  625. package/src/lib/authentication/providers/clerk.tsx +9 -28
  626. package/src/lib/authentication/providers/firebase.tsx +376 -0
  627. package/src/lib/authentication/providers/openid.tsx +18 -15
  628. package/src/lib/authentication/providers/supabase/SupabaseAuthUI.tsx +75 -0
  629. package/src/lib/authentication/providers/supabase.tsx +61 -59
  630. package/src/lib/authentication/state.ts +3 -23
  631. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  632. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +477 -0
  633. package/src/lib/authentication/ui/icons/Apple.tsx +10 -0
  634. package/src/lib/authentication/ui/icons/Facebook.tsx +15 -0
  635. package/src/lib/authentication/ui/icons/Github.tsx +16 -0
  636. package/src/lib/authentication/ui/icons/Google.tsx +16 -0
  637. package/src/lib/authentication/ui/icons/Microsoft.tsx +12 -0
  638. package/src/lib/authentication/ui/icons/X.tsx +10 -0
  639. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  640. package/src/lib/components/Autocomplete.tsx +11 -2
  641. package/src/lib/components/Layout.tsx +3 -2
  642. package/src/lib/components/Mermaid.tsx +68 -0
  643. package/src/lib/components/PagefindSearchMeta.tsx +14 -0
  644. package/src/lib/components/Pagination.tsx +4 -5
  645. package/src/lib/components/Zudoku.tsx +7 -10
  646. package/src/lib/components/index.ts +4 -0
  647. package/src/lib/components/navigation/NavigationItem.tsx +16 -23
  648. package/src/lib/components/navigation/Toc.tsx +3 -3
  649. package/src/lib/core/RouteGuard.tsx +69 -43
  650. package/src/lib/core/ZudokuContext.ts +3 -0
  651. package/src/lib/core/plugins.ts +2 -2
  652. package/src/lib/core/react-query.ts +1 -0
  653. package/src/lib/errors/ErrorAlert.tsx +1 -1
  654. package/src/lib/errors/ErrorMessage.tsx +38 -0
  655. package/src/lib/errors/RouterError.tsx +7 -2
  656. package/src/lib/oas/graphql/circular.test.ts +186 -0
  657. package/src/lib/oas/graphql/circular.ts +49 -10
  658. package/src/lib/oas/graphql/index.ts +7 -3
  659. package/src/lib/oas/parser/index.ts +10 -3
  660. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +11 -7
  661. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
  662. package/src/lib/plugins/api-keys/index.tsx +76 -32
  663. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
  664. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
  665. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
  666. package/src/lib/plugins/markdown/MdxPage.tsx +4 -1
  667. package/src/lib/plugins/markdown/index.tsx +2 -0
  668. package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -3
  669. package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +115 -0
  670. package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
  671. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -0
  672. package/src/lib/plugins/openapi/OasProvider.tsx +30 -17
  673. package/src/lib/plugins/openapi/OperationList.tsx +51 -21
  674. package/src/lib/plugins/openapi/OperationListItem.tsx +15 -12
  675. package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
  676. package/src/lib/plugins/openapi/ParameterList.tsx +37 -23
  677. package/src/lib/plugins/openapi/ParameterListItem.tsx +105 -54
  678. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +48 -7
  679. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +101 -33
  680. package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
  681. package/src/lib/plugins/openapi/Sidecar.tsx +148 -67
  682. package/src/lib/plugins/openapi/SidecarBox.tsx +26 -4
  683. package/src/lib/plugins/openapi/SidecarExamples.tsx +91 -79
  684. package/src/lib/plugins/openapi/components/ConstValue.tsx +1 -1
  685. package/src/lib/plugins/openapi/components/EnumValues.tsx +2 -2
  686. package/src/lib/plugins/openapi/components/NonHighlightedCode.tsx +22 -0
  687. package/src/lib/plugins/openapi/components/ResponseContent.tsx +63 -53
  688. package/src/lib/plugins/openapi/index.tsx +25 -36
  689. package/src/lib/plugins/openapi/interfaces.ts +28 -7
  690. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +246 -30
  691. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +10 -6
  692. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +3 -2
  693. package/src/lib/plugins/openapi/playground/Headers.tsx +103 -219
  694. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +33 -1
  695. package/src/lib/plugins/openapi/playground/PathParams.tsx +26 -34
  696. package/src/lib/plugins/openapi/playground/Playground.tsx +88 -35
  697. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +10 -31
  698. package/src/lib/plugins/openapi/playground/QueryParams.tsx +82 -136
  699. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +20 -1
  700. package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -0
  701. package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +1 -1
  702. package/src/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.tsx +872 -0
  703. package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +349 -0
  704. package/src/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.tsx +2 -2
  705. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +102 -62
  706. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +1 -1
  707. package/src/lib/plugins/openapi/playground/useRememberSkipLoginDialog.tsx +3 -0
  708. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +1 -1
  709. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +89 -55
  710. package/src/lib/plugins/openapi/schema/SchemaView.tsx +100 -60
  711. package/src/lib/plugins/openapi/schema/UnionView.tsx +6 -17
  712. package/src/lib/plugins/openapi/schema/union-helpers.ts +0 -1
  713. package/src/lib/plugins/openapi/schema/utils.ts +20 -6
  714. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
  715. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +11 -11
  716. package/src/lib/plugins/openapi/util/getRoutes.tsx +35 -3
  717. package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
  718. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
  719. package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
  720. package/src/lib/shiki.ts +37 -14
  721. package/src/lib/ui/Badge.tsx +21 -12
  722. package/src/lib/ui/Button.tsx +11 -9
  723. package/src/lib/ui/ButtonGroup.tsx +82 -0
  724. package/src/lib/ui/Callout.tsx +10 -5
  725. package/src/lib/ui/Checkbox.tsx +23 -24
  726. package/src/lib/ui/CodeBlock.tsx +3 -4
  727. package/src/lib/ui/Collapsible.tsx +26 -4
  728. package/src/lib/ui/Command.tsx +3 -3
  729. package/src/lib/ui/Dialog.tsx +112 -106
  730. package/src/lib/ui/DropdownMenu.tsx +226 -170
  731. package/src/lib/ui/EmbeddedCodeBlock.tsx +24 -19
  732. package/src/lib/ui/Frame.tsx +81 -0
  733. package/src/lib/ui/Item.tsx +192 -0
  734. package/src/lib/ui/Kbd.tsx +28 -0
  735. package/src/lib/ui/NativeSelect.tsx +47 -0
  736. package/src/lib/ui/ReactComponentDoc.tsx +17 -17
  737. package/src/lib/ui/Select.tsx +153 -126
  738. package/src/lib/ui/Separator.tsx +25 -0
  739. package/src/lib/ui/SyntaxHighlight.tsx +6 -1
  740. package/src/lib/ui/Tooltip.tsx +54 -32
  741. package/src/lib/util/MdxComponents.tsx +5 -5
  742. package/src/lib/util/createVariantComponent.tsx +31 -5
  743. package/src/lib/util/flattenAllOf.test.ts +689 -0
  744. package/src/lib/util/flattenAllOf.ts +122 -0
  745. package/src/lib/util/invariant.ts +2 -1
  746. package/src/lib/util/readFrontmatter.ts +13 -0
  747. package/src/lib/util/syncZustandState.ts +22 -0
  748. package/src/shiki/langs/markdown-nix.js +1 -0
  749. package/src/shiki/langs/openscad.js +1 -0
  750. package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +0 -4
  751. package/dist/lib/plugins/openapi/playground/InlineInput.js +0 -3
  752. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +0 -1
  753. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.d.ts +0 -5
  754. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js +0 -7
  755. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js.map +0 -1
  756. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.d.ts +0 -4
  757. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js +0 -10
  758. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js.map +0 -1
  759. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.d.ts +0 -5
  760. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js +0 -16
  761. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js.map +0 -1
  762. package/dist/vite/create-pagefind-index.d.ts +0 -4
  763. package/dist/vite/create-pagefind-index.js +0 -12
  764. package/dist/vite/create-pagefind-index.js.map +0 -1
  765. package/lib/Button-DmS4u8Lj.js +0 -51
  766. package/lib/Button-DmS4u8Lj.js.map +0 -1
  767. package/lib/CodeBlock-CanTUJLl.js +0 -221
  768. package/lib/CodeBlock-CanTUJLl.js.map +0 -1
  769. package/lib/Command-CJY6q3PF.js.map +0 -1
  770. package/lib/Dialog-BOl0QB3n.js +0 -114
  771. package/lib/Dialog-BOl0QB3n.js.map +0 -1
  772. package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
  773. package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
  774. package/lib/ErrorAlert-VBJ8aHH7.js.map +0 -1
  775. package/lib/MdxPage-DFRNwSsc.js +0 -239
  776. package/lib/MdxPage-DFRNwSsc.js.map +0 -1
  777. package/lib/OAuthErrorPage-DJUOdr6Q.js.map +0 -1
  778. package/lib/OasProvider-BMUgPYQU.js +0 -36
  779. package/lib/OasProvider-BMUgPYQU.js.map +0 -1
  780. package/lib/OperationList-DVig5I94.js +0 -5446
  781. package/lib/OperationList-DVig5I94.js.map +0 -1
  782. package/lib/Pagination-CT4VUR6u.js +0 -37
  783. package/lib/Pagination-CT4VUR6u.js.map +0 -1
  784. package/lib/RouteGuard-BPWQlxy5.js +0 -56
  785. package/lib/RouteGuard-BPWQlxy5.js.map +0 -1
  786. package/lib/RouterError-fm21cqlj.js +0 -41
  787. package/lib/RouterError-fm21cqlj.js.map +0 -1
  788. package/lib/SchemaList-1eLKXqn8.js.map +0 -1
  789. package/lib/SchemaView-fq3uKfOA.js +0 -458
  790. package/lib/SchemaView-fq3uKfOA.js.map +0 -1
  791. package/lib/Select-CPoGZU_V.js +0 -372
  792. package/lib/Select-CPoGZU_V.js.map +0 -1
  793. package/lib/SignUp-BraHuRN_.js +0 -56
  794. package/lib/SignUp-BraHuRN_.js.map +0 -1
  795. package/lib/SyntaxHighlight-B0laqAqK.js.map +0 -1
  796. package/lib/Toc-KzXCRqrX.js.map +0 -1
  797. package/lib/ZudokuContext-BXTZApgy.js +0 -1506
  798. package/lib/ZudokuContext-BXTZApgy.js.map +0 -1
  799. package/lib/chunk-PVWAREVJ-BO6B-RAk.js +0 -7965
  800. package/lib/chunk-PVWAREVJ-BO6B-RAk.js.map +0 -1
  801. package/lib/circular-D6wbrxuf.js.map +0 -1
  802. package/lib/cn-dYga0KKN.js.map +0 -1
  803. package/lib/createServer-C5aY10Bc.js +0 -12559
  804. package/lib/createServer-C5aY10Bc.js.map +0 -1
  805. package/lib/hook-CAebs2rv.js +0 -31
  806. package/lib/hook-CAebs2rv.js.map +0 -1
  807. package/lib/index-BPSpOxTK.js +0 -1058
  808. package/lib/index-BPSpOxTK.js.map +0 -1
  809. package/lib/index-Bb9AsFlk.js +0 -3318
  810. package/lib/index-Bb9AsFlk.js.map +0 -1
  811. package/lib/invariant-Bm-FVUQE.js.map +0 -1
  812. package/lib/mutation-CdGPxHNX.js.map +0 -1
  813. package/lib/useExposedProps-Cd7Yg_uG.js +0 -113
  814. package/lib/useExposedProps-Cd7Yg_uG.js.map +0 -1
  815. package/src/lib/plugins/openapi/playground/InlineInput.tsx +0 -6
  816. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.tsx +0 -36
  817. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.tsx +0 -25
  818. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.tsx +0 -42
@@ -0,0 +1,3677 @@
1
+ import { j as t } from "./jsx-runtime-BzflLqGi.js";
2
+ import { ChevronsDownUpIcon as Ln, ChevronsUpDownIcon as kn, PlusCircleIcon as Je, XIcon as It, CheckIcon as Dt, PaperclipIcon as ue, TrashIcon as En, FileInput as Rn, ScanTextIcon as yt, Grid2x2PlusIcon as vt, ChevronDownIcon as In, TableOfContentsIcon as Dn, LockIcon as Fn, CircleAlertIcon as zn, Circle as Vn, Unlink2Icon as Bn, CornerDownRightIcon as _n, MinusCircleIcon as bt, CornerDownLeftIcon as qn, SquareCodeIcon as Mn, DownloadIcon as Un, EyeOffIcon as Gn, EyeIcon as Hn, UnplugIcon as Qn, SendIcon as Jn, CopyIcon as Wn, IdCardLanyardIcon as Xn, ShapesIcon as Kn, PlayIcon as Zn, CirclePlayIcon as Yn } from "lucide-react";
3
+ import { r as es, d as ts, a as ns, N as ss, aL as rs, m as jt } from "./chunk-EPOLDU6W-C6C8jAwd.js";
4
+ import { Button as Ft } from "./ui/Button.js";
5
+ import { f as Ze, p as Ye, g as zt, s as as, h as os, j as V } from "./ZudokuContext-BZB1TWdT.js";
6
+ import { Z as is } from "./invariant-BJAl77rw.js";
7
+ import * as xe from "react";
8
+ import { createContext as Vt, use as ls, useRef as k, useEffect as G, useMemo as Bt, useCallback as D, startTransition as cs, useState as E, Fragment as ie, useLayoutEffect as ds, useTransition as us, useContext as ms } from "react";
9
+ import { VisuallyHidden as ps } from "@radix-ui/react-visually-hidden";
10
+ import { z as hs, b as fs } from "./index-DBjOT2H1.js";
11
+ import { B as q } from "./Button-GUVe7pmt.js";
12
+ import { D as et, a as tt, c as nt, d as _t, e as qt, g as gs } from "./Dialog-hlvmmQ_c.js";
13
+ import { B as pe, k as Ct, l as Nt, m as St, c as xs, S as ys, n as vs, h as bs } from "./index-BDsEwofZ.js";
14
+ import { u as js } from "./useMutation-CFMGlAMW.js";
15
+ import { u as ae, b as Mt, C as wt, a as Cs, F as Ns } from "./index.esm-BYObtETB.js";
16
+ import * as st from "@radix-ui/react-collapsible";
17
+ import { S as Ut, a as Gt, b as Ht, c as Qt, e as Te, g as Ss } from "./Secret-BDBqq4p3.js";
18
+ import { c as w } from "./cn-5-Gd1Dss.js";
19
+ import { u as ws } from "./useCopyToClipboard-B_085nfO.js";
20
+ import { u as Ts } from "./useLatest-hmRS46UF.js";
21
+ import { D as Jt, a as Wt, b as Xt, d as As, e as $s, f as Ps, c as Ae } from "./DropdownMenu-DN0jNrjj.js";
22
+ import { I as Os } from "./Input-Cx-GeKoF.js";
23
+ import { c as ye } from "./createVariantComponent-Dc0vtOvr.js";
24
+ import * as Tt from "@radix-ui/react-checkbox";
25
+ import * as $e from "@radix-ui/react-popover";
26
+ import { PopoverAnchor as Ls } from "@radix-ui/react-popover";
27
+ import { P as ks } from "./index-CrcNWbel.js";
28
+ import { f as Es, g as Rs, C as Is, b as Ds } from "./Command-N6VujV30.js";
29
+ import { C as Fs } from "./Card-DCdq37aA.js";
30
+ import * as Kt from "@radix-ui/react-label";
31
+ import { c as zs } from "./index-DI5SPFK9.js";
32
+ import * as he from "@radix-ui/react-radio-group";
33
+ import { A as Vs, a as Bs, b as _s } from "./Mermaid-Koc3z8mU.js";
34
+ import { e as qs, u as Ms } from "./useSuspenseQuery-CSB_rVek.js";
35
+ let _e;
36
+ const Us = (e) => {
37
+ if (e.errors?.[0])
38
+ throw new is(e.errors[0].message, {
39
+ developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
40
+ });
41
+ };
42
+ class Gs {
43
+ constructor(n) {
44
+ this.config = n;
45
+ }
46
+ #e = async () => (_e || (_e = import("./createServer-BXZ0CAUn.js").then(
47
+ (n) => n.createServer(this.config)
48
+ )), _e);
49
+ #t = async (n) => this.config.server ? fetch(this.config.server, n) : (await this.#e()).fetch("http://localhost/graphql", n);
50
+ fetch = async (n, s) => {
51
+ const a = n.match(/query (\w+)/)?.[1], r = await this.#t({
52
+ method: "POST",
53
+ body: JSON.stringify({ query: n, variables: s, operationName: a }),
54
+ headers: { "Content-Type": "application/json" }
55
+ });
56
+ if (!r.ok)
57
+ throw new Error("Network response was not ok");
58
+ const o = await r.json();
59
+ return Us(o), o.data;
60
+ };
61
+ }
62
+ function qe(e, n) {
63
+ if (!!!e)
64
+ throw new Error(n);
65
+ }
66
+ function Hs(e) {
67
+ return typeof e == "object" && e !== null;
68
+ }
69
+ function Qs(e, n) {
70
+ if (!!!e)
71
+ throw new Error(
72
+ n ?? "Unexpected invariant triggered."
73
+ );
74
+ }
75
+ const Js = /\r\n|[\n\r]/g;
76
+ function We(e, n) {
77
+ let s = 0, a = 1;
78
+ for (const r of e.body.matchAll(Js)) {
79
+ if (typeof r.index == "number" || Qs(!1), r.index >= n)
80
+ break;
81
+ s = r.index + r[0].length, a += 1;
82
+ }
83
+ return {
84
+ line: a,
85
+ column: n + 1 - s
86
+ };
87
+ }
88
+ function Ws(e) {
89
+ return Zt(
90
+ e.source,
91
+ We(e.source, e.start)
92
+ );
93
+ }
94
+ function Zt(e, n) {
95
+ const s = e.locationOffset.column - 1, a = "".padStart(s) + e.body, r = n.line - 1, o = e.locationOffset.line - 1, i = n.line + o, c = n.line === 1 ? s : 0, l = n.column + c, m = `${e.name}:${i}:${l}
96
+ `, d = a.split(/\r\n|[\n\r]/g), f = d[r];
97
+ if (f.length > 120) {
98
+ const x = Math.floor(l / 80), h = l % 80, v = [];
99
+ for (let u = 0; u < f.length; u += 80)
100
+ v.push(f.slice(u, u + 80));
101
+ return m + At([
102
+ [`${i} |`, v[0]],
103
+ ...v.slice(1, x + 1).map((u) => ["|", u]),
104
+ ["|", "^".padStart(h)],
105
+ ["|", v[x + 1]]
106
+ ]);
107
+ }
108
+ return m + At([
109
+ // Lines specified like this: ["prefix", "string"],
110
+ [`${i - 1} |`, d[r - 1]],
111
+ [`${i} |`, f],
112
+ ["|", "^".padStart(l)],
113
+ [`${i + 1} |`, d[r + 1]]
114
+ ]);
115
+ }
116
+ function At(e) {
117
+ const n = e.filter(([a, r]) => r !== void 0), s = Math.max(...n.map(([a]) => a.length));
118
+ return n.map(([a, r]) => a.padStart(s) + (r ? " " + r : "")).join(`
119
+ `);
120
+ }
121
+ function Xs(e) {
122
+ const n = e[0];
123
+ return n == null || "kind" in n || "length" in n ? {
124
+ nodes: n,
125
+ source: e[1],
126
+ positions: e[2],
127
+ path: e[3],
128
+ originalError: e[4],
129
+ extensions: e[5]
130
+ } : n;
131
+ }
132
+ class rt extends Error {
133
+ /**
134
+ * An array of `{ line, column }` locations within the source GraphQL document
135
+ * which correspond to this error.
136
+ *
137
+ * Errors during validation often contain multiple locations, for example to
138
+ * point out two things with the same name. Errors during execution include a
139
+ * single location, the field which produced the error.
140
+ *
141
+ * Enumerable, and appears in the result of JSON.stringify().
142
+ */
143
+ /**
144
+ * An array describing the JSON-path into the execution response which
145
+ * corresponds to this error. Only included for errors during execution.
146
+ *
147
+ * Enumerable, and appears in the result of JSON.stringify().
148
+ */
149
+ /**
150
+ * An array of GraphQL AST Nodes corresponding to this error.
151
+ */
152
+ /**
153
+ * The source GraphQL document for the first location of this error.
154
+ *
155
+ * Note that if this Error represents more than one node, the source may not
156
+ * represent nodes after the first node.
157
+ */
158
+ /**
159
+ * An array of character offsets within the source GraphQL document
160
+ * which correspond to this error.
161
+ */
162
+ /**
163
+ * The original error thrown from a field resolver during execution.
164
+ */
165
+ /**
166
+ * Extension fields to add to the formatted error.
167
+ */
168
+ /**
169
+ * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
170
+ */
171
+ constructor(n, ...s) {
172
+ var a, r, o;
173
+ const { nodes: i, source: c, positions: l, path: m, originalError: d, extensions: f } = Xs(s);
174
+ super(n), this.name = "GraphQLError", this.path = m ?? void 0, this.originalError = d ?? void 0, this.nodes = $t(
175
+ Array.isArray(i) ? i : i ? [i] : void 0
176
+ );
177
+ const x = $t(
178
+ (a = this.nodes) === null || a === void 0 ? void 0 : a.map((v) => v.loc).filter((v) => v != null)
179
+ );
180
+ this.source = c ?? (x == null || (r = x[0]) === null || r === void 0 ? void 0 : r.source), this.positions = l ?? x?.map((v) => v.start), this.locations = l && c ? l.map((v) => We(c, v)) : x?.map((v) => We(v.source, v.start));
181
+ const h = Hs(
182
+ d?.extensions
183
+ ) ? d?.extensions : void 0;
184
+ this.extensions = (o = f ?? h) !== null && o !== void 0 ? o : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
185
+ message: {
186
+ writable: !0,
187
+ enumerable: !0
188
+ },
189
+ name: {
190
+ enumerable: !1
191
+ },
192
+ nodes: {
193
+ enumerable: !1
194
+ },
195
+ source: {
196
+ enumerable: !1
197
+ },
198
+ positions: {
199
+ enumerable: !1
200
+ },
201
+ originalError: {
202
+ enumerable: !1
203
+ }
204
+ }), d != null && d.stack ? Object.defineProperty(this, "stack", {
205
+ value: d.stack,
206
+ writable: !0,
207
+ configurable: !0
208
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, rt) : Object.defineProperty(this, "stack", {
209
+ value: Error().stack,
210
+ writable: !0,
211
+ configurable: !0
212
+ });
213
+ }
214
+ get [Symbol.toStringTag]() {
215
+ return "GraphQLError";
216
+ }
217
+ toString() {
218
+ let n = this.message;
219
+ if (this.nodes)
220
+ for (const s of this.nodes)
221
+ s.loc && (n += `
222
+
223
+ ` + Ws(s.loc));
224
+ else if (this.source && this.locations)
225
+ for (const s of this.locations)
226
+ n += `
227
+
228
+ ` + Zt(this.source, s);
229
+ return n;
230
+ }
231
+ toJSON() {
232
+ const n = {
233
+ message: this.message
234
+ };
235
+ return this.locations != null && (n.locations = this.locations), this.path != null && (n.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (n.extensions = this.extensions), n;
236
+ }
237
+ }
238
+ function $t(e) {
239
+ return e === void 0 || e.length === 0 ? void 0 : e;
240
+ }
241
+ function F(e, n, s) {
242
+ return new rt(`Syntax Error: ${s}`, {
243
+ source: e,
244
+ positions: [n]
245
+ });
246
+ }
247
+ class Ka {
248
+ /**
249
+ * The character offset at which this Node begins.
250
+ */
251
+ /**
252
+ * The character offset at which this Node ends.
253
+ */
254
+ /**
255
+ * The Token at which this Node begins.
256
+ */
257
+ /**
258
+ * The Token at which this Node ends.
259
+ */
260
+ /**
261
+ * The Source document the AST represents.
262
+ */
263
+ constructor(n, s, a) {
264
+ this.start = n.start, this.end = s.end, this.startToken = n, this.endToken = s, this.source = a;
265
+ }
266
+ get [Symbol.toStringTag]() {
267
+ return "Location";
268
+ }
269
+ toJSON() {
270
+ return {
271
+ start: this.start,
272
+ end: this.end
273
+ };
274
+ }
275
+ }
276
+ class Yt {
277
+ /**
278
+ * The kind of Token.
279
+ */
280
+ /**
281
+ * The character offset at which this Node begins.
282
+ */
283
+ /**
284
+ * The character offset at which this Node ends.
285
+ */
286
+ /**
287
+ * The 1-indexed line number on which this Token appears.
288
+ */
289
+ /**
290
+ * The 1-indexed column number at which this Token begins.
291
+ */
292
+ /**
293
+ * For non-punctuation tokens, represents the interpreted value of the token.
294
+ *
295
+ * Note: is undefined for punctuation tokens, but typed as string for
296
+ * convenience in the parser.
297
+ */
298
+ /**
299
+ * Tokens exist as nodes in a double-linked-list amongst all tokens
300
+ * including ignored tokens. <SOF> is always the first node and <EOF>
301
+ * the last.
302
+ */
303
+ constructor(n, s, a, r, o, i) {
304
+ this.kind = n, this.start = s, this.end = a, this.line = r, this.column = o, this.value = i, this.prev = null, this.next = null;
305
+ }
306
+ get [Symbol.toStringTag]() {
307
+ return "Token";
308
+ }
309
+ toJSON() {
310
+ return {
311
+ kind: this.kind,
312
+ value: this.value,
313
+ line: this.line,
314
+ column: this.column
315
+ };
316
+ }
317
+ }
318
+ const Ks = {
319
+ Name: [],
320
+ Document: ["definitions"],
321
+ OperationDefinition: [
322
+ "description",
323
+ "name",
324
+ "variableDefinitions",
325
+ "directives",
326
+ "selectionSet"
327
+ ],
328
+ VariableDefinition: [
329
+ "description",
330
+ "variable",
331
+ "type",
332
+ "defaultValue",
333
+ "directives"
334
+ ],
335
+ Variable: ["name"],
336
+ SelectionSet: ["selections"],
337
+ Field: ["alias", "name", "arguments", "directives", "selectionSet"],
338
+ Argument: ["name", "value"],
339
+ FragmentSpread: ["name", "directives"],
340
+ InlineFragment: ["typeCondition", "directives", "selectionSet"],
341
+ FragmentDefinition: [
342
+ "description",
343
+ "name",
344
+ // Note: fragment variable definitions are deprecated and will removed in v17.0.0
345
+ "variableDefinitions",
346
+ "typeCondition",
347
+ "directives",
348
+ "selectionSet"
349
+ ],
350
+ IntValue: [],
351
+ FloatValue: [],
352
+ StringValue: [],
353
+ BooleanValue: [],
354
+ NullValue: [],
355
+ EnumValue: [],
356
+ ListValue: ["values"],
357
+ ObjectValue: ["fields"],
358
+ ObjectField: ["name", "value"],
359
+ Directive: ["name", "arguments"],
360
+ NamedType: ["name"],
361
+ ListType: ["type"],
362
+ NonNullType: ["type"],
363
+ SchemaDefinition: ["description", "directives", "operationTypes"],
364
+ OperationTypeDefinition: ["type"],
365
+ ScalarTypeDefinition: ["description", "name", "directives"],
366
+ ObjectTypeDefinition: [
367
+ "description",
368
+ "name",
369
+ "interfaces",
370
+ "directives",
371
+ "fields"
372
+ ],
373
+ FieldDefinition: ["description", "name", "arguments", "type", "directives"],
374
+ InputValueDefinition: [
375
+ "description",
376
+ "name",
377
+ "type",
378
+ "defaultValue",
379
+ "directives"
380
+ ],
381
+ InterfaceTypeDefinition: [
382
+ "description",
383
+ "name",
384
+ "interfaces",
385
+ "directives",
386
+ "fields"
387
+ ],
388
+ UnionTypeDefinition: ["description", "name", "directives", "types"],
389
+ EnumTypeDefinition: ["description", "name", "directives", "values"],
390
+ EnumValueDefinition: ["description", "name", "directives"],
391
+ InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
392
+ DirectiveDefinition: ["description", "name", "arguments", "locations"],
393
+ SchemaExtension: ["directives", "operationTypes"],
394
+ ScalarTypeExtension: ["name", "directives"],
395
+ ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
396
+ InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
397
+ UnionTypeExtension: ["name", "directives", "types"],
398
+ EnumTypeExtension: ["name", "directives", "values"],
399
+ InputObjectTypeExtension: ["name", "directives", "fields"],
400
+ TypeCoordinate: ["name"],
401
+ MemberCoordinate: ["name", "memberName"],
402
+ ArgumentCoordinate: ["name", "fieldName", "argumentName"],
403
+ DirectiveCoordinate: ["name"],
404
+ DirectiveArgumentCoordinate: ["name", "argumentName"]
405
+ }, Zs = new Set(Object.keys(Ks));
406
+ function Za(e) {
407
+ const n = e?.kind;
408
+ return typeof n == "string" && Zs.has(n);
409
+ }
410
+ var Pt;
411
+ (function(e) {
412
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
413
+ })(Pt || (Pt = {}));
414
+ function Xe(e) {
415
+ return e === 9 || e === 32;
416
+ }
417
+ function fe(e) {
418
+ return e >= 48 && e <= 57;
419
+ }
420
+ function en(e) {
421
+ return e >= 97 && e <= 122 || // A-Z
422
+ e >= 65 && e <= 90;
423
+ }
424
+ function tn(e) {
425
+ return en(e) || e === 95;
426
+ }
427
+ function Ys(e) {
428
+ return en(e) || fe(e) || e === 95;
429
+ }
430
+ function er(e) {
431
+ var n;
432
+ let s = Number.MAX_SAFE_INTEGER, a = null, r = -1;
433
+ for (let i = 0; i < e.length; ++i) {
434
+ var o;
435
+ const c = e[i], l = tr(c);
436
+ l !== c.length && (a = (o = a) !== null && o !== void 0 ? o : i, r = i, i !== 0 && l < s && (s = l));
437
+ }
438
+ return e.map((i, c) => c === 0 ? i : i.slice(s)).slice(
439
+ (n = a) !== null && n !== void 0 ? n : 0,
440
+ r + 1
441
+ );
442
+ }
443
+ function tr(e) {
444
+ let n = 0;
445
+ for (; n < e.length && Xe(e.charCodeAt(n)); )
446
+ ++n;
447
+ return n;
448
+ }
449
+ function nr(e, n) {
450
+ const s = e.replace(/"""/g, '\\"""'), a = s.split(/\r\n|[\n\r]/g), r = a.length === 1, o = a.length > 1 && a.slice(1).every((h) => h.length === 0 || Xe(h.charCodeAt(0))), i = s.endsWith('\\"""'), c = e.endsWith('"') && !i, l = e.endsWith("\\"), m = c || l, d = !(n != null && n.minimize) && // add leading and trailing new lines only if it improves readability
451
+ (!r || e.length > 70 || m || o || i);
452
+ let f = "";
453
+ const x = r && Xe(e.charCodeAt(0));
454
+ return (d && !x || o) && (f += `
455
+ `), f += s, (d || m) && (f += `
456
+ `), '"""' + f + '"""';
457
+ }
458
+ var b;
459
+ (function(e) {
460
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
461
+ })(b || (b = {}));
462
+ class sr {
463
+ /**
464
+ * The previously focused non-ignored token.
465
+ */
466
+ /**
467
+ * The currently focused non-ignored token.
468
+ */
469
+ /**
470
+ * The (1-indexed) line containing the current token.
471
+ */
472
+ /**
473
+ * The character offset at which the current line begins.
474
+ */
475
+ constructor(n) {
476
+ const s = new Yt(b.SOF, 0, 0, 0, 0);
477
+ this.source = n, this.lastToken = s, this.token = s, this.line = 1, this.lineStart = 0;
478
+ }
479
+ get [Symbol.toStringTag]() {
480
+ return "Lexer";
481
+ }
482
+ /**
483
+ * Advances the token stream to the next non-ignored token.
484
+ */
485
+ advance() {
486
+ return this.lastToken = this.token, this.token = this.lookahead();
487
+ }
488
+ /**
489
+ * Looks ahead and returns the next non-ignored token, but does not change
490
+ * the state of Lexer.
491
+ */
492
+ lookahead() {
493
+ let n = this.token;
494
+ if (n.kind !== b.EOF)
495
+ do
496
+ if (n.next)
497
+ n = n.next;
498
+ else {
499
+ const s = ar(this, n.end);
500
+ n.next = s, s.prev = n, n = s;
501
+ }
502
+ while (n.kind === b.COMMENT);
503
+ return n;
504
+ }
505
+ }
506
+ function rr(e) {
507
+ return e === b.BANG || e === b.DOLLAR || e === b.AMP || e === b.PAREN_L || e === b.PAREN_R || e === b.DOT || e === b.SPREAD || e === b.COLON || e === b.EQUALS || e === b.AT || e === b.BRACKET_L || e === b.BRACKET_R || e === b.BRACE_L || e === b.PIPE || e === b.BRACE_R;
508
+ }
509
+ function oe(e) {
510
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
511
+ }
512
+ function Oe(e, n) {
513
+ return nn(e.charCodeAt(n)) && sn(e.charCodeAt(n + 1));
514
+ }
515
+ function nn(e) {
516
+ return e >= 55296 && e <= 56319;
517
+ }
518
+ function sn(e) {
519
+ return e >= 56320 && e <= 57343;
520
+ }
521
+ function K(e, n) {
522
+ const s = e.source.body.codePointAt(n);
523
+ if (s === void 0)
524
+ return b.EOF;
525
+ if (s >= 32 && s <= 126) {
526
+ const a = String.fromCodePoint(s);
527
+ return a === '"' ? `'"'` : `"${a}"`;
528
+ }
529
+ return "U+" + s.toString(16).toUpperCase().padStart(4, "0");
530
+ }
531
+ function P(e, n, s, a, r) {
532
+ const o = e.line, i = 1 + s - e.lineStart;
533
+ return new Yt(n, s, a, o, i, r);
534
+ }
535
+ function ar(e, n) {
536
+ const s = e.source.body, a = s.length;
537
+ let r = n;
538
+ for (; r < a; ) {
539
+ const o = s.charCodeAt(r);
540
+ switch (o) {
541
+ // Ignored ::
542
+ // - UnicodeBOM
543
+ // - WhiteSpace
544
+ // - LineTerminator
545
+ // - Comment
546
+ // - Comma
547
+ //
548
+ // UnicodeBOM :: "Byte Order Mark (U+FEFF)"
549
+ //
550
+ // WhiteSpace ::
551
+ // - "Horizontal Tab (U+0009)"
552
+ // - "Space (U+0020)"
553
+ //
554
+ // Comma :: ,
555
+ case 65279:
556
+ // <BOM>
557
+ case 9:
558
+ // \t
559
+ case 32:
560
+ // <space>
561
+ case 44:
562
+ ++r;
563
+ continue;
564
+ // LineTerminator ::
565
+ // - "New Line (U+000A)"
566
+ // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
567
+ // - "Carriage Return (U+000D)" "New Line (U+000A)"
568
+ case 10:
569
+ ++r, ++e.line, e.lineStart = r;
570
+ continue;
571
+ case 13:
572
+ s.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
573
+ continue;
574
+ // Comment
575
+ case 35:
576
+ return or(e, r);
577
+ // Token ::
578
+ // - Punctuator
579
+ // - Name
580
+ // - IntValue
581
+ // - FloatValue
582
+ // - StringValue
583
+ //
584
+ // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
585
+ case 33:
586
+ return P(e, b.BANG, r, r + 1);
587
+ case 36:
588
+ return P(e, b.DOLLAR, r, r + 1);
589
+ case 38:
590
+ return P(e, b.AMP, r, r + 1);
591
+ case 40:
592
+ return P(e, b.PAREN_L, r, r + 1);
593
+ case 41:
594
+ return P(e, b.PAREN_R, r, r + 1);
595
+ case 46:
596
+ if (s.charCodeAt(r + 1) === 46 && s.charCodeAt(r + 2) === 46)
597
+ return P(e, b.SPREAD, r, r + 3);
598
+ break;
599
+ case 58:
600
+ return P(e, b.COLON, r, r + 1);
601
+ case 61:
602
+ return P(e, b.EQUALS, r, r + 1);
603
+ case 64:
604
+ return P(e, b.AT, r, r + 1);
605
+ case 91:
606
+ return P(e, b.BRACKET_L, r, r + 1);
607
+ case 93:
608
+ return P(e, b.BRACKET_R, r, r + 1);
609
+ case 123:
610
+ return P(e, b.BRACE_L, r, r + 1);
611
+ case 124:
612
+ return P(e, b.PIPE, r, r + 1);
613
+ case 125:
614
+ return P(e, b.BRACE_R, r, r + 1);
615
+ // StringValue
616
+ case 34:
617
+ return s.charCodeAt(r + 1) === 34 && s.charCodeAt(r + 2) === 34 ? mr(e, r) : lr(e, r);
618
+ }
619
+ if (fe(o) || o === 45)
620
+ return ir(e, r, o);
621
+ if (tn(o))
622
+ return pr(e, r);
623
+ throw F(
624
+ e.source,
625
+ r,
626
+ o === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : oe(o) || Oe(s, r) ? `Unexpected character: ${K(e, r)}.` : `Invalid character: ${K(e, r)}.`
627
+ );
628
+ }
629
+ return P(e, b.EOF, a, a);
630
+ }
631
+ function or(e, n) {
632
+ const s = e.source.body, a = s.length;
633
+ let r = n + 1;
634
+ for (; r < a; ) {
635
+ const o = s.charCodeAt(r);
636
+ if (o === 10 || o === 13)
637
+ break;
638
+ if (oe(o))
639
+ ++r;
640
+ else if (Oe(s, r))
641
+ r += 2;
642
+ else
643
+ break;
644
+ }
645
+ return P(
646
+ e,
647
+ b.COMMENT,
648
+ n,
649
+ r,
650
+ s.slice(n + 1, r)
651
+ );
652
+ }
653
+ function ir(e, n, s) {
654
+ const a = e.source.body;
655
+ let r = n, o = s, i = !1;
656
+ if (o === 45 && (o = a.charCodeAt(++r)), o === 48) {
657
+ if (o = a.charCodeAt(++r), fe(o))
658
+ throw F(
659
+ e.source,
660
+ r,
661
+ `Invalid number, unexpected digit after 0: ${K(
662
+ e,
663
+ r
664
+ )}.`
665
+ );
666
+ } else
667
+ r = Me(e, r, o), o = a.charCodeAt(r);
668
+ if (o === 46 && (i = !0, o = a.charCodeAt(++r), r = Me(e, r, o), o = a.charCodeAt(r)), (o === 69 || o === 101) && (i = !0, o = a.charCodeAt(++r), (o === 43 || o === 45) && (o = a.charCodeAt(++r)), r = Me(e, r, o), o = a.charCodeAt(r)), o === 46 || tn(o))
669
+ throw F(
670
+ e.source,
671
+ r,
672
+ `Invalid number, expected digit but got: ${K(
673
+ e,
674
+ r
675
+ )}.`
676
+ );
677
+ return P(
678
+ e,
679
+ i ? b.FLOAT : b.INT,
680
+ n,
681
+ r,
682
+ a.slice(n, r)
683
+ );
684
+ }
685
+ function Me(e, n, s) {
686
+ if (!fe(s))
687
+ throw F(
688
+ e.source,
689
+ n,
690
+ `Invalid number, expected digit but got: ${K(
691
+ e,
692
+ n
693
+ )}.`
694
+ );
695
+ const a = e.source.body;
696
+ let r = n + 1;
697
+ for (; fe(a.charCodeAt(r)); )
698
+ ++r;
699
+ return r;
700
+ }
701
+ function lr(e, n) {
702
+ const s = e.source.body, a = s.length;
703
+ let r = n + 1, o = r, i = "";
704
+ for (; r < a; ) {
705
+ const c = s.charCodeAt(r);
706
+ if (c === 34)
707
+ return i += s.slice(o, r), P(e, b.STRING, n, r + 1, i);
708
+ if (c === 92) {
709
+ i += s.slice(o, r);
710
+ const l = s.charCodeAt(r + 1) === 117 ? s.charCodeAt(r + 2) === 123 ? cr(e, r) : dr(e, r) : ur(e, r);
711
+ i += l.value, r += l.size, o = r;
712
+ continue;
713
+ }
714
+ if (c === 10 || c === 13)
715
+ break;
716
+ if (oe(c))
717
+ ++r;
718
+ else if (Oe(s, r))
719
+ r += 2;
720
+ else
721
+ throw F(
722
+ e.source,
723
+ r,
724
+ `Invalid character within String: ${K(
725
+ e,
726
+ r
727
+ )}.`
728
+ );
729
+ }
730
+ throw F(e.source, r, "Unterminated string.");
731
+ }
732
+ function cr(e, n) {
733
+ const s = e.source.body;
734
+ let a = 0, r = 3;
735
+ for (; r < 12; ) {
736
+ const o = s.charCodeAt(n + r++);
737
+ if (o === 125) {
738
+ if (r < 5 || !oe(a))
739
+ break;
740
+ return {
741
+ value: String.fromCodePoint(a),
742
+ size: r
743
+ };
744
+ }
745
+ if (a = a << 4 | le(o), a < 0)
746
+ break;
747
+ }
748
+ throw F(
749
+ e.source,
750
+ n,
751
+ `Invalid Unicode escape sequence: "${s.slice(
752
+ n,
753
+ n + r
754
+ )}".`
755
+ );
756
+ }
757
+ function dr(e, n) {
758
+ const s = e.source.body, a = Ot(s, n + 2);
759
+ if (oe(a))
760
+ return {
761
+ value: String.fromCodePoint(a),
762
+ size: 6
763
+ };
764
+ if (nn(a) && s.charCodeAt(n + 6) === 92 && s.charCodeAt(n + 7) === 117) {
765
+ const r = Ot(s, n + 8);
766
+ if (sn(r))
767
+ return {
768
+ value: String.fromCodePoint(a, r),
769
+ size: 12
770
+ };
771
+ }
772
+ throw F(
773
+ e.source,
774
+ n,
775
+ `Invalid Unicode escape sequence: "${s.slice(n, n + 6)}".`
776
+ );
777
+ }
778
+ function Ot(e, n) {
779
+ return le(e.charCodeAt(n)) << 12 | le(e.charCodeAt(n + 1)) << 8 | le(e.charCodeAt(n + 2)) << 4 | le(e.charCodeAt(n + 3));
780
+ }
781
+ function le(e) {
782
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
783
+ }
784
+ function ur(e, n) {
785
+ const s = e.source.body;
786
+ switch (s.charCodeAt(n + 1)) {
787
+ case 34:
788
+ return {
789
+ value: '"',
790
+ size: 2
791
+ };
792
+ case 92:
793
+ return {
794
+ value: "\\",
795
+ size: 2
796
+ };
797
+ case 47:
798
+ return {
799
+ value: "/",
800
+ size: 2
801
+ };
802
+ case 98:
803
+ return {
804
+ value: "\b",
805
+ size: 2
806
+ };
807
+ case 102:
808
+ return {
809
+ value: "\f",
810
+ size: 2
811
+ };
812
+ case 110:
813
+ return {
814
+ value: `
815
+ `,
816
+ size: 2
817
+ };
818
+ case 114:
819
+ return {
820
+ value: "\r",
821
+ size: 2
822
+ };
823
+ case 116:
824
+ return {
825
+ value: " ",
826
+ size: 2
827
+ };
828
+ }
829
+ throw F(
830
+ e.source,
831
+ n,
832
+ `Invalid character escape sequence: "${s.slice(
833
+ n,
834
+ n + 2
835
+ )}".`
836
+ );
837
+ }
838
+ function mr(e, n) {
839
+ const s = e.source.body, a = s.length;
840
+ let r = e.lineStart, o = n + 3, i = o, c = "";
841
+ const l = [];
842
+ for (; o < a; ) {
843
+ const m = s.charCodeAt(o);
844
+ if (m === 34 && s.charCodeAt(o + 1) === 34 && s.charCodeAt(o + 2) === 34) {
845
+ c += s.slice(i, o), l.push(c);
846
+ const d = P(
847
+ e,
848
+ b.BLOCK_STRING,
849
+ n,
850
+ o + 3,
851
+ // Return a string of the lines joined with U+000A.
852
+ er(l).join(`
853
+ `)
854
+ );
855
+ return e.line += l.length - 1, e.lineStart = r, d;
856
+ }
857
+ if (m === 92 && s.charCodeAt(o + 1) === 34 && s.charCodeAt(o + 2) === 34 && s.charCodeAt(o + 3) === 34) {
858
+ c += s.slice(i, o), i = o + 1, o += 4;
859
+ continue;
860
+ }
861
+ if (m === 10 || m === 13) {
862
+ c += s.slice(i, o), l.push(c), m === 13 && s.charCodeAt(o + 1) === 10 ? o += 2 : ++o, c = "", i = o, r = o;
863
+ continue;
864
+ }
865
+ if (oe(m))
866
+ ++o;
867
+ else if (Oe(s, o))
868
+ o += 2;
869
+ else
870
+ throw F(
871
+ e.source,
872
+ o,
873
+ `Invalid character within String: ${K(
874
+ e,
875
+ o
876
+ )}.`
877
+ );
878
+ }
879
+ throw F(e.source, o, "Unterminated string.");
880
+ }
881
+ function pr(e, n) {
882
+ const s = e.source.body, a = s.length;
883
+ let r = n + 1;
884
+ for (; r < a; ) {
885
+ const o = s.charCodeAt(r);
886
+ if (Ys(o))
887
+ ++r;
888
+ else
889
+ break;
890
+ }
891
+ return P(
892
+ e,
893
+ b.NAME,
894
+ n,
895
+ r,
896
+ s.slice(n, r)
897
+ );
898
+ }
899
+ const hr = 10, rn = 2;
900
+ function an(e) {
901
+ return Le(e, []);
902
+ }
903
+ function Le(e, n) {
904
+ switch (typeof e) {
905
+ case "string":
906
+ return JSON.stringify(e);
907
+ case "function":
908
+ return e.name ? `[function ${e.name}]` : "[function]";
909
+ case "object":
910
+ return fr(e, n);
911
+ default:
912
+ return String(e);
913
+ }
914
+ }
915
+ function fr(e, n) {
916
+ if (e === null)
917
+ return "null";
918
+ if (n.includes(e))
919
+ return "[Circular]";
920
+ const s = [...n, e];
921
+ if (gr(e)) {
922
+ const a = e.toJSON();
923
+ if (a !== e)
924
+ return typeof a == "string" ? a : Le(a, s);
925
+ } else if (Array.isArray(e))
926
+ return yr(e, s);
927
+ return xr(e, s);
928
+ }
929
+ function gr(e) {
930
+ return typeof e.toJSON == "function";
931
+ }
932
+ function xr(e, n) {
933
+ const s = Object.entries(e);
934
+ return s.length === 0 ? "{}" : n.length > rn ? "[" + vr(e) + "]" : "{ " + s.map(
935
+ ([r, o]) => r + ": " + Le(o, n)
936
+ ).join(", ") + " }";
937
+ }
938
+ function yr(e, n) {
939
+ if (e.length === 0)
940
+ return "[]";
941
+ if (n.length > rn)
942
+ return "[Array]";
943
+ const s = Math.min(hr, e.length), a = e.length - s, r = [];
944
+ for (let o = 0; o < s; ++o)
945
+ r.push(Le(e[o], n));
946
+ return a === 1 ? r.push("... 1 more item") : a > 1 && r.push(`... ${a} more items`), "[" + r.join(", ") + "]";
947
+ }
948
+ function vr(e) {
949
+ const n = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
950
+ if (n === "Object" && typeof e.constructor == "function") {
951
+ const s = e.constructor.name;
952
+ if (typeof s == "string" && s !== "")
953
+ return s;
954
+ }
955
+ return n;
956
+ }
957
+ const br = globalThis.process && // eslint-disable-next-line no-undef
958
+ process.env.NODE_ENV === "production", jr = (
959
+ /* c8 ignore next 6 */
960
+ // FIXME: https://github.com/graphql/graphql-js/issues/2317
961
+ br ? function(n, s) {
962
+ return n instanceof s;
963
+ } : function(n, s) {
964
+ if (n instanceof s)
965
+ return !0;
966
+ if (typeof n == "object" && n !== null) {
967
+ var a;
968
+ const r = s.prototype[Symbol.toStringTag], o = (
969
+ // We still need to support constructor's name to detect conflicts with older versions of this library.
970
+ Symbol.toStringTag in n ? n[Symbol.toStringTag] : (a = n.constructor) === null || a === void 0 ? void 0 : a.name
971
+ );
972
+ if (r === o) {
973
+ const i = an(n);
974
+ throw new Error(`Cannot use ${r} "${i}" from another module or realm.
975
+
976
+ Ensure that there is only one instance of "graphql" in the node_modules
977
+ directory. If different versions of "graphql" are the dependencies of other
978
+ relied on modules, use "resolutions" to ensure only one version is installed.
979
+
980
+ https://yarnpkg.com/en/docs/selective-version-resolutions
981
+
982
+ Duplicate "graphql" modules cannot be used at the same time since different
983
+ versions may have different capabilities and behavior. The data from one
984
+ version used in the function from another could produce confusing and
985
+ spurious results.`);
986
+ }
987
+ }
988
+ return !1;
989
+ }
990
+ );
991
+ class on {
992
+ constructor(n, s = "GraphQL request", a = {
993
+ line: 1,
994
+ column: 1
995
+ }) {
996
+ typeof n == "string" || qe(!1, `Body must be a string. Received: ${an(n)}.`), this.body = n, this.name = s, this.locationOffset = a, this.locationOffset.line > 0 || qe(
997
+ !1,
998
+ "line in locationOffset is 1-indexed and must be positive."
999
+ ), this.locationOffset.column > 0 || qe(
1000
+ !1,
1001
+ "column in locationOffset is 1-indexed and must be positive."
1002
+ );
1003
+ }
1004
+ get [Symbol.toStringTag]() {
1005
+ return "Source";
1006
+ }
1007
+ }
1008
+ function Cr(e) {
1009
+ return jr(e, on);
1010
+ }
1011
+ function Nr(e) {
1012
+ const n = Cr(e) ? e : new on(e), s = n.body, a = new sr(n);
1013
+ let r = "", o = !1;
1014
+ for (; a.advance().kind !== b.EOF; ) {
1015
+ const i = a.token, c = i.kind, l = !rr(i.kind);
1016
+ o && (l || i.kind === b.SPREAD) && (r += " ");
1017
+ const m = s.slice(i.start, i.end);
1018
+ c === b.BLOCK_STRING ? r += nr(i.value, {
1019
+ minimize: !0
1020
+ }) : r += m, o = l;
1021
+ }
1022
+ return r;
1023
+ }
1024
+ const ln = Vt(
1025
+ void 0
1026
+ ), Ya = ({
1027
+ children: e,
1028
+ client: n
1029
+ }) => /* @__PURE__ */ t.jsx(ln.Provider, { value: n, children: e }), cn = (e, n, ...[s]) => ({
1030
+ queryFn: () => e.fetch(n, s),
1031
+ queryKey: [Nr(n.toString()), s]
1032
+ }), Sr = (e, ...[n]) => {
1033
+ const s = ls(ln);
1034
+ if (s === void 0)
1035
+ throw new Error("useGraphQL must be used within a GraphQLProvider");
1036
+ return cn(s, e, ...n === void 0 ? [] : [n]);
1037
+ };
1038
+ class Y extends String {
1039
+ __apiType;
1040
+ value;
1041
+ __meta__;
1042
+ constructor(n, s) {
1043
+ super(n), this.value = n, this.__meta__ = s;
1044
+ }
1045
+ toString() {
1046
+ return this.value;
1047
+ }
1048
+ }
1049
+ const wr = new Y(
1050
+ `
1051
+ fragment OperationsFragment on OperationItem {
1052
+ slug
1053
+ summary
1054
+ method
1055
+ description
1056
+ operationId
1057
+ contentTypes
1058
+ path
1059
+ deprecated
1060
+ extensions
1061
+ servers {
1062
+ url
1063
+ description
1064
+ }
1065
+ parameters {
1066
+ name
1067
+ in
1068
+ description
1069
+ required
1070
+ schema
1071
+ style
1072
+ explode
1073
+ examples {
1074
+ name
1075
+ description
1076
+ externalValue
1077
+ value
1078
+ summary
1079
+ }
1080
+ }
1081
+ requestBody {
1082
+ content {
1083
+ mediaType
1084
+ encoding {
1085
+ name
1086
+ }
1087
+ examples {
1088
+ name
1089
+ description
1090
+ externalValue
1091
+ value
1092
+ summary
1093
+ }
1094
+ schema
1095
+ }
1096
+ description
1097
+ required
1098
+ }
1099
+ responses {
1100
+ statusCode
1101
+ links
1102
+ description
1103
+ content {
1104
+ examples {
1105
+ name
1106
+ description
1107
+ externalValue
1108
+ value
1109
+ summary
1110
+ }
1111
+ mediaType
1112
+ encoding {
1113
+ name
1114
+ }
1115
+ schema
1116
+ }
1117
+ }
1118
+ }
1119
+ `,
1120
+ { fragmentName: "OperationsFragment" }
1121
+ ), Tr = new Y(`
1122
+ query ServersQuery($input: JSON!, $type: SchemaType!) {
1123
+ schema(input: $input, type: $type) {
1124
+ url
1125
+ servers {
1126
+ url
1127
+ }
1128
+ }
1129
+ }
1130
+ `), Ar = new Y(`
1131
+ query SchemaWarmup($input: JSON!, $type: SchemaType!) {
1132
+ schema(input: $input, type: $type) {
1133
+ openapi
1134
+ }
1135
+ }
1136
+ `), $r = new Y(`
1137
+ query OperationsForTag($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
1138
+ schema(input: $input, type: $type) {
1139
+ servers {
1140
+ url
1141
+ }
1142
+ description
1143
+ summary
1144
+ title
1145
+ url
1146
+ version
1147
+ tag(slug: $tag, untagged: $untagged) {
1148
+ name
1149
+ description
1150
+ operations {
1151
+ slug
1152
+ ...OperationsFragment
1153
+ }
1154
+ extensions
1155
+ next {
1156
+ name
1157
+ slug
1158
+ extensions
1159
+ }
1160
+ prev {
1161
+ name
1162
+ slug
1163
+ extensions
1164
+ }
1165
+ }
1166
+ }
1167
+ }
1168
+ fragment OperationsFragment on OperationItem {
1169
+ slug
1170
+ summary
1171
+ method
1172
+ description
1173
+ operationId
1174
+ contentTypes
1175
+ path
1176
+ deprecated
1177
+ extensions
1178
+ servers {
1179
+ url
1180
+ description
1181
+ }
1182
+ parameters {
1183
+ name
1184
+ in
1185
+ description
1186
+ required
1187
+ schema
1188
+ style
1189
+ explode
1190
+ examples {
1191
+ name
1192
+ description
1193
+ externalValue
1194
+ value
1195
+ summary
1196
+ }
1197
+ }
1198
+ requestBody {
1199
+ content {
1200
+ mediaType
1201
+ encoding {
1202
+ name
1203
+ }
1204
+ examples {
1205
+ name
1206
+ description
1207
+ externalValue
1208
+ value
1209
+ summary
1210
+ }
1211
+ schema
1212
+ }
1213
+ description
1214
+ required
1215
+ }
1216
+ responses {
1217
+ statusCode
1218
+ links
1219
+ description
1220
+ content {
1221
+ examples {
1222
+ name
1223
+ description
1224
+ externalValue
1225
+ value
1226
+ summary
1227
+ }
1228
+ mediaType
1229
+ encoding {
1230
+ name
1231
+ }
1232
+ schema
1233
+ }
1234
+ }
1235
+ }`), Pr = new Y(`
1236
+ query GetSchemas($input: JSON!, $type: SchemaType!) {
1237
+ schema(input: $input, type: $type) {
1238
+ title
1239
+ description
1240
+ summary
1241
+ components {
1242
+ schemas {
1243
+ name
1244
+ schema
1245
+ extensions
1246
+ }
1247
+ }
1248
+ }
1249
+ }
1250
+ `), Or = new Y(`
1251
+ query getServerQuery($input: JSON!, $type: SchemaType!) {
1252
+ schema(input: $input, type: $type) {
1253
+ url
1254
+ servers {
1255
+ url
1256
+ }
1257
+ }
1258
+ }
1259
+ `), Lr = new Y(`
1260
+ query GetNavigationOperations($input: JSON!, $type: SchemaType!) {
1261
+ schema(input: $input, type: $type) {
1262
+ extensions
1263
+ tags {
1264
+ slug
1265
+ name
1266
+ extensions
1267
+ operations {
1268
+ summary
1269
+ slug
1270
+ method
1271
+ operationId
1272
+ path
1273
+ }
1274
+ }
1275
+ components {
1276
+ schemas {
1277
+ __typename
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ `), kr = {
1283
+ "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": Tr,
1284
+ "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n deprecated\n extensions\n servers {\n url\n description\n }\n parameters {\n name\n in\n description\n required\n schema\n style\n explode\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n": wr,
1285
+ "\n query SchemaWarmup($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n openapi\n }\n }\n": Ar,
1286
+ "\n query OperationsForTag(\n $input: JSON!\n $type: SchemaType!\n $tag: String\n $untagged: Boolean\n ) {\n schema(input: $input, type: $type) {\n servers {\n url\n }\n description\n summary\n title\n url\n version\n tag(slug: $tag, untagged: $untagged) {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n extensions\n next {\n name\n slug\n extensions\n }\n prev {\n name\n slug\n extensions\n }\n }\n }\n }\n": $r,
1287
+ "\n query GetSchemas($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n title\n description\n summary\n components {\n schemas {\n name\n schema\n extensions\n }\n }\n }\n }\n": Pr,
1288
+ "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": Or,
1289
+ "\n query GetNavigationOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n extensions\n tags {\n slug\n name\n extensions\n operations {\n summary\n slug\n method\n operationId\n path\n }\n }\n components {\n schemas {\n __typename\n }\n }\n }\n }\n": Lr
1290
+ };
1291
+ function Er(e) {
1292
+ return kr[e] ?? {};
1293
+ }
1294
+ function B({
1295
+ ...e
1296
+ }) {
1297
+ return /* @__PURE__ */ t.jsx(st.Root, { "data-slot": "collapsible", ...e });
1298
+ }
1299
+ function ce({
1300
+ ...e
1301
+ }) {
1302
+ return /* @__PURE__ */ t.jsx(
1303
+ st.CollapsibleTrigger,
1304
+ {
1305
+ "data-slot": "collapsible-trigger",
1306
+ ...e
1307
+ }
1308
+ );
1309
+ }
1310
+ function _({
1311
+ ...e
1312
+ }) {
1313
+ return /* @__PURE__ */ t.jsx(
1314
+ st.CollapsibleContent,
1315
+ {
1316
+ "data-slot": "collapsible-content",
1317
+ ...e
1318
+ }
1319
+ );
1320
+ }
1321
+ function Rr() {
1322
+ const n = navigator.userAgent.toLowerCase();
1323
+ if (n.indexOf("win") !== -1)
1324
+ return "windows";
1325
+ if (n.indexOf("mac") !== -1)
1326
+ return "apple";
1327
+ if (n.indexOf("linux") !== -1)
1328
+ return "linux";
1329
+ if (n.indexOf("x11") !== -1)
1330
+ return "unix";
1331
+ }
1332
+ function Ir() {
1333
+ return Rr() === "apple";
1334
+ }
1335
+ const Dr = {
1336
+ other: {
1337
+ alt: "Alt",
1338
+ meta: "Ctrl",
1339
+ ctrl: "Ctrl",
1340
+ shift: "⇧",
1341
+ option: "Alt"
1342
+ },
1343
+ apple: {
1344
+ alt: "⌥",
1345
+ meta: "⌘",
1346
+ ctrl: "Ctrl",
1347
+ shift: "⇧",
1348
+ option: "⌥"
1349
+ }
1350
+ }, Fr = (e, n) => {
1351
+ const s = e.toLowerCase().split("+"), a = s.includes("meta"), r = s.includes("shift"), o = s.includes("option") || s.includes("alt"), i = s.includes("ctrl"), c = e.split("+").pop(), l = k(n);
1352
+ return G(() => {
1353
+ l.current = n;
1354
+ }, [n]), G(() => {
1355
+ const m = (d) => {
1356
+ (d.code === `Key${c?.toUpperCase()}` || d.code.toLowerCase() === c?.toLowerCase()) && d.metaKey === a && d.shiftKey === r && d.altKey === o && d.ctrlKey === i && (d.preventDefault(), l.current());
1357
+ };
1358
+ return window.addEventListener("keydown", m), () => {
1359
+ window.removeEventListener("keydown", m);
1360
+ };
1361
+ }, [c, a, r, o, i]), {
1362
+ trigger: () => l.current(),
1363
+ label: s.map(
1364
+ (m) => m === "meta" || m === "ctrl" || m === "alt" || m === "shift" || m === "option" ? Dr[Ir() ? "apple" : "other"][m] : m
1365
+ )
1366
+ };
1367
+ }, zr = Ze()(
1368
+ Ye(
1369
+ (e) => ({
1370
+ selectedServer: void 0,
1371
+ setSelectedServer: (n) => e({ selectedServer: n })
1372
+ }),
1373
+ { name: "zudoku-selected-server" }
1374
+ )
1375
+ ), Vr = (e) => {
1376
+ const { selectedServer: n, setSelectedServer: s } = zr();
1377
+ return { selectedServer: Bt(
1378
+ () => n && e.some((r) => r.url === n) ? n : e.at(0)?.url ?? "",
1379
+ [n, e]
1380
+ ), setSelectedServer: s };
1381
+ }, dn = xe.forwardRef(
1382
+ ({ className: e, ...n }, s) => /* @__PURE__ */ t.jsx(
1383
+ "textarea",
1384
+ {
1385
+ className: w(
1386
+ "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1387
+ e
1388
+ ),
1389
+ ref: s,
1390
+ ...n
1391
+ }
1392
+ )
1393
+ );
1394
+ dn.displayName = "Textarea";
1395
+ const ke = (e = 0) => {
1396
+ if (e === 0)
1397
+ return "0 B";
1398
+ const n = Math.floor(Math.log(e) / Math.log(1e3));
1399
+ return `${(e / 1e3 ** n).toFixed(n ? 2 : 0)} ${n ? `${"kMGTPEZY"[n - 1]}B` : "B"}`;
1400
+ }, Z = ({
1401
+ children: e,
1402
+ className: n
1403
+ }) => /* @__PURE__ */ t.jsxs(
1404
+ "div",
1405
+ {
1406
+ className: w(
1407
+ "grid grid-cols-[max-content_1fr_max-content] items-center gap-2 group bg-muted w-full h-10 ps-4 pe-2 border-b",
1408
+ n
1409
+ ),
1410
+ children: [
1411
+ e,
1412
+ /* @__PURE__ */ t.jsxs(
1413
+ ce,
1414
+ {
1415
+ className: w(
1416
+ "flex items-center gap-4 group bg-muted w-full p-2 hover:bg-accent hover:brightness-95 opacity-75 rounded-md",
1417
+ n
1418
+ ),
1419
+ children: [
1420
+ /* @__PURE__ */ t.jsx(
1421
+ Ln,
1422
+ {
1423
+ className: "group-data-[state=closed]:hidden shrink-0",
1424
+ size: 14
1425
+ }
1426
+ ),
1427
+ /* @__PURE__ */ t.jsx(
1428
+ kn,
1429
+ {
1430
+ className: "group-data-[state=open]:hidden shrink-0",
1431
+ size: 14
1432
+ }
1433
+ )
1434
+ ]
1435
+ }
1436
+ )
1437
+ ]
1438
+ }
1439
+ ), H = ({
1440
+ children: e,
1441
+ className: n
1442
+ }) => /* @__PURE__ */ t.jsx("span", { className: w("font-semibold w-full text-start", n), children: e }), Br = ({
1443
+ examples: e,
1444
+ onSelect: n
1445
+ }) => /* @__PURE__ */ t.jsxs(Jt, { children: [
1446
+ /* @__PURE__ */ t.jsx(Wt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
1447
+ q,
1448
+ {
1449
+ variant: "ghost",
1450
+ size: "sm",
1451
+ className: "hover:bg-accent hover:brightness-95 gap-2",
1452
+ children: [
1453
+ "Use Example",
1454
+ /* @__PURE__ */ t.jsx(Je, { size: 14 })
1455
+ ]
1456
+ }
1457
+ ) }),
1458
+ /* @__PURE__ */ t.jsx(Xt, { className: "max-w-72", children: e.map((s) => /* @__PURE__ */ t.jsxs("div", { children: [
1459
+ /* @__PURE__ */ t.jsx(As, { children: s.mediaType }),
1460
+ /* @__PURE__ */ t.jsx($s, {}),
1461
+ /* @__PURE__ */ t.jsx(Ps, { children: s.examples?.map((a) => /* @__PURE__ */ t.jsx(
1462
+ Ae,
1463
+ {
1464
+ onSelect: () => n(a, s.mediaType),
1465
+ children: /* @__PURE__ */ t.jsx(
1466
+ "span",
1467
+ {
1468
+ className: "line-clamp-1",
1469
+ title: a.summary ?? a.name,
1470
+ children: a.summary ?? a.name
1471
+ }
1472
+ )
1473
+ },
1474
+ a.name
1475
+ )) })
1476
+ ] }, s.mediaType)) })
1477
+ ] }), Ee = ye(
1478
+ "div",
1479
+ "grid grid-cols-[min-content_2fr_3fr] items-center gap-x-5 [&>*:last-child_[data-slot=remove-button]]:invisible"
1480
+ ), ge = ye(
1481
+ "div",
1482
+ "group h-9 hover:bg-accent/75 ps-4 pe-2 grid col-span-full grid-cols-subgrid items-center border-b"
1483
+ ), I = ye(
1484
+ Os,
1485
+ "w-full truncate border-0 p-0 m-0 shadow-none text-xs focus-visible:ring-0 font-mono"
1486
+ ), at = ({
1487
+ onClick: e,
1488
+ className: n
1489
+ }) => /* @__PURE__ */ t.jsx(
1490
+ pe,
1491
+ {
1492
+ size: "icon-xs",
1493
+ variant: "ghost",
1494
+ className: w(
1495
+ "text-muted-foreground opacity-0 group-hover:brightness-95 focus-visible:opacity-100 group-hover:opacity-100",
1496
+ n
1497
+ ),
1498
+ onClick: e,
1499
+ type: "button",
1500
+ "data-slot": "remove-button",
1501
+ children: /* @__PURE__ */ t.jsx(It, { size: 14 })
1502
+ }
1503
+ );
1504
+ function ve({
1505
+ className: e,
1506
+ ...n
1507
+ }) {
1508
+ return /* @__PURE__ */ t.jsx(
1509
+ Tt.Root,
1510
+ {
1511
+ "data-slot": "checkbox",
1512
+ className: w(
1513
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
1514
+ e
1515
+ ),
1516
+ ...n,
1517
+ children: /* @__PURE__ */ t.jsx(
1518
+ Tt.Indicator,
1519
+ {
1520
+ "data-slot": "checkbox-indicator",
1521
+ className: "grid place-content-center text-current transition-none",
1522
+ children: /* @__PURE__ */ t.jsx(Dt, { className: "size-3.5" })
1523
+ }
1524
+ )
1525
+ }
1526
+ );
1527
+ }
1528
+ const _r = ({ index: e, manager: n }) => {
1529
+ const s = k(null), a = n.getValue(e, "value");
1530
+ return /* @__PURE__ */ t.jsxs(ge, { children: [
1531
+ /* @__PURE__ */ t.jsx(
1532
+ ve,
1533
+ {
1534
+ ...n.getCheckboxProps(e),
1535
+ disabled: !n.getValue(e, "name")
1536
+ }
1537
+ ),
1538
+ /* @__PURE__ */ t.jsx(
1539
+ I,
1540
+ {
1541
+ ...n.getNameInputProps(e),
1542
+ placeholder: "Key"
1543
+ }
1544
+ ),
1545
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 flex-1", children: [
1546
+ a instanceof File ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 flex-1 min-w-0", children: [
1547
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 border-b cursor-default", children: [
1548
+ /* @__PURE__ */ t.jsx(ue, { size: 12, className: "text-muted-foreground" }),
1549
+ /* @__PURE__ */ t.jsx(
1550
+ "span",
1551
+ {
1552
+ className: "text-xs truncate",
1553
+ title: `${a.name} (${ke(a.size)})`,
1554
+ children: a.name
1555
+ }
1556
+ )
1557
+ ] }),
1558
+ /* @__PURE__ */ t.jsx(
1559
+ pe,
1560
+ {
1561
+ type: "button",
1562
+ variant: "ghost",
1563
+ size: "icon-xs",
1564
+ className: "opacity-50 hover:opacity-100 hover:brightness-95 transition-opacity",
1565
+ onClick: () => n.setValue(e, "value", ""),
1566
+ children: /* @__PURE__ */ t.jsx(En, { size: 13 })
1567
+ }
1568
+ )
1569
+ ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1570
+ /* @__PURE__ */ t.jsx(
1571
+ I,
1572
+ {
1573
+ ...n.getValueInputProps(e),
1574
+ placeholder: "Value"
1575
+ }
1576
+ ),
1577
+ /* @__PURE__ */ t.jsx(
1578
+ "input",
1579
+ {
1580
+ ref: s,
1581
+ type: "file",
1582
+ className: "hidden",
1583
+ onChange: (r) => {
1584
+ const o = r.target.files?.[0];
1585
+ o && (n.setValue(e, "value", o), n.setValue(e, "active", !0));
1586
+ }
1587
+ }
1588
+ ),
1589
+ /* @__PURE__ */ t.jsx(
1590
+ pe,
1591
+ {
1592
+ type: "button",
1593
+ variant: "ghost",
1594
+ size: "icon-xs",
1595
+ onClick: () => s.current?.click(),
1596
+ title: "Attach file",
1597
+ className: "opacity-0 focus-visible:opacity-100 group-hover:opacity-100 group-hover:brightness-95 transition-opacity",
1598
+ children: /* @__PURE__ */ t.jsx(ue, { size: 14 })
1599
+ }
1600
+ )
1601
+ ] }),
1602
+ /* @__PURE__ */ t.jsx(at, { ...n.getRemoveButtonProps(e) })
1603
+ ] })
1604
+ ] });
1605
+ }, ot = (e) => {
1606
+ const {
1607
+ control: n,
1608
+ name: s,
1609
+ defaultValue: a,
1610
+ isEmpty: r,
1611
+ shouldSetActive: o
1612
+ } = e, {
1613
+ setValue: i,
1614
+ watch: c,
1615
+ setFocus: l,
1616
+ register: m
1617
+ } = ae(), { fields: d, append: f, remove: x } = Mt({ control: n, name: s }), h = c(s), v = k(-1), u = k(-1), y = D(
1618
+ (g, C, T, A) => {
1619
+ (C === "value" || C === "name") && (v.current = g), i(`${s}.${g}.${C}`, T), A?.focus === "next" ? l(
1620
+ C === "name" ? `${s}.${g}.value` : `${s}.${g + 1}.name`
1621
+ ) : A?.focus === "previous" && l(
1622
+ C === "name" ? `${s}.${g - 1}.value` : `${s}.${g}.name`
1623
+ );
1624
+ },
1625
+ [s, i, l]
1626
+ ), S = D(
1627
+ (g) => r ? r(g) : !g.name && !g.value,
1628
+ [r]
1629
+ ), R = D(
1630
+ (g) => o ? o(g) : !!(g.name || g.value),
1631
+ [o]
1632
+ );
1633
+ G(() => {
1634
+ if (!h) return;
1635
+ if (u.current === -1) {
1636
+ u.current = h.length, h.length === 0 && f(a, {
1637
+ shouldFocus: !1
1638
+ });
1639
+ return;
1640
+ }
1641
+ if (u.current = h.length, h.length === 0) {
1642
+ f(a, {
1643
+ shouldFocus: !1
1644
+ });
1645
+ return;
1646
+ }
1647
+ if (h.length > 1) {
1648
+ const C = [];
1649
+ for (let T = 0; T < h.length - 1; T++) {
1650
+ const A = h[T];
1651
+ A && S(A) && !R(A) && C.push(T);
1652
+ }
1653
+ if (C.length > 0) {
1654
+ const T = C[0];
1655
+ if (T === void 0) return;
1656
+ for (let A = C.length - 1; A >= 0; A--) {
1657
+ const M = C[A];
1658
+ M !== void 0 && x(M);
1659
+ }
1660
+ if (v.current === T) {
1661
+ const A = h.length - C.length;
1662
+ T < A ? l(`${s}.${T}.name`) : T > 0 ? l(`${s}.${T - 1}.name`) : l(`${s}.0.name`);
1663
+ }
1664
+ v.current = -1;
1665
+ }
1666
+ }
1667
+ const g = h[h.length - 1];
1668
+ g && !S(g) && f(a, {
1669
+ shouldFocus: !1
1670
+ });
1671
+ }, [
1672
+ h,
1673
+ f,
1674
+ x,
1675
+ a,
1676
+ S,
1677
+ s,
1678
+ l,
1679
+ R
1680
+ ]), G(() => {
1681
+ if (!h) return;
1682
+ const g = [];
1683
+ for (let C = 0; C < h.length; C++) {
1684
+ const T = h[C];
1685
+ if (!T) continue;
1686
+ const A = R(T);
1687
+ T.active !== A && g.push(() => y(C, "active", A));
1688
+ }
1689
+ g.length !== 0 && cs(() => g.forEach((C) => C()));
1690
+ }, [h, R, y]);
1691
+ const N = D(
1692
+ (g) => {
1693
+ const C = h?.[g];
1694
+ return C ? S(C) : !0;
1695
+ },
1696
+ [h, S]
1697
+ ), j = D(
1698
+ (g, C) => {
1699
+ const T = C === "name" ? `${s}.${g}.value` : `${s}.${g + 1}.name`, A = C === "name" ? `${s}.${g - 1}.value` : `${s}.${g}.name`, M = C === "value" || g > 0;
1700
+ return (L) => {
1701
+ if (!(L.target instanceof HTMLInputElement)) return;
1702
+ const De = L.target.selectionStart === 0, te = L.target.selectionStart === L.target.value.length, je = !L.target.value;
1703
+ L.key === "Enter" ? l(T) : L.key === "Backspace" && je && M || L.key === "ArrowLeft" && De && M ? (L.preventDefault(), l(A)) : L.key === "ArrowRight" && te && (L.preventDefault(), l(T));
1704
+ };
1705
+ },
1706
+ [s, l]
1707
+ ), O = D(
1708
+ (g) => ({
1709
+ ...m(`${s}.${g}.name`),
1710
+ onChange: (C) => y(g, "name", C.target.value),
1711
+ onKeyDown: j(g, "name")
1712
+ }),
1713
+ [m, s, y, j]
1714
+ ), Q = D(
1715
+ (g) => ({
1716
+ ...m(`${s}.${g}.value`),
1717
+ onChange: (C) => y(g, "value", C.target.value),
1718
+ onKeyDown: j(g, "value")
1719
+ }),
1720
+ [m, s, y, j]
1721
+ ), be = D(
1722
+ (g) => ({
1723
+ ...m(`${s}.${g}.active`),
1724
+ checked: c(`${s}.${g}.active`) ?? !1,
1725
+ disabled: N(g),
1726
+ onCheckedChange: (C) => {
1727
+ y(g, "active", C === !0);
1728
+ }
1729
+ }),
1730
+ [s, m, N, c, y]
1731
+ ), Ie = D(
1732
+ (g, C) => h?.[g]?.[C],
1733
+ [h]
1734
+ ), ee = D(
1735
+ (g) => ({
1736
+ onClick: () => x(g),
1737
+ disabled: g === d.length - 1
1738
+ }),
1739
+ [x, d.length]
1740
+ );
1741
+ return {
1742
+ fields: d,
1743
+ getNameInputProps: O,
1744
+ getValueInputProps: Q,
1745
+ getCheckboxProps: be,
1746
+ getRemoveButtonProps: ee,
1747
+ setValue: y,
1748
+ getValue: Ie
1749
+ };
1750
+ }, qr = ({ content: e }) => {
1751
+ const { register: n, setValue: s, watch: a, control: r } = ae(), o = (e ?? []).flatMap((j) => j.examples), [i, c, l, m, d] = a([
1752
+ "headers",
1753
+ "file",
1754
+ "bodyMode",
1755
+ "body",
1756
+ "multipartFormFields"
1757
+ ]), f = k(null), [x, h] = E(!1), v = (j) => {
1758
+ s("file", j), j && s(
1759
+ "headers",
1760
+ i.filter(
1761
+ (O) => O.name.toLowerCase() !== "content-type" || !O.active
1762
+ )
1763
+ );
1764
+ }, u = (j) => {
1765
+ const O = j.target.files?.[0] ?? null;
1766
+ v(O);
1767
+ }, y = (j) => {
1768
+ j.preventDefault(), j.stopPropagation(), h(!0);
1769
+ }, S = (j) => {
1770
+ j.preventDefault(), j.stopPropagation(), h(!1);
1771
+ }, R = (j) => {
1772
+ j.preventDefault(), j.stopPropagation(), h(!1);
1773
+ const O = j.dataTransfer.files?.[0] ?? null;
1774
+ v(O);
1775
+ }, N = ot({
1776
+ control: r,
1777
+ name: "multipartFormFields",
1778
+ defaultValue: { name: "", value: "", active: !1 },
1779
+ isEmpty: (j) => j.value instanceof File ? !1 : !j.name && !j.value
1780
+ });
1781
+ return /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
1782
+ /* @__PURE__ */ t.jsxs(Z, { className: "items-center", children: [
1783
+ /* @__PURE__ */ t.jsx(Rn, { size: 16 }),
1784
+ /* @__PURE__ */ t.jsxs(H, { className: "flex items-center justify-between", children: [
1785
+ "Body",
1786
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1787
+ /* @__PURE__ */ t.jsxs(Jt, { children: [
1788
+ /* @__PURE__ */ t.jsx(Wt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
1789
+ pe,
1790
+ {
1791
+ variant: "ghost",
1792
+ size: "sm",
1793
+ className: "hover:bg-accent hover:brightness-95 gap-2",
1794
+ children: [
1795
+ l === "text" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1796
+ /* @__PURE__ */ t.jsx(yt, { size: 14 }),
1797
+ "Text"
1798
+ ] }) : l === "file" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1799
+ /* @__PURE__ */ t.jsx(ue, { size: 14 }),
1800
+ "File"
1801
+ ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1802
+ /* @__PURE__ */ t.jsx(vt, { size: 14 }),
1803
+ "Multipart"
1804
+ ] }),
1805
+ /* @__PURE__ */ t.jsx(In, { size: 14 })
1806
+ ]
1807
+ }
1808
+ ) }),
1809
+ /* @__PURE__ */ t.jsxs(Xt, { className: "min-w-40", children: [
1810
+ /* @__PURE__ */ t.jsxs(
1811
+ Ae,
1812
+ {
1813
+ onSelect: () => s("bodyMode", "text"),
1814
+ className: "gap-2",
1815
+ children: [
1816
+ /* @__PURE__ */ t.jsx(yt, { size: 14 }),
1817
+ /* @__PURE__ */ t.jsx("span", { className: "flex-1", children: "Text" }),
1818
+ /* @__PURE__ */ t.jsx("span", { children: m.length > 0 && /* @__PURE__ */ t.jsx("div", { className: "w-1.5 h-1.5 bg-primary rounded-full" }) })
1819
+ ]
1820
+ }
1821
+ ),
1822
+ /* @__PURE__ */ t.jsxs(
1823
+ Ae,
1824
+ {
1825
+ onSelect: () => s("bodyMode", "file"),
1826
+ className: "gap-2",
1827
+ children: [
1828
+ /* @__PURE__ */ t.jsx(ue, { size: 14 }),
1829
+ /* @__PURE__ */ t.jsx("span", { className: "flex-1", children: "File" }),
1830
+ /* @__PURE__ */ t.jsx("span", { children: c && /* @__PURE__ */ t.jsx("div", { className: "w-1.5 h-1.5 bg-primary rounded-full" }) })
1831
+ ]
1832
+ }
1833
+ ),
1834
+ /* @__PURE__ */ t.jsxs(
1835
+ Ae,
1836
+ {
1837
+ onSelect: () => s("bodyMode", "multipart"),
1838
+ className: "gap-2",
1839
+ children: [
1840
+ /* @__PURE__ */ t.jsx(vt, { size: 14, strokeWidth: 1.5 }),
1841
+ /* @__PURE__ */ t.jsx("span", { className: "flex-1", children: "Multipart" }),
1842
+ /* @__PURE__ */ t.jsx("span", { children: d?.some((j) => j.active) && /* @__PURE__ */ t.jsx("div", { className: "w-1.5 h-1.5 bg-primary rounded-full" }) })
1843
+ ]
1844
+ }
1845
+ )
1846
+ ] })
1847
+ ] }),
1848
+ /* @__PURE__ */ t.jsx(
1849
+ "input",
1850
+ {
1851
+ ref: f,
1852
+ type: "file",
1853
+ className: "hidden",
1854
+ onChange: u
1855
+ }
1856
+ ),
1857
+ /* @__PURE__ */ t.jsx("div", { className: "w-px mx-1 h-5 bg-border" }),
1858
+ e && o.length > 0 ? /* @__PURE__ */ t.jsx(
1859
+ Br,
1860
+ {
1861
+ examples: e,
1862
+ onSelect: (j, O) => {
1863
+ s("body", JSON.stringify(j.value, null, 2)), s("headers", [
1864
+ ...i.filter((Q) => Q.name !== "Content-Type"),
1865
+ {
1866
+ name: "Content-Type",
1867
+ value: O,
1868
+ active: !0
1869
+ }
1870
+ ]);
1871
+ }
1872
+ }
1873
+ ) : /* @__PURE__ */ t.jsx("div", {})
1874
+ ] })
1875
+ ] })
1876
+ ] }),
1877
+ /* @__PURE__ */ t.jsxs(_, { className: "CollapsibleContent flex flex-col gap-2", children: [
1878
+ l === "text" && /* @__PURE__ */ t.jsx(
1879
+ dn,
1880
+ {
1881
+ ...n("body"),
1882
+ className: w(
1883
+ "w-full px-4 py-2.5 h-64 font-mono md:text-xs border-none rounded-none focus-visible:ring-0 transition-colors"
1884
+ ),
1885
+ placeholder: "Body content"
1886
+ }
1887
+ ),
1888
+ l === "file" && /* @__PURE__ */ t.jsxs(
1889
+ "div",
1890
+ {
1891
+ role: "region",
1892
+ "aria-label": "File upload drop zone",
1893
+ className: w(
1894
+ "flex flex-col items-center justify-center gap-4 min-h-[300px]"
1895
+ ),
1896
+ onDragOver: y,
1897
+ onDragLeave: S,
1898
+ onDrop: R,
1899
+ children: [
1900
+ /* @__PURE__ */ t.jsx(
1901
+ "button",
1902
+ {
1903
+ type: "button",
1904
+ onClick: () => f.current?.click(),
1905
+ className: w(
1906
+ "flex items-center justify-center gap-2 rounded-full size-20 p-0 border border-dashed border-muted-foreground/50 hover:bg-accent/75 transition-colors",
1907
+ (c || x) && "border-solid",
1908
+ x && "bg-accent border-primary"
1909
+ ),
1910
+ children: /* @__PURE__ */ t.jsx(
1911
+ ue,
1912
+ {
1913
+ className: w(
1914
+ "text-muted-foreground",
1915
+ x && "text-primary"
1916
+ ),
1917
+ size: 30
1918
+ }
1919
+ )
1920
+ }
1921
+ ),
1922
+ c ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-2 px-2 py-1.5 rounded-md border", children: [
1923
+ /* @__PURE__ */ t.jsxs("span", { className: "text-sm truncate", title: c.name, children: [
1924
+ c.name,
1925
+ " ",
1926
+ /* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
1927
+ "(",
1928
+ ke(c.size),
1929
+ ")"
1930
+ ] })
1931
+ ] }),
1932
+ /* @__PURE__ */ t.jsx(
1933
+ pe,
1934
+ {
1935
+ type: "button",
1936
+ variant: "ghost",
1937
+ size: "icon-xxs",
1938
+ onClick: () => v(null),
1939
+ children: /* @__PURE__ */ t.jsx(It, { size: 14 })
1940
+ }
1941
+ )
1942
+ ] }) : /* @__PURE__ */ t.jsx("span", { className: "text-lg font-semibold text-muted-foreground", children: "Select or drop a file" })
1943
+ ]
1944
+ }
1945
+ ),
1946
+ l === "multipart" && /* @__PURE__ */ t.jsx(Ee, { children: N.fields.map((j, O) => /* @__PURE__ */ t.jsx(_r, { index: O, manager: N }, j.id)) })
1947
+ ] })
1948
+ ] });
1949
+ }, Lt = (e, n, s) => {
1950
+ const a = n.replace(/(:\w+|\{\w+})/g, (o) => {
1951
+ const i = o.replace(/[:{}]/g, "");
1952
+ return s.pathParams.find((l) => l.name === i)?.value ?? o;
1953
+ }), r = new URL(
1954
+ a.replace(/^\//, ""),
1955
+ e.endsWith("/") ? e : `${e}/`
1956
+ );
1957
+ return s.queryParams.filter((o) => o.active).forEach((o) => {
1958
+ r.searchParams.set(o.name, o.value);
1959
+ }), r;
1960
+ };
1961
+ function Mr(e) {
1962
+ return /^(application\/octet-stream|image\/|audio\/|video\/|font\/|application\/pdf|application\/zip|application\/x-protobuf|application\/x-binary)/i.test(
1963
+ e
1964
+ );
1965
+ }
1966
+ const Ur = (e, n) => {
1967
+ const s = e.find(
1968
+ ([a]) => a.toLowerCase() === "content-disposition"
1969
+ )?.[1];
1970
+ if (s) {
1971
+ const a = s.match(
1972
+ /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/
1973
+ );
1974
+ if (a?.[1])
1975
+ return a[1].replace(/['"]/g, "");
1976
+ }
1977
+ try {
1978
+ const r = new URL(n).pathname.split("/").pop() || "download";
1979
+ return r.includes(".") ? r : "download";
1980
+ } catch {
1981
+ return "download";
1982
+ }
1983
+ }, Gr = $e.Root, un = xe.forwardRef(({ className: e, align: n = "center", sideOffset: s = 4, ...a }, r) => /* @__PURE__ */ t.jsx($e.Portal, { children: /* @__PURE__ */ t.jsx(
1984
+ $e.Content,
1985
+ {
1986
+ ref: r,
1987
+ align: n,
1988
+ sideOffset: s,
1989
+ className: w(
1990
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1991
+ e
1992
+ ),
1993
+ ...a
1994
+ }
1995
+ ) }));
1996
+ un.displayName = $e.Content.displayName;
1997
+ const Hr = ({
1998
+ value: e,
1999
+ options: n,
2000
+ onChange: s,
2001
+ className: a,
2002
+ placeholder: r = "Value",
2003
+ onEnterPress: o,
2004
+ onKeyDown: i,
2005
+ ref: c,
2006
+ onSelect: l
2007
+ }) => {
2008
+ const [m, d] = E(!1), [f, x] = E(!1), h = ks((u) => u.filtered.count), v = k(null);
2009
+ return /* @__PURE__ */ t.jsxs(Gr, { open: m, children: [
2010
+ /* @__PURE__ */ t.jsx(Ls, { children: /* @__PURE__ */ t.jsx(
2011
+ Rs,
2012
+ {
2013
+ autoComplete: "off",
2014
+ ref: (u) => {
2015
+ v.current = u, typeof c == "function" ? c(u) : c && (c.current = u);
2016
+ },
2017
+ value: e ? String(e) : void 0,
2018
+ placeholder: r,
2019
+ className: w("h-9 bg-transparent", a),
2020
+ onFocus: () => d(!0),
2021
+ onBlur: () => {
2022
+ f || d(!1);
2023
+ },
2024
+ onKeyDown: (u) => {
2025
+ i?.(u), !u.defaultPrevented && u.key === "Enter" && (d(!1), v.current?.blur(), o?.(u));
2026
+ },
2027
+ onValueChange: (u) => s(u)
2028
+ }
2029
+ ) }),
2030
+ /* @__PURE__ */ t.jsx(
2031
+ un,
2032
+ {
2033
+ onMouseEnter: () => x(!0),
2034
+ onMouseLeave: () => x(!1),
2035
+ onOpenAutoFocus: (u) => u.preventDefault(),
2036
+ className: w("p-0 w-(--radix-popover-trigger-width)", {
2037
+ "border-0": h === 0
2038
+ }),
2039
+ align: "start",
2040
+ side: "bottom",
2041
+ onWheel: (u) => {
2042
+ u.stopPropagation();
2043
+ },
2044
+ onTouchMove: (u) => {
2045
+ u.stopPropagation();
2046
+ },
2047
+ children: /* @__PURE__ */ t.jsx(Is, { className: "max-h-[140px]", children: n.map((u) => /* @__PURE__ */ t.jsx(
2048
+ Ds,
2049
+ {
2050
+ value: u,
2051
+ onSelect: (y) => {
2052
+ l?.(y), s(y), d(!1);
2053
+ },
2054
+ className: "cursor-pointer",
2055
+ children: u
2056
+ },
2057
+ u
2058
+ )) })
2059
+ }
2060
+ )
2061
+ ] });
2062
+ }, Pe = ({ shouldFilter: e, ...n }) => /* @__PURE__ */ t.jsx(Es, { className: "bg-transparent", shouldFilter: e, children: /* @__PURE__ */ t.jsx(Hr, { ...n }) }), Qr = Object.freeze([
2063
+ "Accept",
2064
+ "Accept-Encoding",
2065
+ "Accept-Language",
2066
+ "Authorization",
2067
+ "Cache-Control",
2068
+ "Connection",
2069
+ "Content-Disposition",
2070
+ "Content-Encoding",
2071
+ "Content-Language",
2072
+ "Content-Length",
2073
+ "Content-Range",
2074
+ "Content-Security-Policy",
2075
+ "Content-Type",
2076
+ "Cookie",
2077
+ "Date",
2078
+ "ETag",
2079
+ "Expires",
2080
+ "Host",
2081
+ "If-Modified-Since",
2082
+ "Location",
2083
+ "Origin",
2084
+ "Pragma",
2085
+ "Referer",
2086
+ "Set-Cookie",
2087
+ "User-Agent",
2088
+ "X-Requested-With"
2089
+ ]), Jr = ({
2090
+ control: e,
2091
+ schemaHeaders: n,
2092
+ lockedHeaders: s
2093
+ }) => {
2094
+ const { watch: a, formState: r } = ae(), o = a("headers"), i = ot({
2095
+ control: e,
2096
+ name: "headers",
2097
+ defaultValue: { name: "", value: "", active: !1 }
2098
+ }), c = n.filter((d) => !o.some((f) => f.name === d.name)).map(({ name: d }) => d), l = i.fields.flatMap((d, f) => !s?.map((h) => h.toLowerCase()).includes(d.name.toLowerCase()) ? [] : [f]), m = s?.map((d) => ({
2099
+ name: d,
2100
+ id: `locked-${d}`,
2101
+ value: "••••••••••",
2102
+ active: !0,
2103
+ locked: !0
2104
+ })) ?? [];
2105
+ return /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
2106
+ /* @__PURE__ */ t.jsxs(Z, { children: [
2107
+ /* @__PURE__ */ t.jsx(Dn, { size: 14 }),
2108
+ /* @__PURE__ */ t.jsx(H, { children: "Headers" })
2109
+ ] }),
2110
+ /* @__PURE__ */ t.jsx(_, { className: "CollapsibleContent", children: /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ t.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ t.jsxs(Ee, { children: [
2111
+ m.map((d) => /* @__PURE__ */ t.jsxs(Ct, { children: [
2112
+ /* @__PURE__ */ t.jsx(Nt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
2113
+ ge,
2114
+ {
2115
+ className: "opacity-50 cursor-not-allowed font-mono text-xs min-h-10",
2116
+ children: [
2117
+ /* @__PURE__ */ t.jsx(Fn, { size: 16 }),
2118
+ /* @__PURE__ */ t.jsx(I, { value: d.name, disabled: !0 }),
2119
+ /* @__PURE__ */ t.jsx("div", { children: d.value })
2120
+ ]
2121
+ },
2122
+ d.id
2123
+ ) }),
2124
+ /* @__PURE__ */ t.jsx(St, { alignOffset: 10, side: "bottom", align: "start", children: /* @__PURE__ */ t.jsx("p", { children: "This header is set by the selected authentication." }) })
2125
+ ] }, d.id)),
2126
+ i.fields.map((d, f) => {
2127
+ const x = n.find(
2128
+ (S) => S.name === o.at(f)?.name
2129
+ ), h = x?.enum && x.enum.length > 0, v = l.includes(f), u = i.getNameInputProps(f), y = i.getValueInputProps(f);
2130
+ return /* @__PURE__ */ t.jsxs(
2131
+ ge,
2132
+ {
2133
+ className: w(
2134
+ v && "text-amber-600",
2135
+ v && !r.dirtyFields.headers?.[f]?.value && "hidden"
2136
+ ),
2137
+ children: [
2138
+ /* @__PURE__ */ t.jsx(
2139
+ ve,
2140
+ {
2141
+ className: w(v && "hidden"),
2142
+ ...i.getCheckboxProps(f)
2143
+ }
2144
+ ),
2145
+ /* @__PURE__ */ t.jsxs(Ct, { children: [
2146
+ /* @__PURE__ */ t.jsx(Nt, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2147
+ zn,
2148
+ {
2149
+ className: w(
2150
+ "text-amber-600",
2151
+ !v && "hidden"
2152
+ ),
2153
+ size: 16
2154
+ }
2155
+ ) }),
2156
+ /* @__PURE__ */ t.jsx(
2157
+ St,
2158
+ {
2159
+ alignOffset: 10,
2160
+ side: "bottom",
2161
+ align: "start",
2162
+ children: /* @__PURE__ */ t.jsx("p", { children: "This header will be overwritten by the selected authentication." })
2163
+ }
2164
+ )
2165
+ ] }),
2166
+ /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2167
+ Pe,
2168
+ {
2169
+ ...u,
2170
+ value: String(i.getValue(f, "name")),
2171
+ placeholder: "Name",
2172
+ options: [...c, ...Qr],
2173
+ onChange: (S) => i.setValue(f, "name", S),
2174
+ onSelect: (S) => i.setValue(f, "name", S, { focus: "next" })
2175
+ }
2176
+ ) }),
2177
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2178
+ h ? /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2179
+ Pe,
2180
+ {
2181
+ ...y,
2182
+ value: String(i.getValue(f, "value")),
2183
+ shouldFilter: !1,
2184
+ options: x.enum ?? [],
2185
+ onChange: (S) => i.setValue(f, "value", S),
2186
+ onSelect: (S) => i.setValue(f, "value", S, { focus: "next" })
2187
+ }
2188
+ ) }) : /* @__PURE__ */ t.jsx(
2189
+ I,
2190
+ {
2191
+ placeholder: "Value",
2192
+ autoComplete: "off",
2193
+ ...y
2194
+ }
2195
+ ),
2196
+ /* @__PURE__ */ t.jsx(
2197
+ at,
2198
+ {
2199
+ ...i.getRemoveButtonProps(f)
2200
+ }
2201
+ )
2202
+ ] })
2203
+ ]
2204
+ },
2205
+ d.id
2206
+ );
2207
+ })
2208
+ ] }) }) }) })
2209
+ ] });
2210
+ }, Wr = zs(
2211
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
2212
+ ), Re = xe.forwardRef(({ className: e, ...n }, s) => /* @__PURE__ */ t.jsx(
2213
+ Kt.Root,
2214
+ {
2215
+ ref: s,
2216
+ className: w(Wr(), e),
2217
+ ...n
2218
+ }
2219
+ ));
2220
+ Re.displayName = Kt.Root.displayName;
2221
+ const mn = xe.forwardRef(({ className: e, ...n }, s) => /* @__PURE__ */ t.jsx(
2222
+ he.Root,
2223
+ {
2224
+ className: w("grid gap-2", e),
2225
+ ...n,
2226
+ ref: s
2227
+ }
2228
+ ));
2229
+ mn.displayName = he.Root.displayName;
2230
+ const pn = xe.forwardRef(({ className: e, ...n }, s) => /* @__PURE__ */ t.jsx(
2231
+ he.Item,
2232
+ {
2233
+ ref: s,
2234
+ className: w(
2235
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
2236
+ e
2237
+ ),
2238
+ ...n,
2239
+ children: /* @__PURE__ */ t.jsx(he.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ t.jsx(Vn, { className: "h-2.5 w-2.5 fill-current text-current" }) })
2240
+ }
2241
+ ));
2242
+ pn.displayName = he.Item.displayName;
2243
+ const hn = ({
2244
+ identities: e,
2245
+ setValue: n,
2246
+ value: s
2247
+ }) => /* @__PURE__ */ t.jsx("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ t.jsx(
2248
+ mn,
2249
+ {
2250
+ onValueChange: (a) => n(a),
2251
+ value: s,
2252
+ defaultValue: me,
2253
+ className: "gap-0",
2254
+ disabled: e?.length === 0,
2255
+ children: [{ id: me, label: "None" }, ...e ?? []].map(
2256
+ (a) => /* @__PURE__ */ t.jsxs(
2257
+ Re,
2258
+ {
2259
+ className: "h-10 items-center border-b font-normal flex gap-4 p-4 cursor-pointer hover:bg-accent/75",
2260
+ children: [
2261
+ /* @__PURE__ */ t.jsx(pn, { value: a.id, id: a.id }),
2262
+ /* @__PURE__ */ t.jsx("span", { children: a.label })
2263
+ ]
2264
+ },
2265
+ a.id
2266
+ )
2267
+ )
2268
+ }
2269
+ ) }), Xr = ({
2270
+ onSubmit: e,
2271
+ identities: n,
2272
+ open: s,
2273
+ onOpenChange: a
2274
+ }) => {
2275
+ const [r, o] = E(void 0), [i, c] = E(!1);
2276
+ return /* @__PURE__ */ t.jsx(et, { open: s, onOpenChange: a, children: /* @__PURE__ */ t.jsxs(tt, { children: [
2277
+ /* @__PURE__ */ t.jsx(nt, { children: "Select an auth identity" }),
2278
+ /* @__PURE__ */ t.jsx(_t, { children: "Please select an identity for this request." }),
2279
+ /* @__PURE__ */ t.jsx(Fs, { className: "max-h-80 overflow-auto", children: /* @__PURE__ */ t.jsx(
2280
+ hn,
2281
+ {
2282
+ identities: n,
2283
+ setValue: o,
2284
+ value: r
2285
+ }
2286
+ ) }),
2287
+ /* @__PURE__ */ t.jsxs(qt, { className: "flex flex-col gap-2", children: [
2288
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2289
+ /* @__PURE__ */ t.jsx(
2290
+ ve,
2291
+ {
2292
+ id: "remember",
2293
+ checked: i,
2294
+ onCheckedChange: (l) => c(
2295
+ l === "indeterminate" ? !1 : !!l
2296
+ )
2297
+ }
2298
+ ),
2299
+ /* @__PURE__ */ t.jsx(Re, { htmlFor: "remember", children: "Remember my choice" })
2300
+ ] }),
2301
+ /* @__PURE__ */ t.jsx(
2302
+ q,
2303
+ {
2304
+ onClick: () => e({ identity: r, rememberedIdentity: i }),
2305
+ children: "Send"
2306
+ }
2307
+ )
2308
+ ] })
2309
+ ] }) });
2310
+ }, Ue = (e) => Math.abs(
2311
+ Number.isNaN(Number(e)) ? e.toLowerCase().charCodeAt(0) - 96 : Number.isNaN(Number(e)) ? 0 : Number(e)
2312
+ ), Ge = (e) => e.length > 1 ? Number(e.split("").reduce((n, s) => `${Ue(n) + Ue(s)}`)) : Ue(e), kt = (e, n = {}) => {
2313
+ const s = (3 * Ge(e) + 2 * Ge(e) + Ge(e)) % 360, { saturation: a = 75, lightness: r = 60 } = n;
2314
+ return `${s}deg ${a}% ${r}%`;
2315
+ }, He = "data-linked-param", Kr = (e) => {
2316
+ const { resolvedTheme: n } = hs();
2317
+ return {
2318
+ text: kt(
2319
+ e,
2320
+ n === "light" ? { saturation: 95, lightness: 38 } : {}
2321
+ ),
2322
+ background: kt(
2323
+ e,
2324
+ n === "light" ? { saturation: 85, lightness: 40 } : {}
2325
+ )
2326
+ };
2327
+ }, fn = ({
2328
+ name: e,
2329
+ className: n,
2330
+ slug: s,
2331
+ title: a,
2332
+ children: r,
2333
+ onClick: o
2334
+ }) => {
2335
+ const i = k(null), c = s?.replace(/[{}]/g, ""), l = e.replace(/[{}]/g, ""), { text: m, background: d } = Kr(l), f = `hsl(${m} / 100%)`, x = `hsl(${d} / 10%)`, h = `hsl(${d} / 50%)`;
2336
+ return G(() => {
2337
+ if (!c || !i.current) return;
2338
+ const v = () => {
2339
+ document.querySelectorAll(`[${He}="${c}"]`).forEach((S) => {
2340
+ S instanceof HTMLElement && (S.dataset.active = "true");
2341
+ });
2342
+ }, u = () => {
2343
+ document.querySelectorAll(`[${He}="${c}"]`).forEach((S) => {
2344
+ S instanceof HTMLElement && (S.dataset.active = "false");
2345
+ });
2346
+ }, y = i.current;
2347
+ return y.addEventListener("mouseenter", v), y.addEventListener("mouseleave", u), () => {
2348
+ y.removeEventListener("mouseenter", v), y.removeEventListener("mouseleave", u);
2349
+ };
2350
+ }, [c]), // biome-ignore lint/a11y/noStaticElementInteractions: Just passing props through
2351
+ // biome-ignore lint/a11y/useKeyWithClickEvents: Just passing props through
2352
+ /* @__PURE__ */ t.jsx(
2353
+ "span",
2354
+ {
2355
+ [He]: c,
2356
+ className: w(
2357
+ // This may not contain (inline-)flex or (inline-)block otherwise it breaks the browser's full text search
2358
+ "relative transition-all duration-100 rounded-lg",
2359
+ "border border-(--border-color) p-0.5 text-(--param-color) bg-(--background-color)",
2360
+ "data-[active=true]:border-(--param-color) data-[active=true]:shadow-sm data-[active=true]:bottom-px",
2361
+ n
2362
+ ),
2363
+ title: a,
2364
+ suppressHydrationWarning: !0,
2365
+ ref: i,
2366
+ onClick: o,
2367
+ style: {
2368
+ "--param-color": f,
2369
+ "--border-color": h,
2370
+ "--background-color": x
2371
+ },
2372
+ children: r ?? e
2373
+ }
2374
+ );
2375
+ }, Zr = ({
2376
+ control: e,
2377
+ url: n
2378
+ }) => {
2379
+ const { fields: s } = Mt({
2380
+ control: e,
2381
+ name: "pathParams"
2382
+ }), a = [...s].sort(
2383
+ (r, o) => n.indexOf(`{${r.name}}`) - n.indexOf(`{${o.name}}`)
2384
+ );
2385
+ return /* @__PURE__ */ t.jsx(Ee, { children: a.map((r, o) => /* @__PURE__ */ t.jsxs(ge, { children: [
2386
+ /* @__PURE__ */ t.jsx(
2387
+ wt,
2388
+ {
2389
+ control: e,
2390
+ name: `pathParams.${o}.name`,
2391
+ render: () => /* @__PURE__ */ t.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ t.jsx(
2392
+ fn,
2393
+ {
2394
+ slug: r.name,
2395
+ name: r.name,
2396
+ className: "font-mono text-xs px-2"
2397
+ }
2398
+ ) })
2399
+ }
2400
+ ),
2401
+ /* @__PURE__ */ t.jsx("div", { className: "flex justify-between items-center col-span-2", children: /* @__PURE__ */ t.jsx(
2402
+ wt,
2403
+ {
2404
+ control: e,
2405
+ name: `pathParams.${o}.value`,
2406
+ render: ({ field: i }) => /* @__PURE__ */ t.jsx(I, { ...i, required: !0, placeholder: "Value" })
2407
+ }
2408
+ ) })
2409
+ ] }, r.id)) });
2410
+ }, Yr = ({
2411
+ control: e,
2412
+ schemaQueryParams: n
2413
+ }) => {
2414
+ const { watch: s } = ae(), a = s("queryParams"), r = ot({
2415
+ control: e,
2416
+ name: "queryParams",
2417
+ defaultValue: { name: "", value: "", active: !1 }
2418
+ }), o = n.map(
2419
+ (c) => !!c.isRequired
2420
+ ), i = n.length > 0;
2421
+ return /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
2422
+ /* @__PURE__ */ t.jsxs(Z, { children: [
2423
+ /* @__PURE__ */ t.jsx(Bn, { size: 16 }),
2424
+ /* @__PURE__ */ t.jsx(H, { children: "Query Parameters" })
2425
+ ] }),
2426
+ /* @__PURE__ */ t.jsx(_, { className: "CollapsibleContent", children: /* @__PURE__ */ t.jsx(Ee, { children: r.fields.map((c, l) => {
2427
+ const m = n.find(
2428
+ (h) => h.name === a.at(l)?.name
2429
+ ), d = m?.enum && m.enum.length > 0, f = r.getNameInputProps(l), x = r.getValueInputProps(l);
2430
+ return /* @__PURE__ */ t.jsxs(ge, { children: [
2431
+ /* @__PURE__ */ t.jsx(ve, { ...r.getCheckboxProps(l) }),
2432
+ o[l] ? /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
2433
+ "label",
2434
+ {
2435
+ className: "flex items-center cursor-pointer gap-1",
2436
+ htmlFor: `queryParams.${l}.active`,
2437
+ title: o[l] ? "Required field" : void 0,
2438
+ children: [
2439
+ a[l]?.name,
2440
+ o[l] && /* @__PURE__ */ t.jsx("sup", { children: " *" })
2441
+ ]
2442
+ }
2443
+ ) }) : i ? /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2444
+ Pe,
2445
+ {
2446
+ ...f,
2447
+ value: String(r.getValue(l, "name")),
2448
+ placeholder: "Name",
2449
+ options: n.map((h) => h.name),
2450
+ onChange: (h) => r.setValue(l, "name", h),
2451
+ onSelect: (h) => r.setValue(l, "name", h, { focus: "next" })
2452
+ }
2453
+ ) }) : /* @__PURE__ */ t.jsx(I, { ...f, placeholder: "Name" }),
2454
+ /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
2455
+ d ? /* @__PURE__ */ t.jsx(I, { asChild: !0, children: /* @__PURE__ */ t.jsx(
2456
+ Pe,
2457
+ {
2458
+ ...x,
2459
+ value: String(r.getValue(l, "value")),
2460
+ shouldFilter: !1,
2461
+ options: m.enum ?? [],
2462
+ onChange: (h) => r.setValue(l, "value", h),
2463
+ onSelect: (h) => r.setValue(l, "value", h, { focus: "next" })
2464
+ }
2465
+ ) }) : /* @__PURE__ */ t.jsx(
2466
+ I,
2467
+ {
2468
+ placeholder: "Value",
2469
+ "aria-label": "Query parameter value",
2470
+ ...x
2471
+ }
2472
+ ),
2473
+ /* @__PURE__ */ t.jsx(
2474
+ at,
2475
+ {
2476
+ ...r.getRemoveButtonProps(l)
2477
+ }
2478
+ )
2479
+ ] })
2480
+ ] }, c.id);
2481
+ }) }) })
2482
+ ] });
2483
+ }, ea = ({
2484
+ open: e,
2485
+ setOpen: n,
2486
+ onSignUp: s,
2487
+ onLogin: a,
2488
+ onSkip: r
2489
+ }) => {
2490
+ const [o, i] = E(!1), c = () => {
2491
+ r?.(o), n(!1);
2492
+ };
2493
+ return /* @__PURE__ */ t.jsx(et, { open: e, onOpenChange: n, children: /* @__PURE__ */ t.jsxs(tt, { children: [
2494
+ /* @__PURE__ */ t.jsx(nt, { children: "Welcome to the Playground!" }),
2495
+ /* @__PURE__ */ t.jsx(_t, { children: "The Playground is a tool for developers to test and explore our APIs. To use the Playground, you need to login." }),
2496
+ /* @__PURE__ */ t.jsxs(Re, { className: "flex items-center gap-2 font-normal", children: [
2497
+ /* @__PURE__ */ t.jsx(
2498
+ ve,
2499
+ {
2500
+ checked: o,
2501
+ onCheckedChange: (l) => i(l === !0)
2502
+ }
2503
+ ),
2504
+ "Don't show this again"
2505
+ ] }),
2506
+ /* @__PURE__ */ t.jsxs(qt, { className: "flex gap-2 sm:justify-between", children: [
2507
+ /* @__PURE__ */ t.jsx(q, { type: "button", variant: "outline", onClick: c, children: "Skip" }),
2508
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2", children: [
2509
+ s && /* @__PURE__ */ t.jsx(q, { type: "button", variant: "outline", onClick: s, children: "Sign Up" }),
2510
+ a && /* @__PURE__ */ t.jsx(q, { type: "button", variant: "default", onClick: a, children: "Login" })
2511
+ ] })
2512
+ ] })
2513
+ ] }) });
2514
+ }, ta = Ze()(
2515
+ Ye(
2516
+ (e, n) => ({
2517
+ rememberedIdentity: null,
2518
+ setRememberedIdentity: (s) => e({ rememberedIdentity: s }),
2519
+ getRememberedIdentity: (s) => s.find(
2520
+ (a) => a === n().rememberedIdentity
2521
+ )
2522
+ }),
2523
+ {
2524
+ name: "identity-storage",
2525
+ storage: zt(() => sessionStorage)
2526
+ }
2527
+ )
2528
+ ), na = ({
2529
+ path: e,
2530
+ renderParam: n
2531
+ }) => {
2532
+ let s = 0;
2533
+ return e.split("/").map((a, r, o) => {
2534
+ const i = Array.from(a.matchAll(/{([^}]+)}/g)), c = [];
2535
+ let l = 0;
2536
+ return i.forEach((m) => {
2537
+ const [d, f] = m;
2538
+ if (!f) return;
2539
+ const x = m.index;
2540
+ x > l && c.push(
2541
+ /* @__PURE__ */ t.jsx(ie, { children: a.slice(l, x) }, `text-${l}-${x}`)
2542
+ ), c.push(
2543
+ /* @__PURE__ */ t.jsx(ie, { children: n({ name: f, originalValue: d, index: s++ }) }, `param-${f}`)
2544
+ ), l = x + d.length;
2545
+ }), l < a.length && c.push(
2546
+ /* @__PURE__ */ t.jsx(ie, { children: a.slice(l) }, `text-${l}-${a.length}`)
2547
+ ), // biome-ignore lint/suspicious/noArrayIndexKey: index should be stable
2548
+ /* @__PURE__ */ t.jsxs(ie, { children: [
2549
+ c,
2550
+ r < o.length - 1 && "/",
2551
+ /* @__PURE__ */ t.jsx("wbr", {})
2552
+ ] }, `${a}-${r}`);
2553
+ });
2554
+ }, sa = ({ url: e }) => {
2555
+ const { watch: n, setFocus: s } = ae(), [a] = n(["pathParams"]);
2556
+ return /* @__PURE__ */ t.jsx(
2557
+ na,
2558
+ {
2559
+ path: e,
2560
+ renderParam: ({ name: r, originalValue: o, index: i }) => {
2561
+ const c = a.find(
2562
+ (l) => l.name === r
2563
+ )?.value;
2564
+ return /* @__PURE__ */ t.jsx(
2565
+ fn,
2566
+ {
2567
+ name: r,
2568
+ backgroundOpacity: "0",
2569
+ slug: r,
2570
+ onClick: () => s(`pathParams.${i}.value`),
2571
+ children: c || o
2572
+ }
2573
+ );
2574
+ }
2575
+ }
2576
+ );
2577
+ }, ra = () => {
2578
+ const { watch: e } = ae(), s = e("queryParams").filter((a) => a.active && a.name).map((a, r, o) => /* @__PURE__ */ t.jsxs(ie, { children: [
2579
+ a.name,
2580
+ "=",
2581
+ encodeURIComponent(a.value).replaceAll("%20", "+"),
2582
+ r < o.length - 1 && "&",
2583
+ /* @__PURE__ */ t.jsx("wbr", {})
2584
+ ] }, `${r}-${a.name}`));
2585
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2586
+ s.length > 0 ? "?" : "",
2587
+ s
2588
+ ] });
2589
+ }, aa = ({ status: e }) => {
2590
+ if (!e) return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-gray-500" });
2591
+ switch (Number(e.toString().slice(0, 1))) {
2592
+ case 2:
2593
+ return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-green-500" });
2594
+ case 4:
2595
+ return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-yellow-400" });
2596
+ case 5:
2597
+ return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-red-500" });
2598
+ default:
2599
+ return /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full bg-gray-500" });
2600
+ }
2601
+ }, oa = () => {
2602
+ const e = k(null), n = k(null), s = k(Date.now()), a = k(null), r = D(() => {
2603
+ if (n.current) {
2604
+ const o = Date.now() - s.current;
2605
+ n.current.nodeValue = o.toFixed();
2606
+ }
2607
+ a.current = requestAnimationFrame(r);
2608
+ }, []);
2609
+ return ds(() => {
2610
+ const o = e.current;
2611
+ if (!o) return;
2612
+ const i = document.createTextNode("0");
2613
+ return o.appendChild(i), n.current = i, s.current = Date.now(), a.current = requestAnimationFrame(r), () => {
2614
+ a.current && cancelAnimationFrame(a.current), n.current && o.contains(i) && o.removeChild(i);
2615
+ };
2616
+ }, [r]), /* @__PURE__ */ t.jsx("span", { className: "inline-block text-end w-[3ch]", ref: e });
2617
+ }, ia = ({
2618
+ status: e,
2619
+ time: n,
2620
+ size: s,
2621
+ isFinished: a,
2622
+ progress: r
2623
+ }) => {
2624
+ const o = {
2625
+ 200: "OK",
2626
+ 201: "Created",
2627
+ 202: "Accepted",
2628
+ 204: "No Content",
2629
+ 400: "Bad Request",
2630
+ 401: "Unauthorized",
2631
+ 403: "Forbidden",
2632
+ 404: "Not Found",
2633
+ 405: "Method Not Allowed",
2634
+ 500: "Internal Server Error"
2635
+ };
2636
+ return /* @__PURE__ */ t.jsxs("div", { className: "relative shrink-0 flex h-10 text-xs gap-4 px-4 items-center justify-between font-mono border-b", children: [
2637
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
2638
+ /* @__PURE__ */ t.jsx(aa, { status: e }),
2639
+ " ",
2640
+ e ?? "Sending Request...",
2641
+ e ? ` ${o[e]}` : ""
2642
+ ] }),
2643
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2", children: [
2644
+ /* @__PURE__ */ t.jsxs("div", { children: [
2645
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Size" }),
2646
+ " ",
2647
+ /* @__PURE__ */ t.jsx("span", { className: "inline-block text-end min-w-[5ch]", children: s ? ke(s) : "- B" })
2648
+ ] }),
2649
+ /* @__PURE__ */ t.jsxs("div", { children: [
2650
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Time" }),
2651
+ " ",
2652
+ n !== void 0 ? `${n.toFixed(0)}` : /* @__PURE__ */ t.jsx(oa, {}),
2653
+ "ms"
2654
+ ] })
2655
+ ] }),
2656
+ /* @__PURE__ */ t.jsx(
2657
+ "div",
2658
+ {
2659
+ className: "h-full bg-neutral-500/10 absolute left-0 bottom-0 z-10 transition-all duration-200 ease-in-out",
2660
+ style: {
2661
+ opacity: a ? 0 : 1,
2662
+ width: a ? 0 : `${r * 100}%`
2663
+ }
2664
+ }
2665
+ )
2666
+ ] });
2667
+ };
2668
+ function it(e) {
2669
+ if (e === null) return "null";
2670
+ if (Array.isArray(e)) {
2671
+ if (e.length === 0) return "any[]";
2672
+ const n = e[0];
2673
+ return n === void 0 ? "any[]" : `${it(n)}[]`;
2674
+ }
2675
+ return typeof e == "object" ? la(e) : typeof e;
2676
+ }
2677
+ function la(e, n = "") {
2678
+ const s = ["{"];
2679
+ for (const [a, r] of Object.entries(e)) {
2680
+ const o = it(r);
2681
+ s.push(` ${a}: ${o};`);
2682
+ }
2683
+ return s.push("}"), s.join(`
2684
+ `);
2685
+ }
2686
+ function ca(e) {
2687
+ return { lines: [`type GeneratedType = ${it(e)};`] };
2688
+ }
2689
+ const da = (e) => Object.entries({
2690
+ "application/json": "json",
2691
+ "text/json": "json",
2692
+ "text/html": "html",
2693
+ "text/css": "css",
2694
+ "text/javascript": "javascript",
2695
+ "application/xml": "xml",
2696
+ "application/xhtml+xml": "xhtml"
2697
+ }).find(
2698
+ ([s]) => e.includes(s)
2699
+ )?.[1], ua = (e) => {
2700
+ const n = e.find(([s]) => s.toLowerCase() === "content-type")?.[1] || "";
2701
+ return da(n);
2702
+ }, ma = (e) => {
2703
+ try {
2704
+ return JSON.stringify(JSON.parse(e), null, 2);
2705
+ } catch {
2706
+ return null;
2707
+ }
2708
+ }, pa = (e) => {
2709
+ const n = [
2710
+ "Content-Type",
2711
+ "Content-Length",
2712
+ "Authorization",
2713
+ "X-RateLimit-Remaining",
2714
+ "X-RateLimit-Limit",
2715
+ "Cache-Control",
2716
+ "ETag"
2717
+ ].map((s) => s.toLowerCase());
2718
+ return [...e].sort(([s], [a]) => {
2719
+ const r = n.indexOf(s.toLowerCase()), o = n.indexOf(a.toLowerCase());
2720
+ return r === o ? 0 : r === -1 ? 1 : o === -1 ? -1 : r - o;
2721
+ });
2722
+ }, z = 3, Se = ye(
2723
+ "div",
2724
+ "grid-cols-subgrid grid border-b col-span-full px-4 py-1.5 font-mono text-xs"
2725
+ ), de = ye("div", "py-1 break-words"), we = ({ value: e, header: n }) => {
2726
+ const a = ["authorization", "key", "secret", "token"].includes(n.toLowerCase()), [r, o] = E(!a);
2727
+ return /* @__PURE__ */ t.jsx(
2728
+ de,
2729
+ {
2730
+ className: w(
2731
+ "max-h-28 overflow-auto",
2732
+ a && "cursor-pointer flex group"
2733
+ ),
2734
+ onClick: () => {
2735
+ a && o((i) => !i);
2736
+ },
2737
+ children: a ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2738
+ /* @__PURE__ */ t.jsx(Ss, { secret: e, previewChars: 0, revealed: r }),
2739
+ r ? /* @__PURE__ */ t.jsx(Gn, { size: 14, className: w("hidden group-hover:block") }) : /* @__PURE__ */ t.jsx(Hn, { size: 14, className: w("hidden group-hover:block") })
2740
+ ] }) : e
2741
+ }
2742
+ );
2743
+ }, ha = ({
2744
+ body: e = "",
2745
+ headers: n,
2746
+ request: s,
2747
+ size: a,
2748
+ isBinary: r = !1,
2749
+ fileName: o,
2750
+ blob: i
2751
+ }) => {
2752
+ const c = ua(n), l = ma(e), m = l || e, [d, f] = E(
2753
+ l ? "formatted" : "raw"
2754
+ ), x = qs({
2755
+ queryKey: ["types", m],
2756
+ queryFn: async () => ca(JSON.parse(m)),
2757
+ enabled: d === "types" && !r
2758
+ }), h = () => {
2759
+ if (i && o) {
2760
+ const u = URL.createObjectURL(i), y = document.createElement("a");
2761
+ y.href = u, y.download = o, document.body.appendChild(y), y.click(), document.body.removeChild(y), URL.revokeObjectURL(u);
2762
+ }
2763
+ }, v = pa([...n]);
2764
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2765
+ /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
2766
+ /* @__PURE__ */ t.jsxs(Z, { children: [
2767
+ /* @__PURE__ */ t.jsx(_n, { size: 14 }),
2768
+ /* @__PURE__ */ t.jsx(H, { children: "Request Headers" })
2769
+ ] }),
2770
+ /* @__PURE__ */ t.jsx(_, { children: /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[2fr_3fr] gap-x-6 text-sm", children: [
2771
+ s.headers.slice(0, z).map(([u, y]) => /* @__PURE__ */ t.jsxs(Se, { children: [
2772
+ /* @__PURE__ */ t.jsx(de, { children: u }),
2773
+ /* @__PURE__ */ t.jsx(we, { value: y, header: u })
2774
+ ] }, u)),
2775
+ s.headers.length > z && /* @__PURE__ */ t.jsxs(B, { className: "col-span-full grid-cols-subgrid grid group", children: [
2776
+ /* @__PURE__ */ t.jsxs(ce, { className: "data-[state=open]:hidden justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2777
+ "Show ",
2778
+ s.headers.length - z,
2779
+ " more headers",
2780
+ /* @__PURE__ */ t.jsx(Je, { size: 12, className: "text-muted-foreground" })
2781
+ ] }),
2782
+ /* @__PURE__ */ t.jsxs(_, { className: "col-span-full grid grid-cols-subgrid", children: [
2783
+ s.headers.slice(z).map(([u, y]) => /* @__PURE__ */ t.jsxs(Se, { children: [
2784
+ /* @__PURE__ */ t.jsx(de, { children: u }),
2785
+ /* @__PURE__ */ t.jsx(we, { value: y, header: u })
2786
+ ] }, u)),
2787
+ /* @__PURE__ */ t.jsxs(ce, { className: "justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2788
+ "Hide ",
2789
+ s.headers.length - z,
2790
+ " headers",
2791
+ /* @__PURE__ */ t.jsx(
2792
+ bt,
2793
+ {
2794
+ size: 12,
2795
+ className: "text-muted-foreground"
2796
+ }
2797
+ )
2798
+ ] })
2799
+ ] })
2800
+ ] })
2801
+ ] }) })
2802
+ ] }),
2803
+ /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
2804
+ /* @__PURE__ */ t.jsxs(Z, { children: [
2805
+ /* @__PURE__ */ t.jsx(qn, { size: 14 }),
2806
+ /* @__PURE__ */ t.jsx(H, { children: "Response Headers" })
2807
+ ] }),
2808
+ /* @__PURE__ */ t.jsx(_, { children: /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[2fr_3fr] gap-x-6 text-sm", children: [
2809
+ v.slice(0, z).map(([u, y]) => /* @__PURE__ */ t.jsxs(Se, { children: [
2810
+ /* @__PURE__ */ t.jsx(de, { children: u }),
2811
+ /* @__PURE__ */ t.jsx(we, { value: y, header: u })
2812
+ ] }, u)),
2813
+ v.length > z && /* @__PURE__ */ t.jsxs(B, { className: "col-span-full grid-cols-subgrid grid group", children: [
2814
+ /* @__PURE__ */ t.jsxs(ce, { className: "data-[state=open]:hidden justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2815
+ "Show ",
2816
+ v.length - z,
2817
+ " more headers",
2818
+ /* @__PURE__ */ t.jsx(Je, { size: 12, className: "text-muted-foreground" })
2819
+ ] }),
2820
+ /* @__PURE__ */ t.jsxs(_, { className: "col-span-full grid grid-cols-subgrid", children: [
2821
+ v.slice(z).map(([u, y]) => /* @__PURE__ */ t.jsxs(Se, { children: [
2822
+ /* @__PURE__ */ t.jsx(de, { children: u }),
2823
+ /* @__PURE__ */ t.jsx(we, { value: y, header: u })
2824
+ ] }, u)),
2825
+ /* @__PURE__ */ t.jsxs(ce, { className: "justify-center col-span-2 text-xs text-muted-foreground hover:text-primary border-b h-8 flex items-center gap-2", children: [
2826
+ "Hide ",
2827
+ v.length - z,
2828
+ " headers",
2829
+ /* @__PURE__ */ t.jsx(
2830
+ bt,
2831
+ {
2832
+ size: 12,
2833
+ className: "text-muted-foreground"
2834
+ }
2835
+ )
2836
+ ] })
2837
+ ] })
2838
+ ] })
2839
+ ] }) })
2840
+ ] }),
2841
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 justify-between items-center border-b px-2 flex-0", children: [
2842
+ /* @__PURE__ */ t.jsxs(H, { className: "flex items-center gap-2", children: [
2843
+ /* @__PURE__ */ t.jsx(Mn, { size: 14 }),
2844
+ "Response body"
2845
+ ] }),
2846
+ l && !r && /* @__PURE__ */ t.jsxs(
2847
+ Ut,
2848
+ {
2849
+ value: d,
2850
+ onValueChange: (u) => f(u),
2851
+ children: [
2852
+ /* @__PURE__ */ t.jsx(Gt, { className: "max-w-32 border-0 bg-transparent", children: /* @__PURE__ */ t.jsx(Ht, { placeholder: "View" }) }),
2853
+ /* @__PURE__ */ t.jsxs(Qt, { children: [
2854
+ /* @__PURE__ */ t.jsx(Te, { value: "formatted", children: "Formatted" }),
2855
+ /* @__PURE__ */ t.jsx(Te, { value: "raw", children: "Raw" }),
2856
+ /* @__PURE__ */ t.jsx(Te, { value: "types", children: "Types" })
2857
+ ] })
2858
+ ]
2859
+ }
2860
+ )
2861
+ ] }),
2862
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1", children: r ? /* @__PURE__ */ t.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center gap-4", children: [
2863
+ /* @__PURE__ */ t.jsx("div", { className: "text-lg font-semibold", children: "Binary Content" }),
2864
+ /* @__PURE__ */ t.jsx("div", { className: "text-sm text-muted-foreground", children: "This response contains binary data that cannot be displayed as text." }),
2865
+ /* @__PURE__ */ t.jsxs(
2866
+ q,
2867
+ {
2868
+ onClick: h,
2869
+ className: "flex items-center gap-2",
2870
+ disabled: !i,
2871
+ children: [
2872
+ /* @__PURE__ */ t.jsx(Un, { className: "h-4 w-4" }),
2873
+ "Download ",
2874
+ o || "file",
2875
+ " (",
2876
+ ke(a),
2877
+ ")"
2878
+ ]
2879
+ }
2880
+ )
2881
+ ] }) }) : /* @__PURE__ */ t.jsx(
2882
+ xs,
2883
+ {
2884
+ className: "text-xs flex-1",
2885
+ embedded: !0,
2886
+ fullHeight: !0,
2887
+ language: d === "types" ? "typescript" : d === "raw" ? l ? "plain" : c : "json",
2888
+ code: (d === "raw" ? e : d === "types" ? x.data?.lines.join(`
2889
+ `) : m) ?? ""
2890
+ }
2891
+ ) })
2892
+ ] });
2893
+ }, fa = ({
2894
+ queryMutation: e,
2895
+ showLongRunningWarning: n,
2896
+ onCancel: s,
2897
+ tip: a,
2898
+ isFinished: r,
2899
+ progress: o
2900
+ }) => /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col overflow-y-auto h-[80vh] bg-muted/50", children: [
2901
+ (e.isPending || e.data) && /* @__PURE__ */ t.jsx(
2902
+ ia,
2903
+ {
2904
+ status: e.data?.status,
2905
+ time: e.data?.time,
2906
+ size: e.data?.size,
2907
+ isFinished: r,
2908
+ progress: o
2909
+ }
2910
+ ),
2911
+ e.error ? /* @__PURE__ */ t.jsx("div", { className: "max-w-2/3 mx-auto mt-20", children: /* @__PURE__ */ t.jsxs(Vs, { children: [
2912
+ /* @__PURE__ */ t.jsx(Qn, { size: 24, strokeWidth: 1.5, className: "me-5" }),
2913
+ /* @__PURE__ */ t.jsx(Bs, { children: "Request failed" }),
2914
+ /* @__PURE__ */ t.jsx(_s, { children: e.error.message || String(e.error) || "Unexpected error" })
2915
+ ] }) }) : e.data ? /* @__PURE__ */ t.jsx(
2916
+ ha,
2917
+ {
2918
+ request: e.data.request,
2919
+ size: e.data.size,
2920
+ headers: e.data.headers,
2921
+ body: e.data.body,
2922
+ isBinary: e.data.isBinary,
2923
+ fileName: e.data.fileName,
2924
+ blob: e.data.blob
2925
+ }
2926
+ ) : e.isPending ? /* @__PURE__ */ t.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2 items-center mt-20", children: [
2927
+ /* @__PURE__ */ t.jsx(ys, {}),
2928
+ /* @__PURE__ */ t.jsxs(
2929
+ "div",
2930
+ {
2931
+ className: w(
2932
+ "opacity-0 pointer-events-none transition-opacity h-20 text-sm text-muted-foreground duration-300 flex flex-col gap-2 items-center",
2933
+ n && "opacity-100 pointer-events-auto"
2934
+ ),
2935
+ children: [
2936
+ "Looks like the request is taking longer than expected.",
2937
+ /* @__PURE__ */ t.jsx(
2938
+ Ft,
2939
+ {
2940
+ type: "button",
2941
+ onClick: s,
2942
+ size: "sm",
2943
+ className: "w-fit",
2944
+ variant: "outline",
2945
+ children: "Cancel"
2946
+ }
2947
+ )
2948
+ ]
2949
+ }
2950
+ )
2951
+ ] }) }) : /* @__PURE__ */ t.jsx("div", { className: "h-full grid place-items-center", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-4 items-center", children: [
2952
+ /* @__PURE__ */ t.jsx(
2953
+ Jn,
2954
+ {
2955
+ size: 64,
2956
+ className: "text-muted-foreground",
2957
+ strokeWidth: 1.2
2958
+ }
2959
+ ),
2960
+ /* @__PURE__ */ t.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: "Send your first request" }),
2961
+ a
2962
+ ] }) })
2963
+ ] }), gn = Ze()(
2964
+ Ye(
2965
+ (e) => ({
2966
+ skipLogin: !1,
2967
+ setSkipLogin: (n) => e({ skipLogin: n })
2968
+ }),
2969
+ {
2970
+ name: "remember-skip-login",
2971
+ storage: zt(() => sessionStorage)
2972
+ }
2973
+ )
2974
+ );
2975
+ as(gn);
2976
+ const me = "__none", ga = ({
2977
+ server: e,
2978
+ servers: n = [],
2979
+ url: s,
2980
+ method: a,
2981
+ headers: r = [],
2982
+ queryParams: o = [],
2983
+ pathParams: i = [],
2984
+ defaultBody: c = "",
2985
+ examples: l,
2986
+ requiresLogin: m = !1,
2987
+ onLogin: d,
2988
+ onSignUp: f
2989
+ }) => {
2990
+ const { selectedServer: x, setSelectedServer: h } = Vr(
2991
+ n.map((p) => ({ url: p }))
2992
+ ), [v, u] = E(!1), y = os(), { setRememberedIdentity: S, getRememberedIdentity: R } = ta(), [, N] = us(), { skipLogin: j, setSkipLogin: O } = gn(), [Q, be] = E(!1), [Ie, ee] = E(!1), g = k(void 0), C = Ts(S), T = k(null), { label: A } = Fr("meta+enter", () => {
2993
+ T.current?.requestSubmit();
2994
+ }), M = s.match(/\{([^}]+)\}/g)?.map((p) => p.slice(1, -1)) ?? [], L = [...i].sort(
2995
+ (p, se) => M.indexOf(p.name) - M.indexOf(se.name)
2996
+ ), { register: De, control: te, handleSubmit: je, watch: ct, setValue: Fe, ...ze } = Cs({
2997
+ defaultValues: {
2998
+ body: c,
2999
+ bodyMode: "text",
3000
+ file: null,
3001
+ multipartFormFields: [],
3002
+ queryParams: o.length > 0 ? o.map((p) => ({
3003
+ name: p.name,
3004
+ value: p.defaultValue ?? "",
3005
+ active: p.defaultActive ?? !1,
3006
+ enum: p.enum ?? []
3007
+ })) : [{ name: "", value: "", active: !1, enum: [] }],
3008
+ pathParams: L.map((p) => ({
3009
+ name: p.name,
3010
+ value: p.defaultValue ?? ""
3011
+ })),
3012
+ headers: r.length > 0 ? r.map((p) => ({
3013
+ name: p.name,
3014
+ value: p.defaultValue ?? "",
3015
+ active: p.defaultActive ?? !1
3016
+ })) : [{ name: "", value: "", active: !1 }],
3017
+ identity: R([
3018
+ me,
3019
+ ...y.data?.map((p) => p.id) ?? []
3020
+ ])
3021
+ }
3022
+ }), ne = ct("identity"), jn = Bt(
3023
+ () => y.data?.find((p) => p.id === ne)?.authorizationFields,
3024
+ [y.data, ne]
3025
+ );
3026
+ G(() => {
3027
+ ne && C.current(ne);
3028
+ }, [C, ne]);
3029
+ const J = js({
3030
+ gcTime: 0,
3031
+ mutationFn: async (p) => {
3032
+ const se = performance.now(), Ve = new window.Headers(
3033
+ p.headers.filter(($) => $.name && $.active).map(($) => [$.name, $.value])
3034
+ );
3035
+ let Ce;
3036
+ switch (p.bodyMode) {
3037
+ case "file":
3038
+ Ce = p.file || void 0, Ve.delete("Content-Type");
3039
+ break;
3040
+ case "multipart": {
3041
+ const $ = new FormData();
3042
+ p.multipartFormFields?.filter((X) => X.name && X.active).forEach((X) => $.append(X.name, X.value)), Ce = $, Ve.delete("Content-Type");
3043
+ break;
3044
+ }
3045
+ default:
3046
+ Ce = p.body || void 0;
3047
+ break;
3048
+ }
3049
+ const W = new Request(
3050
+ Lt(e ?? x, s, p),
3051
+ {
3052
+ method: a,
3053
+ headers: Ve,
3054
+ body: ["GET", "HEAD"].includes(a.toUpperCase()) ? null : Ce
3055
+ }
3056
+ );
3057
+ p.identity !== me && await y.data?.find(($) => $.id === p.identity)?.authorizeRequest(W);
3058
+ const Be = setTimeout(
3059
+ () => ee(!0),
3060
+ 3210
3061
+ );
3062
+ g.current = new AbortController(), g.current.signal.addEventListener("abort", () => {
3063
+ clearTimeout(Be);
3064
+ });
3065
+ try {
3066
+ const $ = await fetch(W, {
3067
+ cache: "no-store",
3068
+ signal: g.current.signal
3069
+ });
3070
+ clearTimeout(Be), ee(!1);
3071
+ const X = performance.now() - se, On = new URL(W.url), mt = Array.from($.headers.entries()), pt = $.headers.get("content-type") || "", ht = Mr(pt);
3072
+ let Ne = "", ft, gt;
3073
+ ht ? (ft = await $.blob(), gt = Ur(mt, W.url), Ne = `Binary content (${pt})`) : Ne = await $.text();
3074
+ const xt = $.headers.get("content-length");
3075
+ let re = "";
3076
+ switch (p.bodyMode) {
3077
+ case "text":
3078
+ re = p.body;
3079
+ break;
3080
+ case "file":
3081
+ re = `[File: ${p.file?.name ?? "Unknown"}]`;
3082
+ break;
3083
+ case "multipart":
3084
+ re = `[Multipart Form Data]
3085
+ `, re += p.multipartFormFields?.filter((U) => U.name && U.active).map(
3086
+ (U) => U.value instanceof File ? `${U.name}: [File: ${U.value.name}]` : `${U.name}: ${U.value}`
3087
+ ).join(`
3088
+ `);
3089
+ break;
3090
+ default:
3091
+ re = p.body;
3092
+ break;
3093
+ }
3094
+ return {
3095
+ status: $.status,
3096
+ headers: mt,
3097
+ size: xt ? Number(xt) : Ne.length,
3098
+ body: Ne,
3099
+ time: X,
3100
+ isBinary: ht,
3101
+ fileName: gt,
3102
+ blob: ft,
3103
+ request: {
3104
+ method: W.method.toUpperCase(),
3105
+ url: W.url,
3106
+ headers: [
3107
+ ["Host", On.host],
3108
+ ["User-Agent", "Zudoku Playground"],
3109
+ ...Array.from(W.headers.entries())
3110
+ ],
3111
+ body: re
3112
+ }
3113
+ };
3114
+ } catch ($) {
3115
+ throw clearTimeout(Be), ee(!1), $ instanceof TypeError ? new Error(
3116
+ "The request failed, possibly due to network issues or CORS policy."
3117
+ ) : $;
3118
+ }
3119
+ }
3120
+ }), dt = J.isPending, [Cn, Nn] = E(!1);
3121
+ G(() => {
3122
+ const p = setTimeout(() => Nn(dt), 100);
3123
+ return () => clearTimeout(p);
3124
+ }, [dt]);
3125
+ const { isFinished: Sn, progress: wn } = vs({ isAnimating: Cn });
3126
+ G(() => () => {
3127
+ g.current?.abort();
3128
+ }, []);
3129
+ const Tn = /* @__PURE__ */ t.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: e ? /* @__PURE__ */ t.jsx("span", { children: e.replace(/^https?:\/\//, "").replace(/\/$/, "") }) : n.length > 1 && /* @__PURE__ */ t.jsxs(
3130
+ Ut,
3131
+ {
3132
+ onValueChange: (p) => {
3133
+ N(() => h(p));
3134
+ },
3135
+ value: x,
3136
+ defaultValue: x,
3137
+ children: [
3138
+ /* @__PURE__ */ t.jsx(Gt, { className: "p-0 h-fit shadow-none border-none flex-row-reverse bg-transparent text-xs gap-0.5 translate-y-[4px]", children: /* @__PURE__ */ t.jsx(Ht, {}) }),
3139
+ /* @__PURE__ */ t.jsx(Qt, { children: n.map((p) => /* @__PURE__ */ t.jsx(Te, { value: p, children: p.replace(/^https?:\/\//, "").replace(/\/$/, "") }, p)) })
3140
+ ]
3141
+ }
3142
+ ) }), An = m && !j && !Q, $n = ["POST", "PUT", "PATCH", "DELETE"].includes(
3143
+ a.toUpperCase()
3144
+ ), [ut, Pn] = ws();
3145
+ return /* @__PURE__ */ t.jsx(
3146
+ Ns,
3147
+ {
3148
+ register: De,
3149
+ control: te,
3150
+ handleSubmit: je,
3151
+ watch: ct,
3152
+ setValue: Fe,
3153
+ ...ze,
3154
+ children: /* @__PURE__ */ t.jsx(bs, { delayDuration: 150, children: /* @__PURE__ */ t.jsxs(
3155
+ "form",
3156
+ {
3157
+ ref: T,
3158
+ onKeyDown: (p) => {
3159
+ p.key === "Enter" && p.target instanceof HTMLInputElement && p.preventDefault();
3160
+ },
3161
+ onSubmit: je((p) => {
3162
+ y.data?.length === 0 || p.identity ? J.mutate(p) : u(!0);
3163
+ }),
3164
+ className: "relative",
3165
+ children: [
3166
+ /* @__PURE__ */ t.jsx(
3167
+ Xr,
3168
+ {
3169
+ identities: y.data ?? [],
3170
+ open: v,
3171
+ onOpenChange: u,
3172
+ onSubmit: ({ rememberedIdentity: p, identity: se }) => {
3173
+ p && Fe("identity", se ?? me), u(!1), J.mutate({ ...ze.getValues(), identity: se });
3174
+ }
3175
+ }
3176
+ ),
3177
+ /* @__PURE__ */ t.jsx(
3178
+ ea,
3179
+ {
3180
+ open: An,
3181
+ setOpen: (p) => {
3182
+ p || be(!0);
3183
+ },
3184
+ onSkip: (p) => {
3185
+ be(!0), p && O(!0);
3186
+ },
3187
+ onSignUp: f,
3188
+ onLogin: d
3189
+ }
3190
+ ),
3191
+ /* @__PURE__ */ t.jsxs("div", { className: "grid grid-cols-[1fr_1px_1fr] text-sm", children: [
3192
+ /* @__PURE__ */ t.jsxs("div", { className: "col-span-3 p-4 border-b flex gap-2 items-stretch", children: [
3193
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md relative overflow-hidden", children: [
3194
+ /* @__PURE__ */ t.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono flex items-center", children: a.toUpperCase() }),
3195
+ /* @__PURE__ */ t.jsx("div", { className: "items-center px-2 font-mono text-xs break-all leading-6 relative h-full w-full", children: /* @__PURE__ */ t.jsxs("div", { className: "h-full py-1.5", children: [
3196
+ Tn,
3197
+ /* @__PURE__ */ t.jsx(sa, { url: s }),
3198
+ /* @__PURE__ */ t.jsx(ra, {})
3199
+ ] }) }),
3200
+ /* @__PURE__ */ t.jsx("div", { className: "px-1", children: /* @__PURE__ */ t.jsx(
3201
+ q,
3202
+ {
3203
+ type: "button",
3204
+ onClick: () => {
3205
+ Pn(
3206
+ Lt(
3207
+ e ?? x,
3208
+ s,
3209
+ ze.getValues()
3210
+ ).toString()
3211
+ );
3212
+ },
3213
+ variant: "ghost",
3214
+ size: "icon-xs",
3215
+ className: w(
3216
+ "hover:opacity-100 transition",
3217
+ ut ? "text-emerald-600 opacity-100" : "opacity-50"
3218
+ ),
3219
+ children: ut ? /* @__PURE__ */ t.jsx(Dt, { className: "text-green-500", size: 14 }) : /* @__PURE__ */ t.jsx(Wn, { size: 14 })
3220
+ }
3221
+ ) })
3222
+ ] }),
3223
+ /* @__PURE__ */ t.jsx(
3224
+ q,
3225
+ {
3226
+ type: "submit",
3227
+ variant: J.isPending ? "destructive" : "default",
3228
+ onClick: (p) => {
3229
+ J.isPending && (g.current?.abort(
3230
+ "Request cancelled by user"
3231
+ ), p.preventDefault());
3232
+ },
3233
+ className: "w-18",
3234
+ children: J.isPending ? "Cancel" : "Send"
3235
+ }
3236
+ )
3237
+ ] }),
3238
+ /* @__PURE__ */ t.jsxs("div", { className: "relative overflow-y-auto h-[80vh]", children: [
3239
+ y.data?.length !== 0 && /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
3240
+ /* @__PURE__ */ t.jsxs(Z, { children: [
3241
+ /* @__PURE__ */ t.jsx(Xn, { size: 16 }),
3242
+ /* @__PURE__ */ t.jsx(H, { children: "Authentication" })
3243
+ ] }),
3244
+ /* @__PURE__ */ t.jsx(_, { className: "CollapsibleContent", children: /* @__PURE__ */ t.jsx(
3245
+ hn,
3246
+ {
3247
+ value: ne,
3248
+ identities: y.data ?? [],
3249
+ setValue: (p) => Fe("identity", p)
3250
+ }
3251
+ ) })
3252
+ ] }),
3253
+ L.length > 0 && /* @__PURE__ */ t.jsxs(B, { defaultOpen: !0, children: [
3254
+ /* @__PURE__ */ t.jsxs(Z, { children: [
3255
+ /* @__PURE__ */ t.jsx(Kn, { size: 16 }),
3256
+ /* @__PURE__ */ t.jsx(H, { children: "Path Parameters" })
3257
+ ] }),
3258
+ /* @__PURE__ */ t.jsx(_, { className: "CollapsibleContent", children: /* @__PURE__ */ t.jsx(Zr, { url: s, control: te }) })
3259
+ ] }),
3260
+ /* @__PURE__ */ t.jsx(Yr, { control: te, schemaQueryParams: o }),
3261
+ /* @__PURE__ */ t.jsx(
3262
+ Jr,
3263
+ {
3264
+ control: te,
3265
+ schemaHeaders: r,
3266
+ lockedHeaders: jn?.headers
3267
+ }
3268
+ ),
3269
+ $n && /* @__PURE__ */ t.jsx(qr, { content: l })
3270
+ ] }),
3271
+ /* @__PURE__ */ t.jsx("div", { className: "w-full bg-muted-foreground/20" }),
3272
+ /* @__PURE__ */ t.jsx(
3273
+ fa,
3274
+ {
3275
+ queryMutation: J,
3276
+ showLongRunningWarning: Ie,
3277
+ isFinished: Sn,
3278
+ progress: wn,
3279
+ tip: /* @__PURE__ */ t.jsx("div", { className: "text-xs w-full", children: /* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
3280
+ "Press",
3281
+ " ",
3282
+ /* @__PURE__ */ t.jsx("kbd", { className: "text-foreground border rounded m-0.5 px-1 py-0.5 capitalize", children: A.join(" + ") }),
3283
+ " ",
3284
+ "to send a request"
3285
+ ] }) }),
3286
+ onCancel: () => {
3287
+ g.current?.abort(
3288
+ "Request cancelled by the user"
3289
+ ), ee(!1);
3290
+ }
3291
+ }
3292
+ )
3293
+ ] })
3294
+ ]
3295
+ }
3296
+ ) })
3297
+ }
3298
+ );
3299
+ }, xa = (e) => {
3300
+ const [n, s] = E(!1), { isAuthEnabled: a, login: r, signup: o, isPending: i, isAuthenticated: c } = fs();
3301
+ return /* @__PURE__ */ t.jsxs(et, { onOpenChange: (l) => s(l), children: [
3302
+ /* @__PURE__ */ t.jsx(gs, { asChild: !0, children: e.children ?? /* @__PURE__ */ t.jsx(q, { variant: "ghost", size: "icon-xs", className: "group", children: /* @__PURE__ */ t.jsx(
3303
+ Zn,
3304
+ {
3305
+ className: "fill-muted-foreground group-hover:fill-foreground transition",
3306
+ size: 16,
3307
+ strokeWidth: 1.5
3308
+ }
3309
+ ) }) }),
3310
+ /* @__PURE__ */ t.jsxs(
3311
+ tt,
3312
+ {
3313
+ className: "max-w-screen-xl! w-full overflow-hidden p-0",
3314
+ "aria-describedby": void 0,
3315
+ showCloseButton: !0,
3316
+ children: [
3317
+ /* @__PURE__ */ t.jsx(ps, { children: /* @__PURE__ */ t.jsx(nt, { children: "Playground" }) }),
3318
+ n && /* @__PURE__ */ t.jsx(
3319
+ ga,
3320
+ {
3321
+ requiresLogin: a && !c && !i,
3322
+ onLogin: () => r(),
3323
+ onSignUp: () => o(),
3324
+ ...e
3325
+ }
3326
+ )
3327
+ ]
3328
+ }
3329
+ )
3330
+ ] });
3331
+ }, ya = {
3332
+ get: "green",
3333
+ post: "blue",
3334
+ put: "yellow",
3335
+ delete: "red",
3336
+ patch: "purple",
3337
+ options: "gray",
3338
+ head: "gray"
3339
+ }, Et = ({
3340
+ label: e,
3341
+ path: n,
3342
+ operations: s,
3343
+ collapsible: a,
3344
+ collapsed: r
3345
+ }) => ({
3346
+ type: "category",
3347
+ label: e,
3348
+ link: {
3349
+ type: "doc",
3350
+ path: n,
3351
+ file: n,
3352
+ label: e
3353
+ },
3354
+ collapsible: a,
3355
+ collapsed: r,
3356
+ items: s.map((o) => ({
3357
+ type: "link",
3358
+ label: o.summary ?? o.path,
3359
+ to: `${n}#${o.slug}`,
3360
+ badge: {
3361
+ label: o.method,
3362
+ // biome-ignore lint/style/noNonNullAssertion: is guaranteed to be defined
3363
+ color: ya[o.method.toLowerCase()],
3364
+ invert: !0
3365
+ }
3366
+ }))
3367
+ }), xn = Vt(
3368
+ void 0
3369
+ ), eo = xn.Provider, va = () => {
3370
+ const e = ms(xn);
3371
+ if (!e)
3372
+ throw new Error("useOasConfig must be used within a OasConfigProvider");
3373
+ return e.config;
3374
+ }, Qe = (e) => ({
3375
+ path: e.routePath,
3376
+ async lazy() {
3377
+ const { OasProvider: n } = await import("./OasProvider-DSe-hk5Y.js");
3378
+ return {
3379
+ element: /* @__PURE__ */ t.jsx(
3380
+ n,
3381
+ {
3382
+ basePath: e.basePath,
3383
+ version: e.version,
3384
+ client: e.client,
3385
+ config: e.config
3386
+ }
3387
+ )
3388
+ };
3389
+ },
3390
+ children: e.routes
3391
+ }), yn = ({
3392
+ path: e,
3393
+ tag: n,
3394
+ untagged: s
3395
+ }) => ({
3396
+ path: e,
3397
+ async lazy() {
3398
+ const { OperationList: a } = await import("./OperationList-CaknPbvq.js");
3399
+ return { element: /* @__PURE__ */ t.jsx(a, { tag: n, untagged: s }) };
3400
+ }
3401
+ }), ba = ({
3402
+ render: e,
3403
+ path: n
3404
+ }) => {
3405
+ const { type: s, input: a } = va(), { tag: r } = ts(), o = ns(), i = Sr(bn, { type: s, input: a }), {
3406
+ data: { schema: c }
3407
+ } = Ms(i), l = c.tags.at(0);
3408
+ return !r && l?.slug ? /* @__PURE__ */ t.jsx(
3409
+ ss,
3410
+ {
3411
+ to: {
3412
+ pathname: rs(n, { tag: l.slug }),
3413
+ search: o.search
3414
+ }
3415
+ }
3416
+ ) : r && c.tags.some((m) => m.slug === r) ? e(r) : null;
3417
+ }, Rt = ({ path: e }) => ({
3418
+ path: e,
3419
+ async lazy() {
3420
+ const { OperationList: n } = await import("./OperationList-CaknPbvq.js");
3421
+ return {
3422
+ element: /* @__PURE__ */ t.jsx(
3423
+ ba,
3424
+ {
3425
+ path: e,
3426
+ render: (s) => /* @__PURE__ */ t.jsx(n, { tag: s })
3427
+ }
3428
+ )
3429
+ };
3430
+ }
3431
+ }), Ke = (e) => [
3432
+ // Category without tagged operations
3433
+ yn({
3434
+ path: V(e, lt),
3435
+ untagged: !0
3436
+ }),
3437
+ // Schema list route
3438
+ {
3439
+ path: V(e, "~schemas"),
3440
+ lazy: async () => {
3441
+ const { SchemaList: n } = await import("./SchemaList-Dw3-CJPb.js");
3442
+ return { element: /* @__PURE__ */ t.jsx(n, {}) };
3443
+ }
3444
+ }
3445
+ ], ja = (e, n) => {
3446
+ const s = V(e, n.at(0) ?? lt);
3447
+ return [
3448
+ // Redirect to first tag on the index route
3449
+ { index: !0, loader: () => es(s) },
3450
+ // Create routes for each tag
3451
+ ...n.map(
3452
+ (a) => yn({
3453
+ path: V(e, a),
3454
+ tag: a
3455
+ })
3456
+ ),
3457
+ ...Ke(e)
3458
+ ];
3459
+ }, vn = (e) => e.type === "raw" || !Array.isArray(e.input) ? { versions: [], labels: {} } : {
3460
+ versions: e.input.map((n) => n.path),
3461
+ labels: Object.fromEntries(
3462
+ e.input.map((n) => [n.path, n.label ?? n.path])
3463
+ )
3464
+ }, Ca = ({
3465
+ basePath: e,
3466
+ config: n,
3467
+ client: s
3468
+ }) => {
3469
+ const a = n.tagPages, { versions: r } = vn(n);
3470
+ return a ? (r.length > 1 ? [void 0, ...r] : [void 0]).map((i) => {
3471
+ const c = V(e, i);
3472
+ return Qe({
3473
+ basePath: e,
3474
+ version: i,
3475
+ routePath: c,
3476
+ routes: ja(c, a),
3477
+ client: s,
3478
+ config: n
3479
+ });
3480
+ }) : r.length > 0 ? (r.length > 1 ? [void 0, ...r] : [void 0]).map((c) => {
3481
+ const l = V(e, c);
3482
+ return Qe({
3483
+ basePath: e,
3484
+ version: c,
3485
+ routePath: l,
3486
+ routes: [
3487
+ Rt({ path: `${l}/:tag?` }),
3488
+ ...Ke(l)
3489
+ ],
3490
+ client: s,
3491
+ config: n
3492
+ });
3493
+ }) : [
3494
+ Qe({
3495
+ basePath: e,
3496
+ routePath: e,
3497
+ routes: [
3498
+ Rt({ path: `${e}/:tag?` }),
3499
+ ...Ke(e)
3500
+ ],
3501
+ client: s,
3502
+ config: n
3503
+ })
3504
+ ];
3505
+ }, bn = Er(`
3506
+ query GetNavigationOperations($input: JSON!, $type: SchemaType!) {
3507
+ schema(input: $input, type: $type) {
3508
+ extensions
3509
+ tags {
3510
+ slug
3511
+ name
3512
+ extensions
3513
+ operations {
3514
+ summary
3515
+ slug
3516
+ method
3517
+ operationId
3518
+ path
3519
+ }
3520
+ }
3521
+ components {
3522
+ schemas {
3523
+ __typename
3524
+ }
3525
+ }
3526
+ }
3527
+ }
3528
+ `), lt = "~endpoints", to = (e) => {
3529
+ const n = V(e.path), s = new Gs(e);
3530
+ return {
3531
+ getHead: () => {
3532
+ if (e.type === "url" && !e.skipPreload)
3533
+ return (Array.isArray(e.input) ? e.input.map((r) => r.input) : [e.input]).map((r) => /* @__PURE__ */ t.jsx(
3534
+ "link",
3535
+ {
3536
+ href: r,
3537
+ rel: "preload",
3538
+ as: "fetch",
3539
+ crossOrigin: "anonymous"
3540
+ },
3541
+ r
3542
+ ));
3543
+ if (e.server)
3544
+ return /* @__PURE__ */ t.jsx("link", { rel: "preconnect", href: e.server });
3545
+ },
3546
+ getMdxComponents: () => ({
3547
+ OpenPlaygroundButton: ({
3548
+ server: a,
3549
+ method: r = "get",
3550
+ url: o = "/",
3551
+ children: i,
3552
+ ...c
3553
+ }) => {
3554
+ if (!a)
3555
+ throw new Error("Server is required");
3556
+ return /* @__PURE__ */ t.jsx(
3557
+ xa,
3558
+ {
3559
+ url: o,
3560
+ method: r,
3561
+ server: a,
3562
+ ...c,
3563
+ children: /* @__PURE__ */ t.jsx(Ft, { className: "gap-2 items-center", variant: "outline", children: i ?? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
3564
+ "Open in Playground",
3565
+ /* @__PURE__ */ t.jsx(Yn, { size: 16 })
3566
+ ] }) })
3567
+ }
3568
+ );
3569
+ }
3570
+ }),
3571
+ getNavigation: async (a, r) => {
3572
+ if (!jt({ path: n, end: !1 }, a))
3573
+ return [];
3574
+ const o = jt(
3575
+ { path: `${n}/:version?/:tag`, end: !0 },
3576
+ a
3577
+ );
3578
+ try {
3579
+ const i = o?.params.version, { versions: c } = vn(e), l = i ?? c.at(0), { type: m } = e, d = Array.isArray(e.input) ? e.input.find((N) => N.path === l)?.input ?? e.input[0]?.input : e.input, f = cn(s, bn, {
3580
+ type: m,
3581
+ input: d
3582
+ }), x = await r.queryClient.ensureQueryData(f), h = new Map(
3583
+ x.schema.tags.filter((N) => N.name && N.operations.length > 0).map((N) => {
3584
+ if (!N.name)
3585
+ throw new Error(`Tag ${N.slug} has no name`);
3586
+ const j = V(n, i, N.slug), O = N.extensions?.["x-zudoku-collapsed"] ?? !e.options?.expandAllTags, Q = N.extensions?.["x-zudoku-collapsible"] ?? !0;
3587
+ return [
3588
+ N.name,
3589
+ Et({
3590
+ label: N.extensions?.["x-displayName"] ?? N.name,
3591
+ path: j,
3592
+ operations: N.operations,
3593
+ collapsed: O,
3594
+ collapsible: Q
3595
+ })
3596
+ ];
3597
+ })
3598
+ ), v = x.schema.extensions?.["x-tagGroups"] ?? [], u = new Set(
3599
+ v.flatMap(
3600
+ (N) => N.tags.filter((j) => h.has(j))
3601
+ )
3602
+ ), S = [
3603
+ ...v.flatMap(
3604
+ (N) => {
3605
+ const j = N.tags.map((O) => h.get(O)).filter(Boolean);
3606
+ return j.length === 0 ? [] : [
3607
+ {
3608
+ type: "category",
3609
+ label: N.name,
3610
+ items: j,
3611
+ collapsible: !0,
3612
+ collapsed: !e.options?.expandAllTags
3613
+ }
3614
+ ];
3615
+ }
3616
+ ),
3617
+ ...Array.from(h.entries()).filter(([N]) => !u.has(N)).map(([, N]) => N)
3618
+ ], R = x.schema.tags.find(
3619
+ (N) => !N.name
3620
+ )?.operations;
3621
+ return R && R.length > 0 && S.push(
3622
+ Et({
3623
+ label: S.length === 0 ? "Endpoints" : "Other endpoints",
3624
+ path: V(n, i, lt),
3625
+ operations: R,
3626
+ collapsed: !e.options?.expandAllTags
3627
+ })
3628
+ ), x.schema.components?.schemas?.length && S.push({
3629
+ type: "link",
3630
+ label: "Schemas",
3631
+ to: V(n, i, "~schemas")
3632
+ }), S;
3633
+ } catch {
3634
+ return [];
3635
+ }
3636
+ },
3637
+ getRoutes: () => Ca({ basePath: n, config: e, client: s })
3638
+ };
3639
+ };
3640
+ export {
3641
+ B as C,
3642
+ Ya as G,
3643
+ sr as L,
3644
+ eo as O,
3645
+ xa as P,
3646
+ Ks as Q,
3647
+ on as S,
3648
+ b as T,
3649
+ lt as U,
3650
+ Sr as a,
3651
+ ce as b,
3652
+ _ as c,
3653
+ Er as d,
3654
+ Vr as e,
3655
+ fn as f,
3656
+ vn as g,
3657
+ na as h,
3658
+ Za as i,
3659
+ qe as j,
3660
+ an as k,
3661
+ rt as l,
3662
+ Ys as m,
3663
+ tn as n,
3664
+ jr as o,
3665
+ nr as p,
3666
+ Hs as q,
3667
+ Cr as r,
3668
+ F as s,
3669
+ Pt as t,
3670
+ va as u,
3671
+ Ka as v,
3672
+ rr as w,
3673
+ Qs as x,
3674
+ bn as y,
3675
+ to as z
3676
+ };
3677
+ //# sourceMappingURL=index-BQB9hb6n.js.map