@objectstack/console 17.5.0 → 17.6.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 (271) hide show
  1. package/CHANGELOG.md +378 -0
  2. package/dist/.objectstack-injection.json +2 -2
  3. package/dist/.objectui-sha +1 -1
  4. package/dist/assets/{ActionResultDialog-CLdIyOW6.js → ActionResultDialog-4kHDGnT3.js} +3 -3
  5. package/dist/assets/{AiPendingActionsPage-OKYz66yR.js → AiPendingActionsPage-JjOddm0h.js} +1 -1
  6. package/dist/assets/{ApiConsolePage-CcrKovu8.js → ApiConsolePage-BgS26lbp.js} +1 -1
  7. package/dist/assets/AppDocsIndex-BDoH5ECM.js +1 -0
  8. package/dist/assets/{AppManagementPage-D_xz8cTZ.js → AppManagementPage-CCgKmNTj.js} +1 -1
  9. package/dist/assets/ApprovalsInboxPage-C6S1vk0X.js +1 -0
  10. package/dist/assets/AuditLogPage-v2dKXMuk.js +1 -0
  11. package/dist/assets/BookPage-DwFMcTSN.js +1 -0
  12. package/dist/assets/{ComponentNavView-BxsixSU9.js → ComponentNavView-B5g9c6fx.js} +1 -1
  13. package/dist/assets/{CreateViewDialog-xyKlpLEW.js → CreateViewDialog-D3l-tYHM.js} +1 -1
  14. package/dist/assets/DashboardView-BOcovpPd.js +1 -0
  15. package/dist/assets/DocPage-B6AkH5WI.js +1 -0
  16. package/dist/assets/{DocsIndex-B2zw_HAp.js → DocsIndex-DwW2QsYY.js} +1 -1
  17. package/dist/assets/{DocsLayout-DezZ8x7_.js → DocsLayout-D63StSgd.js} +1 -1
  18. package/dist/assets/DocsSlug-CP9fcabi.js +1 -0
  19. package/dist/assets/ExpressionProvider-CrL6jhVq.js +1 -0
  20. package/dist/assets/{FlowRunsPage-CvY3nJMF.js → FlowRunsPage-CxdaiUyk.js} +1 -1
  21. package/dist/assets/{IntegrationsPage-2leVkVDH.js → IntegrationsPage-DvG0x0Nb.js} +2 -2
  22. package/dist/assets/{InterfaceListPage-BdECC_i3.js → InterfaceListPage-C4wPYohR.js} +1 -1
  23. package/dist/assets/{MarketplaceInstalledPage-EPPHSitW.js → MarketplaceInstalledPage-B7KETQG2.js} +1 -1
  24. package/dist/assets/MarketplacePackagePage-CfgKDpNH.js +4 -0
  25. package/dist/assets/{MarketplacePage-BnQKykgv.js → MarketplacePage-DNEyU5AE.js} +1 -1
  26. package/dist/assets/{MetadataInspector-BWxLkr0O.js → MetadataInspector-EP0I3-Kq.js} +1 -1
  27. package/dist/assets/{ObjectDataPage-BIzp65Mo.js → ObjectDataPage-CykEm9MD.js} +1 -1
  28. package/dist/assets/PageView-C6u86tni.js +1 -0
  29. package/dist/assets/{ProfilePage-D2qGgxPK.js → ProfilePage-C3SjXMzi.js} +1 -1
  30. package/dist/assets/{PublicFormsPage-DlE6tck_.js → PublicFormsPage-D3uCTR-8.js} +1 -1
  31. package/dist/assets/RecordDetailView-DgR_zhP4.js +3 -0
  32. package/dist/assets/RecordFormPage-kiJI-ieF.js +1 -0
  33. package/dist/assets/ReportDefaultInspector-BIinF0EQ.js +1 -0
  34. package/dist/assets/{ReportView-GIdKJdOt.js → ReportView-BREO-ADE.js} +1 -1
  35. package/dist/assets/{RuntimeDraftBar-BbMdi3Kp.js → RuntimeDraftBar-BCWfd2yS.js} +1 -1
  36. package/dist/assets/SchemaForm-C4uMMZ13.js +3 -0
  37. package/dist/assets/SearchResultsPage-C6Hw_Lpn.js +1 -0
  38. package/dist/assets/{SettingsHub-BGKIj-Zq.js → SettingsHub-DP1mrzEN.js} +1 -1
  39. package/dist/assets/SettingsView-u7mc6pcc.js +1 -0
  40. package/dist/assets/{SkeletonDetail-C8fMI-Mu.js → SkeletonDetail-DIwlbHTr.js} +1 -1
  41. package/dist/assets/{af-BfSmLD34.js → af-DPUgkQl0.js} +1 -1
  42. package/dist/assets/ai-DPBykF2N.js +3 -0
  43. package/dist/assets/{app-shell-eager-leaves-CDVclng4.js → app-shell-eager-leaves-Cf2bM6uT.js} +1 -1
  44. package/dist/assets/{ar-B9ttrM75.js → ar-B-6GTIRU.js} +1 -1
  45. package/dist/assets/{ar-DZ-C1rn-cyl.js → ar-DZ-wEl298ti.js} +1 -1
  46. package/dist/assets/{ar-EG-BaDxKP_o.js → ar-EG-YBT90_S0.js} +1 -1
  47. package/dist/assets/{ar-MA-DbxNEcmd.js → ar-MA-3uT-EYh6.js} +1 -1
  48. package/dist/assets/{ar-SA-DeC5LXcX.js → ar-SA-SiQsjhhc.js} +1 -1
  49. package/dist/assets/{ar-TN-C9KpTFJz.js → ar-TN-CfzXjKzS.js} +1 -1
  50. package/dist/assets/{az-cMerDwRO.js → az-BqAfcNza.js} +1 -1
  51. package/dist/assets/{be-ZTSbszQh.js → be-CQgWXa9_.js} +1 -1
  52. package/dist/assets/{be-tarask-BXZEUrgX.js → be-tarask-BmNg0Sir.js} +1 -1
  53. package/dist/assets/{bg-BDogpmn5.js → bg-D3evgRuS.js} +1 -1
  54. package/dist/assets/{bn-Cz04uxmh.js → bn-uItkARwm.js} +1 -1
  55. package/dist/assets/{bs-CpFnCl-j.js → bs-DueReOpO.js} +1 -1
  56. package/dist/assets/{ca-CHC4M52Z.js → ca-Cr3AHktR.js} +1 -1
  57. package/dist/assets/{ckb-Dxw-RNm8.js → ckb-CTi5BET7.js} +1 -1
  58. package/dist/assets/contracts-DieHW666.js +1 -0
  59. package/dist/assets/{createDerive-DvA_JGNq.js → createDerive-CjN1i5vn.js} +1 -1
  60. package/dist/assets/{cs-DsFaJ5Z7.js → cs-43mFX9jr.js} +1 -1
  61. package/dist/assets/{cy-FH4JFDTs.js → cy-BBSkg3F8.js} +1 -1
  62. package/dist/assets/{da-D1pVjaAq.js → da-C5oA5qcs.js} +1 -1
  63. package/dist/assets/data-adapter-Cymvlczj.js +1 -0
  64. package/dist/assets/{de-AT-DUMQCisj.js → de-AT-CApxwJzu.js} +1 -1
  65. package/dist/assets/{de-DKrxSvnP.js → de-CPtbLlAf.js} +1 -1
  66. package/dist/assets/default-inspector-registry-Bs6GBn00.js +1 -0
  67. package/dist/assets/dist-BF-ssUpn.js +14 -0
  68. package/dist/assets/{el-l3-bHySV.js → el-Dto2xBQU.js} +1 -1
  69. package/dist/assets/en-AU-FVwCiDJO.js +1 -0
  70. package/dist/assets/{en-CA-DGH5NF0a.js → en-CA-DKuJPN1U.js} +1 -1
  71. package/dist/assets/en-GB-DQ_y5VbJ.js +1 -0
  72. package/dist/assets/en-IE-DaXOhsZW.js +1 -0
  73. package/dist/assets/en-IN-CnRZnAom.js +1 -0
  74. package/dist/assets/en-NZ-CBZLEToK.js +1 -0
  75. package/dist/assets/en-ZA-BE59v0wZ.js +1 -0
  76. package/dist/assets/{eo-CL6CXHZx.js → eo-BL8JXIWd.js} +1 -1
  77. package/dist/assets/{es-BIJ0rksI.js → es-BnoaNxsu.js} +1 -1
  78. package/dist/assets/{et-BGgMzjm1.js → et-tPYLNenO.js} +1 -1
  79. package/dist/assets/{eu-CqvAoRrX.js → eu-CUBG6bT0.js} +1 -1
  80. package/dist/assets/{fa-IR-DNz3oA1-.js → fa-IR-Rr2d9xSs.js} +1 -1
  81. package/dist/assets/{fi-DNSfKWuW.js → fi-B0NVIZsV.js} +1 -1
  82. package/dist/assets/{formatLong-CHb9WA3O.js → formatLong-1-gt9bpo.js} +1 -1
  83. package/dist/assets/{fr-DYRJCirJ.js → fr-BbhHek8e.js} +1 -1
  84. package/dist/assets/{fr-CA-CotiswPx.js → fr-CA-CBDvLXFg.js} +1 -1
  85. package/dist/assets/{fr-CH-CpiEYWpc.js → fr-CH-WPNmwPn7.js} +1 -1
  86. package/dist/assets/framework-DFR4HNtj.js +35 -0
  87. package/dist/assets/{fy-B69yM3FE.js → fy-DvOBbvEF.js} +1 -1
  88. package/dist/assets/{gd-BAy8AsX6.js → gd-BQPiTPX5.js} +1 -1
  89. package/dist/assets/getIcon-Cfwf-Egt.js +1 -0
  90. package/dist/assets/{gl-soLn_weL.js → gl-BJCXK8uO.js} +1 -1
  91. package/dist/assets/{gu-B19Yo9yC.js → gu-CctPRz3V.js} +1 -1
  92. package/dist/assets/{he-DYTPo33p.js → he-CVFMk6p2.js} +1 -1
  93. package/dist/assets/{hi-D2dIK7Oy.js → hi-Ba30-RwS.js} +1 -1
  94. package/dist/assets/{highlighted-body-OFNGDK62-CExufvVt.js → highlighted-body-OFNGDK62-BQ57IrBV.js} +1 -1
  95. package/dist/assets/{hr-BV-VOPMu.js → hr-BZUqTbZs.js} +1 -1
  96. package/dist/assets/{ht-C7MM4qkS.js → ht-BLe05tPx.js} +1 -1
  97. package/dist/assets/{hu-Rha1m2Ym.js → hu-2CQ_Mkww.js} +1 -1
  98. package/dist/assets/{hy-CiTNgbdV.js → hy-CclcPG4H.js} +1 -1
  99. package/dist/assets/i18n-BnUsCaSC.js +17 -0
  100. package/dist/assets/i18n-locale-ar-92O_xtDZ.js +4 -0
  101. package/dist/assets/i18n-locale-de-T5ic3yH9.js +4 -0
  102. package/dist/assets/i18n-locale-en-rxr7WJYl.js +4 -0
  103. package/dist/assets/i18n-locale-es-D_WOifJ_.js +4 -0
  104. package/dist/assets/i18n-locale-fr-3cvyjMkp.js +4 -0
  105. package/dist/assets/i18n-locale-ja-DXlIkB8I.js +4 -0
  106. package/dist/assets/i18n-locale-ko-DngRpS45.js +4 -0
  107. package/dist/assets/i18n-locale-pt-BkPaFCqZ.js +4 -0
  108. package/dist/assets/i18n-locale-ru-E5wLh-y6.js +4 -0
  109. package/dist/assets/i18n-locale-zh-BL4_Yand.js +4 -0
  110. package/dist/assets/{i18n-runtime-CTgAQF4N.js → i18n-runtime-97_bDVjP.js} +1 -1
  111. package/dist/assets/{id-Cijsfjt-.js → id-6JLB8s-f.js} +1 -1
  112. package/dist/assets/index-Cadlh4t_.css +2 -0
  113. package/dist/assets/index-D98sa5GF.js +20 -0
  114. package/dist/assets/{infrastructure-BHSync5f.js → infrastructure-Cc34lEqb.js} +2 -2
  115. package/dist/assets/integration-CeAF4JFT.js +1 -0
  116. package/dist/assets/{is-xS1WTyeC.js → is-to0CWzm1.js} +1 -1
  117. package/dist/assets/isSameWeek-DBXaA1Gd.js +1 -0
  118. package/dist/assets/{it-CH-l516ZNXj.js → it-CH-DhdfjP5Z.js} +1 -1
  119. package/dist/assets/{it-C2i_c9sd.js → it-ea0B8Ujp.js} +1 -1
  120. package/dist/assets/{ja-D9_ewLny.js → ja-B1bzkgDW.js} +1 -1
  121. package/dist/assets/{ja-Hira-D_6ExgHw.js → ja-Hira-CMrY5hXO.js} +1 -1
  122. package/dist/assets/{ka-BYHGyees.js → ka-DKSXLnXP.js} +1 -1
  123. package/dist/assets/{kk-CbTFtuqb.js → kk-DHwMv8Dn.js} +1 -1
  124. package/dist/assets/{km-Dr2gwhIn.js → km-tpLG1xNr.js} +1 -1
  125. package/dist/assets/{kn-CprH8JD7.js → kn-MLreVnHA.js} +1 -1
  126. package/dist/assets/{ko-CsFS2u5i.js → ko-CI0DBazn.js} +1 -1
  127. package/dist/assets/{lb-CbFKN7Ob.js → lb-CmL572Xe.js} +1 -1
  128. package/dist/assets/{lt-Bq0xkLp0.js → lt-DRtUOLdw.js} +1 -1
  129. package/dist/assets/{lv-Cj6vg6Qo.js → lv-COSHgkOP.js} +1 -1
  130. package/dist/assets/{match-C_jFGO9e.js → match-B-ergJQb.js} +1 -1
  131. package/dist/assets/{match-CiPp9BME.js → match-BQoOW8Cj.js} +1 -1
  132. package/dist/assets/{match-Co4ivumx.js → match-dfBS0YSQ.js} +1 -1
  133. package/dist/assets/mermaid-GHXKKRXX-Bb17TtNP.js +1 -0
  134. package/dist/assets/metadata-admin-CABUxbJl.js +9 -0
  135. package/dist/assets/{mk-MXFM99YL.js → mk-B0IH_YL_.js} +1 -1
  136. package/dist/assets/{mn-D5Q9B6Jt.js → mn-P-QdQ2n3.js} +1 -1
  137. package/dist/assets/{ms-CCzPRldx.js → ms-CtyEOINy.js} +1 -1
  138. package/dist/assets/{mt-mjJpN6xW.js → mt-DfuZ2HRm.js} +1 -1
  139. package/dist/assets/{nb-BIlNqdEb.js → nb-2Hp-5Tnt.js} +1 -1
  140. package/dist/assets/{nl-BE-FwXjQsmV.js → nl-BE-mmxbfNoR.js} +1 -1
  141. package/dist/assets/{nl-D2uBtIxG.js → nl-CZ_nLREz.js} +1 -1
  142. package/dist/assets/{nn-B0loJ7SV.js → nn-ccWhYsNa.js} +1 -1
  143. package/dist/assets/{oc-U7-yH1sO.js → oc-z504BFRV.js} +1 -1
  144. package/dist/assets/{pl-mTy0JYgi.js → pl-DeQ7ASt-.js} +1 -1
  145. package/dist/assets/plugin-calendar-Cn5HaZU8.js +1 -0
  146. package/dist/assets/plugin-charts-B6RcFWbo.js +7 -0
  147. package/dist/assets/plugin-chatbot-Ck47EhDX.js +122 -0
  148. package/dist/assets/plugin-dashboard-DjEx8e5Y.js +6 -0
  149. package/dist/assets/plugin-form-CLDvL0up.js +1 -0
  150. package/dist/assets/plugin-gantt-CrVrxVdi.js +63 -0
  151. package/dist/assets/plugin-grid-D2rmQEW_.js +11 -0
  152. package/dist/assets/plugin-kanban-BUNHFfIC.js +1 -0
  153. package/dist/assets/plugin-map-y-7RQQC5.js +1 -0
  154. package/dist/assets/{plugin-markdown-D1nTQc1T.js → plugin-markdown-BOkHcir_.js} +1 -1
  155. package/dist/assets/plugin-report-mT3jpna0.js +59 -0
  156. package/dist/assets/plugin-timeline-B1EF83D3.js +1 -0
  157. package/dist/assets/plugin-tree-MTHUt3_S.js +1 -0
  158. package/dist/assets/plugin-view-DHJI-ahf.js +1 -0
  159. package/dist/assets/plugins-views-CfkgqD30.js +3 -0
  160. package/dist/assets/{pt-BR-2KtO5Js1.js → pt-BR-D80_lPYF.js} +1 -1
  161. package/dist/assets/{pt-Bet5OOQf.js → pt-CJJ1RmXd.js} +1 -1
  162. package/dist/assets/{ro-37U6sgzi.js → ro-EuFb2TCj.js} +1 -1
  163. package/dist/assets/{ru-CyuAY-5E.js → ru-CMaVQScp.js} +1 -1
  164. package/dist/assets/{runtime-metadata-persistence-afAW-MeD.js → runtime-metadata-persistence-ClOTznqa.js} +1 -1
  165. package/dist/assets/{se-DeJabuC6.js → se-DsfdKLdF.js} +1 -1
  166. package/dist/assets/{sk-DWEpjfkR.js → sk-BNV9omI8.js} +1 -1
  167. package/dist/assets/{sl-4oSvNhIR.js → sl-DJS_nINU.js} +1 -1
  168. package/dist/assets/{sq-BjkBCaXW.js → sq-HEgjcbHe.js} +1 -1
  169. package/dist/assets/{sr-Dxm1DsRS.js → sr-CO0CFu4X.js} +1 -1
  170. package/dist/assets/{sr-Latn-Dawg6oP2.js → sr-Latn-eE1Idzey.js} +1 -1
  171. package/dist/assets/{src-C8NYjdVm.js → src-BU7L2v4J.js} +1 -1
  172. package/dist/assets/src-BUtIBFDA.js +1 -0
  173. package/dist/assets/src-C0eXlKtx.js +16 -0
  174. package/dist/assets/{studioEntry-nXQP3iL0.js → studioEntry-WeMfaSGn.js} +1 -1
  175. package/dist/assets/{submitRedirect-jK-cEIbP.js → submitRedirect-C2lfZSHt.js} +1 -1
  176. package/dist/assets/{sv-CROOGJGz.js → sv-5uTzgQT3.js} +1 -1
  177. package/dist/assets/{ta-BZnTmFI_.js → ta-BzgdkBZG.js} +1 -1
  178. package/dist/assets/{te-BN0v0x5t.js → te-Ct_pl7ZJ.js} +1 -1
  179. package/dist/assets/{th-CBjKhp_U.js → th-DouAlk0-.js} +1 -1
  180. package/dist/assets/{tr-x0Ne4N4H.js → tr-3XNBsI40.js} +1 -1
  181. package/dist/assets/types-zod-DXpXw10W.js +1 -0
  182. package/dist/assets/{ug-sgzNhsKo.js → ug-B9n24h9G.js} +1 -1
  183. package/dist/assets/ui-components-D6cEVg0T.js +37 -0
  184. package/dist/assets/ui-layout-DgVDuPEM.js +1 -0
  185. package/dist/assets/{uk-o_DQ5VHJ.js → uk-DCAenByf.js} +1 -1
  186. package/dist/assets/use-book-data-CwRldFxP.js +1 -0
  187. package/dist/assets/{useActionModal-CSvbHkQ7.js → useActionModal-Blp4rhOk.js} +1 -1
  188. package/dist/assets/useCanAuthorMetadata-BxCMgFRf.js +1 -0
  189. package/dist/assets/useNavSelDeepLink-67Y4qCNO.js +1 -0
  190. package/dist/assets/useNavTargetLabel-BOJncjIb.js +1 -0
  191. package/dist/assets/{useOpenRecordList-B5-qaFUx.js → useOpenRecordList-BrwJFojQ.js} +1 -1
  192. package/dist/assets/{usePackageL10n-CMx66am-.js → usePackageL10n-Ci9uVkRZ.js} +1 -1
  193. package/dist/assets/{useSettingsLabel-Kkr2q0Oo.js → useSettingsLabel-CeMnMWsh.js} +1 -1
  194. package/dist/assets/{uz-Cyrl-DbtkQtz_.js → uz-Cyrl-JSeHEqu-.js} +1 -1
  195. package/dist/assets/{uz-Be41d4jl.js → uz-DT3s9bZS.js} +1 -1
  196. package/dist/assets/vendor-objectstack-DFqu45yM.js +138 -0
  197. package/dist/assets/{vi-84mZmklk.js → vi-D2p-h6bY.js} +1 -1
  198. package/dist/assets/{zh-CN-DD1reegJ.js → zh-CN-DHOKqAit.js} +1 -1
  199. package/dist/assets/{zh-HK-B05u30WI.js → zh-HK-D4iIPY7I.js} +1 -1
  200. package/dist/assets/{zh-TW-Bb-WimPD.js → zh-TW-gORQ_tZh.js} +1 -1
  201. package/dist/chunk-membership.json +100 -90
  202. package/dist/eager-closure.json +110 -110
  203. package/dist/index.html +4 -4
  204. package/dist/sdui.manifest.json +520 -60
  205. package/package.json +1 -1
  206. package/dist/assets/AppDocsIndex-F4zDq2zz.js +0 -1
  207. package/dist/assets/ApprovalsInboxPage-DrEUmaDb.js +0 -1
  208. package/dist/assets/AuditLogPage-CoghqsZb.js +0 -1
  209. package/dist/assets/DashboardView-CGC-_Om8.js +0 -1
  210. package/dist/assets/DocPage-CIZE5kdj.js +0 -1
  211. package/dist/assets/DocsSlug-DXdFdwlS.js +0 -1
  212. package/dist/assets/ExpressionProvider-DZfMwyMs.js +0 -1
  213. package/dist/assets/MarketplacePackagePage-C7NOu2Ir.js +0 -4
  214. package/dist/assets/PageView-CVLgCRSF.js +0 -1
  215. package/dist/assets/RecordDetailView-DQKydU7X.js +0 -3
  216. package/dist/assets/RecordFormPage-BTjwxJIA.js +0 -1
  217. package/dist/assets/ReportDefaultInspector-DdsQAkd7.js +0 -1
  218. package/dist/assets/SchemaForm-C8X1ve4p.js +0 -3
  219. package/dist/assets/SearchResultsPage-Jwhqsdyo.js +0 -1
  220. package/dist/assets/SettingsView-D8SMKdrc.js +0 -1
  221. package/dist/assets/appRoute-DbnWDEa1.js +0 -1
  222. package/dist/assets/data-adapter-DMbe6Njk.js +0 -1
  223. package/dist/assets/default-inspector-registry-CpL3fFhl.js +0 -1
  224. package/dist/assets/dist-BXrEV1ag.js +0 -13
  225. package/dist/assets/en-AU-C6x7mDhH.js +0 -1
  226. package/dist/assets/en-GB-0-nho2eK.js +0 -1
  227. package/dist/assets/en-IE-2fC3BkfV.js +0 -1
  228. package/dist/assets/en-IN-C1QcFhxn.js +0 -1
  229. package/dist/assets/en-NZ-C80ptZT7.js +0 -1
  230. package/dist/assets/en-ZA-ByZDrjeb.js +0 -1
  231. package/dist/assets/framework-DcWkeiND.js +0 -35
  232. package/dist/assets/getIcon-BEVyC4y3.js +0 -1
  233. package/dist/assets/i18n-CEKxYdmD.js +0 -9
  234. package/dist/assets/i18n-locale-ar-DN7sl3GF.js +0 -4
  235. package/dist/assets/i18n-locale-de-C40JErvb.js +0 -4
  236. package/dist/assets/i18n-locale-en-CITPDIHy.js +0 -4
  237. package/dist/assets/i18n-locale-es-C8DdWN6c.js +0 -4
  238. package/dist/assets/i18n-locale-fr-COIdEZZl.js +0 -4
  239. package/dist/assets/i18n-locale-ja-DYF_rU_s.js +0 -4
  240. package/dist/assets/i18n-locale-ko-B-ODYAtX.js +0 -4
  241. package/dist/assets/i18n-locale-pt-CK1SyBIm.js +0 -4
  242. package/dist/assets/i18n-locale-ru-jLzvShMO.js +0 -4
  243. package/dist/assets/i18n-locale-zh-Bf9Gbbvl.js +0 -4
  244. package/dist/assets/index-CLyvpiGc.css +0 -2
  245. package/dist/assets/index-CfnfGw5W.js +0 -20
  246. package/dist/assets/isSameWeek-DWYeNyh8.js +0 -1
  247. package/dist/assets/mermaid-GHXKKRXX-DVLc_uym.js +0 -1
  248. package/dist/assets/metadata-admin-CybaOCdO.js +0 -9
  249. package/dist/assets/nav-selection-Dzm_mA3C.js +0 -1
  250. package/dist/assets/plugin-calendar-CKRBcML7.js +0 -1
  251. package/dist/assets/plugin-charts-DGTJxXCB.js +0 -7
  252. package/dist/assets/plugin-chatbot-DwtwNA-y.js +0 -122
  253. package/dist/assets/plugin-dashboard-C1AYKmGX.js +0 -6
  254. package/dist/assets/plugin-form-CV8ZY04-.js +0 -1
  255. package/dist/assets/plugin-gantt-BRIb2_8G.js +0 -63
  256. package/dist/assets/plugin-grid-C9h7mRVv.js +0 -11
  257. package/dist/assets/plugin-kanban-BcJ0Dhys.js +0 -1
  258. package/dist/assets/plugin-map-D24ZUOUj.js +0 -1
  259. package/dist/assets/plugin-report-BfGintAq.js +0 -59
  260. package/dist/assets/plugin-timeline-CbBRq_qt.js +0 -1
  261. package/dist/assets/plugin-tree-BNX2A5J5.js +0 -1
  262. package/dist/assets/plugin-view-DzWQWYyH.js +0 -1
  263. package/dist/assets/plugins-views-DraK4xz0.js +0 -3
  264. package/dist/assets/src-B8lv0plz.js +0 -18
  265. package/dist/assets/src-DoDvT77T.js +0 -1
  266. package/dist/assets/types-zod-Y2RwUUeJ.js +0 -1
  267. package/dist/assets/ui-components-BTB1NkUW.js +0 -37
  268. package/dist/assets/ui-layout-bZfafwJa.js +0 -1
  269. package/dist/assets/use-book-data-C3eyZJSG.js +0 -1
  270. package/dist/assets/vendor-objectstack-XuWC71M9.js +0 -266
  271. package/dist/assets/vendor-zod-CHLW1iCr.js +0 -64
