@objectstack/console 5.1.0 → 7.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 (374) hide show
  1. package/LICENSE.apache +202 -0
  2. package/README.md +33 -50
  3. package/dist/assets/AiPendingActionsPage-DfPQB-bV.js +1 -0
  4. package/dist/assets/ApiConsolePage-CVt86JW9.js +1 -0
  5. package/dist/assets/AppManagementPage-DuIaI8a2.js +1 -0
  6. package/dist/assets/ApprovalsInboxPage-BRv2RqN4.js +1 -0
  7. package/dist/assets/AuditLogPage-CDXmY4Lg.js +1 -0
  8. package/dist/assets/ComponentNavView-B2VAx_8W.js +1 -0
  9. package/dist/assets/ConsoleFloatingChatbot-c1A9X4w7.js +1 -0
  10. package/dist/assets/DeveloperHubPage-E4ydudW4.js +1 -0
  11. package/dist/assets/FlowRunsPage-CF-nkx9E.js +1 -0
  12. package/dist/assets/MonacoImpl-CKoKq1tG.js +11 -0
  13. package/dist/assets/ProfilePage-4wnWye8l.js +1 -0
  14. package/dist/assets/PublicFormsPage-B1cdfwoQ.js +1 -0
  15. package/dist/assets/SettingsHub-B4d9Pn8t.js +1 -0
  16. package/dist/assets/SettingsView-cRQBVn6H.js +1 -0
  17. package/dist/assets/SystemHubPage-DIKmhwy1.js +1 -0
  18. package/dist/assets/abap-CLvhMVsD.js +1 -0
  19. package/dist/assets/actionscript-3--17pq3dv.js +1 -0
  20. package/dist/assets/ada-C5qYipkI.js +1 -0
  21. package/dist/assets/andromeeda-vGVdxbeo.js +1 -0
  22. package/dist/assets/angular-html-B9s24XBK.js +1 -0
  23. package/dist/assets/angular-ts-C7DCn4N7.js +1 -0
  24. package/dist/assets/apache-U0d_L8uA.js +1 -0
  25. package/dist/assets/apex-VAyPSnFM.js +1 -0
  26. package/dist/assets/apl-BFSpAsVe.js +1 -0
  27. package/dist/assets/applescript-CCn79oCD.js +1 -0
  28. package/dist/assets/ara-4CJ0cIlV.js +1 -0
  29. package/dist/assets/asciidoc-DE70LPWp.js +1 -0
  30. package/dist/assets/asm-Cmm7eHzH.js +1 -0
  31. package/dist/assets/astro-By5nmri_.js +1 -0
  32. package/dist/assets/aurora-x-CDeNXAV0.js +1 -0
  33. package/dist/assets/awk-BWXHIvNe.js +1 -0
  34. package/dist/assets/ayu-dark-DluEY0Gj.js +1 -0
  35. package/dist/assets/ayu-light-C3h-C4tm.js +1 -0
  36. package/dist/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  37. package/dist/assets/ballerina-B7ZEbQpA.js +1 -0
  38. package/dist/assets/bat-Bo4NYOV-.js +1 -0
  39. package/dist/assets/beancount-D-usSTwE.js +1 -0
  40. package/dist/assets/berry-DKpUyyne.js +1 -0
  41. package/dist/assets/bibtex-Ci_nEsc7.js +1 -0
  42. package/dist/assets/bicep-CUHmPFLl.js +1 -0
  43. package/dist/assets/bird2-C6vDhewU.js +1 -0
  44. package/dist/assets/blade-BEsyb4Es.js +1 -0
  45. package/dist/assets/bsl-BkkzgIyY.js +1 -0
  46. package/dist/assets/c-CwKsiqWD.js +1 -0
  47. package/dist/assets/c3-BFHwR3_K.js +1 -0
  48. package/dist/assets/cadence-CQ2zXKGN.js +1 -0
  49. package/dist/assets/cairo-DLTphjLi.js +1 -0
  50. package/dist/assets/catppuccin-frappe-3VR1Za6u.js +1 -0
  51. package/dist/assets/catppuccin-latte-DwIHMF0Q.js +1 -0
  52. package/dist/assets/catppuccin-macchiato-DYnBP6_5.js +1 -0
  53. package/dist/assets/catppuccin-mocha-DYhrFGRu.js +1 -0
  54. package/dist/assets/clarity-SemFz856.js +1 -0
  55. package/dist/assets/clojure-DqKBuwfJ.js +1 -0
  56. package/dist/assets/cmake-Bj61d0ZC.js +1 -0
  57. package/dist/assets/cobol-AtgRrYrD.js +1 -0
  58. package/dist/assets/codeowners-C8r90Shi.js +1 -0
  59. package/dist/assets/codeql-oeQT6MSM.js +1 -0
  60. package/dist/assets/coffee-Dx9BrBX9.js +1 -0
  61. package/dist/assets/common-lisp-Cv5bFMCO.js +1 -0
  62. package/dist/assets/coq-BrsZFFmf.js +1 -0
  63. package/dist/assets/cpp-DNQ-Fj9i.js +1 -0
  64. package/dist/assets/crystal-BFAqiLnY.js +1 -0
  65. package/dist/assets/csharp-oqKa8noW.js +1 -0
  66. package/dist/assets/css-76WQuunA.js +1 -0
  67. package/dist/assets/csv-Dx-8-gkx.js +1 -0
  68. package/dist/assets/cue-CE9AQfxI.js +1 -0
  69. package/dist/assets/cypher-ClKdZ_lG.js +1 -0
  70. package/dist/assets/d-qD-0Kul2.js +1 -0
  71. package/dist/assets/dark-plus-Cs2F2srj.js +1 -0
  72. package/dist/assets/dart-CnvKMtbv.js +1 -0
  73. package/dist/assets/data-adapter-Be-s1kWX.js +1 -0
  74. package/dist/assets/dax-BkyTk9wS.js +1 -0
  75. package/dist/assets/desktop-Dlh5hvp9.js +1 -0
  76. package/dist/assets/diff-woXpYk--.js +1 -0
  77. package/dist/assets/docker-IyjqRm3v.js +1 -0
  78. package/dist/assets/dotenv-_5a1GRtc.js +1 -0
  79. package/dist/assets/dracula-BHWKrbxM.js +1 -0
  80. package/dist/assets/dracula-soft-5eyTD99u.js +1 -0
  81. package/dist/assets/dream-maker-DW3nJb8Q.js +1 -0
  82. package/dist/assets/edge-BEfBxc5h.js +1 -0
  83. package/dist/assets/elixir-Bi1LyDCo.js +1 -0
  84. package/dist/assets/elm-BMPZeG5i.js +1 -0
  85. package/dist/assets/emacs-lisp-B4R74twV.js +1 -0
  86. package/dist/assets/erb-Pmcx6TTx.js +1 -0
  87. package/dist/assets/erlang-Cphh6RMH.js +1 -0
  88. package/dist/assets/everforest-dark-sB-x3p7T.js +1 -0
  89. package/dist/assets/everforest-light-Df2xbC6M.js +1 -0
  90. package/dist/assets/fennel-DQxkIbk2.js +1 -0
  91. package/dist/assets/fish-BJitypiv.js +1 -0
  92. package/dist/assets/fluent-C03EYrpw.js +1 -0
  93. package/dist/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
  94. package/dist/assets/fortran-free-form-CYNrtFtB.js +1 -0
  95. package/dist/assets/framework-ClI3DbWX.js +34 -0
  96. package/dist/assets/fsharp-D13ZGOAj.js +1 -0
  97. package/dist/assets/gdresource-C0sCabJj.js +1 -0
  98. package/dist/assets/gdscript-Cp2uCuqX.js +1 -0
  99. package/dist/assets/gdshader-CBce3t8t.js +1 -0
  100. package/dist/assets/genie-CV2tkWYe.js +1 -0
  101. package/dist/assets/gherkin-DExj1W_8.js +1 -0
  102. package/dist/assets/git-commit-BSykSTBG.js +1 -0
  103. package/dist/assets/git-rebase-Dj7t0bix.js +1 -0
  104. package/dist/assets/github-dark-C-LZuMrd.js +1 -0
  105. package/dist/assets/github-dark-default-DXG-b-1a.js +1 -0
  106. package/dist/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  107. package/dist/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  108. package/dist/assets/github-light-EUqPIrTm.js +1 -0
  109. package/dist/assets/github-light-default-BXViO-2h.js +1 -0
  110. package/dist/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  111. package/dist/assets/gleam-CSRkHgEL.js +1 -0
  112. package/dist/assets/glimmer-js-DTpMHWUo.js +1 -0
  113. package/dist/assets/glimmer-ts-BKOVQU61.js +1 -0
  114. package/dist/assets/glsl-DDNdYp2B.js +1 -0
  115. package/dist/assets/gn-ilITqXS6.js +1 -0
  116. package/dist/assets/gnuplot-7GGW24-e.js +1 -0
  117. package/dist/assets/go-rLFTqkRN.js +1 -0
  118. package/dist/assets/graphql-C-akFyqE.js +1 -0
  119. package/dist/assets/groovy-CacY0gHj.js +1 -0
  120. package/dist/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  121. package/dist/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  122. package/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  123. package/dist/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  124. package/dist/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  125. package/dist/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  126. package/dist/assets/hack-Z382E4IB.js +1 -0
  127. package/dist/assets/haml-DCWQJgln.js +1 -0
  128. package/dist/assets/handlebars-D_RRtkV5.js +1 -0
  129. package/dist/assets/haskell-D8IpX4py.js +1 -0
  130. package/dist/assets/haxe-OTjmBuCE.js +1 -0
  131. package/dist/assets/hcl-Dh228itO.js +1 -0
  132. package/dist/assets/highlighted-body-OFNGDK62-Dynkkk0t.js +1 -0
  133. package/dist/assets/hjson-CxZEssPk.js +1 -0
  134. package/dist/assets/hlsl-Cvrh5tZx.js +1 -0
  135. package/dist/assets/horizon-CE9ld1lL.js +1 -0
  136. package/dist/assets/horizon-bright-DSNQnXHK.js +1 -0
  137. package/dist/assets/houston-CsvMBhTu.js +1 -0
  138. package/dist/assets/html-BqDo3pKb.js +1 -0
  139. package/dist/assets/html-derivative-DncxUXSH.js +1 -0
  140. package/dist/assets/http-CrTHj6_t.js +1 -0
  141. package/dist/assets/hurl-BdeVL_ga.js +1 -0
  142. package/dist/assets/hxml-B0Qn7Nwc.js +1 -0
  143. package/dist/assets/hy-CZbG8q4J.js +1 -0
  144. package/dist/assets/imba-DsUTQ-LC.js +1 -0
  145. package/dist/assets/index-D7iz-IIn.js +24 -0
  146. package/dist/assets/index-Db8Nmh4R.css +2 -0
  147. package/dist/assets/infrastructure-ezj3FgNE.js +3 -0
  148. package/dist/assets/ini-B5eOa1yu.js +1 -0
  149. package/dist/assets/java-DKFHmTAg.js +1 -0
  150. package/dist/assets/javascript-Jx16aUBb.js +1 -0
  151. package/dist/assets/jinja-CQEVrK23.js +1 -0
  152. package/dist/assets/jison-BJRgvE0A.js +1 -0
  153. package/dist/assets/json-DlFP2GYa.js +1 -0
  154. package/dist/assets/json5-BR5RXkoi.js +1 -0
  155. package/dist/assets/jsonc-CYpm1nAK.js +1 -0
  156. package/dist/assets/jsonl-CmCQp5Yx.js +1 -0
  157. package/dist/assets/jsonnet-CJTPZ8u_.js +1 -0
  158. package/dist/assets/jssm-DXw9l8Rf.js +1 -0
  159. package/dist/assets/jsx-CIwpwN-u.js +1 -0
  160. package/dist/assets/julia-D4zLZb0D.js +1 -0
  161. package/dist/assets/just-BbmgE3ZP.js +1 -0
  162. package/dist/assets/kanagawa-dragon-CXtmUGW6.js +1 -0
  163. package/dist/assets/kanagawa-lotus-BN08jTvb.js +1 -0
  164. package/dist/assets/kanagawa-wave-CTweb8Dz.js +1 -0
  165. package/dist/assets/kdl-CsD5j6eV.js +1 -0
  166. package/dist/assets/kotlin-DhhofPvG.js +1 -0
  167. package/dist/assets/kusto-C7mF5XQf.js +1 -0
  168. package/dist/assets/laserwave-C_8bwKvT.js +1 -0
  169. package/dist/assets/latex-BUDs7Dcl.js +1 -0
  170. package/dist/assets/lean-CewbzKMR.js +1 -0
  171. package/dist/assets/less-DVTAwKKz.js +1 -0
  172. package/dist/assets/light-plus-DVQuIRkW.js +1 -0
  173. package/dist/assets/liquid-Bc0s0G9S.js +1 -0
  174. package/dist/assets/llvm-Cm23YOpf.js +1 -0
  175. package/dist/assets/log-BNLmms1o.js +1 -0
  176. package/dist/assets/logo-Cluzi2Zq.js +1 -0
  177. package/dist/assets/lua-dQaszIi_.js +1 -0
  178. package/dist/assets/luau-FMPmPwt6.js +1 -0
  179. package/dist/assets/make-Dixweg8N.js +1 -0
  180. package/dist/assets/{maplibre-gl-fFz1l9Ly.js → maplibre-gl-CoREonuK.js} +1 -1
  181. package/dist/assets/markdown-BYOwaDjH.js +1 -0
  182. package/dist/assets/marko-B5Uea28G.js +1 -0
  183. package/dist/assets/material-theme-Bm3Qr25_.js +1 -0
  184. package/dist/assets/material-theme-darker-2IIEA8gg.js +1 -0
  185. package/dist/assets/material-theme-lighter-uhdI0v04.js +1 -0
  186. package/dist/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  187. package/dist/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  188. package/dist/assets/matlab-D7qyCx1q.js +1 -0
  189. package/dist/assets/mdc-CwQcy7BI.js +1 -0
  190. package/dist/assets/mdx-DQZ5AkYe.js +1 -0
  191. package/dist/assets/mermaid-Bk4SNUv9.js +1 -0
  192. package/dist/assets/mermaid-GHXKKRXX-DJsGdxYj.js +1 -0
  193. package/dist/assets/min-dark-BSWPekZh.js +1 -0
  194. package/dist/assets/min-light-DDpmG2fV.js +1 -0
  195. package/dist/assets/mipsasm-BMqwQI7S.js +1 -0
  196. package/dist/assets/mojo-BgCJLMeH.js +1 -0
  197. package/dist/assets/monokai-CdkpiU2Y.js +1 -0
  198. package/dist/assets/moonbit-CaWjb8XO.js +1 -0
  199. package/dist/assets/move-B1IS1UjX.js +1 -0
  200. package/dist/assets/narrat-_X_XdTYD.js +1 -0
  201. package/dist/assets/nextflow-BJtWHP5T.js +1 -0
  202. package/dist/assets/nextflow-groovy-DJMQeKeT.js +1 -0
  203. package/dist/assets/nginx-SzmDaWuK.js +1 -0
  204. package/dist/assets/night-owl-DhmEMT88.js +1 -0
  205. package/dist/assets/night-owl-light-eJ-hLW7d.js +1 -0
  206. package/dist/assets/nim-CO_A6I25.js +1 -0
  207. package/dist/assets/nix-IvuFDN5E.js +1 -0
  208. package/dist/assets/nord-Cb4Vim4T.js +1 -0
  209. package/dist/assets/nushell-DcLAeLz5.js +1 -0
  210. package/dist/assets/objective-c-D1A_Heim.js +1 -0
  211. package/dist/assets/objective-cpp-BsSzOQcm.js +1 -0
  212. package/dist/assets/ocaml-O90oeIOV.js +1 -0
  213. package/dist/assets/odin-B1RWQWA5.js +1 -0
  214. package/dist/assets/one-dark-pro-CLwyXe_n.js +1 -0
  215. package/dist/assets/one-light-D7Lr4KcI.js +1 -0
  216. package/dist/assets/openscad-BUDT5pXO.js +1 -0
  217. package/dist/assets/pascal-4ZHwLPI5.js +1 -0
  218. package/dist/assets/perl-DXgLsVg8.js +1 -0
  219. package/dist/assets/php-C4KCWpl8.js +1 -0
  220. package/dist/assets/pkl-ot-7Btpt.js +1 -0
  221. package/dist/assets/plastic-DQwYfKfQ.js +1 -0
  222. package/dist/assets/plsql-DGHpHOYJ.js +1 -0
  223. package/dist/assets/plugin-calendar-wl24Whh9.js +1 -0
  224. package/dist/assets/plugin-charts-Mt2y8Sdm.js +7 -0
  225. package/dist/assets/plugin-chatbot-DXGXTdLU.js +120 -0
  226. package/dist/assets/plugin-dashboard-DqF5vvlQ.js +3 -0
  227. package/dist/assets/plugin-form-BBc-xwrZ.js +1 -0
  228. package/dist/assets/plugin-gantt-scBgVq2Q.js +1 -0
  229. package/dist/assets/plugin-grid-u5JmW5Ui.js +6 -0
  230. package/dist/assets/plugin-kanban-0qj1Kr3T.js +1 -0
  231. package/dist/assets/plugin-map-CjA33cHV.js +1 -0
  232. package/dist/assets/plugin-map-CsMXqW6n.css +1 -0
  233. package/dist/assets/plugin-markdown-BPsaoDf-.js +7 -0
  234. package/dist/assets/plugin-report-C35V4A8F.js +59 -0
  235. package/dist/assets/plugin-timeline-Bmy8v-AN.js +1 -0
  236. package/dist/assets/plugin-view-tV_8MnpT.js +1 -0
  237. package/dist/assets/plugins-views-DM6-O61C.js +4 -0
  238. package/dist/assets/po-BiJDBrnU.js +1 -0
  239. package/dist/assets/poimandres-DRFjx7u4.js +1 -0
  240. package/dist/assets/polar-C7UOKdEL.js +1 -0
  241. package/dist/assets/postcss-BXeXVLqQ.js +1 -0
  242. package/dist/assets/powerquery-DNMTfnFr.js +1 -0
  243. package/dist/assets/powershell-DshXNtvi.js +1 -0
  244. package/dist/assets/prisma-BsRQq5mF.js +1 -0
  245. package/dist/assets/prolog-iXnhIJG7.js +1 -0
  246. package/dist/assets/proto-DB4EqR-F.js +1 -0
  247. package/dist/assets/pug-bpEG1CVZ.js +1 -0
  248. package/dist/assets/puppet-CDv2pdJW.js +1 -0
  249. package/dist/assets/purescript-9MfHhQsQ.js +1 -0
  250. package/dist/assets/python-gzcpVVnB.js +1 -0
  251. package/dist/assets/qml-DGJzHzg9.js +1 -0
  252. package/dist/assets/qmldir-DCQb3MpD.js +1 -0
  253. package/dist/assets/qss-Fe1Jh2GI.js +1 -0
  254. package/dist/assets/r-CZt9UGEb.js +1 -0
  255. package/dist/assets/racket-DcIDlBhZ.js +1 -0
  256. package/dist/assets/raku-B3gFvitq.js +1 -0
  257. package/dist/assets/razor-mTLK-dma.js +1 -0
  258. package/dist/assets/red-CJ3rzSJv.js +1 -0
  259. package/dist/assets/reg-CRGYupPL.js +1 -0
  260. package/dist/assets/regexp-DX5QhPdx.js +1 -0
  261. package/dist/assets/rel-BtDbiS_P.js +1 -0
  262. package/dist/assets/riscv-Ckw8ddFX.js +1 -0
  263. package/dist/assets/rolldown-runtime-CMxvf4Kt.js +1 -0
  264. package/dist/assets/ron-VUp2lXgN.js +1 -0
  265. package/dist/assets/rose-pine-BthvhNj6.js +1 -0
  266. package/dist/assets/rose-pine-dawn-Dg85fqjY.js +1 -0
  267. package/dist/assets/rose-pine-moon-hon4tzzS.js +1 -0
  268. package/dist/assets/rosmsg-CAekHB0j.js +1 -0
  269. package/dist/assets/rst-t-F-oATV.js +1 -0
  270. package/dist/assets/ruby-D9DDGNv3.js +1 -0
  271. package/dist/assets/rust-Cfkwpbl8.js +1 -0
  272. package/dist/assets/sas-BAEs8TsV.js +1 -0
  273. package/dist/assets/sass-DXrisJhu.js +1 -0
  274. package/dist/assets/scala-DKOlJaKm.js +1 -0
  275. package/dist/assets/scheme-DQCgrYNe.js +1 -0
  276. package/dist/assets/scss-B6B5DSWC.js +1 -0
  277. package/dist/assets/sdbl-bTVj8UrX.js +1 -0
  278. package/dist/assets/shaderlab-TOUzSsQk.js +1 -0
  279. package/dist/assets/shellscript-DXt7nqYk.js +1 -0
  280. package/dist/assets/shellsession-DQ4guRhR.js +1 -0
  281. package/dist/assets/slack-dark-DnToyrRv.js +1 -0
  282. package/dist/assets/slack-ochin-B2OO5cIa.js +1 -0
  283. package/dist/assets/smalltalk-B16xEiuN.js +1 -0
  284. package/dist/assets/snazzy-light-4G7pJPwS.js +1 -0
  285. package/dist/assets/solarized-dark-DV17i1UV.js +1 -0
  286. package/dist/assets/solarized-light-DSh2HLQt.js +1 -0
  287. package/dist/assets/solidity-CKzVLygQ.js +1 -0
  288. package/dist/assets/soy-DtwGS8Y2.js +1 -0
  289. package/dist/assets/sparql-D_iOobhT.js +1 -0
  290. package/dist/assets/splunk-BC2Px7Mm.js +1 -0
  291. package/dist/assets/sql-ArzG0FT1.js +1 -0
  292. package/dist/assets/src-BJJhwsID.js +2 -0
  293. package/dist/assets/ssh-config-BgfXC-Er.js +1 -0
  294. package/dist/assets/stata-CdQ318yb.js +1 -0
  295. package/dist/assets/stylus-B6D30XZt.js +1 -0
  296. package/dist/assets/surrealql-RyXJ8VfM.js +1 -0
  297. package/dist/assets/svelte-CXkGIk7i.js +1 -0
  298. package/dist/assets/swift-DonLKvLd.js +1 -0
  299. package/dist/assets/synthwave-84-nFMaYfgc.js +1 -0
  300. package/dist/assets/system-verilog-DJ5XKQeo.js +1 -0
  301. package/dist/assets/systemd-BxMlprV5.js +1 -0
  302. package/dist/assets/talonscript-CohzipZa.js +1 -0
  303. package/dist/assets/tasl-DMoTqEGO.js +1 -0
  304. package/dist/assets/tcl-CZd0xW_V.js +1 -0
  305. package/dist/assets/templ-CJz86NIj.js +1 -0
  306. package/dist/assets/terraform-DswuEJGm.js +1 -0
  307. package/dist/assets/tex-C71esTKh.js +1 -0
  308. package/dist/assets/tokyo-night-oM2G3aXe.js +1 -0
  309. package/dist/assets/toml-CcmNWLt0.js +1 -0
  310. package/dist/assets/ts-tags-Qszjvpax.js +1 -0
  311. package/dist/assets/tsv-sltzmVWM.js +1 -0
  312. package/dist/assets/tsx-BEhriTf8.js +1 -0
  313. package/dist/assets/turtle-ByJddavk.js +1 -0
  314. package/dist/assets/twig-CbaWuFm3.js +1 -0
  315. package/dist/assets/types-BsFD2pPK.js +1 -0
  316. package/dist/assets/typescript-CBu4i5lG.js +1 -0
  317. package/dist/assets/typespec-BRdr0IET.js +1 -0
  318. package/dist/assets/typst-DI99ib-x.js +1 -0
  319. package/dist/assets/ui-components-BL3SEdAz.css +1 -0
  320. package/dist/assets/ui-components-DYQ4Pai7.js +41 -0
  321. package/dist/assets/ui-layout-Dmw4Ab7P.js +1 -0
  322. package/dist/assets/v-DETTlOr0.js +1 -0
  323. package/dist/assets/vala-zf12oZj6.js +1 -0
  324. package/dist/assets/vb-Djn5o6TS.js +1 -0
  325. package/dist/assets/vendor-charts-vh1WJI0j.js +36 -0
  326. package/dist/assets/vendor-dndkit-0jp7h5ty.js +5 -0
  327. package/dist/assets/vendor-i18n-CnFu8bdi.js +1 -0
  328. package/dist/assets/vendor-icons-core-D5MicM14.js +1 -0
  329. package/dist/assets/vendor-markdown-CvMSBmgq.js +38 -0
  330. package/dist/assets/vendor-objectstack-CwZ3saTl.js +65 -0
  331. package/dist/assets/vendor-radix-BNWIlSsV.js +56 -0
  332. package/dist/assets/vendor-react-CIpZOxG3.js +13 -0
  333. package/dist/assets/vendor-sentry-D5yZpZ5X.js +484 -0
  334. package/dist/assets/vendor-ui-utils-D3GsyZyi.js +1 -0
  335. package/dist/assets/vendor-zod-BzP-Jkm3.js +1 -0
  336. package/dist/assets/verilog-CiiDBU1e.js +1 -0
  337. package/dist/assets/vesper-DdrHHSXu.js +1 -0
  338. package/dist/assets/vhdl-BroJfC0k.js +1 -0
  339. package/dist/assets/viml-DvXPmvsu.js +1 -0
  340. package/dist/assets/vitesse-black-fwtXNY1n.js +1 -0
  341. package/dist/assets/vitesse-dark-BZCL-v6S.js +1 -0
  342. package/dist/assets/vitesse-light-VbXTXTou.js +1 -0
  343. package/dist/assets/vue-Bruwzb-A.js +1 -0
  344. package/dist/assets/vue-html-C-3Ma2tD.js +1 -0
  345. package/dist/assets/vue-vine-DQAt9DTg.js +1 -0
  346. package/dist/assets/vyper-CgoNMtux.js +1 -0
  347. package/dist/assets/wasm-BnjxR4X6.js +1 -0
  348. package/dist/assets/wasm-ByWQv1Qj.js +1 -0
  349. package/dist/assets/wenyan-C8pVoKbM.js +1 -0
  350. package/dist/assets/wgsl-BsKzXJz4.js +1 -0
  351. package/dist/assets/wikitext-ClFFjSW2.js +1 -0
  352. package/dist/assets/wit-DdvCle-K.js +1 -0
  353. package/dist/assets/wolfram-DLL8P-h_.js +1 -0
  354. package/dist/assets/xml-BS2GSQw_.js +1 -0
  355. package/dist/assets/xsl-CCmfIdf4.js +1 -0
  356. package/dist/assets/yaml-C1LY7x4K.js +1 -0
  357. package/dist/assets/zenscript-BnlCZFoB.js +1 -0
  358. package/dist/assets/zig-CMLA9XwU.js +1 -0
  359. package/dist/index.html +24 -5
  360. package/dist/manifest.json +19 -0
  361. package/dist/vite.svg +25 -0
  362. package/package.json +18 -59
  363. package/dist/assets/app-shell-CaJU0zqc.js +0 -263
  364. package/dist/assets/dist-DxiImE7o.js +0 -1
  365. package/dist/assets/framework-CT7trS8g.js +0 -1
  366. package/dist/assets/index-DRq36Jb9.js +0 -1
  367. package/dist/assets/index-sNORrJSP.css +0 -1
  368. package/dist/assets/plugin-calendar-N01daPoe.js +0 -1
  369. package/dist/assets/plugin-charts-BxPL3e--.js +0 -9
  370. package/dist/assets/plugin-kanban-Cy0iBS_w.js +0 -0
  371. package/dist/assets/plugins-views-CIpa21Ck.js +0 -58
  372. package/dist/assets/rolldown-runtime-aKtaBQYM.js +0 -1
  373. package/dist/assets/vendor-react-BnXfQgq5.js +0 -9
  374. /package/dist/assets/{app-shell-DnNKJB60.css → plugin-dashboard-DnNKJB60.css} +0 -0
