zudoku 0.0.0-fix-downgrade-openapi-parser.aac00796 → 0.0.0-fix-firebase-export.2e421fda

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