@declarion/react 0.61.1 → 0.63.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 (487) hide show
  1. package/dist-lib/ActionDialog-uiuse5W8.js +374 -0
  2. package/dist-lib/ActionResultDialog.impl-BUBm9Ck3.js +273 -0
  3. package/dist-lib/ActionRunner-DAxgnKB3.js +1440 -0
  4. package/dist-lib/AdminCatalogPage.impl-BJGn7EvA.js +441 -0
  5. package/dist-lib/{AgentChatPanel.impl-rgkewyMl.js → AgentChatPanel.impl-8bw8J-xV.js} +358 -319
  6. package/dist-lib/AgentOpenFollower.impl-Cga1q7_e.js +81 -0
  7. package/dist-lib/AssociatedBlock-D6qDYmRO.js +1515 -0
  8. package/dist-lib/AuthShell-DdiughRT.js +361 -0
  9. package/dist-lib/ChangePasswordDialog-DFe7lVQg.js +12 -0
  10. package/dist-lib/ChangePasswordDialog.impl-DtSIaP-A.js +194 -0
  11. package/dist-lib/CommandPalette.impl-Db3AFA5w.js +383 -0
  12. package/dist-lib/CopyButton-C0iEvaT1.js +119 -0
  13. package/dist-lib/DirtyTabsCloseDialog.impl-DWaFaWKn.js +191 -0
  14. package/dist-lib/{DraggableChildrenTable-DruYOxKm.js → DraggableChildrenTable-Cy8uevS_.js} +45 -44
  15. package/dist-lib/DynamicIcon-DuBSz6TZ.js +133 -0
  16. package/dist-lib/FieldRow-BXBBFOZh.js +157 -0
  17. package/dist-lib/FilterChips-8fMDBXHp.js +1031 -0
  18. package/dist-lib/Forgot.impl-CmT5A__V.js +105 -0
  19. package/dist-lib/{Grid-Dsf3I0xG.js → Grid-Cg29k0jv.js} +98 -99
  20. package/dist-lib/Icons-Dzl-AkD_.d.ts +159 -0
  21. package/dist-lib/Icons-lt-7lhYR.js +151 -0
  22. package/dist-lib/ImpersonationBanner.impl-CBJJx6an.js +76 -0
  23. package/dist-lib/ImpersonationStartModal.impl-RaZcsJpG.js +158 -0
  24. package/dist-lib/Kbd-CNttVu0z.js +23 -0
  25. package/dist-lib/{LayoutRenderer-QN7Wp2W6.js → LayoutRenderer-DEHtYtzV.js} +965 -942
  26. package/dist-lib/{ListCardsBody-CNaZ0xwz.js → ListCardsBody-BAwFR3yO.js} +46 -52
  27. package/dist-lib/{MarkdownRenderer-BuO5hYJh.js → MarkdownRenderer-kNEMr6K_.js} +15 -16
  28. package/dist-lib/MenuItem-CfkVXPvC.js +140 -0
  29. package/dist-lib/NotFoundPage.impl-ZSBn4WWb.js +68 -0
  30. package/dist-lib/PageHeader-tw4pX3lI.js +71 -0
  31. package/dist-lib/PageShell-tI-mm0C5.js +47 -0
  32. package/dist-lib/Pill-D-wsfRhx.js +42 -0
  33. package/dist-lib/Preferences.impl-BG9XBZDf.js +162 -0
  34. package/dist-lib/Profile.impl-CbzSzxyG.js +527 -0
  35. package/dist-lib/PropertyGridEditor-BTjscqfz.js +4378 -0
  36. package/dist-lib/RecordHeader-Bv9nJXnG.js +217 -0
  37. package/dist-lib/RecordIdBadge-C3MgoZvt.js +25 -0
  38. package/dist-lib/RefreshControl-Ce-T_wSQ.js +195 -0
  39. package/dist-lib/Reset.impl-Cesyqt5p.js +168 -0
  40. package/dist-lib/SSOCallbackPage.impl-BC_W9nQA.js +31 -0
  41. package/dist-lib/SectionCard-VonaiLrx.js +150 -0
  42. package/dist-lib/SignUp.impl-C1KCQbfZ.js +212 -0
  43. package/dist-lib/SmartDetailPage.impl-8iOAMYQh.js +1609 -0
  44. package/dist-lib/SmartListPage.impl-Cc4Zwz5f.js +2818 -0
  45. package/dist-lib/SmartRecordListPage.impl-xTSohkqG.js +795 -0
  46. package/dist-lib/{SortHeaderMenu-BV-aQbPy.js → SortHeaderMenu-BKTrq0Wb.js} +23 -23
  47. package/dist-lib/TenantParamsPage.impl-DMuSs3eP.js +306 -0
  48. package/dist-lib/TwoFA.impl-BClZ3ndk.js +125 -0
  49. package/dist-lib/{cardProjection-BnmWukxk.js → cardProjection-Cr7fG6wJ.js} +134 -133
  50. package/dist-lib/declarion-react.css +1 -1
  51. package/dist-lib/format-count-CSEFw2ht.js +943 -0
  52. package/dist-lib/headerActionZone-bef-tZZ7.js +14 -0
  53. package/dist-lib/{stores/icon-registry.d.ts → icon-registry-CUT4eF63.d.ts} +14 -11
  54. package/dist-lib/icons.d.ts +20 -4
  55. package/dist-lib/icons.js +3 -2
  56. package/dist-lib/index.d.ts +2516 -150
  57. package/dist-lib/index.js +1588 -5117
  58. package/dist-lib/page-inset-D_kkVwwN.js +9 -0
  59. package/dist-lib/page-state-eA6J_KIR.js +124 -0
  60. package/dist-lib/param-editors-9yJr7xmN.js +201 -0
  61. package/dist-lib/payload-B2wODLAX.js +86 -0
  62. package/dist-lib/{peekDraftStore-Dk1Ha5u3.js → peekDraftStore-D4GRsRKW.js} +44 -43
  63. package/dist-lib/registry-BpzE8-h8.js +119 -0
  64. package/dist-lib/screen-back-Cs4kzeqD.js +44 -0
  65. package/dist-lib/testing.d.ts +53 -56
  66. package/dist-lib/testing.js +54 -55
  67. package/dist-lib/use-filter-value-labels-DuqvAIVG.js +413 -0
  68. package/dist-lib/{useAgentConversation-nT5UypJX.js → useAgentConversation-D210VDCQ.js} +158 -169
  69. package/dist-lib/useAuth-CR2YKKXb.js +49 -0
  70. package/dist-lib/useBranding-Ckp_AuJb.js +41 -0
  71. package/dist-lib/useBrandingChrome-bKTXXDLy.js +170 -0
  72. package/dist-lib/useCurrentLocation-BdngVeQv.js +22 -0
  73. package/dist-lib/useCurrentScreen--UovgvRj.js +2511 -0
  74. package/dist-lib/useImpersonation-DNV23Ks1.js +35 -0
  75. package/dist-lib/useObject-1OCeV34A.js +26 -0
  76. package/dist-lib/useOwnRefresh-DkOuM4yo.js +435 -0
  77. package/dist-lib/useParams-ei6w4I7w.js +133 -0
  78. package/dist-lib/useProperties-CbdhlhZd.js +81 -0
  79. package/dist-lib/useResponsiveMode-DIR1bZfo.d.ts +1786 -0
  80. package/dist-lib/useScreenBack-J861tbwn.js +71 -0
  81. package/dist-lib/useTabNavigate-BZiW4q3M.js +78 -0
  82. package/dist-lib/useTabTitle-CZZnWIQi.js +22 -0
  83. package/dist-lib/utils-D_QDpB8_.js +11 -0
  84. package/dist-lib/{value-Dwfyghtj.js → value-CDCeHgOv.js} +8 -22
  85. package/dist-lib/{action-dispatch-gWmOYjOP.js → variants-CbAwl3Mn.js} +734 -740
  86. package/dist-lib/vite/index.d.ts +42 -16
  87. package/dist-lib/window-election-CHIvIZwx.js +45 -0
  88. package/package.json +16 -23
  89. package/dist-lib/DetailAuditStrip-CSXZoy7v.js +0 -288
  90. package/dist-lib/DynamicIcon-DW5krHuX.js +0 -280
  91. package/dist-lib/RefreshControl-DO9rYcdq.js +0 -399
  92. package/dist-lib/SmartDetailPage.impl-DFIIx80b.js +0 -1565
  93. package/dist-lib/SmartListPage.impl-D694R32H.js +0 -3051
  94. package/dist-lib/SmartRecordListPage.impl-CB5cuQJV.js +0 -780
  95. package/dist-lib/api/agents.d.ts +0 -140
  96. package/dist-lib/api/auth-redirect.d.ts +0 -3
  97. package/dist-lib/api/auth.d.ts +0 -26
  98. package/dist-lib/api/batch.d.ts +0 -25
  99. package/dist-lib/api/client.d.ts +0 -51
  100. package/dist-lib/api/data.d.ts +0 -153
  101. package/dist-lib/api/entities.d.ts +0 -149
  102. package/dist-lib/api/events.d.ts +0 -91
  103. package/dist-lib/api/params.d.ts +0 -28
  104. package/dist-lib/api/properties.d.ts +0 -3
  105. package/dist-lib/api/schema.d.ts +0 -2
  106. package/dist-lib/api/status.d.ts +0 -2
  107. package/dist-lib/app.d.ts +0 -1
  108. package/dist-lib/components/actions/ActionButton.d.ts +0 -18
  109. package/dist-lib/components/actions/ActionDialog.d.ts +0 -20
  110. package/dist-lib/components/actions/ActionResultDialog.d.ts +0 -22
  111. package/dist-lib/components/actions/ActionRunner.d.ts +0 -62
  112. package/dist-lib/components/actions/ObjectActionBar.d.ts +0 -29
  113. package/dist-lib/components/actions/PropertyGridEditor.d.ts +0 -20
  114. package/dist-lib/components/actions/ResponsiveActionBar.d.ts +0 -259
  115. package/dist-lib/components/actions/RowActionsKebab.d.ts +0 -20
  116. package/dist-lib/components/agents/AgentChatPanel.d.ts +0 -3
  117. package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +0 -14
  118. package/dist-lib/components/agents/AgentConversationDrawer.d.ts +0 -11
  119. package/dist-lib/components/agents/AgentElicitForm.d.ts +0 -27
  120. package/dist-lib/components/agents/AgentPicker.d.ts +0 -8
  121. package/dist-lib/components/agents/transcript-runs.d.ts +0 -29
  122. package/dist-lib/components/chrome/AssociationTabs.d.ts +0 -9
  123. package/dist-lib/components/chrome/AuditMetaStrip.d.ts +0 -11
  124. package/dist-lib/components/chrome/Breadcrumbs.d.ts +0 -14
  125. package/dist-lib/components/chrome/HighlightsStrip.d.ts +0 -10
  126. package/dist-lib/components/chrome/PageHeader.d.ts +0 -16
  127. package/dist-lib/components/chrome/PageShell.d.ts +0 -7
  128. package/dist-lib/components/chrome/RecordHeader.d.ts +0 -17
  129. package/dist-lib/components/chrome/headerActionZone.d.ts +0 -27
  130. package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +0 -20
  131. package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +0 -13
  132. package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +0 -16
  133. package/dist-lib/components/detail-layout/ChildrenCards.d.ts +0 -2
  134. package/dist-lib/components/detail-layout/ChildrenList.d.ts +0 -2
  135. package/dist-lib/components/detail-layout/ChildrenTable.d.ts +0 -2
  136. package/dist-lib/components/detail-layout/ChildrenTimeline.d.ts +0 -2
  137. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +0 -12
  138. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +0 -14
  139. package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +0 -16
  140. package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +0 -16
  141. package/dist-lib/components/detail-layout/ErrorSummary.d.ts +0 -11
  142. package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +0 -6
  143. package/dist-lib/components/detail-layout/FieldRow.d.ts +0 -23
  144. package/dist-lib/components/detail-layout/FieldsBlock.d.ts +0 -8
  145. package/dist-lib/components/detail-layout/LayoutColumn.d.ts +0 -9
  146. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +0 -46
  147. package/dist-lib/components/detail-layout/LayoutRow.d.ts +0 -8
  148. package/dist-lib/components/detail-layout/LayoutTabs.d.ts +0 -8
  149. package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +0 -8
  150. package/dist-lib/components/detail-layout/QuickAddForm.d.ts +0 -10
  151. package/dist-lib/components/detail-layout/SectionBlock.d.ts +0 -8
  152. package/dist-lib/components/detail-layout/StatusesBlock.d.ts +0 -8
  153. package/dist-lib/components/detail-layout/TimelineComposer.d.ts +0 -10
  154. package/dist-lib/components/detail-layout/blockMeta.d.ts +0 -5
  155. package/dist-lib/components/detail-layout/index.d.ts +0 -21
  156. package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +0 -25
  157. package/dist-lib/components/detail-layout/useQuickAdd.d.ts +0 -16
  158. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.d.ts +0 -2
  159. package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.d.ts +0 -2
  160. package/dist-lib/components/detail-layout/widgets/MonacoJson.d.ts +0 -9
  161. package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +0 -9
  162. package/dist-lib/components/detail-layout/widgets/builtins.d.ts +0 -1
  163. package/dist-lib/components/detail-layout/widgets/canonicalizeJson.d.ts +0 -1
  164. package/dist-lib/components/detail-layout/widgets/monacoBootstrap.d.ts +0 -1
  165. package/dist-lib/components/detail-layout/widgets/registry.d.ts +0 -14
  166. package/dist-lib/components/fields/BoolField.d.ts +0 -2
  167. package/dist-lib/components/fields/EmailField.d.ts +0 -2
  168. package/dist-lib/components/fields/EnumField.d.ts +0 -2
  169. package/dist-lib/components/fields/IntArrayField.d.ts +0 -2
  170. package/dist-lib/components/fields/JsonEditor.d.ts +0 -10
  171. package/dist-lib/components/fields/JsonField.d.ts +0 -3
  172. package/dist-lib/components/fields/MultilangArrayField.d.ts +0 -2
  173. package/dist-lib/components/fields/MultilangField.d.ts +0 -2
  174. package/dist-lib/components/fields/MultilangTextField.d.ts +0 -2
  175. package/dist-lib/components/fields/NumberField.d.ts +0 -2
  176. package/dist-lib/components/fields/PasswordField.d.ts +0 -2
  177. package/dist-lib/components/fields/PhoneField.d.ts +0 -2
  178. package/dist-lib/components/fields/RefCombobox.d.ts +0 -45
  179. package/dist-lib/components/fields/RefField.d.ts +0 -2
  180. package/dist-lib/components/fields/RichTextField.d.ts +0 -2
  181. package/dist-lib/components/fields/SecretField.d.ts +0 -2
  182. package/dist-lib/components/fields/StringArrayField.d.ts +0 -2
  183. package/dist-lib/components/fields/StringField.d.ts +0 -2
  184. package/dist-lib/components/fields/StructureField.d.ts +0 -2
  185. package/dist-lib/components/fields/TextField.d.ts +0 -2
  186. package/dist-lib/components/fields/TimestampField.d.ts +0 -2
  187. package/dist-lib/components/fields/UrlField.d.ts +0 -2
  188. package/dist-lib/components/fields/cells/factories/badge.d.ts +0 -2
  189. package/dist-lib/components/fields/cells/factories/boolPill.d.ts +0 -2
  190. package/dist-lib/components/fields/cells/factories/code.d.ts +0 -2
  191. package/dist-lib/components/fields/cells/factories/date.d.ts +0 -2
  192. package/dist-lib/components/fields/cells/factories/email.d.ts +0 -2
  193. package/dist-lib/components/fields/cells/factories/emptyCell.d.ts +0 -2
  194. package/dist-lib/components/fields/cells/factories/host-icons.d.ts +0 -17
  195. package/dist-lib/components/fields/cells/factories/json.d.ts +0 -2
  196. package/dist-lib/components/fields/cells/factories/link.d.ts +0 -2
  197. package/dist-lib/components/fields/cells/factories/markdown.d.ts +0 -2
  198. package/dist-lib/components/fields/cells/factories/markdownPreview.d.ts +0 -9
  199. package/dist-lib/components/fields/cells/factories/money.d.ts +0 -2
  200. package/dist-lib/components/fields/cells/factories/multilangInline.d.ts +0 -2
  201. package/dist-lib/components/fields/cells/factories/nextRun.d.ts +0 -2
  202. package/dist-lib/components/fields/cells/factories/number.d.ts +0 -2
  203. package/dist-lib/components/fields/cells/factories/passwordMask.d.ts +0 -2
  204. package/dist-lib/components/fields/cells/factories/phone.d.ts +0 -2
  205. package/dist-lib/components/fields/cells/factories/refLink.d.ts +0 -2
  206. package/dist-lib/components/fields/cells/factories/richTextPreview.d.ts +0 -2
  207. package/dist-lib/components/fields/cells/factories/statusPill.d.ts +0 -2
  208. package/dist-lib/components/fields/cells/factories/tagList.d.ts +0 -2
  209. package/dist-lib/components/fields/cells/factories/text.d.ts +0 -2
  210. package/dist-lib/components/fields/cells/factories/timestamp.d.ts +0 -3
  211. package/dist-lib/components/fields/cells/factories/url-helpers.d.ts +0 -12
  212. package/dist-lib/components/fields/cells/factories/url.d.ts +0 -2
  213. package/dist-lib/components/fields/cells/registry.d.ts +0 -21
  214. package/dist-lib/components/fields/index.d.ts +0 -28
  215. package/dist-lib/components/fields/langMap.d.ts +0 -2
  216. package/dist-lib/components/fields/secretValue.d.ts +0 -2
  217. package/dist-lib/components/file-widgets/CircleImage.d.ts +0 -2
  218. package/dist-lib/components/file-widgets/DocumentCard.d.ts +0 -2
  219. package/dist-lib/components/file-widgets/FileList.d.ts +0 -2
  220. package/dist-lib/components/file-widgets/Grid.d.ts +0 -2
  221. package/dist-lib/components/file-widgets/GridLazy.d.ts +0 -2
  222. package/dist-lib/components/file-widgets/ImageWidget.d.ts +0 -12
  223. package/dist-lib/components/file-widgets/LabeledSlots.d.ts +0 -2
  224. package/dist-lib/components/file-widgets/SquareImage.d.ts +0 -2
  225. package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +0 -3
  226. package/dist-lib/components/file-widgets/UploadFailureText.d.ts +0 -4
  227. package/dist-lib/components/file-widgets/WideBanner.d.ts +0 -2
  228. package/dist-lib/components/file-widgets/builtins.d.ts +0 -1
  229. package/dist-lib/components/file-widgets/cropper.d.ts +0 -14
  230. package/dist-lib/components/file-widgets/draft-scope.d.ts +0 -22
  231. package/dist-lib/components/file-widgets/helpers.d.ts +0 -15
  232. package/dist-lib/components/file-widgets/host.d.ts +0 -28
  233. package/dist-lib/components/file-widgets/index.d.ts +0 -16
  234. package/dist-lib/components/file-widgets/payload.d.ts +0 -21
  235. package/dist-lib/components/file-widgets/registry.d.ts +0 -5
  236. package/dist-lib/components/file-widgets/types.d.ts +0 -17
  237. package/dist-lib/components/file-widgets/upload.d.ts +0 -45
  238. package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +0 -42
  239. package/dist-lib/components/file-widgets/value.d.ts +0 -4
  240. package/dist-lib/components/filters/FilterChips.d.ts +0 -14
  241. package/dist-lib/components/filters/FilterDrawer.d.ts +0 -32
  242. package/dist-lib/components/filters/filter-op-label.d.ts +0 -3
  243. package/dist-lib/components/layout/CommandPalette.d.ts +0 -21
  244. package/dist-lib/components/layout/DirtyTabsCloseDialog.d.ts +0 -9
  245. package/dist-lib/components/layout/ImpersonationBanner.d.ts +0 -11
  246. package/dist-lib/components/layout/ImpersonationFrame.d.ts +0 -11
  247. package/dist-lib/components/layout/ImpersonationStartModal.d.ts +0 -22
  248. package/dist-lib/components/layout/Layout.d.ts +0 -6
  249. package/dist-lib/components/layout/Rail.d.ts +0 -22
  250. package/dist-lib/components/layout/Sidebar.d.ts +0 -12
  251. package/dist-lib/components/layout/TabStrip.d.ts +0 -6
  252. package/dist-lib/components/layout/TenantChip.d.ts +0 -26
  253. package/dist-lib/components/layout/TopBar.d.ts +0 -22
  254. package/dist-lib/components/layout/tab-close.d.ts +0 -13
  255. package/dist-lib/components/list/ColumnPicker.d.ts +0 -20
  256. package/dist-lib/components/list/InlineEditCell.d.ts +0 -15
  257. package/dist-lib/components/list/PeekFieldCell.d.ts +0 -16
  258. package/dist-lib/components/list/QuickPeek.d.ts +0 -59
  259. package/dist-lib/components/list/ViewSwitcher.d.ts +0 -24
  260. package/dist-lib/components/list/peekDraftStore.d.ts +0 -6
  261. package/dist-lib/components/pages/AdminCatalogPage.d.ts +0 -1
  262. package/dist-lib/components/pages/DocumentsMenu.d.ts +0 -21
  263. package/dist-lib/components/pages/ExportMenu.d.ts +0 -30
  264. package/dist-lib/components/pages/NotFoundPage.d.ts +0 -1
  265. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +0 -41
  266. package/dist-lib/components/pages/SSOCallbackPage.d.ts +0 -1
  267. package/dist-lib/components/pages/SmartDetailPage.d.ts +0 -2
  268. package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +0 -4
  269. package/dist-lib/components/pages/SmartListPage.d.ts +0 -2
  270. package/dist-lib/components/pages/SmartListPage.impl.d.ts +0 -4
  271. package/dist-lib/components/pages/SmartRecordListPage.d.ts +0 -2
  272. package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +0 -4
  273. package/dist-lib/components/pages/auth/AuthShell.d.ts +0 -18
  274. package/dist-lib/components/pages/auth/Forgot.d.ts +0 -1
  275. package/dist-lib/components/pages/auth/Reset.d.ts +0 -1
  276. package/dist-lib/components/pages/auth/SignIn.d.ts +0 -1
  277. package/dist-lib/components/pages/auth/SignUp.d.ts +0 -1
  278. package/dist-lib/components/pages/auth/TwoFA.d.ts +0 -1
  279. package/dist-lib/components/pages/auth/icons.d.ts +0 -6
  280. package/dist-lib/components/pages/exportRequest.d.ts +0 -69
  281. package/dist-lib/components/pages/list/DataCell.d.ts +0 -4
  282. package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +0 -8
  283. package/dist-lib/components/pages/list/ListCardRow.d.ts +0 -39
  284. package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -33
  285. package/dist-lib/components/pages/list/ListFloatbar.d.ts +0 -29
  286. package/dist-lib/components/pages/list/ListFooter.d.ts +0 -26
  287. package/dist-lib/components/pages/list/ListHeader.d.ts +0 -26
  288. package/dist-lib/components/pages/list/ListNoRows.d.ts +0 -31
  289. package/dist-lib/components/pages/list/ListTable.d.ts +0 -33
  290. package/dist-lib/components/pages/list/ListTableRow.d.ts +0 -17
  291. package/dist-lib/components/pages/list/ListToolbar.d.ts +0 -46
  292. package/dist-lib/components/pages/list/ListUrlBanner.d.ts +0 -10
  293. package/dist-lib/components/pages/list/RowActionsCell.d.ts +0 -34
  294. package/dist-lib/components/pages/list/RowContextMenu.d.ts +0 -28
  295. package/dist-lib/components/pages/list/SaveViewDialog.d.ts +0 -10
  296. package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +0 -14
  297. package/dist-lib/components/pages/list/cardProjection.d.ts +0 -67
  298. package/dist-lib/components/pages/list/column-sizing.d.ts +0 -14
  299. package/dist-lib/components/pages/list/columns.d.ts +0 -46
  300. package/dist-lib/components/pages/list/filter-meta.d.ts +0 -25
  301. package/dist-lib/components/pages/list/page-size.d.ts +0 -3
  302. package/dist-lib/components/pages/list/sortable-header.d.ts +0 -2
  303. package/dist-lib/components/pages/list/table-features.d.ts +0 -14
  304. package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +0 -24
  305. package/dist-lib/components/pages/list/useActiveView.d.ts +0 -45
  306. package/dist-lib/components/pages/list/useHeaderReorder.d.ts +0 -26
  307. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +0 -38
  308. package/dist-lib/components/pages/list/useListQuery.d.ts +0 -67
  309. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +0 -61
  310. package/dist-lib/components/pages/list/useListSelection.d.ts +0 -31
  311. package/dist-lib/components/pages/list/useListSort.d.ts +0 -46
  312. package/dist-lib/components/pages/list/useListViews.d.ts +0 -57
  313. package/dist-lib/components/pages/list/useRowMenu.d.ts +0 -46
  314. package/dist-lib/components/pages/profile/Preferences.d.ts +0 -1
  315. package/dist-lib/components/pages/profile/Profile.d.ts +0 -7
  316. package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +0 -2
  317. package/dist-lib/components/params/ParamsBlock.d.ts +0 -13
  318. package/dist-lib/components/params/param-editors.d.ts +0 -20
  319. package/dist-lib/components/primitives/Avatar.d.ts +0 -6
  320. package/dist-lib/components/primitives/BoolToggle.d.ts +0 -7
  321. package/dist-lib/components/primitives/BrandGlyph.d.ts +0 -8
  322. package/dist-lib/components/primitives/BrandLogo.d.ts +0 -12
  323. package/dist-lib/components/primitives/Btn.d.ts +0 -19
  324. package/dist-lib/components/primitives/Check.d.ts +0 -7
  325. package/dist-lib/components/primitives/Chip.d.ts +0 -9
  326. package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +0 -9
  327. package/dist-lib/components/primitives/Dropdown.d.ts +0 -20
  328. package/dist-lib/components/primitives/Fields.d.ts +0 -111
  329. package/dist-lib/components/primitives/HoverCard.d.ts +0 -15
  330. package/dist-lib/components/primitives/IconBtn.d.ts +0 -11
  331. package/dist-lib/components/primitives/Icons.d.ts +0 -136
  332. package/dist-lib/components/primitives/Kbd.d.ts +0 -4
  333. package/dist-lib/components/primitives/MenuItem.d.ts +0 -14
  334. package/dist-lib/components/primitives/Pill.d.ts +0 -11
  335. package/dist-lib/components/primitives/RecordIdBadge.d.ts +0 -8
  336. package/dist-lib/components/primitives/RowField.d.ts +0 -10
  337. package/dist-lib/components/primitives/SectionCard.d.ts +0 -24
  338. package/dist-lib/components/primitives/Spinner.d.ts +0 -3
  339. package/dist-lib/components/primitives/Tooltip.d.ts +0 -34
  340. package/dist-lib/components/primitives/dataTableStyles.d.ts +0 -4
  341. package/dist-lib/components/primitives/index.d.ts +0 -37
  342. package/dist-lib/components/shared/ChangePasswordDialog.d.ts +0 -9
  343. package/dist-lib/components/shared/ConfirmDialog.d.ts +0 -11
  344. package/dist-lib/components/shared/CopyButton.d.ts +0 -8
  345. package/dist-lib/components/shared/DynamicIcon.d.ts +0 -20
  346. package/dist-lib/components/shared/EmptyState.d.ts +0 -9
  347. package/dist-lib/components/shared/ErrorBoundary.d.ts +0 -17
  348. package/dist-lib/components/shared/LoadingSkeleton.d.ts +0 -6
  349. package/dist-lib/components/shared/LucideIcon.d.ts +0 -16
  350. package/dist-lib/components/shared/Markdown.d.ts +0 -3
  351. package/dist-lib/components/shared/MarkdownRenderer.d.ts +0 -11
  352. package/dist-lib/components/shared/RefreshControl.d.ts +0 -25
  353. package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +0 -11
  354. package/dist-lib/components/shared/StatusStepper.d.ts +0 -13
  355. package/dist-lib/components/shared/toast/DeclarionToast.d.ts +0 -31
  356. package/dist-lib/components/shared/useOwnRefresh.d.ts +0 -9
  357. package/dist-lib/embed/EmbedAuthBootstrap.d.ts +0 -8
  358. package/dist-lib/embed/EmbedContext.d.ts +0 -50
  359. package/dist-lib/embed/EmbedDirtyReporter.d.ts +0 -10
  360. package/dist-lib/embed/EmbedHistoryTracker.d.ts +0 -1
  361. package/dist-lib/embed/EmbedLocationReporter.d.ts +0 -8
  362. package/dist-lib/embed/EmbedResizeReporter.d.ts +0 -6
  363. package/dist-lib/embed/EmbedUnsavedGuard.d.ts +0 -7
  364. package/dist-lib/embed/embed-dirty.d.ts +0 -24
  365. package/dist-lib/embed/embed-history.d.ts +0 -19
  366. package/dist-lib/embed/embed-nav-guard.d.ts +0 -20
  367. package/dist-lib/embed/file-src.d.ts +0 -63
  368. package/dist-lib/embed/handshake.d.ts +0 -57
  369. package/dist-lib/embed/index.d.ts +0 -19
  370. package/dist-lib/embed/params.d.ts +0 -75
  371. package/dist-lib/embed/protocol.d.ts +0 -165
  372. package/dist-lib/embed/screen-location.d.ts +0 -50
  373. package/dist-lib/embed/theme.d.ts +0 -34
  374. package/dist-lib/embed/token.d.ts +0 -57
  375. package/dist-lib/embed/useEmbedNavigate.d.ts +0 -48
  376. package/dist-lib/embed/useGlobalLinkInterceptor.d.ts +0 -66
  377. package/dist-lib/failure-BUxXuP4c.js +0 -158
  378. package/dist-lib/format-count-bXVfHzbI.js +0 -1771
  379. package/dist-lib/hooks/useActionData.d.ts +0 -61
  380. package/dist-lib/hooks/useAgentConversation.d.ts +0 -24
  381. package/dist-lib/hooks/useAllEntityData.d.ts +0 -16
  382. package/dist-lib/hooks/useAssociatedData.d.ts +0 -10
  383. package/dist-lib/hooks/useAuth.d.ts +0 -22
  384. package/dist-lib/hooks/useBranding.d.ts +0 -8
  385. package/dist-lib/hooks/useBrandingChrome.d.ts +0 -59
  386. package/dist-lib/hooks/useChildrenData.d.ts +0 -3
  387. package/dist-lib/hooks/useColumns.d.ts +0 -13
  388. package/dist-lib/hooks/useCurrentScreen.d.ts +0 -34
  389. package/dist-lib/hooks/useCursorEntityData.d.ts +0 -79
  390. package/dist-lib/hooks/useDebounce.d.ts +0 -1
  391. package/dist-lib/hooks/useEntity.d.ts +0 -2
  392. package/dist-lib/hooks/useEntityData.d.ts +0 -41
  393. package/dist-lib/hooks/useFilters.d.ts +0 -14
  394. package/dist-lib/hooks/useImpersonation.d.ts +0 -23
  395. package/dist-lib/hooks/useLanguage.d.ts +0 -4
  396. package/dist-lib/hooks/useLiveObject.d.ts +0 -9
  397. package/dist-lib/hooks/useLongPress.d.ts +0 -29
  398. package/dist-lib/hooks/useMutations.d.ts +0 -13
  399. package/dist-lib/hooks/useObject.d.ts +0 -11
  400. package/dist-lib/hooks/useObjectStatus.d.ts +0 -5
  401. package/dist-lib/hooks/usePageState.d.ts +0 -32
  402. package/dist-lib/hooks/usePageStateRuntime.d.ts +0 -27
  403. package/dist-lib/hooks/usePageStateTtl.d.ts +0 -11
  404. package/dist-lib/hooks/useParams.d.ts +0 -49
  405. package/dist-lib/hooks/useProperties.d.ts +0 -5
  406. package/dist-lib/hooks/useRealtimeThresholds.d.ts +0 -1
  407. package/dist-lib/hooks/useRegisterScreenTab.d.ts +0 -11
  408. package/dist-lib/hooks/useResponsiveMode.d.ts +0 -27
  409. package/dist-lib/hooks/useSSE.d.ts +0 -31
  410. package/dist-lib/hooks/useSchema.d.ts +0 -1
  411. package/dist-lib/hooks/useScreen.d.ts +0 -2
  412. package/dist-lib/hooks/useScreenBack.d.ts +0 -21
  413. package/dist-lib/hooks/useScreenTab.d.ts +0 -10
  414. package/dist-lib/hooks/useTabNavigate.d.ts +0 -34
  415. package/dist-lib/hooks/useTabSearchMirror.d.ts +0 -1
  416. package/dist-lib/hooks/useTabTitle.d.ts +0 -2
  417. package/dist-lib/hooks/useText.d.ts +0 -3
  418. package/dist-lib/hooks/useTimelineData.d.ts +0 -10
  419. package/dist-lib/hooks/useVersionWatcher.d.ts +0 -30
  420. package/dist-lib/hooks/useViews.d.ts +0 -26
  421. package/dist-lib/lib/action-dispatch.d.ts +0 -8
  422. package/dist-lib/lib/actions.d.ts +0 -254
  423. package/dist-lib/lib/anchor.d.ts +0 -36
  424. package/dist-lib/lib/brand-tokens.d.ts +0 -43
  425. package/dist-lib/lib/branding.d.ts +0 -20
  426. package/dist-lib/lib/canonical-url.d.ts +0 -27
  427. package/dist-lib/lib/capabilityPrefetch.d.ts +0 -6
  428. package/dist-lib/lib/child-config.d.ts +0 -24
  429. package/dist-lib/lib/children-validation.d.ts +0 -5
  430. package/dist-lib/lib/decimal-text.d.ts +0 -1
  431. package/dist-lib/lib/display-value.d.ts +0 -1
  432. package/dist-lib/lib/document-templates.d.ts +0 -11
  433. package/dist-lib/lib/download.d.ts +0 -21
  434. package/dist-lib/lib/evidence-verdict.d.ts +0 -11
  435. package/dist-lib/lib/failure.d.ts +0 -2
  436. package/dist-lib/lib/field-classification.d.ts +0 -61
  437. package/dist-lib/lib/field-regions.d.ts +0 -8
  438. package/dist-lib/lib/filter-evaluator.d.ts +0 -16
  439. package/dist-lib/lib/filters.d.ts +0 -93
  440. package/dist-lib/lib/format-count.d.ts +0 -41
  441. package/dist-lib/lib/html-state.d.ts +0 -11
  442. package/dist-lib/lib/language.d.ts +0 -19
  443. package/dist-lib/lib/longPressGesture.d.ts +0 -55
  444. package/dist-lib/lib/mass-edit.d.ts +0 -32
  445. package/dist-lib/lib/page-inset.d.ts +0 -3
  446. package/dist-lib/lib/quick-add.d.ts +0 -2
  447. package/dist-lib/lib/realtime-query-keys.d.ts +0 -22
  448. package/dist-lib/lib/realtime-reconcile.d.ts +0 -33
  449. package/dist-lib/lib/realtime-resync.d.ts +0 -23
  450. package/dist-lib/lib/record-documents-key.d.ts +0 -1
  451. package/dist-lib/lib/rich-text.d.ts +0 -14
  452. package/dist-lib/lib/rowClickGesture.d.ts +0 -26
  453. package/dist-lib/lib/safe-url.d.ts +0 -15
  454. package/dist-lib/lib/schema-routing.d.ts +0 -3
  455. package/dist-lib/lib/screen-back.d.ts +0 -70
  456. package/dist-lib/lib/scroll-restoration.d.ts +0 -90
  457. package/dist-lib/lib/size-value.d.ts +0 -16
  458. package/dist-lib/lib/sort.d.ts +0 -72
  459. package/dist-lib/lib/timestamp.d.ts +0 -53
  460. package/dist-lib/lib/toast.d.ts +0 -49
  461. package/dist-lib/lib/ui-actions.d.ts +0 -12
  462. package/dist-lib/lib/utils.d.ts +0 -9
  463. package/dist-lib/lib/variants.d.ts +0 -7
  464. package/dist-lib/lib/versionTracker.d.ts +0 -72
  465. package/dist-lib/lib/viewport-category.d.ts +0 -44
  466. package/dist-lib/main.d.ts +0 -1
  467. package/dist-lib/registry-nSeHd5si.js +0 -1956
  468. package/dist-lib/safe-url-oSJw5pzO.js +0 -34
  469. package/dist-lib/stores/auth.d.ts +0 -16
  470. package/dist-lib/stores/list-layout.d.ts +0 -85
  471. package/dist-lib/stores/page-state.d.ts +0 -61
  472. package/dist-lib/stores/preferences.d.ts +0 -37
  473. package/dist-lib/stores/realtime.d.ts +0 -96
  474. package/dist-lib/stores/screen-registry.d.ts +0 -17
  475. package/dist-lib/stores/tabs.d.ts +0 -73
  476. package/dist-lib/types/api.d.ts +0 -579
  477. package/dist-lib/types/fieldType.d.ts +0 -2
  478. package/dist-lib/types/files.d.ts +0 -79
  479. package/dist-lib/types/ordmap.d.ts +0 -39
  480. package/dist-lib/types/schema.d.ts +0 -1089
  481. package/dist-lib/useCurrentScreen-0WBj7wT6.js +0 -7860
  482. package/dist-lib/useListQuery-C7dq_sEo.js +0 -103
  483. package/dist-lib/useOwnRefresh-q80kCMMh.js +0 -1167
  484. package/dist-lib/useProperties-CeGKtq7Q.js +0 -83
  485. package/dist-lib/useTabSearchMirror-CzNAj82Q.js +0 -175
  486. package/dist-lib/useText-BsedsJ-J.js +0 -952
  487. package/dist-lib/vite/fingerprint-plugin.d.ts +0 -44
