@declarion/react 0.56.0 → 0.59.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 (167) hide show
  1. package/README.md +0 -2
  2. package/dist-lib/AgentChatPanel.impl-DBH1Ff4G.js +1200 -0
  3. package/dist-lib/DetailAuditStrip-GNRA_eP5.js +289 -0
  4. package/dist-lib/{DraggableChildrenTable-BV5sb8Uo.js → DraggableChildrenTable-4RZC351U.js} +87 -86
  5. package/dist-lib/Grid-CQabaBLx.js +405 -0
  6. package/dist-lib/{LayoutRenderer-C9AH9cXf.js → LayoutRenderer-DGKWZKpW.js} +1000 -1114
  7. package/dist-lib/{ListCardsBody-DXcDg536.js → ListCardsBody-DfGmyNIu.js} +84 -84
  8. package/dist-lib/MarkdownRenderer-BDbzDv_y.js +87 -0
  9. package/dist-lib/{RefreshControl-CNtN8zSl.js → RefreshControl-Bhoib0ZA.js} +126 -155
  10. package/dist-lib/SmartDetailPage.impl-Ds2RGg6K.js +1565 -0
  11. package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +3046 -0
  12. package/dist-lib/{SmartRecordListPage.impl-Bkl9aZJ8.js → SmartRecordListPage.impl-C1FJLr80.js} +281 -280
  13. package/dist-lib/SortHeaderMenu-Cijxk4cX.js +107 -0
  14. package/dist-lib/action-dispatch-DY0c8U81.js +1967 -0
  15. package/dist-lib/api/client.d.ts +5 -0
  16. package/dist-lib/api/data.d.ts +2 -4
  17. package/dist-lib/api/entities.d.ts +8 -15
  18. package/dist-lib/api/events.d.ts +3 -3
  19. package/dist-lib/cardProjection-Bkl2SSYz.js +499 -0
  20. package/dist-lib/components/actions/ResponsiveActionBar.d.ts +17 -16
  21. package/dist-lib/components/agents/AgentChatPanel.d.ts +3 -13
  22. package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +14 -0
  23. package/dist-lib/components/agents/AgentPicker.d.ts +1 -2
  24. package/dist-lib/components/chrome/PageShell.d.ts +7 -0
  25. package/dist-lib/components/chrome/RecordHeader.d.ts +1 -2
  26. package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +1 -1
  27. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -2
  28. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -2
  29. package/dist-lib/components/detail-layout/blockMeta.d.ts +2 -1
  30. package/dist-lib/components/fields/BoolField.d.ts +1 -1
  31. package/dist-lib/components/fields/EnumField.d.ts +1 -1
  32. package/dist-lib/components/fields/IntArrayField.d.ts +1 -1
  33. package/dist-lib/components/fields/MultilangArrayField.d.ts +2 -0
  34. package/dist-lib/components/fields/MultilangField.d.ts +1 -1
  35. package/dist-lib/components/fields/MultilangTextField.d.ts +1 -1
  36. package/dist-lib/components/fields/NumberField.d.ts +1 -1
  37. package/dist-lib/components/fields/PasswordField.d.ts +1 -1
  38. package/dist-lib/components/fields/RefCombobox.d.ts +1 -1
  39. package/dist-lib/components/fields/SecretField.d.ts +1 -1
  40. package/dist-lib/components/fields/StringArrayField.d.ts +1 -1
  41. package/dist-lib/components/fields/TimestampField.d.ts +1 -1
  42. package/dist-lib/components/fields/cells/registry.d.ts +2 -1
  43. package/dist-lib/components/fields/index.d.ts +2 -1
  44. package/dist-lib/components/fields/langMap.d.ts +2 -0
  45. package/dist-lib/components/fields/secretValue.d.ts +2 -0
  46. package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +3 -0
  47. package/dist-lib/components/file-widgets/UploadFailureText.d.ts +4 -0
  48. package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
  49. package/dist-lib/components/file-widgets/host.d.ts +4 -3
  50. package/dist-lib/components/file-widgets/types.d.ts +1 -0
  51. package/dist-lib/components/file-widgets/upload.d.ts +18 -3
  52. package/dist-lib/components/filters/filter-op-label.d.ts +3 -0
  53. package/dist-lib/components/layout/ImpersonationBanner.d.ts +1 -1
  54. package/dist-lib/components/layout/ImpersonationFrame.d.ts +1 -1
  55. package/dist-lib/components/layout/Layout.d.ts +2 -1
  56. package/dist-lib/components/layout/Sidebar.d.ts +2 -1
  57. package/dist-lib/components/layout/TenantChip.d.ts +1 -1
  58. package/dist-lib/components/list/ViewSwitcher.d.ts +4 -2
  59. package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -2
  60. package/dist-lib/components/pages/ExportMenu.d.ts +3 -5
  61. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -2
  62. package/dist-lib/components/pages/auth/AuthShell.d.ts +4 -31
  63. package/dist-lib/components/pages/exportRequest.d.ts +4 -6
  64. package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +8 -0
  65. package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -2
  66. package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -1
  67. package/dist-lib/components/pages/list/ListFloatbar.d.ts +2 -2
  68. package/dist-lib/components/pages/list/ListHeader.d.ts +2 -2
  69. package/dist-lib/components/pages/list/ListNoRows.d.ts +4 -5
  70. package/dist-lib/components/pages/list/ListToolbar.d.ts +3 -2
  71. package/dist-lib/components/pages/list/ListUrlBanner.d.ts +10 -0
  72. package/dist-lib/components/pages/list/RowActionsCell.d.ts +2 -4
  73. package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -2
  74. package/dist-lib/components/pages/list/columns.d.ts +2 -1
  75. package/dist-lib/components/pages/list/filter-meta.d.ts +2 -1
  76. package/dist-lib/components/pages/list/useActiveView.d.ts +38 -0
  77. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +6 -5
  78. package/dist-lib/components/pages/list/useListQuery.d.ts +4 -4
  79. package/dist-lib/components/pages/list/useListSort.d.ts +5 -4
  80. package/dist-lib/components/pages/list/useListViews.d.ts +18 -8
  81. package/dist-lib/components/pages/list/useRowMenu.d.ts +2 -3
  82. package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
  83. package/dist-lib/components/params/ParamsBlock.d.ts +1 -13
  84. package/dist-lib/components/params/param-editors.d.ts +3 -11
  85. package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -2
  86. package/dist-lib/components/shared/DynamicIcon.d.ts +2 -2
  87. package/dist-lib/components/shared/ErrorBoundary.d.ts +1 -1
  88. package/dist-lib/components/shared/LoadingSkeleton.d.ts +1 -0
  89. package/dist-lib/components/shared/LucideIcon.d.ts +1 -1
  90. package/dist-lib/components/shared/useOwnRefresh.d.ts +1 -1
  91. package/dist-lib/declarion-react.css +1 -1
  92. package/dist-lib/embed/theme.d.ts +1 -1
  93. package/dist-lib/embed/useEmbedNavigate.d.ts +1 -1
  94. package/dist-lib/failure-v-uGSpbX.js +158 -0
  95. package/dist-lib/{field-classification-D6xQYn-h.js → field-classification-C28XE-_P.js} +514 -307
  96. package/dist-lib/format-count-DA4wmmWR.js +1771 -0
  97. package/dist-lib/hooks/useEntityData.d.ts +1 -1
  98. package/dist-lib/hooks/useFilters.d.ts +7 -5
  99. package/dist-lib/hooks/useLanguage.d.ts +4 -0
  100. package/dist-lib/hooks/useParams.d.ts +4 -51
  101. package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
  102. package/dist-lib/hooks/useSSE.d.ts +3 -3
  103. package/dist-lib/hooks/useTabTitle.d.ts +2 -0
  104. package/dist-lib/hooks/useText.d.ts +3 -3
  105. package/dist-lib/hooks/useVersionWatcher.d.ts +1 -1
  106. package/dist-lib/hooks/useViews.d.ts +20 -0
  107. package/dist-lib/index.d.ts +8 -7
  108. package/dist-lib/index.js +2716 -5795
  109. package/dist-lib/lib/action-dispatch.d.ts +2 -1
  110. package/dist-lib/lib/actions.d.ts +30 -42
  111. package/dist-lib/lib/anchor.d.ts +3 -4
  112. package/dist-lib/lib/decimal-text.d.ts +1 -0
  113. package/dist-lib/lib/document-templates.d.ts +1 -2
  114. package/dist-lib/lib/download.d.ts +2 -1
  115. package/dist-lib/lib/evidence-verdict.d.ts +2 -1
  116. package/dist-lib/lib/failure.d.ts +2 -0
  117. package/dist-lib/lib/field-classification.d.ts +3 -3
  118. package/dist-lib/lib/filters.d.ts +18 -2
  119. package/dist-lib/lib/format-count.d.ts +8 -7
  120. package/dist-lib/lib/language.d.ts +19 -0
  121. package/dist-lib/lib/mass-edit.d.ts +2 -1
  122. package/dist-lib/lib/realtime-query-keys.d.ts +1 -1
  123. package/dist-lib/lib/realtime-reconcile.d.ts +3 -4
  124. package/dist-lib/lib/screen-back.d.ts +4 -6
  125. package/dist-lib/lib/sort.d.ts +9 -9
  126. package/dist-lib/lib/timestamp.d.ts +5 -7
  127. package/dist-lib/lib/ui-actions.d.ts +2 -1
  128. package/dist-lib/peekDraftStore-D-cTbiIr.js +199 -0
  129. package/dist-lib/registry-Cb3W-czW.js +1950 -0
  130. package/dist-lib/safe-url-oSJw5pzO.js +34 -0
  131. package/dist-lib/stores/icon-registry.d.ts +2 -2
  132. package/dist-lib/stores/list-layout.d.ts +3 -4
  133. package/dist-lib/stores/realtime.d.ts +1 -1
  134. package/dist-lib/stores/tabs.d.ts +3 -2
  135. package/dist-lib/testing.d.ts +6 -0
  136. package/dist-lib/testing.js +98 -76
  137. package/dist-lib/types/api.d.ts +7 -8
  138. package/dist-lib/types/fieldType.d.ts +1 -1
  139. package/dist-lib/types/files.d.ts +4 -4
  140. package/dist-lib/types/schema.d.ts +44 -50
  141. package/dist-lib/useAgentConversation-D97IqE-J.js +623 -0
  142. package/dist-lib/{useCurrentScreen-CzwzQpoW.js → useCurrentScreen-BL5NZFCw.js} +2777 -3768
  143. package/dist-lib/useListQuery-BG1GyKtJ.js +103 -0
  144. package/dist-lib/useProperties-4Lg3odrt.js +83 -0
  145. package/dist-lib/{useTabSearchMirror-C39U85cg.js → useTabSearchMirror-ZVLlINBX.js} +49 -51
  146. package/dist-lib/useText-BFDCTUSo.js +952 -0
  147. package/dist-lib/{value-Bo8C8WMU.js → value-By1-WJ8J.js} +74 -76
  148. package/dist-lib/vite/fingerprint-plugin.d.ts +2 -3
  149. package/package.json +13 -12
  150. package/dist-lib/Grid-DWgUPuZ3.js +0 -404
  151. package/dist-lib/MarkdownRenderer-CcSFc2N3.js +0 -85
  152. package/dist-lib/RecordIdBadge-CGxPR-8q.js +0 -24
  153. package/dist-lib/SmartDetailPage.impl-lskCd-WG.js +0 -1846
  154. package/dist-lib/SmartListPage.impl-CrGbdzyK.js +0 -2854
  155. package/dist-lib/SortHeaderMenu-SYSAaqQJ.js +0 -106
  156. package/dist-lib/action-dispatch-CR4ajBtT.js +0 -1985
  157. package/dist-lib/cardProjection-CW5RIMko.js +0 -699
  158. package/dist-lib/components/pages/home/HomeStub.d.ts +0 -6
  159. package/dist-lib/components/pages/jobs/Jobs.d.ts +0 -1
  160. package/dist-lib/components/pages/pipeline/Pipeline.d.ts +0 -1
  161. package/dist-lib/format-count-Dobmi-Ji.js +0 -1551
  162. package/dist-lib/hooks/useUserLocale.d.ts +0 -1
  163. package/dist-lib/lib/messages.d.ts +0 -12
  164. package/dist-lib/peekDraftStore-5wQ7lq_V.js +0 -194
  165. package/dist-lib/registry-CjgUaF7C.js +0 -1768
  166. package/dist-lib/useListQuery-D7Hr5WM1.js +0 -96
  167. package/dist-lib/useProperties-CqtCzFCr.js +0 -81