package/LICENSE.apache ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute
108
+ must include a readable copy of the attribution notices
109
+ contained within such NOTICE file, excluding those notices
110
+ that do not pertain to any part of the Derivative Works,
111
+ in at least one of the following places: within a NOTICE
112
+ text file distributed as part of the Derivative Works; within
113
+ the Source form or documentation, if provided along with
114
+ the Derivative Works; or, within a display generated by the
115
+ Derivative Works, if and wherever such third-party notices
116
+ normally appear. The contents of the NOTICE file are for
117
+ informational purposes only and do not modify the License.
118
+ You may add Your own attribution notices within Derivative
119
+ Works that You distribute, alongside or as an addendum to
120
+ the NOTICE text from the Work, provided that such additional
121
+ attribution notices cannot be construed as modifying the
122
+ License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 ObjectStack
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,65 +1,48 @@
1
1
  # @objectstack/console
2
2
 
3
- Opinionated, fork-ready ObjectStack runtime console built on
4
- [`@object-ui/app-shell`](https://www.objectui.org/docs/layout/app-shell) with the
5
- full ObjectUI plugin set wired up (grid, kanban, calendar, charts, list, detail,
6
- view, form, dashboard, report, chatbot).
3
+ **Prebuilt Console SPA, version-locked to `@objectstack/framework`.**
7
4
 
8
- This app mirrors the upstream
9
- [`console-starter`](https://github.com/objectstack-ai/objectui/tree/main/examples/console-starter)
10
- template, repackaged as a first-party app inside the framework monorepo so it
11
- can be served alongside `apps/objectos` / `apps/cloud`.
5
+ This package contains nothing but a prebuilt `dist/` directory: the static
6
+ assets of the ObjectStack runtime Console, baked at the commit of
7
+ [`objectstack-ai/objectui`](https://github.com/objectstack-ai/objectui)
8
+ recorded in [`.objectui-sha`](../../.objectui-sha) of this framework release.
12
9
 
13
- > Renamed from `apps/dashboard` to avoid confusion with the spec-level
14
- > `Dashboard` metadata type. The Console is the runtime UI shell that *renders*
15
- > dashboards (and views/pages/reports), it is not itself a dashboard.
10
+ It exists so that a single
16
11
 
17
- ## Develop
18
-
19
- ```bash
20
- # from the repo root
21
- pnpm install
22
- pnpm dev:console # runs on http://localhost:5175/_console/
12
+ ```sh
13
+ pnpm add @objectstack/framework
23
14
  ```
24
15
 
25
- By default the dev server proxies `/api` and `/.well-known` to
26
- `http://localhost:3000`, which is where `pnpm dev` (the `apps/objectos` server)
27
- listens. Override the upstream server with `VITE_SERVER_URL` in
28
- `.env.development` if you point the console at a remote ObjectStack instance.
29
-
30
- > Pair it with the CRM example server: `pnpm dev:crm` (port 3001) and launch
31
- > with `VITE_SERVER_URL=http://localhost:3001 VITE_PROXY_TARGET=http://localhost:3001 pnpm dev:console`.
16
+ always pulls in a Console build matched to the framework version — no
17
+ second npm dependency to keep in sync.
32
18
 
33
- ### Workspace alias requirement
19
+ ## Relationship to `@object-ui/console`
34
20
 
35
- `vite.config.ts` aliases every `@object-ui/*` import to the **source** folders
36
- in the sibling [`objectui`](https://github.com/objectstack-ai/objectui) checkout
37
- (`../../../objectui/packages/<name>/src`). This is required: the published
38
- `@object-ui/plugin-*` rolldown bundles inline their own private
39
- `ComponentRegistry` instance per package, which breaks cross-plugin component
40
- lookup (e.g. `plugin-list` cannot find `object-grid` registered by
41
- `plugin-grid`). Building from source guarantees a single shared
42
- `ComponentRegistry` singleton — the same trick used by the upstream
43
- `examples/console-starter` template.
21
+ | | `@object-ui/console` | `@objectstack/console` |
22
+ |---|---|---|
23
+ | Repo | [`objectstack-ai/objectui`](https://github.com/objectstack-ai/objectui) | [`objectstack-ai/framework`](https://github.com/objectstack-ai/framework) |
24
+ | Role | Standalone Console SPA on its own release cadence | Prebuilt SPA frozen at the SHA this framework release was tested against |
25
+ | Use | Cloud overlays, advanced users, anyone consuming Console directly | Default install for `@objectstack/framework` consumers |
44
26
 
45
- Make sure you have `objectui` cloned next to this repo:
27
+ The framework CLI's `resolveConsolePath()` (in
28
+ `packages/cli/src/utils/console.ts`) prefers `@objectstack/console` and
29
+ falls back to `@object-ui/console` when present — so cloud's Docker
30
+ overlay (which `cp -r`s its build over `node_modules/@object-ui/console`)
31
+ keeps working.
46
32
 
47
- ```
48
- GitHub/
49
- ├── framework/ # this repo
50
- └── objectui/ # https://github.com/objectstack-ai/objectui
51
- ```
33
+ ## Updating
52
34
 
53
- ## Customise
35
+ 1. Run `scripts/bump-objectui.sh` (or `scripts/bump-objectui.sh <sha>`) at
36
+ the repo root to update `.objectui-sha`.
37
+ 2. CI runs `scripts/build-console.sh` before publish, which clones
38
+ objectui at the pinned SHA, builds `@object-ui/console`, and copies
39
+ `dist/` into this package.
40
+ 3. `pnpm publish` ships it at the same version as every other package in
41
+ the Changesets `fixed` group.
54
42
 
55
- `src/App.tsx` owns the routing treefork and edit it. The building blocks
56
- imported from `@object-ui/app-shell` (`ConsoleShell`, `AuthenticatedRoute`,
57
- `RootRedirect`, `Default*` pages) encapsulate the provider stack and auth guard
58
- so you only write JSX.
43
+ The `dist/` directory is **not** committedit's a CI publish artifact
44
+ only.
59
45
 
60
- Common edits:
46
+ ## License
61
47
 
62
- - **Add a route**: drop a `<Route path="/billing" ... />` inside `<Routes>`
63
- - **Swap auth UI**: replace `<DefaultLoginPage />` with your own component
64
- - **Skip orgs**: `<AuthenticatedRoute requireOrganization={false}>`
65
- - **Add/remove plugins**: edit the side-effect imports at the top of `src/main.tsx`
48
+ Apache-2.0
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";import{n as r}from"./plugin-chatbot-DXGXTdLU.js";var i=e(t(),1),a=n();function o(){let e={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_SENTRY_DSN:`https://1373a588ceb9da150b11e64bf85f583d@o4510356161757184.ingest.us.sentry.io/4511439670673408`,VITE_SENTRY_ENVIRONMENT:`production`,VITE_SENTRY_SEND_DEFAULT_PII:`true`,VITE_SERVER_URL:``,VITE_USE_MOCK_SERVER:`false`},t=e.VITE_AI_BASE_URL;return t?t.replace(/\/$/,``):`${(e.VITE_SERVER_URL??``).replace(/\/$/,``)}/api/v1/ai`}function s(){let e=(0,i.useMemo)(()=>o(),[]);return(0,a.jsxs)(`div`,{className:`p-6 max-w-6xl mx-auto`,children:[(0,a.jsxs)(`div`,{className:`mb-4`,children:[(0,a.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`AI Approvals`}),(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Review actions an AI agent proposed. Approve to execute them server-side; reject to send a reason back to the model so it can revise the next turn.`})]}),(0,a.jsx)(r,{apiBase:e,variant:`card`,title:`Queue`,description:`Polled every 5 seconds. Decisions are recorded under your identity.`})]})}export{s as AiPendingActionsPage,s as default};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";import{x as r}from"./framework-ClI3DbWX.js";import{Co as i,Di as a,Hn as o,Ma as s,Pr as c,Qn as l,So as u,Ti as d,Un as f,Wn as p,bo as m,ia as h,oo as g,to as _,ui as v,xr as ee,yi as te}from"./ui-components-DYQ4Pai7.js";import"./index-D7iz-IIn.js";var y=e(t(),1),b=[`plugin`,`plugins`,`kind`,`package`];function x(e){return[{method:`POST`,path:`${e}/sign-in/email`,desc:`Sign in (email)`,group:`Auth`,bodyTemplate:{email:`user@example.com`,password:``}},{method:`POST`,path:`${e}/sign-up/email`,desc:`Sign up (email)`,group:`Auth`,bodyTemplate:{email:``,password:``,name:``}},{method:`POST`,path:`${e}/sign-out`,desc:`Sign out`,group:`Auth`},{method:`GET`,path:`${e}/get-session`,desc:`Get session`,group:`Auth`}]}var S={ai:{group:`AI`,defaultRoute:`/api/v1/ai`,endpoints:[{method:`POST`,path:`/chat`,desc:`Chat completion`,bodyTemplate:{messages:[{role:`user`,content:``}]}},{method:`POST`,path:`/chat/stream`,desc:`Streaming chat (SSE)`,bodyTemplate:{messages:[{role:`user`,content:``}]}},{method:`POST`,path:`/complete`,desc:`Text completion`,bodyTemplate:{prompt:``}},{method:`GET`,path:`/models`,desc:`List available models`},{method:`POST`,path:`/nlq`,desc:`Natural language query`,bodyTemplate:{query:``}},{method:`POST`,path:`/suggest`,desc:`AI-powered suggestions`,bodyTemplate:{object:``,field:``,context:{}}},{method:`POST`,path:`/insights`,desc:`AI-generated insights`,bodyTemplate:{object:``,recordIds:[]}},{method:`POST`,path:`/conversations`,desc:`Create conversation`,bodyTemplate:{}},{method:`GET`,path:`/conversations`,desc:`List conversations`},{method:`POST`,path:`/conversations/:id/messages`,desc:`Add message to conversation`,bodyTemplate:{role:`user`,content:``}},{method:`DELETE`,path:`/conversations/:id`,desc:`Delete conversation`}]},workflow:{group:`Workflow`,defaultRoute:`/api/v1/workflow`,endpoints:[{method:`GET`,path:`/:object/config`,desc:`Get workflow configuration`},{method:`GET`,path:`/:object/:recordId/state`,desc:`Get workflow state`},{method:`POST`,path:`/:object/:recordId/transition`,desc:`Execute workflow transition`,bodyTemplate:{targetState:``}},{method:`POST`,path:`/:object/:recordId/approve`,desc:`Approve workflow step`,bodyTemplate:{comment:``}},{method:`POST`,path:`/:object/:recordId/reject`,desc:`Reject workflow step`,bodyTemplate:{comment:``}}]},realtime:{group:`Realtime`,defaultRoute:`/api/v1/realtime`,endpoints:[{method:`POST`,path:`/connect`,desc:`Establish realtime connection`,bodyTemplate:{transport:`websocket`}},{method:`POST`,path:`/disconnect`,desc:`Close realtime connection`,bodyTemplate:{connectionId:``}},{method:`POST`,path:`/subscribe`,desc:`Subscribe to channel`,bodyTemplate:{channel:``}},{method:`POST`,path:`/unsubscribe`,desc:`Unsubscribe from channel`,bodyTemplate:{channel:``}},{method:`PUT`,path:`/presence/:channel`,desc:`Set presence state`,bodyTemplate:{status:`online`}},{method:`GET`,path:`/presence/:channel`,desc:`Get channel presence`}]},notification:{group:`Notifications`,defaultRoute:`/api/v1/notifications`,endpoints:[{method:`GET`,path:``,desc:`List notifications`},{method:`POST`,path:`/devices`,desc:`Register device for push`,bodyTemplate:{token:``,platform:`web`}},{method:`DELETE`,path:`/devices/:deviceId`,desc:`Unregister device`},{method:`GET`,path:`/preferences`,desc:`Get notification preferences`},{method:`PATCH`,path:`/preferences`,desc:`Update notification preferences`,bodyTemplate:{email:!0,push:!0}},{method:`POST`,path:`/read`,desc:`Mark notifications as read`,bodyTemplate:{ids:[]}},{method:`POST`,path:`/read/all`,desc:`Mark all as read`}]},analytics:{group:`Analytics`,defaultRoute:`/api/v1/analytics`,endpoints:[{method:`POST`,path:`/query`,desc:`Execute analytics query`,bodyTemplate:{measures:[],dimensions:[]}},{method:`GET`,path:`/meta`,desc:`Get analytics metadata`}]},automation:{group:`Automation`,defaultRoute:`/api/v1/automation`,endpoints:[{method:`POST`,path:`/trigger`,desc:`Trigger automation`,bodyTemplate:{name:``,params:{}}}]},i18n:{group:`i18n`,defaultRoute:`/api/v1/i18n`,endpoints:[{method:`GET`,path:`/locales`,desc:`Get available locales`},{method:`GET`,path:`/translations/:locale`,desc:`Get translations for locale`},{method:`GET`,path:`/labels/:object/:locale`,desc:`Get translated field labels`}]},ui:{group:`UI`,defaultRoute:`/api/v1/ui`,endpoints:[{method:`GET`,path:`/views`,desc:`List views`},{method:`GET`,path:`/views/:id`,desc:`Get view by ID`},{method:`POST`,path:`/views`,desc:`Create view`,bodyTemplate:{name:``,object:``,type:`list`}},{method:`PATCH`,path:`/views/:id`,desc:`Update view`,bodyTemplate:{name:``}},{method:`DELETE`,path:`/views/:id`,desc:`Delete view`}]},feed:{group:`Feed`,defaultRoute:`/api/v1/feed`,endpoints:[{method:`GET`,path:`/:object/:recordId`,desc:`Get feed items`},{method:`POST`,path:`/:object/:recordId`,desc:`Post feed item`,bodyTemplate:{body:``}}]},storage:{group:`Storage`,defaultRoute:`/api/v1/storage`,endpoints:[{method:`POST`,path:`/upload`,desc:`Upload file (multipart/form-data)`},{method:`GET`,path:`/:fileId`,desc:`Download file`},{method:`DELETE`,path:`/:fileId`,desc:`Delete file`}]}};function C(e,t){let n=S[e];return n?n.endpoints.map(e=>({method:e.method,path:`${t}${e.path}`,desc:e.desc,group:n.group,...e.bodyTemplate?{bodyTemplate:e.bodyTemplate}:{}})):[]}function ne(){let e=r(),[t,n]=(0,y.useState)([]),[i,a]=(0,y.useState)([]),[o,s]=(0,y.useState)(!0),[c,l]=(0,y.useState)(null),u=(0,y.useCallback)(async()=>{s(!0),l(null);let t=`/api/v1`,r=`${t}/discovery`,i=[{method:`GET`,path:r,desc:`API Discovery`,group:`System`},{method:`GET`,path:`${t}/meta/types`,desc:`List metadata types`,group:`Metadata`},{method:`GET`,path:`${t}/packages`,desc:`List packages`,group:`System`},{method:`GET`,path:`/api/v1/health`,desc:`Health check`,group:`System`}];try{let o=`/api/v1/auth`,s={},c={};try{let e=await fetch(r);if(e.ok){let t=await e.json(),n=t?.data??t;c=n?.routes??{},s=n?.services??{},c.auth&&(o=c.auth)}}catch{}let l=[];for(let[e,t]of Object.entries(S)){let n=s[e],r=n?.enabled??!1,i=n?.handlerReady??(n?.status===`available`||n?.status===`degraded`),a=n?.route??c[e]??t.defaultRoute;r&&i&&l.push(...C(e,a))}let u=e?.getClient?.(),d=[];try{let e=await u?.meta?.getTypes?.();e&&Array.isArray(e.types)?d=e.types:Array.isArray(e)&&(d=e)}catch{}let f=[];try{let e=d.includes(`object`)?`object`:null;if(e&&u?.meta?.getItems){let t=await u.meta.getItems(e),n=[];Array.isArray(t)?n=t:t&&Array.isArray(t.items)?n=t.items:t&&Array.isArray(t.value)&&(n=t.value),f=n.map(e=>e.name||e.id).filter(Boolean)}}catch{}let p=f.flatMap(e=>{let n=e.startsWith(`sys_`)?`Data: system tables`:`Data: ${e}`;return[{method:`GET`,path:`${t}/data/${e}`,desc:`List ${e}`,group:n},{method:`POST`,path:`${t}/data/${e}`,desc:`Create ${e}`,group:n,bodyTemplate:{name:`example`}},{method:`GET`,path:`${t}/data/${e}/:id`,desc:`Get ${e} by ID`,group:n},{method:`PATCH`,path:`${t}/data/${e}/:id`,desc:`Update ${e}`,group:n,bodyTemplate:{name:`updated`}},{method:`DELETE`,path:`${t}/data/${e}/:id`,desc:`Delete ${e}`,group:n}]}),m=d.filter(e=>!b.includes(e)).map(e=>({method:`GET`,path:`${t}/meta/${e}`,desc:`List ${e} metadata`,group:`Metadata`})),h=f.map(e=>({method:`GET`,path:`${t}/meta/object/${e}`,desc:`${e} schema`,group:`Metadata`})),g=[...i,...x(o),...l,...m,...h,...p],_=new Map;for(let e of g){let t=_.get(e.group)||[];t.push(e),_.set(e.group,t)}let v=[`System`,`Auth`,`AI`,`Workflow`,`Realtime`,`Notifications`,`Analytics`,`Automation`,`i18n`,`UI`,`Feed`,`Storage`,`Metadata`];n(Array.from(_.entries()).sort(([e],[t])=>{let n=v.indexOf(e),r=v.indexOf(t);return n!==-1&&r!==-1?n-r:n===-1?r===-1?e.localeCompare(t):1:-1}).map(([e,t])=>({key:e,label:e,endpoints:t}))),a(g)}catch(e){l(e.message||`Failed to discover APIs`)}finally{s(!1)}},[e]);return(0,y.useEffect)(()=>{u()},[u]),{groups:t,allEndpoints:i,loading:o,error:c,refresh:u}}var w=n(),T={GET:`text-emerald-600 bg-emerald-50 border-emerald-200 dark:text-emerald-400 dark:bg-emerald-950/50`,POST:`text-blue-600 bg-blue-50 border-blue-200 dark:text-blue-400 dark:bg-blue-950/50`,PATCH:`text-amber-600 bg-amber-50 border-amber-200 dark:text-amber-400 dark:bg-amber-950/50`,PUT:`text-amber-600 bg-amber-50 border-amber-200 dark:text-amber-400 dark:bg-amber-950/50`,DELETE:`text-red-600 bg-red-50 border-red-200 dark:text-red-400 dark:bg-red-950/50`},E={2:`text-emerald-600 dark:text-emerald-400`,3:`text-blue-600 dark:text-blue-400`,4:`text-amber-600 dark:text-amber-400`,5:`text-red-600 dark:text-red-400`},re=[{key:`$top`,placeholder:`10`,hint:`limit`},{key:`$skip`,placeholder:`0`,hint:`offset`},{key:`$sort`,placeholder:`name`,hint:`sort field`},{key:`$select`,placeholder:`name,email`,hint:`fields`},{key:`$count`,placeholder:`true`,hint:`total count`},{key:`$filter`,placeholder:`status eq 'active'`,hint:`OData filter`}],D=1;function O(){let e=r()?.getClient?.(),{groups:t,loading:n,refresh:b}=ne(),[x,S]=(0,y.useState)(``),[C,O]=(0,y.useState)(new Set),[k,A]=(0,y.useState)(null),[ie,j]=(0,y.useState)(``),[ae,M]=(0,y.useState)(``),[N,P]=(0,y.useState)(``),[F,I]=(0,y.useState)([]),[L,R]=(0,y.useState)(!1),[z,B]=(0,y.useState)(null),[V,H]=(0,y.useState)([]),[U,oe]=(0,y.useState)(null),[W,G]=(0,y.useState)(!1),K=(0,y.useMemo)(()=>{if(!x)return t;let e=x.toLowerCase();return t.map(t=>({...t,endpoints:t.endpoints.filter(t=>t.desc.toLowerCase().includes(e)||t.path.toLowerCase().includes(e)||t.method.toLowerCase().includes(e))})).filter(e=>e.endpoints.length>0)},[t,x]),se=(0,y.useCallback)(e=>{O(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ce=(0,y.useCallback)(e=>{A(e),j(e.method),M(e.path),P(e.bodyTemplate?JSON.stringify(e.bodyTemplate,null,2):``),I([]),B(null)},[]),q=ie||k?.method||`GET`,J=ae||k?.path||``,Y=(0,y.useMemo)(()=>{let e=F.filter(e=>e.enabled&&e.key.trim());return e.length===0?J:`${J}?${e.map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`).join(`&`)}`},[J,F]),X=(0,y.useCallback)((e=``,t=``)=>{I(n=>[...n,{id:D++,key:e,value:t,enabled:!0}])},[]),le=(0,y.useCallback)(e=>{I(t=>t.filter(t=>t.id!==e))},[]),Z=(0,y.useCallback)((e,t,n)=>{I(r=>r.map(r=>r.id===e?{...r,[t]:n}:r))},[]),ue=(0,y.useCallback)(e=>{I(t=>t.map(t=>t.id===e?{...t,enabled:!t.enabled}:t))},[]),Q=(0,y.useCallback)(async()=>{if(L||!Y)return;let t=`${e?.baseUrl??``}${Y}`;R(!0);let n=performance.now();try{let e={method:q,headers:{"Content-Type":`application/json`}};[`POST`,`PATCH`,`PUT`].includes(q)&&N.trim()&&(e.body=N);let r=await fetch(t,e),i=Math.round(performance.now()-n),a;if((r.headers.get(`content-type`)??``).includes(`json`)){let e=await r.json();a=JSON.stringify(e,null,2)}else a=await r.text();B({status:r.status,body:a,duration:i}),H(e=>[{id:Date.now(),method:q,url:Y,body:N||void 0,status:r.status,duration:i,response:a,timestamp:new Date},...e].slice(0,50))}catch(e){let t=Math.round(performance.now()-n);B({status:0,body:`Network Error: ${e.message}`,duration:t})}finally{R(!1)}},[e,Y,q,N,L]),de=(0,y.useCallback)(e=>{j(e.method);let[t,n]=e.url.split(`?`);if(M(t),P(e.body||``),n){let e=new URLSearchParams(n),t=[];e.forEach((e,n)=>{t.push({id:D++,key:n,value:e,enabled:!0})}),I(t)}else I([]);B(null),A(null)},[]),fe=(0,y.useCallback)(()=>{z?.body&&(navigator.clipboard.writeText(z.body),G(!0),setTimeout(()=>G(!1),1500))},[z]),$=e=>E[String(e)[0]]??`text-muted-foreground`;return(0,w.jsxs)(`div`,{className:`flex flex-1 min-h-0 overflow-hidden`,children:[(0,w.jsxs)(`div`,{className:`w-72 shrink-0 border-r flex flex-col overflow-hidden`,children:[(0,w.jsxs)(`div`,{className:`p-3 border-b space-y-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`h3`,{className:`text-sm font-semibold text-foreground flex-1`,children:`API Endpoints`}),(0,w.jsx)(`button`,{onClick:b,disabled:n,className:`p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground`,title:`Refresh endpoints`,children:(0,w.jsx)(te,{className:`h-3.5 w-3.5 ${n?`animate-spin`:``}`})})]}),(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsx)(v,{className:`absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,w.jsx)(`input`,{type:`text`,value:x,onChange:e=>S(e.target.value),placeholder:`Search endpoints...`,className:`w-full rounded-md border bg-background pl-8 pr-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-ring`})]})]}),(0,w.jsx)(`div`,{className:`flex-1 overflow-auto p-2 space-y-1`,children:n?(0,w.jsxs)(`div`,{className:`flex items-center justify-center py-8 text-muted-foreground text-sm`,children:[(0,w.jsx)(h,{className:`h-4 w-4 animate-spin mr-2`}),`Discovering APIs...`]}):K.length===0?(0,w.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-muted-foreground text-sm`,children:[(0,w.jsx)(s,{className:`h-6 w-6 opacity-30 mb-2`}),(0,w.jsx)(`span`,{children:x?`No matching endpoints`:`No endpoints found`})]}):K.map(e=>{let t=C.has(e.key)||!!x;return(0,w.jsxs)(o,{open:t,onOpenChange:()=>se(e.key),children:[(0,w.jsx)(p,{asChild:!0,children:(0,w.jsxs)(`button`,{className:`w-full flex items-center gap-1.5 px-2 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:bg-muted/50 hover:text-foreground transition-colors`,children:[(0,w.jsx)(m,{className:`h-3 w-3 shrink-0 transition-transform duration-200 ${t?`rotate-90`:``}`}),(0,w.jsx)(`span`,{className:`flex-1 text-left truncate`,children:e.label}),(0,w.jsx)(`span`,{className:`shrink-0 text-[10px] tabular-nums opacity-60`,children:e.endpoints.length})]})}),(0,w.jsx)(f,{children:(0,w.jsx)(`div`,{className:`ml-3 space-y-0.5 mt-0.5`,children:e.endpoints.map((e,t)=>(0,w.jsxs)(`button`,{onClick:()=>ce(e),className:`w-full text-left flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors ${k===e?`bg-accent text-accent-foreground`:`hover:bg-muted/50 text-muted-foreground hover:text-foreground`}`,children:[(0,w.jsx)(l,{variant:`outline`,className:`font-mono text-[9px] shrink-0 px-1 py-0 ${T[e.method]||``}`,children:e.method}),(0,w.jsx)(`span`,{className:`truncate`,children:e.desc})]},`${e.method}-${e.path}-${t}`))})})]},e.key)})}),(0,w.jsxs)(`div`,{className:`p-3 border-t space-y-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`h4`,{className:`text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:`Query Parameters`}),(0,w.jsxs)(`button`,{onClick:()=>X(),className:`inline-flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:[(0,w.jsx)(d,{className:`h-3 w-3`}),`Add`]})]}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:re.map(e=>(0,w.jsx)(`button`,{onClick:()=>X(e.key,``),className:`text-[10px] px-1.5 py-0.5 rounded border bg-muted/30 text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors font-mono`,title:e.hint,children:e.key},e.key))}),F.length>0&&(0,w.jsx)(`div`,{className:`space-y-1`,children:F.map(e=>(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:()=>ue(e.id),className:`h-3 w-3 shrink-0 rounded border accent-primary`}),(0,w.jsx)(`input`,{type:`text`,value:e.key,onChange:t=>Z(e.id,`key`,t.target.value),placeholder:`key`,className:`flex-1 min-w-0 rounded border bg-background px-1.5 py-0.5 text-[10px] font-mono focus:outline-none focus:ring-1 focus:ring-ring`}),(0,w.jsx)(`input`,{type:`text`,value:e.value,onChange:t=>Z(e.id,`value`,t.target.value),placeholder:`value`,className:`flex-1 min-w-0 rounded border bg-background px-1.5 py-0.5 text-[10px] font-mono focus:outline-none focus:ring-1 focus:ring-ring`}),(0,w.jsx)(`button`,{onClick:()=>le(e.id),className:`shrink-0 p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors`,children:(0,w.jsx)(ee,{className:`h-3 w-3`})})]},e.id))})]})]}),(0,w.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:[(0,w.jsxs)(`div`,{className:`p-3 border-b space-y-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`select`,{value:q,onChange:e=>j(e.target.value),className:`rounded-md border bg-background px-2 py-1.5 font-mono text-xs font-semibold focus:outline-none focus:ring-1 focus:ring-ring ${T[q]||``}`,children:[`GET`,`POST`,`PATCH`,`PUT`,`DELETE`].map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))}),(0,w.jsx)(`input`,{type:`text`,value:J,onChange:e=>M(e.target.value),className:`flex-1 rounded-md border bg-background px-3 py-1.5 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-ring`,placeholder:`/api/v1/...`,onKeyDown:e=>{e.key===`Enter`&&Q()}}),(0,w.jsxs)(`button`,{onClick:Q,disabled:L||!Y,className:`inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors`,children:[L?(0,w.jsx)(h,{className:`h-3.5 w-3.5 animate-spin`}):(0,w.jsx)(a,{className:`h-3.5 w-3.5`}),`Send`]})]}),F.some(e=>e.enabled&&e.key.trim())&&(0,w.jsxs)(`div`,{className:`text-[10px] font-mono text-muted-foreground truncate pl-1`,children:[`→ `,Y]})]}),(0,w.jsxs)(`div`,{className:`flex-1 flex flex-col min-h-0 overflow-auto`,children:[[`POST`,`PATCH`,`PUT`].includes(q)&&(0,w.jsxs)(`div`,{className:`p-3 border-b space-y-1`,children:[(0,w.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:`Request Body (JSON)`}),(0,w.jsx)(`textarea`,{value:N,onChange:e=>P(e.target.value),rows:5,className:`w-full rounded-md border bg-background px-3 py-2 font-mono text-xs focus:outline-none focus:ring-1 focus:ring-ring resize-y`,placeholder:`{ "key": "value" }`})]}),L&&(0,w.jsxs)(`div`,{className:`flex items-center justify-center py-8 text-muted-foreground text-sm`,children:[(0,w.jsx)(h,{className:`h-4 w-4 animate-spin mr-2`}),`Sending request...`]}),z&&!L&&(0,w.jsxs)(`div`,{className:`flex-1 min-h-0 flex flex-col overflow-hidden`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 bg-muted/30 border-b`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,w.jsx)(`span`,{className:`font-mono font-semibold ${$(z.status)}`,children:z.status||`ERR`}),(0,w.jsxs)(`span`,{className:`text-muted-foreground flex items-center gap-1`,children:[(0,w.jsx)(g,{className:`h-3 w-3`}),z.duration,`ms`]})]}),(0,w.jsxs)(`button`,{onClick:fe,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[W?(0,w.jsx)(i,{className:`h-3 w-3`}):(0,w.jsx)(_,{className:`h-3 w-3`}),W?`Copied`:`Copy`]})]}),(0,w.jsx)(`pre`,{className:`flex-1 overflow-auto p-3 text-xs font-mono bg-muted/10 whitespace-pre-wrap break-all`,children:z.body})]}),!z&&!L&&(0,w.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground text-sm`,children:(0,w.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,w.jsx)(s,{className:`h-10 w-10 mx-auto opacity-20`}),(0,w.jsxs)(`p`,{children:[`Select an endpoint or type a URL and click `,(0,w.jsx)(`strong`,{children:`Send`})]}),(0,w.jsx)(`p`,{className:`text-xs opacity-60`,children:`All registered APIs are auto-discovered from the platform`})]})}),V.length>0&&(0,w.jsxs)(`div`,{className:`border-t`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,w.jsxs)(`h4`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:[`History (`,V.length,`)`]}),(0,w.jsxs)(`button`,{onClick:()=>H([]),className:`inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:[(0,w.jsx)(c,{className:`h-3 w-3`}),`Clear`]})]}),(0,w.jsx)(`div`,{className:`space-y-0.5 px-2 pb-2 max-h-60 overflow-auto`,children:V.map(e=>(0,w.jsxs)(`div`,{className:`rounded border`,children:[(0,w.jsxs)(`button`,{onClick:()=>oe(U===e.id?null:e.id),className:`w-full flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-muted/30 transition-colors`,children:[U===e.id?(0,w.jsx)(u,{className:`h-3 w-3 shrink-0`}):(0,w.jsx)(m,{className:`h-3 w-3 shrink-0`}),(0,w.jsx)(l,{variant:`outline`,className:`font-mono text-[9px] shrink-0 ${T[e.method]||``}`,children:e.method}),(0,w.jsx)(`span`,{className:`font-mono truncate text-left flex-1`,children:e.url}),(0,w.jsx)(`span`,{className:`ml-auto shrink-0 font-mono ${$(e.status)}`,children:e.status}),(0,w.jsxs)(`span`,{className:`shrink-0 text-muted-foreground`,children:[e.duration,`ms`]}),(0,w.jsx)(`button`,{onClick:t=>{t.stopPropagation(),de(e)},className:`shrink-0 p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors`,title:`Replay request`,children:(0,w.jsx)(a,{className:`h-2.5 w-2.5`})})]}),U===e.id&&(0,w.jsx)(`pre`,{className:`px-3 py-2 text-xs font-mono bg-muted/10 border-t overflow-auto max-h-40 whitespace-pre-wrap break-all`,children:e.response})]},e.id))})]})]})]})]})}export{O as ApiConsolePage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{d as t,g as n,r,u as i}from"./vendor-react-CIpZOxG3.js";import{S as a}from"./framework-ClI3DbWX.js";import{Fr as o,Gn as s,Ka as c,Kn as l,Kr as u,Lr as d,Pr as f,Qn as p,Ti as m,en as h,fa as g,ji as _,mr as v,qn as y,ui as b}from"./ui-components-DYQ4Pai7.js";import{o as x}from"./vendor-ui-utils-D3GsyZyi.js";import"./index-D7iz-IIn.js";var S=e(n(),1);function C(e,t){if(e!=null){if(typeof e==`string`)return e;if(t){let n=t(e.key,{defaultValue:e.defaultValue,...e.params});if(n&&n!==e.key)return n}return e.defaultValue||e.key}}var w=r();function T(){let e=i(),{appName:n}=t(),r=n?`/apps/${n}`:``,{apps:T,refresh:E}=a(),[D,O]=(0,S.useState)(``),[k,A]=(0,S.useState)(new Set),[j,M]=(0,S.useState)(null),[N,P]=(0,S.useState)(!1),F=(T||[]).filter(e=>{if(!D)return!0;let t=D.toLowerCase();return(e.name||``).toLowerCase().includes(t)||(e.label||``).toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)}),I=(0,S.useCallback)(e=>{A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),L=(0,S.useCallback)(()=>{k.size===F.length?A(new Set):A(new Set(F.map(e=>e.name)))},[k.size,F]),R=(0,S.useCallback)(async e=>{P(!0);try{let t=e.active===!1;x.success(`${e.label||e.name} ${t?`enabled`:`disabled`}`),await E()}catch{x.error(`Failed to toggle app status`)}finally{P(!1)}},[E]),z=(0,S.useCallback)(async e=>{P(!0);try{x.success(`${e.label||e.name} set as default`),await E()}catch{x.error(`Failed to set default app`)}finally{P(!1)}},[E]),B=(0,S.useCallback)(async e=>{if(j!==e.name){M(e.name);return}P(!0);try{x.success(`${e.label||e.name} deleted`),M(null),await E()}catch{x.error(`Failed to delete app`)}finally{P(!1)}},[j,E]),V=(0,S.useCallback)(async e=>{P(!0);try{x.success(`${k.size} apps ${e?`enabled`:`disabled`}`),A(new Set),await E()}catch{x.error(`Bulk operation failed`)}finally{P(!1)}},[k,E]);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`Applications`}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage all configured applications`})]}),(0,w.jsxs)(v,{onClick:()=>e(`${r}/create-app`),"data-testid":`create-app-btn`,children:[(0,w.jsx)(m,{className:`h-4 w-4 mr-2`}),`New App`]})]}),(0,w.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,w.jsx)(`label`,{htmlFor:`app-search`,className:`sr-only`,children:`Search apps`}),(0,w.jsx)(b,{className:`pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),(0,w.jsx)(h,{id:`app-search`,placeholder:`Search apps...`,value:D,onChange:e=>O(e.target.value),className:`pl-8`,"data-testid":`app-search-input`})]}),k.size>0&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(p,{variant:`secondary`,children:[k.size,` selected`]}),(0,w.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>V(!0),disabled:N,children:`Enable`}),(0,w.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>V(!1),disabled:N,children:`Disable`})]})]}),F.length>0&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,w.jsx)(s,{id:`select-all-apps`,checked:k.size===F.length&&F.length>0,onCheckedChange:()=>L()}),(0,w.jsxs)(`label`,{htmlFor:`select-all-apps`,className:`cursor-pointer`,children:[`Select all (`,F.length,`)`]})]}),F.length===0?(0,w.jsxs)(`div`,{className:`text-center py-12 text-muted-foreground`,"data-testid":`no-apps-message`,children:[(0,w.jsx)(g,{className:`h-12 w-12 mx-auto mb-3 opacity-30`}),(0,w.jsx)(`p`,{children:`No apps found.`})]}):(0,w.jsx)(`div`,{className:`grid gap-3`,children:F.map(t=>{let n=t.active!==!1,i=t.isDefault===!0,a=j===t.name;return(0,w.jsx)(l,{className:n?``:`opacity-60`,"data-testid":`app-card-${t.name}`,children:(0,w.jsxs)(y,{className:`flex items-center gap-3 py-3 px-4`,children:[(0,w.jsx)(s,{id:`select-app-${t.name}`,checked:k.has(t.name),onCheckedChange:()=>I(t.name),"aria-label":`Select ${t.label||t.name}`,className:`shrink-0`}),(0,w.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,w.jsx)(g,{className:`h-4 w-4`})}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`font-medium truncate`,children:C(t.label)||t.name}),i&&(0,w.jsx)(p,{variant:`default`,className:`text-xs`,children:`Default`}),(0,w.jsx)(p,{variant:n?`secondary`:`outline`,className:`text-xs`,children:n?`Active`:`Inactive`})]}),t.description&&(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:C(t.description)})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,w.jsx)(v,{variant:`ghost`,size:`icon`,title:`Open app`,"aria-label":`Open ${t.label||t.name}`,onClick:()=>e(`/apps/${t.name}`),children:(0,w.jsx)(c,{className:`h-4 w-4`})}),(0,w.jsx)(v,{variant:`ghost`,size:`icon`,title:`Edit app`,"aria-label":`Edit ${t.label||t.name}`,onClick:()=>e(`${r}/edit-app/${t.name}`),children:(0,w.jsx)(_,{className:`h-4 w-4`})}),(0,w.jsx)(v,{variant:`ghost`,size:`icon`,title:n?`Disable app`:`Enable app`,"aria-label":n?`Disable ${t.label||t.name}`:`Enable ${t.label||t.name}`,onClick:()=>R(t),disabled:N,children:n?(0,w.jsx)(o,{className:`h-4 w-4`}):(0,w.jsx)(d,{className:`h-4 w-4`})}),(0,w.jsx)(v,{variant:`ghost`,size:`icon`,title:`Set as default`,"aria-label":`Set ${t.label||t.name} as default`,onClick:()=>z(t),disabled:N||i,children:(0,w.jsx)(u,{className:`h-4 w-4 ${i?`fill-current text-yellow-500`:``}`})}),(0,w.jsx)(v,{variant:`ghost`,size:`icon`,title:a?`Click again to confirm delete`:`Delete app`,"aria-label":a?`Confirm delete ${t.label||t.name}`:`Delete ${t.label||t.name}`,onClick:()=>B(t),disabled:N,className:a?`text-destructive`:``,children:(0,w.jsx)(f,{className:`h-4 w-4`})})]})]})},t.name)})})]})}export{T as AppManagementPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";import{l as r}from"./infrastructure-ezj3FgNE.js";import{$ as i,Ar as a,At as o,Bt as s,F as ee,Ft as te,Gn as ne,Ht as c,I as re,It as ie,Kn as ae,Lt as l,Mt as oe,Nt as se,Pt as ce,Q as le,Qn as u,Rt as ue,Vt as d,Zr as de,ar as fe,at as f,cr as pe,ct as me,dr as he,en as ge,et as _e,fr as ve,go as ye,in as be,it as xe,lr as Se,mr as p,nr as Ce,nt as m,oo as we,or as Te,ot as h,pr as Ee,qn as De,rr as Oe,rt as ke,sr as Ae,st as je,to as Me,tt as Ne,ui as Pe,uo as g,ur as _,vo as Fe,xr as Ie,yi as Le,z as Re,zt as v}from"./ui-components-DYQ4Pai7.js";import{o as y}from"./vendor-ui-utils-D3GsyZyi.js";var b=e(t(),1),x=`${``.replace(/\/$/,``)}/api/v1`;async function S(e,t){let n=await fetch(`${x}${e}`,{credentials:`include`,headers:{"Content-Type":`application/json`,...t?.headers||{}},...t}),r=null;try{r=await n.json()}catch{}if(!n.ok){let e=r?.code??`HTTP_${n.status}`,t=r?.message??r?.error??n.statusText,i=Error(`${e}: ${t}`);throw i.code=e,i.status=n.status,i.details=r,i}return r}var C={listProcesses(e={}){let t=new URLSearchParams;e.object&&t.set(`object`,e.object),e.activeOnly&&t.set(`activeOnly`,`true`);let n=t.toString();return S(`/approvals/processes${n?`?${n}`:``}`)},listRequests(e={}){let t=new URLSearchParams;e.status&&t.set(`status`,e.status),e.object&&t.set(`object`,e.object),e.recordId&&t.set(`recordId`,e.recordId),e.approverId&&t.set(`approverId`,e.approverId),e.submitterId&&t.set(`submitterId`,e.submitterId);let n=t.toString();return S(`/approvals/requests${n?`?${n}`:``}`)},async getRequest(e){return{data:await S(`/approvals/requests/${encodeURIComponent(e)}`)}},listActions(e){return S(`/approvals/requests/${encodeURIComponent(e)}/actions`)},async approve(e,t){let n=await S(`/approvals/requests/${encodeURIComponent(e)}/approve`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,finalized:n.finalized}},async reject(e,t){let n=await S(`/approvals/requests/${encodeURIComponent(e)}/reject`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,finalized:n.finalized}},async recall(e,t){let n=await S(`/approvals/requests/${encodeURIComponent(e)}/recall`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,finalized:n.finalized}},async submit(e){return S(`/approvals/requests`,{method:`POST`,body:JSON.stringify(e)})}};function ze(e){if(!e)return[];let t=new Set;e.id&&t.add(e.id),e.email&&t.add(e.email);for(let n of e.roles||[])n&&t.add(`role:${n}`);return Array.from(t)}var w=n(),T={pending:{variant:`secondary`,label:`Pending`},approved:{variant:`default`,label:`Approved`},rejected:{variant:`destructive`,label:`Rejected`},recalled:{variant:`outline`,label:`Recalled`}};function E({status:e}){let t=T[e]??{variant:`outline`,label:e};return(0,w.jsx)(u,{variant:t.variant,children:t.label})}function D(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function Be(e){if(!e)return`—`;let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Date.now()-t,r=Math.round(n/1e3);if(r<45)return`just now`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);if(a<24)return`${a}h ago`;let o=Math.round(a/24);if(o<30)return`${o}d ago`;try{return new Date(e).toLocaleDateString()}catch{return e}}function O(e){return e?e.includes(`@`)?e:e.startsWith(`role:`)?`Role: ${e.slice(5)}`:e.length>14?`${e.slice(0,6)}…${e.slice(-4)}`:e:`—`}function k(){let{user:e}=r(),t=(0,b.useMemo)(()=>ze(e),[e]),[n,x]=(0,b.useState)(`pending`),[S,T]=(0,b.useState)([]),[k,A]=(0,b.useState)(!1),[Ve,He]=(0,b.useState)(null),[Ue,We]=(0,b.useState)(null),[j,M]=(0,b.useState)(null),[Ge,N]=(0,b.useState)([]),[Ke,qe]=(0,b.useState)(!1),[P,F]=(0,b.useState)(``),[I,L]=(0,b.useState)(``),[R,Je]=(0,b.useState)(null),[z,Ye]=(0,b.useState)(``),[B,Xe]=(0,b.useState)(`all`),[V,Ze]=(0,b.useState)(`all`),[H,U]=(0,b.useState)(new Set),[W,Qe]=(0,b.useState)(!1),G=(0,b.useCallback)(async()=>{A(!0),He(null);try{let r=[];if(n===`pending`){let e=new Set;if(t.length===0){let e=await C.listRequests({status:`pending`});for(let t of e.data)r.push(t)}else for(let n of t){let t=await C.listRequests({status:`pending`,approverId:n});for(let n of t.data)e.has(n.id)||(e.add(n.id),r.push(n))}}else if(n===`submitted`){let t=e?.id;if(!t){T([]),A(!1);return}let n=await C.listRequests({submitterId:t});r.push(...n.data)}else{let e=await C.listRequests({});r.push(...e.data)}r.sort((e,t)=>(t.submitted_at||``).localeCompare(e.submitted_at||``)),T(r)}catch(e){He(e?.message||String(e)),T([])}finally{A(!1)}},[n,t,e?.id]);(0,b.useEffect)(()=>{G()},[G]);let $e=(0,b.useCallback)(async e=>{We(e),qe(!0),F(``),L(``);try{let[t,n]=await Promise.all([C.getRequest(e),C.listActions(e)]);M(t.data),N(n.data)}catch(e){y.error(e?.message||`Failed to load request`),M(null),N([])}finally{qe(!1)}},[]),et=()=>{We(null),M(null),N([]),F(``),L(``)},K=(0,b.useCallback)(n=>{if(I.trim())return I.trim();if(!n)return e?.id||``;let r=new Set(n.pending_approvers||[]);for(let e of t)if(r.has(e))return e;return e?.id||``},[I,t,e?.id]),q=(0,b.useCallback)(async e=>{if(!j)return;let t=K(j);if(!t){y.error(`Cannot determine actor id`);return}Je(e);try{let n={actor_id:t,comment:P.trim()||void 0},r=await(e===`approve`?C.approve:e===`reject`?C.reject:C.recall)(j.id,n);y.success(e===`approve`?r.finalized?`Approved (finalized)`:`Approved — advanced to next step`:e===`reject`?r.finalized?`Rejected`:`Rejected — returned to previous step`:`Recalled`),F(``);let[i,a]=await Promise.all([C.getRequest(j.id),C.listActions(j.id)]);M(i.data),N(a.data),G()}catch(t){y.error(t?.message||`Failed to ${e}`)}finally{Je(null)}},[j,K,P,G]),J=(0,b.useMemo)(()=>{if(!j||j.status!==`pending`)return!1;let e=new Set(j.pending_approvers||[]);return t.some(t=>e.has(t))||I.trim().length>0},[j,t,I]),tt=(0,b.useMemo)(()=>!j||j.status!==`pending`?!1:j.submitter_id===e?.id||I.trim().length>0,[j,e?.id,I]),nt=(0,b.useMemo)(()=>S.filter(e=>e.status===`pending`).length,[S]),rt=(0,b.useMemo)(()=>{let e=new Set;for(let t of S)t.process_name&&e.add(t.process_name);return Array.from(e).sort()},[S]),it=(0,b.useMemo)(()=>{let e=new Set;for(let t of S)t.object_name&&e.add(t.object_name);return Array.from(e).sort()},[S]),Y=(0,b.useMemo)(()=>{let e=z.trim().toLowerCase();return S.filter(t=>B!==`all`&&t.process_name!==B||V!==`all`&&t.object_name!==V?!1:e?[t.process_name,t.object_name,t.record_id,t.submitter_id,...t.pending_approvers||[]].filter(Boolean).join(` `).toLowerCase().includes(e):!0)},[S,z,B,V]);(0,b.useEffect)(()=>{if(H.size===0)return;let e=new Set(Y.map(e=>e.id)),t=!1,n=new Set;for(let r of H)e.has(r)?n.add(r):t=!0;t&&U(n)},[Y,H]);let X=(0,b.useMemo)(()=>{let e=new Set(t);return Y.filter(t=>H.has(t.id)&&t.status===`pending`&&(t.pending_approvers||[]).some(t=>e.has(t)))},[Y,H,t]),Z=Y.filter(e=>e.status===`pending`),Q=Z.length>0&&Z.every(e=>H.has(e.id)),at=(0,b.useCallback)(()=>{U(e=>{if(Q)return new Set;let t=new Set(e);for(let e of Z)t.add(e.id);return t})},[Q,Z]),ot=(0,b.useCallback)(e=>{U(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),$=(0,b.useCallback)(async n=>{let r=X;if(r.length===0)return;Qe(!0);let i=0,a=0;for(let o of r){let r=new Set(o.pending_approvers||[]),s=t.find(e=>r.has(e))||e?.id||``;try{await(n===`approve`?C.approve:C.reject)(o.id,{actor_id:s}),i++}catch{a++}}Qe(!1),U(new Set),a===0?y.success(`${n===`approve`?`Approved`:`Rejected`} ${i} request${i===1?``:`s`}`):y.error(`${i} succeeded, ${a} failed`),G()},[X,t,e?.id,G]);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6 max-w-6xl`,children:[(0,w.jsxs)(`header`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`h1`,{className:`text-2xl font-semibold flex items-center gap-2`,children:[(0,w.jsx)(de,{className:`h-6 w-6`}),`Approvals Inbox`]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Review and act on multi-step approval requests.`})]}),(0,w.jsxs)(p,{variant:`outline`,size:`sm`,onClick:G,disabled:k,children:[(0,w.jsx)(Le,{className:`h-4 w-4 mr-2 ${k?`animate-spin`:``}`}),`Refresh`]})]}),Ve&&(0,w.jsxs)(Ce,{variant:`destructive`,children:[(0,w.jsx)(Fe,{className:`h-4 w-4`}),(0,w.jsx)(Oe,{children:Ve})]}),(0,w.jsxs)(i,{value:n,onValueChange:e=>x(e),children:[(0,w.jsxs)(Ne,{children:[(0,w.jsxs)(m,{value:`pending`,children:[`My Pending`,nt>0&&(0,w.jsx)(u,{variant:`secondary`,className:`ml-2`,children:nt})]}),(0,w.jsx)(m,{value:`submitted`,children:`Submitted by me`}),(0,w.jsx)(m,{value:`all`,children:`All`})]}),(0,w.jsxs)(_e,{value:n,className:`mt-4 space-y-3`,children:[!k&&S.length>0&&(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1 min-w-[200px] max-w-sm`,children:[(0,w.jsx)(Pe,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,w.jsx)(ge,{value:z,onChange:e=>Ye(e.target.value),placeholder:`Search process, record, approver…`,className:`pl-8 h-8 text-sm`}),z&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>Ye(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,"aria-label":`Clear search`,children:(0,w.jsx)(Ie,{className:`h-3.5 w-3.5`})})]}),rt.length>1&&(0,w.jsxs)(ue,{value:B,onValueChange:Xe,children:[(0,w.jsx)(d,{className:`h-8 w-auto min-w-[140px] text-sm`,children:(0,w.jsx)(c,{placeholder:`Process`})}),(0,w.jsxs)(v,{children:[(0,w.jsx)(s,{value:`all`,children:`All processes`}),rt.map(e=>(0,w.jsx)(s,{value:e,children:e},e))]})]}),it.length>1&&(0,w.jsxs)(ue,{value:V,onValueChange:Ze,children:[(0,w.jsx)(d,{className:`h-8 w-auto min-w-[140px] text-sm`,children:(0,w.jsx)(c,{placeholder:`Object`})}),(0,w.jsxs)(v,{children:[(0,w.jsx)(s,{value:`all`,children:`All objects`}),it.map(e=>(0,w.jsx)(s,{value:e,children:e},e))]})]}),(z||B!==`all`||V!==`all`)&&(0,w.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[Y.length,` of `,S.length]})]}),n===`pending`&&H.size>0&&(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 rounded-md border bg-accent/30 text-sm`,children:[(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`strong`,{children:H.size}),` selected`,X.length!==H.size&&(0,w.jsxs)(`span`,{className:`text-muted-foreground ml-1`,children:[`(`,X.length,` actionable)`]})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(p,{size:`sm`,onClick:()=>$(`approve`),disabled:W||X.length===0,children:[(0,w.jsx)(ye,{className:`h-3.5 w-3.5 mr-1`}),`Approve `,X.length||``]}),(0,w.jsxs)(fe,{children:[(0,w.jsx)(Ee,{asChild:!0,children:(0,w.jsxs)(p,{size:`sm`,variant:`outline`,disabled:W||X.length===0,className:`border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground`,children:[(0,w.jsx)(g,{className:`h-3.5 w-3.5 mr-1`}),`Reject `,X.length||``]})}),(0,w.jsxs)(pe,{children:[(0,w.jsxs)(he,{children:[(0,w.jsxs)(ve,{children:[`Reject `,X.length,` requests?`]}),(0,w.jsx)(Se,{children:`This will reject the selected requests and notify their submitters.`})]}),(0,w.jsxs)(_,{children:[(0,w.jsx)(Ae,{children:`Cancel`}),(0,w.jsxs)(Te,{onClick:()=>$(`reject`),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:[`Reject `,X.length]})]})]})]}),(0,w.jsx)(p,{size:`sm`,variant:`ghost`,onClick:()=>U(new Set),disabled:W,children:`Clear`})]})]}),k?(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(o,{className:`h-10 w-full`}),(0,w.jsx)(o,{className:`h-10 w-full`}),(0,w.jsx)(o,{className:`h-10 w-full`})]}):S.length===0?(0,w.jsx)(`div`,{className:`flex items-center justify-center min-h-[240px] rounded-md border border-dashed`,children:(0,w.jsxs)(ee,{children:[(0,w.jsx)(Re,{children:`No requests`}),(0,w.jsx)(re,{children:n===`pending`?`You have no pending approvals.`:`Nothing here yet.`})]})}):Y.length===0?(0,w.jsx)(`div`,{className:`flex items-center justify-center min-h-[160px] rounded-md border border-dashed text-sm text-muted-foreground`,children:`No matches for current filters.`}):(0,w.jsx)(ae,{children:(0,w.jsx)(De,{className:`p-0`,children:(0,w.jsxs)(ke,{children:[(0,w.jsx)(je,{children:(0,w.jsxs)(me,{children:[n===`pending`&&(0,w.jsx)(h,{className:`w-10`,children:(0,w.jsx)(ne,{checked:Q,onCheckedChange:at,"aria-label":`Select all`,disabled:Z.length===0})}),(0,w.jsx)(h,{children:`Process`}),(0,w.jsx)(h,{children:`Object`}),(0,w.jsx)(h,{children:`Record`}),(0,w.jsx)(h,{children:`Step`}),(0,w.jsx)(h,{children:`Status`}),(0,w.jsx)(h,{children:`Approvers`}),(0,w.jsx)(h,{children:`Submitted`})]})}),(0,w.jsx)(xe,{children:Y.map(e=>(0,w.jsxs)(me,{className:`cursor-pointer hover:bg-accent/50`,onClick:()=>$e(e.id),children:[n===`pending`&&(0,w.jsx)(f,{className:`w-10`,onClick:e=>e.stopPropagation(),children:(0,w.jsx)(ne,{checked:H.has(e.id),onCheckedChange:()=>ot(e.id),disabled:e.status!==`pending`,"aria-label":`Select request ${e.id}`})}),(0,w.jsx)(f,{className:`font-medium`,children:e.process_name}),(0,w.jsx)(f,{children:e.object_name}),(0,w.jsx)(f,{className:`font-mono text-xs`,title:e.record_id,children:O(e.record_id)}),(0,w.jsx)(f,{children:e.current_step?(0,w.jsxs)(`span`,{className:`text-xs`,children:[e.current_step,typeof e.current_step_index==`number`&&(0,w.jsxs)(`span`,{className:`text-muted-foreground`,children:[` (#`,e.current_step_index,`)`]})]}):`—`}),(0,w.jsx)(f,{children:(0,w.jsx)(E,{status:e.status})}),(0,w.jsx)(f,{className:`max-w-[220px] truncate text-xs text-muted-foreground`,title:(e.pending_approvers||[]).join(`, `),children:(e.pending_approvers||[]).map(O).join(`, `)||`—`}),(0,w.jsxs)(f,{className:`text-xs whitespace-nowrap text-muted-foreground`,title:D(e.submitted_at),children:[(0,w.jsx)(we,{className:`h-3 w-3 inline mr-1`}),Be(e.submitted_at)]})]},e.id))})]})})})]})]}),(0,w.jsx)(oe,{open:!!Ue,onOpenChange:e=>!e&&et(),children:(0,w.jsxs)(se,{className:`w-full sm:max-w-xl overflow-y-auto`,children:[(0,w.jsxs)(te,{children:[(0,w.jsx)(ie,{children:`Approval Request`}),(0,w.jsx)(ce,{children:j?`${j.process_name} · ${j.object_name}/${j.record_id}`:``})]}),Ke?(0,w.jsxs)(`div`,{className:`space-y-2 mt-6`,children:[(0,w.jsx)(o,{className:`h-6 w-3/4`}),(0,w.jsx)(o,{className:`h-6 w-1/2`}),(0,w.jsx)(o,{className:`h-20 w-full`})]}):j?(0,w.jsxs)(`div`,{className:`space-y-4 mt-6`,children:[(0,w.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-sm`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Status`}),(0,w.jsx)(E,{status:j.status})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Current Step`}),j.current_step||`—`]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Step Index`}),j.current_step_index??`—`]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Submitter`}),(0,w.jsx)(`span`,{className:`font-mono text-xs`,title:j.submitter_id||``,children:O(j.submitter_id)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Submitted`}),D(j.submitted_at)]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Completed`}),D(j.completed_at)]}),(0,w.jsxs)(`div`,{className:`col-span-2`,children:[(0,w.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Pending Approvers`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:(j.pending_approvers||[]).length===0?`—`:(j.pending_approvers||[]).map((e,t)=>(0,w.jsx)(u,{variant:`outline`,className:`font-mono text-[10px]`,title:e,children:O(e)},t))})]}),j.payload&&(0,w.jsxs)(`div`,{className:`col-span-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Payload`}),(0,w.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify(j.payload,null,2)),y.success(`Payload copied`)}catch{y.error(`Copy failed`)}},className:`text-[10px] text-muted-foreground hover:text-foreground inline-flex items-center gap-1`,children:[(0,w.jsx)(Me,{className:`h-3 w-3`}),`Copy`]})]}),(0,w.jsx)(`pre`,{className:`text-[11px] bg-muted/50 rounded p-2 overflow-auto max-h-32 mt-1`,children:JSON.stringify(j.payload,null,2)})]})]}),(0,w.jsx)(l,{}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{className:`text-sm font-semibold mb-3`,children:`Action History`}),Ge.length===0?(0,w.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No actions yet.`}):(0,w.jsx)(`ol`,{className:`relative space-y-3 pl-5 before:absolute before:left-[7px] before:top-1 before:bottom-1 before:w-px before:bg-border`,children:Ge.map(e=>(0,w.jsxs)(`li`,{className:`relative text-xs`,children:[(0,w.jsx)(`span`,{className:`absolute -left-[18px] top-1 h-3 w-3 rounded-full ring-2 ring-background ${e.action===`approve`?`bg-emerald-500`:e.action===`reject`?`bg-destructive`:e.action===`submit`?`bg-blue-500`:(e.action,`bg-muted-foreground`)}`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`flex items-baseline gap-1.5 flex-wrap`,children:[(0,w.jsx)(`span`,{className:`font-medium capitalize`,children:e.action}),(0,w.jsx)(`span`,{className:`text-muted-foreground`,children:`by`}),(0,w.jsx)(`span`,{className:`font-mono`,title:e.actor_id||``,children:O(e.actor_id)}),e.step_name&&(0,w.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,e.step_name,` (#`,e.step_index,`)`]}),(0,w.jsx)(`span`,{className:`ml-auto text-muted-foreground text-[10px]`,title:D(e.created_at),children:Be(e.created_at)})]}),e.comment&&(0,w.jsxs)(`div`,{className:`text-muted-foreground italic mt-0.5`,children:[`"`,e.comment,`"`]})]},e.id))})]}),j.status===`pending`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(l,{}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`details`,{className:`group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground hover:text-foreground select-none`,children:`Override actor (advanced)`}),(0,w.jsxs)(`div`,{className:`mt-2`,children:[(0,w.jsx)(be,{htmlFor:`actor-override`,className:`text-xs`,children:`Actor`}),(0,w.jsx)(`input`,{id:`actor-override`,type:`text`,value:I,onChange:e=>L(e.target.value),placeholder:`Auto: ${K(j)||`(none)`}`,className:`w-full mt-1 px-3 py-2 text-sm border rounded-md bg-background`}),(0,w.jsxs)(`div`,{className:`text-[10px] text-muted-foreground mt-1`,children:[`e.g. `,(0,w.jsx)(`code`,{children:`role:sales_manager`}),`. Leave blank to use auto-detected.`]})]})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(be,{htmlFor:`comment`,className:`text-xs`,children:`Comment (optional)`}),(0,w.jsx)(le,{id:`comment`,value:P,onChange:e=>F(e.target.value),rows:2,className:`mt-1`})]}),(0,w.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[(0,w.jsxs)(p,{size:`sm`,onClick:()=>q(`approve`),disabled:!J||R!==null,children:[(0,w.jsx)(ye,{className:`h-4 w-4 mr-1`}),R===`approve`?`Approving…`:`Approve`]}),(0,w.jsxs)(fe,{children:[(0,w.jsx)(Ee,{asChild:!0,children:(0,w.jsxs)(p,{size:`sm`,variant:`outline`,disabled:!J||R!==null,className:`border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground`,children:[(0,w.jsx)(g,{className:`h-4 w-4 mr-1`}),R===`reject`?`Rejecting…`:`Reject`]})}),(0,w.jsxs)(pe,{children:[(0,w.jsxs)(he,{children:[(0,w.jsx)(ve,{children:`Reject this request?`}),(0,w.jsxs)(Se,{children:[`This will mark the request as rejected and notify the submitter.`,j.current_step_index!=null&&j.current_step_index>0?` If the process is multi-step, it returns to the previous step.`:``]})]}),(0,w.jsxs)(_,{children:[(0,w.jsx)(Ae,{children:`Cancel`}),(0,w.jsx)(Te,{onClick:()=>q(`reject`),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Reject`})]})]})]}),(0,w.jsxs)(p,{size:`sm`,variant:`outline`,onClick:()=>q(`recall`),disabled:!tt||R!==null,children:[(0,w.jsx)(a,{className:`h-4 w-4 mr-1`}),R===`recall`?`Recalling…`:`Recall`]})]}),!J&&!tt&&(0,w.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`You are not in the pending approvers list and did not submit this request. Use the override above to act as another identity (e.g. `,(0,w.jsx)(`code`,{children:`role:sales_manager`}),`).`]})]})]})]}):null]})})]})}export{k as ApprovalsInboxPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";import{At as r,Bt as i,F as a,Ft as ee,Ht as te,I as o,It as ne,Kn as s,Lt as c,Mt as l,Nt as re,Pt as u,Qn as d,Rt as ie,Vt as ae,at as f,ct as p,di as oe,en as m,in as h,it as se,mr as g,nr as _,ot as v,qn as y,rr as b,rt as ce,st as le,ui as ue,vo as x,xr as S,yi as C,z as w,zt as T}from"./ui-components-DYQ4Pai7.js";var E=e(t(),1),D=n(),de=`${``.replace(/\/$/,``)}/api/v1`,fe=[`create`,`update`,`delete`,`restore`,`login`,`logout`,`permission_change`,`config_change`,`export`,`import`],O={create:`default`,update:`secondary`,delete:`destructive`,restore:`outline`,login:`outline`,logout:`outline`,permission_change:`secondary`,config_change:`secondary`,export:`outline`,import:`outline`},k=50;function A(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function j(e,t=24){return e?e.length>t?`${e.slice(0,t-1)}…`:e:`—`}function M(e){if(!e)return``;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function N(){let[e,t]=(0,E.useState)([]),[n,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(null),[I,L]=(0,E.useState)(`all`),[R,z]=(0,E.useState)(``),[B,V]=(0,E.useState)(``),[H,U]=(0,E.useState)(``),[W,G]=(0,E.useState)(``),[K,q]=(0,E.useState)(0),[J,Y]=(0,E.useState)(!1),[X,Z]=(0,E.useState)(null),Q=(0,E.useCallback)(async()=>{N(!0),F(null);try{let e={};I&&I!==`all`&&(e.action=I),R.trim()&&(e.object_name=R.trim()),B.trim()&&(e.user_id=B.trim()),H&&(e.created_at={...e.created_at||{},$gte:H}),W&&(e.created_at={...e.created_at||{},$lte:`${W}T23:59:59`});let n=new URLSearchParams;Object.keys(e).length>0&&n.set(`$filter`,JSON.stringify(e)),n.set(`$orderby`,`created_at desc`),n.set(`$top`,`51`),n.set(`$skip`,String(K*k));let r=await fetch(`${de}/data/sys_audit_log?${n.toString()}`,{credentials:`include`});if(!r.ok){let e=await r.text().catch(()=>``);throw Error(`HTTP ${r.status}: ${e.slice(0,200)||r.statusText}`)}let i=await r.json(),a=Array.isArray(i)?i:Array.isArray(i?.records)?i.records:Array.isArray(i?.data)?i.data:[];Y(a.length>k),t(a.slice(0,k))}catch(e){console.warn(`[AuditLogPage] load failed:`,e),F(e?.message||`Failed to load audit log`),t([]),Y(!1)}finally{N(!1)}},[I,R,B,H,W,K]);(0,E.useEffect)(()=>{Q()},[Q]);let pe=(0,E.useCallback)(()=>{L(`all`),z(``),V(``),U(``),G(``),q(0)},[]),$=(0,E.useMemo)(()=>{let e=0;return I!==`all`&&(e+=1),R.trim()&&(e+=1),B.trim()&&(e+=1),H&&(e+=1),W&&(e+=1),e},[I,R,B,H,W]);return(0,D.jsxs)(`div`,{className:`p-6 space-y-4 max-w-screen-2xl mx-auto`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(oe,{className:`h-6 w-6 text-muted-foreground`}),(0,D.jsxs)(`div`,{className:`flex-1`,children:[(0,D.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Audit Log`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Read-only system activity and record changes. Newest first.`})]}),(0,D.jsxs)(g,{variant:`outline`,size:`sm`,onClick:Q,disabled:n,children:[(0,D.jsx)(C,{className:`h-4 w-4 mr-1 ${n?`animate-spin`:``}`}),`Refresh`]})]}),(0,D.jsx)(s,{children:(0,D.jsxs)(y,{className:`p-4 grid grid-cols-1 md:grid-cols-5 gap-3`,children:[(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(h,{className:`text-xs`,children:`Action`}),(0,D.jsxs)(ie,{value:I,onValueChange:e=>{L(e),q(0)},children:[(0,D.jsx)(ae,{className:`h-9`,children:(0,D.jsx)(te,{})}),(0,D.jsxs)(T,{children:[(0,D.jsx)(i,{value:`all`,children:`All actions`}),fe.map(e=>(0,D.jsx)(i,{value:e,children:e},e))]})]})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(h,{className:`text-xs`,children:`Object`}),(0,D.jsx)(m,{placeholder:`e.g. account`,value:R,onChange:e=>{z(e.target.value),q(0)},className:`h-9`})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(h,{className:`text-xs`,children:`Actor (user id)`}),(0,D.jsx)(m,{placeholder:`user id`,value:B,onChange:e=>{V(e.target.value),q(0)},className:`h-9`})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(h,{className:`text-xs`,children:`From`}),(0,D.jsx)(m,{type:`date`,value:H,onChange:e=>{U(e.target.value),q(0)},className:`h-9`})]}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(h,{className:`text-xs`,children:`To`}),(0,D.jsx)(m,{type:`date`,value:W,onChange:e=>{G(e.target.value),q(0)},className:`h-9`})]}),$>0&&(0,D.jsx)(`div`,{className:`md:col-span-5 flex justify-end`,children:(0,D.jsxs)(g,{variant:`ghost`,size:`sm`,onClick:pe,children:[(0,D.jsx)(S,{className:`h-4 w-4 mr-1`}),`Clear filters (`,$,`)`]})})]})}),P&&(0,D.jsxs)(_,{variant:`destructive`,children:[(0,D.jsx)(x,{className:`h-4 w-4`}),(0,D.jsx)(b,{children:P})]}),(0,D.jsx)(s,{children:(0,D.jsx)(y,{className:`p-0`,children:n&&e.length===0?(0,D.jsx)(`div`,{className:`p-6 space-y-2`,children:Array.from({length:6}).map((e,t)=>(0,D.jsx)(r,{className:`h-9 w-full`},t))}):e.length===0?(0,D.jsx)(`div`,{className:`p-12`,children:(0,D.jsxs)(a,{children:[(0,D.jsx)(ue,{className:`h-8 w-8 text-muted-foreground mb-3`}),(0,D.jsx)(w,{children:`No audit entries`}),(0,D.jsx)(o,{children:$>0?`Try clearing filters or widening the date range.`:`Events will appear here once tracked objects are modified.`})]})}):(0,D.jsxs)(ce,{children:[(0,D.jsx)(le,{children:(0,D.jsxs)(p,{children:[(0,D.jsx)(v,{className:`w-[180px]`,children:`Timestamp`}),(0,D.jsx)(v,{className:`w-[130px]`,children:`Action`}),(0,D.jsx)(v,{children:`Object`}),(0,D.jsx)(v,{children:`Record`}),(0,D.jsx)(v,{children:`Actor`}),(0,D.jsx)(v,{className:`w-[130px]`,children:`IP`})]})}),(0,D.jsx)(se,{children:e.map(e=>{let t=O[e.action||``]||`outline`;return(0,D.jsxs)(p,{className:`cursor-pointer`,onClick:()=>Z(e),children:[(0,D.jsx)(f,{className:`font-mono text-xs`,children:A(e.created_at)}),(0,D.jsx)(f,{children:(0,D.jsx)(d,{variant:t,children:e.action||`—`})}),(0,D.jsx)(f,{children:e.object_name||`—`}),(0,D.jsx)(f,{className:`font-mono text-xs`,children:j(e.record_id,18)}),(0,D.jsx)(f,{className:`font-mono text-xs`,children:j(e.user_id,18)}),(0,D.jsx)(f,{className:`font-mono text-xs`,children:e.ip_address||`—`})]},e.id)})})]})})}),(e.length>0||K>0)&&(0,D.jsxs)(`div`,{className:`flex items-center justify-between text-sm text-muted-foreground`,children:[(0,D.jsxs)(`span`,{children:[`Page `,K+1,J?``:` · end`]}),(0,D.jsxs)(`div`,{className:`flex gap-2`,children:[(0,D.jsx)(g,{variant:`outline`,size:`sm`,disabled:K===0||n,onClick:()=>q(e=>Math.max(0,e-1)),children:`Previous`}),(0,D.jsx)(g,{variant:`outline`,size:`sm`,disabled:!J||n,onClick:()=>q(e=>e+1),children:`Next`})]})]}),(0,D.jsx)(l,{open:!!X,onOpenChange:e=>!e&&Z(null),children:(0,D.jsxs)(re,{side:`right`,className:`sm:max-w-2xl w-full overflow-y-auto`,children:[(0,D.jsxs)(ee,{children:[(0,D.jsxs)(ne,{className:`flex items-center gap-2`,children:[(0,D.jsx)(d,{variant:X&&O[X.action||``]||`outline`,children:X?.action||`—`}),X?.object_name||`Audit Event`]}),(0,D.jsx)(u,{children:X?.id?(0,D.jsx)(`span`,{className:`font-mono text-xs`,children:X.id}):null})]}),X&&(0,D.jsxs)(`div`,{className:`mt-6 space-y-5`,children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-sm`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Timestamp`}),(0,D.jsx)(`div`,{className:`font-mono`,children:A(X.created_at)})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`IP Address`}),(0,D.jsx)(`div`,{className:`font-mono`,children:X.ip_address||`—`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Actor (user_id)`}),(0,D.jsx)(`div`,{className:`font-mono break-all`,children:X.user_id||`—`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Tenant`}),(0,D.jsx)(`div`,{className:`font-mono break-all`,children:X.tenant_id||`—`})]}),(0,D.jsxs)(`div`,{className:`col-span-2`,children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Target record`}),(0,D.jsxs)(`div`,{className:`font-mono text-sm break-all`,children:[X.object_name||`—`,` / `,X.record_id||`—`]})]}),X.user_agent&&(0,D.jsxs)(`div`,{className:`col-span-2`,children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`User Agent`}),(0,D.jsx)(`div`,{className:`font-mono text-xs break-all`,children:X.user_agent})]})]}),(X.old_value||X.new_value)&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{}),(0,D.jsxs)(`div`,{className:`space-y-3`,children:[(0,D.jsx)(`div`,{className:`text-sm font-medium`,children:`Change payload`}),X.old_value&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:`Before`}),(0,D.jsx)(`pre`,{className:`rounded-md bg-muted p-3 text-xs font-mono whitespace-pre-wrap max-h-64 overflow-auto`,children:M(X.old_value)})]}),X.new_value&&(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:`After`}),(0,D.jsx)(`pre`,{className:`rounded-md bg-muted p-3 text-xs font-mono whitespace-pre-wrap max-h-64 overflow-auto`,children:M(X.new_value)})]})]})]}),X.metadata&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(c,{}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`text-sm font-medium mb-2`,children:`Metadata`}),(0,D.jsx)(`pre`,{className:`rounded-md bg-muted p-3 text-xs font-mono whitespace-pre-wrap max-h-48 overflow-auto`,children:M(X.metadata)})]})]})]})]})})]})}export{N as AuditLogPage};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-CMxvf4Kt.js";import{d as e,f as t,g as n,r}from"./vendor-react-CIpZOxG3.js";import{F as i,I as a,z as o}from"./ui-components-DYQ4Pai7.js";import{t as s}from"./index-D7iz-IIn.js";n();var c=r();function l({extraProps:n}={}){let r=e(),[l]=t(),u=r.ns,d=r.name,f=u&&d?`${u}:${d}`:u??``,p=s(f);if(!p)return(0,c.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,c.jsxs)(i,{children:[(0,c.jsx)(o,{children:`Component not registered`}),(0,c.jsxs)(a,{children:[`No component is registered for `,(0,c.jsx)(`code`,{className:`font-mono`,children:f||`(empty)`}),`. Ensure the plugin that provides this surface is installed and has called`,(0,c.jsx)(`code`,{className:`font-mono`,children:` registerAppComponent()`}),`.`]})]})});let m={};for(let[e,t]of l.entries())m[e]=t;let h=p.component;return(0,c.jsx)(h,{...m,...n??{}})}export{l as ComponentNavView,l as default};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";import{Bt as r,Ht as i,Rt as a,Vt as o,mr as s,oi as c,x as l,zt as u}from"./ui-components-DYQ4Pai7.js";import{l as d,r as f,t as p,u as m}from"./plugin-chatbot-DXGXTdLU.js";import{n as h}from"./index-D7iz-IIn.js";var g=e(t(),1),_=n(),v=`/api/v1/ai`;function y(e){if(e)return e.replace(/\/$/,``);let t={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_SENTRY_DSN:`https://1373a588ceb9da150b11e64bf85f583d@o4510356161757184.ingest.us.sentry.io/4511439670673408`,VITE_SENTRY_ENVIRONMENT:`production`,VITE_SENTRY_SEND_DEFAULT_PII:`true`,VITE_SERVER_URL:``,VITE_USE_MOCK_SERVER:`false`},n=t.VITE_AI_BASE_URL;return n?n.replace(/\/$/,``):`${(t.VITE_SERVER_URL??``).replace(/\/$/,``)}${v}`}function b({appLabel:e,objects:t,agents:n,agentsLoading:d,agentsError:h,activeAgent:v,onAgentChange:y,chatApi:b,apiBase:x,defaultOpen:S=!1,conversationId:C,initialMessages:w}){let T=t.map(e=>e.label||e.name).join(`, `),E=g.useMemo(()=>!w||w.length===0?[]:w.map(e=>({id:e.id,role:e.role,content:e.parts.map(e=>e.text).join(``)})),[w]),D=g.useMemo(()=>n.find(e=>e.name===v)?.label??v??e,[n,v,e]),O=v?`Hello! I'm **${D}**, your ${e} assistant. How can I help you today?`:`Hello! I'm your **${e}** assistant. ${h?`(Backend unreachable — running in offline demo mode.)`:``}`,{messages:k,isLoading:A,error:j,sendMessage:M,stop:N,reload:P,clear:F}=m({api:b,conversationId:C,body:{context:{activeApp:e,objects:t.map(e=>({name:e.name,label:e.label})),agentName:v}},initialMessages:E.length>0?E:[{id:`welcome`,role:`assistant`,content:O}],autoResponse:!b,autoResponseText:T?`I can help you work with ${T}. What would you like to do?`:`Thanks for your message! I'm here to help you navigate and manage your data.`,autoResponseDelay:600}),I=p({messages:k,apiBase:x,continueConversation:e=>{M(e)}}),L=n.length>0?(0,_.jsxs)(a,{value:v,onValueChange:y,disabled:d,children:[(0,_.jsx)(o,{className:`h-7 w-[180px] text-xs`,"data-testid":`floating-chatbot-agent-picker`,children:(0,_.jsx)(i,{placeholder:`Choose agent...`})}),(0,_.jsx)(u,{align:`end`,children:n.map(e=>(0,_.jsxs)(r,{value:e.name,className:`text-xs`,children:[(0,_.jsx)(`span`,{className:`font-medium`,children:e.label}),e.description?(0,_.jsx)(`span`,{className:`block text-muted-foreground text-[10px] truncate max-w-[220px]`,children:e.description}):null]},e.name))})]}):null,[R,z]=g.useState(!1),B=g.useMemo(()=>x.replace(/\/v1\/ai$/,``).replace(/\/ai$/,``)||`/api`,[x]),V=C?(0,_.jsx)(s,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":`Share conversation`,"data-testid":`floating-chatbot-share`,onClick:()=>z(!0),children:(0,_.jsx)(c,{className:`h-4 w-4`})}):null;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(f,{floatingConfig:{position:`bottom-right`,defaultOpen:S,panelWidth:420,panelHeight:560,title:`${e} Assistant`,triggerSize:56},headerExtra:L,headerActions:V,messages:k,placeholder:v?`Ask ${D}...`:d?`Loading agents...`:`Ask anything...`,onSendMessage:e=>M(e),onClear:F,onStop:A?N:void 0,onReload:P,isLoading:A,error:j,enableMarkdown:!0,onToolApprove:I.decide,toolDecisions:I.decisions,toolApproveLabel:`Approve & run`,toolDenyLabel:`Reject`,toolDenyReason:`Operator rejected from chat`}),C&&(0,_.jsx)(l,{open:R,onOpenChange:z,objectName:`ai_conversations`,recordId:C,recordLabel:`this conversation`,apiBase:B})]})}function x({appLabel:e,objects:t,apiBase:n,defaultAgent:r,defaultOpen:i=!1,userId:a}){let o=g.useMemo(()=>y(n),[n]),s={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_SENTRY_DSN:`https://1373a588ceb9da150b11e64bf85f583d@o4510356161757184.ingest.us.sentry.io/4511439670673408`,VITE_SENTRY_ENVIRONMENT:`production`,VITE_SENTRY_SEND_DEFAULT_PII:`true`,VITE_SERVER_URL:``,VITE_USE_MOCK_SERVER:`false`}.VITE_AI_DEFAULT_AGENT,{agents:c,isLoading:l,error:u}=d({apiBase:o}),[f,p]=g.useState(void 0);g.useEffect(()=>{if(!f&&c.length>0){let e=r??s;p(((e?c.find(t=>t.name===e):void 0)??c[0]).name)}},[c,f,r,s]);let m=f?`${o}/agents/${encodeURIComponent(f)}/chat`:void 0,{conversationId:v,initialMessages:x}=h({userId:a,scope:f,apiBase:o});return(0,_.jsx)(b,{appLabel:e,objects:t,agents:c,agentsLoading:l,agentsError:u,activeAgent:f,onAgentChange:p,chatApi:m,apiBase:o,defaultOpen:i,conversationId:v,initialMessages:x},`${m??`local`}:${v??`pending`}`)}export{x as default};
@@ -0,0 +1 @@
1
+ import{d as e,r as t,u as n}from"./vendor-react-CIpZOxG3.js";import{Br as r,Cr as i,Jn as a,Kn as o,Xn as s,Yn as c,qn as l,za as u}from"./ui-components-DYQ4Pai7.js";var d=t();function f(){let t=n(),{appName:f}=e(),p=f?`/apps/${f}`:``,m=[{title:`API Console`,description:`Inspect and exercise REST endpoints with auto-discovered services`,icon:r,href:`${p}/developer/api-console`},{title:`Flow Runs`,description:`Trigger flows with sample inputs and inspect recent run history`,icon:i,href:`${p}/developer/flow-runs`},{title:`Public Forms`,description:`Publish, share, and embed FormViews available to anonymous users`,icon:u,href:`${p}/developer/public-forms`}];return(0,d.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`Developer`}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Tools for building, debugging, and sharing ObjectStack apps`})]}),(0,d.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:m.map(e=>{let n=e.icon;return(0,d.jsxs)(o,{className:`cursor-pointer transition-colors hover:bg-accent/50`,onClick:()=>t(e.href),"data-testid":`hub-card-${e.title.toLowerCase().replace(/\s+/g,`-`)}`,role:`link`,tabIndex:0,"aria-label":`${e.title}: ${e.description}`,onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),t(e.href))},children:[(0,d.jsxs)(c,{className:`flex flex-row items-center gap-3 pb-2`,children:[(0,d.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,d.jsx)(n,{className:`h-5 w-5`})}),(0,d.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,d.jsx)(s,{className:`text-base`,children:e.title}),(0,d.jsx)(a,{className:`text-xs`,children:e.description})]})]}),(0,d.jsx)(l,{className:`pt-0`})]},e.title)})})]})}export{f as DeveloperHubPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";import{x as r}from"./framework-ClI3DbWX.js";import{At as i,Cr as a,Di as o,Ft as s,It as c,Jn as l,Kn as u,Mt as d,Nt as f,Pt as p,Q as m,Qn as h,Ut as g,Xn as _,Yn as v,at as y,ct as b,en as x,go as S,ia as C,in as w,it as T,lt as E,mr as D,oo as O,ot as k,qn as A,rt as j,st as M,uo as N,vo as P,yi as F}from"./ui-components-DYQ4Pai7.js";import"./index-D7iz-IIn.js";var I=e(t(),1),L=n();function R({status:e}){let t={success:{icon:S,cls:`text-emerald-600 border-emerald-300`},completed:{icon:S,cls:`text-emerald-600 border-emerald-300`},failed:{icon:N,cls:`text-red-600 border-red-300`},error:{icon:N,cls:`text-red-600 border-red-300`},running:{icon:C,cls:`text-blue-600 border-blue-300 animate-pulse`},pending:{icon:O,cls:`text-amber-600 border-amber-300`},skipped:{icon:P,cls:`text-muted-foreground`}}[e]??{icon:P,cls:`text-muted-foreground`},n=t.icon;return(0,L.jsxs)(h,{variant:`outline`,className:`text-[10px] font-mono inline-flex items-center gap-1 ${t.cls}`,children:[(0,L.jsx)(n,{className:`h-3 w-3`}),e]})}function z(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function B(e,t){switch(t){case`number`:{if(e===``)return;let t=Number(e);return Number.isNaN(t)?e:t}case`boolean`:return e===`true`;case`object`:case`list`:case`array`:if(e.trim()===``)return;try{return JSON.parse(e)}catch{return e}default:return e}}function V({data:e}){return(0,L.jsx)(`pre`,{className:`rounded border bg-muted/30 p-2 text-xs font-mono overflow-auto whitespace-pre-wrap break-all max-h-96`,children:JSON.stringify(e,null,2)})}function H(){let e=r()?.getClient?.(),[t,n]=(0,I.useState)([]),[o,s]=(0,I.useState)(!0),[c,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(``),[m,h]=(0,I.useState)(0),g=(0,I.useCallback)(async()=>{if(!e?.meta?.getItems){d(`meta.getItems is not available on this client`),s(!1);return}s(!0),d(null);try{let t=await e.meta.getItems(`flow`),r=(Array.isArray(t)?t:Array.isArray(t?.items)?t.items:Array.isArray(t?.value)?t.value:[]).map(e=>({name:e?.spec?.name??e?.name,label:e?.spec?.label,spec:e?.spec??e,updatedAt:e?.updatedAt??e?.updated_at})).filter(e=>e.name);n(r),!f&&r.length>0&&p(r[0].name)}catch(e){d(e?.message??String(e))}finally{s(!1)}},[e,f]);(0,I.useEffect)(()=>{g()},[g]);let y=(0,I.useMemo)(()=>t.find(e=>e.name===f)??null,[t,f]);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,L.jsx)(a,{className:`h-5 w-5`}),`Flow Runs`]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Pick a flow, trigger a test run with sample inputs, and inspect recent run history`})]}),(0,L.jsxs)(u,{children:[(0,L.jsx)(v,{className:`pb-3`,children:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(_,{className:`text-base`,children:`Flow`}),(0,L.jsx)(l,{children:`Select a flow definition to test`})]}),(0,L.jsxs)(D,{variant:`outline`,size:`sm`,onClick:g,disabled:o,children:[(0,L.jsx)(F,{className:`h-3.5 w-3.5 mr-2 ${o?`animate-spin`:``}`}),`Refresh`]})]})}),(0,L.jsxs)(A,{children:[o&&(0,L.jsx)(i,{className:`h-9 w-72`}),c&&(0,L.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:c}),!o&&!c&&t.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No flow definitions found.`}),!o&&!c&&t.length>0&&(0,L.jsx)(`select`,{value:f,onChange:e=>p(e.target.value),className:`flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring`,children:t.map(e=>(0,L.jsx)(`option`,{value:e.name,children:e.label?`${e.label} (${e.name})`:e.name},e.name))})]})]}),y&&(0,L.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,L.jsx)(U,{client:e,flow:y.spec,onExecuted:()=>h(e=>e+1)}),(0,L.jsx)(W,{client:e,flowName:y.name,refreshKey:m})]})]})}function U({client:e,flow:t,onExecuted:n}){let r=(0,I.useMemo)(()=>(t?.variables??[]).filter(e=>e?.isInput),[t]),[i,a]=(0,I.useState)({}),[s,c]=(0,I.useState)(!1),[d,f]=(0,I.useState)(null),[p,g]=(0,I.useState)(null);(0,I.useEffect)(()=>{a({}),f(null),g(null)},[t?.name]);let y=(e,t)=>a(n=>({...n,[e]:t}));return(0,L.jsxs)(u,{children:[(0,L.jsxs)(v,{className:`pb-3`,children:[(0,L.jsx)(_,{className:`text-base`,children:`Test Run`}),(0,L.jsx)(l,{children:`Provide input values and invoke the flow`})]}),(0,L.jsxs)(A,{className:`space-y-3`,children:[r.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This flow declares no input variables. Click Run to invoke with no parameters.`}),r.map(e=>(0,L.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,L.jsxs)(w,{htmlFor:`var-${e.name}`,className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-xs`,children:e.name}),(0,L.jsx)(h,{variant:`outline`,className:`text-[10px] font-mono`,children:e.type})]}),e.type===`boolean`?(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(E,{id:`var-${e.name}`,checked:i[e.name]===`true`,onCheckedChange:t=>y(e.name,t?`true`:`false`)}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i[e.name]===`true`?`true`:`false`})]}):e.type===`object`||e.type===`list`||e.type===`array`?(0,L.jsx)(m,{id:`var-${e.name}`,placeholder:`JSON ${e.type}`,value:i[e.name]??``,onChange:t=>y(e.name,t.target.value),className:`font-mono text-xs min-h-[80px]`}):(0,L.jsx)(x,{id:`var-${e.name}`,type:e.type===`number`?`number`:`text`,value:i[e.name]??``,onChange:t=>y(e.name,t.target.value)})]},e.name)),(0,L.jsx)(`div`,{className:`pt-1`,children:(0,L.jsxs)(D,{onClick:async()=>{if(!e?.automation?.execute){g(`automation.execute is not available on this client`);return}c(!0),g(null),f(null);try{let a={};for(let e of r){let t=i[e.name];t!==void 0&&(a[e.name]=B(t,e.type))}f(await e.automation.execute(t.name,{params:a})),n?.()}catch(e){g(e?.message??String(e))}finally{c(!1)}},disabled:s,size:`sm`,children:[s?(0,L.jsx)(C,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,L.jsx)(o,{className:`h-3.5 w-3.5 mr-2`}),s?`Running…`:`Run Flow`]})}),(d||p)&&(0,L.jsxs)(`div`,{className:`pt-2 border-t mt-2 space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[p||d?.success===!1?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(N,{className:`h-4 w-4 text-red-500`}),` Failed`]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(S,{className:`h-4 w-4 text-emerald-500`}),` Result`]}),typeof d?.durationMs==`number`&&(0,L.jsxs)(h,{variant:`secondary`,className:`text-[10px] font-mono`,children:[d.durationMs,` ms`]})]}),p&&(0,L.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:p}),d&&(0,L.jsx)(V,{data:d})]})]})]})}function W({client:e,flowName:t,refreshKey:n}){let[r,a]=(0,I.useState)([]),[o,m]=(0,I.useState)(!0),[x,S]=(0,I.useState)(null),[w,E]=(0,I.useState)(null),[O,N]=(0,I.useState)(null),[P,B]=(0,I.useState)(!1),[H,U]=(0,I.useState)(null),W=(0,I.useCallback)(async()=>{if(!e?.automation?.listRuns){S(`automation.listRuns is not available on this client`),m(!1);return}m(!0),S(null);try{let n=await e.automation.listRuns(t,{limit:20});a(Array.isArray(n)?n:n?.items??n?.runs??[])}catch(e){S(e?.message??String(e))}finally{m(!1)}},[e,t]);(0,I.useEffect)(()=>{W()},[W,n]);let G=async n=>{E(n),N(null),U(null),B(!0);try{let r=await e.automation.getRun(t,n);N(r?.run??r)}catch(e){U(e?.message??String(e))}finally{B(!1)}};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(u,{children:[(0,L.jsx)(v,{className:`pb-3`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(_,{className:`text-base`,children:`Recent Runs`}),(0,L.jsx)(l,{className:`font-mono text-xs`,children:t})]}),(0,L.jsxs)(D,{variant:`outline`,size:`sm`,onClick:W,disabled:o,children:[o?(0,L.jsx)(C,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,L.jsx)(F,{className:`h-3.5 w-3.5 mr-2`}),`Refresh`]})]})}),(0,L.jsxs)(A,{children:[o&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(i,{className:`h-8 w-full`}),(0,L.jsx)(i,{className:`h-8 w-full`}),(0,L.jsx)(i,{className:`h-8 w-full`})]}),!o&&x&&(0,L.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:x}),!o&&!x&&r.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground py-6 text-center`,children:`No runs yet. Use the Test Run panel to invoke this flow.`}),!o&&!x&&r.length>0&&(0,L.jsxs)(j,{children:[(0,L.jsx)(M,{children:(0,L.jsxs)(b,{children:[(0,L.jsx)(k,{children:`Run`}),(0,L.jsx)(k,{children:`Status`}),(0,L.jsx)(k,{children:`Started`}),(0,L.jsx)(k,{className:`text-right`,children:`Duration`})]})}),(0,L.jsx)(T,{children:r.map(e=>(0,L.jsxs)(b,{className:`cursor-pointer`,onClick:()=>G(e.id),children:[(0,L.jsxs)(y,{className:`font-mono text-xs`,children:[e.id.slice(0,12),`…`]}),(0,L.jsx)(y,{children:(0,L.jsx)(R,{status:e.status})}),(0,L.jsx)(y,{className:`text-xs text-muted-foreground`,children:z(e.startedAt)}),(0,L.jsx)(y,{className:`text-right font-mono text-xs`,children:typeof e.durationMs==`number`?`${e.durationMs} ms`:`—`})]},e.id))})]})]})]}),(0,L.jsx)(d,{open:!!w,onOpenChange:e=>{e||(E(null),N(null))},children:(0,L.jsxs)(f,{side:`right`,className:`w-full sm:max-w-2xl p-0 flex flex-col`,children:[(0,L.jsxs)(s,{className:`p-4 border-b`,children:[(0,L.jsxs)(c,{className:`font-mono text-sm break-all`,children:[`Run `,w]}),(0,L.jsx)(p,{children:O&&(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,L.jsx)(R,{status:O.status}),typeof O.durationMs==`number`&&(0,L.jsxs)(h,{variant:`secondary`,className:`text-[10px] font-mono`,children:[O.durationMs,` ms`]}),(0,L.jsx)(`span`,{className:`text-xs`,children:z(O.startedAt)})]})})]}),(0,L.jsxs)(g,{className:`flex-1 p-4`,children:[P&&(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(i,{className:`h-16 w-full`}),(0,L.jsx)(i,{className:`h-16 w-full`}),(0,L.jsx)(i,{className:`h-16 w-full`})]}),H&&(0,L.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:H}),!P&&O&&(0,L.jsx)(`div`,{className:`space-y-3`,children:Array.isArray(O.steps)&&O.steps.length>0?O.steps.map((e,t)=>(0,L.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,L.jsxs)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:[`#`,t+1]}),(0,L.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.nodeLabel||e.nodeId}),e.nodeType&&(0,L.jsx)(h,{variant:`outline`,className:`text-[10px] font-mono`,children:e.nodeType}),(0,L.jsx)(R,{status:e.status}),typeof e.durationMs==`number`&&(0,L.jsxs)(h,{variant:`secondary`,className:`text-[10px] font-mono ml-auto`,children:[e.durationMs,` ms`]})]}),e.input!==void 0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Input`}),(0,L.jsx)(V,{data:e.input})]}),e.output!==void 0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Output`}),(0,L.jsx)(V,{data:e.output})]}),e.error&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase text-red-500 mb-1`,children:`Error`}),(0,L.jsx)(V,{data:e.error})]})]},`${e.nodeId}-${t}`)):(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Run`}),(0,L.jsx)(V,{data:O})]})})]})]})})]})}export{H as FlowRunsPage};
@@ -0,0 +1,11 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";function r(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(e){if(Array.isArray(e))return e}function a(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function s(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){if(e==null)return{};var n,r,i=d(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function f(e,t){return i(e)||o(e,t)||h(e,t)||s()}function p(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function m(e){var t=p(e,`string`);return typeof t==`symbol`?t:t+``}function h(e,t){if(e){if(typeof e==`string`)return r(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function b(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function x(e){return{}.toString.call(e).includes(`Object`)}function S(e){return!Object.keys(e).length}function C(e){return typeof e==`function`}function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function T(e,t){return x(t)||A(`changeType`),Object.keys(t).some(function(t){return!w(e,t)})&&A(`changeField`),t}function E(e){C(e)||A(`selectorType`)}function D(e){C(e)||x(e)||A(`handlerType`),x(e)&&Object.values(e).some(function(e){return!C(e)})&&A(`handlersType`)}function O(e){e||A(`initialIsRequired`),x(e)||A(`initialType`),S(e)&&A(`initialContent`)}function k(e,t){throw Error(e[t]||e.default)}var A=b(k)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),j={changes:T,selector:E,handler:D,initial:O};function ee(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};j.initial(e),j.handler(t);var n={current:e},r=b(P)(n,t),i=b(N)(n),a=b(j.changes)(e),o=b(M)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return j.selector(e),e(n.current)}function c(e){y(r,i,a,o)(e)}return[s,c]}function M(e,t){return C(t)?t(e.current):t}function N(e,t){return e.current=v(v({},e.current),t),t}function P(e,t,n){return C(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var F={create:ee},te={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function ne(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function re(e){return{}.toString.call(e).includes(`Object`)}function ie(e){return e||L(`configIsRequired`),re(e)||L(`configType`),e.urls?(ae(),{paths:{vs:e.urls.monacoBase}}):e}function ae(){console.warn(I.deprecation)}function oe(e,t){throw Error(e[t]||e.default)}var I={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
+ You are using deprecated way of configuration.
4
+
5
+ Instead of using
6
+ monaco.config({ urls: { monacoBase: '...' } })
7
+ use
8
+ monaco.config({ paths: { vs: '...' } })
9
+
10
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
11
+ `},L=ne(oe)(I),se={config:ie},ce=function(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function R(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],R(e[n],t[n]))}),l(l({},e),t)}var le={type:`cancelation`,msg:`operation is manually canceled`};function z(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(le):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var ue=[`monaco`],B=f(F.create({config:te,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),V=B[0],H=B[1];function de(e){var t=se.config(e),n=t.monaco,r=u(t,ue);H(function(e){return{config:R(e.config,r),monaco:n}})}function fe(){var e=V(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(H({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),z(W);if(window.monaco&&window.monaco.editor)return U(window.monaco),e.resolve(window.monaco),z(W);ce(pe,he)(ge)}return z(W)}function pe(e){return document.body.appendChild(e)}function me(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function he(e){var t=V(function(e){return{config:e.config,reject:e.reject}}),n=me(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function ge(){var e=V(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;U(n),e.resolve(n)},function(t){e.reject(t)})}function U(e){V().monaco||H({monaco:e})}function _e(){return V(function(e){return e.monaco})}var W=new Promise(function(e,t){return H({resolve:e,reject:t})}),G={config:de,init:fe,__getMonacoInstance:_e},K=e(t(),1),q={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},ve={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function ye({children:e}){return K.createElement(`div`,{style:ve.container},e)}var be=ye;function xe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return K.createElement(`section`,{style:{...q.wrapper,width:e,height:t},...o},!n&&K.createElement(be,null,r),K.createElement(`div`,{ref:i,style:{...q.fullWidth,...!n&&q.hide},className:a}))}var J=(0,K.memo)(xe);function Se(e){(0,K.useEffect)(e,[])}var Y=Se;function Ce(e,t,n=!0){let r=(0,K.useRef)(!0);(0,K.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var X=Ce;function Z(){}function Q(e,t,n,r){return we(e,r)||Te(e,t,n,r)}function we(e,t){return e.editor.getModel(Ee(e,t))}function Te(e,t,n,r){return e.editor.createModel(t,n,r?Ee(e,r):void 0)}function Ee(e,t){return e.Uri.parse(t)}function De({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:d={},height:f=`100%`,width:p=`100%`,className:m,wrapperProps:h={},beforeMount:g=Z,onMount:_=Z}){let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useRef)(null),C=(0,K.useRef)(null),w=(0,K.useRef)(null),T=(0,K.useRef)(_),E=(0,K.useRef)(g),D=(0,K.useRef)(!1);Y(()=>{let e=G.init();return e.then(e=>(C.current=e)&&x(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>S.current?A():e.cancel()}),X(()=>{if(S.current&&C.current){let t=S.current.getOriginalEditor(),i=Q(C.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],v),X(()=>{if(S.current&&C.current){let e=S.current.getModifiedEditor(),r=Q(C.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}},[o],v),X(()=>{let e=S.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),X(()=>{S.current?.getModel()?.original.setValue(e||``)},[e],v),X(()=>{let{original:e,modified:t}=S.current.getModel();C.current.editor.setModelLanguage(e,r||n||`text`),C.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],v),X(()=>{C.current?.editor.setTheme(l)},[l],v),X(()=>{S.current?.updateOptions(d)},[d],v);let O=(0,K.useCallback)(()=>{if(!C.current)return;E.current(C.current);let s=Q(C.current,e||``,r||n||`text`,a||``),c=Q(C.current,t||``,i||n||`text`,o||``);S.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),k=(0,K.useCallback)(()=>{!D.current&&w.current&&(S.current=C.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...d}),O(),C.current?.editor.setTheme(l),y(!0),D.current=!0)},[d,l,O]);(0,K.useEffect)(()=>{v&&T.current(S.current,C.current)},[v]),(0,K.useEffect)(()=>{!b&&!v&&k()},[b,v,k]);function A(){let e=S.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),S.current?.dispose()}return K.createElement(J,{width:p,height:f,isEditorReady:v,loading:u,_ref:w,className:m,wrapperProps:h})}(0,K.memo)(De);function Oe(e){let t=(0,K.useRef)();return(0,K.useEffect)(()=>{t.current=e},[e]),t.current}var ke=Oe,$=new Map;function Ae({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p=`100%`,height:m=`100%`,className:h,wrapperProps:g={},beforeMount:_=Z,onMount:v=Z,onChange:y,onValidate:b=Z}){let[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!0),T=(0,K.useRef)(null),E=(0,K.useRef)(null),D=(0,K.useRef)(null),O=(0,K.useRef)(v),k=(0,K.useRef)(_),A=(0,K.useRef)(),j=(0,K.useRef)(r),ee=ke(a),M=(0,K.useRef)(!1),N=(0,K.useRef)(!1);Y(()=>{let e=G.init();return e.then(e=>(T.current=e)&&w(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>E.current?F():e.cancel()}),X(()=>{let o=Q(T.current,e||r||``,t||i||``,a||n||``);o!==E.current?.getModel()&&(d&&$.set(ee,E.current?.saveViewState()),E.current?.setModel(o),d&&E.current?.restoreViewState($.get(a)))},[a],x),X(()=>{E.current?.updateOptions(l)},[l],x),X(()=>{!E.current||r===void 0||(E.current.getOption(T.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(N.current=!0,E.current.executeEdits(``,[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),N.current=!1))},[r],x),X(()=>{let e=E.current?.getModel();e&&i&&T.current?.editor.setModelLanguage(e,i)},[i],x),X(()=>{s!==void 0&&E.current?.revealLine(s)},[s],x),X(()=>{T.current?.editor.setTheme(o)},[o],x);let P=(0,K.useCallback)(()=>{if(!(!D.current||!T.current)&&!M.current){k.current(T.current);let c=a||n,f=Q(T.current,r||e||``,t||i||``,c||``);E.current=T.current?.editor.create(D.current,{model:f,automaticLayout:!0,...l},u),d&&E.current.restoreViewState($.get(c)),T.current.editor.setTheme(o),s!==void 0&&E.current.revealLine(s),S(!0),M.current=!0}},[e,t,n,r,i,a,l,u,d,o,s]);(0,K.useEffect)(()=>{x&&O.current(E.current,T.current)},[x]),(0,K.useEffect)(()=>{!C&&!x&&P()},[C,x,P]),j.current=r,(0,K.useEffect)(()=>{x&&y&&(A.current?.dispose(),A.current=E.current?.onDidChangeModelContent(e=>{N.current||y(E.current.getValue(),e)}))},[x,y]),(0,K.useEffect)(()=>{if(x){let e=T.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=T.current.editor.getModelMarkers({resource:t});b?.(e)}});return()=>{e?.dispose()}}return()=>{}},[x,b]);function F(){A.current?.dispose(),f?d&&$.set(a,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}return K.createElement(J,{width:p,height:m,isEditorReady:x,loading:c,_ref:D,className:h,wrapperProps:g})}var je=(0,K.memo)(Ae),Me=n();function Ne({value:e=``,language:t=`javascript`,theme:n=`vs-dark`,height:r=`400px`,onChange:i,readOnly:a=!1,className:o=``}){return(0,Me.jsx)(`div`,{className:o,children:(0,Me.jsx)(je,{height:r,language:t,theme:n,value:e,onChange:i,options:{readOnly:a,minimap:{enabled:!1},fontSize:14,lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0}})})}export{Ne as default};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";import{l as r,o as i}from"./infrastructure-ezj3FgNE.js";import{$n as a,Dr as o,Jn as s,Kn as c,Qn as l,Xn as u,Yn as d,_ as f,ai as p,en as m,er as h,go as g,ia as _,in as v,ir as y,kr as b,mr as x,nr as S,qn as C,ra as w,rr as T,tr as E,vo as D,xr as O}from"./ui-components-DYQ4Pai7.js";var k=e(t(),1),A=n();function j(){let[e,t]=(0,k.useState)(!1);return(0,k.useEffect)(()=>{typeof window>`u`||t(new URLSearchParams(window.location.search).get(`recovery_needed`)===`true`)},[]),{recoveryNeeded:e,clear:()=>{if(typeof window>`u`)return;let e=new URL(window.location.href);e.searchParams.delete(`recovery_needed`),window.history.replaceState({},``,e.toString()),t(!1)}}}function M(){let{user:e,updateUser:t,isLoading:n,changePassword:w,setInitialPassword:M,hasLocalPassword:P}=r(),{upload:F}=f(),[I,L]=(0,k.useState)(e?.name??``),[R,z]=(0,k.useState)(!1),[B,V]=(0,k.useState)(null),H=(0,k.useRef)(null),[U,W]=(0,k.useState)(!1),[G,K]=(0,k.useState)(null),q=(0,k.useRef)(null),{recoveryNeeded:J,clear:Y}=j();return(0,k.useEffect)(()=>{L(e?.name??``)},[e?.name]),(0,k.useEffect)(()=>{if(!J)return;let e=setTimeout(()=>{q.current?.scrollIntoView({behavior:`smooth`,block:`start`})},200);return()=>clearTimeout(e)},[J]),e?(0,A.jsxs)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6 max-w-2xl`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:`Profile`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Manage your account settings`})]}),J&&(0,A.jsxs)(S,{variant:`default`,className:`border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,"data-testid":`profile-recovery-banner`,children:[(0,A.jsx)(p,{className:`h-4 w-4`}),(0,A.jsx)(y,{children:`Set a recovery password`}),(0,A.jsx)(T,{children:`You signed in via single sign-on from the control plane. Set a local password below so you can still sign in to this environment directly if SSO ever becomes unavailable.`})]}),(0,A.jsx)(c,{children:(0,A.jsxs)(C,{className:`pt-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsxs)(a,{className:`h-16 w-16`,children:[(0,A.jsx)(E,{src:e.image??void 0,alt:e.name??`User`}),(0,A.jsx)(h,{className:`text-lg bg-primary text-primary-foreground`,children:i(e)})]}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`p`,{className:`text-lg font-semibold truncate`,children:e.name??`User`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:e.email}),(0,A.jsx)(l,{variant:`secondary`,className:`mt-1`,children:e.role??`member`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2 shrink-0`,children:[(0,A.jsx)(`input`,{ref:H,type:`file`,accept:`image/*`,className:`hidden`,onChange:async e=>{let n=e.target.files?.[0];if(H.current&&(H.current.value=``),n){W(!0),K(null);try{await t({image:(await F(n)).url})}catch(e){K(e instanceof Error?e.message:String(e))}finally{W(!1)}}},"data-testid":`profile-avatar-file`}),(0,A.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,disabled:U,onClick:()=>H.current?.click(),"data-testid":`profile-avatar-upload-btn`,children:[U?(0,A.jsx)(_,{className:`mr-2 h-4 w-4 animate-spin`}):(0,A.jsx)(b,{className:`mr-2 h-4 w-4`}),e.image?`Replace`:`Upload`]}),e.image&&(0,A.jsxs)(x,{type:`button`,variant:`ghost`,size:`sm`,disabled:U,onClick:async()=>{W(!0),K(null);try{await t({image:null})}catch(e){K(e instanceof Error?e.message:String(e))}finally{W(!1)}},"data-testid":`profile-avatar-remove-btn`,children:[(0,A.jsx)(O,{className:`mr-2 h-4 w-4`}),`Remove`]})]})]}),G&&(0,A.jsxs)(S,{variant:`destructive`,className:`mt-4`,children:[(0,A.jsx)(D,{className:`h-4 w-4`}),(0,A.jsx)(T,{children:G})]})]})}),(0,A.jsxs)(c,{children:[(0,A.jsxs)(d,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(o,{className:`h-4 w-4 text-muted-foreground`}),(0,A.jsx)(u,{className:`text-base sm:text-lg`,children:`Personal Information`})]}),(0,A.jsx)(s,{children:`Update your name and view account details`})]}),(0,A.jsx)(C,{children:(0,A.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),V(null),z(!1);try{await t({name:I}),z(!0)}catch(e){V(e instanceof Error?e.message:String(e))}},className:`space-y-4`,children:[B&&(0,A.jsxs)(S,{variant:`destructive`,children:[(0,A.jsx)(D,{className:`h-4 w-4`}),(0,A.jsx)(T,{children:B})]}),R&&(0,A.jsxs)(S,{children:[(0,A.jsx)(g,{className:`h-4 w-4 text-green-600`}),(0,A.jsx)(T,{className:`text-green-800 dark:text-green-400`,children:`Profile updated successfully.`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(v,{htmlFor:`profile-name`,children:`Name`}),(0,A.jsx)(m,{id:`profile-name`,type:`text`,value:I,onChange:e=>L(e.target.value),required:!0,"aria-required":`true`,disabled:n})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(v,{htmlFor:`profile-email`,children:`Email`}),(0,A.jsx)(m,{id:`profile-email`,type:`email`,value:e.email,disabled:!0,className:`bg-muted text-muted-foreground`}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Email cannot be changed.`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(v,{children:`Role`}),(0,A.jsx)(m,{type:`text`,value:e.role??`member`,disabled:!0,className:`bg-muted text-muted-foreground`})]}),(0,A.jsx)(x,{type:`submit`,disabled:n,className:`w-full sm:w-auto`,children:n?`Saving…`:`Save Changes`})]})})]}),(0,A.jsx)(`div`,{ref:q,children:(0,A.jsx)(N,{changePassword:w,setInitialPassword:M,hasLocalPassword:P,highlight:J,onPasswordSet:Y})})]}):null}function N({changePassword:e,setInitialPassword:t,hasLocalPassword:n,highlight:r,onPasswordSet:i}){let[a,o]=(0,k.useState)(null),[l,f]=(0,k.useState)(``),[p,h]=(0,k.useState)(``),[_,y]=(0,k.useState)(``),[b,E]=(0,k.useState)(!1),[O,j]=(0,k.useState)(null),[M,N]=(0,k.useState)(null);(0,k.useEffect)(()=>{let e=!1;return n().then(t=>{e||o(t)}).catch(()=>{e||o(!1)}),()=>{e=!0}},[n]);let P=()=>{f(``),h(``),y(``)},F=async n=>{if(n.preventDefault(),j(null),N(null),p.length<8){j(`Password must be at least 8 characters`);return}if(p!==_){j(`Passwords do not match`);return}E(!0);try{if(a){if(!l){j(`Enter your current password`),E(!1);return}await e(l,p),N(`Password changed.`)}else await t(p),N(`Local password set. You can now sign in with email and password on this environment.`),o(!0),i?.();P()}catch(e){j(e instanceof Error?e.message:String(e))}finally{E(!1)}},I=a===null;return(0,A.jsxs)(c,{className:r?`ring-2 ring-amber-300 dark:ring-amber-700`:void 0,children:[(0,A.jsxs)(d,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(w,{className:`h-4 w-4 text-muted-foreground`}),(0,A.jsx)(u,{className:`text-base sm:text-lg`,children:a?`Change Password`:`Set Local Password`})]}),(0,A.jsx)(s,{children:a?`Update the password you use to sign in to this environment.`:`You signed in via single sign-on. Set a local password to also sign in with email and password on this environment.`})]}),(0,A.jsx)(C,{children:(0,A.jsxs)(`form`,{onSubmit:F,className:`space-y-4 max-w-md`,children:[a&&(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(v,{htmlFor:`current-password`,children:`Current password`}),(0,A.jsx)(m,{id:`current-password`,type:`password`,autoComplete:`current-password`,value:l,onChange:e=>f(e.target.value),disabled:b||I,required:!0})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(v,{htmlFor:`new-password`,children:a?`New password`:`Password`}),(0,A.jsx)(m,{id:`new-password`,type:`password`,autoComplete:`new-password`,value:p,onChange:e=>h(e.target.value),disabled:b||I,minLength:8,required:!0})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(v,{htmlFor:`confirm-password`,children:`Confirm password`}),(0,A.jsx)(m,{id:`confirm-password`,type:`password`,autoComplete:`new-password`,value:_,onChange:e=>y(e.target.value),disabled:b||I,minLength:8,required:!0})]}),O&&(0,A.jsxs)(S,{variant:`destructive`,children:[(0,A.jsx)(D,{className:`h-4 w-4`}),(0,A.jsx)(T,{children:O})]}),M&&(0,A.jsxs)(S,{children:[(0,A.jsx)(g,{className:`h-4 w-4`}),(0,A.jsx)(T,{children:M})]}),(0,A.jsx)(x,{type:`submit`,disabled:b||I,className:`w-full sm:w-auto`,children:b?`Saving…`:a?`Change password`:`Set password`})]})})]})}export{M as ProfilePage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{g as t,r as n}from"./vendor-react-CIpZOxG3.js";import{x as r}from"./framework-ClI3DbWX.js";import{Bn as i,Fn as a,In as o,Jn as ee,Ka as te,Kn as ne,Ln as s,Qn as re,Rn as c,Si as ie,Ti as ae,Xn as oe,Yn as se,ao as ce,at as l,ci as u,ct as d,en as f,in as p,it as le,la as ue,mr as m,ot as h,qn as de,rt as fe,st as pe,to as me,yi as he,zn as g}from"./ui-components-DYQ4Pai7.js";import{o as _}from"./vendor-ui-utils-D3GsyZyi.js";import"./index-D7iz-IIn.js";var v=e(t(),1),y=n();function b(e){return e?e.replace(/^\/+/,``).match(/^forms\/([^/?#]+)/i)?.[1]??null:null}function x(e){return e.trim().toLowerCase().replace(/[^a-z0-9-_]+/g,`-`).replace(/^-+|-+$/g,``)}function S(){let e=r()?.getClient?.(),[t,n]=(0,v.useState)([]),[S,ge]=(0,v.useState)([]),[C,w]=(0,v.useState)(!0),[T,E]=(0,v.useState)(null),[_e,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(``),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(!1),[I,L]=(0,v.useState)(null),[R,z]=(0,v.useState)(``),[B,V]=(0,v.useState)(`thank-you`),[H,U]=(0,v.useState)(``),[W,G]=(0,v.useState)(``),[K,q]=(0,v.useState)(``),[J,Y]=(0,v.useState)(!1),X=async()=>{if(!e?.meta?.getItems){E(`meta.getItems is not available on this client`),w(!1);return}w(!0),E(null);try{let t=await e.meta.getItems(`view`),r=Array.isArray(t)?t:Array.isArray(t?.items)?t.items:Array.isArray(t?.value)?t.value:[],i=[],a=[];for(let e of r){let t=e?.spec??e;if(!(t?.sections||t?.groups||t?.form||t?.type===`simple`||t?.type===`tabbed`||t?.type===`wizard`||t?.viewType===`form`))continue;let n=t?.sharing,r=n?.publicLink,o=b(r);n?.allowAnonymous&&o&&r?i.push({name:t?.name??e?.name,label:t?.label,object:t?.object,slug:o,publicLink:r,updatedAt:e?.updatedAt??e?.updated_at,spec:t}):a.push({name:t?.name??e?.name,label:t?.label,object:t?.object,spec:t})}n(i),ge(a)}catch(e){E(e?.message??String(e))}finally{w(!1)}};(0,v.useEffect)(()=>{X()},[]);let ve=typeof window<`u`?window.location.origin:``,Z=e=>`${ve}/console/f/${e}`,ye=e=>`<iframe src="${Z(e)}" width="100%" height="640" frameborder="0" style="border:0;"></iframe>`,be=e=>`<iframe\n src={\`${Z(e)}\`}\n title="Public form"\n style={{ width: '100%', height: 640, border: 0 }}\n/>`,Q=async(e,t)=>{try{await navigator.clipboard.writeText(t),_.success(`Copied ${e}`)}catch{_.error(`Clipboard unavailable`)}},xe=async()=>{if(!O||!A)return;let t=S.find(e=>e.name===O);if(!t)return;let n=x(A);if(!n){_.error(`Invalid slug`);return}let r={...t.spec,sharing:{...t.spec.sharing??{},enabled:!0,allowAnonymous:!0,publicLink:`/forms/${n}`}};N(!0);try{await e.meta.saveItem(`view`,t.name,r),_.success(`Published ${t.name}`),D(!1),k(``),j(``),await X()}catch(e){_.error(`Publish failed: ${e?.message??e}`)}finally{N(!1)}},Se=e=>{L(e),z(e.slug);let t=e.spec?.submitBehavior;V(t?.kind??`thank-you`),U(t?.title??``),G(t?.message??``),q(t?.url??``),F(!0)},Ce=async()=>{if(!I)return;let t=x(R);if(!t){_.error(`Invalid slug`);return}let n;switch(B){case`thank-you`:n={kind:`thank-you`},H&&(n.title=H),W&&(n.message=W);break;case`redirect`:if(!K){_.error(`Redirect URL is required`);return}n={kind:`redirect`,url:K};break;case`continue`:case`next-record`:n={kind:B};break}let r={...I.spec,sharing:{...I.spec.sharing??{},enabled:!0,allowAnonymous:!0,publicLink:`/forms/${t}`},submitBehavior:n};Y(!0);try{await e.meta.saveItem(`view`,I.name,r),_.success(`Saved ${I.name}`),F(!1),L(null),await X()}catch(e){_.error(`Save failed: ${e?.message??e}`)}finally{Y(!1)}},$=t.length>0;return(0,y.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4 p-4 md:p-6 overflow-auto`,children:[(0,y.jsxs)(ne,{children:[(0,y.jsxs)(se,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(oe,{className:`flex items-center gap-2`,children:[(0,y.jsx)(ie,{className:`h-4 w-4`}),`Public Forms`]}),(0,y.jsx)(ee,{children:`Forms anyone can fill out — no login required. Publish a form to get a shareable link; submissions land directly in the bound object.`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsxs)(m,{variant:`default`,size:`sm`,onClick:()=>D(!0),disabled:S.length===0,title:S.length===0?`No non-public FormViews available`:`Publish a FormView`,children:[(0,y.jsx)(ae,{className:`h-3.5 w-3.5`}),(0,y.jsx)(`span`,{className:`ml-1.5`,children:`Publish form…`})]}),(0,y.jsxs)(m,{variant:`outline`,size:`sm`,onClick:X,disabled:C,children:[(0,y.jsx)(he,{className:`h-3.5 w-3.5 ${C?`animate-spin`:``}`}),(0,y.jsx)(`span`,{className:`ml-1.5`,children:`Refresh`})]})]})]}),(0,y.jsxs)(de,{children:[T&&(0,y.jsx)(`div`,{className:`mb-3 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:T}),!C&&!$&&(0,y.jsxs)(`div`,{className:`rounded-md border border-dashed p-6 text-center text-sm text-muted-foreground`,children:[(0,y.jsx)(`p`,{className:`font-medium text-foreground`,children:`No public forms yet`}),(0,y.jsxs)(`p`,{className:`mt-1`,children:[`Click `,(0,y.jsx)(`strong`,{children:`Publish form…`}),` above to share an existing form, or build a new one in Views & Apps and mark it public.`]})]}),$&&(0,y.jsxs)(fe,{children:[(0,y.jsx)(pe,{children:(0,y.jsxs)(d,{children:[(0,y.jsx)(h,{children:`Name`}),(0,y.jsx)(h,{children:`Object`}),(0,y.jsx)(h,{children:`Slug`}),(0,y.jsx)(h,{children:`Public URL`}),(0,y.jsx)(h,{className:`text-right`,children:`Actions`})]})}),(0,y.jsx)(le,{children:t.map(e=>{let t=Z(e.slug);return(0,y.jsxs)(d,{children:[(0,y.jsx)(l,{children:(0,y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,y.jsx)(`span`,{className:`font-medium`,children:e.label??e.name}),(0,y.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:e.name})]})}),(0,y.jsx)(l,{children:e.object?(0,y.jsx)(re,{variant:`secondary`,children:e.object}):(0,y.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,y.jsx)(l,{children:(0,y.jsx)(`code`,{className:`text-xs`,children:e.slug})}),(0,y.jsx)(l,{children:(0,y.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-primary underline-offset-2 hover:underline`,children:[t,(0,y.jsx)(te,{className:`h-3 w-3`})]})}),(0,y.jsx)(l,{className:`text-right`,children:(0,y.jsxs)(`div`,{className:`inline-flex gap-1`,children:[(0,y.jsx)(m,{variant:`ghost`,size:`sm`,title:`Copy URL`,onClick:()=>Q(`URL`,t),children:(0,y.jsx)(ue,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(m,{variant:`ghost`,size:`sm`,title:`Copy <iframe> embed`,onClick:()=>Q(`iframe snippet`,ye(e.slug)),children:(0,y.jsx)(ce,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(m,{variant:`ghost`,size:`sm`,title:`Copy React snippet`,onClick:()=>Q(`React snippet`,be(e.slug)),children:(0,y.jsx)(me,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(m,{variant:`ghost`,size:`sm`,title:`Edit sharing & post-submit behavior`,onClick:()=>Se(e),children:(0,y.jsx)(u,{className:`h-3.5 w-3.5`})})]})})]},e.name)})})]})]})]}),(0,y.jsx)(a,{open:_e,onOpenChange:D,children:(0,y.jsxs)(o,{className:`sm:max-w-md`,children:[(0,y.jsxs)(g,{children:[(0,y.jsx)(i,{children:`Publish a FormView`}),(0,y.jsxs)(s,{children:[`Pick an existing FormView and turn it into a public form by enabling `,(0,y.jsx)(`code`,{className:`text-xs`,children:`sharing.allowAnonymous`}),` `,`and setting `,(0,y.jsx)(`code`,{className:`text-xs`,children:`publicLink`}),`.`]})]}),(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(p,{htmlFor:`publish-view`,children:`FormView`}),(0,y.jsxs)(`select`,{id:`publish-view`,className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm`,value:O,onChange:e=>k(e.target.value),children:[(0,y.jsx)(`option`,{value:``,children:`— Select a FormView —`}),S.map(e=>(0,y.jsxs)(`option`,{value:e.name,children:[e.label??e.name,` (`,e.name,`) `,e.object?`· ${e.object}`:``]},e.name))]})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(p,{htmlFor:`publish-slug`,children:`URL slug`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`/console/f/`}),(0,y.jsx)(f,{id:`publish-slug`,placeholder:`contact-us`,value:A,onChange:e=>j(e.target.value)})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase letters, digits, dashes and underscores only.`})]})]}),(0,y.jsxs)(c,{children:[(0,y.jsx)(m,{variant:`ghost`,onClick:()=>D(!1),disabled:M,children:`Cancel`}),(0,y.jsx)(m,{onClick:xe,disabled:M||!O||!A,children:M?`Publishing…`:`Publish`})]})]})}),(0,y.jsx)(a,{open:P,onOpenChange:F,children:(0,y.jsxs)(o,{className:`sm:max-w-lg`,children:[(0,y.jsxs)(g,{children:[(0,y.jsx)(i,{children:I?`Edit ${I.label??I.name}`:`Edit form`}),(0,y.jsx)(s,{children:`Configure the public URL and what happens after submit.`})]}),(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(p,{htmlFor:`edit-slug`,children:`URL slug`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`/console/f/`}),(0,y.jsx)(f,{id:`edit-slug`,value:R,onChange:e=>z(e.target.value)})]})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(p,{htmlFor:`edit-behavior`,children:`After submit`}),(0,y.jsxs)(`select`,{id:`edit-behavior`,className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm`,value:B,onChange:e=>V(e.target.value),children:[(0,y.jsx)(`option`,{value:`thank-you`,children:`Show a thank-you panel`}),(0,y.jsx)(`option`,{value:`redirect`,children:`Redirect to a URL`}),(0,y.jsx)(`option`,{value:`continue`,children:`Reset for another response`}),(0,y.jsx)(`option`,{value:`next-record`,children:`Advance to next record (internal queues)`})]})]}),B===`thank-you`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(p,{htmlFor:`edit-tytitle`,children:`Title`}),(0,y.jsx)(f,{id:`edit-tytitle`,placeholder:`Thanks!`,value:H,onChange:e=>U(e.target.value)})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(p,{htmlFor:`edit-tymsg`,children:`Message`}),(0,y.jsx)(f,{id:`edit-tymsg`,placeholder:`Your submission has been received.`,value:W,onChange:e=>G(e.target.value)})]})]}),B===`redirect`&&(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(p,{htmlFor:`edit-url`,children:`Redirect URL`}),(0,y.jsx)(f,{id:`edit-url`,type:`url`,placeholder:`https://example.com/thanks`,value:K,onChange:e=>q(e.target.value)})]})]}),(0,y.jsxs)(c,{children:[(0,y.jsx)(m,{variant:`ghost`,onClick:()=>F(!1),disabled:J,children:`Cancel`}),(0,y.jsx)(m,{onClick:Ce,disabled:J||!R,children:J?`Saving…`:`Save`})]})]})})]})}export{S as PublicFormsPage};