@@ -0,0 +1,2511 @@
1
+ import { t as e } from "./Icons-lt-7lhYR.js";
2
+ import { Fragment as t, createContext as n, createElement as r, useCallback as i, useContext as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
3
+ import { useQuery as u } from "@tanstack/react-query";
4
+ import { formatISO as d } from "date-fns";
5
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
6
+ import { create as m } from "zustand";
7
+ import { useLocation as ee, useNavigate as h } from "react-router";
8
+ import { toast as g } from "sonner";
9
+ //#region src/types/api.ts
10
+ var _ = class extends Error {
11
+ status;
12
+ code;
13
+ type;
14
+ retryable;
15
+ detail;
16
+ index;
17
+ raw;
18
+ constructor(e, t, n) {
19
+ super(t.title ?? ""), this.name = "ApiError", this.status = t.status ?? e, this.type = t.type ?? "", this.code = v(t.type), this.retryable = t.retryable ?? !1, this.detail = t.detail;
20
+ let r = t.index;
21
+ typeof r == "number" && (this.index = r), this.raw = n;
22
+ }
23
+ ext(e) {
24
+ return this.raw?.[e];
25
+ }
26
+ };
27
+ function v(e) {
28
+ if (!e || e === "about:blank") return "";
29
+ let t = e.lastIndexOf("/");
30
+ return t >= 0 ? e.slice(t + 1) : e;
31
+ }
32
+ function y(e) {
33
+ return typeof e == "object" && !!e && typeof e.type == "string";
34
+ }
35
+ var te = "cursor.semantics_mismatch", b = "cursor.language_changed";
36
+ function ne(e) {
37
+ return e instanceof _ && (e.code === "cursor.semantics_mismatch" || e.code === "cursor.language_changed" || e.code === "cursor.archive_invalid");
38
+ }
39
+ async function x(e) {
40
+ let t;
41
+ try {
42
+ t = await e.json();
43
+ } catch {}
44
+ return {
45
+ raw: t,
46
+ body: y(t) ? t : {}
47
+ };
48
+ }
49
+ //#endregion
50
+ //#region src/api/auth-redirect.ts
51
+ var S = "/", C = "/login", w = "/signup", T = "https://declarion.local";
52
+ function re(e) {
53
+ let t = e.split(/[?#]/, 1)[0];
54
+ return t === C || t.startsWith(`${C}/`) || t === w || t.startsWith(`${w}/`);
55
+ }
56
+ function ie(e) {
57
+ if (!e) return S;
58
+ let t = e.toLowerCase();
59
+ if (!e.startsWith("/") || e.startsWith("//") || e.includes("\\") || t.includes("%5c")) return S;
60
+ try {
61
+ let t = new URL(e, T);
62
+ if (t.origin !== T) return S;
63
+ let n = `${t.pathname}${t.search}${t.hash}`;
64
+ return !n.startsWith("/") || n.startsWith("//") || n.includes("\\") ? S : n || S;
65
+ } catch {
66
+ return S;
67
+ }
68
+ }
69
+ function ae(e) {
70
+ let t = ie(e);
71
+ return t === S || re(t) ? C : `${C}?next=${encodeURIComponent(t)}`;
72
+ }
73
+ function oe() {
74
+ if (typeof window > "u") return C;
75
+ let { pathname: e, search: t, hash: n } = window.location;
76
+ return ae(`${e}${t}${n}`);
77
+ }
78
+ //#endregion
79
+ //#region src/embed/protocol.ts
80
+ var se = "declarion-embed", E = {
81
+ ready: "ready",
82
+ setToken: "set-token",
83
+ tokenExpired: "token-expired",
84
+ reloadRequired: "reload-required",
85
+ resized: "resized",
86
+ navigated: "navigated",
87
+ navigationRequested: "navigation-requested",
88
+ dirtyChanged: "dirty-changed",
89
+ navigationFailed: "navigation-failed",
90
+ navigate: "navigate",
91
+ setTheme: "set-theme"
92
+ };
93
+ function D(e, t, n) {
94
+ if (!e || typeof window > "u" || window.parent === window) return !1;
95
+ let r = {
96
+ source: se,
97
+ protocol: 1,
98
+ type: t,
99
+ payload: n
100
+ };
101
+ return window.parent.postMessage(r, e), !0;
102
+ }
103
+ //#endregion
104
+ //#region src/embed/token.ts
105
+ var ce = 15e3, le = 5e3, O = {
106
+ active: !1,
107
+ parentOrigin: null,
108
+ current: null,
109
+ pending: null
110
+ };
111
+ function ue(e) {
112
+ O.active = !0, O.parentOrigin = e;
113
+ }
114
+ function k() {
115
+ return O.active;
116
+ }
117
+ function de() {
118
+ return O.current?.token ?? null;
119
+ }
120
+ function fe() {
121
+ return O.parentOrigin;
122
+ }
123
+ function pe() {
124
+ return !O.current || Date.now() >= O.current.expiresAt - le;
125
+ }
126
+ function me(e) {
127
+ if (!e.token || typeof e.token != "string") return;
128
+ let t = Date.parse(e.expires_at);
129
+ if (!Number.isNaN(t) && (O.current = {
130
+ token: e.token,
131
+ expiresAt: t
132
+ }, O.pending)) {
133
+ let t = O.pending;
134
+ O.pending = null, clearTimeout(t.timer), t.resolve(e.token);
135
+ }
136
+ }
137
+ function he() {
138
+ O.current = null;
139
+ }
140
+ function ge() {
141
+ if (!pe() && O.current) return Promise.resolve(O.current.token);
142
+ if (O.pending) return O.pending.promise;
143
+ let e, t, n = new Promise((n, r) => {
144
+ e = n, t = r;
145
+ }), r = setTimeout(() => {
146
+ O.pending && O.pending.promise === n && (O.pending = null), t(/* @__PURE__ */ Error(`embed token wait timed out after ${ce}ms`));
147
+ }, ce);
148
+ return O.pending = {
149
+ promise: n,
150
+ resolve: e,
151
+ reject: t,
152
+ timer: r
153
+ }, D(O.parentOrigin, E.tokenExpired, {}), n;
154
+ }
155
+ //#endregion
156
+ //#region src/lib/versionTracker.ts
157
+ var _e = "X-Declarion-Version", ve = "declarion-version";
158
+ function ye() {
159
+ if (typeof BroadcastChannel > "u") return null;
160
+ try {
161
+ return new BroadcastChannel(ve);
162
+ } catch {
163
+ return null;
164
+ }
165
+ }
166
+ var A = {
167
+ firstSeen: null,
168
+ firstComponents: null,
169
+ hasReportedDrift: !1,
170
+ pendingReload: null,
171
+ listeners: /* @__PURE__ */ new Set(),
172
+ channel: null
173
+ };
174
+ function be() {
175
+ A.channel || typeof BroadcastChannel > "u" || (A.channel = ye(), A.channel && A.channel.addEventListener("message", (e) => {
176
+ let t = e.data;
177
+ if (t && t.type === "drift" && t.delta && !A.hasReportedDrift) {
178
+ A.hasReportedDrift = !0;
179
+ for (let e of A.listeners) e(t.delta);
180
+ }
181
+ }));
182
+ }
183
+ function xe(e) {
184
+ if (be(), !e) return;
185
+ let t = e.get(_e);
186
+ t && (A.firstSeen ? t !== A.firstSeen && (A.hasReportedDrift || Se().catch(() => {
187
+ we({
188
+ kind: "unknown",
189
+ observed: t
190
+ });
191
+ })) : A.firstSeen = t);
192
+ }
193
+ async function Se() {
194
+ be();
195
+ let e;
196
+ try {
197
+ let t = {};
198
+ A.firstSeen && (t["If-None-Match"] = `"${A.firstSeen}"`), e = await fetch("/api/version", {
199
+ method: "GET",
200
+ credentials: k() ? "omit" : "include",
201
+ headers: t
202
+ });
203
+ } catch {
204
+ throw Error("version probe network error");
205
+ }
206
+ if (e.status === 304) return;
207
+ if (!e.ok) throw await x(e), Error(`version probe ${e.status}`);
208
+ let t;
209
+ try {
210
+ t = await e.json();
211
+ } catch {
212
+ throw Error("version probe malformed body");
213
+ }
214
+ let n = t.fingerprint;
215
+ if (typeof n != "string" || n === "") throw Error("version probe missing fingerprint");
216
+ let r = typeof t.schema_fingerprint == "string" && typeof t.asset_fingerprint == "string" && typeof t.binary_fingerprint == "string" ? {
217
+ schema: t.schema_fingerprint,
218
+ asset: t.asset_fingerprint,
219
+ binary: t.binary_fingerprint
220
+ } : void 0;
221
+ A.firstSeen ||= n, !A.firstComponents && r && n === A.firstSeen && (A.firstComponents = r), n !== A.firstSeen && we({
222
+ kind: Ce(A.firstComponents, r),
223
+ observed: n,
224
+ components: r
225
+ });
226
+ }
227
+ function Ce(e, t) {
228
+ if (!e || !t) return "unknown";
229
+ let n = e.schema !== t.schema, r = e.asset !== t.asset, i = e.binary !== t.binary;
230
+ return n && !r && !i ? "schema-only" : r || i ? "asset-or-binary" : "unknown";
231
+ }
232
+ function we(e) {
233
+ if (!A.hasReportedDrift) {
234
+ A.hasReportedDrift = !0, e.kind !== "schema-only" && (A.pendingReload = e);
235
+ for (let t of A.listeners) t(e);
236
+ if (A.channel) try {
237
+ A.channel.postMessage({
238
+ type: "drift",
239
+ delta: e
240
+ });
241
+ } catch {}
242
+ k() && e.kind !== "schema-only" && D(fe(), E.reloadRequired, { reason: `version drift: ${e.kind}` });
243
+ }
244
+ }
245
+ function Te() {
246
+ return A.pendingReload;
247
+ }
248
+ function Ee(e) {
249
+ return A.listeners.add(e), () => {
250
+ A.listeners.delete(e);
251
+ };
252
+ }
253
+ //#endregion
254
+ //#region src/api/client.ts
255
+ var De = (e) => JSON.stringify(e ?? {}), j = null, M = "declarion.auth.refresh.lock", N = "declarion.auth.refresh.result", Oe = "declarion.auth.refresh", ke = 3e4, Ae = 100, P = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
256
+ function je() {
257
+ if (typeof window > "u") return !1;
258
+ try {
259
+ let e = window.localStorage, t = `${M}.probe`;
260
+ return e.setItem(t, "1"), e.removeItem(t), !0;
261
+ } catch {
262
+ return !1;
263
+ }
264
+ }
265
+ function Me() {
266
+ return typeof navigator > "u" ? null : navigator.locks ?? null;
267
+ }
268
+ function Ne(e) {
269
+ if (!e) return null;
270
+ try {
271
+ let t = JSON.parse(e);
272
+ return typeof t.owner != "string" || typeof t.expires_at != "number" ? null : {
273
+ owner: t.owner,
274
+ expires_at: t.expires_at
275
+ };
276
+ } catch {
277
+ return null;
278
+ }
279
+ }
280
+ function Pe(e) {
281
+ if (!e) return null;
282
+ try {
283
+ let t = JSON.parse(e);
284
+ return typeof t.owner != "string" || typeof t.ok != "boolean" || typeof t.updated_at != "number" ? null : {
285
+ owner: t.owner,
286
+ ok: t.ok,
287
+ status: typeof t.status == "number" ? t.status : void 0,
288
+ updated_at: t.updated_at
289
+ };
290
+ } catch {
291
+ return null;
292
+ }
293
+ }
294
+ function Fe(e) {
295
+ if (!je()) return null;
296
+ let t = Pe(window.localStorage.getItem(N));
297
+ return !t || t.updated_at < e ? null : t;
298
+ }
299
+ function Ie(e) {
300
+ if (!e.ok) throw new F(e.status ?? 401);
301
+ }
302
+ function Le(e = Date.now()) {
303
+ let t = Ne(window.localStorage.getItem(M));
304
+ if (t && t.expires_at > e && t.owner !== P) return !1;
305
+ let n = {
306
+ owner: P,
307
+ expires_at: e + ke
308
+ };
309
+ return window.localStorage.setItem(M, JSON.stringify(n)), Ne(window.localStorage.getItem(M))?.owner === P;
310
+ }
311
+ function Re() {
312
+ Ne(window.localStorage.getItem(M))?.owner === P && window.localStorage.removeItem(M);
313
+ }
314
+ function ze(e) {
315
+ let t = {
316
+ owner: P,
317
+ updated_at: Date.now(),
318
+ ...e
319
+ };
320
+ window.localStorage.setItem(N, JSON.stringify(t));
321
+ }
322
+ async function Be(e) {
323
+ return new Promise((t, n) => {
324
+ let r = !1, i = null, a = (e) => {
325
+ r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), t(e));
326
+ }, o = (e) => {
327
+ r || (r = !0, i && clearTimeout(i), window.removeEventListener("storage", c), n(new F(e)));
328
+ }, s = () => {
329
+ let t = Pe(window.localStorage.getItem(N));
330
+ if (t && t.updated_at >= e) {
331
+ t.ok ? a("complete") : o(t.status ?? 401);
332
+ return;
333
+ }
334
+ let n = Ne(window.localStorage.getItem(M));
335
+ n ? n.expires_at <= Date.now() ? a("expired") : i = setTimeout(s, Ae) : a("complete");
336
+ }, c = (e) => {
337
+ (e.key === M || e.key === N) && (i && clearTimeout(i), s());
338
+ };
339
+ window.addEventListener("storage", c), s();
340
+ });
341
+ }
342
+ async function Ve(e) {
343
+ let t = Me();
344
+ return t ? (await t.request(Oe, { mode: "exclusive" }, async () => {
345
+ let t = Fe(e);
346
+ if (t) Ie(t);
347
+ else try {
348
+ await Je(), je() && ze({ ok: !0 });
349
+ } catch (e) {
350
+ throw e instanceof F && je() && ze({
351
+ ok: !1,
352
+ status: e.status
353
+ }), e;
354
+ }
355
+ }), !0) : !1;
356
+ }
357
+ async function He() {
358
+ let e = Date.now();
359
+ if (!await Ve(e)) {
360
+ if (!je()) await Je();
361
+ else {
362
+ if (Le(e)) try {
363
+ await Je(), ze({ ok: !0 });
364
+ return;
365
+ } catch (e) {
366
+ throw e instanceof F && ze({
367
+ ok: !1,
368
+ status: e.status
369
+ }), e;
370
+ } finally {
371
+ Re();
372
+ }
373
+ await Be(e) === "expired" && await He();
374
+ }
375
+ }
376
+ }
377
+ var F = class extends Error {
378
+ status;
379
+ constructor(e) {
380
+ super(`refresh failed terminally (${e})`), this.status = e, this.name = "RefreshDeadError";
381
+ }
382
+ }, I = null, L = null, Ue = 3e4, We = 5e3;
383
+ function Ge() {
384
+ Ye().catch((e) => {
385
+ e instanceof F && B();
386
+ });
387
+ }
388
+ function R(e) {
389
+ if (z = null, I &&= (clearTimeout(I), null), L = null, !e || typeof window > "u") return;
390
+ let t = Date.parse(e);
391
+ if (Number.isNaN(t)) return;
392
+ L = t;
393
+ let n = Math.max(t - Date.now() - Ue, We);
394
+ I = setTimeout(() => {
395
+ I = null, Ge();
396
+ }, n);
397
+ }
398
+ function Ke() {
399
+ I &&= (clearTimeout(I), null), L = null;
400
+ }
401
+ typeof document < "u" && document.addEventListener("visibilitychange", () => {
402
+ document.visibilityState === "visible" && L !== null && Date.now() >= L - Ue && Ge();
403
+ });
404
+ async function qe(e) {
405
+ try {
406
+ let t = await e.json();
407
+ R(t?.result?.expires_at ?? t?.expires_at);
408
+ } catch {}
409
+ }
410
+ async function Je() {
411
+ let e = {
412
+ method: "POST",
413
+ credentials: "include",
414
+ headers: { "Content-Type": "application/json" },
415
+ body: De({})
416
+ }, t = await fetch("/api/actions/auth.refresh", e);
417
+ if (t.status === 429) {
418
+ let n = parseInt(t.headers.get("Retry-After") || "1", 10);
419
+ await new Promise((e) => setTimeout(e, n * 1e3));
420
+ let r = await fetch("/api/actions/auth.refresh", e);
421
+ if (!r.ok) throw await x(r), new F(r.status);
422
+ await qe(r);
423
+ } else {
424
+ if (!t.ok) throw await x(t), new F(t.status);
425
+ await qe(t);
426
+ }
427
+ }
428
+ var z = null;
429
+ async function Ye() {
430
+ if (z !== null) throw new F(z);
431
+ return j || (j = He().catch((e) => {
432
+ throw e instanceof F && (z = e.status), e;
433
+ }).finally(() => {
434
+ j = null;
435
+ }), j);
436
+ }
437
+ var B = () => {
438
+ if (typeof window > "u") return;
439
+ let { pathname: e } = window.location;
440
+ e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = oe());
441
+ };
442
+ function Xe(e) {
443
+ let t = B;
444
+ return B = e, t;
445
+ }
446
+ function Ze() {
447
+ return B;
448
+ }
449
+ var Qe = ({ status: e, code: t, message: n }) => {
450
+ console.error(`[API ${e}] ${t}: ${n}`);
451
+ };
452
+ function $e(e, t, n, r) {
453
+ let i = new Headers(e);
454
+ return !i.has("Content-Type") && t && i.set("Content-Type", "application/json"), n.setAccept && !i.has("Accept") && i.set("Accept", "*/*"), r && i.set("Authorization", `Bearer ${r}`), i;
455
+ }
456
+ var V = null, et = 0;
457
+ function tt(e) {
458
+ e || et++, V = e || null;
459
+ }
460
+ function nt() {
461
+ return et;
462
+ }
463
+ function rt(e, t) {
464
+ e === et && (V = t || null);
465
+ }
466
+ function it() {
467
+ return V;
468
+ }
469
+ function at(e) {
470
+ return !V || !e.startsWith("/api/") || /[?&]language=/.test(e) ? e : `${e}${e.includes("?") ? "&" : "?"}language=${encodeURIComponent(V)}`;
471
+ }
472
+ async function ot(e, t, n, r) {
473
+ let i = at(e), a = k(), o = a ? "omit" : "include", s = $e(t.headers, !!t.body, n, a ? de() : null), c = await fetch(i, {
474
+ ...t,
475
+ headers: s,
476
+ credentials: o
477
+ });
478
+ if (xe(c.headers), !c.ok) {
479
+ let { raw: e, body: s } = await x(c), l = v(s.type), u = s.title ?? "";
480
+ if (c.status === 401 && (l === "auth.token_refresh_needed" || l === "auth.unauthorized")) try {
481
+ let e = null;
482
+ a ? (he(), e = await ge()) : await Ye();
483
+ let s = $e(t.headers, !!t.body, n, e), c = await fetch(i, {
484
+ ...t,
485
+ headers: s,
486
+ credentials: o
487
+ });
488
+ if (!c.ok) {
489
+ B();
490
+ let e = await x(c);
491
+ throw new _(c.status, e.body, e.raw);
492
+ }
493
+ return r(c);
494
+ } catch (t) {
495
+ throw t instanceof _ ? t : (B(), new _(401, s, e));
496
+ }
497
+ throw c.status === 401 && B(), Qe({
498
+ status: c.status,
499
+ code: l,
500
+ message: u
501
+ }), new _(c.status, s, e);
502
+ }
503
+ return r(c);
504
+ }
505
+ function st(e) {
506
+ return e.status === 204 ? Promise.resolve(void 0) : e.json();
507
+ }
508
+ async function H(e, t = {}) {
509
+ return ot(e, t, { setAccept: !1 }, st);
510
+ }
511
+ async function ct(e) {
512
+ return {
513
+ blob: await e.blob(),
514
+ filename: ut(e.headers),
515
+ headers: e.headers
516
+ };
517
+ }
518
+ async function lt(e, t = {}) {
519
+ return ot(e, t, { setAccept: !0 }, ct);
520
+ }
521
+ function ut(e) {
522
+ let t = e.get("Content-Disposition");
523
+ if (!t) return "";
524
+ let n = t.match(/filename\*\s*=\s*([^']*)'([^']*)'([^;]+)/i);
525
+ if (n) try {
526
+ return decodeURIComponent(n[3].trim());
527
+ } catch {}
528
+ let r = t.match(/filename\s*=\s*("([^"]+)"|([^;]+))/i);
529
+ return r ? (r[2] ?? r[3] ?? "").trim() : "";
530
+ }
531
+ async function U(e, t = {}) {
532
+ return (await H(`/api/actions/${encodeURIComponent(e)}`, {
533
+ method: "POST",
534
+ body: De(t)
535
+ })).result;
536
+ }
537
+ //#endregion
538
+ //#region src/types/ordmap.ts
539
+ var W = class e {
540
+ #e;
541
+ #t;
542
+ constructor(e) {
543
+ this.#e = e;
544
+ let t = /* @__PURE__ */ new Map();
545
+ for (let n = 0; n < e.length; n++) {
546
+ let r = e[n].name;
547
+ r !== void 0 && t.set(r, n);
548
+ }
549
+ this.#t = t;
550
+ }
551
+ static fromObject(t) {
552
+ return e.#n(t);
553
+ }
554
+ static fromWire(t) {
555
+ return e.#n(t);
556
+ }
557
+ static #n(t) {
558
+ if (!t) return new e([]);
559
+ let n = [];
560
+ for (let [e, r] of Object.entries(t)) n.push({
561
+ ...r,
562
+ name: e
563
+ });
564
+ return new e(n);
565
+ }
566
+ get length() {
567
+ return this.#e.length;
568
+ }
569
+ has(e) {
570
+ return this.#t.has(e);
571
+ }
572
+ get(e) {
573
+ let t = this.#t.get(e);
574
+ return t === void 0 ? void 0 : this.#e[t];
575
+ }
576
+ items() {
577
+ return this.#e;
578
+ }
579
+ names() {
580
+ return this.#e.map((e) => e.name ?? "");
581
+ }
582
+ *[Symbol.iterator]() {
583
+ for (let e of this.#e) yield [e.name ?? "", e];
584
+ }
585
+ };
586
+ //#endregion
587
+ //#region src/lib/display-value.ts
588
+ function G(e) {
589
+ if (e == null) return "";
590
+ switch (typeof e) {
591
+ case "string": return e;
592
+ case "number":
593
+ case "boolean":
594
+ case "bigint":
595
+ case "symbol": return String(e);
596
+ case "object": try {
597
+ return JSON.stringify(e);
598
+ } catch {
599
+ return "[unserializable]";
600
+ }
601
+ default: return "";
602
+ }
603
+ }
604
+ //#endregion
605
+ //#region src/lib/timestamp.ts
606
+ function dt(e = /* @__PURE__ */ new Date()) {
607
+ return d(e);
608
+ }
609
+ function ft(e, t, n) {
610
+ let r = e.match(/([+-]\d{2}:\d{2})$/), i = e.endsWith("Z"), a = new Date(e);
611
+ if (isNaN(a.getTime())) return e;
612
+ if (r || i) {
613
+ let e;
614
+ if (i) e = "UTC";
615
+ else if (r) {
616
+ let t = r[1].charAt(0), n = parseInt(r[1].substring(1, 3), 10);
617
+ parseInt(r[1].substring(4, 6), 10) === 0 && (e = n === 0 ? "UTC" : `Etc/GMT${t === "+" ? "-" : "+"}${n}`);
618
+ }
619
+ if (e) try {
620
+ return new Intl.DateTimeFormat(n, {
621
+ ...t,
622
+ timeZone: e
623
+ }).format(a);
624
+ } catch {}
625
+ if (r) {
626
+ let e = r[1].charAt(0) === "+" ? 1 : -1, i = parseInt(r[1].substring(1, 3), 10), o = parseInt(r[1].substring(4, 6), 10), s = e * (i * 60 + o) * 60 * 1e3;
627
+ return new Intl.DateTimeFormat(n, {
628
+ ...t,
629
+ timeZone: "UTC"
630
+ }).format(new Date(a.getTime() + s));
631
+ }
632
+ }
633
+ return new Intl.DateTimeFormat(n, t).format(a);
634
+ }
635
+ function pt(e) {
636
+ return ft(e, {
637
+ day: "2-digit",
638
+ month: "2-digit",
639
+ year: "numeric",
640
+ hour: "2-digit",
641
+ minute: "2-digit",
642
+ hour12: !1
643
+ }, "en-GB").replace(/\//g, "-").replace(",", "");
644
+ }
645
+ function mt(e, t, n = /* @__PURE__ */ new Date()) {
646
+ if (t == null || t === "") return {
647
+ text: "—",
648
+ absolute: ""
649
+ };
650
+ let r = t instanceof Date ? t : new Date(String(t));
651
+ if (isNaN(r.getTime())) {
652
+ let e = String(t);
653
+ return {
654
+ text: e,
655
+ absolute: e
656
+ };
657
+ }
658
+ let i = pt(typeof t == "string" ? t : r.toISOString()), a = n.getTime() - r.getTime();
659
+ return Math.abs(a) > 2592e6 ? {
660
+ text: d(r, { representation: "date" }),
661
+ absolute: i
662
+ } : {
663
+ text: _t(e, r, n),
664
+ absolute: i
665
+ };
666
+ }
667
+ var ht = [
668
+ {
669
+ unit: "second",
670
+ ms: 1e3,
671
+ limit: 60
672
+ },
673
+ {
674
+ unit: "minute",
675
+ ms: 6e4,
676
+ limit: 60
677
+ },
678
+ {
679
+ unit: "hour",
680
+ ms: 36e5,
681
+ limit: 24
682
+ }
683
+ ], gt = 864e5;
684
+ function _t(e, t, n) {
685
+ let r = t.getTime() - n.getTime(), i = new Intl.RelativeTimeFormat(e, { numeric: "always" }), a = (e) => r > 0 ? e : -e;
686
+ for (let { unit: e, ms: t, limit: n } of ht) {
687
+ let o = Math.round(Math.abs(r) / t);
688
+ if (o < n) return i.format(a(o), e);
689
+ }
690
+ return i.format(a(Math.round(Math.abs(r) / gt)), "day");
691
+ }
692
+ var vt = "$display";
693
+ function yt(e, t, n) {
694
+ if (!t) return;
695
+ let r = t[vt];
696
+ if (typeof r == "string" && r !== "") return r;
697
+ let i = n?.display?.display_field;
698
+ if (!i) return;
699
+ let a = t[i];
700
+ if (a == null) return;
701
+ let o = n?.fields?.get(i);
702
+ if (o?.type === "timestamp" && typeof a == "string" && a !== "") return pt(a);
703
+ let s = o?.values;
704
+ if (s && (typeof a == "string" || typeof a == "number")) {
705
+ let t = s.find((e) => e.code === String(a));
706
+ if (t) {
707
+ let n = e(t.name);
708
+ if (n) return n;
709
+ }
710
+ }
711
+ return typeof a == "object" && !Array.isArray(a) ? e(a) || void 0 : G(a);
712
+ }
713
+ function bt(e, t, n, r) {
714
+ if (!n) return r;
715
+ let i = t[n];
716
+ return i == null ? r : typeof i == "object" && !Array.isArray(i) ? e(i) || r : G(i);
717
+ }
718
+ function xt(e) {
719
+ let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
720
+ return RegExp("^" + t.join("/") + "$");
721
+ }
722
+ function St(e) {
723
+ let t = (() => {
724
+ try {
725
+ return decodeURIComponent(e);
726
+ } catch {
727
+ return e;
728
+ }
729
+ })().split("-")[0];
730
+ return t.length > 8 ? t.slice(0, 8) : t;
731
+ }
732
+ function Ct(e, t, n, r) {
733
+ if (!n) return;
734
+ let i = t.replace(/\/+$/, "") || "/", a;
735
+ for (let t of Object.values(n)) {
736
+ if (!t.route || !xt(t.route).test(i)) continue;
737
+ let n = t.route.includes("/:"), o = e(t.display?.name);
738
+ if (!o && !n && r && t.entity && (o = e(r[t.entity]?.display?.name_plural)), !o && n && r && t.entity) {
739
+ let n = e(r[t.entity]?.display?.name);
740
+ if (n) {
741
+ let e = i.slice(i.lastIndexOf("/") + 1);
742
+ o = e ? `${n} ${St(e)}` : n;
743
+ }
744
+ }
745
+ if (!o) continue;
746
+ let s = {
747
+ title: o,
748
+ icon: t.display?.icon,
749
+ exact: !n
750
+ };
751
+ if (!n) return s;
752
+ a ??= s;
753
+ }
754
+ return a;
755
+ }
756
+ function wt(e, t, n, r) {
757
+ let i = e(t.display?.name);
758
+ if (i) return i;
759
+ if (t.type === "ref" && t.ref?.entity && r) {
760
+ let n = r[t.ref.entity];
761
+ if (n) {
762
+ let t = e(n.display?.name);
763
+ if (t) return t;
764
+ }
765
+ }
766
+ return n;
767
+ }
768
+ function Tt(e) {
769
+ if (e != null) return typeof e == "string" ? { entity: e } : e;
770
+ }
771
+ function Et(e, t) {
772
+ let n = e ?? [];
773
+ if (!t) return n;
774
+ switch (t.mode ?? "append") {
775
+ case "replace": return t.values ?? [];
776
+ case "clear": return [];
777
+ default: return [...n, ...t.values ?? []];
778
+ }
779
+ }
780
+ function Dt(e) {
781
+ let t = e.name, n = e.display ? {
782
+ ...e.display,
783
+ name: e.display.name ?? t
784
+ } : { name: t };
785
+ return {
786
+ type: e.type,
787
+ display: n,
788
+ values: e.values,
789
+ ref: e.ref,
790
+ structure: e.structure
791
+ };
792
+ }
793
+ function Ot(e, t) {
794
+ return !e || e.readonly ? !1 : e.mutations?.[t] ?? !0;
795
+ }
796
+ function kt(e) {
797
+ return !e?.disable_defaults?.includes("__new");
798
+ }
799
+ function K(e) {
800
+ if (e.primary_key && e.primary_key.length > 0) return e.primary_key;
801
+ for (let [t, n] of e.fields) if (n.primary) return [t];
802
+ return ["id"];
803
+ }
804
+ function At(e, t) {
805
+ let n = K(e), r = {};
806
+ for (let e of n) r[e] = G(t[e]);
807
+ return r;
808
+ }
809
+ function jt(e) {
810
+ return e.length === 1 ? e[0] : JSON.stringify(e);
811
+ }
812
+ function Mt(e) {
813
+ return jt(Object.values(e));
814
+ }
815
+ function Nt(e, t) {
816
+ return jt(K(e).map((e) => t[e] ?? ""));
817
+ }
818
+ function Pt(e, t) {
819
+ let n = K(e);
820
+ if (n.length === 1) return { [n[0]]: t };
821
+ }
822
+ function Ft(e, t) {
823
+ if (t <= 1) return [e];
824
+ try {
825
+ let n = JSON.parse(e);
826
+ if (Array.isArray(n) && n.length === t && n.every((e) => typeof e == "string")) return n;
827
+ } catch {
828
+ return null;
829
+ }
830
+ return null;
831
+ }
832
+ function It(e, t, n) {
833
+ if (e?.detail_screen === "none") return null;
834
+ let r = e?.detail_screen ?? t?.detail_screen;
835
+ return r ? n?.[r]?.route ?? null : null;
836
+ }
837
+ function Lt(e, t, n, r) {
838
+ if (!t) return null;
839
+ let i = It(e, n, r);
840
+ return i ? i.replace(":id", encodeURIComponent(t)) : null;
841
+ }
842
+ function Rt(e, t, n, r) {
843
+ return !t || K(t).some((e) => !r[e]) ? null : Lt(e, Nt(t, r), t, n);
844
+ }
845
+ function zt(e, t, n, r) {
846
+ return t ? Rt(e, t, n, At(t, r)) : null;
847
+ }
848
+ function Bt(e) {
849
+ return K(e).length > 1;
850
+ }
851
+ //#endregion
852
+ //#region src/api/schema.ts
853
+ function Vt(e) {
854
+ return {
855
+ ...e,
856
+ params: e.params ? W.fromWire(e.params) : void 0
857
+ };
858
+ }
859
+ function Ht(e) {
860
+ return {
861
+ ...e,
862
+ resolved_params: e.resolved_params ? W.fromWire(e.resolved_params) : void 0
863
+ };
864
+ }
865
+ function Ut(e) {
866
+ let t = {};
867
+ if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = Vt(r);
868
+ let n = {};
869
+ if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = Ht(r);
870
+ return {
871
+ ...e,
872
+ fields: W.fromWire(e.fields),
873
+ files: e.files ? W.fromWire(e.files) : void 0,
874
+ variants: e.variants ? W.fromWire(e.variants) : void 0,
875
+ handlers: e.handlers ? t : void 0,
876
+ actions: e.actions ? n : void 0
877
+ };
878
+ }
879
+ function Wt(e) {
880
+ let t = {};
881
+ if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = Ut(r);
882
+ let n = {};
883
+ if (e.structures) for (let [t, r] of Object.entries(e.structures)) n[t] = {
884
+ ...r,
885
+ fields: W.fromWire(r.fields)
886
+ };
887
+ let r = {};
888
+ if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = Vt(n);
889
+ let i = {};
890
+ if (e.actions) for (let [t, n] of Object.entries(e.actions)) i[t] = Ht(n);
891
+ let a = { ...e.screens };
892
+ for (let [e, t] of Object.entries(a)) {
893
+ let n = t;
894
+ a[e] = {
895
+ ...t,
896
+ variants: n.variants ? W.fromWire(n.variants) : void 0
897
+ };
898
+ }
899
+ return {
900
+ ...e,
901
+ entities: t,
902
+ structures: n,
903
+ handlers: r,
904
+ actions: i,
905
+ screens: a
906
+ };
907
+ }
908
+ async function Gt() {
909
+ let e = nt(), t = Wt(await H("/api/schema", { cache: "no-cache" }));
910
+ return rt(e, t.language), t;
911
+ }
912
+ //#endregion
913
+ //#region src/lib/html-state.ts
914
+ function Kt(e) {
915
+ typeof document < "u" && (document.documentElement.dataset.viewport = e);
916
+ }
917
+ function qt(e) {
918
+ typeof document < "u" && (document.documentElement.dataset.embed = e ? "true" : "false");
919
+ }
920
+ //#endregion
921
+ //#region src/embed/params.ts
922
+ var Jt = "self", Yt = "embed", Xt = "parent_origin", Zt = "theme", Qt = [
923
+ Yt,
924
+ Xt,
925
+ Zt,
926
+ "nav"
927
+ ];
928
+ function $t(e) {
929
+ if (!e) return null;
930
+ let t;
931
+ try {
932
+ t = new URL(e);
933
+ } catch {
934
+ return null;
935
+ }
936
+ return t.origin === "null" ? null : e === t.origin ? t.origin : null;
937
+ }
938
+ function en(e) {
939
+ return e === "light" || e === "dark" ? e : null;
940
+ }
941
+ function tn(e) {
942
+ return e === "delegated" ? "delegated" : Jt;
943
+ }
944
+ function nn(e) {
945
+ let t = typeof e == "string" ? new URLSearchParams(e) : e;
946
+ return {
947
+ enabled: t.get(Yt) === "1",
948
+ parentOrigin: $t(t.get(Xt)),
949
+ theme: en(t.get(Zt)),
950
+ navigationMode: tn(t.get("nav"))
951
+ };
952
+ }
953
+ function rn(e, t) {
954
+ if (!t.enabled) return e;
955
+ let n = /^[a-z][a-z0-9+.-]*:/i.test(e), r;
956
+ try {
957
+ r = new URL(e, "http://embed.invalid");
958
+ } catch {
959
+ return e;
960
+ }
961
+ let i = r.searchParams;
962
+ return t.enabled && i.set(Yt, "1"), t.parentOrigin && i.set(Xt, t.parentOrigin), t.theme && i.set(Zt, t.theme), i.set("nav", t.navigationMode), n ? r.toString() : `${r.pathname}${r.search}${r.hash}`;
963
+ }
964
+ //#endregion
965
+ //#region src/embed/EmbedContext.tsx
966
+ var an = n({
967
+ enabled: !1,
968
+ parentOrigin: null,
969
+ theme: null,
970
+ navigationMode: "self",
971
+ appendEmbedParams: (e) => e
972
+ });
973
+ function on(e) {
974
+ return {
975
+ enabled: e.enabled,
976
+ parentOrigin: e.parentOrigin,
977
+ theme: e.theme,
978
+ navigationMode: e.navigationMode,
979
+ appendEmbedParams: (t) => rn(t, e)
980
+ };
981
+ }
982
+ function sn({ children: e, query: t }) {
983
+ let n = s(() => on(nn(t ?? (typeof window < "u" ? window.location.search : ""))), [t]);
984
+ return o(() => {
985
+ qt(n.enabled);
986
+ }, [n.enabled]), /* @__PURE__ */ f(an.Provider, {
987
+ value: n,
988
+ children: e
989
+ });
990
+ }
991
+ function q() {
992
+ return a(an);
993
+ }
994
+ //#endregion
995
+ //#region src/api/auth.ts
996
+ async function cn() {
997
+ return U("auth.check_setup");
998
+ }
999
+ async function ln(e, t, n = !0) {
1000
+ let r = await U("auth.login", {
1001
+ email: e,
1002
+ password: t,
1003
+ remember: n
1004
+ });
1005
+ return R(r.expires_at), r;
1006
+ }
1007
+ async function un(e, t, n) {
1008
+ let r = await U("auth.signup", {
1009
+ email: e,
1010
+ password: t,
1011
+ display_name: n
1012
+ });
1013
+ return R(r.expires_at), r;
1014
+ }
1015
+ async function dn() {
1016
+ return U("auth.me");
1017
+ }
1018
+ async function fn() {
1019
+ return (await U("auth.list_tenants")).tenants;
1020
+ }
1021
+ async function pn(e) {
1022
+ let t = await U("auth.switch_tenant", { tenant_id: e });
1023
+ return R(t.expires_at), t;
1024
+ }
1025
+ async function mn() {
1026
+ await U("auth.logout");
1027
+ }
1028
+ async function hn(e) {
1029
+ return (await U("sso_provider.list", e ? { tenant_code: e } : {})).providers;
1030
+ }
1031
+ function gn(e, t, n) {
1032
+ let r = new URLSearchParams();
1033
+ t && r.set("tenant", t), n && r.set("redirect", n);
1034
+ let i = r.toString();
1035
+ return `/api/auth/sso/authorize/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
1036
+ }
1037
+ async function _n(e, t, n) {
1038
+ let r = {
1039
+ target_user_id: e,
1040
+ reason: t
1041
+ };
1042
+ return n != null && (r.duration_minutes = n), U("impersonation.start", r);
1043
+ }
1044
+ async function vn() {
1045
+ return U("impersonation.stop");
1046
+ }
1047
+ async function yn(e) {
1048
+ await U("impersonation.revoke", { session_id: e });
1049
+ }
1050
+ async function bn(e, t) {
1051
+ await U("auth.change_password", {
1052
+ current_password: e,
1053
+ new_password: t
1054
+ });
1055
+ }
1056
+ //#endregion
1057
+ //#region src/stores/auth.ts
1058
+ var xn = m((e) => ({
1059
+ user: null,
1060
+ isAuthenticated: !1,
1061
+ isLoading: !0,
1062
+ activeTenant: null,
1063
+ tenants: [],
1064
+ initialize: async () => {
1065
+ try {
1066
+ let t = await dn(), n = t.tenant ?? null, r = [];
1067
+ try {
1068
+ r = await fn();
1069
+ } catch {}
1070
+ e({
1071
+ user: t,
1072
+ isAuthenticated: !0,
1073
+ isLoading: !1,
1074
+ activeTenant: n,
1075
+ tenants: r
1076
+ });
1077
+ } catch {
1078
+ e({
1079
+ user: null,
1080
+ isAuthenticated: !1,
1081
+ isLoading: !1
1082
+ });
1083
+ }
1084
+ },
1085
+ refreshMe: async () => {
1086
+ try {
1087
+ let t = await dn();
1088
+ e({
1089
+ user: t,
1090
+ activeTenant: t.tenant ?? null
1091
+ });
1092
+ } catch {}
1093
+ },
1094
+ setUser: (t, n) => {
1095
+ e({
1096
+ user: t,
1097
+ isAuthenticated: !0,
1098
+ isLoading: !1,
1099
+ activeTenant: n ?? null
1100
+ });
1101
+ },
1102
+ setTenants: (t) => {
1103
+ e({ tenants: t });
1104
+ },
1105
+ setActiveTenant: (t) => {
1106
+ e({ activeTenant: t });
1107
+ },
1108
+ logout: async () => {
1109
+ Ke();
1110
+ try {
1111
+ await mn();
1112
+ } catch {}
1113
+ e({
1114
+ user: null,
1115
+ isAuthenticated: !1,
1116
+ activeTenant: null,
1117
+ tenants: []
1118
+ });
1119
+ }
1120
+ }));
1121
+ xn.subscribe((e, t) => {
1122
+ e.isAuthenticated !== t.isAuthenticated && tt(null);
1123
+ });
1124
+ //#endregion
1125
+ //#region src/hooks/useSchema.ts
1126
+ function J() {
1127
+ let e = xn((e) => e.isAuthenticated), t = q().enabled;
1128
+ return u({
1129
+ queryKey: ["schema", e],
1130
+ queryFn: Gt,
1131
+ staleTime: Infinity,
1132
+ enabled: e || !t
1133
+ });
1134
+ }
1135
+ //#endregion
1136
+ //#region src/lib/language.ts
1137
+ var Sn = "en", Cn = "ui_language";
1138
+ function wn(e, t, n) {
1139
+ if (e) for (let r of [
1140
+ t,
1141
+ n,
1142
+ "en"
1143
+ ]) {
1144
+ let t = e[r];
1145
+ if (t) return [r, t];
1146
+ }
1147
+ }
1148
+ function Tn(e, t, n) {
1149
+ return wn(e, t, n)?.[1];
1150
+ }
1151
+ function En(e, t, n) {
1152
+ function r(r, i, a) {
1153
+ if (typeof r != "string") return Tn(r, t, n) ?? "";
1154
+ let o = Tn(e?.[r], t, n) ?? i ?? "";
1155
+ return a ? o.replace(/\{(\w+)\}/g, (e, t) => Object.hasOwn(a, t) ? String(a[t]) : e) : o;
1156
+ }
1157
+ return Object.assign(r, {
1158
+ language: t,
1159
+ deploymentLanguage: n
1160
+ });
1161
+ }
1162
+ function Dn(e, t, n, r, i) {
1163
+ let a = new Intl.PluralRules(e.language).select(n), o = {
1164
+ ...i,
1165
+ count: new Intl.NumberFormat(e.language).format(n)
1166
+ };
1167
+ return e(`${t}.${a}`, "", o) || e(`${t}.other`, a === "one" ? r.one : r.other, o);
1168
+ }
1169
+ function On(e, n) {
1170
+ return e.split(/(\{[A-Za-z_][A-Za-z0-9_]*\})/).filter((e) => e !== "").map((e, i) => {
1171
+ let a = /^\{(\w+)\}$/.exec(e)?.[1];
1172
+ return r(t, { key: i }, a !== void 0 && Object.hasOwn(n, a) ? n[a] : e);
1173
+ });
1174
+ }
1175
+ //#endregion
1176
+ //#region src/hooks/useLanguage.ts
1177
+ function kn() {
1178
+ let { data: e } = J();
1179
+ return e?.language || "en";
1180
+ }
1181
+ function An() {
1182
+ let { data: e } = J();
1183
+ return e?.deployment_language || "en";
1184
+ }
1185
+ async function jn(e) {
1186
+ let t = it();
1187
+ tt(null), await e.refetchQueries({
1188
+ queryKey: ["schema"],
1189
+ type: "active"
1190
+ }), it() !== t && await e.invalidateQueries({ predicate: (e) => e.queryKey[0] !== "schema" });
1191
+ }
1192
+ //#endregion
1193
+ //#region src/hooks/useText.ts
1194
+ function Mn(e = "messages") {
1195
+ let { data: t } = J(), n = kn(), r = An(), i = e === "errors" ? t?.errors : t?.messages;
1196
+ return s(() => En(i, n, r), [
1197
+ i,
1198
+ n,
1199
+ r
1200
+ ]);
1201
+ }
1202
+ //#endregion
1203
+ //#region src/lib/viewport-category.ts
1204
+ var Nn = {
1205
+ phoneMax: 639,
1206
+ tabletMax: 1023,
1207
+ landscapePhoneMaxHeight: 520
1208
+ };
1209
+ function Pn(e, t = Nn) {
1210
+ let { width: n, height: r, touch: i = !1 } = e;
1211
+ return !Number.isFinite(n) || n <= 0 ? "desktop" : n <= t.phoneMax ? "phone" : n <= t.tabletMax ? i && Number.isFinite(r) && r > 0 && r <= t.landscapePhoneMaxHeight ? "phone" : "tablet" : "desktop";
1212
+ }
1213
+ //#endregion
1214
+ //#region src/hooks/useResponsiveMode.tsx
1215
+ var Y = {
1216
+ width: 1280,
1217
+ height: 720
1218
+ }, Fn = n({
1219
+ ...Y,
1220
+ category: "desktop",
1221
+ isPhone: !1,
1222
+ isTablet: !1,
1223
+ isDesktop: !0,
1224
+ touch: !1
1225
+ });
1226
+ function In(e) {
1227
+ return {
1228
+ width: Number.isFinite(e.width) && e.width > 0 ? e.width : Y.width,
1229
+ height: Number.isFinite(e.height) && e.height > 0 ? e.height : Y.height,
1230
+ touch: e.touch ?? !1
1231
+ };
1232
+ }
1233
+ function Ln() {
1234
+ if (typeof window > "u") return !1;
1235
+ let e = window.matchMedia?.("(pointer: coarse)")?.matches ?? !1, t = window.navigator?.maxTouchPoints ?? 0;
1236
+ return e || t > 0;
1237
+ }
1238
+ function Rn() {
1239
+ if (typeof window > "u") return Y;
1240
+ let e = window.visualViewport;
1241
+ return In({
1242
+ width: e?.width ?? window.innerWidth,
1243
+ height: e?.height ?? window.innerHeight,
1244
+ touch: Ln()
1245
+ });
1246
+ }
1247
+ function zn(e, t, n) {
1248
+ if (typeof document > "u") return;
1249
+ let r = document.documentElement;
1250
+ r.style.setProperty("--app-viewport-width", `${Math.round(e.width)}px`), r.style.setProperty("--app-viewport-height", `${Math.round(e.height)}px`), r.style.setProperty("--app-height", `${Math.round(e.height)}px`);
1251
+ let i = t === "phone" || e.height <= n.landscapePhoneMaxHeight;
1252
+ r.style.setProperty("--control-height", i ? "38px" : "30px"), r.style.setProperty("--control-line-height", i ? "36px" : "28px"), r.style.setProperty("--control-font-size", i ? "16px" : "12.5px");
1253
+ }
1254
+ function Bn({ children: e, breakpoints: t = Nn, viewportOverride: n, viewport: r = "auto" }) {
1255
+ let [i, a] = l(() => In(n ?? Rn())), c = r === "auto" ? Pn(i, t) : r;
1256
+ o(() => {
1257
+ if (n) {
1258
+ let e = In(n);
1259
+ a(e), zn(e, c, t);
1260
+ return;
1261
+ }
1262
+ let e = () => {
1263
+ let e = Rn();
1264
+ a(e), zn(e, c, t);
1265
+ };
1266
+ return e(), window.addEventListener("resize", e), window.addEventListener("orientationchange", e), window.visualViewport?.addEventListener("resize", e), window.visualViewport?.addEventListener("scroll", e), () => {
1267
+ window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e), window.visualViewport?.removeEventListener("resize", e), window.visualViewport?.removeEventListener("scroll", e);
1268
+ };
1269
+ }, [
1270
+ n,
1271
+ c,
1272
+ t
1273
+ ]), o(() => {
1274
+ Kt(c);
1275
+ }, [c]);
1276
+ let u = s(() => ({
1277
+ ...i,
1278
+ category: c,
1279
+ isPhone: c === "phone",
1280
+ isTablet: c === "tablet",
1281
+ isDesktop: c === "desktop",
1282
+ touch: i.touch ?? !1
1283
+ }), [c, i]);
1284
+ return /* @__PURE__ */ f(Fn.Provider, {
1285
+ value: u,
1286
+ children: e
1287
+ });
1288
+ }
1289
+ function Vn() {
1290
+ return a(Fn);
1291
+ }
1292
+ //#endregion
1293
+ //#region src/api/data.ts
1294
+ function Hn(e, t) {
1295
+ let n = new URL(`/api/data/${e}`, window.location.origin);
1296
+ if (t.page && n.searchParams.set("page", String(t.page)), t.per_page && n.searchParams.set("per_page", String(t.per_page)), t.sort && n.searchParams.set("sort", t.sort), t.search && n.searchParams.set("search", t.search), t.filters && t.filters.length > 0 && n.searchParams.set("filters", JSON.stringify(t.filters)), t.include_deleted && n.searchParams.set("include_deleted", "true"), t.expand) for (let e of t.expand) n.searchParams.append("expand", e);
1297
+ return t.select && t.select.length > 0 && n.searchParams.set("select", t.select.join(",")), t.screen && n.searchParams.set("screen", t.screen), t.preview && n.searchParams.set("preview", "true"), t.count && n.searchParams.set("count", t.count), n.pathname + n.search;
1298
+ }
1299
+ async function Un(e, t = {}, n = {}) {
1300
+ if (rr) {
1301
+ let n = rr(e, t);
1302
+ if (n !== void 0) return n;
1303
+ }
1304
+ return H(Hn(e, t), { signal: n.signal });
1305
+ }
1306
+ async function Wn(e, t, n = {}) {
1307
+ if (ir) {
1308
+ let n = ir(e, t);
1309
+ if (n !== void 0) return n;
1310
+ }
1311
+ let r = new URLSearchParams();
1312
+ if (typeof t == "string") r.set("id", t);
1313
+ else for (let [e, n] of Object.entries(t)) r.set(e, n);
1314
+ return n.expand?.length && r.set("expand", n.expand.join(",")), H(`/api/data/${e}?${r.toString()}`);
1315
+ }
1316
+ async function Gn(e, t) {
1317
+ return { data: ((await X(`${e}.__create`, {
1318
+ entity: e,
1319
+ fields: t
1320
+ })).result?.rows ?? [])[0] };
1321
+ }
1322
+ async function Kn(e, t, n) {
1323
+ let r = typeof t == "string" ? t : Jn(t);
1324
+ return { data: ((await X(`${e}.__update`, {
1325
+ object_ids: [r],
1326
+ entity: e,
1327
+ fields: n
1328
+ })).result?.rows ?? [])[0] };
1329
+ }
1330
+ async function qn(e, t) {
1331
+ let n = typeof t == "string" ? t : Jn(t);
1332
+ await X(`${e}.__delete`, {
1333
+ object_ids: [n],
1334
+ entity: e
1335
+ });
1336
+ }
1337
+ function Jn(e) {
1338
+ let t = Object.values(e);
1339
+ return t.length === 1 ? t[0] : t.join("");
1340
+ }
1341
+ async function Yn(e, t) {
1342
+ let n = typeof t == "string" ? t : Jn(t);
1343
+ await X(`${e}.__restore`, {
1344
+ object_ids: [n],
1345
+ entity: e
1346
+ });
1347
+ }
1348
+ async function Xn(e, t) {
1349
+ let n = await lt(`/api/data/${e}/export`, {
1350
+ method: "POST",
1351
+ body: JSON.stringify(t)
1352
+ });
1353
+ return {
1354
+ blob: n.blob,
1355
+ filename: n.filename
1356
+ };
1357
+ }
1358
+ function Zn(e) {
1359
+ return !!e && ((e.failed_count ?? 0) > 0 || (e.timed_out_count ?? 0) > 0);
1360
+ }
1361
+ var Qn = class extends Error {
1362
+ status;
1363
+ response;
1364
+ constructor(e, t) {
1365
+ super(t.errors?.[0]?.error?.title ?? ""), this.name = "ActionBatchError", this.status = e, this.response = t;
1366
+ }
1367
+ };
1368
+ function $n(e) {
1369
+ if (!e || typeof e != "object") return !1;
1370
+ let t = e;
1371
+ return typeof t.status == "string" && Array.isArray(t.errors);
1372
+ }
1373
+ function er(e, t) {
1374
+ let n = { ...e ?? {} };
1375
+ if ("object_ids" in n) throw Error("handler param \"object_ids\" collides with reserved key");
1376
+ return t !== void 0 && (n.object_ids = t), n;
1377
+ }
1378
+ var tr = null;
1379
+ function nr(e) {
1380
+ let t = tr;
1381
+ return tr = e, t;
1382
+ }
1383
+ var rr = null, ir = null;
1384
+ function ar(e) {
1385
+ let t = rr;
1386
+ return rr = e, t;
1387
+ }
1388
+ function or(e) {
1389
+ let t = ir;
1390
+ return ir = e, t;
1391
+ }
1392
+ async function X(e, t) {
1393
+ if (tr) return tr(e, t);
1394
+ try {
1395
+ return await H(`/api/actions/${e}`, {
1396
+ method: "POST",
1397
+ body: JSON.stringify(t)
1398
+ });
1399
+ } catch (e) {
1400
+ throw e instanceof _ && $n(e.raw) ? new Qn(e.status, e.raw) : e;
1401
+ }
1402
+ }
1403
+ async function sr(e, t) {
1404
+ let n = new URLSearchParams();
1405
+ return n.set("ids", t.join(",")), H(`/api/associations/${e}?${n.toString()}`);
1406
+ }
1407
+ //#endregion
1408
+ //#region src/lib/safe-url.ts
1409
+ var cr = [
1410
+ "http:",
1411
+ "https:",
1412
+ "mailto:"
1413
+ ], lr = /[\u0000-\u001f\u007f]/g;
1414
+ function ur(e) {
1415
+ if (!e) return;
1416
+ let t = e.trim();
1417
+ if (!t) return;
1418
+ let n = t.replace(lr, "");
1419
+ if (!n || n.startsWith("//")) return;
1420
+ let r = n.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/);
1421
+ if (r) {
1422
+ let e = r[1].toLowerCase() + ":";
1423
+ if (!cr.includes(e)) return;
1424
+ }
1425
+ return n;
1426
+ }
1427
+ function dr(e) {
1428
+ if (!e) return !1;
1429
+ if (e.startsWith("//")) return !0;
1430
+ let t = typeof window < "u" ? window.location.href : "http://localhost/", n;
1431
+ try {
1432
+ n = new URL(e, t);
1433
+ } catch {
1434
+ return !1;
1435
+ }
1436
+ if (n.protocol !== "http:" && n.protocol !== "https:") return !0;
1437
+ let r = typeof window < "u" ? window.location.origin : "http://localhost";
1438
+ return n.origin !== r;
1439
+ }
1440
+ //#endregion
1441
+ //#region src/lib/download.ts
1442
+ var fr = class extends Error {
1443
+ code;
1444
+ constructor(e, t) {
1445
+ super(e), this.code = t, this.name = "DownloadError";
1446
+ }
1447
+ };
1448
+ function pr(e) {
1449
+ return e instanceof fr && e.code === "file.not_found";
1450
+ }
1451
+ async function mr(e, t, n) {
1452
+ let r = ur(t);
1453
+ if (!r) throw new fr(e("file.download_url_unsafe", "This download address is not allowed."));
1454
+ let i = await fetch(at(r), { credentials: "same-origin" });
1455
+ if (!i.ok) {
1456
+ let t = await gr(i);
1457
+ throw new fr(t.message || e("file.download_failed", "The file could not be downloaded."), t.code);
1458
+ }
1459
+ hr(await i.blob(), n);
1460
+ }
1461
+ function hr(e, t) {
1462
+ let n = URL.createObjectURL(e), r = document.createElement("a");
1463
+ r.href = n, t && (r.download = t), document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 0);
1464
+ }
1465
+ async function gr(e) {
1466
+ try {
1467
+ let t = JSON.parse(await e.text());
1468
+ if (y(t)) return {
1469
+ code: v(t.type),
1470
+ message: t.title
1471
+ };
1472
+ } catch {
1473
+ return {};
1474
+ }
1475
+ return {};
1476
+ }
1477
+ //#endregion
1478
+ //#region src/lib/failure.ts
1479
+ function _r(e, t) {
1480
+ return t instanceof _ ? t.message || e(t.code, "") || e("platform.unavailable", "This service is temporarily unavailable.") : t instanceof Qn ? t.message || e("action.all_items_failed", "The action failed for every selected record.") : t instanceof fr ? t.message : e("platform.internal_error", "Something went wrong on our side.");
1481
+ }
1482
+ //#endregion
1483
+ //#region src/embed/embed-dirty.ts
1484
+ var vr = m((e) => ({
1485
+ isDirty: !1,
1486
+ setDirty: (t) => e((e) => e.isDirty === t ? e : { isDirty: t })
1487
+ }));
1488
+ function yr(e, t) {
1489
+ let n = vr((e) => e.setDirty);
1490
+ o(() => {
1491
+ t && n(e);
1492
+ }, [
1493
+ t,
1494
+ e,
1495
+ n
1496
+ ]), o(() => {
1497
+ if (t) return () => n(!1);
1498
+ }, [t, n]);
1499
+ }
1500
+ //#endregion
1501
+ //#region src/embed/embed-nav-guard.ts
1502
+ var br = m((e, t) => ({
1503
+ pendingNavigation: null,
1504
+ requestNavigation: (t) => e({ pendingNavigation: t }),
1505
+ confirmNavigation: () => {
1506
+ let n = t().pendingNavigation;
1507
+ e({ pendingNavigation: null }), n?.();
1508
+ },
1509
+ cancelNavigation: () => e({ pendingNavigation: null })
1510
+ }));
1511
+ //#endregion
1512
+ //#region src/embed/screen-location.ts
1513
+ function xr(e) {
1514
+ let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
1515
+ return RegExp("^" + t.join("/") + "$");
1516
+ }
1517
+ function Sr(e, t) {
1518
+ let n = e.replace(/\/+$/, "") || "/";
1519
+ if (!t) return {
1520
+ matched: !1,
1521
+ payload: { route: e }
1522
+ };
1523
+ let r, i, a, o;
1524
+ for (let [e, s] of Object.entries(t)) if (s.route && xr(s.route).test(n)) {
1525
+ if (s.route.includes("/:")) a || (a = s, o = e);
1526
+ else {
1527
+ r = s, i = e;
1528
+ break;
1529
+ }
1530
+ }
1531
+ let s = r ?? a, c = r ? i : o;
1532
+ if (!s || !c) return {
1533
+ matched: !1,
1534
+ payload: { route: e }
1535
+ };
1536
+ let l = {
1537
+ route: s.route,
1538
+ screenCode: c
1539
+ };
1540
+ if (s.entity && (l.entity = s.entity), s.route.includes("/:")) {
1541
+ let e = n.slice(n.lastIndexOf("/") + 1);
1542
+ e && (l.recordId = e);
1543
+ }
1544
+ return {
1545
+ matched: !0,
1546
+ screenCode: c,
1547
+ screenType: s.type,
1548
+ payload: l
1549
+ };
1550
+ }
1551
+ function Cr(e, t) {
1552
+ return Sr(e, t).payload;
1553
+ }
1554
+ //#endregion
1555
+ //#region src/embed/useEmbedNavigate.ts
1556
+ function wr(e) {
1557
+ let t = e.search(/[?#]/);
1558
+ return t === -1 ? e : e.slice(0, t);
1559
+ }
1560
+ function Tr() {
1561
+ let e = h(), t = ee(), n = q(), { data: r } = J();
1562
+ return i((i, a) => {
1563
+ if (!n.enabled) return e(i, a), !0;
1564
+ let o = r?.screens, s = Sr(wr(i), o), c = vr.getState().isDirty && wr(i) !== t.pathname;
1565
+ if (o && !s.matched) return D(n.parentOrigin, E.navigationFailed, {
1566
+ route: wr(i),
1567
+ reason: "unresolved"
1568
+ }), !1;
1569
+ if (n.navigationMode === "delegated") {
1570
+ let e = () => {
1571
+ D(n.parentOrigin, E.navigationRequested, s.payload);
1572
+ };
1573
+ return c ? (br.getState().requestNavigation(e), !1) : (e(), !1);
1574
+ }
1575
+ let l = () => {
1576
+ e(n.appendEmbedParams(i), a);
1577
+ };
1578
+ return c ? (br.getState().requestNavigation(l), !1) : (l(), !0);
1579
+ }, [
1580
+ e,
1581
+ t.pathname,
1582
+ n,
1583
+ r?.screens
1584
+ ]);
1585
+ }
1586
+ function Er() {
1587
+ let e = Tr();
1588
+ return i((t, n) => {
1589
+ e(t, n);
1590
+ }, [e]);
1591
+ }
1592
+ function Dr() {
1593
+ let e = h();
1594
+ return i(() => {
1595
+ let t = () => {
1596
+ e(-1);
1597
+ };
1598
+ vr.getState().isDirty ? br.getState().requestNavigation(t) : t();
1599
+ }, [e]);
1600
+ }
1601
+ function Or() {
1602
+ let e = q();
1603
+ return i((t, n) => {
1604
+ e.enabled && D(e.parentOrigin, E.navigationFailed, {
1605
+ route: t,
1606
+ reason: n
1607
+ });
1608
+ }, [e.enabled, e.parentOrigin]);
1609
+ }
1610
+ //#endregion
1611
+ //#region src/components/shared/toast/DeclarionToast.tsx
1612
+ var kr = {
1613
+ success: {
1614
+ tone: "success",
1615
+ defaultTitle: (e) => e("toast.title.success", "Success")
1616
+ },
1617
+ error: {
1618
+ tone: "danger",
1619
+ defaultTitle: (e) => e("toast.title.error", "Error")
1620
+ },
1621
+ warning: {
1622
+ tone: "warn",
1623
+ defaultTitle: (e) => e("toast.title.warning", "Warning")
1624
+ },
1625
+ info: {
1626
+ tone: "info",
1627
+ defaultTitle: (e) => e("toast.title.info", "Heads up")
1628
+ },
1629
+ loading: {
1630
+ tone: "info",
1631
+ defaultTitle: (e) => e("toast.title.loading", "Working…")
1632
+ }
1633
+ }, Ar = 200;
1634
+ function jr({ type: t }) {
1635
+ let n = { display: "flex" };
1636
+ if (t === "loading") return /* @__PURE__ */ f("span", {
1637
+ style: {
1638
+ ...n,
1639
+ animation: "dz-toast-spin 0.9s linear infinite"
1640
+ },
1641
+ children: /* @__PURE__ */ f(e.loader, { size: 11 })
1642
+ });
1643
+ let r = t === "success" ? e.check : t === "error" ? e.x : t === "warning" ? e.warning : e.info;
1644
+ return /* @__PURE__ */ f("span", {
1645
+ style: n,
1646
+ children: /* @__PURE__ */ f(r, { size: 11 })
1647
+ });
1648
+ }
1649
+ function Mr({ model: t, onClose: n }) {
1650
+ let r = Mn(), a = kr[t.type] ?? kr.info, s = a.tone, [u, d] = l(!1), [m, ee] = l(!1), [h, g] = l(!1), [_, v] = l(!1), [y, te] = l(1), b = c(t.duration), ne = c(!1), x = !t.sticky && t.duration > 0, S = i(() => {
1651
+ ne.current || (ne.current = !0, v(!0), window.setTimeout(n, Ar));
1652
+ }, [n]);
1653
+ o(() => {
1654
+ b.current = t.duration, te(1);
1655
+ }, [t.createdAt, t.duration]), o(() => {
1656
+ if (!x || u || _) return;
1657
+ let e = Date.now(), n = window.setTimeout(S, b.current), r = 0, i = () => {
1658
+ let n = b.current - (Date.now() - e);
1659
+ te(Math.max(0, n) / t.duration), n > 0 && (r = requestAnimationFrame(i));
1660
+ };
1661
+ return r = requestAnimationFrame(i), () => {
1662
+ window.clearTimeout(n), cancelAnimationFrame(r), b.current = Math.max(0, b.current - (Date.now() - e));
1663
+ };
1664
+ }, [
1665
+ x,
1666
+ u,
1667
+ _,
1668
+ t.duration,
1669
+ t.createdAt,
1670
+ S
1671
+ ]);
1672
+ let C = i(() => {
1673
+ let e = [
1674
+ t.title,
1675
+ t.message,
1676
+ t.requestId ? `request_id: ${t.requestId}` : null,
1677
+ t.details
1678
+ ].filter(Boolean).join("\n");
1679
+ navigator.clipboard?.writeText(e), ee(!0), window.setTimeout(() => ee(!1), 1500);
1680
+ }, [
1681
+ t.title,
1682
+ t.message,
1683
+ t.requestId,
1684
+ t.details
1685
+ ]), w = (e) => `var(--${s}${e})`, T = t.type === "error";
1686
+ return /* @__PURE__ */ p("div", {
1687
+ role: t.type === "error" ? "alert" : "status",
1688
+ "aria-live": t.type === "error" ? "assertive" : "polite",
1689
+ onMouseEnter: () => d(!0),
1690
+ onMouseLeave: () => d(!1),
1691
+ style: {
1692
+ width: "100%",
1693
+ background: "var(--surface)",
1694
+ border: `1px solid ${w("-border")}`,
1695
+ borderLeft: `3px solid ${w("")}`,
1696
+ borderRadius: 8,
1697
+ boxShadow: "var(--shadow-toast)",
1698
+ overflow: "hidden",
1699
+ position: "relative",
1700
+ animation: _ ? `dz-toast-out ${Ar}ms ease-in forwards` : "dz-toast-in 0.24s cubic-bezier(0.16, 1, 0.3, 1)"
1701
+ },
1702
+ children: [/* @__PURE__ */ p("div", {
1703
+ style: {
1704
+ display: "flex",
1705
+ padding: "10px 12px 11px 12px",
1706
+ gap: 10
1707
+ },
1708
+ children: [
1709
+ /* @__PURE__ */ f("div", {
1710
+ style: {
1711
+ width: 18,
1712
+ height: 18,
1713
+ marginTop: 1,
1714
+ flexShrink: 0,
1715
+ background: w("-soft"),
1716
+ borderRadius: 99,
1717
+ display: "flex",
1718
+ alignItems: "center",
1719
+ justifyContent: "center",
1720
+ color: w("")
1721
+ },
1722
+ children: /* @__PURE__ */ f(jr, { type: t.type })
1723
+ }),
1724
+ /* @__PURE__ */ p("div", {
1725
+ style: {
1726
+ flex: 1,
1727
+ minWidth: 0
1728
+ },
1729
+ children: [
1730
+ /* @__PURE__ */ p("div", {
1731
+ style: {
1732
+ display: "flex",
1733
+ alignItems: "baseline",
1734
+ gap: 6
1735
+ },
1736
+ children: [
1737
+ /* @__PURE__ */ f("div", {
1738
+ style: {
1739
+ fontSize: 12.5,
1740
+ fontWeight: 600,
1741
+ color: "var(--text)",
1742
+ letterSpacing: "-0.005em",
1743
+ userSelect: "text"
1744
+ },
1745
+ children: t.title || a.defaultTitle(r)
1746
+ }),
1747
+ (t.count ?? 0) > 1 && /* @__PURE__ */ p("span", {
1748
+ style: {
1749
+ background: w("-soft"),
1750
+ color: w(""),
1751
+ fontSize: 10,
1752
+ padding: "1px 6px",
1753
+ borderRadius: 99,
1754
+ fontWeight: 600,
1755
+ flexShrink: 0
1756
+ },
1757
+ children: ["×", t.count]
1758
+ }),
1759
+ t.requestId && /* @__PURE__ */ f("span", {
1760
+ className: "mono",
1761
+ style: {
1762
+ fontSize: 10,
1763
+ color: "var(--text-4)",
1764
+ marginLeft: "auto",
1765
+ userSelect: "text"
1766
+ },
1767
+ children: t.requestId
1768
+ })
1769
+ ]
1770
+ }),
1771
+ t.message && /* @__PURE__ */ f("div", {
1772
+ style: {
1773
+ fontSize: 12,
1774
+ color: "var(--text-2)",
1775
+ marginTop: 3,
1776
+ lineHeight: 1.5,
1777
+ userSelect: "text",
1778
+ cursor: "text",
1779
+ wordBreak: "break-word"
1780
+ },
1781
+ children: t.message
1782
+ }),
1783
+ t.details && /* @__PURE__ */ p("div", {
1784
+ style: { marginTop: 6 },
1785
+ children: [/* @__PURE__ */ p("button", {
1786
+ type: "button",
1787
+ onClick: () => g((e) => !e),
1788
+ style: {
1789
+ background: "transparent",
1790
+ border: 0,
1791
+ padding: 0,
1792
+ cursor: "pointer",
1793
+ color: "var(--text-3)",
1794
+ fontSize: 11,
1795
+ fontWeight: 500,
1796
+ display: "inline-flex",
1797
+ alignItems: "center",
1798
+ gap: 4
1799
+ },
1800
+ children: [/* @__PURE__ */ f(e.down, {
1801
+ size: 10,
1802
+ style: {
1803
+ transform: h ? "rotate(180deg)" : "none",
1804
+ transition: "transform .15s"
1805
+ }
1806
+ }), h ? r("toast.hide_details", "Hide details") : r("toast.show_details", "Show details")]
1807
+ }), h && /* @__PURE__ */ f("pre", {
1808
+ className: "mono",
1809
+ style: {
1810
+ margin: "6px 0 0 0",
1811
+ padding: "8px 10px",
1812
+ background: "var(--surface-2)",
1813
+ border: "1px solid var(--border)",
1814
+ borderRadius: 5,
1815
+ fontSize: 11,
1816
+ lineHeight: 1.5,
1817
+ color: "var(--text-2)",
1818
+ whiteSpace: "pre-wrap",
1819
+ wordBreak: "break-word",
1820
+ userSelect: "text",
1821
+ maxHeight: 200,
1822
+ overflow: "auto"
1823
+ },
1824
+ children: t.details
1825
+ })]
1826
+ }),
1827
+ (t.action || T) && /* @__PURE__ */ p("div", {
1828
+ style: {
1829
+ display: "flex",
1830
+ alignItems: "center",
1831
+ gap: 6,
1832
+ marginTop: 8
1833
+ },
1834
+ children: [t.action && /* @__PURE__ */ f("button", {
1835
+ type: "button",
1836
+ onClick: () => {
1837
+ t.action?.onClick(), S();
1838
+ },
1839
+ style: {
1840
+ background: w("-soft"),
1841
+ color: w(""),
1842
+ border: 0,
1843
+ padding: "4px 10px",
1844
+ borderRadius: 5,
1845
+ fontSize: 11.5,
1846
+ fontWeight: 600,
1847
+ cursor: "pointer"
1848
+ },
1849
+ children: t.action.label
1850
+ }), T && /* @__PURE__ */ p("button", {
1851
+ type: "button",
1852
+ onClick: C,
1853
+ title: r("toast.copy_error_message", "Copy error message"),
1854
+ "aria-label": r("toast.copy_error_message", "Copy error message"),
1855
+ style: {
1856
+ display: "inline-flex",
1857
+ alignItems: "center",
1858
+ gap: 4,
1859
+ background: "transparent",
1860
+ border: "1px solid var(--border)",
1861
+ padding: "3px 7px",
1862
+ borderRadius: 5,
1863
+ fontSize: 11,
1864
+ color: m ? "var(--success)" : "var(--text-3)",
1865
+ cursor: "pointer",
1866
+ fontWeight: 500
1867
+ },
1868
+ children: [f(m ? e.check : e.copy, { size: 11 }), m ? r("control.copied", "Copied") : r("control.copy", "Copy")]
1869
+ })]
1870
+ })
1871
+ ]
1872
+ }),
1873
+ /* @__PURE__ */ f("button", {
1874
+ type: "button",
1875
+ onClick: S,
1876
+ "aria-label": r("toast.dismiss", "Dismiss"),
1877
+ style: {
1878
+ width: 20,
1879
+ height: 20,
1880
+ padding: 0,
1881
+ marginTop: -1,
1882
+ flexShrink: 0,
1883
+ background: "transparent",
1884
+ border: 0,
1885
+ borderRadius: 4,
1886
+ cursor: "pointer",
1887
+ color: "var(--text-4)",
1888
+ display: "flex",
1889
+ alignItems: "center",
1890
+ justifyContent: "center"
1891
+ },
1892
+ children: /* @__PURE__ */ f(e.x, { size: 12 })
1893
+ })
1894
+ ]
1895
+ }), x && /* @__PURE__ */ f("div", {
1896
+ style: {
1897
+ position: "absolute",
1898
+ left: 0,
1899
+ right: 0,
1900
+ bottom: 0,
1901
+ height: 2
1902
+ },
1903
+ children: /* @__PURE__ */ f("div", { style: {
1904
+ height: "100%",
1905
+ width: `${y * 100}%`,
1906
+ background: w(""),
1907
+ opacity: .55,
1908
+ transition: u ? "none" : "width 0.1s linear"
1909
+ } })
1910
+ })]
1911
+ });
1912
+ }
1913
+ //#endregion
1914
+ //#region src/lib/toast.tsx
1915
+ var Nr = {
1916
+ success: 4e3,
1917
+ info: 6e3,
1918
+ warning: 8e3,
1919
+ error: 0,
1920
+ loading: 0
1921
+ }, Z = /* @__PURE__ */ new Map(), Pr = /* @__PURE__ */ new Map(), Fr = 0, Ir = () => `dz-${++Fr}`;
1922
+ function Lr(e) {
1923
+ g.custom(() => /* @__PURE__ */ f(Mr, {
1924
+ model: e,
1925
+ onClose: () => g.dismiss(e.id)
1926
+ }), {
1927
+ id: e.id,
1928
+ duration: Infinity,
1929
+ onDismiss: () => {
1930
+ Z.delete(String(e.id)), e.group && Pr.get(e.group) === e.id && Pr.delete(e.group);
1931
+ }
1932
+ });
1933
+ }
1934
+ function Q(e, t, n, r = {}) {
1935
+ if (r.group) {
1936
+ let e = Pr.get(r.group);
1937
+ if (e && Z.has(e)) {
1938
+ let r = Z.get(e), i = {
1939
+ ...r,
1940
+ title: t,
1941
+ message: n,
1942
+ count: (r.count ?? 1) + 1,
1943
+ createdAt: Date.now()
1944
+ };
1945
+ return Z.set(e, i), Lr(i), e;
1946
+ }
1947
+ }
1948
+ let i = r.id ?? Ir(), a = r.duration ?? Nr[e], o = {
1949
+ id: i,
1950
+ type: e,
1951
+ title: t,
1952
+ message: n,
1953
+ duration: a,
1954
+ sticky: r.sticky ?? a === 0,
1955
+ action: r.action,
1956
+ requestId: r.requestId,
1957
+ details: r.details,
1958
+ count: 1,
1959
+ createdAt: Date.now(),
1960
+ group: r.group
1961
+ };
1962
+ return Z.set(i, o), r.group && Pr.set(r.group, i), Lr(o), i;
1963
+ }
1964
+ function Rr(e, t) {
1965
+ let n = Z.get(e);
1966
+ if (!n) return;
1967
+ let r = t.type ?? n.type, i = t.duration ?? (t.type ? Nr[r] : n.duration), a = {
1968
+ ...n,
1969
+ ...t,
1970
+ type: r,
1971
+ duration: i,
1972
+ sticky: t.sticky ?? i === 0,
1973
+ createdAt: Date.now()
1974
+ };
1975
+ Z.set(e, a), Lr(a);
1976
+ }
1977
+ var zr = {
1978
+ success: (e, t, n) => Q("success", e, t, n),
1979
+ info: (e, t, n) => Q("info", e, t, n),
1980
+ warning: (e, t, n) => Q("warning", e, t, n),
1981
+ error: (e, t, n) => Q("error", e, t, n),
1982
+ loading: (e, t, n) => Q("loading", e, t, n),
1983
+ update: Rr,
1984
+ dismiss: (e) => g.dismiss(e),
1985
+ dismissAll: () => g.dismiss()
1986
+ }, Br = {
1987
+ __create: "create",
1988
+ __edit: "update",
1989
+ __delete: "delete",
1990
+ __restore: "restore"
1991
+ }, Vr = "__peek", Hr = "__open", Ur = "__edit";
1992
+ function Wr(e) {
1993
+ return e === "__peek" || e === "__open";
1994
+ }
1995
+ function Gr(e, t) {
1996
+ if (!e) return "";
1997
+ if (t) try {
1998
+ return Nt(t, At(t, e));
1999
+ } catch {}
2000
+ let n = e.id;
2001
+ return typeof n == "string" ? n : n == null ? "" : G(n);
2002
+ }
2003
+ function $(e, t) {
2004
+ if (!e || e.length === 0) return !0;
2005
+ for (let n of e) {
2006
+ if (n.status && n.status.length > 0) {
2007
+ let e = t.status;
2008
+ if (typeof e != "string" || !n.status.includes(e)) return !1;
2009
+ }
2010
+ if (n.field && !qr(n, t)) return !1;
2011
+ }
2012
+ return !0;
2013
+ }
2014
+ function Kr(e, t) {
2015
+ return t.startsWith("$status.") ? !Array.isArray(e.$statuses) : t.startsWith("$property.") ? !Array.isArray(e.$properties) : !1;
2016
+ }
2017
+ function qr(e, t) {
2018
+ if (Kr(t, e.field)) return !1;
2019
+ let n = Jr(t, e.field), r = e.op || "eq";
2020
+ if (r === "in" || r === "not_in") {
2021
+ let t = Array.isArray(e.value) ? e.value : [e.value], i = G(n), a = t.some((e) => G(e) === i);
2022
+ return r === "in" ? a : !a;
2023
+ }
2024
+ return typeof e.value == "boolean" && r === "eq" ? Xr(n) === e.value : typeof n == "number" && typeof e.value == "number" ? Zr(n, e.value, r) : Zr(G(n), G(e.value), r);
2025
+ }
2026
+ function Jr(e, t) {
2027
+ if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
2028
+ if (t.startsWith("$status.")) {
2029
+ let n = t.slice(8), r = e.$statuses;
2030
+ return Array.isArray(r) ? r.find((e) => !e || typeof e != "object" ? !1 : e.group_code === n)?.status_code : void 0;
2031
+ }
2032
+ if (t.startsWith("$property.")) {
2033
+ let n = t.slice(10), r = e.$properties;
2034
+ return Array.isArray(r) ? r.find((e) => !e || typeof e != "object" ? !1 : e.property_code === n)?.value : void 0;
2035
+ }
2036
+ }
2037
+ function Yr(e) {
2038
+ let t = null, n = (n, r) => {
2039
+ Object.prototype.hasOwnProperty.call(e, n) || (t === null && (t = { ...e }), t[n] = r);
2040
+ }, r = e.$statuses;
2041
+ if (Array.isArray(r)) for (let t of r) {
2042
+ if (!t || typeof t != "object") continue;
2043
+ let r = t.group_code;
2044
+ typeof r == "string" && n(`$status.${r}`, Jr(e, `$status.${r}`));
2045
+ }
2046
+ let i = e.$properties;
2047
+ if (Array.isArray(i)) for (let t of i) {
2048
+ if (!t || typeof t != "object") continue;
2049
+ let r = t.property_code;
2050
+ typeof r == "string" && n(`$property.${r}`, Jr(e, `$property.${r}`));
2051
+ }
2052
+ return t ?? e;
2053
+ }
2054
+ function Xr(e) {
2055
+ return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e !== "" : typeof e != "number" || e !== 0;
2056
+ }
2057
+ function Zr(e, t, n) {
2058
+ switch (n) {
2059
+ case "eq": return e === t;
2060
+ case "ne": return e !== t;
2061
+ case "gt": return e > t;
2062
+ case "gte":
2063
+ case "ge": return e >= t;
2064
+ case "lt": return e < t;
2065
+ case "lte":
2066
+ case "le": return e <= t;
2067
+ default: return !1;
2068
+ }
2069
+ }
2070
+ function Qr(e, t) {
2071
+ return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).map(([e, t]) => ({
2072
+ code: e,
2073
+ action: t
2074
+ })) : [];
2075
+ }
2076
+ function $r(e, t, n, r) {
2077
+ return !e && !r ? [] : t === void 0 ? Qr(e, n) : t.map((t) => {
2078
+ let n = e?.[t] ?? r?.[t];
2079
+ return n ? {
2080
+ code: t,
2081
+ action: n
2082
+ } : null;
2083
+ }).filter((e) => e !== null);
2084
+ }
2085
+ function ei(e, t) {
2086
+ return e.filter(({ code: e }) => {
2087
+ let n = Br[e];
2088
+ return !n || Ot(t, n);
2089
+ });
2090
+ }
2091
+ function ti(e) {
2092
+ return !!e?.confirmation && Object.keys(e.confirmation).length > 0;
2093
+ }
2094
+ function ni(e, t) {
2095
+ return ti(t) ? e(t.confirmation) : t?.destructive ? e("action.confirm.destructive", "This action cannot be undone.") : null;
2096
+ }
2097
+ function ri(e) {
2098
+ return ti(e) || !!e?.destructive;
2099
+ }
2100
+ function ii(e, t, n, r, i, a = !1) {
2101
+ if (r && i) return i;
2102
+ let o = e(t?.display?.description);
2103
+ return o ? a || t?.display?.icon_only === !0 ? `${n}\n${o}` : o : n;
2104
+ }
2105
+ function ai(e) {
2106
+ return !!e.association;
2107
+ }
2108
+ function oi(e, t) {
2109
+ if (e) {
2110
+ for (let n of Object.values(e.screens)) if (n.entity === t && n.type === "list") {
2111
+ let r = e.entities[t];
2112
+ return {
2113
+ route: n.route,
2114
+ icon: n.display?.icon || r?.display?.icon || ""
2115
+ };
2116
+ }
2117
+ }
2118
+ }
2119
+ function si(e, t, n, r, i, a, o) {
2120
+ let s = [];
2121
+ for (let c of t) {
2122
+ let t = ci(e, c, n, r, i, a, o);
2123
+ t !== null && s.push(t);
2124
+ }
2125
+ return s;
2126
+ }
2127
+ function ci(e, t, n, r, i, a, o) {
2128
+ return t.kind === "group" ? li(e, t, n, r, i, a, o) : ui(e, t, n, r, i, a, o);
2129
+ }
2130
+ function li(e, t, n, r, i, a, o) {
2131
+ let s = [];
2132
+ for (let c of t.items) {
2133
+ let t = ci(e, c, n, r, i, a, o);
2134
+ t !== null && s.push(t);
2135
+ }
2136
+ return s.length === 0 ? null : {
2137
+ ...t,
2138
+ items: s
2139
+ };
2140
+ }
2141
+ function ui(e, t, n, r, i, a, o) {
2142
+ if (o && !t.code.startsWith("__") && !o.has(t.code)) return null;
2143
+ let s = pi(t.code, n, r);
2144
+ if (!s) return null;
2145
+ if (a.length > 0) {
2146
+ let n = di(e, s, a);
2147
+ return n.visible ? {
2148
+ ...t,
2149
+ enabled: n.enabled,
2150
+ reason: n.reason
2151
+ } : null;
2152
+ }
2153
+ if (!$(s.conditions, i) || !$(mi(s.visible_if), i)) return null;
2154
+ let { enabled: c, reason: l } = fi(e, s, i);
2155
+ return {
2156
+ ...t,
2157
+ enabled: c,
2158
+ reason: l
2159
+ };
2160
+ }
2161
+ function di(e, t, n) {
2162
+ let r = mi(t.visible_if), i = mi(t.enabled_if), a = t.conditions, o = 0, s = 0;
2163
+ for (let e of n) {
2164
+ let t = $(r, e) && $(a, e);
2165
+ t && o++;
2166
+ let n = $(i, e);
2167
+ (!t || !n) && s++;
2168
+ }
2169
+ if (o === 0) return {
2170
+ visible: !1,
2171
+ enabled: !1,
2172
+ reason: null
2173
+ };
2174
+ if (s === 0) return {
2175
+ visible: !0,
2176
+ enabled: !0,
2177
+ reason: null
2178
+ };
2179
+ let c = {
2180
+ failing: s,
2181
+ total: n.length
2182
+ }, l = e(t.enabled_if_reason);
2183
+ return {
2184
+ visible: !0,
2185
+ enabled: !1,
2186
+ reason: l ? e("action.bulk.reason_rows_fail", "{reason} ({failing} of {total} rows fail)", {
2187
+ reason: l,
2188
+ ...c
2189
+ }) : e("action.bulk.rows_fail", "({failing} of {total} rows fail)", c)
2190
+ };
2191
+ }
2192
+ function fi(e, t, n) {
2193
+ let r = mi(t.enabled_if);
2194
+ return !r || r.length === 0 || $(r, n) ? {
2195
+ enabled: !0,
2196
+ reason: null
2197
+ } : {
2198
+ enabled: !1,
2199
+ reason: e(t.enabled_if_reason) || null
2200
+ };
2201
+ }
2202
+ function pi(e, t, n) {
2203
+ if (t && e in t) return t[e];
2204
+ if (n && e in n) return n[e];
2205
+ }
2206
+ function mi(e) {
2207
+ return e;
2208
+ }
2209
+ function hi(e, t, n, r, i) {
2210
+ let a = [];
2211
+ for (let o of e) {
2212
+ if (o.kind === "group") {
2213
+ let e = hi(o.items, t, n, r, i);
2214
+ e.length > 0 && a.push({
2215
+ ...o,
2216
+ items: e
2217
+ });
2218
+ continue;
2219
+ }
2220
+ let e = pi(o.code, t, n);
2221
+ e && e.visibility?.includes(r) && (i?.bulkRequired === void 0 || (i.bulkRequiredPredicate ? i.bulkRequiredPredicate(e) : !1) === i.bulkRequired) && (i?.excludeIf && i.excludeIf(e) || a.push(o));
2222
+ }
2223
+ return a;
2224
+ }
2225
+ function gi(e, t, n, r, i, a) {
2226
+ let o = e ?? t;
2227
+ return o ? hi(o, n, r, i, a) : bi(n, i);
2228
+ }
2229
+ function _i(e) {
2230
+ return e.requires_selection === void 0 ? vi(e) : e.requires_selection;
2231
+ }
2232
+ function vi(e) {
2233
+ return e.visibility?.includes("list_floatbar") ?? !1;
2234
+ }
2235
+ function yi(e, t, n, r, i) {
2236
+ return e.map((e) => {
2237
+ if (e.kind === "group") return {
2238
+ ...e,
2239
+ items: yi(e.items, t, n, r, i)
2240
+ };
2241
+ let a = pi(e.code, t, n);
2242
+ return a && r(a) ? {
2243
+ ...e,
2244
+ enabled: !1,
2245
+ reason: i
2246
+ } : e;
2247
+ });
2248
+ }
2249
+ function bi(e, t) {
2250
+ return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).sort(([e, t], [n, r]) => {
2251
+ let i = t.position ?? 0, a = r.position ?? 0;
2252
+ return i === a ? e < n ? -1 : +(e > n) : i - a;
2253
+ }).map(([e]) => ({
2254
+ kind: "action",
2255
+ code: e,
2256
+ enabled: !0,
2257
+ reason: null
2258
+ })) : [];
2259
+ }
2260
+ //#endregion
2261
+ //#region src/api/events.ts
2262
+ var xi = new EventTarget(), Si = "agent-frame", Ci = "agent-message-changed";
2263
+ function wi(e) {
2264
+ xi.dispatchEvent(new CustomEvent(Si, { detail: e }));
2265
+ }
2266
+ var Ti = class extends Error {
2267
+ constructor() {
2268
+ super("SSE auth expired"), this.name = "SSEAuthError";
2269
+ }
2270
+ }, Ei;
2271
+ function Di() {
2272
+ return Ei;
2273
+ }
2274
+ async function* Oi(e = {}) {
2275
+ let t = new Headers();
2276
+ e.lastEventID && t.set("Last-Event-ID", e.lastEventID), e.bearerToken && t.set("Authorization", `Bearer ${e.bearerToken}`);
2277
+ let n = await fetch(at("/api/events"), {
2278
+ credentials: e.credentials ?? "include",
2279
+ signal: e.signal,
2280
+ headers: t
2281
+ });
2282
+ if (!n.ok || !n.body) {
2283
+ let { raw: e, body: t } = await x(n);
2284
+ throw n.status === 401 ? new Ti() : new _(n.status, t, e);
2285
+ }
2286
+ if (Ei === void 0) {
2287
+ let e = Date.parse(n.headers.get("Date") ?? "");
2288
+ Number.isNaN(e) || (Ei = e);
2289
+ }
2290
+ let r = n.body.getReader(), i = new TextDecoder(), a = "", o = "", s = "", c = "";
2291
+ try {
2292
+ for (;;) {
2293
+ let { done: t, value: n } = await r.read();
2294
+ if (t) break;
2295
+ e.onActivity?.(), a += i.decode(n, { stream: !0 });
2296
+ let l = a.split("\n");
2297
+ a = l.pop() ?? "";
2298
+ for (let e of l) if (e.startsWith("event: ")) o = e.slice(7);
2299
+ else if (e.startsWith("id: ")) c = e.slice(4);
2300
+ else if (e === "id:") c = "";
2301
+ else if (e.startsWith("data: ")) s = e.slice(6);
2302
+ else if (e === "" && o) {
2303
+ try {
2304
+ if (o === "session_refresh") yield { type: "session_refresh" };
2305
+ else if (o === "checkpoint" && c) yield {
2306
+ type: "checkpoint",
2307
+ eventID: c
2308
+ };
2309
+ else if (o === "replay_complete") yield {
2310
+ type: "replay_complete",
2311
+ seq: (s ? JSON.parse(s) : {}).seq
2312
+ };
2313
+ else if (o === "snapshot_complete") {
2314
+ let e = s ? JSON.parse(s) : {};
2315
+ yield {
2316
+ type: "snapshot_complete",
2317
+ known: e.known === !0,
2318
+ asOf: typeof e.as_of == "number" ? e.as_of : void 0
2319
+ };
2320
+ } else if (o === "realtime_streaming" && s) {
2321
+ let e = JSON.parse(s);
2322
+ Array.isArray(e.degraded) && e.degraded.every((e) => typeof e == "string") && (yield {
2323
+ type: "realtime_streaming",
2324
+ eventID: c || void 0,
2325
+ degraded: e.degraded
2326
+ });
2327
+ } else if (o === "realtime_degraded" && s) {
2328
+ let e = JSON.parse(s);
2329
+ e.entity && (yield {
2330
+ type: "realtime_degraded",
2331
+ eventID: c || void 0,
2332
+ entity: e.entity,
2333
+ degradedSeq: e.degraded_seq
2334
+ });
2335
+ } else if (o === "cache_reset" && s) {
2336
+ let e = JSON.parse(s);
2337
+ yield {
2338
+ type: "cache_reset",
2339
+ eventID: c || void 0,
2340
+ reason: e.reason || "replay_gap",
2341
+ requestedSeq: e.requested_seq,
2342
+ oldestSeq: e.oldest_seq,
2343
+ resetSeq: e.reset_seq
2344
+ };
2345
+ } else if (o === "agent_stream" && s) {
2346
+ let e = JSON.parse(s);
2347
+ wi({
2348
+ convId: e.conversation_id,
2349
+ kind: e.kind,
2350
+ turnId: e.turn_id,
2351
+ payload: e.payload
2352
+ });
2353
+ } else if (o === "entity_changed" && s) {
2354
+ let e = JSON.parse(s);
2355
+ (e.entity === "agent_message" || e.entity === "agent_turn" || e.entity === "agent_tool_invocation") && xi.dispatchEvent(new CustomEvent(Ci, { detail: {
2356
+ entity: e.entity,
2357
+ rowId: e.ids[0],
2358
+ action: e.action
2359
+ } })), yield {
2360
+ type: "entity_changed",
2361
+ eventID: c || void 0,
2362
+ entity: e.entity,
2363
+ ids: e.ids,
2364
+ objects: e.objects,
2365
+ action: e.action,
2366
+ reason: e.reason
2367
+ };
2368
+ }
2369
+ } catch {}
2370
+ o = "", s = "", c = "";
2371
+ }
2372
+ }
2373
+ } finally {
2374
+ r.releaseLock();
2375
+ }
2376
+ }
2377
+ //#endregion
2378
+ //#region src/lib/field-classification.ts
2379
+ function ki(e, t) {
2380
+ let n = e?.field_access?.[t];
2381
+ return !n || n.read === "granted";
2382
+ }
2383
+ function Ai(e, t) {
2384
+ let n = e?.field_access?.[t];
2385
+ return !n || n.write === "granted";
2386
+ }
2387
+ function ji(e, t) {
2388
+ return e?.field_access?.[t]?.classification;
2389
+ }
2390
+ function Mi(e, t) {
2391
+ return e?.field_access?.[t]?.required_permission;
2392
+ }
2393
+ function Ni(e, t, n) {
2394
+ let r = ji(t, n);
2395
+ if (r) return e?.classifications?.[r];
2396
+ }
2397
+ function Pi(e, t, n) {
2398
+ return !!Ni(e, t, n)?.sod_protected;
2399
+ }
2400
+ function Fi(e, t) {
2401
+ return e?.field_access?.[t];
2402
+ }
2403
+ function Ii(e, t) {
2404
+ return ki(e, t.startsWith("$property.") ? t.slice(10) : t);
2405
+ }
2406
+ function Li(e, t) {
2407
+ if (!t) return t;
2408
+ let n = t.split(",").filter((t) => {
2409
+ let n = t.split(":")[0]?.trim();
2410
+ return !n || Ii(e, n);
2411
+ });
2412
+ return n.length > 0 ? n.join(",") : void 0;
2413
+ }
2414
+ function Ri(e, t) {
2415
+ let n = [], r = !1;
2416
+ for (let i of t) {
2417
+ if (i.field !== void 0 && !Ii(e, i.field)) {
2418
+ r = !0;
2419
+ continue;
2420
+ }
2421
+ let t = i.or ? "or" : i.and ? "and" : void 0;
2422
+ if (!t) {
2423
+ n.push(i);
2424
+ continue;
2425
+ }
2426
+ let a = i[t] ?? [], o = Ri(e, a);
2427
+ o === a ? n.push(i) : (r = !0, o.length > 0 && n.push({
2428
+ ...i,
2429
+ [t]: o
2430
+ }));
2431
+ }
2432
+ return r ? n : t;
2433
+ }
2434
+ //#endregion
2435
+ //#region src/hooks/useEntity.ts
2436
+ function zi(e) {
2437
+ let { data: t } = J();
2438
+ if (t && e) return t.entities[e];
2439
+ }
2440
+ //#endregion
2441
+ //#region src/hooks/useEntityData.ts
2442
+ function Bi(e, t) {
2443
+ return [
2444
+ "entity-data",
2445
+ e,
2446
+ {
2447
+ ...t,
2448
+ count: "window"
2449
+ }
2450
+ ];
2451
+ }
2452
+ function Vi(e, t, n = !0) {
2453
+ let r = Bi(e, t), i = r[2];
2454
+ return u({
2455
+ queryKey: r,
2456
+ queryFn: ({ signal: t }) => Un(e, i, { signal: t }),
2457
+ enabled: !!e && n,
2458
+ placeholderData: (t, n) => {
2459
+ if (n?.queryKey?.[1] !== e) return;
2460
+ let r = n?.queryKey?.[2];
2461
+ return Hi(r, i) ? t : void 0;
2462
+ }
2463
+ });
2464
+ }
2465
+ function Hi(e, t) {
2466
+ return e ? JSON.stringify(e.filters ?? null) === JSON.stringify(t.filters ?? null) && (e.search ?? "") === (t.search ?? "") && (e.screen ?? "") === (t.screen ?? "") && !!e.include_deleted == !!t.include_deleted : !1;
2467
+ }
2468
+ function Ui(e, t) {
2469
+ return [
2470
+ "entity-count",
2471
+ e,
2472
+ {
2473
+ ...t,
2474
+ count: "only",
2475
+ page: void 0,
2476
+ per_page: void 0,
2477
+ sort: void 0,
2478
+ select: void 0,
2479
+ expand: void 0
2480
+ }
2481
+ ];
2482
+ }
2483
+ function Wi(e, t, n = !0) {
2484
+ let r = Ui(e, t), i = r[2];
2485
+ return u({
2486
+ queryKey: r,
2487
+ queryFn: ({ signal: t }) => Un(e, i, { signal: t }),
2488
+ enabled: !!e && n,
2489
+ retry: 1,
2490
+ staleTime: 3e4,
2491
+ placeholderData: (t, n) => n?.queryKey?.[1] === e ? t : void 0
2492
+ });
2493
+ }
2494
+ //#endregion
2495
+ //#region src/hooks/useCurrentScreen.tsx
2496
+ var Gi = n(void 0);
2497
+ function Ki({ code: e, children: t }) {
2498
+ let { data: n } = J(), r = s(() => ({
2499
+ code: e,
2500
+ screen: n?.screens[e]
2501
+ }), [e, n]);
2502
+ return /* @__PURE__ */ f(Gi.Provider, {
2503
+ value: r,
2504
+ children: t
2505
+ });
2506
+ }
2507
+ function qi() {
2508
+ return a(Gi);
2509
+ }
2510
+ //#endregion
2511
+ export { mr as $, x as $n, Lt as $t, si as A, Ye as An, En as At, gi as B, k as Bn, yn as Bt, Ur as C, dt as Cn, Pn as Ct, ri as D, H as Dn, kn as Dt, ni as E, F as En, An as Et, ei as F, Ee as Fn, J as Ft, Or as G, ae as Gn, ln as Gt, Yr as H, se as Hn, vn as Ht, oi as I, ge as In, xn as It, Cr as J, b as Jn, pn as Jt, Dr as K, ie as Kn, un as Kt, $r as L, he as Ln, bn as Lt, yi as M, Xe as Mn, wn as Mt, $ as N, Se as Nn, Dn as Nt, _i as O, lt as On, Cn as Ot, hi as P, Te as Pn, On as Pt, _r as Q, ne as Qn, vt as Qt, ai as R, de as Rn, cn as Rt, Oi as S, mt as Sn, Nn as St, Vr as T, W as Tn, jn as Tt, zr as U, E as Un, hn as Ut, Gr as V, me as Vn, _n as Vt, Er as W, D as Wn, fn as Wt, vr as X, v as Xn, q as Xt, br as Y, te as Yn, sn as Yt, yr as Z, y as Zn, Qt as Zt, Si as _, bt as _n, or as _t, Wi as a, At as an, er as at, xi as b, ft as bn, Bn as bt, Ni as c, K as cn, Jn as ct, Mi as d, jt as dn, Xn as dt, Rt as en, pr as et, ki as f, Ft as fn, Wn as ft, Li as g, It as gn, nr as gt, Ri as h, Dt as hn, Yn as ht, Bi as i, Ot as in, Qn as it, bi as j, Ze as jn, Tn as jt, ii as k, U as kn, Sn as kt, Fi as l, Bt as ln, Zn as lt, Ai as m, Mt as mn, sr as mt, qi as n, Et as nn, dr as nt, Vi as o, wt as on, Gn as ot, Pi as p, Nt as pn, Un as pt, Tr as q, _ as qn, gn as qt, Ui as r, kt as rn, ur as rt, zi as s, yt as sn, qn as st, Ki as t, zt as tn, hr as tt, ji as u, Tt as un, X as ut, Ci as v, Ct as vn, ar as vt, Hr as w, G as wn, Mn as wt, Di as x, pt as xn, Vn as xt, Ti as y, Pt as yn, Kn as yt, Wr as z, ue as zn, dn as zt };