@@ -34,6 +34,11 @@ type ApiErrorReporter = (report: ApiErrorReport) => void;
34
34
  * previous reporter so callers can restore it. Tests should install a
35
35
  * spy or no-op via this hook instead of stubbing `console.error`. */
36
36
  export declare function setApiErrorReporter(r: ApiErrorReporter): ApiErrorReporter;
37
+ export declare function publishLanguage(language: string | null): void;
38
+ export declare function currentReader(): number;
39
+ export declare function publishLanguageFor(startedFor: number, language: string): void;
40
+ export declare function currentPublishedLanguage(): string | null;
41
+ export declare function withPublishedLanguage(path: string): string;
37
42
  export declare function apiFetch<T>(path: string, options?: RequestInit): Promise<T>;
38
43
  export interface BlobResponse {
39
44
  blob: Blob;
@@ -103,10 +103,8 @@ export declare class ActionBatchError extends Error {
103
103
  * passes a param literally named `object_ids` (collision with the
104
104
  * reserved control key) or the now-rejected legacy `_ids` key.
105
105
  *
106
- * Plan 2026-06-01-write-api-final: the wire-level reserved key is
107
- * `object_ids` (server-side parseActionBody decodes it into
108
- * ctx.ObjectIDs). The legacy `_ids` envelope was removed in Task 5;
109
- * passing it triggers a 400 from the server.
106
+ * The wire-level reserved key is `object_ids`. The legacy `_ids` envelope
107
+ * was removed; the server answers it with a 400.
110
108
  */
111
109
  export declare function buildActionBody(params: Record<string, unknown> | undefined, ids?: string[]): ActionExecuteRequest;
112
110
  /**
@@ -41,7 +41,7 @@ export declare class EntityClient<T extends Record<string, unknown> = Record<str
41
41
  *
42
42
  * Recovery on cursor-stale signals: when the server returns
43
43
  * `cursor.semantics_mismatch` (sort grammar version bump),
44
- * `cursor.locale_changed` (active locale switched mid-pagination), or
44
+ * `cursor.language_changed` (the reader's language switched mid-pagination), or
45
45
  * `cursor.archive_invalid` (an undecodable cross-store archive cursor), the
46
46
  * `after` token is dropped and the request is retried once from the top.
47
47
  *
@@ -63,8 +63,7 @@ export declare class EntityClient<T extends Record<string, unknown> = Record<str
63
63
  /**
64
64
  * Create multiple records in one transactional batch.
65
65
  *
66
- * Plan 2026-06-01-write-api-final §1.2 + Non-Obvious Knowledge:
67
- * `data.create` is one-row-per-dispatch on the new envelope; N independent
66
+ * `data.create` is one row per dispatch; N independent
68
67
  * inserts compose through the platform batch primitive (`system.batch`,
69
68
  * atomic READ COMMITTED tx). Each child op targets `<entity>.__create`
70
69
  * with a FLAT `{entity, fields}` body inside `BatchOp.params`.
@@ -81,8 +80,7 @@ export declare class EntityClient<T extends Record<string, unknown> = Record<str
81
80
  /**
82
81
  * Update multiple records in one request. Each item must include its id.
83
82
  *
84
- * Plan 2026-06-01-write-api-final §1.2 + Non-Obvious Knowledge:
85
- * `data.update` is one-fields-map-per-dispatch on the new envelope
83
+ * `data.update` is one fields map per dispatch
86
84
  * ({object_ids, entity, fields}); per-row variation composes through
87
85
  * `system.batch` (atomic READ COMMITTED tx) — one __update child op per
88
86
  * input item, mirroring createMany / upsertMany. The batch is atomic:
@@ -100,12 +98,9 @@ export declare class EntityClient<T extends Record<string, unknown> = Record<str
100
98
  * Delete multiple records in one request. Returns the count of deleted
101
99
  * records.
102
100
  *
103
- * Plan 2026-06-01-write-api-final §1.2: dispatches
104
- * /api/actions/<entity>.__delete with a FLAT envelope
105
- * ({object_ids, entity}). The reserved `object_ids` key lands directly
106
- * in ctx.ObjectIDs; the dispatcher derives items from those + the
107
- * entity's PK fields. NO legacy `_ids` on the wire (rejected 400 by
108
- * parseActionBody as of Task 5).
101
+ * Dispatches /api/actions/<entity>.__delete with a FLAT envelope
102
+ * ({object_ids, entity}); the server derives the rows from `object_ids`
103
+ * and the entity's PK fields. The legacy `_ids` key is rejected with 400.
109
104
  */
110
105
  deleteMany(ids: string[]): Promise<{
111
106
  count: number;
@@ -116,8 +111,7 @@ export declare class EntityClient<T extends Record<string, unknown> = Record<str
116
111
  * Restore multiple soft-deleted records. Returns the count of restored
117
112
  * records.
118
113
  *
119
- * Plan 2026-06-01-write-api-final §1.2: routes through the platform-
120
- * default `__restore` action. The legacy CRUD route
114
+ * Routes through the platform-default `__restore` action. The legacy CRUD route
121
115
  * POST /api/data/{entity}/restore is retired (returns 410). The FLAT
122
116
  * envelope ({object_ids, entity}) lands directly in DataRestoreParams
123
117
  * via JSON tags; no `params:` wrapper on the wire.
@@ -131,8 +125,7 @@ export declare class EntityClient<T extends Record<string, unknown> = Record<str
131
125
  * Upsert multiple records. Existing matches (by uniqueFields) are
132
126
  * updated; absent rows are inserted.
133
127
  *
134
- * Plan 2026-06-01-write-api-final §1.2 + OQ-1: `data.upsert` is one-row-
135
- * per-dispatch on the new envelope (per-row uniqueness matching), so N
128
+ * `data.upsert` is one row per dispatch (per-row uniqueness matching), so N
136
129
  * rows compose through `system.batch`. Each child op targets
137
130
  * `<entity>.__upsert` with FLAT `{entity, fields, unique_by}` params.
138
131
  * The handler returns `DataUpsertResult.rows[]` where each
@@ -1,7 +1,7 @@
1
1
  /**
2
- * What a change frame says happened. The relay emits exactly these three
3
- * (`golang/internal/realtime/mapper_coerce.go`, `actionForOp`); a restore is an
4
- * SQL update and arrives as `updated`, so a branch on a fourth value is dead.
2
+ * What a change frame says happened. The relay emits exactly these three; a
3
+ * restore is an SQL update and arrives as `updated`, so a branch on a fourth
4
+ * value is dead.
5
5
  * Declared once here because every layer below reads the same wire word.
6
6
  */
7
7
  export type EntityAction = "created" | "updated" | "deleted";
@@ -0,0 +1,499 @@
1
+ import { h as e, yn as t } from "./useCurrentScreen-BL5NZFCw.js";
2
+ //#region src/components/pages/list/cardProjection.ts
3
+ var n = 4, r = 2, i = 2, a = [
4
+ "screen_card",
5
+ "entity_card",
6
+ "saved_view_columns",
7
+ "screen_default_columns",
8
+ "screen_columns",
9
+ "entity_inference"
10
+ ], o = /* @__PURE__ */ new Set(["_select", "_actions"]), s = /* @__PURE__ */ new Set([
11
+ "text",
12
+ "rich_text",
13
+ "multilang_text",
14
+ "json",
15
+ "structure",
16
+ "secret",
17
+ "password",
18
+ "bytes"
19
+ ]), c = /* @__PURE__ */ new Set(["enum", "bool"]), l = /* @__PURE__ */ new Set([
20
+ "date",
21
+ "time",
22
+ "timestamp"
23
+ ]), u = /* @__PURE__ */ new Set([
24
+ "string",
25
+ "text",
26
+ "email",
27
+ "url",
28
+ "phone",
29
+ "int",
30
+ "integer",
31
+ "bigint",
32
+ "smallint",
33
+ "float",
34
+ "double",
35
+ "decimal",
36
+ "numeric",
37
+ "number",
38
+ "money",
39
+ "percent",
40
+ "bool",
41
+ "boolean",
42
+ "date",
43
+ "datetime",
44
+ "timestamp",
45
+ "timestamptz",
46
+ "enum",
47
+ "status"
48
+ ]);
49
+ function d(e) {
50
+ let { entity: t, screen: n, savedViewColumns: r } = e, i = n?.card;
51
+ if (i) return g(t, i, "screen_card");
52
+ if (t?.card) return g(t, t.card, "entity_card");
53
+ let a = y(t, n, r);
54
+ return _(t, a.columns, a.source);
55
+ }
56
+ function f(e) {
57
+ let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new Y(), h = r === "cards" ? a.renderFields : x(t, i, { explicit: !0 }), g = r === "cards" ? m(t, n) : [];
58
+ for (let e of h) f.addField(e, "render"), G(t, e, f, "render");
59
+ for (let e of g) h.includes(e) || (f.addField(e, "variant"), G(t, e, f, "variant"));
60
+ let _ = M(t, f), v = L(t, [
61
+ o,
62
+ s,
63
+ c
64
+ ], f), y = p(t, n, f), b = R(t, l, f), S = z(t, n, d, f);
65
+ if (u) for (let e of _) f.addField(e, "detail_handoff");
66
+ let C = new J();
67
+ for (let e of _) C.add(e);
68
+ for (let e of v) C.add(e);
69
+ for (let e of y) C.add(e);
70
+ for (let e of g) C.add(e);
71
+ for (let e of b) C.add(e);
72
+ for (let e of S) C.add(e);
73
+ let w = new J();
74
+ for (let e of h) W(t, e, w, f);
75
+ for (let e of C.values()) W(t, e, w, f);
76
+ let T = w.values(), E = K(f);
77
+ return {
78
+ renderFields: h,
79
+ dependencyFields: C.values().filter((e) => !h.includes(e)),
80
+ conditionFields: v,
81
+ identityFields: _,
82
+ sortFields: b,
83
+ selectFields: T.length > 0 ? T : void 0,
84
+ expandFields: E.length > 0 ? E : void 0,
85
+ reasons: f.snapshot()
86
+ };
87
+ }
88
+ function p(e, t, n) {
89
+ let r = new J(), i = (t) => {
90
+ for (let n of t) n.and ? i(n.and) : n.or ? i(n.or) : n.field && e?.fields.has(n.field) && r.add(n.field);
91
+ };
92
+ for (let t of e?.variants?.items() ?? []) t.when && i(t.when);
93
+ for (let e of t?.variants?.items() ?? []) e.when && i(e.when);
94
+ for (let e of r.values()) n.addField(e, "variant");
95
+ return r.values();
96
+ }
97
+ function m(e, t, n) {
98
+ let r = new J();
99
+ for (let i of d({
100
+ entity: e,
101
+ screen: t,
102
+ savedViewColumns: n
103
+ }).renderFields) r.add(i);
104
+ for (let i of t?.variants?.items() ?? []) {
105
+ let a = { ...t };
106
+ i.card !== void 0 && (a.card = i.card);
107
+ for (let t of d({
108
+ entity: e,
109
+ screen: a,
110
+ savedViewColumns: n
111
+ }).renderFields) r.add(t);
112
+ }
113
+ return r.values();
114
+ }
115
+ function h(e, t, n) {
116
+ if (!e || t?.on_row_click !== "peek" || t.quick_peek?.enabled === !1) return [];
117
+ let r = t.quick_peek?.fields;
118
+ if (r && r.length > 0) return x(e, r, { explicit: !0 });
119
+ let i = t.quick_peek?.sections;
120
+ if (i && i.length > 0) {
121
+ let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new J();
122
+ B(r?.items, new Set(i.map(String)), a);
123
+ let o = x(e, a.values(), { explicit: !0 });
124
+ if (o.length > 0) return o;
125
+ }
126
+ return U(e);
127
+ }
128
+ function g(e, t, r) {
129
+ let i = t.max_body_fields ?? n, a = S(e, t.title_field, { explicit: !0 }), o = S(e, t.subtitle_field, { explicit: !0 }), s = x(e, t.badge_fields ?? [], { explicit: !0 }), c = x(e, t.fields ?? [], { explicit: !0 }), l = x(e, t.meta_fields ?? [], { explicit: !0 });
130
+ return v({
131
+ source: r,
132
+ explicit: !0,
133
+ titleField: a,
134
+ titleUsesDisplay: !a,
135
+ subtitleField: o,
136
+ badgeFields: s,
137
+ bodyFields: c,
138
+ metaFields: l,
139
+ hideEmptyFields: t.hide_empty_fields ?? !0,
140
+ maxBodyFields: i
141
+ });
142
+ }
143
+ function _(e, t, a) {
144
+ let o = x(e, t, { explicit: !1 }), s = n, c = S(e, e?.display?.display_field, { explicit: !1 }), l = c ?? C(e, o, {
145
+ allowLong: !1,
146
+ allowAuto: !1
147
+ }), u = c !== void 0, d = l ? /* @__PURE__ */ new Set([l]) : void 0, f = o.find((t) => !d?.has(t) && T(e, t)), p = new Set([l, f].filter((e) => !!e)), m = D(e, o).filter((e) => !p.has(e)).slice(0, r);
148
+ for (let e of m) p.add(e);
149
+ let h = o.filter((t) => !p.has(t) && O(e, t)).slice(0, i);
150
+ for (let e of h) p.add(e);
151
+ return v({
152
+ source: a,
153
+ explicit: !1,
154
+ titleField: l,
155
+ titleUsesDisplay: u,
156
+ subtitleField: f,
157
+ badgeFields: m,
158
+ bodyFields: o.filter((t) => !p.has(t) && w(e, t)).slice(0, s),
159
+ metaFields: h,
160
+ hideEmptyFields: !0,
161
+ maxBodyFields: s
162
+ });
163
+ }
164
+ function v(e) {
165
+ let t = new J(), n = [], r = (r, i) => {
166
+ r && !t.has(r) && (t.add(r), n.push({
167
+ field: r,
168
+ bucket: i,
169
+ explicit: e.explicit
170
+ }));
171
+ };
172
+ r(e.titleField, "title"), r(e.subtitleField, "subtitle");
173
+ for (let t of e.badgeFields) r(t, "badges");
174
+ for (let t of e.bodyFields) r(t, "body");
175
+ for (let t of e.metaFields) r(t, "meta");
176
+ return {
177
+ source: e.source,
178
+ explicit: e.explicit,
179
+ titleField: e.titleField,
180
+ titleUsesDisplay: e.titleUsesDisplay,
181
+ subtitleField: e.subtitleField,
182
+ badgeFields: e.badgeFields,
183
+ bodyFields: e.bodyFields,
184
+ metaFields: e.metaFields,
185
+ hideEmptyFields: e.hideEmptyFields,
186
+ maxBodyFields: e.maxBodyFields,
187
+ renderFields: t.values(),
188
+ fields: n,
189
+ sourcePrecedence: a
190
+ };
191
+ }
192
+ function y(e, t, n) {
193
+ return n && n.length > 0 ? {
194
+ source: "saved_view_columns",
195
+ columns: n
196
+ } : t?.default_columns && t.default_columns.length > 0 ? {
197
+ source: "screen_default_columns",
198
+ columns: t.default_columns
199
+ } : t?.columns && t.columns.length > 0 ? {
200
+ source: "screen_columns",
201
+ columns: t.columns
202
+ } : {
203
+ source: "entity_inference",
204
+ columns: b(e)
205
+ };
206
+ }
207
+ function b(e) {
208
+ if (!e) return [];
209
+ let t = [];
210
+ e.display.display_field && t.push(e.display.display_field);
211
+ for (let [n] of e.fields) t.push(n);
212
+ for (let n of Object.keys(e.status_groups ?? {})) t.push(`$status.${n}`);
213
+ for (let n of Object.keys(e.properties ?? {})) t.push(`$property.${n}`);
214
+ if (e.evidence_covered && t.push("$evidence"), e.files) for (let [n] of e.files) t.push(n);
215
+ return t;
216
+ }
217
+ function x(e, t, n) {
218
+ let r = new J();
219
+ for (let i of t) {
220
+ let t = S(e, i, n);
221
+ t && r.add(t);
222
+ }
223
+ return r.values();
224
+ }
225
+ function S(e, t, n) {
226
+ if (!t || o.has(t)) return;
227
+ if (!e) return t.startsWith("$") ? void 0 : t;
228
+ if (t.startsWith("$status.")) {
229
+ let n = t.slice(8);
230
+ return e.status_groups?.[n] ? t : void 0;
231
+ }
232
+ if (t.startsWith("$property.")) {
233
+ let n = t.slice(10);
234
+ return e.properties?.[n] ? t : void 0;
235
+ }
236
+ if (t === "$evidence") return e.evidence_covered ? t : void 0;
237
+ if (t.startsWith("$")) return;
238
+ let r = e.fields.get(t), i = e.files?.get(t);
239
+ if ((r || i) && (n.explicit || !(r && r.display?.is_listable === !1) && !(i && i.display?.is_listable === !1))) return t;
240
+ }
241
+ function C(e, t, n) {
242
+ return t.find((t) => n.exclude?.has(t) || !n.allowAuto && A(e, t) || !n.allowLong && j(e, t) ? !1 : k(e, t));
243
+ }
244
+ function w(e, t) {
245
+ return !(!k(e, t) || A(e, t) || j(e, t));
246
+ }
247
+ function T(e, t) {
248
+ return !(!k(e, t) || A(e, t) || j(e, t) || O(e, t) || E(e, t));
249
+ }
250
+ function E(e, t) {
251
+ if (t.startsWith("$status.") || t.startsWith("$property.") || t === "$evidence") return !0;
252
+ let n = q(e, t);
253
+ return n.kind === "field" && c.has(n.field.type);
254
+ }
255
+ function D(e, t) {
256
+ let n = new J();
257
+ for (let e of t) (e.startsWith("$status.") || e.startsWith("$property.") || e === "$evidence") && n.add(e);
258
+ for (let r of t) E(e, r) && n.add(r);
259
+ return n.values();
260
+ }
261
+ function O(e, t) {
262
+ if (A(e, t)) return !1;
263
+ let n = q(e, t);
264
+ return n.kind === "field" && l.has(n.field.type);
265
+ }
266
+ function k(e, t) {
267
+ return q(e, t).kind !== "missing";
268
+ }
269
+ function A(e, t) {
270
+ let n = q(e, t);
271
+ return n.kind === "field" && (n.field.primary === !0 || n.field.auto === !0);
272
+ }
273
+ function j(e, t) {
274
+ let n = q(e, t);
275
+ return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" && s.has(n.field.type);
276
+ }
277
+ function M(e, n) {
278
+ if (!e) return [];
279
+ let r = new J();
280
+ for (let i of t(e)) r.add(i), n.addField(i, "identity");
281
+ let i = S(e, e.display.display_field, { explicit: !0 });
282
+ i && (r.add(i), n.addField(i, "display"), G(e, i, n, "display"));
283
+ for (let t of N(e.display.display_template)) {
284
+ let i = S(e, t, { explicit: !0 });
285
+ i && (r.add(i), n.addField(i, "display_template"), G(e, i, n, "display_template"));
286
+ }
287
+ return r.values();
288
+ }
289
+ function N(e) {
290
+ if (!e) return [];
291
+ let t = new J(), n = 0;
292
+ for (; n < e.length;) {
293
+ let r = e.indexOf("${", n);
294
+ if (r < 0) break;
295
+ if (r > 0 && e[r - 1] === "\\") {
296
+ n = r + 2;
297
+ continue;
298
+ }
299
+ let i = P(e, r + 2);
300
+ if (i < 0) break;
301
+ for (let n of F(e.slice(r + 2, i))) t.add(n);
302
+ n = i + 1;
303
+ }
304
+ return t.values();
305
+ }
306
+ function P(e, t) {
307
+ let n = 0;
308
+ for (let r = t; r < e.length; r += 1) {
309
+ let t = e[r];
310
+ if (t === "{") {
311
+ n += 1;
312
+ continue;
313
+ }
314
+ if (t === "}") {
315
+ if (n === 0) return r;
316
+ --n;
317
+ }
318
+ }
319
+ return -1;
320
+ }
321
+ function F(e) {
322
+ let t = new J(), n = 0;
323
+ for (; n < e.length;) {
324
+ let r = e.indexOf("row.", n);
325
+ if (r < 0) break;
326
+ if (r > 0 && I(e.charCodeAt(r - 1))) {
327
+ n = r + 4;
328
+ continue;
329
+ }
330
+ let i = r + 4, a = i;
331
+ for (; a < e.length && I(e.charCodeAt(a));) a += 1;
332
+ a > i && t.add(e.slice(i, a)), n = a;
333
+ }
334
+ return t.values();
335
+ }
336
+ function I(e) {
337
+ return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 95;
338
+ }
339
+ function L(e, t, n) {
340
+ let r = new J();
341
+ for (let i of t) for (let t of i ?? []) for (let i of [
342
+ ...t.action.visible_if ?? [],
343
+ ...t.action.enabled_if ?? [],
344
+ ...t.action.conditions ?? []
345
+ ]) {
346
+ let t = S(e, i.field, { explicit: !0 });
347
+ t && (r.add(t), n.addField(t, "condition"), G(e, t, n, "condition"));
348
+ }
349
+ return r.values();
350
+ }
351
+ function R(t, n, r) {
352
+ let i = typeof n == "string" ? e(n) : n ?? [], a = new J();
353
+ for (let e of i) {
354
+ let n = S(t, e.field, { explicit: !0 });
355
+ n && (a.add(n), r.addField(n, "sort"), G(t, n, r, "sort"));
356
+ }
357
+ return a.values();
358
+ }
359
+ function z(e, t, n, r) {
360
+ let i = new J(), a = t?.variants?.items() ?? [];
361
+ if (a.length === 0 || a.some((e) => e.quick_peek === void 0)) for (let r of h(e, t, n)) i.add(r);
362
+ for (let r of a) {
363
+ if (r.quick_peek === void 0) continue;
364
+ let a = {
365
+ ...t,
366
+ quick_peek: r.quick_peek
367
+ };
368
+ for (let t of h(e, a, n)) i.add(t);
369
+ }
370
+ for (let t of i.values()) r.addField(t, "quick_peek"), G(e, t, r, "quick_peek");
371
+ return i.values();
372
+ }
373
+ function B(e, t, n) {
374
+ if (Array.isArray(e)) {
375
+ for (let r of e) if (r && typeof r == "object") {
376
+ if ("section" in r) {
377
+ let e = r.section, i = H(e?.name);
378
+ i && t.has(i) && V(e?.items, n);
379
+ continue;
380
+ }
381
+ "fields" in r && V([r], n);
382
+ }
383
+ }
384
+ }
385
+ function V(e, t) {
386
+ if (Array.isArray(e)) {
387
+ for (let n of e) if (n && typeof n == "object") {
388
+ if ("fields" in n) {
389
+ let e = n.fields;
390
+ if (Array.isArray(e)) {
391
+ for (let n of e) if (typeof n == "string") t.add(n);
392
+ else if (n && typeof n == "object" && "name" in n) {
393
+ let e = n.name;
394
+ typeof e == "string" && t.add(e);
395
+ }
396
+ }
397
+ }
398
+ "section" in n && V(n.section?.items, t);
399
+ }
400
+ }
401
+ }
402
+ function H(e) {
403
+ if (typeof e == "string") return e;
404
+ if (e && typeof e == "object") {
405
+ let t = Object.values(e).find((e) => typeof e == "string");
406
+ return typeof t == "string" ? t : "";
407
+ }
408
+ return "";
409
+ }
410
+ function U(e) {
411
+ let t = [];
412
+ for (let [n, r] of e.fields) {
413
+ if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
414
+ let e = (r.type || "").toLowerCase(), i = !!(r.enum || r.values);
415
+ if ((u.has(e) || i) && (t.push(n), t.length >= 8)) break;
416
+ }
417
+ return t;
418
+ }
419
+ function W(e, t, n, r) {
420
+ if (!t || t.startsWith("$")) return;
421
+ let i = q(e, t);
422
+ i.kind !== "missing" && (n.add(t), i.kind === "file" && r.addField(t, "file_metadata"));
423
+ }
424
+ function G(e, t, n, r) {
425
+ if (t.startsWith("$status.")) {
426
+ n.addExpand("statuses", "status_expand"), r !== "status_expand" && n.addExpand("statuses", r), r !== "status_expand" && n.addField(t, r);
427
+ return;
428
+ }
429
+ if (t.startsWith("$property.")) {
430
+ n.addExpand("properties", "property_expand"), r !== "property_expand" && n.addExpand("properties", r), r !== "property_expand" && n.addField(t, r);
431
+ let i = t.slice(10);
432
+ e?.properties?.[i]?.ref && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
433
+ return;
434
+ }
435
+ if (t === "$evidence") {
436
+ n.addExpand("evidence", "evidence_expand"), r !== "evidence_expand" && n.addExpand("evidence", r), r !== "evidence_expand" && n.addField(t, r);
437
+ return;
438
+ }
439
+ let i = q(e, t);
440
+ i.kind === "field" && i.field.type === "ref" && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
441
+ }
442
+ function K(e) {
443
+ let t = e.snapshot().expand, n = [];
444
+ return t.refs && n.push("refs"), t.statuses && n.push("statuses"), t.properties && n.push("properties"), t.evidence && n.push("evidence"), n;
445
+ }
446
+ function q(e, t) {
447
+ if (!e) return { kind: t.startsWith("$") ? "synthetic" : "missing" };
448
+ if (t.startsWith("$status.")) return e.status_groups?.[t.slice(8)] ? { kind: "synthetic" } : { kind: "missing" };
449
+ if (t.startsWith("$property.")) return e.properties?.[t.slice(10)] ? { kind: "synthetic" } : { kind: "missing" };
450
+ if (t === "$evidence") return e.evidence_covered ? { kind: "synthetic" } : { kind: "missing" };
451
+ let n = e.fields.get(t);
452
+ if (n) return {
453
+ kind: "field",
454
+ field: n
455
+ };
456
+ let r = e.files?.get(t);
457
+ return r ? {
458
+ kind: "file",
459
+ file: r
460
+ } : { kind: "missing" };
461
+ }
462
+ var J = class {
463
+ #e = [];
464
+ #t = /* @__PURE__ */ new Set();
465
+ add(e) {
466
+ this.#t.has(e) || (this.#t.add(e), this.#e.push(e));
467
+ }
468
+ has(e) {
469
+ return this.#t.has(e);
470
+ }
471
+ values() {
472
+ return [...this.#e];
473
+ }
474
+ }, Y = class {
475
+ #e = /* @__PURE__ */ new Map();
476
+ #t = /* @__PURE__ */ new Map();
477
+ addField(e, t) {
478
+ this.add(this.#e, e, t);
479
+ }
480
+ addExpand(e, t) {
481
+ this.add(this.#t, e, t);
482
+ }
483
+ snapshot() {
484
+ return {
485
+ fields: Object.fromEntries(this.#e.entries()),
486
+ expand: Object.fromEntries(this.#t.entries())
487
+ };
488
+ }
489
+ add(e, t, n) {
490
+ let r = e.get(t);
491
+ if (!r) {
492
+ e.set(t, [n]);
493
+ return;
494
+ }
495
+ r.includes(n) || r.push(n);
496
+ }
497
+ };
498
+ //#endregion
499
+ export { m as i, f as n, h as r, d as t };