@declarion/react 0.106.0 → 0.109.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 (34) hide show
  1. package/dist-lib/api/agents.js +8 -7
  2. package/dist-lib/api/client.js +48 -49
  3. package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
  4. package/dist-lib/components/agents/ChatAttachments.js +144 -0
  5. package/dist-lib/components/agents/transcript-runs.js +1 -1
  6. package/dist-lib/components/chrome/AssociationTabs.js +89 -75
  7. package/dist-lib/components/detail-layout/AssociatedBlock.js +243 -235
  8. package/dist-lib/components/detail-layout/ChildrenCards.js +57 -55
  9. package/dist-lib/components/detail-layout/ChildrenList.js +45 -43
  10. package/dist-lib/components/detail-layout/ChildrenTable.js +93 -91
  11. package/dist-lib/components/detail-layout/ChildrenTimeline.js +160 -155
  12. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +127 -121
  13. package/dist-lib/components/fields/RefCombobox.js +53 -48
  14. package/dist-lib/components/fields/index.js +1 -0
  15. package/dist-lib/components/file-widgets/useFileSelection.js +152 -0
  16. package/dist-lib/components/pages/SmartDetailPage.impl.js +506 -482
  17. package/dist-lib/components/pages/SmartRecordListPage.impl.js +335 -300
  18. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +112 -109
  19. package/dist-lib/components/params/ParamsBlock.js +18 -15
  20. package/dist-lib/components/params/param-editors.js +60 -54
  21. package/dist-lib/components/primitives/RetryButton.js +14 -0
  22. package/dist-lib/components/primitives/StatTile.js +42 -34
  23. package/dist-lib/hooks/useAgentConversation.js +18 -13
  24. package/dist-lib/hooks/useParams.js +54 -52
  25. package/dist-lib/hooks/useSchema.js +5 -2
  26. package/dist-lib/hooks/useTimelineData.js +26 -24
  27. package/dist-lib/index.d.ts +89 -5
  28. package/dist-lib/index.js +95 -93
  29. package/dist-lib/lib/read-display-state.js +19 -0
  30. package/dist-lib/stores/auth.js +1 -0
  31. package/dist-lib/testing.d.ts +1 -1
  32. package/dist-lib/types/fieldType.js +1 -1
  33. package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-DODbtSrY.d.ts} +3 -0
  34. package/package.json +1 -1
@@ -10,73 +10,74 @@ import { IconBtn as d } from "../primitives/IconBtn.js";
10
10
  import { Pill as f } from "../primitives/Pill.js";
11
11
  import { HoverCard as p } from "../primitives/HoverCard.js";
12
12
  import { useText as m } from "../../hooks/useText.js";
