@xtandard/kit 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (402) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -2
  3. package/bin/xtandard-kit.mjs +3 -0
  4. package/dist/base-path-BJugWLNO.cjs +42 -0
  5. package/dist/base-path-BJugWLNO.cjs.map +1 -0
  6. package/dist/base-path-CDb4In5E.mjs +31 -0
  7. package/dist/base-path-CDb4In5E.mjs.map +1 -0
  8. package/dist/basic-Qtriv0xS.mjs +176 -0
  9. package/dist/basic-Qtriv0xS.mjs.map +1 -0
  10. package/dist/basic-ZaO92-lB.cjs +199 -0
  11. package/dist/basic-ZaO92-lB.cjs.map +1 -0
  12. package/dist/bin.cjs +126 -0
  13. package/dist/bin.cjs.map +1 -0
  14. package/dist/bin.d.cts +20 -0
  15. package/dist/bin.d.mts +20 -0
  16. package/dist/bin.mjs +125 -0
  17. package/dist/bin.mjs.map +1 -0
  18. package/dist/cas-CuPSaXBV.cjs +23 -0
  19. package/dist/cas-CuPSaXBV.cjs.map +1 -0
  20. package/dist/cas-CzA-yECx.mjs +18 -0
  21. package/dist/cas-CzA-yECx.mjs.map +1 -0
  22. package/dist/chunk-DakpK96I.cjs +43 -0
  23. package/dist/contract-B3UPXXLx.d.cts +30 -0
  24. package/dist/contract-B3UPXXLx.d.mts +30 -0
  25. package/dist/contract-BDPNvjtp.d.mts +64 -0
  26. package/dist/contract-BEdfGTPs.mjs +85 -0
  27. package/dist/contract-BEdfGTPs.mjs.map +1 -0
  28. package/dist/contract-BIVzAn4f.d.cts +64 -0
  29. package/dist/contract-BvgtswLX.d.cts +75 -0
  30. package/dist/contract-BvgtswLX.d.mts +75 -0
  31. package/dist/contract-DUj9P3Vt.d.cts +72 -0
  32. package/dist/contract-DUj9P3Vt.d.mts +72 -0
  33. package/dist/contract-wAEMDmYG.cjs +132 -0
  34. package/dist/contract-wAEMDmYG.cjs.map +1 -0
  35. package/dist/drizzle-BElCHWri.d.mts +115 -0
  36. package/dist/drizzle-BXaQXCr0.cjs +232 -0
  37. package/dist/drizzle-BXaQXCr0.cjs.map +1 -0
  38. package/dist/drizzle-CEpahWQB.d.cts +115 -0
  39. package/dist/drizzle-DxnelsPT.mjs +197 -0
  40. package/dist/drizzle-DxnelsPT.mjs.map +1 -0
  41. package/dist/duration-7WpAK-xe.mjs +52 -0
  42. package/dist/duration-7WpAK-xe.mjs.map +1 -0
  43. package/dist/duration-DVA0Fzkx.cjs +63 -0
  44. package/dist/duration-DVA0Fzkx.cjs.map +1 -0
  45. package/dist/duration-FPwbmWIU.d.cts +35 -0
  46. package/dist/duration-FPwbmWIU.d.mts +35 -0
  47. package/dist/entry-adapters-bun.cjs +10 -0
  48. package/dist/entry-adapters-bun.cjs.map +1 -0
  49. package/dist/entry-adapters-bun.d.cts +10 -0
  50. package/dist/entry-adapters-bun.d.mts +10 -0
  51. package/dist/entry-adapters-bun.mjs +9 -0
  52. package/dist/entry-adapters-bun.mjs.map +1 -0
  53. package/dist/entry-adapters-elysia.cjs +54 -0
  54. package/dist/entry-adapters-elysia.cjs.map +1 -0
  55. package/dist/entry-adapters-elysia.d.cts +38 -0
  56. package/dist/entry-adapters-elysia.d.mts +38 -0
  57. package/dist/entry-adapters-elysia.mjs +53 -0
  58. package/dist/entry-adapters-elysia.mjs.map +1 -0
  59. package/dist/entry-adapters-express.cjs +27 -0
  60. package/dist/entry-adapters-express.cjs.map +1 -0
  61. package/dist/entry-adapters-express.d.cts +24 -0
  62. package/dist/entry-adapters-express.d.mts +24 -0
  63. package/dist/entry-adapters-express.mjs +26 -0
  64. package/dist/entry-adapters-express.mjs.map +1 -0
  65. package/dist/entry-adapters-hono.cjs +33 -0
  66. package/dist/entry-adapters-hono.cjs.map +1 -0
  67. package/dist/entry-adapters-hono.d.cts +36 -0
  68. package/dist/entry-adapters-hono.d.mts +36 -0
  69. package/dist/entry-adapters-hono.mjs +30 -0
  70. package/dist/entry-adapters-hono.mjs.map +1 -0
  71. package/dist/entry-adapters-next.cjs +19 -0
  72. package/dist/entry-adapters-next.cjs.map +1 -0
  73. package/dist/entry-adapters-next.d.cts +35 -0
  74. package/dist/entry-adapters-next.d.mts +35 -0
  75. package/dist/entry-adapters-next.mjs +18 -0
  76. package/dist/entry-adapters-next.mjs.map +1 -0
  77. package/dist/entry-adapters-node.cjs +7 -0
  78. package/dist/entry-adapters-node.d.cts +2 -0
  79. package/dist/entry-adapters-node.d.mts +2 -0
  80. package/dist/entry-adapters-node.mjs +2 -0
  81. package/dist/entry-auth-basic.cjs +5 -0
  82. package/dist/entry-auth-basic.d.cts +83 -0
  83. package/dist/entry-auth-basic.d.mts +83 -0
  84. package/dist/entry-auth-basic.mjs +2 -0
  85. package/dist/entry-auth-delegated.cjs +28 -0
  86. package/dist/entry-auth-delegated.cjs.map +1 -0
  87. package/dist/entry-auth-delegated.d.cts +36 -0
  88. package/dist/entry-auth-delegated.d.mts +36 -0
  89. package/dist/entry-auth-delegated.mjs +27 -0
  90. package/dist/entry-auth-delegated.mjs.map +1 -0
  91. package/dist/entry-auth-none.cjs +4 -0
  92. package/dist/entry-auth-none.d.cts +25 -0
  93. package/dist/entry-auth-none.d.mts +25 -0
  94. package/dist/entry-auth-none.mjs +2 -0
  95. package/dist/entry-auth.cjs +0 -0
  96. package/dist/entry-auth.d.cts +2 -0
  97. package/dist/entry-auth.d.mts +2 -0
  98. package/dist/entry-auth.mjs +1 -0
  99. package/dist/entry-authorization-delegated.cjs +27 -0
  100. package/dist/entry-authorization-delegated.cjs.map +1 -0
  101. package/dist/entry-authorization-delegated.d.cts +31 -0
  102. package/dist/entry-authorization-delegated.d.mts +31 -0
  103. package/dist/entry-authorization-delegated.mjs +26 -0
  104. package/dist/entry-authorization-delegated.mjs.map +1 -0
  105. package/dist/entry-authorization-none.cjs +3 -0
  106. package/dist/entry-authorization-none.d.cts +18 -0
  107. package/dist/entry-authorization-none.d.mts +18 -0
  108. package/dist/entry-authorization-none.mjs +2 -0
  109. package/dist/entry-authorization-roles.cjs +3 -0
  110. package/dist/entry-authorization-roles.d.cts +2 -0
  111. package/dist/entry-authorization-roles.d.mts +2 -0
  112. package/dist/entry-authorization-roles.mjs +2 -0
  113. package/dist/entry-authorization.cjs +35 -0
  114. package/dist/entry-authorization.cjs.map +1 -0
  115. package/dist/entry-authorization.d.cts +2 -0
  116. package/dist/entry-authorization.d.mts +2 -0
  117. package/dist/entry-authorization.mjs +34 -0
  118. package/dist/entry-authorization.mjs.map +1 -0
  119. package/dist/entry-build.cjs +481 -0
  120. package/dist/entry-build.cjs.map +1 -0
  121. package/dist/entry-build.d.cts +355 -0
  122. package/dist/entry-build.d.mts +355 -0
  123. package/dist/entry-build.mjs +460 -0
  124. package/dist/entry-build.mjs.map +1 -0
  125. package/dist/entry-cli.cjs +368 -0
  126. package/dist/entry-cli.cjs.map +1 -0
  127. package/dist/entry-cli.d.cts +275 -0
  128. package/dist/entry-cli.d.mts +275 -0
  129. package/dist/entry-cli.mjs +355 -0
  130. package/dist/entry-cli.mjs.map +1 -0
  131. package/dist/entry-drizzle-mysql.cjs +36 -0
  132. package/dist/entry-drizzle-mysql.cjs.map +1 -0
  133. package/dist/entry-drizzle-mysql.d.cts +55 -0
  134. package/dist/entry-drizzle-mysql.d.mts +55 -0
  135. package/dist/entry-drizzle-mysql.mjs +34 -0
  136. package/dist/entry-drizzle-mysql.mjs.map +1 -0
  137. package/dist/entry-drizzle-pg.cjs +38 -0
  138. package/dist/entry-drizzle-pg.cjs.map +1 -0
  139. package/dist/entry-drizzle-pg.d.cts +78 -0
  140. package/dist/entry-drizzle-pg.d.mts +78 -0
  141. package/dist/entry-drizzle-pg.mjs +36 -0
  142. package/dist/entry-drizzle-pg.mjs.map +1 -0
  143. package/dist/entry-drizzle-sqlite.cjs +20 -0
  144. package/dist/entry-drizzle-sqlite.cjs.map +1 -0
  145. package/dist/entry-drizzle-sqlite.d.cts +22 -0
  146. package/dist/entry-drizzle-sqlite.d.mts +22 -0
  147. package/dist/entry-drizzle-sqlite.mjs +19 -0
  148. package/dist/entry-drizzle-sqlite.mjs.map +1 -0
  149. package/dist/entry-hooks-log.cjs +32 -0
  150. package/dist/entry-hooks-log.cjs.map +1 -0
  151. package/dist/entry-hooks-log.d.cts +36 -0
  152. package/dist/entry-hooks-log.d.mts +36 -0
  153. package/dist/entry-hooks-log.mjs +31 -0
  154. package/dist/entry-hooks-log.mjs.map +1 -0
  155. package/dist/entry-hooks.cjs +10 -0
  156. package/dist/entry-hooks.d.cts +2 -0
  157. package/dist/entry-hooks.d.mts +2 -0
  158. package/dist/entry-hooks.mjs +2 -0
  159. package/dist/entry-server-router.cjs +235 -0
  160. package/dist/entry-server-router.cjs.map +1 -0
  161. package/dist/entry-server-router.d.cts +193 -0
  162. package/dist/entry-server-router.d.mts +193 -0
  163. package/dist/entry-server-router.mjs +228 -0
  164. package/dist/entry-server-router.mjs.map +1 -0
  165. package/dist/entry-server.cjs +344 -0
  166. package/dist/entry-server.cjs.map +1 -0
  167. package/dist/entry-server.d.cts +230 -0
  168. package/dist/entry-server.d.mts +230 -0
  169. package/dist/entry-server.mjs +322 -0
  170. package/dist/entry-server.mjs.map +1 -0
  171. package/dist/entry-site.cjs +1083 -0
  172. package/dist/entry-site.cjs.map +1 -0
  173. package/dist/entry-site.d.cts +336 -0
  174. package/dist/entry-site.d.mts +336 -0
  175. package/dist/entry-site.mjs +1060 -0
  176. package/dist/entry-site.mjs.map +1 -0
  177. package/dist/entry-storage-cloudflare-kv.cjs +51 -0
  178. package/dist/entry-storage-cloudflare-kv.cjs.map +1 -0
  179. package/dist/entry-storage-cloudflare-kv.d.cts +52 -0
  180. package/dist/entry-storage-cloudflare-kv.d.mts +52 -0
  181. package/dist/entry-storage-cloudflare-kv.mjs +50 -0
  182. package/dist/entry-storage-cloudflare-kv.mjs.map +1 -0
  183. package/dist/entry-storage-drizzle-internals.cjs +6 -0
  184. package/dist/entry-storage-drizzle-internals.d.cts +2 -0
  185. package/dist/entry-storage-drizzle-internals.d.mts +2 -0
  186. package/dist/entry-storage-drizzle-internals.mjs +2 -0
  187. package/dist/entry-storage-drizzle.cjs +4 -0
  188. package/dist/entry-storage-drizzle.d.cts +3 -0
  189. package/dist/entry-storage-drizzle.d.mts +3 -0
  190. package/dist/entry-storage-drizzle.mjs +2 -0
  191. package/dist/entry-storage-file.cjs +306 -0
  192. package/dist/entry-storage-file.cjs.map +1 -0
  193. package/dist/entry-storage-file.d.cts +76 -0
  194. package/dist/entry-storage-file.d.mts +76 -0
  195. package/dist/entry-storage-file.mjs +301 -0
  196. package/dist/entry-storage-file.mjs.map +1 -0
  197. package/dist/entry-storage-libsql-internals.cjs +7 -0
  198. package/dist/entry-storage-libsql-internals.d.cts +3 -0
  199. package/dist/entry-storage-libsql-internals.d.mts +3 -0
  200. package/dist/entry-storage-libsql-internals.mjs +3 -0
  201. package/dist/entry-storage-libsql.cjs +3 -0
  202. package/dist/entry-storage-libsql.d.cts +2 -0
  203. package/dist/entry-storage-libsql.d.mts +2 -0
  204. package/dist/entry-storage-libsql.mjs +2 -0
  205. package/dist/entry-storage-memory.cjs +78 -0
  206. package/dist/entry-storage-memory.cjs.map +1 -0
  207. package/dist/entry-storage-memory.d.cts +35 -0
  208. package/dist/entry-storage-memory.d.mts +35 -0
  209. package/dist/entry-storage-memory.mjs +77 -0
  210. package/dist/entry-storage-memory.mjs.map +1 -0
  211. package/dist/entry-storage-mongodb-internals.cjs +5 -0
  212. package/dist/entry-storage-mongodb-internals.d.cts +2 -0
  213. package/dist/entry-storage-mongodb-internals.d.mts +2 -0
  214. package/dist/entry-storage-mongodb-internals.mjs +2 -0
  215. package/dist/entry-storage-mongodb.cjs +3 -0
  216. package/dist/entry-storage-mongodb.d.cts +2 -0
  217. package/dist/entry-storage-mongodb.d.mts +2 -0
  218. package/dist/entry-storage-mongodb.mjs +2 -0
  219. package/dist/entry-storage-postgres-internals.cjs +6 -0
  220. package/dist/entry-storage-postgres-internals.d.cts +2 -0
  221. package/dist/entry-storage-postgres-internals.d.mts +2 -0
  222. package/dist/entry-storage-postgres-internals.mjs +2 -0
  223. package/dist/entry-storage-postgres.cjs +4 -0
  224. package/dist/entry-storage-postgres.d.cts +2 -0
  225. package/dist/entry-storage-postgres.d.mts +2 -0
  226. package/dist/entry-storage-postgres.mjs +2 -0
  227. package/dist/entry-storage-redis-internals.cjs +7 -0
  228. package/dist/entry-storage-redis-internals.d.cts +2 -0
  229. package/dist/entry-storage-redis-internals.d.mts +2 -0
  230. package/dist/entry-storage-redis-internals.mjs +2 -0
  231. package/dist/entry-storage-redis.cjs +4 -0
  232. package/dist/entry-storage-redis.d.cts +2 -0
  233. package/dist/entry-storage-redis.d.mts +2 -0
  234. package/dist/entry-storage-redis.mjs +2 -0
  235. package/dist/entry-storage-sqlite-internals.cjs +7 -0
  236. package/dist/entry-storage-sqlite-internals.d.cts +3 -0
  237. package/dist/entry-storage-sqlite-internals.d.mts +3 -0
  238. package/dist/entry-storage-sqlite-internals.mjs +3 -0
  239. package/dist/entry-storage-sqlite.cjs +3 -0
  240. package/dist/entry-storage-sqlite.d.cts +2 -0
  241. package/dist/entry-storage-sqlite.d.mts +2 -0
  242. package/dist/entry-storage-sqlite.mjs +2 -0
  243. package/dist/entry-storage-testing.cjs +801 -0
  244. package/dist/entry-storage-testing.cjs.map +1 -0
  245. package/dist/entry-storage-testing.d.cts +150 -0
  246. package/dist/entry-storage-testing.d.mts +150 -0
  247. package/dist/entry-storage-testing.mjs +790 -0
  248. package/dist/entry-storage-testing.mjs.map +1 -0
  249. package/dist/entry-storage-unstorage.cjs +78 -0
  250. package/dist/entry-storage-unstorage.cjs.map +1 -0
  251. package/dist/entry-storage-unstorage.d.cts +30 -0
  252. package/dist/entry-storage-unstorage.d.mts +30 -0
  253. package/dist/entry-storage-unstorage.mjs +77 -0
  254. package/dist/entry-storage-unstorage.mjs.map +1 -0
  255. package/dist/entry-storage.cjs +114 -0
  256. package/dist/entry-storage.cjs.map +1 -0
  257. package/dist/entry-storage.d.cts +152 -0
  258. package/dist/entry-storage.d.mts +152 -0
  259. package/dist/entry-storage.mjs +91 -0
  260. package/dist/entry-storage.mjs.map +1 -0
  261. package/dist/entry-testing.cjs +79 -0
  262. package/dist/entry-testing.cjs.map +1 -0
  263. package/dist/entry-testing.d.cts +55 -0
  264. package/dist/entry-testing.d.mts +55 -0
  265. package/dist/entry-testing.mjs +77 -0
  266. package/dist/entry-testing.mjs.map +1 -0
  267. package/dist/entry-tokens.cjs +4 -0
  268. package/dist/entry-tokens.d.cts +85 -0
  269. package/dist/entry-tokens.d.mts +85 -0
  270. package/dist/entry-tokens.mjs +2 -0
  271. package/dist/entry-ui-embed.cjs +131 -0
  272. package/dist/entry-ui-embed.cjs.map +1 -0
  273. package/dist/entry-ui-embed.d.cts +87 -0
  274. package/dist/entry-ui-embed.d.mts +87 -0
  275. package/dist/entry-ui-embed.mjs +127 -0
  276. package/dist/entry-ui-embed.mjs.map +1 -0
  277. package/dist/entry-ui.cjs +795 -0
  278. package/dist/entry-ui.cjs.map +1 -0
  279. package/dist/entry-ui.d.cts +574 -0
  280. package/dist/entry-ui.d.mts +574 -0
  281. package/dist/entry-ui.mjs +731 -0
  282. package/dist/entry-ui.mjs.map +1 -0
  283. package/dist/entry-util.cjs +145 -0
  284. package/dist/entry-util.cjs.map +1 -0
  285. package/dist/entry-util.d.cts +85 -0
  286. package/dist/entry-util.d.mts +85 -0
  287. package/dist/entry-util.mjs +130 -0
  288. package/dist/entry-util.mjs.map +1 -0
  289. package/dist/http-B_rTnLW9.cjs +235 -0
  290. package/dist/http-B_rTnLW9.cjs.map +1 -0
  291. package/dist/http-CxYM7kPT.d.mts +133 -0
  292. package/dist/http-DVdVI6kJ.mjs +164 -0
  293. package/dist/http-DVdVI6kJ.mjs.map +1 -0
  294. package/dist/http-XBVRk8uo.d.cts +133 -0
  295. package/dist/index.cjs +8 -0
  296. package/dist/index.cjs.map +1 -0
  297. package/dist/index.d.cts +6 -0
  298. package/dist/index.d.mts +6 -0
  299. package/dist/index.mjs +7 -0
  300. package/dist/index.mjs.map +1 -0
  301. package/dist/json-CCyzstIm.d.cts +44 -0
  302. package/dist/json-CCyzstIm.d.mts +44 -0
  303. package/dist/json-CM7TwYQ7.cjs +92 -0
  304. package/dist/json-CM7TwYQ7.cjs.map +1 -0
  305. package/dist/json-CmM1M5Kz.mjs +63 -0
  306. package/dist/json-CmM1M5Kz.mjs.map +1 -0
  307. package/dist/keys-Bwubabk0.mjs +73 -0
  308. package/dist/keys-Bwubabk0.mjs.map +1 -0
  309. package/dist/keys-DQrwxDKI.cjs +126 -0
  310. package/dist/keys-DQrwxDKI.cjs.map +1 -0
  311. package/dist/kv-sqlite-B6iTLOx2.d.cts +20 -0
  312. package/dist/kv-sqlite-CHOdIMJ-.cjs +77 -0
  313. package/dist/kv-sqlite-CHOdIMJ-.cjs.map +1 -0
  314. package/dist/kv-sqlite-DIIPfflJ.mjs +66 -0
  315. package/dist/kv-sqlite-DIIPfflJ.mjs.map +1 -0
  316. package/dist/kv-sqlite-Tx4UedJs.d.mts +20 -0
  317. package/dist/libsql-0160BubR.d.mts +65 -0
  318. package/dist/libsql-BZmRZIqt.d.cts +65 -0
  319. package/dist/libsql-CiBfVtbS.cjs +103 -0
  320. package/dist/libsql-CiBfVtbS.cjs.map +1 -0
  321. package/dist/libsql-CkOjQINi.mjs +86 -0
  322. package/dist/libsql-CkOjQINi.mjs.map +1 -0
  323. package/dist/mongodb--Cuj7V_9.cjs +150 -0
  324. package/dist/mongodb--Cuj7V_9.cjs.map +1 -0
  325. package/dist/mongodb-DGtsolQ2.d.cts +61 -0
  326. package/dist/mongodb-JMizy4Wg.mjs +127 -0
  327. package/dist/mongodb-JMizy4Wg.mjs.map +1 -0
  328. package/dist/mongodb-xGEU5Gwz.d.mts +61 -0
  329. package/dist/node-B1Djcwfi.d.cts +57 -0
  330. package/dist/node-B1Djcwfi.d.mts +57 -0
  331. package/dist/node-BYjocCbU.mjs +167 -0
  332. package/dist/node-BYjocCbU.mjs.map +1 -0
  333. package/dist/node-DFFqYRk-.cjs +201 -0
  334. package/dist/node-DFFqYRk-.cjs.map +1 -0
  335. package/dist/none-BEY7Kc_-.mjs +33 -0
  336. package/dist/none-BEY7Kc_-.mjs.map +1 -0
  337. package/dist/none-BoQ6-30P.cjs +33 -0
  338. package/dist/none-BoQ6-30P.cjs.map +1 -0
  339. package/dist/none-CHwVkQL-.cjs +49 -0
  340. package/dist/none-CHwVkQL-.cjs.map +1 -0
  341. package/dist/none-yu3qC47E.mjs +23 -0
  342. package/dist/none-yu3qC47E.mjs.map +1 -0
  343. package/dist/peer-BIjBFzwQ.cjs +56 -0
  344. package/dist/peer-BIjBFzwQ.cjs.map +1 -0
  345. package/dist/peer-CTHMzOdn.mjs +40 -0
  346. package/dist/peer-CTHMzOdn.mjs.map +1 -0
  347. package/dist/portal-container-CJIcau3B.mjs +610 -0
  348. package/dist/portal-container-CJIcau3B.mjs.map +1 -0
  349. package/dist/portal-container-Ca1NxrLE.cjs +774 -0
  350. package/dist/portal-container-Ca1NxrLE.cjs.map +1 -0
  351. package/dist/postgres-BJzxKBk0.d.cts +72 -0
  352. package/dist/postgres-CA8_XcAE.cjs +164 -0
  353. package/dist/postgres-CA8_XcAE.cjs.map +1 -0
  354. package/dist/postgres-RfQMgAsj.d.mts +72 -0
  355. package/dist/postgres-aDiBmNzr.mjs +135 -0
  356. package/dist/postgres-aDiBmNzr.mjs.map +1 -0
  357. package/dist/redis-B2AS4xAQ.cjs +259 -0
  358. package/dist/redis-B2AS4xAQ.cjs.map +1 -0
  359. package/dist/redis-B362ofBw.d.cts +159 -0
  360. package/dist/redis-CahNAVTW.d.mts +159 -0
  361. package/dist/redis-hdoKymfG.mjs +218 -0
  362. package/dist/redis-hdoKymfG.mjs.map +1 -0
  363. package/dist/roles-7JPrQXZa.mjs +46 -0
  364. package/dist/roles-7JPrQXZa.mjs.map +1 -0
  365. package/dist/roles-B_8QqJ3j.cjs +56 -0
  366. package/dist/roles-B_8QqJ3j.cjs.map +1 -0
  367. package/dist/roles-DLISB4T3.d.mts +41 -0
  368. package/dist/roles-DQbbtUPW.d.cts +41 -0
  369. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  370. package/dist/scope-css-BN3jf0ly.cjs +315 -0
  371. package/dist/scope-css-BN3jf0ly.cjs.map +1 -0
  372. package/dist/scope-css-BuJfRCsE.mjs +256 -0
  373. package/dist/scope-css-BuJfRCsE.mjs.map +1 -0
  374. package/dist/scoped-BRoE1W1x.cjs +175 -0
  375. package/dist/scoped-BRoE1W1x.cjs.map +1 -0
  376. package/dist/scoped-cFBbotCh.mjs +164 -0
  377. package/dist/scoped-cFBbotCh.mjs.map +1 -0
  378. package/dist/sqlite-B2g1JJz1.d.cts +47 -0
  379. package/dist/sqlite-BIPIlxfj.d.mts +47 -0
  380. package/dist/sqlite-BntoYaXZ.cjs +79 -0
  381. package/dist/sqlite-BntoYaXZ.cjs.map +1 -0
  382. package/dist/sqlite-DYJDcu7p.mjs +62 -0
  383. package/dist/sqlite-DYJDcu7p.mjs.map +1 -0
  384. package/dist/table-BrioFSra.d.cts +11 -0
  385. package/dist/table-BrioFSra.d.mts +11 -0
  386. package/dist/theme-context-DzZ1otaD.d.cts +270 -0
  387. package/dist/theme-context-J65pythD.d.mts +270 -0
  388. package/dist/ui/styles.css +239 -0
  389. package/dist/util-Dnj5T-yw.mjs +39 -0
  390. package/dist/util-Dnj5T-yw.mjs.map +1 -0
  391. package/dist/util-dAnTK9x-.cjs +74 -0
  392. package/dist/util-dAnTK9x-.cjs.map +1 -0
  393. package/dist/validation-B-atP968.mjs +191 -0
  394. package/dist/validation-B-atP968.mjs.map +1 -0
  395. package/dist/validation-BJifGoB2.d.mts +122 -0
  396. package/dist/validation-DLnzBVJr.cjs +258 -0
  397. package/dist/validation-DLnzBVJr.cjs.map +1 -0
  398. package/dist/validation-tfV2qhbD.d.cts +122 -0
  399. package/package.json +715 -4
  400. package/tsconfig/assets.d.ts +21 -0
  401. package/tsconfig/base.json +21 -0
  402. package/tsconfig/react.json +9 -0
