zudoku 0.0.0-f40ea27 → 0.0.0-f42e3678

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 (420) hide show
  1. package/README.md +2 -2
  2. package/dist/app/demo.js +16 -1
  3. package/dist/app/demo.js.map +1 -1
  4. package/dist/app/main.js +3 -9
  5. package/dist/app/main.js.map +1 -1
  6. package/dist/cli/build/handler.js +9 -1
  7. package/dist/cli/build/handler.js.map +1 -1
  8. package/dist/config/config.d.ts +1 -0
  9. package/dist/config/loader.js +2 -5
  10. package/dist/config/loader.js.map +1 -1
  11. package/dist/config/validators/BuildSchema.js +5 -0
  12. package/dist/config/validators/BuildSchema.js.map +1 -1
  13. package/dist/config/validators/InputNavigationSchema.d.ts +254 -163
  14. package/dist/config/validators/InputNavigationSchema.js +4 -4
  15. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  16. package/dist/config/validators/InputNavigationSchema.test-d.js +0 -1
  17. package/dist/config/validators/InputNavigationSchema.test-d.js.map +1 -1
  18. package/dist/config/validators/NavigationSchema.js +3 -2
  19. package/dist/config/validators/NavigationSchema.js.map +1 -1
  20. package/dist/config/validators/ProtectedRoutesSchema.d.ts +12 -0
  21. package/dist/config/validators/ProtectedRoutesSchema.js +19 -0
  22. package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -0
  23. package/dist/config/validators/icon-types.d.ts +1 -1
  24. package/dist/config/validators/icon-types.js +16 -0
  25. package/dist/config/validators/icon-types.js.map +1 -1
  26. package/dist/config/validators/validate.d.ts +36 -20
  27. package/dist/config/validators/validate.js +18 -4
  28. package/dist/config/validators/validate.js.map +1 -1
  29. package/dist/config/validators/validate.test.js +65 -2
  30. package/dist/config/validators/validate.test.js.map +1 -1
  31. package/dist/flat-config.d.ts +8 -6
  32. package/dist/lib/authentication/authentication.d.ts +2 -0
  33. package/dist/lib/authentication/components/CallbackHandler.js +11 -9
  34. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  35. package/dist/lib/authentication/components/OAuthErrorPage.d.ts +3 -0
  36. package/dist/lib/authentication/components/OAuthErrorPage.js +99 -0
  37. package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -0
  38. package/dist/lib/authentication/components/SignIn.js +4 -3
  39. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  40. package/dist/lib/authentication/errors.d.ts +6 -12
  41. package/dist/lib/authentication/errors.js +2 -1
  42. package/dist/lib/authentication/errors.js.map +1 -1
  43. package/dist/lib/authentication/hook.d.ts +1 -0
  44. package/dist/lib/authentication/hook.js.map +1 -1
  45. package/dist/lib/authentication/providers/azureb2c.js +4 -2
  46. package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
  47. package/dist/lib/authentication/providers/clerk.js +4 -2
  48. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  49. package/dist/lib/authentication/providers/openid.d.ts +4 -2
  50. package/dist/lib/authentication/providers/openid.js +14 -6
  51. package/dist/lib/authentication/providers/openid.js.map +1 -1
  52. package/dist/lib/components/Banner.js +1 -1
  53. package/dist/lib/components/Banner.js.map +1 -1
  54. package/dist/lib/components/CategoryHeading.js +1 -1
  55. package/dist/lib/components/CategoryHeading.js.map +1 -1
  56. package/dist/lib/components/Header.js +1 -1
  57. package/dist/lib/components/Header.js.map +1 -1
  58. package/dist/lib/components/Heading.js +1 -1
  59. package/dist/lib/components/Heading.js.map +1 -1
  60. package/dist/lib/components/Markdown.js +2 -2
  61. package/dist/lib/components/Markdown.js.map +1 -1
  62. package/dist/lib/components/MobileTopNavigation.js +11 -6
  63. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  64. package/dist/lib/components/NotFoundPage.js +1 -1
  65. package/dist/lib/components/NotFoundPage.js.map +1 -1
  66. package/dist/lib/components/Pagination.js +1 -1
  67. package/dist/lib/components/Pagination.js.map +1 -1
  68. package/dist/lib/components/StatusPage.js +4 -0
  69. package/dist/lib/components/StatusPage.js.map +1 -1
  70. package/dist/lib/components/TopNavigation.d.ts +5 -0
  71. package/dist/lib/components/TopNavigation.js +20 -15
  72. package/dist/lib/components/TopNavigation.js.map +1 -1
  73. package/dist/lib/components/Typography.d.ts +1 -1
  74. package/dist/lib/components/Typography.js +1 -1
  75. package/dist/lib/components/Typography.js.map +1 -1
  76. package/dist/lib/components/context/ZudokuContext.js +21 -13
  77. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  78. package/dist/lib/components/navigation/NavigationItem.d.ts +1 -1
  79. package/dist/lib/components/navigation/NavigationItem.js +8 -1
  80. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  81. package/dist/lib/components/navigation/NavigationWrapper.js +1 -1
  82. package/dist/lib/components/navigation/NavigationWrapper.js.map +1 -1
  83. package/dist/lib/components/navigation/utils.d.ts +3 -1
  84. package/dist/lib/components/navigation/utils.js +6 -3
  85. package/dist/lib/components/navigation/utils.js.map +1 -1
  86. package/dist/lib/core/RouteGuard.js +9 -9
  87. package/dist/lib/core/RouteGuard.js.map +1 -1
  88. package/dist/lib/core/ZudokuContext.d.ts +5 -2
  89. package/dist/lib/core/ZudokuContext.js +27 -2
  90. package/dist/lib/core/ZudokuContext.js.map +1 -1
  91. package/dist/lib/core/plugins.d.ts +2 -1
  92. package/dist/lib/core/plugins.js.map +1 -1
  93. package/dist/lib/errors/ErrorAlert.js +1 -1
  94. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  95. package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
  96. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  97. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +6 -4
  98. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  99. package/dist/lib/plugins/api-keys/index.d.ts +1 -0
  100. package/dist/lib/plugins/api-keys/index.js +4 -8
  101. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  102. package/dist/lib/plugins/markdown/MdxPage.js +4 -3
  103. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  104. package/dist/lib/plugins/openapi/OperationList.js +2 -1
  105. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  106. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  107. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  108. package/dist/lib/plugins/openapi/SidecarExamples.js +1 -1
  109. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  110. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  111. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  112. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  113. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +1 -0
  114. package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
  115. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  116. package/dist/lib/plugins/openapi/index.js +43 -11
  117. package/dist/lib/plugins/openapi/index.js.map +1 -1
  118. package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
  119. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  120. package/dist/lib/plugins/openapi/playground/Playground.js +4 -2
  121. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  122. package/dist/lib/plugins/search-inkeep/index.d.ts +5 -22
  123. package/dist/lib/plugins/search-inkeep/index.js +35 -29
  124. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  125. package/dist/lib/plugins/search-inkeep/inkeep.d.ts +5 -21
  126. package/dist/lib/plugins/search-inkeep/inkeep.js +10 -19
  127. package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
  128. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +1 -1
  129. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
  130. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -1
  131. package/dist/lib/plugins/search-pagefind/ResultList.js +12 -5
  132. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
  133. package/dist/lib/ui/ActionButton.js +1 -1
  134. package/dist/lib/ui/ActionButton.js.map +1 -1
  135. package/dist/lib/ui/Alert.d.ts +1 -1
  136. package/dist/lib/ui/Badge.d.ts +1 -1
  137. package/dist/lib/ui/Button.d.ts +2 -2
  138. package/dist/lib/ui/CodeBlock.js +1 -1
  139. package/dist/lib/ui/CodeBlock.js.map +1 -1
  140. package/dist/lib/ui/Command.d.ts +1 -1
  141. package/dist/lib/ui/EmbeddedCodeBlock.js +1 -1
  142. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  143. package/dist/lib/util/invariant.d.ts +6 -5
  144. package/dist/lib/util/invariant.js +1 -1
  145. package/dist/lib/util/invariant.js.map +1 -1
  146. package/dist/vite/build.js +7 -1
  147. package/dist/vite/build.js.map +1 -1
  148. package/dist/vite/dev-server.js +9 -1
  149. package/dist/vite/dev-server.js.map +1 -1
  150. package/dist/vite/mdx/remark-last-modified.js +1 -28
  151. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  152. package/dist/vite/plugin-docs.js +20 -13
  153. package/dist/vite/plugin-docs.js.map +1 -1
  154. package/dist/vite/plugin-mdx.js +2 -3
  155. package/dist/vite/plugin-mdx.js.map +1 -1
  156. package/dist/vite/plugin-theme.js +88 -49
  157. package/dist/vite/plugin-theme.js.map +1 -1
  158. package/dist/vite/plugin-theme.test.js +25 -4
  159. package/dist/vite/plugin-theme.test.js.map +1 -1
  160. package/dist/vite/prerender/worker.js +5 -1
  161. package/dist/vite/prerender/worker.js.map +1 -1
  162. package/dist/vite/shadcn-registry.d.ts +8 -8
  163. package/lib/{Button-BE9IVkWV.js → Button-B3o-2Xdf.js} +2 -2
  164. package/lib/{Button-BE9IVkWV.js.map → Button-B3o-2Xdf.js.map} +1 -1
  165. package/lib/{Card-DPhGbYUM.js → Card-CMDQUPM4.js} +2 -2
  166. package/lib/{Card-DPhGbYUM.js.map → Card-CMDQUPM4.js.map} +1 -1
  167. package/lib/ClientOnly-E7hGysn1.js.map +1 -1
  168. package/lib/{CodeBlock-DAKxs_Tu.js → CodeBlock-B-G0eKtw.js} +3 -3
  169. package/lib/{CodeBlock-DAKxs_Tu.js.map → CodeBlock-B-G0eKtw.js.map} +1 -1
  170. package/lib/{Command-xsbs2uhf.js → Command-BYukybsa.js} +3 -3
  171. package/lib/{Command-xsbs2uhf.js.map → Command-BYukybsa.js.map} +1 -1
  172. package/lib/{Dialog-CiIdyz6a.js → Dialog-u9Uz9sTt.js} +5 -5
  173. package/lib/{Dialog-CiIdyz6a.js.map → Dialog-u9Uz9sTt.js.map} +1 -1
  174. package/lib/{Drawer-BzkOKwgC.js → Drawer-DJ05s2pH.js} +86 -86
  175. package/lib/{Drawer-BzkOKwgC.js.map → Drawer-DJ05s2pH.js.map} +1 -1
  176. package/lib/{MdxPage-swXPJ0gf.js → MdxPage-Bsko6_kb.js} +34 -34
  177. package/lib/MdxPage-Bsko6_kb.js.map +1 -0
  178. package/lib/OAuthErrorPage-DJzGiIBt.js +150 -0
  179. package/lib/OAuthErrorPage-DJzGiIBt.js.map +1 -0
  180. package/lib/{OasProvider-CDAM3TB1.js → OasProvider-DQQRt3oS.js} +3 -3
  181. package/lib/{OasProvider-CDAM3TB1.js.map → OasProvider-DQQRt3oS.js.map} +1 -1
  182. package/lib/{OperationList-C9Hb9ql8.js → OperationList-DpmkHf26.js} +212 -210
  183. package/lib/OperationList-DpmkHf26.js.map +1 -0
  184. package/lib/{Pagination-VGlgeCmS.js → Pagination-kqFNgtnI.js} +10 -9
  185. package/lib/Pagination-kqFNgtnI.js.map +1 -0
  186. package/lib/{RouteGuard-CbKd7_9h.js → RouteGuard-0wPUKdxJ.js} +166 -165
  187. package/lib/{RouteGuard-CbKd7_9h.js.map → RouteGuard-0wPUKdxJ.js.map} +1 -1
  188. package/lib/{SchemaList-BAbh1BXO.js → SchemaList-DS-pMd6B.js} +9 -9
  189. package/lib/{SchemaList-BAbh1BXO.js.map → SchemaList-DS-pMd6B.js.map} +1 -1
  190. package/lib/{SchemaView-C2Io712T.js → SchemaView-BnN6WHjw.js} +6 -6
  191. package/lib/{SchemaView-C2Io712T.js.map → SchemaView-BnN6WHjw.js.map} +1 -1
  192. package/lib/Select-BmTTKNPp.js +273 -0
  193. package/lib/Select-BmTTKNPp.js.map +1 -0
  194. package/lib/SignUp-BwOSCD-6.js +56 -0
  195. package/lib/SignUp-BwOSCD-6.js.map +1 -0
  196. package/lib/{Slot-DwZlQ-vX.js → Slot-DAyXieeZ.js} +1634 -1643
  197. package/lib/Slot-DAyXieeZ.js.map +1 -0
  198. package/lib/Spinner-mNLZ6awP.js.map +1 -1
  199. package/lib/{SyntaxHighlight-CrjhGEwT.js → SyntaxHighlight-BMKR4pl6.js} +757 -757
  200. package/lib/SyntaxHighlight-BMKR4pl6.js.map +1 -0
  201. package/lib/{Toc-WCmwFkX-.js → Toc-BKDRCQzU.js} +3 -3
  202. package/lib/{Toc-WCmwFkX-.js.map → Toc-BKDRCQzU.js.map} +1 -1
  203. package/lib/ZudokuContext-CLl5w57E.js +1278 -0
  204. package/lib/ZudokuContext-CLl5w57E.js.map +1 -0
  205. package/lib/{chunk-DQRVZFIR-DHK7_Ilc.js → chunk-QMGIS6GS-CEOk3lro.js} +3 -3
  206. package/lib/chunk-QMGIS6GS-CEOk3lro.js.map +1 -0
  207. package/lib/{circular-B42RaanD.js → circular-8GWQDvCW.js} +2 -2
  208. package/lib/{circular-B42RaanD.js.map → circular-8GWQDvCW.js.map} +1 -1
  209. package/lib/{cn-wvCW-ho6.js → cn-dYga0KKN.js} +2 -2
  210. package/lib/cn-dYga0KKN.js.map +1 -0
  211. package/lib/{createServer-BKFsRuuk.js → createServer-BsezSzvV.js} +3398 -3552
  212. package/lib/createServer-BsezSzvV.js.map +1 -0
  213. package/lib/errors-Cs7hKmdL.js +45 -0
  214. package/lib/errors-Cs7hKmdL.js.map +1 -0
  215. package/lib/hook-DbUCLQNg.js +247 -0
  216. package/lib/hook-DbUCLQNg.js.map +1 -0
  217. package/lib/index-A5Qdwj1B.js +4081 -0
  218. package/lib/index-A5Qdwj1B.js.map +1 -0
  219. package/lib/{index-B6Re5_cx.js → index-Bg7Js3jB.js} +873 -951
  220. package/lib/index-Bg7Js3jB.js.map +1 -0
  221. package/lib/{index-CcV90rin.js → index-BkW9tJ6j.js} +2 -2
  222. package/lib/{index-CcV90rin.js.map → index-BkW9tJ6j.js.map} +1 -1
  223. package/lib/index-Bm35Tkgf.js +107 -0
  224. package/lib/index-Bm35Tkgf.js.map +1 -0
  225. package/lib/index-CrcNWbel.js.map +1 -1
  226. package/lib/index-DI5SPFK9.js.map +1 -1
  227. package/lib/index-DmNq2fbN.js.map +1 -1
  228. package/lib/index.esm-CdzlRw50.js +1254 -0
  229. package/lib/index.esm-CdzlRw50.js.map +1 -0
  230. package/lib/{invariant-DAFpPywt.js → invariant-Bm-FVUQE.js} +2 -6
  231. package/lib/invariant-Bm-FVUQE.js.map +1 -0
  232. package/lib/jsx-runtime-C5mzlN2N.js.map +1 -1
  233. package/lib/processors/removeExtensions.js.map +1 -1
  234. package/lib/processors/removeParameters.js.map +1 -1
  235. package/lib/processors/removePaths.js.map +1 -1
  236. package/lib/processors/traverse.js.map +1 -1
  237. package/lib/ui/Accordion.js +1 -1
  238. package/lib/ui/Accordion.js.map +1 -1
  239. package/lib/ui/ActionButton.js +10 -10
  240. package/lib/ui/ActionButton.js.map +1 -1
  241. package/lib/ui/Alert.js +1 -1
  242. package/lib/ui/Alert.js.map +1 -1
  243. package/lib/ui/AlertDialog.js +1 -1
  244. package/lib/ui/AlertDialog.js.map +1 -1
  245. package/lib/ui/Badge.js +1 -1
  246. package/lib/ui/Badge.js.map +1 -1
  247. package/lib/ui/Breadcrumb.js +1 -1
  248. package/lib/ui/Breadcrumb.js.map +1 -1
  249. package/lib/ui/Button.js +1 -1
  250. package/lib/ui/Button.js.map +1 -1
  251. package/lib/ui/Callout.js +1 -1
  252. package/lib/ui/Callout.js.map +1 -1
  253. package/lib/ui/Card.js +1 -1
  254. package/lib/ui/Card.js.map +1 -1
  255. package/lib/ui/Carousel.js +1 -1
  256. package/lib/ui/Carousel.js.map +1 -1
  257. package/lib/ui/Checkbox.js +1 -1
  258. package/lib/ui/Checkbox.js.map +1 -1
  259. package/lib/ui/CodeBlock.js +2 -2
  260. package/lib/ui/Command.js +2 -2
  261. package/lib/ui/Command.js.map +1 -1
  262. package/lib/ui/Dialog.js +1 -1
  263. package/lib/ui/Dialog.js.map +1 -1
  264. package/lib/ui/Drawer.js +2 -2
  265. package/lib/ui/DropdownMenu.js +1 -1
  266. package/lib/ui/DropdownMenu.js.map +1 -1
  267. package/lib/ui/EmbeddedCodeBlock.js +2 -2
  268. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  269. package/lib/ui/Form.js +2 -2
  270. package/lib/ui/Form.js.map +1 -1
  271. package/lib/ui/HoverCard.js +1 -1
  272. package/lib/ui/HoverCard.js.map +1 -1
  273. package/lib/ui/Input.js +1 -1
  274. package/lib/ui/Input.js.map +1 -1
  275. package/lib/ui/Label.js +1 -1
  276. package/lib/ui/Label.js.map +1 -1
  277. package/lib/ui/Pagination.js +1 -1
  278. package/lib/ui/Pagination.js.map +1 -1
  279. package/lib/ui/Popover.js +1 -1
  280. package/lib/ui/Popover.js.map +1 -1
  281. package/lib/ui/Progress.js +1 -1
  282. package/lib/ui/Progress.js.map +1 -1
  283. package/lib/ui/RadioGroup.js +1 -1
  284. package/lib/ui/RadioGroup.js.map +1 -1
  285. package/lib/ui/ScrollArea.js +1 -1
  286. package/lib/ui/ScrollArea.js.map +1 -1
  287. package/lib/ui/Select.js +1 -1
  288. package/lib/ui/Select.js.map +1 -1
  289. package/lib/ui/Skeleton.js +1 -1
  290. package/lib/ui/Skeleton.js.map +1 -1
  291. package/lib/ui/Slider.js +1 -1
  292. package/lib/ui/Slider.js.map +1 -1
  293. package/lib/ui/Stepper.js.map +1 -1
  294. package/lib/ui/Switch.js +1 -1
  295. package/lib/ui/Switch.js.map +1 -1
  296. package/lib/ui/SyntaxHighlight.js +4 -4
  297. package/lib/ui/Tabs.js +1 -1
  298. package/lib/ui/Tabs.js.map +1 -1
  299. package/lib/ui/Textarea.js +1 -1
  300. package/lib/ui/Textarea.js.map +1 -1
  301. package/lib/ui/Toggle.js +1 -1
  302. package/lib/ui/Toggle.js.map +1 -1
  303. package/lib/ui/ToggleGroup.js +1 -1
  304. package/lib/ui/ToggleGroup.js.map +1 -1
  305. package/lib/ui/Tooltip.js +1 -1
  306. package/lib/ui/Tooltip.js.map +1 -1
  307. package/lib/ui/util.js +1 -1
  308. package/lib/{useExposedProps-BIYjecPD.js → useExposedProps-KcgXHKeE.js} +2 -2
  309. package/lib/{useExposedProps-BIYjecPD.js.map → useExposedProps-KcgXHKeE.js.map} +1 -1
  310. package/lib/zudoku.auth-auth0.js +1 -1
  311. package/lib/zudoku.auth-auth0.js.map +1 -1
  312. package/lib/zudoku.auth-azureb2c.js +46 -9883
  313. package/lib/zudoku.auth-azureb2c.js.map +1 -1
  314. package/lib/zudoku.auth-clerk.js +25 -22
  315. package/lib/zudoku.auth-clerk.js.map +1 -1
  316. package/lib/zudoku.auth-openid.js +249 -231
  317. package/lib/zudoku.auth-openid.js.map +1 -1
  318. package/lib/zudoku.auth-supabase.js +97 -0
  319. package/lib/zudoku.auth-supabase.js.map +1 -0
  320. package/lib/zudoku.components.js +30 -29
  321. package/lib/zudoku.components.js.map +1 -1
  322. package/lib/zudoku.hooks.js +17 -16
  323. package/lib/zudoku.hooks.js.map +1 -1
  324. package/lib/zudoku.icons.js.map +1 -1
  325. package/lib/zudoku.plugin-api-catalog.js +26 -25
  326. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  327. package/lib/zudoku.plugin-api-keys.js +428 -299
  328. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  329. package/lib/zudoku.plugin-custom-pages.js +1 -1
  330. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  331. package/lib/zudoku.plugin-markdown.js +1 -1
  332. package/lib/zudoku.plugin-markdown.js.map +1 -1
  333. package/lib/zudoku.plugin-openapi.js +7 -6
  334. package/lib/zudoku.plugin-openapi.js.map +1 -1
  335. package/lib/zudoku.plugin-redirect.js +1 -1
  336. package/lib/zudoku.plugin-redirect.js.map +1 -1
  337. package/lib/zudoku.plugin-search-inkeep.js +54 -57
  338. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  339. package/lib/zudoku.plugin-search-pagefind.js +123 -118
  340. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  341. package/lib/zudoku.plugins.js.map +1 -1
  342. package/package.json +34 -33
  343. package/src/app/demo.tsx +19 -2
  344. package/src/app/main.css +26 -5
  345. package/src/app/main.tsx +6 -14
  346. package/src/lib/authentication/authentication.ts +2 -2
  347. package/src/lib/authentication/components/CallbackHandler.tsx +22 -15
  348. package/src/lib/authentication/components/OAuthErrorPage.tsx +171 -0
  349. package/src/lib/authentication/components/SignIn.tsx +5 -12
  350. package/src/lib/authentication/errors.ts +27 -13
  351. package/src/lib/authentication/hook.ts +2 -0
  352. package/src/lib/authentication/providers/azureb2c.tsx +8 -3
  353. package/src/lib/authentication/providers/clerk.tsx +4 -1
  354. package/src/lib/authentication/providers/openid.tsx +30 -5
  355. package/src/lib/components/Banner.tsx +0 -1
  356. package/src/lib/components/CategoryHeading.tsx +4 -1
  357. package/src/lib/components/Header.tsx +5 -2
  358. package/src/lib/components/Heading.tsx +1 -1
  359. package/src/lib/components/Markdown.tsx +3 -3
  360. package/src/lib/components/MobileTopNavigation.tsx +60 -8
  361. package/src/lib/components/NotFoundPage.tsx +3 -2
  362. package/src/lib/components/Pagination.tsx +1 -0
  363. package/src/lib/components/StatusPage.tsx +5 -0
  364. package/src/lib/components/TopNavigation.tsx +34 -18
  365. package/src/lib/components/Typography.tsx +1 -1
  366. package/src/lib/components/context/ZudokuContext.ts +25 -18
  367. package/src/lib/components/navigation/NavigationItem.tsx +9 -1
  368. package/src/lib/components/navigation/NavigationWrapper.tsx +4 -1
  369. package/src/lib/components/navigation/utils.ts +9 -3
  370. package/src/lib/core/RouteGuard.tsx +13 -13
  371. package/src/lib/core/ZudokuContext.ts +40 -5
  372. package/src/lib/core/plugins.ts +2 -1
  373. package/src/lib/errors/ErrorAlert.tsx +5 -7
  374. package/src/lib/plugins/api-keys/CreateApiKey.tsx +12 -1
  375. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +37 -13
  376. package/src/lib/plugins/api-keys/index.tsx +8 -9
  377. package/src/lib/plugins/markdown/MdxPage.tsx +4 -3
  378. package/src/lib/plugins/openapi/OperationList.tsx +4 -2
  379. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  380. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -1
  381. package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
  382. package/src/lib/plugins/openapi/graphql/graphql.ts +2 -0
  383. package/src/lib/plugins/openapi/index.tsx +67 -17
  384. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  385. package/src/lib/plugins/openapi/playground/Playground.tsx +8 -2
  386. package/src/lib/plugins/search-inkeep/index.tsx +54 -58
  387. package/src/lib/plugins/search-inkeep/inkeep.ts +19 -21
  388. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +1 -0
  389. package/src/lib/plugins/search-pagefind/ResultList.tsx +13 -4
  390. package/src/lib/ui/ActionButton.tsx +3 -1
  391. package/src/lib/ui/Alert.tsx +1 -1
  392. package/src/lib/ui/CodeBlock.tsx +1 -1
  393. package/src/lib/ui/EmbeddedCodeBlock.tsx +1 -1
  394. package/src/lib/util/invariant.ts +7 -5
  395. package/lib/Alert-CT_ViLrJ.js +0 -161
  396. package/lib/Alert-CT_ViLrJ.js.map +0 -1
  397. package/lib/MdxPage-swXPJ0gf.js.map +0 -1
  398. package/lib/OperationList-C9Hb9ql8.js.map +0 -1
  399. package/lib/Pagination-VGlgeCmS.js.map +0 -1
  400. package/lib/SignUp-5RUdVhnq.js +0 -63
  401. package/lib/SignUp-5RUdVhnq.js.map +0 -1
  402. package/lib/Slot-DwZlQ-vX.js.map +0 -1
  403. package/lib/SyntaxHighlight-CrjhGEwT.js.map +0 -1
  404. package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +0 -1
  405. package/lib/clerk-BDZ31hjU.js +0 -25190
  406. package/lib/clerk-BDZ31hjU.js.map +0 -1
  407. package/lib/cn-wvCW-ho6.js.map +0 -1
  408. package/lib/createServer-BKFsRuuk.js.map +0 -1
  409. package/lib/errors-CF2X_x5o.js +0 -78
  410. package/lib/errors-CF2X_x5o.js.map +0 -1
  411. package/lib/hook-Bd0yS8M0.js +0 -1503
  412. package/lib/hook-Bd0yS8M0.js.map +0 -1
  413. package/lib/index-B6Re5_cx.js.map +0 -1
  414. package/lib/index-CLy1XyH0.js +0 -3919
  415. package/lib/index-CLy1XyH0.js.map +0 -1
  416. package/lib/index-ClhS5TxS.js +0 -107
  417. package/lib/index-ClhS5TxS.js.map +0 -1
  418. package/lib/index.esm-Cp4wkyud.js +0 -1236
  419. package/lib/index.esm-Cp4wkyud.js.map +0 -1
  420. package/lib/invariant-DAFpPywt.js.map +0 -1
