zudoku 0.0.0-f865d81 → 0.0.0-fa903e7

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 (446) hide show
  1. package/dist/app/demo.js +0 -2
  2. package/dist/app/demo.js.map +1 -1
  3. package/dist/app/entry.client.js +14 -0
  4. package/dist/app/entry.client.js.map +1 -1
  5. package/dist/app/entry.server.js +6 -6
  6. package/dist/app/entry.server.js.map +1 -1
  7. package/dist/app/main.d.ts +1 -1
  8. package/dist/app/main.js +2 -2
  9. package/dist/app/main.js.map +1 -1
  10. package/dist/app/standalone.js +0 -2
  11. package/dist/app/standalone.js.map +1 -1
  12. package/dist/cli/cli.js +1 -2
  13. package/dist/cli/cli.js.map +1 -1
  14. package/dist/cli/common/logger.js +9 -0
  15. package/dist/cli/common/logger.js.map +1 -1
  16. package/dist/codegen.d.ts +3 -0
  17. package/dist/codegen.js +45 -0
  18. package/dist/codegen.js.map +1 -0
  19. package/dist/config/validators/InputSidebarSchema.d.ts +10 -10
  20. package/dist/config/validators/validate.d.ts +148 -117
  21. package/dist/config/validators/validate.js +13 -6
  22. package/dist/config/validators/validate.js.map +1 -1
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/lib/authentication/AuthenticationPlugin.d.ts +4 -2
  27. package/dist/lib/authentication/AuthenticationPlugin.js +3 -0
  28. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -1
  29. package/dist/lib/authentication/authentication.d.ts +3 -3
  30. package/dist/lib/authentication/hook.d.ts +5 -4
  31. package/dist/lib/authentication/hook.js +1 -3
  32. package/dist/lib/authentication/hook.js.map +1 -1
  33. package/dist/lib/authentication/providers/auth0.js +12 -11
  34. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  35. package/dist/lib/authentication/providers/openid.d.ts +0 -1
  36. package/dist/lib/authentication/providers/openid.js +11 -26
  37. package/dist/lib/authentication/providers/openid.js.map +1 -1
  38. package/dist/lib/authentication/state.d.ts +25 -4
  39. package/dist/lib/authentication/state.js +28 -3
  40. package/dist/lib/authentication/state.js.map +1 -1
  41. package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
  42. package/dist/lib/authentication/use-broadcast/shared.js +243 -0
  43. package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
  44. package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
  45. package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
  46. package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
  47. package/dist/lib/components/Bootstrap.d.ts +3 -1
  48. package/dist/lib/components/Bootstrap.js +10 -4
  49. package/dist/lib/components/Bootstrap.js.map +1 -1
  50. package/dist/lib/components/ClientOnly.d.ts +4 -2
  51. package/dist/lib/components/ClientOnly.js +1 -1
  52. package/dist/lib/components/ClientOnly.js.map +1 -1
  53. package/dist/lib/components/DeveloperHint.js +2 -1
  54. package/dist/lib/components/DeveloperHint.js.map +1 -1
  55. package/dist/lib/components/Header.js +16 -10
  56. package/dist/lib/components/Header.js.map +1 -1
  57. package/dist/lib/components/Heading.d.ts +1 -1
  58. package/dist/lib/components/Layout.js +12 -4
  59. package/dist/lib/components/Layout.js.map +1 -1
  60. package/dist/lib/components/MobileTopNavigation.js +6 -7
  61. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  62. package/dist/lib/components/SyntaxHighlight.js +16 -12
  63. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  64. package/dist/lib/components/ThemeSwitch.d.ts +1 -0
  65. package/dist/lib/components/ThemeSwitch.js +13 -0
  66. package/dist/lib/components/ThemeSwitch.js.map +1 -0
  67. package/dist/lib/components/TopNavigation.d.ts +2 -0
  68. package/dist/lib/components/TopNavigation.js +13 -7
  69. package/dist/lib/components/TopNavigation.js.map +1 -1
  70. package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
  71. package/dist/lib/components/{DevPortal.js → Zudoku.js} +13 -14
  72. package/dist/lib/components/Zudoku.js.map +1 -0
  73. package/dist/lib/components/context/ZudokuContext.d.ts +7 -7
  74. package/dist/lib/components/context/ZudokuContext.js +8 -13
  75. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  76. package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
  77. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  78. package/dist/lib/components/index.d.ts +18 -10
  79. package/dist/lib/components/index.js +2 -3
  80. package/dist/lib/components/index.js.map +1 -1
  81. package/dist/lib/components/navigation/Sidebar.js +1 -1
  82. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  83. package/dist/lib/components/navigation/utils.js +2 -2
  84. package/dist/lib/components/navigation/utils.js.map +1 -1
  85. package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +3 -7
  86. package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -7
  87. package/dist/lib/core/ZudokuContext.js.map +1 -0
  88. package/dist/lib/core/plugins.d.ts +18 -12
  89. package/dist/lib/core/plugins.js.map +1 -1
  90. package/dist/lib/errors/ErrorAlert.js +1 -1
  91. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  92. package/dist/lib/oas/graphql/index.js +4 -4
  93. package/dist/lib/oas/graphql/index.js.map +1 -1
  94. package/dist/lib/oas/parser/upgrade/index.d.ts +2 -2
  95. package/dist/lib/oas/parser/upgrade/index.js +2 -17
  96. package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
  97. package/dist/lib/plugins/api-keys/index.d.ts +9 -9
  98. package/dist/lib/plugins/api-keys/index.js +3 -0
  99. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  100. package/dist/lib/plugins/custom-pages/index.d.ts +2 -2
  101. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  102. package/dist/lib/plugins/markdown/MdxPage.d.ts +9 -1
  103. package/dist/lib/plugins/markdown/MdxPage.js +14 -1
  104. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  105. package/dist/lib/plugins/markdown/index.d.ts +2 -2
  106. package/dist/lib/plugins/markdown/index.js +1 -1
  107. package/dist/lib/plugins/markdown/index.js.map +1 -1
  108. package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +5 -0
  109. package/dist/lib/plugins/openapi/CollapsibleCode.js +24 -0
  110. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -0
  111. package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
  112. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  113. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
  114. package/dist/lib/plugins/openapi/Endpoint.js +5 -9
  115. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  116. package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
  117. package/dist/lib/plugins/openapi/OperationList.js +21 -22
  118. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  119. package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
  120. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  121. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +7 -3
  122. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  123. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +9 -2
  124. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  125. package/dist/lib/plugins/openapi/Route.d.ts +4 -4
  126. package/dist/lib/plugins/openapi/Route.js +2 -4
  127. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  128. package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
  129. package/dist/lib/plugins/openapi/Sidecar.js +35 -33
  130. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  131. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
  132. package/dist/lib/plugins/openapi/client/GraphQLClient.js +114 -0
  133. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
  134. package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
  135. package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
  136. package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
  137. package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
  138. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
  139. package/dist/lib/plugins/openapi/client/useCreateQuery.js +15 -0
  140. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
  141. package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
  142. package/dist/lib/plugins/openapi/client/worker.js +23 -14
  143. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  144. package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
  145. package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
  146. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  147. package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -51
  148. package/dist/lib/plugins/openapi/graphql/gql.js +4 -2
  149. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  150. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +32 -8
  151. package/dist/lib/plugins/openapi/graphql/graphql.js +194 -662
  152. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  153. package/dist/lib/plugins/openapi/index.d.ts +2 -2
  154. package/dist/lib/plugins/openapi/index.js +40 -53
  155. package/dist/lib/plugins/openapi/index.js.map +1 -1
  156. package/dist/lib/plugins/openapi/interfaces.d.ts +1 -1
  157. package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +6 -0
  158. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +14 -0
  159. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -0
  160. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.d.ts +1 -0
  161. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +125 -0
  162. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -0
  163. package/dist/lib/plugins/openapi/post-processors/removePaths.d.ts +11 -0
  164. package/dist/lib/plugins/openapi/post-processors/removePaths.js +33 -0
  165. package/dist/lib/plugins/openapi/post-processors/removePaths.js.map +1 -0
  166. package/dist/lib/plugins/openapi/post-processors/removePaths.test.d.ts +1 -0
  167. package/dist/lib/plugins/openapi/post-processors/removePaths.test.js +104 -0
  168. package/dist/lib/plugins/openapi/post-processors/removePaths.test.js.map +1 -0
  169. package/dist/lib/plugins/openapi/post-processors/traverse.d.ts +1 -0
  170. package/dist/lib/plugins/openapi/post-processors/traverse.js +2 -0
  171. package/dist/lib/plugins/openapi/post-processors/traverse.js.map +1 -0
  172. package/dist/lib/plugins/openapi/schema/SchemaView.js +2 -1
  173. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  174. package/dist/lib/plugins/openapi/util/generateSchemaExample.d.ts +0 -1
  175. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +25 -36
  176. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  177. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  178. package/dist/lib/plugins/openapi-worker.js +7 -1
  179. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  180. package/dist/lib/plugins/redirect/index.d.ts +4 -7
  181. package/dist/lib/plugins/redirect/index.js +1 -1
  182. package/dist/lib/plugins/redirect/index.js.map +1 -1
  183. package/dist/lib/plugins/search-inkeep/index.d.ts +2 -2
  184. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  185. package/dist/lib/ui/ActionButton.d.ts +4 -0
  186. package/dist/lib/ui/ActionButton.js +10 -0
  187. package/dist/lib/ui/ActionButton.js.map +1 -0
  188. package/dist/lib/util/MdxComponents.d.ts +1 -1
  189. package/dist/lib/util/traverse.d.ts +2 -0
  190. package/dist/lib/util/traverse.js +18 -0
  191. package/dist/lib/util/traverse.js.map +1 -0
  192. package/dist/lib/util/useIsomorphicLayoutEffect.d.ts +3 -0
  193. package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
  194. package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
  195. package/dist/lib/util/useOnScreen.d.ts +4 -0
  196. package/dist/lib/util/useOnScreen.js +19 -0
  197. package/dist/lib/util/useOnScreen.js.map +1 -0
  198. package/dist/vite/build.js +5 -1
  199. package/dist/vite/build.js.map +1 -1
  200. package/dist/vite/config.d.ts +2 -8
  201. package/dist/vite/config.js +25 -54
  202. package/dist/vite/config.js.map +1 -1
  203. package/dist/vite/config.test.js +3 -4
  204. package/dist/vite/config.test.js.map +1 -1
  205. package/dist/vite/html.js +0 -2
  206. package/dist/vite/html.js.map +1 -1
  207. package/dist/vite/output.d.ts +101 -0
  208. package/dist/vite/output.js +53 -0
  209. package/dist/vite/output.js.map +1 -0
  210. package/dist/vite/plugin-api.js +23 -19
  211. package/dist/vite/plugin-api.js.map +1 -1
  212. package/dist/vite/plugin-component.js +14 -19
  213. package/dist/vite/plugin-component.js.map +1 -1
  214. package/dist/vite/plugin-config.d.ts +2 -3
  215. package/dist/vite/plugin-config.js +2 -3
  216. package/dist/vite/plugin-config.js.map +1 -1
  217. package/dist/vite/plugin-docs.test.js +15 -23
  218. package/dist/vite/plugin-docs.test.js.map +1 -1
  219. package/dist/vite/plugin-mdx.d.ts +0 -6
  220. package/dist/vite/plugin-mdx.js +13 -5
  221. package/dist/vite/plugin-mdx.js.map +1 -1
  222. package/dist/vite/plugin.js +1 -3
  223. package/dist/vite/plugin.js.map +1 -1
  224. package/dist/vite/prerender.js +3 -2
  225. package/dist/vite/prerender.js.map +1 -1
  226. package/dist/vite/remarkStaticGeneration.d.ts +3 -0
  227. package/dist/vite/remarkStaticGeneration.js +125 -0
  228. package/dist/vite/remarkStaticGeneration.js.map +1 -0
  229. package/dist/zuplo/with-zuplo.d.ts +3 -0
  230. package/dist/zuplo/with-zuplo.js +28 -0
  231. package/dist/zuplo/with-zuplo.js.map +1 -0
  232. package/lib/{AnchorLink-BbB2q-jx.js → AnchorLink-CDlhr8gL.js} +11 -10
  233. package/lib/{AnchorLink-BbB2q-jx.js.map → AnchorLink-CDlhr8gL.js.map} +1 -1
  234. package/lib/AuthenticationPlugin-D0Em0SwR.js +59 -0
  235. package/lib/{AuthenticationPlugin-C9BHGXlE.js.map → AuthenticationPlugin-D0Em0SwR.js.map} +1 -1
  236. package/lib/Button-jK0EsymC.js +48 -0
  237. package/lib/Button-jK0EsymC.js.map +1 -0
  238. package/lib/{ClientOnly-CVN6leDu.js → ClientOnly-E7hGysn1.js} +4 -4
  239. package/lib/ClientOnly-E7hGysn1.js.map +1 -0
  240. package/lib/Markdown-ievDDhFT.js +15192 -0
  241. package/lib/Markdown-ievDDhFT.js.map +1 -0
  242. package/lib/MdxPage-B2FpJ9KC.js +183 -0
  243. package/lib/MdxPage-B2FpJ9KC.js.map +1 -0
  244. package/lib/OperationList-BkNQEsNs.js +4693 -0
  245. package/lib/OperationList-BkNQEsNs.js.map +1 -0
  246. package/lib/Route-DlG_HTMu.js +11 -0
  247. package/lib/Route-DlG_HTMu.js.map +1 -0
  248. package/lib/{Select-Bagt3Bme.js → Select-O9ZM3ZgX.js} +7 -7
  249. package/lib/Select-O9ZM3ZgX.js.map +1 -0
  250. package/lib/{Spinner-C6zroowC.js → SidebarBadge-DxFJcJ6V.js} +28 -17
  251. package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
  252. package/lib/SlotletProvider-DyomlzGx.js +252 -0
  253. package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
  254. package/lib/Spinner-3cQDBVGr.js +7 -0
  255. package/lib/Spinner-3cQDBVGr.js.map +1 -0
  256. package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
  257. package/lib/SyntaxHighlight-DkLOsjHS.js.map +1 -0
  258. package/lib/assets/{worker-Bf8vjASY.js → worker-BHClFO3A.js} +156 -156
  259. package/lib/assets/worker-BHClFO3A.js.map +1 -0
  260. package/lib/context-D1nXWxm7.js +22 -0
  261. package/lib/context-D1nXWxm7.js.map +1 -0
  262. package/lib/createServer-CpJlUPtn.js +15299 -0
  263. package/lib/createServer-CpJlUPtn.js.map +1 -0
  264. package/lib/{hook-sn0zMTkE.js → hook-hEqe7fPB.js} +12 -14
  265. package/lib/hook-hEqe7fPB.js.map +1 -0
  266. package/lib/index-C7SaIME0.js +1277 -0
  267. package/lib/index-C7SaIME0.js.map +1 -0
  268. package/lib/index-Czzd9rjU.js +899 -0
  269. package/lib/index-Czzd9rjU.js.map +1 -0
  270. package/lib/index-Yn8c3UWE.js +921 -0
  271. package/lib/index-Yn8c3UWE.js.map +1 -0
  272. package/lib/object_hash-CvlLgU-M.js +785 -0
  273. package/lib/object_hash-CvlLgU-M.js.map +1 -0
  274. package/lib/post-processors/removeExtensions.js +11 -0
  275. package/lib/post-processors/removeExtensions.js.map +1 -0
  276. package/lib/post-processors/removePaths.js +28 -0
  277. package/lib/post-processors/removePaths.js.map +1 -0
  278. package/lib/post-processors/traverse.js +12 -0
  279. package/lib/post-processors/traverse.js.map +1 -0
  280. package/lib/{router-BsfSoK2j.js → router-lfyopgBI.js} +23 -23
  281. package/lib/{router-BsfSoK2j.js.map → router-lfyopgBI.js.map} +1 -1
  282. package/lib/state-tsXBLONe.js +203 -0
  283. package/lib/{state-CsuHT8ZO.js.map → state-tsXBLONe.js.map} +1 -1
  284. package/lib/ui/ActionButton.js +25 -0
  285. package/lib/ui/ActionButton.js.map +1 -0
  286. package/lib/useExposedProps-CTPtylCV.js +10 -0
  287. package/lib/{useExposedProps-ChOIUaS4.js.map → useExposedProps-CTPtylCV.js.map} +1 -1
  288. package/lib/{ZudokuContext-BKXGJTmu.js → utils-DcpDOncX.js} +242 -246
  289. package/lib/utils-DcpDOncX.js.map +1 -0
  290. package/lib/zudoku.auth-auth0.js +24 -18
  291. package/lib/zudoku.auth-auth0.js.map +1 -1
  292. package/lib/zudoku.auth-clerk.js +2 -2
  293. package/lib/zudoku.auth-openid.js +124 -138
  294. package/lib/zudoku.auth-openid.js.map +1 -1
  295. package/lib/zudoku.components.js +1291 -1119
  296. package/lib/zudoku.components.js.map +1 -1
  297. package/lib/zudoku.openapi-worker.js +10 -16336
  298. package/lib/zudoku.openapi-worker.js.map +1 -1
  299. package/lib/zudoku.plugin-api-keys.js +41 -39
  300. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  301. package/lib/zudoku.plugin-custom-pages.js +2 -2
  302. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  303. package/lib/zudoku.plugin-markdown.js +15 -14
  304. package/lib/zudoku.plugin-markdown.js.map +1 -1
  305. package/lib/zudoku.plugin-openapi.js +5 -9
  306. package/lib/zudoku.plugin-openapi.js.map +1 -1
  307. package/lib/zudoku.plugin-redirect.js +2 -2
  308. package/lib/zudoku.plugin-redirect.js.map +1 -1
  309. package/lib/zudoku.plugin-search-inkeep.js +1 -1
  310. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  311. package/package.json +27 -7
  312. package/src/app/demo.tsx +0 -3
  313. package/src/app/entry.client.tsx +14 -0
  314. package/src/app/entry.server.tsx +59 -53
  315. package/src/app/main.css +1 -1
  316. package/src/app/main.tsx +4 -4
  317. package/src/app/standalone.tsx +0 -3
  318. package/src/lib/authentication/AuthenticationPlugin.tsx +4 -1
  319. package/src/lib/authentication/authentication.ts +3 -3
  320. package/src/lib/authentication/hook.ts +1 -3
  321. package/src/lib/authentication/providers/auth0.tsx +17 -11
  322. package/src/lib/authentication/providers/openid.tsx +12 -30
  323. package/src/lib/authentication/state.ts +50 -9
  324. package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
  325. package/src/lib/authentication/use-broadcast/shared.ts +372 -0
  326. package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
  327. package/src/lib/components/Bootstrap.tsx +36 -14
  328. package/src/lib/components/ClientOnly.tsx +6 -3
  329. package/src/lib/components/DeveloperHint.tsx +6 -1
  330. package/src/lib/components/Header.tsx +68 -40
  331. package/src/lib/components/Layout.tsx +49 -37
  332. package/src/lib/components/MobileTopNavigation.tsx +15 -18
  333. package/src/lib/components/SyntaxHighlight.tsx +81 -46
  334. package/src/lib/components/ThemeSwitch.tsx +26 -0
  335. package/src/lib/components/TopNavigation.tsx +27 -19
  336. package/src/lib/components/Zudoku.tsx +108 -0
  337. package/src/lib/components/context/ZudokuContext.ts +11 -16
  338. package/src/lib/components/context/ZudokuProvider.tsx +2 -2
  339. package/src/lib/components/index.ts +2 -3
  340. package/src/lib/components/navigation/Sidebar.tsx +3 -3
  341. package/src/lib/components/navigation/utils.ts +2 -2
  342. package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +3 -11
  343. package/src/lib/core/plugins.ts +20 -16
  344. package/src/lib/errors/ErrorAlert.tsx +2 -1
  345. package/src/lib/oas/graphql/index.ts +4 -4
  346. package/src/lib/oas/parser/upgrade/index.ts +3 -24
  347. package/src/lib/plugins/api-keys/index.tsx +12 -9
  348. package/src/lib/plugins/custom-pages/index.tsx +2 -2
  349. package/src/lib/plugins/markdown/MdxPage.tsx +25 -1
  350. package/src/lib/plugins/markdown/index.tsx +3 -2
  351. package/src/lib/plugins/openapi/CollapsibleCode.tsx +80 -0
  352. package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
  353. package/src/lib/plugins/openapi/Endpoint.tsx +5 -10
  354. package/src/lib/plugins/openapi/OperationList.tsx +20 -40
  355. package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
  356. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +18 -13
  357. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +17 -12
  358. package/src/lib/plugins/openapi/Route.tsx +11 -12
  359. package/src/lib/plugins/openapi/Sidecar.tsx +73 -59
  360. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +157 -0
  361. package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
  362. package/src/lib/plugins/openapi/client/createServer.ts +2 -0
  363. package/src/lib/plugins/openapi/client/useCreateQuery.ts +21 -0
  364. package/src/lib/plugins/openapi/client/worker.ts +38 -24
  365. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
  366. package/src/lib/plugins/openapi/graphql/gql.ts +10 -27
  367. package/src/lib/plugins/openapi/graphql/graphql.ts +233 -665
  368. package/src/lib/plugins/openapi/index.tsx +42 -67
  369. package/src/lib/plugins/openapi/interfaces.ts +1 -1
  370. package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +144 -0
  371. package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +24 -0
  372. package/src/lib/plugins/openapi/post-processors/removePaths.test.ts +126 -0
  373. package/src/lib/plugins/openapi/post-processors/removePaths.ts +55 -0
  374. package/src/lib/plugins/openapi/post-processors/traverse.ts +1 -0
  375. package/src/lib/plugins/openapi/schema/SchemaView.tsx +5 -2
  376. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +28 -42
  377. package/src/lib/plugins/openapi-worker.ts +11 -1
  378. package/src/lib/plugins/redirect/index.tsx +5 -9
  379. package/src/lib/plugins/search-inkeep/index.tsx +2 -2
  380. package/src/lib/ui/ActionButton.tsx +28 -0
  381. package/src/lib/util/traverse.ts +25 -0
  382. package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
  383. package/src/lib/util/useOnScreen.ts +32 -0
  384. package/dist/lib/components/DevPortal.js.map +0 -1
  385. package/dist/lib/components/context/ThemeContext.d.ts +0 -2
  386. package/dist/lib/components/context/ThemeContext.js +0 -7
  387. package/dist/lib/components/context/ThemeContext.js.map +0 -1
  388. package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
  389. package/dist/lib/components/context/ThemeProvider.js +0 -23
  390. package/dist/lib/components/context/ThemeProvider.js.map +0 -1
  391. package/dist/lib/core/DevPortalContext.js.map +0 -1
  392. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -12
  393. package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -46
  394. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
  395. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
  396. package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -61
  397. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
  398. package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
  399. package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
  400. package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
  401. package/dist/lib/themeToggle.d.ts +0 -1
  402. package/dist/lib/themeToggle.js +0 -7
  403. package/dist/lib/themeToggle.js.map +0 -1
  404. package/dist/lib/util/createWaitForNotify.d.ts +0 -1
  405. package/dist/lib/util/createWaitForNotify.js +0 -15
  406. package/dist/lib/util/createWaitForNotify.js.map +0 -1
  407. package/dist/vite/plugin-html-transform.d.ts +0 -2
  408. package/dist/vite/plugin-html-transform.js +0 -15
  409. package/dist/vite/plugin-html-transform.js.map +0 -1
  410. package/lib/AuthenticationPlugin-C9BHGXlE.js +0 -55
  411. package/lib/ClientOnly-CVN6leDu.js.map +0 -1
  412. package/lib/DeveloperHint-DHdLXGHA.js +0 -16
  413. package/lib/DeveloperHint-DHdLXGHA.js.map +0 -1
  414. package/lib/Markdown-BDcCAWwm.js +0 -18059
  415. package/lib/Markdown-BDcCAWwm.js.map +0 -1
  416. package/lib/MdxPage-DKMH_t0f.js +0 -174
  417. package/lib/MdxPage-DKMH_t0f.js.map +0 -1
  418. package/lib/OperationList-Tj7ubW_t.js +0 -604
  419. package/lib/OperationList-Tj7ubW_t.js.map +0 -1
  420. package/lib/Route-C3DGB6OS.js +0 -13
  421. package/lib/Route-C3DGB6OS.js.map +0 -1
  422. package/lib/Select-Bagt3Bme.js.map +0 -1
  423. package/lib/SlotletProvider-Da7eFgd2.js +0 -241
  424. package/lib/SlotletProvider-Da7eFgd2.js.map +0 -1
  425. package/lib/Spinner-C6zroowC.js.map +0 -1
  426. package/lib/StaggeredRender-DDHSzQKE.js +0 -17
  427. package/lib/StaggeredRender-DDHSzQKE.js.map +0 -1
  428. package/lib/ZudokuContext-BKXGJTmu.js.map +0 -1
  429. package/lib/assets/worker-Bf8vjASY.js.map +0 -1
  430. package/lib/hook-sn0zMTkE.js.map +0 -1
  431. package/lib/index-AjWCJNGC.js +0 -5690
  432. package/lib/index-AjWCJNGC.js.map +0 -1
  433. package/lib/index-CRo94sKK.js +0 -1783
  434. package/lib/index-CRo94sKK.js.map +0 -1
  435. package/lib/state-CsuHT8ZO.js +0 -183
  436. package/lib/urql-core-KJnLL26g.js +0 -1455
  437. package/lib/urql-core-KJnLL26g.js.map +0 -1
  438. package/lib/useExposedProps-ChOIUaS4.js +0 -9
  439. package/src/lib/components/DevPortal.tsx +0 -111
  440. package/src/lib/components/context/ThemeContext.tsx +0 -8
  441. package/src/lib/components/context/ThemeProvider.tsx +0 -27
  442. package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -51
  443. package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -75
  444. package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
  445. package/src/lib/themeToggle.ts +0 -7
  446. package/src/lib/util/createWaitForNotify.ts +0 -18