13
- import { Spinner as h } from "../primitives/Spinner.js";
14
- import { toast as g } from "../../lib/toast.js";
15
- import { ENTITY_CHILDREN_KEY as _ } from "../../hooks/useChildrenData.js";
16
- import { renderField as v } from "../fields/index.js";
17
- import { useTimelineData as y } from "../../hooks/useTimelineData.js";
18
- import { TimelineComposer as b } from "./TimelineComposer.js";
19
- import { useCallback as x, useEffect as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
20
- import { useMutation as D, useQueryClient as O } from "@tanstack/react-query";
21
- import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
13
+ import { RetryButton as h } from "../primitives/RetryButton.js";
14
+ import { Spinner as g } from "../primitives/Spinner.js";
15
+ import { toast as _ } from "../../lib/toast.js";
16
+ import { ENTITY_CHILDREN_KEY as v } from "../../hooks/useChildrenData.js";
17
+ import { renderField as y } from "../fields/index.js";
18
+ import { useTimelineData as b } from "../../hooks/useTimelineData.js";
19
+ import { TimelineComposer as x } from "./TimelineComposer.js";
20
+ import { useCallback as S, useEffect as C, useLayoutEffect as w, useMemo as ee, useRef as T, useState as te } from "react";
21
+ import { useMutation as E, useQueryClient as D } from "@tanstack/react-query";
22
+ import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
22
23
  //#region src/components/detail-layout/ChildrenTimeline.tsx
23
- var ee = 80, te = 200, M = 6, N = 2e4, P = 280;
24
- function F(e) {
25
- if (e.length > P) return !0;
24
+ var j = 80, M = 200, N = 6, P = 2e4, F = 280;
25
+ function I(e) {
26
+ if (e.length > F) return !0;
26
27
  let t = 0;
27
- for (let n of e) if (n === "\n" && ++t >= M) return !0;
28
+ for (let n of e) if (n === "\n" && ++t >= N) return !0;
28
29
  return !1;
29
30
  }
30
- function I(t, r) {
31
- if (L(r)) {
31
+ function L(t, r) {
32
+ if (R(r)) {
32
33
  let t = r.id;
33
34
  return t == null ? "" : e(t);
34
35
  }
35
36
  return o(n(t, r));
36
37
  }
37
- function L(e) {
38
+ function R(e) {
38
39
  return e.__optimistic === !0;
39
40
  }
40
- function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
41
- let i = m(), a = m("errors"), o = r.entities[e.entity], { rows: s, refs: c, fetchNextPage: l, hasOlder: d, isFetchingOlder: f, isLoading: p, isError: g } = y(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), _ = e.timeline, v = _?.scroll ?? !1, D = (e.sort ?? "").endsWith(":asc"), O = w(() => D ? [...s].reverse() : s, [s, D]), M = _?.auto_scroll ?? "none", N = T(null), P = T(null), F = T(!1), R = T(0), B = T(null), W = T(null), G = T(!0), K = T(null);
42
- S(() => {
43
- F.current = !1, R.current = 0, B.current = null, W.current = null, G.current = !0, K.current = null;
44
- }, [n]), C(() => {
45
- f && N.current && (K.current = {
46
- scrollHeight: N.current.scrollHeight,
47
- scrollTop: N.current.scrollTop
41
+ function z({ config: e, parentEntity: t, parentId: n, schema: r }) {
42
+ let i = m(), a = m("errors"), o = r.entities[e.entity], { rows: s, refs: c, fetchNextPage: l, hasOlder: d, isFetchingOlder: f, isLoading: p, isError: _, retry: v } = b(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), y = e.timeline, E = y?.scroll ?? !1, D = (e.sort ?? "").endsWith(":asc"), N = ee(() => D ? [...s].reverse() : s, [s, D]), P = y?.auto_scroll ?? "none", F = T(null), I = T(null), z = T(!1), V = T(0), G = T(null), K = T(null), q = T(!0), J = T(null);
43
+ C(() => {
44
+ z.current = !1, V.current = 0, G.current = null, K.current = null, q.current = !0, J.current = null;
45
+ }, [n]), w(() => {
46
+ f && F.current && (J.current = {
47
+ scrollHeight: F.current.scrollHeight,
48
+ scrollTop: F.current.scrollTop
48
49
  });
49
- }, [f]), C(() => {
50
- let e = N.current;
51
- if (!e || O.length === 0 || !o) {
52
- R.current = O.length;
50
+ }, [f]), w(() => {
51
+ let e = F.current;
52
+ if (!e || N.length === 0 || !o) {
53
+ V.current = N.length;
53
54
  return;
54
55
  }
55
- let t = I(o, O[0]), n = I(o, O[O.length - 1]), r = !F.current, i = O.length > R.current && R.current > 0, a = i && (D && t !== B.current && n === W.current || !D && n !== W.current && t === B.current), s = i && !a;
56
- if (r) D && M === "bottom" && (e.scrollTop = e.scrollHeight), F.current = !0;
57
- else if (a && K.current) {
58
- let t = K.current;
59
- D && (e.scrollTop = t.scrollTop + (e.scrollHeight - t.scrollHeight)), K.current = null;
60
- } else s && D && G.current && (e.scrollTop = e.scrollHeight);
61
- R.current = O.length, B.current = t, W.current = n;
56
+ let t = L(o, N[0]), n = L(o, N[N.length - 1]), r = !z.current, i = N.length > V.current && V.current > 0, a = i && (D && t !== G.current && n === K.current || !D && n !== K.current && t === G.current), s = i && !a;
57
+ if (r) D && P === "bottom" && (e.scrollTop = e.scrollHeight), z.current = !0;
58
+ else if (a && J.current) {
59
+ let t = J.current;
60
+ D && (e.scrollTop = t.scrollTop + (e.scrollHeight - t.scrollHeight)), J.current = null;
61
+ } else s && D && q.current && (e.scrollTop = e.scrollHeight);
62
+ V.current = N.length, G.current = t, K.current = n;
62
63
  }, [
63
- O,
64
- M,
64
+ N,
65
+ P,
65
66
  D,
66
67
  o
67
68
  ]);
68
- let q = x(() => {
69
- let e = N.current;
70
- e && (G.current = e.scrollHeight - e.scrollTop - e.clientHeight < ee);
69
+ let Y = S(() => {
70
+ let e = F.current;
71
+ e && (q.current = e.scrollHeight - e.scrollTop - e.clientHeight < j);
71
72
  }, []);
72
- S(() => {
73
- let e = P.current;
73
+ C(() => {
74
+ let e = I.current;
74
75
  if (!e || typeof IntersectionObserver > "u") return;
75
76
  let t = new IntersectionObserver((e) => {
76
77
  for (let t of e) t.isIntersecting && d && !f && l();
77
78
  }, {
78
- root: N.current ?? null,
79
- rootMargin: `${te}px 0px 0px 0px`,
79
+ root: F.current ?? null,
80
+ rootMargin: `${M}px 0px 0px 0px`,
80
81
  threshold: 0
81
82
  });
82
83
  return t.observe(e), () => t.disconnect();
@@ -85,52 +86,56 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
85
86
  f,
86
87
  l
87
88
  ]);
88
- let [J, Y] = E(null);
89
+ let [X, Z] = te(null);
89
90
  if (!o) return null;
90
- let X = e.quick_add?.fields ?? [_?.content_field].filter(Boolean), Z = i(o.display?.name_plural) || i(o.display?.name) || e.entity, Q = d ? /* @__PURE__ */ A("div", {
91
+ let Q = e.quick_add?.fields ?? [y?.content_field].filter(Boolean), ne = i(o.display?.name_plural) || i(o.display?.name) || e.entity, re = d ? /* @__PURE__ */ k("div", {
91
92
  style: {
92
93
  display: "flex",
93
94
  justifyContent: "center",
94
95
  padding: "6px 0"
95
96
  },
96
- children: /* @__PURE__ */ A(u, {
97
+ children: /* @__PURE__ */ k(u, {
97
98
  size: "xs",
98
99
  onClick: () => l(),
99
100
  disabled: f,
100
- icon: f ? /* @__PURE__ */ A(h, { size: 11 }) : void 0,
101
+ icon: f ? /* @__PURE__ */ k(g, { size: 11 }) : void 0,
101
102
  children: f ? i("record.loading", "Loading…") : i("record.timeline.load_older", "Load older")
102
103
  })
103
- }) : null, ne = /* @__PURE__ */ A("div", {
104
- ref: P,
104
+ }) : null, ie = /* @__PURE__ */ k("div", {
105
+ ref: I,
105
106
  "aria-hidden": "true",
106
107
  style: { height: 1 }
107
108
  }), $;
108
- if (g) $ = /* @__PURE__ */ A("div", {
109
+ if (_) $ = /* @__PURE__ */ A("div", {
109
110
  style: {
110
111
  fontSize: 12.5,
111
112
  color: "var(--danger)",
112
113
  padding: 12
113
114
  },
114
- children: a("record.related_rows_unreadable", "The related records could not be loaded.")
115
+ children: [
116
+ a("record.related_rows_unreadable", "The related records could not be loaded."),
117
+ " ",
118
+ /* @__PURE__ */ k(h, { onRetry: v })
119
+ ]
115
120
  });
116
- else if (p) $ = /* @__PURE__ */ j("div", {
121
+ else if (p) $ = /* @__PURE__ */ A("div", {
117
122
  style: {
118
123
  display: "flex",
119
124
  flexDirection: "column",
120
125
  gap: 8,
121
126
  padding: 12
122
127
  },
123
- children: [/* @__PURE__ */ A("div", { style: {
128
+ children: [/* @__PURE__ */ k("div", { style: {
124
129
  height: 64,
125
130
  background: "var(--surface-3)",
126
131
  borderRadius: "var(--radius-md)"
127
- } }), /* @__PURE__ */ A("div", { style: {
132
+ } }), /* @__PURE__ */ k("div", { style: {
128
133
  height: 64,
129
134
  background: "var(--surface-3)",
130
135
  borderRadius: "var(--radius-md)"
131
136
  } })]
132
137
  });
133
- else if (O.length === 0) $ = /* @__PURE__ */ j(k, { children: [ne, /* @__PURE__ */ A("div", {
138
+ else if (N.length === 0) $ = /* @__PURE__ */ A(O, { children: [ie, /* @__PURE__ */ k("div", {
134
139
  style: {
135
140
  fontSize: 12.5,
136
141
  color: "var(--text-3)",
@@ -140,35 +145,35 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
140
145
  })] });
141
146
  else {
142
147
  let a = (i, a) => {
143
- let s = I(o, i) || String(a);
144
- return /* @__PURE__ */ A(z, {
148
+ let s = L(o, i) || String(a);
149
+ return /* @__PURE__ */ k(B, {
145
150
  row: i,
146
151
  rowId: s,
147
152
  childEntity: o,
148
153
  entityCode: e.entity,
149
154
  parentEntity: t,
150
155
  parentId: n,
151
- timeline: _,
152
- editableFields: X,
156
+ timeline: y,
157
+ editableFields: Q,
153
158
  refs: c,
154
- isEditing: J === s,
155
- onStartEdit: () => Y(s),
156
- onCancelEdit: () => Y(null),
157
- onSaved: () => Y(null),
159
+ isEditing: X === s,
160
+ onStartEdit: () => Z(s),
161
+ onCancelEdit: () => Z(null),
162
+ onSaved: () => Z(null),
158
163
  schema: r,
159
- optimistic: L(i)
164
+ optimistic: R(i)
160
165
  }, s);
161
- }, s = _?.time_field, l;
166
+ }, s = y?.time_field, l;
162
167
  if (s) {
163
168
  let e = [], t = o?.fields?.get(s), n = {
164
169
  zone: i.timeZone,
165
170
  declared: !!(t?.timezone || o?.default_timezone)
166
171
  };
167
- O.forEach((t, r) => {
168
- let a = t[s], o = V(a, n), c = e[e.length - 1];
172
+ N.forEach((t, r) => {
173
+ let a = t[s], o = H(a, n), c = e[e.length - 1];
169
174
  !c || c.key !== o ? e.push({
170
175
  key: o,
171
- label: H(i, a, n),
176
+ label: U(i, a, n),
172
177
  rows: [{
173
178
  row: t,
174
179
  idx: r
@@ -177,25 +182,25 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
177
182
  row: t,
178
183
  idx: r
179
184
  });
180
- }), l = e.map((e) => /* @__PURE__ */ j("div", {
185
+ }), l = e.map((e) => /* @__PURE__ */ A("div", {
181
186
  style: {
182
187
  display: "flex",
183
188
  flexDirection: "column",
184
189
  gap: 8
185
190
  },
186
- children: [/* @__PURE__ */ A(U, {
191
+ children: [/* @__PURE__ */ k(W, {
187
192
  label: e.label,
188
193
  count: e.rows.length
189
194
  }), e.rows.map(({ row: e, idx: t }) => a(e, t))]
190
195
  }, `day-${e.key}`));
191
- } else l = O.map((e, t) => a(e, t));
192
- $ = /* @__PURE__ */ j(k, { children: [
193
- ne,
194
- Q,
196
+ } else l = N.map((e, t) => a(e, t));
197
+ $ = /* @__PURE__ */ A(O, { children: [
198
+ ie,
199
+ re,
195
200
  l
196
201
  ] });
197
202
  }
198
- return v ? /* @__PURE__ */ j("div", {
203
+ return E ? /* @__PURE__ */ A("div", {
199
204
  style: {
200
205
  display: "flex",
201
206
  flexDirection: "column",
@@ -205,24 +210,24 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
205
210
  color: "var(--text)"
206
211
  },
207
212
  children: [
208
- /* @__PURE__ */ A("div", {
213
+ /* @__PURE__ */ k("div", {
209
214
  style: {
210
215
  padding: "10px 16px",
211
216
  borderBottom: "1px solid var(--divider)",
212
217
  background: "var(--surface)"
213
218
  },
214
- children: /* @__PURE__ */ A("h3", {
219
+ children: /* @__PURE__ */ k("h3", {
215
220
  style: {
216
221
  margin: 0,
217
222
  fontSize: 12.5,
218
223
  fontWeight: 600
219
224
  },
220
- children: Z
225
+ children: ne
221
226
  })
222
227
  }),
223
- /* @__PURE__ */ A("div", {
224
- ref: N,
225
- onScroll: q,
228
+ /* @__PURE__ */ k("div", {
229
+ ref: F,
230
+ onScroll: Y,
226
231
  style: {
227
232
  flex: 1,
228
233
  overflowY: "auto",
@@ -233,41 +238,41 @@ function R({ config: e, parentEntity: t, parentId: n, schema: r }) {
233
238
  },
234
239
  children: $
235
240
  }),
236
- /* @__PURE__ */ A(b, {
241
+ /* @__PURE__ */ k(x, {
237
242
  config: e,
238
243
  parentEntity: t,
239
244
  parentId: n,
240
245
  schema: r
241
246
  })
242
247
  ]
243
- }) : /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("div", {
248
+ }) : /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("div", {
244
249
  style: {
245
250
  display: "flex",
246
251
  flexDirection: "column",
247
252
  gap: 8
248
253
  },
249
254
  children: $
250
- }), /* @__PURE__ */ A(b, {
255
+ }), /* @__PURE__ */ k(x, {
251
256
  config: e,
252
257
  parentEntity: t,
253
258
  parentId: n,
254
259
  schema: r
255
260
  })] });
256
261
  }
257
- function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, parentId: b, timeline: S, editableFields: C, refs: w, isEditing: T, onStartEdit: k, onCancelEdit: ee, onSaved: te, schema: M, optimistic: N = !1 }) {
258
- let P = m(), F = m("errors"), I = O(), [L, R] = E({}), z = x(() => {
262
+ function B({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: h, parentId: b, timeline: x, editableFields: C, refs: w, isEditing: ee, onStartEdit: T, onCancelEdit: O, onSaved: j, schema: M, optimistic: N = !1 }) {
263
+ let P = m(), F = m("errors"), I = D(), [L, R] = te({}), z = S(() => {
259
264
  I.invalidateQueries({ queryKey: [
260
- _,
261
- y,
265
+ v,
266
+ h,
262
267
  b,
263
268
  p
264
269
  ] });
265
270
  }, [
266
271
  I,
267
- y,
272
+ h,
268
273
  b,
269
274
  p
270
- ]), V = D({
275
+ ]), B = E({
271
276
  mutationFn: (e) => {
272
277
  let r = t.$row_version, i = typeof r == "string" && r !== "" ? {
273
278
  ...e,
@@ -276,30 +281,30 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
276
281
  return s(p, n, i);
277
282
  },
278
283
  onSuccess: () => {
279
- z(), g.success(P("record.timeline.updated", "Updated")), te();
284
+ z(), _.success(P("record.timeline.updated", "Updated")), j();
280
285
  },
281
- onError: (e) => g.error(c(F, e))
282
- }), H = D({
286
+ onError: (e) => _.error(c(F, e))
287
+ }), H = E({
283
288
  mutationFn: () => a(p, n),
284
289
  onSuccess: () => {
285
- z(), g.success(P("record.timeline.deleted", "Deleted"));
290
+ z(), _.success(P("record.timeline.deleted", "Deleted"));
286
291
  },
287
- onError: (e) => g.error(c(F, e))
288
- }), U = x(() => {
292
+ onError: (e) => _.error(c(F, e))
293
+ }), U = S(() => {
289
294
  let e = {};
290
295
  for (let n of C) e[n] = t[n] ?? "";
291
- R(e), k();
296
+ R(e), T();
292
297
  }, [
293
298
  t,
294
299
  C,
295
- k
296
- ]), G = x((e, t) => {
300
+ T
301
+ ]), W = S((e, t) => {
297
302
  R((n) => ({
298
303
  ...n,
299
304
  [e]: t
300
305
  }));
301
- }, []), K = S?.time_field, q = S?.type_field, J = S?.summary_field, Y = S?.content_field, X = S?.author_field, Z = S?.direction_field, Q = S?.intent_field;
302
- return T ? /* @__PURE__ */ j("div", {
306
+ }, []), K = x?.time_field, q = x?.type_field, J = x?.summary_field, Y = x?.content_field, X = x?.author_field, Z = x?.direction_field, Q = x?.intent_field;
307
+ return ee ? /* @__PURE__ */ A("div", {
303
308
  style: {
304
309
  borderRadius: "var(--radius-lg)",
305
310
  border: "1px solid var(--accent)",
@@ -311,7 +316,7 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
311
316
  },
312
317
  children: [C.map((e) => {
313
318
  let t = o.fields.get(e);
314
- return t ? /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
319
+ return t ? /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
315
320
  style: {
316
321
  fontSize: 11,
317
322
  color: "var(--text-3)",
@@ -319,40 +324,40 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
319
324
  display: "block"
320
325
  },
321
326
  children: r(P, t, e, M.entities)
322
- }), v({
327
+ }), y({
323
328
  field: t,
324
329
  fieldName: e,
325
330
  value: L[e] ?? "",
326
331
  mode: "edit",
327
- onChange: (t) => G(e, t),
332
+ onChange: (t) => W(e, t),
328
333
  record: L,
329
334
  t: P
330
335
  })] }, e) : null;
331
- }), /* @__PURE__ */ j("div", {
336
+ }), /* @__PURE__ */ A("div", {
332
337
  style: {
333
338
  display: "flex",
334
339
  alignItems: "center",
335
340
  gap: 6,
336
341
  paddingTop: 4
337
342
  },
338
- children: [/* @__PURE__ */ A(u, {
343
+ children: [/* @__PURE__ */ k(u, {
339
344
  kind: "primary",
340
345
  size: "xs",
341
- icon: V.isPending ? /* @__PURE__ */ A(h, { size: 12 }) : /* @__PURE__ */ A(l.check, { size: 12 }),
342
- onClick: () => V.mutate(L),
343
- disabled: V.isPending,
344
- children: V.isPending ? P("dialog.saving", "Saving…") : P("dialog.save", "Save")
345
- }), /* @__PURE__ */ A(u, {
346
+ icon: B.isPending ? /* @__PURE__ */ k(g, { size: 12 }) : /* @__PURE__ */ k(l.check, { size: 12 }),
347
+ onClick: () => B.mutate(L),
348
+ disabled: B.isPending,
349
+ children: B.isPending ? P("dialog.saving", "Saving…") : P("dialog.save", "Save")
350
+ }), /* @__PURE__ */ k(u, {
346
351
  size: "xs",
347
- icon: /* @__PURE__ */ A(l.x, { size: 12 }),
352
+ icon: /* @__PURE__ */ k(l.x, { size: 12 }),
348
353
  onClick: () => {
349
- R({}), ee();
354
+ R({}), O();
350
355
  },
351
- disabled: V.isPending,
356
+ disabled: B.isPending,
352
357
  children: P("dialog.cancel", "Cancel")
353
358
  })]
354
359
  })]
355
- }) : /* @__PURE__ */ j("div", {
360
+ }) : /* @__PURE__ */ A("div", {
356
361
  className: "group",
357
362
  "data-optimistic": N || void 0,
358
363
  style: {
@@ -366,7 +371,7 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
366
371
  onMouseEnter: (e) => e.currentTarget.style.borderColor = "var(--border-strong)",
367
372
  onMouseLeave: (e) => e.currentTarget.style.borderColor = "var(--border)",
368
373
  children: [
369
- /* @__PURE__ */ j("div", {
374
+ /* @__PURE__ */ A("div", {
370
375
  style: {
371
376
  display: "flex",
372
377
  alignItems: "center",
@@ -376,9 +381,9 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
376
381
  color: "var(--text-3)"
377
382
  },
378
383
  children: [
379
- K && t[K] != null && o.fields.get(K) && /* @__PURE__ */ A("span", {
384
+ K && t[K] != null && o.fields.get(K) && /* @__PURE__ */ k("span", {
380
385
  style: { fontWeight: 500 },
381
- children: v({
386
+ children: y({
382
387
  field: o.fields.get(K),
383
388
  fieldName: K,
384
389
  value: t[K],
@@ -388,10 +393,10 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
388
393
  t: P
389
394
  })
390
395
  }),
391
- q && t[q] != null && o.fields.get(q) && /* @__PURE__ */ A(f, {
396
+ q && t[q] != null && o.fields.get(q) && /* @__PURE__ */ k(f, {
392
397
  tone: "slate",
393
398
  size: "xs",
394
- children: v({
399
+ children: y({
395
400
  field: o.fields.get(q),
396
401
  fieldName: q,
397
402
  value: t[q],
@@ -401,14 +406,14 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
401
406
  t: P
402
407
  })
403
408
  }),
404
- Z && t[Z] != null && o.fields.get(Z) && /* @__PURE__ */ A(W, {
409
+ Z && t[Z] != null && o.fields.get(Z) && /* @__PURE__ */ k(G, {
405
410
  value: t[Z],
406
411
  field: o.fields.get(Z)
407
412
  }),
408
- Q && t[Q] != null && o.fields.get(Q) && /* @__PURE__ */ A(f, {
413
+ Q && t[Q] != null && o.fields.get(Q) && /* @__PURE__ */ k(f, {
409
414
  tone: "slate",
410
415
  size: "xs",
411
- children: v({
416
+ children: y({
412
417
  field: o.fields.get(Q),
413
418
  fieldName: Q,
414
419
  value: t[Q],
@@ -418,7 +423,7 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
418
423
  t: P
419
424
  })
420
425
  }),
421
- X && t[X] != null && o.fields.get(X) && /* @__PURE__ */ A("span", { children: i(P("record.timeline.by_author", "by {author}"), { author: v({
426
+ X && t[X] != null && o.fields.get(X) && /* @__PURE__ */ k("span", { children: i(P("record.timeline.by_author", "by {author}"), { author: y({
422
427
  field: o.fields.get(X),
423
428
  fieldName: X,
424
429
  value: t[X],
@@ -427,34 +432,34 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
427
432
  refs: w,
428
433
  t: P
429
434
  }) }) }),
430
- !N && /* @__PURE__ */ j("div", {
435
+ !N && /* @__PURE__ */ A("div", {
431
436
  style: {
432
437
  marginLeft: "auto",
433
438
  display: "flex",
434
439
  alignItems: "center",
435
440
  gap: 2
436
441
  },
437
- children: [/* @__PURE__ */ A(d, {
442
+ children: [/* @__PURE__ */ k(d, {
438
443
  size: 22,
439
- icon: /* @__PURE__ */ A(l.edit, { size: 11 }),
444
+ icon: /* @__PURE__ */ k(l.edit, { size: 11 }),
440
445
  onClick: U,
441
446
  title: P("record.action.edit", "Edit")
442
- }), /* @__PURE__ */ A(d, {
447
+ }), /* @__PURE__ */ k(d, {
443
448
  size: 22,
444
- icon: /* @__PURE__ */ A(l.trash, { size: 11 }),
449
+ icon: /* @__PURE__ */ k(l.trash, { size: 11 }),
445
450
  onClick: () => H.mutate(),
446
451
  title: P("record.action.delete", "Delete")
447
452
  })]
448
453
  })
449
454
  ]
450
455
  }),
451
- J && t[J] != null && o.fields.get(J) && /* @__PURE__ */ A("div", {
456
+ J && t[J] != null && o.fields.get(J) && /* @__PURE__ */ k("div", {
452
457
  style: {
453
458
  fontSize: 12.5,
454
459
  fontWeight: 500,
455
460
  marginTop: 6
456
461
  },
457
- children: v({
462
+ children: y({
458
463
  field: o.fields.get(J),
459
464
  fieldName: J,
460
465
  value: t[J],
@@ -464,8 +469,8 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
464
469
  t: P
465
470
  })
466
471
  }),
467
- Y && t[Y] != null && Y !== J && o.fields.get(Y) && /* @__PURE__ */ A(B, {
468
- rendered: v({
472
+ Y && t[Y] != null && Y !== J && o.fields.get(Y) && /* @__PURE__ */ k(V, {
473
+ rendered: y({
469
474
  field: o.fields.get(Y),
470
475
  fieldName: Y,
471
476
  value: t[Y],
@@ -479,36 +484,36 @@ function z({ row: t, rowId: n, childEntity: o, entityCode: p, parentEntity: y, p
479
484
  ]
480
485
  });
481
486
  }
482
- function B({ rendered: e, text: t }) {
487
+ function V({ rendered: e, text: t }) {
483
488
  let n = m(), r = {
484
489
  fontSize: 12.5,
485
490
  fontWeight: 400,
486
491
  marginTop: 6
487
492
  };
488
- if (!F(t)) return /* @__PURE__ */ A("div", {
493
+ if (!I(t)) return /* @__PURE__ */ k("div", {
489
494
  style: r,
490
495
  children: e
491
496
  });
492
- let i = t.length > N, a = i ? t.slice(0, N) : t;
493
- return /* @__PURE__ */ A("div", {
497
+ let i = t.length > P, a = i ? t.slice(0, P) : t;
498
+ return /* @__PURE__ */ k("div", {
494
499
  style: {
495
500
  ...r,
496
501
  display: "-webkit-box",
497
502
  WebkitBoxOrient: "vertical",
498
- WebkitLineClamp: M,
503
+ WebkitLineClamp: N,
499
504
  overflow: "hidden",
500
505
  whiteSpace: "pre-wrap",
501
506
  overflowWrap: "anywhere"
502
507
  },
503
- children: /* @__PURE__ */ A(p, {
508
+ children: /* @__PURE__ */ k(p, {
504
509
  width: 380,
505
- content: /* @__PURE__ */ j("div", {
510
+ content: /* @__PURE__ */ A("div", {
506
511
  style: {
507
512
  fontSize: 12.5,
508
513
  whiteSpace: "pre-wrap",
509
514
  overflowWrap: "anywhere"
510
515
  },
511
- children: [a, i && /* @__PURE__ */ A("div", {
516
+ children: [a, i && /* @__PURE__ */ k("div", {
512
517
  style: {
513
518
  marginTop: 8,
514
519
  fontSize: 11,
@@ -521,10 +526,10 @@ function B({ rendered: e, text: t }) {
521
526
  })
522
527
  });
523
528
  }
524
- function V(n, r) {
529
+ function H(n, r) {
525
530
  return n == null ? "" : t(e(n), r) ?? "";
526
531
  }
527
- function H(n, r, i) {
532
+ function U(n, r, i) {
528
533
  let a = r == null ? null : t(e(r), i);
529
534
  if (!a) return "—";
530
535
  let o = Date.now();
@@ -535,8 +540,8 @@ function H(n, r, i) {
535
540
  timeZone: "UTC"
536
541
  });
537
542
  }
538
- function U({ label: e, count: t }) {
539
- return /* @__PURE__ */ j("div", {
543
+ function W({ label: e, count: t }) {
544
+ return /* @__PURE__ */ A("div", {
540
545
  style: {
541
546
  position: "sticky",
542
547
  top: -4,
@@ -548,7 +553,7 @@ function U({ label: e, count: t }) {
548
553
  background: "linear-gradient(180deg, var(--surface-2) 0%, var(--surface-2) 65%, transparent 100%)"
549
554
  },
550
555
  children: [
551
- /* @__PURE__ */ A("span", {
556
+ /* @__PURE__ */ k("span", {
552
557
  style: {
553
558
  fontSize: 11,
554
559
  fontWeight: 600,
@@ -556,12 +561,12 @@ function U({ label: e, count: t }) {
556
561
  },
557
562
  children: e
558
563
  }),
559
- /* @__PURE__ */ A("span", { style: {
564
+ /* @__PURE__ */ k("span", { style: {
560
565
  flex: 1,
561
566
  height: 1,
562
567
  background: "var(--divider)"
563
568
  } }),
564
- /* @__PURE__ */ A("span", {
569
+ /* @__PURE__ */ k("span", {
565
570
  className: "num",
566
571
  style: {
567
572
  fontSize: 10.5,
@@ -572,9 +577,9 @@ function U({ label: e, count: t }) {
572
577
  ]
573
578
  });
574
579
  }
575
- function W({ value: e, field: t }) {
576
- let n = m(), r = G(e, t);
577
- return r === null ? null : /* @__PURE__ */ j("span", {
580
+ function G({ value: e, field: t }) {
581
+ let n = m(), r = K(e, t);
582
+ return r === null ? null : /* @__PURE__ */ A("span", {
578
583
  style: {
579
584
  display: "inline-flex",
580
585
  alignItems: "center",
@@ -586,10 +591,10 @@ function W({ value: e, field: t }) {
586
591
  background: r ? "var(--accent-soft)" : "var(--info-soft)",
587
592
  color: r ? "var(--accent)" : "var(--info)"
588
593
  },
589
- children: [A(r ? l.arrowUp : l.arrowDown, { size: 10 }), r ? n("record.timeline.outbound", "Out") : n("record.timeline.inbound", "In")]
594
+ children: [k(r ? l.arrowUp : l.arrowDown, { size: 10 }), r ? n("record.timeline.outbound", "Out") : n("record.timeline.inbound", "In")]
590
595
  });
591
596
  }
592
- function G(e, t) {
597
+ function K(e, t) {
593
598
  if (t.type === "bool") return e === !0;
594
599
  if (typeof e == "string") {
595
600
  let t = e.toLowerCase();
@@ -599,4 +604,4 @@ function G(e, t) {
599
604
  return null;
600
605
  }
601
606
  //#endregion
602
- export { R as ChildrenTimeline };
607
+ export { z as ChildrenTimeline };