@@ -1 +0,0 @@
1
- import{Gr as e,Jr as t,Qr as n,Xr as r,Zr as i}from"./ui-components-BTB1NkUW.js";var a={date:i({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:i({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:i({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},o={code:`en-AU`,formatDistance:n,formatLong:a,formatRelative:r,localize:t,match:e,options:{weekStartsOn:1,firstWeekContainsDate:4}};export{o as default,o as enAU};
@@ -1 +0,0 @@
1
- import{Gr as e,Jr as t,Qr as n,Xr as r}from"./ui-components-BTB1NkUW.js";import{t as i}from"./formatLong-CHb9WA3O.js";var a={code:`en-GB`,formatDistance:n,formatLong:i,formatRelative:r,localize:t,match:e,options:{weekStartsOn:1,firstWeekContainsDate:4}};export{a as default,a as enGB};
@@ -1 +0,0 @@
1
- import{Gr as e,Jr as t,Qr as n,Xr as r}from"./ui-components-BTB1NkUW.js";import{t as i}from"./formatLong-CHb9WA3O.js";var a={code:`en-IE`,formatDistance:n,formatLong:i,formatRelative:r,localize:t,match:e,options:{weekStartsOn:1,firstWeekContainsDate:4}};export{a as default,a as enIE};
@@ -1 +0,0 @@
1
- import{Gr as e,Jr as t,Qr as n,Xr as r,Zr as i}from"./ui-components-BTB1NkUW.js";var a={date:i({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM, yyyy`,medium:`d MMM, yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:i({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:i({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},o={code:`en-IN`,formatDistance:n,formatLong:a,formatRelative:r,localize:t,match:e,options:{weekStartsOn:1,firstWeekContainsDate:4}};export{o as default,o as enIN};
@@ -1 +0,0 @@
1
- import{Gr as e,Jr as t,Qr as n,Xr as r,Zr as i}from"./ui-components-BTB1NkUW.js";var a={date:i({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:i({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:i({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},o={code:`en-NZ`,formatDistance:n,formatLong:a,formatRelative:r,localize:t,match:e,options:{weekStartsOn:1,firstWeekContainsDate:4}};export{o as default,o as enNZ};
@@ -1 +0,0 @@
1
- import{Gr as e,Jr as t,Qr as n,Xr as r,Zr as i}from"./ui-components-BTB1NkUW.js";var a={date:i({formats:{full:`EEEE, dd MMMM yyyy`,long:`dd MMMM yyyy`,medium:`dd MMM yyyy`,short:`yyyy/MM/dd`},defaultWidth:`full`}),time:i({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:i({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},o={code:`en-ZA`,formatDistance:n,formatLong:a,formatRelative:r,localize:t,match:e,options:{weekStartsOn:0,firstWeekContainsDate:1}};export{o as default,o as enZA};
@@ -1,35 +0,0 @@
1
- import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n,v as r}from"./vendor-react-BggL7APJ.js";import{Ar as i,Bt as a,Ct as o,Er as s,Et as c,In as l,It as u,Ln as d,Mt as f,Wt as p,_r as m,an as h,ct as g,dn as _,dr as v,dt as y,fn as b,gn as x,in as S,jt as C,ot as w,pr as ee,qt as te,rn as T,ur as ne,yn as re,yr as ie}from"./vendor-objectstack-XuWC71M9.js";import{t as ae}from"./i18n-locale-en-CITPDIHy.js";import{f as oe,o as se,p as ce,w as E}from"./i18n-runtime-CTgAQF4N.js";import{n as le}from"./data-adapter-DMbe6Njk.js";T();function ue(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function D(e){return typeof e!=`string`||e===``}function de(e,t,n){let r=`@objectstack/spec's FILTER_TEXT_CASES declares this shape refused (INVALID_FILTER); the declared comparand for '${t}' is a NON-EMPTY STRING`;return n===``?`filter comparand for field '${e}' on operator '${t}' is the EMPTY STRING. Every value contains the empty substring, so evaluating it is a predicate that constrains nothing. ${r}. Drop the condition instead of sending an empty comparand`:`filter comparand for field '${e}' on operator '${t}' is ${n===null?`null`:typeof n} (${ue(n)}), not a string. Coercing it would answer a query nobody wrote. ${r}. Write the comparand as a string`}var O=class extends Error{code=`INVALID_FILTER`;httpStatus=400;operator;field;constructor(e,t){super(e),this.name=`FilterOperatorError`,this.operator=t?.operator,this.field=t?.field}};function fe(e){return e.operator??e.field??void 0}var pe={$notin:`$nin`,$notcontains:`$notContains`,$startswith:`$startsWith`,$endswith:`$endsWith`};function me(e){return{$eq:`=`,$ne:`!=`,$gt:`>`,$gte:`>=`,$lt:`<`,$lte:`<=`,$in:`in`,$nin:`nin`,$between:`between`,$contains:`contains`,$notContains:`notcontains`,$startsWith:`startswith`,$endsWith:`endswith`,$icontains:`icontains`}[e]||null}var he={$and:`and`,$or:`or`};function ge(e,t,n){if(!Array.isArray(n))throw new O(`[ObjectUI] The '${e}' filter combinator takes an ARRAY of conditions. Received ${typeof n==`object`?`an object`:typeof n}: ${JSON.stringify(n)}. Spec: FilterCondition declares '${e}?: FilterCondition[]' (data/filter.zod.ts).`,{operator:e});if(n.length===0)return t===`and`?void 0:_e(e,n);let r=[],i=!1;for(let a of n){if(typeof a!=`object`||!a||Array.isArray(a))throw new O(`[ObjectUI] Every member of '${e}' must be a filter condition OBJECT. Received ${JSON.stringify(a)}. Spec: FilterCondition declares '${e}?: FilterCondition[]' (data/filter.zod.ts).`,{operator:e});let n=Se(a);if(!Array.isArray(n)){t===`or`&&(i=!0);continue}r.push(n)}if(!i&&r.length!==0)return[t,...r]}function _e(e,t){return[e,`=`,t]}function ve(e){let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}function ye(e){let t,n;try{t=Object.getPrototypeOf(e)?.constructor?.name}catch{t=void 0}if(typeof t!=`string`||t===``)return`an object of an unrecognised type`;try{n=String(e)}catch{n=void 0}return n&&n!==`[object ${t}]`?`a ${t} instance (${n})`:`a ${t} instance`}function be(e,t,n){throw new O(`[ObjectUI] The ${de(e,t,n)}. It is refused here rather than lowered onto the wire (objectui#9001; ported from ValueDataSource's refuseTextComparand, objectui#8748).`,{operator:t,field:e})}function xe(e){throw new O(`[ObjectUI] The filter on field '${e}' is an EMPTY operator map — { ${e}: {} } names the field and no operator. It cannot be lowered: the ObjectQL filter AST has no node for a field with zero operators, and '@objectstack/spec' ruled the shape REJECTED wherever it appears (objectstack#5240, recorded on FilterConditionSchema). It is refused here rather than dropped: beside a key that lowers, the '${e}' condition used to vanish from the filter and silently WIDEN the result set (objectui#10788), and alone it was handed back as the caller's object, which reached the wire as ?${e}=[object Object] on one route and as a filter the server refuses on the other (objectui#9164). Choose an operator — { ${e}: { $eq: ... } }, { ${e}: { $in: [...] } }, { ${e}: { $null: true } } — or remove the key.`,{field:e})}function Se(e){let t=[],n=0,r=0;for(let[i,a]of Object.entries(e)){if(a==null){r+=1;continue}let e=he[i];if(e){let r=ge(i,e,a);r===void 0?n+=1:t.push(r);continue}if(i===`$not`)throw new O(`[ObjectUI] The '\$not' filter combinator cannot be lowered to the ObjectQL filter AST. '@objectstack/spec' declares it on FilterCondition, but the AST this layer emits has no negation keyword (FILTER_ARRAY_LOGIC_KEYWORDS is ['and', 'or']), and rewriting the negation inward is not available either — 'startswith', 'endswith', 'between' and 'icontains' have no negated counterpart in VALID_AST_OPERATORS, so the rewrite would be silently partial. Express the negation with a negated operator instead (\$ne, \$nin, \$notContains); note those follow each operator's own answer for a missing value rather than \$not's NULL-safe rule (objectstack#5146). Value: ${JSON.stringify(a)}.`,{operator:`$not`});if(Array.isArray(a))throw new O(`[ObjectUI] The filter on field '${i}' carries a bare ARRAY as its equality comparand: ${JSON.stringify(a)}. It cannot be lowered: the ObjectQL filter AST has no array-equality node, so the lowered node [${i}, '=', [...]] is refused by @objectstack/driver-sql (400 INVALID_FILTER) and matches no row in the in-memory matchers — it can never select anything. It is deliberately NOT read as membership here: { ${i}: [...] } and { ${i}: { $in: [...] } } are different statements, and guessing the second from the first would silently change which rows a stored view returns (objectui#8530; the same ruling objectui#8514 applied one layer down). Spell membership as { ${i}: { $in: [...] } }, its negation as { ${i}: { $nin: [...] } }, or a range as { ${i}: { $between: [min, max] } }.`,{field:i});if(typeof a==`object`&&!Array.isArray(a)){if(S(a)){t.push([i,`=`,a]);continue}if(!ve(a))throw new O(`[ObjectUI] The filter on field '${i}' carries ${ye(a)} in comparand position. '@objectstack/spec' does not accept it: a comparison value must be ${o} (ACCEPTED_FILTER_COMPARAND_TYPES), so isAcceptedFilterComparand is false for it and normalizeFilterComparandTypes answers 400 INVALID_FILTER — "which no driver can compare". It is not an operator map either: only a plain object can be one, so until objectui#8567 this value was read as ZERO operators and the '${i}' condition was dropped from the filter entirely, silently WIDENING the result set. Spell a text match as { ${i}: { $contains: '...' } } ($startsWith / $endsWith; a pattern itself has no operator here, see the $regex refusal), a membership test as { ${i}: { $in: [...] } }, and a date bound as { ${i}: { $gte: new Date(...) } }.`,{field:i});let e=Object.entries(a);e.length===0&&xe(i);for(let[n,r]of e){if(n===`$regex`)throw new O(`[ObjectUI] The '\$regex' filter operator is not supported. It used to be converted to 'contains', which matches a literal substring rather than a pattern — a different result, not a degraded one. Field: '${i}', Value: ${JSON.stringify(r)}. Use $contains for a case-sensitive substring, $icontains for a case-insensitive one, or $startsWith / $endsWith.`,{operator:`$regex`,field:i});if(n===`$null`){t.push([i,r?`is_null`:`is_not_null`,!0]);continue}if(n===`$exists`){t.push([i,r?`is_not_null`:`is_null`,!0]);continue}let e=me(n);if(e)e===`icontains`&&D(r)&&be(i,n,r),t.push([i,e,r]);else{let e=pe[n];throw e?new O(`[ObjectUI] The '${n}' filter operator is retired. Write '${e}' instead — the canonical spelling '@objectstack/spec' declares in FILTER_OPERATORS (data/filter.zod.ts). The operator itself is unchanged; only the key is renamed. Field: '${i}', Value: ${JSON.stringify(r)}. It used to be accepted here as a lowercase alias while the in-memory matcher refused it, so the same filter selected rows through one data source and none through the other (objectui#8568).`,{operator:n,field:i}):new O(`[ObjectUI] Unknown filter operator '${n}' for field '${i}'. Supported operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $between, $contains, $notContains, $startsWith, $endsWith, $icontains, $null, $exists. If you need exact object matching, use the value directly without an operator.`,{operator:n,field:i})}}}else t.push([i,`=`,a])}if(t.length===0){let t=Object.keys(e).length-r;return n>0&&n===t||r>0&&r===Object.keys(e).length?void 0:e}return t.length===1?t[0]:[`and`,...t]}function Ce(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e.field;return typeof t==`string`&&t!==``}var we=new Set([...ne,...ee]),Te=new Set([`is_empty`,`is_not_empty`,`is_null`,`is_not_null`]),Ee=new Set(v);function De(e){let t=i(e.operator);if(Array.isArray(e.value)&&typeof t==`string`&&Ee.has(t)&&!we.has(t)&&!Te.has(t))throw new O(`[ObjectUI] The stored view rule on field '${e.field}' carries an ARRAY as the comparand of '${t}', which takes a single value: ${JSON.stringify(e.value)}. It cannot be lowered: the ObjectQL filter AST has no array-equality node, so the lowered node [${e.field}, '${t}', [...]] is refused by @objectstack/driver-sql (400 INVALID_FILTER) and matches no row in the in-memory matchers — it can never select anything. It is deliberately NOT rewritten to 'in': that would change what the saved view means, and 'in' is already spellable in the rule itself. Spell membership as { field: '${e.field}', operator: 'in', value: [...] }, its negation as 'not_in', or a range as { operator: 'between', value: [min, max] } — the three operators the spec declares array-valued, which are untouched (objectui#8557; the same ruling objectui#8530 applied to the object arm).`,{operator:t,field:e.field});if(t===`icontains`&&e.value!==void 0&&D(e.value)){let n=typeof e.operator==`string`&&e.operator!==``?e.operator:t,r=`This is a STORED VIEW rule, so it is refused as the filter is BUILT rather than lowered onto the wire: the spelling @objectstack/spec's FILTER_TEXT_CASES uses for this operator is the \$-dialect '\$icontains', which this vocabulary spells '${n}'. Remove the condition from the view, or give it a non-empty string comparand (objectui#9048; the same refusal ValueDataSource and convertFiltersToAST already share).`;throw new O(`[ObjectUI] The ${de(e.field,n,e.value)}. ${r}`,{operator:n,field:e.field})}return e.value===void 0?[e.field,t]:[e.field,t,e.value]}function Oe(e){if(e==null)return;if(Array.isArray(e))return e.length===0?void 0:e.some(Ce)?e.map(e=>Ce(e)?De(e):e):e;if(typeof e!=`object`)return;let t=e;if(Object.keys(t).length!==0)return Se(t)}function ke(e){try{return{ok:!0,node:Oe(e)}}catch(e){if(e instanceof O)return{ok:!1,refusal:e};throw e}}function Ae(...e){let t=e.map(Oe).filter(e=>e!==void 0);if(t.length!==0)return t.length===1?t[0]:[`and`,...t]}var k=e(r(),1);function je(e,t,n){if(!e)return;let r=e=>t.includes(e);if(r(e))return e;let i=`${n}.`;if(!e.includes(`.`)&&r(i+e))return i+e;if(e.startsWith(i)&&r(e.slice(i.length)))return e.slice(i.length)}var Me=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function Ne(e){if(!Me(e)||typeof e.find==`function`)return!1;let t=e.object;return typeof t==`string`&&t.length>0}function Pe(...e){let t={};for(let n of e)if(Array.isArray(n))for(let e of n){if(!Me(e))continue;let n=e.name??e.id;typeof n==`string`&&n&&(t[n]=e)}else if(Me(n))for(let[e,r]of Object.entries(n))Me(r)&&(t[e]=r);return t}function Fe(e,t,n){let r=je(t,Object.keys(e),n);return r===void 0?void 0:e[r]}function Ie(e){return typeof e==`number`&&Number.isInteger(e)&&e>0}function Le(e){if(!e)return;let t=e.pagination;return Me(t)&&typeof t.pageSize==`number`?t.pageSize:typeof e.limit==`number`?e.limit:void 0}function Re(e){let t=Le(e);return Ie(t)?t:void 0}function ze(e){return Ie(e.limit)?e.limit:void 0}function Be(e,t,n){let r=e?.limit;return r==null||Ie(r)?null:`[ObjectUI] ElementDataSource: the ${t?`dataSource binding on ${n} (view "${t}")`:`dataSource binding on ${n}`} declares \`limit: ${String(typeof r==`number`?r:JSON.stringify(r))}\`, which is not a positive integer. A row cap must be a positive integer (the spec declares this binding’s \`limit\` positive), so the binding’s cap was treated as not authored and ignored, exactly as if the binding declared no \`limit\`: the cap comes from the next source that declares a usable one, or else from the consumer’s own default.`}function Ve(e,t,n,r,i=`view`){if(i===`binding`)return Be(r,t,n);if(Ie(r?.limit))return null;let a=Le(e);return a===void 0||Ie(a)?null:`[ObjectUI] ElementDataSource: ${t?`saved view "${t}" on ${n}`:`saved view on ${n}`} declares a row cap of ${String(a)}, which is not a positive integer. A row cap must be a positive integer (the spec declares this binding’s \`limit\` positive, and refuses a zero or negative \`pagination.pageSize\`), so the view’s cap was ignored and no cap was lowered from it — the consuming block uses its own default.`}function He(e){if(!e)return;let t=e.type??e.viewType;return typeof t==`string`&&t?t:void 0}function Ue(e){if(e){if(Array.isArray(e.columns))return e.columns;if(Array.isArray(e.fields))return e.fields}}function We(e,t){let n={object:e.object},r=Ue(t);r!==void 0&&(n.columns=r);let i=t?.filter,a=i!==void 0&&e.filter!==void 0?Ae(i,e.filter):e.filter??i;a!==void 0&&(n.filter=a);let o=e.sort??t?.sort;o!==void 0&&(n.sort=o);let s=ze(e)??Re(t);s!==void 0&&(n.limit=s);let c=He(t);return c!==void 0&&(n.viewType=c),n}function Ge(e,t,n){return`dataSource.view "${t}" was not found on object "${e}". ${n.length?`Known views: ${[...n].sort().join(`, `)}.`:`No saved views are known for this object. It may have none, or they could not be read.`}`}var Ke=`dataSource`,qe={name:Ke,type:`object`,binding:`object`,description:"Per-element data binding: { object, view, filter, sort, limit }. Overrides the page-level object context for this block; `view` names a saved view of `object`, and `filter` is ANDed with the view’s own rather than replacing it."},Je=new WeakSet;function Ye(e){return e&&(typeof e==`object`||typeof e==`function`)&&Je.add(e),e}function Xe(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&Je.has(e)}var Ze=`object-grid.list-view.object-form.embeddable-form.object-master-detail-form.object-kanban.object-calendar.object-gantt.object-timeline.object-map.object-tree.object-metric.object-chart.dashboard.object-pivot.record:details.record:highlights.record:related_list.record:path.record:line_items.record:activity.record:discussion.record:history.record:quick_actions.record:reference_rail.record:alert.page:tabs.page:card.page:accordion.page:section.page:footer.page:sidebar.element:text.element:number.element:button.element:definition-list.element:repeater.action:button.action:group.action:menu.action:icon.flex.grid.stack.card.tabs.accordion.container.box.page:header.text.image.icon.markdown.element:divider.badge.alert.button.html`.split(`.`);new Set(Ze);var Qe=`h1.h2.h3.h4.h5.h6.p.a.blockquote.pre.code.strong.em.b.i.u.small.mark.sub.sup.del.ins.abbr.ul.ol.li.dl.dt.dd.figure.figcaption.img.hr.br.time.address.cite.q.span.table.label.aside.main.header.nav.footer.section.article`.split(`.`);new Set(Qe);function $e(e,t){return t.meta?.namespace?`${t.meta.namespace}:${e}`:e}function et(e,t){if(!Xe(e))return t;let n=t?.inputs??[];if(n.some(e=>e?.name===qe.name))return t;let r={...qe};return{...t??{},inputs:[...n,r]}}var tt=class{components=new Map;lazyEntries=new Map;listeners=new Set;version=0;register(e,t,n){let r=n?.namespace?`${n.namespace}:${e}`:e,i=et(t,n);if(n?.namespace||console.warn(`Registering component "${e}" without a namespace is deprecated. Please provide a namespace in the meta parameter.\n\n Migration:\n // Before (deprecated):\n registry.register('${e}', MyComponent);\n\n // After:\n registry.register('${e}', MyComponent, { namespace: 'my-plugin' });\n\n See: https://www.objectui.org/docs/guide/plugin-development#namespaced-registration`),this.components.has(r),this.components.set(r,{type:r,component:t,...i}),n?.namespace&&!n?.skipFallback){let n=this.components.get(e);if(n&&n.component!==t&&n.type!==r)console.warn(`Component "${e}" bare-name fallback is being overwritten by "${r}". If this is intentional keep going; otherwise register "${r}" with { skipFallback: true } so it doesn't claim the bare "${e}" key.`);else if(!n){let t=this.lazyEntries.get(e),n=t?$e(e,t):void 0;n&&n!==r&&console.warn(`Component "${e}" bare-name fallback is being overwritten by "${r}", which a pending lazy stub already claims for "${n}". Which one an authored "${e}" node resolves to depends on whether that chunk has loaded. If this is intentional keep going; otherwise register "${r}" with { skipFallback: true } so it doesn't claim the bare "${e}" key — that opt-out settles it, because the bare "${e}" key is then left with "${n}".`)}this.components.set(e,{type:r,component:t,...i}),this.lazyEntries.delete(e)}this.lazyEntries.delete(r),this.notify()}unregister(e,t){let n=t?`${t}:${e}`:e,r=this.components.delete(n);if(t){let t=this.components.get(e);t&&t.type===n&&this.components.delete(e)}if(this.lazyEntries.delete(n),t){let t=this.lazyEntries.get(e);t&&$e(e,t)===n&&this.lazyEntries.delete(e)}return r&&this.notify(),r}registerLazy(e,t,n){let r=n?.namespace?`${n.namespace}:${e}`:e,i={loader:t,meta:n};if(this.lazyEntries.set(r,i),n?.namespace&&!n?.skipFallback){let t=this.components.get(e),n=t?void 0:this.lazyEntries.get(e),a=t?t.type:n?$e(e,n):void 0;a&&a!==r&&console.warn(`Lazy component "${e}" bare-name fallback is being overwritten by "${r}", which ${t?`a loaded registration`:`another pending stub`} already claims for "${a}". If this is intentional keep going; otherwise register "${r}" with { skipFallback: true } so it doesn't claim the bare "${e}" key — that opt-out settles it, because the stub then claims only "${r}".`),this.lazyEntries.set(e,i)}this.version++}hasLazy(e,t){return t?this.lazyEntries.has(`${t}:${e}`):this.lazyEntries.has(e)}loadLazy(e,t){let n=t?`${t}:${e}`:e,r=this.lazyEntries.get(n);if(r)return r.pending||=r.loader().catch(e=>{throw r.pending=void 0,e}),r.pending}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){this.version++;for(let e of this.listeners)try{e()}catch(e){console.error(`[Registry] listener error`,e)}}getVersion(){return this.version}get(e,t){if(t){let n=`${t}:${e}`;return this.components.get(n)?.component}return this.components.get(e)?.component}getConfig(e,t){if(t){let n=`${t}:${e}`;return this.components.get(n)}return this.components.get(e)}has(e,t){if(t){let n=`${t}:${e}`;return this.components.has(n)}return this.components.has(e)}getAllTypes(){return Array.from(this.components.keys())}getKnownTypes(){return Array.from(new Set([...this.components.keys(),...this.lazyEntries.keys()]))}getMeta(e,t){let n=t?`${t}:${e}`:e;return this.components.get(n)??this.lazyEntries.get(n)?.meta}deprecationFor(e,t,n){let r=this.getMeta(e,n)?.deprecated;if(r)return r.surfaces.includes(t)?r:void 0}getAllConfigs(){return Array.from(this.components.values())}getContractConfig(e){let t=this.components.get(e);if(t)return t;let n=this.lazyEntries.get(e);if(!n)return;let r=n.meta?.namespace,i=r&&!e.startsWith(`${r}:`)?`${r}:${e}`:e;return{...n.meta,type:i,lazy:!0}}getPublicConfigs(){let e=new Set,t=[],n=(n,r)=>{r&&!e.has(r.type)&&(e.add(r.type),t.push({...r,type:n}))};for(let e of Ze)n(e,this.getContractConfig(e));for(let[e,t]of this.components.entries())t.tier===`public`&&!e.includes(`:`)&&n(e,t);for(let[e,t]of this.lazyEntries.entries())t.meta?.tier===`public`&&!e.includes(`:`)&&n(e,this.getContractConfig(e));for(let e of Qe){let t=this.getContractConfig(e);t&&n(e,{...t,tier:`html`})}return t}getNamespaceComponents(e){return Array.from(this.components.values()).filter(t=>t.namespace===e)}},A=new tt;function nt(e){return e==null||typeof e==`string`&&e.trim()===``||Array.isArray(e)&&e.length===0}T();function rt(e){return typeof e==`object`&&!!e&&typeof e.dialect==`string`&&typeof e.source==`string`}function it(e){return b(e)||rt(e)}function at(e,t){return t?it(e?.field?.defaultValue):!1}function ot(e){return e.includes("${")?e:`\${${e}}`}function st(e){if(e!=null&&e!==``){if(typeof e==`boolean`)return e;if(typeof e==`string`)return ot(e);if(typeof e==`object`&&typeof e.source==`string`){let t=e.source;return t?e.dialect===`cel`?{dialect:`cel`,source:t}:ot(t):void 0}}}function ct(e){if(typeof e==`string`)return e.trim()===``;if(typeof e==`object`&&e){let t=e.source;if(typeof t==`string`)return t.trim()===``}return!1}function j(e){return!ct(e)&&st(e)!==void 0}function lt(e){return{required:!1,validate:e=>typeof e==`boolean`||j(e),message:`${e} must be a boolean or a declared predicate: an expression string (bare, e.g. "record.stage == 'closed'", or the "\${...}" template spelling), or a { dialect, source } expression envelope`}}var ut={type:{required:!0,validate:e=>typeof e==`string`&&e.length>0,message:`type must be a non-empty string`},id:{required:!1,validate:e=>typeof e==`string`,message:`id must be a string`},className:{required:!1,validate:e=>typeof e==`string`,message:`className must be a string`},visible:lt(`visible`),disabled:lt(`disabled`)};function dt(e){return!!e&&typeof e==`object`}function ft(e,t=`schema`){let n=[];return Object.entries(ut).forEach(([r,i])=>{let a=e[r];i.required&&a===void 0&&n.push({path:`${t}.${r}`,message:`${r} is required`,type:`error`,code:`MISSING_REQUIRED`}),a!==void 0&&!i.validate(a)&&n.push({path:`${t}.${r}`,message:i.message,type:`error`,code:`INVALID_TYPE`})}),n}var pt=Object.freeze({crud:'Node type `crud` was RETIRED (objectui#5373, ADR-0049 enforce-or-remove). `CRUDSchema` declared it in four places and no renderer ever registered it, so a node spelling it painted the OBJUI-001 "Unknown component type" panel. Compose the shapes that DO render instead: `object-grid` for the record table with its toolbar, filters, pagination and row/batch actions, `object-form` for the create/edit form, and `detail` for the record view.'});function mt(e,t=`schema`){let n=e.type;return typeof n!=`string`||!Object.prototype.hasOwnProperty.call(pt,n)?[]:[{path:`${t}.type`,message:pt[n],type:`error`,code:`RETIRED_TYPE`}]}var ht=`field:`;function gt(e){let t=e.widget??e.type;return typeof t==`string`?t:void 0}function _t(e,t){let n=gt(e);if(n&&n.includes(`:`)&&!n.startsWith(ht))return{path:`${t}.${typeof e.widget==`string`?`widget`:`type`}`,message:`'${n}' is not a form field widget: a namespaced field widget id must name the \`field:\` namespace (objectui#5254), so this id resolves NOTHING on the field path and the renderer would fall through to a plain text box — putting a secret on screen in clear text when the field holds one (objectui#5375). Write the built-in spelling (e.g. \`password\`), or the field widget id \`field:${n.slice(n.indexOf(`:`)+1)}\`. Resolving in the registry is not proof it resolves HERE — \`ui:password\` is a registered SDUI node renderer and still renders clear text as a field.`,type:`error`,code:`UNRESOLVABLE_FIELD_WIDGET_NAMESPACE`}}function vt(e,t=`schema`){let n=[];if(e.type===`form`){let r=e.fields;Array.isArray(r)&&r.forEach((e,i)=>{let a=dt(e)?e:{};a.name||n.push({path:`${t}.fields[${i}]`,message:`Form field requires name property`,type:`error`,code:`MISSING_FIELD_NAME`});let o=_t(a,`${t}.fields[${i}]`);o&&n.push(o),r.filter(e=>(dt(e)?e.name:void 0)===a.name).length>1&&n.push({path:`${t}.fields[${i}]`,message:`Duplicate field name: ${String(a.name)}`,type:`warning`,code:`DUPLICATE_FIELD_NAME`})})}return n}function yt(e,t=`schema`){let n=[],r=e.children;if(r){if(Array.isArray(r))r.forEach((e,r)=>{if(dt(e)){let i=bt(e,`${t}.children[${r}]`);n.push(...i.errors,...i.warnings)}});else if(dt(r)){let e=bt(r,`${t}.children`);n.push(...e.errors,...e.warnings)}}return n}function bt(e,t=`schema`){let n=[];dt(e)?(n.push(...ft(e,t)),n.push(...mt(e,t)),n.push(...vt(e,t)),n.push(...yt(e,t))):n.push({path:t,message:`Schema must be an object`,type:`error`,code:`INVALID_SCHEMA`});let r=n.filter(e=>e.type===`error`),i=n.filter(e=>e.type===`warning`);return{valid:r.length===0,errors:r,warnings:i}}var xt=[`id`,`className`,`role`,`tabIndex`,`autoFocus`,`onClick`,`onBlur`,`onFocus`];function St(e){return e.startsWith(`data-`)||e.startsWith(`aria-`)}function Ct(e,t){let n=new Set(t),r={};for(let t of Object.keys(e))(n.has(t)||St(t))&&(r[t]=e[t]);return r}function wt(e){return Ct(e,xt)}T();function Tt(e,t){if(e==null)return{enabled:t};if(typeof e==`boolean`)return{enabled:e};let n=e.enabled??t;if(e.visibleWhen==null&&e.disabledWhen==null)return{enabled:n};let r={};return e.visibleWhen!=null&&(r.visibleWhen=e.visibleWhen),e.disabledWhen!=null&&(r.disabledWhen=e.disabledWhen),{enabled:n,predicates:r}}function Et(e){return Tt(e,!1).predicates}var Dt={create:`create`,import:`import`,edit:`update`,delete:`delete`,exportCsv:`export`};function Ot(e,t){let n=re({managedBy:e?.managedBy??void 0,userActions:e?.userActions??void 0});if(Array.isArray(t)){let e=new Set(t);for(let[t,r]of Object.entries(Dt))n[t]&&!e.has(r)&&(n[t]=!1)}return n}function kt(e,t){return Ot(e,t).edit}function At(e){if(Array.isArray(e))return e;if(e&&typeof e==`object`){if(Array.isArray(e.data))return e.data;if(Array.isArray(e.value))return e.value}return[]}var jt=2e3;function Mt(){return{$top:2001}}function Nt(e){let t=At(e),n=e&&typeof e==`object`&&typeof e.total==`number`?e.total:void 0,r=t.length>jt;return{rows:r?t.slice(0,jt):t,total:n,truncated:r}}function Pt(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var M=`field`,Ft=[`name`,`fieldName`],It=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Lt=e=>typeof e==`string`&&e.length>0?e:void 0;function Rt(e){if(typeof e==`string`)return Lt(e);if(!It(e))return;let t=Lt(e[M]);if(t)return t;for(let t of Ft){let n=Lt(e[t]);if(n)return n}}var zt=new Set,Bt=()=>!1;function Vt(e,t,n){if(Bt()&&n.length!==0)for(let r of n){let n=`${t}:${r}:${String(e[r])}`;zt.has(n)||(zt.add(n),console.warn(`[ObjectUI] Column carries two identities: \`${M}: '${t}'\` and \`${r}: '${String(e[r])}'\`. \`${M}\` wins — it is the only key \`ListColumnSchema\` declares — and \`${r}\` has been rewritten to match, so the rendered column and the requested field agree. Fix the producer: drop \`${r}\` and author \`${M}\` only. (objectui#3104)`))}}function Ht(e){if(typeof e==`string`||!It(e))return e;let t=Rt(e);if(!t)return e;let n=e[M]!==t,r=Ft.filter(n=>e[n]!==void 0&&e[n]!==t);if(!n&&r.length===0)return e;Vt(e,t,r);let i={...e};i[M]=t;for(let e of r)i[e]=t;return i}function Ut(e){if(!Array.isArray(e))return e;let t=!1,n=e.map(e=>{let n=Ht(e);return n!==e&&(t=!0),n});return t?n:e}var Wt=`label`,Gt=`header`;function Kt(e){if(It(e))return Lt(e.header)??Lt(e.label)}var qt=new Set([`lookup`,`master_detail`,`tree`,`user`]);function Jt(e){return!!e&&typeof e==`object`&&qt.has(e.type)}function Yt(e,t){if(!e||typeof e!=`object`)return[];let n=[];for(let[t,r]of Object.entries(e))Jt(r)&&n.push(t);if(n.length===0)return[];if(t&&Array.isArray(t)&&t.length>0){let e=new Set;for(let n of t){let t=Rt(n);t&&e.add(t)}return n.filter(t=>e.has(t))}return n}var Xt=Object.freeze({owner:"[object-ui] Field type `owner` was RETIRED (objectui#4814). It was a synonym for `user` with no behavioral difference, and it is not a member of `@objectstack/spec`'s FieldType. Write the record-owner field as `{ type: 'user', name: 'owner' }` — the field NAME carries the ownership meaning, the type carries the widget. The `widget: 'field:owner'` spelling is retired with it."});function Zt(e){return typeof e!=`string`||!e?!1:Object.prototype.hasOwnProperty.call(Xt,e)}var Qt=new Set;function $t(e){let t=Zt(e)?Xt[e]:void 0;return t?(Qt.has(e)||(Qt.add(e),console.error(t)),!0):!1}T();var en=a;function tn(e){return!!e&&typeof e==`object`&&en.has(e.type)}var nn=Symbol.for(`objectui.objectSortability`);function rn(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e.sortable;if(typeof t!=`boolean`)return;let n=e.reason,r=e.caveat;return{sortable:t,...typeof n==`string`?{reason:n}:{},...typeof r==`string`?{caveat:r}:{}}}function an(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e.fields;if(!t||typeof t!=`object`||Array.isArray(t))return;let n={};for(let[e,r]of Object.entries(t)){let t=rn(r);t&&(n[e]=t)}return{fields:n}}function on(e,t){let n=an(t);return!n||!e||typeof e!=`object`||Object.defineProperty(e,nn,{value:n,enumerable:!1,configurable:!0,writable:!0}),e}function sn(e){if(!e||typeof e!=`object`)return;let t=e[nn];if(!t||typeof t!=`object`)return;let n=t.fields;if(n&&typeof n==`object`&&!Array.isArray(n))return t}function cn(e,t){if(typeof t!=`string`||t.length===0)return!1;let n=e.fields?.[t];return rn(n)?.sortable===!0}function ln(e,t){return Array.isArray(e)?e.filter(e=>cn(t,e?.field)):[]}function un(e,t=0){let n=`migrated_${t}`;return e.type===`separator`?{id:n,type:`separator`}:e.type===`group`?{id:n,type:`group`,label:e.label||``,icon:e.icon,children:(e.children||[]).map((e,n)=>un(e,t*100+n)),visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge,defaultOpen:!0}:e.href?{id:n,type:`url`,label:e.label||``,icon:e.icon,url:e.href,target:`_blank`,visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge}:{id:n,type:`page`,label:e.label||``,icon:e.icon,pageName:e.path||``,visible:e.hidden===void 0?void 0:!e.hidden,badge:e.badge}}function dn(e){return/^[a-z][a-z0-9]*(_[a-z0-9]+)*$/.test(e)}function fn(e){return{name:e.name,label:e.title,description:e.description,icon:e.icon,branding:e.branding,navigation:e.navigation}}function pn(e){if(!e)return null;let t=e.stageField;if(t===!1)return null;if(typeof t==`string`&&t)return t;let n=e.fields||{};for(let e of[`status`,`stage`,`state`,`phase`])if(e in n)return e;for(let[e,t]of Object.entries(n)){let n=(t?.type||``).toLowerCase();if(n===`status`||n===`stage`)return e}return null}function mn(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=Object.keys(e);if(t.length!==1||t[0]!==`preset`)return!1;let n=e.preset;return typeof n==`string`&&n.length>0}function hn(e){if(!e||typeof e!=`object`)return e;let t=e.defaultValue;return mn(t)?{...e,defaultValue:t.preset}:e}function gn(e){if(!e||typeof e!=`object`)return e;let t=e.globalFilters;if(!Array.isArray(t))return e;let n=!1,r=t.map(e=>{let t=hn(e);return t!==e&&(n=!0),t});return n?{...e,globalFilters:r}:e}var _n=[`text`,`number`,`date`,`datetime`,`currency`,`percent`,`boolean`,`action`],vn={int:`number`,integer:`number`,float:`number`,double:`number`,"datetime-local":`datetime`};function yn(e){if(typeof e==`string`)return _n.includes(e)?e:vn[e]}var bn=[`metric-card`],xn=[`list`,`custom`],Sn=new Set(`id._id.__v._version._rev.created.created_at.createdAt.created_by.createdBy.modified.modified_by.updated_at.updatedAt.updated_by.updatedBy.deleted.deleted_at.deletedAt.is_deleted.instance_state.locked.owner_id.organization_id.tenant_id.company_id.space`.split(`.`)),Cn={createdAt:`created_at`,createdBy:`created_by`,updatedAt:`updated_at`,updatedBy:`updated_by`},wn=new Set(Object.values(Cn));function Tn(e,t){return t?.system===!0||Sn.has(e)}var En=[`default`,`blue`,`teal`,`orange`,`purple`,`success`,`warning`,`danger`],Dn=[`metric`,`bar`,`horizontal-bar`,`line`,`pie`,`donut`,`area`,`scatter`,`funnel`,`table`,`pivot`,`list`,`custom`],On=`text.textarea.number.boolean.date.datetime.time.select.email.phone.url.password.currency.percent.lookup.formula.autonumber.file.image.markdown.html.color.code.location.address.rating.slider`.split(`.`);function kn(e,t){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.default;if(typeof t==`string`)return t}return t}function An(e){let t=e.type??`tabular`,n=t===`joined`||t===`tabular`?`tabular`:t,r=(e.values??[]).map(e=>({name:e,label:kn(void 0,e)})),i=(e.rows??[]).map(e=>({field:e,sort:`asc`}));return{type:`report`,title:kn(e.label,e.name),description:e.description?kn(e.description,``):void 0,reportType:n,fields:r,groupBy:i.length>0?i:void 0}}function jn(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.name!=`string`||t.type===`report`&&Array.isArray(t.fields)?!1:typeof t.dataset==`string`||Array.isArray(t.blocks)||typeof t.type==`string`&&[`tabular`,`summary`,`matrix`,`joined`].includes(t.type)}T();function Mn(e,t){if(!t)return!0;let n=e?.locations;return Array.isArray(n)&&n.includes(t)}var Nn=`an actions array is either all action ids or all inline action objects — mixed id/object action arrays are refused; use all ids or all objects`;function Pn(e){return e===null?`null`:Array.isArray(e)?`an array`:`a ${typeof e}`}function Fn(e){let t=e=>typeof e==`string`?`id`:typeof e==`object`&&e&&!Array.isArray(e)?`object`:null;if(e.length===0)return{kind:`objects`,objects:[]};let n=t(e[0]);for(let r=0;r<e.length;r+=1){let i=e[r],a=t(i);if(a===null)return{kind:`refused`,index:r,message:`element ${r} is ${Pn(i)}, which is neither an action id (a string) nor an inline action object; ${Nn}`};if(a!==n)return{kind:`refused`,index:r,message:`element ${r} is ${a===`id`?`an action id`:`an inline action object`} but element 0 is ${n===`id`?`an action id`:`an inline action object`}; an actions array is either all action ids or all inline action objects — mixed id/object action arrays are refused; use all ids or all objects`}}return n===`id`?{kind:`ids`,ids:e}:{kind:`objects`,objects:e}}function In(e,t){let n=Fn(e);if(n.kind===`refused`)return n;if(n.kind===`objects`)return{kind:`objects`,actions:Array.from(n.objects)};let r=new Map;for(let e of t??[]){let t=typeof e?.name==`string`?e.name:``;t&&!r.has(t)&&r.set(t,e)}let i=[],a=[];return n.ids.forEach((e,t)=>{let n=r.get(e);n?i.push(n):a.push({index:t,id:e})}),{kind:`ids`,ids:n.ids,actions:i,unresolved:a}}var Ln=f.options,Rn=[`checkbox`,`reference`,`datetime-local`];function zn(e,t){let n=e?.code;return typeof n!=`string`||n.length===0?!1:n.toUpperCase()===t.toUpperCase()}function Bn(e,t){return t.some(t=>zn(e,t))}var Vn=3e4,Hn=new Set([408,425,429,502,503,504]),Un=class extends Error{status;retryAfterMs;constructor(e,t,n){super(n??`Endpoint returned ${e}`),this.status=e,this.retryAfterMs=t,this.name=`HttpFetchError`}};function Wn(e){return e instanceof Un?Hn.has(e.status):!0}function Gn(e,t){if(!e)return;let n=e.trim();if(!n)return;let r;if(/^\d+$/.test(n))r=Number(n)*1e3;else{let e=Date.parse(n);if(Number.isNaN(e))return;r=e-t}if(!(!Number.isFinite(r)||r<0))return Math.min(r,Vn)}function Kn(e,t,n){return n===void 0?Math.min(t*2**e,Vn):n}var qn=e=>new Promise(t=>setTimeout(t,e));function Jn(e){return Gn(e.headers?.get?.(`Retry-After`),Date.now())}var Yn=Symbol.for(`objectui.inflightGet`);function Xn(){let e=globalThis,t=e[Yn];if(t)return t;let n=new Map;return e[Yn]=n,n}function Zn(e){if(!e)return``;let t=[];if(typeof Headers<`u`&&e instanceof Headers)e.forEach((e,n)=>t.push(`${n.toLowerCase()}=${e}`));else if(Array.isArray(e))for(let[n,r]of e)t.push(`${String(n).toLowerCase()}=${String(r)}`);else for(let[n,r]of Object.entries(e))t.push(`${n.toLowerCase()}=${String(r)}`);return t.sort().join(`,`)}function Qn(e,t){return`GET\n${t?.credentials??`same-origin`}\n${e}\n${Zn(t?.headers)}`}function $n(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}var er=(e,t)=>fetch(e,t);async function tr(e,t,n=er){let r=t?.method;if(r!==void 0&&r.toUpperCase()!==`GET`)throw TypeError(`sharedGetJson is GET-only; refusing to share a ${r.toUpperCase()} request`);if(t?.signal){let r=await n(e,{...t,method:`GET`});if(!r.ok)throw new Un(r.status,Jn(r));return await r.json()}let i=Qn(e,t),a=Xn(),o=a.get(i);if(o)return $n(await o);let s=(async()=>{let r=await n(e,{...t,method:`GET`});if(!r.ok)throw new Un(r.status,Jn(r));return await r.json()})();a.set(i,s);let c=()=>{a.get(i)===s&&a.delete(i)};return s.then(c,c),$n(await s)}var nr=`\0`,rr=`[-\\u2013\\u2014|/·,:]`,ir=[`name`,`title`,`subject`,`label`,`full_name`,`display_name`],ar=new Set([`date`,`datetime`,`time`,`number`,`currency`,`percent`,`boolean`,`file`,`image`,`attachment`,`json`,`geolocation`,`select`,`multiselect`,`picklist`,`multipicklist`,`lookup`,`master_detail`,`reference`,`autonumber`,`auto_number`,`phone`]),or=new Set([`text`,`string`,`textarea`,`html`]);function sr(e){let t=e.name??e.full_name??e.display_name??e.label??e.title??e.subject??null;return t==null||typeof t==`string`&&!t.trim()?[e.salutation,e.first_name,e.last_name].filter(e=>typeof e==`string`&&e.trim()).map(e=>e.trim()).join(` `)||(typeof e.email==`string`&&e.email.trim()?e.email.trim():null):typeof t==`string`?t:String(t)}function cr(e,t){let n=typeof e==`string`?e:e&&typeof e==`object`&&typeof e.source==`string`?e.source:void 0;if(!n||!t||typeof t!=`object`)return``;n=n.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,`{$1}`);let r=!1,i=n.replace(/\{([^{}]+)\}/g,(e,n)=>{let i=String(n).trim().split(`.`),a=t;for(let e of i){if(a==null)break;a=a[e]}let o=vr(a);return o===void 0?nr:(r=!0,o)});if(!r)return``;let a=RegExp(`\\s*${rr}\\s*${nr}`,`g`),o=RegExp(`${nr}\\s*${rr}\\s*`,`g`);return i=i.replace(a,``).replace(o,``).replace(new RegExp(nr,`g`),``).replace(/\s+/g,` `).trim(),i}function lr(e){if(!e||typeof e!=`object`)return!1;let t=typeof e.type==`string`?e.type.toLowerCase():void 0;if(!t)return!0;if(t===`formula`){let t=String(e.data_type??e.dataType??e.returnType??e.result_type??``).toLowerCase();return or.has(t)}return!ar.has(t)}function ur(e){return e?Array.isArray(e)?e.filter(e=>e&&typeof e==`object`&&typeof e.name==`string`).map(e=>[e.name,e]):typeof e==`object`?Object.keys(e).map(t=>[t,e[t]]):[]:[]}var dr=new WeakMap;function fr(e){let t=ur(e?.fields).filter(([,e])=>lr(e));if(t.length===0)return;for(let e of ir){let n=t.find(([t])=>t.toLowerCase()===e);if(n)return n[0]}let n=t.find(([e])=>{let t=e.toLowerCase();return t.endsWith(`_name`)||t.endsWith(`_title`)||t.startsWith(`name_`)});return n?n[0]:t[0][0]}function pr(e){if(typeof e!=`object`||!e)return fr(e);if(dr.has(e))return dr.get(e);let t=fr(e);return dr.set(e,t),t}function mr(e){return e?.nameField??e?.displayNameField??e?.NAME_FIELD_KEY}function hr(e){let t=mr(e);return typeof t==`string`&&t.length>0?t:pr(e)}function gr(e,t){let n=mr(e),r=typeof n==`string`&&n.length>0,i=r?n:pr(e),a=i?e?.fields?.[i]:void 0;return!i||!a||a.hidden||!r&&Tn(i,a)?t:[i,...t.filter(e=>e!==i)]}var _r=[`name`,`full_name`,`fullName`,`display_name`,`displayName`,`title`,`subject`,`label`];function N(e,t){if(t&&e&&typeof e==`object`)return vr(e[t])}function vr(e){let t=e;if(t&&typeof t==`object`&&(t=sr(t)),t==null)return;let n=typeof t==`string`?t.trim():String(t);return n===``?void 0:n}function yr(e,t,n){let r=N(t,n?.titleField);if(r)return r;let i=N(t,mr(e));if(i)return i;if(e?.titleFormat){let n=cr(e.titleFormat,t);if(n)return n}let a=N(t,pr(e));if(a)return a;if(n?.deriveFromRecordKeys!==!1&&t&&typeof t==`object`){for(let e of _r){let n=N(t,e);if(n)return n}for(let e of Object.keys(t)){let n=e.toLowerCase();if(!(n===`id`||n===`_id`||n.endsWith(`_id`)||n.startsWith(`_`))&&(n.endsWith(`_name`)||n.endsWith(`_title`)||n.startsWith(`name_`))){let n=N(t,e);if(n)return n}}}let o=t?.id??t?._id;return o!=null&&String(o).trim()!==``?`Record #${o}`:n?.fallback??`Untitled`}function br(e,t){if(e==null||e===``)return null;let n=t?.labels;if(typeof e==`string`)return n?.[e]??e;if(typeof e==`number`)return Number.isFinite(e)?n?.[String(e)]??e:null;if(typeof e==`boolean`)return e;if(e instanceof Date){let t=e.getTime();return Number.isNaN(t)?null:t}if(Array.isArray(e)){let n=e.map(e=>br(e,t)).filter(e=>e!==null).map(e=>String(e));return n.length>0?n.join(`, `):null}if(typeof e==`object`){let t=e,r=t.id??t._id;if(r!=null){let e=n?.[String(r)];if(e)return e}let i=yr(void 0,t,{fallback:``});return i===``?null:i}return String(e)}function xr(e,t){return e===null&&t===null?0:e===null?1:t===null?-1:typeof e==`boolean`&&typeof t==`boolean`?!!e-+!!t:typeof e==`number`&&typeof t==`number`?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0})}var Sr=`[{ field: 'name', order: 'desc' }]`,Cr=new Set;function wr(e,t){return`${e}\n${t}`}function Tr(e){let t=wr(`scalar`,e);Cr.has(t)||(Cr.add(t),console.error(`[object-ui] convertSortToQueryParams: the legacy string \`sort\` clause is retired (objectui#8221) and was REFUSED — received ${JSON.stringify(e)}, so this query carries no \`$orderby\`. Write the array form instead: sort: ${Sr} — both keys, on every entry. \`order\` is required: on \`SortConfig\`, on its zod counterpart, and on \`@objectstack/spec\`'s \`SortItemSchema\`, which refuses an entry without it. (A missing \`order\` is still read as \`'asc'\` here — that is a runtime tolerance, not permission to omit the key: metadata written that way is refused when it is published.) The array is the only spelling every \`sort\` input declares, and the only one \`@objectstack/spec\` accepts.`))}function Er(e){let t=wr(`entry`,e);Cr.has(t)||(Cr.add(t),console.error(`[object-ui] convertSortToQueryParams: a \`sort\` ARRAY ENTRY is the retired string clause (objectui#8221) and was REFUSED — received ${JSON.stringify(e)} as an entry of the \`sort\` array, so that entry orders nothing (and if it was the only usable entry, this query carries no \`$orderby\` at all). The retirement is about the SPELLING, not the container: wrapping the clause in an array does not revive it. Write entry OBJECTS instead: sort: ${Sr} — both keys, on every entry. \`order\` is required: on \`SortConfig\`, on its zod counterpart, and on \`@objectstack/spec\`'s \`SortItemSchema\`, which refuses an entry without it. (A missing \`order\` is still read as \`'asc'\` here — that is a runtime tolerance, not permission to omit the key: metadata written that way is refused when it is published.) The array OF OBJECTS is the only spelling every \`sort\` input declares, and the only one \`@objectstack/spec\` accepts.`))}function Dr(e){if(e){if(typeof e==`string`){Tr(e);return}if(Array.isArray(e)){let t=[];for(let n of e){if(typeof n==`string`){let e=n;e!==``&&Er(e);continue}n&&typeof n.field==`string`&&n.field!==``&&t.push({field:n.field,order:n.order===`desc`?`desc`:`asc`})}return t.length>0?t:void 0}}}function Or(e){let t=Dr(e);if(!t)return;let n={};for(let e of t)n[e.field]=e.order;return n}var kr=class e{scopes=[];constructor(e={}){this.scopes.push(new Map(Object.entries(e)))}pushScope(e){this.scopes.push(new Map(Object.entries(e)))}popScope(){this.scopes.length>1&&this.scopes.pop()}get(e){let t=e.split(`.`),n=t[0];for(let e=this.scopes.length-1;e>=0;e--)if(this.scopes[e].has(n)){let r=this.scopes[e].get(n);for(let e=1;e<t.length;e++)if(r&&typeof r==`object`)r=r[t[e]];else return;return r}}set(e,t){this.scopes.length>0&&this.scopes[this.scopes.length-1].set(e,t)}has(e){let t=e.split(`.`)[0];for(let e=this.scopes.length-1;e>=0;e--)if(this.scopes[e].has(t))return!0;return!1}toObject(){let e={};for(let t of this.scopes)for(let[n,r]of t.entries())e[n]=r;return e}createChild(t={}){let n=new e;return n.scopes=[...this.scopes,new Map(Object.entries(t))],n}},Ar={Math,JSON,parseInt,parseFloat,isNaN,isFinite},jr=new Set([`constructor`,`__proto__`,`prototype`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`]),Mr=class e{source=``;pos=0;context={};_evaluating=!0;evaluate(e,t){this.source=e.trim(),this.pos=0,this.context={...Ar,...t};let n=this.parseTernary();if(this.skipWhitespace(),this.pos<this.source.length)throw SyntaxError(`Unexpected token "${this.source[this.pos]}" at position ${this.pos} in expression "${e}"`);return n}skipWhitespace(){for(;this.pos<this.source.length&&/\s/.test(this.source[this.pos]);)this.pos++}peek(e=0){return this.source[this.pos+e]??``}consume(){return this.source[this.pos++]??``}withEvaluation(e,t){let n=this._evaluating;this._evaluating=e;try{return t()}finally{this._evaluating=n}}assertSafeProp(e){if(typeof e==`string`&&jr.has(e))throw TypeError(`Access to property "${e}" is not permitted in expressions`)}parseTernary(){let e=this.parseNullish();if(this.skipWhitespace(),this.peek()===`?`&&this.peek(1)!==`?`){if(this.pos++,this.skipWhitespace(),!this._evaluating){if(this.parseTernary(),this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);this.pos++,this.skipWhitespace(),this.parseTernary();return}if(e){let e=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);return this.pos++,this.skipWhitespace(),this.withEvaluation(!1,()=>this.parseTernary()),e}if(this.withEvaluation(!1,()=>this.parseTernary()),this.skipWhitespace(),this.peek()!==`:`)throw SyntaxError(`Expected ":" in ternary expression`);return this.pos++,this.skipWhitespace(),this.parseTernary()}return e}parseNullish(){let e=this.parseOr();for(this.skipWhitespace();this.peek()===`?`&&this.peek(1)===`?`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&e!=null)this.withEvaluation(!1,()=>this.parseOr());else{let t=this.parseOr();this._evaluating&&(e??=t)}this.skipWhitespace()}return e}parseOr(){let e=this.parseAnd();for(this.skipWhitespace();this.peek()===`|`&&this.peek(1)===`|`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&e)this.withEvaluation(!1,()=>this.parseAnd());else{let t=this.parseAnd();this._evaluating&&(e||=t)}this.skipWhitespace()}return e}parseAnd(){let e=this.parseEquality();for(this.skipWhitespace();this.peek()===`&`&&this.peek(1)===`&`;){if(this.pos+=2,this.skipWhitespace(),this._evaluating&&!e)this.withEvaluation(!1,()=>this.parseEquality());else{let t=this.parseEquality();this._evaluating&&(e&&=t)}this.skipWhitespace()}return e}parseEquality(){let e=this.parseAddition();for(this.skipWhitespace();;){let t;if(this.peek()===`=`&&this.peek(1)===`=`&&this.peek(2)===`=`)t=`===`,this.pos+=3;else if(this.peek()===`!`&&this.peek(1)===`=`&&this.peek(2)===`=`)t=`!==`,this.pos+=3;else if(this.peek()===`=`&&this.peek(1)===`=`)t=`==`,this.pos+=2;else if(this.peek()===`!`&&this.peek(1)===`=`)t=`!=`,this.pos+=2;else if(this.peek()===`>`&&this.peek(1)===`=`)t=`>=`,this.pos+=2;else if(this.peek()===`<`&&this.peek(1)===`=`)t=`<=`,this.pos+=2;else if(this.peek()===`>`&&this.peek(1)!==`>`)t=`>`,this.pos++;else if(this.peek()===`<`&&this.peek(1)!==`<`)t=`<`,this.pos++;else break;this.skipWhitespace();let n=this.parseAddition();switch(t){case`===`:e=e===n;break;case`!==`:e=e!==n;break;case`==`:e=e==n;break;case`!=`:e=e!=n;break;case`>`:e=e>n;break;case`<`:e=e<n;break;case`>=`:e=e>=n;break;case`<=`:e=e<=n}this.skipWhitespace()}return e}parseAddition(){let e=this.parseMultiplication();for(this.skipWhitespace();(this.peek()===`+`||this.peek()===`-`)&&this.peek(1)!==`=`;){let t=this.consume();this.skipWhitespace();let n=this.parseMultiplication();e=t===`+`?e+n:e-n,this.skipWhitespace()}return e}parseMultiplication(){let e=this.parseUnary();for(this.skipWhitespace();(this.peek()===`*`||this.peek()===`/`||this.peek()===`%`)&&this.peek(1)!==`=`;){let t=this.consume();this.skipWhitespace();let n=this.parseUnary();t===`*`?e*=n:t===`/`?e/=n:e%=n,this.skipWhitespace()}return e}parseUnary(){if(this.skipWhitespace(),this.source.startsWith(`typeof`,this.pos)&&!/[\w$]/.test(this.source[this.pos+6]??``)){this.pos+=6,this.skipWhitespace();try{return typeof this.parseUnary()}catch{return`undefined`}}return this.peek()===`!`?(this.pos++,!this.parseUnary()):this.peek()===`-`?(this.pos++,-this.parseUnary()):this.peek()===`+`?(this.pos++,+this.parseUnary()):this.parseMember()}parseMember(){let e=this.parsePrimary();for(;;){this.skipWhitespace();let t=this.peek()===`?`&&this.peek(1)===`.`;if(this.peek()===`.`&&this.peek(1)!==`.`||t){t&&this.pos++,this.pos++,this.skipWhitespace();let n=this.parseIdentifierName();if(!n)break;if(this.assertSafeProp(n),this.skipWhitespace(),this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating){e=void 0;continue}e=e!=null&&typeof e[n]==`function`?e[n](...t):void 0}else{if(!this._evaluating){e=void 0;continue}e=e?.[n]}continue}let n=this.peek()===`?`&&this.peek(1)===`[`;if(this.peek()===`[`||n){n&&this.pos++,this.pos++,this.skipWhitespace();let t=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`]`)throw SyntaxError(`Expected "]" after bracket expression at position ${this.pos}`);if(this.pos++,this.assertSafeProp(t),!this._evaluating){e=void 0;continue}e=e?.[t];continue}if(this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating){e=void 0;continue}if(typeof e==`function`)e=e(...t);else throw TypeError(`${String(e)} is not a function`);continue}break}return e}parsePrimary(){this.skipWhitespace();let e=this.peek();if(e===`(`){this.pos++;let e=this.parseTernary();if(this.skipWhitespace(),this.peek()!==`)`)throw SyntaxError(`Expected ")" to close "(" expression at position ${this.pos}`);return this.pos++,e}if(e===`[`)return this.parseArrayLiteral();if(e===`"`||e===`'`)return this.parseString(e);if(/\d/.test(e)||e===`.`&&/\d/.test(this.peek(1)))return this.parseNumber();if(/[a-zA-Z_$]/.test(e))return this.parseIdentifierOrKeyword();throw SyntaxError(`Unexpected character "${e}" at position ${this.pos}`)}parseArrayLiteral(){this.pos++;let e=[];for(this.skipWhitespace();this.peek()!==`]`&&this.pos<this.source.length;)e.push(this.parseTernary()),this.skipWhitespace(),this.peek()===`,`&&(this.pos++,this.skipWhitespace());if(this.peek()!==`]`)throw SyntaxError(`Expected "]" to close array literal at position ${this.pos}`);return this.pos++,e}parseString(e){this.pos++;let t=``;for(;this.pos<this.source.length;){let n=this.source[this.pos];if(n===`\\`){this.pos++;let e=this.source[this.pos++]??``;switch(e){case`n`:t+=`
2
- `;break;case`t`:t+=` `;break;case`r`:t+=`\r`;break;case`\\`:t+=`\\`;break;case`"`:t+=`"`;break;case`'`:t+=`'`;break;case"`":t+="`";break;default:t+=e}}else if(n===e){this.pos++;break}else t+=n,this.pos++}return t}parseNumber(){let e=this.pos,t=!1;for(;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t=!0,this.pos++;if(this.source[this.pos]===`.`)for(this.pos++;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t=!0,this.pos++;if(/[eE]/.test(this.source[this.pos]??``)){this.pos++,/[+-]/.test(this.source[this.pos]??``)&&this.pos++;let t=0;for(;this.pos<this.source.length&&/\d/.test(this.source[this.pos]);)t++,this.pos++;if(t===0)throw SyntaxError(`Invalid numeric literal exponent at position ${e}`)}if(!t)throw SyntaxError(`Invalid numeric literal at position ${e}`);let n=this.source.slice(e,this.pos),r=Number(n);if(!Number.isFinite(r))throw SyntaxError(`Invalid numeric literal "${n}" at position ${e}`);return r}parseIdentifierName(){let e=this.pos;for(;this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]);)this.pos++;return this.source.slice(e,this.pos)}parseIdentifierOrKeyword(){let e=this.parseIdentifierName();switch(e){case`true`:return!0;case`false`:return!1;case`null`:return null;case`undefined`:return;case`NaN`:return NaN;case`Infinity`:return 1/0}if(e===`new`)return this.parseNewExpression();if(this.skipWhitespace(),this.peek()===`=`&&this.peek(1)===`>`)return this.parseArrowFunction(e);if(this.peek()===`(`){this.pos++;let t=this.parseArgList();if(this.peek()!==`)`)throw SyntaxError(`Expected ")" after argument list at position ${this.pos}`);if(this.pos++,!this._evaluating)return;let n=this.context[e];if(typeof n==`function`)return n(...t);throw TypeError(`"${e}" is not a function`)}if(this._evaluating){if(!(e in this.context))throw ReferenceError(`${e} is not defined`);return this.context[e]}}parseNewExpression(){this.skipWhitespace();let e=this.parseIdentifierName();this.skipWhitespace();let t=[];if(this.peek()===`(`){if(this.pos++,t=this.parseArgList(),this.peek()!==`)`)throw SyntaxError(`Expected ")" after new ${e}() at position ${this.pos}`);this.pos++}if(this._evaluating)switch(e){case`Date`:return new Date(...t);case`RegExp`:return new RegExp(t[0],t[1]);default:throw TypeError(`new ${e}() is not supported in expressions`)}}parseArrowFunction(t){this.pos+=2,this.skipWhitespace();let n=this.pos,r=this.scanExpressionEnd(),i=this.source.slice(n,r).trim();this.pos=r;let a=this.context;return n=>new e().evaluate(i,{...a,[t]:n})}scanExpressionEnd(){let e=this.pos,t=0,n=!1,r=``;for(;e<this.source.length;){let i=this.source[e];if(n){if(i===`\\`){e+=2;continue}i===r&&(n=!1),e++;continue}if(i===`"`||i===`'`){n=!0,r=i,e++;continue}if(i===`(`||i===`[`)t++;else if(i===`)`||i===`]`){if(t===0)break;t--}else if(i===`,`&&t===0)break;e++}return e}parseArgList(){let e=[];for(this.skipWhitespace();this.peek()!==`)`&&this.pos<this.source.length;)e.push(this.parseTernary()),this.skipWhitespace(),this.peek()===`,`&&(this.pos++,this.skipWhitespace());return e}},Nr=class{cache=new Map;maxSize;constructor(e=1e3){this.maxSize=e}compile(e,t){let n=`${e}::${t.join(`,`)}`;if(this.cache.has(n)){let e=this.cache.get(n);return e.hitCount++,e}this.cache.size>=this.maxSize&&this.evictLFU();let r={fn:this.compileExpression(e,t),varNames:[...t],expression:e,compiledAt:Date.now(),hitCount:1};return this.cache.set(n,r),r}compileExpression(e,t){let n=new Mr;return(...r)=>{let i={};for(let e=0;e<t.length;e++)i[t[e]]=r[e];return n.evaluate(e,i)}}evictLFU(){let e=null,t=1/0,n=1/0;for(let[r,i]of this.cache.entries())(i.hitCount<n||i.hitCount===n&&i.compiledAt<t)&&(e=r,t=i.compiledAt,n=i.hitCount);e&&this.cache.delete(e)}has(e,t){let n=`${e}::${t.join(`,`)}`;return this.cache.has(n)}clear(){this.cache.clear()}getStats(){let e=0,t=[];for(let n of this.cache.values())e+=n.hitCount,t.push({expression:n.expression,hitCount:n.hitCount});return{size:this.cache.size,maxSize:this.maxSize,totalHits:e,entries:t.sort((e,t)=>t.hitCount-e.hitCount)}}},Pr=class{functions=new Map;constructor(){this.registerDefaults()}register(e,t){this.functions.set(e.toUpperCase(),t)}get(e){return this.functions.get(e.toUpperCase())}has(e){return this.functions.has(e.toUpperCase())}getNames(){return Array.from(this.functions.keys())}toObject(){let e={};for(let[t,n]of this.functions)e[t]=n;return e}registerDefaults(){this.registerAggregationFunctions(),this.registerDateFunctions(),this.registerLogicFunctions(),this.registerStringFunctions(),this.registerStringSearchFunctions(),this.registerStatisticalFunctions()}registerAggregationFunctions(){this.register(`SUM`,(...e)=>P(e).reduce((e,t)=>e+t,0)),this.register(`AVG`,(...e)=>{let t=P(e);return t.length===0?0:t.reduce((e,t)=>e+t,0)/t.length}),this.register(`COUNT`,(...e)=>Fr(e).filter(e=>e!=null).length),this.register(`MIN`,(...e)=>{let t=P(e);return t.length===0?0:Math.min(...t)}),this.register(`MAX`,(...e)=>{let t=P(e);return t.length===0?0:Math.max(...t)})}registerDateFunctions(){this.register(`TODAY`,()=>new Date().toISOString().split(`T`)[0]),this.register(`NOW`,()=>new Date().toISOString()),this.register(`DATEADD`,(e,t,n)=>{let r=new Date(e);if(isNaN(r.getTime()))throw Error(`DATEADD: Invalid date "${e}"`);switch(String(n).toLowerCase()){case`day`:case`days`:r.setDate(r.getDate()+t);break;case`month`:case`months`:r.setMonth(r.getMonth()+t);break;case`year`:case`years`:r.setFullYear(r.getFullYear()+t);break;case`hour`:case`hours`:r.setHours(r.getHours()+t);break;case`minute`:case`minutes`:r.setMinutes(r.getMinutes()+t);break;default:throw Error(`DATEADD: Unsupported unit "${n}"`)}return r.toISOString()}),this.register(`DATEDIFF`,(e,t,n)=>{let r=new Date(e),i=new Date(t);if(isNaN(r.getTime()))throw Error(`DATEDIFF: Invalid date "${e}"`);if(isNaN(i.getTime()))throw Error(`DATEDIFF: Invalid date "${t}"`);let a=i.getTime()-r.getTime();switch(String(n).toLowerCase()){case`day`:case`days`:return Math.floor(a/864e5);case`month`:case`months`:return(i.getFullYear()-r.getFullYear())*12+(i.getMonth()-r.getMonth());case`year`:case`years`:return i.getFullYear()-r.getFullYear();case`hour`:case`hours`:return Math.floor(a/36e5);case`minute`:case`minutes`:return Math.floor(a/6e4);default:throw Error(`DATEDIFF: Unsupported unit "${n}"`)}}),this.register(`DATEFORMAT`,(e,t)=>{let n=new Date(e);if(isNaN(n.getTime()))throw Error(`DATEFORMAT: Invalid date "${e}"`);let r=(e,t=2)=>String(e).padStart(t,`0`);return t.replace(`YYYY`,String(n.getFullYear())).replace(`YY`,String(n.getFullYear()).slice(-2)).replace(`MM`,r(n.getMonth()+1)).replace(`DD`,r(n.getDate())).replace(`HH`,r(n.getHours())).replace(`mm`,r(n.getMinutes())).replace(`ss`,r(n.getSeconds()))})}registerLogicFunctions(){this.register(`IF`,(e,t,n)=>e?t:n),this.register(`AND`,(...e)=>e.every(Boolean)),this.register(`OR`,(...e)=>e.some(Boolean)),this.register(`NOT`,e=>!e),this.register(`SWITCH`,(e,...t)=>{for(let n=0;n<t.length-1;n+=2)if(e===t[n])return t[n+1];if(t.length%2==1)return t[t.length-1]})}registerStringFunctions(){this.register(`CONCAT`,(...e)=>e.map(e=>String(e??``)).join(``)),this.register(`LEFT`,(e,t)=>String(e??``).substring(0,t)),this.register(`RIGHT`,(e,t)=>{let n=String(e??``);return n.substring(Math.max(0,n.length-t))}),this.register(`TRIM`,e=>String(e??``).trim()),this.register(`UPPER`,e=>String(e??``).toUpperCase()),this.register(`LOWER`,e=>String(e??``).toLowerCase())}registerStringSearchFunctions(){this.register(`FIND`,(e,t,n)=>String(t??``).indexOf(String(e??``),n??0)),this.register(`REPLACE`,(e,t,n)=>String(e??``).split(String(t??``)).join(String(n??``))),this.register(`SUBSTRING`,(e,t,n)=>{let r=String(e??``);return n===void 0?r.substring(t):r.substring(t,t+n)}),this.register(`REGEX`,(e,t,n)=>{let r=String(e??``);return new RegExp(t,n).test(r)}),this.register(`LEN`,e=>String(e??``).length)}registerStatisticalFunctions(){this.register(`MEDIAN`,(...e)=>{let t=P(e).sort((e,t)=>e-t);if(t.length===0)return 0;let n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}),this.register(`STDEV`,(...e)=>{let t=P(e);if(t.length<2)return 0;let n=t.reduce((e,t)=>e+t,0)/t.length,r=t.map(e=>(e-n)**2).reduce((e,t)=>e+t,0)/(t.length-1);return Math.sqrt(r)}),this.register(`VARIANCE`,(...e)=>{let t=P(e);if(t.length<2)return 0;let n=t.reduce((e,t)=>e+t,0)/t.length;return t.map(e=>(e-n)**2).reduce((e,t)=>e+t,0)/(t.length-1)}),this.register(`PERCENTILE`,(e,...t)=>{let n=P(t).sort((e,t)=>e-t);if(n.length===0)return 0;let r=Math.max(0,Math.min(100,e))/100*(n.length-1),i=Math.floor(r),a=Math.ceil(r);if(i===a)return n[i];let o=r-i;return n[i]+o*(n[a]-n[i])})}};function P(e){let t=[];for(let n of e)if(Array.isArray(n))t.push(...P(n));else{let e=Number(n);isNaN(e)||t.push(e)}return t}function Fr(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...Fr(n)):t.push(n);return t}function Ir(e){return typeof e==`string`?{dialect:`cel`,source:e}:{dialect:e.dialect??`cel`,source:e.source}}var Lr=new Set,Rr=`[blank] the predicate is declared but empty — nothing to evaluate`;function zr(e,t,n,r){let i=e.source?.trim()?JSON.stringify([e.dialect,e.source]):JSON.stringify([e.dialect,e.source,r??``]);Lr.has(i)||(Lr.add(i),console.warn(`[object-ui] A conditional predicate failed to evaluate`+(r?` (${r})`:``)+` and was treated as its safe default (${String(t)}): `+JSON.stringify(e.source)+`. Reason: ${n}. Values are bound under 'record.' (e.g. record.status) — check the field names and CEL syntax.`))}function F(e,t,n,r,i,a){if(e==null)return n;let o=Ir(e),s,c=n;if(ct(e))s=Rr;else try{let e=w.evaluate(o,{record:t,previous:r,...i?{extra:i}:{}});e.ok?c=e.value===!0:s=`[${e.error.kind}] ${e.error.message}`}catch(e){s=`[throw] ${e instanceof Error?e.message:String(e)}`}return s===void 0?c:(a?.warn!==!1&&zr(o,n,s,a?.context),a?.onFault?.(s),n)}var Br=!0,Vr=!1,Hr=!1,Ur=!0,Wr=!1,Gr=!1;function Kr(e,t,n,r,i,a){let o=e=>({context:a?`${e} of ${a}`:e});return{visible:e.visibleWhen==null?Ur:F(e.visibleWhen,t,Br,r,i,o(`visibleWhen`)),readonly:n.readonly===!0||(e.readonlyWhen==null?Wr:F(e.readonlyWhen,t,Vr,r,i,o(`readonlyWhen`))),required:n.serverOwnedValue===!0?!1:n.required===!0||(e.requiredWhen==null?Gr:F(e.requiredWhen,t,Hr,r,i,o(`requiredWhen`)))}}var qr=new Set;function Jr(e,t,n,r){let i=r instanceof Error?r.message:String(r);if(e){e(i);return}let a=JSON.stringify([t,n]);qr.has(a)||(qr.add(a),console.warn(t===`template-part`?`Expression evaluation failed for: ${n}`:`Failed to evaluate expression: ${n}`,r))}var I=class e{context;cache;formulas;constructor(e,t,n){this.context=e instanceof kr?e:new kr(e||{}),this.cache=t||new Nr,this.formulas=n||new Pr}evaluate(e,t={}){if(e&&typeof e==`object`&&typeof e.source==`string`&&(e=e.source),typeof e!=`string`)return e;let{defaultValue:n,throwOnError:r=!1,sanitize:i=!0,onFault:a}=t;try{if(!e.includes("${"))return e;let t=e.match(/^\$\{([^}]+)\}$/);return t?this.evaluateExpression(t[1].trim(),{sanitize:i}):e.replace(/\$\{([^}]+)\}/g,(e,t)=>{try{let e=this.evaluateExpression(t.trim(),{sanitize:i});return String(e??``)}catch(n){if(r)throw n;return Jr(a,`template-part`,t,n),e}})}catch(t){if(r)throw t;return Jr(a,`whole-expression`,e,t),n??e}}evaluateExpression(e,t={}){let{sanitize:n=!0}=t;if(e&&e.trim()!==``){if(n&&this.isDangerous(e))throw Error(`Potentially dangerous expression detected: ${e}`);try{let t=this.context.toObject(),n={...this.formulas.toObject(),...t},r=Object.keys(n),i=Object.values(n);return this.cache.compile(e,r).fn(...i)}catch(t){throw Error(`Failed to evaluate expression "${e}": ${t.message}`)}}}isDangerous(e){return[/eval\s*\(/i,/Function\s*\(/i,/setTimeout\s*\(/i,/setInterval\s*\(/i,/import\s*\(/i,/require\s*\(/i,/process\./i,/global\./i,/window\./i,/document\./i,/__proto__/i,/constructor\s*\(/i,/prototype\./i].some(t=>t.test(e))}evaluateCondition(e,t={}){if(typeof e==`boolean`)return e;if(e&&typeof e==`object`&&e.dialect===`cel`&&typeof e.source==`string`)return this.evaluateCelCondition(e.source,t);if(e&&typeof e==`object`&&typeof e.source==`string`&&(e=e.source),!e)return!0;if(typeof e!=`string`)return!!e;let n=e.trim();if(!n)return!0;if(n.includes("${"))return!!this.evaluate(n,t);try{return!!this.evaluateExpression(n,{sanitize:t.sanitize!==!1})}catch(e){if(t.throwOnError)throw e;return t.onFault?.(e instanceof Error?e.message:String(e)),!0}}evaluateCelCondition(e,t){if(!e.trim())return!0;let n=this.context.toObject(),r=n.record,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n;if(!t.throwOnError)return F(e,i,!0,void 0,n,t.onFault?{warn:!1,onFault:t.onFault}:void 0);let a=F(e,i,!0,void 0,n,{warn:!1});if(a!==F(e,i,!1,void 0,n,{warn:!1}))throw Error(`CEL predicate failed to evaluate: ${e}`);return a}updateContext(e){Object.entries(e).forEach(([e,t])=>{this.context.set(e,t)})}getContext(){return this.context}withContext(t){return new e(this.context.createChild(t),this.cache,this.formulas)}getCacheStats(){return this.cache.getStats()}clearCache(){this.cache.clear()}getFormulas(){return this.formulas}registerFunction(e,t){this.formulas.register(e,t)}};new Nr,new Pr;var Yr=`record`,Xr=`data`;function Zr(e,t,n){if(typeof e!=`string`||!e.trim())return null;let r=g(e);if(!r||r.ok!==!0)return null;let i=y(e);return typeof i==`string`&&typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(t,i)?{kind:`bare-shorthand`,identifier:i,canonical:`${Yr}.${i}`}:n&&Array.isArray(r.roots)&&r.roots.includes(Xr)?{kind:`metadata-layer-root`,identifier:Xr,canonical:Yr}:null}function Qr(e){if(!e||typeof e!=`object`)return null;let t=new Set;if(Array.isArray(e))for(let n of e){let e=n?.name,r=n?.type;typeof e==`string`&&qt.has(r)&&t.add(e)}else for(let[n,r]of Object.entries(e)){let e=r?.type;qt.has(e)&&t.add(n)}return t.size>0?t:null}function $r(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=t.id??t._id;return typeof n==`string`||typeof n==`number`?String(n):void 0}function ei(e,t){if(!e||typeof e!=`object`)return e;let n=Qr(t);if(!n)return e;let r=null,i=(t,n)=>{r||={...e},r[t]=n};for(let t of n){if(!(t in e))continue;let n=e[t];if(Array.isArray(n)){if(!n.some(e=>$r(e)!==void 0))continue;i(t,n.map(e=>$r(e)??e));continue}let r=$r(n);r!==void 0&&i(t,r)}return r??e}var ti=/\$\{|===|!==|\?\.|\?\?|\.(?:includes|indexOf|toUpperCase|toLowerCase|startsWith|endsWith|trim|split|map|filter|reduce|find|some|every|join|slice|charAt|padStart|padEnd|replace|match|test)\s*\(/;function ni(e){return ti.test(e)}var ri=new Set;function ii(e){ri.has(e)||(ri.add(e),console.warn(`[object-ui] A conditional predicate uses the legacy expression dialect and is not portable to the server CEL engine: `+JSON.stringify(e)+`. Rewrite it as CEL (use "==" not "===", "x in [..]" for membership, ".contains()" not ".includes()", and drop template interpolation).`))}var ai=new Set;function oi(e,t,n){let r=JSON.stringify([t??``,e]);ai.has(r)||(ai.add(r),console.warn(`[object-ui] A conditional predicate failed to evaluate`+(t?` (${t})`:``)+` and was treated as its safe default: `+JSON.stringify(e)+(n?`. Reason: ${n}`:``)+`. Check the field names and CEL syntax.`))}function si(e,t,n){let r,i={warn:!1,onFault:e=>{r??=e}},a=F(e,t,!0,void 0,n,i);return a===F(e,t,!1,void 0,n,i)?{ok:!0,value:a}:{ok:!1,value:!1,reason:r}}function ci(e,t,n={}){let r=n.fallback??!1;if(e==null)return r;let i=typeof e==`string`?e:void 0;if(i!==void 0&&!i.trim())return r;let a=n.rowless?{}:ei(t&&typeof t==`object`?t:{},n.fields),o=n.rowless?{...n.scope??{}}:{...n.scope??{},record:a},s=i??(e&&typeof e==`object`&&typeof e.source==`string`?e.source:`(expression)`);if(i!==void 0&&ni(i)){ii(i);try{return new I(o).evaluateCondition(i,{throwOnError:!0})}catch(e){return n.warnOnError&&oi(i,n.label,`[legacy] ${e instanceof Error?e.message:String(e)}`),r}}if(!n.warnOnError)return F(e,a,r,void 0,o,{context:n.label});let c=si(e,a,o);return c.ok?c.value:(oi(s,n.label,c.reason),r)}function li(e,t,n={}){if(e==null||e===``)return{eligible:t,skipped:0};if(typeof e==`boolean`)return e?{eligible:t,skipped:0}:{eligible:[],skipped:t.length};let r=t.filter(t=>ci(e,t,{...n,warnOnError:n.warnOnError??!0,fallback:!1}));return{eligible:r,skipped:t.length-r.length}}function L(e){if(e==null)return`null`;let t=typeof e;return t===`string`?JSON.stringify(e):t===`number`||t===`boolean`?String(e):Array.isArray(e)?`[${e.map(L).join(`, `)}]`:JSON.stringify(String(e))}function ui(e){let{field:t,operator:n,value:r}=e;if(!t||!n)return null;let i=`record[${JSON.stringify(t)}]`;switch(n){case`equals`:return`${i} == ${L(r)}`;case`not_equals`:return`${i} != ${L(r)}`;case`greater_than`:return`${i} > ${L(r)}`;case`less_than`:return`${i} < ${L(r)}`;case`contains`:return`${i}.contains(${L(r)})`;case`in`:return`${i} in ${L(Array.isArray(r)?r:[r])}`;default:return null}}function di(e){return e.condition==null?typeof e.expression==`string`&&e.expression.trim()?e.expression:ui(e):e.condition}function fi(e){let t={};if(e.style&&typeof e.style==`object`)for(let[n,r]of Object.entries(e.style))r!=null&&(t[n]=String(r));return e.backgroundColor&&(t.backgroundColor=String(e.backgroundColor)),e.textColor&&(t.color=String(e.textColor)),e.borderColor&&(t.borderColor=String(e.borderColor)),t}function pi(e,t,n,r){if(!t||t.length===0)return{};let i=e&&typeof e==`object`?e:{};for(let e=0;e<t.length;e++){let a=t[e];if(!a||typeof a!=`object`)continue;let o=di(a);if(o!=null&&ci(o,i,{fallback:!1,scope:n,fields:r,label:`conditionalFormatting[${e}]`}))return fi(a)}return{}}function mi(e){return e?(Array.isArray(e)?e:[e]).map(e=>typeof e==`string`?e:e&&typeof e==`object`?e.field:null).filter(e=>typeof e==`string`&&e.length>0):[]}function hi(e,t){return mi(e).some(e=>Pt(t[e]))}function gi(e,t,n){return!e||e.length===0?[]:e.filter(e=>e?.visibleWhen==null||F(e.visibleWhen,t,!0,void 0,n,{context:`visibleWhen of option '${String(e.value)}'`}))}function _i(e){let{label:t}=e;return typeof t==`string`&&t.trim()!==``?t:String(e.value)}function vi(e,t){return Pt(e)?!0:Array.isArray(e)?e.every(e=>t.some(t=>t.value===e)):t.some(t=>t.value===e)}function yi(e,t,n,r){let i=mi(n),a=i.length>0&&hi(n,t);return{options:a?[]:gi(e,t,r),gated:a,dependsOnFields:i}}var bi=new Set([`select`,`multiselect`,`radio`,`checkboxes`]);function xi(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.type==`string`&&typeof t.objectName==`string`&&typeof t.recordId==`string`&&typeof t.timestamp==`number`}var Si=class e{undoStack=[];redoStack=[];maxHistory;listeners=new Set;constructor(e){this.maxHistory=e?.maxHistory??50}push(e){this.undoStack.push(e),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack=[],this.notify()}peekUndo(){return this.undoStack[this.undoStack.length-1]}peekRedo(){return this.redoStack[this.redoStack.length-1]}popUndo(){let e=this.undoStack.pop();return e&&(this.redoStack.push(e),this.notify()),e}popRedo(){let e=this.redoStack.pop();return e&&(this.undoStack.push(e),this.notify()),e}clear(){this.undoStack=[],this.redoStack=[],this.notify()}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get undoCount(){return this.undoStack.length}get redoCount(){return this.redoStack.length}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}getHistory(){return[...this.undoStack]}getRedoHistory(){return[...this.redoStack]}pushBatch(e){e.length!==0&&(this.undoStack.push(...e),this.undoStack.length>this.maxHistory&&this.undoStack.splice(0,this.undoStack.length-this.maxHistory),this.redoStack=[],this.notify())}popUndoBatch(e){let t=Math.min(e,this.undoStack.length);if(t===0)return[];let n=this.undoStack.splice(this.undoStack.length-t,t);return this.redoStack.push(...n),this.notify(),n}popRedoBatch(e){let t=Math.min(e,this.redoStack.length);if(t===0)return[];let n=this.redoStack.splice(this.redoStack.length-t,t);return this.undoStack.push(...n),this.notify(),n}static STORAGE_KEY=`objectui:undo-history`;saveToStorage(){try{let t=JSON.stringify({undoStack:this.undoStack,redoStack:this.redoStack});localStorage.setItem(e.STORAGE_KEY,t)}catch{}}loadFromStorage(){try{if(typeof localStorage>`u`)return;let t=localStorage.getItem(e.STORAGE_KEY);if(!t)return;let n=JSON.parse(t);Array.isArray(n.undoStack)&&(this.undoStack=n.undoStack.filter(xi)),Array.isArray(n.redoStack)&&(this.redoStack=n.redoStack.filter(xi)),this.undoStack.length>this.maxHistory&&this.undoStack.splice(0,this.undoStack.length-this.maxHistory),this.notify()}catch{}}notify(){this.listeners.forEach(e=>e())}},R=new Si,Ci=`type.actionType.name.label.description.confirmText.confirm.condition.disabled.api.endpoint.method.navigate.to.external.newTab.replace.onClick.reload.close.redirect.toast.successMessage.errorMessage.refreshAfter.undoable.params.actionParams.resultDialog.target.body.openIn.modal.chain.chainMode.onFailure.opensInNewTab.newTabUrl.locations.visible.requiredPermissions.icon.variant.order.component.objectName.ai.aria.bodyExtra.bodyShape.operation.patch.mode.recordIdField.recordIdParam.requiresFeature.onSuccess.shortcut.bulkEnabled`.split(`.`),wi=`_lock._lockDocsUrl._lockReason._lockSource._packageId._packageVersion._provenance.ai.aria.body.bodyExtra.bodyShape.bulkEnabled.component.confirmText.description.disabled.errorMessage.execute.icon.label.locations.method.mode.name.newTabUrl.objectName.onSuccess.openIn.opensInNewTab.operation.order.params.patch.recordIdField.recordIdParam.refreshAfter.requiredPermissions.requiresFeature.resultDialog.shortcut.successMessage.target.type.undoable.variant.visible`.split(`.`),Ti=[`to`,`external`,`newTab`,`replace`],Ei=[`overrideNotice`],Di={execute:"`execute` was removed in @objectstack/spec 17 (#3855) — rename the key to `target`. The value (a script name or expression) is unchanged. Run `os migrate meta --from 16` to rewrite it automatically."},Oi=new Set([...Ci,...wi,...Ti,...Ei].filter(e=>!(e in Di)));function ki(e){let t=[],n=[];if(!e||typeof e!=`object`)return{unknown:t,retired:n};for(let r of Object.keys(e))r in Di?n.push(r):Oi.has(r)||t.push(r);return{unknown:t,retired:n}}var z=new Set,Ai=()=>!1;function ji(e,t=`ActionRunner`){if(!Ai())return;let{unknown:n,retired:r}=ki(e),i=e?.name??e?.type??`(unnamed)`;for(let e of r){let n=`retired:${String(i)}:${e}`;z.has(n)||(z.add(n),console.warn(`[${t}] action "${String(i)}" carries the retired key \`${e}\`. ${Di[e]}`))}if(n.length===0)return;let a=`unknown:${String(i)}:${n.slice().sort().join(`,`)}`;z.has(a)||(z.add(a),console.warn(`[${t}] action "${String(i)}" carries ${n.length===1?`a key`:`keys`} no reader recognizes: \`${n.join("`, `")}\`. Nothing will read ${n.length===1?`it`:`them`} — check for a typo, or promote the key to an explicit field on \`ActionDef\` (packages/core/src/actions/ActionRunner.ts), adding it to \`ACTION_DEF_KEYS\` (packages/core/src/actions/actionKeys.ts) in the SAME commit — the pin test derives one from the other, so either edit alone goes red. Warned rather than rejected because \`tsc\` only sees actions authored in code: this one may have arrived as DATA, and stored \`sys_metadata\` rows reach the runner unparsed (objectstack#3903).`))}var Mi=new Set([`recordId`]),Ni=e=>!e.startsWith(`_`)&&!Mi.has(e);function Pi(e){if(!e||typeof e!=`object`)return!1;let{type:t,actionType:n,params:r}=e;return(t??n)!==`api`||!r||typeof r!=`object`||Array.isArray(r)?!1:Object.keys(r).some(Ni)}function Fi(e,t=`ActionRunner`){if(!Ai()||!Pi(e))return;let n=e?.name??`(unnamed)`,r=`deprecated-object-params:${String(n)}`;z.has(r)||(z.add(r),console.warn(`[${t}] action "${String(n)}" carries a static request payload in \`params\`. \`params\` is the parameter DEFINITION array (fields collected from the user before the action runs), never a payload map — put the payload in \`bodyExtra\` instead (objectstack#5777). Still read as the payload for one version window; the arm is removed at 18. \`bodyExtra\` is merged LAST, so it overrides anything left here.`))}function Ii(e,t){let n=e,r=n?.error;if(typeof r==`string`&&r.length>0)return r;let i=r?.message;return typeof i==`string`&&i.length>0?i:typeof n?.message==`string`&&n.message.length>0?n.message:t}function Li(e){return zi(e)?e.data:e}var Ri=new Set([`success`,`data`,`error`,`code`,`fields`]);function zi(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.success==`boolean`&&Object.keys(e).every(e=>Ri.has(e))}function Bi(e,t,n){let r=t?.data,i=zi(r)&&r.success===!1;return!e.ok||t&&t.success===!1||i?{ok:!1,error:i?Ii(r,`${n} failed`):Ii(t,`${n} failed (HTTP ${e.status})`)}:{ok:!0,envelope:r,payload:Li(r)}}function Vi(e){let t=e.user;if(t===void 0)return e;let n=e.os;return n&&typeof n==`object`&&n.user===t?e:{...e,os:{...n&&typeof n==`object`?n:{},user:t}}}var Hi=`recordId`,Ui=`recordObject`;function Wi(e){let t=e.objectName;return typeof t==`string`&&t.trim()!==``?t.trim():void 0}function Gi(e,t){return!t||!e.includes(`.`)?!1:!e.startsWith(`${t}.`)}function Ki(e){return e.operation===`update`}function qi(e,t){if(e.every(e=>Ji(t,e)))return Object.fromEntries(e.map(e=>[e,t[e]]))}function Ji(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}var B=class{handlers=new Map;scripts=new Map;evaluator;context;confirmHandler;toastHandler;modalHandler;navigationHandler;paramCollectionHandler;resultDialogHandler;builtinExecutors={script:e=>this.executeScript(e),url:e=>this.executeUrl(e),modal:e=>this.executeModal(e),flow:e=>this.executeFlow(e),api:e=>this.executeAPI(e),form:e=>this.executeForm(e),navigation:e=>this.executeNavigation(e)};constructor(e={}){this.context=Vi(e),this.evaluator=new I(this.context),this.confirmHandler=async e=>window.confirm(e),this.toastHandler=null,this.modalHandler=null,this.navigationHandler=null,this.paramCollectionHandler=null,this.resultDialogHandler=null}setConfirmHandler(e){this.confirmHandler=e}setToastHandler(e){this.toastHandler=e}setModalHandler(e){this.modalHandler=e}setNavigationHandler(e){this.navigationHandler=e}setParamCollectionHandler(e){this.paramCollectionHandler=e}setResultDialogHandler(e){this.resultDialogHandler=e}registerHandler(e,t){this.handlers.set(e,t)}unregisterHandler(e){this.handlers.delete(e)}registerScript(e,t){this.scripts.set(e,t)}unregisterScript(e){this.scripts.delete(e)}async execute(e){try{ji(e),Fi(e);let t=e.type||e.actionType||e.name||``;if(j(e.condition)&&!this.evaluator.evaluateCondition(e.condition))return{success:!1,error:`Action condition not met`};if(j(e.disabled)){let t=!1;try{t=this.evaluator.evaluateCondition(e.disabled)}catch{t=!1}if(t)return{success:!1,error:`Action is disabled`}}if(e.confirmText&&!await this.confirmHandler(this.evaluator.evaluate(e.confirmText)))return{success:!1,error:`Action cancelled by user`};let n=e.actionParams&&Array.isArray(e.actionParams)?e.actionParams:Array.isArray(e.params)?e.params:void 0;if(n&&n.length>0&&this.paramCollectionHandler){let t=await this.paramCollectionHandler(n,e);if(t===null)return{success:!1,error:`Action cancelled by user (params)`};let r=Array.isArray(e.params)?{}:e.params||{},i=r._rowRecord;e.params={...r,...t},i!==void 0&&(e.params._rowRecord=i)}if(Ki(e)){let t=await this.executeUpdateOperation(e);return await this.handlePostExecution(e,t),t}if(t&&this.handlers.has(t)){let n=await this.handlers.get(t)(e,this.context);return await this.handlePostExecution(e,n),n}let r,i=t?this.builtinExecutors[t]:void 0;return i?r=await i(e):e.navigate?r=await this.executeNavigation(e):e.api||e.endpoint?r=await this.executeAPI(e):e.onClick?(await e.onClick(),r={success:!0}):r=await this.executeActionSchema(e),await this.handlePostExecution(e,r),r}catch(t){let n={success:!1,error:t.message};return await this.handlePostExecution(e,n),n}}async executeChain(e,t=`sequential`){if(e.length===0)return{success:!0};if(t===`parallel`){let t=await Promise.allSettled(e.map(e=>this.execute(e)));if(t.filter(e=>e.status===`rejected`||e.status===`fulfilled`&&!e.value.success).length>0)return{success:!1,error:t.find(e=>e.status===`fulfilled`&&!e.value.success)?.value?.error||`One or more parallel actions failed`};let n=t[t.length-1];return n.status===`fulfilled`?n.value:{success:!1,error:`Action failed`}}let n={success:!0};for(let t of e)if(n=await this.execute(t),!n.success)return n;return n}async handlePostExecution(e,t){let n=!!(e.resultDialog&&t.success);if(this.toastHandler){let r=e.toast??{showOnSuccess:!0,showOnError:!0},i=e.toast?.duration;if(t.success&&!n&&!t.silent&&r.showOnSuccess!==!1){let n=(t.data&&typeof t.data==`object`&&typeof t.data.message==`string`?String(t.data.message).trim():``)||e.successMessage||`Action completed successfully`;if(t.undo)try{R.push(t.undo)}catch{}this.toastHandler(n,{type:`success`,duration:i,undo:t.undo?{}:void 0})}if(!t.success&&r.showOnError!==!1&&t.error){let n=e.errorMessage||t.error,r=typeof n==`string`?n:n&&typeof n.message==`string`?n.message:`Action failed`;this.toastHandler(r,{type:`error`,duration:i})}}if(n){if(this.resultDialogHandler)try{await this.resultDialogHandler(e.resultDialog,t.data,e)}catch(e){console.warn(`[ActionRunner] resultDialog handler rejected; treating as acknowledged`,e)}else console.warn(`[ActionRunner] action.resultDialog set but no resultDialogHandler registered — the response value will not be shown to the user.`,{action:e.name,data:t.data})}if(e.refreshAfter&&t.success&&(t.reload=!0),e.chain&&e.chain.length>0&&t.success){let n=await this.executeChain(e.chain,e.chainMode||`sequential`);n.success||(t.success=!1,t.error=n.error),n.data&&(t.data=n.data),n.redirect&&(t.redirect=n.redirect),n.reload&&(t.reload=!0)}if(t.success&&e.onSuccess){let n=Yi(e.onSuccess);n&&this.navigateOnSuccess(n,e,t)}if(!t.success&&e.onFailure){let t=Array.isArray(e.onFailure)?e.onFailure:[e.onFailure];await this.executeChain(t,`sequential`)}}navigateOnSuccess(e,t,n){let r=this.interpolateTarget(e.navigate,t,Li(n.data));if(!this.isValidUrl(r)){console.warn(`[ActionRunner] onSuccess.navigate resolved to a URL this runner refuses to open (only http://, https:// and relative URLs are allowed) — no navigation performed.`,{action:t.name,navigate:e.navigate,resolved:r});return}let i=e.openIn===`newTab`,a=r.startsWith(`http://`)||r.startsWith(`https://`);if(this.navigationHandler){this.navigationHandler(r,{external:a,newTab:i});return}i?window.open(r,`_blank`,`noopener,noreferrer`):n.redirect=r}async executeUpdateOperation(e){let t=this.handlers.get(`script`);if(!t)return{success:!1,error:"An `operation: \"update\"` action is written by the platform action route, which this client runner cannot reach: no `script` handler is registered. The write is never performed client-side — a direct data-plane update bypasses the route's permission floor, the object's hooks and its validations. Register a handler that POSTs to /api/v1/actions/{object}/{action} — build one with createServerActionHandler from @object-ui/core."};let n=e.params&&!Array.isArray(e.params)?{...e.params}:{},r={...e.patch&&typeof e.patch==`object`&&!Array.isArray(e.patch)?{...e.patch}:{},...n},i=n._rowRecord&&typeof n._rowRecord==`object`?n._rowRecord:void 0,a=Object.keys(r).filter(e=>e!==`_rowRecord`&&e!==`recordId`),o=await t({...e,params:r},this.context);if(!o.success)return o;if(e.undoable&&i&&a.length>0){let t=e.objectName||Wi(this.context),s=n.recordId??i.id;if(t&&s!=null){let n=qi(a,i);n?o.undo={id:`undo-${t}-${String(s)}-${Date.now()}`,type:`update`,objectName:t,recordId:String(s),timestamp:Date.now(),description:e.label||`Undo ${t}`,undoData:n,redoData:Object.fromEntries(a.map(e=>[e,r[e]]))}:console.warn("[ActionRunner] `undoable` update succeeded but offers no Undo: the row it ran on does not carry every field it wrote, so their prior values are unknown and an Undo would overwrite stored data. A list row carries a written field when the object declares it and the principal may read it.",{action:e.name,missing:a.filter(e=>!Ji(i,e))})}}return o}async executeScript(e){let t=e.target;if(!t)return e.body==null?typeof e.execute==`string`?{success:!1,error:"`execute` was removed in @objectstack/spec 17 — rename the key to `target`. The value (a script name or expression) is unchanged. Run `os migrate meta --from 16` to rewrite it automatically."}:{success:!1,error:`No script provided for script action`}:{success:!1,error:"Action body must be executed server-side — this client runner does not interpret `body` (sandboxed JS needs an isolated VM; expression bodies use the formula engine). Register a `script` handler that POSTs to /api/v1/actions/{object}/{action} — build one with createServerActionHandler from @object-ui/core."};let n=this.scripts.get(t);if(n)try{return await n(e,this.context)}catch(e){return{success:!1,error:`Script execution failed: ${e.message}`}}try{let e=this.evaluator.evaluate(`\${${t}}`);return e!=null&&typeof e.then==`function`&&(e=await e),{success:!0,data:e}}catch(e){return{success:!1,error:`Script execution failed: ${e.message}`}}}async executeUrl(e){let t=e.target||e.redirect;return t?this.navigateTo(e,t,e):{success:!1,error:`No URL provided for url action`}}async navigateTo(e,t,n){let r=this.interpolateTarget(t,e),i=this.evaluator.evaluate(r);if(!this.isValidUrl(i))return{success:!1,error:`Invalid URL scheme. Only http://, https://, and relative URLs are allowed.`};let a=typeof this.context.apiBase==`string`?this.context.apiBase.replace(/\/+$/,``):``;a&&/^\/(api|_auth|_account)\//.test(i)&&(i=`${a}${i}`);let o=!!n.external||i.startsWith(`http://`)||i.startsWith(`https://`);if(/\/(api|_auth|_account)\//.test(i)&&(o||i.startsWith(`/`)))return window.location.href=i,{success:!0};let s=n.openIn??e.openIn,c=s===`new-tab`?!0:s===`self`?!1:n.newTab??o,l=n.replace??e.replace;if(this.navigationHandler)return this.navigationHandler(i,{external:o,newTab:c,...l===void 0?{}:{replace:!!l}}),{success:!0};if(c)window.open(i,`_blank`,`noopener,noreferrer`);else return{success:!0,redirect:i};return{success:!0}}async executeModal(e){let t=e.modal||e.target||e.params?.schema;return t?this.modalHandler?await this.modalHandler(t,this.context):{success:!0,modal:t}:{success:!1,error:`No modal schema or target provided for modal action`}}async executeFlow(e){let t=e.target||e.name;return t?this.handlers.has(`flow`)?await this.handlers.get(`flow`)(e,this.context):{success:!1,error:`Flow handler not registered. Cannot execute flow: ${t}`}:{success:!1,error:`No flow target provided for flow action`}}async executeActionSchema(e){let t=!!(e.api||e.endpoint);if(!(t||e.onClick||e.redirect||e.reload===!0||e.close===!0))return{success:!1,error:`Action "${e.name||e.type||e.actionType||`action`}" is not executable: no handler is registered under that name and it declares no api, endpoint, navigate, redirect or onClick.`};let n={success:!0};if(t){let t=await this.executeAPI(e);if(!t.success)return t;n.data=t.data}return e.onClick&&await e.onClick(),n.reload=e.reload!==!1,n.close=e.close!==!1,e.redirect&&(n.redirect=this.evaluator.evaluate(e.redirect)),n}async executeForm(e){let t=this.evaluator.evaluate(e.target);if(!t||typeof t!=`string`)return{success:!1,error:`No form target (FormView name) provided for form action`};let n=(this.context.record&&this.context.record.id)??(this.context.data&&this.context.data.id),r=`/forms/${t}`,i=Wi(this.context),a=n==null||Gi(t,i)?r:`${r}?${Hi}=${encodeURIComponent(String(n))}`+(i?`&${Ui}=${encodeURIComponent(i)}`:``);return this.navigationHandler?(this.navigationHandler(a,{external:!1}),{success:!0}):{success:!0,redirect:a}}async executeNavigation(e){let t=e.navigate||e,n=t.to||t.target||t.redirect;return n?this.navigateTo(e,n,t):{success:!1,error:`No URL provided for navigation action`}}buildApiRequestBody(e){let t=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:void 0,n=t(e.bodyExtra),r=t(e.params)??this.context.data,i=e.bodyShape,a=i&&typeof i==`object`&&typeof i.wrap==`string`&&i.wrap?i.wrap:void 0;return a?{[a]:r??{},...n}:n?{...t(r),...n}:r??{}}async executeAPI(e){let t=e.api||e.endpoint||e.target;if(!t)return{success:!1,error:`No API endpoint provided`};try{let n,r,i={"Content-Type":`application/json`},a,o=`json`;if(typeof t==`string`)n=this.interpolateTarget(t,e),r=e.method||`POST`,a=JSON.stringify(this.buildApiRequestBody(e));else{let s=t;if(n=this.interpolateTarget(s.url,e),r=s.method||e.method||`POST`,i={...i,...s.headers},o=s.responseType||`json`,s.queryParams){let e=new URLSearchParams(s.queryParams);n=`${n}${n.includes(`?`)?`&`:`?`}${e.toString()}`}s.body?a=typeof s.body==`string`?s.body:JSON.stringify(s.body):r!==`GET`&&r!==`HEAD`&&(a=JSON.stringify(this.buildApiRequestBody(e)))}let s={method:r,headers:i};a&&r!==`GET`&&r!==`HEAD`&&(s.body=a);let c=await fetch(n,s);if(!c.ok)throw Error(`HTTP ${c.status}: ${c.statusText}`);let l;switch(o){case`text`:l=await c.text();break;case`blob`:l=await c.blob();break;default:l=await c.json()}return{success:!0,data:l}}catch(e){return{success:!1,error:e.message}}}isValidUrl(e){return typeof e==`string`&&(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)||e.startsWith(`./`))}interpolateTarget(e,t,n){if(typeof e!=`string`||e.indexOf("${")===-1)return e;let r={param:t.params&&typeof t.params==`object`&&!Array.isArray(t.params)?t.params:{},ctx:this.buildInterpolationContext()};n!==void 0&&(r.result=n);let i=RegExp(`\\$\\{(${Object.keys(r).join(`|`)})\\.([\\w.]+)\\}`,`g`);return e.replace(i,(e,t,n)=>{let i=Xi(r[t],n);return i==null?``:encodeURIComponent(String(i))})}buildInterpolationContext(){let e={origin:typeof window<`u`?window.location.origin:``,apiBase:typeof this.context.apiBase==`string`?this.context.apiBase.replace(/\/+$/,``):``,user:this.context.user??{},org:this.context.org??this.context.organization??{},recordId:this.context.record?.id??this.context.recordId,selection:{ids:Array.isArray(this.context.selectedRecords)?this.context.selectedRecords.map(e=>e?.id).filter(e=>e!=null).map(String):[],count:Array.isArray(this.context.selectedRecords)?this.context.selectedRecords.length:0}};return this.context.ctx&&typeof this.context.ctx==`object`&&Object.assign(e,this.context.ctx),e}updateContext(e){this.context=Vi({...this.context,...e}),this.evaluator.updateContext(this.context)}getContext(){return this.context}getEvaluator(){return this.evaluator}};function Yi(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.navigate;return typeof t!=`string`||t===``?null:e}function Xi(e,t){if(e!=null)return t.split(`.`).reduce((e,t)=>{if(e!=null)return e[t]},e)}function Zi(e){return e.toLowerCase().split(`+`).map(e=>e.trim()).sort().join(`+`)}var Qi=new Set;function $i(e,t,n){let r=typeof t==`string`?t:t&&typeof t==`object`&&typeof t.source==`string`?t.source:String(t),i=`${String(e)}::${r}`;if(Qi.has(i))return;Qi.add(i);let a=n instanceof Error?n.message:String(n);console.warn(`[ActionEngine] action "${String(e)}" hidden: its \`visible\` predicate threw — ${a}. Predicate: ${r}. Action predicates evaluate against { record, recordId, objectName, user, os.user, … }; use \`record.<field>\` (not a bare field).`)}var ea=class{actions=new Map;shortcuts=[];normalizedShortcutMap=new Map;runner;constructor(e={}){this.runner=e instanceof B?e:new B(e)}getRunner(){return this.runner}registerAction(e,t){let n=e.name||e.type||``;if(!n)throw Error(`Action must have a name or type`);this.actions.set(n,{action:e,locations:t?.locations||[],shortcut:t?.shortcut,bulkEnabled:t?.bulkEnabled??!1,priority:t?.priority??100}),t?.shortcut&&(this.shortcuts.push({keys:t.shortcut,actionName:n}),this.normalizedShortcutMap.set(Zi(t.shortcut),n))}registerActions(e){for(let t of e)this.registerAction(t,{locations:t.locations})}unregisterAction(e){let t=this.actions.get(e);t?.shortcut&&this.normalizedShortcutMap.delete(Zi(t.shortcut)),this.actions.delete(e),this.shortcuts=this.shortcuts.filter(t=>t.actionName!==e)}getActionsForLocation(e){let t=this.runner.getEvaluator();return Array.from(this.actions.values()).filter(t=>t.locations.includes(e)).filter(e=>{let t=e.action.requiredPermissions;if(!Array.isArray(t)||t.length===0)return!0;let n=this.runner.getContext()?.user?.systemPermissions;return!Array.isArray(n)||t.every(e=>n.includes(e))}).filter(e=>{let n=e.action.visible;if(!j(n))return!0;let r=st(n);try{return t.evaluateCondition(r,{throwOnError:!0})}catch(t){return $i(e.action.name,n,t),!1}}).sort((e,t)=>(e.priority??100)-(t.priority??100)).map(e=>e.action)}getBulkActions(){return Array.from(this.actions.values()).filter(e=>e.bulkEnabled).sort((e,t)=>(e.priority??100)-(t.priority??100)).map(e=>e.action)}getShortcuts(){return[...this.shortcuts]}getAction(e){return this.actions.get(e)?.action}async executeAction(e,t){let n=this.actions.get(e);return n?(t&&this.runner.updateContext(t),this.runner.execute(n.action)):{success:!1,error:`Action not found: ${e}`}}async handleShortcut(e,t){let n=this.normalizedShortcutMap.get(Zi(e));return n?this.executeAction(n,t):null}async executeBulk(e,t,n){let r=this.actions.get(e);if(!r)return{total:0,succeeded:0,failed:0,results:[{success:!1,error:`Action not found: ${e}`}]};if(!r.bulkEnabled)return{total:0,succeeded:0,failed:0,results:[{success:!1,error:`Action ${e} does not support bulk operations`}]};let i=[],a=0,o=0;if(n?.parallel){let e=t.map(e=>(this.runner.updateContext({record:e,selectedRecords:t}),this.runner.execute(r.action))),n=await Promise.allSettled(e);for(let e of n)e.status===`fulfilled`?(i.push(e.value),e.value.success?a++:o++):(i.push({success:!1,error:e.reason?.message||`Unknown error`}),o++)}else for(let e of t){this.runner.updateContext({record:e,selectedRecords:t});let s=await this.runner.execute(r.action);if(i.push(s),s.success)a++;else if(o++,!n?.continueOnError)break}return{total:t.length,succeeded:a,failed:o,results:i}}updateContext(e){this.runner.updateContext(e)}clear(){this.actions.clear(),this.shortcuts=[],this.normalizedShortcutMap.clear()}};async function ta(e,t){let{ids:n,allowBulk:r,offset:i,label:a=`bulk`}=e,o={succeeded:0,failed:0,errors:[]};if(r&&typeof t.bulkCall==`function`)try{let e=await t.bulkCall(n),r=Math.max(0,Math.min(e,n.length));o.succeeded+=r;let s=n.length-r;return s>0&&(o.failed+=s,o.errors.push({id:`batch_${i}`,error:`${s} record${s===1?``:`s`} failed in ${a}`})),o}catch{}return(await Promise.allSettled(n.map(e=>t.perRow(e)))).forEach((e,t)=>{e.status===`fulfilled`?o.succeeded+=1:(o.failed+=1,o.errors.push({id:n[t],error:e.reason instanceof Error?e.reason.message:String(e.reason)}))}),o}function na(e){let t=e.locations;return Array.isArray(t)?t.some(e=>e===`list_item`||e===`record_header`||e===`record_more`||e===`record_section`):!1}function ra(e,t){let n=e.params&&!Array.isArray(e.params)?e.params:{},r=n._rowRecord,i=e.recordIdField||`id`,a=n.recordId??r?.[i],o=Array.isArray(n._selectedIds);if(a==null&&!o){let n=Array.isArray(t?.selectedRecords)?t.selectedRecords:[];if(n.length===1)a=n[0]?.[i];else if(n.length>1)return{error:`This action runs on a single record — select exactly one row.`};else if(na(e))return{error:`This action runs on a single record — select a row first.`}}return{recordId:a??void 0}}function ia(e){let{fetch:t,resolveObject:n,onRefresh:r}=e,i=e.resolveRecordId??ra,a=new Set;return async function(o,s){let c=o.name;if(!c)return{success:!1,error:`Action has no name — a server action must declare one`};let l=o.params&&!Array.isArray(o.params)?{...o.params}:{};delete l._rowRecord;let u=i(o,s);if(u.error)return{success:!1,error:u.error};let d=u.recordId,f=`${c}:${d??``}`;if(a.has(f))return{success:!1,error:`Action already in progress`};a.add(f);try{let i=typeof e.baseUrl==`function`?e.baseUrl():e.baseUrl??``,a=o.objectName||n?.(o,s)||`global`,u=await t(`${i}/api/v1/actions/${encodeURIComponent(a)}/${encodeURIComponent(c)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:d,params:l})}),f=Bi(u,await u.json().catch(()=>null),`Action "${c}"`);if(!f.ok)return{success:!1,error:f.error};let p=o.refreshAfter!==!1;return p&&r?.(),{success:!0,data:f.envelope,reload:p}}catch(e){return{success:!1,error:e.message}}finally{a.delete(f)}}}function aa(e,t){let n=e?.recordIdParam;if(!n||!t||typeof t!=`object`)return{};let r=e?.recordIdField||`id`,i=e?.label||e?.name||n;if(!(r in t))return{error:`Action "${i}" identifies its record by "${r}", but that field is not present on the row. Add it to the view's columns, or check that it is readable — running without it would send a request that names no record.`};let a=t[r];return a==null?{error:`Action "${i}" identifies its record by "${r}", but this record has no value for it — running without it would send a request that names no record.`}:{value:a}}var oa=`sys_permission_set`;function sa(e){return e?.managed_by===`package`}var ca=Object.freeze({confirmText(e,t){let{objectName:n,t:r}=e;return n===oa&&sa(t)?r(`objectActions.resetPackageSetConfirm`,{defaultValue:`This permission set ships with an installed package and cannot be removed. Deleting resets it to the shipped baseline and discards your environment customization. Continue?`}):r(`objectActions.deleteConfirm`)},async run(e,t){let{objectName:n,t:r,label:i,dataSource:a,toast:o,onRefresh:s}=e,c=t.params,l=Array.isArray(c?.records)?c.records.filter(e=>e?.id!=null):null;if(l&&l.length>1){let e=await Promise.allSettled(l.map(e=>a.delete(n,e.id))),t=e.filter(e=>e.status===`rejected`).length,c=e.length-t;return s?.(),t===0?(o.success(r(`objectActions.bulkDeleteSuccess`,{count:c,label:i,defaultValue:`Deleted ${c} ${i} records`})),{success:!0,reload:!0,silent:!0}):(o.error(r(`objectActions.bulkDeletePartial`,{succeeded:c,failed:t,defaultValue:`${c} deleted, ${t} failed`})),{success:!1})}let u=c?.recordId??c?.record?.id??l?.[0]?.id??t.recordId;if(!u)return{success:!1,error:r(`objectActions.noRecordId`)};let d=!1;if(n===oa)try{d=sa(c?.record?.managed_by===void 0?await a.findOne(n,u):c.record)}catch{}try{return await a.delete(n,u),s?.(),o.success(d?r(`objectActions.resetPackageSetSuccess`,{defaultValue:`Permission set reset to its shipped baseline`}):r(`objectActions.deleteSuccess`,{label:i})),{success:!0,reload:!0,silent:!0}}catch(e){return o.error(r(`objectActions.deleteFailed`,{label:i}),{description:e.message}),{success:!1}}}});function la(e){if(e!=null)return e.id??e._id??e.recordId}function ua(e,t){let n={};for(let[r,i]of Object.entries(e))if(i&&typeof i==`object`&&!Array.isArray(i)&&typeof i.$ref==`number`){let e=i.$ref,a=la(t[e]);if(a===void 0)throw Error(`batchTransaction: field "${r}" references operation ${e}, which has not produced an id (forward or invalid $ref)`);n[r]=a}else n[r]=i;return n}async function da(e,t){let n=[],r=[];try{for(let i of t){let t=i.action??`create`;if(t===`create`){let t=await e.create(i.object,ua(i.data??{},n));n.push(t);let a=la(t);a&&r.push({object:i.object,id:a})}else if(t===`update`){if(i.id==null)throw Error(`batchTransaction: update on "${i.object}" requires an id`);n.push(await e.update(i.object,i.id,ua(i.data??{},n)))}else{if(i.id==null)throw Error(`batchTransaction: delete on "${i.object}" requires an id`);n.push(await e.delete(i.object,i.id))}}return{results:n}}catch(t){throw r.length>0&&await Promise.allSettled([...r].reverse().map(t=>e.delete(t.object,t.id))),t}}function fa(e,t){return typeof e.batchTransaction==`function`?e.batchTransaction(t):da(e,t)}function pa(e,t,n){let r=e;if(t&&(r=r.replace(/\/+$/,``)+`/`+t.replace(/^\/+/,``)),n&&Object.keys(n).length>0){let e=new URLSearchParams;for(let[t,r]of Object.entries(n))r!=null&&e.set(t,String(r));let t=e.toString();t&&(r+=(r.includes(`?`)?`&`:`?`)+t)}return r}function ma(e){if(!e)return{};let t={};return e.$select?.length&&(t.$select=e.$select.join(`,`)),e.$filter&&Object.keys(e.$filter).length>0&&(t.$filter=JSON.stringify(e.$filter)),e.$orderby&&(t.$orderby=typeof e.$orderby==`string`?e.$orderby:Array.isArray(e.$orderby)?typeof e.$orderby[0]==`string`?e.$orderby.join(`,`):e.$orderby.map(e=>`${e.field} ${e.order||`asc`}`).join(`,`):Object.entries(e.$orderby).map(([e,t])=>`${e} ${t}`).join(`,`)),e.$skip!==void 0&&(t.$skip=e.$skip),e.$top!==void 0&&(t.$top=e.$top),e.$expand?.length&&(t.$expand=e.$expand.join(`,`)),e.$search&&(t.$search=e.$search),e.$count&&(t.$count=`true`),t}function ha(e,t){return{...e,...t}}var ga=class{readConfig;writeConfig;fetchFn;defaultHeaders;constructor(e){this.readConfig=e.read,this.writeConfig=e.write,this.fetchFn=e.fetch??globalThis.fetch.bind(globalThis),this.defaultHeaders=e.defaultHeaders??{}}async request(e,t={}){if(!e)throw Error(`ApiDataSource: No HTTP configuration provided for this operation. Ensure the ViewData has read/write configs.`);let n=t.method??e.method??`GET`,r={...e.params,...t.queryParams},i=pa(e.url,t.pathSuffix,r),a=ha(ha(this.defaultHeaders,e.headers),t.headers),o={method:n,headers:a};t.body!==void 0&&n!==`GET`&&(t.body instanceof FormData||t.body instanceof Blob?o.body=t.body:typeof t.body==`string`?(o.body=t.body,a[`Content-Type`]||=`text/plain`):(o.body=JSON.stringify(t.body),a[`Content-Type`]||=`application/json`));let s=await this.fetchFn(i,o);if(!s.ok){let e=await s.text().catch(()=>``);throw Error(`ApiDataSource: HTTP ${s.status} ${s.statusText} — ${e}`)}return(s.headers.get(`content-type`)??``).includes(`application/json`)?s.json():await s.text()}async find(e,t){let n=ma(t),r=await this.request(this.readConfig,{method:`GET`,queryParams:n});return this.normalizeQueryResult(r)}async findOne(e,t,n){try{let e=ma(n);return await this.request(this.readConfig,{pathSuffix:String(t),method:`GET`,queryParams:e})??null}catch{return null}}async create(e,t){let n=this.writeConfig??this.readConfig;return this.request(n,{method:`POST`,body:t})}async update(e,t,n,r){let i=this.writeConfig??this.readConfig;return this.request(i,{pathSuffix:String(t),method:`PATCH`,body:n,...r?.ifMatch?{headers:{"If-Match":String(r.ifMatch)}}:{}})}async delete(e,t,n){let r=this.writeConfig??this.readConfig;try{return await this.request(r,{pathSuffix:String(t),method:`DELETE`,...n?.ifMatch?{headers:{"If-Match":String(n.ifMatch)}}:{}}),!0}catch{return!1}}batchTransaction(e){return da(this,e)}async getObjectSchema(e){return{name:e,fields:{}}}async getView(e,t){return null}async getApp(e){return null}async aggregate(e,t){let n={field:t.field,function:t.function,groupBy:t.groupBy};t.filter&&(n.filter=typeof t.filter==`string`?t.filter:JSON.stringify(t.filter));let r=await this.request(this.readConfig,{pathSuffix:`aggregate`,method:`GET`,queryParams:n});return Array.isArray(r)?r:r?.data&&Array.isArray(r.data)?r.data:r?.results&&Array.isArray(r.results)?r.results:[]}normalizeQueryResult(e){if(Array.isArray(e))return{data:e,total:e.length};if(e&&typeof e==`object`){if(Array.isArray(e.data)&&(`total`in e||`totalCount`in e))return{data:e.data,total:e.total??e.totalCount??e.data.length,hasMore:e.hasMore,cursor:e.cursor};for(let t of[`data`,`items`,`results`,`records`,`value`])if(Array.isArray(e[t]))return{data:e[t],total:e.total??e.totalCount??e.count??e[t].length,hasMore:e.hasMore??e.hasNextPage};return{data:[e],total:1}}return{data:[],total:0}}};T();function V(e,t){return t?e[t]:e.id??e._id}function H(e,t){return e.add(`[ObjectUI] ValueDataSource: ${t}. Rows are excluded rather than passed through.`),!1}function _a(e){return`filter rule refused as it is lowered: ${e.message.replace(/^\[ObjectUI\]\s*/,``).replace(/\.\s*$/,``)}`}var va=new Set([`$in`,`$nin`,`$between`]),ya=new Set([`in`,`nin`,`between`]),ba=new Set([`is_null`,`is_not_null`]);function xa(e,t,n){return H(e,`filter comparand for field '${t}' on operator '${n}' is an ARRAY, which is a declared comparand only for $in / $nin / $between. The spec leaves an array in any other position unruled and the sibling in-memory matcher (@objectstack/formula) refuses it; express membership as { ${t}: { $in: [...] } } or its negation { ${t}: { $nin: [...] } }`)}function Sa(e,t,n,r){return H(e,de(t,n,r))}var Ca=new Set([`$eq`,`$ne`,`$gt`,`$gte`,`$lt`,`$lte`]),wa=new Set([`=`,`!=`,`>`,`>=`,`<`,`<=`]),U=Symbol(`ValueDataSource:refused-comparand`);function Ta(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&`$field`in e}function Ea(e,t,n,r,i,a,o){let s=t.$field;return typeof s==`string`?a.has(n)?`addDays`in t&&t.addDays!==void 0?(H(o,`the { $field } reference on field '${i}' carries an addDays offset, which is defined against the referenced column's temporal class; this matcher has no field types to read one from, and answering without the offset would compare against an unshifted column and return the wrong rows`),U):s.includes(`.`)?(H(o,`the { $field } reference on field '${i}' names the dotted path '${s}'; this matcher addresses a flat record, so a dotted reference would not mean the same thing as the dotted field name on the other side of the comparison`),U):e[s]:(H(o,`a { $field } reference is not a comparand for operator '${r}' on field '${i}'. It is declared only on the six scalar comparisons ($eq/$ne/$gt/$gte/$lt/$lte and their AST spellings); the spec removed it from $in / $nin members and $between endpoints because no backend resolves one there`),U):(H(o,`filter comparand for field '${i}' carries a non-string $field (${ue(s)}); a field reference declares $field as a string, so this is not one on any path`),U)}function Da(e,t,n){return H(e,`a { $field } reference appears inside the list comparand of '${n}' on field '${t}'. A reference may be the WHOLE comparand of a scalar comparison, never a member of $in / $nin nor an endpoint of $between — the spec removed those positions because no evaluation path resolved them`)}function W(e,t){if(e instanceof Date&&t instanceof Date){let n=e.getTime();return!Number.isNaN(n)&&n===t.getTime()}return e===t}function Oa(e,t,n){let r=t[0],i=t[1],a=i===`not in`?`nin`:te(i),o=e[r],s=t[2];if(Array.isArray(s)&&!ya.has(a)&&!ba.has(a))return xa(n,r,String(i));if(Array.isArray(s)&&s.some(Ta))return Da(n,r,String(i));let c=Ta(s)?Ea(e,s,a,String(i),r,wa,n):s;if(c===U)return!1;switch(a){case`is_null`:return o==null;case`is_not_null`:return o!=null;case`=`:return W(o,c);case`!=`:return!W(o,c);case`>`:return o>c;case`>=`:return o>=c;case`<`:return o<c;case`<=`:return o<=c;case`in`:return Array.isArray(c)&&c.some(e=>W(o,e));case`nin`:return Array.isArray(c)&&!c.some(e=>W(o,e));case`contains`:return typeof o==`string`&&o.includes(String(c));case`icontains`:return D(c)?Sa(n,r,String(i),c):typeof o==`string`&&p(o,c);case`not_contains`:return!(typeof o==`string`&&o.includes(String(c)));case`starts_with`:return typeof o==`string`&&o.startsWith(String(c));case`ends_with`:return typeof o==`string`&&o.endsWith(String(c));case`between`:return Array.isArray(c)&&c.length===2&&o>=c[0]&&o<=c[1];default:return H(n,`filter operator '${String(i)}' is not implemented by the in-memory matcher`)}}function ka(e,t,n){if(!Array.isArray(t))return H(n,`filter node ${JSON.stringify(t)??String(t)} is not an array`);if(t.length===0)return!0;let r=t[0];if(typeof r==`string`){let i=r.toLowerCase();if(i===`and`||i===`or`){if(t.length<2)return H(n,`'${i}' group carries no conditions`);let r=t.slice(1);return i===`and`?r.every(t=>ka(e,t,n)):r.some(t=>ka(e,t,n))}}return Array.isArray(r)?t.every(t=>ka(e,t,n)):typeof r==`string`&&typeof t[1]==`string`&&t.length<=3?Oa(e,t,n):H(n,`filter node ${JSON.stringify(t)} is not a shape the matcher reads`)}function Aa(e,t,n,r,i,a){if(Array.isArray(r)&&!va.has(n))return xa(a,i,n);if(Array.isArray(r)&&r.some(Ta))return Da(a,i,n);let o=Ta(r)?Ea(e,r,n,n,i,Ca,a):r;if(o===U)return!1;switch(n){case`$eq`:return W(t,o);case`$ne`:return!W(t,o);case`$gt`:return t>o;case`$gte`:return t>=o;case`$lt`:return t<o;case`$lte`:return t<=o;case`$in`:return Array.isArray(o)&&o.some(e=>W(t,e));case`$nin`:return Array.isArray(o)&&!o.some(e=>W(t,e));case`$between`:return Array.isArray(o)&&o.length===2&&t>=o[0]&&t<=o[1];case`$contains`:return typeof t==`string`&&t.includes(String(o));case`$icontains`:return D(o)?Sa(a,i,n,o):typeof t==`string`&&p(t,o);case`$notContains`:return!(typeof t==`string`&&t.includes(String(o)));case`$startsWith`:return typeof t==`string`&&t.startsWith(String(o));case`$endsWith`:return typeof t==`string`&&t.endsWith(String(o));case`$null`:return o?t==null:t!=null;case`$exists`:return o?t!=null:t==null;case`$field`:return H(a,`field '${i}' carries a bare { $field } object, which reads as an operator named '$field' rather than as a comparand. Write the explicit comparison { ${i}: { $eq: { $field: ${JSON.stringify(String(r))} } } }`);default:{let e=u[n];return e?H(a,`filter operator '${n}' on field '${i}' is retired. ${e.why}`):n.startsWith(`$`)?H(a,`filter operator '${n}' on field '${i}' is not implemented by the in-memory matcher`):H(a,`filter condition on field '${i}' carries the non-operator key '${n}'; the in-memory matcher does not descend into a nested relation constraint`)}}}function ja(e,t,n,r){if(!Array.isArray(n))return H(r,`filter combinator '${t}' takes an ARRAY of conditions; received ${typeof n==`object`&&n?`an object`:typeof n}: ${JSON.stringify(n)??String(n)}. The spec declares '${t}?: FilterCondition[]' (FilterConditionSchema, data/filter.zod.ts)`);for(let e of n)if(typeof e!=`object`||!e||Array.isArray(e))return H(r,`every member of filter combinator '${t}' must be a filter condition OBJECT; received ${JSON.stringify(e)??String(e)}. The spec declares '${t}?: FilterCondition[]' (FilterConditionSchema, data/filter.zod.ts)`);return t===`$and`?n.every(t=>Ma(e,t,r)):n.some(t=>Ma(e,t,r))}function Ma(e,t,n){for(let[r,i]of Object.entries(t)){if(r===`$and`||r===`$or`){if(!ja(e,r,i,n))return!1;continue}if(r===`$not`)return H(n,`filter combinator '$not' is not executed by the object-dialect matcher. Its NULL-safe semantics are ruled (objectstack#5146) but this repo's own lowering refuses it too: FILTER_ARRAY_LOGIC_KEYWORDS is ['and', 'or'], so the filter AST has no negation keyword, and rewriting the negation inward would be silently partial ('startswith', 'endswith', 'between' and 'icontains' have no negated counterpart). Express the negation with a negated operator instead ($ne, $nin, $notContains); note those follow each operator's own answer for a missing value rather than $not's NULL-safe rule`);if(r.startsWith(`$`))return H(n,`filter key '${r}' is not a field name and not one of the combinators this matcher executes ($and / $or). The spec's LOGICAL_OPERATORS are $and / $or / $not and nothing else`);let t=e[r];if(i&&typeof i==`object`&&!Array.isArray(i)&&!S(i)){for(let[a,o]of Object.entries(i))if(!Aa(e,t,a,o,r,n))return!1}else if(Array.isArray(i))return xa(n,r,`implicit equality`);else if(!W(t,i))return!1}return!0}function Na(e){for(let[t,n]of Object.entries(e)){if(t===`$and`||t===`$or`){if(!Array.isArray(n))continue;for(let e of n){if(typeof e!=`object`||!e||Array.isArray(e))continue;let t=Na(e);if(t)return t}continue}if(t.startsWith(`$`)||typeof n!=`object`||!n||Array.isArray(n)||Object.keys(n).length>0)continue;let e=ke({[t]:n});if(!e.ok)return e.refusal}}function Pa(e,t){if(!t)return e;let n=[];return Array.isArray(t)?n=t.map(e=>typeof e==`string`?e.startsWith(`-`)?{field:e.slice(1),order:`desc`}:{field:e,order:`asc`}:{field:e.field,order:e.order??`asc`}):typeof t==`object`&&(n=Object.entries(t).map(([e,t])=>({field:e,order:t}))),n.length===0?e:[...e].sort((e,t)=>{for(let{field:r,order:i}of n){let n=e[r],a=t[r];if(n===a)continue;if(n==null)return i===`asc`?-1:1;if(a==null)return i===`asc`?1:-1;let o=n<a?-1:1;return i===`asc`?o:-o}return 0})}function Fa(e,t){if(!t||t.length===0)return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}var Ia=class{items;idField;mutationListeners=new Set;constructor(e){this.items=structuredClone(e.items),this.idField=e.idField}emitMutation(e){for(let t of this.mutationListeners)try{t(e)}catch(e){console.warn(`ValueDataSource: mutation listener error`,e)}}async find(e,t){let n=[...this.items];if(t?.$filter){let e=new Set;if(Array.isArray(t.$filter)){let r=ke(t.$filter);if(!r.ok)H(e,_a(r.refusal)),n=[];else if(Array.isArray(r.node)&&r.node.length>0){let t=r.node;n=n.filter(n=>ka(n,t,e))}}else if(Object.keys(t.$filter).length>0){let r=t.$filter,i=Na(r);i?(H(e,_a(i)),n=[]):n=n.filter(t=>Ma(t,r,e))}for(let t of e)console.warn(t)}if(t?.$search){let e=t.$search.toLowerCase();n=n.filter(t=>Object.values(t).some(t=>typeof t==`string`&&t.toLowerCase().includes(e)))}let r=n.length;n=Pa(n,t?.$orderby);let i=t?.$skip??0,a=t?.$top;return i>0&&(n=n.slice(i)),a!==void 0&&(n=n.slice(0,a)),t?.$select?.length&&(n=n.map(e=>Fa(e,t.$select))),{data:n,total:r,hasMore:i+(a??n.length)<r}}async findOne(e,t,n){let r=this.items.find(e=>String(V(e,this.idField))===String(t));return r?n?.$select?.length?Fa(r,n.$select):{...r}:null}async create(e,t){let n={...t};if(!V(n,this.idField)){let e=this.idField??`id`;n[e]=`auto_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}return this.items.push(n),this.emitMutation({type:`create`,resource:e,record:{...n}}),{...n}}async update(e,t,n){let r=this.items.findIndex(e=>String(V(e,this.idField))===String(t));if(r===-1)throw Error(`ValueDataSource: Record with id "${t}" not found`);return this.items[r]={...this.items[r],...n},this.emitMutation({type:`update`,resource:e,id:String(t),record:{...this.items[r]}}),{...this.items[r]}}async delete(e,t){let n=this.items.findIndex(e=>String(V(e,this.idField))===String(t));return n!==-1&&(this.items.splice(n,1),this.emitMutation({type:`delete`,resource:e,id:String(t)}),!0)}async bulk(e,t,n){let r=[];for(let i of n)switch(t){case`create`:r.push(await this.create(e,i));break;case`update`:{let t=V(i,this.idField);t!==void 0&&r.push(await this.update(e,t,i));break}case`delete`:{let t=V(i,this.idField);t!==void 0&&await this.delete(e,t);break}}return r}batchTransaction(e){return da(this,e)}async getObjectSchema(e){if(this.items.length===0)return{name:e,fields:{}};let t=this.items[0],n={};for(let[e,r]of Object.entries(t))n[e]={type:typeof r};return{name:e,fields:n}}async getView(e,t){return null}async getApp(e){return null}async aggregate(e,t){let{field:n,function:r,groupBy:i}=t,a={};for(let e of this.items){let t=String(e[i]??`Unknown`);a[t]||(a[t]=[]),a[t].push(e)}return Object.entries(a).map(([e,t])=>{let a=t.map(e=>Number(e[n])||0),o;switch(r){case`count`:o=t.length;break;case`avg`:o=a.length>0?a.reduce((e,t)=>e+t,0)/a.length:0;break;case`min`:o=a.length>0?Math.min(...a):0;break;case`max`:o=a.length>0?Math.max(...a):0;break;default:o=a.reduce((e,t)=>e+t,0)}return{[i]:e,[n]:o}})}onMutation(e){return this.mutationListeners.add(e),()=>{this.mutationListeners.delete(e)}}get count(){return this.items.length}getAll(){return structuredClone(this.items)}};function La(e,t,n){if(!e)return t??null;switch(e.provider){case`object`:return t??null;case`api`:return new ga({read:e.read,write:e.write,fetch:n?.fetch,defaultHeaders:n?.defaultHeaders});case`value`:return new Ia({items:e.items??[],idField:n?.idField});default:return t??null}}var G=`https://objectui.dev/docs/errors`,Ra={"OBJUI-001":{code:`OBJUI-001`,message:'Unknown component type: "${type}"',suggestion:`Ensure the component is registered via registry.register() before rendering. Check for typos in the component type name.`,docUrl:`${G}/OBJUI-001`},"OBJUI-002":{code:`OBJUI-002`,message:"Schema validation failed: ${reason}",suggestion:`Verify the schema against the ObjectUI JSON spec. Run the built-in schema validator for details.`,docUrl:`${G}/OBJUI-002`},"OBJUI-003":{code:`OBJUI-003`,message:"Expression evaluation failed: ${expression}",suggestion:`Check the expression syntax and ensure all referenced variables exist in the current data scope.`,docUrl:`${G}/OBJUI-003`},"OBJUI-004":{code:`OBJUI-004`,message:'Plugin dependency missing: "${dependency}"',suggestion:`Install the required dependency and register it before loading this plugin.`,docUrl:`${G}/OBJUI-004`},"OBJUI-005":{code:`OBJUI-005`,message:'Plugin already loaded: "${plugin}"',suggestion:`A plugin with the same name is already registered. Remove the duplicate or use a unique plugin name.`,docUrl:`${G}/OBJUI-005`},"OBJUI-006":{code:`OBJUI-006`,message:'Plugin not found: "${plugin}"',suggestion:`Verify the plugin name and ensure it has been registered before access.`,docUrl:`${G}/OBJUI-006`},"OBJUI-007":{code:`OBJUI-007`,message:'Registry namespace deprecated: "${namespace}"',suggestion:`Migrate to the new namespace format. See the migration guide for details.`,docUrl:`${G}/OBJUI-007`},"OBJUI-008":{code:`OBJUI-008`,message:'Read-only scope violation: "${scope}"',suggestion:`You are trying to mutate a read-only data scope. Use a writable scope or clone the data before modifying.`,docUrl:`${G}/OBJUI-008`},"OBJUI-009":{code:`OBJUI-009`,message:'Invalid field configuration: "${field}"',suggestion:`Check the field schema for required properties (type, name). Ensure the field widget is registered.`,docUrl:`${G}/OBJUI-009`},"OBJUI-010":{code:`OBJUI-010`,message:'Action execution failed: "${action}"',suggestion:`Verify the action handler is registered and that all required parameters are provided.`,docUrl:`${G}/OBJUI-010`}},za=class extends Error{code;details;constructor(e,t,n){super(e),this.code=t,this.details=n,this.name=`ObjectUIError`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,code:this.code,details:this.details,stack:this.stack}}};function Ba(e){return e instanceof za}var K=`__debug`;function Va(e){let t=e;if(t===void 0)try{t=typeof window<`u`?window.location.search:``}catch{t=``}let n=new URLSearchParams(t),r=n.has(K),i=n.has(`${K}_schema`),a=n.has(`${K}_perf`),o=n.has(`${K}_data`),s=n.has(`${K}_expr`),c=n.has(`${K}_events`),l=n.has(`${K}_registry`);return{enabled:r||i||a||o||s||c||l,...i&&{schema:i},...a&&{perf:a},...o&&{data:o},...s&&{expr:s},...c&&{events:c},...l&&{registry:l}}}function Ha(){try{if(typeof window<`u`)try{if(Va(window.location.search).enabled)return!0}catch{}let e=typeof globalThis<`u`&&globalThis.OBJECTUI_DEBUG;return e===!0||e===`true`||globalThis.process?.env?.OBJECTUI_DEBUG===`true`}catch{return!1}}function Ua(e,t,n){Ha()&&(n===void 0?console.log(`[ObjectUI Debug][${e}] ${t}`):console.log(`[ObjectUI Debug][${e}] ${t}`,n))}var Wa=new Map;function Ga(e){Ha()&&Wa.set(e,performance.now())}function Ka(e){if(!Ha())return;let t=Wa.get(e);if(t!==void 0){let n=(performance.now()-t).toFixed(2);console.log(`[ObjectUI Debug][perf] ${e}: ${n}ms`),Wa.delete(e)}}var qa=200,Ja=class e{static instance=null;entries=[];subscribers=new Set;static getInstance(){return e.instance||=new e,e.instance}static resetInstance(){e.instance=null}addPerf(e){this.push({kind:`perf`,data:e})}addExpr(e){this.push({kind:`expr`,data:e})}addEvent(e){this.push({kind:`event`,data:e})}getEntries(e){return e?this.entries.filter(t=>t.kind===e):this.entries.slice()}clear(){this.entries=[]}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}push(e){this.entries.push(e),this.entries.length>qa&&(this.entries=this.entries.slice(-200));for(let t of this.subscribers)try{t(e)}catch{}}},Ya={medium:991,small:640,xsmall:479},Xa=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Za=e=>Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,t])=>`${Xa(e)}: ${typeof t==`number`?String(t):t} !important;`).join(` `);function Qa(e){if(!e||typeof e!=`object`)return!1;let t=e;return!!(t.large||t.medium||t.small||t.xsmall)}function $a(e){return`os-s-${String(e).replace(/[^a-zA-Z0-9_-]/g,`-`)}`}function eo(e,t){let n=[];if(t.large){let r=Za(t.large);r&&n.push(`${e} { ${r} }`)}for(let r of[`medium`,`small`,`xsmall`]){let i=t[r];if(!i)continue;let a=Za(i);a&&n.push(`@media (max-width: ${Ya[r]}px) { ${e} { ${a} } }`)}return n.join(`
3
- `)}var to={"react-pages":!0},no=new Map,ro=!1;function io(){if(ro)return;ro=!0;let e=globalThis;if(Array.isArray(e.__OBJECTUI_CAPABILITIES__))for(let t of e.__OBJECTUI_CAPABILITIES__)typeof t==`string`&&!no.has(t)&&no.set(t,!0);if(Array.isArray(e.__OBJECTUI_CAPABILITIES_DISABLED__))for(let t of e.__OBJECTUI_CAPABILITIES_DISABLED__)typeof t==`string`&&no.set(t,!1)}function ao(e){io();let t=no.get(e);return t===void 0?to[e]??!1:t}var oo=`react-pages`;T();var so=/\$\{event\.([a-zA-Z0-9_]+)\}/g;function co(e,t){return typeof e!=`string`||e.indexOf("${event.")===-1?e:e.replace(so,(e,n)=>{let r=t[n];return r==null?``:String(r)})}function lo(e,t){if(typeof e==`string`){let n=e.match(/^\$\{event\.([a-zA-Z0-9_]+)\}$/);if(n){let e=t[n[1]];return e===``||e===void 0?null:e}return co(e,t)}if(Array.isArray(e))return e.map(e=>lo(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=lo(i,t);return n}return e}function uo(e,t,n={}){if(e?.filter)return lo(e.filter,t);let r={},{rowField:i,columnField:a,groupByField:o}=n,s=t.scope??`cell`;return s===`total`?r:((s===`cell`||s===`row`)&&i&&`rowKey`in t&&(r[i]=t.rowKey===``?null:t.rowKey),(s===`cell`||s===`column`)&&a&&`colKey`in t&&(r[a]=t.colKey===``?null:t.colKey),o&&`category`in t&&(r[o]=t.category===``?null:t.category),r)}function fo(e,t,n=`Details`){if(e?.title){let n=co(e.title,t).trim();if(n)return n}let r=[];return t.rowLabel&&r.push(t.rowLabel),t.colLabel&&r.push(t.colLabel),t.categoryLabel?r.push(t.categoryLabel):t.category&&r.push(t.category),t.series&&r.push(t.series),r.length>0?r.join(` × `):n}function po(e){return e?e.enabled!==!1:!1}function mo(e,t){let n=Ae(e,t);try{return x(n)}catch(e){throw e?.code===`INVALID_FILTER`?new O(e.message):e}}function ho(e,t=new Date){if(e==null)return e;let n=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t},r=e=>{let t=n(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`},i=e=>{let t=n(e),r=(t.getDay()+6)%7;return t.setDate(t.getDate()-r),t},a=e=>new Date(e.getFullYear(),e.getMonth(),1),o=e=>{let t=Math.floor(e.getMonth()/3);return new Date(e.getFullYear(),t*3,1)},s=e=>new Date(e.getFullYear(),0,1),c=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,1),l=(e,t)=>{let r=n(e);return r.setDate(r.getDate()+t),r},u=e=>l(c(a(e),1),-1),d=e=>l(i(e),6),f=e=>l(c(o(e),3),-1),p=e=>new Date(e.getFullYear(),11,31),m={today:()=>r(t),yesterday:()=>r(l(t,-1)),tomorrow:()=>r(l(t,1)),now:()=>t.toISOString(),current_week_start:()=>r(i(t)),current_week_end:()=>r(d(t)),current_month_start:()=>r(a(t)),current_month_end:()=>r(u(t)),current_quarter_start:()=>r(o(t)),current_quarter_end:()=>r(f(t)),current_year_start:()=>r(s(t)),current_year_end:()=>r(p(t)),last_week_start:()=>r(l(i(t),-7)),last_week_end:()=>r(l(i(t),-1)),last_month_start:()=>r(c(a(t),-1)),last_month_end:()=>r(l(a(t),-1)),last_quarter_start:()=>r(c(o(t),-3)),last_quarter_end:()=>r(l(o(t),-1)),last_year_start:()=>r(new Date(t.getFullYear()-1,0,1)),last_year_end:()=>r(new Date(t.getFullYear()-1,11,31)),next_week_start:()=>r(l(i(t),7)),next_month_start:()=>r(c(a(t),1)),next_quarter_start:()=>r(c(o(t),3)),next_year_start:()=>r(new Date(t.getFullYear()+1,0,1))};for(let[e,t]of Object.entries({week_start:`current_week_start`,week_end:`current_week_end`,month_start:`current_month_start`,month_end:`current_month_end`,quarter_start:`current_quarter_start`,quarter_end:`current_quarter_end`,year_start:`current_year_start`,year_end:`current_year_end`}))m[e]=m[t];let h=/^(\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/,g=e=>{let n=e.match(h);if(!n)return null;let i=parseInt(n[1],10);if(!Number.isFinite(i))return null;let a=n[3]===`ago`?-1:1,o=n[2].replace(/s$/,``);if(o===`minute`)return new Date(t.getTime()+a*i*60*1e3).toISOString();if(o===`hour`)return new Date(t.getTime()+a*i*60*60*1e3).toISOString();if(o===`day`)return r(l(t,a*i));if(o===`week`)return r(l(t,a*i*7));if(o===`month`){let e=new Date(t.getFullYear(),t.getMonth()+a*i,t.getDate());return r(e)}if(o===`year`){let e=new Date(t.getFullYear()+a*i,t.getMonth(),t.getDate());return r(e)}return null},_=/\$?\{([a-zA-Z0-9_]+)\}/g,v=e=>{if(e==null)return e;if(typeof e==`string`){let t=e.match(/^\$?\{([a-zA-Z0-9_]+)\}$/);if(t){let e=t[1];if(m[e])return m[e]();let n=g(e);if(n!=null)return n}let n=!1,r=e.replace(_,(e,t)=>{if(m[t])return n=!0,m[t]();let r=g(t);return r==null?e:(n=!0,r)});return n?r:e}if(Array.isArray(e))return e.map(v);if(typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n={};for(let t of Object.keys(e))n[t]=v(e[t]);return n}return e};return v(e)}T();var go=/^\$?\{([a-zA-Z0-9_]+)\}$/,_o=Object.assign(Object.create(null),c);function vo(e,t={}){if(e==null)return e;let{currentUserId:n,currentOrgId:r}=t,i=t.onUnresolved===null?()=>{}:t.onUnresolved??(e=>{console.warn(`[object-ui] ${e}`)}),a={current_user_id:n,current_org_id:r},o=e=>{if(e==null)return e;if(typeof e==`string`){let t=e.match(go);if(!t)return e;let n=t[1];if(h(n)){let t=a[n];return t!=null&&t!==``?t:(i(`Filter placeholder "{${n}}" could not be resolved — no ${n===`current_user_id`?`signed-in user`:`active organization`} in scope. The filter will match no records.`),e)}let r=_o[n.toLowerCase()];return r&&i(`Filter placeholder "{${n}}" is not a recognised token — did you mean "{${r}}"? It is sent to the server as a literal string and will match no records.`),e}if(Array.isArray(e))return e.map(o);if(typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n={};for(let t of Object.keys(e))n[t]=o(e[t]);return n}return e};return o(e)}function yo(e,t={},n=new Date){return e==null?e:vo(ho(e,n),t)}var bo=`dateRange`,xo=`created_at`,So;function Co(){return So===void 0&&(So=d.shape.dateRange.parse({})?.defaultRange),So}var wo={today:{from:`{today}`,to:`{today}`},yesterday:{from:`{yesterday}`,to:`{yesterday}`},this_week:{from:`{current_week_start}`,to:`{current_week_end}`},last_week:{from:`{last_week_start}`,to:`{last_week_end}`},this_month:{from:`{current_month_start}`,to:`{current_month_end}`},last_month:{from:`{last_month_start}`,to:`{last_month_end}`},this_quarter:{from:`{current_quarter_start}`,to:`{current_quarter_end}`},last_quarter:{from:`{last_quarter_start}`,to:`{last_quarter_end}`},this_year:{from:`{current_year_start}`,to:`{current_year_end}`},last_year:{from:`{last_year_start}`,to:`{last_year_end}`},last_7_days:{from:`{7_days_ago}`,to:`{today}`},last_30_days:{from:`{30_days_ago}`,to:`{today}`},last_90_days:{from:`{90_days_ago}`,to:`{today}`}};function To(e){return wo[e]}var Eo=/^\d{4}-\d{2}-\d{2}(?:[T ][\d:.]+(?:Z|[+-]\d{2}:?\d{2})?)?$/;function Do(e){return ho(e)!==e||Eo.test(e)&&!Number.isNaN(Date.parse(e))}function Oo(){return l.join(`, `)}function ko(e){typeof console<`u`&&console.warn(`[dashboard-filters] ${e}`)}var Ao=()=>!1,jo=new Set;function Mo(e){let t=hn(e);if(t===e)return e;let n=e?.name??e?.field??`?`,r=t?.defaultValue;return ko(`filter "${n}": \`defaultValue: { preset: ${JSON.stringify(r)} }\` is a LEGACY spelling (objectui#4165) and was lifted to the canonical bare preset name ${JSON.stringify(r)}. Rewrite the stored dashboard — the object form is refused by @objectstack/spec and its acceptance here ends with @object-ui/types 18.`),t}function No(e,t){return e!==`date`&&e!==`dateRange`||typeof t!=`string`?t:t in wo?{preset:t}:t}function Po(e,t){if(!Array.isArray(e)||e.length===0)return;let n=[],r=[];for(let t of e)if(t!=null){if(typeof t==`object`){let e=t.value;if(e==null)continue;let r=t.label,i=typeof r==`object`&&!!r&&!Array.isArray(r);n.push({value:String(e),label:typeof r==`string`&&r||i?r:String(e)})}else r.push(String(t)),n.push({value:String(t),label:String(t)})}return r.length>0&&Fo(t,r),n.length>0?n:void 0}function Fo(e,t){if(!Ao())return;let n=`${e}:${t.join(`,`)}`;if(jo.has(n))return;jo.add(n);let r=t.map(e=>`{ value: ${JSON.stringify(e)}, label: ${JSON.stringify(e)} }`).join(`, `);ko(`filter "${e}": \`options\` carries the bare-string shorthand (${t.map(e=>JSON.stringify(e)).join(`, `)}), which @objectstack/spec's \`GlobalFilterSchema\` REFUSES at publish — a dashboard authored this way renders here and is rejected the moment it reaches the platform (objectui#4356). Rewrite the stored dashboard to the canonical pair form: [${r}]. Still lifted here for already-persisted dashboards; the lift is removed on the objectstack#7917 schedule.`)}function Io(e){let t=new Map;if(e.dateRange){let n=e.dateRange.defaultRange===void 0?Co():e.dateRange.defaultRange;t.set(bo,{name:bo,field:e.dateRange.field||xo,type:`dateRange`,defaultValue:n&&n!==`custom`?{preset:n}:void 0,allowCustomRange:e.dateRange.allowCustomRange})}for(let n of e.globalFilters??[]){if(!n?.field)continue;let e=Mo(n),r=e.name||e.field;t.has(r)&&typeof console<`u`&&console.warn(`[dashboard-filters] duplicate filter name "${r}" — the later definition wins`);let i=e.type??`text`;t.set(r,{name:r,field:e.field,...typeof e.object==`string`&&e.object?{object:e.object}:{},label:e.label,type:i,options:Po(e.options,r),optionsFrom:e.optionsFrom,defaultValue:No(i,e.defaultValue),targetWidgets:e.targetWidgets})}return Array.from(t.values())}function Lo(e){return e.map(e=>({name:e.name,type:e.type===`dateRange`?`object`:`string`,defaultValue:e.defaultValue}))}function Ro(e,t){if(t==null||t===``)return!0;if(Array.isArray(t))return t.length===0;if(e.type===`dateRange`||e.type===`date`){let e=t;return typeof e==`object`&&!e.preset&&!e.from&&!e.to}return typeof t==`object`&&Object.keys(t).length===0}function zo(e,t){if(!Ro(e,t)){if(e.type===`dateRange`||e.type===`date`){let n=t;if(typeof n==`object`){let t=typeof n.preset==`string`&&n.preset?n.preset:void 0,r=t?To(t):void 0,i=r?.from??n.from,a=r?.to??n.to;return t&&!r&&ko(i||a?`filter "${e.name}": ignoring unknown date range preset "${t}" — using the explicit from/to bounds instead; known presets: ${Oo()}`:`skipping filter "${e.name}": unknown date range preset "${t}" — expected one of: ${Oo()}`),!i&&!a?void 0:{...i?{$gte:i}:{},...a?{$lte:a}:{}}}if(typeof n==`string`&&!Do(n)){ko(`skipping filter "${e.name}": value "${n}" is neither a known date range preset nor an ISO date — expected one of: ${Oo()}, an ISO date (YYYY-MM-DD), or a date macro such as {today}`);return}return t}return e.type===`select`||e.type===`lookup`?Array.isArray(t)?{$in:t}:t:e.type===`text`?{$contains:t}:t}}function Bo(e,t){let n=e.filterBindings?.[t.name];if(n!==!1){if(typeof n==`string`&&n)return n;if(!(t.targetWidgets&&t.targetWidgets.length>0&&(!e.id||!t.targetWidgets.includes(e.id))))return t.field}}function Vo(e,t,n,r){let i=[];for(let a of t){let t=n[a.name];if(Ro(a,t))continue;let o=Bo(e,a);if(!o)continue;if(typeof e.filterBindings?.[a.name]!=`string`&&r&&!r.has(o)){typeof console<`u`&&console.warn(`[dashboard-filters] skipping filter "${a.name}" on widget "${e.id??`?`}": default field "${o}" does not exist on the widget's object — map it with filterBindings: { "${a.name}": "<field>" } or opt out with false`);continue}let s=zo(a,t);s!==void 0&&i.push({[o]:s})}if(i.length!==0)return i.length===1?i[0]:{$and:i}}function Ho(e,t){let n=e&&Object.keys(e).length>0,r=t&&Object.keys(t).length>0;if(n&&r)return{$and:[e,t]};if(n)return e;if(r)return t}var Uo={current_week_start:`last_week_start`,current_week_end:`last_week_end`,current_month_start:`last_month_start`,current_month_end:`last_month_end`,current_quarter_start:`last_quarter_start`,current_quarter_end:`last_quarter_end`,current_year_start:`last_year_start`,current_year_end:`last_year_end`,week_start:`last_week_start`,week_end:`last_week_end`,month_start:`last_month_start`,month_end:`last_month_end`,quarter_start:`last_quarter_start`,quarter_end:`last_quarter_end`,year_start:`last_year_start`,year_end:`last_year_end`,today:`yesterday`};function Wo(e,t){if(e==null)return e;if(typeof e==`string`)return e.replace(/\$?\{([a-zA-Z0-9_]+)\}/g,(e,n)=>{let r=t[n];return r?`{${r}}`:e});if(Array.isArray(e))return e.map(e=>Wo(e,t));if(typeof e==`object`){let n={};for(let r of Object.keys(e))n[r]=Wo(e[r],t);return n}return e}function Go(e,t,n=new Date){return t.kind===`previousYear`?ho(e,new Date(n.getFullYear()-1,n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds())):ho(Wo(e,Uo),n)}function Ko(e,t){if(e.kind===`previousYear`)return`vsLastYear`;let n=t?JSON.stringify(t):``;return/current_year_|year_start|year_end/.test(n)?`vsLastYear`:/current_quarter_|quarter_start|quarter_end/.test(n)?`vsLastQuarter`:/current_month_|month_start|month_end/.test(n)?`vsLastMonth`:/current_week_|week_start|week_end/.test(n)?`vsLastWeek`:/\btoday\b/.test(n)?`vsYesterday`:`vsPreviousPeriod`}var qo=e=>e==null?null:String(e),Jo=e=>JSON.stringify(e),Yo=(e,t)=>JSON.stringify([e,t]),Xo=[`count`,`sum`,`avg`,`min`,`max`,`count_distinct`];function Zo(e){return typeof e==`string`&&Xo.includes(e)}function Qo(e,t){let n=e.builtinAggregate;if(Zo(n)){let e=t?.[n];if(typeof e==`string`&&e!==``)return e}return e.label??e.name}var $o=`(None)`;function q(e){return Jo([qo(e)])}var es=`__bucketId`;function ts(e){if(!e||typeof e!=`object`)return;let t=e[es];return typeof t==`string`&&t!==``?t:void 0}function ns(e,t){return J(e,t)&&e[t]==null}function J(e,t){return!!e&&typeof e==`object`&&t in e}function rs(e){return e==null?``:String(e)}function is(e){let t=new Map;for(let{id:n,display:r}of e){let e=t.get(r);e||t.set(r,e=new Set),e.add(n)}let n=new Set;for(let[e,r]of t)r.size>1&&n.add(e);return n}function as(e,t,n){let r=e=>ns(e,t)?n:e[t],i=is(e.filter(e=>J(e,t)).map(e=>({id:q(e[t]),display:rs(r(e))}))),a=!1,o=e.map(e=>{if(!J(e,t))return e;let o=ns(e,t),s=i.has(rs(r(e)));return!o&&!s?e:(a=!0,{...e,...o?{[t]:n}:{},...s?{[es]:q(e[t])}:{}})});return a?o:e}function os(e,t,n,r){let i=new Map;for(let r of e){if(!J(r,t))continue;let e=q(r[t]);i.has(e)||i.set(e,{id:e,label:ns(r,t)?n:String(r[t])})}let a=Array.from(i.values()),o=is(a.map(({id:e,label:t})=>({id:e,display:t}))),s=new Set([r,es]),c=new Set(a.map(({id:e})=>e));return a.map(({id:e,label:t})=>({id:e,label:t,dataKey:o.has(t)||s.has(t)||c.has(t)?e:t}))}function ss(e,t,n,r,i){let a=(t??[]).filter(Boolean),o=(n??[]).filter(Boolean),s=Array.isArray(e)?e:[],c=e=>{let t=(r??[]).find(t=>t.name===e);return t?Qo(t,i?.builtinAggregateLabels):e};if(a.length>=2&&o.length===1){let e=a[0],t=a[1],n=o[0],r=i?.nullCategoryLabel??`(None)`,c=os(s,t,r,e),l=new Map(c.map(({id:e,dataKey:t})=>[e,t])),u=new Map;for(let i of s){let a=i[e],o=q(a),s=u.get(o);s||u.set(o,s={}),J(i,e)&&!J(s,e)&&(s[e]=ns(i,e)?r:a);let c=J(i,t)?l.get(q(i[t])):void 0;c!==void 0&&(s[c]=i[n])}let d=is(Array.from(u.entries()).map(([t,n])=>({id:t,display:rs(n[e])})));return{data:Array.from(u.entries()).map(([t,n])=>d.has(rs(n[e]))?{...n,[es]:t}:n),xAxisKey:e,series:c.map(({dataKey:e,label:t})=>({dataKey:e,label:t}))}}let l=a[0];return{data:l?as(s,l,i?.nullCategoryLabel??`(None)`):s,xAxisKey:l,series:o.map(e=>({dataKey:e,label:c(e)}))}}function cs(e,t){let n=Array.isArray(e)?e:[];if(!t)return n;let r=Object.keys(t).filter(e=>t[e]&&Object.keys(t[e]).length>0);return r.length===0?n:n.map(e=>{let n=null;for(let i of r){let r=e[i];if(r==null)continue;let a=t[i][String(r)];a!=null&&a!==r&&(n||={...e},n[i]=a)}return n??e})}function ls(e,t,n,r,i,a){let o=(t??[]).filter(Boolean),s=(n??[]).filter(Boolean),c=Array.isArray(e)?e:[],l=o[0];if(!l)return-1;let u=String(r??``),d=a?.nullCategoryLabel??`(None)`,f=a?.bucketId,p=typeof f==`string`&&f!==``?e=>q(e[l])===f:e=>(e[l]==null?d:String(e[l]))===u;if(o.length>=2&&s.length===1){let e=o[1],t=os(c,e,d,l).find(({dataKey:e})=>e===String(i??``))?.id;return t===void 0?-1:c.findIndex(n=>p(n)&&J(n,e)&&q(n[e])===t)}return c.findIndex(e=>p(e))}function us(e){if(!Array.isArray(e)||e.length===0)return null;let t={};for(let n of e)if(n&&typeof n==`object`){let e=n;typeof e.color==`string`&&e.color&&(e.value!=null&&(t[String(e.value)]=e.color),e.label!=null&&(t[String(e.label)]=e.color))}return Object.keys(t).length>0?t:null}function ds(e){if(!Array.isArray(e)||e.length===0)return null;let t=[];for(let n of e){if(typeof n==`string`||typeof n==`number`||typeof n==`boolean`){t.push(String(n));continue}if(n&&typeof n==`object`){let e=n;e.value!=null&&t.push(String(e.value)),e.label!=null&&String(e.label)!==String(e.value)&&t.push(String(e.label))}}return t.length>0?t:null}function fs(e){if(!Array.isArray(e)||e.length===0)return null;let t=new Map;return e.forEach((e,n)=>{t.has(e)||t.set(e,n)}),t.size>0?t:null}function ps(e){if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return{value:String(e),label:String(e)};if(e&&typeof e==`object`){let t=e;if(t.value!=null&&t.label!=null)return{value:String(t.value),label:String(t.label)}}return null}function ms(e,t){if(!t||!Array.isArray(e)||e.length===0)return e;let n=!1,r=e.map(e=>{let r=ps(e);if(!r)return e;let i=t(r.value,r.label);return i===r.label?e:(n=!0,e&&typeof e==`object`?{...e,label:i}:{value:r.value,label:i})});return n?r:e}function hs(e,t){if(!Array.isArray(e)||e.length===0)return null;let n={},r={};for(let i of e){let e=ps(i);if(!e)continue;let a=t?t(e.value,e.label):e.label;a!==e.value&&(n[e.value]=a),a!==e.label&&(r[e.label]=a)}let i={...r,...n};return Object.keys(i).length>0?i:null}var gs=new Set([`lookup`,`master_detail`,`masterdetail`,`master-detail`]);function _s(e){let t=e?.fields;return t&&typeof t==`object`&&!Array.isArray(t)?t:null}function vs(e){if(!e||typeof e!=`object`)return;let t=e,n=typeof t.type==`string`?t.type.toLowerCase():``;if(!gs.has(n))return;let r=t.reference;return typeof r==`string`&&r?r:void 0}async function ys(e,t,n){let r={},i=Array.from(new Set((t??[]).filter(e=>!!e)));if(i.length===0)return r;let a=new Map,o=e?.name;typeof o==`string`&&o&&a.set(o,Promise.resolve(e));let s=e=>{let t=a.get(e);return t||(t=Promise.resolve().then(()=>n(e)).catch(()=>null),a.set(e,t)),t};for(let t of i){let n=t.split(`.`),i=e,a=typeof o==`string`&&o?o:void 0,c=!0;for(let e=0;e<n.length-1;e+=1){let t=vs(_s(i)?.[n[e]]);if(!t){c=!1;break}if(i=await s(t),!i){c=!1;break}let r=i.name;a=typeof r==`string`&&r?r:t}if(!c)continue;let l=n[n.length-1],u=_s(i)?.[l];u?.options!==void 0&&(r[t]={object:a,field:l,options:u.options})}return r}function bs(e,t){let n=e?.object;if(!n||!t)return;let r=e.field;return(e,i)=>t(n,r,e,i)}function xs(e,t,n){if(!e||!t||t.length===0)return null;let r={};for(let{dim:i,path:a}of t){let t=e[a],o=hs(t?.options,bs(t,n));o&&(r[i]=o)}return Object.keys(r).length>0?r:null}async function Ss(e,t,n){return ys(await e(t),n,e)}function Cs(e,t){return ie(e)??t}function ws(e,t){return m(e)??t}function Ts(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Es(e,t,n){let r=e.function,i={function:r,alias:Cs(e,r||`count`)};return r!==`count`&&e.field&&(i.field=e.field),{groupBy:[t],aggregations:[i],where:n}}var Ds=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function Os(e){if(typeof e==`string`&&e)return e;if(Ds(e))return Object.values(e).find(e=>typeof e==`string`&&e)}function ks(e){if(typeof e==`string`)return e||void 0;if(Ds(e)&&Object.values(e).some(e=>typeof e==`string`&&e))return e}function As(e){let t={},n=e.type;(n===`bar`||n===`line`||n===`area`)&&(t.chartType=n),(e.yAxis===`left`||e.yAxis===`right`)&&(t.yAxis=e.yAxis);let r=Os(e.label);return r&&(t.label=r),typeof e.color==`string`&&e.color&&(t.color=e.color),typeof e.stack==`string`&&e.stack&&(t.stack=e.stack),(e.variant===`primary`||e.variant===`comparison`)&&(t.variant=e.variant),typeof e.dashArray==`string`&&e.dashArray&&(t.dashArray=e.dashArray),typeof e.opacity==`number`&&Number.isFinite(e.opacity)&&(t.opacity=e.opacity),t}function js(e){let t={};if(!Ds(e))return t;let n=ks(e.title);return n&&(t.title=n),typeof e.format==`string`&&e.format&&(t.format=e.format),typeof e.min==`number`&&Number.isFinite(e.min)&&(t.min=e.min),typeof e.max==`number`&&Number.isFinite(e.max)&&(t.max=e.max),typeof e.stepSize==`number`&&Number.isFinite(e.stepSize)&&e.stepSize>0&&(t.stepSize=e.stepSize),typeof e.showGridLines==`boolean`&&(t.showGridLines=e.showGridLines),(e.position===`left`||e.position===`right`||e.position===`top`||e.position===`bottom`)&&(t.position=e.position),typeof e.logarithmic==`boolean`&&(t.logarithmic=e.logarithmic),t}function Ms(e,t){let n=new Map;for(let e of Array.isArray(t)?t:[]){if(!Ds(e))continue;let t=typeof e.name==`string`?e.name:void 0;t&&!n.has(t)&&n.set(t,e)}return e.map(e=>{let t=n.get(e.dataKey);return t?{...e,...As(t)}:e})}function Ns(e,t){let n=Ds(t)?t:{},r=Ms(e,n.series),i={},a=js(n.xAxis);Object.keys(a).length>0&&(i.xAxis=a);let o=Array.isArray(n.yAxis)?n.yAxis:n.yAxis===void 0?[]:[n.yAxis];return o.length>0&&(i.yAxis=o.map(js)),{series:r,axes:i}}function Ps(e,t){let n=Ds(e)?e:{},r={};typeof n.showLegend==`boolean`&&(r.showLegend=n.showLegend),typeof n.showDataLabels==`boolean`&&(r.showDataLabels=n.showDataLabels);let i=ks(n.title);i&&(r.title=i);let a=ks(n.subtitle);a&&(r.subtitle=a);let o=ks(n.description);o&&(r.description=o),typeof n.height==`number`&&Number.isFinite(n.height)&&n.height>0&&(r.height=n.height),Array.isArray(n.annotations)&&n.annotations.length>0&&(r.annotations=n.annotations),n.interaction&&typeof n.interaction==`object`&&!Array.isArray(n.interaction)&&(r.interaction=n.interaction);let s=Array.isArray(n.colors)?n.colors.filter(e=>typeof e==`string`&&!!e):void 0;s?.length&&(r.colors=s);let c=n.colors&&typeof n.colors==`object`&&!Array.isArray(n.colors)?n.colors:void 0;return(t||c)&&(r.categoryColors={...t??{},...c??{}}),r}var Fs=new Set([`pie`,`donut`,`funnel`,`scatter`]);function Is(e){return typeof e==`string`&&Fs.has(e)}function Ls(e,t){return t?!0:e!==0}function Rs(e,t={}){let{locale:n,currency:r,scale:i,style:a,...o}=t,s={...o};a===`percentPoints`?(s.style=`unit`,s.unit=`percent`,s.unitDisplay=`narrow`):a&&(s.style=a),r&&(s.style=`currency`,s.currency=r,delete s.unit,delete s.unitDisplay),Ls(i,r)||(s.useGrouping=!1);try{return new Intl.NumberFormat(n,s).format(e)}catch{return new Intl.NumberFormat(void 0,s).format(e)}}var zs=/^\d{4}-\d{2}-\d{2}$/,Bs=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function Vs(e){if(!zs.test(e))return!1;let[t,n,r]=e.split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r}function Hs(e){let t=e instanceof Date?e:new Date(e);if(typeof e==`string`&&Bs.test(e)&&!Vs(e.slice(0,10)))return new Date(NaN);if(typeof e!=`string`||!zs.test(e)||isNaN(t.getTime()))return t;if(!Vs(e))return new Date(NaN);let[n,r,i]=e.split(`-`).map(Number),a=new Date(n,r-1,i);return a.setFullYear(n),a}function Us(e,t){try{let n=new Intl.RelativeTimeFormat(t,{numeric:`auto`}).format(e,`day`);return n.charAt(0).toUpperCase()+n.slice(1)}catch{return e===0?`Today`:e===1?`Tomorrow`:e===-1?`Yesterday`:e>0?`In ${e} days`:`${Math.abs(e)} days ago`}}function Ws(e){return e===void 0||e.style===void 0?e:{...e,style:void 0}}function Gs(e,t){if(e==null||e===``)return`—`;let n=Hs(e);if(!(n instanceof Date)||isNaN(n.getTime()))return`—`;let r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate()),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime()-i.getTime(),o=Math.round(a/864e5);if(o<-7||o>7)return Ks(n,void 0,Ws(t));if(o<-1&&t?.dueLike){let e=Math.abs(o),n=`fields.relativeDate.overdue`,r=t.t?.(n,{count:e});return r&&r!==n?r:`Overdue ${e}d`}return Us(o,t?.locale)}function Ks(e,t,n){if(e==null||e===``)return`—`;let r=Hs(e);if(!(r instanceof Date)||isNaN(r.getTime()))return`—`;let i=t??n?.style;if(i===`short`)return`${r.toLocaleDateString(n?.locale,{month:`short`})} ${r.getDate()}, '${String(r.getFullYear()).slice(-2)}`;if(i===`relative`)return Gs(r,n);let a=r.getFullYear()===new Date().getFullYear();return r.toLocaleDateString(n?.locale,{year:a?void 0:`numeric`,month:`short`,day:`numeric`})}function qs(e,t){if(e==null||e===``)return null;let n=Hs(e);return!(n instanceof Date)||isNaN(n.getTime())?null:{date:n.toLocaleDateString(t?.locale,{month:`numeric`,day:`numeric`,year:`numeric`}),time:n.toLocaleTimeString(t?.locale,{hour:`numeric`,minute:`2-digit`,hour12:!0}).toLowerCase()}}function Js(e,t){if(e==null||e===``)return`—`;let n=Hs(e);if(!(n instanceof Date)||isNaN(n.getTime()))return`—`;if(t?.style===`compact`){let e=qs(n,t);return e?`${e.date} ${e.time}`:`—`}return n.toLocaleDateString(t?.locale,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Ys(e){return String(e).padStart(2,`0`)}function Xs(e){if(e==null||e===``)return``;if(typeof e==`string`){let t=e.match(/^(\d{4}-\d{2}-\d{2})/);if(t)return t[1]}let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?``:`${t.getFullYear()}-${Ys(t.getMonth()+1)}-${Ys(t.getDate())}`}function Zs(e){if(e==null||e===``||$s(e))return``;if(typeof e==`string`){let t=e.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})(?::\d{2}(?:\.\d+)?)?$/);if(t)return`${t[1]}T${t[2]}`}let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?``:`${t.getFullYear()}-${Ys(t.getMonth()+1)}-${Ys(t.getDate())}T${Ys(t.getHours())}:${Ys(t.getMinutes())}`}function Qs(e){if(!e)return``;if($s(e))return e;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()}function $s(e){if(typeof e!=`string`)return!1;let t=e.match(/^(\d{4}-\d{2}-\d{2})(?:$|T)/);return t!=null&&!Vs(t[1])}function ec(e){return e>-1&&e<1?e*100:e}function tc(e,t,n){return Rs(e,{...n,locale:t})}var nc=/^\d{4}-\d{2}-\d{2}$/,rc=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;function ic(e,t,n){if(typeof e==`string`){if(nc.test(e))return Number.isNaN(Date.parse(e))?void 0:Ks(e,t,{locale:n});if(rc.test(e))return Number.isNaN(Date.parse(e))?void 0:t===`relative`?Gs(e,{locale:n}):t===`short`?Js(e,{locale:n,style:`compact`}):Js(e,{locale:n})}}function ac(e,t,n,r,i){if(e==null)return`—`;if(typeof e!=`number`)return ic(e,t,i)??String(e);let a=t?t.split(`.`)[1]?.match(/0/g)?.length??0:void 0;if(n)try{return tc(e,i,{currency:n,minimumFractionDigits:a??0,maximumFractionDigits:a??2})}catch{}if(!t)return Number.isInteger(e)?String(e):tc(e,i,{maximumFractionDigits:2});let o=t.includes(`%`);return`${t.includes(`$`)?`$`:``}${tc(o?r?r===`fraction`?e*100:e:ec(e):e,i,{style:o?`percentPoints`:`decimal`,minimumFractionDigits:a??0,maximumFractionDigits:a??0})}`}function oc(e,t){return e==null?`—`:typeof e==`number`?Number.isInteger(e)?String(e):tc(e,t,{maximumFractionDigits:2}):String(e)}function sc(e,t,n,r){let i=new Map((e??[]).map(e=>[e.name,e])),a=e=>i.get(e);return{measureField:a,headerLabel:e=>{let i=a(e),o=i?Qo(i,r):e;return t&&n?n(t,e,o):o}}}function cc(e,t,n,r,i){let a={};for(let r of t){let t=e?.[r];a[n[r]]=t===``||t==null?{$null:!0}:t}if(i)for(let e of Object.values(i))e&&e.field&&(a[e.field]={$gte:e.gte,$lt:e.lt});return r?mo(r,a)??{}:a}var lc=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function uc(e){return lc.test(e)||e.startsWith(`rgb`)||e.startsWith(`hsl`)}function dc(e){let t=e?.options;if(!Array.isArray(t))return{};let n={};for(let e of t)e&&typeof e==`object`&&e.value!=null&&typeof e.color==`string`&&e.color&&(n[String(e.value)]=e.color);return n}function fc(e){let t=dc(e);return e=>{if(e==null||e===``)return;let n=String(e);return t[n]||(uc(n)?n:void 0)}}var pc=/[\\/:*?"<>|\u0000-\u001f]+/g,mc=80;function hc(e){return e?String(e).replace(pc,`_`).replace(/\s+/g,` `).replace(/_{2,}/g,`_`).replace(/^[\s._-]+|[\s._-]+$/g,``).slice(0,mc):``}function gc(e,t={},n=new Date){let r=hc(t.prefix),i=r||hc(t.label)||hc(t.objectName)||`export`,a=hc(t.viewLabel);!r&&a&&a.toLowerCase()!==i.toLowerCase()&&(i=`${i}-${a}`.slice(0,mc));let o=e=>String(e).padStart(2,`0`),s=`${n.getFullYear()}${o(n.getMonth()+1)}${o(n.getDate())}-${o(n.getHours())}${o(n.getMinutes())}${o(n.getSeconds())}`;return`${i}-${s}.${e}`}T();var _c=e=>e.toLowerCase().replace(/[_\-\s]/g,``),vc=null,yc=null,bc=null;function xc(){if(yc)return yc;let e=Object.keys(C.shape),t=new Map;for(let n of e){let e=_c(n);t.set(e,[...t.get(e)??[],n])}let n=new Map,r=new Map;for(let[e,i]of t)i.length===1?n.set(e,i[0]):r.set(e,i);return vc=new Set(e),bc=r,yc=n,n}var Sc=new Set,Cc=new Set;function wc(e,t,n,r,i,a){if(!Dc())return;let o=r??(typeof a.name==`string`?a.name:`(unnamed field)`),s=i??`(unknown object)`,c=`${s}:${o}:${t}:${e}`;Cc.has(c)||(Cc.add(c),console.warn(`[ObjectUI] Object \`${s}\`, field \`${o}\`: the ingestion choke point CANNOT canonicalize the retired spelling \`${t}\`. ${n} The key and its value are LEFT on the def exactly as served — nothing is dropped here — but the consumers read only the spelling \`@objectstack/spec\`'s \`FieldSchema\` declares, so this value reaches no reader. Fix the PRODUCER, or migrate the stored document. (maintainer ruling item 3 on objectui#7650; objectui#8938)`))}function Tc(e,t,n){let r=xc();for(let i of Object.keys(e)){if(vc.has(i))continue;let a=e[i];if(a===void 0||kc.has(i))continue;let o=_c(i),s=r.get(o);if(s===void 0){let r=bc.get(o);r?wc(`ambiguous-probe`,i,`Its alias spelling is shared by MORE THAN ONE key \`FieldSchema\` declares (${r.map(e=>`\`${e}\``).join(`, `)}), so the fold refuses to choose between them rather than picking one.`,t,n,e):wc(`no-declared-twin`,i,`\`FieldSchema\` declares neither \`${i}\` nor any key sharing its alias spelling (lowercased, with \`_\`, \`-\` and spaces removed), so there is no canonical key to fold it onto — and this path deliberately does not guess a near match.`,t,n,e);continue}if(e[s]!==void 0){e[s]!==a&&wc(`canonical-occupied`,i,`\`FieldSchema\` declares \`${s}\`, and this def already carries a DIFFERENT value under it; the producer's value stands, because this choke point never overwrites one.`,t,n,e);continue}if(e[s]=a,!Dc())continue;let c=t??(typeof e.name==`string`?e.name:`(unnamed field)`),l=n??`(unknown object)`,u=`${l}:${c}:${i}:${s}`;Sc.has(u)||(Sc.add(u),console.warn(`[ObjectUI] Object \`${l}\`, field \`${c}\` carries the retired spelling \`${i}\`. \`@objectstack/spec\`'s \`FieldSchema\` declares \`${s}\` and does not declare \`${i}\`, so a producer emitting it would be refused at the metadata write door. ObjectUI stamps \`${s}\` here so this stored def still renders, but the consumers no longer carry a \`${i}\` fallback of their own — fix the PRODUCER, or migrate the stored document. (objectui#7650)`))}}var Ec=new Set,Dc=()=>!1,Oc=[`reference_to`,`referenceTo`],kc=new Set(Oc);function Ac(e,t,n){if(!Dc()||e.reference!==void 0)return;let r=Oc.filter(t=>e[t]!==void 0&&e[t]!==``);if(r.length===0)return;let i=t??(typeof e.name==`string`?e.name:`(unnamed field)`),a=n??`(unknown object)`;for(let t of r){let n=`${a}:${i}:${t}:${String(e[t])}`;Ec.has(n)||(Ec.add(n),console.warn(`[ObjectUI] Object \`${a}\`, field \`${i}\` declares its relationship target as \`${t}: '${String(e[t])}'\` and does NOT carry \`reference\`. \`reference\` is the only spelling the protocol declares: \`@objectstack/spec\`'s \`FieldSchema\` refuses \`${t}\` by name with \`unrecognized_keys\` ("Did you mean \`${t}\` -> \`reference\`?"). ObjectUI stamps \`reference\` here so this def still renders, but the readers no longer carry a \`${t}\` fallback of their own — fix the PRODUCER to emit \`reference\`, or serve the def through a backend that normalizes it (objectstack#13847 does this on the serve path and in \`os migrate meta\`). Maintainer ruling 2026-08-31: protocol normalization belongs on the server, the front end just executes the protocol. (objectui#6837)`))}}function jc(e,t,n){if(!e||typeof e!=`object`)return e;let r=e;Tc(r,t,n);let i=r.reference_to??r.reference??r.referenceTo;return i==null||i===``?e:(Ac(r,t,n),r.reference_to===void 0&&(r.reference_to=i),r.reference===void 0&&(r.reference=i),e)}function Mc(e){let t=e&&typeof e==`object`?e.fields:null;if(!t||typeof t!=`object`)return e;let n=typeof e.name==`string`?e.name:void 0;if(Array.isArray(t))for(let e of t)jc(e,void 0,n);else for(let[e,r]of Object.entries(t))jc(r,e,n);return e}function Nc(e,t,n,r){if(!t?.isLoaded||!n||!e||typeof e!=`object`)return e;let i={},a=!1;for(let[o,s]of Object.entries(e))o===`id`||o===`_id`||r?.includes(o)||t.checkField(n,o,`read`)?i[o]=s:a=!0;return a?i:e}T();function Pc(e,t){if(!t||!e||typeof e!=`object`)return;let n=Array.isArray(e)?e.find(e=>e?.name===t):e[t];if(n&&typeof n==`object`)return n}function Fc(e,t){let n=Pc(e,t);return n!==void 0&&_(n)}function Ic(e,t,n){let r=Fc(n,e);return{[e]:r?{$contains:t}:t}}var Lc=new Set([`id`,`created_at`,`created_by`,`updated_at`,`updated_by`,`owner_id`,`organization_id`,`owning_business_unit_id`]);function Rc(e,t){return Lc.has(e)?!0:!!t&&typeof t==`object`&&e in t}var zc=/\b(?:record|data)\.([A-Za-z_][A-Za-z0-9_]*)/g,Bc=/^[A-Za-z_][A-Za-z0-9_]*$/,Vc=/\{([a-z_][a-z0-9_]*)\}/gi;function Hc(e){if(!e||typeof e!=`object`)return;let t=e;if(t.defaultFromRow)return t.field??t.name}function Uc(e){let t=[];for(let n of[e.patch,e.bodyExtra])n&&typeof n==`object`&&!Array.isArray(n)&&t.push(...Object.keys(n));if(Array.isArray(e.params))for(let n of e.params){if(!n||typeof n!=`object`)continue;let e=n;t.push(e.name??e.field)}return t.filter(e=>e!==`recordId`)}function Wc(e){if(typeof e==`string`)return e.trim()||null;if(e&&typeof e==`object`){let t=e.source;if(typeof t==`string`)return t.trim()||null}return null}function Gc(e){let t=[],n=new Set;for(let r of e){let e=Wc(r);if(e){zc.lastIndex=0;for(let r=zc.exec(e);r;r=zc.exec(e)){let e=r[1];n.has(e)||(n.add(e),t.push(e))}}}return t}function Kc(e){let t=[];for(let n of e.conditionalFormatting??[]){if(!n||typeof n!=`object`)continue;let e=n;t.push(e.condition,e.expression),typeof e.field==`string`&&e.field&&t.push(`record.${e.field}`)}for(let n of[e.rowActionDefs,e.bulkActionDefs,e.objectActions])for(let e of n??[]){if(!e||typeof e!=`object`)continue;let n=e;if(t.push(n.visible,n.disabled),typeof n.recordIdField==`string`&&Bc.test(n.recordIdField)&&t.push(`record.${n.recordIdField}`),Array.isArray(n.params))for(let e of n.params){let n=Hc(e);typeof n==`string`&&Bc.test(n)&&t.push(`record.${n}`)}if(typeof n.target==`string`){Vc.lastIndex=0;for(let e=Vc.exec(n.target);e;e=Vc.exec(n.target))t.push(`record.${e[1]}`)}if(n.undoable)for(let e of Uc(n))typeof e==`string`&&Bc.test(e)&&t.push(`record.${e}`)}for(let n of Object.values(e.userActions??{})){if(!n||typeof n!=`object`)continue;let e=n;t.push(e.visibleWhen,e.disabledWhen)}return t}function qc(e){let t=e?.fields;if(!Array.isArray(t))return[];let n=[],r=new Set;for(let e of t){let t=e?.field;if(typeof t!=`string`)continue;let i=t.trim();i&&!r.has(i)&&(r.add(i),n.push(i))}return n}var Jc={compact:`compact`,comfortable:`medium`,spacious:`tall`},Yc={compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`};function Xc(e){if(typeof e==`string`&&Object.prototype.hasOwnProperty.call(Yc,e))return Yc[e]}var Zc=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Qc={showSearch:`search`,showSort:`sort`,showFilters:`filter`,showDensity:`rowHeight`,showGroup:`group`,showHideFields:`hideFields`,showColor:`rowColor`},$c={private:`personal`,team:`collaborative`,organization:`collaborative`,public:`collaborative`},el={label:`ariaLabel`,describedBy:`ariaDescribedBy`},tl={grid:!0,kanban:!0,gallery:!0,calendar:!0,timeline:!0,gantt:!0,map:!0,chart:!0,tree:!0},nl={list:null,detail:null,page:"it mounts a published page (bound through `pageName`) in place of rows, which this renderer has no branch for"},rl=new Set;function il(e){let t=Object.prototype.hasOwnProperty.call(nl,e)?nl[e]:null;t===null||rl.has(e)||(rl.add(e),console.warn(`[object-ui] This build accepts a ${JSON.stringify(e)} list view but cannot draw one: ${t}. The view falls back to a grid. Author a visualization this renderer draws, or render the page through the surface that owns it.`))}function al(e){return typeof e==`string`&&Object.prototype.hasOwnProperty.call(tl,e)}function ol(e){if(typeof e==`string`){if(al(e))return e;il(e)}}var sl={kanban:{groupField:`groupByField`,cardFields:`columns`},gallery:{imageField:`coverField`},timeline:{dateField:`startDateField`}};function cl(e){if(!e||typeof e!=`object`)return e;let t=e,n=t.fields,r=Array.isArray(n),i=t.densityMode,a=typeof i==`string`&&Object.prototype.hasOwnProperty.call(Jc,i),o=t.filters,s=Array.isArray(o),c=Object.keys(Qc).filter(e=>typeof t[e]==`boolean`),l=typeof t.showDescription==`boolean`,u=Zc(t.aria)?t.aria:void 0,d=!!u&&Object.keys(el).some(e=>u[e]!==void 0),f=Zc(t.sharing)?t.sharing:void 0,p=!!f&&(f.visibility!==void 0||f.enabled!==void 0),m=Zc(t.data)?t.data:void 0,h=m?.provider===`object`&&typeof m.object==`string`&&m.object?m.object:void 0,g=h!==void 0&&!(typeof t.objectName==`string`&&t.objectName),_=t.viewType,v=ol(t.specType)??ol(t.type),y=!_||_===`list`,b=Array.isArray(t.columns)?t.columns:r?n:void 0,x=Ut(b),S=x!==b,C=Object.entries(sl).map(([e,n])=>{let r=Zc(t[e])?t[e]:void 0;if(!r)return;let i=Object.keys(n).filter(e=>r[e]!==void 0);return i.length?{viewKey:e,aliases:n,cfg:r,legacyKeys:i}:void 0}).filter(e=>e!==void 0);if(!r&&!a&&!s&&!c.length&&!l&&!d&&!p&&!y&&!S&&!C.length&&!g)return e;let w={...t};if(r&&(Array.isArray(w.columns)||(w.columns=n),delete w.fields),S&&(w.columns=x),a&&(typeof w.rowHeight!=`string`&&(w.rowHeight=Jc[i]),delete w.densityMode),s&&(Array.isArray(w.filter)||(w.filter=o),delete w.filters),c.length){let e={...Zc(w.userActions)?w.userActions:{}};for(let n of c){let r=Qc[n];typeof e[r]!=`boolean`&&(e[r]=t[n]),delete w[n]}w.userActions=e}if(l){let e={...Zc(w.appearance)?w.appearance:{}};typeof e.showDescription!=`boolean`&&(e.showDescription=t.showDescription),delete w.showDescription,w.appearance=e}if(d&&u){let e={...u};for(let[t,n]of Object.entries(el))e[n]===void 0&&u[t]!==void 0&&(e[n]=u[t]),delete e[t];w.aria=e}if(p&&f){let e={...f};if(e.type===void 0){let t=typeof f.visibility==`string`?f.visibility:void 0,n=t?$c[t]:f.enabled===!0?`personal`:void 0;n&&(e.type=n)}delete e.visibility,delete e.enabled,w.sharing=e}for(let{viewKey:e,aliases:t,cfg:n,legacyKeys:r}of C){let i={...n};for(let e of r){let r=t[e];i[r]===void 0&&(i[r]=n[e]),delete i[e]}w[e]=i}return g&&(w.objectName=h),y&&(w.viewType=v??`grid`),w}function ll(e,t){return t?.provider===`object`?t.object:e?.objectName}function ul(e,t){return e?t===`array`?Array.isArray(e):t!==`view-data`||!Array.isArray(e):!1}function dl(e,t){return ul(e.data,t)?e.data:e.staticData?{provider:`value`,items:e.staticData}:e.objectName?{provider:`object`,object:e.objectName}:null}var fl=Object.freeze({"object-grid":`view-data`,"plugin-grid:object-grid":`view-data`,"view:grid":`view-data`,"object-map":`view-data`,"plugin-map:object-map":`view-data`,"object-gantt":`view-data`,"plugin-gantt:object-gantt":`view-data`,"object-calendar":`array`,"plugin-calendar:object-calendar":`array`,"view:calendar":`array`,calendar:`array`,"object-tree":`undeclared`,"plugin-tree:object-tree":`undeclared`,"view:tree":`undeclared`,tree:`undeclared`});function pl(e){return typeof e==`string`?fl[e]??`undeclared`:`undeclared`}function ml(e){return e.replace(/[_-]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}var hl=t({ACTION_DEF_KEYS:()=>Ci,ActionEngine:()=>ea,ActionRunner:()=>B,BUILTIN_AGGREGATES:()=>Xo,CANONICAL_COLUMN_IDENTITY_KEY:()=>M,CANONICAL_COLUMN_LABEL_KEY:()=>Wt,CAP_REACT_PAGES:()=>oo,CASCADE_OPTION_WIDGET_TYPES:()=>bi,CHART_BUCKET_ID_KEY:()=>es,ComponentRegistry:()=>A,DATE_RANGE_FILTER_NAME:()=>bo,DATE_RANGE_PRESETS:()=>l,DENSITY_MODE_TO_ROW_HEIGHT:()=>Jc,DebugCollector:()=>Ja,ELEMENT_DATA_SOURCE_KEY:()=>Ke,ERROR_CODES:()=>Ra,EXPANDABLE_FIELD_TYPES:()=>qt,ExpressionCache:()=>Nr,ExpressionContext:()=>kr,ExpressionEvaluator:()=>I,FIELD_SORTABLE_UNPROVISIONED_ANCHOR:()=>FIELD_SORTABLE_UNPROVISIONED_ANCHOR,FIELD_UNSORTABLE_VIRTUAL_TYPE:()=>FIELD_UNSORTABLE_VIRTUAL_TYPE,FilterOperatorError:()=>O,FormulaFunctions:()=>Pr,HOST_DISPATCH_ACTION_KEYS:()=>Ei,HTML_TIER_INTRINSICS:()=>Qe,KNOWN_ACTION_KEYS:()=>Oi,LEGACY_COLUMN_IDENTITY_KEYS:()=>Ft,NAVIGATION_ALIAS_KEYS:()=>Ti,NON_GRID_ROW_CEILING:()=>jt,NULL_CATEGORY_LABEL:()=>$o,OBJECT_SORTABILITY_KEY:()=>nn,ObjectUIError:()=>za,PLATFORM_RECORD_COLUMNS:()=>Lc,PUBLIC_BLOCKS:()=>Ze,RETIRED_ACTION_KEYS:()=>Di,RETIRED_FIELD_TYPES:()=>Xt,ROW_HEIGHT_TO_DENSITY_MODE:()=>Yc,ROW_PREDICATE_CANONICAL_ROOT:()=>Yr,Registry:()=>tt,SDUI_DOM_PASS_THROUGH_KEYS:()=>xt,SPEC_ACTION_KEYS:()=>wi,STYLE_BREAKPOINTS:()=>Ya,SafeExpressionParser:()=>Mr,TABLE_ADAPTER_COLUMN_KEY:()=>TABLE_ADAPTER_COLUMN_KEY,TABLE_ADAPTER_HEADER_KEY:()=>Gt,UNMATERIALIZED_FIELD_TYPES:()=>en,UndoManager:()=>Si,actionErrorDetail:()=>Ii,applyNonGridRowCeiling:()=>Nt,attachObjectSortability:()=>on,axisPresentation:()=>js,buildCategoryOrder:()=>ds,buildCategoryRank:()=>fs,buildChartSeries:()=>ss,buildDatasetDrillFilter:()=>cc,buildDatasetFieldHelpers:()=>sc,buildDimensionLabelMap:()=>hs,buildExpandFields:()=>Yt,buildExportFileName:()=>gc,buildFieldColorMap:()=>dc,buildFilterCondition:()=>zo,buildOptionColorMap:()=>us,buildWidgetScopedFilter:()=>Vo,chartBucketId:()=>q,chartCategoryKey:()=>ws,chartConfigPresentation:()=>Ps,chartMeasureKey:()=>Cs,chartRowBucketId:()=>ts,chartTypeIgnoresCompareTo:()=>Is,classifyActionKeys:()=>ki,collectGroupingFieldRefs:()=>qc,collectPredicateFieldRefs:()=>Gc,columnHeader:()=>Kt,columnIdentity:()=>Rt,compareSortValues:()=>xr,compareToTrendLabelKey:()=>Ko,compileScopedStyles:()=>eo,composeDrillFilter:()=>mo,composeParentScopeFilter:()=>Ic,computeDrillFilter:()=>uo,convertFiltersToAST:()=>Se,convertOperatorToAST:()=>me,convertSortToQueryParams:()=>Or,createFieldColorResolver:()=>fc,createServerActionHandler:()=>ia,dashboardFilterVariableDefs:()=>Lo,debugLog:()=>Ua,debugTime:()=>Ga,debugTimeEnd:()=>Ka,declaredNameField:()=>mr,deriveDimensionLabelMaps:()=>xs,deriveTitleField:()=>pr,detectNonCanonicalRowSpelling:()=>Zr,dimensionOptionTranslator:()=>bs,evalFieldPredicate:()=>F,evalRowPredicate:()=>ci,executeBulkBatch:()=>ta,extractRecords:()=>At,filterPlatformSortableSort:()=>ln,filterRefusalSubject:()=>fe,findChartSeriesRow:()=>ls,formatDate:()=>Ks,formatDateTime:()=>Js,formatDateTimeCompactParts:()=>qs,formatDimensionValue:()=>oc,formatDisplayNumber:()=>Rs,formatMeasure:()=>ac,formatRelativeDate:()=>Gs,formatTitleTemplate:()=>cr,fromDateTimeInputValue:()=>Qs,getRecordDisplayName:()=>yr,getSortValue:()=>br,globalUndoManager:()=>R,hasDeclaredPredicate:()=>j,hasDeprecatedObjectParams:()=>Pi,hasResponsiveStyles:()=>Qa,humanizeLabel:()=>ml,interpolate:()=>co,interpretActionResponse:()=>Bi,isBlankPredicateText:()=>ct,isBuiltinAggregate:()=>Zo,isCapabilityEnabled:()=>ao,isColorLiteral:()=>uc,isDebugEnabled:()=>Ha,isDrillEnabled:()=>po,isEmptyValue:()=>Pt,isExpandableFieldType:()=>Jt,isImpossibleStoredDay:()=>$s,isLegacyActionEnvelope:()=>zi,isLegacyDialectSource:()=>ni,isListViewVisualization:()=>al,isMissingForRequired:()=>nt,isMultiValueRelationship:()=>Fc,isObjectInlineEditable:()=>kt,isObjectUIError:()=>Ba,isOpenDomAttributeFamily:()=>St,isOptionGroupGated:()=>hi,isPlatformSortableField:()=>cn,isProjectableField:()=>Rc,isRealCalendarDate:()=>Vs,isRecordScopedAction:()=>na,isRetiredFieldType:()=>Zt,isRuntimeDefault:()=>it,isServerOwnedValue:()=>at,isStructuredGroupBy:()=>Ts,isTitleEligibleField:()=>lr,isUnmaterializedFieldType:()=>tn,isValueStillOffered:()=>vi,leadWithNameField:()=>gr,listViewPredicates:()=>Kc,loadDimensionFieldMeta:()=>Ss,localizeFieldOptions:()=>ms,mergeAuthoredPresentation:()=>Ns,mergeAuthoredSeries:()=>Ms,mergeFilterNodes:()=>Ae,mergeFilters:()=>Ho,nonGridRowCeilingQuery:()=>Mt,normalizeColumnIdentities:()=>Ut,normalizeColumnIdentity:()=>Ht,normalizeFieldReferenceKeys:()=>jc,normalizeListViewSchema:()=>cl,normalizeObjectSortability:()=>an,normalizeSchemaReferenceKeys:()=>Mc,normalizeSortEntries:()=>Dr,normalizeUserAction:()=>Tt,objectAggregateSpecQuery:()=>Es,optionDisplayLabel:()=>_i,parentRelationshipFieldDef:()=>Pc,parseDebugFlags:()=>Va,partitionRowsByPredicate:()=>li,percentDisplayValue:()=>ec,pickDomProps:()=>Ct,pivotBucketId:()=>Jo,pivotCellKey:()=>Yo,pivotDimensionValue:()=>qo,readActionPayload:()=>Li,readObjectSortability:()=>sn,readOnSuccessNavigation:()=>Yi,recordDelete:()=>ca,recordDisplayValueAt:()=>N,recordSourceDataArmForType:()=>pl,relabelDimensions:()=>cs,reportRetiredFieldType:()=>$t,resolveCascadingOptions:()=>yi,resolveConditionalFormatting:()=>pi,resolveContextTokens:()=>vo,resolveDashboardFilterDefs:()=>Io,resolveDateMacros:()=>ho,resolveDependsOnFields:()=>mi,resolveDimensionFieldMeta:()=>ys,resolveDrillTitle:()=>fo,resolveEffectiveCrudAffordances:()=>Ot,resolveFieldRuleState:()=>Kr,resolveFilterPlaceholders:()=>yo,resolveMeasureLabel:()=>Qo,resolveNameField:()=>hr,resolveRecordIdParamSeed:()=>aa,resolveRecordSourceConfig:()=>dl,resolveRecordSourceObjectName:()=>ll,resolveRelationshipTarget:()=>vs,resolveServerActionRecordId:()=>ra,resolveViewId:()=>je,resolveVisibleOptions:()=>gi,rowHeightToDensityMode:()=>Xc,sanitizeFileNameBase:()=>hc,scopeClassFor:()=>$a,seriesPresentation:()=>As,shiftFilterByCompareTo:()=>Go,shouldGroupDisplayNumber:()=>Ls,toDateInputValue:()=>Xs,toDateTimeInputValue:()=>Zs,toDisplayDate:()=>Hs,toDomProps:()=>wt,toFilterNode:()=>Oe,toFilterNodeSafely:()=>ke,toPredicateInput:()=>st,toPredicateRecord:()=>ei,userActionPredicates:()=>Et,validateSchema:()=>bt,warnOnDeprecatedObjectParams:()=>Fi,warnOnUnknownActionKeys:()=>ji,withElementDataSourceInput:()=>et,withoutDeniedFields:()=>Nc}),gl=(0,k.createContext)({});function _l({scope:e,children:t}){return(0,k.createElement)(gl.Provider,{value:e},t)}function Y(){return(0,k.useContext)(gl)}function vl(e){return(0,k.useMemo)(()=>typeof e!=`object`||!e||Array.isArray(e)?{}:{record:e},[e])}var yl=new Set;function bl(e,t={},n){let r=Y();return(0,k.useMemo)(()=>{let i=new I({...r,...t});if(n?.throwOnError)try{return i.evaluateCondition(e,{throwOnError:!0})}catch(t){let r=typeof e==`string`?e:String(e),i=`${n?.label??``}::${r}`;if(!yl.has(i)){yl.add(i);let e=t instanceof Error?t.message:String(t);console.warn(`[object-ui] ${n?.label??`a component`} was hidden/disabled: its predicate threw — ${e}. Predicate: ${r}.`)}return!1}return i.evaluateCondition(e)},[e,t,r,n?.throwOnError,n?.label])}function xl(e,t,n){let r=Y(),i=n?.fallback??!0,a=n?.fields;return(0,k.useMemo)(()=>typeof e==`boolean`?e:e==null||e===``?i:ci(e,t??{},{fallback:i,scope:r,warnOnError:n?.warnOnError,label:n?.label,fields:a}),[e,t,r,i,n?.warnOnError,n?.label,a])}var X=n(),Z=(0,k.createContext)(null),Sl=({children:e,dataSource:t,debug:n,debugFlags:r,apiFetch:i})=>{let a=(0,k.useContext)(Z),o=i??a?.apiFetch,s=(0,k.useMemo)(()=>({dataSource:t,debug:n,debugFlags:r,apiFetch:o}),[t,n,r,o]);return(0,X.jsx)(Z.Provider,{value:s,children:e})},Cl=()=>{let e=(0,k.useContext)(Z);if(!e)throw Error(`useSchemaContext must be used within a SchemaRendererProvider`);return e},wl=e=>{let t=Y();if(e&&t)return e.split(`.`).reduce((e,t)=>e&&e[t],t)},Tl=k.createContext(null),El=({children:e})=>{let t=k.useMemo(()=>{let e=new Map,t=jl,n=new Set,r=()=>{let r=new Set;for(let t of e.values())for(let e of t)r.add(e);if(r.size===t.size){let e=!0;for(let n of r)if(!t.has(n)){e=!1;break}if(e)return}t=r,n.forEach(e=>e())};return{getNames:()=>t,subscribe:e=>(n.add(e),()=>{n.delete(e)}),register:(t,n)=>{let i=e.get(t);i&&i.length===n.length&&i.every((e,t)=>e===n[t])||(e.set(t,[...n]),r())},unregister:t=>{e.delete(t)&&r()}}},[]);return(0,X.jsx)(Tl.Provider,{value:t,children:e})};function Dl(){let e=k.useContext(Tl);return k.useSyncExternalStore(e?e.subscribe:kl,e?e.getNames:Al,e?e.getNames:Al)}function Ol(e,t){let n=k.useContext(Tl),r=t.join(`|`);k.useEffect(()=>{if(n)return n.register(e,r.length===0?[]:r.split(`|`)),()=>n.unregister(e)},[n,e,r])}var kl=e=>()=>{},Al=()=>jl,jl=new Set,Ml=k.createContext(null),Nl=({children:e,recordId:t,...n})=>{let r={...n,recordId:typeof t==`number`?String(t):t},i=k.useMemo(()=>r,[r.objectName,r.recordId,r.dataSource,r.data,r.objectSchema,r.refresh,r.embedded,r.headerSystemActions,r.isFavorite,r.onToggleFavorite]);return(0,X.jsx)(Ml.Provider,{value:i,children:e})};function Pl(){return k.useContext(Ml)}var Fl=(0,k.createContext)(null);function Il(e){if(!e||e.length===0)return{};let t={};for(let n of e)if(n.defaultValue!==void 0)t[n.name]=n.defaultValue;else switch(n.type){case`number`:t[n.name]=0;break;case`boolean`:t[n.name]=!1;break;case`object`:t[n.name]={};break;case`array`:t[n.name]=[];break;default:t[n.name]=``}return t}var Ll=({definitions:e,children:t})=>{let n=(0,k.useContext)(Fl),[r,i]=(0,k.useState)(()=>Il(e)),a=(0,k.useMemo)(()=>e??[],[e]),o=(0,k.useMemo)(()=>new Set(a.map(e=>e.name)),[a]),s=(0,k.useCallback)((e,t)=>{if(!o.has(e)&&n&&n.definitions.some(t=>t.name===e)){n.setVariable(e,t);return}i(n=>({...n,[e]:t}))},[o,n]),c=(0,k.useCallback)(e=>{for(let[t,n]of Object.entries(e))s(t,n)},[s]),l=(0,k.useCallback)(()=>{i(Il(e))},[e]),u=(0,k.useMemo)(()=>n?{...n.variables,...r}:r,[n,r]),d=(0,k.useMemo)(()=>n?[...n.definitions.filter(e=>!o.has(e.name)),...a]:a,[n,a,o]),f=(0,k.useMemo)(()=>({variables:u,definitions:d,setVariable:s,setVariables:c,resetVariables:l}),[u,d,s,c,l]);return(0,X.jsx)(Fl.Provider,{value:f,children:t})};Ll.displayName=`PageVariablesProvider`;function Rl(){return(0,k.useContext)(Fl)??zl}var zl=Object.freeze({variables:Object.freeze({}),definitions:Object.freeze([]),setVariable:()=>{},setVariables:()=>{},resetVariables:()=>{}});function Bl(e){let{variables:t,definitions:n,setVariable:r}=Rl();return(0,k.useMemo)(()=>{if(!e)return null;let i=n.find(t=>t.source===e);return i?{name:i.name,value:t[i.name],setValue:e=>r(i.name,e)}:null},[e,n,t,r])}function Vl(e){if(e!=null)return typeof e==`string`?e:e.defaultValue||e.key}function Q(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}var Hl=`params`;function Ul(e){if(!Q(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Wl(e){return Ul(e)}function Gl(e,t,n,r){if(typeof e==`string`)return n(e,t);if(Array.isArray(e)){if(r.has(e))return e;r.add(e);let i;for(let a=0;a<e.length;a++){let o=Gl(e[a],t+`[`+a+`]`,n,r);o!==e[a]&&(i||=e.slice(),i[a]=o)}return r.delete(e),i??e}if(Ul(e)){if(r.has(e))return e;r.add(e);let i;for(let a of Object.keys(e)){let o=e[a],s=Gl(o,t+`.`+a,n,r);s!==o&&(i||={...e},Object.defineProperty(i,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))}return r.delete(e),i??e}return e}function Kl(e,t,n=Hl){return Gl(e,n,t,new Set)}var ql=/\$\{([^}]+)\}/g;function Jl(e){let t=[];ql.lastIndex=0;let n=ql.exec(e);for(;n!==null;)t.push(n[0]),n=ql.exec(e);return t}function Yl(e,t,n,r){let i=Jl(n);i.length>0&&r.push({key:e,channel:t,value:n,expressions:i})}function Xl(e,t,n,r){if(Q(e)){for(let[i,a]of Object.entries(e))if(!r?.(i,a)){if(i===`params`&&Wl(a)){Kl(a,(e,r)=>(Yl(r,t,e,n),e));continue}typeof a==`string`&&Yl(i,t,a,n)}}}function Zl(e,t,n){let r=[];Xl(t,`properties`,r);let i=Q(t)?t:void 0;return Xl(e,`schema`,r,(e,t)=>i?.[e]===t),Xl(n,`props`,r),r}function Ql(e){switch(e.channel){case`properties`:return`properties.`+e.key;case`props`:return`props.`+e.key;default:return e.key}}function $l(e,t,n){let r=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,i=typeof t==`string`&&t?` (id: "`+t+`")`:``,a=n.map(e=>` - `+Ql(e)+`: `+JSON.stringify(e.value)+` [`+e.expressions.join(`, `)+`]`);return`[ObjectUI] Unevaluated expression reached the DOM - node `+r+i+`
4
- `+a.join(`
5
- `)+"\nThe value above is placed VERBATIM: it is handed to the renderer, and spread\nto the DOM, with its source text intact. Either SchemaRenderer does not\nevaluate this key, or the expression threw and the evaluator returned the\nsource unchanged.\nChannels that do evaluate and read back today: `content`; `properties.*`,\nwhich is evaluated and then HOISTED onto the node, so a renderer declared\nas `({ schema })` reads it back as `schema.<key>`; every string leaf of a\n`params` bag, at any depth, node-level or under `properties`; or resolve\nthe value in the host before handing the schema to SchemaRenderer."}var eu=typeof WeakSet<`u`?new WeakSet:{add(){},has(){return!1}};function tu(e,t,n,r,i,a){let o=Zl(r,i,a);if(o.length===0)return o;if(e&&typeof e==`object`){if(eu.has(e))return o;eu.add(e)}return console.error($l(t,n,o)),o}var nu=`element:`,ru=new Set([`view:simple`]);function iu(e){return typeof e!=`string`||e.length===0?!1:e.startsWith(nu)?!0:ru.has(e)}var au="[ObjectUI] A `props` config bag was not read";function ou(e,t){return`${typeof e==`string`&&e?`\`${e}\``:`(untyped node)`}${typeof t==`string`&&t?` (id: '${t}')`:``}`}function su(e,t,n){let r=n.map(e=>`\`${e}\``).join(`, `),i=n.length===1;return`${au} - node ${ou(e,t)}\n ${i?`Key`:`Keys`} under \`props\`: ${r}\n\`props\` is NOT hoisted onto the node — only \`properties.*\` is. It is spread as
6
- React props on the created element, so \`schema.${n[0]}\` is undefined and a\nrenderer declared as \`({ schema })\` never sees ${i?`this key`:`these keys`}. Nothing throws and\nnothing is logged by the renderer: the node renders as if the bag were empty.
7
- Write ${i?`it`:`them`} under \`properties\` instead (or at node level, where the node's\nschema declares the key). The \`element:*\` renderers merge both bags via
8
- \`readProps()\`; every other renderer reads \`schema\`. (objectui#6708)`}var cu=new Set;function lu(e,t,n){if(iu(e)||!Q(t)||!Q(n))return null;let r=Object.keys(n);return r.length>0?r:null}function uu(e,t,n,r){let i=lu(e,n,r);if(!i)return null;let a=su(e,t,i);return cu.has(a)?null:(cu.add(a),console.warn(a),a)}var du="[ObjectUI] A node-gate predicate under `props` is REFUSED",fu=new Set([`disabled`]);function pu(e,t,n){let r=n.map(e=>`\`${e}\``).join(`, `),i=n.length===1;return`${du} - node ${ou(e,t)}\n ${i?`Key`:`Keys`} parked under \`props\`: ${r}\n\`props\` is NOT an authoring surface for the node gates. \`SchemaRenderer\`
9
- hoists \`properties.*\` onto the node and reads its visibility / enablement
10
- gates from there; nothing copies \`props.*\`, so this predicate is never a key
11
- either gate can see. ${i?`It gates`:`They gate`} nothing - the node renders and stays enabled\nexactly as if the predicate said yes, which is why nothing on screen says so.
12
- MIGRATION: move ${i?`it`:`them`} out of \`props\` - onto the node itself\n(\`{ "type": "card", "visibleWhen": ... }\`, the spelling the spec declares), or
13
- into the \`properties\` bag, which IS hoisted. The worked pair is in
14
- \`skills/objectui/rules/protocol.md\`. (objectui#9108)`}function mu(e,t,n){if(!Q(n))return null;let r=iu(e),i=Object.keys(n).filter(e=>t.has(e)&&!(r&&fu.has(e)));return i.length>0?i:null}var hu=new Set;function gu(e,t,n,r){let i=mu(e,n,r);if(!i)return null;let a=pu(e,t,i);return hu.has(a)?null:(hu.add(a),console.error(a),a)}var _u=new Set;function vu(e,t){let n=t===void 0?e:`${e}#${t}`;_u.has(n)||(_u.add(n),console.warn(`[ObjectUI] SchemaRenderer: the authored \`data\` key on <${e}${t===void 0?``:` id="${t}"`}> was NOT passed to the component as a React prop. This block's published \`data\` row is the \`ViewData\` OBJECT arm, so \`data\` is read from the schema and judged by that row (objectui#8348). Inline rows go at \`data: { provider: "value", items: [...] }\`; a bare array under \`data\` is refused. A HOST passing rows down as a React \`data\` prop is unaffected.`))}var yu=`[ObjectUI] A visibility predicate could not be evaluated`,bu=`[ObjectUI] An enablement predicate could not be evaluated`;function xu(e){if(e&&typeof e==`object`){let t=e.source;if(typeof t==`string`)return t}return typeof e==`string`?e:String(e)}var Su={"page-component":"Page-component predicates bind `record` (the row on a record page),\n`current_user`, and page state as `page.<var>`. Check those roots and the\nCEL syntax.","app-shell":"App-shell predicates bind `current_user` - also spelled `user`, `ctx.user`\nand `os.user` - plus `features` (the deployment flags).\nNeither `record` nor `page.<var>` exists at this tier.\nCheck those roots and the CEL syntax."},Cu={visibility:{prefix:yu,consequence:`The node was treated as its safe default, which on this surface means the
15
- gate did NOT bite - a predicate that cannot be evaluated reads on screen
16
- exactly like one that said yes.
17
- `},concealment:{prefix:yu,consequence:`The node was treated as its safe default, which on THIS leg is the one
18
- that BITES: \`hidden\` / \`hiddenOn\` are NOT negated, so that default
19
- REMOVED the node - it is not on the page at all, and an absent node is
20
- indistinguishable from metadata that meant to hide it. Nothing is broken
21
- in the renderer: the block is missing because the predicate above could
22
- not be evaluated.
23
- `},enablement:{prefix:bu,consequence:`The node was treated as its safe default, which on THIS gate is the one
24
- that BITES: the node renders DISABLED - on screen, greyed out, refusing
25
- input - and that is indistinguishable from a gate the author meant to
26
- close. No pixel says a predicate failed, so this line is the only thing
27
- that will ever name the one that did it.
28
- `}};function wu(e,t,n,r,i,a=`page-component`,o=`visibility`){let s=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,c=typeof t==`string`&&t?` (id: "`+t+`")`:``,l=Cu[o];return l.prefix+` - node `+s+c+`
29
- `+n+`: `+JSON.stringify(xu(r))+`
30
- Reason: `+i+`
31
- `+l.consequence+Su[a]}var Tu=new Set;function Eu(e,t,n,r,i,a=`page-component`,o=`visibility`){let s=i instanceof Error?i.message:String(i),c=JSON.stringify([e,n,xu(r)]);Tu.has(c)||(Tu.add(c),console.warn(wu(e,t,n,r,s,a,o)))}var Du={visibility:{prefix:"[ObjectUI] A visibility predicate read `data.*` that the bound `data` does not answer",consequence:"At the node tier `data` is whatever the HOST published under that name\nin the ambient predicate scope, and it is NOT the row. Since\nobjectui#9308 it is not the data-source adapter either - the renderer\nbinds no `data` of its own. The reads above are undefined on it, so\nthis predicate is a CONSTANT: it does not\ndepend on the row at all, and on this surface a constant `false` hides the\nnode on every row while looking exactly like a gate that said no.\nWrite the row as `record.*` (e.g. `record.status`), which page-component\npredicates bind alongside `current_user` and page state as `page.<var>`.\n`data.*` as a spelling for the row is deprecated (objectui#5330) and was\nnever bound to the row on this tier."},enablement:{prefix:"[ObjectUI] An enablement predicate read `data.*` that the bound `data` does not answer",consequence:"At the node tier `data` is whatever the HOST published under that name\nin the ambient predicate scope, and it is NOT the row. Since\nobjectui#9308 it is not the data-source adapter either - the renderer\nbinds no `data` of its own. The reads above are undefined on it, so\nthis predicate is a CONSTANT: it does not\ndepend on the row at all, and on THIS gate the dangerous polarity is a\nconstant `true`: the node renders DISABLED - on screen, greyed out,\nrefusing input - on every row, in every build, while looking exactly\nlike a gate that said no. No pixel says the predicate is a constant, so\nthis line is the only thing that will ever name it.\nWrite the row as `record.*` (e.g. `record.status`), which page-component\npredicates bind alongside `current_user` and page state as `page.<var>`.\n`data.*` as a spelling for the row is deprecated (objectui#5330) and was\nnever bound to the row on this tier."}};function Ou(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g,`''`)}var ku=/(^|[^A-Za-z0-9_$.])data\.([A-Za-z_$][A-Za-z0-9_$]*(?:\.[A-Za-z_$][A-Za-z0-9_$]*)*)/g;function Au(e,t){let n=Ou(e),r=[];ku.lastIndex=0;let i;for(;(i=ku.exec(n))!==null;){let e=i[2],n=t;try{for(let t of e.split(`.`)){if(n==null){n=void 0;break}n=n[t]}}catch{return[]}let a=`data.`+e;n===void 0&&r.indexOf(a)===-1&&r.push(a)}return r}function ju(e,t,n,r,i,a=`visibility`){let o=typeof e==`string`&&e?`"`+e+`"`:`(untyped node)`,s=typeof t==`string`&&t?` (id: "`+t+`")`:``,c=Du[a];return c.prefix+` - node `+o+s+`
32
- `+n+`: `+JSON.stringify(xu(r))+"\n Unanswered by the bound `data`: "+i.join(`, `)+`
33
- `+c.consequence}function Mu(e,t,n,r,i,a=`visibility`){let o=xu(r);if(o.indexOf(`data.`)===-1)return;let s=Au(o,i);if(s.length===0)return;let c=JSON.stringify([`adapter-only-data`,e,n,o]);Tu.has(c)||(Tu.add(c),console.warn(ju(e,t,n,r,s,a)))}var $=(()=>{try{return!1}catch{return!0}})(),Nu=typeof WeakMap<`u`?new WeakMap:{set(){},get(){},has(){return!1}},Pu=typeof WeakSet<`u`?new WeakSet:{add(){},has(){return!1}};function Fu(e){if(!$||!e||typeof e!=`object`)return{valid:!0,messages:[]};let t=Nu.get(e);if(t)return t;let n={valid:!0,messages:[]};try{let t=bt(e);if(!t.valid){let r=t.errors.map(e=>`${e.path}: ${e.message}`);n={valid:!1,messages:r},Pu.has(e)||(Pu.add(e),console.warn(`[ObjectUI] Invalid schema detected:
34
- `+r.join(`
35
- `),e))}}catch(t){Pu.has(e)||(Pu.add(e),console.warn(`[ObjectUI] Schema validator threw:`,t))}return Nu.set(e,n),n}function Iu(e){let t={};return e.ariaLabel&&(t[`aria-label`]=Vl(e.ariaLabel)),e.ariaDescribedBy&&(t[`aria-describedby`]=e.ariaDescribedBy),e.role&&(t.role=e.role),t}var Lu=new Set([`type`,`id`]);function Ru(e,t){if(!Q(e))return{};if(!Q(t))return e;let n=null;for(let r of Object.keys(t))Lu.has(r)||Object.prototype.hasOwnProperty.call(e,r)&&(n||={...e},delete n[r]);return n??e}var zu=[`visibleWhen`,`visible`,`visibleOn`,`visibility`],Bu=[`hidden`,`hiddenOn`],Vu=new Set([...zu,...Bu]),Hu=[`disabled`,`disabledOn`],Uu=[`enabled`],Wu=new Set([...Vu,...Hu,...Uu]),Gu=new Set([...Vu,...Hu]),Ku=e=>Q(e)&&e.dialect===`cel`&&typeof e.source==`string`,qu=(e,t,n)=>Wu.has(e)&&Ku(t)?t:n(t),Ju=e=>Q(e)&&typeof e.dialect==`string`&&typeof e.source==`string`,Yu=(e,t)=>!Wu.has(e)&&Q(t)&&!Ju(t),Xu=(e,t,n)=>({...e,current_user:e?.user,...t&&typeof t==`object`&&!Array.isArray(t)?{record:t}:null,page:n}),Zu=(e,t,n)=>t===`params`&&Wl(n)?Kl(n,t=>e.evaluate(t)):Yu(t,n)?n:qu(t,n,t=>e.evaluate(t)),Qu=(e,t)=>{let n={...t};for(let[t,r]of Object.entries(n))n[t]=Zu(e,t,r);return n};function $u(e,t,n,r){return Q(e)?Qu(new I(Xu(t,n,r)),e):e}var ed=e=>Bu.includes(e)?`concealment`:`visibility`;function td(e){let t=e.properties,n=Q(t),r=r=>n&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:e[r];for(let e of zu)if(r(e)!==void 0)return e;for(let e of Bu)if(j(r(e)))return e}function nd(e){if(typeof e!=`string`||e===``)return;let t=e.toLowerCase();for(let n of A.getKnownTypes())if(n!==e&&n.toLowerCase()===t)return n}var rd=class extends k.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidUpdate(e){this.state.hasError&&(e.componentType!==this.props.componentType||e.resetKey!==this.props.resetKey)&&this.setState({hasError:!1,error:null})}handleRetry=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError&&this.state.error){let e=this.state.error;return Ba(e),(0,X.jsxs)(`div`,{className:`p-4 border border-orange-400 rounded bg-orange-50 text-orange-700 my-2`,role:`alert`,children:[(0,X.jsxs)(`p`,{className:`font-medium`,children:[`Component`,this.props.componentType?` "${this.props.componentType}"`:``,` failed to render`]}),(0,X.jsx)(`p`,{className:`text-sm mt-1`,children:e.message}),!1,(0,X.jsx)(`button`,{type:`button`,onClick:this.handleRetry,className:`mt-2 text-sm underline hover:no-underline`,children:`Retry`})]})}return this.props.children}},id={};function ad(e,t){if(!t||!(`data`in e))return e;let{data:n,...r}=e;return r}function od(e){if(!(`objectFields`in e))return e;let{objectFields:t,...n}=e;return n}var sd=(0,k.forwardRef)(({schema:e,...t},n)=>{let r=(0,k.useContext)(Z),i=r?.dataSource||id,a=Y(),o=Pl()?.data,{variables:c}=Rl(),[,l]=(0,k.useReducer)(e=>e+1,0);(0,k.useEffect)(()=>{let e=A.subscribe(l);return l(),e},[]);let[u,d]=(0,k.useState)(null),f=k.useId(),p=(0,k.useMemo)(()=>{if(!e||typeof e!=`object`)return e;let t=new I(Xu(a,o,c)),n={...e},r=(e,r)=>{let i=ed(r);if(!$)return t.evaluateCondition(e,{onFault:t=>Eu(n.type,n.id,r,e,t,`page-component`,i)});try{let i=t.evaluateCondition(e,{throwOnError:!0});return Mu(n.type,n.id,r,e,a?.data),i}catch(t){return Eu(n.type,n.id,r,e,t,`page-component`,i),!0}},i=(e,r)=>{let i=!1,o=t.evaluateCondition(e,{onFault:t=>{i=!0,Eu(n.type,n.id,r,e,t,`page-component`,`enablement`)}});return $&&!i&&Mu(n.type,n.id,r,e,a?.data,`enablement`),o},l=(e,n)=>Zu(t,e,n);Wl(n.params)&&(n[Hl]=l(Hl,n[Hl]));let u=Q(n.properties)?n.properties:void 0;if(u&&(n.properties=Qu(t,u)),$){let e=td(n);if(e&&u&&Object.prototype.hasOwnProperty.call(u,e)){let t=u[e];typeof t==`string`&&t.includes("${")&&r(t,e)}}if(Q(n.properties)){let e=n.type,t=n.id,r=n.properties;for(let[e,t]of Object.entries(r))e!==`type`&&e!==`id`&&(n[e]=t);e!==void 0&&(n.type=e),t!==void 0&&(n.id=t),n.properties=r}typeof n.content==`string`&&(n.content=t.evaluate(n.content));for(let e of s(typeof n.type==`string`?n.type:``))typeof n[e]==`string`&&(n[e]=t.evaluate(n[e]));if(Q(n.props)){let e={...n.props};for(let[t,n]of Object.entries(e))e[t]=l(t,n);n.props=e}return gu(n.type,n.id,Gu,Ru(n.props,n.properties)),(n.visibleWhen===void 0?n.visible===void 0?n.visibleOn===void 0?n.visibility===void 0?j(n.hidden)?r(n.hidden,`hidden`):j(n.hiddenOn)&&r(n.hiddenOn,`hiddenOn`):!r(n.visibility,`visibility`):!r(n.visibleOn,`visibleOn`):!r(n.visible,`visible`):!r(n.visibleWhen,`visibleWhen`))&&(n._hidden=!0),(j(n.disabled)?i(n.disabled,`disabled`):j(n.disabledOn)&&i(n.disabledOn,`disabledOn`))&&(n._disabled=!0),n},[e,i,a,c,o]),m=(0,k.useMemo)(()=>{let e=p;if(!e||typeof e!=`object`)return{scopeClass:``,scopedCss:``,mergedClassName:void 0,schemaForComponent:e};let t=e.responsiveStyles;if(!Qa(t))return{scopeClass:``,scopedCss:``,mergedClassName:e.className,schemaForComponent:e};let n=$a(e.id??f),r=[e.className,n].filter(Boolean).join(` `);return{scopeClass:n,scopedCss:eo(`.${n}`,t),mergedClassName:r,schemaForComponent:{...e,className:r}}},[p,f]);if(!p)return null;if(typeof p==`string`)return(0,X.jsx)(X.Fragment,{children:p});if(typeof p!=`object`)return(0,X.jsx)(X.Fragment,{children:String(p)});if(p._hidden)return null;let h=$?Fu(e):{valid:!0,messages:[]};Ua(`schema`,`Rendering schema node`,{type:p.type,id:p.id});let g=A.get(p.type);if(!g){if(!u&&A.hasLazy(p.type)){let e=A.loadLazy(p.type);if(e)return e.catch(e=>{d(e instanceof Error?e:Error(String(e)))}),(0,X.jsxs)(`div`,{className:`p-2 text-sm text-muted-foreground animate-pulse`,role:`status`,"aria-live":`polite`,"data-lazy-loading":p.type,children:[`Loading `,(0,X.jsx)(`code`,{children:p.type}),`…`]})}Ua(`schema`,`Component not found in registry`,{type:p.type}),Ra[`OBJUI-001`];let e=nd(p.type);return(0,X.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,children:[(0,X.jsxs)(`p`,{className:`font-medium`,children:[`Unknown component type: `,(0,X.jsx)(`strong`,{children:p.type}),e===void 0?null:(0,X.jsxs)(X.Fragment,{children:[` — did you mean '`,(0,X.jsx)(`strong`,{children:e}),`'?`]})]}),u&&(0,X.jsxs)(`p`,{className:`text-xs mt-1`,children:[`Failed to load plugin: `,u.message]}),!1,(0,X.jsx)(`pre`,{className:`text-xs mt-2 overflow-auto`,children:JSON.stringify(p,null,2)})]})}let{type:_,children:v,body:y,schema:b,visible:x,visibleWhen:S,visibleOn:C,visibility:w,hidden:ee,hiddenOn:te,disabled:T,disabledOn:ne,dataSource:re,testId:ie,objectFields:ae,_hidden:oe,_disabled:se,responsiveStyles:ce,...E}=p;$&&tu(e,p.type,p.id,ie===void 0?E:{...E,testId:ie},p.properties,p.props);let le=pl(p.type)===`view-data`,ue=od(Ru(p.props,p.properties)),D=ad(ue,le);$&&D!==ue&&vu(p.type,p.id),$&&uu(p.type,p.id,e?.props,D);let de=ad(E,le);$&&de!==E&&vu(p.type,p.id);let{scopeClass:O,scopedCss:fe,mergedClassName:pe,schemaForComponent:me}=m,he=Iu(p),ge=r?.debug||r?.debugFlags?.enabled,_e={};ge&&(_e[`data-debug-type`]=p.type,p.id&&(_e[`data-debug-id`]=p.id)),Ga(`render:${p.type}:${p.id??`anon`}`);let ve=ge?performance.now():0,ye=(0,X.jsxs)(rd,{componentType:p.type,resetKey:p.id??null,children:[fe?(0,X.jsx)(`style`,{"data-os-scope":O,dangerouslySetInnerHTML:{__html:fe}}):null,k.createElement(g,{schema:me,...de,...D,...he,..._e,disabled:se||void 0,className:pe,"data-obj-id":p.id,"data-obj-type":p.type,...ie===void 0?{}:{"data-testid":ie},...$&&!h.valid?{"data-obj-schema-invalid":`true`}:{},...t})]});if(Ka(`render:${p.type}:${p.id??`anon`}`),ge&&ve){let e=performance.now()-ve;Ja.getInstance().addPerf({type:p.type,id:p.id,durationMs:e,timestamp:Date.now()})}return ye});sd.displayName=`SchemaRenderer`;function cd(e){return typeof e==`number`||typeof e==`boolean`?e?String(e):void 0:e}var ld=(0,k.createContext)({});function ud({currentUserId:e,currentOrgId:t,children:n}){let r=(0,k.useMemo)(()=>({currentUserId:e,currentOrgId:t}),[e,t]);return(0,k.createElement)(ld.Provider,{value:r},n)}function dd(){return(0,k.useContext)(ld)}function fd(e,t){let n=yo(e,t);return{authored:e,currentUserId:t.currentUserId,currentOrgId:t.currentOrgId,onUnresolved:t.onUnresolved,resolved:hd(n,e)?e:n}}var pd=12;function md(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function hd(e,t,n=0){if(Object.is(e,t))return!0;if(n>=pd)return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,r)=>hd(e,t[r],n+1));if(md(e)&&md(t)){let r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Object.prototype.hasOwnProperty.call(t,r)&&hd(e[r],t[r],n+1))}return!1}function gd(e,t){let[n,r]=k.useState(()=>fd(e,t));if(n.currentUserId!==t.currentUserId||n.currentOrgId!==t.currentOrgId||n.onUnresolved!==t.onUnresolved||!hd(n.authored,e)){let n=fd(e,t);return r(n),n.resolved}return n.resolved}function _d(e={}){let{context:t={},onConfirm:n,onToast:r,onModal:i,onNavigate:a,onParamCollection:o,onResultDialog:s}=`context`in e?e:{context:e},[c,l]=(0,k.useState)(!1),[u,d]=(0,k.useState)(null),[f,p]=(0,k.useState)(null),m=(0,k.useMemo)(()=>{let e=new B(t);return n&&e.setConfirmHandler(n),r&&e.setToastHandler(r),i&&e.setModalHandler(i),a&&e.setNavigationHandler(a),o&&e.setParamCollectionHandler(o),s&&e.setResultDialogHandler(s),e},[JSON.stringify(t)]);return{execute:(0,k.useCallback)(async e=>{l(!0),d(null),p(null);try{let t=await m.execute(e);return p(t),t.success||d(t.error||`Action failed`),t}catch(e){let t=e.message;d(t);let n={success:!1,error:t};return p(n),n}finally{l(!1)}},[m]),loading:c,error:u,result:f,updateContext:(0,k.useCallback)(e=>{m.updateContext(e)},[m]),runner:m}}var vd={sm:`min(92vw, 480px)`,md:`min(92vw, 720px)`,lg:`min(92vw, 960px)`,xl:`min(92vw, 1200px)`,full:`min(92vw, 1600px)`};function yd(e){if(!e)return;if(e.width!==void 0)return e.width;let t=e.size;if(t&&t!==`auto`)return vd[t]}function bd(e){let{navigation:t,objectName:n,onNavigate:r,onRowClick:i}=e,[a,o]=(0,k.useState)(!1),[s,c]=(0,k.useState)(null),l=t?.mode??`page`,u=yd(t),d=l===`drawer`||l===`modal`||l===`split`||l===`popover`,f=(0,k.useCallback)(()=>{o(!1),c(null)},[]),p=(0,k.useCallback)(e=>{c(e),o(!0)},[]),m=(0,k.useCallback)((e,a)=>{if(i){i(e,a);return}if(a&&(a.metaKey||a.ctrlKey||a.button===1)){let t=e.id||e._id;if(r&&t!=null){r(t,`new_window`);return}}if(!t){let t=e.id||e._id;r&&t!=null&&r(t,`view`);return}if(!(l===`none`||t.preventNavigation)){if(l===`new_window`||t.openNewTab){let t=e.id||e._id;if(r&&t!=null){r(t,`new_window`);return}let i=encodeURIComponent(String(t)),a=n?`/${n}/record/${i}`:`/${i}`;window.open(a,`_blank`);return}if(l===`page`){let t=e.id||e._id;r&&t!=null&&r(t,`view`);return}if(d){c(e),o(!0);return}}},[i,t,l,n,r,d]);return(0,k.useMemo)(()=>({isOpen:a,selectedRecord:s,mode:l,close:f,open:p,setIsOpen:o,handleClick:m,width:u,isOverlay:d}),[a,s,l,f,p,m,u,d])}var xd=(0,k.createContext)(!1),Sd=({value:e=!0,children:t})=>(0,X.jsx)(xd.Provider,{value:e,children:t}),Cd=()=>(0,k.useContext)(xd),wd=(0,k.createContext)(null),Td=({children:e,context:t={},onConfirm:n,onToast:r,onModal:i,onNavigate:a,onParamCollection:o,onResultDialog:s,handlers:c})=>{let[l,u]=(0,k.useState)(!1),[d,f]=(0,k.useState)(null),[p,m]=(0,k.useState)(null),h=(0,k.useMemo)(()=>{let e=new B({...t,ctx:t&&typeof t.ctx==`object`?{...t,...t.ctx}:{...t}});return n&&e.setConfirmHandler(n),r&&e.setToastHandler(r),i&&e.setModalHandler(i),a&&e.setNavigationHandler(a),o&&e.setParamCollectionHandler(o),s&&e.setResultDialogHandler(s),c&&Object.entries(c).forEach(([t,n])=>{e.registerHandler(t,n)}),e},[JSON.stringify(t)]),g=(0,k.useCallback)(async e=>{u(!0),f(null),m(null);try{let t=await h.execute(e);return m(t),t.success||f(t.error||`Action failed`),t}catch(e){let t=e.message;f(t);let n={success:!1,error:t};return m(n),n}finally{u(!1)}},[h]),_=(0,k.useCallback)(async(e,t)=>{u(!0),f(null),m(null);try{let n=await h.executeChain(e,t);return m(n),n.success||f(n.error||`Chain failed`),n}catch(e){let t=e.message;f(t);let n={success:!1,error:t};return m(n),n}finally{u(!1)}},[h]),v=(0,k.useCallback)(e=>{h.updateContext(e)},[h]),y=(0,k.useMemo)(()=>({execute:g,executeChain:_,loading:l,error:d,result:p,runner:h,updateContext:v}),[g,_,l,d,p,h,v]);return(0,X.jsx)(wd.Provider,{value:y,children:e})};Td.displayName=`ActionProvider`;function Ed(){let e=(0,k.useContext)(wd);if(!e){let e=new B;return{execute:t=>e.execute(t),executeChain:(t,n)=>e.executeChain(t,n),loading:!1,error:null,result:null,runner:e,updateContext:t=>e.updateContext(t)}}return e}function Dd(){return(0,k.useContext)(wd)!==null}(0,k.createContext)(null);var Od={toast:{surface:`delegate`,transient:!0},snackbar:{surface:`snackbar`,transient:!0},banner:{surface:`banner`,transient:!1},alert:{surface:`alert`,transient:!1},inline:{surface:`inline`,transient:!1}};function kd(e){return e===`modal`?`alert`:e&&e in Od?e:`toast`}new Set(Object.keys(Od));var Ad=new Set([`top_left`,`top_center`,`top_right`,`bottom_left`,`bottom_center`,`bottom_right`]);function jd(e={}){return{defaultPosition:e.defaultPosition??e.position,defaultDuration:e.defaultDuration??5e3,maxVisible:e.stacking===!1?1:e.maxVisible??5,stackDirection:e.stackDirection??`down`,pauseOnHover:e.pauseOnHover??!0}}var Md=0,Nd=(()=>{try{return!1}catch{return!0}})(),Pd={delegate:"pass `onToast` to <NotificationProvider>",snackbar:`mount <NotificationSnackbar /> from @object-ui/components`,banner:`mount <NotificationBanners /> from @object-ui/components`,alert:`mount <NotificationAlerts /> from @object-ui/components`,inline:`mount <NotificationInline /> from @object-ui/components at the raising surface`},Fd=(0,k.createContext)(null),Id=({children:e,config:t={},onToast:n})=>{let r=(0,k.useMemo)(()=>jd(t),[JSON.stringify(t)]),[i,a]=(0,k.useState)([]),o=(0,k.useRef)(new Map),s=(0,k.useRef)(new Map),c=(0,k.useCallback)((e,t)=>{let n=setTimeout(()=>{s.current.delete(e),a(t=>t.filter(t=>t.id!==e))},t);s.current.set(e,{handle:n,endsAt:Date.now()+t,left:t})},[]),l=(0,k.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),s.current.set(e,{...t,left:Math.max(0,t.endsAt-Date.now())}))},[]),u=(0,k.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),c(e,t.left))},[c]);(0,k.useEffect)(()=>()=>{for(let{handle:e}of s.current.values())clearTimeout(e);s.current.clear()},[]);let d=(0,k.useCallback)(e=>{let t=o.current;return t.set(e,(t.get(e)??0)+1),()=>{let n=(t.get(e)??1)-1;n>0?t.set(e,n):t.delete(e)}},[]),f=(0,k.useCallback)(e=>{let t=`notification-${++Md}`,i=kd(e.displayType),{surface:s,transient:l}=Od[i],u={...e,displayType:i,id:t,createdAt:new Date,read:!1};a(e=>[u,...e]),s===`delegate`&&n?.(u,r),Nd&&s!==`delegate`&&(o.current.get(s)??0)===0&&console.warn(`[NotificationProvider] "${u.title}" declares displayType '${i}' but no ${i} surface is mounted, so it will not be shown. To present it, ${Pd[s]}.`);let d=e.duration??(l?r.defaultDuration:0);return d>0&&c(t,d),t},[r,n,c]),p=(0,k.useCallback)((e,t)=>f({title:e,message:t,severity:`info`}),[f]),m=(0,k.useCallback)((e,t)=>f({title:e,message:t,severity:`success`}),[f]),h=(0,k.useCallback)((e,t)=>f({title:e,message:t,severity:`warning`}),[f]),g=(0,k.useCallback)((e,t)=>f({title:e,message:t,severity:`error`}),[f]),_=(0,k.useCallback)(e=>{a(t=>t.map(t=>t.id===e?{...t,read:!0}:t))},[]),v=(0,k.useCallback)(()=>{a(e=>e.map(e=>({...e,read:!0})))},[]),y=(0,k.useCallback)(e=>{let t=s.current.get(e);t&&(clearTimeout(t.handle),s.current.delete(e)),a(t=>t.filter(t=>t.id!==e))},[]),b=(0,k.useCallback)(()=>{a([])},[]),x=(0,k.useMemo)(()=>i.filter(e=>!e.read).length,[i]),S=(0,k.useMemo)(()=>({notifications:i,unreadCount:x,notify:f,info:p,success:m,warning:h,error:g,markAsRead:_,markAllAsRead:v,dismiss:y,clearAll:b,config:r,pauseAutoDismiss:l,resumeAutoDismiss:u,registerSurface:d}),[i,x,f,p,m,h,g,_,v,y,b,r,l,u,d]);return(0,X.jsx)(Fd.Provider,{value:S,children:e})};Id.displayName=`NotificationProvider`;function Ld(){let e=(0,k.useContext)(Fd);if(!e)throw Error(`useNotifications must be used within a <NotificationProvider>. Wrap your app with <NotificationProvider> to use the notification system.`);return e}function Rd(){return(0,k.useContext)(Fd)!==null}function zd(e,t){let n=t.maxVisible>0?e.slice(0,t.maxVisible):e;return t.stackDirection===`up`?n:[...n].reverse()}function Bd(e,t){let n=e.position??t?.defaultPosition;if(!n)return;let r=n.replace(/-/g,`_`);return Ad.has(r)?r:void 0}function Vd(e,t){let{notifications:n,registerSurface:r}=Ld(),{surface:i}=Od[e];return(0,k.useEffect)(()=>r(i),[r,i]),(0,k.useMemo)(()=>n.filter(n=>kd(n.displayType)===e&&(e!==`inline`||(n.scope??void 0)===t)),[n,e,t])}var Hd=(0,k.createContext)(null);function Ud(){let e=(0,k.useContext)(Hd);if(!e)throw Error(`useDnd must be used within a <DndProvider>. Wrap your app with <DndProvider> to use the drag and drop system.`);return e}function Wd(){return(0,k.useContext)(Hd)!==null}var Gd=(0,k.createContext)(null);function Kd(){return(0,k.useContext)(Gd)}var qd=(0,k.createContext)(null),Jd=Object.freeze([]),Yd=Object.freeze({apps:Jd,objects:Jd,dashboards:Jd,reports:Jd,pages:Jd,loading:!1,error:null,refresh:async()=>{},invalidate:()=>{},ensureType:async()=>[],getItem:async()=>null,getItemsByType:()=>[],getTypeStatus:()=>`ready`});function Xd(){return(0,k.useContext)(qd)??Yd}function Zd(e,t){let{getItem:n}=Xd(),[r,i]=(0,k.useState)({item:null,loading:!!t,error:null});return(0,k.useEffect)(()=>{if(!t){i(e=>e.item===null&&!e.loading&&e.error===null?e:{item:null,loading:!1,error:null});return}let r=!1;return i(e=>({...e,loading:!0,error:null})),n(e,t).then(e=>{r||i({item:e,loading:!1,error:null})}).catch(e=>{r||i({item:null,loading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{r=!0}},[e,t,n]),r}var Qd=k.createContext(null),$d=({canEdit:e=!0,locked:t=!1,approvalPending:n,approvalProgress:r,approvalIsSubmitter:i,lockedReason:a,children:o})=>{let s=n??t,[c,l]=k.useState(!1),[u,d]=k.useState({}),[f,p]=k.useState(null),[m,h]=k.useState(!1),[g,_]=k.useState(null),[v,y]=k.useState(null),b=k.useCallback(t=>{e&&(p(t??null),l(!0),_(null),y(null))},[e]),x=k.useCallback((e,t)=>{d(n=>({...n,[e]:t}))},[]),S=k.useCallback(()=>{d({}),l(!1),p(null),h(!1),_(null),y(null)},[]),C=k.useMemo(()=>({editing:c,canEdit:e,locked:t,approvalPending:s,approvalProgress:r,approvalIsSubmitter:i,lockedReason:a,draft:u,autoFocusField:f,saving:m,error:g,fieldErrors:v,enter:b,setField:x,cancel:S,reset:S,setSaving:h,setError:_,setFieldErrors:y}),[c,e,t,s,r,i,a,u,f,m,g,v,b,x,S]);return(0,X.jsx)(Qd.Provider,{value:C,children:o})};function ef(){return k.useContext(Qd)}var tf=k.createContext(null),nf=({children:e,...t})=>{let n=k.useMemo(()=>t,[t.items,t.onAddComment,t.onAddReply,t.onToggleReaction,t.mentionSuggestions,t.onUploadAttachments,t.loading,t.error]);return(0,X.jsx)(tf.Provider,{value:n,children:e})};function rf(){return k.useContext(tf)}var af=(0,k.createContext)({}),of=({value:e,children:t})=>(0,X.jsx)(af.Provider,{value:e,children:t});function sf(){return(0,k.useContext)(af)}var cf=(0,k.createContext)({}),lf=({value:e,children:t})=>(0,X.jsx)(cf.Provider,{value:e,children:t});function uf(){return(0,k.useContext)(cf)}var df=(0,k.createContext)(null),ff=({value:e,children:t})=>(0,X.jsx)(df.Provider,{value:e,children:t});function pf(){return(0,k.useContext)(df)}function mf(){let{variables:e}=Rl(),{updateContext:t}=Ed();return k.useEffect(()=>(t({pageVariables:e}),()=>{t({pageVariables:{}})}),[e,t]),null}mf.displayName=`PageVariableActionBridge`;var hf=e=>!!e&&typeof e==`object`;async function gf(e,t){let n=typeof e?.getObjectSchema==`function`,r=typeof e?.listViews==`function`;if(!n&&!r)return{capable:!1,views:{}};let i=n?e.getObjectSchema(t).then(e=>hf(e)?e.listViews??e.list_views:void 0,()=>void 0):Promise.resolve(void 0),a=r?e.listViews(t).then(e=>e,()=>void 0):Promise.resolve(void 0),[o,s]=await Promise.all([i,a]);return{capable:!0,views:Pe(o,s)}}function _f(e,t){let n=(0,k.useContext)(Z),r=t??n?.dataSource??null,i=(0,k.useMemo)(()=>{let t=hf(e)?e.dataSource:void 0;return Ne(t)?t:void 0},[e]),a=i?.object,o=i?.view,s=a&&o?JSON.stringify([a,o]):``,[c,l]=(0,k.useState)(null);return(0,k.useEffect)(()=>{if(!a||!o)return;let e=!1;return gf(r,a).then(({capable:t,views:n})=>{if(e)return;if(!t){l({key:s,view:null,error:`dataSource.view "${o}" cannot be resolved: this data source cannot list the saved views of object "${a}".`});return}let r=Fe(n,o,a);l(r?{key:s,view:r}:{key:s,view:null,error:Ge(a,o,Object.keys(n))})}),()=>{e=!0}},[r,a,o,s]),(0,k.useMemo)(()=>{if(!i)return{status:`absent`};if(!i.view)return{status:`ready`,config:i,composed:We(i)};if(c?.key!==s)return{status:`loading`,config:i};if(c.view===null)return{status:`missing`,config:i,error:c.error};let e;try{e=We(i,c.view)}catch(e){if(!(e instanceof O))throw e;return{status:`missing`,config:i,error:e.message,filterRefusal:e}}return{status:`resolved`,config:i,view:c.view,composed:e}},[i,c,s])}function vf(e){return!e||e.enabled!==!1&&e.handlerReady!==!1&&e.status!==`stub`&&e.status!==`unavailable`}[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `);var yf={compact:32,comfortable:40,spacious:52},bf={compact:`py-1 px-2`,comfortable:`py-2 px-3`,spacious:`py-3 px-4`},xf={compact:`text-xs`,comfortable:`text-sm`,spacious:`text-base`},Sf=[`compact`,`comfortable`,`spacious`];function Cf(e=`comfortable`,t){let[n,r]=(0,k.useState)(e),i=t?.rowHeights??yf,a=t?.paddingClasses??bf,o=t?.fontSizeClasses??xf,s=(0,k.useRef)(t?.onChange);(0,k.useEffect)(()=>{s.current=t?.onChange},[t?.onChange]);let c=(0,k.useRef)(e);(0,k.useEffect)(()=>{e!==c.current&&(c.current=e,r(e))},[e]);let l=(0,k.useCallback)(e=>{r(t=>t===e?t:(queueMicrotask(()=>s.current?.(e)),e))},[]),u=(0,k.useCallback)(()=>{r(e=>{let t=Sf[(Sf.indexOf(e)+1)%Sf.length];return queueMicrotask(()=>s.current?.(t)),t})},[]);return(0,k.useMemo)(()=>({mode:n,setMode:l,cycle:u,rowHeight:i[n],paddingClass:a[n],fontSizeClass:o[n]}),[n,l,u,i,a,o])}function wf(e){return typeof window>`u`?()=>{}:(window.addEventListener(`online`,e),window.addEventListener(`offline`,e),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,e)})}function Tf(){return typeof navigator<`u`?navigator.onLine:!0}function Ef(){return!0}var Df=`objectui-offline-queue`;function Of(){if(typeof localStorage>`u`)return[];try{let e=localStorage.getItem(Df);return e?JSON.parse(e):[]}catch{return[]}}function kf(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(Df,JSON.stringify(e))}catch{}}var Af=0;function jf(){return Af+=1,`mut_${Date.now()}_${Af}`}var Mf={enabled:!0,strategy:`network_first`,offlineIndicator:!0,offlineMessage:`You are currently offline. Changes will be synced when reconnected.`,queueMaxSize:100};function Nf(e={}){let{enabled:t=Mf.enabled,strategy:n=Mf.strategy,offlineIndicator:r=Mf.offlineIndicator,offlineMessage:i=Mf.offlineMessage,queueMaxSize:a=Mf.queueMaxSize,sync:o}=e,s=(0,k.useSyncExternalStore)(wf,Tf,Ef),[c,l]=(0,k.useState)(Of),[u,d]=(0,k.useState)(`idle`),f=(0,k.useRef)(o);(0,k.useInsertionEffect)(()=>{f.current=o});let p=(0,k.useRef)(c);(0,k.useInsertionEffect)(()=>{p.current=c}),(0,k.useEffect)(()=>{kf(c)},[c]),(0,k.useEffect)(()=>{t&&(s?u===`offline`&&d(`idle`):d(`offline`))},[s,t,u]);let m=(0,k.useCallback)(e=>{t&&l(t=>{let n={...e,id:jf(),timestamp:Date.now()},r=[...t,n];return r.length>a?r.slice(r.length-a):r})},[t,a]),h=(0,k.useCallback)(()=>{l([])},[]),g=(0,k.useCallback)(async()=>{let e=p.current;if(t&&e.length!==0){d(`syncing`);try{let t=f.current?.batchSize??e.length,n=e.slice(0,t);await new Promise(e=>setTimeout(e,0)),l(e=>e.filter(e=>!n.some(t=>t.id===e.id))),d(`idle`)}catch{d(`error`)}}},[t]),_=c.length>0;return(0,k.useEffect)(()=>{if(!t||!s||!_)return;let e=setTimeout(()=>{g()},100);return()=>clearTimeout(e)},[s,t,_,g]),(0,k.useMemo)(()=>({isOnline:s,enabled:t,syncState:u,strategy:n,pendingCount:c.length,queueMutation:m,sync:g,clearQueue:h,showIndicator:r&&!s,offlineMessage:i}),[s,t,u,n,c.length,m,g,h,r,i])}function Pf(){return{canUndo:R.canUndo,canRedo:R.canRedo,undoDescription:R.peekUndo()?.description,redoDescription:R.peekRedo()?.description,history:R.getHistory()}}function Ff(){return{canUndo:!1,canRedo:!1,undoDescription:void 0,redoDescription:void 0,history:[]}}var If=Pf();function Lf(e){return R.subscribe(()=>{If=Pf(),e()})}function Rf(){return If}function zf(e={}){let t=(0,k.useRef)(e);(0,k.useInsertionEffect)(()=>{t.current=e});let n=(0,k.useSyncExternalStore)(Lf,Rf,Ff),r=(0,k.useCallback)(async(e,n,r)=>{let i=t.current.dataSource;if(!i)return;let a=r===`undo`?{create:`delete`,update:`update`,delete:`create`}[e.type]:e.type;a===`delete`?await i.delete(e.objectName,e.recordId):a===`update`?await i.update(e.objectName,e.recordId,n):await i.create(e.objectName,n)},[]),i=(0,k.useCallback)(async()=>{let e=R.popUndo();e&&(await r(e,e.undoData,`undo`),t.current.onUndo?.(e))},[r]),a=(0,k.useCallback)(async()=>{let e=R.popRedo();e&&(await r(e,e.redoData,`redo`),t.current.onRedo?.(e))},[r]);return(0,k.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`z`&&(e.preventDefault(),e.shiftKey?a():i())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,a]),(0,k.useMemo)(()=>({...n,undo:i,redo:a}),[n,i,a])}function Bf(e={}){let{actions:t=[],context:n={}}=e,r=(0,k.useContext)(wd)?.runner??null,i=(0,k.useMemo)(()=>{let e=n&&Object.keys(n).length>0?{...n,ctx:n.ctx&&typeof n.ctx==`object`?{...n,...n.ctx}:{...n}}:n,i=r?new ea(r):new ea(e);if(r&&n&&Object.keys(n).length>0){let e=i.getRunner(),t=e.getEvaluator().getContext().toObject(),r=t&&typeof t.ctx==`object`?t.ctx:{},a=n.ctx&&typeof n.ctx==`object`?n.ctx:n,o={...n,ctx:{...r,...a}};e.updateContext(o)}return i.registerActions(t),i},[r,JSON.stringify(t),JSON.stringify(n)]);return{getActionsForLocation:(0,k.useCallback)(e=>i.getActionsForLocation(e),[i]),getBulkActions:(0,k.useCallback)(()=>i.getBulkActions(),[i]),executeAction:(0,k.useCallback)((e,t)=>i.executeAction(e,t),[i]),handleShortcut:(0,k.useCallback)(e=>i.handleShortcut(e),[i]),engine:i}}function Vf(){let{actionLabel:e,actionConfirm:t,actionSuccess:n}=oe(),{language:r}=E();return(0,k.useMemo)(()=>((i,a,o)=>{if(!a||typeof a!=`object`)return a;let s=se(a.label,r),c=typeof a.name==`string`&&a.name?a.name:void 0,l=s||c||o?.fallbackLabel||``;if(!c)return l===a.label?a:{...a,label:l};let u={...a,label:e(i,c,l)};return a.confirmText!==void 0&&(u.confirmText=t(i,c,a.confirmText)),a.successMessage!==void 0&&(u.successMessage=n(i,c,a.successMessage)),u}),[e,t,n,r])}function Hf(){let e=(0,k.useContext)(wd),t=Y(),n=e?.runner?.getContext?.()?.user;if(Array.isArray(n?.systemPermissions))return n.systemPermissions;let r=t?.user;if(Array.isArray(r?.systemPermissions))return r.systemPermissions}function Uf(){let e=Hf();return(0,k.useCallback)(t=>!Array.isArray(t)||t.length===0||!Array.isArray(e)||t.every(t=>typeof t==`string`&&e.includes(t)),[e])}function Wf(){let e=Y(),t=Pl()?.data,{variables:n}=Rl();return r=>$u(r,e,t,n)}function Gf(e,t,n,r){let i=(0,k.useContext)(Z)?.apiFetch,a=r?.enabled??!0,[o,s]=(0,k.useState)(null),c=(n??[]).filter(Boolean),l=[a?`1`:`0`,e??``,c.join(`,`),JSON.stringify(t??null)].join(`|`);return(0,k.useEffect)(()=>{if(!a||!e||c.length===0){s(null);return}let n=e=>t&&t[e]||e,r=!1;return(async()=>{try{let t=i??fetch,a=await Ss(async e=>{let n=await(await t(`/api/v1/meta/object/${encodeURIComponent(e)}`,{headers:{accept:`application/json`},credentials:`include`})).json().catch(()=>null);return n?.item??n?.data??n},e,c.map(n));r||s({metaByPath:a,relabel:c.map(e=>({dim:e,path:n(e)}))})}catch{r||s(null)}})(),()=>{r=!0}},[l,i]),o}function Kf(e,t,n,r){let{fieldOptionLabel:i}=ce(),a=Gf(e,t,n,r);return(0,k.useMemo)(()=>xs(a?.metaByPath,a?.relabel,i),[a,i])}function qf(e,t){return!0}function Jf(e,t={}){let n=Xd(),[r,i]=(0,k.useState)(!1),[a,o]=(0,k.useState)(null);(0,k.useEffect)(()=>{let e=!1;if(!n.ensureType){i(!0);return}return n.ensureType(`page`).then(()=>{e||(i(!0),o(null))}).catch(t=>{e||(o(t instanceof Error?t:Error(String(t))),i(!0))}),()=>{e=!0}},[n]);let s=(0,k.useMemo)(()=>{if(!e&&!t.pageName)return null;let r=Array.isArray(n.pages)?n.pages:[];if(!r.length)return null;if(t.pageName)return r.find(e=>e?.name===t.pageName)??null;let i=r.filter(n=>!n||n.type!==`record`||n.object!==e?!1:qf(n,t));return i.length?i[0]:null},[n.pages,e,t.pageName,t.recordType,t.profile,t.app,t.formFactor]),{page:c,slots:l}=(0,k.useMemo)(()=>s?s.kind===`slotted`?{page:null,slots:s.slots??{}}:{page:s,slots:null}:{page:null,slots:null},[s]);return{page:c,slots:l,loading:n.loading||!r,error:a??n.error??null}}function Yf(e,t,n){if(!e)return 0;let r=e.toLowerCase(),i=(t||``).toLowerCase();return(n||``).toLowerCase()===r?110:i===r?100:i.startsWith(r)?80:i.split(/[\s_\-/.,:;()[\]]+/).filter(Boolean).some(e=>e.startsWith(r))?60:i.includes(r)?40:0}function Xf(e){let{query:t,objects:n,dataSource:r,objectNames:i,maxObjectsQueried:a=8,topPerObject:o=3,minLength:s=2,debounceMs:c=250,enabled:l=!0,getDisplayName:u=yr,fieldReadPolicy:d}=e,f=d?.isLoaded===!0,[p,m]=(0,k.useState)([]),[h,g]=(0,k.useState)(!1),[_,v]=(0,k.useState)(void 0),y=(0,k.useMemo)(()=>{if(!Array.isArray(n)||n.length===0)return[];let e;if(Array.isArray(i)&&i.length>0){let t=new Map;for(let e of n){let n=e?.name;typeof n==`string`&&t.set(n,e)}e=i.map(e=>t.get(e)).filter(e=>e!=null)}else e=n.filter(e=>e?.searchable!==!1);return e},[n,i]),b=(0,k.useMemo)(()=>y.map(e=>String(e?.name)).join(`|`),[y]),x=(0,k.useRef)(0),S=(0,k.useRef)(u),C=(0,k.useRef)(d);return(0,k.useEffect)(()=>{S.current=u,C.current=d}),(0,k.useEffect)(()=>{if(!l||!r||y.length===0){m([]),g(!1),v(void 0);return}let e=(t??``).trim();if(e.length<s){m([]),g(!1),v(void 0);return}let n=++x.current;g(!0),v(void 0);let i=setTimeout(()=>{if(x.current!==n)return;let t=r.searchAll;if(typeof t==`function`){let i=new Map;for(let e of y)typeof e?.name==`string`&&i.set(e.name,e);Promise.resolve().then(()=>t.call(r,e,{limit:a*o,objects:Array.from(i.keys())})).then(t=>{if(x.current!==n)return;let r=Array.isArray(t?.hits)?t.hits:Array.isArray(t)?t:[],a=[];for(let t of r){let n=t?.object??t?.objectName;if(typeof n!=`string`||i.size>0&&!i.has(n))continue;let r=t?.id??t?.record?.id??t?.record?._id;if(r==null)continue;let o=i.get(n)??{name:n},s=(typeof t?.title==`string`&&t.title.trim()!==``?t.title.trim():``)||S.current(o,Nc(t?.record??{},C.current,n))||`Record #${r}`,c=typeof t?.snippet==`string`?t.snippet.trim():``;a.push({objectName:n,objectLabel:typeof o.label==`string`&&o.label.length>0?o.label:n,recordId:String(r),display:s,subtitle:c&&c!==s?c:void 0,icon:o?.icon,score:Yf(e,s,String(r)),raw:t?.record??t})}a.sort((e,t)=>+(t.score===110)-(e.score===110)),m(a),g(!1),v(void 0)}).catch(e=>{x.current===n&&(m([]),g(!1),v(e instanceof Error?e:Error(String(e))))});return}let i=y.slice(0,a).map(t=>Promise.resolve().then(()=>r.find(t.name,{$search:e,$top:o})).then(e=>({obj:t,res:e,err:null})).catch(e=>({obj:t,res:null,err:e})));Promise.allSettled(i).then(t=>{if(x.current!==n)return;let r=[],i;for(let n of t){if(n.status!==`fulfilled`)continue;let{obj:t,res:a,err:s}=n.value;if(s){let e=s?.httpStatus??s?.status;if(s?.code,e===404||zn(s,`OBJECT_NOT_FOUND`))continue;i=s instanceof Error?s:Error(String(s));continue}let c=Array.isArray(a?.data)?a.data:Array.isArray(a)?a:[];for(let n of c.slice(0,o)){let i=n?.id??n?._id;if(i==null)continue;let a=S.current(t,Nc(n,C.current,t.name));r.push({objectName:t.name,objectLabel:typeof t.label==`string`&&t.label.length>0?t.label:t.name,recordId:String(i),display:a,icon:t?.icon,score:Yf(e,a,String(i)),raw:n})}}r.sort((e,t)=>t.score-e.score),m(r),g(!1),v(i)})},c);return()=>{clearTimeout(i)}},[t,l,r,b,o,a,s,c,f]),{results:p,isSearching:h,error:_}}function Zf(e,t){if(Object.is(e,t))return!0;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function Qf(e,t){let[n,r]=(0,k.useState)(null);(0,k.useEffect)(()=>{let n=!0,i=e,a=e=>{r(t=>t&&t.key===i&&Zf(t.def,e)?t:{key:i,def:e})};return(async()=>{if(!t||!i||typeof t.getObjectSchema!=`function`){n&&a(null);return}try{let e=await t.getObjectSchema(i);n&&a(e)}catch(e){console.error(`[useSettledSchema] getObjectSchema failed for`,i,e),n&&a(null)}})(),()=>{n=!1}},[e,t]);let i=n!==null&&n.key===e;return{ready:i,def:i?n.def:null}}var $f=new Set,ep=`objectui:related-changed`;function tp(e){for(let t of Array.from($f))try{t(e)}catch{}typeof window<`u`&&window.dispatchEvent(new CustomEvent(ep,{detail:{objectName:e.objectName,recordId:e.recordId}}))}function np(e){return $f.add(e),()=>$f.delete(e)}function rp(e,t,n){return e.objectName===`*`?!0:e.objectName===t?n===void 0||e.recordId===void 0||e.recordId===n:!1}function ip(e,t){let[n,r]=(0,k.useState)(0);return(0,k.useEffect)(()=>{if(e)return np(n=>{rp(n,e,t)&&r(e=>e+1)})},[e,t]),n}function ap(e){(0,k.useEffect)(()=>{let t=e;if(t?.onMutation)return t.onMutation(e=>{e?.resource&&tp({objectName:e.resource,recordId:e.id==null?void 0:String(e.id)})})},[e])}function op(e){return typeof e==`number`&&Number.isInteger(e)&&e>0}var sp=(e,t,n,r,i)=>{if(e==null||op(e))return null;let a=typeof r==`string`&&r?r:`component`;return`[ObjectUI] ElementDataSourceGate row cap: ${typeof i==`string`&&i?`${a} on ${i}`:a} declared ${t}: ${String(e)}, which is not a positive integer. A row cap must be a positive integer (the spec refuses zero and negative values), so it was ignored and the cap from this component's bound data source (${n}) was used instead.`},cp=(e,t,n)=>!t||op(n)?null:Ve(e,t.view,t.object,t),lp=(e,t)=>t?Ve(e,t.view,t.object,t,`binding`):null,up=(e,t)=>t===`pagination.pageSize`?e.pagination?.pageSize:e[t],dp=(e,t,n,r)=>{if(n===`pagination.pageSize`){e.pagination={...t.pagination??{},pageSize:r};return}e[n]=r};function fp(e,t={},n){let r=_f(e,Ne(n)?void 0:n),{object:i=`objectName`,columns:a,filter:o,sort:s,limit:c,viewType:l}=t,{schema:u,capMessage:d,viewCapMessage:f,bindingCapMessage:p,filterRefusal:m}=k.useMemo(()=>{let t=r.composed;if(!t)return{schema:e,capMessage:null,viewCapMessage:null,bindingCapMessage:null};let n=e??{},u={...n},d=null,f=null,p=null;if(i!==!1&&(u[i]=t.object),a&&!(Array.isArray(n.columns)&&n.columns.length>0)&&t.columns!==void 0&&(u.columns=t.columns),o){let r=ke(n.filter);if(!r.ok)return{schema:e,capMessage:null,viewCapMessage:null,bindingCapMessage:null,filterRefusal:r.refusal};let i=ke(t.filter);if(!i.ok)return{schema:e,capMessage:null,viewCapMessage:null,bindingCapMessage:null,filterRefusal:i.refusal};let a=Ae(r.node,i.node);a===void 0?delete u.filter:u.filter=a}if(s&&t.sort!==void 0&&(r.config?.sort!==void 0||n.sort===void 0)&&(u.sort=t.sort),c&&t.limit!==void 0){let e=!op(r.config?.limit),i=up(n,c);(!e||!op(i))&&(dp(u,n,c,t.limit),d=sp(i,c,t.limit,n.type,t.object))}return c&&(f=cp(r.view,r.config,up(n,c)),p=lp(r.view,r.config)),l&&t.viewType!==void 0&&n.viewType===void 0&&(u.viewType=t.viewType),{schema:u,capMessage:d,viewCapMessage:f,bindingCapMessage:p}},[e,r.composed,r.config,r.view,i,a,o,s,c,l]);k.useEffect(()=>{d&&console.warn(d)},[d]),k.useEffect(()=>{f&&console.warn(f)},[f]),k.useEffect(()=>{p&&console.warn(p)},[p]);let h=r.filterRefusal??m;return k.useMemo(()=>h?{status:`missing`,schema:u,config:r.config,error:h.message,filterRefusal:h}:{status:r.status,schema:u,config:r.config,error:r.error},[r.status,r.config,r.error,u,h])}function pp({testId:e,title:t=`This component’s data source could not be resolved`,message:n}){return(0,X.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,"data-testid":`${e}-datasource-error`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:t}),n?(0,X.jsx)(`p`,{className:`text-sm mt-1`,children:n}):null]})}function mp({testId:e,refusal:t}){let{t:n}=E();return(0,X.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 p-3 my-2 text-sm text-amber-800`,"data-testid":`${e}-malformed-filter`,children:[(0,X.jsx)(`p`,{className:`font-medium`,"data-testid":`${e}-malformed-filter-subject`,children:n(`view.malformedFilter`,{subject:fe(t)??``,defaultValue:`This view’s filter is malformed, so no records are shown: the {{subject}} condition cannot be applied.`})}),(0,X.jsx)(`p`,{className:`mt-1 text-xs opacity-80`,children:t.message})]})}function hp({testId:e}){return(0,X.jsx)(`div`,{className:`p-2 text-sm text-muted-foreground animate-pulse`,role:`status`,"aria-live":`polite`,"data-testid":`${e}-resolving-view`,children:`Loading view…`})}function gp(e){let t=k.useContext(Z);return(Ne(e)?void 0:e)??t?.dataSource??void 0}function _p(e,t){return`“${e}” has no data source, so it cannot read ${typeof t==`string`&&t.trim().length>0?`“${t}”`:`its object`}. Inject one from an ancestor — <SchemaRendererProvider dataSource={…}> from @object-ui/react — or hand this block a dataSource of its own.`}function vp({testId:e,title:t=`No data source resolved`,message:n}){return(0,X.jsxs)(`div`,{className:`p-4 border border-red-500 rounded text-red-500 bg-red-50 my-2`,role:`alert`,"data-testid":`${e}-no-data-source`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:t}),n?(0,X.jsx)(`p`,{className:`text-sm mt-1`,children:n}):null]})}function yp({schema:e,mapping:t,dataSource:n,testId:r,errorTitle:i,requiresDataSource:a,noDataSourceMessage:o,children:s}){let c=fp(e,t,n),l=gp(n);return a&&l==null?(0,X.jsx)(vp,{testId:r,message:o}):c.filterRefusal?(0,X.jsx)(mp,{testId:r,refusal:c.filterRefusal}):c.status===`missing`?(0,X.jsx)(pp,{testId:r,title:i,message:c.error}):c.status===`loading`?(0,X.jsx)(hp,{testId:r}):s(c.schema)}function bp(...e){for(let t of e)if(typeof t==`string`&&t.trim())return t;return null}function xp(e){let t=e,n=t&&typeof t==`object`?bp(t.details?.error,t.details?.message,t.error):null;if(!n){let r=e instanceof Error?e.message:typeof e==`string`?e:typeof t?.message==`string`?t.message:``,i=r.indexOf(`{`);if(i>=0)try{let e=JSON.parse(r.slice(i));n=bp(e?.error,e?.message)}catch{}!n&&r.trim()&&(n=r)}return n&&n.replace(/^\[[^\]]+\]\s*/,``).replace(/^[A-Z][A-Z0-9_]+:\s*/,``).trim()||null}function Sp(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.userMessage==`string`&&t.userMessage.trim())return t.userMessage;let n=t.details;return n&&typeof n==`object`&&typeof n.userMessage==`string`&&n.userMessage.trim()?n.userMessage:null}function Cp(e){let t=e;if(!t||typeof t!=`object`)return null;let n=Array.isArray(t.validationErrors)&&t.validationErrors||Array.isArray(t.details?.fields)&&t.details.fields||Array.isArray(t.fields)&&t.fields||null;if(!n||!Array.isArray(n))return null;let r=[];for(let e of n){if(!e||typeof e!=`object`)continue;let t=e,n=bp(t.field,t.name,t.path);if(!n)continue;let i=bp(t.message,t.error,t.code)??``;r.push({field:n,message:i})}return r.length>0?r:null}function wp(e){let t=e;if(!t||typeof t!=`object`)return!1;if((t.httpStatus??t.status??t.statusCode)===403)return!0;let n=bp(t.code,t.details?.code)??``;if(n===`PERMISSION_DENIED`||n===`FORBIDDEN`)return!0;let r=`${typeof t.message==`string`?t.message:``} ${t.details?.error??t.error??``}`;return/row-level security|access denied|permission denied|not permitted/i.test(r)}var Tp=new Set([`INVALID_FILTER`,`UNSUPPORTED_QUERY_PARAM`,`INVALID_QUERY`]);function Ep(e){let t=e,n=[t?.httpStatus,t?.status,t?.statusCode].find(e=>typeof e==`number`);if(n===void 0){let e=/HTTP (\d{3})\b/.exec(String(t?.message??``));e&&(n=Number(e[1]))}let r=typeof t?.code==`string`?t.code.toUpperCase():``;return le(e)?`api-disabled`:n===403||r===`PERMISSION_DENIED`||r===`FORBIDDEN`?`forbidden`:n===401||r===`UNAUTHORIZED`||r===`UNAUTHENTICATED`?`unauthorized`:n===400||Tp.has(r)?`rejected`:`network`}function Dp({result:e}){let{t}=E();if(!e.truncated)return null;let n=e.rows.length,r=typeof e.total==`number`?t(`common.rowCeilingNote`,{shown:n,total:e.total,defaultValue:ae.common.rowCeilingNote}):t(`common.rowCeilingNoteUnknownTotal`,{shown:n,defaultValue:ae.common.rowCeilingNoteUnknownTotal});return(0,X.jsx)(`p`,{role:`note`,"data-row-ceiling-note":`non-grid`,className:`shrink-0 px-1 py-1 text-xs text-muted-foreground`,children:r})}var Op=[{key:`indexed`,retiredBy:`objectui#4644`,specEquivalent:null,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`referenceTo`,retiredBy:`objectui#6041`,specEquivalent:`reference`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`formula`,retiredBy:`objectui#6043`,specEquivalent:`expression`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!1,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`isSystem`,retiredBy:`objectui#6044`,specEquivalent:`system`,defensive:!1,sites:{metadataAdminFieldsReadDoor:!0,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!0}},{key:`sortOrder`,retiredBy:`objectui#6045`,specEquivalent:null,defensive:!0,sites:{metadataAdminFieldsReadDoor:!1,metadataServiceCarryOver:!0,metadataFieldsPageCarryOver:!1}}];function kp(e){return Op.filter(t=>t.sites[e]).map(e=>e.key)}export{Ld as $,fo as $n,Dn as $r,Nc as $t,vf as A,Mt as Ai,ss as An,br as Ar,Cl as At,rf as B,it as Bi,Yo as Bn,Kn as Br,Jc as Bt,Wf as C,qt as Ci,Ms as Cn,ei as Cr,Nl as Ct,zf as D,Rt as Di,Cs as Dn,Or as Dr,Z as Dt,Bf as E,Kt as Ei,ws as En,Kr as Er,Ol as Et,lf as F,xt as Fi,ls as Fn,gr as Fr,xl as Ft,Kd as G,Ne as Gi,Vo as Gn,Bn as Gr,qc as Gt,ef as H,nt as Hi,Ko as Hn,Jn as Hr,al as Ht,uf as I,Ct as Ii,Ss as In,N as Ir,hl as It,Ud as J,Se as Ji,vo as Jn,Mn as Jr,Rc as Jt,Xd as K,je as Ki,Lo as Kn,Ln as Kr,Lc as Kt,of as L,wt as Li,ms as Ln,hr as Lr,ml as Lt,mf as M,kt as Mi,ts as Mn,pr as Mr,bl as Mt,ff as N,Ot as Ni,xs as Nn,cr as Nr,vl as Nt,Nf as O,Pt as Oi,ds as On,Dr as Or,Sl as Ot,pf as P,Et as Pi,bs as Pn,yr as Pr,Y as Pt,Rd as Q,ke as Qi,po as Qn,En as Qr,Pc as Qt,sf as R,j as Ri,cs as Rn,tr as Rr,dl as Rt,Gf as S,$t as Si,Ns as Sn,pi as Sr,El as St,Vf as T,Jt as Ti,Es as Tn,F as Tr,Pl as Tt,Gd as U,A as Ui,Go as Un,qn as Ur,cl as Ut,$d as V,at as Vi,qo as Vn,Wn as Vr,Yc as Vt,qd as W,Ye as Wi,Ho as Wn,zn as Wr,Xc as Wt,Id as X,Ae as Xi,mo as Xn,jn as Xr,Ic as Xt,Wd as Y,fe as Yi,yo as Yn,In as Yr,Kc as Yt,Bd as Z,Oe as Zi,uo as Zn,An as Zr,Fc as Zt,ap as _,sn as _i,Vs as _n,vi as _r,Q as _t,Cp as a,bn as ai,sc as an,da as ar,Dd as at,Jf as b,Xt as bi,Ps as bn,ci as br,Bl as bt,pp as c,yn as ci,ec as cn,aa as cr,bd as ct,_p as d,dn as di,Xs as dn,ra as dr,ud as dt,On as ei,Mc as en,oo as er,Vd as et,gp as f,un as fi,Zs as fn,ta as fr,dd as ft,ip as g,cn as gi,Gs as gn,bi as gr,Eu as gt,np as h,ln as hi,qs as hn,Ii as hr,sd as ht,Sp as i,Tn as ii,cc as in,Ia as ir,Ed as it,_f as j,At as ji,us as jn,mr as jr,_l as jt,Cf as k,Nt as ki,fs as kn,xr as kr,wl as kt,yp as l,gn as li,Qs as ln,ia as lr,_d as lt,tp as m,on as mi,Js as mn,Li as mr,rd as mt,Dp as n,wn as ni,hc as nn,Va as nr,wd as nt,xp as o,xn as oi,oc as on,fa as or,Sd as ot,rp as p,fn as pi,Ks as pn,Yi as pr,cd as pt,Zd as q,O as qi,Io as qn,Rn as qr,Gc as qt,Ep as r,Sn as ri,fc as rn,La as rr,Td as rt,wp as s,_n as si,ac as sn,ca as sr,Cd as st,kp as t,Cn as ti,gc as tn,ao as tr,zd as tt,hp as u,pn as ui,$s as un,na as ur,gd as ut,Qf as v,en as vi,Hs as vn,_i as vr,Vl as vt,Uf as w,Yt as wi,Ts as wn,I as wr,Dl as wt,Kf as x,Zt as xi,Is as xn,li as xr,Rl as xt,Xf as y,tn as yi,Rs as yn,yi as yr,Ll as yt,nf as z,st as zi,Jo as zn,Un as zr,ll as zt};