zudoku 0.0.0-e614aaa → 0.0.0-e6d1d34

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 (543) hide show
  1. package/README.md +1 -1
  2. package/dist/app/entry.server.d.ts +8 -6
  3. package/dist/app/entry.server.js +12 -8
  4. package/dist/app/entry.server.js.map +1 -1
  5. package/dist/app/main.js +2 -0
  6. package/dist/app/main.js.map +1 -1
  7. package/dist/app/tailwind.js +14 -0
  8. package/dist/app/tailwind.js.map +1 -1
  9. package/dist/cli/build/handler.js +2 -1
  10. package/dist/cli/build/handler.js.map +1 -1
  11. package/dist/cli/cmds/dev.d.ts +1 -1
  12. package/dist/cli/cmds/dev.js.map +1 -1
  13. package/dist/cli/dev/handler.js +2 -1
  14. package/dist/cli/dev/handler.js.map +1 -1
  15. package/dist/cli/preview/handler.js +13 -15
  16. package/dist/cli/preview/handler.js.map +1 -1
  17. package/dist/config/common.d.ts +0 -1
  18. package/dist/config/config.d.ts +13 -8
  19. package/dist/config/loader.d.ts +2 -2
  20. package/dist/config/loader.js +14 -25
  21. package/dist/config/loader.js.map +1 -1
  22. package/dist/config/validators/common.d.ts +2773 -597
  23. package/dist/config/validators/common.js +81 -4
  24. package/dist/config/validators/common.js.map +1 -1
  25. package/dist/config/validators/validate.d.ts +1013 -257
  26. package/dist/lib/authentication/authentication.d.ts +1 -0
  27. package/dist/lib/authentication/hook.d.ts +1 -0
  28. package/dist/lib/authentication/hook.js +11 -1
  29. package/dist/lib/authentication/hook.js.map +1 -1
  30. package/dist/lib/authentication/providers/clerk.d.ts +2 -2
  31. package/dist/lib/authentication/providers/clerk.js +19 -0
  32. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  33. package/dist/lib/authentication/providers/openid.d.ts +1 -0
  34. package/dist/lib/authentication/providers/openid.js +20 -8
  35. package/dist/lib/authentication/providers/openid.js.map +1 -1
  36. package/dist/lib/authentication/providers/supabase.d.ts +4 -0
  37. package/dist/lib/authentication/providers/supabase.js +117 -0
  38. package/dist/lib/authentication/providers/supabase.js.map +1 -0
  39. package/dist/lib/authentication/state.d.ts +0 -26
  40. package/dist/lib/authentication/state.js +1 -16
  41. package/dist/lib/authentication/state.js.map +1 -1
  42. package/dist/lib/components/AnchorLink.d.ts +2 -2
  43. package/dist/lib/components/AnchorLink.js +5 -4
  44. package/dist/lib/components/AnchorLink.js.map +1 -1
  45. package/dist/lib/components/Bootstrap.d.ts +2 -1
  46. package/dist/lib/components/Bootstrap.js +3 -2
  47. package/dist/lib/components/Bootstrap.js.map +1 -1
  48. package/dist/lib/components/Footer.d.ts +1 -0
  49. package/dist/lib/components/Footer.js +32 -0
  50. package/dist/lib/components/Footer.js.map +1 -0
  51. package/dist/lib/components/Header.js +4 -4
  52. package/dist/lib/components/Header.js.map +1 -1
  53. package/dist/lib/components/Heading.d.ts +1 -1
  54. package/dist/lib/components/InlineCode.d.ts +2 -1
  55. package/dist/lib/components/InlineCode.js +2 -9
  56. package/dist/lib/components/InlineCode.js.map +1 -1
  57. package/dist/lib/components/Layout.js +8 -29
  58. package/dist/lib/components/Layout.js.map +1 -1
  59. package/dist/lib/components/Main.d.ts +2 -0
  60. package/dist/lib/components/Main.js +17 -0
  61. package/dist/lib/components/Main.js.map +1 -0
  62. package/dist/lib/components/MobileTopNavigation.js +6 -3
  63. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  64. package/dist/lib/components/Pagination.d.ts +11 -0
  65. package/dist/lib/components/Pagination.js +10 -0
  66. package/dist/lib/components/Pagination.js.map +1 -0
  67. package/dist/lib/components/TopNavigation.d.ts +3 -2
  68. package/dist/lib/components/TopNavigation.js +26 -13
  69. package/dist/lib/components/TopNavigation.js.map +1 -1
  70. package/dist/lib/components/Zudoku.js +9 -3
  71. package/dist/lib/components/Zudoku.js.map +1 -1
  72. package/dist/lib/components/cache.d.ts +7 -0
  73. package/dist/lib/components/cache.js +7 -0
  74. package/dist/lib/components/cache.js.map +1 -1
  75. package/dist/lib/components/context/BypassProtectedRoutesContext.d.ts +1 -0
  76. package/dist/lib/components/context/BypassProtectedRoutesContext.js +3 -0
  77. package/dist/lib/components/context/BypassProtectedRoutesContext.js.map +1 -0
  78. package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
  79. package/dist/lib/components/context/ViewportAnchorContext.js +5 -10
  80. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  81. package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
  82. package/dist/lib/components/context/ZudokuContext.js +13 -7
  83. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  84. package/dist/lib/components/index.d.ts +5 -2
  85. package/dist/lib/components/navigation/PoweredByZudoku.d.ts +3 -0
  86. package/dist/lib/components/navigation/PoweredByZudoku.js +6 -0
  87. package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -0
  88. package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
  89. package/dist/lib/components/navigation/Sidebar.js +1 -12
  90. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  91. package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
  92. package/dist/lib/components/navigation/SidebarCategory.js +10 -6
  93. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  94. package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
  95. package/dist/lib/components/navigation/SidebarItem.js +17 -11
  96. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  97. package/dist/lib/components/navigation/SidebarWrapper.d.ts +7 -6
  98. package/dist/lib/components/navigation/SidebarWrapper.js +18 -3
  99. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  100. package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
  101. package/dist/lib/components/navigation/Toc.js.map +1 -0
  102. package/dist/lib/components/navigation/ZudokuLogo.d.ts +6 -0
  103. package/dist/lib/components/navigation/ZudokuLogo.js +5 -0
  104. package/dist/lib/components/navigation/ZudokuLogo.js.map +1 -0
  105. package/dist/lib/core/RouteGuard.d.ts +1 -0
  106. package/dist/lib/core/RouteGuard.js +10 -3
  107. package/dist/lib/core/RouteGuard.js.map +1 -1
  108. package/dist/lib/core/ZudokuContext.d.ts +23 -7
  109. package/dist/lib/core/ZudokuContext.js +12 -5
  110. package/dist/lib/core/ZudokuContext.js.map +1 -1
  111. package/dist/lib/core/plugins.d.ts +9 -7
  112. package/dist/lib/errors/ErrorAlert.js +6 -1
  113. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  114. package/dist/lib/hooks/useEvent.test.js +1 -1
  115. package/dist/lib/hooks/useEvent.test.js.map +1 -1
  116. package/dist/lib/oas/graphql/index.d.ts +17 -4
  117. package/dist/lib/oas/graphql/index.js +148 -38
  118. package/dist/lib/oas/graphql/index.js.map +1 -1
  119. package/dist/lib/oas/parser/dereference/index.js +2 -0
  120. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  121. package/dist/lib/oas/parser/index.d.ts +5 -3
  122. package/dist/lib/oas/parser/index.js +0 -22
  123. package/dist/lib/oas/parser/index.js.map +1 -1
  124. package/dist/lib/plugins/api-catalog/Catalog.js +1 -1
  125. package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
  126. package/dist/lib/plugins/api-catalog/index.js +19 -17
  127. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  128. package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
  129. package/dist/lib/plugins/markdown/MdxPage.js +3 -9
  130. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  131. package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
  132. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  133. package/dist/lib/plugins/openapi/Endpoint.js +1 -1
  134. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  135. package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
  136. package/dist/lib/plugins/openapi/OperationList.js +63 -19
  137. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  138. package/dist/lib/plugins/openapi/OperationListItem.d.ts +1 -1
  139. package/dist/lib/plugins/openapi/OperationListItem.js +6 -12
  140. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  141. package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
  142. package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
  143. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
  144. package/dist/lib/plugins/openapi/ParameterListItem.js +9 -4
  145. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  146. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -1
  147. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  148. package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
  149. package/dist/lib/plugins/openapi/SchemaList.js +52 -0
  150. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
  151. package/dist/lib/plugins/openapi/Sidecar.js +38 -9
  152. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  153. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  154. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  155. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
  156. package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
  157. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
  158. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
  159. package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
  160. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
  161. package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
  162. package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
  163. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
  164. package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
  165. package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
  166. package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
  167. package/dist/lib/plugins/openapi/graphql/gql.d.ts +9 -5
  168. package/dist/lib/plugins/openapi/graphql/gql.js +5 -4
  169. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  170. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +108 -55
  171. package/dist/lib/plugins/openapi/graphql/graphql.js +59 -34
  172. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  173. package/dist/lib/plugins/openapi/index.d.ts +6 -11
  174. package/dist/lib/plugins/openapi/index.js +41 -60
  175. package/dist/lib/plugins/openapi/index.js.map +1 -1
  176. package/dist/lib/plugins/openapi/interfaces.d.ts +36 -10
  177. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
  178. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
  179. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  180. package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
  181. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  182. package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
  183. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
  184. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
  185. package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
  186. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
  187. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
  188. package/dist/lib/plugins/openapi/playground/Playground.d.ts +13 -2
  189. package/dist/lib/plugins/openapi/playground/Playground.js +81 -27
  190. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  191. package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
  192. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  193. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
  194. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
  195. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
  196. package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
  197. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
  198. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
  199. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +19 -13
  200. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  201. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
  202. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
  203. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  204. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
  205. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
  206. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
  207. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.d.ts +2 -1
  208. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js +2 -2
  209. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js.map +1 -1
  210. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
  211. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
  212. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
  213. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
  214. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
  215. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
  216. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.d.ts +2 -4
  217. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +18 -13
  218. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  219. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
  220. package/dist/lib/plugins/openapi/schema/SchemaView.js +33 -48
  221. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  222. package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
  223. package/dist/lib/plugins/openapi/schema/utils.js +3 -1
  224. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  225. package/dist/lib/plugins/openapi/state.d.ts +25 -0
  226. package/dist/lib/plugins/openapi/state.js +18 -0
  227. package/dist/lib/plugins/openapi/state.js.map +1 -0
  228. package/dist/lib/plugins/openapi/util/createSidebarCategory.js +5 -7
  229. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -1
  230. package/dist/lib/plugins/openapi/util/getRoutes.js +9 -3
  231. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  232. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +23 -10
  233. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  234. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -0
  235. package/dist/lib/plugins/search-pagefind/ResultList.js +19 -17
  236. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  237. package/dist/lib/plugins/search-pagefind/get-results.d.ts +8 -1
  238. package/dist/lib/plugins/search-pagefind/get-results.js +9 -4
  239. package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -1
  240. package/dist/lib/ui/Badge.d.ts +1 -1
  241. package/dist/lib/ui/Button.d.ts +2 -2
  242. package/dist/lib/ui/Button.js +2 -1
  243. package/dist/lib/ui/Button.js.map +1 -1
  244. package/dist/lib/ui/Callout.d.ts +2 -1
  245. package/dist/lib/ui/Callout.js +3 -2
  246. package/dist/lib/ui/Callout.js.map +1 -1
  247. package/dist/lib/ui/Checkbox.d.ts +2 -8
  248. package/dist/lib/ui/Checkbox.js +1 -13
  249. package/dist/lib/ui/Checkbox.js.map +1 -1
  250. package/dist/lib/ui/Command.d.ts +1 -1
  251. package/dist/lib/ui/Select.js +1 -1
  252. package/dist/lib/ui/Select.js.map +1 -1
  253. package/dist/lib/ui/Stepper.d.ts +0 -1
  254. package/dist/lib/ui/Stepper.js +1 -1
  255. package/dist/lib/ui/Stepper.js.map +1 -1
  256. package/dist/lib/ui/SyntaxHighlight.d.ts +2 -1
  257. package/dist/lib/ui/SyntaxHighlight.js +21 -15
  258. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  259. package/dist/lib/util/MdxComponents.d.ts +3 -2
  260. package/dist/lib/util/MdxComponents.js +2 -2
  261. package/dist/lib/util/MdxComponents.js.map +1 -1
  262. package/dist/lib/util/joinPath.d.ts +3 -0
  263. package/dist/lib/util/joinPath.js +3 -0
  264. package/dist/lib/util/joinPath.js.map +1 -1
  265. package/dist/lib/util/traverse.d.ts +2 -8
  266. package/dist/lib/util/traverse.js +2 -2
  267. package/dist/lib/util/traverse.js.map +1 -1
  268. package/dist/lib/util/types.d.ts +7 -0
  269. package/dist/lib/util/types.js +2 -0
  270. package/dist/lib/util/types.js.map +1 -0
  271. package/dist/lib/util/useOnScreen.d.ts +3 -2
  272. package/dist/lib/util/useOnScreen.js +3 -3
  273. package/dist/lib/util/useOnScreen.js.map +1 -1
  274. package/dist/lib/util/useScrollToAnchor.js +20 -12
  275. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  276. package/dist/vite/api/schema-codegen.d.ts +1 -1
  277. package/dist/vite/api/schema-codegen.js +35 -12
  278. package/dist/vite/api/schema-codegen.js.map +1 -1
  279. package/dist/vite/api/schema-codegen.test.js +66 -0
  280. package/dist/vite/api/schema-codegen.test.js.map +1 -1
  281. package/dist/vite/build.js +1 -4
  282. package/dist/vite/build.js.map +1 -1
  283. package/dist/vite/config.js +7 -9
  284. package/dist/vite/config.js.map +1 -1
  285. package/dist/vite/create-pagefind-index.d.ts +4 -0
  286. package/dist/vite/create-pagefind-index.js +12 -0
  287. package/dist/vite/create-pagefind-index.js.map +1 -0
  288. package/dist/vite/dev-server.js +4 -4
  289. package/dist/vite/dev-server.js.map +1 -1
  290. package/dist/vite/plugin-api.js +36 -29
  291. package/dist/vite/plugin-api.js.map +1 -1
  292. package/dist/vite/plugin-config-reload.js +3 -2
  293. package/dist/vite/plugin-config-reload.js.map +1 -1
  294. package/dist/vite/plugin-docs.d.ts +1 -1
  295. package/dist/vite/plugin-docs.js +18 -1
  296. package/dist/vite/plugin-docs.js.map +1 -1
  297. package/dist/vite/prerender/FileWritingResponse.d.ts +9 -5
  298. package/dist/vite/prerender/FileWritingResponse.js +5 -5
  299. package/dist/vite/prerender/FileWritingResponse.js.map +1 -1
  300. package/dist/vite/prerender/InMemoryResponse.d.ts +16 -0
  301. package/dist/vite/prerender/InMemoryResponse.js +32 -0
  302. package/dist/vite/prerender/InMemoryResponse.js.map +1 -0
  303. package/dist/vite/prerender/PrerenderResponse.d.ts +10 -0
  304. package/dist/vite/prerender/PrerenderResponse.js +2 -0
  305. package/dist/vite/prerender/PrerenderResponse.js.map +1 -0
  306. package/dist/vite/prerender/prerender.d.ts +1 -0
  307. package/dist/vite/prerender/prerender.js +32 -8
  308. package/dist/vite/prerender/prerender.js.map +1 -1
  309. package/dist/vite/prerender/worker.js +41 -14
  310. package/dist/vite/prerender/worker.js.map +1 -1
  311. package/dist/zuplo/with-zuplo.js +4 -0
  312. package/dist/zuplo/with-zuplo.js.map +1 -1
  313. package/lib/{AuthenticationPlugin-CiO1FM6Q.js → AuthenticationPlugin-foqdvvkf.js} +3 -3
  314. package/lib/{AuthenticationPlugin-CiO1FM6Q.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
  315. package/lib/Button-Fp19CMUr.js +49 -0
  316. package/lib/Button-Fp19CMUr.js.map +1 -0
  317. package/lib/Callout-B2vsR09t.js +229 -0
  318. package/lib/Callout-B2vsR09t.js.map +1 -0
  319. package/lib/{Dialog-DIKGQxQc.js → Dialog-sbgekbjb.js} +47 -32
  320. package/lib/{Dialog-DIKGQxQc.js.map → Dialog-sbgekbjb.js.map} +1 -1
  321. package/lib/Drawer-kDAfOq_2.js +1133 -0
  322. package/lib/Drawer-kDAfOq_2.js.map +1 -0
  323. package/lib/{Markdown-DePfm7oQ.js → Markdown-aF5FdsNi.js} +6268 -4572
  324. package/lib/Markdown-aF5FdsNi.js.map +1 -0
  325. package/lib/MdxPage-Vw_dc9Yz.js +85 -0
  326. package/lib/MdxPage-Vw_dc9Yz.js.map +1 -0
  327. package/lib/{OasProvider-BSuptFK-.js → OasProvider-C5paEivQ.js} +4 -4
  328. package/lib/{OasProvider-BSuptFK-.js.map → OasProvider-C5paEivQ.js.map} +1 -1
  329. package/lib/OperationList-Ds9Izgkn.js +5069 -0
  330. package/lib/OperationList-Ds9Izgkn.js.map +1 -0
  331. package/lib/Pagination-SdlocK96.js +48 -0
  332. package/lib/Pagination-SdlocK96.js.map +1 -0
  333. package/lib/{index.esm-CQHE3GEU.js → RouteGuard-CqZPoZYJ.js} +192 -139
  334. package/lib/RouteGuard-CqZPoZYJ.js.map +1 -0
  335. package/lib/SchemaList-NZbDXAV5.js +148 -0
  336. package/lib/SchemaList-NZbDXAV5.js.map +1 -0
  337. package/lib/SchemaView-B3fOPR4V.js +357 -0
  338. package/lib/SchemaView-B3fOPR4V.js.map +1 -0
  339. package/lib/{Select-Dqtcn53H.js → Select-DVFRKf1R.js} +9 -9
  340. package/lib/{Select-Dqtcn53H.js.map → Select-DVFRKf1R.js.map} +1 -1
  341. package/lib/SlotletProvider-DXvc0aY6.js +338 -0
  342. package/lib/SlotletProvider-DXvc0aY6.js.map +1 -0
  343. package/lib/Spinner-CE68iCm0.js +7 -0
  344. package/lib/Spinner-CE68iCm0.js.map +1 -0
  345. package/lib/SyntaxHighlight-BEoSoPEo.js +2890 -0
  346. package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
  347. package/lib/Toc-YBsgI72s.js +92 -0
  348. package/lib/Toc-YBsgI72s.js.map +1 -0
  349. package/lib/{chunk-IR6S3I6Y-D_3UmFIn.js → chunk-HA7DTUK3-C4gP41vD.js} +278 -278
  350. package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
  351. package/lib/{circular-v7K6lDDh.js → circular-ByJI6Mci.js} +4887 -4419
  352. package/lib/circular-ByJI6Mci.js.map +1 -0
  353. package/lib/{createServer-DmusVVsi.js → createServer-mYvGvmc0.js} +4150 -4424
  354. package/lib/createServer-mYvGvmc0.js.map +1 -0
  355. package/lib/{hook-CN__aZIt.js → hook-CqpVYDqN.js} +398 -379
  356. package/lib/hook-CqpVYDqN.js.map +1 -0
  357. package/lib/index-D48iOQvJ.js +1973 -0
  358. package/lib/index-D48iOQvJ.js.map +1 -0
  359. package/lib/index-PGJOZ6R-.js +2227 -0
  360. package/lib/index-PGJOZ6R-.js.map +1 -0
  361. package/lib/{mutation-EclmI0is.js → mutation-8LjrN7uz.js} +2 -2
  362. package/lib/{mutation-EclmI0is.js.map → mutation-8LjrN7uz.js.map} +1 -1
  363. package/lib/post-processors/traverse.js +2 -2
  364. package/lib/post-processors/traverse.js.map +1 -1
  365. package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
  366. package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
  367. package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
  368. package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
  369. package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
  370. package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
  371. package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
  372. package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
  373. package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
  374. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
  375. package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
  376. package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
  377. package/lib/ui/ActionButton.js +11 -10
  378. package/lib/ui/ActionButton.js.map +1 -1
  379. package/lib/ui/Button.js +13 -12
  380. package/lib/ui/Button.js.map +1 -1
  381. package/lib/ui/Callout.js +39 -21
  382. package/lib/ui/Callout.js.map +1 -1
  383. package/lib/ui/Checkbox.js +15 -25
  384. package/lib/ui/Checkbox.js.map +1 -1
  385. package/lib/ui/Command.js +1 -1
  386. package/lib/ui/Drawer.js +14 -1129
  387. package/lib/ui/Drawer.js.map +1 -1
  388. package/lib/ui/Select.js +1 -1
  389. package/lib/ui/Select.js.map +1 -1
  390. package/lib/ui/Stepper.js.map +1 -1
  391. package/lib/ui/SyntaxHighlight.js +8 -2902
  392. package/lib/ui/SyntaxHighlight.js.map +1 -1
  393. package/lib/{useExposedProps-RIvey2Oy.js → useExposedProps-B9qXJedG.js} +2 -2
  394. package/lib/{useExposedProps-RIvey2Oy.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
  395. package/lib/useLatest-hmRS46UF.js +11 -0
  396. package/lib/useLatest-hmRS46UF.js.map +1 -0
  397. package/lib/zudoku.auth-auth0.js +1 -1
  398. package/lib/zudoku.auth-clerk.js +59 -41
  399. package/lib/zudoku.auth-clerk.js.map +1 -1
  400. package/lib/zudoku.auth-openid.js +341 -337
  401. package/lib/zudoku.auth-openid.js.map +1 -1
  402. package/lib/zudoku.components.js +32 -1395
  403. package/lib/zudoku.components.js.map +1 -1
  404. package/lib/zudoku.hooks.js +1 -1
  405. package/lib/zudoku.plugin-api-catalog.js +94 -98
  406. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  407. package/lib/zudoku.plugin-api-keys.js +4 -4
  408. package/lib/zudoku.plugin-custom-pages.js +2 -2
  409. package/lib/zudoku.plugin-markdown.js +1 -1
  410. package/lib/zudoku.plugin-openapi.js +5 -7
  411. package/lib/zudoku.plugin-openapi.js.map +1 -1
  412. package/lib/zudoku.plugin-redirect.js +1 -1
  413. package/lib/zudoku.plugin-search-pagefind.js +233 -0
  414. package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
  415. package/lib/zudoku.plugins.js.map +1 -1
  416. package/package.json +32 -24
  417. package/src/app/entry.server.tsx +23 -13
  418. package/src/app/main.css +98 -57
  419. package/src/app/main.tsx +2 -0
  420. package/src/app/tailwind.ts +14 -0
  421. package/src/lib/authentication/authentication.ts +2 -0
  422. package/src/lib/authentication/hook.ts +12 -1
  423. package/src/lib/authentication/providers/clerk.tsx +22 -2
  424. package/src/lib/authentication/providers/openid.tsx +23 -10
  425. package/src/lib/authentication/providers/supabase.tsx +157 -0
  426. package/src/lib/authentication/state.ts +1 -35
  427. package/src/lib/components/AnchorLink.tsx +9 -7
  428. package/src/lib/components/Bootstrap.tsx +13 -6
  429. package/src/lib/components/Footer.tsx +136 -0
  430. package/src/lib/components/Header.tsx +11 -7
  431. package/src/lib/components/InlineCode.tsx +13 -16
  432. package/src/lib/components/Layout.tsx +22 -68
  433. package/src/lib/components/Main.tsx +50 -0
  434. package/src/lib/components/MobileTopNavigation.tsx +27 -18
  435. package/src/lib/components/Pagination.tsx +50 -0
  436. package/src/lib/components/TopNavigation.tsx +40 -17
  437. package/src/lib/components/Zudoku.tsx +12 -3
  438. package/src/lib/components/cache.ts +8 -0
  439. package/src/lib/components/context/BypassProtectedRoutesContext.ts +3 -0
  440. package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
  441. package/src/lib/components/context/ZudokuContext.ts +17 -8
  442. package/src/lib/components/navigation/PoweredByZudoku.tsx +23 -0
  443. package/src/lib/components/navigation/Sidebar.tsx +30 -44
  444. package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
  445. package/src/lib/components/navigation/SidebarItem.tsx +21 -29
  446. package/src/lib/components/navigation/SidebarWrapper.tsx +42 -23
  447. package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
  448. package/src/lib/components/navigation/ZudokuLogo.tsx +25 -0
  449. package/src/lib/core/RouteGuard.tsx +27 -4
  450. package/src/lib/core/ZudokuContext.ts +35 -15
  451. package/src/lib/core/plugins.ts +8 -8
  452. package/src/lib/errors/ErrorAlert.tsx +24 -17
  453. package/src/lib/hooks/useEvent.test.tsx +1 -1
  454. package/src/lib/oas/graphql/index.ts +202 -54
  455. package/src/lib/oas/parser/dereference/index.ts +2 -0
  456. package/src/lib/oas/parser/index.ts +7 -29
  457. package/src/lib/plugins/api-catalog/Catalog.tsx +1 -4
  458. package/src/lib/plugins/api-catalog/index.tsx +40 -35
  459. package/src/lib/plugins/markdown/MdxPage.tsx +11 -47
  460. package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
  461. package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
  462. package/src/lib/plugins/openapi/OperationList.tsx +162 -84
  463. package/src/lib/plugins/openapi/OperationListItem.tsx +116 -110
  464. package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
  465. package/src/lib/plugins/openapi/ParameterListItem.tsx +35 -23
  466. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -0
  467. package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
  468. package/src/lib/plugins/openapi/Sidecar.tsx +47 -11
  469. package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
  470. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
  471. package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
  472. package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
  473. package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
  474. package/src/lib/plugins/openapi/graphql/gql.ts +29 -20
  475. package/src/lib/plugins/openapi/graphql/graphql.ts +172 -86
  476. package/src/lib/plugins/openapi/index.tsx +55 -87
  477. package/src/lib/plugins/openapi/interfaces.ts +44 -15
  478. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
  479. package/src/lib/plugins/openapi/playground/Headers.tsx +0 -1
  480. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
  481. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
  482. package/src/lib/plugins/openapi/playground/Playground.tsx +175 -88
  483. package/src/lib/plugins/openapi/playground/QueryParams.tsx +0 -1
  484. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
  485. package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
  486. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +24 -4
  487. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +67 -45
  488. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
  489. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.tsx +3 -0
  490. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +6 -3
  491. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
  492. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +47 -50
  493. package/src/lib/plugins/openapi/schema/SchemaView.tsx +84 -138
  494. package/src/lib/plugins/openapi/schema/utils.ts +7 -1
  495. package/src/lib/plugins/openapi/state.ts +36 -0
  496. package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +5 -7
  497. package/src/lib/plugins/openapi/util/getRoutes.tsx +9 -6
  498. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +39 -14
  499. package/src/lib/plugins/search-pagefind/ResultList.tsx +60 -53
  500. package/src/lib/plugins/search-pagefind/get-results.tsx +31 -10
  501. package/src/lib/ui/Button.tsx +4 -2
  502. package/src/lib/ui/Callout.tsx +28 -10
  503. package/src/lib/ui/Checkbox.tsx +8 -24
  504. package/src/lib/ui/Select.tsx +1 -1
  505. package/src/lib/ui/Stepper.tsx +1 -1
  506. package/src/lib/ui/SyntaxHighlight.tsx +96 -96
  507. package/src/lib/util/MdxComponents.tsx +2 -2
  508. package/src/lib/util/joinPath.tsx +3 -0
  509. package/src/lib/util/traverse.ts +4 -8
  510. package/src/lib/util/types.ts +7 -0
  511. package/src/lib/util/useOnScreen.ts +6 -4
  512. package/src/lib/util/useScrollToAnchor.ts +22 -12
  513. package/dist/lib/components/context/PluginSystem.d.ts +0 -1
  514. package/dist/lib/components/context/PluginSystem.js +0 -2
  515. package/dist/lib/components/context/PluginSystem.js.map +0 -1
  516. package/dist/lib/plugins/markdown/Toc.js.map +0 -1
  517. package/dist/vite/pagefind.d.ts +0 -4
  518. package/dist/vite/pagefind.js +0 -15
  519. package/dist/vite/pagefind.js.map +0 -1
  520. package/lib/Markdown-DePfm7oQ.js.map +0 -1
  521. package/lib/MdxPage-BN6l6zXL.js +0 -201
  522. package/lib/MdxPage-BN6l6zXL.js.map +0 -1
  523. package/lib/OperationList-DOcfDmJP.js +0 -5217
  524. package/lib/OperationList-DOcfDmJP.js.map +0 -1
  525. package/lib/SlotletProvider-DdtIOUi6.js +0 -221
  526. package/lib/SlotletProvider-DdtIOUi6.js.map +0 -1
  527. package/lib/Spinner-1KrEmx1V.js +0 -51
  528. package/lib/Spinner-1KrEmx1V.js.map +0 -1
  529. package/lib/chunk-IR6S3I6Y-D_3UmFIn.js.map +0 -1
  530. package/lib/circular-v7K6lDDh.js.map +0 -1
  531. package/lib/createServer-DmusVVsi.js.map +0 -1
  532. package/lib/hook-CN__aZIt.js.map +0 -1
  533. package/lib/index-BTbP6Lgf.js +0 -2103
  534. package/lib/index-BTbP6Lgf.js.map +0 -1
  535. package/lib/index.esm-CQHE3GEU.js.map +0 -1
  536. package/lib/joinUrl-10po2Jdj.js +0 -20
  537. package/lib/joinUrl-10po2Jdj.js.map +0 -1
  538. package/lib/useScrollToAnchor-RyqO3lj4.js +0 -290
  539. package/lib/useScrollToAnchor-RyqO3lj4.js.map +0 -1
  540. package/lib/zudoku.css +0 -1
  541. package/src/lib/components/context/PluginSystem.ts +0 -0
  542. package/src/lib/ui/Stepper.css +0 -43
  543. /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
@@ -1,2103 +0,0 @@
1
- var yt = Object.defineProperty;
2
- var De = (t) => {
3
- throw TypeError(t);
4
- };
5
- var vt = (t, a, s) => a in t ? yt(t, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[a] = s;
6
- var ne = (t, a, s) => vt(t, typeof a != "symbol" ? a + "" : a, s), jt = (t, a, s) => a.has(t) || De("Cannot " + s);
7
- var re = (t, a, s) => (jt(t, a, "read from private field"), s ? s.call(t) : a.get(t)), oe = (t, a, s) => a.has(t) ? De("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, s);
8
- import { j as e } from "./jsx-runtime-CYK1ROHF.js";
9
- import { s as W } from "./index-LNp6rxyU.js";
10
- import { Circle as bt, ChevronRightIcon as B, CheckIcon as Nt, DotIcon as wt, Check as Ct, Search as Tt, XIcon as $t, ChevronDownIcon as St, InfoIcon as Le, LogInIcon as Pt, CirclePlayIcon as Rt } from "lucide-react";
11
- import { r as kt, m as Ve } from "./chunk-IR6S3I6Y-D_3UmFIn.js";
12
- import { m as It, o as Ot, p as Et, k as At } from "./hook-CN__aZIt.js";
13
- import { Button as K } from "./ui/Button.js";
14
- import { j as O } from "./joinUrl-10po2Jdj.js";
15
- import { Z as qt } from "./invariant-Caa8-XvF.js";
16
- import { VisuallyHidden as Dt } from "@radix-ui/react-visually-hidden";
17
- import * as x from "react";
18
- import { Fragment as k, useRef as q, useEffect as fe, useState as U, useCallback as Lt, useTransition as Vt } from "react";
19
- import { D as Ft, b as zt, a as Ht, c as Gt } from "./Dialog-DIKGQxQc.js";
20
- import { S as Qe, a as Ze, b as We, c as Ke, e as Q, u as Bt } from "./Select-Dqtcn53H.js";
21
- import { b as ge, u as ye, C as I, a as Ut, F as Mt } from "./index.esm--gIChbWs.js";
22
- import { c as ve } from "./index-CPNSgwSb.js";
23
- import { c as m } from "./cn-qaFjX9_3.js";
24
- import * as Xe from "@radix-ui/react-label";
25
- import * as M from "@radix-ui/react-radio-group";
26
- import { Card as je, CardHeader as _t, CardTitle as Jt, CardContent as Qt } from "./ui/Card.js";
27
- import { Tabs as Ye, TabsList as et, TabsTrigger as E, TabsContent as A } from "./ui/Tabs.js";
28
- import { z as Zt } from "./index-DwT-v3zK.js";
29
- import { B as Z, S as Wt } from "./Spinner-1KrEmx1V.js";
30
- import * as j from "@radix-ui/react-dropdown-menu";
31
- import * as me from "@radix-ui/react-checkbox";
32
- import * as X from "@radix-ui/react-popover";
33
- import { PopoverAnchor as Kt } from "@radix-ui/react-popover";
34
- import { V as $, T as Xt } from "./index-gQD2h1wX.js";
35
- import { Input as be } from "./ui/Input.js";
36
- import { Slot as Yt } from "@radix-ui/react-slot";
37
- import { Callout as ea } from "./ui/Callout.js";
38
- import { Collapsible as Fe, CollapsibleTrigger as ze, CollapsibleContent as He } from "./ui/Collapsible.js";
39
- import * as Ne from "@radix-ui/react-collapsible";
40
- import { SyntaxHighlight as ta } from "./ui/SyntaxHighlight.js";
41
- let ie;
42
- const aa = (t) => {
43
- var a;
44
- if ((a = t.errors) != null && a[0])
45
- throw new qt(t.errors[0].message, {
46
- developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
47
- });
48
- };
49
- var te, ae;
50
- class sa {
51
- constructor(a) {
52
- oe(this, te, async () => (ie || (ie = import("./createServer-DmusVVsi.js").then(
53
- (a) => a.createServer(this.config)
54
- )), ie));
55
- oe(this, ae, async (a) => this.config.server ? fetch(this.config.server, a) : (await re(this, te).call(this)).fetch("http://localhost/graphql", a));
56
- ne(this, "fetch", async (a, ...[s]) => {
57
- var l;
58
- const n = (l = a.match(/query (\w+)/)) == null ? void 0 : l[1], r = await re(this, ae).call(this, {
59
- method: "POST",
60
- body: JSON.stringify({ query: a, variables: s, operationName: n }),
61
- headers: { "Content-Type": "application/json" }
62
- });
63
- if (!r.ok)
64
- throw new Error("Network response was not ok");
65
- const o = await r.json();
66
- return aa(o), o.data;
67
- });
68
- this.config = a;
69
- }
70
- }
71
- te = new WeakMap(), ae = new WeakMap();
72
- class D extends String {
73
- constructor(s, n) {
74
- super(s);
75
- ne(this, "__apiType");
76
- this.value = s, this.__meta__ = n;
77
- }
78
- toString() {
79
- return this.value;
80
- }
81
- }
82
- const na = new D(
83
- `
84
- fragment OperationsFragment on OperationItem {
85
- slug
86
- summary
87
- method
88
- description
89
- operationId
90
- contentTypes
91
- path
92
- parameters {
93
- name
94
- in
95
- description
96
- required
97
- schema
98
- style
99
- examples {
100
- name
101
- description
102
- externalValue
103
- value
104
- summary
105
- }
106
- }
107
- requestBody {
108
- content {
109
- mediaType
110
- encoding {
111
- name
112
- }
113
- examples {
114
- name
115
- description
116
- externalValue
117
- value
118
- summary
119
- }
120
- schema
121
- }
122
- description
123
- required
124
- }
125
- responses {
126
- statusCode
127
- links
128
- description
129
- content {
130
- examples {
131
- name
132
- description
133
- externalValue
134
- value
135
- summary
136
- }
137
- mediaType
138
- encoding {
139
- name
140
- }
141
- schema
142
- }
143
- }
144
- }
145
- `,
146
- { fragmentName: "OperationsFragment" }
147
- ), ra = new D(`
148
- query ServersQuery($input: JSON!, $type: SchemaType!) {
149
- schema(input: $input, type: $type) {
150
- url
151
- servers {
152
- url
153
- }
154
- }
155
- }
156
- `), oa = new D(`
157
- query AllOperations($input: JSON!, $type: SchemaType!, $tag: String, $untagged: Boolean) {
158
- schema(input: $input, type: $type) {
159
- servers {
160
- url
161
- }
162
- description
163
- summary
164
- title
165
- url
166
- version
167
- tags(name: $tag) {
168
- name
169
- description
170
- }
171
- operations(tag: $tag, untagged: $untagged) {
172
- slug
173
- ...OperationsFragment
174
- }
175
- }
176
- }
177
- fragment OperationsFragment on OperationItem {
178
- slug
179
- summary
180
- method
181
- description
182
- operationId
183
- contentTypes
184
- path
185
- parameters {
186
- name
187
- in
188
- description
189
- required
190
- schema
191
- style
192
- examples {
193
- name
194
- description
195
- externalValue
196
- value
197
- summary
198
- }
199
- }
200
- requestBody {
201
- content {
202
- mediaType
203
- encoding {
204
- name
205
- }
206
- examples {
207
- name
208
- description
209
- externalValue
210
- value
211
- summary
212
- }
213
- schema
214
- }
215
- description
216
- required
217
- }
218
- responses {
219
- statusCode
220
- links
221
- description
222
- content {
223
- examples {
224
- name
225
- description
226
- externalValue
227
- value
228
- summary
229
- }
230
- mediaType
231
- encoding {
232
- name
233
- }
234
- schema
235
- }
236
- }
237
- }`), ia = new D(`
238
- query getServerQuery($input: JSON!, $type: SchemaType!) {
239
- schema(input: $input, type: $type) {
240
- url
241
- servers {
242
- url
243
- }
244
- }
245
- }
246
- `), la = new D(`
247
- query GetCategories($input: JSON!, $type: SchemaType!) {
248
- schema(input: $input, type: $type) {
249
- url
250
- tags {
251
- name
252
- }
253
- }
254
- }
255
- `), da = new D(`
256
- query GetOperations($input: JSON!, $type: SchemaType!, $tag: String) {
257
- schema(input: $input, type: $type) {
258
- operations(tag: $tag) {
259
- slug
260
- deprecated
261
- method
262
- summary
263
- operationId
264
- path
265
- tags {
266
- name
267
- }
268
- }
269
- untagged: operations(untagged: true) {
270
- slug
271
- deprecated
272
- method
273
- summary
274
- operationId
275
- path
276
- }
277
- }
278
- }
279
- `), ca = {
280
- "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": ra,
281
- "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\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": na,
282
- "\n query AllOperations(\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 tags(name: $tag) {\n name\n description\n }\n operations(tag: $tag, untagged: $untagged) {\n slug\n ...OperationsFragment\n }\n }\n }\n": oa,
283
- "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": ia,
284
- "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n name\n }\n }\n }\n": la,
285
- "\n query GetOperations($input: JSON!, $type: SchemaType!, $tag: String) {\n schema(input: $input, type: $type) {\n operations(tag: $tag) {\n slug\n deprecated\n method\n summary\n operationId\n path\n tags {\n name\n }\n }\n untagged: operations(untagged: true) {\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n": da
286
- };
287
- function tt(t) {
288
- return ca[t] ?? {};
289
- }
290
- const ma = ve(
291
- "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
292
- {
293
- variants: {
294
- variant: {
295
- default: "bg-background text-foreground",
296
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
297
- }
298
- },
299
- defaultVariants: {
300
- variant: "default"
301
- }
302
- }
303
- ), ue = x.forwardRef(({ className: t, variant: a, ...s }, n) => /* @__PURE__ */ e.jsx(
304
- "div",
305
- {
306
- ref: n,
307
- role: "alert",
308
- className: m(ma({ variant: a }), t),
309
- ...s
310
- }
311
- ));
312
- ue.displayName = "Alert";
313
- const pe = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
314
- "h5",
315
- {
316
- ref: s,
317
- className: m("mb-1 font-medium leading-none tracking-tight", t),
318
- ...a
319
- }
320
- ));
321
- pe.displayName = "AlertTitle";
322
- const he = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
323
- "div",
324
- {
325
- ref: s,
326
- className: m("text-sm [&_p]:leading-relaxed", t),
327
- ...a
328
- }
329
- ));
330
- he.displayName = "AlertDescription";
331
- const ua = ({
332
- path: t,
333
- renderParam: a
334
- }) => {
335
- let s = 0;
336
- return t.split("/").map((n, r, o) => {
337
- const l = Array.from(n.matchAll(/{([^}]+)}/g)), c = [];
338
- let d = 0;
339
- return l.forEach((u) => {
340
- const [g, C] = u;
341
- if (!C) return;
342
- const b = u.index;
343
- b > d && c.push(
344
- /* @__PURE__ */ e.jsx(k, { children: n.slice(d, b) }, `text-${d}-${b}`)
345
- ), c.push(
346
- /* @__PURE__ */ e.jsx(k, { children: a({ name: C, originalValue: g, index: s++ }) }, `param-${C}`)
347
- ), d = b + g.length;
348
- }), d < n.length && c.push(
349
- /* @__PURE__ */ e.jsx(k, { children: n.slice(d) }, `text-${d}-${n.length}`)
350
- ), // eslint-disable-next-line react/no-array-index-key
351
- /* @__PURE__ */ e.jsxs(k, { children: [
352
- c,
353
- r < o.length - 1 && "/",
354
- /* @__PURE__ */ e.jsx("wbr", {})
355
- ] }, `${n}-${r}`);
356
- });
357
- }, pa = ve(
358
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
359
- ), z = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
360
- Xe.Root,
361
- {
362
- ref: s,
363
- className: m(pa(), t),
364
- ...a
365
- }
366
- ));
367
- z.displayName = Xe.Root.displayName;
368
- const we = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
369
- M.Root,
370
- {
371
- className: m("grid gap-2", t),
372
- ...a,
373
- ref: s
374
- }
375
- ));
376
- we.displayName = M.Root.displayName;
377
- const Y = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
378
- M.Item,
379
- {
380
- ref: s,
381
- className: m(
382
- "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
383
- t
384
- ),
385
- ...a,
386
- children: /* @__PURE__ */ e.jsx(M.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(bt, { className: "h-2.5 w-2.5 fill-current text-current" }) })
387
- }
388
- ));
389
- Y.displayName = M.Item.displayName;
390
- const at = x.forwardRef(
391
- ({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
392
- "textarea",
393
- {
394
- className: m(
395
- "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-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
396
- t
397
- ),
398
- ref: s,
399
- ...a
400
- }
401
- )
402
- );
403
- at.displayName = "Textarea";
404
- const le = (t) => Math.abs(
405
- isNaN(parseInt(t)) ? t.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(t)) ? 0 : parseInt(t)
406
- ), de = (t) => t.length > 1 ? parseInt(t.split("").reduce((a, s) => `${le(a) + le(s)}`)) : le(t), Ge = (t, a = {}) => {
407
- const s = (3 * de(t) + 2 * de(t) + de(t)) % 360, { saturation: n = 75, lightness: r = 60 } = a;
408
- return `${s}deg ${n}% ${r}%`;
409
- }, ce = "data-linked-param", ha = (t) => {
410
- const { resolvedTheme: a } = Zt();
411
- return {
412
- text: Ge(
413
- t,
414
- a === "light" ? { saturation: 95, lightness: 38 } : {}
415
- ),
416
- background: Ge(
417
- t,
418
- a === "light" ? { saturation: 85, lightness: 40 } : {}
419
- )
420
- };
421
- }, st = ({
422
- name: t,
423
- className: a,
424
- slug: s,
425
- title: n,
426
- children: r,
427
- onClick: o
428
- }) => {
429
- const l = q(null), c = s == null ? void 0 : s.replace(/[{}]/g, ""), d = t.replace(/[{}]/g, ""), { text: u, background: g } = ha(d), C = `hsl(${u} / 100%)`, b = `hsl(${g} / 10%)`, p = `hsl(${g} / 50%)`;
430
- return fe(() => {
431
- if (!c || !l.current) return;
432
- const f = () => {
433
- document.querySelectorAll(`[${ce}="${c}"]`).forEach((y) => {
434
- y instanceof HTMLElement && (y.dataset.active = "true");
435
- });
436
- }, h = () => {
437
- document.querySelectorAll(`[${ce}="${c}"]`).forEach((y) => {
438
- y instanceof HTMLElement && (y.dataset.active = "false");
439
- });
440
- }, v = l.current;
441
- return v.addEventListener("mouseenter", f), v.addEventListener("mouseleave", h), () => {
442
- v.removeEventListener("mouseenter", f), v.removeEventListener("mouseleave", h);
443
- };
444
- }, [c]), /* @__PURE__ */ e.jsx(
445
- "span",
446
- {
447
- [ce]: c,
448
- className: m(
449
- // This may not contain (inline-)flex or (inline-)block otherwise it breaks the browser's full text search
450
- "relative rounded transition-all duration-100 rounded-lg",
451
- "border border-[--border-color] p-0.5 text-[--param-color] bg-[--background-color]",
452
- "data-[active=true]:border-[--param-color] data-[active=true]:shadow data-[active=true]:bottom-px",
453
- a
454
- ),
455
- title: n,
456
- suppressHydrationWarning: !0,
457
- ref: l,
458
- onClick: o,
459
- style: {
460
- "--param-color": C,
461
- "--border-color": p,
462
- "--background-color": b
463
- },
464
- children: r ?? t
465
- }
466
- );
467
- }, xa = (t, a, s) => {
468
- const n = a.replace(/(:\w+|\{\w+})/g, (o) => {
469
- var d;
470
- const l = o.replace(/[:{}]/g, "");
471
- return ((d = s.pathParams.find((u) => u.name === l)) == null ? void 0 : d.value) ?? o;
472
- }), r = new URL(
473
- n.replace(/^\//, ""),
474
- t.endsWith("/") ? t : `${t}/`
475
- );
476
- return s.queryParams.filter((o) => o.active).forEach((o) => {
477
- r.searchParams.set(o.name, o.value);
478
- }), r;
479
- }, nt = j.Root, rt = j.Trigger, fa = j.Group, ga = x.forwardRef(({ className: t, inset: a, children: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
480
- j.SubTrigger,
481
- {
482
- ref: r,
483
- className: m(
484
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
485
- a && "pl-8",
486
- t
487
- ),
488
- ...n,
489
- children: [
490
- s,
491
- /* @__PURE__ */ e.jsx(B, { className: "ml-auto h-4 w-4" })
492
- ]
493
- }
494
- ));
495
- ga.displayName = j.SubTrigger.displayName;
496
- const ya = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
497
- j.SubContent,
498
- {
499
- ref: s,
500
- className: m(
501
- "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",
502
- t
503
- ),
504
- ...a
505
- }
506
- ));
507
- ya.displayName = j.SubContent.displayName;
508
- const Ce = x.forwardRef(({ className: t, sideOffset: a = 4, ...s }, n) => /* @__PURE__ */ e.jsx(j.Portal, { children: /* @__PURE__ */ e.jsx(
509
- j.Content,
510
- {
511
- ref: n,
512
- sideOffset: a,
513
- className: m(
514
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
515
- "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",
516
- t
517
- ),
518
- ...s
519
- }
520
- ) }));
521
- Ce.displayName = j.Content.displayName;
522
- const Te = x.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ e.jsx(
523
- j.Item,
524
- {
525
- ref: n,
526
- className: m(
527
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
528
- a && "pl-8",
529
- t
530
- ),
531
- ...s
532
- }
533
- ));
534
- Te.displayName = j.Item.displayName;
535
- const va = x.forwardRef(({ className: t, children: a, checked: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
536
- j.CheckboxItem,
537
- {
538
- ref: r,
539
- className: m(
540
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
541
- t
542
- ),
543
- checked: s,
544
- ...n,
545
- children: [
546
- /* @__PURE__ */ e.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e.jsx(j.ItemIndicator, { children: /* @__PURE__ */ e.jsx(Nt, { className: "h-4 w-4" }) }) }),
547
- a
548
- ]
549
- }
550
- ));
551
- va.displayName = j.CheckboxItem.displayName;
552
- const ja = x.forwardRef(({ className: t, children: a, ...s }, n) => /* @__PURE__ */ e.jsxs(
553
- j.RadioItem,
554
- {
555
- ref: n,
556
- className: m(
557
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
558
- t
559
- ),
560
- ...s,
561
- children: [
562
- /* @__PURE__ */ e.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e.jsx(j.ItemIndicator, { children: /* @__PURE__ */ e.jsx(wt, { className: "h-4 w-4 fill-current" }) }) }),
563
- a
564
- ]
565
- }
566
- ));
567
- ja.displayName = j.RadioItem.displayName;
568
- const ot = x.forwardRef(({ className: t, inset: a, ...s }, n) => /* @__PURE__ */ e.jsx(
569
- j.Label,
570
- {
571
- ref: n,
572
- className: m(
573
- "px-2 py-1.5 text-sm font-semibold",
574
- a && "pl-8",
575
- t
576
- ),
577
- ...s
578
- }
579
- ));
580
- ot.displayName = j.Label.displayName;
581
- const it = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
582
- j.Separator,
583
- {
584
- ref: s,
585
- className: m("-mx-1 my-1 h-px bg-muted", t),
586
- ...a
587
- }
588
- ));
589
- it.displayName = j.Separator.displayName;
590
- const ba = ({
591
- examples: t,
592
- onSelect: a
593
- }) => /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 mt-2 items-end", children: /* @__PURE__ */ e.jsxs(nt, { children: [
594
- /* @__PURE__ */ e.jsx(rt, { asChild: !0, children: /* @__PURE__ */ e.jsx(Z, { variant: "outline", children: "Use Example" }) }),
595
- /* @__PURE__ */ e.jsx(Ce, { className: "w-56", children: t.map((s) => {
596
- var n;
597
- return /* @__PURE__ */ e.jsxs("div", { children: [
598
- /* @__PURE__ */ e.jsx(ot, { children: s.mediaType }),
599
- /* @__PURE__ */ e.jsx(it, {}),
600
- /* @__PURE__ */ e.jsx(fa, { children: (n = s.examples) == null ? void 0 : n.map((r) => /* @__PURE__ */ e.jsx(
601
- Te,
602
- {
603
- onSelect: () => a(r),
604
- className: "line-clamp-1",
605
- children: r.summary ?? r.name
606
- },
607
- r.name
608
- )) })
609
- ] }, s.mediaType);
610
- }) })
611
- ] }) }), se = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
612
- "div",
613
- {
614
- ref: s,
615
- className: m(
616
- "rounded-xl border bg-card text-card-foreground shadow-sm",
617
- t
618
- ),
619
- ...a
620
- }
621
- ));
622
- se.displayName = "Card";
623
- const Na = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
624
- "div",
625
- {
626
- ref: s,
627
- className: m("flex flex-col space-y-1.5 p-6", t),
628
- ...a
629
- }
630
- ));
631
- Na.displayName = "CardHeader";
632
- const wa = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
633
- "h3",
634
- {
635
- ref: s,
636
- className: m("font-semibold leading-none tracking-tight", t),
637
- ...a
638
- }
639
- ));
640
- wa.displayName = "CardTitle";
641
- const Ca = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
642
- "p",
643
- {
644
- ref: s,
645
- className: m("text-sm text-muted-foreground", t),
646
- ...a
647
- }
648
- ));
649
- Ca.displayName = "CardDescription";
650
- const Ta = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx("div", { ref: s, className: m("p-6 pt-0", t), ...a }));
651
- Ta.displayName = "CardContent";
652
- const $a = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
653
- "div",
654
- {
655
- ref: s,
656
- className: m("flex items-center p-6 pt-0", t),
657
- ...a
658
- }
659
- ));
660
- $a.displayName = "CardFooter";
661
- const Sa = ve(
662
- "peer h-4 w-4 shrink-0 rounded-sm ring-offset-background focus-visible:outline-none 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",
663
- {
664
- variants: {
665
- variant: {
666
- default: "border border-primary data-[state=checked]:bg-primary",
667
- outline: "border border-input data-[state=checked]:bg-accent"
668
- }
669
- },
670
- defaultVariants: {
671
- variant: "default"
672
- }
673
- }
674
- ), $e = x.forwardRef(({ className: t, variant: a, ...s }, n) => /* @__PURE__ */ e.jsx(
675
- me.Root,
676
- {
677
- ref: n,
678
- className: m(Sa({ variant: a, className: t })),
679
- ...s,
680
- children: /* @__PURE__ */ e.jsx(
681
- me.Indicator,
682
- {
683
- className: m("flex items-center justify-center text-current"),
684
- children: /* @__PURE__ */ e.jsx(Ct, { className: "h-4 w-4" })
685
- }
686
- )
687
- }
688
- ));
689
- $e.displayName = me.Root.displayName;
690
- const lt = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
691
- $,
692
- {
693
- ref: s,
694
- className: m(
695
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
696
- t
697
- ),
698
- ...a
699
- }
700
- ));
701
- lt.displayName = $.displayName;
702
- const Pa = x.forwardRef(({ className: t, ...a }, s) => (
703
- // eslint-disable-next-line react/no-unknown-property
704
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
705
- /* @__PURE__ */ e.jsx(Tt, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
706
- /* @__PURE__ */ e.jsx(
707
- $.Input,
708
- {
709
- ref: s,
710
- className: m(
711
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
712
- t
713
- ),
714
- ...a
715
- }
716
- )
717
- ] })
718
- ));
719
- Pa.displayName = $.Input.displayName;
720
- const dt = x.forwardRef(({ className: t, ...a }, s) => (
721
- // eslint-disable-next-line react/no-unknown-property
722
- /* @__PURE__ */ e.jsx("div", { className: "flex items-center", "cmdk-input-wrapper": "", children: /* @__PURE__ */ e.jsx(
723
- $.Input,
724
- {
725
- ref: s,
726
- className: m(
727
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
728
- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
729
- t
730
- ),
731
- ...a
732
- }
733
- ) })
734
- ));
735
- dt.displayName = $.Input.displayName;
736
- const ct = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
737
- $.List,
738
- {
739
- ref: s,
740
- className: m("max-h-[300px] overflow-y-auto overflow-x-hidden", t),
741
- ...a
742
- }
743
- ));
744
- ct.displayName = $.List.displayName;
745
- const Ra = x.forwardRef((t, a) => /* @__PURE__ */ e.jsx(
746
- $.Empty,
747
- {
748
- ref: a,
749
- className: "py-6 text-center text-sm",
750
- ...t
751
- }
752
- ));
753
- Ra.displayName = $.Empty.displayName;
754
- const ka = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
755
- $.Group,
756
- {
757
- ref: s,
758
- className: m(
759
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
760
- t
761
- ),
762
- ...a
763
- }
764
- ));
765
- ka.displayName = $.Group.displayName;
766
- const Ia = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
767
- $.Separator,
768
- {
769
- ref: s,
770
- className: m("-mx-1 h-px bg-border", t),
771
- ...a
772
- }
773
- ));
774
- Ia.displayName = $.Separator.displayName;
775
- const mt = x.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e.jsx(
776
- $.Item,
777
- {
778
- ref: s,
779
- className: m(
780
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
781
- t
782
- ),
783
- ...a
784
- }
785
- ));
786
- mt.displayName = $.Item.displayName;
787
- const Oa = X.Root, ut = x.forwardRef(({ className: t, align: a = "center", sideOffset: s = 4, ...n }, r) => /* @__PURE__ */ e.jsx(X.Portal, { children: /* @__PURE__ */ e.jsx(
788
- X.Content,
789
- {
790
- ref: r,
791
- align: a,
792
- sideOffset: s,
793
- className: m(
794
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
795
- t
796
- ),
797
- ...n
798
- }
799
- ) }));
800
- ut.displayName = X.Content.displayName;
801
- const Ea = ({
802
- value: t,
803
- options: a,
804
- onChange: s,
805
- className: n,
806
- placeholder: r = "Enter value",
807
- onEnterPress: o,
808
- ref: l
809
- }) => {
810
- const [c, d] = U(!1), [u, g] = U(!1), C = Xt((p) => p.filtered.count), b = q(null);
811
- return /* @__PURE__ */ e.jsxs(Oa, { open: c, children: [
812
- /* @__PURE__ */ e.jsx(Kt, { children: /* @__PURE__ */ e.jsx(
813
- dt,
814
- {
815
- ref: (p) => {
816
- b.current = p, typeof l == "function" ? l(p) : l && (l.current = p);
817
- },
818
- value: t,
819
- placeholder: r,
820
- className: m("h-9 bg-transparent", n),
821
- onFocus: () => d(!0),
822
- onBlur: () => {
823
- u || d(!1);
824
- },
825
- onKeyDown: (p) => {
826
- var f;
827
- p.key === "Enter" && (d(!1), (f = b.current) == null || f.blur(), o == null || o(p));
828
- },
829
- onValueChange: (p) => s(p)
830
- }
831
- ) }),
832
- /* @__PURE__ */ e.jsx(
833
- ut,
834
- {
835
- onMouseEnter: () => g(!0),
836
- onMouseLeave: () => g(!1),
837
- onOpenAutoFocus: (p) => p.preventDefault(),
838
- className: m("p-0 w-[--radix-popover-trigger-width]", {
839
- "border-0": C === 0
840
- }),
841
- align: "start",
842
- side: "bottom",
843
- onWheel: (p) => {
844
- p.stopPropagation();
845
- },
846
- onTouchMove: (p) => {
847
- p.stopPropagation();
848
- },
849
- children: /* @__PURE__ */ e.jsx(ct, { className: "max-h-[140px]", children: a.map((p) => /* @__PURE__ */ e.jsx(
850
- mt,
851
- {
852
- value: p,
853
- onSelect: (f) => {
854
- s(f), d(!1);
855
- },
856
- className: "cursor-pointer",
857
- children: p
858
- },
859
- p
860
- )) })
861
- }
862
- )
863
- ] });
864
- }, ee = ({ shouldFilter: t, ...a }) => /* @__PURE__ */ e.jsx(lt, { className: "bg-transparent", shouldFilter: t, children: /* @__PURE__ */ e.jsx(Ea, { ...a }) }), Se = (t, a) => {
865
- const s = x.forwardRef(({ className: n, asChild: r, ...o }, l) => {
866
- const c = r ? Yt : t;
867
- return x.createElement(c, {
868
- ...o,
869
- ref: l,
870
- className: typeof a == "function" ? a({ className: n }) : m(a, n)
871
- });
872
- });
873
- return s.displayName = `VariantComponent(${t})`, s;
874
- }, Pe = Se(
875
- "div",
876
- "grid grid-cols-[2fr_3fr] gap-2 items-center"
877
- ), Re = Se(
878
- "div",
879
- "group hover:bg-accent px-3 grid col-span-full grid-cols-subgrid"
880
- ), Aa = Object.freeze([
881
- "Accept",
882
- "Accept-Encoding",
883
- "Accept-Language",
884
- "Authorization",
885
- "Cache-Control",
886
- "Connection",
887
- "Content-Disposition",
888
- "Content-Encoding",
889
- "Content-Language",
890
- "Content-Length",
891
- "Content-Range",
892
- "Content-Security-Policy",
893
- "Content-Type",
894
- "Cookie",
895
- "Date",
896
- "ETag",
897
- "Expires",
898
- "Host",
899
- "If-Modified-Since",
900
- "Location",
901
- "Origin",
902
- "Pragma",
903
- "Referer",
904
- "Set-Cookie",
905
- "User-Agent",
906
- "X-Requested-With"
907
- ]), qa = ({
908
- control: t,
909
- headers: a
910
- }) => {
911
- const { fields: s, append: n, remove: r } = ge({
912
- control: t,
913
- name: "headers"
914
- }), { setValue: o, watch: l } = ye(), c = q([]), d = q([]), u = l("headers"), g = Lt(() => {
915
- n({ name: "", value: "", active: !1 });
916
- }, [n]);
917
- fe(() => {
918
- u.length === 0 && g();
919
- }, [u, g]);
920
- const C = (f) => {
921
- var h;
922
- (h = c.current[f]) == null || h.focus();
923
- }, b = (f) => {
924
- g(), requestAnimationFrame(() => {
925
- var h;
926
- return (h = d.current[f + 1]) == null ? void 0 : h.focus();
927
- });
928
- }, p = a.filter((f) => !u.some((h) => h.name === f.name)).map(({ name: f }) => f);
929
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
930
- /* @__PURE__ */ e.jsx(se, { className: "overflow-hidden", children: /* @__PURE__ */ e.jsx(Pe, { children: s.map((f, h) => {
931
- const v = a.find(
932
- (y) => y.name === l(`headers.${h}.name`)
933
- );
934
- return /* @__PURE__ */ e.jsxs(Re, { children: [
935
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 ", children: [
936
- /* @__PURE__ */ e.jsx(
937
- I,
938
- {
939
- control: t,
940
- name: `headers.${h}.active`,
941
- render: ({ field: y }) => /* @__PURE__ */ e.jsx(
942
- $e,
943
- {
944
- variant: "outline",
945
- id: `headers.${h}.active`,
946
- checked: y.value,
947
- onCheckedChange: (N) => {
948
- y.onChange(N);
949
- }
950
- }
951
- )
952
- }
953
- ),
954
- /* @__PURE__ */ e.jsx(
955
- I,
956
- {
957
- control: t,
958
- name: `headers.${h}.name`,
959
- render: ({ field: y }) => /* @__PURE__ */ e.jsx(
960
- ee,
961
- {
962
- ...y,
963
- placeholder: "Name",
964
- className: "border-0 shadow-none bg-transparent text-xs font-mono",
965
- options: [...p, ...Aa],
966
- onEnterPress: () => C(h),
967
- onChange: (N) => {
968
- y.onChange(N), o(`headers.${h}.active`, !0);
969
- },
970
- ref: (N) => {
971
- d.current[h] = N;
972
- }
973
- }
974
- )
975
- }
976
- )
977
- ] }),
978
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
979
- /* @__PURE__ */ e.jsx(
980
- I,
981
- {
982
- control: t,
983
- name: `headers.${h}.value`,
984
- render: ({ field: y }) => (v == null ? void 0 : v.enum) && v.enum.length > 0 ? /* @__PURE__ */ e.jsx(
985
- ee,
986
- {
987
- shouldFilter: !1,
988
- value: y.value,
989
- options: v.enum ?? [],
990
- onChange: (w) => {
991
- y.onChange(w), o(`headers.${h}.active`, !0);
992
- },
993
- className: "font-mono text-xs border-0"
994
- }
995
- ) : /* @__PURE__ */ e.jsx(
996
- be,
997
- {
998
- placeholder: "Value",
999
- className: "w-full border-0 shadow-none text-xs font-mono focus-visible:ring-0",
1000
- ...y,
1001
- ref: (w) => {
1002
- c.current[h] = w;
1003
- },
1004
- onKeyDown: (w) => {
1005
- w.key === "Enter" && w.currentTarget.value.trim() && b(h);
1006
- },
1007
- autoComplete: "off"
1008
- }
1009
- )
1010
- }
1011
- ),
1012
- /* @__PURE__ */ e.jsx(
1013
- K,
1014
- {
1015
- size: "icon",
1016
- variant: "ghost",
1017
- className: "text-muted-foreground opacity-0 group-hover:opacity-100 rounded-full w-8 h-7",
1018
- onClick: () => r(h),
1019
- type: "button",
1020
- children: /* @__PURE__ */ e.jsx($t, { size: 16 })
1021
- }
1022
- )
1023
- ] })
1024
- ] }, f.id);
1025
- }) }) }),
1026
- /* @__PURE__ */ e.jsx("div", { className: "text-end", children: /* @__PURE__ */ e.jsx(
1027
- K,
1028
- {
1029
- className: "",
1030
- onClick: g,
1031
- type: "button",
1032
- variant: "secondary",
1033
- children: "Add header"
1034
- }
1035
- ) })
1036
- ] });
1037
- }, Da = ({
1038
- control: t,
1039
- url: a
1040
- }) => {
1041
- const { fields: s } = ge({
1042
- control: t,
1043
- name: "pathParams"
1044
- }), n = [...s].sort(
1045
- (r, o) => a.indexOf(`{${r.name}}`) - a.indexOf(`{${o.name}}`)
1046
- );
1047
- return /* @__PURE__ */ e.jsx(se, { className: "rounded-lg", children: /* @__PURE__ */ e.jsx(Pe, { children: n.map((r, o) => /* @__PURE__ */ e.jsxs(Re, { children: [
1048
- /* @__PURE__ */ e.jsx(
1049
- I,
1050
- {
1051
- control: t,
1052
- name: `pathParams.${o}.name`,
1053
- render: () => /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ e.jsx(
1054
- st,
1055
- {
1056
- slug: r.name,
1057
- name: r.name,
1058
- className: "font-mono text-xs px-2"
1059
- }
1060
- ) })
1061
- }
1062
- ),
1063
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ e.jsx(
1064
- I,
1065
- {
1066
- control: t,
1067
- name: `pathParams.${o}.value`,
1068
- render: ({ field: l }) => /* @__PURE__ */ e.jsx(
1069
- be,
1070
- {
1071
- ...l,
1072
- required: !0,
1073
- placeholder: "Enter value",
1074
- className: "w-full border-0 shadow-none text-xs font-mono focus-visible:ring-0"
1075
- }
1076
- )
1077
- }
1078
- ) })
1079
- ] }, r.id)) }) });
1080
- }, La = Se(
1081
- "input",
1082
- "px-2 bg-transparent h-6 font-mono text-xs m-2"
1083
- ), Va = ({
1084
- control: t,
1085
- queryParams: a
1086
- }) => {
1087
- const { fields: s } = ge({
1088
- control: t,
1089
- name: "queryParams"
1090
- }), n = ye(), r = a.map((o) => !!o.isRequired);
1091
- return /* @__PURE__ */ e.jsx(se, { className: "rounded-lg", children: /* @__PURE__ */ e.jsx("div", { className: "w-full ", children: /* @__PURE__ */ e.jsx(Pe, { children: s.map((o, l) => {
1092
- const c = a.find(
1093
- (d) => d.name === n.watch(`queryParams.${l}.name`)
1094
- );
1095
- return /* @__PURE__ */ e.jsxs(Re, { children: [
1096
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1097
- /* @__PURE__ */ e.jsx(
1098
- I,
1099
- {
1100
- control: t,
1101
- name: `queryParams.${l}.active`,
1102
- render: ({ field: d }) => /* @__PURE__ */ e.jsx(
1103
- $e,
1104
- {
1105
- variant: "outline",
1106
- id: `queryParams.${l}.active`,
1107
- className: "mr-2",
1108
- checked: d.value,
1109
- onCheckedChange: d.onChange
1110
- }
1111
- )
1112
- }
1113
- ),
1114
- /* @__PURE__ */ e.jsx(
1115
- I,
1116
- {
1117
- control: t,
1118
- render: ({ field: d }) => r[l] ? /* @__PURE__ */ e.jsx(La, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1119
- "label",
1120
- {
1121
- className: "flex items-center cursor-pointer gap-1",
1122
- htmlFor: `queryParams.${l}.active`,
1123
- title: r[l] ? "Required field" : void 0,
1124
- children: [
1125
- d.value,
1126
- r[l] && /* @__PURE__ */ e.jsx("sup", { children: " *" })
1127
- ]
1128
- }
1129
- ) }) : /* @__PURE__ */ e.jsx(
1130
- ee,
1131
- {
1132
- value: d.value,
1133
- options: a.map((u) => u.name),
1134
- onChange: (u) => {
1135
- d.onChange(u);
1136
- },
1137
- className: "border-0 font-mono text-xs bg-transparent hover:bg-transparent"
1138
- }
1139
- ),
1140
- name: `queryParams.${l}.name`
1141
- }
1142
- )
1143
- ] }, o.id),
1144
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ e.jsx(
1145
- I,
1146
- {
1147
- control: t,
1148
- render: ({ field: d }) => (c == null ? void 0 : c.enum) && c.enum.length > 0 ? /* @__PURE__ */ e.jsx(
1149
- ee,
1150
- {
1151
- value: d.value,
1152
- options: c.enum ?? [],
1153
- onChange: (g) => {
1154
- d.onChange(g), n.setValue(`queryParams.${l}.active`, !0);
1155
- },
1156
- className: "font-mono text-xs border-0 ring-1 ring-ring"
1157
- }
1158
- ) : /* @__PURE__ */ e.jsx(
1159
- be,
1160
- {
1161
- ...d,
1162
- onChange: (g) => {
1163
- d.onChange(g.target.value), g.target.value.length > 0 && n.setValue(`queryParams.${l}.active`, !0);
1164
- },
1165
- placeholder: "Enter value",
1166
- className: "w-full border-0 shadow-none focus-visible:ring-0 text-xs font-mono"
1167
- }
1168
- ),
1169
- name: `queryParams.${l}.value`
1170
- }
1171
- ) })
1172
- ] }, o.id);
1173
- }) }) }) });
1174
- }, P = {
1175
- green: "text-green-600",
1176
- blue: "text-sky-600",
1177
- yellow: "text-yellow-600",
1178
- red: "text-red-600",
1179
- purple: "text-purple-600",
1180
- indigo: "text-indigo-600",
1181
- gray: "text-gray-600"
1182
- }, Fa = {
1183
- get: P.green,
1184
- post: P.blue,
1185
- put: P.yellow,
1186
- delete: P.red,
1187
- patch: P.purple,
1188
- options: P.indigo,
1189
- head: P.gray,
1190
- trace: P.gray
1191
- }, za = (t) => Fa[t.toLocaleLowerCase()] ?? P.gray, Ha = ({
1192
- method: t,
1193
- url: a,
1194
- headers: s,
1195
- body: n
1196
- }) => /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 font-mono text-xs", children: [
1197
- /* @__PURE__ */ e.jsxs("div", { className: "gap-2 p-2 bg-muted rounded-md", children: [
1198
- /* @__PURE__ */ e.jsx("span", { className: m(za(t), "font-semibold"), children: t }),
1199
- " ",
1200
- /* @__PURE__ */ e.jsx("span", { className: "break-all", children: a }),
1201
- " ",
1202
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "HTTP/1.1" })
1203
- ] }),
1204
- /* @__PURE__ */ e.jsxs("div", { className: "mx-1.5 flex flex-col gap-3", children: [
1205
- /* @__PURE__ */ e.jsxs(Fe, { defaultOpen: !0, children: [
1206
- /* @__PURE__ */ e.jsxs(ze, { className: "flex items-center gap-2 hover:text-primary group", children: [
1207
- /* @__PURE__ */ e.jsx(B, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1208
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Headers" })
1209
- ] }),
1210
- /* @__PURE__ */ e.jsx(He, { children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-[auto,1fr] gap-x-8 gap-y-1 pl-1.5 pt-2", children: s.map(([r, o]) => /* @__PURE__ */ e.jsxs(k, { children: [
1211
- /* @__PURE__ */ e.jsx("div", { className: "text-primary", children: r }),
1212
- /* @__PURE__ */ e.jsx("div", { className: "break-all", children: o })
1213
- ] }, r)) }) })
1214
- ] }),
1215
- /* @__PURE__ */ e.jsxs(Fe, { defaultOpen: !0, children: [
1216
- /* @__PURE__ */ e.jsxs(ze, { className: "flex items-center gap-2 hover:text-primary group", children: [
1217
- /* @__PURE__ */ e.jsx(B, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1218
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Body" })
1219
- ] }),
1220
- /* @__PURE__ */ e.jsx(He, { children: /* @__PURE__ */ e.jsx("div", { className: "pl-0 pt-2", children: /* @__PURE__ */ e.jsx(
1221
- "div",
1222
- {
1223
- className: m(
1224
- "whitespace-pre-wrap break-all bg-muted p-2 rounded-md",
1225
- !n && "text-muted-foreground"
1226
- ),
1227
- children: n ?? "Empty body"
1228
- }
1229
- ) }) })
1230
- ] })
1231
- ] })
1232
- ] }), Be = Ne.Root, Ue = Ne.CollapsibleTrigger, Me = Ne.CollapsibleContent;
1233
- function ke(t) {
1234
- if (t === null) return "null";
1235
- if (Array.isArray(t)) {
1236
- if (t.length === 0) return "any[]";
1237
- const a = t[0];
1238
- return a === void 0 ? "any[]" : `${ke(a)}[]`;
1239
- }
1240
- return typeof t == "object" ? Ga(t) : typeof t;
1241
- }
1242
- function Ga(t, a = "") {
1243
- const s = ["{"];
1244
- for (const [n, r] of Object.entries(t)) {
1245
- const o = ke(r);
1246
- s.push(` ${n}: ${o};`);
1247
- }
1248
- return s.push("}"), s.join(`
1249
- `);
1250
- }
1251
- function Ba(t) {
1252
- return { lines: [`type GeneratedType = ${ke(t)};`] };
1253
- }
1254
- const Ua = {
1255
- 200: "OK",
1256
- 201: "Created",
1257
- 202: "Accepted",
1258
- 204: "No Content",
1259
- 400: "Bad Request",
1260
- 401: "Unauthorized",
1261
- 403: "Forbidden",
1262
- 404: "Not Found",
1263
- 405: "Method Not Allowed",
1264
- 500: "Internal Server Error"
1265
- }, Ma = (t) => {
1266
- var s;
1267
- return (s = Object.entries({
1268
- "application/json": "json",
1269
- "text/json": "json",
1270
- "text/html": "html",
1271
- "text/css": "css",
1272
- "text/javascript": "javascript",
1273
- "application/xml": "xml",
1274
- "application/xhtml+xml": "xhtml"
1275
- }).find(
1276
- ([n]) => t.includes(n)
1277
- )) == null ? void 0 : s[1];
1278
- }, _a = (t) => {
1279
- var s;
1280
- const a = ((s = t.find(([n, r]) => n === "Content-Type")) == null ? void 0 : s[1]) || "";
1281
- return Ma(a);
1282
- }, Ja = (t) => {
1283
- try {
1284
- return JSON.stringify(JSON.parse(t), null, 2);
1285
- } catch {
1286
- return null;
1287
- }
1288
- }, Qa = (t) => {
1289
- const a = [
1290
- "Content-Type",
1291
- "Content-Length",
1292
- "Authorization",
1293
- "X-RateLimit-Remaining",
1294
- "X-RateLimit-Limit",
1295
- "Cache-Control",
1296
- "ETag"
1297
- ].map((s) => s.toLowerCase());
1298
- return [...t].sort(([s], [n]) => {
1299
- const r = a.indexOf(s.toLowerCase()), o = a.indexOf(n.toLowerCase());
1300
- return r === o ? 0 : r === -1 ? 1 : o === -1 ? -1 : r - o;
1301
- });
1302
- }, Za = ({
1303
- body: t = "",
1304
- headers: a,
1305
- status: s,
1306
- time: n,
1307
- size: r,
1308
- url: o
1309
- }) => {
1310
- var p;
1311
- const l = _a(a), c = Ja(t), d = c || t, [u, g] = U(
1312
- c ? "formatted" : "raw"
1313
- ), C = It({
1314
- queryKey: ["types", d],
1315
- queryFn: async () => Ba(JSON.parse(d)),
1316
- enabled: u === "types"
1317
- }), b = Qa([...a]);
1318
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 h-full overflow-y-scroll max-h-[calc(100vh-220px)] py-4", children: [
1319
- /* @__PURE__ */ e.jsxs(Be, { defaultOpen: !0, children: [
1320
- /* @__PURE__ */ e.jsxs(Ue, { className: "flex items-center gap-2 hover:text-primary group", children: [
1321
- /* @__PURE__ */ e.jsx(B, { className: "h-4 w-4 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1322
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Headers" })
1323
- ] }),
1324
- /* @__PURE__ */ e.jsx(Me, { children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[auto,1fr] gap-x-8 gap-y-1 pl-1.5 pt-2 font-mono text-xs", children: [
1325
- b.slice(0, 5).map(([f, h]) => /* @__PURE__ */ e.jsxs(k, { children: [
1326
- /* @__PURE__ */ e.jsx("div", { className: "text-primary whitespace-pre", children: f }),
1327
- /* @__PURE__ */ e.jsx("div", { className: "break-all", children: h })
1328
- ] }, f)),
1329
- b.length > 5 && /* @__PURE__ */ e.jsxs(Be, { className: "col-span-full grid-cols-subgrid grid", children: [
1330
- /* @__PURE__ */ e.jsxs(Ue, { className: "col-span-2 text-xs text-muted-foreground hover:text-primary flex items-center gap-1 py-1", children: [
1331
- /* @__PURE__ */ e.jsx(B, { className: "h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-[90deg]" }),
1332
- "Show ",
1333
- b.length - 5,
1334
- " more headers"
1335
- ] }),
1336
- /* @__PURE__ */ e.jsx(Me, { className: "col-span-full grid grid-cols-subgrid gap-x-8 gap-y-1 ", children: b.slice(5).map(([f, h]) => /* @__PURE__ */ e.jsxs(k, { children: [
1337
- /* @__PURE__ */ e.jsx("div", { className: "text-primary whitespace-pre", children: f }),
1338
- /* @__PURE__ */ e.jsx("div", { className: "break-all", children: h })
1339
- ] }, f)) })
1340
- ] })
1341
- ] }) })
1342
- ] }),
1343
- /* @__PURE__ */ e.jsx(je, { className: "shadow-none", children: /* @__PURE__ */ e.jsx(
1344
- ta,
1345
- {
1346
- language: u === "types" ? "typescript" : u === "raw" ? c ? "plain" : l : "json",
1347
- noBackground: !0,
1348
- className: "overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]",
1349
- code: (u === "raw" ? t : u === "types" ? (p = C.data) == null ? void 0 : p.lines.join(`
1350
- `) : d) ?? ""
1351
- }
1352
- ) }),
1353
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 justify-between", children: [
1354
- /* @__PURE__ */ e.jsxs("div", { className: "flex text-xs gap-2 border bg-muted rounded-md p-2 items-center h-8 font-mono divide-x", children: [
1355
- /* @__PURE__ */ e.jsxs("div", { children: [
1356
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Status" }),
1357
- " ",
1358
- s,
1359
- " ",
1360
- Ua[s] ?? ""
1361
- ] }),
1362
- /* @__PURE__ */ e.jsxs("div", { children: [
1363
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Time" }),
1364
- " ",
1365
- n.toFixed(0),
1366
- "ms"
1367
- ] }),
1368
- /* @__PURE__ */ e.jsxs("div", { children: [
1369
- /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "Size" }),
1370
- " ",
1371
- r,
1372
- "B"
1373
- ] })
1374
- ] }),
1375
- c && /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
1376
- Qe,
1377
- {
1378
- value: u,
1379
- onValueChange: (f) => g(f),
1380
- children: [
1381
- /* @__PURE__ */ e.jsx(Ze, { className: "min-w-32", children: /* @__PURE__ */ e.jsx(We, { placeholder: "View" }) }),
1382
- /* @__PURE__ */ e.jsxs(Ke, { children: [
1383
- /* @__PURE__ */ e.jsx(Q, { value: "formatted", children: "Formatted" }),
1384
- /* @__PURE__ */ e.jsx(Q, { value: "raw", children: "Raw" }),
1385
- /* @__PURE__ */ e.jsx(Q, { value: "types", children: "Types" })
1386
- ] })
1387
- ]
1388
- }
1389
- ) })
1390
- ] })
1391
- ] });
1392
- }, Wa = ({
1393
- queryMutation: t,
1394
- showPathParamsWarning: a
1395
- }) => {
1396
- var n;
1397
- const s = ((((n = t.data) == null ? void 0 : n.status) ?? 0) / 100).toFixed(0);
1398
- return /* @__PURE__ */ e.jsx("div", { className: "min-w-0 p-8 bg-muted/70 overflow-y-auto", children: t.error ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1399
- a && /* @__PURE__ */ e.jsx(ea, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
1400
- /* @__PURE__ */ e.jsxs(je, { children: [
1401
- /* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(Jt, { children: "Request failed" }) }),
1402
- /* @__PURE__ */ e.jsxs(Qt, { children: [
1403
- "Error:",
1404
- " ",
1405
- t.error.message || String(t.error) || "Unexpected error"
1406
- ] })
1407
- ] })
1408
- ] }) : t.data ? /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsxs(Ye, { defaultValue: "response", children: [
1409
- /* @__PURE__ */ e.jsxs(et, { children: [
1410
- /* @__PURE__ */ e.jsx(E, { value: "request", children: "Request" }),
1411
- /* @__PURE__ */ e.jsxs(E, { value: "response", children: [
1412
- "Response",
1413
- /* @__PURE__ */ e.jsxs(
1414
- "span",
1415
- {
1416
- className: m(
1417
- "text-xs font-mono ml-1",
1418
- s === "2" && "text-green-500",
1419
- s === "3" && "text-blue-500",
1420
- s === "4" && "text-yellow-500",
1421
- s === "5" && "text-red-500"
1422
- ),
1423
- children: [
1424
- "(",
1425
- t.data.status,
1426
- ")"
1427
- ]
1428
- }
1429
- )
1430
- ] })
1431
- ] }),
1432
- /* @__PURE__ */ e.jsx(A, { value: "request", children: /* @__PURE__ */ e.jsx(Ha, { ...t.data.request }) }),
1433
- /* @__PURE__ */ e.jsx(A, { value: "response", children: /* @__PURE__ */ e.jsx(
1434
- Za,
1435
- {
1436
- status: t.data.status,
1437
- time: t.data.time,
1438
- size: t.data.size,
1439
- headers: t.data.headers,
1440
- body: t.data.body,
1441
- url: t.data.request.url
1442
- }
1443
- ) })
1444
- ] }) }) : /* @__PURE__ */ e.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ e.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: t.isPending ? /* @__PURE__ */ e.jsx(Wt, {}) : "Send a request first to see the response here" }) }) });
1445
- }, Ka = ({
1446
- identities: t,
1447
- formRef: a,
1448
- disabled: s
1449
- }) => {
1450
- const { setValue: n } = ye(), [r, o] = U();
1451
- return t.length === 0 ? /* @__PURE__ */ e.jsx(Z, { disabled: s, children: "Send" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex", children: [
1452
- /* @__PURE__ */ e.jsx(
1453
- Z,
1454
- {
1455
- className: "rounded-r-none inset-shadow-sm",
1456
- disabled: s,
1457
- onClick: () => {
1458
- var l;
1459
- return (l = a == null ? void 0 : a.current) == null ? void 0 : l.requestSubmit();
1460
- },
1461
- children: "Send"
1462
- }
1463
- ),
1464
- /* @__PURE__ */ e.jsxs(nt, { children: [
1465
- /* @__PURE__ */ e.jsx(rt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1466
- Z,
1467
- {
1468
- disabled: s,
1469
- className: "rounded-l-none border-l border-border/40 inset-shadow-sm w-6",
1470
- size: "icon",
1471
- children: /* @__PURE__ */ e.jsx(St, { className: "w-4 h-4" })
1472
- }
1473
- ) }),
1474
- /* @__PURE__ */ e.jsx(we, { value: r, children: /* @__PURE__ */ e.jsx(Ce, { className: "w-56", align: "end", alignOffset: -150, children: [{ id: H, label: "None" }, ...t].map(
1475
- (l) => /* @__PURE__ */ e.jsxs(
1476
- Te,
1477
- {
1478
- onClick: () => {
1479
- var c;
1480
- o(l.id), n("identity", l.id), (c = a == null ? void 0 : a.current) == null || c.requestSubmit();
1481
- },
1482
- onMouseEnter: () => o(l.id),
1483
- onMouseLeave: () => o(void 0),
1484
- children: [
1485
- /* @__PURE__ */ e.jsx(Y, { value: l.id, className: "mr-2" }),
1486
- l.label
1487
- ]
1488
- },
1489
- l.id
1490
- )
1491
- ) }) })
1492
- ] })
1493
- ] });
1494
- }, H = "__none", Xa = ({
1495
- server: t,
1496
- servers: a = [],
1497
- url: s,
1498
- method: n,
1499
- headers: r = [],
1500
- queryParams: o = [],
1501
- pathParams: l = [],
1502
- defaultBody: c = "",
1503
- examples: d
1504
- }) => {
1505
- var Oe, Ee, Ae;
1506
- const { selectedServer: u, setSelectedServer: g } = Ot(
1507
- a.map((i) => ({ url: i }))
1508
- ), [, C] = Vt(), { register: b, control: p, handleSubmit: f, watch: h, setValue: v, ...y } = Ut({
1509
- defaultValues: {
1510
- body: c,
1511
- queryParams: o.map((i) => ({
1512
- name: i.name,
1513
- value: i.defaultValue ?? "",
1514
- active: i.defaultActive ?? !1,
1515
- enum: i.enum ?? []
1516
- })).concat([
1517
- {
1518
- name: "",
1519
- value: "",
1520
- active: !1,
1521
- enum: []
1522
- }
1523
- ]),
1524
- pathParams: l.map((i) => ({
1525
- name: i.name,
1526
- value: i.defaultValue ?? ""
1527
- })),
1528
- headers: r.map((i) => ({
1529
- name: i.name,
1530
- value: i.defaultValue ?? "",
1531
- active: i.defaultActive ?? !1
1532
- })).concat([
1533
- {
1534
- name: "",
1535
- value: "",
1536
- active: !1
1537
- }
1538
- ]),
1539
- identity: H
1540
- }
1541
- }), N = h(), w = Et(), L = q(!1);
1542
- fe(() => {
1543
- var R;
1544
- if (L.current) return;
1545
- const i = (R = w.data) == null ? void 0 : R.at(0);
1546
- i && (v("identity", i.id), L.current = !0);
1547
- }, [v, w.data]);
1548
- const V = q(null), _ = Bt({
1549
- mutationFn: async (i) => {
1550
- var J, F;
1551
- const R = performance.now(), S = new Request(
1552
- xa(t ?? u, s, i),
1553
- {
1554
- method: n.toUpperCase(),
1555
- headers: Object.fromEntries(
1556
- i.headers.filter((T) => T.name && T.active).map((T) => [T.name, T.value])
1557
- ),
1558
- body: i.body ? i.body : void 0
1559
- }
1560
- );
1561
- i.identity !== H && await ((F = (J = w.data) == null ? void 0 : J.find((T) => T.id === i.identity)) == null ? void 0 : F.authorizeRequest(S));
1562
- try {
1563
- const T = await fetch(S, {
1564
- signal: AbortSignal.timeout(5e3)
1565
- }), ft = performance.now() - R, qe = await T.text(), gt = new URL(S.url);
1566
- return {
1567
- status: T.status,
1568
- headers: Array.from(T.headers.entries()),
1569
- size: qe.length,
1570
- body: qe,
1571
- time: ft,
1572
- request: {
1573
- method: S.method.toUpperCase(),
1574
- url: S.url,
1575
- headers: [
1576
- ["Host", gt.host],
1577
- ["User-Agent", "Zudoku Playground"],
1578
- ...Array.from(S.headers.entries())
1579
- ],
1580
- body: i.body ? i.body : void 0
1581
- }
1582
- };
1583
- } catch (T) {
1584
- throw T instanceof TypeError ? new Error(
1585
- "The request failed, possibly due to network issues or CORS policy."
1586
- ) : T;
1587
- }
1588
- }
1589
- }), ht = /* @__PURE__ */ e.jsx(
1590
- ua,
1591
- {
1592
- path: s,
1593
- renderParam: ({ name: i, originalValue: R, index: S }) => {
1594
- var F;
1595
- const J = (F = N.pathParams.find(
1596
- (T) => T.name === i
1597
- )) == null ? void 0 : F.value;
1598
- return /* @__PURE__ */ e.jsx(
1599
- st,
1600
- {
1601
- name: i,
1602
- backgroundOpacity: "0",
1603
- slug: i,
1604
- onClick: () => y.setFocus(`pathParams.${S}.value`),
1605
- children: J || R
1606
- }
1607
- );
1608
- }
1609
- }
1610
- ), Ie = N.queryParams.filter((i) => i.active).map((i, R, S) => /* @__PURE__ */ e.jsxs(k, { children: [
1611
- i.name,
1612
- "=",
1613
- encodeURIComponent(i.value).replaceAll("%20", "+"),
1614
- R < S.length - 1 && "&",
1615
- /* @__PURE__ */ e.jsx("wbr", {})
1616
- ] }, i.name)), xt = /* @__PURE__ */ e.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition translate-y-[4px]", children: t ? /* @__PURE__ */ e.jsx("span", { children: t.replace(/^https?:\/\//, "") }) : a.length > 1 && /* @__PURE__ */ e.jsxs(
1617
- Qe,
1618
- {
1619
- onValueChange: (i) => {
1620
- C(() => g(i));
1621
- },
1622
- value: u,
1623
- defaultValue: u,
1624
- children: [
1625
- /* @__PURE__ */ e.jsx(Ze, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ e.jsx(We, {}) }),
1626
- /* @__PURE__ */ e.jsx(Ke, { children: a.map((i) => /* @__PURE__ */ e.jsx(Q, { value: i, children: i.replace(/^https?:\/\//, "") }, i)) })
1627
- ]
1628
- }
1629
- ) });
1630
- return /* @__PURE__ */ e.jsx(
1631
- Mt,
1632
- {
1633
- register: b,
1634
- control: p,
1635
- handleSubmit: f,
1636
- watch: h,
1637
- setValue: v,
1638
- ...y,
1639
- children: /* @__PURE__ */ e.jsx(
1640
- "form",
1641
- {
1642
- onSubmit: f((i) => _.mutateAsync(i)),
1643
- ref: V,
1644
- children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 text-sm h-full", children: [
1645
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 p-4 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
1646
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-stretch", children: [
1647
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
1648
- /* @__PURE__ */ e.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono flex items-center", children: n.toUpperCase() }),
1649
- /* @__PURE__ */ e.jsxs("div", { className: "items-center px-2 py-0.5 font-mono text-xs break-all leading-6", children: [
1650
- xt,
1651
- ht,
1652
- Ie.length > 0 ? "?" : "",
1653
- Ie
1654
- ] })
1655
- ] }),
1656
- /* @__PURE__ */ e.jsx(
1657
- Ka,
1658
- {
1659
- identities: w.data ?? [],
1660
- formRef: V,
1661
- disabled: y.formState.isSubmitting
1662
- }
1663
- )
1664
- ] }),
1665
- /* @__PURE__ */ e.jsxs(Ye, { defaultValue: "parameters", children: [
1666
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1 justify-between", children: /* @__PURE__ */ e.jsxs(et, { children: [
1667
- /* @__PURE__ */ e.jsxs(E, { value: "parameters", children: [
1668
- "Parameters",
1669
- (N.pathParams.some((i) => i.value !== "") || N.queryParams.some((i) => i.active)) && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1670
- ] }),
1671
- /* @__PURE__ */ e.jsxs(E, { value: "headers", children: [
1672
- "Headers",
1673
- N.headers.filter((i) => i.active).length > 0 && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1674
- ] }),
1675
- /* @__PURE__ */ e.jsxs(E, { value: "auth", children: [
1676
- "Auth",
1677
- N.identity !== H && /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 rounded-full bg-blue-400 ml-2" })
1678
- ] }),
1679
- /* @__PURE__ */ e.jsx(E, { value: "body", children: "Body" })
1680
- ] }) }),
1681
- /* @__PURE__ */ e.jsx(A, { value: "headers", children: /* @__PURE__ */ e.jsx(qa, { control: p, headers: r }) }),
1682
- /* @__PURE__ */ e.jsxs(A, { value: "parameters", children: [
1683
- l.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1684
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
1685
- /* @__PURE__ */ e.jsx(Da, { url: s, control: p })
1686
- ] }),
1687
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1688
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
1689
- /* @__PURE__ */ e.jsx(Va, { control: p, queryParams: o })
1690
- ] })
1691
- ] }),
1692
- /* @__PURE__ */ e.jsxs(A, { value: "body", children: [
1693
- !["POST", "PUT", "PATCH", "DELETE"].includes(
1694
- n.toUpperCase()
1695
- ) && /* @__PURE__ */ e.jsxs(ue, { className: "mb-2", children: [
1696
- /* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4" }),
1697
- /* @__PURE__ */ e.jsx(pe, { children: "Body" }),
1698
- /* @__PURE__ */ e.jsx(he, { children: "Body is only supported for POST, PUT, PATCH, and DELETE requests" })
1699
- ] }),
1700
- /* @__PURE__ */ e.jsx(
1701
- at,
1702
- {
1703
- ...b("body"),
1704
- className: m(
1705
- "border w-full rounded-lg p-2 bg-muted h-40 font-mono",
1706
- !["POST", "PUT", "PATCH", "DELETE"].includes(
1707
- n.toUpperCase()
1708
- ) && "h-20"
1709
- ),
1710
- placeholder: ["POST", "PUT", "PATCH", "DELETE"].includes(
1711
- n.toUpperCase()
1712
- ) ? void 0 : "This request does not support a body",
1713
- disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
1714
- n.toUpperCase()
1715
- )
1716
- }
1717
- ),
1718
- d && /* @__PURE__ */ e.jsx(
1719
- ba,
1720
- {
1721
- examples: d,
1722
- onSelect: (i) => v("body", JSON.stringify(i.value, null, 2))
1723
- }
1724
- )
1725
- ] }),
1726
- /* @__PURE__ */ e.jsx(A, { value: "auth", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1727
- ((Oe = w.data) == null ? void 0 : Oe.length) === 0 && /* @__PURE__ */ e.jsxs(ue, { children: [
1728
- /* @__PURE__ */ e.jsx(Le, { className: "w-4 h-4" }),
1729
- /* @__PURE__ */ e.jsx(pe, { children: "Authentication" }),
1730
- /* @__PURE__ */ e.jsx(he, { children: "No identities found. Please create an identity first." })
1731
- ] }),
1732
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center gap-2", children: /* @__PURE__ */ e.jsx(je, { className: "w-full overflow-hidden", children: /* @__PURE__ */ e.jsxs(
1733
- we,
1734
- {
1735
- onValueChange: (i) => v("identity", i),
1736
- value: N.identity,
1737
- defaultValue: N.identity,
1738
- className: "gap-0",
1739
- disabled: ((Ee = w.data) == null ? void 0 : Ee.length) === 0,
1740
- children: [
1741
- /* @__PURE__ */ e.jsxs(
1742
- z,
1743
- {
1744
- className: "h-12 border-b items-center flex p-4 cursor-pointer hover:bg-accent",
1745
- htmlFor: "none",
1746
- children: [
1747
- /* @__PURE__ */ e.jsx(Y, { value: H, id: "none", children: "None" }),
1748
- /* @__PURE__ */ e.jsx(z, { htmlFor: "none", className: "ml-2", children: "None" })
1749
- ]
1750
- }
1751
- ),
1752
- (Ae = w.data) == null ? void 0 : Ae.map((i) => /* @__PURE__ */ e.jsxs(
1753
- z,
1754
- {
1755
- className: "h-12 border-b items-center flex p-4 cursor-pointer hover:bg-accent",
1756
- children: [
1757
- /* @__PURE__ */ e.jsx(
1758
- Y,
1759
- {
1760
- value: i.id,
1761
- id: i.id,
1762
- children: i.label
1763
- }
1764
- ),
1765
- /* @__PURE__ */ e.jsx(z, { htmlFor: i.id, className: "ml-2", children: i.label })
1766
- ]
1767
- },
1768
- i.id
1769
- ))
1770
- ]
1771
- }
1772
- ) }) })
1773
- ] }) })
1774
- ] })
1775
- ] }),
1776
- /* @__PURE__ */ e.jsx(
1777
- Wa,
1778
- {
1779
- queryMutation: _,
1780
- showPathParamsWarning: N.pathParams.some(
1781
- (i) => i.value === ""
1782
- )
1783
- }
1784
- )
1785
- ] })
1786
- }
1787
- )
1788
- }
1789
- );
1790
- }, Ya = ({
1791
- className: t,
1792
- size: a = 16
1793
- }) => /* @__PURE__ */ e.jsx(
1794
- "svg",
1795
- {
1796
- xmlns: "http://www.w3.org/2000/svg",
1797
- viewBox: "0 0 24 24",
1798
- fill: "currentColor",
1799
- className: t,
1800
- width: a,
1801
- height: a,
1802
- children: /* @__PURE__ */ e.jsx(
1803
- "path",
1804
- {
1805
- fillRule: "evenodd",
1806
- 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",
1807
- clipRule: "evenodd"
1808
- }
1809
- )
1810
- }
1811
- ), es = (t) => {
1812
- const [a, s] = U(!1);
1813
- return /* @__PURE__ */ e.jsxs(Ft, { onOpenChange: (n) => s(n), children: [
1814
- /* @__PURE__ */ e.jsx(zt, { asChild: !0, children: t.children ?? /* @__PURE__ */ e.jsxs(
1815
- "button",
1816
- {
1817
- type: "button",
1818
- className: "flex gap-1 items-center px-2 py-1 rounded-md transition text-xs bg-primary text-primary-foreground shadow-sm hover:bg-primary/80",
1819
- children: [
1820
- "Test",
1821
- /* @__PURE__ */ e.jsx(Ya, { size: 14 })
1822
- ]
1823
- }
1824
- ) }),
1825
- /* @__PURE__ */ e.jsxs(
1826
- Ht,
1827
- {
1828
- className: "max-w-screen-xl w-full h-5/6 overflow-hidden p-0",
1829
- "aria-describedby": void 0,
1830
- children: [
1831
- /* @__PURE__ */ e.jsx(Dt, { children: /* @__PURE__ */ e.jsx(Gt, { children: "Playground" }) }),
1832
- a && /* @__PURE__ */ e.jsx(Xa, { ...t })
1833
- ]
1834
- }
1835
- )
1836
- ] });
1837
- }, ts = {
1838
- get: "green",
1839
- post: "blue",
1840
- put: "yellow",
1841
- delete: "red",
1842
- patch: "purple",
1843
- options: "gray",
1844
- head: "gray"
1845
- }, _e = ({
1846
- label: t,
1847
- path: a,
1848
- operations: s,
1849
- collapsible: n,
1850
- collapsed: r
1851
- }) => ({
1852
- type: "category",
1853
- label: t,
1854
- link: {
1855
- type: "doc",
1856
- id: a,
1857
- label: t
1858
- },
1859
- collapsible: n,
1860
- collapsed: r,
1861
- items: s.map((o) => ({
1862
- type: "link",
1863
- label: o.summary ?? o.path,
1864
- href: `${a}#${o.slug}`,
1865
- ...o.method && {
1866
- badge: {
1867
- label: o.method,
1868
- color: ts[o.method.toLowerCase()],
1869
- invert: !0
1870
- }
1871
- }
1872
- }))
1873
- }), Je = (t) => ({
1874
- path: t.routePath,
1875
- async lazy() {
1876
- const { OasProvider: a } = await import("./OasProvider-BSuptFK-.js");
1877
- return {
1878
- element: /* @__PURE__ */ e.jsx(
1879
- a,
1880
- {
1881
- basePath: t.basePath,
1882
- version: t.version,
1883
- client: t.client,
1884
- config: t.config
1885
- }
1886
- )
1887
- };
1888
- },
1889
- children: t.routes
1890
- }), xe = ({
1891
- path: t,
1892
- tag: a,
1893
- untagged: s
1894
- }) => ({
1895
- path: t,
1896
- async lazy() {
1897
- const { OperationList: n } = await import("./OperationList-DOcfDmJP.js");
1898
- return { element: /* @__PURE__ */ e.jsx(n, { tag: a, untagged: s }) };
1899
- }
1900
- }), as = (t, a) => {
1901
- const s = O(
1902
- t,
1903
- a[0] ? W(a[0]) : G
1904
- );
1905
- return [
1906
- // Redirect to first tag on the index route
1907
- { index: !0, loader: () => kt(s) },
1908
- // Create routes for each tag
1909
- ...a.map(
1910
- (n) => xe({
1911
- path: O(t, W(n)),
1912
- tag: n
1913
- })
1914
- ),
1915
- // Category without tagged operations
1916
- xe({
1917
- path: O(t, G),
1918
- untagged: !0
1919
- })
1920
- ];
1921
- }, pt = (t) => t.type === "file" ? Object.keys(t.input) : [], ss = ({
1922
- basePath: t,
1923
- config: a,
1924
- client: s
1925
- }) => {
1926
- const n = a.tagPages;
1927
- if (!n)
1928
- return [
1929
- Je({
1930
- basePath: t,
1931
- routePath: t,
1932
- routes: [xe({ path: t + "/:tag?" })],
1933
- client: s,
1934
- config: a
1935
- })
1936
- ];
1937
- const r = pt(a);
1938
- return (r.length > 1 ? [void 0, ...r] : [void 0]).map((l) => {
1939
- const c = O(t, l);
1940
- return Je({
1941
- basePath: t,
1942
- version: l,
1943
- routePath: c,
1944
- routes: as(c, n),
1945
- client: s,
1946
- config: a
1947
- });
1948
- });
1949
- }, ns = tt(`
1950
- query GetCategories($input: JSON!, $type: SchemaType!) {
1951
- schema(input: $input, type: $type) {
1952
- url
1953
- tags {
1954
- name
1955
- }
1956
- }
1957
- }
1958
- `), rs = tt(`
1959
- query GetOperations($input: JSON!, $type: SchemaType!, $tag: String) {
1960
- schema(input: $input, type: $type) {
1961
- operations(tag: $tag) {
1962
- slug
1963
- deprecated
1964
- method
1965
- summary
1966
- operationId
1967
- path
1968
- tags {
1969
- name
1970
- }
1971
- }
1972
- untagged: operations(untagged: true) {
1973
- slug
1974
- deprecated
1975
- method
1976
- summary
1977
- operationId
1978
- path
1979
- }
1980
- }
1981
- }
1982
- `), G = "~endpoints", Es = (t) => {
1983
- const a = O(t.navigationId ?? "/reference"), s = new sa(t);
1984
- return {
1985
- getHead: () => {
1986
- if (t.type === "url" && !t.skipPreload)
1987
- return /* @__PURE__ */ e.jsx(
1988
- "link",
1989
- {
1990
- rel: "preload",
1991
- href: t.input,
1992
- as: "fetch",
1993
- crossOrigin: "anonymous"
1994
- }
1995
- );
1996
- if (t.server)
1997
- return /* @__PURE__ */ e.jsx("link", { rel: "preconnect", href: t.server });
1998
- },
1999
- getMdxComponents: () => ({
2000
- OpenPlaygroundButton: ({
2001
- requireAuth: n,
2002
- server: r,
2003
- method: o,
2004
- url: l,
2005
- children: c,
2006
- ...d
2007
- }) => {
2008
- const u = At();
2009
- if (!r)
2010
- throw new Error("Server is required");
2011
- return n && !u.isAuthenticated ? /* @__PURE__ */ e.jsxs(
2012
- K,
2013
- {
2014
- className: "gap-2 items-center",
2015
- variant: "outline",
2016
- onClick: u.login,
2017
- children: [
2018
- "Login to open in Playground ",
2019
- /* @__PURE__ */ e.jsx(Pt, { size: 16 })
2020
- ]
2021
- }
2022
- ) : /* @__PURE__ */ e.jsx(
2023
- es,
2024
- {
2025
- url: l ?? "/",
2026
- method: o ?? "get",
2027
- server: r,
2028
- ...d,
2029
- children: /* @__PURE__ */ e.jsx(K, { className: "gap-2 items-center", variant: "outline", children: c ?? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2030
- "Open in Playground ",
2031
- /* @__PURE__ */ e.jsx(Rt, { size: 16 })
2032
- ] }) })
2033
- }
2034
- );
2035
- }
2036
- }),
2037
- getSidebar: async (n) => {
2038
- var o;
2039
- if (!Ve({ path: a, end: !1 }, n))
2040
- return [];
2041
- const r = Ve(
2042
- { path: `${a}/:version?/:tag`, end: !0 },
2043
- n
2044
- );
2045
- try {
2046
- const l = r == null ? void 0 : r.params.version, c = l ?? pt(t).at(0), d = t.type, u = t.type === "file" ? t.input[c] : t.input, g = t.loadTags === !0 || t.type === "url", C = !t.loadTags && t.type !== "url", b = (o = t.tagPages) == null ? void 0 : o.find(
2047
- (v) => W(v) === (r == null ? void 0 : r.params.tag)
2048
- ), [p, f] = await Promise.all([
2049
- s.fetch(ns, { type: d, input: u }),
2050
- s.fetch(rs, {
2051
- type: d,
2052
- input: u,
2053
- tag: t.loadTags ? void 0 : b
2054
- })
2055
- ]), h = p.schema.tags.flatMap((v) => {
2056
- const y = O(
2057
- a,
2058
- l,
2059
- W(v.name)
2060
- ), N = f.schema.operations.filter(
2061
- (w) => {
2062
- var L, V;
2063
- return ((L = w.tags) == null ? void 0 : L.length) !== 0 && ((V = w.tags) == null ? void 0 : V.map((_) => _.name).includes(v.name));
2064
- }
2065
- );
2066
- return t.loadTags && N.length === 0 ? [] : _e({
2067
- label: v.name,
2068
- path: y,
2069
- operations: (r == null ? void 0 : r.params.tag) !== G || t.loadTags ? N : [],
2070
- collapsible: g,
2071
- collapsed: C
2072
- });
2073
- });
2074
- return f.schema.untagged.length > 0 && h.push(
2075
- _e({
2076
- label: "Other endpoints",
2077
- path: O(a, l, G),
2078
- operations: (r == null ? void 0 : r.params.tag) === G || t.loadTags ? f.schema.untagged : [],
2079
- collapsible: g,
2080
- collapsed: C
2081
- })
2082
- ), h;
2083
- } catch {
2084
- return [];
2085
- }
2086
- },
2087
- getRoutes: () => ss({ basePath: a, config: t, client: s })
2088
- };
2089
- };
2090
- export {
2091
- st as C,
2092
- es as P,
2093
- G as U,
2094
- tt as a,
2095
- Be as b,
2096
- Me as c,
2097
- Ue as d,
2098
- ua as e,
2099
- pt as g,
2100
- za as m,
2101
- Es as o
2102
- };
2103
- //# sourceMappingURL=index-BTbP6Lgf.js.map