@@ -1,49 +1,55 @@
1
1
  import { j as e } from "./jsx-runtime-C5mzlN2N.js";
2
- import { CircleSlashIcon as R, CheckIcon as _, XIcon as se, PencilLineIcon as ne, RefreshCwIcon as ie, EyeOffIcon as re, EyeIcon as ae, CopyIcon as oe, TrashIcon as le, KeyRoundIcon as ce } from "lucide-react";
3
- import { D as de, a as F, R as ue } from "./Slot-DwZlQ-vX.js";
4
- import { i as E } from "./invariant-DAFpPywt.js";
5
- import { O as he, L as $ } from "./chunk-DQRVZFIR-DHK7_Ilc.js";
6
- import { e as pe, d as fe, g as me, c as xe } from "./hook-Bd0yS8M0.js";
7
- import { Button as y } from "./ui/Button.js";
8
- import { u as z, A as T, a as M } from "./Alert-CT_ViLrJ.js";
9
- import * as q from "react";
10
- import ye, { createContext as L, useLayoutEffect as ge, useEffect as je, useRef as k, useId as H, useContext as B, useInsertionEffect as Ce, useCallback as ve, useMemo as S, Children as we, isValidElement as ke, useState as b } from "react";
11
- import { C as be, a as Ee } from "./Card-DPhGbYUM.js";
12
- import { D as J, e as U, a as V, c as Y, b as G, d as Z, f as W, g as K } from "./Dialog-CiIdyz6a.js";
13
- import { Input as Ne } from "./ui/Input.js";
14
- import { c as P } from "./cn-wvCW-ho6.js";
15
- import { u as De } from "./CodeBlock-DAKxs_Tu.js";
16
- const Ie = () => {
17
- const t = pe();
18
- return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(he, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
2
+ import { CircleSlashIcon as F, CheckIcon as te, XIcon as ue, PencilLineIcon as he, RefreshCwIcon as fe, EyeOffIcon as pe, EyeIcon as me, CopyIcon as xe, TrashIcon as ye, KeyRoundIcon as ge } from "lucide-react";
3
+ import { D as je, a as Y, R as Ce } from "./Slot-DAyXieeZ.js";
4
+ import { i as A } from "./invariant-Bm-FVUQE.js";
5
+ import { O as ve, a as we, L as be } from "./chunk-QMGIS6GS-CEOk3lro.js";
6
+ import { a as ke } from "./hook-DbUCLQNg.js";
7
+ import { Button as x } from "./ui/Button.js";
8
+ import { c as se, e as ne, b as Ne } from "./ZudokuContext-CLl5w57E.js";
9
+ import { u as z, A as O, a as M, b as Ee, S as Ke, c as De, d as Ie, e as Pe, f as Ae, g as Z } from "./Select-BmTTKNPp.js";
10
+ import * as _ from "react";
11
+ import Re, { createContext as G, useRef as D, useLayoutEffect as Se, useEffect as ie, useId as J, useContext as U, useInsertionEffect as Te, useMemo as L, useCallback as ze, Children as Oe, isValidElement as Me, useState as K, forwardRef as qe } from "react";
12
+ import { C as Fe, a as Le } from "./Card-CMDQUPM4.js";
13
+ import { e as W, f as I, D as $, g as Q, a as B, c as H, b as V, d as re } from "./Dialog-u9Uz9sTt.js";
14
+ import { Input as ae } from "./ui/Input.js";
15
+ import { c as N } from "./cn-dYga0KKN.js";
16
+ import { u as $e } from "./CodeBlock-B-G0eKtw.js";
17
+ import { a as Qe } from "./index.esm-CdzlRw50.js";
18
+ import { B as Be } from "./Button-B3o-2Xdf.js";
19
+ import { S as He } from "./Spinner-mNLZ6awP.js";
20
+ const Ve = () => {
21
+ const t = ke();
22
+ return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(ve, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
19
23
  "Please login first to view this page",
20
- /* @__PURE__ */ e.jsx(y, { onClick: () => t.login(), children: "Login" })
21
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(de, { className: "max-w-[600px]", children: [
24
+ /* @__PURE__ */ e.jsx(x, { onClick: () => t.login(), children: "Login" })
25
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(je, { className: "max-w-[600px]", children: [
22
26
  "Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
23
27
  /* @__PURE__ */ e.jsx("code", { children: "authentication" }),
24
28
  "."
25
29
  ] }) });
26
- }, Ke = (t) => t;
27
- let X = Ke;
28
- process.env.NODE_ENV !== "production" && (X = (t, i) => {
29
- if (!t)
30
- throw new Error(i);
31
- });
32
- const Pe = L(null), Ae = L({}), Re = L({
30
+ }, _e = G({});
31
+ function oe(t) {
32
+ const i = D(null);
33
+ return i.current === null && (i.current = t()), i.current;
34
+ }
35
+ const Ge = typeof window < "u", Je = Ge ? Se : ie, le = /* @__PURE__ */ G(null);
36
+ function Ue(t) {
37
+ return typeof t == "object" && t !== null;
38
+ }
39
+ function We(t) {
40
+ return Ue(t) && "offsetHeight" in t;
41
+ }
42
+ const Xe = G({
33
43
  transformPagePoint: (t) => t,
34
44
  isStatic: !1,
35
45
  reducedMotion: "never"
36
- }), ze = typeof window < "u", Te = ze ? ge : je;
37
- function ee(t) {
38
- const i = k(null);
39
- return i.current === null && (i.current = t()), i.current;
40
- }
41
- class Me extends q.Component {
46
+ });
47
+ class Ye extends _.Component {
42
48
  getSnapshotBeforeUpdate(i) {
43
49
  const s = this.props.childRef.current;
44
50
  if (s && i.isPresent && !this.props.isPresent) {
45
- const n = this.props.sizeRef.current;
46
- n.height = s.offsetHeight || 0, n.width = s.offsetWidth || 0, n.top = s.offsetTop, n.left = s.offsetLeft;
51
+ const n = s.offsetParent, r = We(n) && n.offsetWidth || 0, a = this.props.sizeRef.current;
52
+ a.height = s.offsetHeight || 0, a.width = s.offsetWidth || 0, a.top = s.offsetTop, a.left = s.offsetLeft, a.right = r - a.width - a.left;
47
53
  }
48
54
  return null;
49
55
  }
@@ -56,230 +62,347 @@ class Me extends q.Component {
56
62
  return this.props.children;
57
63
  }
58
64
  }
59
- function Se({ children: t, isPresent: i }) {
60
- const s = H(), n = k(null), o = k({
65
+ function Ze({ children: t, isPresent: i, anchorX: s, root: n }) {
66
+ const r = J(), a = D(null), l = D({
61
67
  width: 0,
62
68
  height: 0,
63
69
  top: 0,
64
- left: 0
65
- }), { nonce: l } = B(Re);
66
- return Ce(() => {
67
- const { width: m, height: a, top: x, left: h } = o.current;
68
- if (i || !n.current || !m || !a)
70
+ left: 0,
71
+ right: 0
72
+ }), { nonce: h } = U(Xe);
73
+ return Te(() => {
74
+ const { width: y, height: d, top: C, left: u, right: f } = l.current;
75
+ if (i || !a.current || !y || !d)
69
76
  return;
70
- n.current.dataset.motionPopId = s;
71
- const p = document.createElement("style");
72
- return l && (p.nonce = l), document.head.appendChild(p), p.sheet && p.sheet.insertRule(`
73
- [data-motion-pop-id="${s}"] {
77
+ const p = s === "left" ? `left: ${u}` : `right: ${f}`;
78
+ a.current.dataset.motionPopId = r;
79
+ const m = document.createElement("style");
80
+ h && (m.nonce = h);
81
+ const g = n ?? document.head;
82
+ return g.appendChild(m), m.sheet && m.sheet.insertRule(`
83
+ [data-motion-pop-id="${r}"] {
74
84
  position: absolute !important;
75
- width: ${m}px !important;
76
- height: ${a}px !important;
77
- top: ${x}px !important;
78
- left: ${h}px !important;
85
+ width: ${y}px !important;
86
+ height: ${d}px !important;
87
+ ${p}px !important;
88
+ top: ${C}px !important;
79
89
  }
80
90
  `), () => {
81
- document.head.removeChild(p);
91
+ g.removeChild(m), g.contains(m) && g.removeChild(m);
82
92
  };
83
- }, [i]), e.jsx(Me, { isPresent: i, childRef: n, sizeRef: o, children: q.cloneElement(t, { ref: n }) });
93
+ }, [i]), e.jsx(Ye, { isPresent: i, childRef: a, sizeRef: l, children: _.cloneElement(t, { ref: a }) });
84
94
  }
85
- const qe = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: o, presenceAffectsLayout: l, mode: m }) => {
86
- const a = ee(Le), x = H(), h = ve((d) => {
87
- a.set(d, !0);
88
- for (const C of a.values())
89
- if (!C)
90
- return;
91
- n && n();
92
- }, [a, n]), p = S(
93
- () => ({
94
- id: x,
95
- initial: i,
96
- isPresent: s,
97
- custom: o,
98
- onExitComplete: h,
99
- register: (d) => (a.set(d, !1), () => a.delete(d))
100
- }),
101
- /**
102
- * If the presence of a child affects the layout of the components around it,
103
- * we want to make a new context value to ensure they get re-rendered
104
- * so they can detect that layout change.
105
- */
106
- l ? [Math.random(), h] : [s, h]
107
- );
108
- return S(() => {
109
- a.forEach((d, C) => a.set(C, !1));
110
- }, [s]), q.useEffect(() => {
111
- !s && !a.size && n && n();
112
- }, [s]), m === "popLayout" && (t = e.jsx(Se, { isPresent: s, children: t })), e.jsx(Pe.Provider, { value: p, children: t });
95
+ const et = ({ children: t, initial: i, isPresent: s, onExitComplete: n, custom: r, presenceAffectsLayout: a, mode: l, anchorX: h, root: y }) => {
96
+ const d = oe(tt), C = J();
97
+ let u = !0, f = L(() => (u = !1, {
98
+ id: C,
99
+ initial: i,
100
+ isPresent: s,
101
+ custom: r,
102
+ onExitComplete: (p) => {
103
+ d.set(p, !0);
104
+ for (const m of d.values())
105
+ if (!m)
106
+ return;
107
+ n && n();
108
+ },
109
+ register: (p) => (d.set(p, !1), () => d.delete(p))
110
+ }), [s, d, n]);
111
+ return a && u && (f = { ...f }), L(() => {
112
+ d.forEach((p, m) => d.set(m, !1));
113
+ }, [s]), _.useEffect(() => {
114
+ !s && !d.size && n && n();
115
+ }, [s]), l === "popLayout" && (t = e.jsx(Ze, { isPresent: s, anchorX: h, root: y, children: t })), e.jsx(le.Provider, { value: f, children: t });
113
116
  };
114
- function Le() {
117
+ function tt() {
115
118
  return /* @__PURE__ */ new Map();
116
119
  }
117
- const N = (t) => t.key || "";
118
- function Q(t) {
120
+ function st(t = !0) {
121
+ const i = U(le);
122
+ if (i === null)
123
+ return [!0, null];
124
+ const { isPresent: s, onExitComplete: n, register: r } = i, a = J();
125
+ ie(() => {
126
+ if (t)
127
+ return r(a);
128
+ }, [t]);
129
+ const l = ze(() => t && n && n(a), [a, n, t]);
130
+ return !s && n ? [!1, l] : [!0];
131
+ }
132
+ const R = (t) => t.key || "";
133
+ function ee(t) {
119
134
  const i = [];
120
- return we.forEach(t, (s) => {
121
- ke(s) && i.push(s);
135
+ return Oe.forEach(t, (s) => {
136
+ Me(s) && i.push(s);
122
137
  }), i;
123
138
  }
124
- const Oe = ({ children: t, exitBeforeEnter: i, custom: s, initial: n = !0, onExitComplete: o, presenceAffectsLayout: l = !0, mode: m = "sync" }) => {
125
- X(!i, "Replace exitBeforeEnter with mode='wait'");
126
- const a = S(() => Q(t), [t]), x = a.map(N), h = k(!0), p = k(a), d = ee(() => /* @__PURE__ */ new Map()), [C, w] = b(a), [j, r] = b(a);
127
- Te(() => {
128
- h.current = !1, p.current = a;
129
- for (let f = 0; f < j.length; f++) {
130
- const u = N(j[f]);
131
- x.includes(u) ? d.delete(u) : d.get(u) !== !0 && d.set(u, !1);
139
+ const nt = ({ children: t, custom: i, initial: s = !0, onExitComplete: n, presenceAffectsLayout: r = !0, mode: a = "sync", propagate: l = !1, anchorX: h = "left", root: y }) => {
140
+ const [d, C] = st(l), u = L(() => ee(t), [t]), f = l && !d ? [] : u.map(R), p = D(!0), m = D(u), g = oe(() => /* @__PURE__ */ new Map()), [P, o] = K(u), [c, v] = K(u);
141
+ Je(() => {
142
+ p.current = !1, m.current = u;
143
+ for (let w = 0; w < c.length; w++) {
144
+ const j = R(c[w]);
145
+ f.includes(j) ? g.delete(j) : g.get(j) !== !0 && g.set(j, !1);
132
146
  }
133
- }, [j, x.length, x.join("-")]);
134
- const c = [];
135
- if (a !== C) {
136
- let f = [...a];
137
- for (let u = 0; u < j.length; u++) {
138
- const v = j[u], A = N(v);
139
- x.includes(A) || (f.splice(u, 0, v), c.push(v));
147
+ }, [c, f.length, f.join("-")]);
148
+ const b = [];
149
+ if (u !== P) {
150
+ let w = [...u];
151
+ for (let j = 0; j < c.length; j++) {
152
+ const E = c[j], q = R(E);
153
+ f.includes(q) || (w.splice(j, 0, E), b.push(E));
140
154
  }
141
- m === "wait" && c.length && (f = c), r(Q(f)), w(a);
142
- return;
155
+ return a === "wait" && b.length && (w = b), v(ee(w)), o(u), null;
143
156
  }
144
- process.env.NODE_ENV !== "production" && m === "wait" && j.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
145
- const { forceRender: g } = B(Ae);
146
- return e.jsx(e.Fragment, { children: j.map((f) => {
147
- const u = N(f), v = a === j || x.includes(u), A = () => {
148
- if (d.has(u))
149
- d.set(u, !0);
157
+ process.env.NODE_ENV !== "production" && a === "wait" && c.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
158
+ const { forceRender: k } = U(_e);
159
+ return e.jsx(e.Fragment, { children: c.map((w) => {
160
+ const j = R(w), E = l && !d ? !1 : u === c || f.includes(j), q = () => {
161
+ if (g.has(j))
162
+ g.set(j, !0);
150
163
  else
151
164
  return;
152
- let O = !0;
153
- d.forEach((te) => {
154
- te || (O = !1);
155
- }), O && (g?.(), r(p.current), o && o());
165
+ let X = !0;
166
+ g.forEach((de) => {
167
+ de || (X = !1);
168
+ }), X && (k?.(), v(m.current), l && C?.(), n && n());
156
169
  };
157
- return e.jsx(qe, { isPresent: v, initial: !h.current || n ? void 0 : !1, custom: v ? void 0 : s, presenceAffectsLayout: l, mode: m, onExitComplete: v ? void 0 : A, children: f }, u);
170
+ return e.jsx(et, { isPresent: E, initial: !p.current || s ? void 0 : !1, custom: i, presenceAffectsLayout: r, mode: a, root: y, onExitComplete: E ? void 0 : q, anchorX: h, children: w }, j);
158
171
  }) });
159
- }, Fe = ({ service: t }) => {
160
- const i = fe(), s = me(), [n, o] = b(
172
+ }, ce = qe(
173
+ ({ isPending: t, children: i, className: s, ...n }, r) => /* @__PURE__ */ e.jsxs(
174
+ Be,
175
+ {
176
+ ref: r,
177
+ disabled: t,
178
+ ...n,
179
+ className: N("relative", s),
180
+ children: [
181
+ t && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 grid place-items-center", children: /* @__PURE__ */ e.jsx(He, {}) }),
182
+ /* @__PURE__ */ e.jsx("span", { className: N("block", t && "invisible"), children: i })
183
+ ]
184
+ }
185
+ )
186
+ );
187
+ ce.displayName = "ActionButton";
188
+ const it = ({
189
+ service: t,
190
+ onOpenChange: i
191
+ }) => {
192
+ const s = se(), n = ne(), r = we(), a = Qe({
193
+ defaultValues: {
194
+ expiresOn: "30"
195
+ }
196
+ }), l = z({
197
+ mutationFn: ({ description: h, expiresOn: y }) => {
198
+ if (!t.createKey)
199
+ throw new Error("createKey not implemented");
200
+ const d = y !== "never" ? rt(Number(y)) : void 0;
201
+ return t.createKey(
202
+ {
203
+ description: h || "Secret Key",
204
+ expiresOn: d
205
+ },
206
+ s
207
+ );
208
+ },
209
+ onSuccess: async () => {
210
+ await n.invalidateQueries({ queryKey: ["api-keys"] }), await r("/settings/api-keys/");
211
+ }
212
+ });
213
+ return t.createKey ? /* @__PURE__ */ e.jsxs(
214
+ "form",
215
+ {
216
+ onSubmit: a.handleSubmit(
217
+ (h) => l.mutate(
218
+ { ...h },
219
+ {
220
+ onSuccess: () => i(!1)
221
+ }
222
+ )
223
+ ),
224
+ children: [
225
+ l.error && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
226
+ /* @__PURE__ */ e.jsx(M, { children: "Error" }),
227
+ /* @__PURE__ */ e.jsx(Ee, { children: l.error.message })
228
+ ] }),
229
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
230
+ "Name",
231
+ /* @__PURE__ */ e.jsx(ae, { ...a.register("description") }),
232
+ "Expiration",
233
+ /* @__PURE__ */ e.jsxs(
234
+ Ke,
235
+ {
236
+ onValueChange: (h) => a.setValue("expiresOn", h),
237
+ defaultValue: a.getValues("expiresOn"),
238
+ children: [
239
+ /* @__PURE__ */ e.jsx(De, { children: /* @__PURE__ */ e.jsx(Ie, {}) }),
240
+ /* @__PURE__ */ e.jsx(Pe, { children: /* @__PURE__ */ e.jsxs(Ae, { children: [
241
+ [7, 30, 60, 90].map((h) => /* @__PURE__ */ e.jsxs(Z, { value: String(h), children: [
242
+ h,
243
+ " days"
244
+ ] }, h)),
245
+ /* @__PURE__ */ e.jsx(Z, { value: "never", children: "Never" })
246
+ ] }) })
247
+ ]
248
+ }
249
+ ),
250
+ /* @__PURE__ */ e.jsxs(W, { children: [
251
+ /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "outline", children: "Cancel" }) }),
252
+ /* @__PURE__ */ e.jsx(ce, { isPending: l.isPending, children: "Generate Key" })
253
+ ] })
254
+ ] })
255
+ ]
256
+ }
257
+ ) : null;
258
+ }, rt = (t) => {
259
+ const i = /* @__PURE__ */ new Date();
260
+ return i.setDate(i.getDate() + t), i.toISOString();
261
+ }, at = ({ service: t }) => {
262
+ const i = se(), s = ne(), [n, r] = K(
161
263
  null
162
- ), [l, m] = b(""), { data: a, isFetching: x } = xe({
264
+ ), [a, l] = K(""), { data: h, isFetching: y } = Ne({
163
265
  queryFn: () => t.getConsumers(i),
164
266
  queryKey: ["api-keys"],
165
267
  retry: !1
166
- }), h = z({
268
+ }), [d, C] = K(!1), u = z({
167
269
  mutationFn: ({
168
- consumerId: r,
270
+ consumerId: o,
169
271
  keyId: c
170
272
  }) => {
171
273
  if (!t.deleteKey)
172
274
  throw new Error("deleteKey not implemented");
173
- return t.deleteKey(r, c, i);
275
+ return t.deleteKey(o, c, i);
174
276
  },
175
- onMutate: async ({ consumerId: r, keyId: c }) => {
277
+ onMutate: async ({ consumerId: o, keyId: c }) => {
176
278
  await s.cancelQueries({ queryKey: ["api-keys"] });
177
- const g = s.getQueryData([
279
+ const v = s.getQueryData([
178
280
  "api-keys"
179
281
  ]);
180
- return s.setQueryData(["api-keys"], (f) => f && f.map((u) => u.id === r ? {
181
- ...u,
182
- apiKeys: u.apiKeys.filter((v) => v.id !== c)
183
- } : u)), { previousData: g };
282
+ return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
283
+ ...k,
284
+ apiKeys: k.apiKeys.filter((w) => w.id !== c)
285
+ } : k)), { previousData: v };
184
286
  },
185
- onError: (r, c, g) => {
186
- g?.previousData && s.setQueryData(["api-keys"], g.previousData);
287
+ onError: (o, c, v) => {
288
+ v?.previousData && s.setQueryData(["api-keys"], v.previousData);
187
289
  },
188
290
  onSuccess: () => {
189
291
  s.invalidateQueries({ queryKey: ["api-keys"] });
190
292
  }
191
- }), p = z({
293
+ }), f = z({
192
294
  mutationFn: ({
193
- consumerId: r,
295
+ consumerId: o,
194
296
  label: c
195
297
  }) => {
196
298
  if (!t.updateConsumer)
197
299
  throw new Error("updateConsumer not implemented");
198
- return t.updateConsumer({ id: r, label: c }, i);
300
+ return t.updateConsumer({ id: o, label: c }, i);
199
301
  },
200
- onMutate: async ({ consumerId: r, label: c }) => {
302
+ onMutate: async ({ consumerId: o, label: c }) => {
201
303
  await s.cancelQueries({ queryKey: ["api-keys"] });
202
- const g = s.getQueryData(["api-keys"]);
203
- return s.setQueryData(["api-keys"], (f) => f && f.map((u) => u.id === r ? {
204
- ...u,
304
+ const v = s.getQueryData(["api-keys"]);
305
+ return s.setQueryData(["api-keys"], (b) => b && b.map((k) => k.id === o ? {
306
+ ...k,
205
307
  label: c
206
- } : u)), { previousData: g };
308
+ } : k)), { previousData: v };
207
309
  },
208
- onError: (r, c, g) => {
209
- g?.previousData && s.setQueryData(["api-keys"], g.previousData);
310
+ onError: (o, c, v) => {
311
+ v?.previousData && s.setQueryData(["api-keys"], v.previousData);
210
312
  },
211
313
  onSuccess: () => {
212
314
  s.invalidateQueries({ queryKey: ["api-keys"] });
213
315
  }
214
- }), d = z({
215
- mutationFn: (r) => {
316
+ }), p = z({
317
+ mutationFn: (o) => {
216
318
  if (!t.rollKey)
217
319
  throw new Error("rollKey not implemented");
218
- return t.rollKey(r, i);
320
+ return t.rollKey(o, i);
219
321
  },
220
322
  onSuccess: () => s.invalidateQueries({ queryKey: ["api-keys"] })
221
- }), C = (r, c) => {
222
- o(r), m(c);
223
- }, w = (r) => {
224
- l.trim() && p.mutate({
225
- consumerId: r,
226
- label: l.trim()
227
- }), o(null), m("");
228
- }, j = () => {
229
- o(null), m("");
323
+ }), m = (o, c) => {
324
+ r(o), l(c);
325
+ }, g = (o) => {
326
+ a.trim() && f.mutate({
327
+ consumerId: o,
328
+ label: a.trim()
329
+ }), r(null), l("");
330
+ }, P = () => {
331
+ r(null), l("");
230
332
  };
231
333
  return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-md h-full pt-(--padding-content-top) pb-(--padding-content-bottom)", children: [
232
- /* @__PURE__ */ e.jsx(F.Target, { name: "api-keys-list-page" }),
334
+ /* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page" }),
233
335
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between pb-3", children: [
234
- /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
235
- t.createKey && /* @__PURE__ */ e.jsx(y, { asChild: !0, children: /* @__PURE__ */ e.jsx($, { to: "/settings/api-keys/new", children: "Create API Key" }) })
336
+ /* @__PURE__ */ e.jsxs("h1", { className: "font-medium text-2xl", children: [
337
+ "API Keys ",
338
+ typeof t.createKey
339
+ ] }),
340
+ t.createKey && /* @__PURE__ */ e.jsxs(
341
+ $,
342
+ {
343
+ open: d,
344
+ onOpenChange: C,
345
+ children: [
346
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "outline", children: "Create API Key" }) }),
347
+ /* @__PURE__ */ e.jsxs(B, { children: [
348
+ /* @__PURE__ */ e.jsx(H, { children: /* @__PURE__ */ e.jsx(V, { children: "Create API Key" }) }),
349
+ /* @__PURE__ */ e.jsx(
350
+ it,
351
+ {
352
+ service: t,
353
+ onOpenChange: C
354
+ }
355
+ )
356
+ ] })
357
+ ]
358
+ }
359
+ )
236
360
  ] }),
237
361
  /* @__PURE__ */ e.jsx("p", { children: "Create, manage, and monitor your API keys" }),
238
- /* @__PURE__ */ e.jsx(F.Target, { name: "api-keys-list-page-before-keys" }),
362
+ /* @__PURE__ */ e.jsx(Y.Target, { name: "api-keys-list-page-before-keys" }),
239
363
  /* @__PURE__ */ e.jsx("div", { className: "h-8" }),
240
- d.isError && /* @__PURE__ */ e.jsxs(T, { variant: "destructive", className: "mb-4", children: [
241
- /* @__PURE__ */ e.jsx(R, { size: 16 }),
242
- /* @__PURE__ */ e.jsx(M, { children: d.error.message })
243
- ] }),
244
- p.isError && /* @__PURE__ */ e.jsxs(T, { variant: "destructive", className: "mb-4", children: [
245
- /* @__PURE__ */ e.jsx(R, { size: 16 }),
364
+ p.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
365
+ /* @__PURE__ */ e.jsx(F, { size: 16 }),
246
366
  /* @__PURE__ */ e.jsx(M, { children: p.error.message })
247
367
  ] }),
248
- h.isError && /* @__PURE__ */ e.jsxs(T, { variant: "destructive", className: "mb-4", children: [
249
- /* @__PURE__ */ e.jsx(R, { size: 16 }),
250
- /* @__PURE__ */ e.jsx(M, { children: h.error.message })
368
+ f.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
369
+ /* @__PURE__ */ e.jsx(F, { size: 16 }),
370
+ /* @__PURE__ */ e.jsx(M, { children: f.error.message })
251
371
  ] }),
252
- /* @__PURE__ */ e.jsx("div", { className: "", children: a.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex col-span-full flex-col justify-center gap-4 items-center p-8 border rounded-sm bg-muted/30 text-muted-foreground", children: [
372
+ u.isError && /* @__PURE__ */ e.jsxs(O, { variant: "destructive", className: "mb-4", children: [
373
+ /* @__PURE__ */ e.jsx(F, { size: 16 }),
374
+ /* @__PURE__ */ e.jsx(M, { children: u.error.message })
375
+ ] }),
376
+ /* @__PURE__ */ e.jsx("div", { className: "", children: h.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex col-span-full flex-col justify-center gap-4 items-center p-8 border rounded-sm bg-muted/30 text-muted-foreground", children: [
253
377
  /* @__PURE__ */ e.jsxs("p", { className: "text-center", children: [
254
378
  "You have no API keys yet.",
255
379
  /* @__PURE__ */ e.jsx("br", {}),
256
380
  t.createKey && "Get started and create your first key."
257
381
  ] }),
258
- t.createKey && /* @__PURE__ */ e.jsx(y, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx($, { to: "/settings/api-keys/new", children: "Create API Key" }) })
382
+ t.createKey && /* @__PURE__ */ e.jsx(x, { asChild: !0, variant: "outline", children: /* @__PURE__ */ e.jsx(be, { to: "/settings/api-keys/new", children: "Create API Key" }) })
259
383
  ] }) : /* @__PURE__ */ e.jsx(
260
384
  "ul",
261
385
  {
262
- className: P(
263
- "grid grid-cols-1 divide-y divide-border col-span-6",
264
- "lg:grid-cols-[1fr_min-content]"
386
+ className: N(
387
+ "grid grid-cols-[1fr_min-content] divide-y divide-border col-span-6"
265
388
  ),
266
- children: a.map((r) => /* @__PURE__ */ e.jsxs(
267
- be,
389
+ children: h.map((o) => /* @__PURE__ */ e.jsxs(
390
+ Fe,
268
391
  {
269
392
  className: "grid grid-cols-subgrid col-span-full items-center mb-4 group",
270
393
  children: [
271
- /* @__PURE__ */ e.jsxs(Ee, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
394
+ /* @__PURE__ */ e.jsxs(Le, { className: "border-b col-span-full grid-cols-subgrid grid", children: [
272
395
  /* @__PURE__ */ e.jsxs("div", { className: "h-10 flex flex-col text-sm justify-center", children: [
273
396
  /* @__PURE__ */ e.jsxs("div", { className: "font-medium text-lg flex items-center gap-2", children: [
274
- n === r.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
397
+ n === o.id ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
275
398
  /* @__PURE__ */ e.jsx(
276
- Ne,
399
+ ae,
277
400
  {
278
401
  maxLength: 32,
279
- value: l,
280
- onChange: (c) => m(c.target.value),
402
+ value: a,
403
+ onChange: (c) => l(c.target.value),
281
404
  onKeyDown: (c) => {
282
- c.key === "Enter" ? w(r.id) : c.key === "Escape" && j();
405
+ c.key === "Enter" ? g(o.id) : c.key === "Escape" && P();
283
406
  },
284
407
  className: "text-lg font-medium",
285
408
  autoFocus: !0
@@ -287,90 +410,90 @@ const Oe = ({ children: t, exitBeforeEnter: i, custom: s, initial: n = !0, onExi
287
410
  ),
288
411
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
289
412
  /* @__PURE__ */ e.jsx(
290
- y,
413
+ x,
291
414
  {
292
415
  size: "icon",
293
416
  variant: "ghost",
294
- onClick: () => w(r.id),
295
- disabled: !l.trim(),
296
- children: /* @__PURE__ */ e.jsx(_, { size: 16 })
417
+ onClick: () => g(o.id),
418
+ disabled: !a.trim(),
419
+ children: /* @__PURE__ */ e.jsx(te, { size: 16 })
297
420
  }
298
421
  ),
299
422
  /* @__PURE__ */ e.jsx(
300
- y,
423
+ x,
301
424
  {
302
425
  size: "icon",
303
426
  variant: "ghost",
304
- onClick: j,
305
- children: /* @__PURE__ */ e.jsx(se, { size: 16 })
427
+ onClick: P,
428
+ children: /* @__PURE__ */ e.jsx(ue, { size: 16 })
306
429
  }
307
430
  )
308
431
  ] })
309
- ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: r.label }),
310
- /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: r.createdOn })
432
+ ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: o.label }),
433
+ /* @__PURE__ */ e.jsx("div", { className: "text-muted-foreground text-xs", children: o.createdOn })
311
434
  ] }),
312
435
  /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
313
- r.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
436
+ o.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
314
437
  "Created on",
315
438
  " ",
316
- new Date(r.createdOn).toLocaleDateString()
439
+ new Date(o.createdOn).toLocaleDateString()
317
440
  ] }),
318
- r.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
441
+ o.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
319
442
  "Expires on",
320
443
  " ",
321
- new Date(r.expiresOn).toLocaleDateString()
444
+ new Date(o.expiresOn).toLocaleDateString()
322
445
  ] })
323
446
  ] })
324
447
  ] }),
325
448
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-end", children: [
326
449
  t.updateConsumer && /* @__PURE__ */ e.jsxs(
327
- y,
450
+ x,
328
451
  {
329
452
  variant: "ghost",
330
- onClick: () => C(r.id, r.label),
331
- className: P(
453
+ onClick: () => m(o.id, o.label),
454
+ className: N(
332
455
  "flex gap-2",
333
- n === r.id && "opacity-0! pointer-events-none"
456
+ n === o.id && "opacity-0! pointer-events-none"
334
457
  ),
335
- disabled: n === r.id,
458
+ disabled: n === o.id,
336
459
  children: [
337
- /* @__PURE__ */ e.jsx(ne, { size: 16 }),
338
- "Edit label"
460
+ /* @__PURE__ */ e.jsx(he, { size: 16 }),
461
+ /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Edit label" })
339
462
  ]
340
463
  }
341
464
  ),
342
- t.rollKey && /* @__PURE__ */ e.jsxs(J, { children: [
343
- /* @__PURE__ */ e.jsx(U, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
344
- y,
465
+ t.rollKey && /* @__PURE__ */ e.jsxs($, { children: [
466
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
467
+ x,
345
468
  {
346
469
  title: "Roll this key",
347
470
  variant: "ghost",
348
- disabled: d.isPending,
471
+ disabled: p.isPending,
349
472
  className: "flex items-center gap-2",
350
473
  children: [
351
474
  /* @__PURE__ */ e.jsx(
352
- ie,
475
+ fe,
353
476
  {
354
477
  size: 16,
355
- className: d.isPending ? "animate-spin" : void 0
478
+ className: p.isPending ? "animate-spin" : void 0
356
479
  }
357
480
  ),
358
- "Roll key"
481
+ /* @__PURE__ */ e.jsx("span", { className: "hidden md:block", children: "Roll key" })
359
482
  ]
360
483
  }
361
484
  ) }),
362
- /* @__PURE__ */ e.jsxs(V, { children: [
363
- /* @__PURE__ */ e.jsxs(Y, { children: [
364
- /* @__PURE__ */ e.jsx(G, { children: "Roll API Key" }),
365
- /* @__PURE__ */ e.jsx(Z, { children: "Are you sure you want to roll this API key?" })
485
+ /* @__PURE__ */ e.jsxs(B, { children: [
486
+ /* @__PURE__ */ e.jsxs(H, { children: [
487
+ /* @__PURE__ */ e.jsx(V, { children: "Roll API Key" }),
488
+ /* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to roll this API key?" })
366
489
  ] }),
367
490
  /* @__PURE__ */ e.jsxs(W, { children: [
368
- /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
369
- /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
370
- y,
491
+ /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "outline", children: "Cancel" }) }),
492
+ /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(
493
+ x,
371
494
  {
372
495
  onClick: () => {
373
- d.mutate(r.id);
496
+ p.mutate(o.id);
374
497
  },
375
498
  children: "Roll Key"
376
499
  }
@@ -380,109 +503,118 @@ const Oe = ({ children: t, exitBeforeEnter: i, custom: s, initial: n = !0, onExi
380
503
  ] })
381
504
  ] })
382
505
  ] }),
383
- /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(Oe, { children: r.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(ye.Fragment, { children: [
506
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-full grid-cols-subgrid grid", children: /* @__PURE__ */ e.jsx(nt, { children: o.apiKeys.map((c) => /* @__PURE__ */ e.jsxs(Re.Fragment, { children: [
384
507
  /* @__PURE__ */ e.jsx(
385
- Qe,
508
+ lt,
386
509
  {
387
510
  apiKey: c,
388
511
  onDeleteKey: () => {
389
- h.mutate({
390
- consumerId: r.id,
512
+ u.mutate({
513
+ consumerId: o.id,
391
514
  keyId: c.id
392
515
  });
393
516
  },
394
- className: h.variables?.keyId === c.id && (h.isPending || x) ? "opacity-10!" : void 0
517
+ className: u.variables?.keyId === c.id && (u.isPending || y) ? "opacity-10!" : void 0
395
518
  }
396
519
  ),
397
520
  /* @__PURE__ */ e.jsx("div", { className: "col-span-full h-px bg-border" })
398
521
  ] }, c.id)) }) })
399
522
  ]
400
523
  },
401
- r.id
524
+ o.id
402
525
  ))
403
526
  }
404
527
  ) })
405
528
  ] });
406
- }, $e = (t) => {
407
- const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), o = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
408
- return n < 60 ? o.format(-n, "second") : n < 3600 ? o.format(-Math.floor(n / 60), "minute") : n < 86400 ? o.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? o.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? o.format(-Math.floor(n / 2592e3), "month") : o.format(-Math.floor(n / 31536e3), "year");
409
- }, Qe = ({
529
+ }, ot = (t) => {
530
+ const i = /* @__PURE__ */ new Date(), s = new Date(t), n = Math.floor((i.getTime() - s.getTime()) / 1e3), r = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
531
+ return n < 60 ? r.format(-n, "second") : n < 3600 ? r.format(-Math.floor(n / 60), "minute") : n < 86400 ? r.format(-Math.floor(n / 3600), "hour") : n < 2592e3 ? r.format(-Math.floor(n / 86400), "day") : n < 31536e3 ? r.format(-Math.floor(n / 2592e3), "month") : r.format(-Math.floor(n / 31536e3), "year");
532
+ }, lt = ({
410
533
  apiKey: t,
411
534
  onDeleteKey: i,
412
535
  className: s
413
536
  }) => {
414
- const [n, o] = b(!1), [l, m] = De(), { key: a, createdOn: x, expiresOn: h } = t, p = h && new Date(h) < /* @__PURE__ */ new Date(), d = h ? Math.ceil(
415
- (new Date(h).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
416
- ) : 1 / 0, C = d <= 7 && !p;
417
- return /* @__PURE__ */ e.jsxs("div", { className: P("grid col-span-full grid-cols-subgrid p-6", s), children: [
537
+ const [n, r] = K(!1), [a, l] = $e(), { key: h, createdOn: y, expiresOn: d } = t, C = d && new Date(d) < /* @__PURE__ */ new Date(), u = d ? Math.ceil(
538
+ (new Date(d).getTime() - (/* @__PURE__ */ new Date()).getTime()) / (1e3 * 60 * 60 * 24)
539
+ ) : 1 / 0, f = u <= 7 && !C;
540
+ return /* @__PURE__ */ e.jsxs("div", { className: N("grid col-span-full grid-cols-subgrid p-6", s), children: [
418
541
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
419
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-fit px-1", children: [
420
- /* @__PURE__ */ e.jsxs("div", { className: "font-mono truncate h-9 items-center flex px-2 text-xs gap-2", children: [
542
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm border rounded-md w-full max-w-fit px-1", children: [
543
+ /* @__PURE__ */ e.jsxs("div", { className: "font-mono w-full h-9 items-center flex px-2 text-xs gap-2", children: [
421
544
  /* @__PURE__ */ e.jsx(
422
545
  "div",
423
546
  {
424
- className: P(
547
+ className: N(
425
548
  "rounded-full w-2 h-2 bg-emerald-400 mr-2",
426
- (C || p) && "bg-neutral-200"
549
+ (f || C) && "bg-neutral-200"
427
550
  )
428
551
  }
429
552
  ),
430
- /* @__PURE__ */ e.jsxs("span", { children: [
431
- /* @__PURE__ */ e.jsx("span", { className: n ? "" : "opacity-20", children: n ? a.slice(0, -5) : "**** ".repeat(a.slice(0, -5).length / 5) + "*".repeat(a.slice(0, -5).length % 5) }),
432
- /* @__PURE__ */ e.jsx("span", { children: a.slice(-5) })
553
+ /* @__PURE__ */ e.jsxs("span", { className: "w-full truncate", children: [
554
+ /* @__PURE__ */ e.jsx(
555
+ "div",
556
+ {
557
+ className: N(
558
+ "w-40 inline-block md:w-full truncate",
559
+ n ? "" : "opacity-20"
560
+ ),
561
+ children: n ? h.slice(0, -5) : "**** ".repeat(h.slice(0, -5).length / 5) + "*".repeat(h.slice(0, -5).length % 5)
562
+ }
563
+ ),
564
+ /* @__PURE__ */ e.jsx("span", { children: h.slice(-5) })
433
565
  ] })
434
566
  ] }),
435
567
  /* @__PURE__ */ e.jsx(
436
- y,
568
+ x,
437
569
  {
438
570
  variant: "ghost",
439
- onClick: () => o((w) => !w),
571
+ onClick: () => r((p) => !p),
440
572
  size: "icon",
441
- children: n ? /* @__PURE__ */ e.jsx(re, { size: 16 }) : /* @__PURE__ */ e.jsx(ae, { size: 16 })
573
+ children: n ? /* @__PURE__ */ e.jsx(pe, { size: 16 }) : /* @__PURE__ */ e.jsx(me, { size: 16 })
442
574
  }
443
575
  ),
444
576
  /* @__PURE__ */ e.jsx(
445
- y,
577
+ x,
446
578
  {
447
579
  variant: "ghost",
448
- onClick: () => m(a),
580
+ onClick: () => l(h),
449
581
  size: "icon",
450
- children: l ? /* @__PURE__ */ e.jsx(_, { size: 16 }) : /* @__PURE__ */ e.jsx(oe, { size: 16 })
582
+ children: a ? /* @__PURE__ */ e.jsx(te, { size: 16 }) : /* @__PURE__ */ e.jsx(xe, { size: 16 })
451
583
  }
452
584
  )
453
585
  ] }),
454
586
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 mt-0.5 text-nowrap", children: [
455
- x && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
587
+ y && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-muted-foreground", children: [
456
588
  "Created ",
457
- $e(x),
589
+ ot(y),
458
590
  "."
459
591
  ] }),
460
592
  " ",
461
- h && C && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
593
+ d && f && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
462
594
  "Expires in ",
463
- d,
595
+ u,
464
596
  " ",
465
- d === 1 ? "day" : "days",
597
+ u === 1 ? "day" : "days",
466
598
  "."
467
599
  ] }),
468
- h && p && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
600
+ d && C && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-primary", children: [
469
601
  "Expired",
470
602
  " ",
471
- d === 0 ? "today." : `${d * -1} days ago.`
603
+ u === 0 ? "today." : `${u * -1} days ago.`
472
604
  ] })
473
605
  ] })
474
606
  ] }),
475
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: h && i && /* @__PURE__ */ e.jsxs(J, { children: [
476
- /* @__PURE__ */ e.jsx(U, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(le, { size: 16 }) }) }),
477
- /* @__PURE__ */ e.jsxs(V, { children: [
478
- /* @__PURE__ */ e.jsxs(Y, { children: [
479
- /* @__PURE__ */ e.jsx(G, { children: "Delete API Key" }),
480
- /* @__PURE__ */ e.jsx(Z, { children: "Are you sure you want to delete this API key?" })
607
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: d && i && /* @__PURE__ */ e.jsxs($, { children: [
608
+ /* @__PURE__ */ e.jsx(Q, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "ghost", size: "icon", children: /* @__PURE__ */ e.jsx(ye, { size: 16 }) }) }),
609
+ /* @__PURE__ */ e.jsxs(B, { children: [
610
+ /* @__PURE__ */ e.jsxs(H, { children: [
611
+ /* @__PURE__ */ e.jsx(V, { children: "Delete API Key" }),
612
+ /* @__PURE__ */ e.jsx(re, { children: "Are you sure you want to delete this API key?" })
481
613
  ] }),
482
614
  /* @__PURE__ */ e.jsxs(W, { children: [
483
- /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(y, { variant: "outline", children: "Cancel" }) }),
484
- /* @__PURE__ */ e.jsx(K, { asChild: !0, children: /* @__PURE__ */ e.jsx(
485
- y,
615
+ /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { variant: "outline", children: "Cancel" }) }),
616
+ /* @__PURE__ */ e.jsx(I, { asChild: !0, children: /* @__PURE__ */ e.jsx(
617
+ x,
486
618
  {
487
619
  onClick: () => {
488
620
  i();
@@ -494,55 +626,55 @@ const Oe = ({ children: t, exitBeforeEnter: i, custom: s, initial: n = !0, onExi
494
626
  ] })
495
627
  ] }) })
496
628
  ] });
497
- }, D = "https://api.zuploedge.com/v2/client", _e = async (t) => {
629
+ }, S = "https://api.zuploedge.com/v2/client", ct = async (t) => {
498
630
  try {
499
631
  return await t.json();
500
632
  } catch {
501
633
  return;
502
634
  }
503
- }, I = async (t) => {
635
+ }, T = async (t) => {
504
636
  const i = t.headers.get("content-type");
505
637
  if (!t.ok && i?.includes("application/problem+json")) {
506
- const s = await _e(t);
638
+ const s = await ct(t);
507
639
  if (s.type && s.title)
508
640
  throw new Error(s.detail ?? s.title);
509
641
  }
510
- }, He = (t) => ({
511
- deleteKey: async (i, s, n) => {
512
- const o = new Request(
513
- D + `/${t}/consumers/${i}/keys/${s}`,
642
+ }, dt = (t, i) => ({
643
+ deleteKey: async (s, n, r) => {
644
+ const a = new Request(
645
+ S + `/${t}/consumers/${s}/keys/${n}`,
514
646
  {
515
647
  method: "DELETE"
516
648
  }
517
649
  );
518
- await n.signRequest(o);
519
- const l = await fetch(o);
520
- await I(l), E(l.ok, "Failed to delete API key");
650
+ await r.signRequest(a);
651
+ const l = await fetch(a);
652
+ await T(l), A(l.ok, "Failed to delete API key");
521
653
  },
522
- updateConsumer: async (i, s) => {
523
- const n = await fetch(
524
- await s.signRequest(
654
+ updateConsumer: async (s, n) => {
655
+ const r = await fetch(
656
+ await n.signRequest(
525
657
  new Request(
526
- D + `/${t}/consumers/${i.id}`,
658
+ S + `/${t}/consumers/${s.id}`,
527
659
  {
528
660
  method: "PATCH",
529
661
  headers: {
530
662
  "Content-Type": "application/json"
531
663
  },
532
664
  body: JSON.stringify({
533
- label: i.label
665
+ label: s.label
534
666
  })
535
667
  }
536
668
  )
537
669
  )
538
670
  );
539
- await I(n), E(n.ok, "Failed to update API key description");
671
+ await T(r), A(r.ok, "Failed to update API key description");
540
672
  },
541
- rollKey: async (i, s) => {
542
- const n = await fetch(
543
- await s.signRequest(
673
+ rollKey: async (s, n) => {
674
+ const r = await fetch(
675
+ await n.signRequest(
544
676
  new Request(
545
- D + `/${t}/consumers/${i}/roll-key`,
677
+ S + `/${t}/consumers/${s}/roll-key`,
546
678
  {
547
679
  method: "POST",
548
680
  headers: {
@@ -553,41 +685,42 @@ const Oe = ({ children: t, exitBeforeEnter: i, custom: s, initial: n = !0, onExi
553
685
  )
554
686
  )
555
687
  );
556
- await I(n), E(n.ok, "Failed to delete API key");
688
+ await T(r), A(r.ok, "Failed to delete API key");
557
689
  },
558
- getConsumers: async (i) => {
559
- const s = new Request(
560
- D + `/${t}/consumers`
690
+ getConsumers: async (s) => {
691
+ const n = new Request(
692
+ S + `/${t}/consumers`
561
693
  );
562
- await i.signRequest(s);
563
- const n = await fetch(s);
564
- return await I(n), E(n.ok, "Failed to fetch API keys"), (await n.json()).data.map((l) => ({
694
+ await s.signRequest(n);
695
+ const r = await fetch(n);
696
+ return await T(r), A(r.ok, "Failed to fetch API keys"), (await r.json()).data.map((l) => ({
565
697
  id: l.id,
566
- label: l.label ?? l.subject ?? "API Key",
698
+ label: l.label || l.subject || "API Key",
567
699
  apiKeys: l.apiKeys.data,
568
700
  key: l.apiKeys.data.at(0)
569
701
  }));
570
- }
571
- }), rt = (t) => t, at = (t) => {
572
- const i = "deploymentName" in t ? He(t.deploymentName) : t;
702
+ },
703
+ ...i
704
+ }), It = (t) => t, Pt = (t) => {
705
+ const i = "deploymentName" in t ? dt(t.deploymentName, t) : t;
573
706
  return {
574
707
  getProfileMenuItems: () => [
575
708
  {
576
709
  label: "API Keys",
577
710
  path: "/settings/api-keys",
578
711
  category: "middle",
579
- icon: ce
712
+ icon: ge
580
713
  }
581
714
  ],
582
715
  getIdentities: async (s) => {
583
716
  try {
584
- return (await i.getConsumers(s)).map((o) => ({
585
- authorizeRequest: (l) => (l.headers.set(
717
+ return (await i.getConsumers(s)).map((r) => ({
718
+ authorizeRequest: (a) => (a.headers.set(
586
719
  "Authorization",
587
- `Bearer ${o.apiKeys.at(0)?.key}`
588
- ), l),
589
- id: o.id,
590
- label: o.label
720
+ `Bearer ${r.apiKeys.at(0)?.key}`
721
+ ), a),
722
+ id: r.id,
723
+ label: r.label
591
724
  }));
592
725
  } catch {
593
726
  return [];
@@ -595,24 +728,20 @@ const Oe = ({ children: t, exitBeforeEnter: i, custom: s, initial: n = !0, onExi
595
728
  },
596
729
  getRoutes: () => [
597
730
  {
598
- element: /* @__PURE__ */ e.jsx(Ie, {}),
599
- errorElement: /* @__PURE__ */ e.jsx(ue, {}),
731
+ element: /* @__PURE__ */ e.jsx(Ve, {}),
732
+ errorElement: /* @__PURE__ */ e.jsx(Ce, {}),
600
733
  children: [
601
734
  {
602
735
  path: "/settings/api-keys",
603
- element: /* @__PURE__ */ e.jsx(Fe, { service: i })
736
+ element: /* @__PURE__ */ e.jsx(at, { service: i })
604
737
  }
605
- // {
606
- // path: "/settings/api-keys/new",
607
- // element: <CreateApiKey service={service} />,
608
- // },
609
738
  ]
610
739
  }
611
740
  ]
612
741
  };
613
742
  };
614
743
  export {
615
- at as apiKeyPlugin,
616
- rt as createApiKeyService
744
+ Pt as apiKeyPlugin,
745
+ It as createApiKeyService
617
746
  };
618
747
  //# sourceMappingURL=zudoku.plugin-api-keys.js.map