zudoku 0.26.0 → 0.27.0

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