zudoku 0.0.0-fd8f8ad → 0.0.0-feda542

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 (1140) hide show
  1. package/README.md +1 -1
  2. package/cli.js +3 -0
  3. package/client.d.ts +7 -0
  4. package/dist/app/demo.js +1 -2
  5. package/dist/app/demo.js.map +1 -1
  6. package/dist/app/entry.client.d.ts +6 -0
  7. package/dist/app/entry.client.js +15 -15
  8. package/dist/app/entry.client.js.map +1 -1
  9. package/dist/app/entry.server.d.ts +9 -6
  10. package/dist/app/entry.server.js +14 -10
  11. package/dist/app/entry.server.js.map +1 -1
  12. package/dist/app/main.d.ts +2 -2
  13. package/dist/app/main.js +23 -10
  14. package/dist/app/main.js.map +1 -1
  15. package/dist/app/sentry.d.ts +3 -0
  16. package/dist/app/sentry.js +19 -0
  17. package/dist/app/sentry.js.map +1 -0
  18. package/dist/app/standalone.js +1 -2
  19. package/dist/app/standalone.js.map +1 -1
  20. package/dist/app/tailwind.d.ts +2 -1
  21. package/dist/app/tailwind.js +80 -48
  22. package/dist/app/tailwind.js.map +1 -1
  23. package/dist/cli/build/handler.d.ts +1 -3
  24. package/dist/cli/build/handler.js +9 -1
  25. package/dist/cli/build/handler.js.map +1 -1
  26. package/dist/cli/cli.js +5 -2
  27. package/dist/cli/cli.js.map +1 -1
  28. package/dist/cli/cmds/build.d.ts +11 -3
  29. package/dist/cli/cmds/build.js +21 -13
  30. package/dist/cli/cmds/build.js.map +1 -1
  31. package/dist/cli/cmds/dev.d.ts +1 -1
  32. package/dist/cli/cmds/dev.js +5 -0
  33. package/dist/cli/cmds/dev.js.map +1 -1
  34. package/dist/cli/cmds/preview.d.ts +16 -0
  35. package/dist/cli/cmds/preview.js +25 -0
  36. package/dist/cli/cmds/preview.js.map +1 -0
  37. package/dist/cli/common/logger.js +9 -0
  38. package/dist/cli/common/logger.js.map +1 -1
  39. package/dist/cli/common/outdated.js +2 -1
  40. package/dist/cli/common/outdated.js.map +1 -1
  41. package/dist/cli/common/output.js.map +1 -1
  42. package/dist/cli/common/utils/ports.d.ts +1 -1
  43. package/dist/cli/common/utils/ports.js +16 -15
  44. package/dist/cli/common/utils/ports.js.map +1 -1
  45. package/dist/cli/dev/handler.d.ts +1 -0
  46. package/dist/cli/dev/handler.js +15 -12
  47. package/dist/cli/dev/handler.js.map +1 -1
  48. package/dist/cli/preview/handler.d.ts +3 -0
  49. package/dist/cli/preview/handler.js +35 -0
  50. package/dist/cli/preview/handler.js.map +1 -0
  51. package/dist/config/common.d.ts +10 -0
  52. package/dist/config/common.js +2 -0
  53. package/dist/config/common.js.map +1 -0
  54. package/dist/config/config.d.ts +20 -16
  55. package/dist/config/loader.d.ts +21 -0
  56. package/dist/config/loader.js +149 -0
  57. package/dist/config/loader.js.map +1 -0
  58. package/dist/config/validators/BuildSchema.d.ts +59 -0
  59. package/dist/config/validators/BuildSchema.js +31 -0
  60. package/dist/config/validators/BuildSchema.js.map +1 -0
  61. package/dist/config/validators/InputSidebarSchema.d.ts +46 -30
  62. package/dist/config/validators/InputSidebarSchema.js +11 -1
  63. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  64. package/dist/config/validators/common.d.ts +7670 -0
  65. package/dist/config/validators/common.js +402 -0
  66. package/dist/config/validators/common.js.map +1 -0
  67. package/dist/config/validators/icon-types.d.ts +1 -0
  68. package/dist/config/validators/icon-types.js +2 -0
  69. package/dist/config/validators/icon-types.js.map +1 -0
  70. package/dist/config/validators/validate.d.ts +1885 -642
  71. package/dist/config/validators/validate.js +9 -228
  72. package/dist/config/validators/validate.js.map +1 -1
  73. package/dist/index.d.ts +2 -1
  74. package/dist/index.js +1 -0
  75. package/dist/index.js.map +1 -1
  76. package/dist/lib/MissingIcon.d.ts +2 -0
  77. package/dist/lib/MissingIcon.js +7 -0
  78. package/dist/lib/MissingIcon.js.map +1 -0
  79. package/dist/lib/authentication/AuthenticationPlugin.d.ts +4 -2
  80. package/dist/lib/authentication/AuthenticationPlugin.js +3 -0
  81. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -1
  82. package/dist/lib/authentication/authentication.d.ts +2 -1
  83. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  84. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  85. package/dist/lib/authentication/components/SignIn.js +1 -1
  86. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  87. package/dist/lib/authentication/components/SignOut.js +2 -2
  88. package/dist/lib/authentication/components/SignOut.js.map +1 -1
  89. package/dist/lib/authentication/hook.d.ts +6 -4
  90. package/dist/lib/authentication/hook.js +12 -4
  91. package/dist/lib/authentication/hook.js.map +1 -1
  92. package/dist/lib/authentication/providers/auth0.d.ts +2 -2
  93. package/dist/lib/authentication/providers/auth0.js +4 -3
  94. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  95. package/dist/lib/authentication/providers/clerk.d.ts +2 -2
  96. package/dist/lib/authentication/providers/clerk.js +54 -12
  97. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  98. package/dist/lib/authentication/providers/openid.d.ts +12 -4
  99. package/dist/lib/authentication/providers/openid.js +54 -44
  100. package/dist/lib/authentication/providers/openid.js.map +1 -1
  101. package/dist/lib/authentication/providers/supabase.d.ts +4 -0
  102. package/dist/lib/authentication/providers/supabase.js +117 -0
  103. package/dist/lib/authentication/providers/supabase.js.map +1 -0
  104. package/dist/lib/authentication/state.d.ts +23 -19
  105. package/dist/lib/authentication/state.js +35 -10
  106. package/dist/lib/authentication/state.js.map +1 -1
  107. package/dist/lib/components/AnchorLink.d.ts +2 -2
  108. package/dist/lib/components/AnchorLink.js +9 -5
  109. package/dist/lib/components/AnchorLink.js.map +1 -1
  110. package/dist/lib/components/Autocomplete.d.ts +13 -0
  111. package/dist/lib/components/Autocomplete.js +47 -0
  112. package/dist/lib/components/Autocomplete.js.map +1 -0
  113. package/dist/lib/components/Banner.js +1 -1
  114. package/dist/lib/components/Banner.js.map +1 -1
  115. package/dist/lib/components/Bootstrap.d.ts +3 -3
  116. package/dist/lib/components/Bootstrap.js +12 -13
  117. package/dist/lib/components/Bootstrap.js.map +1 -1
  118. package/dist/lib/components/Footer.d.ts +1 -0
  119. package/dist/lib/components/Footer.js +32 -0
  120. package/dist/lib/components/Footer.js.map +1 -0
  121. package/dist/lib/components/Header.js +18 -10
  122. package/dist/lib/components/Header.js.map +1 -1
  123. package/dist/lib/components/Heading.d.ts +4 -4
  124. package/dist/lib/components/Heading.js +1 -1
  125. package/dist/lib/components/Heading.js.map +1 -1
  126. package/dist/lib/components/InlineCode.d.ts +2 -1
  127. package/dist/lib/components/InlineCode.js +2 -9
  128. package/dist/lib/components/InlineCode.js.map +1 -1
  129. package/dist/lib/components/Layout.js +9 -20
  130. package/dist/lib/components/Layout.js.map +1 -1
  131. package/dist/lib/components/Main.d.ts +2 -0
  132. package/dist/lib/components/Main.js +17 -0
  133. package/dist/lib/components/Main.js.map +1 -0
  134. package/dist/lib/components/Markdown.d.ts +2 -2
  135. package/dist/lib/components/Markdown.js +4 -2
  136. package/dist/lib/components/Markdown.js.map +1 -1
  137. package/dist/lib/components/MobileTopNavigation.js +9 -8
  138. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  139. package/dist/lib/components/NotFoundPage.js +1 -1
  140. package/dist/lib/components/NotFoundPage.js.map +1 -1
  141. package/dist/lib/components/Pagination.d.ts +11 -0
  142. package/dist/lib/components/Pagination.js +10 -0
  143. package/dist/lib/components/Pagination.js.map +1 -0
  144. package/dist/lib/components/PathRenderer.d.ts +11 -0
  145. package/dist/lib/components/PathRenderer.js +28 -0
  146. package/dist/lib/components/PathRenderer.js.map +1 -0
  147. package/dist/lib/components/ReactMarkdown.d.ts +29 -0
  148. package/dist/lib/components/ReactMarkdown.js +182 -0
  149. package/dist/lib/components/ReactMarkdown.js.map +1 -0
  150. package/dist/lib/components/Search.d.ts +3 -1
  151. package/dist/lib/components/Search.js +9 -3
  152. package/dist/lib/components/Search.js.map +1 -1
  153. package/dist/lib/components/SlotletProvider.d.ts +2 -2
  154. package/dist/lib/components/StatusPage.d.ts +7 -0
  155. package/dist/lib/components/StatusPage.js +71 -0
  156. package/dist/lib/components/StatusPage.js.map +1 -0
  157. package/dist/lib/components/ThemeSwitch.js +10 -5
  158. package/dist/lib/components/ThemeSwitch.js.map +1 -1
  159. package/dist/lib/components/TopNavigation.d.ts +4 -1
  160. package/dist/lib/components/TopNavigation.js +37 -17
  161. package/dist/lib/components/TopNavigation.js.map +1 -1
  162. package/dist/lib/components/Zudoku.d.ts +1 -1
  163. package/dist/lib/components/Zudoku.js +15 -8
  164. package/dist/lib/components/Zudoku.js.map +1 -1
  165. package/dist/lib/components/cache.d.ts +13 -0
  166. package/dist/lib/components/cache.js +20 -0
  167. package/dist/lib/components/cache.js.map +1 -0
  168. package/dist/lib/components/context/BypassProtectedRoutesContext.d.ts +1 -0
  169. package/dist/lib/components/context/BypassProtectedRoutesContext.js +3 -0
  170. package/dist/lib/components/context/BypassProtectedRoutesContext.js.map +1 -0
  171. package/dist/lib/components/context/RouterEventsEmitter.d.ts +1 -0
  172. package/dist/lib/components/context/RouterEventsEmitter.js +17 -0
  173. package/dist/lib/components/context/RouterEventsEmitter.js.map +1 -0
  174. package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
  175. package/dist/lib/components/context/ViewportAnchorContext.js +21 -14
  176. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  177. package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
  178. package/dist/lib/components/context/ZudokuContext.js +22 -9
  179. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  180. package/dist/lib/components/index.d.ts +38 -8
  181. package/dist/lib/components/index.js +17 -4
  182. package/dist/lib/components/index.js.map +1 -1
  183. package/dist/lib/components/navigation/PoweredByZudoku.d.ts +3 -0
  184. package/dist/lib/components/navigation/PoweredByZudoku.js +6 -0
  185. package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -0
  186. package/dist/lib/components/navigation/Sidebar.d.ts +5 -1
  187. package/dist/lib/components/navigation/Sidebar.js +3 -7
  188. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  189. package/dist/lib/components/navigation/SidebarBadge.d.ts +6 -3
  190. package/dist/lib/components/navigation/SidebarBadge.js +13 -11
  191. package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
  192. package/dist/lib/components/navigation/SidebarCategory.d.ts +3 -3
  193. package/dist/lib/components/navigation/SidebarCategory.js +26 -21
  194. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  195. package/dist/lib/components/navigation/SidebarItem.d.ts +3 -4
  196. package/dist/lib/components/navigation/SidebarItem.js +19 -17
  197. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  198. package/dist/lib/components/navigation/SidebarWrapper.d.ts +7 -6
  199. package/dist/lib/components/navigation/SidebarWrapper.js +18 -3
  200. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  201. package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
  202. package/dist/lib/components/navigation/Toc.js.map +1 -0
  203. package/dist/lib/components/navigation/ZudokuLogo.d.ts +6 -0
  204. package/dist/lib/components/navigation/ZudokuLogo.js +5 -0
  205. package/dist/lib/components/navigation/ZudokuLogo.js.map +1 -0
  206. package/dist/lib/components/navigation/utils.js +1 -1
  207. package/dist/lib/components/navigation/utils.js.map +1 -1
  208. package/dist/lib/core/RouteGuard.d.ts +2 -0
  209. package/dist/lib/core/RouteGuard.js +52 -0
  210. package/dist/lib/core/RouteGuard.js.map +1 -0
  211. package/dist/lib/core/ZudokuContext.d.ts +36 -8
  212. package/dist/lib/core/ZudokuContext.js +37 -12
  213. package/dist/lib/core/ZudokuContext.js.map +1 -1
  214. package/dist/lib/core/plugins.d.ts +21 -7
  215. package/dist/lib/core/plugins.js +3 -0
  216. package/dist/lib/core/plugins.js.map +1 -1
  217. package/dist/lib/errors/ErrorAlert.js +6 -1
  218. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  219. package/dist/lib/errors/RouterError.js +1 -1
  220. package/dist/lib/errors/RouterError.js.map +1 -1
  221. package/dist/lib/hooks/index.d.ts +3 -0
  222. package/dist/lib/hooks/index.js +5 -0
  223. package/dist/lib/hooks/index.js.map +1 -0
  224. package/dist/lib/hooks/useEvent.d.ts +11 -0
  225. package/dist/lib/hooks/useEvent.js +19 -0
  226. package/dist/lib/hooks/useEvent.js.map +1 -0
  227. package/dist/lib/hooks/useEvent.test.js +100 -0
  228. package/dist/lib/hooks/useEvent.test.js.map +1 -0
  229. package/dist/lib/icons.d.ts +1 -0
  230. package/dist/lib/icons.js +1 -0
  231. package/dist/lib/icons.js.map +1 -1
  232. package/dist/lib/oas/graphql/circular.d.ts +3 -0
  233. package/dist/lib/oas/graphql/circular.js +38 -0
  234. package/dist/lib/oas/graphql/circular.js.map +1 -0
  235. package/dist/lib/oas/graphql/index.d.ts +25 -1
  236. package/dist/lib/oas/graphql/index.js +213 -66
  237. package/dist/lib/oas/graphql/index.js.map +1 -1
  238. package/dist/lib/oas/parser/dereference/index.js +8 -3
  239. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  240. package/dist/lib/oas/parser/index.d.ts +5 -3
  241. package/dist/lib/oas/parser/index.js +0 -22
  242. package/dist/lib/oas/parser/index.js.map +1 -1
  243. package/dist/lib/oas/parser/upgrade/index.d.ts +2 -2
  244. package/dist/lib/oas/parser/upgrade/index.js +21 -23
  245. package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
  246. package/dist/lib/plugins/api-catalog/Catalog.d.ts +4 -0
  247. package/dist/lib/plugins/api-catalog/Catalog.js +26 -0
  248. package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -0
  249. package/dist/lib/plugins/api-catalog/index.d.ts +31 -0
  250. package/dist/lib/plugins/api-catalog/index.js +46 -0
  251. package/dist/lib/plugins/api-catalog/index.js.map +1 -0
  252. package/dist/lib/plugins/api-keys/CreateApiKey.js +8 -4
  253. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  254. package/dist/lib/plugins/api-keys/ProtectedRoute.js +1 -1
  255. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
  256. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +1 -1
  257. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  258. package/dist/lib/plugins/api-keys/index.d.ts +1 -0
  259. package/dist/lib/plugins/api-keys/index.js +4 -0
  260. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  261. package/dist/lib/plugins/markdown/MdxPage.d.ts +10 -2
  262. package/dist/lib/plugins/markdown/MdxPage.js +17 -4
  263. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  264. package/dist/lib/plugins/markdown/index.d.ts +3 -1
  265. package/dist/lib/plugins/markdown/index.js +1 -1
  266. package/dist/lib/plugins/markdown/index.js.map +1 -1
  267. package/dist/lib/plugins/markdown/resolver.d.ts +0 -6
  268. package/dist/lib/plugins/markdown/resolver.js +0 -29
  269. package/dist/lib/plugins/markdown/resolver.js.map +1 -1
  270. package/dist/lib/plugins/openapi/CollapsibleCode.js +2 -1
  271. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
  272. package/dist/lib/plugins/openapi/ColorizedParam.d.ts +10 -2
  273. package/dist/lib/plugins/openapi/ColorizedParam.js +19 -8
  274. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  275. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
  276. package/dist/lib/plugins/openapi/Endpoint.js +8 -7
  277. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  278. package/dist/lib/plugins/openapi/OasProvider.d.ts +8 -0
  279. package/dist/lib/plugins/openapi/OasProvider.js +29 -0
  280. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -0
  281. package/dist/lib/plugins/openapi/OperationList.d.ts +5 -2
  282. package/dist/lib/plugins/openapi/OperationList.js +90 -11
  283. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  284. package/dist/lib/plugins/openapi/OperationListItem.d.ts +5 -3
  285. package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
  286. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  287. package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
  288. package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
  289. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
  290. package/dist/lib/plugins/openapi/ParameterList.d.ts +2 -1
  291. package/dist/lib/plugins/openapi/ParameterList.js +3 -2
  292. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  293. package/dist/lib/plugins/openapi/ParameterListItem.js +9 -3
  294. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  295. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +4 -2
  296. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +12 -3
  297. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  298. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +3 -4
  299. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +5 -13
  300. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  301. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +7 -13
  302. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  303. package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
  304. package/dist/lib/plugins/openapi/SchemaList.js +52 -0
  305. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
  306. package/dist/lib/plugins/openapi/Sidecar.js +54 -37
  307. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  308. package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
  309. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  310. package/dist/lib/plugins/openapi/SidecarExamples.d.ts +9 -0
  311. package/dist/lib/plugins/openapi/SidecarExamples.js +68 -0
  312. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -0
  313. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  314. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  315. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +2 -2
  316. package/dist/lib/plugins/openapi/client/GraphQLClient.js +23 -82
  317. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
  318. package/dist/lib/plugins/openapi/client/createServer.d.ts +2 -1
  319. package/dist/lib/plugins/openapi/client/createServer.js +5 -2
  320. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -1
  321. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
  322. package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
  323. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
  324. package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
  325. package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
  326. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
  327. package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
  328. package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
  329. package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
  330. package/dist/lib/plugins/openapi/context.d.ts +3 -3
  331. package/dist/lib/plugins/openapi/graphql/gql.d.ts +11 -3
  332. package/dist/lib/plugins/openapi/graphql/gql.js +5 -14
  333. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  334. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +113 -21
  335. package/dist/lib/plugins/openapi/graphql/graphql.js +55 -11
  336. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  337. package/dist/lib/plugins/openapi/index.d.ts +10 -6
  338. package/dist/lib/plugins/openapi/index.js +63 -82
  339. package/dist/lib/plugins/openapi/index.js.map +1 -1
  340. package/dist/lib/plugins/openapi/interfaces.d.ts +56 -3
  341. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
  342. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +8 -0
  343. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
  344. package/dist/lib/plugins/openapi/playground/Headers.d.ts +4 -4
  345. package/dist/lib/plugins/openapi/playground/Headers.js +84 -5
  346. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  347. package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
  348. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
  349. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
  350. package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
  351. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
  352. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
  353. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +9 -0
  354. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +5 -0
  355. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -0
  356. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +3 -2
  357. package/dist/lib/plugins/openapi/playground/PathParams.js +5 -7
  358. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  359. package/dist/lib/plugins/openapi/playground/Playground.d.ts +37 -2
  360. package/dist/lib/plugins/openapi/playground/Playground.js +131 -69
  361. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  362. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  363. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  364. package/dist/lib/plugins/openapi/playground/QueryParams.js +24 -18
  365. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  366. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
  367. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
  368. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
  369. package/dist/lib/plugins/openapi/playground/SubmitButton.d.ts +7 -0
  370. package/dist/lib/plugins/openapi/playground/SubmitButton.js +22 -0
  371. package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +1 -0
  372. package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
  373. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
  374. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
  375. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +7 -0
  376. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +11 -0
  377. package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +1 -0
  378. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +8 -0
  379. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +101 -0
  380. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -0
  381. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +9 -0
  382. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +17 -0
  383. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -0
  384. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.d.ts +10 -0
  385. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js +32 -0
  386. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js.map +1 -0
  387. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.d.ts +1 -0
  388. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js +56 -0
  389. package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js.map +1 -0
  390. package/dist/lib/plugins/openapi/processors/removeExtensions.d.ts +7 -0
  391. package/dist/lib/plugins/openapi/processors/removeExtensions.js +16 -0
  392. package/dist/lib/plugins/openapi/processors/removeExtensions.js.map +1 -0
  393. package/dist/lib/plugins/openapi/processors/removeExtensions.test.d.ts +1 -0
  394. package/dist/lib/plugins/openapi/processors/removeExtensions.test.js +174 -0
  395. package/dist/lib/plugins/openapi/processors/removeExtensions.test.js.map +1 -0
  396. package/dist/lib/plugins/openapi/processors/removeParameters.d.ts +10 -0
  397. package/dist/lib/plugins/openapi/processors/removeParameters.js +66 -0
  398. package/dist/lib/plugins/openapi/processors/removeParameters.js.map +1 -0
  399. package/dist/lib/plugins/openapi/processors/removeParameters.test.d.ts +1 -0
  400. package/dist/lib/plugins/openapi/processors/removeParameters.test.js +131 -0
  401. package/dist/lib/plugins/openapi/processors/removeParameters.test.js.map +1 -0
  402. package/dist/lib/plugins/openapi/processors/removePaths.d.ts +11 -0
  403. package/dist/lib/plugins/openapi/processors/removePaths.js +33 -0
  404. package/dist/lib/plugins/openapi/processors/removePaths.js.map +1 -0
  405. package/dist/lib/plugins/openapi/processors/removePaths.test.d.ts +1 -0
  406. package/dist/lib/plugins/openapi/processors/removePaths.test.js +104 -0
  407. package/dist/lib/plugins/openapi/processors/removePaths.test.js.map +1 -0
  408. package/dist/lib/plugins/openapi/processors/traverse.d.ts +1 -0
  409. package/dist/lib/plugins/openapi/processors/traverse.js +2 -0
  410. package/dist/lib/plugins/openapi/processors/traverse.js.map +1 -0
  411. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
  412. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
  413. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
  414. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.d.ts +2 -1
  415. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js +2 -2
  416. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js.map +1 -1
  417. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
  418. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
  419. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
  420. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
  421. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
  422. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
  423. package/dist/lib/plugins/openapi/schema/{SchemaComponents.d.ts → SchemaPropertyItem.d.ts} +2 -4
  424. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +42 -0
  425. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -0
  426. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
  427. package/dist/lib/plugins/openapi/schema/SchemaView.js +34 -49
  428. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  429. package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -0
  430. package/dist/lib/plugins/openapi/schema/utils.js +5 -1
  431. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  432. package/dist/lib/plugins/openapi/state.d.ts +25 -0
  433. package/dist/lib/plugins/openapi/state.js +18 -0
  434. package/dist/lib/plugins/openapi/state.js.map +1 -0
  435. package/dist/lib/plugins/openapi/util/createSidebarCategory.d.ts +9 -0
  436. package/dist/lib/plugins/openapi/util/createSidebarCategory.js +23 -0
  437. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -0
  438. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +19 -11
  439. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  440. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +10 -0
  441. package/dist/lib/plugins/openapi/util/getRoutes.js +80 -0
  442. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -0
  443. package/dist/lib/plugins/openapi/util/methodColorMap.d.ts +2 -0
  444. package/dist/lib/plugins/openapi/util/methodColorMap.js +10 -0
  445. package/dist/lib/plugins/openapi/util/methodColorMap.js.map +1 -0
  446. package/dist/lib/plugins/openapi/util/methodToColor.d.ts +20 -0
  447. package/dist/lib/plugins/openapi/util/methodToColor.js +24 -0
  448. package/dist/lib/plugins/openapi/util/methodToColor.js.map +1 -0
  449. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.d.ts +1 -0
  450. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js +27 -0
  451. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js.map +1 -0
  452. package/dist/lib/plugins/redirect/index.d.ts +1 -1
  453. package/dist/lib/plugins/redirect/index.js +1 -1
  454. package/dist/lib/plugins/redirect/index.js.map +1 -1
  455. package/dist/lib/plugins/search-inkeep/index.d.ts +22 -3
  456. package/dist/lib/plugins/search-inkeep/index.js +41 -5
  457. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  458. package/dist/lib/plugins/search-inkeep/inkeep.d.ts +3 -4
  459. package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
  460. package/dist/lib/plugins/search-pagefind/PagefindSearch.d.ts +6 -0
  461. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +80 -0
  462. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -0
  463. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +8 -0
  464. package/dist/lib/plugins/search-pagefind/ResultList.js +32 -0
  465. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -0
  466. package/dist/lib/plugins/search-pagefind/get-results.d.ts +10 -0
  467. package/dist/lib/plugins/search-pagefind/get-results.js +42 -0
  468. package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -0
  469. package/dist/lib/plugins/search-pagefind/index.d.ts +6 -0
  470. package/dist/lib/plugins/search-pagefind/index.js +9 -0
  471. package/dist/lib/plugins/search-pagefind/index.js.map +1 -0
  472. package/dist/lib/plugins/search-pagefind/types.d.ts +85 -0
  473. package/dist/lib/plugins/search-pagefind/types.js +2 -0
  474. package/dist/lib/plugins/search-pagefind/types.js.map +1 -0
  475. package/dist/lib/ui/Badge.d.ts +1 -1
  476. package/dist/lib/ui/Badge.js +2 -1
  477. package/dist/lib/ui/Badge.js.map +1 -1
  478. package/dist/lib/ui/Button.d.ts +2 -2
  479. package/dist/lib/ui/Button.js +2 -1
  480. package/dist/lib/ui/Button.js.map +1 -1
  481. package/dist/lib/ui/Callout.d.ts +2 -1
  482. package/dist/lib/ui/Callout.js +3 -2
  483. package/dist/lib/ui/Callout.js.map +1 -1
  484. package/dist/lib/ui/Card.js +1 -1
  485. package/dist/lib/ui/Card.js.map +1 -1
  486. package/dist/lib/ui/Checkbox.js +1 -1
  487. package/dist/lib/ui/Checkbox.js.map +1 -1
  488. package/dist/lib/ui/Command.d.ts +17 -3
  489. package/dist/lib/ui/Command.js +7 -3
  490. package/dist/lib/ui/Command.js.map +1 -1
  491. package/dist/lib/ui/Input.d.ts +1 -2
  492. package/dist/lib/ui/Input.js.map +1 -1
  493. package/dist/lib/ui/Select.js +3 -3
  494. package/dist/lib/ui/Select.js.map +1 -1
  495. package/dist/lib/ui/Stepper.d.ts +3 -0
  496. package/dist/lib/ui/Stepper.js +7 -0
  497. package/dist/lib/ui/Stepper.js.map +1 -0
  498. package/dist/lib/ui/SyntaxHighlight.d.ts +15 -0
  499. package/dist/lib/ui/SyntaxHighlight.js +62 -0
  500. package/dist/lib/ui/SyntaxHighlight.js.map +1 -0
  501. package/dist/lib/ui/util.d.ts +2 -0
  502. package/dist/lib/ui/util.js +3 -0
  503. package/dist/lib/ui/util.js.map +1 -0
  504. package/dist/lib/util/MdxComponents.d.ts +23 -20
  505. package/dist/lib/util/MdxComponents.js +10 -7
  506. package/dist/lib/util/MdxComponents.js.map +1 -1
  507. package/dist/lib/util/createVariantComponent.d.ts +2 -2
  508. package/dist/lib/util/detectOS.d.ts +1 -0
  509. package/dist/lib/util/detectOS.js +11 -0
  510. package/dist/lib/util/detectOS.js.map +1 -0
  511. package/dist/lib/util/joinPath.d.ts +3 -0
  512. package/dist/lib/util/joinPath.js +3 -0
  513. package/dist/lib/util/joinPath.js.map +1 -1
  514. package/dist/lib/util/joinUrl.d.ts +1 -0
  515. package/dist/lib/util/joinUrl.js +40 -0
  516. package/dist/lib/util/joinUrl.js.map +1 -0
  517. package/dist/lib/util/joinUrl.test.d.ts +1 -0
  518. package/dist/lib/util/joinUrl.test.js +43 -0
  519. package/dist/lib/util/joinUrl.test.js.map +1 -0
  520. package/dist/lib/util/scrollIntoViewIfNeeded.d.ts +1 -0
  521. package/dist/lib/util/scrollIntoViewIfNeeded.js +14 -0
  522. package/dist/lib/util/scrollIntoViewIfNeeded.js.map +1 -0
  523. package/dist/lib/util/traverse.d.ts +3 -0
  524. package/dist/lib/util/traverse.js +22 -0
  525. package/dist/lib/util/traverse.js.map +1 -0
  526. package/dist/lib/util/types.d.ts +7 -0
  527. package/dist/lib/util/types.js +2 -0
  528. package/dist/lib/util/types.js.map +1 -0
  529. package/dist/lib/util/useExposedProps.js +1 -1
  530. package/dist/lib/util/useExposedProps.js.map +1 -1
  531. package/dist/lib/util/useLatest.d.ts +1 -0
  532. package/dist/lib/util/useLatest.js +15 -0
  533. package/dist/lib/util/useLatest.js.map +1 -0
  534. package/dist/lib/util/useOnScreen.d.ts +3 -2
  535. package/dist/lib/util/useOnScreen.js +3 -3
  536. package/dist/lib/util/useOnScreen.js.map +1 -1
  537. package/dist/lib/util/useScrollToAnchor.d.ts +1 -0
  538. package/dist/lib/util/useScrollToAnchor.js +42 -37
  539. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  540. package/dist/lib/util/useScrollToTop.js +7 -5
  541. package/dist/lib/util/useScrollToTop.js.map +1 -1
  542. package/dist/vite/api/schema-codegen.d.ts +12 -0
  543. package/dist/vite/api/schema-codegen.js +85 -0
  544. package/dist/vite/api/schema-codegen.js.map +1 -0
  545. package/dist/vite/api/schema-codegen.test.d.ts +1 -0
  546. package/dist/vite/api/schema-codegen.test.js +313 -0
  547. package/dist/vite/api/schema-codegen.test.js.map +1 -0
  548. package/dist/vite/build.js +41 -16
  549. package/dist/vite/build.js.map +1 -1
  550. package/dist/vite/config.d.ts +7 -8
  551. package/dist/vite/config.js +109 -64
  552. package/dist/vite/config.js.map +1 -1
  553. package/dist/vite/config.test.js +11 -5
  554. package/dist/vite/config.test.js.map +1 -1
  555. package/dist/vite/create-pagefind-index.d.ts +4 -0
  556. package/dist/vite/create-pagefind-index.js +12 -0
  557. package/dist/vite/create-pagefind-index.js.map +1 -0
  558. package/dist/vite/css/collect.d.ts +2 -0
  559. package/dist/vite/css/collect.js +27 -0
  560. package/dist/vite/css/collect.js.map +1 -0
  561. package/dist/vite/css/plugin.d.ts +5 -0
  562. package/dist/vite/css/plugin.js +79 -0
  563. package/dist/vite/css/plugin.js.map +1 -0
  564. package/dist/vite/dev-server.d.ts +5 -2
  565. package/dist/vite/dev-server.js +65 -15
  566. package/dist/vite/dev-server.js.map +1 -1
  567. package/dist/vite/error-handler.d.ts +1 -1
  568. package/dist/vite/error-handler.js +1 -1
  569. package/dist/vite/error-handler.js.map +1 -1
  570. package/dist/vite/output.d.ts +15 -3
  571. package/dist/vite/output.js +41 -14
  572. package/dist/vite/output.js.map +1 -1
  573. package/dist/vite/plugin-api-keys.d.ts +2 -2
  574. package/dist/vite/plugin-api-keys.js +5 -5
  575. package/dist/vite/plugin-api-keys.js.map +1 -1
  576. package/dist/vite/plugin-api.d.ts +2 -2
  577. package/dist/vite/plugin-api.js +223 -32
  578. package/dist/vite/plugin-api.js.map +1 -1
  579. package/dist/vite/plugin-auth.d.ts +2 -2
  580. package/dist/vite/plugin-auth.js +7 -4
  581. package/dist/vite/plugin-auth.js.map +1 -1
  582. package/dist/vite/plugin-component.d.ts +2 -2
  583. package/dist/vite/plugin-component.js +20 -20
  584. package/dist/vite/plugin-component.js.map +1 -1
  585. package/dist/vite/plugin-config-reload.d.ts +4 -4
  586. package/dist/vite/plugin-config-reload.js +13 -6
  587. package/dist/vite/plugin-config-reload.js.map +1 -1
  588. package/dist/vite/plugin-config.d.ts +2 -2
  589. package/dist/vite/plugin-config.js +25 -1
  590. package/dist/vite/plugin-config.js.map +1 -1
  591. package/dist/vite/plugin-custom-pages.d.ts +2 -2
  592. package/dist/vite/plugin-custom-pages.js +3 -3
  593. package/dist/vite/plugin-custom-pages.js.map +1 -1
  594. package/dist/vite/plugin-docs.d.ts +3 -3
  595. package/dist/vite/plugin-docs.js +23 -6
  596. package/dist/vite/plugin-docs.js.map +1 -1
  597. package/dist/vite/plugin-docs.test.js +15 -23
  598. package/dist/vite/plugin-docs.test.js.map +1 -1
  599. package/dist/vite/plugin-frontmatter.d.ts +2 -2
  600. package/dist/vite/plugin-frontmatter.js +5 -4
  601. package/dist/vite/plugin-frontmatter.js.map +1 -1
  602. package/dist/vite/plugin-mdx.d.ts +2 -2
  603. package/dist/vite/plugin-mdx.js +86 -14
  604. package/dist/vite/plugin-mdx.js.map +1 -1
  605. package/dist/vite/plugin-redirect.d.ts +2 -2
  606. package/dist/vite/plugin-redirect.js +3 -3
  607. package/dist/vite/plugin-redirect.js.map +1 -1
  608. package/dist/vite/plugin-search.d.ts +2 -2
  609. package/dist/vite/plugin-search.js +5 -1
  610. package/dist/vite/plugin-search.js.map +1 -1
  611. package/dist/vite/plugin-sidebar.d.ts +2 -2
  612. package/dist/vite/plugin-sidebar.js +13 -4
  613. package/dist/vite/plugin-sidebar.js.map +1 -1
  614. package/dist/vite/{plugin-custom-css.d.ts → plugin-theme-css.d.ts} +3 -3
  615. package/dist/vite/plugin-theme-css.js +117 -0
  616. package/dist/vite/plugin-theme-css.js.map +1 -0
  617. package/dist/vite/plugin.d.ts +2 -3
  618. package/dist/vite/plugin.js +6 -2
  619. package/dist/vite/plugin.js.map +1 -1
  620. package/dist/vite/prerender/FileWritingResponse.d.ts +25 -0
  621. package/dist/vite/prerender/FileWritingResponse.js +51 -0
  622. package/dist/vite/prerender/FileWritingResponse.js.map +1 -0
  623. package/dist/vite/prerender/InMemoryResponse.d.ts +16 -0
  624. package/dist/vite/prerender/InMemoryResponse.js +32 -0
  625. package/dist/vite/prerender/InMemoryResponse.js.map +1 -0
  626. package/dist/vite/prerender/PrerenderResponse.d.ts +10 -0
  627. package/dist/vite/prerender/PrerenderResponse.js +2 -0
  628. package/dist/vite/prerender/PrerenderResponse.js.map +1 -0
  629. package/dist/vite/prerender/prerender.d.ts +15 -0
  630. package/dist/vite/prerender/prerender.js +109 -0
  631. package/dist/vite/prerender/prerender.js.map +1 -0
  632. package/dist/vite/prerender/worker.d.ts +13 -0
  633. package/dist/vite/prerender/worker.js +59 -0
  634. package/dist/vite/prerender/worker.js.map +1 -0
  635. package/dist/vite/remarkStaticGeneration.js +5 -5
  636. package/dist/vite/remarkStaticGeneration.js.map +1 -1
  637. package/dist/vite/reporter.d.ts +3 -0
  638. package/dist/vite/reporter.js +33 -0
  639. package/dist/vite/reporter.js.map +1 -0
  640. package/dist/vite/sitemap.d.ts +1 -1
  641. package/dist/vite/sitemap.js +2 -1
  642. package/dist/vite/sitemap.js.map +1 -1
  643. package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
  644. package/dist/zuplo/enrich-with-zuplo.js +184 -0
  645. package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
  646. package/dist/zuplo/env.d.ts +7 -0
  647. package/dist/zuplo/env.js +12 -0
  648. package/dist/zuplo/env.js.map +1 -0
  649. package/dist/zuplo/policy-types.d.ts +33 -0
  650. package/dist/zuplo/policy-types.js +8 -0
  651. package/dist/zuplo/policy-types.js.map +1 -0
  652. package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
  653. package/dist/zuplo/with-zuplo-processors.js +26 -0
  654. package/dist/zuplo/with-zuplo-processors.js.map +1 -0
  655. package/dist/zuplo/with-zuplo.d.ts +3 -0
  656. package/dist/zuplo/with-zuplo.js +13 -0
  657. package/dist/zuplo/with-zuplo.js.map +1 -0
  658. package/lib/AuthenticationPlugin-foqdvvkf.js +58 -0
  659. package/lib/AuthenticationPlugin-foqdvvkf.js.map +1 -0
  660. package/lib/Button-Fp19CMUr.js +49 -0
  661. package/lib/Button-Fp19CMUr.js.map +1 -0
  662. package/lib/Callout-Boqdgl-z.js +230 -0
  663. package/lib/Callout-Boqdgl-z.js.map +1 -0
  664. package/lib/{CategoryHeading-Bb9dqxD3.js → CategoryHeading-DpB47wvk.js} +3 -3
  665. package/lib/{CategoryHeading-Bb9dqxD3.js.map → CategoryHeading-DpB47wvk.js.map} +1 -1
  666. package/lib/ClientOnly-E7hGysn1.js.map +1 -1
  667. package/lib/Dialog-sbgekbjb.js +98 -0
  668. package/lib/{Dialog-k70Qfukb.js.map → Dialog-sbgekbjb.js.map} +1 -1
  669. package/lib/Drawer-kDAfOq_2.js +1133 -0
  670. package/lib/Drawer-kDAfOq_2.js.map +1 -0
  671. package/lib/{Markdown-BorQdbxW.js → Markdown-CKXePgqR.js} +15142 -13372
  672. package/lib/Markdown-CKXePgqR.js.map +1 -0
  673. package/lib/MdxPage-DzpRK-fu.js +85 -0
  674. package/lib/MdxPage-DzpRK-fu.js.map +1 -0
  675. package/lib/OasProvider-Dw2mP5VZ.js +34 -0
  676. package/lib/OasProvider-Dw2mP5VZ.js.map +1 -0
  677. package/lib/OperationList-Cr_NA4e2.js +5069 -0
  678. package/lib/OperationList-Cr_NA4e2.js.map +1 -0
  679. package/lib/Pagination-DT6eKg_U.js +48 -0
  680. package/lib/Pagination-DT6eKg_U.js.map +1 -0
  681. package/lib/RouteGuard-CqZPoZYJ.js +744 -0
  682. package/lib/RouteGuard-CqZPoZYJ.js.map +1 -0
  683. package/lib/SchemaList-DNvUJgwI.js +148 -0
  684. package/lib/SchemaList-DNvUJgwI.js.map +1 -0
  685. package/lib/SchemaView-Cxh_msLc.js +357 -0
  686. package/lib/SchemaView-Cxh_msLc.js.map +1 -0
  687. package/lib/{Select-DP74t8Yy.js → Select-DVFRKf1R.js} +53 -53
  688. package/lib/{Select-DP74t8Yy.js.map → Select-DVFRKf1R.js.map} +1 -1
  689. package/lib/SlotletProvider-BV1xrg-l.js +338 -0
  690. package/lib/SlotletProvider-BV1xrg-l.js.map +1 -0
  691. package/lib/{Spinner-3cQDBVGr.js → Spinner-CE68iCm0.js} +2 -2
  692. package/lib/{Spinner-3cQDBVGr.js.map → Spinner-CE68iCm0.js.map} +1 -1
  693. package/lib/{SyntaxHighlight-CBmwwKoM.js → SyntaxHighlight-BEoSoPEo.js} +552 -645
  694. package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
  695. package/lib/Toc-D40bDl5J.js +92 -0
  696. package/lib/Toc-D40bDl5J.js.map +1 -0
  697. package/lib/chunk-HA7DTUK3-C4gP41vD.js +1821 -0
  698. package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
  699. package/lib/circular-ByJI6Mci.js +15877 -0
  700. package/lib/circular-ByJI6Mci.js.map +1 -0
  701. package/lib/{cn-BmFQLtkS.js → cn-qaFjX9_3.js} +2 -2
  702. package/lib/cn-qaFjX9_3.js.map +1 -0
  703. package/lib/{context-D1nXWxm7.js → context-DLCwaMXN.js} +2 -2
  704. package/lib/context-DLCwaMXN.js.map +1 -0
  705. package/lib/createServer-Cq73y9Kv.js +12454 -0
  706. package/lib/createServer-Cq73y9Kv.js.map +1 -0
  707. package/lib/hook-CqpVYDqN.js +1483 -0
  708. package/lib/hook-CqpVYDqN.js.map +1 -0
  709. package/lib/index-CN3TIw7H.js +2009 -0
  710. package/lib/index-CN3TIw7H.js.map +1 -0
  711. package/lib/index-CPNSgwSb.js +36 -0
  712. package/lib/index-CPNSgwSb.js.map +1 -0
  713. package/lib/{index-CkwDvuPt.js → index-Dl3Yl0yb.js} +303 -286
  714. package/lib/index-Dl3Yl0yb.js.map +1 -0
  715. package/lib/index-DwT-v3zK.js +86 -0
  716. package/lib/index-DwT-v3zK.js.map +1 -0
  717. package/lib/index-LNp6rxyU.js.map +1 -1
  718. package/lib/index-dQecW8K5.js +2227 -0
  719. package/lib/index-dQecW8K5.js.map +1 -0
  720. package/lib/index-gQD2h1wX.js +447 -0
  721. package/lib/index-gQD2h1wX.js.map +1 -0
  722. package/lib/index.esm--gIChbWs.js +1207 -0
  723. package/lib/index.esm--gIChbWs.js.map +1 -0
  724. package/lib/invariant-Caa8-XvF.js.map +1 -1
  725. package/lib/jsx-runtime-CYK1ROHF.js +446 -0
  726. package/lib/jsx-runtime-CYK1ROHF.js.map +1 -0
  727. package/lib/{hook-Diu0rqp-.js → mutation-8LjrN7uz.js} +40 -61
  728. package/lib/mutation-8LjrN7uz.js.map +1 -0
  729. package/lib/objectEntries-yMIkr2mI.js +5 -0
  730. package/lib/objectEntries-yMIkr2mI.js.map +1 -0
  731. package/lib/{prism-bash.min-DadFsM4Z.js → prism-bash.min-HHIMdNJ_.js} +4 -4
  732. package/lib/{prism-bash.min-DadFsM4Z.js.map → prism-bash.min-HHIMdNJ_.js.map} +1 -1
  733. package/lib/prism-csharp.min-bQAo2pmx.js +63 -0
  734. package/lib/{prism-csharp.min-Yizuc34Y.js.map → prism-csharp.min-bQAo2pmx.js.map} +1 -1
  735. package/lib/prism-java.min-BpvsOuIa.js +35 -0
  736. package/lib/{prism-java.min-d5iT_mOd.js.map → prism-java.min-BpvsOuIa.js.map} +1 -1
  737. package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
  738. package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
  739. package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
  740. package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
  741. package/lib/{prism-markdown.min-F3U-vPBi.js → prism-markdown.min-C0Qn0m-5.js} +30 -30
  742. package/lib/{prism-markdown.min-F3U-vPBi.js.map → prism-markdown.min-C0Qn0m-5.js.map} +1 -1
  743. package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
  744. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
  745. package/lib/prism-ruby.min-Dx9KO9ds.js +38 -0
  746. package/lib/{prism-ruby.min-C7LwcKyz.js.map → prism-ruby.min-Dx9KO9ds.js.map} +1 -1
  747. package/lib/prism-typescript.min-CD7H2IYQ.js +34 -0
  748. package/lib/{prism-typescript.min-oSVeWCAd.js.map → prism-typescript.min-CD7H2IYQ.js.map} +1 -1
  749. package/lib/processors/removeExtensions.js +11 -0
  750. package/lib/processors/removeExtensions.js.map +1 -0
  751. package/lib/processors/removeParameters.js +48 -0
  752. package/lib/processors/removeParameters.js.map +1 -0
  753. package/lib/processors/removePaths.js +28 -0
  754. package/lib/processors/removePaths.js.map +1 -0
  755. package/lib/processors/traverse.js +15 -0
  756. package/lib/processors/traverse.js.map +1 -0
  757. package/lib/ui/Accordion.js +2 -2
  758. package/lib/ui/Accordion.js.map +1 -1
  759. package/lib/ui/ActionButton.js +4 -4
  760. package/lib/ui/ActionButton.js.map +1 -1
  761. package/lib/ui/Alert.js +3 -3
  762. package/lib/ui/Alert.js.map +1 -1
  763. package/lib/ui/AlertDialog.js +2 -2
  764. package/lib/ui/AlertDialog.js.map +1 -1
  765. package/lib/ui/Badge.js +5 -4
  766. package/lib/ui/Badge.js.map +1 -1
  767. package/lib/ui/Breadcrumb.js +5 -5
  768. package/lib/ui/Breadcrumb.js.map +1 -1
  769. package/lib/ui/Button.js +14 -13
  770. package/lib/ui/Button.js.map +1 -1
  771. package/lib/ui/Callout.js +40 -21
  772. package/lib/ui/Callout.js.map +1 -1
  773. package/lib/ui/Card.js +9 -9
  774. package/lib/ui/Card.js.map +1 -1
  775. package/lib/ui/Carousel.js +408 -402
  776. package/lib/ui/Carousel.js.map +1 -1
  777. package/lib/ui/Checkbox.js +14 -13
  778. package/lib/ui/Checkbox.js.map +1 -1
  779. package/lib/ui/Command.js +114 -508
  780. package/lib/ui/Command.js.map +1 -1
  781. package/lib/ui/Dialog.js +2 -2
  782. package/lib/ui/Dialog.js.map +1 -1
  783. package/lib/ui/Drawer.js +14 -1150
  784. package/lib/ui/Drawer.js.map +1 -1
  785. package/lib/ui/DropdownMenu.js +2 -2
  786. package/lib/ui/DropdownMenu.js.map +1 -1
  787. package/lib/ui/Form.js +6 -6
  788. package/lib/ui/Form.js.map +1 -1
  789. package/lib/ui/HoverCard.js +2 -2
  790. package/lib/ui/Input.js +2 -2
  791. package/lib/ui/Input.js.map +1 -1
  792. package/lib/ui/Label.js +3 -3
  793. package/lib/ui/Pagination.js +5 -5
  794. package/lib/ui/Pagination.js.map +1 -1
  795. package/lib/ui/Popover.js +2 -2
  796. package/lib/ui/Popover.js.map +1 -1
  797. package/lib/ui/Progress.js +2 -2
  798. package/lib/ui/Progress.js.map +1 -1
  799. package/lib/ui/RadioGroup.js +2 -2
  800. package/lib/ui/RadioGroup.js.map +1 -1
  801. package/lib/ui/ScrollArea.js +2 -2
  802. package/lib/ui/ScrollArea.js.map +1 -1
  803. package/lib/ui/Select.js +5 -5
  804. package/lib/ui/Select.js.map +1 -1
  805. package/lib/ui/Skeleton.js +2 -2
  806. package/lib/ui/Skeleton.js.map +1 -1
  807. package/lib/ui/Slider.js +2 -2
  808. package/lib/ui/Stepper.js +6 -0
  809. package/lib/ui/Stepper.js.map +1 -0
  810. package/lib/ui/Switch.js +2 -2
  811. package/lib/ui/Switch.js.map +1 -1
  812. package/lib/ui/SyntaxHighlight.js +11 -0
  813. package/lib/ui/SyntaxHighlight.js.map +1 -0
  814. package/lib/ui/Tabs.js +2 -2
  815. package/lib/ui/Textarea.js +2 -2
  816. package/lib/ui/Textarea.js.map +1 -1
  817. package/lib/ui/Toggle.js +3 -3
  818. package/lib/ui/Toggle.js.map +1 -1
  819. package/lib/ui/ToggleGroup.js +2 -2
  820. package/lib/ui/ToggleGroup.js.map +1 -1
  821. package/lib/ui/Tooltip.js +2 -2
  822. package/lib/ui/util.js +6 -0
  823. package/lib/ui/util.js.map +1 -0
  824. package/lib/useExposedProps-B9qXJedG.js +9 -0
  825. package/lib/useExposedProps-B9qXJedG.js.map +1 -0
  826. package/lib/useLatest-hmRS46UF.js +11 -0
  827. package/lib/useLatest-hmRS46UF.js.map +1 -0
  828. package/lib/zudoku.auth-auth0.js +25 -25
  829. package/lib/zudoku.auth-auth0.js.map +1 -1
  830. package/lib/zudoku.auth-clerk.js +101 -55
  831. package/lib/zudoku.auth-clerk.js.map +1 -1
  832. package/lib/zudoku.auth-openid.js +448 -484
  833. package/lib/zudoku.auth-openid.js.map +1 -1
  834. package/lib/zudoku.components.js +32 -1584
  835. package/lib/zudoku.components.js.map +1 -1
  836. package/lib/zudoku.hooks.js +19 -0
  837. package/lib/zudoku.hooks.js.map +1 -0
  838. package/lib/zudoku.icons.js +10 -0
  839. package/lib/zudoku.icons.js.map +1 -1
  840. package/lib/zudoku.plugin-api-catalog.js +117 -0
  841. package/lib/zudoku.plugin-api-catalog.js.map +1 -0
  842. package/lib/zudoku.plugin-api-keys.js +111 -108
  843. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  844. package/lib/zudoku.plugin-custom-pages.js +4 -4
  845. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  846. package/lib/zudoku.plugin-markdown.js +27 -47
  847. package/lib/zudoku.plugin-markdown.js.map +1 -1
  848. package/lib/zudoku.plugin-openapi.js +6 -6
  849. package/lib/zudoku.plugin-openapi.js.map +1 -1
  850. package/lib/zudoku.plugin-redirect.js +1 -1
  851. package/lib/zudoku.plugin-redirect.js.map +1 -1
  852. package/lib/zudoku.plugin-search-inkeep.js +53 -24
  853. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  854. package/lib/zudoku.plugin-search-pagefind.js +233 -0
  855. package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
  856. package/lib/zudoku.plugins.js +14 -0
  857. package/lib/zudoku.plugins.js.map +1 -0
  858. package/package.json +140 -95
  859. package/src/app/demo-cdn.html +31 -31
  860. package/src/app/demo.tsx +1 -2
  861. package/src/app/entry.client.tsx +24 -15
  862. package/src/app/entry.server.tsx +26 -15
  863. package/src/app/main.css +100 -39
  864. package/src/app/main.tsx +40 -11
  865. package/src/app/sentry.ts +24 -0
  866. package/src/app/standalone.tsx +1 -2
  867. package/src/app/tailwind.ts +83 -48
  868. package/src/lib/MissingIcon.tsx +22 -0
  869. package/src/lib/authentication/AuthenticationPlugin.tsx +4 -1
  870. package/src/lib/authentication/authentication.ts +3 -1
  871. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  872. package/src/lib/authentication/components/SignIn.tsx +1 -1
  873. package/src/lib/authentication/components/SignOut.tsx +3 -2
  874. package/src/lib/authentication/hook.ts +13 -4
  875. package/src/lib/authentication/providers/auth0.tsx +6 -7
  876. package/src/lib/authentication/providers/clerk.tsx +70 -15
  877. package/src/lib/authentication/providers/openid.tsx +72 -55
  878. package/src/lib/authentication/providers/supabase.tsx +157 -0
  879. package/src/lib/authentication/state.ts +51 -27
  880. package/src/lib/components/AnchorLink.tsx +13 -8
  881. package/src/lib/components/Autocomplete.tsx +113 -0
  882. package/src/lib/components/Banner.tsx +1 -0
  883. package/src/lib/components/Bootstrap.tsx +29 -29
  884. package/src/lib/components/Footer.tsx +139 -0
  885. package/src/lib/components/Header.tsx +65 -24
  886. package/src/lib/components/Heading.tsx +13 -13
  887. package/src/lib/components/InlineCode.tsx +13 -16
  888. package/src/lib/components/Layout.tsx +33 -54
  889. package/src/lib/components/Main.tsx +50 -0
  890. package/src/lib/components/Markdown.tsx +15 -16
  891. package/src/lib/components/MobileTopNavigation.tsx +36 -34
  892. package/src/lib/components/NotFoundPage.tsx +1 -1
  893. package/src/lib/components/Pagination.tsx +50 -0
  894. package/src/lib/components/PathRenderer.tsx +61 -0
  895. package/src/lib/components/ReactMarkdown.license.txt +21 -0
  896. package/src/lib/components/ReactMarkdown.tsx +264 -0
  897. package/src/lib/components/Search.tsx +17 -6
  898. package/src/lib/components/SlotletProvider.tsx +1 -1
  899. package/src/lib/components/StatusPage.tsx +91 -0
  900. package/src/lib/components/ThemeSwitch.tsx +33 -11
  901. package/src/lib/components/TopNavigation.tsx +72 -37
  902. package/src/lib/components/Zudoku.tsx +20 -7
  903. package/src/lib/components/cache.ts +23 -0
  904. package/src/lib/components/context/BypassProtectedRoutesContext.ts +3 -0
  905. package/src/lib/components/context/RouterEventsEmitter.tsx +19 -0
  906. package/src/lib/components/context/ViewportAnchorContext.tsx +26 -21
  907. package/src/lib/components/context/ZudokuContext.ts +32 -10
  908. package/src/lib/components/index.ts +22 -5
  909. package/src/lib/components/navigation/PoweredByZudoku.tsx +23 -0
  910. package/src/lib/components/navigation/Sidebar.tsx +38 -29
  911. package/src/lib/components/navigation/SidebarBadge.tsx +17 -12
  912. package/src/lib/components/navigation/SidebarCategory.tsx +59 -56
  913. package/src/lib/components/navigation/SidebarItem.tsx +30 -39
  914. package/src/lib/components/navigation/SidebarWrapper.tsx +42 -22
  915. package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
  916. package/src/lib/components/navigation/ZudokuLogo.tsx +25 -0
  917. package/src/lib/components/navigation/utils.ts +1 -1
  918. package/src/lib/core/RouteGuard.tsx +96 -0
  919. package/src/lib/core/ZudokuContext.ts +73 -21
  920. package/src/lib/core/plugins.ts +33 -7
  921. package/src/lib/errors/ErrorAlert.tsx +24 -17
  922. package/src/lib/errors/RouterError.tsx +1 -1
  923. package/src/lib/hooks/index.ts +5 -0
  924. package/src/lib/hooks/useEvent.test.tsx +149 -0
  925. package/src/lib/hooks/useEvent.ts +41 -0
  926. package/src/lib/icons.ts +1 -0
  927. package/src/lib/oas/graphql/circular.ts +50 -0
  928. package/src/lib/oas/graphql/index.ts +295 -101
  929. package/src/lib/oas/parser/dereference/index.ts +10 -4
  930. package/src/lib/oas/parser/index.ts +7 -29
  931. package/src/lib/oas/parser/upgrade/index.ts +24 -31
  932. package/src/lib/plugins/api-catalog/Catalog.tsx +73 -0
  933. package/src/lib/plugins/api-catalog/index.tsx +115 -0
  934. package/src/lib/plugins/api-keys/CreateApiKey.tsx +8 -4
  935. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +1 -1
  936. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +1 -1
  937. package/src/lib/plugins/api-keys/index.tsx +7 -1
  938. package/src/lib/plugins/custom-pages/index.tsx +1 -1
  939. package/src/lib/plugins/markdown/MdxPage.tsx +43 -41
  940. package/src/lib/plugins/markdown/index.tsx +5 -2
  941. package/src/lib/plugins/markdown/resolver.ts +2 -37
  942. package/src/lib/plugins/openapi/CollapsibleCode.tsx +10 -7
  943. package/src/lib/plugins/openapi/ColorizedParam.tsx +30 -13
  944. package/src/lib/plugins/openapi/Endpoint.tsx +14 -12
  945. package/src/lib/plugins/openapi/OasProvider.tsx +51 -0
  946. package/src/lib/plugins/openapi/OperationList.tsx +220 -42
  947. package/src/lib/plugins/openapi/OperationListItem.tsx +136 -88
  948. package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
  949. package/src/lib/plugins/openapi/ParameterList.tsx +4 -0
  950. package/src/lib/plugins/openapi/ParameterListItem.tsx +35 -24
  951. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +21 -2
  952. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +15 -38
  953. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +46 -63
  954. package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
  955. package/src/lib/plugins/openapi/Sidecar.tsx +85 -65
  956. package/src/lib/plugins/openapi/SidecarBox.tsx +4 -16
  957. package/src/lib/plugins/openapi/SidecarExamples.tsx +162 -0
  958. package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
  959. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +29 -104
  960. package/src/lib/plugins/openapi/client/createServer.ts +6 -2
  961. package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
  962. package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
  963. package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
  964. package/src/lib/plugins/openapi/context.tsx +2 -2
  965. package/src/lib/plugins/openapi/graphql/gql.ts +36 -11
  966. package/src/lib/plugins/openapi/graphql/graphql.ts +172 -36
  967. package/src/lib/plugins/openapi/index.tsx +99 -98
  968. package/src/lib/plugins/openapi/interfaces.ts +57 -3
  969. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +52 -0
  970. package/src/lib/plugins/openapi/playground/Headers.tsx +165 -36
  971. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
  972. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
  973. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +13 -0
  974. package/src/lib/plugins/openapi/playground/PathParams.tsx +39 -64
  975. package/src/lib/plugins/openapi/playground/Playground.tsx +384 -244
  976. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +6 -3
  977. package/src/lib/plugins/openapi/playground/QueryParams.tsx +86 -88
  978. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
  979. package/src/lib/plugins/openapi/playground/SubmitButton.tsx +75 -0
  980. package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
  981. package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +73 -0
  982. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +230 -0
  983. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +123 -0
  984. package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.test.ts +64 -0
  985. package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.ts +36 -0
  986. package/src/lib/plugins/openapi/processors/removeExtensions.test.ts +202 -0
  987. package/src/lib/plugins/openapi/processors/removeExtensions.ts +27 -0
  988. package/src/lib/plugins/openapi/processors/removeParameters.test.ts +148 -0
  989. package/src/lib/plugins/openapi/processors/removeParameters.ts +101 -0
  990. package/src/lib/plugins/openapi/processors/removePaths.test.ts +126 -0
  991. package/src/lib/plugins/openapi/processors/removePaths.ts +55 -0
  992. package/src/lib/plugins/openapi/processors/traverse.ts +1 -0
  993. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
  994. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.tsx +3 -0
  995. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +6 -3
  996. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
  997. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +148 -0
  998. package/src/lib/plugins/openapi/schema/SchemaView.tsx +88 -139
  999. package/src/lib/plugins/openapi/schema/utils.ts +11 -1
  1000. package/src/lib/plugins/openapi/state.ts +36 -0
  1001. package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +37 -0
  1002. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +26 -11
  1003. package/src/lib/plugins/openapi/util/getRoutes.tsx +126 -0
  1004. package/src/lib/plugins/openapi/util/methodColorMap.tsx +11 -0
  1005. package/src/lib/plugins/openapi/util/methodToColor.ts +27 -0
  1006. package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -0
  1007. package/src/lib/plugins/redirect/index.tsx +2 -2
  1008. package/src/lib/plugins/search-inkeep/index.tsx +78 -23
  1009. package/src/lib/plugins/search-inkeep/inkeep.ts +3 -9
  1010. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +164 -0
  1011. package/src/lib/plugins/search-pagefind/ResultList.tsx +105 -0
  1012. package/src/lib/plugins/search-pagefind/get-results.tsx +75 -0
  1013. package/src/lib/plugins/search-pagefind/index.tsx +21 -0
  1014. package/src/lib/plugins/search-pagefind/types.ts +118 -0
  1015. package/src/lib/ui/Badge.tsx +2 -1
  1016. package/src/lib/ui/Button.tsx +4 -2
  1017. package/src/lib/ui/Callout.tsx +29 -10
  1018. package/src/lib/ui/Card.tsx +1 -1
  1019. package/src/lib/ui/Checkbox.tsx +2 -1
  1020. package/src/lib/ui/Command.tsx +45 -3
  1021. package/src/lib/ui/Input.tsx +1 -2
  1022. package/src/lib/ui/Select.tsx +2 -2
  1023. package/src/lib/ui/Stepper.tsx +8 -0
  1024. package/src/lib/ui/SyntaxHighlight.tsx +186 -0
  1025. package/src/lib/ui/util.tsx +3 -0
  1026. package/src/lib/util/MdxComponents.tsx +12 -11
  1027. package/src/lib/util/createVariantComponent.tsx +2 -2
  1028. package/src/lib/util/detectOS.ts +9 -0
  1029. package/src/lib/util/joinPath.tsx +3 -0
  1030. package/src/lib/util/joinUrl.test.ts +62 -0
  1031. package/src/lib/util/joinUrl.ts +57 -0
  1032. package/src/lib/util/scrollIntoViewIfNeeded.ts +18 -0
  1033. package/src/lib/util/traverse.ts +31 -0
  1034. package/src/lib/util/types.ts +7 -0
  1035. package/src/lib/util/useExposedProps.tsx +1 -1
  1036. package/src/lib/util/useLatest.ts +18 -0
  1037. package/src/lib/util/useOnScreen.ts +6 -4
  1038. package/src/lib/util/useScrollToAnchor.ts +48 -39
  1039. package/src/lib/util/useScrollToTop.ts +9 -4
  1040. package/dist/lib/components/SyntaxHighlight.d.ts +0 -11
  1041. package/dist/lib/components/SyntaxHighlight.js +0 -57
  1042. package/dist/lib/components/SyntaxHighlight.js.map +0 -1
  1043. package/dist/lib/components/context/PluginSystem.js +0 -2
  1044. package/dist/lib/components/context/PluginSystem.js.map +0 -1
  1045. package/dist/lib/plugins/markdown/Toc.js.map +0 -1
  1046. package/dist/lib/plugins/openapi/Route.d.ts +0 -6
  1047. package/dist/lib/plugins/openapi/Route.js +0 -6
  1048. package/dist/lib/plugins/openapi/Route.js.map +0 -1
  1049. package/dist/lib/plugins/openapi/client/worker.d.ts +0 -4
  1050. package/dist/lib/plugins/openapi/client/worker.js +0 -29
  1051. package/dist/lib/plugins/openapi/client/worker.js.map +0 -1
  1052. package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +0 -4
  1053. package/dist/lib/plugins/openapi/playground/ResponseTab.js +0 -42
  1054. package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +0 -1
  1055. package/dist/lib/plugins/openapi/schema/SchemaComponents.js +0 -28
  1056. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +0 -1
  1057. package/dist/lib/plugins/openapi-worker.d.ts +0 -1
  1058. package/dist/lib/plugins/openapi-worker.js +0 -8
  1059. package/dist/lib/plugins/openapi-worker.js.map +0 -1
  1060. package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.d.ts +0 -2
  1061. package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js +0 -3
  1062. package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js.map +0 -1
  1063. package/dist/vite/plugin-custom-css.js +0 -55
  1064. package/dist/vite/plugin-custom-css.js.map +0 -1
  1065. package/dist/vite/prerender.d.ts +0 -21
  1066. package/dist/vite/prerender.js +0 -89
  1067. package/dist/vite/prerender.js.map +0 -1
  1068. package/lib/AnchorLink-CDlhr8gL.js +0 -706
  1069. package/lib/AnchorLink-CDlhr8gL.js.map +0 -1
  1070. package/lib/AuthenticationPlugin-DeGDVa1r.js +0 -56
  1071. package/lib/AuthenticationPlugin-DeGDVa1r.js.map +0 -1
  1072. package/lib/Button-jK0EsymC.js +0 -48
  1073. package/lib/Button-jK0EsymC.js.map +0 -1
  1074. package/lib/Dialog-k70Qfukb.js +0 -67
  1075. package/lib/InkeepCustomTrigger-CE5-K5ex.js +0 -6
  1076. package/lib/InkeepCustomTrigger-CE5-K5ex.js.map +0 -1
  1077. package/lib/Markdown-BorQdbxW.js.map +0 -1
  1078. package/lib/MdxPage-DFlbtJWi.js +0 -174
  1079. package/lib/MdxPage-DFlbtJWi.js.map +0 -1
  1080. package/lib/OperationList-KshJrrLL.js +0 -4691
  1081. package/lib/OperationList-KshJrrLL.js.map +0 -1
  1082. package/lib/Route-DlG_HTMu.js +0 -11
  1083. package/lib/Route-DlG_HTMu.js.map +0 -1
  1084. package/lib/SidebarBadge-DxFJcJ6V.js +0 -51
  1085. package/lib/SidebarBadge-DxFJcJ6V.js.map +0 -1
  1086. package/lib/SlotletProvider-D2v6rJy1.js +0 -252
  1087. package/lib/SlotletProvider-D2v6rJy1.js.map +0 -1
  1088. package/lib/SyntaxHighlight-CBmwwKoM.js.map +0 -1
  1089. package/lib/__vite-browser-external-BYRIRx8p.js +0 -9
  1090. package/lib/__vite-browser-external-BYRIRx8p.js.map +0 -1
  1091. package/lib/assets/index-B_Jk_Yzp.js +0 -4820
  1092. package/lib/assets/index-B_Jk_Yzp.js.map +0 -1
  1093. package/lib/assets/worker-CPsGZsve.js +0 -18201
  1094. package/lib/assets/worker-CPsGZsve.js.map +0 -1
  1095. package/lib/cn-BmFQLtkS.js.map +0 -1
  1096. package/lib/context-D1nXWxm7.js.map +0 -1
  1097. package/lib/createServer-DK-g7kbB.js +0 -16089
  1098. package/lib/createServer-DK-g7kbB.js.map +0 -1
  1099. package/lib/hook-Diu0rqp-.js.map +0 -1
  1100. package/lib/index-BcesIHH4.js +0 -1273
  1101. package/lib/index-BcesIHH4.js.map +0 -1
  1102. package/lib/index-BuAyrJe3.js +0 -46
  1103. package/lib/index-BuAyrJe3.js.map +0 -1
  1104. package/lib/index-CkwDvuPt.js.map +0 -1
  1105. package/lib/index-Czzd9rjU.js +0 -899
  1106. package/lib/index-Czzd9rjU.js.map +0 -1
  1107. package/lib/index-Yn8c3UWE.js +0 -921
  1108. package/lib/index-Yn8c3UWE.js.map +0 -1
  1109. package/lib/index.esm-C5mr_sKO.js +0 -1193
  1110. package/lib/index.esm-C5mr_sKO.js.map +0 -1
  1111. package/lib/jsx-runtime-B6kdoens.js +0 -635
  1112. package/lib/jsx-runtime-B6kdoens.js.map +0 -1
  1113. package/lib/prism-csharp.min-Yizuc34Y.js +0 -35
  1114. package/lib/prism-java.min-d5iT_mOd.js +0 -7
  1115. package/lib/prism-markup-templating-DZrrEs0A.js +0 -62
  1116. package/lib/prism-markup-templating-DZrrEs0A.js.map +0 -1
  1117. package/lib/prism-php.min-o7FpoMP_.js +0 -11
  1118. package/lib/prism-php.min-o7FpoMP_.js.map +0 -1
  1119. package/lib/prism-ruby.min-C7LwcKyz.js +0 -10
  1120. package/lib/prism-typescript.min-oSVeWCAd.js +0 -6
  1121. package/lib/router-lfyopgBI.js +0 -3024
  1122. package/lib/router-lfyopgBI.js.map +0 -1
  1123. package/lib/state-BsPrOUAh.js +0 -252
  1124. package/lib/state-BsPrOUAh.js.map +0 -1
  1125. package/lib/useExposedProps-CTPtylCV.js +0 -10
  1126. package/lib/useExposedProps-CTPtylCV.js.map +0 -1
  1127. package/lib/utils-DcpDOncX.js +0 -1218
  1128. package/lib/utils-DcpDOncX.js.map +0 -1
  1129. package/lib/zudoku.openapi-worker.js +0 -15
  1130. package/lib/zudoku.openapi-worker.js.map +0 -1
  1131. package/src/lib/components/SyntaxHighlight.tsx +0 -160
  1132. package/src/lib/components/context/PluginSystem.ts +0 -0
  1133. package/src/lib/plugins/openapi/Route.tsx +0 -19
  1134. package/src/lib/plugins/openapi/client/worker.ts +0 -44
  1135. package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -76
  1136. package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +0 -126
  1137. package/src/lib/plugins/openapi-worker.ts +0 -11
  1138. package/src/lib/plugins/search-inkeep/InkeepCustomTrigger.tsx +0 -3
  1139. /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
  1140. /package/dist/lib/{components/context/PluginSystem.d.ts → hooks/useEvent.test.d.ts} +0 -0
