zudoku 0.0.0-f62edde → 0.0.0-f687ed1

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