@nivaro/react 0.3.68 → 0.3.70

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.
@@ -1,45 +1,45 @@
1
- import { jsxs as h, jsx as n, Fragment as C } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as n, Fragment as w } from "react/jsx-runtime";
2
2
  import { X as S } from "lucide-react";
3
- import { useMemo as N } from "react";
4
- import { validateExpression as O } from "../../../lib/expression.js";
5
- import { displayFormulaOf as R, textRulesOf as T, counterOf as M, confirmChangeOf as L } from "../../../lib/placement-behaviour.js";
6
- import { cn as F } from "../../../lib/utils.js";
7
- import { RoleConditionRow as P, PipelineStateConditionRow as $ } from "../editors/lock-conditions.js";
8
- import { useColumnFacts as A, columnOf as D } from "../inspect/inspect-api.js";
3
+ import { useMemo as O } from "react";
4
+ import { validateExpression as N } from "../../../lib/expression.js";
5
+ import { displayFormulaOf as T, textRulesOf as R, counterOf as M, confirmChangeOf as F } from "../../../lib/placement-behaviour.js";
6
+ import { cn as L } from "../../../lib/utils.js";
7
+ import { RoleConditionRow as A, PipelineStateConditionRow as $ } from "../editors/lock-conditions.js";
8
+ import { useColumnFacts as P, columnOf as D } from "../inspect/inspect-api.js";
9
9
  import { effectText as I, tintCard as W } from "../panel-style.js";
10
10
  import { isRelational as K } from "./applies.js";
11
- import { useFieldCtx as g } from "./field-context.js";
12
- import { useInspectorEnv as j, Setting as p, TextInput as _, TextArea as q, Segmented as k, DraftInput as E, AddButton as H, Toggle as v } from "./kit.js";
11
+ import { useFieldCtx as b } from "./field-context.js";
12
+ import { useInspectorEnv as j, Setting as p, TextInput as _, TextArea as q, Segmented as k, DraftInput as E, AddButton as H, Toggle as g } from "./kit.js";
13
13
  const U = "rounded p-0.5 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-foreground";