@@ -1,4691 +0,0 @@
1
- import { j as d } from "./jsx-runtime-B6kdoens.js";
2
- import { g as Ht } from "./utils-DcpDOncX.js";
3
- import { C as nr } from "./CategoryHeading-Bb9dqxD3.js";
4
- import { I as On, M as be, H as _e, P as je } from "./Markdown-BorQdbxW.js";
5
- import { c as D } from "./cn-BmFQLtkS.js";
6
- import { CheckIcon as Tn, CopyIcon as Cn, ChevronDownIcon as Pn, CircleFadingPlusIcon as kn, CircleDotIcon as En, CircleIcon as Nn, SquareMinusIcon as Rn, SquarePlusIcon as An, ListPlusIcon as qn } from "lucide-react";
7
- import { useContext as In, useTransition as Jr, useState as ve, useRef as Gr, useEffect as Vr, useLayoutEffect as Ln, Fragment as Un, useMemo as Fn, useCallback as _n } from "react";
8
- import { a as Qr } from "./state-BsPrOUAh.js";
9
- import { Button as Kr } from "./ui/Button.js";
10
- import { a as Hn, u as Bt } from "./context-D1nXWxm7.js";
11
- import { g as ut, S as Dr, C as Yr, P as Bn } from "./index-BcesIHH4.js";
12
- import { Tabs as Mn, TabsList as zn, TabsTrigger as Wn, TabsContent as Jn } from "./ui/Tabs.js";
13
- import { T as fe, b as Gn } from "./SidebarBadge-DxFJcJ6V.js";
14
- import { Card as de, CardHeader as Vn, CardTitle as Qn, CardContent as Kn } from "./ui/Card.js";
15
- import { g as Dn, c as He, a as Yn } from "./_commonjsHelpers-BkfeUUK-.js";
16
- import { _ as Xn } from "./__vite-browser-external-BYRIRx8p.js";
17
- import { u as Zn } from "./index-Yn8c3UWE.js";
18
- import { S as Mt } from "./SyntaxHighlight-CBmwwKoM.js";
19
- import { B as or } from "./Button-jK0EsymC.js";
20
- import * as ee from "@radix-ui/react-collapsible";
21
- import * as De from "@radix-ui/react-tabs";
22
- function eo(t, e) {
23
- return e;
24
- }
25
- const zt = (t, ...e) => {
26
- const r = In(Hn);
27
- if (r === void 0)
28
- throw new Error("useGraphQL must be used within a GraphQLProvider");
29
- return {
30
- queryFn: () => r.fetch(t, ...e),
31
- queryKey: [t, e[0]]
32
- };
33
- }, to = ut(
34
- /* GraphQL */
35
- `
36
- query ServersQuery($input: JSON!, $type: SchemaType!) {
37
- schema(input: $input, type: $type) {
38
- url
39
- servers {
40
- url
41
- }
42
- }
43
- }
44
- `
45
- ), ar = ({ url: t }) => {
46
- const [e, r] = ve(!1);
47
- return /* @__PURE__ */ d.jsx(
48
- Kr,
49
- {
50
- onClick: () => {
51
- navigator.clipboard.writeText(t).then(() => {
52
- r(!0), setTimeout(() => r(!1), 2e3);
53
- });
54
- },
55
- variant: "ghost",
56
- size: "icon",
57
- children: e ? /* @__PURE__ */ d.jsx(Tn, { className: "text-green-600", size: 14 }) : /* @__PURE__ */ d.jsx(Cn, { size: 14, strokeWidth: 1.3 })
58
- }
59
- );
60
- }, ro = () => {
61
- const { input: t, type: e } = Bt(), r = zt(to, { input: t, type: e }), o = Ht(r), [, i] = Jr(), { selectedServer: a, setSelectedServer: n } = Qr(), { servers: s } = o.data.schema;
62
- return s.length === 1 ? /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2", children: [
63
- /* @__PURE__ */ d.jsx("span", { className: "font-medium text-sm", children: "Endpoint:" }),
64
- /* @__PURE__ */ d.jsx(On, { className: "text-xs px-2 py-1.5", selectOnClick: !0, children: s[0].url }),
65
- /* @__PURE__ */ d.jsx(ar, { url: s[0].url })
66
- ] }) : /* @__PURE__ */ d.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
67
- /* @__PURE__ */ d.jsxs("span", { className: "font-medium text-sm", children: [
68
- s.length > 1 ? "Endpoints" : "Endpoint",
69
- ":"
70
- ] }),
71
- /* @__PURE__ */ d.jsx(
72
- Dr,
73
- {
74
- className: "font-mono text-xs bg-border/50 dark:bg-border/70 py-1.5 max-w-[450px] truncate",
75
- onChange: (l) => i(() => {
76
- n(l.target.value);
77
- }),
78
- value: a ?? o.data.schema.url,
79
- showChevrons: s.length > 1,
80
- options: s.map((l) => ({
81
- value: l.url,
82
- label: l.url
83
- }))
84
- }
85
- ),
86
- /* @__PURE__ */ d.jsx(ar, { url: a ?? o.data.schema.url })
87
- ] });
88
- }, Xr = (t, e) => t.reduce(
89
- (r, o) => {
90
- const i = e(o);
91
- return r[i] || (r[i] = []), r[i].push(o), r;
92
- },
93
- {}
94
- ), no = (t, e) => t ? e(t) : void 0, oo = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
95
- type: "string"
96
- }, ao = ({
97
- parameter: t,
98
- group: e,
99
- id: r
100
- }) => {
101
- const o = oo(t);
102
- return /* @__PURE__ */ d.jsxs("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1", children: [
103
- /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2", children: [
104
- /* @__PURE__ */ d.jsx("code", { children: e === "path" ? /* @__PURE__ */ d.jsx(
105
- Yr,
106
- {
107
- name: t.name,
108
- backgroundOpacity: "15%",
109
- slug: r + "-" + t.name.toLocaleLowerCase()
110
- }
111
- ) : t.name }),
112
- t.required && /* @__PURE__ */ d.jsx("span", { className: "py-px px-1.5 font-medium bg-primary/75 text-muted rounded-lg", children: "required" }),
113
- o.type && /* @__PURE__ */ d.jsx("span", { className: "text-muted-foreground", children: o.type === "array" ? `${o.items.type}[]` : o.type })
114
- ] }),
115
- t.description && /* @__PURE__ */ d.jsx(
116
- be,
117
- {
118
- content: t.description,
119
- className: "text-sm prose-p:my-1 prose-code:whitespace-pre-line"
120
- }
121
- )
122
- ] });
123
- }, io = ({
124
- group: t,
125
- parameters: e,
126
- id: r
127
- }) => /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
128
- /* @__PURE__ */ d.jsx(_e, { level: 3, id: `${r}/${t}-parameters`, className: "capitalize", children: t === "header" ? "Headers" : `${t} Parameters` }),
129
- /* @__PURE__ */ d.jsx(de, { children: /* @__PURE__ */ d.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: e.sort((o, i) => o.required === i.required ? 0 : o.required ? -1 : 1).map((o) => /* @__PURE__ */ d.jsx(
130
- ao,
131
- {
132
- parameter: o,
133
- id: r,
134
- group: t
135
- },
136
- `${o.name}-${o.in}`
137
- )) }) })
138
- ] });
139
- var ir = (t, e) => {
140
- const r = t[e.name];
141
- return r === void 0 ? (t[e.name] = e.value, t) : Array.isArray(r) ? (r.push(e.value), t) : (t[e.name] = [r, e.value], t);
142
- }, sr = "", lr = `
143
- `, C = class {
144
- /**
145
- * Helper object to format and aggragate lines of code.
146
- * Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
147
- */
148
- constructor({ indent: t, join: e } = {}) {
149
- this.postProcessors = [], this.code = [], this.indentationCharacter = sr, this.lineJoin = lr, this.indentLine = (r, o = 0) => `${this.indentationCharacter.repeat(o)}${r}`, this.unshift = (r, o) => {
150
- const i = this.indentLine(r, o);
151
- this.code.unshift(i);
152
- }, this.push = (r, o) => {
153
- const i = this.indentLine(r, o);
154
- this.code.push(i);
155
- }, this.blank = () => {
156
- this.code.push("");
157
- }, this.join = () => {
158
- const r = this.code.join(this.lineJoin);
159
- return this.postProcessors.reduce((i, a) => a(i), r);
160
- }, this.addPostProcessor = (r) => {
161
- this.postProcessors = [...this.postProcessors, r];
162
- }, this.indentationCharacter = t || sr, this.lineJoin = e ?? lr;
163
- }
164
- }, so = function(t) {
165
- return Object.prototype.toString.call(t) === "[object RegExp]";
166
- }, lo = function(t) {
167
- var e = typeof t;
168
- return t !== null && (e === "object" || e === "function");
169
- }, Wt = {};
170
- Object.defineProperty(Wt, "__esModule", { value: !0 });
171
- Wt.default = (t) => Object.getOwnPropertySymbols(t).filter((e) => Object.prototype.propertyIsEnumerable.call(t, e));
172
- const co = so, uo = lo, po = Wt.default;
173
- var fo = (t, e, r) => {
174
- const o = [];
175
- return function i(a, n, s) {
176
- n = n || {}, n.indent = n.indent || " ", s = s || "";
177
- let l;
178
- n.inlineCharacterLimit === void 0 ? l = {
179
- newLine: `
180
- `,
181
- newLineOrSpace: `
182
- `,
183
- pad: s,
184
- indent: s + n.indent
185
- } : l = {
186
- newLine: "@@__STRINGIFY_OBJECT_NEW_LINE__@@",
187
- newLineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",
188
- pad: "@@__STRINGIFY_OBJECT_PAD__@@",
189
- indent: "@@__STRINGIFY_OBJECT_INDENT__@@"
190
- };
191
- const c = (u) => {
192
- if (n.inlineCharacterLimit === void 0)
193
- return u;
194
- const f = u.replace(new RegExp(l.newLine, "g"), "").replace(new RegExp(l.newLineOrSpace, "g"), " ").replace(new RegExp(l.pad + "|" + l.indent, "g"), "");
195
- return f.length <= n.inlineCharacterLimit ? f : u.replace(new RegExp(l.newLine + "|" + l.newLineOrSpace, "g"), `
196
- `).replace(new RegExp(l.pad, "g"), s).replace(new RegExp(l.indent, "g"), s + n.indent);
197
- };
198
- if (o.indexOf(a) !== -1)
199
- return '"[Circular]"';
200
- if (a == null || typeof a == "number" || typeof a == "boolean" || typeof a == "function" || typeof a == "symbol" || co(a))
201
- return String(a);
202
- if (a instanceof Date)
203
- return `new Date('${a.toISOString()}')`;
204
- if (Array.isArray(a)) {
205
- if (a.length === 0)
206
- return "[]";
207
- o.push(a);
208
- const u = "[" + l.newLine + a.map((f, p) => {
209
- const h = a.length - 1 === p ? l.newLine : "," + l.newLineOrSpace;
210
- let y = i(f, n, s + n.indent);
211
- return n.transform && (y = n.transform(a, p, y)), l.indent + y + h;
212
- }).join("") + l.pad + "]";
213
- return o.pop(), c(u);
214
- }
215
- if (uo(a)) {
216
- let u = Object.keys(a).concat(po(a));
217
- if (n.filter && (u = u.filter((p) => n.filter(a, p))), u.length === 0)
218
- return "{}";
219
- o.push(a);
220
- const f = "{" + l.newLine + u.map((p, h) => {
221
- const y = u.length - 1 === h ? l.newLine : "," + l.newLineOrSpace, g = typeof p == "symbol", b = !g && /^[a-z$_][a-z$_0-9]*$/i.test(p), x = g || b ? p : i(p, n);
222
- let m = i(a[p], n, s + n.indent);
223
- return n.transform && (m = n.transform(a, p, m)), l.indent + String(x) + ": " + m + y;
224
- }).join("") + l.pad + "}";
225
- return o.pop(), c(f);
226
- }
227
- return a = String(a).replace(/[\r\n]/g, (u) => u === `
228
- ` ? "\\n" : "\\r"), n.singleQuotes === !1 ? (a = a.replace(/"/g, '\\"'), `"${a}"`) : (a = a.replace(/\\?'/g, "\\'"), `'${a}'`);
229
- }(t, e, r);
230
- };
231
- const z = /* @__PURE__ */ Dn(fo);
232
- function We(t, e = {}) {
233
- const { delimiter: r = '"', escapeChar: o = "\\", escapeNewlines: i = !0 } = e;
234
- return [...t.toString()].map((n) => n === "\b" ? `${o}b` : n === " " ? `${o}t` : n === `
235
- ` ? i ? `${o}n` : n : n === "\f" ? `${o}f` : n === "\r" ? i ? `${o}r` : n : n === o ? o + o : n === r ? o + r : n < " " || n > "~" ? JSON.stringify(n).slice(1, -1) : n).join("");
236
- }
237
- var Je = (t) => We(t, { delimiter: "'" }), H = (t) => We(t, { delimiter: '"' }), ho = {
238
- info: {
239
- key: "libcurl",
240
- title: "Libcurl",
241
- link: "http://curl.haxx.se/libcurl",
242
- description: "Simple REST and HTTP API Client for C",
243
- extname: ".c"
244
- },
245
- convert: ({ method: t, fullUrl: e, headersObj: r, allHeaders: o, postData: i }) => {
246
- const { push: a, blank: n, join: s } = new C();
247
- a("CURL *hnd = curl_easy_init();"), n(), a(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${t.toUpperCase()}");`), a("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"), a(`curl_easy_setopt(hnd, CURLOPT_URL, "${e}");`);
248
- const l = Object.keys(r);
249
- return l.length && (n(), a("struct curl_slist *headers = NULL;"), l.forEach((c) => {
250
- a(`headers = curl_slist_append(headers, "${c}: ${H(r[c])}");`);
251
- }), a("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), o.cookie && (n(), a(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${o.cookie}");`)), i.text && (n(), a(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(i.text)});`)), n(), a("CURLcode ret = curl_easy_perform(hnd);"), s();
252
- }
253
- }, yo = {
254
- info: {
255
- key: "c",
256
- title: "C",
257
- default: "libcurl",
258
- cli: "c"
259
- },
260
- clientsById: {
261
- libcurl: ho
262
- }
263
- }, J = (t, e) => Object.keys(t).find((r) => r.toLowerCase() === e.toLowerCase()), ue = (t, e) => {
264
- const r = J(t, e);
265
- if (r)
266
- return t[r];
267
- }, pt = (t, e) => !!J(t, e), mo = (t) => ["application/json", "application/x-json", "text/json", "text/x-json", "+json"].some(
268
- (e) => t.indexOf(e) > -1
269
- ), cr = class {
270
- constructor(t) {
271
- this.name = "", this.toString = () => `:${this.name}`, this.name = t;
272
- }
273
- }, go = class {
274
- constructor(t) {
275
- this.path = "", this.toString = () => `(clojure.java.io/file "${this.path}")`, this.path = t;
276
- }
277
- }, Zr = (t) => t === void 0 ? null : t === null ? "null" : t.constructor.name.toLowerCase(), en = (t) => t === void 0 ? !0 : Zr(t) === "object" ? Object.keys(t).length === 0 : !1, ur = (t) => (Object.keys(t).filter((e) => en(t[e])).forEach((e) => {
278
- delete t[e];
279
- }), t), et = (t, e) => {
280
- const r = " ".repeat(t);
281
- return e.replace(/\n/g, `
282
- ${r}`);
283
- }, Ct = (t) => {
284
- switch (Zr(t)) {
285
- case "string":
286
- return `"${t.replace(/"/g, '\\"')}"`;
287
- case "file":
288
- return t.toString();
289
- case "keyword":
290
- return t.toString();
291
- case "null":
292
- return "nil";
293
- case "regexp":
294
- return `#"${t.source}"`;
295
- case "object": {
296
- const e = Object.keys(t).reduce((r, o) => {
297
- const i = et(o.length + 2, Ct(t[o]));
298
- return `${r}:${o} ${i}
299
- `;
300
- }, "").trim();
301
- return `{${et(1, e)}}`;
302
- }
303
- case "array": {
304
- const e = t.reduce((r, o) => `${r} ${Ct(o)}`, "").trim();
305
- return `[${et(1, e)}]`;
306
- }
307
- default:
308
- return t.toString();
309
- }
310
- }, bo = {
311
- info: {
312
- key: "clj_http",
313
- title: "clj-http",
314
- link: "https://github.com/dakrone/clj-http",
315
- description: "An idiomatic clojure http client wrapping the apache client.",
316
- extname: ".clj"
317
- },
318
- convert: ({ queryObj: t, method: e, postData: r, url: o, allHeaders: i }, a) => {
319
- const { push: n, join: s } = new C({ indent: a == null ? void 0 : a.indent }), l = ["get", "post", "put", "delete", "patch", "head", "options"];
320
- if (e = e.toLowerCase(), !l.includes(e))
321
- return n("Method not supported"), s();
322
- const c = {
323
- headers: i,
324
- "query-params": t
325
- };
326
- switch (r.mimeType) {
327
- case "application/json":
328
- {
329
- c["content-type"] = new cr("json"), c["form-params"] = r.jsonObj;
330
- const u = J(c.headers, "content-type");
331
- u && delete c.headers[u];
332
- }
333
- break;
334
- case "application/x-www-form-urlencoded":
335
- {
336
- c["form-params"] = r.paramsObj;
337
- const u = J(c.headers, "content-type");
338
- u && delete c.headers[u];
339
- }
340
- break;
341
- case "text/plain":
342
- {
343
- c.body = r.text;
344
- const u = J(c.headers, "content-type");
345
- u && delete c.headers[u];
346
- }
347
- break;
348
- case "multipart/form-data": {
349
- if (r.params) {
350
- c.multipart = r.params.map((f) => f.fileName && !f.value ? {
351
- name: f.name,
352
- content: new go(f.fileName)
353
- } : {
354
- name: f.name,
355
- content: f.value
356
- });
357
- const u = J(c.headers, "content-type");
358
- u && delete c.headers[u];
359
- }
360
- break;
361
- }
362
- }
363
- switch (ue(c.headers, "accept")) {
364
- case "application/json":
365
- {
366
- c.accept = new cr("json");
367
- const u = J(c.headers, "accept");
368
- u && delete c.headers[u];
369
- }
370
- break;
371
- }
372
- if (n(`(require '[clj-http.client :as client])
373
- `), en(ur(c)))
374
- n(`(client/${e} "${o}")`);
375
- else {
376
- const u = 11 + e.length + o.length, f = et(u, Ct(ur(c)));
377
- n(`(client/${e} "${o}" ${f})`);
378
- }
379
- return s();
380
- }
381
- }, vo = {
382
- info: {
383
- key: "clojure",
384
- title: "Clojure",
385
- default: "clj_http"
386
- },
387
- clientsById: {
388
- clj_http: bo
389
- }
390
- }, xo = (t) => {
391
- let e = ue(t, "accept-encoding");
392
- if (!e)
393
- return [];
394
- const r = {
395
- gzip: "DecompressionMethods.GZip",
396
- deflate: "DecompressionMethods.Deflate"
397
- }, o = [];
398
- return typeof e == "string" && (e = [e]), e.forEach((i) => {
399
- i.split(",").forEach((a) => {
400
- const n = /\s*([^;\s]+)/.exec(a);
401
- if (n) {
402
- const s = r[n[1]];
403
- s && o.push(s);
404
- }
405
- });
406
- }), o;
407
- }, $o = {
408
- info: {
409
- key: "httpclient",
410
- title: "HttpClient",
411
- link: "https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",
412
- description: ".NET Standard HTTP Client",
413
- extname: ".cs"
414
- },
415
- convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o }, i) => {
416
- var h, y;
417
- const a = {
418
- indent: " ",
419
- ...i
420
- }, { push: n, join: s } = new C({ indent: a.indent });
421
- n("using System.Net.Http.Headers;");
422
- let l = "";
423
- const c = !!t.cookie, u = xo(t);
424
- (c || u.length) && (l = "clientHandler", n("var clientHandler = new HttpClientHandler"), n("{"), c && n("UseCookies = false,", 1), u.length && n(`AutomaticDecompression = ${u.join(" | ")},`, 1), n("};")), n(`var client = new HttpClient(${l});`), n("var request = new HttpRequestMessage"), n("{");
425
- const f = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE"];
426
- r = r.toUpperCase(), r && f.includes(r) ? r = `HttpMethod.${r[0]}${r.substring(1).toLowerCase()}` : r = `new HttpMethod("${r}")`, n(`Method = ${r},`, 1), n(`RequestUri = new Uri("${o}"),`, 1);
427
- const p = Object.keys(t).filter((g) => {
428
- switch (g.toLowerCase()) {
429
- case "content-type":
430
- case "content-length":
431
- case "accept-encoding":
432
- return !1;
433
- default:
434
- return !0;
435
- }
436
- });
437
- if (p.length && (n("Headers =", 1), n("{", 1), p.forEach((g) => {
438
- n(`{ "${g}", "${H(t[g])}" },`, 2);
439
- }), n("},", 1)), e.text) {
440
- const g = e.mimeType;
441
- switch (g) {
442
- case "application/x-www-form-urlencoded":
443
- n("Content = new FormUrlEncodedContent(new Dictionary<string, string>", 1), n("{", 1), (h = e.params) == null || h.forEach((b) => {
444
- n(`{ "${b.name}", "${b.value}" },`, 2);
445
- }), n("}),", 1);
446
- break;
447
- case "multipart/form-data":
448
- n("Content = new MultipartFormDataContent", 1), n("{", 1), (y = e.params) == null || y.forEach((b) => {
449
- n(`new StringContent(${JSON.stringify(b.value || "")})`, 2), n("{", 2), n("Headers =", 3), n("{", 3), b.contentType && n(`ContentType = new MediaTypeHeaderValue("${b.contentType}"),`, 4), n('ContentDisposition = new ContentDispositionHeaderValue("form-data")', 4), n("{", 4), n(`Name = "${b.name}",`, 5), b.fileName && n(`FileName = "${b.fileName}",`, 5), n("}", 4), n("}", 3), n("},", 2);
450
- }), n("},", 1);
451
- break;
452
- default:
453
- n(`Content = new StringContent(${JSON.stringify(e.text || "")})`, 1), n("{", 1), n("Headers =", 2), n("{", 2), n(`ContentType = new MediaTypeHeaderValue("${g}")`, 3), n("}", 2), n("}", 1);
454
- break;
455
- }
456
- }
457
- return n("};"), n("using (var response = await client.SendAsync(request))"), n("{"), n("response.EnsureSuccessStatusCode();", 1), n("var body = await response.Content.ReadAsStringAsync();", 1), n("Console.WriteLine(body);", 1), n("}"), s();
458
- }
459
- };
460
- function wo(t) {
461
- return t[0].toUpperCase() + t.slice(1).toLowerCase();
462
- }
463
- var jo = {
464
- info: {
465
- key: "restsharp",
466
- title: "RestSharp",
467
- link: "http://restsharp.org/",
468
- description: "Simple REST and HTTP API Client for .NET",
469
- extname: ".cs",
470
- installation: "dotnet add package RestSharp"
471
- },
472
- convert: ({ method: t, fullUrl: e, headersObj: r, cookies: o, postData: i, uriObj: a }) => {
473
- const { push: n, join: s } = new C();
474
- if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(
475
- t.toUpperCase()
476
- ))
477
- return "Method not supported";
478
- n(`using RestSharp;
479
-
480
- `), n(`var options = new RestClientOptions("${e}");`), n("var client = new RestClient(options);"), n('var request = new RestRequest("");');
481
- const c = i.mimeType && i.mimeType === "multipart/form-data";
482
- switch (c && n("request.AlwaysMultipartFormData = true;"), Object.keys(r).forEach((u) => {
483
- if (i.mimeType && u.toLowerCase() === "content-type" && i.text) {
484
- c && i.boundary && n(`request.FormBoundary = "${i.boundary}";`);
485
- return;
486
- }
487
- n(`request.AddHeader("${u}", "${H(r[u])}");`);
488
- }), o.forEach(({ name: u, value: f }) => {
489
- n(`request.AddCookie("${u}", "${H(f)}", "${a.pathname}", "${a.host}");`);
490
- }), i.mimeType) {
491
- case "multipart/form-data":
492
- if (!i.params) break;
493
- i.params.forEach((u) => {
494
- u.fileName ? n(`request.AddFile("${u.name}", "${u.fileName}");`) : n(`request.AddParameter("${u.name}", "${u.value}");`);
495
- });
496
- break;
497
- case "application/x-www-form-urlencoded":
498
- if (!i.params) break;
499
- i.params.forEach((u) => {
500
- n(`request.AddParameter("${u.name}", "${u.value}");`);
501
- });
502
- break;
503
- case "application/json": {
504
- if (!i.text) break;
505
- const u = JSON.stringify(i.text);
506
- n(`request.AddJsonBody(${u}, false);`);
507
- break;
508
- }
509
- default:
510
- if (!i.text) break;
511
- n(`request.AddStringBody("${i.text}", "${i.mimeType}");`);
512
- }
513
- return n(`var response = await client.${wo(t)}Async(request);
514
- `), n(`Console.WriteLine("{0}", response.Content);
515
- `), s();
516
- }
517
- }, So = {
518
- info: {
519
- key: "csharp",
520
- title: "C#",
521
- default: "restsharp",
522
- cli: "dotnet"
523
- },
524
- clientsById: {
525
- httpclient: $o,
526
- restsharp: jo
527
- }
528
- }, Oo = {
529
- info: {
530
- key: "native",
531
- title: "NewRequest",
532
- link: "http://golang.org/pkg/net/http/#NewRequest",
533
- description: "Golang HTTP client request",
534
- extname: ".go"
535
- },
536
- convert: ({ postData: t, method: e, allHeaders: r, fullUrl: o }, i = {}) => {
537
- const { blank: a, push: n, join: s } = new C({ indent: " " }), { showBoilerplate: l = !0, checkErrors: c = !1, printBody: u = !0, timeout: f = -1 } = i, p = c ? "err" : "_", h = l ? 1 : 0, y = () => {
538
- c && (n("if err != nil {", h), n("panic(err)", h + 1), n("}", h));
539
- };
540
- l && (n("package main"), a(), n("import ("), n('"fmt"', h), f > 0 && n('"time"', h), t.text && n('"strings"', h), n('"net/http"', h), u && n('"io"', h), n(")"), a(), n("func main() {"), a());
541
- const g = f > 0, b = g, x = b ? "client" : "http.DefaultClient";
542
- return b && (n("client := http.Client{", h), g && n(`Timeout: time.Duration(${f} * time.Second),`, h + 1), n("}", h), a()), n(`url := "${o}"`, h), a(), t.text ? (n(`payload := strings.NewReader(${JSON.stringify(t.text)})`, h), a(), n(`req, ${p} := http.NewRequest("${e}", url, payload)`, h), a()) : (n(`req, ${p} := http.NewRequest("${e}", url, nil)`, h), a()), y(), Object.keys(r).length && (Object.keys(r).forEach((m) => {
543
- n(`req.Header.Add("${m}", "${H(r[m])}")`, h);
544
- }), a()), n(`res, ${p} := ${x}.Do(req)`, h), y(), u && (a(), n("defer res.Body.Close()", h), n(`body, ${p} := io.ReadAll(res.Body)`, h), y()), a(), u && n("fmt.Println(string(body))", h), l && (a(), n("}")), s();
545
- }
546
- }, To = {
547
- info: {
548
- key: "go",
549
- title: "Go",
550
- default: "native",
551
- cli: "go"
552
- },
553
- clientsById: {
554
- native: Oo
555
- }
556
- }, pr = `\r
557
- `, Co = {
558
- info: {
559
- key: "http1.1",
560
- title: "HTTP/1.1",
561
- link: "https://tools.ietf.org/html/rfc7230",
562
- description: "HTTP/1.1 request string in accordance with RFC 7230",
563
- extname: null
564
- },
565
- convert: ({ method: t, fullUrl: e, uriObj: r, httpVersion: o, allHeaders: i, postData: a }, n) => {
566
- const s = {
567
- absoluteURI: !1,
568
- autoContentLength: !0,
569
- autoHost: !0,
570
- ...n
571
- }, { blank: l, push: c, join: u } = new C({ indent: "", join: pr }), f = s.absoluteURI ? e : r.path;
572
- c(`${t} ${f} ${o}`);
573
- const p = Object.keys(i);
574
- if (p.forEach((g) => {
575
- const b = g.toLowerCase().replace(/(^|-)(\w)/g, (x) => x.toUpperCase());
576
- c(`${b}: ${i[g]}`);
577
- }), s.autoHost && !p.includes("host") && c(`Host: ${r.host}`), s.autoContentLength && a.text && !p.includes("content-length")) {
578
- const b = new TextEncoder().encode(a.text).length.toString();
579
- c(`Content-Length: ${b}`);
580
- }
581
- l();
582
- const h = u(), y = a.text || "";
583
- return `${h}${pr}${y}`;
584
- }
585
- }, Po = {
586
- info: {
587
- key: "http",
588
- title: "HTTP",
589
- default: "http1.1"
590
- },
591
- clientsById: {
592
- "http1.1": Co
593
- }
594
- }, ko = {
595
- info: {
596
- key: "asynchttp",
597
- title: "AsyncHttp",
598
- link: "https://github.com/AsyncHttpClient/async-http-client",
599
- description: "Asynchronous Http and WebSocket Client library for Java",
600
- extname: ".java"
601
- },
602
- convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, i) => {
603
- const a = {
604
- indent: " ",
605
- ...i
606
- }, { blank: n, push: s, join: l } = new C({ indent: a.indent });
607
- return s("AsyncHttpClient client = new DefaultAsyncHttpClient();"), s(`client.prepare("${t.toUpperCase()}", "${o}")`), Object.keys(e).forEach((c) => {
608
- s(`.setHeader("${c}", "${H(e[c])}")`, 1);
609
- }), r.text && s(`.setBody(${JSON.stringify(r.text)})`, 1), s(".execute()", 1), s(".toCompletableFuture()", 1), s(".thenAccept(System.out::println)", 1), s(".join();", 1), n(), s("client.close();"), l();
610
- }
611
- }, Eo = {
612
- info: {
613
- key: "nethttp",
614
- title: "java.net.http",
615
- link: "https://openjdk.java.net/groups/net/httpclient/intro.html",
616
- description: "Java Standardized HTTP Client API",
617
- extname: ".java"
618
- },
619
- convert: ({ allHeaders: t, fullUrl: e, method: r, postData: o }, i) => {
620
- const a = {
621
- indent: " ",
622
- ...i
623
- }, { push: n, join: s } = new C({ indent: a.indent });
624
- return n("HttpRequest request = HttpRequest.newBuilder()"), n(`.uri(URI.create("${e}"))`, 2), Object.keys(t).forEach((l) => {
625
- n(`.header("${l}", "${H(t[l])}")`, 2);
626
- }), o.text ? n(
627
- `.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(o.text)}))`,
628
- 2
629
- ) : n(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`, 2), n(".build();", 2), n(
630
- "HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"
631
- ), n("System.out.println(response.body());"), s();
632
- }
633
- }, No = {
634
- info: {
635
- key: "okhttp",
636
- title: "OkHttp",
637
- link: "http://square.github.io/okhttp/",
638
- description: "An HTTP Request Client Library",
639
- extname: ".java"
640
- },
641
- convert: ({ postData: t, method: e, fullUrl: r, allHeaders: o }, i) => {
642
- const a = {
643
- indent: " ",
644
- ...i
645
- }, { push: n, blank: s, join: l } = new C({ indent: a.indent }), c = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
646
- return n("OkHttpClient client = new OkHttpClient();"), s(), t.text && (t.boundary ? n(`MediaType mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}");`) : n(`MediaType mediaType = MediaType.parse("${t.mimeType}");`), n(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(t.text)});`)), n("Request request = new Request.Builder()"), n(`.url("${r}")`, 1), c.includes(e.toUpperCase()) ? u.includes(e.toUpperCase()) ? t.text ? n(`.${e.toLowerCase()}(body)`, 1) : n(`.${e.toLowerCase()}(null)`, 1) : n(`.${e.toLowerCase()}()`, 1) : t.text ? n(`.method("${e.toUpperCase()}", body)`, 1) : n(`.method("${e.toUpperCase()}", null)`, 1), Object.keys(o).forEach((f) => {
647
- n(`.addHeader("${f}", "${H(o[f])}")`, 1);
648
- }), n(".build();", 1), s(), n("Response response = client.newCall(request).execute();"), l();
649
- }
650
- }, Ro = {
651
- info: {
652
- key: "unirest",
653
- title: "Unirest",
654
- link: "http://unirest.io/java.html",
655
- description: "Lightweight HTTP Request Client Library",
656
- extname: ".java"
657
- },
658
- convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, i) => {
659
- const a = {
660
- indent: " ",
661
- ...i
662
- }, { join: n, push: s } = new C({ indent: a.indent });
663
- return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(t.toUpperCase()) ? s(`HttpResponse<String> response = Unirest.${t.toLowerCase()}("${o}")`) : s(`HttpResponse<String> response = Unirest.customMethod("${t.toUpperCase()}","${o}")`), Object.keys(e).forEach((c) => {
664
- s(`.header("${c}", "${H(e[c])}")`, 1);
665
- }), r.text && s(`.body(${JSON.stringify(r.text)})`, 1), s(".asString();", 1), n();
666
- }
667
- }, Ao = {
668
- info: {
669
- key: "java",
670
- title: "Java",
671
- default: "unirest"
672
- },
673
- clientsById: {
674
- asynchttp: ko,
675
- nethttp: Eo,
676
- okhttp: No,
677
- unirest: Ro
678
- }
679
- }, qo = {
680
- info: {
681
- key: "axios",
682
- title: "Axios",
683
- link: "https://github.com/axios/axios",
684
- description: "Promise based HTTP client for the browser and node.js",
685
- extname: ".js",
686
- installation: "npm install axios --save"
687
- },
688
- convert: ({ allHeaders: t, method: e, url: r, queryObj: o, postData: i }, a) => {
689
- const n = {
690
- indent: " ",
691
- ...a
692
- }, { blank: s, push: l, join: c, addPostProcessor: u } = new C({ indent: n.indent });
693
- l("import axios from 'axios';"), s();
694
- const f = {
695
- method: e,
696
- url: r
697
- };
698
- switch (Object.keys(o).length && (f.params = o), Object.keys(t).length && (f.headers = t), i.mimeType) {
699
- case "application/x-www-form-urlencoded":
700
- i.params && (l("const encodedParams = new URLSearchParams();"), i.params.forEach((h) => {
701
- l(`encodedParams.set('${h.name}', '${h.value}');`);
702
- }), s(), f.data = "encodedParams,", u((h) => h.replace(/'encodedParams,'/, "encodedParams,")));
703
- break;
704
- case "application/json":
705
- i.jsonObj && (f.data = i.jsonObj);
706
- break;
707
- case "multipart/form-data":
708
- if (!i.params)
709
- break;
710
- l("const form = new FormData();"), i.params.forEach((h) => {
711
- l(`form.append('${h.name}', '${h.value || h.fileName || ""}');`);
712
- }), s(), f.data = "[form]";
713
- break;
714
- default:
715
- i.text && (f.data = i.text);
716
- }
717
- const p = z(f, {
718
- indent: " ",
719
- inlineCharacterLimit: 80
720
- }).replace('"[form]"', "form");
721
- return l(`const options = ${p};`), s(), l("axios"), l(".request(options)", 1), l(".then(function (response) {", 1), l("console.log(response.data);", 2), l("})", 1), l(".catch(function (error) {", 1), l("console.error(error);", 2), l("});", 1), c();
722
- }
723
- }, Io = {
724
- info: {
725
- key: "fetch",
726
- title: "fetch",
727
- link: "https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",
728
- description: "Perform asynchronous HTTP requests with the Fetch API",
729
- extname: ".js"
730
- },
731
- convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, i) => {
732
- const a = {
733
- indent: " ",
734
- credentials: null,
735
- ...i
736
- }, { blank: n, join: s, push: l } = new C({ indent: a.indent }), c = {
737
- method: t
738
- };
739
- switch (Object.keys(e).length && (c.headers = e), a.credentials !== null && (c.credentials = a.credentials), r.mimeType) {
740
- case "application/x-www-form-urlencoded":
741
- c.body = r.paramsObj ? r.paramsObj : r.text;
742
- break;
743
- case "application/json":
744
- r.jsonObj && (c.body = r.jsonObj);
745
- break;
746
- case "multipart/form-data":
747
- if (!r.params)
748
- break;
749
- const u = J(e, "content-type");
750
- u && delete e[u], l("const form = new FormData();"), r.params.forEach((f) => {
751
- l(`form.append('${f.name}', '${f.value || f.fileName || ""}');`);
752
- }), n();
753
- break;
754
- default:
755
- r.text && (c.body = r.text);
756
- }
757
- return c.headers && !Object.keys(c.headers).length && delete c.headers, l(
758
- `const options = ${z(c, {
759
- indent: a.indent,
760
- inlineCharacterLimit: 80,
761
- // The Fetch API body only accepts string parameters, but stringified JSON can be difficult
762
- // to read, so we keep the object as a literal and use this transform function to wrap the
763
- // literal in a `JSON.stringify` call.
764
- transform: (u, f, p) => {
765
- if (f === "body") {
766
- if (r.mimeType === "application/x-www-form-urlencoded")
767
- return `new URLSearchParams(${p})`;
768
- if (r.mimeType === "application/json")
769
- return `JSON.stringify(${p})`;
770
- }
771
- return p;
772
- }
773
- })};`
774
- ), n(), r.params && r.mimeType === "multipart/form-data" && (l("options.body = form;"), n()), l(`fetch('${o}', options)`), l(".then(response => response.json())", 1), l(".then(response => console.log(response))", 1), l(".catch(err => console.error(err));", 1), s();
775
- }
776
- }, Lo = {
777
- info: {
778
- key: "jquery",
779
- title: "jQuery",
780
- link: "http://api.jquery.com/jquery.ajax/",
781
- description: "Perform an asynchronous HTTP (Ajax) requests with jQuery",
782
- extname: ".js"
783
- },
784
- convert: ({ fullUrl: t, method: e, allHeaders: r, postData: o }, i) => {
785
- var f;
786
- const a = {
787
- indent: " ",
788
- ...i
789
- }, { blank: n, push: s, join: l } = new C({ indent: a.indent }), c = {
790
- async: !0,
791
- crossDomain: !0,
792
- url: t,
793
- method: e,
794
- headers: r
795
- };
796
- switch (o.mimeType) {
797
- case "application/x-www-form-urlencoded":
798
- c.data = o.paramsObj ? o.paramsObj : o.text;
799
- break;
800
- case "application/json":
801
- c.processData = !1, c.data = o.text;
802
- break;
803
- case "multipart/form-data":
804
- if (!o.params)
805
- break;
806
- if (s("const form = new FormData();"), o.params.forEach((p) => {
807
- s(`form.append('${p.name}', '${p.value || p.fileName || ""}');`);
808
- }), c.processData = !1, c.contentType = !1, c.mimeType = "multipart/form-data", c.data = "[form]", pt(r, "content-type") && (f = ue(r, "content-type")) != null && f.includes("boundary")) {
809
- const p = J(r, "content-type");
810
- p && delete c.headers[p];
811
- }
812
- n();
813
- break;
814
- default:
815
- o.text && (c.data = o.text);
816
- }
817
- const u = z(c, { indent: a.indent }).replace("'[form]'", "form");
818
- return s(`const settings = ${u};`), n(), s("$.ajax(settings).done(function (response) {"), s("console.log(response);", 1), s("});"), l();
819
- }
820
- }, Uo = {
821
- info: {
822
- key: "xhr",
823
- title: "XMLHttpRequest",
824
- link: "https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",
825
- description: "W3C Standard API that provides scripted client functionality",
826
- extname: ".js"
827
- },
828
- convert: ({ postData: t, allHeaders: e, method: r, fullUrl: o }, i) => {
829
- var c;
830
- const a = {
831
- indent: " ",
832
- cors: !0,
833
- ...i
834
- }, { blank: n, push: s, join: l } = new C({ indent: a.indent });
835
- switch (t.mimeType) {
836
- case "application/json":
837
- s(
838
- `const data = JSON.stringify(${z(t.jsonObj, {
839
- indent: a.indent
840
- })});`
841
- ), n();
842
- break;
843
- case "multipart/form-data":
844
- if (!t.params)
845
- break;
846
- if (s("const data = new FormData();"), t.params.forEach((u) => {
847
- s(`data.append('${u.name}', '${u.value || u.fileName || ""}');`);
848
- }), pt(e, "content-type") && (c = ue(e, "content-type")) != null && c.includes("boundary")) {
849
- const u = J(e, "content-type");
850
- u && delete e[u];
851
- }
852
- n();
853
- break;
854
- default:
855
- s(`const data = ${t.text ? `'${t.text}'` : "null"};`), n();
856
- }
857
- return s("const xhr = new XMLHttpRequest();"), a.cors && s("xhr.withCredentials = true;"), n(), s("xhr.addEventListener('readystatechange', function () {"), s("if (this.readyState === this.DONE) {", 1), s("console.log(this.responseText);", 2), s("}", 1), s("});"), n(), s(`xhr.open('${r}', '${o}');`), Object.keys(e).forEach((u) => {
858
- s(`xhr.setRequestHeader('${u}', '${Je(e[u])}');`);
859
- }), n(), s("xhr.send(data);"), l();
860
- }
861
- }, Fo = {
862
- info: {
863
- key: "javascript",
864
- title: "JavaScript",
865
- default: "xhr"
866
- },
867
- clientsById: {
868
- xhr: Uo,
869
- axios: qo,
870
- fetch: Io,
871
- jquery: Lo
872
- }
873
- }, _o = {
874
- info: {
875
- key: "native",
876
- title: "Native JSON",
877
- link: "https://www.json.org/json-en.html",
878
- description: "A JSON represetation of any HAR payload.",
879
- extname: ".json"
880
- },
881
- convert: ({ postData: t }, e) => {
882
- const r = {
883
- indent: " ",
884
- ...e
885
- };
886
- let o = "";
887
- switch (t.mimeType) {
888
- case "application/x-www-form-urlencoded":
889
- o = t.paramsObj ? t.paramsObj : t.text;
890
- break;
891
- case "application/json":
892
- t.jsonObj && (o = t.jsonObj);
893
- break;
894
- case "multipart/form-data":
895
- if (!t.params)
896
- break;
897
- const i = {};
898
- t.params.forEach((a) => {
899
- i[a.name] = a.value;
900
- }), o = i;
901
- break;
902
- default:
903
- t.text && (o = t.text);
904
- }
905
- return typeof o > "u" || o === "" ? "No JSON body" : JSON.stringify(o, null, r.indent);
906
- }
907
- }, Ho = {
908
- info: {
909
- key: "json",
910
- title: "JSON",
911
- default: "native"
912
- },
913
- clientsById: {
914
- native: _o
915
- }
916
- }, Bo = {
917
- info: {
918
- key: "okhttp",
919
- title: "OkHttp",
920
- link: "http://square.github.io/okhttp/",
921
- description: "An HTTP Request Client Library",
922
- extname: ".kt"
923
- },
924
- convert: ({ postData: t, fullUrl: e, method: r, allHeaders: o }, i) => {
925
- const a = {
926
- indent: " ",
927
- ...i
928
- }, { blank: n, join: s, push: l } = new C({ indent: a.indent }), c = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
929
- return l("val client = OkHttpClient()"), n(), t.text && (t.boundary ? l(`val mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}")`) : l(`val mediaType = MediaType.parse("${t.mimeType}")`), l(`val body = RequestBody.create(mediaType, ${JSON.stringify(t.text)})`)), l("val request = Request.Builder()"), l(`.url("${e}")`, 1), c.includes(r.toUpperCase()) ? u.includes(r.toUpperCase()) ? t.text ? l(`.${r.toLowerCase()}(body)`, 1) : l(`.${r.toLowerCase()}(null)`, 1) : l(`.${r.toLowerCase()}()`, 1) : t.text ? l(`.method("${r.toUpperCase()}", body)`, 1) : l(`.method("${r.toUpperCase()}", null)`, 1), Object.keys(o).forEach((f) => {
930
- l(`.addHeader("${f}", "${H(o[f])}")`, 1);
931
- }), l(".build()", 1), n(), l("val response = client.newCall(request).execute()"), s();
932
- }
933
- }, Mo = {
934
- info: {
935
- key: "kotlin",
936
- title: "Kotlin",
937
- default: "okhttp"
938
- },
939
- clientsById: {
940
- okhttp: Bo
941
- }
942
- }, zo = {
943
- info: {
944
- key: "axios",
945
- title: "Axios",
946
- link: "https://github.com/axios/axios",
947
- description: "Promise based HTTP client for the browser and node.js",
948
- extname: ".cjs",
949
- installation: "npm install axios --save"
950
- },
951
- convert: ({ method: t, fullUrl: e, allHeaders: r, postData: o }, i) => {
952
- const a = {
953
- indent: " ",
954
- ...i
955
- }, { blank: n, join: s, push: l, addPostProcessor: c } = new C({ indent: a.indent });
956
- l("const axios = require('axios');");
957
- const u = {
958
- method: t,
959
- url: e
960
- };
961
- switch (Object.keys(r).length && (u.headers = r), o.mimeType) {
962
- case "application/x-www-form-urlencoded":
963
- o.params && (l("const { URLSearchParams } = require('url');"), n(), l("const encodedParams = new URLSearchParams();"), o.params.forEach((p) => {
964
- l(`encodedParams.set('${p.name}', '${p.value}');`);
965
- }), n(), u.data = "encodedParams,", c((p) => p.replace(/'encodedParams,'/, "encodedParams,")));
966
- break;
967
- case "application/json":
968
- n(), o.jsonObj && (u.data = o.jsonObj);
969
- break;
970
- default:
971
- n(), o.text && (u.data = o.text);
972
- }
973
- const f = z(u, { indent: " ", inlineCharacterLimit: 80 });
974
- return l(`const options = ${f};`), n(), l("axios"), l(".request(options)", 1), l(".then(function (response) {", 1), l("console.log(response.data);", 2), l("})", 1), l(".catch(function (error) {", 1), l("console.error(error);", 2), l("});", 1), s();
975
- }
976
- }, Wo = {
977
- info: {
978
- key: "fetch",
979
- title: "Fetch",
980
- link: "https://github.com/bitinn/node-fetch",
981
- description: "Simplified HTTP node-fetch client",
982
- extname: ".cjs",
983
- installation: "npm install node-fetch@2 --save"
984
- },
985
- convert: ({ method: t, fullUrl: e, postData: r, headersObj: o, cookies: i }, a) => {
986
- var g;
987
- const n = {
988
- indent: " ",
989
- ...a
990
- };
991
- let s = !1;
992
- const { blank: l, push: c, join: u, unshift: f } = new C({ indent: n.indent });
993
- c("const fetch = require('node-fetch');");
994
- const p = e, h = {
995
- method: t
996
- };
997
- switch (Object.keys(o).length && (h.headers = o), r.mimeType) {
998
- case "application/x-www-form-urlencoded":
999
- f("const { URLSearchParams } = require('url');"), c("const encodedParams = new URLSearchParams();"), l(), (g = r.params) == null || g.forEach((x) => {
1000
- c(`encodedParams.set('${x.name}', '${x.value}');`);
1001
- }), h.body = "encodedParams";
1002
- break;
1003
- case "application/json":
1004
- r.jsonObj && (h.body = r.jsonObj);
1005
- break;
1006
- case "multipart/form-data":
1007
- if (!r.params)
1008
- break;
1009
- const b = J(o, "content-type");
1010
- b && delete o[b], f("const FormData = require('form-data');"), c("const formData = new FormData();"), l(), r.params.forEach((x) => {
1011
- if (!x.fileName && !x.fileName && !x.contentType) {
1012
- c(`formData.append('${x.name}', '${x.value}');`);
1013
- return;
1014
- }
1015
- x.fileName && (s = !0, c(`formData.append('${x.name}', fs.createReadStream('${x.fileName}'));`));
1016
- });
1017
- break;
1018
- default:
1019
- r.text && (h.body = r.text);
1020
- }
1021
- if (i.length) {
1022
- const b = i.map(({ name: x, value: m }) => `${encodeURIComponent(x)}=${encodeURIComponent(m)}`).join("; ");
1023
- h.headers || (h.headers = {}), h.headers.cookie = b;
1024
- }
1025
- l(), c(`const url = '${p}';`), h.headers && !Object.keys(h.headers).length && delete h.headers;
1026
- const y = z(h, {
1027
- indent: " ",
1028
- inlineCharacterLimit: 80,
1029
- // The Fetch API body only accepts string parameters, but stringified JSON can be difficult to
1030
- // read, so we keep the object as a literal and use this transform function to wrap the literal
1031
- // in a `JSON.stringify` call.
1032
- transform: (b, x, m) => x === "body" && r.mimeType === "application/json" ? `JSON.stringify(${m})` : m
1033
- });
1034
- return c(`const options = ${y};`), l(), s && f("const fs = require('fs');"), r.params && r.mimeType === "multipart/form-data" && (c("options.body = formData;"), l()), c("fetch(url, options)"), c(".then(res => res.json())", 1), c(".then(json => console.log(json))", 1), c(".catch(err => console.error('error:' + err));", 1), u().replace(/'encodedParams'/, "encodedParams").replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/, 'fs.createReadStream("$1")');
1035
- }
1036
- }, Jo = {
1037
- info: {
1038
- key: "native",
1039
- title: "HTTP",
1040
- link: "http://nodejs.org/api/http.html#http_http_request_options_callback",
1041
- description: "Node.js native HTTP interface",
1042
- extname: ".cjs"
1043
- },
1044
- convert: ({ uriObj: t, method: e, allHeaders: r, postData: o }, i = {}) => {
1045
- var f;
1046
- const { indent: a = " " } = i, { blank: n, join: s, push: l, unshift: c } = new C({ indent: a }), u = {
1047
- method: e,
1048
- hostname: t.hostname,
1049
- port: t.port,
1050
- path: t.path,
1051
- headers: r
1052
- };
1053
- switch (l(`const http = require('${(f = t.protocol) == null ? void 0 : f.replace(":", "")}');`), n(), l(`const options = ${z(u, { indent: a })};`), n(), l("const req = http.request(options, function (res) {"), l("const chunks = [];", 1), n(), l("res.on('data', function (chunk) {", 1), l("chunks.push(chunk);", 2), l("});", 1), n(), l("res.on('end', function () {", 1), l("const body = Buffer.concat(chunks);", 2), l("console.log(body.toString());", 2), l("});", 1), l("});"), n(), o.mimeType) {
1054
- case "application/x-www-form-urlencoded":
1055
- o.paramsObj && (c("const qs = require('querystring');"), l(
1056
- `req.write(qs.stringify(${z(o.paramsObj, {
1057
- indent: " ",
1058
- inlineCharacterLimit: 80
1059
- })}));`
1060
- ));
1061
- break;
1062
- case "application/json":
1063
- o.jsonObj && l(
1064
- `req.write(JSON.stringify(${z(o.jsonObj, {
1065
- indent: " ",
1066
- inlineCharacterLimit: 80
1067
- })}));`
1068
- );
1069
- break;
1070
- default:
1071
- o.text && l(`req.write(${z(o.text, { indent: a })});`);
1072
- }
1073
- return l("req.end();"), s();
1074
- }
1075
- }, Go = {
1076
- info: {
1077
- key: "request",
1078
- title: "Request",
1079
- link: "https://github.com/request/request",
1080
- description: "Simplified HTTP request client",
1081
- extname: ".cjs",
1082
- installation: "npm install request --save"
1083
- },
1084
- convert: ({ method: t, url: e, fullUrl: r, postData: o, headersObj: i, cookies: a }, n) => {
1085
- const s = {
1086
- indent: " ",
1087
- ...n
1088
- };
1089
- let l = !1;
1090
- const { push: c, blank: u, join: f, unshift: p, addPostProcessor: h } = new C({ indent: s.indent });
1091
- c("const request = require('request');"), u();
1092
- const y = {
1093
- method: t,
1094
- url: r
1095
- };
1096
- switch (Object.keys(i).length && (y.headers = i), o.mimeType) {
1097
- case "application/x-www-form-urlencoded":
1098
- y.form = o.paramsObj;
1099
- break;
1100
- case "application/json":
1101
- o.jsonObj && (y.body = o.jsonObj, y.json = !0);
1102
- break;
1103
- case "multipart/form-data":
1104
- if (!o.params)
1105
- break;
1106
- y.formData = {}, o.params.forEach((g) => {
1107
- if (!g.fileName && !g.fileName && !g.contentType) {
1108
- y.formData[g.name] = g.value;
1109
- return;
1110
- }
1111
- let b = {};
1112
- g.fileName ? (l = !0, b = {
1113
- value: `fs.createReadStream(${g.fileName})`,
1114
- options: {
1115
- filename: g.fileName,
1116
- contentType: g.contentType ? g.contentType : null
1117
- }
1118
- }) : g.value && (b.value = g.value), y.formData[g.name] = b;
1119
- }), h((g) => g.replace(/'fs\.createReadStream\((.*)\)'/, "fs.createReadStream('$1')"));
1120
- break;
1121
- default:
1122
- o.text && (y.body = o.text);
1123
- }
1124
- return a.length && (y.jar = "JAR", c("const jar = request.jar();"), a.forEach(({ name: g, value: b }) => {
1125
- c(`jar.setCookie(request.cookie('${encodeURIComponent(g)}=${encodeURIComponent(b)}'), '${e}');`);
1126
- }), u(), h((g) => g.replace(/'JAR'/, "jar"))), l && p("const fs = require('fs');"), c(`const options = ${z(y, { indent: " ", inlineCharacterLimit: 80 })};`), u(), c("request(options, function (error, response, body) {"), c("if (error) throw new Error(error);", 1), u(), c("console.log(body);", 1), c("});"), f();
1127
- }
1128
- }, Vo = {
1129
- info: {
1130
- key: "unirest",
1131
- title: "Unirest",
1132
- link: "http://unirest.io/nodejs.html",
1133
- description: "Lightweight HTTP Request Client Library",
1134
- extname: ".cjs"
1135
- },
1136
- convert: ({ method: t, url: e, cookies: r, queryObj: o, postData: i, headersObj: a }, n) => {
1137
- const s = {
1138
- indent: " ",
1139
- ...n
1140
- };
1141
- let l = !1;
1142
- const { addPostProcessor: c, blank: u, join: f, push: p, unshift: h } = new C({
1143
- indent: s.indent
1144
- });
1145
- switch (p("const unirest = require('unirest');"), u(), p(`const req = unirest('${t}', '${e}');`), u(), r.length && (p("const CookieJar = unirest.jar();"), r.forEach((y) => {
1146
- p(`CookieJar.add('${encodeURIComponent(y.name)}=${encodeURIComponent(y.value)}', '${e}');`);
1147
- }), p("req.jar(CookieJar);"), u()), Object.keys(o).length && (p(`req.query(${z(o, { indent: s.indent })});`), u()), Object.keys(a).length && (p(`req.headers(${z(a, { indent: s.indent })});`), u()), i.mimeType) {
1148
- case "application/x-www-form-urlencoded":
1149
- i.paramsObj && (p(`req.form(${z(i.paramsObj, { indent: s.indent })});`), u());
1150
- break;
1151
- case "application/json":
1152
- i.jsonObj && (p("req.type('json');"), p(`req.send(${z(i.jsonObj, { indent: s.indent })});`), u());
1153
- break;
1154
- case "multipart/form-data": {
1155
- if (!i.params)
1156
- break;
1157
- const y = [];
1158
- i.params.forEach((g) => {
1159
- const b = {};
1160
- g.fileName && !g.value ? (l = !0, b.body = `fs.createReadStream('${g.fileName}')`, c((x) => x.replace(/'fs\.createReadStream\(\\'(.+)\\'\)'/, "fs.createReadStream('$1')"))) : g.value && (b.body = g.value), b.body && (g.contentType && (b["content-type"] = g.contentType), y.push(b));
1161
- }), p(`req.multipart(${z(y, { indent: s.indent })});`), u();
1162
- break;
1163
- }
1164
- default:
1165
- i.text && (p(`req.send(${z(i.text, { indent: s.indent })});`), u());
1166
- }
1167
- return l && h("const fs = require('fs');"), p("req.end(function (res) {"), p("if (res.error) throw new Error(res.error);", 1), u(), p("console.log(res.body);", 1), p("});"), f();
1168
- }
1169
- }, Qo = {
1170
- info: {
1171
- key: "node",
1172
- title: "Node.js",
1173
- default: "native",
1174
- cli: "node %s"
1175
- },
1176
- clientsById: {
1177
- native: Jo,
1178
- request: Go,
1179
- unirest: Vo,
1180
- axios: zo,
1181
- fetch: Wo
1182
- }
1183
- }, ht = (t, e, r, o) => {
1184
- const i = `${t} *${e} = `, a = Pt(r, o ? i.length : void 0);
1185
- return `${i}${a};`;
1186
- }, Pt = (t, e) => {
1187
- const r = e === void 0 ? ", " : `,
1188
- ${" ".repeat(e)}`;
1189
- switch (Object.prototype.toString.call(t)) {
1190
- case "[object Number]":
1191
- return `@${t}`;
1192
- case "[object Array]":
1193
- return `@[ ${t.map((i) => Pt(i)).join(r)} ]`;
1194
- case "[object Object]": {
1195
- const o = [];
1196
- return Object.keys(t).forEach((i) => {
1197
- o.push(`@"${i}": ${Pt(t[i])}`);
1198
- }), `@{ ${o.join(r)} }`;
1199
- }
1200
- case "[object Boolean]":
1201
- return t ? "@YES" : "@NO";
1202
- default:
1203
- return t == null ? "" : `@"${t.toString().replace(/"/g, '\\"')}"`;
1204
- }
1205
- }, Ko = {
1206
- info: {
1207
- key: "nsurlsession",
1208
- title: "NSURLSession",
1209
- link: "https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",
1210
- description: "Foundation's NSURLSession request",
1211
- extname: ".m"
1212
- },
1213
- convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o }, i) => {
1214
- var u;
1215
- const a = {
1216
- indent: " ",
1217
- pretty: !0,
1218
- timeout: 10,
1219
- ...i
1220
- }, { push: n, join: s, blank: l } = new C({ indent: a.indent }), c = {
1221
- hasHeaders: !1,
1222
- hasBody: !1
1223
- };
1224
- if (n("#import <Foundation/Foundation.h>"), Object.keys(t).length && (c.hasHeaders = !0, l(), n(ht("NSDictionary", "headers", t, a.pretty))), e.text || e.jsonObj || e.params)
1225
- switch (c.hasBody = !0, e.mimeType) {
1226
- case "application/x-www-form-urlencoded":
1227
- if ((u = e.params) != null && u.length) {
1228
- l();
1229
- const [f, ...p] = e.params;
1230
- n(
1231
- `NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${f.name}=${f.value}" dataUsingEncoding:NSUTF8StringEncoding]];`
1232
- ), p.forEach(({ name: h, value: y }) => {
1233
- n(`[postData appendData:[@"&${h}=${y}" dataUsingEncoding:NSUTF8StringEncoding]];`);
1234
- });
1235
- } else
1236
- c.hasBody = !1;
1237
- break;
1238
- case "application/json":
1239
- e.jsonObj && (n(ht("NSDictionary", "parameters", e.jsonObj, a.pretty)), l(), n("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));
1240
- break;
1241
- case "multipart/form-data":
1242
- n(ht("NSArray", "parameters", e.params || [], a.pretty)), n(`NSString *boundary = @"${e.boundary}";`), l(), n("NSError *error;"), n("NSMutableString *body = [NSMutableString string];"), n("for (NSDictionary *param in parameters) {"), n('[body appendFormat:@"--%@\\r\\n", boundary];', 1), n('if (param[@"fileName"]) {', 1), n(
1243
- '[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',
1244
- 2
1245
- ), n('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];', 2), n(
1246
- '[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];',
1247
- 2
1248
- ), n("if (error) {", 2), n('NSLog(@"%@", error);', 3), n("}", 2), n("} else {", 1), n('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];', 2), n('[body appendFormat:@"%@", param[@"value"]];', 2), n("}", 1), n("}"), n('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'), n("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");
1249
- break;
1250
- default:
1251
- l(), n(
1252
- `NSData *postData = [[NSData alloc] initWithData:[@"${e.text}" dataUsingEncoding:NSUTF8StringEncoding]];`
1253
- );
1254
- }
1255
- return l(), n(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${o}"]`), n(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), n(` timeoutInterval:${a.timeout.toFixed(1)}];`), n(`[request setHTTPMethod:@"${r}"];`), c.hasHeaders && n("[request setAllHTTPHeaderFields:headers];"), c.hasBody && n("[request setHTTPBody:postData];"), l(), n("NSURLSession *session = [NSURLSession sharedSession];"), n("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"), n(
1256
- " completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"
1257
- ), n(" if (error) {", 1), n(' NSLog(@"%@", error);', 2), n(" } else {", 1), n(
1258
- " NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",
1259
- 2
1260
- ), n(' NSLog(@"%@", httpResponse);', 2), n(" }", 1), n(" }];"), n("[dataTask resume];"), s();
1261
- }
1262
- }, Do = {
1263
- info: {
1264
- key: "objc",
1265
- title: "Objective-C",
1266
- default: "nsurlsession"
1267
- },
1268
- clientsById: {
1269
- nsurlsession: Ko
1270
- }
1271
- }, Yo = {
1272
- info: {
1273
- key: "cohttp",
1274
- title: "CoHTTP",
1275
- link: "https://github.com/mirage/ocaml-cohttp",
1276
- description: "Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",
1277
- extname: ".ml",
1278
- installation: "opam install cohttp-lwt-unix cohttp-async"
1279
- },
1280
- convert: ({ fullUrl: t, allHeaders: e, postData: r, method: o }, i) => {
1281
- const a = {
1282
- indent: " ",
1283
- ...i
1284
- }, n = ["get", "post", "head", "delete", "patch", "put", "options"], { push: s, blank: l, join: c } = new C({ indent: a.indent });
1285
- s("open Cohttp_lwt_unix"), s("open Cohttp"), s("open Lwt"), l(), s(`let uri = Uri.of_string "${t}" in`);
1286
- const u = Object.keys(e);
1287
- u.length === 1 ? s(
1288
- `let headers = Header.add (Header.init ()) "${u[0]}" "${H(
1289
- e[u[0]]
1290
- )}" in`
1291
- ) : u.length > 1 && (s("let headers = Header.add_list (Header.init ()) ["), u.forEach((y) => {
1292
- s(`("${y}", "${H(e[y])}");`, 1);
1293
- }), s("] in")), r.text && s(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(r.text)} in`), l();
1294
- const f = u.length ? "~headers " : "", p = r.text ? "~body " : "", h = n.includes(o.toLowerCase()) ? `\`${o.toUpperCase()}` : `(Code.method_of_string "${o}")`;
1295
- return s(`Client.call ${f}${p}${h} uri`), s(">>= fun (res, body_stream) ->"), s("(* Do stuff with the result *)", 1), c();
1296
- }
1297
- }, Xo = {
1298
- info: {
1299
- key: "ocaml",
1300
- title: "OCaml",
1301
- default: "cohttp"
1302
- },
1303
- clientsById: {
1304
- cohttp: Yo
1305
- }
1306
- }, N = (t, e, r) => {
1307
- switch (r = r || "", e = e || "", Object.prototype.toString.call(t)) {
1308
- case "[object Boolean]":
1309
- return t;
1310
- case "[object Null]":
1311
- return "null";
1312
- case "[object Undefined]":
1313
- return "null";
1314
- case "[object String]":
1315
- return `'${We(t, { delimiter: "'", escapeNewlines: !1 })}'`;
1316
- case "[object Number]":
1317
- return t.toString();
1318
- case "[object Array]": {
1319
- const o = t.map((i) => N(i, `${e}${e}`, e)).join(`,
1320
- ${e}`);
1321
- return `[
1322
- ${e}${o}
1323
- ${r}]`;
1324
- }
1325
- case "[object Object]": {
1326
- const o = [];
1327
- for (const i in t)
1328
- Object.prototype.hasOwnProperty.call(t, i) && o.push(`${N(i, e)} => ${N(t[i], `${e}${e}`, e)}`);
1329
- return `[
1330
- ${e}${o.join(`,
1331
- ${e}`)}
1332
- ${r}]`;
1333
- }
1334
- default:
1335
- return "null";
1336
- }
1337
- }, fr = [
1338
- "ACL",
1339
- "BASELINE_CONTROL",
1340
- "CHECKIN",
1341
- "CHECKOUT",
1342
- "CONNECT",
1343
- "COPY",
1344
- "DELETE",
1345
- "GET",
1346
- "HEAD",
1347
- "LABEL",
1348
- "LOCK",
1349
- "MERGE",
1350
- "MKACTIVITY",
1351
- "MKCOL",
1352
- "MKWORKSPACE",
1353
- "MOVE",
1354
- "OPTIONS",
1355
- "POST",
1356
- "PROPFIND",
1357
- "PROPPATCH",
1358
- "PUT",
1359
- "REPORT",
1360
- "TRACE",
1361
- "UNCHECKOUT",
1362
- "UNLOCK",
1363
- "UPDATE",
1364
- "VERSION_CONTROL"
1365
- ], Zo = {
1366
- info: {
1367
- key: "curl",
1368
- title: "cURL",
1369
- link: "http://php.net/manual/en/book.curl.php",
1370
- description: "PHP with ext-curl",
1371
- extname: ".php"
1372
- },
1373
- convert: ({ uriObj: t, postData: e, fullUrl: r, method: o, httpVersion: i, cookies: a, headersObj: n }, s = {}) => {
1374
- const {
1375
- closingTag: l = !1,
1376
- indent: c = " ",
1377
- maxRedirects: u = 10,
1378
- namedErrors: f = !1,
1379
- noTags: p = !1,
1380
- shortTags: h = !1,
1381
- timeout: y = 30
1382
- } = s, { push: g, blank: b, join: x } = new C({ indent: c });
1383
- p || (g(h ? "<?" : "<?php"), b()), g("$curl = curl_init();"), b();
1384
- const m = [
1385
- {
1386
- escape: !0,
1387
- name: "CURLOPT_PORT",
1388
- value: t.port
1389
- },
1390
- {
1391
- escape: !0,
1392
- name: "CURLOPT_URL",
1393
- value: r
1394
- },
1395
- {
1396
- escape: !1,
1397
- name: "CURLOPT_RETURNTRANSFER",
1398
- value: "true"
1399
- },
1400
- {
1401
- escape: !0,
1402
- name: "CURLOPT_ENCODING",
1403
- value: ""
1404
- },
1405
- {
1406
- escape: !1,
1407
- name: "CURLOPT_MAXREDIRS",
1408
- value: u
1409
- },
1410
- {
1411
- escape: !1,
1412
- name: "CURLOPT_TIMEOUT",
1413
- value: y
1414
- },
1415
- {
1416
- escape: !1,
1417
- name: "CURLOPT_HTTP_VERSION",
1418
- value: i === "HTTP/1.0" ? "CURL_HTTP_VERSION_1_0" : "CURL_HTTP_VERSION_1_1"
1419
- },
1420
- {
1421
- escape: !0,
1422
- name: "CURLOPT_CUSTOMREQUEST",
1423
- value: o
1424
- },
1425
- {
1426
- escape: !e.jsonObj,
1427
- name: "CURLOPT_POSTFIELDS",
1428
- value: e ? e.jsonObj ? `json_encode(${N(e.jsonObj, c.repeat(2), c)})` : e.text : void 0
1429
- }
1430
- ];
1431
- g("curl_setopt_array($curl, [");
1432
- const v = new C({ indent: c, join: `
1433
- ${c}` });
1434
- m.forEach(({ value: S, name: k, escape: E }) => {
1435
- S != null && v.push(`${k} => ${E ? JSON.stringify(S) : S},`);
1436
- });
1437
- const j = a.map((S) => `${encodeURIComponent(S.name)}=${encodeURIComponent(S.value)}`);
1438
- j.length && v.push(`CURLOPT_COOKIE => "${j.join("; ")}",`);
1439
- const w = Object.keys(n).sort().map((S) => `"${S}: ${H(n[S])}"`);
1440
- return w.length && (v.push("CURLOPT_HTTPHEADER => ["), v.push(w.join(`,
1441
- ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = curl_exec($curl);"), g("$err = curl_error($curl);"), b(), g("curl_close($curl);"), b(), g("if ($err) {"), g(f ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), g("} else {"), g("echo $response;", 1), g("}"), !p && l && (b(), g("?>")), x();
1442
- }
1443
- }, ea = {
1444
- info: {
1445
- key: "guzzle",
1446
- title: "Guzzle",
1447
- link: "http://docs.guzzlephp.org/en/stable/",
1448
- description: "PHP with Guzzle",
1449
- extname: ".php",
1450
- installation: "composer require guzzlehttp/guzzle"
1451
- },
1452
- convert: ({ postData: t, fullUrl: e, method: r, cookies: o, headersObj: i }, a) => {
1453
- var g;
1454
- const n = {
1455
- closingTag: !1,
1456
- indent: " ",
1457
- noTags: !1,
1458
- shortTags: !1,
1459
- ...a
1460
- }, { push: s, blank: l, join: c } = new C({ indent: n.indent }), { code: u, push: f, join: p } = new C({ indent: n.indent });
1461
- switch (n.noTags || s(n.shortTags ? "<?" : "<?php"), s("require_once('vendor/autoload.php');"), l(), t.mimeType) {
1462
- case "application/x-www-form-urlencoded":
1463
- f(`'form_params' => ${N(t.paramsObj, n.indent + n.indent, n.indent)},`, 1);
1464
- break;
1465
- case "multipart/form-data": {
1466
- const b = [];
1467
- if (t.params && t.params.forEach((x) => {
1468
- if (x.fileName) {
1469
- const m = {
1470
- name: x.name,
1471
- filename: x.fileName,
1472
- contents: x.value
1473
- };
1474
- x.contentType && (m.headers = { "Content-Type": x.contentType }), b.push(m);
1475
- } else x.value && b.push({
1476
- name: x.name,
1477
- contents: x.value
1478
- });
1479
- }), b.length && (f(`'multipart' => ${N(b, n.indent + n.indent, n.indent)}`, 1), pt(i, "content-type") && (g = ue(i, "content-type")) != null && g.indexOf("boundary"))) {
1480
- const x = J(i, "content-type");
1481
- x && delete i[x];
1482
- }
1483
- break;
1484
- }
1485
- default:
1486
- t.text && f(`'body' => ${N(t.text)},`, 1);
1487
- }
1488
- const h = Object.keys(i).sort().map(function(b) {
1489
- return `${n.indent}${n.indent}'${b}' => '${Je(i[b])}',`;
1490
- }), y = o.map((b) => `${encodeURIComponent(b.name)}=${encodeURIComponent(b.value)}`).join("; ");
1491
- return y.length && h.push(`${n.indent}${n.indent}'cookie' => '${Je(y)}',`), h.length && (f("'headers' => [", 1), f(h.join(`
1492
- `)), f("],", 1)), s("$client = new \\GuzzleHttp\\Client();"), l(), u.length ? (s(`$response = $client->request('${r}', '${e}', [`), s(p()), s("]);")) : s(`$response = $client->request('${r}', '${e}');`), l(), s("echo $response->getBody();"), !n.noTags && n.closingTag && (l(), s("?>")), c();
1493
- }
1494
- }, ta = {
1495
- info: {
1496
- key: "http1",
1497
- title: "HTTP v1",
1498
- link: "http://php.net/manual/en/book.http.php",
1499
- description: "PHP with pecl/http v1",
1500
- extname: ".php"
1501
- },
1502
- convert: ({ method: t, url: e, postData: r, queryObj: o, headersObj: i, cookiesObj: a }, n = {}) => {
1503
- const { closingTag: s = !1, indent: l = " ", noTags: c = !1, shortTags: u = !1 } = n, { push: f, blank: p, join: h } = new C({ indent: l });
1504
- switch (c || (f(u ? "<?" : "<?php"), p()), fr.includes(t.toUpperCase()) || f(`HttpRequest::methodRegister('${t}');`), f("$request = new HttpRequest();"), f(`$request->setUrl(${N(e)});`), fr.includes(t.toUpperCase()) ? f(`$request->setMethod(HTTP_METH_${t.toUpperCase()});`) : f(`$request->setMethod(HttpRequest::HTTP_METH_${t.toUpperCase()});`), p(), Object.keys(o).length && (f(`$request->setQueryData(${N(o, l)});`), p()), Object.keys(i).length && (f(`$request->setHeaders(${N(i, l)});`), p()), Object.keys(a).length && (f(`$request->setCookies(${N(a, l)});`), p()), r.mimeType) {
1505
- case "application/x-www-form-urlencoded":
1506
- f(`$request->setContentType(${N(r.mimeType)});`), f(`$request->setPostFields(${N(r.paramsObj, l)});`), p();
1507
- break;
1508
- case "application/json":
1509
- f(`$request->setContentType(${N(r.mimeType)});`), f(`$request->setBody(json_encode(${N(r.jsonObj, l)}));`), p();
1510
- break;
1511
- default:
1512
- r.text && (f(`$request->setBody(${N(r.text)});`), p());
1513
- }
1514
- return f("try {"), f("$response = $request->send();", 1), p(), f("echo $response->getBody();", 1), f("} catch (HttpException $ex) {"), f("echo $ex;", 1), f("}"), !c && s && (p(), f("?>")), h();
1515
- }
1516
- }, ra = {
1517
- info: {
1518
- key: "http2",
1519
- title: "HTTP v2",
1520
- link: "http://devel-m6w6.rhcloud.com/mdref/http",
1521
- description: "PHP with pecl/http v2",
1522
- extname: ".php"
1523
- },
1524
- convert: ({ postData: t, headersObj: e, method: r, queryObj: o, cookiesObj: i, url: a }, n = {}) => {
1525
- var g;
1526
- const { closingTag: s = !1, indent: l = " ", noTags: c = !1, shortTags: u = !1 } = n, { push: f, blank: p, join: h } = new C({ indent: l });
1527
- let y = !1;
1528
- switch (c || (f(u ? "<?" : "<?php"), p()), f("$client = new http\\Client;"), f("$request = new http\\Client\\Request;"), p(), t.mimeType) {
1529
- case "application/x-www-form-urlencoded":
1530
- f("$body = new http\\Message\\Body;"), f(`$body->append(new http\\QueryString(${N(t.paramsObj, l)}));`), p(), y = !0;
1531
- break;
1532
- case "multipart/form-data": {
1533
- if (!t.params)
1534
- break;
1535
- const b = [], x = {};
1536
- t.params.forEach(({ name: j, fileName: w, value: S, contentType: k }) => {
1537
- if (w) {
1538
- b.push({
1539
- name: j,
1540
- type: k,
1541
- file: w,
1542
- data: S
1543
- });
1544
- return;
1545
- }
1546
- S && (x[j] = S);
1547
- });
1548
- const m = Object.keys(x).length ? N(x, l) : "null", v = b.length ? N(b, l) : "null";
1549
- if (f("$body = new http\\Message\\Body;"), f(`$body->addForm(${m}, ${v});`), pt(e, "content-type") && (g = ue(e, "content-type")) != null && g.indexOf("boundary")) {
1550
- const j = J(e, "content-type");
1551
- j && delete e[j];
1552
- }
1553
- p(), y = !0;
1554
- break;
1555
- }
1556
- case "application/json":
1557
- f("$body = new http\\Message\\Body;"), f(`$body->append(json_encode(${N(t.jsonObj, l)}));`), y = !0;
1558
- break;
1559
- default:
1560
- t.text && (f("$body = new http\\Message\\Body;"), f(`$body->append(${N(t.text)});`), p(), y = !0);
1561
- }
1562
- return f(`$request->setRequestUrl(${N(a)});`), f(`$request->setRequestMethod(${N(r)});`), y && (f("$request->setBody($body);"), p()), Object.keys(o).length && (f(`$request->setQuery(new http\\QueryString(${N(o, l)}));`), p()), Object.keys(e).length && (f(`$request->setHeaders(${N(e, l)});`), p()), Object.keys(i).length && (p(), f(`$client->setCookies(${N(i, l)});`), p()), f("$client->enqueue($request)->send();"), f("$response = $client->getResponse();"), p(), f("echo $response->getBody();"), !c && s && (p(), f("?>")), h();
1563
- }
1564
- }, na = {
1565
- info: {
1566
- key: "php",
1567
- title: "PHP",
1568
- default: "curl",
1569
- cli: "php %s"
1570
- },
1571
- clientsById: {
1572
- curl: Zo,
1573
- guzzle: ea,
1574
- http1: ta,
1575
- http2: ra
1576
- }
1577
- }, tn = (t) => ({ method: r, headersObj: o, cookies: i, uriObj: a, fullUrl: n, postData: s, allHeaders: l }) => {
1578
- const { push: c, join: u } = new C();
1579
- if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(r.toUpperCase()))
1580
- return "Method not supported";
1581
- const p = [], h = Object.keys(o);
1582
- return h.length && (c("$headers=@{}"), h.forEach((y) => {
1583
- y !== "connection" && c(`$headers.Add("${y}", "${We(o[y], { escapeChar: "`" })}")`);
1584
- }), p.push("-Headers $headers")), i.length && (c("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), i.forEach((y) => {
1585
- c("$cookie = New-Object System.Net.Cookie"), c(`$cookie.Name = '${y.name}'`), c(`$cookie.Value = '${y.value}'`), c(`$cookie.Domain = '${a.host}'`), c("$session.Cookies.Add($cookie)");
1586
- }), p.push("-WebSession $session")), s.text && (p.push(
1587
- `-ContentType '${We(ue(l, "content-type"), { delimiter: "'", escapeChar: "`" })}'`
1588
- ), p.push(`-Body '${s.text}'`)), c(`$response = ${t} -Uri '${n}' -Method ${r} ${p.join(" ")}`.trim()), u();
1589
- }, oa = {
1590
- info: {
1591
- key: "restmethod",
1592
- title: "Invoke-RestMethod",
1593
- link: "https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",
1594
- description: "Powershell Invoke-RestMethod client",
1595
- extname: ".ps1"
1596
- },
1597
- convert: tn("Invoke-RestMethod")
1598
- }, aa = {
1599
- info: {
1600
- key: "webrequest",
1601
- title: "Invoke-WebRequest",
1602
- link: "https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",
1603
- description: "Powershell Invoke-WebRequest client",
1604
- extname: ".ps1"
1605
- },
1606
- convert: tn("Invoke-WebRequest")
1607
- }, ia = {
1608
- info: {
1609
- key: "powershell",
1610
- title: "Powershell",
1611
- default: "webrequest"
1612
- },
1613
- clientsById: {
1614
- webrequest: aa,
1615
- restmethod: oa
1616
- }
1617
- };
1618
- function dr(t, e, r, o, i) {
1619
- const a = o.repeat(i), n = o.repeat(i - 1), s = r ? `,
1620
- ${a}` : ", ", l = t === "object" ? "{" : "[", c = t === "object" ? "}" : "]";
1621
- return r ? `${l}
1622
- ${a}${e.join(s)}
1623
- ${n}${c}` : t === "object" && e.length > 0 ? `${l} ${e.join(s)} ${c}` : `${l}${e.join(s)}${c}`;
1624
- }
1625
- var ke = (t, e, r) => {
1626
- switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
1627
- case "[object Number]":
1628
- return t;
1629
- case "[object Array]": {
1630
- let o = !1;
1631
- const i = t.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (o = Object.keys(a).length > 1), ke(a, e, r)));
1632
- return dr("array", i, o, e.indent, r);
1633
- }
1634
- case "[object Object]": {
1635
- const o = [];
1636
- for (const i in t)
1637
- o.push(`"${i}": ${ke(t[i], e, r)}`);
1638
- return dr("object", o, e.pretty && o.length > 1, e.indent, r);
1639
- }
1640
- case "[object Null]":
1641
- return "None";
1642
- case "[object Boolean]":
1643
- return t ? "True" : "False";
1644
- default:
1645
- return t == null ? "" : `"${t.toString().replace(/"/g, '\\"')}"`;
1646
- }
1647
- }, sa = ["HEAD", "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], la = {
1648
- info: {
1649
- key: "requests",
1650
- title: "Requests",
1651
- link: "http://docs.python-requests.org/en/latest/api/#requests.request",
1652
- description: "Requests HTTP library",
1653
- extname: ".py",
1654
- installation: "python -m pip install requests"
1655
- },
1656
- convert: ({ fullUrl: t, postData: e, allHeaders: r, method: o }, i) => {
1657
- const a = {
1658
- indent: " ",
1659
- pretty: !0,
1660
- ...i
1661
- }, { push: n, blank: s, join: l, addPostProcessor: c } = new C({ indent: a.indent });
1662
- n("import requests"), s(), n(`url = "${t}"`), s();
1663
- const u = r;
1664
- let f = {};
1665
- const p = {};
1666
- let h = !1, y = !1, g = !1;
1667
- switch (e.mimeType) {
1668
- case "application/json":
1669
- e.jsonObj && (n(`payload = ${ke(e.jsonObj, a)}`), g = !0, y = !0);
1670
- break;
1671
- case "multipart/form-data":
1672
- if (!e.params)
1673
- break;
1674
- if (f = {}, e.params.forEach((m) => {
1675
- m.fileName ? (m.contentType ? p[m.name] = `('${m.fileName}', open('${m.fileName}', 'rb'), '${m.contentType}')` : p[m.name] = `('${m.fileName}', open('${m.fileName}', 'rb'))`, h = !0) : (f[m.name] = m.value, y = !0);
1676
- }), h) {
1677
- n(`files = ${ke(p, a)}`), y && n(`payload = ${ke(f, a)}`);
1678
- const m = J(u, "content-type");
1679
- m && delete u[m];
1680
- } else {
1681
- const m = JSON.stringify(e.text);
1682
- m && (n(`payload = ${m}`), y = !0);
1683
- }
1684
- c(
1685
- (m) => m.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g, '("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g, '("$1", open("$2", "rb"), "$3")')
1686
- );
1687
- break;
1688
- default: {
1689
- if (e.mimeType === "application/x-www-form-urlencoded" && e.paramsObj) {
1690
- n(`payload = ${ke(e.paramsObj, a)}`), y = !0;
1691
- break;
1692
- }
1693
- const m = JSON.stringify(e.text);
1694
- m && (n(`payload = ${m}`), y = !0);
1695
- }
1696
- }
1697
- const b = Object.keys(u).length;
1698
- if (b === 0 && (y || h))
1699
- s();
1700
- else if (b === 1)
1701
- Object.keys(u).forEach((m) => {
1702
- n(`headers = {"${m}": "${H(u[m])}"}`), s();
1703
- });
1704
- else if (b > 1) {
1705
- let m = 1;
1706
- n("headers = {"), Object.keys(u).forEach((v) => {
1707
- n(m !== b ? `"${v}": "${H(u[v])}",` : `"${v}": "${H(u[v])}"`, 1), m += 1;
1708
- }), n("}"), s();
1709
- }
1710
- let x = sa.includes(o) ? `response = requests.${o.toLowerCase()}(url` : `response = requests.request("${o}", url`;
1711
- return y && (g ? x += ", json=payload" : x += ", data=payload"), h && (x += ", files=files"), b > 0 && (x += ", headers=headers"), x += ")", n(x), s(), n("print(response.text)"), l();
1712
- }
1713
- }, ca = {
1714
- info: {
1715
- key: "python",
1716
- title: "Python",
1717
- default: "requests",
1718
- cli: "python3 %s"
1719
- },
1720
- clientsById: {
1721
- requests: la
1722
- }
1723
- }, ua = {
1724
- info: {
1725
- key: "httr",
1726
- title: "httr",
1727
- link: "https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html",
1728
- description: "httr: Tools for Working with URLs and HTTP",
1729
- extname: ".r"
1730
- },
1731
- convert: ({ url: t, queryObj: e, queryString: r, postData: o, allHeaders: i, method: a }) => {
1732
- const { push: n, blank: s, join: l } = new C();
1733
- n("library(httr)"), s(), n(`url <- "${t}"`), s();
1734
- const c = e;
1735
- delete e.key;
1736
- const u = Object.keys(c).length;
1737
- r.length === 1 ? (n(`queryString <- list(${Object.keys(c)} = "${Object.values(c).toString()}")`), s()) : r.length > 1 && (n("queryString <- list("), Object.keys(c).forEach((w, S) => {
1738
- S !== u - 1 ? n(` ${w} = "${c[w].toString()}",`) : n(` ${w} = "${c[w].toString()}"`);
1739
- }), n(")"), s());
1740
- const f = JSON.stringify(o.text);
1741
- if (f && (n(`payload <- ${f}`), s()), o.text || o.jsonObj || o.params)
1742
- switch (o.mimeType) {
1743
- case "application/x-www-form-urlencoded":
1744
- n('encode <- "form"'), s();
1745
- break;
1746
- case "application/json":
1747
- n('encode <- "json"'), s();
1748
- break;
1749
- case "multipart/form-data":
1750
- n('encode <- "multipart"'), s();
1751
- break;
1752
- default:
1753
- n('encode <- "raw"'), s();
1754
- break;
1755
- }
1756
- const p = ue(i, "cookie"), h = ue(i, "accept"), y = p ? `set_cookies(\`${String(p).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, g = h ? `accept("${H(h)}")` : void 0, b = `content_type("${H(o.mimeType)}")`, x = Object.entries(i).filter(([w]) => !["cookie", "accept", "content-type"].includes(w.toLowerCase())).map(([w, S]) => `'${w}' = '${Je(S)}'`).join(", "), m = x ? `add_headers(${x})` : void 0;
1757
- let v = `response <- VERB("${a}", url`;
1758
- f && (v += ", body = payload"), r.length && (v += ", query = queryString");
1759
- const j = [m, b, g, y].filter((w) => !!w).join(", ");
1760
- return j && (v += `, ${j}`), (o.text || o.jsonObj || o.params) && (v += ", encode = encode"), v += ")", n(v), s(), n('content(response, "text")'), l();
1761
- }
1762
- }, pa = {
1763
- info: {
1764
- key: "r",
1765
- title: "R",
1766
- default: "httr"
1767
- },
1768
- clientsById: {
1769
- httr: ua
1770
- }
1771
- }, fa = {
1772
- info: {
1773
- key: "native",
1774
- title: "net::http",
1775
- link: "http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html",
1776
- description: "Ruby HTTP client",
1777
- extname: ".rb"
1778
- },
1779
- convert: ({ uriObj: t, method: e, fullUrl: r, postData: o, allHeaders: i }) => {
1780
- const { push: a, blank: n, join: s } = new C();
1781
- a("require 'uri'"), a("require 'net/http'"), n();
1782
- const l = e.toUpperCase(), c = [
1783
- "GET",
1784
- "POST",
1785
- "HEAD",
1786
- "DELETE",
1787
- "PATCH",
1788
- "PUT",
1789
- "OPTIONS",
1790
- "COPY",
1791
- "LOCK",
1792
- "UNLOCK",
1793
- "MOVE",
1794
- "TRACE"
1795
- ], u = l.charAt(0) + l.substring(1).toLowerCase();
1796
- c.includes(l) || (a(`class Net::HTTP::${u} < Net::HTTPRequest`), a(` METHOD = '${l.toUpperCase()}'`), a(` REQUEST_HAS_BODY = '${o.text ? "true" : "false"}'`), a(" RESPONSE_HAS_BODY = true"), a("end"), n()), a(`url = URI("${r}")`), n(), a("http = Net::HTTP.new(url.host, url.port)"), t.protocol === "https:" && a("http.use_ssl = true"), n(), a(`request = Net::HTTP::${u}.new(url)`);
1797
- const f = Object.keys(i);
1798
- return f.length && f.forEach((p) => {
1799
- a(`request["${p}"] = '${Je(i[p])}'`);
1800
- }), o.text && a(`request.body = ${JSON.stringify(o.text)}`), n(), a("response = http.request(request)"), a("puts response.read_body"), s();
1801
- }
1802
- }, da = {
1803
- info: {
1804
- key: "ruby",
1805
- title: "Ruby",
1806
- default: "native"
1807
- },
1808
- clientsById: {
1809
- native: fa
1810
- }
1811
- }, M = (t = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(t) ? t : `'${t.replace(/'/g, "'\\''")}'`, ha = (t) => t.replace(/\r/g, "\\r").replace(/\n/g, "\\n"), ya = {
1812
- "http1.0": "0",
1813
- "url ": "",
1814
- cookie: "b",
1815
- data: "d",
1816
- form: "F",
1817
- globoff: "g",
1818
- header: "H",
1819
- insecure: "k",
1820
- request: "X"
1821
- }, ma = (t) => (e) => {
1822
- if (t) {
1823
- const r = ya[e];
1824
- return r ? `-${r}` : "";
1825
- }
1826
- return `--${e}`;
1827
- }, ga = {
1828
- info: {
1829
- key: "curl",
1830
- title: "cURL",
1831
- link: "http://curl.haxx.se/",
1832
- description: "cURL is a command line tool and library for transferring data with URL syntax",
1833
- extname: ".sh"
1834
- },
1835
- convert: ({ fullUrl: t, method: e, httpVersion: r, headersObj: o, allHeaders: i, postData: a }, n = {}) => {
1836
- var b;
1837
- const { indent: s = " ", short: l = !1, binary: c = !1, globOff: u = !1 } = n, f = " ", { push: p, join: h } = new C({
1838
- ...typeof s == "string" ? { indent: s } : {},
1839
- join: s !== !1 ? ` \\
1840
- ${s}` : " "
1841
- }), y = ma(l);
1842
- let g = M(t);
1843
- if (p(`curl ${y("request")} ${e}`), u && (g = unescape(g), p(y("globoff"))), p(`${y("url ")}${g}`), r === "HTTP/1.0" && p(y("http1.0")), ue(i, "accept-encoding") && p("--compressed"), a.mimeType === "multipart/form-data") {
1844
- const x = J(o, "content-type");
1845
- if (x) {
1846
- const m = o[x];
1847
- if (x && m) {
1848
- const v = String(m).replace(/; boundary.+?(?=(;|$))/, "");
1849
- o[x] = v, i[x] = v;
1850
- }
1851
- }
1852
- }
1853
- switch (Object.keys(o).sort().forEach((x) => {
1854
- const m = `${x}: ${o[x]}`;
1855
- p(`${y("header")} ${M(m)}`);
1856
- }), i.cookie && p(`${y("cookie")} ${M(i.cookie)}`), a.mimeType) {
1857
- case "multipart/form-data":
1858
- (b = a.params) == null || b.forEach((m) => {
1859
- let v = "";
1860
- m.fileName ? v = `${m.name}='@${m.fileName}'` : v = M(`${m.name}=${m.value}`), p(`${y("form")} ${v}`);
1861
- });
1862
- break;
1863
- case "application/x-www-form-urlencoded":
1864
- a.params ? a.params.forEach((m) => {
1865
- const v = m.name, j = encodeURIComponent(m.name), w = j !== v, S = w ? j : v, k = c ? "--data-binary" : w ? "--data-urlencode" : y("data");
1866
- p(`${k} ${M(`${S}=${m.value}`)}`);
1867
- }) : p(`${c ? "--data-binary" : y("data")} ${M(a.text)}`);
1868
- break;
1869
- default:
1870
- if (!a.text)
1871
- break;
1872
- let x = !1;
1873
- if (mo(a.mimeType) && a.text.length > 20)
1874
- try {
1875
- const m = JSON.parse(a.text);
1876
- x = !0, a.text.indexOf("'") > 0 ? p(
1877
- `${c ? "--data-binary" : y("data")} @- <<EOF
1878
- ${JSON.stringify(
1879
- m,
1880
- null,
1881
- f
1882
- )}
1883
- EOF`
1884
- ) : p(
1885
- `${c ? "--data-binary" : y("data")} '
1886
- ${JSON.stringify(m, null, f)}
1887
- '`
1888
- );
1889
- } catch {
1890
- }
1891
- x || p(`${c ? "--data-binary" : y("data")} ${M(a.text)}`);
1892
- }
1893
- return h();
1894
- }
1895
- }, ba = {
1896
- info: {
1897
- key: "httpie",
1898
- title: "HTTPie",
1899
- link: "http://httpie.org/",
1900
- description: "a CLI, cURL-like tool for humans",
1901
- extname: ".sh",
1902
- installation: "brew install httpie"
1903
- },
1904
- convert: ({ allHeaders: t, postData: e, queryObj: r, fullUrl: o, method: i, url: a }, n) => {
1905
- const s = {
1906
- body: !1,
1907
- cert: !1,
1908
- headers: !1,
1909
- indent: " ",
1910
- pretty: !1,
1911
- print: !1,
1912
- queryParams: !1,
1913
- short: !1,
1914
- style: !1,
1915
- timeout: !1,
1916
- verbose: !1,
1917
- verify: !1,
1918
- ...n
1919
- }, { push: l, join: c, unshift: u } = new C({
1920
- indent: s.indent,
1921
- // @ts-expect-error SEEMS LEGIT
1922
- join: s.indent !== !1 ? ` \\
1923
- ${s.indent}` : " "
1924
- });
1925
- let f = !1;
1926
- const p = [];
1927
- s.headers && p.push(s.short ? "-h" : "--headers"), s.body && p.push(s.short ? "-b" : "--body"), s.verbose && p.push(s.short ? "-v" : "--verbose"), s.print && p.push(`${s.short ? "-p" : "--print"}=${s.print}`), s.verify && p.push(`--verify=${s.verify}`), s.cert && p.push(`--cert=${s.cert}`), s.pretty && p.push(`--pretty=${s.pretty}`), s.style && p.push(`--style=${s.style}`), s.timeout && p.push(`--timeout=${s.timeout}`), s.queryParams && Object.keys(r).forEach((y) => {
1928
- const g = r[y];
1929
- Array.isArray(g) ? g.forEach((b) => {
1930
- l(`${y}==${M(b)}`);
1931
- }) : l(`${y}==${M(g)}`);
1932
- }), Object.keys(t).sort().forEach((y) => {
1933
- l(`${y}:${M(t[y])}`);
1934
- }), e.mimeType === "application/x-www-form-urlencoded" ? e.params && e.params.length && (p.push(s.short ? "-f" : "--form"), e.params.forEach((y) => {
1935
- l(`${y.name}=${M(y.value)}`);
1936
- })) : f = !0;
1937
- const h = p.length ? `${p.join(" ")} ` : "";
1938
- if (a = M(s.queryParams ? a : o), u(`http ${h}${i} ${a}`), f && e.text) {
1939
- const y = M(e.text);
1940
- u(`echo ${y} | `);
1941
- }
1942
- return c();
1943
- }
1944
- }, va = {
1945
- info: {
1946
- key: "wget",
1947
- title: "Wget",
1948
- link: "https://www.gnu.org/software/wget/",
1949
- description: "a free software package for retrieving files using HTTP, HTTPS",
1950
- extname: ".sh"
1951
- },
1952
- convert: ({ method: t, postData: e, allHeaders: r, fullUrl: o }, i) => {
1953
- const a = {
1954
- indent: " ",
1955
- short: !1,
1956
- verbose: !1,
1957
- ...i
1958
- }, { push: n, join: s } = new C({
1959
- ...typeof a.indent == "string" ? { indent: a.indent } : {},
1960
- join: a.indent !== !1 ? ` \\
1961
- ${a.indent}` : " "
1962
- });
1963
- return a.verbose ? n(`wget ${a.short ? "-v" : "--verbose"}`) : n(`wget ${a.short ? "-q" : "--quiet"}`), n(`--method ${M(t)}`), Object.keys(r).forEach((l) => {
1964
- const c = `${l}: ${r[l]}`;
1965
- n(`--header ${M(c)}`);
1966
- }), e.text && n(`--body-data ${ha(M(e.text))}`), n(a.short ? "-O" : "--output-document"), n(`- ${M(o)}`), s();
1967
- }
1968
- }, xa = {
1969
- info: {
1970
- key: "shell",
1971
- title: "Shell",
1972
- default: "curl",
1973
- cli: "%s"
1974
- },
1975
- clientsById: {
1976
- curl: ga,
1977
- httpie: ba,
1978
- wget: va
1979
- }
1980
- }, hr = (t, e) => e.repeat(t), yr = (t, e, r, o) => {
1981
- const i = hr(o, r), a = hr(o - 1, r), n = e ? `,
1982
- ${i}` : ", ";
1983
- return e ? `[
1984
- ${i}${t.join(n)}
1985
- ${a}]` : `[${t.join(n)}]`;
1986
- }, mr = (t, e, r) => `let ${t} = ${ot(e, r)}`, ot = (t, e, r) => {
1987
- switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
1988
- case "[object Number]":
1989
- return t;
1990
- case "[object Array]": {
1991
- let o = !1;
1992
- const i = t.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (o = Object.keys(a).length > 1), ot(a, e, r)));
1993
- return yr(i, o, e.indent, r);
1994
- }
1995
- case "[object Object]": {
1996
- const o = [];
1997
- for (const i in t)
1998
- o.push(`"${i}": ${ot(t[i], e, r)}`);
1999
- return yr(
2000
- o,
2001
- // @ts-expect-error needs better types
2002
- e.pretty && o.length > 1,
2003
- // @ts-expect-error needs better types
2004
- e.indent,
2005
- r
2006
- );
2007
- }
2008
- case "[object Boolean]":
2009
- return t.toString();
2010
- default:
2011
- return t == null ? "nil" : `"${t.toString().replace(/"/g, '\\"')}"`;
2012
- }
2013
- }, $a = {
2014
- info: {
2015
- key: "urlsession",
2016
- title: "URLSession",
2017
- link: "https://developer.apple.com/documentation/foundation/urlsession",
2018
- description: "Foundation's URLSession request",
2019
- extname: ".swift"
2020
- },
2021
- convert: ({ allHeaders: t, postData: e, uriObj: r, queryObj: o, method: i }, a) => {
2022
- var p;
2023
- const n = {
2024
- indent: " ",
2025
- pretty: !0,
2026
- timeout: 10,
2027
- ...a
2028
- }, { push: s, blank: l, join: c } = new C({ indent: n.indent });
2029
- s("import Foundation"), l();
2030
- const u = e.text || e.jsonObj || e.params;
2031
- if (u)
2032
- switch (e.mimeType) {
2033
- case "application/x-www-form-urlencoded":
2034
- if ((p = e.params) != null && p.length) {
2035
- const h = e.params.map((y) => `"${y.name}": "${y.value}"`);
2036
- n.pretty ? (s("let parameters = ["), h.forEach((y) => s(`${y},`, 1)), s("]")) : s(`let parameters = [${h.join(", ")}]`), s('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'), s("let postData = Data(joinedParameters.utf8)"), l();
2037
- }
2038
- break;
2039
- case "application/json":
2040
- e.jsonObj && (s(`${mr("parameters", e.jsonObj, n)} as [String : Any?]`), l(), s("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"), l());
2041
- break;
2042
- case "multipart/form-data":
2043
- s(mr("parameters", e.params, n)), l(), s(`let boundary = "${e.boundary}"`), l(), s('var body = ""'), s("for param in parameters {"), s('let paramName = param["name"]!', 1), s('body += "--\\(boundary)\\r\\n"', 1), s('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1), s('if let filename = param["fileName"] {', 1), s('let contentType = param["contentType"]!', 2), s("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)", 2), s('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2), s('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2), s("body += fileContent", 2), s('} else if let paramValue = param["value"] {', 1), s('body += "\\r\\n\\r\\n\\(paramValue)"', 2), s("}", 1), s("}"), l(), s("let postData = Data(body.utf8)"), l();
2044
- break;
2045
- default:
2046
- s(`let postData = Data("${e.text}".utf8)`), l();
2047
- }
2048
- s(`let url = URL(string: "${r.href}")!`);
2049
- const f = o ? Object.entries(o) : [];
2050
- return f.length < 1 ? s("var request = URLRequest(url: url)") : (s("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"), s("let queryItems: [URLQueryItem] = ["), f.forEach((h) => {
2051
- const y = h[0], g = h[1];
2052
- switch (Object.prototype.toString.call(g)) {
2053
- case "[object String]":
2054
- s(`URLQueryItem(name: "${y}", value: "${g}"),`, 1);
2055
- break;
2056
- case "[object Array]":
2057
- g.forEach((b) => {
2058
- s(`URLQueryItem(name: "${y}", value: "${b}"),`, 1);
2059
- });
2060
- break;
2061
- }
2062
- }), s("]"), s("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"), l(), s("var request = URLRequest(url: components.url!)")), s(`request.httpMethod = "${i}"`), s(`request.timeoutInterval = ${n.timeout}`), Object.keys(t).length && s(`request.allHTTPHeaderFields = ${ot(t, n)}`), u && s("request.httpBody = postData"), l(), s("let (data, _) = try await URLSession.shared.data(for: request)"), s("print(String(decoding: data, as: UTF8.self))"), c();
2063
- }
2064
- }, wa = {
2065
- info: {
2066
- key: "swift",
2067
- title: "Swift",
2068
- default: "urlsession"
2069
- },
2070
- clientsById: {
2071
- urlsession: $a
2072
- }
2073
- }, ja = {
2074
- c: yo,
2075
- clojure: vo,
2076
- csharp: So,
2077
- go: To,
2078
- http: Po,
2079
- java: Ao,
2080
- javascript: Fo,
2081
- json: Ho,
2082
- kotlin: Mo,
2083
- node: Qo,
2084
- objc: Do,
2085
- ocaml: Xo,
2086
- php: na,
2087
- powershell: ia,
2088
- python: ca,
2089
- r: pa,
2090
- ruby: da,
2091
- shell: xa,
2092
- swift: wa
2093
- }, at = { exports: {} };
2094
- /*! https://mths.be/punycode v1.4.1 by @mathias */
2095
- at.exports;
2096
- (function(t, e) {
2097
- (function(r) {
2098
- var o = e && !e.nodeType && e, i = t && !t.nodeType && t, a = typeof He == "object" && He;
2099
- (a.global === a || a.window === a || a.self === a) && (r = a);
2100
- var n, s = 2147483647, l = 36, c = 1, u = 26, f = 38, p = 700, h = 72, y = 128, g = "-", b = /^xn--/, x = /[^\x20-\x7E]/, m = /[\x2E\u3002\uFF0E\uFF61]/g, v = {
2101
- overflow: "Overflow: input needs wider integers to process",
2102
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
2103
- "invalid-input": "Invalid input"
2104
- }, j = l - c, w = Math.floor, S = String.fromCharCode, k;
2105
- function E($) {
2106
- throw new RangeError(v[$]);
2107
- }
2108
- function R($, O) {
2109
- for (var P = $.length, A = []; P--; )
2110
- A[P] = O($[P]);
2111
- return A;
2112
- }
2113
- function F($, O) {
2114
- var P = $.split("@"), A = "";
2115
- P.length > 1 && (A = P[0] + "@", $ = P[1]), $ = $.replace(m, ".");
2116
- var I = $.split("."), K = R(I, O).join(".");
2117
- return A + K;
2118
- }
2119
- function te($) {
2120
- for (var O = [], P = 0, A = $.length, I, K; P < A; )
2121
- I = $.charCodeAt(P++), I >= 55296 && I <= 56319 && P < A ? (K = $.charCodeAt(P++), (K & 64512) == 56320 ? O.push(((I & 1023) << 10) + (K & 1023) + 65536) : (O.push(I), P--)) : O.push(I);
2122
- return O;
2123
- }
2124
- function re($) {
2125
- return R($, function(O) {
2126
- var P = "";
2127
- return O > 65535 && (O -= 65536, P += S(O >>> 10 & 1023 | 55296), O = 56320 | O & 1023), P += S(O), P;
2128
- }).join("");
2129
- }
2130
- function L($) {
2131
- return $ - 48 < 10 ? $ - 22 : $ - 65 < 26 ? $ - 65 : $ - 97 < 26 ? $ - 97 : l;
2132
- }
2133
- function V($, O) {
2134
- return $ + 22 + 75 * ($ < 26) - ((O != 0) << 5);
2135
- }
2136
- function Q($, O, P) {
2137
- var A = 0;
2138
- for ($ = P ? w($ / p) : $ >> 1, $ += w($ / O); $ > j * u >> 1; A += l)
2139
- $ = w($ / j);
2140
- return w(A + (j + 1) * $ / ($ + f));
2141
- }
2142
- function Y($) {
2143
- var O = [], P = $.length, A, I = 0, K = y, B = h, X, ne, ie, pe, W, Z, oe, ye, $e;
2144
- for (X = $.lastIndexOf(g), X < 0 && (X = 0), ne = 0; ne < X; ++ne)
2145
- $.charCodeAt(ne) >= 128 && E("not-basic"), O.push($.charCodeAt(ne));
2146
- for (ie = X > 0 ? X + 1 : 0; ie < P; ) {
2147
- for (pe = I, W = 1, Z = l; ie >= P && E("invalid-input"), oe = L($.charCodeAt(ie++)), (oe >= l || oe > w((s - I) / W)) && E("overflow"), I += oe * W, ye = Z <= B ? c : Z >= B + u ? u : Z - B, !(oe < ye); Z += l)
2148
- $e = l - ye, W > w(s / $e) && E("overflow"), W *= $e;
2149
- A = O.length + 1, B = Q(I - pe, A, pe == 0), w(I / A) > s - K && E("overflow"), K += w(I / A), I %= A, O.splice(I++, 0, K);
2150
- }
2151
- return re(O);
2152
- }
2153
- function he($) {
2154
- var O, P, A, I, K, B, X, ne, ie, pe, W, Z = [], oe, ye, $e, dt;
2155
- for ($ = te($), oe = $.length, O = y, P = 0, K = h, B = 0; B < oe; ++B)
2156
- W = $[B], W < 128 && Z.push(S(W));
2157
- for (A = I = Z.length, I && Z.push(g); A < oe; ) {
2158
- for (X = s, B = 0; B < oe; ++B)
2159
- W = $[B], W >= O && W < X && (X = W);
2160
- for (ye = A + 1, X - O > w((s - P) / ye) && E("overflow"), P += (X - O) * ye, O = X, B = 0; B < oe; ++B)
2161
- if (W = $[B], W < O && ++P > s && E("overflow"), W == O) {
2162
- for (ne = P, ie = l; pe = ie <= K ? c : ie >= K + u ? u : ie - K, !(ne < pe); ie += l)
2163
- dt = ne - pe, $e = l - pe, Z.push(
2164
- S(V(pe + dt % $e, 0))
2165
- ), ne = w(dt / $e);
2166
- Z.push(S(V(ne, 0))), K = Q(P, ye, A == I), P = 0, ++A;
2167
- }
2168
- ++P, ++O;
2169
- }
2170
- return Z.join("");
2171
- }
2172
- function ft($) {
2173
- return F($, function(O) {
2174
- return b.test(O) ? Y(O.slice(4).toLowerCase()) : O;
2175
- });
2176
- }
2177
- function Ke($) {
2178
- return F($, function(O) {
2179
- return x.test(O) ? "xn--" + he(O) : O;
2180
- });
2181
- }
2182
- if (n = {
2183
- /**
2184
- * A string representing the current Punycode.js version number.
2185
- * @memberOf punycode
2186
- * @type String
2187
- */
2188
- version: "1.4.1",
2189
- /**
2190
- * An object of methods to convert from JavaScript's internal character
2191
- * representation (UCS-2) to Unicode code points, and back.
2192
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
2193
- * @memberOf punycode
2194
- * @type Object
2195
- */
2196
- ucs2: {
2197
- decode: te,
2198
- encode: re
2199
- },
2200
- decode: Y,
2201
- encode: he,
2202
- toASCII: Ke,
2203
- toUnicode: ft
2204
- }, o && i)
2205
- if (t.exports == o)
2206
- i.exports = n;
2207
- else
2208
- for (k in n)
2209
- n.hasOwnProperty(k) && (o[k] = n[k]);
2210
- else
2211
- r.punycode = n;
2212
- })(He);
2213
- })(at, at.exports);
2214
- var Sa = at.exports, Oa = Error, Ta = EvalError, Ca = RangeError, Pa = ReferenceError, rn = SyntaxError, Ve = TypeError, ka = URIError, Ea = function() {
2215
- if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
2216
- return !1;
2217
- if (typeof Symbol.iterator == "symbol")
2218
- return !0;
2219
- var e = {}, r = Symbol("test"), o = Object(r);
2220
- if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(o) !== "[object Symbol]")
2221
- return !1;
2222
- var i = 42;
2223
- e[r] = i;
2224
- for (r in e)
2225
- return !1;
2226
- if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
2227
- return !1;
2228
- var a = Object.getOwnPropertySymbols(e);
2229
- if (a.length !== 1 || a[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r))
2230
- return !1;
2231
- if (typeof Object.getOwnPropertyDescriptor == "function") {
2232
- var n = Object.getOwnPropertyDescriptor(e, r);
2233
- if (n.value !== i || n.enumerable !== !0)
2234
- return !1;
2235
- }
2236
- return !0;
2237
- }, gr = typeof Symbol < "u" && Symbol, Na = Ea, Ra = function() {
2238
- return typeof gr != "function" || typeof Symbol != "function" || typeof gr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Na();
2239
- }, yt = {
2240
- __proto__: null,
2241
- foo: {}
2242
- }, Aa = Object, qa = function() {
2243
- return { __proto__: yt }.foo === yt.foo && !(yt instanceof Aa);
2244
- }, Ia = "Function.prototype.bind called on incompatible ", La = Object.prototype.toString, Ua = Math.max, Fa = "[object Function]", br = function(e, r) {
2245
- for (var o = [], i = 0; i < e.length; i += 1)
2246
- o[i] = e[i];
2247
- for (var a = 0; a < r.length; a += 1)
2248
- o[a + e.length] = r[a];
2249
- return o;
2250
- }, _a = function(e, r) {
2251
- for (var o = [], i = r, a = 0; i < e.length; i += 1, a += 1)
2252
- o[a] = e[i];
2253
- return o;
2254
- }, Ha = function(t, e) {
2255
- for (var r = "", o = 0; o < t.length; o += 1)
2256
- r += t[o], o + 1 < t.length && (r += e);
2257
- return r;
2258
- }, Ba = function(e) {
2259
- var r = this;
2260
- if (typeof r != "function" || La.apply(r) !== Fa)
2261
- throw new TypeError(Ia + r);
2262
- for (var o = _a(arguments, 1), i, a = function() {
2263
- if (this instanceof i) {
2264
- var u = r.apply(
2265
- this,
2266
- br(o, arguments)
2267
- );
2268
- return Object(u) === u ? u : this;
2269
- }
2270
- return r.apply(
2271
- e,
2272
- br(o, arguments)
2273
- );
2274
- }, n = Ua(0, r.length - o.length), s = [], l = 0; l < n; l++)
2275
- s[l] = "$" + l;
2276
- if (i = Function("binder", "return function (" + Ha(s, ",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) {
2277
- var c = function() {
2278
- };
2279
- c.prototype = r.prototype, i.prototype = new c(), c.prototype = null;
2280
- }
2281
- return i;
2282
- }, Ma = Ba, Jt = Function.prototype.bind || Ma, za = Function.prototype.call, Wa = Object.prototype.hasOwnProperty, Ja = Jt, Ga = Ja.call(za, Wa), T, Va = Oa, Qa = Ta, Ka = Ca, Da = Pa, Ae = rn, Ee = Ve, Ya = ka, nn = Function, mt = function(t) {
2283
- try {
2284
- return nn('"use strict"; return (' + t + ").constructor;")();
2285
- } catch {
2286
- }
2287
- }, Se = Object.getOwnPropertyDescriptor;
2288
- if (Se)
2289
- try {
2290
- Se({}, "");
2291
- } catch {
2292
- Se = null;
2293
- }
2294
- var gt = function() {
2295
- throw new Ee();
2296
- }, Xa = Se ? function() {
2297
- try {
2298
- return arguments.callee, gt;
2299
- } catch {
2300
- try {
2301
- return Se(arguments, "callee").get;
2302
- } catch {
2303
- return gt;
2304
- }
2305
- }
2306
- }() : gt, Te = Ra(), Za = qa(), _ = Object.getPrototypeOf || (Za ? function(t) {
2307
- return t.__proto__;
2308
- } : null), Pe = {}, ei = typeof Uint8Array > "u" || !_ ? T : _(Uint8Array), Oe = {
2309
- __proto__: null,
2310
- "%AggregateError%": typeof AggregateError > "u" ? T : AggregateError,
2311
- "%Array%": Array,
2312
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? T : ArrayBuffer,
2313
- "%ArrayIteratorPrototype%": Te && _ ? _([][Symbol.iterator]()) : T,
2314
- "%AsyncFromSyncIteratorPrototype%": T,
2315
- "%AsyncFunction%": Pe,
2316
- "%AsyncGenerator%": Pe,
2317
- "%AsyncGeneratorFunction%": Pe,
2318
- "%AsyncIteratorPrototype%": Pe,
2319
- "%Atomics%": typeof Atomics > "u" ? T : Atomics,
2320
- "%BigInt%": typeof BigInt > "u" ? T : BigInt,
2321
- "%BigInt64Array%": typeof BigInt64Array > "u" ? T : BigInt64Array,
2322
- "%BigUint64Array%": typeof BigUint64Array > "u" ? T : BigUint64Array,
2323
- "%Boolean%": Boolean,
2324
- "%DataView%": typeof DataView > "u" ? T : DataView,
2325
- "%Date%": Date,
2326
- "%decodeURI%": decodeURI,
2327
- "%decodeURIComponent%": decodeURIComponent,
2328
- "%encodeURI%": encodeURI,
2329
- "%encodeURIComponent%": encodeURIComponent,
2330
- "%Error%": Va,
2331
- "%eval%": eval,
2332
- // eslint-disable-line no-eval
2333
- "%EvalError%": Qa,
2334
- "%Float32Array%": typeof Float32Array > "u" ? T : Float32Array,
2335
- "%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
2336
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
2337
- "%Function%": nn,
2338
- "%GeneratorFunction%": Pe,
2339
- "%Int8Array%": typeof Int8Array > "u" ? T : Int8Array,
2340
- "%Int16Array%": typeof Int16Array > "u" ? T : Int16Array,
2341
- "%Int32Array%": typeof Int32Array > "u" ? T : Int32Array,
2342
- "%isFinite%": isFinite,
2343
- "%isNaN%": isNaN,
2344
- "%IteratorPrototype%": Te && _ ? _(_([][Symbol.iterator]())) : T,
2345
- "%JSON%": typeof JSON == "object" ? JSON : T,
2346
- "%Map%": typeof Map > "u" ? T : Map,
2347
- "%MapIteratorPrototype%": typeof Map > "u" || !Te || !_ ? T : _((/* @__PURE__ */ new Map())[Symbol.iterator]()),
2348
- "%Math%": Math,
2349
- "%Number%": Number,
2350
- "%Object%": Object,
2351
- "%parseFloat%": parseFloat,
2352
- "%parseInt%": parseInt,
2353
- "%Promise%": typeof Promise > "u" ? T : Promise,
2354
- "%Proxy%": typeof Proxy > "u" ? T : Proxy,
2355
- "%RangeError%": Ka,
2356
- "%ReferenceError%": Da,
2357
- "%Reflect%": typeof Reflect > "u" ? T : Reflect,
2358
- "%RegExp%": RegExp,
2359
- "%Set%": typeof Set > "u" ? T : Set,
2360
- "%SetIteratorPrototype%": typeof Set > "u" || !Te || !_ ? T : _((/* @__PURE__ */ new Set())[Symbol.iterator]()),
2361
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? T : SharedArrayBuffer,
2362
- "%String%": String,
2363
- "%StringIteratorPrototype%": Te && _ ? _(""[Symbol.iterator]()) : T,
2364
- "%Symbol%": Te ? Symbol : T,
2365
- "%SyntaxError%": Ae,
2366
- "%ThrowTypeError%": Xa,
2367
- "%TypedArray%": ei,
2368
- "%TypeError%": Ee,
2369
- "%Uint8Array%": typeof Uint8Array > "u" ? T : Uint8Array,
2370
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? T : Uint8ClampedArray,
2371
- "%Uint16Array%": typeof Uint16Array > "u" ? T : Uint16Array,
2372
- "%Uint32Array%": typeof Uint32Array > "u" ? T : Uint32Array,
2373
- "%URIError%": Ya,
2374
- "%WeakMap%": typeof WeakMap > "u" ? T : WeakMap,
2375
- "%WeakRef%": typeof WeakRef > "u" ? T : WeakRef,
2376
- "%WeakSet%": typeof WeakSet > "u" ? T : WeakSet
2377
- };
2378
- if (_)
2379
- try {
2380
- null.error;
2381
- } catch (t) {
2382
- var ti = _(_(t));
2383
- Oe["%Error.prototype%"] = ti;
2384
- }
2385
- var ri = function t(e) {
2386
- var r;
2387
- if (e === "%AsyncFunction%")
2388
- r = mt("async function () {}");
2389
- else if (e === "%GeneratorFunction%")
2390
- r = mt("function* () {}");
2391
- else if (e === "%AsyncGeneratorFunction%")
2392
- r = mt("async function* () {}");
2393
- else if (e === "%AsyncGenerator%") {
2394
- var o = t("%AsyncGeneratorFunction%");
2395
- o && (r = o.prototype);
2396
- } else if (e === "%AsyncIteratorPrototype%") {
2397
- var i = t("%AsyncGenerator%");
2398
- i && _ && (r = _(i.prototype));
2399
- }
2400
- return Oe[e] = r, r;
2401
- }, vr = {
2402
- __proto__: null,
2403
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
2404
- "%ArrayPrototype%": ["Array", "prototype"],
2405
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
2406
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
2407
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
2408
- "%ArrayProto_values%": ["Array", "prototype", "values"],
2409
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
2410
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
2411
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
2412
- "%BooleanPrototype%": ["Boolean", "prototype"],
2413
- "%DataViewPrototype%": ["DataView", "prototype"],
2414
- "%DatePrototype%": ["Date", "prototype"],
2415
- "%ErrorPrototype%": ["Error", "prototype"],
2416
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
2417
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
2418
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
2419
- "%FunctionPrototype%": ["Function", "prototype"],
2420
- "%Generator%": ["GeneratorFunction", "prototype"],
2421
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
2422
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
2423
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
2424
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
2425
- "%JSONParse%": ["JSON", "parse"],
2426
- "%JSONStringify%": ["JSON", "stringify"],
2427
- "%MapPrototype%": ["Map", "prototype"],
2428
- "%NumberPrototype%": ["Number", "prototype"],
2429
- "%ObjectPrototype%": ["Object", "prototype"],
2430
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
2431
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
2432
- "%PromisePrototype%": ["Promise", "prototype"],
2433
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
2434
- "%Promise_all%": ["Promise", "all"],
2435
- "%Promise_reject%": ["Promise", "reject"],
2436
- "%Promise_resolve%": ["Promise", "resolve"],
2437
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
2438
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
2439
- "%RegExpPrototype%": ["RegExp", "prototype"],
2440
- "%SetPrototype%": ["Set", "prototype"],
2441
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
2442
- "%StringPrototype%": ["String", "prototype"],
2443
- "%SymbolPrototype%": ["Symbol", "prototype"],
2444
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
2445
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
2446
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
2447
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
2448
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
2449
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
2450
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
2451
- "%URIErrorPrototype%": ["URIError", "prototype"],
2452
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
2453
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
2454
- }, Qe = Jt, it = Ga, ni = Qe.call(Function.call, Array.prototype.concat), oi = Qe.call(Function.apply, Array.prototype.splice), xr = Qe.call(Function.call, String.prototype.replace), st = Qe.call(Function.call, String.prototype.slice), ai = Qe.call(Function.call, RegExp.prototype.exec), ii = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, si = /\\(\\)?/g, li = function(e) {
2455
- var r = st(e, 0, 1), o = st(e, -1);
2456
- if (r === "%" && o !== "%")
2457
- throw new Ae("invalid intrinsic syntax, expected closing `%`");
2458
- if (o === "%" && r !== "%")
2459
- throw new Ae("invalid intrinsic syntax, expected opening `%`");
2460
- var i = [];
2461
- return xr(e, ii, function(a, n, s, l) {
2462
- i[i.length] = s ? xr(l, si, "$1") : n || a;
2463
- }), i;
2464
- }, ci = function(e, r) {
2465
- var o = e, i;
2466
- if (it(vr, o) && (i = vr[o], o = "%" + i[0] + "%"), it(Oe, o)) {
2467
- var a = Oe[o];
2468
- if (a === Pe && (a = ri(o)), typeof a > "u" && !r)
2469
- throw new Ee("intrinsic " + e + " exists, but is not available. Please file an issue!");
2470
- return {
2471
- alias: i,
2472
- name: o,
2473
- value: a
2474
- };
2475
- }
2476
- throw new Ae("intrinsic " + e + " does not exist!");
2477
- }, Le = function(e, r) {
2478
- if (typeof e != "string" || e.length === 0)
2479
- throw new Ee("intrinsic name must be a non-empty string");
2480
- if (arguments.length > 1 && typeof r != "boolean")
2481
- throw new Ee('"allowMissing" argument must be a boolean');
2482
- if (ai(/^%?[^%]*%?$/, e) === null)
2483
- throw new Ae("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
2484
- var o = li(e), i = o.length > 0 ? o[0] : "", a = ci("%" + i + "%", r), n = a.name, s = a.value, l = !1, c = a.alias;
2485
- c && (i = c[0], oi(o, ni([0, 1], c)));
2486
- for (var u = 1, f = !0; u < o.length; u += 1) {
2487
- var p = o[u], h = st(p, 0, 1), y = st(p, -1);
2488
- if ((h === '"' || h === "'" || h === "`" || y === '"' || y === "'" || y === "`") && h !== y)
2489
- throw new Ae("property names with quotes must have matching quotes");
2490
- if ((p === "constructor" || !f) && (l = !0), i += "." + p, n = "%" + i + "%", it(Oe, n))
2491
- s = Oe[n];
2492
- else if (s != null) {
2493
- if (!(p in s)) {
2494
- if (!r)
2495
- throw new Ee("base intrinsic for " + e + " exists, but the property is not available.");
2496
- return;
2497
- }
2498
- if (Se && u + 1 >= o.length) {
2499
- var g = Se(s, p);
2500
- f = !!g, f && "get" in g && !("originalValue" in g.get) ? s = g.get : s = s[p];
2501
- } else
2502
- f = it(s, p), s = s[p];
2503
- f && !l && (Oe[n] = s);
2504
- }
2505
- }
2506
- return s;
2507
- }, on = { exports: {} }, bt, $r;
2508
- function Gt() {
2509
- if ($r) return bt;
2510
- $r = 1;
2511
- var t = Le, e = t("%Object.defineProperty%", !0) || !1;
2512
- if (e)
2513
- try {
2514
- e({}, "a", { value: 1 });
2515
- } catch {
2516
- e = !1;
2517
- }
2518
- return bt = e, bt;
2519
- }
2520
- var ui = Le, tt = ui("%Object.getOwnPropertyDescriptor%", !0);
2521
- if (tt)
2522
- try {
2523
- tt([], "length");
2524
- } catch {
2525
- tt = null;
2526
- }
2527
- var an = tt, wr = Gt(), pi = rn, Ce = Ve, jr = an, fi = function(e, r, o) {
2528
- if (!e || typeof e != "object" && typeof e != "function")
2529
- throw new Ce("`obj` must be an object or a function`");
2530
- if (typeof r != "string" && typeof r != "symbol")
2531
- throw new Ce("`property` must be a string or a symbol`");
2532
- if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null)
2533
- throw new Ce("`nonEnumerable`, if provided, must be a boolean or null");
2534
- if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null)
2535
- throw new Ce("`nonWritable`, if provided, must be a boolean or null");
2536
- if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null)
2537
- throw new Ce("`nonConfigurable`, if provided, must be a boolean or null");
2538
- if (arguments.length > 6 && typeof arguments[6] != "boolean")
2539
- throw new Ce("`loose`, if provided, must be a boolean");
2540
- var i = arguments.length > 3 ? arguments[3] : null, a = arguments.length > 4 ? arguments[4] : null, n = arguments.length > 5 ? arguments[5] : null, s = arguments.length > 6 ? arguments[6] : !1, l = !!jr && jr(e, r);
2541
- if (wr)
2542
- wr(e, r, {
2543
- configurable: n === null && l ? l.configurable : !n,
2544
- enumerable: i === null && l ? l.enumerable : !i,
2545
- value: o,
2546
- writable: a === null && l ? l.writable : !a
2547
- });
2548
- else if (s || !i && !a && !n)
2549
- e[r] = o;
2550
- else
2551
- throw new pi("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
2552
- }, kt = Gt(), sn = function() {
2553
- return !!kt;
2554
- };
2555
- sn.hasArrayLengthDefineBug = function() {
2556
- if (!kt)
2557
- return null;
2558
- try {
2559
- return kt([], "length", { value: 1 }).length !== 1;
2560
- } catch {
2561
- return !0;
2562
- }
2563
- };
2564
- var di = sn, hi = Le, Sr = fi, yi = di(), Or = an, Tr = Ve, mi = hi("%Math.floor%"), gi = function(e, r) {
2565
- if (typeof e != "function")
2566
- throw new Tr("`fn` is not a function");
2567
- if (typeof r != "number" || r < 0 || r > 4294967295 || mi(r) !== r)
2568
- throw new Tr("`length` must be a positive 32-bit integer");
2569
- var o = arguments.length > 2 && !!arguments[2], i = !0, a = !0;
2570
- if ("length" in e && Or) {
2571
- var n = Or(e, "length");
2572
- n && !n.configurable && (i = !1), n && !n.writable && (a = !1);
2573
- }
2574
- return (i || a || !o) && (yi ? Sr(
2575
- /** @type {Parameters<define>[0]} */
2576
- e,
2577
- "length",
2578
- r,
2579
- !0,
2580
- !0
2581
- ) : Sr(
2582
- /** @type {Parameters<define>[0]} */
2583
- e,
2584
- "length",
2585
- r
2586
- )), e;
2587
- };
2588
- (function(t) {
2589
- var e = Jt, r = Le, o = gi, i = Ve, a = r("%Function.prototype.apply%"), n = r("%Function.prototype.call%"), s = r("%Reflect.apply%", !0) || e.call(n, a), l = Gt(), c = r("%Math.max%");
2590
- t.exports = function(p) {
2591
- if (typeof p != "function")
2592
- throw new i("a function is required");
2593
- var h = s(e, n, arguments);
2594
- return o(
2595
- h,
2596
- 1 + c(0, p.length - (arguments.length - 1)),
2597
- !0
2598
- );
2599
- };
2600
- var u = function() {
2601
- return s(e, a, arguments);
2602
- };
2603
- l ? l(t.exports, "apply", { value: u }) : t.exports.apply = u;
2604
- })(on);
2605
- var bi = on.exports, ln = Le, cn = bi, vi = cn(ln("String.prototype.indexOf")), xi = function(e, r) {
2606
- var o = ln(e, !!r);
2607
- return typeof o == "function" && vi(e, ".prototype.") > -1 ? cn(o) : o;
2608
- };
2609
- const $i = /* @__PURE__ */ Yn(Xn);
2610
- var Vt = typeof Map == "function" && Map.prototype, vt = Object.getOwnPropertyDescriptor && Vt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, lt = Vt && vt && typeof vt.get == "function" ? vt.get : null, Cr = Vt && Map.prototype.forEach, Qt = typeof Set == "function" && Set.prototype, xt = Object.getOwnPropertyDescriptor && Qt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ct = Qt && xt && typeof xt.get == "function" ? xt.get : null, Pr = Qt && Set.prototype.forEach, wi = typeof WeakMap == "function" && WeakMap.prototype, Be = wi ? WeakMap.prototype.has : null, ji = typeof WeakSet == "function" && WeakSet.prototype, Me = ji ? WeakSet.prototype.has : null, Si = typeof WeakRef == "function" && WeakRef.prototype, kr = Si ? WeakRef.prototype.deref : null, Oi = Boolean.prototype.valueOf, Ti = Object.prototype.toString, Ci = Function.prototype.toString, Pi = String.prototype.match, Kt = String.prototype.slice, ge = String.prototype.replace, ki = String.prototype.toUpperCase, Er = String.prototype.toLowerCase, un = RegExp.prototype.test, Nr = Array.prototype.concat, ce = Array.prototype.join, Ei = Array.prototype.slice, Rr = Math.floor, Et = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, $t = Object.getOwnPropertySymbols, Nt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, qe = typeof Symbol == "function" && typeof Symbol.iterator == "object", G = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === qe || !0) ? Symbol.toStringTag : null, pn = Object.prototype.propertyIsEnumerable, Ar = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
2611
- return t.__proto__;
2612
- } : null);
2613
- function qr(t, e) {
2614
- if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || un.call(/e/, e))
2615
- return e;
2616
- var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
2617
- if (typeof t == "number") {
2618
- var o = t < 0 ? -Rr(-t) : Rr(t);
2619
- if (o !== t) {
2620
- var i = String(o), a = Kt.call(e, i.length + 1);
2621
- return ge.call(i, r, "$&_") + "." + ge.call(ge.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
2622
- }
2623
- }
2624
- return ge.call(e, r, "$&_");
2625
- }
2626
- var Rt = $i, Ir = Rt.custom, Lr = dn(Ir) ? Ir : null, Ni = function t(e, r, o, i) {
2627
- var a = r || {};
2628
- if (me(a, "quoteStyle") && a.quoteStyle !== "single" && a.quoteStyle !== "double")
2629
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
2630
- if (me(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
2631
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
2632
- var n = me(a, "customInspect") ? a.customInspect : !0;
2633
- if (typeof n != "boolean" && n !== "symbol")
2634
- throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
2635
- if (me(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
2636
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
2637
- if (me(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
2638
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
2639
- var s = a.numericSeparator;
2640
- if (typeof e > "u")
2641
- return "undefined";
2642
- if (e === null)
2643
- return "null";
2644
- if (typeof e == "boolean")
2645
- return e ? "true" : "false";
2646
- if (typeof e == "string")
2647
- return yn(e, a);
2648
- if (typeof e == "number") {
2649
- if (e === 0)
2650
- return 1 / 0 / e > 0 ? "0" : "-0";
2651
- var l = String(e);
2652
- return s ? qr(e, l) : l;
2653
- }
2654
- if (typeof e == "bigint") {
2655
- var c = String(e) + "n";
2656
- return s ? qr(e, c) : c;
2657
- }
2658
- var u = typeof a.depth > "u" ? 5 : a.depth;
2659
- if (typeof o > "u" && (o = 0), o >= u && u > 0 && typeof e == "object")
2660
- return At(e) ? "[Array]" : "[Object]";
2661
- var f = Ki(a, o);
2662
- if (typeof i > "u")
2663
- i = [];
2664
- else if (hn(i, e) >= 0)
2665
- return "[Circular]";
2666
- function p(L, V, Q) {
2667
- if (V && (i = Ei.call(i), i.push(V)), Q) {
2668
- var Y = {
2669
- depth: a.depth
2670
- };
2671
- return me(a, "quoteStyle") && (Y.quoteStyle = a.quoteStyle), t(L, Y, o + 1, i);
2672
- }
2673
- return t(L, a, o + 1, i);
2674
- }
2675
- if (typeof e == "function" && !Ur(e)) {
2676
- var h = Hi(e), y = Ye(e, p);
2677
- return "[Function" + (h ? ": " + h : " (anonymous)") + "]" + (y.length > 0 ? " { " + ce.call(y, ", ") + " }" : "");
2678
- }
2679
- if (dn(e)) {
2680
- var g = qe ? ge.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Nt.call(e);
2681
- return typeof e == "object" && !qe ? Fe(g) : g;
2682
- }
2683
- if (Gi(e)) {
2684
- for (var b = "<" + Er.call(String(e.nodeName)), x = e.attributes || [], m = 0; m < x.length; m++)
2685
- b += " " + x[m].name + "=" + fn(Ri(x[m].value), "double", a);
2686
- return b += ">", e.childNodes && e.childNodes.length && (b += "..."), b += "</" + Er.call(String(e.nodeName)) + ">", b;
2687
- }
2688
- if (At(e)) {
2689
- if (e.length === 0)
2690
- return "[]";
2691
- var v = Ye(e, p);
2692
- return f && !Qi(v) ? "[" + qt(v, f) + "]" : "[ " + ce.call(v, ", ") + " ]";
2693
- }
2694
- if (qi(e)) {
2695
- var j = Ye(e, p);
2696
- return !("cause" in Error.prototype) && "cause" in e && !pn.call(e, "cause") ? "{ [" + String(e) + "] " + ce.call(Nr.call("[cause]: " + p(e.cause), j), ", ") + " }" : j.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + ce.call(j, ", ") + " }";
2697
- }
2698
- if (typeof e == "object" && n) {
2699
- if (Lr && typeof e[Lr] == "function" && Rt)
2700
- return Rt(e, { depth: u - o });
2701
- if (n !== "symbol" && typeof e.inspect == "function")
2702
- return e.inspect();
2703
- }
2704
- if (Bi(e)) {
2705
- var w = [];
2706
- return Cr && Cr.call(e, function(L, V) {
2707
- w.push(p(V, e, !0) + " => " + p(L, e));
2708
- }), Fr("Map", lt.call(e), w, f);
2709
- }
2710
- if (Wi(e)) {
2711
- var S = [];
2712
- return Pr && Pr.call(e, function(L) {
2713
- S.push(p(L, e));
2714
- }), Fr("Set", ct.call(e), S, f);
2715
- }
2716
- if (Mi(e))
2717
- return wt("WeakMap");
2718
- if (Ji(e))
2719
- return wt("WeakSet");
2720
- if (zi(e))
2721
- return wt("WeakRef");
2722
- if (Li(e))
2723
- return Fe(p(Number(e)));
2724
- if (Fi(e))
2725
- return Fe(p(Et.call(e)));
2726
- if (Ui(e))
2727
- return Fe(Oi.call(e));
2728
- if (Ii(e))
2729
- return Fe(p(String(e)));
2730
- if (typeof window < "u" && e === window)
2731
- return "{ [object Window] }";
2732
- if (typeof globalThis < "u" && e === globalThis || typeof He < "u" && e === He)
2733
- return "{ [object globalThis] }";
2734
- if (!Ai(e) && !Ur(e)) {
2735
- var k = Ye(e, p), E = Ar ? Ar(e) === Object.prototype : e instanceof Object || e.constructor === Object, R = e instanceof Object ? "" : "null prototype", F = !E && G && Object(e) === e && G in e ? Kt.call(xe(e), 8, -1) : R ? "Object" : "", te = E || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", re = te + (F || R ? "[" + ce.call(Nr.call([], F || [], R || []), ": ") + "] " : "");
2736
- return k.length === 0 ? re + "{}" : f ? re + "{" + qt(k, f) + "}" : re + "{ " + ce.call(k, ", ") + " }";
2737
- }
2738
- return String(e);
2739
- };
2740
- function fn(t, e, r) {
2741
- var o = (r.quoteStyle || e) === "double" ? '"' : "'";
2742
- return o + t + o;
2743
- }
2744
- function Ri(t) {
2745
- return ge.call(String(t), /"/g, "&quot;");
2746
- }
2747
- function At(t) {
2748
- return xe(t) === "[object Array]" && (!G || !(typeof t == "object" && G in t));
2749
- }
2750
- function Ai(t) {
2751
- return xe(t) === "[object Date]" && (!G || !(typeof t == "object" && G in t));
2752
- }
2753
- function Ur(t) {
2754
- return xe(t) === "[object RegExp]" && (!G || !(typeof t == "object" && G in t));
2755
- }
2756
- function qi(t) {
2757
- return xe(t) === "[object Error]" && (!G || !(typeof t == "object" && G in t));
2758
- }
2759
- function Ii(t) {
2760
- return xe(t) === "[object String]" && (!G || !(typeof t == "object" && G in t));
2761
- }
2762
- function Li(t) {
2763
- return xe(t) === "[object Number]" && (!G || !(typeof t == "object" && G in t));
2764
- }
2765
- function Ui(t) {
2766
- return xe(t) === "[object Boolean]" && (!G || !(typeof t == "object" && G in t));
2767
- }
2768
- function dn(t) {
2769
- if (qe)
2770
- return t && typeof t == "object" && t instanceof Symbol;
2771
- if (typeof t == "symbol")
2772
- return !0;
2773
- if (!t || typeof t != "object" || !Nt)
2774
- return !1;
2775
- try {
2776
- return Nt.call(t), !0;
2777
- } catch {
2778
- }
2779
- return !1;
2780
- }
2781
- function Fi(t) {
2782
- if (!t || typeof t != "object" || !Et)
2783
- return !1;
2784
- try {
2785
- return Et.call(t), !0;
2786
- } catch {
2787
- }
2788
- return !1;
2789
- }
2790
- var _i = Object.prototype.hasOwnProperty || function(t) {
2791
- return t in this;
2792
- };
2793
- function me(t, e) {
2794
- return _i.call(t, e);
2795
- }
2796
- function xe(t) {
2797
- return Ti.call(t);
2798
- }
2799
- function Hi(t) {
2800
- if (t.name)
2801
- return t.name;
2802
- var e = Pi.call(Ci.call(t), /^function\s*([\w$]+)/);
2803
- return e ? e[1] : null;
2804
- }
2805
- function hn(t, e) {
2806
- if (t.indexOf)
2807
- return t.indexOf(e);
2808
- for (var r = 0, o = t.length; r < o; r++)
2809
- if (t[r] === e)
2810
- return r;
2811
- return -1;
2812
- }
2813
- function Bi(t) {
2814
- if (!lt || !t || typeof t != "object")
2815
- return !1;
2816
- try {
2817
- lt.call(t);
2818
- try {
2819
- ct.call(t);
2820
- } catch {
2821
- return !0;
2822
- }
2823
- return t instanceof Map;
2824
- } catch {
2825
- }
2826
- return !1;
2827
- }
2828
- function Mi(t) {
2829
- if (!Be || !t || typeof t != "object")
2830
- return !1;
2831
- try {
2832
- Be.call(t, Be);
2833
- try {
2834
- Me.call(t, Me);
2835
- } catch {
2836
- return !0;
2837
- }
2838
- return t instanceof WeakMap;
2839
- } catch {
2840
- }
2841
- return !1;
2842
- }
2843
- function zi(t) {
2844
- if (!kr || !t || typeof t != "object")
2845
- return !1;
2846
- try {
2847
- return kr.call(t), !0;
2848
- } catch {
2849
- }
2850
- return !1;
2851
- }
2852
- function Wi(t) {
2853
- if (!ct || !t || typeof t != "object")
2854
- return !1;
2855
- try {
2856
- ct.call(t);
2857
- try {
2858
- lt.call(t);
2859
- } catch {
2860
- return !0;
2861
- }
2862
- return t instanceof Set;
2863
- } catch {
2864
- }
2865
- return !1;
2866
- }
2867
- function Ji(t) {
2868
- if (!Me || !t || typeof t != "object")
2869
- return !1;
2870
- try {
2871
- Me.call(t, Me);
2872
- try {
2873
- Be.call(t, Be);
2874
- } catch {
2875
- return !0;
2876
- }
2877
- return t instanceof WeakSet;
2878
- } catch {
2879
- }
2880
- return !1;
2881
- }
2882
- function Gi(t) {
2883
- return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
2884
- }
2885
- function yn(t, e) {
2886
- if (t.length > e.maxStringLength) {
2887
- var r = t.length - e.maxStringLength, o = "... " + r + " more character" + (r > 1 ? "s" : "");
2888
- return yn(Kt.call(t, 0, e.maxStringLength), e) + o;
2889
- }
2890
- var i = ge.call(ge.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, Vi);
2891
- return fn(i, "single", e);
2892
- }
2893
- function Vi(t) {
2894
- var e = t.charCodeAt(0), r = {
2895
- 8: "b",
2896
- 9: "t",
2897
- 10: "n",
2898
- 12: "f",
2899
- 13: "r"
2900
- }[e];
2901
- return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + ki.call(e.toString(16));
2902
- }
2903
- function Fe(t) {
2904
- return "Object(" + t + ")";
2905
- }
2906
- function wt(t) {
2907
- return t + " { ? }";
2908
- }
2909
- function Fr(t, e, r, o) {
2910
- var i = o ? qt(r, o) : ce.call(r, ", ");
2911
- return t + " (" + e + ") {" + i + "}";
2912
- }
2913
- function Qi(t) {
2914
- for (var e = 0; e < t.length; e++)
2915
- if (hn(t[e], `
2916
- `) >= 0)
2917
- return !1;
2918
- return !0;
2919
- }
2920
- function Ki(t, e) {
2921
- var r;
2922
- if (t.indent === " ")
2923
- r = " ";
2924
- else if (typeof t.indent == "number" && t.indent > 0)
2925
- r = ce.call(Array(t.indent + 1), " ");
2926
- else
2927
- return null;
2928
- return {
2929
- base: r,
2930
- prev: ce.call(Array(e + 1), r)
2931
- };
2932
- }
2933
- function qt(t, e) {
2934
- if (t.length === 0)
2935
- return "";
2936
- var r = `
2937
- ` + e.prev + e.base;
2938
- return r + ce.call(t, "," + r) + `
2939
- ` + e.prev;
2940
- }
2941
- function Ye(t, e) {
2942
- var r = At(t), o = [];
2943
- if (r) {
2944
- o.length = t.length;
2945
- for (var i = 0; i < t.length; i++)
2946
- o[i] = me(t, i) ? e(t[i], t) : "";
2947
- }
2948
- var a = typeof $t == "function" ? $t(t) : [], n;
2949
- if (qe) {
2950
- n = {};
2951
- for (var s = 0; s < a.length; s++)
2952
- n["$" + a[s]] = a[s];
2953
- }
2954
- for (var l in t)
2955
- me(t, l) && (r && String(Number(l)) === l && l < t.length || qe && n["$" + l] instanceof Symbol || (un.call(/[^\w$]/, l) ? o.push(e(l, t) + ": " + e(t[l], t)) : o.push(l + ": " + e(t[l], t))));
2956
- if (typeof $t == "function")
2957
- for (var c = 0; c < a.length; c++)
2958
- pn.call(t, a[c]) && o.push("[" + e(a[c]) + "]: " + e(t[a[c]], t));
2959
- return o;
2960
- }
2961
- var mn = Le, Ue = xi, Di = Ni, Yi = Ve, Xe = mn("%WeakMap%", !0), Ze = mn("%Map%", !0), Xi = Ue("WeakMap.prototype.get", !0), Zi = Ue("WeakMap.prototype.set", !0), es = Ue("WeakMap.prototype.has", !0), ts = Ue("Map.prototype.get", !0), rs = Ue("Map.prototype.set", !0), ns = Ue("Map.prototype.has", !0), Dt = function(t, e) {
2962
- for (var r = t, o; (o = r.next) !== null; r = o)
2963
- if (o.key === e)
2964
- return r.next = o.next, o.next = /** @type {NonNullable<typeof list.next>} */
2965
- t.next, t.next = o, o;
2966
- }, os = function(t, e) {
2967
- var r = Dt(t, e);
2968
- return r && r.value;
2969
- }, as = function(t, e, r) {
2970
- var o = Dt(t, e);
2971
- o ? o.value = r : t.next = /** @type {import('.').ListNode<typeof value>} */
2972
- {
2973
- // eslint-disable-line no-param-reassign, no-extra-parens
2974
- key: e,
2975
- next: t.next,
2976
- value: r
2977
- };
2978
- }, is = function(t, e) {
2979
- return !!Dt(t, e);
2980
- }, ss = function() {
2981
- var e, r, o, i = {
2982
- assert: function(a) {
2983
- if (!i.has(a))
2984
- throw new Yi("Side channel does not contain " + Di(a));
2985
- },
2986
- get: function(a) {
2987
- if (Xe && a && (typeof a == "object" || typeof a == "function")) {
2988
- if (e)
2989
- return Xi(e, a);
2990
- } else if (Ze) {
2991
- if (r)
2992
- return ts(r, a);
2993
- } else if (o)
2994
- return os(o, a);
2995
- },
2996
- has: function(a) {
2997
- if (Xe && a && (typeof a == "object" || typeof a == "function")) {
2998
- if (e)
2999
- return es(e, a);
3000
- } else if (Ze) {
3001
- if (r)
3002
- return ns(r, a);
3003
- } else if (o)
3004
- return is(o, a);
3005
- return !1;
3006
- },
3007
- set: function(a, n) {
3008
- Xe && a && (typeof a == "object" || typeof a == "function") ? (e || (e = new Xe()), Zi(e, a, n)) : Ze ? (r || (r = new Ze()), rs(r, a, n)) : (o || (o = { key: {}, next: null }), as(o, a, n));
3009
- }
3010
- };
3011
- return i;
3012
- }, ls = String.prototype.replace, cs = /%20/g, jt = {
3013
- RFC1738: "RFC1738",
3014
- RFC3986: "RFC3986"
3015
- }, Yt = {
3016
- default: jt.RFC3986,
3017
- formatters: {
3018
- RFC1738: function(t) {
3019
- return ls.call(t, cs, "+");
3020
- },
3021
- RFC3986: function(t) {
3022
- return String(t);
3023
- }
3024
- },
3025
- RFC1738: jt.RFC1738,
3026
- RFC3986: jt.RFC3986
3027
- }, us = Yt, St = Object.prototype.hasOwnProperty, we = Array.isArray, se = function() {
3028
- for (var t = [], e = 0; e < 256; ++e)
3029
- t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
3030
- return t;
3031
- }(), ps = function(e) {
3032
- for (; e.length > 1; ) {
3033
- var r = e.pop(), o = r.obj[r.prop];
3034
- if (we(o)) {
3035
- for (var i = [], a = 0; a < o.length; ++a)
3036
- typeof o[a] < "u" && i.push(o[a]);
3037
- r.obj[r.prop] = i;
3038
- }
3039
- }
3040
- }, gn = function(e, r) {
3041
- for (var o = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, i = 0; i < e.length; ++i)
3042
- typeof e[i] < "u" && (o[i] = e[i]);
3043
- return o;
3044
- }, fs = function t(e, r, o) {
3045
- if (!r)
3046
- return e;
3047
- if (typeof r != "object") {
3048
- if (we(e))
3049
- e.push(r);
3050
- else if (e && typeof e == "object")
3051
- (o && (o.plainObjects || o.allowPrototypes) || !St.call(Object.prototype, r)) && (e[r] = !0);
3052
- else
3053
- return [e, r];
3054
- return e;
3055
- }
3056
- if (!e || typeof e != "object")
3057
- return [e].concat(r);
3058
- var i = e;
3059
- return we(e) && !we(r) && (i = gn(e, o)), we(e) && we(r) ? (r.forEach(function(a, n) {
3060
- if (St.call(e, n)) {
3061
- var s = e[n];
3062
- s && typeof s == "object" && a && typeof a == "object" ? e[n] = t(s, a, o) : e.push(a);
3063
- } else
3064
- e[n] = a;
3065
- }), e) : Object.keys(r).reduce(function(a, n) {
3066
- var s = r[n];
3067
- return St.call(a, n) ? a[n] = t(a[n], s, o) : a[n] = s, a;
3068
- }, i);
3069
- }, ds = function(e, r) {
3070
- return Object.keys(r).reduce(function(o, i) {
3071
- return o[i] = r[i], o;
3072
- }, e);
3073
- }, hs = function(t, e, r) {
3074
- var o = t.replace(/\+/g, " ");
3075
- if (r === "iso-8859-1")
3076
- return o.replace(/%[0-9a-f]{2}/gi, unescape);
3077
- try {
3078
- return decodeURIComponent(o);
3079
- } catch {
3080
- return o;
3081
- }
3082
- }, Ot = 1024, ys = function(e, r, o, i, a) {
3083
- if (e.length === 0)
3084
- return e;
3085
- var n = e;
3086
- if (typeof e == "symbol" ? n = Symbol.prototype.toString.call(e) : typeof e != "string" && (n = String(e)), o === "iso-8859-1")
3087
- return escape(n).replace(/%u[0-9a-f]{4}/gi, function(h) {
3088
- return "%26%23" + parseInt(h.slice(2), 16) + "%3B";
3089
- });
3090
- for (var s = "", l = 0; l < n.length; l += Ot) {
3091
- for (var c = n.length >= Ot ? n.slice(l, l + Ot) : n, u = [], f = 0; f < c.length; ++f) {
3092
- var p = c.charCodeAt(f);
3093
- if (p === 45 || p === 46 || p === 95 || p === 126 || p >= 48 && p <= 57 || p >= 65 && p <= 90 || p >= 97 && p <= 122 || a === us.RFC1738 && (p === 40 || p === 41)) {
3094
- u[u.length] = c.charAt(f);
3095
- continue;
3096
- }
3097
- if (p < 128) {
3098
- u[u.length] = se[p];
3099
- continue;
3100
- }
3101
- if (p < 2048) {
3102
- u[u.length] = se[192 | p >> 6] + se[128 | p & 63];
3103
- continue;
3104
- }
3105
- if (p < 55296 || p >= 57344) {
3106
- u[u.length] = se[224 | p >> 12] + se[128 | p >> 6 & 63] + se[128 | p & 63];
3107
- continue;
3108
- }
3109
- f += 1, p = 65536 + ((p & 1023) << 10 | c.charCodeAt(f) & 1023), u[u.length] = se[240 | p >> 18] + se[128 | p >> 12 & 63] + se[128 | p >> 6 & 63] + se[128 | p & 63];
3110
- }
3111
- s += u.join("");
3112
- }
3113
- return s;
3114
- }, ms = function(e) {
3115
- for (var r = [{ obj: { o: e }, prop: "o" }], o = [], i = 0; i < r.length; ++i)
3116
- for (var a = r[i], n = a.obj[a.prop], s = Object.keys(n), l = 0; l < s.length; ++l) {
3117
- var c = s[l], u = n[c];
3118
- typeof u == "object" && u !== null && o.indexOf(u) === -1 && (r.push({ obj: n, prop: c }), o.push(u));
3119
- }
3120
- return ps(r), e;
3121
- }, gs = function(e) {
3122
- return Object.prototype.toString.call(e) === "[object RegExp]";
3123
- }, bs = function(e) {
3124
- return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
3125
- }, vs = function(e, r) {
3126
- return [].concat(e, r);
3127
- }, xs = function(e, r) {
3128
- if (we(e)) {
3129
- for (var o = [], i = 0; i < e.length; i += 1)
3130
- o.push(r(e[i]));
3131
- return o;
3132
- }
3133
- return r(e);
3134
- }, bn = {
3135
- arrayToObject: gn,
3136
- assign: ds,
3137
- combine: vs,
3138
- compact: ms,
3139
- decode: hs,
3140
- encode: ys,
3141
- isBuffer: bs,
3142
- isRegExp: gs,
3143
- maybeMap: xs,
3144
- merge: fs
3145
- }, vn = ss, rt = bn, ze = Yt, $s = Object.prototype.hasOwnProperty, xn = {
3146
- brackets: function(e) {
3147
- return e + "[]";
3148
- },
3149
- comma: "comma",
3150
- indices: function(e, r) {
3151
- return e + "[" + r + "]";
3152
- },
3153
- repeat: function(e) {
3154
- return e;
3155
- }
3156
- }, le = Array.isArray, ws = Array.prototype.push, $n = function(t, e) {
3157
- ws.apply(t, le(e) ? e : [e]);
3158
- }, js = Date.prototype.toISOString, _r = ze.default, U = {
3159
- addQueryPrefix: !1,
3160
- allowDots: !1,
3161
- allowEmptyArrays: !1,
3162
- arrayFormat: "indices",
3163
- charset: "utf-8",
3164
- charsetSentinel: !1,
3165
- delimiter: "&",
3166
- encode: !0,
3167
- encodeDotInKeys: !1,
3168
- encoder: rt.encode,
3169
- encodeValuesOnly: !1,
3170
- format: _r,
3171
- formatter: ze.formatters[_r],
3172
- // deprecated
3173
- indices: !1,
3174
- serializeDate: function(e) {
3175
- return js.call(e);
3176
- },
3177
- skipNulls: !1,
3178
- strictNullHandling: !1
3179
- }, Ss = function(e) {
3180
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
3181
- }, Tt = {}, Os = function t(e, r, o, i, a, n, s, l, c, u, f, p, h, y, g, b, x, m) {
3182
- for (var v = e, j = m, w = 0, S = !1; (j = j.get(Tt)) !== void 0 && !S; ) {
3183
- var k = j.get(e);
3184
- if (w += 1, typeof k < "u") {
3185
- if (k === w)
3186
- throw new RangeError("Cyclic object value");
3187
- S = !0;
3188
- }
3189
- typeof j.get(Tt) > "u" && (w = 0);
3190
- }
3191
- if (typeof u == "function" ? v = u(r, v) : v instanceof Date ? v = h(v) : o === "comma" && le(v) && (v = rt.maybeMap(v, function($) {
3192
- return $ instanceof Date ? h($) : $;
3193
- })), v === null) {
3194
- if (n)
3195
- return c && !b ? c(r, U.encoder, x, "key", y) : r;
3196
- v = "";
3197
- }
3198
- if (Ss(v) || rt.isBuffer(v)) {
3199
- if (c) {
3200
- var E = b ? r : c(r, U.encoder, x, "key", y);
3201
- return [g(E) + "=" + g(c(v, U.encoder, x, "value", y))];
3202
- }
3203
- return [g(r) + "=" + g(String(v))];
3204
- }
3205
- var R = [];
3206
- if (typeof v > "u")
3207
- return R;
3208
- var F;
3209
- if (o === "comma" && le(v))
3210
- b && c && (v = rt.maybeMap(v, c)), F = [{ value: v.length > 0 ? v.join(",") || null : void 0 }];
3211
- else if (le(u))
3212
- F = u;
3213
- else {
3214
- var te = Object.keys(v);
3215
- F = f ? te.sort(f) : te;
3216
- }
3217
- var re = l ? r.replace(/\./g, "%2E") : r, L = i && le(v) && v.length === 1 ? re + "[]" : re;
3218
- if (a && le(v) && v.length === 0)
3219
- return L + "[]";
3220
- for (var V = 0; V < F.length; ++V) {
3221
- var Q = F[V], Y = typeof Q == "object" && typeof Q.value < "u" ? Q.value : v[Q];
3222
- if (!(s && Y === null)) {
3223
- var he = p && l ? Q.replace(/\./g, "%2E") : Q, ft = le(v) ? typeof o == "function" ? o(L, he) : L : L + (p ? "." + he : "[" + he + "]");
3224
- m.set(e, w);
3225
- var Ke = vn();
3226
- Ke.set(Tt, m), $n(R, t(
3227
- Y,
3228
- ft,
3229
- o,
3230
- i,
3231
- a,
3232
- n,
3233
- s,
3234
- l,
3235
- o === "comma" && b && le(v) ? null : c,
3236
- u,
3237
- f,
3238
- p,
3239
- h,
3240
- y,
3241
- g,
3242
- b,
3243
- x,
3244
- Ke
3245
- ));
3246
- }
3247
- }
3248
- return R;
3249
- }, Ts = function(e) {
3250
- if (!e)
3251
- return U;
3252
- if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
3253
- throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
3254
- if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
3255
- throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
3256
- if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
3257
- throw new TypeError("Encoder has to be a function.");
3258
- var r = e.charset || U.charset;
3259
- if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
3260
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
3261
- var o = ze.default;
3262
- if (typeof e.format < "u") {
3263
- if (!$s.call(ze.formatters, e.format))
3264
- throw new TypeError("Unknown format option provided.");
3265
- o = e.format;
3266
- }
3267
- var i = ze.formatters[o], a = U.filter;
3268
- (typeof e.filter == "function" || le(e.filter)) && (a = e.filter);
3269
- var n;
3270
- if (e.arrayFormat in xn ? n = e.arrayFormat : "indices" in e ? n = e.indices ? "indices" : "repeat" : n = U.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
3271
- throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
3272
- var s = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : U.allowDots : !!e.allowDots;
3273
- return {
3274
- addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : U.addQueryPrefix,
3275
- allowDots: s,
3276
- allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : U.allowEmptyArrays,
3277
- arrayFormat: n,
3278
- charset: r,
3279
- charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : U.charsetSentinel,
3280
- commaRoundTrip: e.commaRoundTrip,
3281
- delimiter: typeof e.delimiter > "u" ? U.delimiter : e.delimiter,
3282
- encode: typeof e.encode == "boolean" ? e.encode : U.encode,
3283
- encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : U.encodeDotInKeys,
3284
- encoder: typeof e.encoder == "function" ? e.encoder : U.encoder,
3285
- encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : U.encodeValuesOnly,
3286
- filter: a,
3287
- format: o,
3288
- formatter: i,
3289
- serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : U.serializeDate,
3290
- skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : U.skipNulls,
3291
- sort: typeof e.sort == "function" ? e.sort : null,
3292
- strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : U.strictNullHandling
3293
- };
3294
- }, Cs = function(t, e) {
3295
- var r = t, o = Ts(e), i, a;
3296
- typeof o.filter == "function" ? (a = o.filter, r = a("", r)) : le(o.filter) && (a = o.filter, i = a);
3297
- var n = [];
3298
- if (typeof r != "object" || r === null)
3299
- return "";
3300
- var s = xn[o.arrayFormat], l = s === "comma" && o.commaRoundTrip;
3301
- i || (i = Object.keys(r)), o.sort && i.sort(o.sort);
3302
- for (var c = vn(), u = 0; u < i.length; ++u) {
3303
- var f = i[u];
3304
- o.skipNulls && r[f] === null || $n(n, Os(
3305
- r[f],
3306
- f,
3307
- s,
3308
- l,
3309
- o.allowEmptyArrays,
3310
- o.strictNullHandling,
3311
- o.skipNulls,
3312
- o.encodeDotInKeys,
3313
- o.encode ? o.encoder : null,
3314
- o.filter,
3315
- o.sort,
3316
- o.allowDots,
3317
- o.serializeDate,
3318
- o.format,
3319
- o.formatter,
3320
- o.encodeValuesOnly,
3321
- o.charset,
3322
- c
3323
- ));
3324
- }
3325
- var p = n.join(o.delimiter), h = o.addQueryPrefix === !0 ? "?" : "";
3326
- return o.charsetSentinel && (o.charset === "iso-8859-1" ? h += "utf8=%26%2310003%3B&" : h += "utf8=%E2%9C%93&"), p.length > 0 ? h + p : "";
3327
- }, Ie = bn, It = Object.prototype.hasOwnProperty, Ps = Array.isArray, q = {
3328
- allowDots: !1,
3329
- allowEmptyArrays: !1,
3330
- allowPrototypes: !1,
3331
- allowSparse: !1,
3332
- arrayLimit: 20,
3333
- charset: "utf-8",
3334
- charsetSentinel: !1,
3335
- comma: !1,
3336
- decodeDotInKeys: !1,
3337
- decoder: Ie.decode,
3338
- delimiter: "&",
3339
- depth: 5,
3340
- duplicates: "combine",
3341
- ignoreQueryPrefix: !1,
3342
- interpretNumericEntities: !1,
3343
- parameterLimit: 1e3,
3344
- parseArrays: !0,
3345
- plainObjects: !1,
3346
- strictDepth: !1,
3347
- strictNullHandling: !1
3348
- }, ks = function(t) {
3349
- return t.replace(/&#(\d+);/g, function(e, r) {
3350
- return String.fromCharCode(parseInt(r, 10));
3351
- });
3352
- }, wn = function(t, e) {
3353
- return t && typeof t == "string" && e.comma && t.indexOf(",") > -1 ? t.split(",") : t;
3354
- }, Es = "utf8=%26%2310003%3B", Ns = "utf8=%E2%9C%93", Rs = function(e, r) {
3355
- var o = { __proto__: null }, i = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
3356
- i = i.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
3357
- var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, n = i.split(r.delimiter, a), s = -1, l, c = r.charset;
3358
- if (r.charsetSentinel)
3359
- for (l = 0; l < n.length; ++l)
3360
- n[l].indexOf("utf8=") === 0 && (n[l] === Ns ? c = "utf-8" : n[l] === Es && (c = "iso-8859-1"), s = l, l = n.length);
3361
- for (l = 0; l < n.length; ++l)
3362
- if (l !== s) {
3363
- var u = n[l], f = u.indexOf("]="), p = f === -1 ? u.indexOf("=") : f + 1, h, y;
3364
- p === -1 ? (h = r.decoder(u, q.decoder, c, "key"), y = r.strictNullHandling ? null : "") : (h = r.decoder(u.slice(0, p), q.decoder, c, "key"), y = Ie.maybeMap(
3365
- wn(u.slice(p + 1), r),
3366
- function(b) {
3367
- return r.decoder(b, q.decoder, c, "value");
3368
- }
3369
- )), y && r.interpretNumericEntities && c === "iso-8859-1" && (y = ks(y)), u.indexOf("[]=") > -1 && (y = Ps(y) ? [y] : y);
3370
- var g = It.call(o, h);
3371
- g && r.duplicates === "combine" ? o[h] = Ie.combine(o[h], y) : (!g || r.duplicates === "last") && (o[h] = y);
3372
- }
3373
- return o;
3374
- }, As = function(t, e, r, o) {
3375
- for (var i = o ? e : wn(e, r), a = t.length - 1; a >= 0; --a) {
3376
- var n, s = t[a];
3377
- if (s === "[]" && r.parseArrays)
3378
- n = r.allowEmptyArrays && (i === "" || r.strictNullHandling && i === null) ? [] : [].concat(i);
3379
- else {
3380
- n = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
3381
- var l = s.charAt(0) === "[" && s.charAt(s.length - 1) === "]" ? s.slice(1, -1) : s, c = r.decodeDotInKeys ? l.replace(/%2E/g, ".") : l, u = parseInt(c, 10);
3382
- !r.parseArrays && c === "" ? n = { 0: i } : !isNaN(u) && s !== c && String(u) === c && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (n = [], n[u] = i) : c !== "__proto__" && (n[c] = i);
3383
- }
3384
- i = n;
3385
- }
3386
- return i;
3387
- }, qs = function(e, r, o, i) {
3388
- if (e) {
3389
- var a = o.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, n = /(\[[^[\]]*])/, s = /(\[[^[\]]*])/g, l = o.depth > 0 && n.exec(a), c = l ? a.slice(0, l.index) : a, u = [];
3390
- if (c) {
3391
- if (!o.plainObjects && It.call(Object.prototype, c) && !o.allowPrototypes)
3392
- return;
3393
- u.push(c);
3394
- }
3395
- for (var f = 0; o.depth > 0 && (l = s.exec(a)) !== null && f < o.depth; ) {
3396
- if (f += 1, !o.plainObjects && It.call(Object.prototype, l[1].slice(1, -1)) && !o.allowPrototypes)
3397
- return;
3398
- u.push(l[1]);
3399
- }
3400
- if (l) {
3401
- if (o.strictDepth === !0)
3402
- throw new RangeError("Input depth exceeded depth option of " + o.depth + " and strictDepth is true");
3403
- u.push("[" + a.slice(l.index) + "]");
3404
- }
3405
- return As(u, r, o, i);
3406
- }
3407
- }, Is = function(e) {
3408
- if (!e)
3409
- return q;
3410
- if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
3411
- throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
3412
- if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
3413
- throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
3414
- if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function")
3415
- throw new TypeError("Decoder has to be a function.");
3416
- if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
3417
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
3418
- var r = typeof e.charset > "u" ? q.charset : e.charset, o = typeof e.duplicates > "u" ? q.duplicates : e.duplicates;
3419
- if (o !== "combine" && o !== "first" && o !== "last")
3420
- throw new TypeError("The duplicates option must be either combine, first, or last");
3421
- var i = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : q.allowDots : !!e.allowDots;
3422
- return {
3423
- allowDots: i,
3424
- allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : q.allowEmptyArrays,
3425
- allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : q.allowPrototypes,
3426
- allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : q.allowSparse,
3427
- arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : q.arrayLimit,
3428
- charset: r,
3429
- charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : q.charsetSentinel,
3430
- comma: typeof e.comma == "boolean" ? e.comma : q.comma,
3431
- decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : q.decodeDotInKeys,
3432
- decoder: typeof e.decoder == "function" ? e.decoder : q.decoder,
3433
- delimiter: typeof e.delimiter == "string" || Ie.isRegExp(e.delimiter) ? e.delimiter : q.delimiter,
3434
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
3435
- depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : q.depth,
3436
- duplicates: o,
3437
- ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
3438
- interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : q.interpretNumericEntities,
3439
- parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : q.parameterLimit,
3440
- parseArrays: e.parseArrays !== !1,
3441
- plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : q.plainObjects,
3442
- strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : q.strictDepth,
3443
- strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : q.strictNullHandling
3444
- };
3445
- }, Ls = function(t, e) {
3446
- var r = Is(e);
3447
- if (t === "" || t === null || typeof t > "u")
3448
- return r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
3449
- for (var o = typeof t == "string" ? Rs(t, r) : t, i = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = Object.keys(o), n = 0; n < a.length; ++n) {
3450
- var s = a[n], l = qs(s, o[s], r, typeof t == "string");
3451
- i = Ie.merge(i, l, r);
3452
- }
3453
- return r.allowSparse === !0 ? i : Ie.compact(i);
3454
- }, Us = Cs, Fs = Ls, _s = Yt, nt = {
3455
- formats: _s,
3456
- parse: Fs,
3457
- stringify: Us
3458
- }, Hs = Sa;
3459
- function ae() {
3460
- this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
3461
- }
3462
- var Bs = /^([a-z0-9.+-]+:)/i, Ms = /:[0-9]*$/, zs = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, Ws = [
3463
- "<",
3464
- ">",
3465
- '"',
3466
- "`",
3467
- " ",
3468
- "\r",
3469
- `
3470
- `,
3471
- " "
3472
- ], Js = [
3473
- "{",
3474
- "}",
3475
- "|",
3476
- "\\",
3477
- "^",
3478
- "`"
3479
- ].concat(Ws), Lt = ["'"].concat(Js), Hr = [
3480
- "%",
3481
- "/",
3482
- "?",
3483
- ";",
3484
- "#"
3485
- ].concat(Lt), Br = [
3486
- "/",
3487
- "?",
3488
- "#"
3489
- ], Gs = 255, Mr = /^[+a-z0-9A-Z_-]{0,63}$/, Vs = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, Qs = {
3490
- javascript: !0,
3491
- "javascript:": !0
3492
- }, Ut = {
3493
- javascript: !0,
3494
- "javascript:": !0
3495
- }, Ne = {
3496
- http: !0,
3497
- https: !0,
3498
- ftp: !0,
3499
- gopher: !0,
3500
- file: !0,
3501
- "http:": !0,
3502
- "https:": !0,
3503
- "ftp:": !0,
3504
- "gopher:": !0,
3505
- "file:": !0
3506
- }, Ft = nt;
3507
- function Xt(t, e, r) {
3508
- if (t && typeof t == "object" && t instanceof ae)
3509
- return t;
3510
- var o = new ae();
3511
- return o.parse(t, e, r), o;
3512
- }
3513
- ae.prototype.parse = function(t, e, r) {
3514
- if (typeof t != "string")
3515
- throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
3516
- var o = t.indexOf("?"), i = o !== -1 && o < t.indexOf("#") ? "?" : "#", a = t.split(i), n = /\\/g;
3517
- a[0] = a[0].replace(n, "/"), t = a.join(i);
3518
- var s = t;
3519
- if (s = s.trim(), !r && t.split("#").length === 1) {
3520
- var l = zs.exec(s);
3521
- if (l)
3522
- return this.path = s, this.href = s, this.pathname = l[1], l[2] ? (this.search = l[2], e ? this.query = Ft.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : e && (this.search = "", this.query = {}), this;
3523
- }
3524
- var c = Bs.exec(s);
3525
- if (c) {
3526
- c = c[0];
3527
- var u = c.toLowerCase();
3528
- this.protocol = u, s = s.substr(c.length);
3529
- }
3530
- if (r || c || s.match(/^\/\/[^@/]+@[^@/]+/)) {
3531
- var f = s.substr(0, 2) === "//";
3532
- f && !(c && Ut[c]) && (s = s.substr(2), this.slashes = !0);
3533
- }
3534
- if (!Ut[c] && (f || c && !Ne[c])) {
3535
- for (var p = -1, h = 0; h < Br.length; h++) {
3536
- var y = s.indexOf(Br[h]);
3537
- y !== -1 && (p === -1 || y < p) && (p = y);
3538
- }
3539
- var g, b;
3540
- p === -1 ? b = s.lastIndexOf("@") : b = s.lastIndexOf("@", p), b !== -1 && (g = s.slice(0, b), s = s.slice(b + 1), this.auth = decodeURIComponent(g)), p = -1;
3541
- for (var h = 0; h < Hr.length; h++) {
3542
- var y = s.indexOf(Hr[h]);
3543
- y !== -1 && (p === -1 || y < p) && (p = y);
3544
- }
3545
- p === -1 && (p = s.length), this.host = s.slice(0, p), s = s.slice(p), this.parseHost(), this.hostname = this.hostname || "";
3546
- var x = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
3547
- if (!x)
3548
- for (var m = this.hostname.split(/\./), h = 0, v = m.length; h < v; h++) {
3549
- var j = m[h];
3550
- if (j && !j.match(Mr)) {
3551
- for (var w = "", S = 0, k = j.length; S < k; S++)
3552
- j.charCodeAt(S) > 127 ? w += "x" : w += j[S];
3553
- if (!w.match(Mr)) {
3554
- var E = m.slice(0, h), R = m.slice(h + 1), F = j.match(Vs);
3555
- F && (E.push(F[1]), R.unshift(F[2])), R.length && (s = "/" + R.join(".") + s), this.hostname = E.join(".");
3556
- break;
3557
- }
3558
- }
3559
- }
3560
- this.hostname.length > Gs ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), x || (this.hostname = Hs.toASCII(this.hostname));
3561
- var te = this.port ? ":" + this.port : "", re = this.hostname || "";
3562
- this.host = re + te, this.href += this.host, x && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), s[0] !== "/" && (s = "/" + s));
3563
- }
3564
- if (!Qs[u])
3565
- for (var h = 0, v = Lt.length; h < v; h++) {
3566
- var L = Lt[h];
3567
- if (s.indexOf(L) !== -1) {
3568
- var V = encodeURIComponent(L);
3569
- V === L && (V = escape(L)), s = s.split(L).join(V);
3570
- }
3571
- }
3572
- var Q = s.indexOf("#");
3573
- Q !== -1 && (this.hash = s.substr(Q), s = s.slice(0, Q));
3574
- var Y = s.indexOf("?");
3575
- if (Y !== -1 ? (this.search = s.substr(Y), this.query = s.substr(Y + 1), e && (this.query = Ft.parse(this.query)), s = s.slice(0, Y)) : e && (this.search = "", this.query = {}), s && (this.pathname = s), Ne[u] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
3576
- var te = this.pathname || "", he = this.search || "";
3577
- this.path = te + he;
3578
- }
3579
- return this.href = this.format(), this;
3580
- };
3581
- function Ks(t) {
3582
- return typeof t == "string" && (t = Xt(t)), t instanceof ae ? t.format() : ae.prototype.format.call(t);
3583
- }
3584
- ae.prototype.format = function() {
3585
- var t = this.auth || "";
3586
- t && (t = encodeURIComponent(t), t = t.replace(/%3A/i, ":"), t += "@");
3587
- var e = this.protocol || "", r = this.pathname || "", o = this.hash || "", i = !1, a = "";
3588
- this.host ? i = t + this.host : this.hostname && (i = t + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (i += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (a = Ft.stringify(this.query, {
3589
- arrayFormat: "repeat",
3590
- addQueryPrefix: !1
3591
- }));
3592
- var n = this.search || a && "?" + a || "";
3593
- return e && e.substr(-1) !== ":" && (e += ":"), this.slashes || (!e || Ne[e]) && i !== !1 ? (i = "//" + (i || ""), r && r.charAt(0) !== "/" && (r = "/" + r)) : i || (i = ""), o && o.charAt(0) !== "#" && (o = "#" + o), n && n.charAt(0) !== "?" && (n = "?" + n), r = r.replace(/[?#]/g, function(s) {
3594
- return encodeURIComponent(s);
3595
- }), n = n.replace("#", "%23"), e + i + r + n + o;
3596
- };
3597
- ae.prototype.resolve = function(t) {
3598
- return this.resolveObject(Xt(t, !1, !0)).format();
3599
- };
3600
- ae.prototype.resolveObject = function(t) {
3601
- if (typeof t == "string") {
3602
- var e = new ae();
3603
- e.parse(t, !1, !0), t = e;
3604
- }
3605
- for (var r = new ae(), o = Object.keys(this), i = 0; i < o.length; i++) {
3606
- var a = o[i];
3607
- r[a] = this[a];
3608
- }
3609
- if (r.hash = t.hash, t.href === "")
3610
- return r.href = r.format(), r;
3611
- if (t.slashes && !t.protocol) {
3612
- for (var n = Object.keys(t), s = 0; s < n.length; s++) {
3613
- var l = n[s];
3614
- l !== "protocol" && (r[l] = t[l]);
3615
- }
3616
- return Ne[r.protocol] && r.hostname && !r.pathname && (r.pathname = "/", r.path = r.pathname), r.href = r.format(), r;
3617
- }
3618
- if (t.protocol && t.protocol !== r.protocol) {
3619
- if (!Ne[t.protocol]) {
3620
- for (var c = Object.keys(t), u = 0; u < c.length; u++) {
3621
- var f = c[u];
3622
- r[f] = t[f];
3623
- }
3624
- return r.href = r.format(), r;
3625
- }
3626
- if (r.protocol = t.protocol, !t.host && !Ut[t.protocol]) {
3627
- for (var v = (t.pathname || "").split("/"); v.length && !(t.host = v.shift()); )
3628
- ;
3629
- t.host || (t.host = ""), t.hostname || (t.hostname = ""), v[0] !== "" && v.unshift(""), v.length < 2 && v.unshift(""), r.pathname = v.join("/");
3630
- } else
3631
- r.pathname = t.pathname;
3632
- if (r.search = t.search, r.query = t.query, r.host = t.host || "", r.auth = t.auth, r.hostname = t.hostname || t.host, r.port = t.port, r.pathname || r.search) {
3633
- var p = r.pathname || "", h = r.search || "";
3634
- r.path = p + h;
3635
- }
3636
- return r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
3637
- }
3638
- var y = r.pathname && r.pathname.charAt(0) === "/", g = t.host || t.pathname && t.pathname.charAt(0) === "/", b = g || y || r.host && t.pathname, x = b, m = r.pathname && r.pathname.split("/") || [], v = t.pathname && t.pathname.split("/") || [], j = r.protocol && !Ne[r.protocol];
3639
- if (j && (r.hostname = "", r.port = null, r.host && (m[0] === "" ? m[0] = r.host : m.unshift(r.host)), r.host = "", t.protocol && (t.hostname = null, t.port = null, t.host && (v[0] === "" ? v[0] = t.host : v.unshift(t.host)), t.host = null), b = b && (v[0] === "" || m[0] === "")), g)
3640
- r.host = t.host || t.host === "" ? t.host : r.host, r.hostname = t.hostname || t.hostname === "" ? t.hostname : r.hostname, r.search = t.search, r.query = t.query, m = v;
3641
- else if (v.length)
3642
- m || (m = []), m.pop(), m = m.concat(v), r.search = t.search, r.query = t.query;
3643
- else if (t.search != null) {
3644
- if (j) {
3645
- r.host = m.shift(), r.hostname = r.host;
3646
- var w = r.host && r.host.indexOf("@") > 0 ? r.host.split("@") : !1;
3647
- w && (r.auth = w.shift(), r.hostname = w.shift(), r.host = r.hostname);
3648
- }
3649
- return r.search = t.search, r.query = t.query, (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.href = r.format(), r;
3650
- }
3651
- if (!m.length)
3652
- return r.pathname = null, r.search ? r.path = "/" + r.search : r.path = null, r.href = r.format(), r;
3653
- for (var S = m.slice(-1)[0], k = (r.host || t.host || m.length > 1) && (S === "." || S === "..") || S === "", E = 0, R = m.length; R >= 0; R--)
3654
- S = m[R], S === "." ? m.splice(R, 1) : S === ".." ? (m.splice(R, 1), E++) : E && (m.splice(R, 1), E--);
3655
- if (!b && !x)
3656
- for (; E--; E)
3657
- m.unshift("..");
3658
- b && m[0] !== "" && (!m[0] || m[0].charAt(0) !== "/") && m.unshift(""), k && m.join("/").substr(-1) !== "/" && m.push("");
3659
- var F = m[0] === "" || m[0] && m[0].charAt(0) === "/";
3660
- if (j) {
3661
- r.hostname = F ? "" : m.length ? m.shift() : "", r.host = r.hostname;
3662
- var w = r.host && r.host.indexOf("@") > 0 ? r.host.split("@") : !1;
3663
- w && (r.auth = w.shift(), r.hostname = w.shift(), r.host = r.hostname);
3664
- }
3665
- return b = b || r.host && m.length, b && !F && m.unshift(""), m.length > 0 ? r.pathname = m.join("/") : (r.pathname = null, r.path = null), (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = t.auth || r.auth, r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
3666
- };
3667
- ae.prototype.parseHost = function() {
3668
- var t = this.host, e = Ms.exec(t);
3669
- e && (e = e[0], e !== ":" && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t);
3670
- };
3671
- var Ds = Xt, zr = Ks, Ys = (t) => typeof t == "object" && "log" in t && typeof t.log == "object" && "entries" in t.log && Array.isArray(t.log.entries), Xs = class {
3672
- constructor(t, e = {}) {
3673
- this.initCalled = !1, this.entries = [], this.requests = [], this.options = {}, this.options = {
3674
- harIsAlreadyEncoded: !1,
3675
- ...e
3676
- }, this.requests = [], Ys(t) ? this.entries = t.log.entries : this.entries = [
3677
- {
3678
- request: t
3679
- }
3680
- ];
3681
- }
3682
- init() {
3683
- return this.initCalled = !0, this.requests = this.entries.map(({ request: t }) => {
3684
- var r;
3685
- const e = {
3686
- bodySize: 0,
3687
- headersSize: 0,
3688
- headers: [],
3689
- cookies: [],
3690
- httpVersion: "HTTP/1.1",
3691
- queryString: [],
3692
- postData: {
3693
- mimeType: ((r = t.postData) == null ? void 0 : r.mimeType) || "application/octet-stream"
3694
- },
3695
- ...t
3696
- };
3697
- return e.postData && !e.postData.mimeType && (e.postData.mimeType = "application/octet-stream"), this.prepare(e, this.options);
3698
- }), this;
3699
- }
3700
- prepare(t, e) {
3701
- var u, f, p;
3702
- const r = {
3703
- ...t,
3704
- fullUrl: "",
3705
- uriObj: {},
3706
- queryObj: {},
3707
- headersObj: {},
3708
- cookiesObj: {},
3709
- allHeaders: {}
3710
- };
3711
- if (r.queryString && r.queryString.length && (r.queryObj = r.queryString.reduce(ir, {})), r.headers && r.headers.length) {
3712
- const h = /^HTTP\/2/;
3713
- r.headersObj = r.headers.reduce((y, { name: g, value: b }) => {
3714
- const x = h.exec(r.httpVersion) ? g.toLocaleLowerCase() : g;
3715
- return {
3716
- ...y,
3717
- [x]: b
3718
- };
3719
- }, {});
3720
- }
3721
- r.cookies && r.cookies.length && (r.cookiesObj = r.cookies.reduceRight(
3722
- (h, { name: y, value: g }) => ({
3723
- ...h,
3724
- [y]: g
3725
- }),
3726
- {}
3727
- ));
3728
- const o = (u = r.cookies) == null ? void 0 : u.map(({ name: h, value: y }) => e.harIsAlreadyEncoded ? `${h}=${y}` : `${encodeURIComponent(h)}=${encodeURIComponent(y)}`);
3729
- switch (o != null && o.length && (r.allHeaders.cookie = o.join("; ")), r.postData.mimeType) {
3730
- case "multipart/mixed":
3731
- case "multipart/related":
3732
- case "multipart/form-data":
3733
- case "multipart/alternative":
3734
- if (r.postData.text = "", r.postData.mimeType = "multipart/form-data", (f = r.postData) != null && f.params) {
3735
- const h = "---011000010111000001101001", y = `${h}--`, g = `\r
3736
- `, b = (j) => j.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), x = (j) => j.replace(/\r?\n|\r/g, `\r
3737
- `), m = [`--${h}`];
3738
- (p = r.postData) == null || p.params.forEach((j, w) => {
3739
- const S = j.name, k = j.value || "", E = j.fileName || null, R = j.contentType || "application/octet-stream";
3740
- E ? (m.push(
3741
- `Content-Disposition: form-data; name="${b(x(S))}"; filename="${E}"`
3742
- ), m.push(`Content-Type: ${R}`)) : m.push(`Content-Disposition: form-data; name="${b(x(S))}"`), m.push(""), m.push(x(k)), w !== r.postData.params.length - 1 && m.push(`--${h}`);
3743
- }), m.push(`--${y}`), r.postData.boundary = h, r.postData.text = m.join(g);
3744
- const v = J(r.headersObj, "content-type") || "content-type";
3745
- r.headersObj[v] = `multipart/form-data; boundary=${h}`;
3746
- }
3747
- break;
3748
- case "application/x-www-form-urlencoded":
3749
- r.postData.params ? (r.postData.paramsObj = r.postData.params.reduce(ir, {}), r.postData.text = nt.stringify(r.postData.paramsObj)) : r.postData.text = "";
3750
- break;
3751
- case "text/json":
3752
- case "text/x-json":
3753
- case "application/json":
3754
- case "application/x-json":
3755
- if (r.postData.mimeType = "application/json", r.postData.text)
3756
- try {
3757
- r.postData.jsonObj = JSON.parse(r.postData.text);
3758
- } catch {
3759
- r.postData.mimeType = "text/plain";
3760
- }
3761
- break;
3762
- }
3763
- const i = {
3764
- ...r.allHeaders,
3765
- ...r.headersObj
3766
- }, a = Ds(r.url, !0, !0);
3767
- r.queryObj = {
3768
- ...r.queryObj,
3769
- ...a.query
3770
- };
3771
- let n;
3772
- e.harIsAlreadyEncoded ? n = nt.stringify(r.queryObj, {
3773
- encode: !1,
3774
- indices: !1
3775
- }) : n = nt.stringify(r.queryObj, {
3776
- indices: !1
3777
- });
3778
- const s = {
3779
- ...a,
3780
- query: r.queryObj,
3781
- search: n,
3782
- path: n ? `${a.pathname}?${n}` : a.pathname
3783
- }, l = zr({
3784
- ...a,
3785
- query: null,
3786
- search: null
3787
- }), c = zr({
3788
- ...a,
3789
- ...s
3790
- });
3791
- return {
3792
- ...r,
3793
- allHeaders: i,
3794
- fullUrl: c,
3795
- url: l,
3796
- uriObj: s
3797
- };
3798
- }
3799
- convert(t, e, r) {
3800
- this.initCalled || this.init(), !r && e && (r = e);
3801
- const o = ja[t];
3802
- if (!o)
3803
- return !1;
3804
- const { convert: i } = o.clientsById[e || o.info.default];
3805
- return this.requests.map((n) => i(n, r));
3806
- }
3807
- };
3808
- const Zs = ({
3809
- rootMargin: t = "0px",
3810
- threshold: e
3811
- } = {}) => {
3812
- const [r, o] = ve(!1), i = Gr(null);
3813
- return Vr(() => {
3814
- const a = new IntersectionObserver(
3815
- ([s]) => {
3816
- s && o(s.isIntersecting);
3817
- },
3818
- { rootMargin: t, threshold: e }
3819
- ), n = i.current;
3820
- if (n)
3821
- return a.observe(n), () => a.unobserve(n);
3822
- }, [t, e]), [i, r];
3823
- }, el = ee.Root, Wr = ee.CollapsibleTrigger, tl = ee.CollapsibleContent, rl = typeof window < "u" ? Ln : Vr, Zt = ({
3824
- children: t,
3825
- maxHeight: e = 250
3826
- }) => {
3827
- const r = Gr(null), [o, i] = ve(!1), [a, n] = ve(!1);
3828
- return rl(() => {
3829
- const s = r.current;
3830
- if (!s) return;
3831
- i(s.scrollHeight > e);
3832
- const l = new ResizeObserver(() => {
3833
- i(s.scrollHeight > e);
3834
- });
3835
- return l.observe(s), () => l.disconnect();
3836
- }, [e]), /* @__PURE__ */ d.jsxs(
3837
- el,
3838
- {
3839
- className: "group",
3840
- open: a,
3841
- onOpenChange: n,
3842
- style: { "--max-height": `${e}px` },
3843
- children: [
3844
- /* @__PURE__ */ d.jsxs(
3845
- tl,
3846
- {
3847
- forceMount: !0,
3848
- className: D(
3849
- "relative overflow-hidden",
3850
- !a && o && "max-h-[--max-height]"
3851
- ),
3852
- children: [
3853
- !a && o && /* @__PURE__ */ d.jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/90 dark:to-zinc-800/90 z-10" }),
3854
- /* @__PURE__ */ d.jsx("div", { ref: r, children: t }),
3855
- !a && o && /* @__PURE__ */ d.jsx(
3856
- Wr,
3857
- {
3858
- className: "absolute inset-0 grid place-items-center z-10",
3859
- asChild: !0,
3860
- children: /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx(or, { className: "bg-primary/70 border border-accent-foreground/25", children: "Expand code" }) })
3861
- }
3862
- )
3863
- ]
3864
- }
3865
- ),
3866
- o && /* @__PURE__ */ d.jsx(
3867
- "div",
3868
- {
3869
- className: D("flex justify-center w-full mb-2", !a && "hidden"),
3870
- children: /* @__PURE__ */ d.jsx(Wr, { asChild: !0, children: /* @__PURE__ */ d.jsx(or, { className: "border border-accent-foreground/25", children: "Collapse code" }) })
3871
- }
3872
- )
3873
- ]
3874
- }
3875
- );
3876
- }, nl = ({
3877
- server: t,
3878
- servers: e,
3879
- operation: r
3880
- }) => {
3881
- var n, s, l;
3882
- const o = (n = r.parameters) == null ? void 0 : n.filter((c) => c.in === "header").map((c) => {
3883
- var u, f;
3884
- return {
3885
- name: c.name,
3886
- defaultValue: ((f = (u = c.examples) == null ? void 0 : u.find((p) => p.value)) == null ? void 0 : f.value) ?? ""
3887
- };
3888
- }), i = (s = r.parameters) == null ? void 0 : s.filter((c) => c.in === "query").sort((c, u) => c.required && !u.required ? -1 : 1).map((c) => ({
3889
- name: c.name,
3890
- defaultActive: c.required ?? !1,
3891
- isRequired: c.required ?? !1
3892
- })), a = (l = r.parameters) == null ? void 0 : l.filter((c) => c.in === "path").map((c) => ({ name: c.name }));
3893
- return /* @__PURE__ */ d.jsx(
3894
- Bn,
3895
- {
3896
- server: t,
3897
- servers: e,
3898
- method: r.method,
3899
- url: r.path,
3900
- headers: o,
3901
- queryParams: i,
3902
- pathParams: a
3903
- }
3904
- );
3905
- }, er = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
3906
- "div",
3907
- {
3908
- className: D(
3909
- "rounded-lg overflow-hidden border dark:border-transparent",
3910
- e
3911
- ),
3912
- children: t
3913
- }
3914
- ), tr = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
3915
- "div",
3916
- {
3917
- className: D(
3918
- "border-b dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
3919
- e
3920
- ),
3921
- children: t
3922
- }
3923
- ), rr = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
3924
- "div",
3925
- {
3926
- className: D("bg-zinc-50 dark:bg-zinc-800 overflow-auto p-2", e),
3927
- children: t
3928
- }
3929
- ), jn = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
3930
- "div",
3931
- {
3932
- className: D(
3933
- "border-t dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
3934
- e
3935
- ),
3936
- children: t
3937
- }
3938
- ), Re = (t, e) => {
3939
- if (t.example !== void 0)
3940
- return t.example;
3941
- if (t.examples)
3942
- return Object.values(t.examples)[0];
3943
- if (t.default !== void 0)
3944
- return t.default;
3945
- if (t.properties || t.type === "object") {
3946
- const r = {};
3947
- if (t.properties)
3948
- for (const [o, i] of Object.entries(t.properties))
3949
- r[o] = Re(i, o);
3950
- return r;
3951
- }
3952
- if (t.type === "array")
3953
- return Array.isArray(t.items) ? t.items.map(
3954
- (r) => Re(r)
3955
- ) : t.items ? [Re(t.items)] : [];
3956
- if (t.enum)
3957
- return t.enum[0];
3958
- switch (t.type) {
3959
- case "string":
3960
- return e || "string";
3961
- case "number":
3962
- case "integer":
3963
- return 0;
3964
- case "boolean":
3965
- return !0;
3966
- case "null":
3967
- return null;
3968
- case void 0:
3969
- default:
3970
- return {};
3971
- }
3972
- }, ol = ({ content: t }) => {
3973
- var o, i;
3974
- if (!t.length) return null;
3975
- const e = t.at(0), r = ((i = (o = e == null ? void 0 : e.examples) == null ? void 0 : o.at(0)) == null ? void 0 : i.value) ?? (e != null && e.schema ? Re(e.schema) : "");
3976
- return /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsxs(er, { children: [
3977
- /* @__PURE__ */ d.jsx(tr, { className: "text-xs flex justify-between items-center", children: /* @__PURE__ */ d.jsx("span", { className: "font-mono", children: "Request Body Example" }) }),
3978
- /* @__PURE__ */ d.jsx(rr, { className: "p-0", children: /* @__PURE__ */ d.jsx(Zt, { children: /* @__PURE__ */ d.jsx(
3979
- Mt,
3980
- {
3981
- language: r ? "json" : "plain",
3982
- noBackground: !0,
3983
- copyable: !0,
3984
- className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2",
3985
- code: r ? JSON.stringify(r, null, 2) : "No example"
3986
- }
3987
- ) }) })
3988
- ] }) });
3989
- }, al = ({
3990
- responses: t,
3991
- selectedResponse: e,
3992
- onSelectResponse: r
3993
- }) => {
3994
- var o;
3995
- return /* @__PURE__ */ d.jsx(er, { children: /* @__PURE__ */ d.jsxs(
3996
- De.Root,
3997
- {
3998
- defaultValue: (o = t[0]) == null ? void 0 : o.statusCode,
3999
- value: e,
4000
- onValueChange: (i) => r(i),
4001
- children: [
4002
- /* @__PURE__ */ d.jsxs(tr, { className: "text-xs flex flex-col gap-2 pb-0", children: [
4003
- /* @__PURE__ */ d.jsx("span", { className: "font-mono", children: "Example Responses" }),
4004
- /* @__PURE__ */ d.jsx(De.List, { className: "flex gap-2", children: t.map((i) => /* @__PURE__ */ d.jsx(
4005
- De.Trigger,
4006
- {
4007
- value: i.statusCode,
4008
- className: D(
4009
- "text-xs font-mono px-1.5 py-1 pb-px translate-y-px border-b-2 border-transparent rounded-t cursor-pointer",
4010
- "data-[state=active]:text-primary data-[state=active]:dark:text-inherit data-[state=active]:border-primary",
4011
- "hover:border-accent-foreground/25"
4012
- ),
4013
- children: i.statusCode
4014
- },
4015
- i.statusCode
4016
- )) })
4017
- ] }),
4018
- t.map((i) => {
4019
- var s, l, c;
4020
- const a = (s = i.content) == null ? void 0 : s.at(0), n = ((c = (l = a == null ? void 0 : a.examples) == null ? void 0 : l.at(0)) == null ? void 0 : c.value) ?? (a != null && a.schema ? Re(a.schema) : "");
4021
- return /* @__PURE__ */ d.jsxs(De.Content, { value: i.statusCode, children: [
4022
- /* @__PURE__ */ d.jsx(rr, { className: "p-0", children: /* @__PURE__ */ d.jsx(Zt, { children: /* @__PURE__ */ d.jsx(
4023
- Mt,
4024
- {
4025
- language: n ? "json" : "plain",
4026
- noBackground: !0,
4027
- className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2",
4028
- code: n ? JSON.stringify(n, null, 2) : "Empty response"
4029
- }
4030
- ) }) }),
4031
- /* @__PURE__ */ d.jsx(jn, { className: "flex justify-end text-xs", children: i.description })
4032
- ] }, i.statusCode);
4033
- })
4034
- ]
4035
- }
4036
- ) });
4037
- }, il = (t, e) => {
4038
- let r;
4039
- switch (e) {
4040
- case "shell":
4041
- r = t.convert("shell", "curl");
4042
- break;
4043
- case "js":
4044
- r = t.convert("javascript", "fetch");
4045
- break;
4046
- case "python":
4047
- r = t.convert("python", "requests");
4048
- break;
4049
- case "java":
4050
- r = t.convert("java", "okhttp");
4051
- break;
4052
- case "go":
4053
- r = t.convert("go", "native");
4054
- break;
4055
- case "csharp":
4056
- r = t.convert("csharp", "httpclient");
4057
- break;
4058
- case "kotlin":
4059
- r = t.convert("kotlin", "okhttp");
4060
- break;
4061
- case "objc":
4062
- r = t.convert("objc", "nsurlsession");
4063
- break;
4064
- case "php":
4065
- r = t.convert("php", "http2");
4066
- break;
4067
- case "ruby":
4068
- r = t.convert("ruby");
4069
- break;
4070
- case "swift":
4071
- r = t.convert("swift");
4072
- break;
4073
- default:
4074
- r = t.convert("shell");
4075
- break;
4076
- }
4077
- return r ? r[0] : "";
4078
- }, sl = ut(
4079
- /* GraphQL */
4080
- `
4081
- query getServerQuery($input: JSON!, $type: SchemaType!) {
4082
- schema(input: $input, type: $type) {
4083
- url
4084
- servers {
4085
- url
4086
- }
4087
- }
4088
- }
4089
- `
4090
- ), ll = {
4091
- get: fe.green,
4092
- post: fe.blue,
4093
- put: fe.yellow,
4094
- delete: fe.red,
4095
- patch: fe.purple,
4096
- options: fe.indigo,
4097
- head: fe.gray,
4098
- trace: fe.gray
4099
- }, cl = [
4100
- { value: "shell", label: "cURL" },
4101
- { value: "js", label: "JavaScript" },
4102
- { value: "python", label: "Python" },
4103
- { value: "java", label: "Java" },
4104
- { value: "go", label: "Go" },
4105
- { value: "csharp", label: "C#" },
4106
- { value: "kotlin", label: "Kotlin" },
4107
- { value: "objc", label: "Objective-C" },
4108
- { value: "php", label: "PHP" },
4109
- { value: "ruby", label: "Ruby" },
4110
- { value: "swift", label: "Swift" }
4111
- ], ul = ({
4112
- operation: t,
4113
- selectedResponse: e,
4114
- onSelectResponse: r
4115
- }) => {
4116
- var m;
4117
- const { input: o, type: i } = Bt(), a = zt(sl, { input: o, type: i }), n = Ht(a), s = ll[t.method.toLocaleLowerCase()] ?? fe.gray, [l, c] = Zn(), [, u] = Jr(), f = l.get("lang") ?? "shell", p = (m = t.requestBody) == null ? void 0 : m.content, h = t.path.split("/").map((v, j, w) => {
4118
- const k = v.startsWith("{") && v.endsWith("}") || v.startsWith(":") ? v.replace(/[:{}]/g, "") : void 0;
4119
- return (
4120
- // eslint-disable-next-line react/no-array-index-key
4121
- /* @__PURE__ */ d.jsxs(Un, { children: [
4122
- k ? /* @__PURE__ */ d.jsx(
4123
- Yr,
4124
- {
4125
- name: k,
4126
- backgroundOpacity: "0",
4127
- slug: `${t.slug}-${k.toLocaleLowerCase()}`,
4128
- children: v
4129
- }
4130
- ) : v,
4131
- j < w.length - 1 ? "/" : null,
4132
- /* @__PURE__ */ d.jsx("wbr", {})
4133
- ] }, v + j)
4134
- );
4135
- }), { selectedServer: y } = Qr(), g = Fn(() => {
4136
- var w;
4137
- const v = (w = p == null ? void 0 : p[0]) != null && w.schema ? Re(p[0].schema) : void 0, j = new Xs({
4138
- method: t.method.toLocaleUpperCase(),
4139
- url: (y ?? n.data.schema.url ?? "") + t.path.replaceAll("{", ":").replaceAll("}", ""),
4140
- postData: v ? {
4141
- text: JSON.stringify(v, null, 2),
4142
- mimeType: "application/json"
4143
- } : {},
4144
- headers: [],
4145
- queryString: [],
4146
- httpVersion: "",
4147
- cookies: [],
4148
- headersSize: 0,
4149
- bodySize: 0
4150
- });
4151
- return il(j, f);
4152
- }, [
4153
- p,
4154
- t.method,
4155
- t.path,
4156
- y,
4157
- n.data.schema.url,
4158
- f
4159
- ]), [b, x] = Zs({ rootMargin: "200px 0px 200px 0px" });
4160
- return /* @__PURE__ */ d.jsxs(
4161
- "aside",
4162
- {
4163
- ref: b,
4164
- className: "flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4",
4165
- children: [
4166
- /* @__PURE__ */ d.jsxs(er, { children: [
4167
- /* @__PURE__ */ d.jsxs(tr, { className: "flex justify-between items-center flex-nowrap py-3 gap-2 text-xs", children: [
4168
- /* @__PURE__ */ d.jsxs("span", { className: "font-mono break-words", children: [
4169
- /* @__PURE__ */ d.jsx("span", { className: D("font-semibold", s), children: t.method.toLocaleUpperCase() }),
4170
- " ",
4171
- h
4172
- ] }),
4173
- x && /* @__PURE__ */ d.jsx(
4174
- nl,
4175
- {
4176
- server: n.data.schema.url ?? "",
4177
- servers: n.data.schema.servers.map((v) => v.url) ?? [],
4178
- operation: t
4179
- }
4180
- )
4181
- ] }),
4182
- x && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
4183
- /* @__PURE__ */ d.jsx(rr, { className: "p-0", children: /* @__PURE__ */ d.jsx(Zt, { children: /* @__PURE__ */ d.jsx(
4184
- Mt,
4185
- {
4186
- language: f,
4187
- noBackground: !0,
4188
- className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2",
4189
- code: g
4190
- }
4191
- ) }) }),
4192
- /* @__PURE__ */ d.jsxs(jn, { className: "flex items-center text-xs gap-2 justify-end py-1", children: [
4193
- /* @__PURE__ */ d.jsx("span", { children: "Show example in" }),
4194
- /* @__PURE__ */ d.jsx(
4195
- Dr,
4196
- {
4197
- className: "self-start max-w-[150px]",
4198
- value: f,
4199
- onChange: (v) => {
4200
- u(() => {
4201
- c((j) => (j.set("lang", v.target.value), j));
4202
- });
4203
- },
4204
- options: cl
4205
- }
4206
- )
4207
- ] })
4208
- ] })
4209
- ] }),
4210
- x && p && /* @__PURE__ */ d.jsx(ol, { content: p }),
4211
- x && t.responses.length > 0 && /* @__PURE__ */ d.jsx(
4212
- al,
4213
- {
4214
- selectedResponse: e,
4215
- onSelectResponse: r,
4216
- responses: t.responses
4217
- }
4218
- )
4219
- ]
4220
- }
4221
- );
4222
- }, pl = (t) => Object.entries(t), fl = {
4223
- AND: /* @__PURE__ */ d.jsx(kn, { size: 16, className: "fill-card" }),
4224
- OR: /* @__PURE__ */ d.jsx(En, { size: 16, className: "fill-card" }),
4225
- ONE: /* @__PURE__ */ d.jsx(Nn, { size: 14, className: "fill-card" })
4226
- }, dl = {
4227
- AND: "text-green-500 dark:text-green-300/60",
4228
- OR: "text-blue-400 dark:text-blue-500",
4229
- ONE: "text-purple-500 dark:text-purple-300/60"
4230
- }, hl = ({
4231
- type: t,
4232
- isOpen: e,
4233
- className: r
4234
- }) => /* @__PURE__ */ d.jsx(
4235
- "div",
4236
- {
4237
- className: D(
4238
- dl[t],
4239
- "relative text-sm flex py-2",
4240
- "before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
4241
- r
4242
- ),
4243
- children: /* @__PURE__ */ d.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
4244
- fl[t],
4245
- /* @__PURE__ */ d.jsx(
4246
- "div",
4247
- {
4248
- className: D(
4249
- "translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
4250
- !e && "-rotate-90"
4251
- ),
4252
- children: /* @__PURE__ */ d.jsx(Pn, { size: 16 })
4253
- }
4254
- )
4255
- ] })
4256
- }
4257
- ), yl = (t) => {
4258
- const [e, r] = ve(!0);
4259
- return /* @__PURE__ */ d.jsxs(
4260
- ee.Root,
4261
- {
4262
- open: e,
4263
- onOpenChange: () => r((o) => !o),
4264
- className: "group",
4265
- children: [
4266
- /* @__PURE__ */ d.jsx(ee.Trigger, { children: /* @__PURE__ */ d.jsx(hl, { type: t.type, isOpen: e }) }),
4267
- !e && /* @__PURE__ */ d.jsx("div", { className: "wavy-line bg-border translate-y-1" }),
4268
- /* @__PURE__ */ d.jsx(ee.Content, { children: /* @__PURE__ */ d.jsx(Ge, { schema: t.schema, level: t.level + 1 }) })
4269
- ]
4270
- }
4271
- );
4272
- }, ml = {
4273
- AND: "All of",
4274
- OR: "Any of",
4275
- ONE: "One of"
4276
- }, gl = ({
4277
- schemas: t,
4278
- type: e,
4279
- isOpen: r,
4280
- level: o,
4281
- toggleOpen: i
4282
- }) => /* @__PURE__ */ d.jsx(ee.Root, { open: r, onOpenChange: i, asChild: !0, children: /* @__PURE__ */ d.jsxs(de, { className: "px-6", children: [
4283
- /* @__PURE__ */ d.jsxs(ee.Trigger, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5", children: [
4284
- r ? /* @__PURE__ */ d.jsx(Rn, { size: 14 }) : /* @__PURE__ */ d.jsx(An, { size: 14 }),
4285
- /* @__PURE__ */ d.jsx("span", { children: ml[e] })
4286
- ] }),
4287
- /* @__PURE__ */ d.jsx(ee.Content, { className: "pb-4", children: t.map((a, n) => (
4288
- // eslint-disable-next-line react/no-array-index-key
4289
- /* @__PURE__ */ d.jsx(
4290
- yl,
4291
- {
4292
- type: e,
4293
- schema: a,
4294
- level: o
4295
- },
4296
- n
4297
- )
4298
- )) })
4299
- ] }) }), bl = (t) => t.type === "object" || t.type === "array" && typeof t.items == "object" && (!t.items.type || t.items.type === "object"), _t = (t) => !!(t.oneOf ?? t.allOf ?? t.anyOf), vl = {
4300
- allOf: "AND",
4301
- anyOf: "OR",
4302
- oneOf: "ONE"
4303
- }, Sn = ({
4304
- schema: t,
4305
- level: e
4306
- }) => {
4307
- const [r, o] = ve(!0), i = _n(() => o((a) => !a), []);
4308
- for (const [a, n] of pl(vl))
4309
- if (t[a])
4310
- return /* @__PURE__ */ d.jsx(
4311
- gl,
4312
- {
4313
- schemas: t[a],
4314
- type: n,
4315
- isOpen: r,
4316
- toggleOpen: i,
4317
- level: e
4318
- }
4319
- );
4320
- }, xl = ({
4321
- name: t,
4322
- schema: e,
4323
- group: r,
4324
- level: o,
4325
- defaultOpen: i = !1,
4326
- showCollapseButton: a = !0
4327
- }) => {
4328
- const [n, s] = ve(i);
4329
- return /* @__PURE__ */ d.jsx("li", { className: "p-4 bg-border/20 hover:bg-border/30", children: /* @__PURE__ */ d.jsxs("div", { className: "flex flex-col gap-1 justify-between text-sm", children: [
4330
- /* @__PURE__ */ d.jsxs("div", { className: "flex gap-2 items-center", children: [
4331
- /* @__PURE__ */ d.jsx("code", { children: t }),
4332
- /* @__PURE__ */ d.jsx("span", { className: "text-muted-foreground", children: e.type === "array" && e.items.type ? /* @__PURE__ */ d.jsxs("span", { children: [
4333
- e.items.type,
4334
- "[]"
4335
- ] }) : Array.isArray(e.type) ? /* @__PURE__ */ d.jsx("span", { children: e.type.join(" | ") }) : /* @__PURE__ */ d.jsx("span", { children: e.type }) }),
4336
- r === "optional" && /* @__PURE__ */ d.jsx("span", { className: "py-px px-1.5 font-medium border rounded-lg", children: "optional" })
4337
- ] }),
4338
- e.description && /* @__PURE__ */ d.jsx(
4339
- be,
4340
- {
4341
- className: D(je, "text-sm leading-normal line-clamp-4"),
4342
- content: e.description
4343
- }
4344
- ),
4345
- (_t(e) || bl(e)) && /* @__PURE__ */ d.jsxs(
4346
- ee.Root,
4347
- {
4348
- defaultOpen: i,
4349
- open: n,
4350
- onOpenChange: () => s(!n),
4351
- children: [
4352
- a && /* @__PURE__ */ d.jsx(ee.Trigger, { asChild: !0, children: /* @__PURE__ */ d.jsxs(
4353
- Kr,
4354
- {
4355
- variant: "outline",
4356
- size: "sm",
4357
- className: "mt-2 flex gap-1.5",
4358
- children: [
4359
- /* @__PURE__ */ d.jsx(qn, { size: 18 }),
4360
- n ? "Hide nested properties" : "Show nested properties"
4361
- ]
4362
- }
4363
- ) }),
4364
- /* @__PURE__ */ d.jsx(ee.Content, { children: /* @__PURE__ */ d.jsx("div", { className: "mt-2", children: _t(e) ? /* @__PURE__ */ d.jsx(Sn, { schema: e, level: o + 1 }) : e.type === "object" ? /* @__PURE__ */ d.jsx(Ge, { schema: e, level: o + 1 }) : e.type === "array" && typeof e.items == "object" && /* @__PURE__ */ d.jsx(Ge, { schema: e.items, level: o + 1 }) }) })
4365
- ]
4366
- }
4367
- )
4368
- ] }) });
4369
- }, Ge = ({
4370
- schema: t,
4371
- level: e = 0,
4372
- defaultOpen: r = !1
4373
- }) => {
4374
- if (!t || Object.keys(t).length === 0)
4375
- return /* @__PURE__ */ d.jsx(de, { className: "p-4", children: /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No response specified" }) });
4376
- const o = (i, a) => {
4377
- if (_t(i))
4378
- return /* @__PURE__ */ d.jsx(Sn, { schema: i, level: a });
4379
- if (i.type === "array" && i.items) {
4380
- const n = i.items;
4381
- return typeof n.type == "string" && ["string", "number", "boolean", "integer"].includes(n.type) ? /* @__PURE__ */ d.jsxs(de, { className: "p-4", children: [
4382
- /* @__PURE__ */ d.jsxs("span", { className: "text-sm text-muted-foreground", children: [
4383
- n.type,
4384
- "[]"
4385
- ] }),
4386
- i.description && /* @__PURE__ */ d.jsx(
4387
- be,
4388
- {
4389
- className: D(
4390
- je,
4391
- "text-sm leading-normal line-clamp-4"
4392
- ),
4393
- content: i.description
4394
- }
4395
- )
4396
- ] }) : n.type === "object" ? /* @__PURE__ */ d.jsxs(de, { className: "flex flex-col gap-2 bg-border/30 p-4", children: [
4397
- /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children: "object[]" }),
4398
- o(n, a + 1)
4399
- ] }) : o(n, a + 1);
4400
- }
4401
- if (i.type === "object" && (!i.properties || Object.keys(i.properties).length === 0))
4402
- return /* @__PURE__ */ d.jsxs(de, { className: "p-4 flex gap-2 items-center", children: [
4403
- "name" in i && /* @__PURE__ */ d.jsx(d.Fragment, { children: i.name }),
4404
- /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children: "object" }),
4405
- i.description && /* @__PURE__ */ d.jsx(
4406
- be,
4407
- {
4408
- className: D(
4409
- je,
4410
- "text-sm leading-normal line-clamp-4"
4411
- ),
4412
- content: i.description
4413
- }
4414
- )
4415
- ] });
4416
- if (i.properties) {
4417
- const n = Xr(
4418
- Object.entries(i.properties),
4419
- ([l, c]) => {
4420
- var u;
4421
- return c.deprecated ? "deprecated" : (u = i.required) != null && u.includes(l) ? "required" : "optional";
4422
- }
4423
- ), s = ["required", "optional", "deprecated"];
4424
- return /* @__PURE__ */ d.jsx(de, { className: "divide-y overflow-hidden", children: s.map(
4425
- (l) => n[l] && /* @__PURE__ */ d.jsx("ul", { className: "divide-y", children: n[l].map(([c, u]) => /* @__PURE__ */ d.jsx(
4426
- xl,
4427
- {
4428
- name: c,
4429
- schema: u,
4430
- group: l,
4431
- level: a,
4432
- defaultOpen: r
4433
- },
4434
- c
4435
- )) }, l)
4436
- ) });
4437
- }
4438
- return typeof i.type == "string" && ["string", "number", "boolean", "integer", "null"].includes(i.type) ? /* @__PURE__ */ d.jsxs(de, { className: "p-4", children: [
4439
- /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children: i.type }),
4440
- i.description && /* @__PURE__ */ d.jsx(
4441
- be,
4442
- {
4443
- className: D(
4444
- je,
4445
- "text-sm leading-normal line-clamp-4"
4446
- ),
4447
- content: i.description
4448
- }
4449
- )
4450
- ] }) : i.additionalProperties ? /* @__PURE__ */ d.jsxs(de, { className: "my-2", children: [
4451
- /* @__PURE__ */ d.jsx(Vn, { children: /* @__PURE__ */ d.jsx(Qn, { children: "Additional Properties:" }) }),
4452
- /* @__PURE__ */ d.jsx(Kn, { children: o(
4453
- i.additionalProperties,
4454
- a + 1
4455
- ) })
4456
- ] }) : null;
4457
- };
4458
- return o(t, e);
4459
- }, $l = ["path", "query", "header", "cookie"], wl = ({
4460
- operationFragment: t
4461
- }) => {
4462
- var n, s, l;
4463
- const e = eo(jl, t), r = Xr(
4464
- e.parameters ?? [],
4465
- (c) => c.in
4466
- ), o = e.responses.at(0), [i, a] = ve(o == null ? void 0 : o.statusCode);
4467
- return /* @__PURE__ */ d.jsxs(
4468
- "div",
4469
- {
4470
- className: "grid grid-cols-1 lg:grid-cols-[4fr_3fr] gap-8 items-start border-b-2 mb-16 pb-16",
4471
- children: [
4472
- /* @__PURE__ */ d.jsxs("div", { className: "flex flex-col gap-4", children: [
4473
- /* @__PURE__ */ d.jsx(_e, { level: 2, id: e.slug, registerSidebarAnchor: !0, children: e.summary }),
4474
- e.description && /* @__PURE__ */ d.jsx(
4475
- be,
4476
- {
4477
- className: `${je} max-w-full prose-img:max-w-prose`,
4478
- content: e.description
4479
- }
4480
- ),
4481
- e.parameters && e.parameters.length > 0 && /* @__PURE__ */ d.jsx(d.Fragment, { children: $l.flatMap(
4482
- (c) => {
4483
- var u;
4484
- return (u = r[c]) != null && u.length ? /* @__PURE__ */ d.jsx(
4485
- io,
4486
- {
4487
- id: e.slug,
4488
- parameters: r[c],
4489
- group: c
4490
- },
4491
- c
4492
- ) : [];
4493
- }
4494
- ) }),
4495
- no((l = (s = (n = e.requestBody) == null ? void 0 : n.content) == null ? void 0 : s.at(0)) == null ? void 0 : l.schema, (c) => /* @__PURE__ */ d.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
4496
- /* @__PURE__ */ d.jsx(
4497
- _e,
4498
- {
4499
- level: 3,
4500
- className: "capitalize",
4501
- id: `${e.slug}/request-body`,
4502
- registerSidebarAnchor: !0,
4503
- children: "Request Body"
4504
- }
4505
- ),
4506
- /* @__PURE__ */ d.jsx(Ge, { schema: c })
4507
- ] })),
4508
- e.responses.length > 0 && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
4509
- /* @__PURE__ */ d.jsx(
4510
- _e,
4511
- {
4512
- level: 3,
4513
- className: "capitalize mt-8 pt-8 border-t",
4514
- id: `${e.slug}/responses`,
4515
- registerSidebarAnchor: !0,
4516
- children: "Responses"
4517
- }
4518
- ),
4519
- /* @__PURE__ */ d.jsxs(
4520
- Mn,
4521
- {
4522
- onValueChange: (c) => a(c),
4523
- value: i,
4524
- children: [
4525
- e.responses.length > 1 && /* @__PURE__ */ d.jsx(zn, { children: e.responses.map((c) => /* @__PURE__ */ d.jsx(
4526
- Wn,
4527
- {
4528
- value: c.statusCode,
4529
- title: c.description ?? void 0,
4530
- children: c.statusCode
4531
- },
4532
- c.statusCode
4533
- )) }),
4534
- /* @__PURE__ */ d.jsx("ul", { className: "list-none m-0 px-0", children: e.responses.map((c) => {
4535
- var u, f;
4536
- return /* @__PURE__ */ d.jsx(
4537
- Jn,
4538
- {
4539
- value: c.statusCode,
4540
- children: /* @__PURE__ */ d.jsx(
4541
- Ge,
4542
- {
4543
- schema: (f = (u = c.content) == null ? void 0 : u.find((p) => p.schema)) == null ? void 0 : f.schema
4544
- }
4545
- )
4546
- },
4547
- c.statusCode
4548
- );
4549
- }) })
4550
- ]
4551
- }
4552
- )
4553
- ] })
4554
- ] }),
4555
- /* @__PURE__ */ d.jsx(
4556
- ul,
4557
- {
4558
- selectedResponse: i,
4559
- onSelectResponse: a,
4560
- operation: e
4561
- }
4562
- )
4563
- ]
4564
- },
4565
- e.operationId
4566
- );
4567
- }, jl = ut(
4568
- /* GraphQL */
4569
- `
4570
- fragment OperationsFragment on OperationItem {
4571
- slug
4572
- summary
4573
- method
4574
- description
4575
- operationId
4576
- contentTypes
4577
- path
4578
- parameters {
4579
- name
4580
- in
4581
- description
4582
- required
4583
- schema
4584
- style
4585
- examples {
4586
- name
4587
- description
4588
- externalValue
4589
- value
4590
- summary
4591
- }
4592
- }
4593
- requestBody {
4594
- content {
4595
- mediaType
4596
- encoding {
4597
- name
4598
- }
4599
- examples {
4600
- name
4601
- description
4602
- externalValue
4603
- value
4604
- summary
4605
- }
4606
- schema
4607
- }
4608
- description
4609
- required
4610
- }
4611
- responses {
4612
- statusCode
4613
- links
4614
- description
4615
- content {
4616
- examples {
4617
- name
4618
- description
4619
- externalValue
4620
- value
4621
- summary
4622
- }
4623
- mediaType
4624
- encoding {
4625
- name
4626
- }
4627
- schema
4628
- }
4629
- }
4630
- }
4631
- `
4632
- ), Sl = ut(
4633
- /* GraphQL */
4634
- `
4635
- query AllOperations($input: JSON!, $type: SchemaType!) {
4636
- schema(input: $input, type: $type) {
4637
- description
4638
- title
4639
- url
4640
- version
4641
- tags {
4642
- name
4643
- description
4644
- operations {
4645
- slug
4646
- ...OperationsFragment
4647
- }
4648
- }
4649
- }
4650
- }
4651
- `
4652
- ), Wl = () => {
4653
- const { input: t, type: e } = Bt(), r = zt(Sl, { input: t, type: e }), o = Ht(r);
4654
- return /* @__PURE__ */ d.jsxs("div", { className: "pt-[--padding-content-top]", children: [
4655
- /* @__PURE__ */ d.jsxs(
4656
- "div",
4657
- {
4658
- className: D(je, "mb-16 max-w-full prose-img:max-w-prose"),
4659
- children: [
4660
- /* @__PURE__ */ d.jsx(nr, { children: "Overview" }),
4661
- /* @__PURE__ */ d.jsx(_e, { level: 1, id: "description", registerSidebarAnchor: !0, children: o.data.schema.title }),
4662
- /* @__PURE__ */ d.jsx(be, { content: o.data.schema.description ?? "" })
4663
- ]
4664
- }
4665
- ),
4666
- /* @__PURE__ */ d.jsx("hr", {}),
4667
- /* @__PURE__ */ d.jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ d.jsx(ro, {}) }),
4668
- o.data.schema.tags.filter((i) => i.operations.length > 0).map((i) => /* @__PURE__ */ d.jsxs("div", { className: "[content-visibility:auto]", children: [
4669
- i.name && /* @__PURE__ */ d.jsx(nr, { children: i.name }),
4670
- i.description && /* @__PURE__ */ d.jsx(
4671
- be,
4672
- {
4673
- className: `${je} max-w-full prose-img:max-w-prose w-full mt-2 mb-12`,
4674
- content: i.description
4675
- }
4676
- ),
4677
- /* @__PURE__ */ d.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ d.jsx(Gn, { children: i.operations.map((a) => /* @__PURE__ */ d.jsx(
4678
- wl,
4679
- {
4680
- operationFragment: a
4681
- },
4682
- a.slug
4683
- )) }) })
4684
- ] }, i.name))
4685
- ] });
4686
- };
4687
- export {
4688
- Wl as OperationList,
4689
- jl as OperationsFragment
4690
- };
4691
- //# sourceMappingURL=OperationList-KshJrrLL.js.map