@@ -0,0 +1,1277 @@
1
+ var ke = Object.defineProperty;
2
+ var me = (t) => {
3
+ throw TypeError(t);
4
+ };
5
+ var Ie = (t, n, s) => n in t ? ke(t, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[n] = s;
6
+ var W = (t, n, s) => Ie(t, typeof n != "symbol" ? n + "" : n, s), pe = (t, n, s) => n.has(t) || me("Cannot " + s);
7
+ var x = (t, n, s) => (pe(t, n, "read from private field"), s ? s.call(t) : n.get(t)), R = (t, n, s) => n.has(t) ? me("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(t) : n.set(t, s), M = (t, n, s, r) => (pe(t, n, "write to private field"), r ? r.call(t, s) : n.set(t, s), s);
8
+ import { j as e } from "./jsx-runtime-B6kdoens.js";
9
+ import { i as qe, j as Re, k as Me } from "./utils-DcpDOncX.js";
10
+ import { XIcon as Ae, EraserIcon as Se, ChevronsUpDownIcon as Ve, LogInIcon as ze, CirclePlayIcon as Fe } from "lucide-react";
11
+ import { u as Le } from "./hook-hEqe7fPB.js";
12
+ import { Button as E } from "./ui/Button.js";
13
+ import { initializeWorker as De } from "zudoku/openapi-worker";
14
+ import { Z as Ge } from "./invariant-Caa8-XvF.js";
15
+ import { VisuallyHidden as Be } from "@radix-ui/react-visually-hidden";
16
+ import * as he from "react";
17
+ import { useRef as Ce, useEffect as $e, useState as Te, useTransition as Je, Fragment as Z } from "react";
18
+ import { D as He, b as Qe, a as Ue, c as We } from "./Dialog-k70Qfukb.js";
19
+ import { u as Ze, S as fe, a as xe, b as ye, c as ge, e as K } from "./Select-O9ZM3ZgX.js";
20
+ import { b as oe, C as $, u as Ke, a as Xe, F as Ye } from "./index.esm-C5mr_sKO.js";
21
+ import { a as et } from "./state-tsXBLONe.js";
22
+ import { S as ve } from "./Spinner-3cQDBVGr.js";
23
+ import { Callout as tt } from "./ui/Callout.js";
24
+ import { Card as ae, CardHeader as nt, CardTitle as st, CardContent as rt } from "./ui/Card.js";
25
+ import { Tabs as je, TabsList as be, TabsTrigger as A, TabsContent as V } from "./ui/Tabs.js";
26
+ import { z as at, S as ot } from "./SyntaxHighlight-DkLOsjHS.js";
27
+ import { c as P } from "./cn-BmFQLtkS.js";
28
+ import { Input as H } from "./ui/Input.js";
29
+ import { Slot as it } from "@radix-ui/react-slot";
30
+ import { m as lt } from "./router-lfyopgBI.js";
31
+ class L extends String {
32
+ constructor(s, r) {
33
+ super(s);
34
+ W(this, "__apiType");
35
+ this.value = s, this.__meta__ = r;
36
+ }
37
+ toString() {
38
+ return this.value;
39
+ }
40
+ }
41
+ const ct = new L(
42
+ `
43
+ fragment OperationsFragment on OperationItem {
44
+ slug
45
+ summary
46
+ method
47
+ description
48
+ operationId
49
+ contentTypes
50
+ path
51
+ parameters {
52
+ name
53
+ in
54
+ description
55
+ required
56
+ schema
57
+ style
58
+ examples {
59
+ name
60
+ description
61
+ externalValue
62
+ value
63
+ summary
64
+ }
65
+ }
66
+ requestBody {
67
+ content {
68
+ mediaType
69
+ encoding {
70
+ name
71
+ }
72
+ examples {
73
+ name
74
+ description
75
+ externalValue
76
+ value
77
+ summary
78
+ }
79
+ schema
80
+ }
81
+ description
82
+ required
83
+ }
84
+ responses {
85
+ statusCode
86
+ links
87
+ description
88
+ content {
89
+ examples {
90
+ name
91
+ description
92
+ externalValue
93
+ value
94
+ summary
95
+ }
96
+ mediaType
97
+ encoding {
98
+ name
99
+ }
100
+ schema
101
+ }
102
+ }
103
+ }
104
+ `,
105
+ { fragmentName: "OperationsFragment" }
106
+ ), dt = new L(`
107
+ query ServersQuery($input: JSON!, $type: SchemaType!) {
108
+ schema(input: $input, type: $type) {
109
+ url
110
+ servers {
111
+ url
112
+ }
113
+ }
114
+ }
115
+ `), ut = new L(`
116
+ query AllOperations($input: JSON!, $type: SchemaType!) {
117
+ schema(input: $input, type: $type) {
118
+ description
119
+ title
120
+ url
121
+ version
122
+ tags {
123
+ name
124
+ description
125
+ operations {
126
+ slug
127
+ ...OperationsFragment
128
+ }
129
+ }
130
+ }
131
+ }
132
+ fragment OperationsFragment on OperationItem {
133
+ slug
134
+ summary
135
+ method
136
+ description
137
+ operationId
138
+ contentTypes
139
+ path
140
+ parameters {
141
+ name
142
+ in
143
+ description
144
+ required
145
+ schema
146
+ style
147
+ examples {
148
+ name
149
+ description
150
+ externalValue
151
+ value
152
+ summary
153
+ }
154
+ }
155
+ requestBody {
156
+ content {
157
+ mediaType
158
+ encoding {
159
+ name
160
+ }
161
+ examples {
162
+ name
163
+ description
164
+ externalValue
165
+ value
166
+ summary
167
+ }
168
+ schema
169
+ }
170
+ description
171
+ required
172
+ }
173
+ responses {
174
+ statusCode
175
+ links
176
+ description
177
+ content {
178
+ examples {
179
+ name
180
+ description
181
+ externalValue
182
+ value
183
+ summary
184
+ }
185
+ mediaType
186
+ encoding {
187
+ name
188
+ }
189
+ schema
190
+ }
191
+ }
192
+ }`), mt = new L(`
193
+ query getServerQuery($input: JSON!, $type: SchemaType!) {
194
+ schema(input: $input, type: $type) {
195
+ url
196
+ servers {
197
+ url
198
+ }
199
+ }
200
+ }
201
+ `), pt = new L(`
202
+ query GetCategories($input: JSON!, $type: SchemaType!) {
203
+ schema(input: $input, type: $type) {
204
+ url
205
+ tags {
206
+ __typename
207
+ name
208
+ operations {
209
+ __typename
210
+ slug
211
+ deprecated
212
+ method
213
+ summary
214
+ operationId
215
+ path
216
+ }
217
+ }
218
+ }
219
+ }
220
+ `), ht = {
221
+ "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": dt,
222
+ "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n": ct,
223
+ "\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n": ut,
224
+ "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": mt,
225
+ "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n": pt
226
+ };
227
+ function ft(t) {
228
+ return ht[t] ?? {};
229
+ }
230
+ function X(t) {
231
+ if (!ie(t))
232
+ throw new Error("Parameter was not an error");
233
+ }
234
+ function ie(t) {
235
+ return !!t && typeof t == "object" && xt(t) === "[object Error]" || t instanceof Error;
236
+ }
237
+ function xt(t) {
238
+ return Object.prototype.toString.call(t);
239
+ }
240
+ const yt = "Layerr";
241
+ let gt = yt;
242
+ function vt() {
243
+ return gt;
244
+ }
245
+ function jt(t) {
246
+ let n, s = "";
247
+ if (t.length === 0)
248
+ n = {};
249
+ else if (ie(t[0]))
250
+ n = {
251
+ cause: t[0]
252
+ }, s = t.slice(1).join(" ") || "";
253
+ else if (t[0] && typeof t[0] == "object")
254
+ n = Object.assign({}, t[0]), s = t.slice(1).join(" ") || "";
255
+ else if (typeof t[0] == "string")
256
+ n = {}, s = s = t.join(" ") || "";
257
+ else
258
+ throw new Error("Invalid arguments passed to Layerr");
259
+ return {
260
+ options: n,
261
+ shortMessage: s
262
+ };
263
+ }
264
+ class y extends Error {
265
+ constructor(n, s) {
266
+ const r = [...arguments], { options: o, shortMessage: l } = jt(r);
267
+ let i = l;
268
+ if (o.cause && (i = `${i}: ${o.cause.message}`), super(i), this.message = i, o.name && typeof o.name == "string" ? this.name = o.name : this.name = vt(), o.cause && Object.defineProperty(this, "_cause", { value: o.cause }), Object.defineProperty(this, "_info", { value: {} }), o.info && typeof o.info == "object" && Object.assign(this._info, o.info), Error.captureStackTrace) {
269
+ const c = o.constructorOpt || this.constructor;
270
+ Error.captureStackTrace(this, c);
271
+ }
272
+ }
273
+ static cause(n) {
274
+ return X(n), n._cause && ie(n._cause) ? n._cause : null;
275
+ }
276
+ static fullStack(n) {
277
+ X(n);
278
+ const s = y.cause(n);
279
+ return s ? `${n.stack}
280
+ caused by: ${y.fullStack(s)}` : n.stack ?? "";
281
+ }
282
+ static info(n) {
283
+ X(n);
284
+ const s = {}, r = y.cause(n);
285
+ return r && Object.assign(s, y.info(r)), n._info && Object.assign(s, n._info), s;
286
+ }
287
+ toString() {
288
+ let n = this.name || this.constructor.name || this.constructor.prototype.name;
289
+ return this.message && (n = `${n}: ${this.message}`), n;
290
+ }
291
+ }
292
+ const Ee = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", F = 32, Ne = 281474976710655, bt = 10, Nt = 16, z = Object.freeze({
293
+ source: "ulid"
294
+ });
295
+ function wt(t) {
296
+ const n = St(), s = n && (n.crypto || n.msCrypto) || null;
297
+ if (typeof (s == null ? void 0 : s.getRandomValues) == "function")
298
+ return () => {
299
+ const r = new Uint8Array(1);
300
+ return s.getRandomValues(r), r[0] / 255;
301
+ };
302
+ if (typeof (s == null ? void 0 : s.randomBytes) == "function")
303
+ return () => s.randomBytes(1).readUInt8() / 255;
304
+ throw new y({
305
+ info: {
306
+ code: "PRNG_DETECT",
307
+ ...z
308
+ }
309
+ }, "Failed to find a reliable PRNG");
310
+ }
311
+ function St() {
312
+ return Tt() ? self : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : null;
313
+ }
314
+ function Ct(t, n) {
315
+ let s = "";
316
+ for (; t > 0; t--)
317
+ s = Et(n) + s;
318
+ return s;
319
+ }
320
+ function $t(t, n) {
321
+ if (isNaN(t))
322
+ throw new y({
323
+ info: {
324
+ code: "ENC_TIME_NAN",
325
+ ...z
326
+ }
327
+ }, `Time must be a number: ${t}`);
328
+ if (t > Ne)
329
+ throw new y({
330
+ info: {
331
+ code: "ENC_TIME_SIZE_EXCEED",
332
+ ...z
333
+ }
334
+ }, `Cannot encode a time larger than ${Ne}: ${t}`);
335
+ if (t < 0)
336
+ throw new y({
337
+ info: {
338
+ code: "ENC_TIME_NEG",
339
+ ...z
340
+ }
341
+ }, `Time must be positive: ${t}`);
342
+ if (Number.isInteger(t) === !1)
343
+ throw new y({
344
+ info: {
345
+ code: "ENC_TIME_TYPE",
346
+ ...z
347
+ }
348
+ }, `Time must be an integer: ${t}`);
349
+ let s, r = "";
350
+ for (let o = n; o > 0; o--)
351
+ s = t % F, r = Ee.charAt(s) + r, t = (t - s) / F;
352
+ return r;
353
+ }
354
+ function Tt() {
355
+ return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope;
356
+ }
357
+ function Et(t) {
358
+ let n = Math.floor(t() * F);
359
+ return n === F && (n = F - 1), Ee.charAt(n);
360
+ }
361
+ function Pt(t, n) {
362
+ const s = wt(), r = isNaN(t) ? Date.now() : t;
363
+ return $t(r, bt) + Ct(Nt, s);
364
+ }
365
+ let Y, ee;
366
+ const Ot = async (t) => {
367
+ t && typeof t == "object" && "type" in t && t.type === "file" && "input" in t && typeof t.input == "function" && (t.input = await t.input());
368
+ }, te = (t) => {
369
+ var n;
370
+ if ((n = t.errors) != null && n[0])
371
+ throw new Ge(t.errors[0].message, {
372
+ developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
373
+ });
374
+ };
375
+ var T, O, N, Q;
376
+ class _t {
377
+ constructor(n) {
378
+ R(this, T);
379
+ R(this, O, /* @__PURE__ */ new Map());
380
+ R(this, N);
381
+ R(this, Q, () => import("./createServer-CpJlUPtn.js").then((n) => n.createServer()));
382
+ W(this, "fetch", async (n, ...[s]) => {
383
+ var l;
384
+ const r = (l = n.match(/query (\w+)/)) == null ? void 0 : l[1];
385
+ await Ot(s);
386
+ const o = JSON.stringify({ query: n, variables: s, operationName: r });
387
+ switch (x(this, T)) {
388
+ case "remote": {
389
+ const i = await fetch(this.config.server, {
390
+ method: "POST",
391
+ body: o,
392
+ headers: { "Content-Type": "application/json" }
393
+ });
394
+ if (!i.ok)
395
+ throw new Error("Network response was not ok");
396
+ const c = await i.json();
397
+ return te(c), c.data;
398
+ }
399
+ case "in-memory": {
400
+ Y || (Y = x(this, Q).call(this));
401
+ const i = await Y;
402
+ if (!i) throw new Error("Local server not initialized");
403
+ const c = await i.fetch(
404
+ new Request("http://localhost/graphql", {
405
+ method: "POST",
406
+ body: o,
407
+ headers: { "Content-Type": "application/json" }
408
+ })
409
+ );
410
+ if (!c.ok)
411
+ throw new Error("Network response was not ok");
412
+ const u = await c.json();
413
+ return te(u), u.data;
414
+ }
415
+ case "worker": {
416
+ if (ee || (ee = De()), !x(this, N)) {
417
+ const d = new MessageChannel();
418
+ ee.port.postMessage({ port: d.port2 }, [d.port2]), M(this, N, d.port1), x(this, N).onmessage = (h) => {
419
+ const { id: g, body: j } = h.data, b = x(this, O).get(g);
420
+ if (b) {
421
+ const w = JSON.parse(j);
422
+ b(w), x(this, O).delete(g);
423
+ } else
424
+ console.error(`No pending request found for id: ${g}`);
425
+ }, x(this, N).start();
426
+ }
427
+ const i = Pt(), u = await new Promise(
428
+ (d) => {
429
+ x(this, O).set(i, d), x(this, N).postMessage({ id: i, body: o });
430
+ }
431
+ );
432
+ return te(u), u.data;
433
+ }
434
+ }
435
+ });
436
+ this.config = n, n.server ? M(this, T, "remote") : n.inMemory || typeof SharedWorker > "u" ? M(this, T, "in-memory") : M(this, T, "worker");
437
+ }
438
+ }
439
+ T = new WeakMap(), O = new WeakMap(), N = new WeakMap(), Q = new WeakMap();
440
+ const ne = (t) => Math.abs(
441
+ isNaN(parseInt(t)) ? t.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(t)) ? 0 : parseInt(t)
442
+ ), se = (t) => t.length > 1 ? parseInt(t.split("").reduce((n, s) => `${ne(n) + ne(s)}`)) : ne(t), kt = (t, n = {}) => {
443
+ const s = (3 * se(t) + 2 * se(t) + se(t)) % 360, { saturation: r = 75, lightness: o = 60 } = n;
444
+ return `${s}deg ${r}% ${o}%`;
445
+ }, re = "data-linked-param", It = (t) => {
446
+ const { resolvedTheme: n } = at();
447
+ return kt(
448
+ t,
449
+ n === "light" ? { saturation: 85, lightness: 50 } : void 0
450
+ );
451
+ }, Pe = ({
452
+ name: t,
453
+ className: n,
454
+ backgroundOpacity: s = "100%",
455
+ borderOpacity: r = "100%",
456
+ slug: o,
457
+ children: l,
458
+ onClick: i
459
+ }) => {
460
+ const c = Ce(null), u = t.replace(/[{}]/g, ""), d = o == null ? void 0 : o.replace(/[{}]/g, ""), h = It(u), g = `hsl(${h} / ${r})`, j = `hsl(${h} / ${s})`;
461
+ return $e(() => {
462
+ if (!d || !c.current) return;
463
+ const b = () => {
464
+ document.querySelectorAll(`[${re}="${d}"]`).forEach((S) => {
465
+ S instanceof HTMLElement && (S.dataset.active = "true");
466
+ });
467
+ }, w = () => {
468
+ document.querySelectorAll(`[${re}="${d}"]`).forEach((S) => {
469
+ S instanceof HTMLElement && (S.dataset.active = "false");
470
+ });
471
+ }, v = c.current;
472
+ return v.addEventListener("mouseenter", b), v.addEventListener("mouseleave", w), () => {
473
+ v.removeEventListener("mouseenter", b), v.removeEventListener("mouseleave", w);
474
+ };
475
+ }, [d]), /* @__PURE__ */ e.jsx(
476
+ "span",
477
+ {
478
+ [re]: d,
479
+ className: P(
480
+ "relative after:rounded after:absolute after:inset-0 after:-bottom-0.5 after:border-b-2 after:transition-opacity after:duration-200",
481
+ "after:pointer-events-none after:border-[--border-color] after:opacity-30 after:data-[active=true]:opacity-100",
482
+ n
483
+ ),
484
+ suppressHydrationWarning: !0,
485
+ ref: c,
486
+ onClick: i,
487
+ style: {
488
+ "--border-color": g,
489
+ "--background-color": j
490
+ },
491
+ children: l ?? t
492
+ }
493
+ );
494
+ }, qt = (t, n, s) => {
495
+ const r = n.replace(/(:\w+|\{\w+})/g, (l) => {
496
+ var u;
497
+ const i = l.replace(/[:{}]/g, "");
498
+ return ((u = s.pathParams.find((d) => d.name === i)) == null ? void 0 : u.value) ?? l;
499
+ }), o = new URL(
500
+ r.replace(/^\//, ""),
501
+ t.endsWith("/") ? t : `${t}/`
502
+ );
503
+ return s.queryParams.filter((l) => l.active).forEach((l) => {
504
+ o.searchParams.set(l.name, l.value);
505
+ }), o;
506
+ }, Rt = ({
507
+ control: t,
508
+ register: n
509
+ }) => {
510
+ const { fields: s, append: r, remove: o } = oe({
511
+ control: t,
512
+ name: "headers"
513
+ });
514
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
515
+ /* @__PURE__ */ e.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: s.map((l, i) => /* @__PURE__ */ e.jsxs(
516
+ "tr",
517
+ {
518
+ className: "group has-[:focus]:bg-muted/50 hover:bg-muted/50",
519
+ children: [
520
+ /* @__PURE__ */ e.jsx("td", { className: "flex gap-2 items-center", children: /* @__PURE__ */ e.jsx(
521
+ H,
522
+ {
523
+ ...n(`headers.${i}.name`),
524
+ placeholder: "Name",
525
+ className: "border-0 shadow-none text-xs font-mono",
526
+ autoComplete: "off"
527
+ }
528
+ ) }),
529
+ /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
530
+ /* @__PURE__ */ e.jsx(
531
+ H,
532
+ {
533
+ placeholder: "Value",
534
+ className: "border-0 shadow-none text-xs font-mono",
535
+ ...n(`headers.${i}.value`),
536
+ autoComplete: "off"
537
+ }
538
+ ),
539
+ /* @__PURE__ */ e.jsx(
540
+ E,
541
+ {
542
+ size: "icon",
543
+ variant: "ghost",
544
+ className: "text-muted-foreground opacity-0 group-hover:opacity-100",
545
+ onClick: () => {
546
+ o(i);
547
+ },
548
+ type: "button",
549
+ children: /* @__PURE__ */ e.jsx(Ae, { size: 16 })
550
+ }
551
+ )
552
+ ] }) })
553
+ ]
554
+ },
555
+ l.id
556
+ )) }) }),
557
+ /* @__PURE__ */ e.jsx("div", { className: "text-end", children: /* @__PURE__ */ e.jsx(
558
+ E,
559
+ {
560
+ className: "",
561
+ onClick: () => r({ name: "", value: "" }),
562
+ type: "button",
563
+ children: "Add header"
564
+ }
565
+ ) })
566
+ ] });
567
+ }, Mt = ({
568
+ control: t
569
+ }) => {
570
+ const { fields: n } = oe({
571
+ control: t,
572
+ name: "pathParams"
573
+ });
574
+ return /* @__PURE__ */ e.jsx("table", { className: "w-full table-auto [&_td]:border [&_td]:py-1 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: n.map((s, r) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
575
+ /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsx(
576
+ $,
577
+ {
578
+ control: t,
579
+ name: `pathParams.${r}.value`,
580
+ render: ({ field: o }) => /* @__PURE__ */ e.jsxs("div", { children: [
581
+ /* @__PURE__ */ e.jsx(
582
+ Pe,
583
+ {
584
+ slug: s.name,
585
+ name: s.name,
586
+ backgroundOpacity: "25%",
587
+ borderOpacity: o.value ? "100%" : "0",
588
+ className: P(
589
+ "font-mono text-xs m-2",
590
+ !o.value && "opacity-60"
591
+ )
592
+ }
593
+ ),
594
+ "*"
595
+ ] })
596
+ }
597
+ ) }),
598
+ /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
599
+ /* @__PURE__ */ e.jsx(
600
+ $,
601
+ {
602
+ control: t,
603
+ name: `pathParams.${r}.value`,
604
+ render: ({ field: o }) => /* @__PURE__ */ e.jsx(
605
+ H,
606
+ {
607
+ ...o,
608
+ placeholder: "Enter value",
609
+ className: "border-0 shadow-none ring-0 font-mono text-xs"
610
+ }
611
+ )
612
+ }
613
+ ),
614
+ /* @__PURE__ */ e.jsx(
615
+ $,
616
+ {
617
+ control: t,
618
+ name: `pathParams.${r}.value`,
619
+ render: ({ field: o }) => /* @__PURE__ */ e.jsx(
620
+ E,
621
+ {
622
+ size: "icon",
623
+ type: "button",
624
+ variant: "ghost",
625
+ "aria-label": "Clear value",
626
+ className: P(
627
+ "ms-2",
628
+ o.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
629
+ ),
630
+ title: "Clear value",
631
+ onClick: () => o.onChange(""),
632
+ children: /* @__PURE__ */ e.jsx(Se, { size: 16 })
633
+ }
634
+ )
635
+ }
636
+ )
637
+ ] }) })
638
+ ] }, s.id)) }) });
639
+ }, At = (t, n) => {
640
+ const s = he.forwardRef(({ className: r, asChild: o, ...l }, i) => {
641
+ const c = o ? it : t;
642
+ return he.createElement(c, {
643
+ ...l,
644
+ ref: i,
645
+ className: P(n, r)
646
+ });
647
+ });
648
+ return s.displayName = `VariantComponent(${t})`, s;
649
+ }, Vt = At(
650
+ "input",
651
+ "px-2 bg-transparent h-6 font-mono text-xs m-2"
652
+ ), zt = ({
653
+ control: t,
654
+ queryParams: n
655
+ }) => {
656
+ const { fields: s } = oe({
657
+ control: t,
658
+ name: "queryParams"
659
+ }), r = Ke(), o = n.map((c) => !!c.isRequired), i = r.watch("identity") !== J;
660
+ return /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: s.filter(
661
+ // TODO remove this hack for Accu or make it more generic
662
+ (c) => !(i && c.name === "apikey")
663
+ ).map((c, u) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
664
+ /* @__PURE__ */ e.jsx("td", { className: "text-center", children: /* @__PURE__ */ e.jsx(
665
+ $,
666
+ {
667
+ control: t,
668
+ name: `queryParams.${u}.active`,
669
+ render: ({ field: d }) => /* @__PURE__ */ e.jsx(
670
+ "input",
671
+ {
672
+ type: "checkbox",
673
+ id: `queryParams.${u}.active`,
674
+ checked: d.value,
675
+ onChange: d.onChange
676
+ }
677
+ )
678
+ }
679
+ ) }),
680
+ /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsx(
681
+ $,
682
+ {
683
+ control: t,
684
+ render: ({ field: d }) => /* @__PURE__ */ e.jsx(Vt, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
685
+ "label",
686
+ {
687
+ className: "flex items-center cursor-pointer",
688
+ htmlFor: `queryParams.${u}.active`,
689
+ title: o[u] ? "Required field" : void 0,
690
+ children: [
691
+ d.value,
692
+ o[u] && /* @__PURE__ */ e.jsx("sup", { children: " *" })
693
+ ]
694
+ }
695
+ ) }),
696
+ name: `queryParams.${u}.name`
697
+ }
698
+ ) }),
699
+ /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
700
+ /* @__PURE__ */ e.jsx(
701
+ $,
702
+ {
703
+ control: t,
704
+ render: ({ field: d }) => /* @__PURE__ */ e.jsx(
705
+ H,
706
+ {
707
+ ...d,
708
+ onChange: (h) => {
709
+ d.onChange(h.target.value), h.target.value.length > 0 && r.setValue(`queryParams.${u}.active`, !0);
710
+ },
711
+ placeholder: "Enter value",
712
+ className: "w-full border-0 shadow-none text-xs font-mono"
713
+ }
714
+ ),
715
+ name: `queryParams.${u}.value`
716
+ }
717
+ ),
718
+ /* @__PURE__ */ e.jsx(
719
+ $,
720
+ {
721
+ control: t,
722
+ render: ({ field: d }) => /* @__PURE__ */ e.jsx(
723
+ E,
724
+ {
725
+ size: "icon",
726
+ type: "button",
727
+ variant: "ghost",
728
+ "aria-label": "Clear value",
729
+ className: P(
730
+ "ms-2",
731
+ d.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
732
+ ),
733
+ title: "Clear value",
734
+ onClick: () => d.onChange(""),
735
+ children: /* @__PURE__ */ e.jsx(Se, { size: 16 })
736
+ }
737
+ ),
738
+ name: `queryParams.${u}.value`
739
+ }
740
+ )
741
+ ] }) })
742
+ ] }, c.id)) }) }) });
743
+ }, Ft = ({
744
+ value: t,
745
+ onChange: n,
746
+ className: s,
747
+ options: r,
748
+ showChevrons: o = !0
749
+ }) => /* @__PURE__ */ e.jsxs("div", { className: "grid", children: [
750
+ /* @__PURE__ */ e.jsx(
751
+ "select",
752
+ {
753
+ className: P(
754
+ "row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
755
+ "rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
756
+ s
757
+ ),
758
+ value: t,
759
+ onChange: n,
760
+ children: r.map((l) => /* @__PURE__ */ e.jsx("option", { value: l.value, children: l.label }, l.value))
761
+ }
762
+ ),
763
+ /* @__PURE__ */ e.jsx(
764
+ "div",
765
+ {
766
+ className: P(
767
+ !o && "hidden",
768
+ "row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none"
769
+ ),
770
+ children: /* @__PURE__ */ e.jsx(Ve, { size: 14 })
771
+ }
772
+ )
773
+ ] }), Lt = (t) => {
774
+ var s;
775
+ return (s = Object.entries({
776
+ "application/json": "json",
777
+ "text/json": "json",
778
+ "text/html": "html",
779
+ "text/css": "css",
780
+ "text/javascript": "javascript",
781
+ "application/xml": "xml",
782
+ "application/xhtml+xml": "xhtml"
783
+ }).find(
784
+ ([r]) => t.includes(r)
785
+ )) == null ? void 0 : s[1];
786
+ }, Dt = (t) => {
787
+ const n = t.get("Content-Type") || "";
788
+ return Lt(n);
789
+ }, Gt = (t) => {
790
+ try {
791
+ return JSON.stringify(JSON.parse(t), null, 2);
792
+ } catch {
793
+ return null;
794
+ }
795
+ }, Bt = ({
796
+ body: t = "",
797
+ headers: n
798
+ }) => {
799
+ const s = Dt(n), r = Gt(t), o = r || t, [l, i] = Te(
800
+ r ? "formatted" : "raw"
801
+ );
802
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
803
+ /* @__PURE__ */ e.jsx(ae, { className: "shadow-none", children: /* @__PURE__ */ e.jsx(
804
+ ot,
805
+ {
806
+ language: l === "raw" ? r ? "plain" : s : "json",
807
+ noBackground: !0,
808
+ className: "overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]",
809
+ code: l === "raw" ? t : o
810
+ }
811
+ ) }),
812
+ r && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
813
+ Ft,
814
+ {
815
+ value: l,
816
+ onChange: (c) => i(c.target.value),
817
+ options: [
818
+ { value: "formatted", label: "Formatted" },
819
+ { value: "raw", label: "Raw" }
820
+ ]
821
+ }
822
+ ) })
823
+ ] });
824
+ }, J = "__none", Jt = {
825
+ 200: "OK",
826
+ 201: "Created",
827
+ 202: "Accepted",
828
+ 204: "No Content",
829
+ 400: "Bad Request",
830
+ 401: "Unauthorized",
831
+ 403: "Forbidden",
832
+ 404: "Not Found",
833
+ 405: "Method Not Allowed",
834
+ 500: "Internal Server Error"
835
+ }, Ht = ({
836
+ server: t,
837
+ servers: n,
838
+ url: s,
839
+ method: r,
840
+ headers: o = [],
841
+ queryParams: l = [],
842
+ pathParams: i = [],
843
+ defaultBody: c = ""
844
+ }) => {
845
+ var de, ue;
846
+ const { selectedServer: u, setSelectedServer: d } = et(), [, h] = Je(), { register: g, control: j, handleSubmit: b, watch: w, setValue: v, ...S } = Xe({
847
+ defaultValues: {
848
+ body: c,
849
+ queryParams: l.map((a) => ({
850
+ name: a.name,
851
+ value: a.defaultValue ?? "",
852
+ active: a.defaultActive ?? !1
853
+ })),
854
+ pathParams: i.map((a) => ({
855
+ name: a.name,
856
+ value: a.defaultValue ?? ""
857
+ })),
858
+ headers: o.map((a) => ({
859
+ name: a.name,
860
+ value: a.defaultValue ?? ""
861
+ })),
862
+ identity: J
863
+ }
864
+ }), C = w(), _ = qe(), le = Ce(!1);
865
+ $e(() => {
866
+ var f;
867
+ if (le.current) return;
868
+ const a = (f = _.data) == null ? void 0 : f.at(0);
869
+ a && (v("identity", a.id), le.current = !0);
870
+ }, [v, _.data]);
871
+ const p = Ze({
872
+ mutationFn: async (a) => {
873
+ var I, q;
874
+ const f = qt(u ?? t, s, a), k = performance.now(), D = new Request(f, {
875
+ method: r.toUpperCase(),
876
+ headers: Object.fromEntries(
877
+ a.headers.filter((m) => m.name).map((m) => [m.name, m.value])
878
+ ),
879
+ body: a.body ? a.body : void 0
880
+ });
881
+ a.identity !== J && ((q = (I = _.data) == null ? void 0 : I.find((m) => m.id === a.identity)) == null || q.authorizeRequest(D));
882
+ try {
883
+ const m = await fetch(D, {
884
+ signal: AbortSignal.timeout(5e3)
885
+ }), G = performance.now() - k, B = await m.text();
886
+ return {
887
+ status: m.status,
888
+ headers: m.headers,
889
+ size: B.length,
890
+ body: B,
891
+ time: G
892
+ };
893
+ } catch (m) {
894
+ throw m instanceof TypeError ? new Error(
895
+ "The request failed, possibly due to network issues or CORS policy."
896
+ ) : m;
897
+ }
898
+ }
899
+ }), Oe = s.split("/").map((a, f, k) => {
900
+ var G;
901
+ const D = a.startsWith("{") && a.endsWith("}") || a.startsWith(":"), I = a.replace(/[:{}]/g, ""), q = (G = C.pathParams.find((B) => B.name === I)) == null ? void 0 : G.value, m = q ? /* @__PURE__ */ e.jsx(Pe, { backgroundOpacity: "25%", name: a, slug: a, children: encodeURIComponent(q) }) : /* @__PURE__ */ e.jsx(
902
+ "span",
903
+ {
904
+ className: "underline decoration-wavy decoration-red-500",
905
+ title: `Missing value for path parameter \`${I}\``,
906
+ children: a
907
+ }
908
+ );
909
+ return (
910
+ // eslint-disable-next-line react/no-array-index-key
911
+ /* @__PURE__ */ e.jsxs(Z, { children: [
912
+ D ? m : a,
913
+ f < k.length - 1 && "/",
914
+ /* @__PURE__ */ e.jsx("wbr", {})
915
+ ] }, a + f)
916
+ );
917
+ }), U = Array.from(((de = p.data) == null ? void 0 : de.headers.entries()) ?? []), ce = C.queryParams.filter((a) => a.active).map((a, f, k) => /* @__PURE__ */ e.jsxs(Z, { children: [
918
+ a.name,
919
+ "=",
920
+ encodeURIComponent(a.value).replaceAll("%20", "+"),
921
+ f < k.length - 1 && "&",
922
+ /* @__PURE__ */ e.jsx("wbr", {})
923
+ ] }, a.name)), _e = /* @__PURE__ */ e.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: n && n.length > 1 ? /* @__PURE__ */ e.jsxs(
924
+ fe,
925
+ {
926
+ onValueChange: (a) => {
927
+ h(() => {
928
+ d(a);
929
+ });
930
+ },
931
+ value: u,
932
+ children: [
933
+ /* @__PURE__ */ e.jsx(xe, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ e.jsx(ye, {}) }),
934
+ /* @__PURE__ */ e.jsx(ge, { children: n.map((a) => /* @__PURE__ */ e.jsx(K, { value: a, children: a.replace(/^https?:\/\//, "") }, a)) })
935
+ ]
936
+ }
937
+ ) : /* @__PURE__ */ e.jsx("span", { children: t.replace(/^https?:\/\//, "") }) });
938
+ return /* @__PURE__ */ e.jsx(
939
+ Ye,
940
+ {
941
+ register: g,
942
+ control: j,
943
+ handleSubmit: b,
944
+ watch: w,
945
+ setValue: v,
946
+ ...S,
947
+ children: /* @__PURE__ */ e.jsx("form", { onSubmit: b((a) => p.mutateAsync(a)), children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[8fr_7fr] text-sm h-full", children: [
948
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 p-8 bg-muted/50 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
949
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-stretch", children: [
950
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
951
+ /* @__PURE__ */ e.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono", children: r.toUpperCase() }),
952
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center flex-wrap p-2 font-mono text-xs", children: [
953
+ _e,
954
+ Oe,
955
+ ce.length > 0 ? "?" : "",
956
+ ce
957
+ ] })
958
+ ] }),
959
+ /* @__PURE__ */ e.jsx(E, { type: "submit", className: "h-auto flex gap-1", children: "Send" })
960
+ ] }),
961
+ /* @__PURE__ */ e.jsxs(
962
+ je,
963
+ {
964
+ defaultValue: l.length + i.length > 0 ? "parameters" : "headers",
965
+ children: [
966
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-1 justify-between", children: [
967
+ /* @__PURE__ */ e.jsxs(be, { children: [
968
+ l.length + i.length > 0 && /* @__PURE__ */ e.jsx(A, { value: "parameters", children: "Parameters" }),
969
+ /* @__PURE__ */ e.jsxs(A, { value: "headers", children: [
970
+ "Headers",
971
+ " ",
972
+ C.headers.length > 0 && `(${C.headers.length})`
973
+ ] }),
974
+ /* @__PURE__ */ e.jsx(
975
+ A,
976
+ {
977
+ value: "body",
978
+ disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
979
+ r.toUpperCase()
980
+ ),
981
+ children: "Body"
982
+ }
983
+ )
984
+ ] }),
985
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
986
+ "Auth:",
987
+ /* @__PURE__ */ e.jsxs(
988
+ fe,
989
+ {
990
+ onValueChange: (a) => v("identity", a),
991
+ value: C.identity,
992
+ defaultValue: C.identity,
993
+ children: [
994
+ /* @__PURE__ */ e.jsx(xe, { className: "w-[180px] flex", children: _.isPending ? /* @__PURE__ */ e.jsx(ve, {}) : /* @__PURE__ */ e.jsx(ye, {}) }),
995
+ /* @__PURE__ */ e.jsxs(ge, { align: "center", children: [
996
+ /* @__PURE__ */ e.jsx(K, { value: J, children: "None" }),
997
+ (ue = _.data) == null ? void 0 : ue.map((a) => /* @__PURE__ */ e.jsx(K, { value: a.id, children: a.label }, a.id))
998
+ ] })
999
+ ]
1000
+ }
1001
+ )
1002
+ ] })
1003
+ ] }),
1004
+ /* @__PURE__ */ e.jsx(V, { value: "headers", children: /* @__PURE__ */ e.jsx(Rt, { control: j, register: g }) }),
1005
+ /* @__PURE__ */ e.jsxs(V, { value: "parameters", children: [
1006
+ i.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1007
+ /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
1008
+ /* @__PURE__ */ e.jsx(Mt, { control: j })
1009
+ ] }),
1010
+ l.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1011
+ /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
1012
+ /* @__PURE__ */ e.jsx(zt, { control: j, queryParams: l })
1013
+ ] })
1014
+ ] }),
1015
+ /* @__PURE__ */ e.jsx(V, { value: "body", children: /* @__PURE__ */ e.jsx(
1016
+ "textarea",
1017
+ {
1018
+ ...g("body"),
1019
+ className: "border w-full rounded p-2 bg-muted h-40"
1020
+ }
1021
+ ) })
1022
+ ]
1023
+ }
1024
+ )
1025
+ ] }),
1026
+ /* @__PURE__ */ e.jsx("div", { className: "min-w-0 p-8 bg-muted/70", children: p.error ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1027
+ C.pathParams.some((a) => a.value === "") && /* @__PURE__ */ e.jsx(tt, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
1028
+ /* @__PURE__ */ e.jsxs(ae, { children: [
1029
+ /* @__PURE__ */ e.jsx(nt, { children: /* @__PURE__ */ e.jsx(st, { children: "Request failed" }) }),
1030
+ /* @__PURE__ */ e.jsxs(rt, { children: [
1031
+ "Error:",
1032
+ " ",
1033
+ p.error.message || String(p.error) || "Unexpected error"
1034
+ ] })
1035
+ ] })
1036
+ ] }) : p.data ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1037
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex text-xs gap-6", children: [
1038
+ /* @__PURE__ */ e.jsxs("div", { children: [
1039
+ "Status: ",
1040
+ p.data.status,
1041
+ " ",
1042
+ Jt[p.data.status] ?? ""
1043
+ ] }),
1044
+ /* @__PURE__ */ e.jsxs("div", { children: [
1045
+ "Time: ",
1046
+ p.data.time.toFixed(0),
1047
+ "ms"
1048
+ ] }),
1049
+ /* @__PURE__ */ e.jsxs("div", { children: [
1050
+ "Size: ",
1051
+ p.data.size,
1052
+ " B"
1053
+ ] })
1054
+ ] }) }),
1055
+ /* @__PURE__ */ e.jsxs(je, { defaultValue: "response", children: [
1056
+ /* @__PURE__ */ e.jsxs(be, { children: [
1057
+ /* @__PURE__ */ e.jsx(A, { value: "response", children: "Response" }),
1058
+ /* @__PURE__ */ e.jsx(A, { value: "headers", children: U.length ? `Headers (${U.length})` : "No headers" })
1059
+ ] }),
1060
+ /* @__PURE__ */ e.jsx(V, { value: "response", children: /* @__PURE__ */ e.jsx(
1061
+ Bt,
1062
+ {
1063
+ headers: p.data.headers,
1064
+ body: p.data.body
1065
+ }
1066
+ ) }),
1067
+ /* @__PURE__ */ e.jsx(V, { value: "headers", children: /* @__PURE__ */ e.jsxs(
1068
+ ae,
1069
+ {
1070
+ className: "max-h-[calc(83.333vh-140px)] overflow-y-auto grid grid-cols-2 w-full gap-2.5 font-mono text-xs shadow-none p-4",
1071
+ children: [
1072
+ /* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Key" }),
1073
+ /* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Value" }),
1074
+ U.map(([a, f]) => /* @__PURE__ */ e.jsxs(Z, { children: [
1075
+ /* @__PURE__ */ e.jsx("div", { children: a }),
1076
+ /* @__PURE__ */ e.jsx("div", { className: "break-words", children: f })
1077
+ ] }, a))
1078
+ ]
1079
+ }
1080
+ ) })
1081
+ ] })
1082
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ e.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: p.isPending ? /* @__PURE__ */ e.jsx(ve, {}) : "Send a request first to see the response here" }) }) })
1083
+ ] }) })
1084
+ }
1085
+ );
1086
+ }, Qt = ({
1087
+ className: t,
1088
+ size: n = 16
1089
+ }) => /* @__PURE__ */ e.jsx(
1090
+ "svg",
1091
+ {
1092
+ xmlns: "http://www.w3.org/2000/svg",
1093
+ viewBox: "0 0 24 24",
1094
+ fill: "currentColor",
1095
+ className: t,
1096
+ width: n,
1097
+ height: n,
1098
+ children: /* @__PURE__ */ e.jsx(
1099
+ "path",
1100
+ {
1101
+ fillRule: "evenodd",
1102
+ d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm14.024-.983a1.125 1.125 0 0 1 0 1.966l-5.603 3.113A1.125 1.125 0 0 1 9 15.113V8.887c0-.857.921-1.4 1.671-.983l5.603 3.113Z",
1103
+ clipRule: "evenodd"
1104
+ }
1105
+ )
1106
+ }
1107
+ ), Ut = (t) => {
1108
+ const [n, s] = Te(!1);
1109
+ return /* @__PURE__ */ e.jsxs(He, { onOpenChange: (r) => s(r), children: [
1110
+ /* @__PURE__ */ e.jsx(Qe, { asChild: !0, children: t.children ?? /* @__PURE__ */ e.jsxs("button", { className: "flex gap-1 items-center px-2 py-1 rounded-md bg-primary/80 hover:bg-primary transition text-primary-foreground text-xs", children: [
1111
+ "Test",
1112
+ /* @__PURE__ */ e.jsx(Qt, { className: "", size: 14 })
1113
+ ] }) }),
1114
+ /* @__PURE__ */ e.jsxs(
1115
+ Ue,
1116
+ {
1117
+ className: "max-w-screen-xl w-full h-5/6 overflow-auto p-0",
1118
+ "aria-describedby": void 0,
1119
+ children: [
1120
+ /* @__PURE__ */ e.jsx(Be, { children: /* @__PURE__ */ e.jsx(We, { children: "Playground" }) }),
1121
+ n && /* @__PURE__ */ e.jsx(Ht, { ...t })
1122
+ ]
1123
+ }
1124
+ )
1125
+ ] });
1126
+ }, we = ft(`
1127
+ query GetCategories($input: JSON!, $type: SchemaType!) {
1128
+ schema(input: $input, type: $type) {
1129
+ url
1130
+ tags {
1131
+ __typename
1132
+ name
1133
+ operations {
1134
+ __typename
1135
+ slug
1136
+ deprecated
1137
+ method
1138
+ summary
1139
+ operationId
1140
+ path
1141
+ }
1142
+ }
1143
+ }
1144
+ }
1145
+ `), Wt = {
1146
+ get: "green",
1147
+ post: "blue",
1148
+ put: "yellow",
1149
+ delete: "red",
1150
+ patch: "purple",
1151
+ options: "gray",
1152
+ head: "gray"
1153
+ }, jn = (t) => {
1154
+ const n = Re(t.navigationId ?? "/reference"), s = new _t(t);
1155
+ return {
1156
+ getHead: () => {
1157
+ if (t.type === "url" && !t.skipPreload)
1158
+ return /* @__PURE__ */ e.jsx(
1159
+ "link",
1160
+ {
1161
+ rel: "preload",
1162
+ href: t.input,
1163
+ as: "fetch",
1164
+ crossOrigin: "anonymous"
1165
+ }
1166
+ );
1167
+ if (t.server)
1168
+ return /* @__PURE__ */ e.jsx("link", { rel: "preconnect", href: t.server });
1169
+ },
1170
+ getMdxComponents: () => ({
1171
+ OpenPlaygroundButton: ({
1172
+ requireAuth: r,
1173
+ server: o,
1174
+ method: l,
1175
+ url: i,
1176
+ ...c
1177
+ }) => {
1178
+ var h;
1179
+ const u = Le(), d = Me({
1180
+ queryFn: () => s.fetch(we, {
1181
+ type: t.type,
1182
+ input: t.input
1183
+ }),
1184
+ enabled: !o,
1185
+ queryKey: ["playground-server"]
1186
+ });
1187
+ return r && !u.isAuthenticated ? /* @__PURE__ */ e.jsxs(
1188
+ E,
1189
+ {
1190
+ className: "gap-2 items-center",
1191
+ variant: "outline",
1192
+ onClick: u.login,
1193
+ children: [
1194
+ "Login to open in Playground ",
1195
+ /* @__PURE__ */ e.jsx(ze, { size: 16 })
1196
+ ]
1197
+ }
1198
+ ) : /* @__PURE__ */ e.jsx(
1199
+ Ut,
1200
+ {
1201
+ url: i ?? "/",
1202
+ method: l ?? "get",
1203
+ server: o ?? ((h = d.data) == null ? void 0 : h.schema.url) ?? "https://example.com",
1204
+ ...c,
1205
+ children: /* @__PURE__ */ e.jsxs(E, { className: "gap-2 items-center", variant: "outline", children: [
1206
+ "Open in Playground ",
1207
+ /* @__PURE__ */ e.jsx(Fe, { size: 16 })
1208
+ ] })
1209
+ }
1210
+ );
1211
+ }
1212
+ }),
1213
+ getSidebar: async (r) => {
1214
+ if (!lt({ path: n, end: !1 }, r))
1215
+ return [];
1216
+ try {
1217
+ const l = (await s.fetch(we, {
1218
+ type: t.type,
1219
+ input: t.input
1220
+ })).schema.tags.filter((i) => i.operations.length > 0).map((i) => ({
1221
+ type: "category",
1222
+ label: i.name || "Other endpoints",
1223
+ collapsible: !0,
1224
+ collapsed: !1,
1225
+ items: i.operations.map((c) => ({
1226
+ type: "link",
1227
+ label: c.summary ?? c.path,
1228
+ href: `#${c.slug}`,
1229
+ badge: {
1230
+ label: c.method,
1231
+ color: Wt[c.method.toLowerCase()]
1232
+ }
1233
+ }))
1234
+ }));
1235
+ return l.unshift({
1236
+ type: "link",
1237
+ label: "Overview",
1238
+ href: "#description"
1239
+ }), l;
1240
+ } catch {
1241
+ return [];
1242
+ }
1243
+ },
1244
+ getRoutes: () => [
1245
+ {
1246
+ async lazy() {
1247
+ const { OpenApiRoute: r } = await import("./Route-DlG_HTMu.js");
1248
+ return {
1249
+ element: /* @__PURE__ */ e.jsx(r, { client: s, config: t })
1250
+ };
1251
+ },
1252
+ children: [
1253
+ {
1254
+ path: n,
1255
+ children: [
1256
+ {
1257
+ index: !0,
1258
+ async lazy() {
1259
+ const { OperationList: r } = await import("./OperationList-BkNQEsNs.js");
1260
+ return { element: /* @__PURE__ */ e.jsx(r, {}) };
1261
+ }
1262
+ }
1263
+ ]
1264
+ }
1265
+ ]
1266
+ }
1267
+ ]
1268
+ };
1269
+ };
1270
+ export {
1271
+ Pe as C,
1272
+ Ut as P,
1273
+ Ft as S,
1274
+ ft as g,
1275
+ jn as o
1276
+ };
1277
+ //# sourceMappingURL=index-C7SaIME0.js.map