@@ -0,0 +1,774 @@
1
+ const require_chunk = require("./chunk-DakpK96I.cjs");
2
+ let react = require("react");
3
+ react = require_chunk.__toESM(react);
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ let react_dom_client = require("react-dom/client");
6
+ let _tanstack_react_query = require("@tanstack/react-query");
7
+ let wouter_use_browser_location = require("wouter/use-browser-location");
8
+ let lucide_react = require("lucide-react");
9
+ let clsx = require("clsx");
10
+ let tailwind_merge = require("tailwind-merge");
11
+ let wouter = require("wouter");
12
+ //#region src/ui/theme.ts
13
+ const DARK_QUERY = "(prefers-color-scheme: dark)";
14
+ function darkQuery() {
15
+ return typeof matchMedia !== "undefined" ? matchMedia(DARK_QUERY) : void 0;
16
+ }
17
+ function prefersDark() {
18
+ return darkQuery()?.matches ?? false;
19
+ }
20
+ /** The OS colour scheme right now (`light` when it can't be read, e.g. on the server). */
21
+ function systemTheme() {
22
+ return prefersDark() ? "dark" : "light";
23
+ }
24
+ /** Call `cb` when the OS colour scheme flips. Returns the unsubscribe function. */
25
+ function subscribeSystemTheme(cb) {
26
+ const mq = darkQuery();
27
+ mq?.addEventListener("change", cb);
28
+ return () => mq?.removeEventListener("change", cb);
29
+ }
30
+ /** The concrete theme a preference resolves to right now. */
31
+ function resolveTheme(pref) {
32
+ return pref === "system" ? systemTheme() : pref;
33
+ }
34
+ /**
35
+ * Create the theme store for one product. `storageKey` is the product's localStorage key
36
+ * (`"xtandard-webhooks:theme"`…); it is a stored-data contract, so products pass it explicitly.
37
+ */
38
+ function createThemeStore(storageKey) {
39
+ const listeners = /* @__PURE__ */ new Set();
40
+ const getThemePref = () => {
41
+ try {
42
+ const v = localStorage.getItem(storageKey);
43
+ if (v === "light" || v === "dark" || v === "system") return v;
44
+ } catch {}
45
+ return "system";
46
+ };
47
+ const setThemePref = (pref) => {
48
+ try {
49
+ localStorage.setItem(storageKey, pref);
50
+ } catch {}
51
+ for (const cb of listeners) cb();
52
+ };
53
+ const getResolvedTheme = () => resolveTheme(getThemePref());
54
+ const subscribeThemePref = (cb) => {
55
+ listeners.add(cb);
56
+ const mq = darkQuery();
57
+ const onOs = () => {
58
+ if (getThemePref() === "system") cb();
59
+ };
60
+ mq?.addEventListener("change", onOs);
61
+ return () => {
62
+ listeners.delete(cb);
63
+ mq?.removeEventListener("change", onOs);
64
+ };
65
+ };
66
+ const initTheme = () => {
67
+ if (typeof document === "undefined") return () => {};
68
+ const apply = () => {
69
+ document.documentElement.dataset.theme = getResolvedTheme();
70
+ };
71
+ apply();
72
+ return subscribeThemePref(apply);
73
+ };
74
+ return {
75
+ storageKey,
76
+ getThemePref,
77
+ setThemePref,
78
+ getResolvedTheme,
79
+ subscribeThemePref,
80
+ initTheme
81
+ };
82
+ }
83
+ /** The attributes {@link detectHostTheme} reads, in order. */
84
+ const THEME_ATTRIBUTES = [
85
+ "data-theme",
86
+ "data-mode",
87
+ "data-color-scheme"
88
+ ];
89
+ function explicitTheme(el) {
90
+ if (!el) return void 0;
91
+ if (el.classList.contains("dark")) return "dark";
92
+ if (el.classList.contains("light")) return "light";
93
+ for (const attr of THEME_ATTRIBUTES) {
94
+ const v = el.getAttribute(attr);
95
+ if (v === "dark" || v === "light") return v;
96
+ }
97
+ const cs = el.style?.colorScheme?.trim();
98
+ if (cs === "dark" || cs === "light") return cs;
99
+ }
100
+ /**
101
+ * The host page's theme, for `theme="inherit"`: an explicit signal on `<html>` (then `<body>`) — a
102
+ * `dark`/`light` class, a `data-theme`/`data-mode`/`data-color-scheme` attribute, or an inline
103
+ * `color-scheme` — and, only when the host sets none, the OS `prefers-color-scheme`.
104
+ *
105
+ * Pass `root`/`body` to read other elements (tests, iframes); they default to the document's.
106
+ */
107
+ function detectHostTheme(root = typeof document !== "undefined" ? document.documentElement : void 0, body = typeof document !== "undefined" ? document.body : void 0) {
108
+ return explicitTheme(root) ?? explicitTheme(body) ?? systemTheme();
109
+ }
110
+ /**
111
+ * Watch the host page for theme switches: class/attribute/style changes on `<html>` and `<body>`,
112
+ * plus the OS scheme. Returns the unsubscribe function. Without a DOM or `MutationObserver` (SSR,
113
+ * old test environments) it only follows the OS scheme.
114
+ */
115
+ function subscribeHostTheme(cb) {
116
+ const offOs = subscribeSystemTheme(cb);
117
+ if (typeof document === "undefined" || typeof MutationObserver === "undefined") return offOs;
118
+ const observer = new MutationObserver(cb);
119
+ const opts = {
120
+ attributes: true,
121
+ attributeFilter: [
122
+ "class",
123
+ "style",
124
+ ...THEME_ATTRIBUTES
125
+ ]
126
+ };
127
+ observer.observe(document.documentElement, opts);
128
+ if (document.body) observer.observe(document.body, opts);
129
+ return () => {
130
+ observer.disconnect();
131
+ offOs();
132
+ };
133
+ }
134
+ //#endregion
135
+ //#region src/ui/theme-context.tsx
136
+ /**
137
+ * React bindings for the theme store: {@link ThemeProvider} resolves a {@link ThemeMode} to one
138
+ * concrete theme with `useSyncExternalStore`, and {@link useTheme} hands it (plus whether the
139
+ * dashboard owns the toggle) to any component below, so the toggle never has to be prop-drilled.
140
+ *
141
+ * @module
142
+ */
143
+ const ThemeContext = react.createContext(null);
144
+ const serverLight = () => "light";
145
+ const noopSubscribe = () => () => {};
146
+ const hostTheme = () => detectHostTheme();
147
+ /** Resolve a {@link ThemeMode} against `store`, re-rendering on every relevant change. */
148
+ function useResolvedTheme(store, mode) {
149
+ const fromPref = useSyncStore(mode === "auto" ? store.subscribeThemePref : noopSubscribe, store.getResolvedTheme);
150
+ const fromHost = useSyncStore(mode === "inherit" ? subscribeHostTheme : noopSubscribe, hostTheme);
151
+ if (mode === "auto") return fromPref;
152
+ if (mode === "inherit") return fromHost;
153
+ return mode;
154
+ }
155
+ function useSyncStore(subscribe, read) {
156
+ return react.useSyncExternalStore(subscribe, read, serverLight);
157
+ }
158
+ /** Provide the resolved theme (and the store, for {@link ThemeToggle}) to the subtree. */
159
+ function ThemeProvider({ store, mode = "auto", children }) {
160
+ const resolved = useResolvedTheme(store, mode);
161
+ const value = react.useMemo(() => ({
162
+ resolved,
163
+ showToggle: mode === "auto",
164
+ store
165
+ }), [
166
+ resolved,
167
+ mode,
168
+ store
169
+ ]);
170
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
171
+ value,
172
+ children: children(resolved)
173
+ });
174
+ }
175
+ /**
176
+ * The active theme. Outside a {@link ThemeProvider} it follows the OS scheme and reports no toggle
177
+ * (there is no store to persist a choice in).
178
+ */
179
+ function useTheme() {
180
+ const ctx = react.useContext(ThemeContext);
181
+ const fromOs = react.useSyncExternalStore(ctx ? noopSubscribe : subscribeSystemTheme, systemTheme, serverLight);
182
+ return ctx ?? {
183
+ resolved: fromOs,
184
+ showToggle: false,
185
+ store: void 0
186
+ };
187
+ }
188
+ //#endregion
189
+ //#region src/ui/token.ts
190
+ /**
191
+ * Portal-token hand-off for the standalone SPA: a host links its customer to
192
+ * `https://app.example.com/panel/#token=…` (the fragment never reaches servers or access logs);
193
+ * `?token=` works too. The token is removed from the address bar so it isn't bookmarked, shared or
194
+ * sent in a `Referer` header.
195
+ *
196
+ * @module
197
+ */
198
+ /**
199
+ * Read a portal token from `#token=` (preferred) or `?token=`, and strip it from the URL through
200
+ * `replace` (e.g. `(url) => history.replaceState(null, "", url)`). Other query and hash parameters
201
+ * are kept. Returns the token, or `null` when the URL carries none (nothing is replaced then).
202
+ */
203
+ function takeTokenFromUrl(location, replace) {
204
+ const rawHash = location.hash.replace(/^#/, "");
205
+ const hash = rawHash.startsWith("/") ? void 0 : new URLSearchParams(rawHash);
206
+ const search = new URLSearchParams(location.search);
207
+ const token = hash?.get("token") || search.get("token");
208
+ if (!token) return null;
209
+ let s = location.search.replace(/^\?/, "");
210
+ if (search.has("token")) {
211
+ search.delete("token");
212
+ s = search.toString();
213
+ }
214
+ let h = rawHash;
215
+ if (hash?.has("token")) {
216
+ hash.delete("token");
217
+ h = hash.toString();
218
+ }
219
+ replace(`${location.pathname}${s ? `?${s}` : ""}${h ? `#${h}` : ""}`);
220
+ return token;
221
+ }
222
+ //#endregion
223
+ //#region src/ui/lib/utils.ts
224
+ /** Merge class names with Tailwind-aware de-duplication. */
225
+ function cn(...inputs) {
226
+ return (0, tailwind_merge.twMerge)((0, clsx.clsx)(inputs));
227
+ }
228
+ //#endregion
229
+ //#region src/ui/components/Toast.tsx
230
+ function reducer(state, action) {
231
+ switch (action.type) {
232
+ case "add": return { toasts: [...state.toasts, action.toast] };
233
+ case "remove": return { toasts: state.toasts.filter((t) => t.id !== action.id) };
234
+ default: return state;
235
+ }
236
+ }
237
+ const ToastContext = (0, react.createContext)(null);
238
+ /** `add(kind, message, detail?)` for the nearest {@link ToastProvider}; throws outside one. */
239
+ function useToast() {
240
+ const ctx = (0, react.useContext)(ToastContext);
241
+ if (!ctx) throw new Error("useToast must be used within ToastProvider");
242
+ return ctx;
243
+ }
244
+ const kindAccent = {
245
+ success: "bg-success",
246
+ error: "bg-destructive",
247
+ warning: "bg-warning",
248
+ info: "bg-accent"
249
+ };
250
+ const kindBorder = {
251
+ success: "border-l-[var(--success)]",
252
+ error: "border-l-[var(--destructive)]",
253
+ warning: "border-l-[var(--warning)]",
254
+ info: "border-l-[var(--accent)]"
255
+ };
256
+ function ToastItem({ toast, onRemove }) {
257
+ (0, react.useEffect)(() => {
258
+ const t = setTimeout(() => onRemove(toast.id), 4500);
259
+ return () => clearTimeout(t);
260
+ }, [toast.id, onRemove]);
261
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
262
+ role: "alert",
263
+ className: cn("flex min-w-[280px] max-w-sm items-start gap-2.5 rounded-lg border border-border bg-card px-3.5 py-3 shadow-lg", "border-l-[3px]", kindBorder[toast.kind]),
264
+ style: { animation: "toastIn 160ms ease-out" },
265
+ children: [
266
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
267
+ className: cn("mt-1 size-2 shrink-0 rounded-full", kindAccent[toast.kind]),
268
+ "aria-hidden": true
269
+ }),
270
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
271
+ className: "flex-1 min-w-0",
272
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
273
+ className: "m-0 text-[13px] font-medium text-foreground leading-snug",
274
+ children: toast.message
275
+ }), toast.detail && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
276
+ className: "mt-1 text-xs text-muted-foreground leading-snug",
277
+ children: toast.detail
278
+ })]
279
+ }),
280
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
281
+ "aria-label": "Dismiss",
282
+ onClick: () => onRemove(toast.id),
283
+ className: "shrink-0 rounded-sm text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring outline-none",
284
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "size-3.5" })
285
+ }),
286
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: `
287
+ @keyframes toastIn {
288
+ from { opacity: 0; transform: translateY(8px); }
289
+ to { opacity: 1; transform: translateY(0); }
290
+ }
291
+ ` })
292
+ ]
293
+ });
294
+ }
295
+ /** Hosts the toast stack (inside the embed wrapper, so it gets the scoped styles and theme). */
296
+ function ToastProvider({ children }) {
297
+ const [state, dispatch] = (0, react.useReducer)(reducer, { toasts: [] });
298
+ const add = (0, react.useCallback)((kind, message, detail) => {
299
+ dispatch({
300
+ type: "add",
301
+ toast: {
302
+ id: `${Date.now()}-${Math.random()}`,
303
+ kind,
304
+ message,
305
+ detail
306
+ }
307
+ });
308
+ }, []);
309
+ const remove = (0, react.useCallback)((id) => {
310
+ dispatch({
311
+ type: "remove",
312
+ id
313
+ });
314
+ }, []);
315
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToastContext.Provider, {
316
+ value: { add },
317
+ children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
318
+ "aria-live": "polite",
319
+ "aria-atomic": "false",
320
+ className: "fixed bottom-6 right-6 z-[9999] flex flex-col gap-2",
321
+ children: state.toasts.map((t) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastItem, {
322
+ toast: t,
323
+ onRemove: remove
324
+ }, t.id))
325
+ })]
326
+ });
327
+ }
328
+ //#endregion
329
+ //#region src/ui/components/ThemeToggle.tsx
330
+ const OPTIONS = [
331
+ {
332
+ value: "system",
333
+ label: "System theme",
334
+ Icon: lucide_react.Monitor
335
+ },
336
+ {
337
+ value: "light",
338
+ label: "Light theme",
339
+ Icon: lucide_react.Sun
340
+ },
341
+ {
342
+ value: "dark",
343
+ label: "Dark theme",
344
+ Icon: lucide_react.Moon
345
+ }
346
+ ];
347
+ /**
348
+ * The system/light/dark switcher. It persists the choice in the product's theme store (the `store`
349
+ * prop, else the enclosing `ThemeProvider`'s).
350
+ */
351
+ function ThemeToggle({ store: storeProp } = {}) {
352
+ const ctx = useTheme();
353
+ const store = storeProp ?? ctx.store;
354
+ if (!store) throw new Error("ThemeToggle needs a `store` prop or an enclosing <ThemeProvider>.");
355
+ const [pref, setPref] = (0, react.useState)(() => store.getThemePref());
356
+ const choose = (value) => {
357
+ setPref(value);
358
+ store.setThemePref(value);
359
+ };
360
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
361
+ role: "group",
362
+ "aria-label": "Theme",
363
+ className: "inline-flex gap-0.5 rounded-md border border-border bg-secondary/50 p-0.5",
364
+ children: OPTIONS.map(({ value, label, Icon }) => {
365
+ const active = pref === value;
366
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
367
+ type: "button",
368
+ title: label,
369
+ "aria-label": label,
370
+ "aria-pressed": active,
371
+ onClick: () => choose(value),
372
+ className: cn("inline-flex h-6 w-7 items-center justify-center rounded-[5px] outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-ring", active ? "bg-card text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"),
373
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { className: "size-3.5" })
374
+ }, value);
375
+ })
376
+ });
377
+ }
378
+ //#endregion
379
+ //#region src/ui/lib/nav-guard.ts
380
+ let active = null;
381
+ /** Register the current blocker (replaces any previous one). */
382
+ function setNavBlocker(blocker) {
383
+ active = blocker;
384
+ }
385
+ /** Clear `blocker` if it is still the active one (safe from stale cleanups). */
386
+ function clearNavBlocker(blocker) {
387
+ if (active === blocker) active = null;
388
+ }
389
+ /** Consult the active blocker. `true` when navigation may proceed. */
390
+ function canLeave() {
391
+ return active ? active() : true;
392
+ }
393
+ //#endregion
394
+ //#region src/ui/shell.tsx
395
+ /**
396
+ * The admin shell shared by every product: {@link useShellConfig} (the `/config` query, portal and
397
+ * readonly state), {@link useShellNav} (nav-guarded in-app navigation that keeps sticky query
398
+ * params) and {@link ShellFrame} (header, brand, badges, theme toggle, tabs, a switcher slot and the
399
+ * routed content). Views, tabs and switchers stay in the product.
400
+ *
401
+ * @module
402
+ */
403
+ /**
404
+ * Read the bootstrap config the panel handler injects as `window[configGlobal]`
405
+ * (`"__WEBHOOKS_CONFIG__"`…). `{}` when it is missing (dev server, embed, SSR).
406
+ */
407
+ function readConfigGlobal(configGlobal) {
408
+ if (typeof window === "undefined") return {};
409
+ const value = window[configGlobal];
410
+ return value && typeof value === "object" ? value : {};
411
+ }
412
+ const defaultIsPortal = (c) => c.portal === true || c.mode === "portal";
413
+ /**
414
+ * The `/config` query plus the shell's derived state, with both portal-race fixes: admin work waits
415
+ * for `/config` (`ready`/`adminReady`), and a token means portal from the first render.
416
+ */
417
+ function useShellConfig(options) {
418
+ const bootstrap = options.bootstrap ?? {};
419
+ const query = (0, _tanstack_react_query.useQuery)({
420
+ queryKey: options.queryKey ?? ["config"],
421
+ queryFn: options.getConfig,
422
+ staleTime: options.staleTime ?? 6e4
423
+ });
424
+ const config = query.data ?? bootstrap;
425
+ const isPortal = options.isPortal ?? defaultIsPortal;
426
+ const portal = Boolean(options.forcePortal) || Boolean(options.token) || isPortal(config);
427
+ const ready = query.isSuccess;
428
+ const hasBootstrap = Boolean(bootstrap.title);
429
+ return {
430
+ config,
431
+ ready,
432
+ loading: query.isLoading && !hasBootstrap && !options.forcePortal,
433
+ failed: query.isError && !hasBootstrap,
434
+ portal,
435
+ readonly: config.readonly ?? false,
436
+ adminReady: ready && !portal,
437
+ query
438
+ };
439
+ }
440
+ /**
441
+ * In-app navigation for the shell: `go(path, params?)` consults the nav guard (a view with unsaved
442
+ * edits can veto the move), carries the sticky params over, then applies `params` (`""` removes
443
+ * one).
444
+ */
445
+ function useShellNav(options = {}) {
446
+ const [, navigate] = (0, wouter.useLocation)();
447
+ const [searchParams] = (0, wouter.useSearchParams)();
448
+ const sticky = options.stickyParams ?? [];
449
+ return (path, params = {}) => {
450
+ if (!canLeave()) return;
451
+ const next = new URLSearchParams();
452
+ for (const key of sticky) {
453
+ const value = searchParams.get(key);
454
+ if (value) next.set(key, value);
455
+ }
456
+ for (const [key, value] of Object.entries(params)) if (value) next.set(key, value);
457
+ else next.delete(key);
458
+ const search = next.toString();
459
+ navigate(search ? `${path}?${search}` : path);
460
+ };
461
+ }
462
+ const defaultMatch = (path) => (location) => path === "/" ? location === "/" : location === path || location.startsWith(`${path}/`);
463
+ /** The shared admin chrome: sticky header (brand, switcher, badges, toggle), tabs and content. */
464
+ function ShellFrame({ title, logoUrl, brandMark, onBrandClick, switcher, readonly, portal, portalLabel = "Portal", headerExtra, showThemeToggle, tabs = [], onNavigate, fallback, children, className }) {
465
+ const [location] = (0, wouter.useLocation)();
466
+ const theme = useTheme();
467
+ const toggle = showThemeToggle ?? theme.showToggle;
468
+ if (fallback !== void 0 && fallback !== null && fallback !== false) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
469
+ className: "flex h-screen items-center justify-center bg-background px-4 text-center",
470
+ children: fallback
471
+ });
472
+ const brand = logoUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
473
+ src: logoUrl,
474
+ alt: title,
475
+ className: "h-7 max-w-[320px] object-contain"
476
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [brandMark, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
477
+ className: "text-sm font-semibold tracking-tight",
478
+ children: title
479
+ })] });
480
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
481
+ className: cn("flex h-screen flex-col overflow-hidden bg-background text-foreground", className),
482
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
483
+ className: "sticky top-0 z-40 border-b border-border bg-background/80 backdrop-blur",
484
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
485
+ className: "mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 sm:px-6",
486
+ children: [
487
+ onBrandClick ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
488
+ href: "#",
489
+ "data-testid": "shell-brand",
490
+ onClick: (e) => {
491
+ e.preventDefault();
492
+ onBrandClick();
493
+ },
494
+ className: "flex shrink-0 items-center gap-2 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring",
495
+ children: brand
496
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
497
+ "data-testid": "shell-brand",
498
+ className: "flex shrink-0 items-center gap-2",
499
+ children: brand
500
+ }),
501
+ switcher ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
502
+ className: "select-none text-border",
503
+ children: "/"
504
+ }), switcher] }) : null,
505
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
506
+ className: "ml-auto flex items-center gap-2",
507
+ children: [
508
+ headerExtra,
509
+ readonly && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
510
+ className: "flex items-center gap-1 rounded-md border border-warning/30 bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",
511
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Lock, { className: "size-3" }), "Read-only"]
512
+ }),
513
+ portal && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
514
+ className: "rounded-md border border-accent/30 bg-accent/10 px-2 py-0.5 text-xs font-medium text-accent",
515
+ children: portalLabel
516
+ }),
517
+ toggle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeToggle, {})
518
+ ]
519
+ })
520
+ ]
521
+ }), tabs.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
522
+ className: "mx-auto flex max-w-6xl items-center gap-1 overflow-x-auto px-2 sm:px-4",
523
+ "aria-label": "Main navigation",
524
+ children: tabs.map(({ path, label, match }) => {
525
+ const active = (match ?? defaultMatch(path))(location);
526
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
527
+ type: "button",
528
+ onClick: () => onNavigate?.(path),
529
+ "aria-current": active ? "page" : void 0,
530
+ className: cn("whitespace-nowrap px-3 py-2.5 text-[13px] font-medium outline-none transition-colors focus-visible:text-foreground", active ? "relative text-foreground after:absolute after:inset-x-3 after:-bottom-px after:h-0.5 after:rounded-full after:bg-accent" : "text-muted-foreground hover:text-foreground"),
531
+ children: label
532
+ }, path);
533
+ })
534
+ })]
535
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("main", {
536
+ className: "flex-1 overflow-y-auto overflow-x-hidden",
537
+ children
538
+ })]
539
+ });
540
+ }
541
+ /** The default message for a `/config` failure (pass it as {@link ShellFrameProps.fallback}). */
542
+ function ConfigError() {
543
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
544
+ className: "text-[13px] text-muted-foreground",
545
+ children: "Could not load the panel configuration. Check that the API is reachable and that you are signed in."
546
+ });
547
+ }
548
+ //#endregion
549
+ //#region src/ui/boot.tsx
550
+ /**
551
+ * The standalone SPA bootstrap (`src/ui/main.tsx` in every product): apply the theme before first
552
+ * paint, take a portal token from the URL, create the QueryClient, read the base path from the
553
+ * config global, and render the product's `App` with browser-history routing.
554
+ *
555
+ * @module
556
+ */
557
+ /** A `QueryClient` with the shell's defaults: one retry, no refetch on window focus. */
558
+ function createShellQueryClient() {
559
+ return new _tanstack_react_query.QueryClient({ defaultOptions: { queries: {
560
+ retry: 1,
561
+ refetchOnWindowFocus: false
562
+ } } });
563
+ }
564
+ /** Boot the standalone admin SPA. Call once from the product's `main.tsx`. */
565
+ function bootSpa(options) {
566
+ const themeStore = typeof options.themeKey === "string" ? createThemeStore(options.themeKey) : options.themeKey;
567
+ themeStore.initTheme();
568
+ let token = null;
569
+ if (options.tokenFromUrl) {
570
+ if (!options.api) throw new Error("bootSpa: `tokenFromUrl` needs the product's `api` client.");
571
+ token = takeTokenFromUrl(window.location, (url) => window.history.replaceState(null, "", url));
572
+ if (token) options.api.setApiToken(token);
573
+ }
574
+ const queryClient = options.queryClient ?? createShellQueryClient();
575
+ const el = typeof options.root === "object" ? options.root : document.getElementById(options.root ?? "root");
576
+ if (!el) throw new Error("Root element not found");
577
+ const basePath = (readConfigGlobal(options.configGlobal).basePath ?? "").replace(/\/$/, "");
578
+ const { App } = options;
579
+ const appProps = options.appProps ?? {};
580
+ const tree = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tanstack_react_query.QueryClientProvider, {
581
+ client: queryClient,
582
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeProvider, {
583
+ store: themeStore,
584
+ mode: "auto",
585
+ children: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToastProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(App, {
586
+ ...appProps,
587
+ locationHook: wouter_use_browser_location.useBrowserLocation,
588
+ base: basePath
589
+ }) })
590
+ })
591
+ });
592
+ const root = (0, react_dom_client.createRoot)(el);
593
+ root.render(options.strictMode === false ? tree : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.StrictMode, { children: tree }));
594
+ return {
595
+ root,
596
+ queryClient,
597
+ themeStore,
598
+ token
599
+ };
600
+ }
601
+ //#endregion
602
+ //#region src/ui/lib/portal-container.ts
603
+ let sharedRef;
604
+ /** Point portals at `ref` (the embed wrapper). Pass `undefined` to reset to the body default. */
605
+ function setPortalContainerRef(ref) {
606
+ sharedRef = ref;
607
+ }
608
+ /**
609
+ * The current portal container ref, or `undefined` when none is set (Base UI
610
+ * then defaults to `document.body`). Pass the result to a Base UI
611
+ * `*.Portal container={…}` prop.
612
+ */
613
+ function portalContainerRef() {
614
+ return sharedRef;
615
+ }
616
+ //#endregion
617
+ Object.defineProperty(exports, "ConfigError", {
618
+ enumerable: true,
619
+ get: function() {
620
+ return ConfigError;
621
+ }
622
+ });
623
+ Object.defineProperty(exports, "ShellFrame", {
624
+ enumerable: true,
625
+ get: function() {
626
+ return ShellFrame;
627
+ }
628
+ });
629
+ Object.defineProperty(exports, "ThemeProvider", {
630
+ enumerable: true,
631
+ get: function() {
632
+ return ThemeProvider;
633
+ }
634
+ });
635
+ Object.defineProperty(exports, "ThemeToggle", {
636
+ enumerable: true,
637
+ get: function() {
638
+ return ThemeToggle;
639
+ }
640
+ });
641
+ Object.defineProperty(exports, "ToastProvider", {
642
+ enumerable: true,
643
+ get: function() {
644
+ return ToastProvider;
645
+ }
646
+ });
647
+ Object.defineProperty(exports, "bootSpa", {
648
+ enumerable: true,
649
+ get: function() {
650
+ return bootSpa;
651
+ }
652
+ });
653
+ Object.defineProperty(exports, "canLeave", {
654
+ enumerable: true,
655
+ get: function() {
656
+ return canLeave;
657
+ }
658
+ });
659
+ Object.defineProperty(exports, "clearNavBlocker", {
660
+ enumerable: true,
661
+ get: function() {
662
+ return clearNavBlocker;
663
+ }
664
+ });
665
+ Object.defineProperty(exports, "cn", {
666
+ enumerable: true,
667
+ get: function() {
668
+ return cn;
669
+ }
670
+ });
671
+ Object.defineProperty(exports, "createShellQueryClient", {
672
+ enumerable: true,
673
+ get: function() {
674
+ return createShellQueryClient;
675
+ }
676
+ });
677
+ Object.defineProperty(exports, "createThemeStore", {
678
+ enumerable: true,
679
+ get: function() {
680
+ return createThemeStore;
681
+ }
682
+ });
683
+ Object.defineProperty(exports, "detectHostTheme", {
684
+ enumerable: true,
685
+ get: function() {
686
+ return detectHostTheme;
687
+ }
688
+ });
689
+ Object.defineProperty(exports, "portalContainerRef", {
690
+ enumerable: true,
691
+ get: function() {
692
+ return portalContainerRef;
693
+ }
694
+ });
695
+ Object.defineProperty(exports, "readConfigGlobal", {
696
+ enumerable: true,
697
+ get: function() {
698
+ return readConfigGlobal;
699
+ }
700
+ });
701
+ Object.defineProperty(exports, "resolveTheme", {
702
+ enumerable: true,
703
+ get: function() {
704
+ return resolveTheme;
705
+ }
706
+ });
707
+ Object.defineProperty(exports, "setNavBlocker", {
708
+ enumerable: true,
709
+ get: function() {
710
+ return setNavBlocker;
711
+ }
712
+ });
713
+ Object.defineProperty(exports, "setPortalContainerRef", {
714
+ enumerable: true,
715
+ get: function() {
716
+ return setPortalContainerRef;
717
+ }
718
+ });
719
+ Object.defineProperty(exports, "subscribeHostTheme", {
720
+ enumerable: true,
721
+ get: function() {
722
+ return subscribeHostTheme;
723
+ }
724
+ });
725
+ Object.defineProperty(exports, "subscribeSystemTheme", {
726
+ enumerable: true,
727
+ get: function() {
728
+ return subscribeSystemTheme;
729
+ }
730
+ });
731
+ Object.defineProperty(exports, "systemTheme", {
732
+ enumerable: true,
733
+ get: function() {
734
+ return systemTheme;
735
+ }
736
+ });
737
+ Object.defineProperty(exports, "takeTokenFromUrl", {
738
+ enumerable: true,
739
+ get: function() {
740
+ return takeTokenFromUrl;
741
+ }
742
+ });
743
+ Object.defineProperty(exports, "useResolvedTheme", {
744
+ enumerable: true,
745
+ get: function() {
746
+ return useResolvedTheme;
747
+ }
748
+ });
749
+ Object.defineProperty(exports, "useShellConfig", {
750
+ enumerable: true,
751
+ get: function() {
752
+ return useShellConfig;
753
+ }
754
+ });
755
+ Object.defineProperty(exports, "useShellNav", {
756
+ enumerable: true,
757
+ get: function() {
758
+ return useShellNav;
759
+ }
760
+ });
761
+ Object.defineProperty(exports, "useTheme", {
762
+ enumerable: true,
763
+ get: function() {
764
+ return useTheme;
765
+ }
766
+ });
767
+ Object.defineProperty(exports, "useToast", {
768
+ enumerable: true,
769
+ get: function() {
770
+ return useToast;
771
+ }
772
+ });
773
+
774
+ //# sourceMappingURL=portal-container-Ca1NxrLE.cjs.map