14
- function z(l) {
15
- if (K(l)) return !1;
16
- const s = l.iface ?? "";
17
- return ["string", "text", "richtext", "rich_text", "markdown", "wysiwyg"].includes(l.type) || /textarea|rich|wysiwyg|markdown/i.test(s);
14
+ function z(t) {
15
+ if (K(t)) return !1;
16
+ const i = t.iface ?? "";
17
+ return ["string", "text", "richtext", "rich_text", "markdown", "wysiwyg"].includes(t.type) || /textarea|rich|wysiwyg|markdown/i.test(i);
18
18
  }
19
- function w(l, s, o = {}) {
20
- const c = o.allowM2M === !0 && l.relKind === "M2M";
21
- return !s.startsWith("__") && !l.isPath && (c || l.type !== "alias" && l.relKind !== "M2M") && l.relKind !== "O2M" && l.computedType !== "virtual" && l.computedType !== "read";
19
+ function C(t, i, o = {}) {
20
+ const s = o.allowM2M === !0 && t.relKind === "M2M";
21
+ return !i.startsWith("__") && !t.isPath && (s || t.type !== "alias" && t.relKind !== "M2M") && t.relKind !== "O2M" && t.computedType !== "virtual" && t.computedType !== "read";
22
22
  }
23
- function oe() {
24
- const l = g(), { ov: s, info: o, env: c, row: i } = l, d = o.label, f = T(s), u = (r, a, e) => l.setOverride("text_rules", r.length ? r : void 0, a, e), t = (r, a, e, m) => u(
25
- f.map((y, b) => b === r ? { ...y, ...a } : y),
23
+ function re() {
24
+ const t = b(), { ov: i, info: o, env: s, row: d } = t, c = o.label, f = R(i), u = (r, a, e) => t.setOverride("text_rules", r.length ? r : void 0, a, e), l = (r, a, e, h) => u(
25
+ f.map((v, y) => y === r ? { ...v, ...a } : v),
26
26
  e,
27
- m
27
+ h
28
28
  );
29
- return i.field.startsWith("__") ? null : /* @__PURE__ */ h(
29
+ return d.field.startsWith("__") ? null : /* @__PURE__ */ m(
30
30
  p,
31
31
  {
32
32
  k: "field.text_rules",
33
33
  label: "Label and help by state or role",
34
34
  effect: "Different words in a workflow state or for a role: “Requested date” becomes “Delivered date” once Completed. The first rule that matches wins; the record page, read view and PDF follow it.",
35
35
  children: [
36
- f.map((r, a) => /* @__PURE__ */ h(
36
+ f.map((r, a) => /* @__PURE__ */ m(
37
37
  "div",
38
38
  {
39
39
  "data-text-rule": a,
40
- className: F(W, "space-y-2 px-2.5 py-2"),
40
+ className: L(W, "space-y-2 px-2.5 py-2"),
41
41
  children: [
42
- /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
42
+ /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
43
43
  /* @__PURE__ */ n("div", { className: "flex-1", children: /* @__PURE__ */ n(
44
44
  k,
45
45
  {
@@ -48,7 +48,7 @@ function oe() {
48
48
  { value: "pipeline_state", label: "In a state" },
49
49
  { value: "role", label: "For a role" }
50
50
  ],
51
- onChange: (e) => t(
51
+ onChange: (e) => l(
52
52
  a,
53
53
  e === "role" ? {
54
54
  type: "role",
@@ -56,7 +56,7 @@ function oe() {
56
56
  state_keys: void 0,
57
57
  pipeline_id: void 0
58
58
  } : { type: "pipeline_state", state_keys: [], role_ids: void 0 },
59
- `Change when ${d} reads differently`
59
+ `Change when ${c} reads differently`
60
60
  )
61
61
  }
62
62
  ) }),
@@ -68,27 +68,27 @@ function oe() {
68
68
  "data-tip": "Remove this rule",
69
69
  className: U,
70
70
  onClick: () => u(
71
- f.filter((e, m) => m !== a),
72
- `Remove a label rule from ${d}`
71
+ f.filter((e, h) => h !== a),
72
+ `Remove a label rule from ${c}`
73
73
  ),
74
74
  children: /* @__PURE__ */ n(S, { className: "h-3.5 w-3.5" })
75
75
  }
76
76
  )
77
77
  ] }),
78
78
  r.type === "role" ? /* @__PURE__ */ n(
79
- P,
79
+ A,
80
80
  {
81
81
  roleIds: r.role_ids ?? [],
82
- onRoleIdsChange: (e) => t(a, { role_ids: e }, `Change the roles for ${d}`)
82
+ onRoleIdsChange: (e) => l(a, { role_ids: e }, `Change the roles for ${c}`)
83
83
  }
84
84
  ) : /* @__PURE__ */ n(
85
85
  $,
86
86
  {
87
- collection: c.collection,
87
+ collection: s.collection,
88
88
  pipelineId: r.pipeline_id,
89
89
  stateKeys: r.state_keys ?? [],
90
- onPipelineChange: (e) => t(a, { pipeline_id: e, state_keys: [] }, `Change the pipeline for ${d}`),
91
- onStateKeysChange: (e) => t(a, { state_keys: e }, `Change the states for ${d}`)
90
+ onPipelineChange: (e) => l(a, { pipeline_id: e, state_keys: [] }, `Change the pipeline for ${c}`),
91
+ onStateKeysChange: (e) => l(a, { state_keys: e }, `Change the states for ${c}`)
92
92
  }
93
93
  ),
94
94
  /* @__PURE__ */ n(
@@ -96,8 +96,8 @@ function oe() {
96
96
  {
97
97
  ariaLabel: "Label in this case",
98
98
  value: r.label ?? "",
99
- placeholder: `Label (${d})`,
100
- onChange: (e) => t(a, { label: e || void 0 }, `Change a label rule of ${d}`, !0)
99
+ placeholder: `Label (${c})`,
100
+ onChange: (e) => l(a, { label: e || void 0 }, `Change a label rule of ${c}`, !0)
101
101
  }
102
102
  ),
103
103
  /* @__PURE__ */ n(
@@ -106,7 +106,7 @@ function oe() {
106
106
  ariaLabel: "Help text in this case",
107
107
  value: r.note ?? "",
108
108
  placeholder: "Help text (unchanged when empty)",
109
- onChange: (e) => t(a, { note: e || void 0 }, `Change a help rule of ${d}`, !0)
109
+ onChange: (e) => l(a, { note: e || void 0 }, `Change a help rule of ${c}`, !0)
110
110
  }
111
111
  )
112
112
  ]
@@ -118,7 +118,7 @@ function oe() {
118
118
  {
119
119
  onClick: () => u(
120
120
  [...f, { type: "pipeline_state", state_keys: [] }],
121
- `Add a label rule to ${d}`
121
+ `Add a label rule to ${c}`
122
122
  ),
123
123
  children: "+ Add a rule"
124
124
  }
@@ -127,29 +127,29 @@ function oe() {
127
127
  }
128
128
  );
129
129
  }
130
- function re() {
131
- const l = g(), { ov: s, info: o, env: c, row: i } = l, { data: d } = A(c.collection), f = D(d, i.field);
132
- if (!z(o) || i.field.startsWith("__")) return null;
133
- const u = o.label, t = M(s), r = (f == null ? void 0 : f.max_length) != null && f.max_length > 0 ? f.max_length : null, a = (e, m, y) => l.setOverride("counter", e, m, y);
134
- return /* @__PURE__ */ h("div", { "data-setting": "field.counter", className: "space-y-3", children: [
130
+ function ie() {
131
+ const t = b(), { ov: i, info: o, env: s, row: d } = t, { data: c } = P(s.collection), f = D(c, d.field);
132
+ if (!z(o) || d.field.startsWith("__")) return null;
133
+ const u = o.label, l = M(i), r = (f == null ? void 0 : f.max_length) != null && f.max_length > 0 ? f.max_length : null, a = (e, h, v) => t.setOverride("counter", e, h, v);
134
+ return /* @__PURE__ */ m("div", { "data-setting": "field.counter", className: "space-y-3", children: [
135
135
  /* @__PURE__ */ n(
136
- v,
136
+ g,
137
137
  {
138
138
  k: "field.counter.on",
139
139
  label: "Counter and limit",
140
140
  effect: r ? `Counts as people type. The limit starts at the column size (${r.toLocaleString()} characters); past it the form will not save.` : "Counts as people type; past a limit the form will not save.",
141
- checked: !!t,
141
+ checked: !!l,
142
142
  onChange: (e) => a(
143
143
  e ? { unit: "characters", ...r ? { limit: r } : {} } : void 0,
144
144
  e ? `Count the characters of ${u}` : `Stop counting ${u}`
145
145
  )
146
146
  }
147
147
  ),
148
- t && /* @__PURE__ */ h(C, { children: [
148
+ l && /* @__PURE__ */ m(w, { children: [
149
149
  /* @__PURE__ */ n(p, { k: "field.counter.unit", label: "Count", effect: "Characters or words.", children: /* @__PURE__ */ n(
150
150
  k,
151
151
  {
152
- value: t.unit,
152
+ value: l.unit,
153
153
  options: [
154
154
  { value: "characters", label: "Characters" },
155
155
  { value: "words", label: "Words" }
@@ -157,7 +157,7 @@ function re() {
157
157
  onChange: (e) => a(
158
158
  {
159
159
  unit: e,
160
- ...e === "words" ? {} : t.limit != null ? { limit: t.limit } : r ? { limit: r } : {}
160
+ ...e === "words" ? {} : l.limit != null ? { limit: l.limit } : r ? { limit: r } : {}
161
161
  },
162
162
  `Count the ${e} of ${u}`
163
163
  )
@@ -168,18 +168,18 @@ function re() {
168
168
  {
169
169
  k: "field.counter.limit",
170
170
  label: "Limit",
171
- effect: t.unit === "words" ? "Most words allowed. Empty counts without a limit." : `Most characters allowed. Empty counts without a limit${r ? `; the column holds ${r.toLocaleString()}` : ""}.`,
171
+ effect: l.unit === "words" ? "Most words allowed. Empty counts without a limit." : `Most characters allowed. Empty counts without a limit${r ? `; the column holds ${r.toLocaleString()}` : ""}.`,
172
172
  children: /* @__PURE__ */ n(
173
173
  _,
174
174
  {
175
175
  type: "number",
176
176
  ariaLabel: "Limit",
177
- value: t.limit == null ? "" : String(t.limit),
178
- placeholder: t.unit === "characters" && r ? String(r) : "No limit",
177
+ value: l.limit == null ? "" : String(l.limit),
178
+ placeholder: l.unit === "characters" && r ? String(r) : "No limit",
179
179
  onChange: (e) => {
180
- const m = e === "" ? void 0 : Math.max(1, Math.floor(Number(e)));
181
- m !== void 0 && !Number.isFinite(m) || a(
182
- { unit: t.unit, ...m ? { limit: m } : {} },
180
+ const h = e === "" ? void 0 : Math.max(1, Math.floor(Number(e)));
181
+ h !== void 0 && !Number.isFinite(h) || a(
182
+ { unit: l.unit, ...h ? { limit: h } : {} },
183
183
  `Set the limit of ${u}`,
184
184
  !0
185
185
  );
@@ -191,20 +191,20 @@ function re() {
191
191
  ] })
192
192
  ] });
193
193
  }
194
- function ie() {
195
- var d;
196
- const l = g(), { ov: s, info: o, row: c } = l;
197
- if (c.field.startsWith("__")) return null;
198
- const i = s.required === !0 || s.required === void 0 && !!((d = o.global) != null && d.required);
194
+ function se() {
195
+ var c;
196
+ const t = b(), { ov: i, info: o, row: s } = t;
197
+ if (s.field.startsWith("__")) return null;
198
+ const d = i.required === !0 || i.required === void 0 && !!((c = o.global) != null && c.required);
199
199
  return /* @__PURE__ */ n(
200
- v,
200
+ g,
201
201
  {
202
202
  k: "field.recommended",
203
203
  label: "Recommended",
204
- effect: i ? "Required already wins; switch Required off to make this a recommendation." : "An amber marker and a reminder on save listing what is still empty. Saving is never blocked.",
205
- checked: s.recommended === !0 && !i,
206
- disabled: i,
207
- onChange: (f) => l.setOverride(
204
+ effect: d ? "Required already wins; switch Required off to make this a recommendation." : "An amber marker and a reminder on save listing what is still empty. Saving is never blocked.",
205
+ checked: i.recommended === !0 && !d,
206
+ disabled: d,
207
+ onChange: (f) => t.setOverride(
208
208
  "recommended",
209
209
  f ? !0 : void 0,
210
210
  f ? `Recommend ${o.label}` : `Stop recommending ${o.label}`
@@ -212,13 +212,13 @@ function ie() {
212
212
  }
213
213
  );
214
214
  }
215
- function se() {
216
- const l = g(), { ov: s, info: o, env: c, row: i } = l;
217
- if (!w(o, i.field)) return null;
218
- const d = o.label, f = L(s), u = s.confirm_change && typeof s.confirm_change == "object" ? s.confirm_change : {}, t = typeof u.pipeline_id == "string" ? u.pipeline_id : void 0, r = (a, e) => l.setOverride("confirm_change", a, e);
219
- return /* @__PURE__ */ h("div", { "data-setting": "field.confirm_change", className: "space-y-3", children: [
215
+ function de() {
216
+ const t = b(), { ov: i, info: o, env: s, row: d } = t;
217
+ if (!C(o, d.field)) return null;
218
+ const c = o.label, f = F(i), u = i.confirm_change && typeof i.confirm_change == "object" ? i.confirm_change : {}, l = typeof u.pipeline_id == "string" ? u.pipeline_id : void 0, r = (a, e) => t.setOverride("confirm_change", a, e);
219
+ return /* @__PURE__ */ m("div", { "data-setting": "field.confirm_change", className: "space-y-3", children: [
220
220
  /* @__PURE__ */ n(
221
- v,
221
+ g,
222
222
  {
223
223
  k: "field.confirm_change.on",
224
224
  label: "Confirm changes on saved records",
@@ -226,7 +226,7 @@ function se() {
226
226
  checked: !!f,
227
227
  onChange: (a) => r(
228
228
  a ? { state_keys: [] } : void 0,
229
- a ? `Confirm changes to ${d}` : `Stop confirming changes to ${d}`
229
+ a ? `Confirm changes to ${c}` : `Stop confirming changes to ${c}`
230
230
  )
231
231
  }
232
232
  ),
@@ -239,16 +239,16 @@ function se() {
239
239
  children: /* @__PURE__ */ n(
240
240
  $,
241
241
  {
242
- collection: c.collection,
243
- pipelineId: t,
242
+ collection: s.collection,
243
+ pipelineId: l,
244
244
  stateKeys: f.state_keys,
245
245
  onPipelineChange: (a) => r(
246
246
  { ...a ? { pipeline_id: a } : {}, state_keys: [] },
247
- `Change the pipeline that confirms ${d}`
247
+ `Change the pipeline that confirms ${c}`
248
248
  ),
249
249
  onStateKeysChange: (a) => r(
250
- { ...t ? { pipeline_id: t } : {}, state_keys: a },
251
- `Change the states that confirm ${d}`
250
+ { ...l ? { pipeline_id: l } : {}, state_keys: a },
251
+ `Change the states that confirm ${c}`
252
252
  )
253
253
  }
254
254
  )
@@ -257,69 +257,105 @@ function se() {
257
257
  ] });
258
258
  }
259
259
  function ce() {
260
- const l = g(), { ov: s, info: o, row: c } = l;
261
- return !w(o, c.field) || o.computedType ? null : /* @__PURE__ */ n(
262
- v,
260
+ const t = b(), { ov: i, info: o, row: s } = t;
261
+ return !C(o, s.field) || o.computedType ? null : /* @__PURE__ */ n(
262
+ g,
263
263
  {
264
264
  k: "field.repeat_last",
265
265
  label: "Repeat last value",
266
266
  effect: "A “Repeat last” button beside the label fills in what this person entered on their previous record here.",
267
- checked: s.repeat_last === !0,
268
- onChange: (i) => l.setOverride(
267
+ checked: i.repeat_last === !0,
268
+ onChange: (d) => t.setOverride(
269
269
  "repeat_last",
270
- i ? !0 : void 0,
271
- i ? `Offer to repeat the last ${o.label}` : `Stop offering to repeat ${o.label}`
270
+ d ? !0 : void 0,
271
+ d ? `Offer to repeat the last ${o.label}` : `Stop offering to repeat ${o.label}`
272
272
  )
273
273
  }
274
274
  );
275
275
  }
276
- function de() {
277
- const l = g(), { ov: s, info: o, row: c } = l;
278
- return !w(o, c.field, { allowM2M: !0 }) || o.computedType ? null : /* @__PURE__ */ n(
279
- v,
276
+ function fe() {
277
+ const t = b(), { ov: i, info: o, row: s } = t;
278
+ return !C(o, s.field, { allowM2M: !0 }) || o.computedType ? null : /* @__PURE__ */ n(
279
+ g,
280
280
  {
281
281
  k: "field.personal_default",
282
282
  label: "Personal default",
283
283
  effect: "On this form, people can save their own starting value for this field, and new records start with it.",
284
- checked: s.personal_default === !0,
285
- onChange: (i) => l.setOverride(
284
+ checked: i.personal_default === !0,
285
+ onChange: (d) => t.setOverride(
286
286
  "personal_default",
287
- i ? !0 : void 0,
288
- i ? `Allow personal defaults for ${o.label}` : `Stop personal defaults for ${o.label}`
287
+ d ? !0 : void 0,
288
+ d ? `Allow personal defaults for ${o.label}` : `Stop personal defaults for ${o.label}`
289
289
  )
290
290
  }
291
291
  );
292
292
  }
293
- function fe() {
294
- const l = g(), { ov: s, info: o } = l;
295
- return s.personal_default !== !0 ? null : /* @__PURE__ */ n(
296
- v,
293
+ function ue() {
294
+ const t = b(), { ov: i, info: o } = t;
295
+ return i.personal_default !== !0 ? null : /* @__PURE__ */ n(
296
+ g,
297
297
  {
298
298
  k: "field.personal_default_inline",
299
299
  label: "Make default on the form",
300
300
  effect: "People can save, update and clear their default right beside this field. Off: they manage it only on their profile (My defaults); the form still fills it in.",
301
- checked: s.personal_default_inline !== !1,
302
- onChange: (c) => l.setOverride(
301
+ checked: i.personal_default_inline !== !1,
302
+ onChange: (s) => t.setOverride(
303
303
  "personal_default_inline",
304
- c ? void 0 : !1,
305
- c ? `Offer Make default on the form for ${o.label}` : `Keep ${o.label}'s default to the profile`
304
+ s ? void 0 : !1,
305
+ s ? `Offer Make default on the form for ${o.label}` : `Keep ${o.label}'s default to the profile`
306
306
  )
307
307
  }
308
308
  );
309
309
  }
310
- const B = [
310
+ function B(t) {
311
+ return ["file", "file-image", "files-m2m"].includes(t.iface ?? "");
312
+ }
313
+ function he() {
314
+ const t = b(), { ov: i, info: o } = t;
315
+ return B(o) ? /* @__PURE__ */ m(w, { children: [
316
+ /* @__PURE__ */ n(
317
+ g,
318
+ {
319
+ k: "field.file_used_in",
320
+ label: "Show where each file was used",
321
+ effect: "A small chip on each file lists the addendum, integration push, email or generated document on this record that carried it.",
322
+ checked: i.file_used_in !== !1,
323
+ onChange: (s) => t.setOverride(
324
+ "file_used_in",
325
+ s ? void 0 : !1,
326
+ s ? `Show where ${o.label} files were used` : `Hide where ${o.label} files were used`
327
+ )
328
+ }
329
+ ),
330
+ /* @__PURE__ */ n(
331
+ g,
332
+ {
333
+ k: "field.file_downloads",
334
+ label: "Show who downloaded each file",
335
+ effect: "Administrators see how many people downloaded each file from this record; hover names them. Everyone else sees nothing.",
336
+ checked: i.file_downloads !== !1,
337
+ onChange: (s) => t.setOverride(
338
+ "file_downloads",
339
+ s ? void 0 : !1,
340
+ s ? `Show downloads for ${o.label}` : `Hide downloads for ${o.label}`
341
+ )
342
+ }
343
+ )
344
+ ] }) : null;
345
+ }
346
+ const J = [
311
347
  { value: "", label: "Plain" },
312
348
  { value: "integer", label: "Whole" },
313
349
  { value: "number", label: "Decimal" },
314
350
  { value: "currency", label: "Money" },
315
351
  { value: "percent", label: "Percent" }
316
352
  ];
317
- function ue({
318
- row: l,
319
- fields: s
353
+ function me({
354
+ row: t,
355
+ fields: i
320
356
  }) {
321
- const o = j(), c = N(() => {
322
- const e = l.overrides;
357
+ const o = j(), s = O(() => {
358
+ const e = t.overrides;
323
359
  if (typeof e == "string")
324
360
  try {
325
361
  return JSON.parse(e) ?? {};
@@ -327,32 +363,32 @@ function ue({
327
363
  return {};
328
364
  }
329
365
  return e && typeof e == "object" ? e : {};
330
- }, [l.overrides]), i = R(c) ?? { expr: "", format: "", currency: null }, d = typeof c.label == "string" ? c.label : "", f = { field: l.field, group_key: l.group_key }, u = (e, m, y) => {
331
- const b = { ...c, ...e };
332
- for (const x of Object.keys(b)) b[x] === void 0 && delete b[x];
333
- o.apply([{ op: "update_placement", at: f, patch: { overrides: b } }], {
334
- label: m,
335
- text: y
366
+ }, [t.overrides]), d = T(s) ?? { expr: "", format: "", currency: null }, c = typeof s.label == "string" ? s.label : "", f = { field: t.field, group_key: t.group_key }, u = (e, h, v) => {
367
+ const y = { ...s, ...e };
368
+ for (const x of Object.keys(y)) y[x] === void 0 && delete y[x];
369
+ o.apply([{ op: "update_placement", at: f, patch: { overrides: y } }], {
370
+ label: h,
371
+ text: v
336
372
  });
337
- }, t = i.expr.trim() ? O(i.expr, s) : null, r = new Set(
373
+ }, l = d.expr.trim() ? N(d.expr, i) : null, r = new Set(
338
374
  o.bundle.placements.filter((e) => !e.field.startsWith("__")).map((e) => e.field)
339
- ), a = t != null && t.ok ? t.tokens.filter((e) => !r.has(e.split(".")[0])) : [];
340
- return /* @__PURE__ */ h("div", { className: "space-y-5", children: [
375
+ ), a = l != null && l.ok ? l.tokens.filter((e) => !r.has(e.split(".")[0])) : [];
376
+ return /* @__PURE__ */ m("div", { className: "space-y-5", children: [
341
377
  /* @__PURE__ */ n(p, { k: "display_formula.label", label: "Label", effect: "What the form calls the value.", children: /* @__PURE__ */ n(
342
378
  _,
343
379
  {
344
380
  ariaLabel: "Label",
345
- value: d,
381
+ value: c,
346
382
  placeholder: "Remaining",
347
383
  onChange: (e) => u({ label: e || void 0 }, "Rename the formula", !0)
348
384
  }
349
385
  ) }),
350
- /* @__PURE__ */ h(
386
+ /* @__PURE__ */ m(
351
387
  p,
352
388
  {
353
389
  k: "display_formula.expr",
354
390
  label: "Formula",
355
- effect: /* @__PURE__ */ h(C, { children: [
391
+ effect: /* @__PURE__ */ m(w, { children: [
356
392
  "Fields in double braces, for example",
357
393
  " ",
358
394
  /* @__PURE__ */ n("code", { className: "font-mono text-[11.5px]", children: "{{budget}} - {{committed}}" }),
@@ -365,25 +401,25 @@ function ue({
365
401
  ariaLabel: "Formula",
366
402
  rows: 3,
367
403
  mono: !0,
368
- value: i.expr,
369
- onChange: (e) => u({ display_formula: { ...i, expr: e } }, "Change the formula", !0)
404
+ value: d.expr,
405
+ onChange: (e) => u({ display_formula: { ...d, expr: e } }, "Change the formula", !0)
370
406
  }
371
407
  ),
372
- t && !t.ok && /* @__PURE__ */ n(
408
+ l && !l.ok && /* @__PURE__ */ n(
373
409
  "p",
374
410
  {
375
411
  role: "alert",
376
412
  "data-formula-error": "",
377
413
  className: "text-[12px] text-red-700 dark:text-red-300",
378
- children: t.error
414
+ children: l.error
379
415
  }
380
416
  ),
381
- (t == null ? void 0 : t.ok) && t.unknownTokens.length > 0 && /* @__PURE__ */ h("p", { "data-formula-unknown": "", className: "text-[12px] text-amber-700 dark:text-amber-300", children: [
417
+ (l == null ? void 0 : l.ok) && l.unknownTokens.length > 0 && /* @__PURE__ */ m("p", { "data-formula-unknown": "", className: "text-[12px] text-amber-700 dark:text-amber-300", children: [
382
418
  "Not fields of this collection:",
383
419
  " ",
384
- /* @__PURE__ */ n("span", { className: "font-mono", children: t.unknownTokens.join(", ") })
420
+ /* @__PURE__ */ n("span", { className: "font-mono", children: l.unknownTokens.join(", ") })
385
421
  ] }),
386
- (t == null ? void 0 : t.ok) && !t.unknownTokens.length && a.length > 0 && /* @__PURE__ */ h("p", { "data-formula-offform": "", className: I, children: [
422
+ (l == null ? void 0 : l.ok) && !l.unknownTokens.length && a.length > 0 && /* @__PURE__ */ m("p", { "data-formula-offform": "", className: I, children: [
387
423
  "Not on this form, so they read as empty here:",
388
424
  " ",
389
425
  /* @__PURE__ */ n("span", { className: "font-mono", children: a.join(", ") })
@@ -394,12 +430,12 @@ function ue({
394
430
  /* @__PURE__ */ n(p, { k: "display_formula.format", label: "Show as", effect: "How the number is written.", children: /* @__PURE__ */ n(
395
431
  k,
396
432
  {
397
- value: i.format,
398
- options: B,
399
- onChange: (e) => u({ display_formula: { ...i, format: e } }, "Change how the formula shows")
433
+ value: d.format,
434
+ options: J,
435
+ onChange: (e) => u({ display_formula: { ...d, format: e } }, "Change how the formula shows")
400
436
  }
401
437
  ) }),
402
- i.format === "currency" && /* @__PURE__ */ n(
438
+ d.format === "currency" && /* @__PURE__ */ n(
403
439
  p,
404
440
  {
405
441
  k: "display_formula.currency",
@@ -409,13 +445,13 @@ function ue({
409
445
  E,
410
446
  {
411
447
  ariaLabel: "Currency",
412
- value: i.currency ?? "",
448
+ value: d.currency ?? "",
413
449
  mono: !0,
414
450
  placeholder: "USD",
415
451
  onCommit: (e) => {
416
- const m = e.trim().toUpperCase();
417
- m && !/^[A-Z]{3}$/.test(m) || u(
418
- { display_formula: { ...i, currency: m || null } },
452
+ const h = e.trim().toUpperCase();
453
+ h && !/^[A-Z]{3}$/.test(h) || u(
454
+ { display_formula: { ...d, currency: h || null } },
419
455
  "Change the currency of the formula",
420
456
  !0
421
457
  );
@@ -427,13 +463,14 @@ function ue({
427
463
  ] });
428
464
  }
429
465
  export {
430
- se as ConfirmChangeSetting,
431
- re as CounterSetting,
432
- ue as DisplayFormulaSettings,
433
- fe as PersonalDefaultInlineToggle,
434
- de as PersonalDefaultToggle,
435
- ie as RecommendedToggle,
466
+ de as ConfirmChangeSetting,
467
+ ie as CounterSetting,
468
+ me as DisplayFormulaSettings,
469
+ he as FileChipToggles,
470
+ ue as PersonalDefaultInlineToggle,
471
+ fe as PersonalDefaultToggle,
472
+ se as RecommendedToggle,
436
473
  ce as RepeatLastToggle,
437
- oe as TextRulesSetting,
474
+ re as TextRulesSetting,
438
475
  z as takesText
439
476
  };