@firecms/collection_editor 3.0.0-canary.42 → 3.0.0-canary.44

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.
package/dist/index.es.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { jsx as e, jsxs as a, Fragment as R } from "react/jsx-runtime";
2
- import { FieldCaption as X, SearchIconsView as vr, toSnakeCase as Pt, singular as yr, IconForView as dt, ArrayContainer as br, serializeRegExp as Cr, useSnackbarController as Ie, resolveEnumValues as Nr, isPropertyBuilder as ie, useCustomizationController as Ae, getFieldConfig as Le, ErrorBoundary as me, PropertyConfigBadge as $e, unslugify as wt, useNavigationController as Te, mergeDeep as K, DEFAULT_FIELD_CONFIGS as Kt, isValidRegExp as Pr, getFieldId as Wt, DeleteConfirmationDialog as ct, useLargeLayout as xr, makePropertiesEditable as He, resolveEntityView as wr, useSelectionController as Tr, CircularProgressCenter as ut, EntityCollectionTable as kr, slugify as Or, useAuthController as _e, randomString as Ft, removeUndefined as Et, ErrorView as Zt, removeInitialAndTrailingSlashes as Vr, getDefaultPropertiesOrder as Ir, joinCollectionLists as _r } from "@firecms/core";
2
+ import { FieldCaption as X, SearchIconsView as yr, toSnakeCase as xt, singular as br, IconForView as dt, ArrayContainer as Cr, serializeRegExp as Nr, useSnackbarController as Ie, resolveEnumValues as xr, isPropertyBuilder as ie, useCustomizationController as Ae, getFieldConfig as Le, ErrorBoundary as me, PropertyConfigBadge as $e, unslugify as wt, useNavigationController as Te, mergeDeep as K, DEFAULT_FIELD_CONFIGS as Kt, isValidRegExp as Pr, getFieldId as Wt, DeleteConfirmationDialog as ct, useLargeLayout as wr, makePropertiesEditable as He, resolveEntityView as Tr, useSelectionController as kr, CircularProgressCenter as ut, EntityCollectionTable as Or, slugify as Vr, useAuthController as _e, randomString as Ft, removeUndefined as Et, ErrorView as Zt, removeInitialAndTrailingSlashes as Ir, getDefaultPropertiesOrder as _r, joinCollectionLists as Fr } from "@firecms/core";
3
3
  import * as Ue from "react";
4
- import Y, { useState as j, useEffect as ue, useMemo as Jt, useCallback as J, useRef as je, useDeferredValue as Fr, useContext as Qt } from "react";
4
+ import Y, { useState as j, useEffect as ue, useMemo as Jt, useCallback as J, useRef as je, useDeferredValue as Er, useContext as Qt } from "react";
5
5
  import be from "react-fast-compare";
6
- import { useAutoComplete as Er, Container as ht, Typography as V, Tooltip as te, IconButton as ae, Chip as xt, TextField as Oe, cn as fe, DebouncedTextField as W, Autocomplete as Sr, AutocompleteItem as Ar, ExpandablePanel as Tt, SettingsIcon as Ye, Select as Ne, SelectItem as ee, BooleanSwitchWithLabel as pt, Dialog as Fe, AutoAwesomeIcon as ft, Badge as Dr, ListIcon as Br, Button as z, CircularProgress as Ge, Paper as ge, DialogContent as De, DialogActions as Be, RuleIcon as Mr, FileUploadIcon as zr, MultiSelect as Rr, MultiSelectItem as St, Checkbox as At, cardMixin as Xt, cardClickableMixin as er, cardSelectedMixin as tr, FunctionsIcon as Ur, RemoveCircleIcon as jr, defaultBorderMixin as kt, RemoveIcon as qr, DragHandleIcon as Lr, AddIcon as ce, SelectGroup as Dt, InfoLabel as $r, DeleteIcon as mt, ContentCopyIcon as Hr, CodeIcon as Yr, Table as Bt, TableBody as Mt, TableRow as Ct, TableCell as Re, Alert as Gr, Icon as it, Card as rr, coolIconKeys as zt, Tabs as Kr, Tab as Nt, ArrowBackIcon as nt, LoadingButton as Rt, DoneIcon as Wr, Menu as Zr, MoreVertIcon as Jr, MenuItem as Qr, SaveIcon as Xr, UndoIcon as ei } from "@firecms/ui";
6
+ import { useAutoComplete as Sr, Container as ht, Typography as V, Tooltip as te, IconButton as ae, Chip as Pt, TextField as Oe, cn as fe, DebouncedTextField as W, Autocomplete as Ar, AutocompleteItem as Dr, ExpandablePanel as Tt, SettingsIcon as Ye, Select as Ne, SelectItem as ee, BooleanSwitchWithLabel as pt, Dialog as Fe, AutoAwesomeIcon as ft, Badge as Br, ListIcon as Mr, Button as z, CircularProgress as Ge, Paper as ge, DialogContent as De, DialogActions as Be, RuleIcon as zr, FileUploadIcon as Rr, MultiSelect as Ur, MultiSelectItem as St, Checkbox as At, cardMixin as Xt, cardClickableMixin as er, cardSelectedMixin as tr, FunctionsIcon as jr, RemoveCircleIcon as qr, defaultBorderMixin as kt, RemoveIcon as Lr, DragHandleIcon as $r, AddIcon as ce, SelectGroup as Dt, InfoLabel as Hr, DeleteIcon as mt, ContentCopyIcon as Yr, CodeIcon as Gr, Table as Bt, TableBody as Mt, TableRow as Ct, TableCell as Re, Alert as Kr, Icon as it, Card as rr, coolIconKeys as zt, Tabs as Wr, Tab as Nt, ArrowBackIcon as nt, LoadingButton as Rt, DoneIcon as Zr, Menu as Jr, MoreVertIcon as Qr, MenuItem as Xr, SaveIcon as ei, UndoIcon as ti } from "@firecms/ui";
7
7
  import * as at from "yup";
8
8
  import { useFormex as G, Field as $, getIn as I, useCreateFormex as Ot, Formex as Vt } from "@firecms/formex";
9
- import { extractEnumFromValues as ti, buildPropertyFromData as ri, buildEntityPropertiesFromData as ii } from "@firecms/schema_inference";
10
- import { DragDropContext as ni, Droppable as ai, Draggable as oi } from "@hello-pangea/dnd";
11
- import li from "json5";
12
- import { Highlight as si, themes as di } from "prism-react-renderer";
13
- import { ImportFileUpload as ci, DataNewPropertiesMapping as ui, ImportNewPropertyFieldPreview as pi, getInferenceType as ir, getPropertiesMapping as mi, convertDataToEntity as hi, useImportConfig as fi, ImportSaveInProgress as gi } from "@firecms/data_import_export";
9
+ import { extractEnumFromValues as ri, buildPropertyFromData as ii, buildEntityPropertiesFromData as ni } from "@firecms/schema_inference";
10
+ import { DragDropContext as ai, Droppable as oi, Draggable as li } from "@hello-pangea/dnd";
11
+ import si from "json5";
12
+ import { Highlight as di, themes as ci } from "prism-react-renderer";
13
+ import { ImportFileUpload as ui, DataNewPropertiesMapping as pi, ImportNewPropertyFieldPreview as mi, getInferenceType as ir, convertDataToEntity as hi, useImportConfig as fi, ImportSaveInProgress as gi } from "@firecms/data_import_export";
14
14
  import { useNavigate as vi } from "react-router";
15
15
  const yi = at.object().shape({
16
16
  id: at.string().required("Required"),
@@ -33,23 +33,23 @@ function bi({
33
33
  errors: s,
34
34
  setFieldTouched: f,
35
35
  isSubmitting: g,
36
- submitCount: x
37
- } = G(), [y, P] = j(!1), [v, b] = j(!1), w = (h) => {
38
- u("name", h), !I(p, "path") && t && h && u("path", Pt(h)), !I(p, "id") && t && h && u("id", Pt(h)), !I(p, "singularName") && t && h && u("singularName", yr(h));
36
+ submitCount: P
37
+ } = G(), [y, x] = j(!1), [v, b] = j(!1), T = (h) => {
38
+ u("name", h), !I(p, "path") && t && h && u("path", xt(h)), !I(p, "id") && t && h && u("id", xt(h)), !I(p, "singularName") && t && h && u("singularName", br(h));
39
39
  };
40
40
  ue(() => {
41
41
  s.id && b(!0);
42
42
  }, [s.id]);
43
- const T = /* @__PURE__ */ e(dt, { collectionOrView: c }), C = l?.filter((h) => !r?.includes(h)), {
43
+ const w = /* @__PURE__ */ e(dt, { collectionOrView: c }), C = l?.filter((h) => !r?.includes(h)), {
44
44
  inputFocused: O,
45
45
  autoCompleteOpen: N,
46
46
  setAutoCompleteOpen: F
47
- } = Er({
47
+ } = Sr({
48
48
  ref: d
49
49
  }), D = !!o;
50
50
  let _;
51
51
  typeof c.customId == "object" ? _ = "code_defined" : c.customId === !0 ? _ = "true" : c.customId === !1 ? _ = "false" : c.customId === "optional" && (_ = "optional");
52
- const S = x > 0;
52
+ const S = P > 0;
53
53
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(ht, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
54
54
  /* @__PURE__ */ a("div", { children: [
55
55
  /* @__PURE__ */ a(
@@ -62,14 +62,14 @@ function bi({
62
62
  ae,
63
63
  {
64
64
  shape: "square",
65
- onClick: () => P(!0),
66
- children: T
65
+ onClick: () => x(!0),
66
+ children: w
67
67
  }
68
68
  ) })
69
69
  ]
70
70
  }
71
71
  ),
72
- o && /* @__PURE__ */ e(xt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
72
+ o && /* @__PURE__ */ e(Pt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
73
73
  "This is a subcollection of ",
74
74
  /* @__PURE__ */ e("b", { children: o.name })
75
75
  ] }) })
@@ -80,7 +80,7 @@ function bi({
80
80
  Oe,
81
81
  {
82
82
  value: c.name ?? "",
83
- onChange: (h) => w(h.target.value),
83
+ onChange: (h) => T(h.target.value),
84
84
  label: "Name",
85
85
  required: !0,
86
86
  error: S && !!s.name
@@ -117,12 +117,12 @@ function bi({
117
117
  }
118
118
  ),
119
119
  /* @__PURE__ */ e(
120
- Sr,
120
+ Ar,
121
121
  {
122
122
  open: N && (C ?? []).length > 0,
123
123
  setOpen: F,
124
124
  children: C?.map((h, B) => /* @__PURE__ */ e(
125
- Ar,
125
+ Dr,
126
126
  {
127
127
  onClick: () => {
128
128
  F(!1), u("group", h ?? null);
@@ -219,7 +219,7 @@ function bi({
219
219
  Ne,
220
220
  {
221
221
  name: "customId",
222
- label: "Data IDs generation",
222
+ label: "Document IDs generation",
223
223
  position: "item-aligned",
224
224
  disabled: _ === "code_defined",
225
225
  onValueChange: (h) => {
@@ -269,15 +269,15 @@ function bi({
269
269
  Fe,
270
270
  {
271
271
  open: y,
272
- onOpenChange: P,
272
+ onOpenChange: x,
273
273
  maxWidth: "xl",
274
274
  fullWidth: !0,
275
275
  children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
276
- vr,
276
+ yr,
277
277
  {
278
278
  selectedIcon: c.icon,
279
279
  onIconSelected: (h) => {
280
- P(!1), u("icon", h);
280
+ x(!1), u("icon", h);
281
281
  }
282
282
  }
283
283
  ) })
@@ -288,7 +288,7 @@ function bi({
288
288
  function he(t) {
289
289
  return "properties." + t.replaceAll(".", ".properties.");
290
290
  }
291
- function Ci(t) {
291
+ function nr(t) {
292
292
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
293
293
  }
294
294
  function Ce(t) {
@@ -297,11 +297,11 @@ function Ce(t) {
297
297
  function ne(t, r) {
298
298
  return r ? `${r}.${t}` : t;
299
299
  }
300
- function nr(t, r) {
300
+ function ar(t, r) {
301
301
  const n = r ? `${r}.${t}` : t;
302
302
  return he(n);
303
303
  }
304
- function Ni({
304
+ function Ci({
305
305
  enumValues: t,
306
306
  onValuesChanged: r,
307
307
  onError: n,
@@ -315,8 +315,8 @@ function Ni({
315
315
  validateOnChange: !0,
316
316
  validation: (p) => {
317
317
  const s = {};
318
- p.enumValues && p.enumValues.forEach((g, x) => {
319
- g?.label || (s.enumValues = s.enumValues ?? [], s.enumValues[x] = s.enumValues[x] ?? {}, s.enumValues[x].label = "You must specify a label for this enum value entry"), g?.id || (s.enumValues = s.enumValues ?? [], s.enumValues[x] = s.enumValues[x] ?? {}, s.enumValues[x].id = "You must specify an ID for this enum value entry");
318
+ p.enumValues && p.enumValues.forEach((g, P) => {
319
+ g?.label || (s.enumValues = s.enumValues ?? [], s.enumValues[P] = s.enumValues[P] ?? {}, s.enumValues[P].label = "You must specify a label for this enum value entry"), g?.id || (s.enumValues = s.enumValues ?? [], s.enumValues[P] = s.enumValues[P] ?? {}, s.enumValues[P].id = "You must specify an ID for this enum value entry");
320
320
  });
321
321
  const f = !!(s?.enumValues && Object.keys(s?.enumValues).length > 0);
322
322
  return n?.(f), s;
@@ -325,7 +325,7 @@ function Ni({
325
325
  return ue(() => {
326
326
  r && r(u.enumValues);
327
327
  }, [u.enumValues]), /* @__PURE__ */ e(Vt, { value: c, children: /* @__PURE__ */ e(
328
- Pi,
328
+ Ni,
329
329
  {
330
330
  enumValuesPath: "enumValues",
331
331
  values: u,
@@ -337,7 +337,7 @@ function Ni({
337
337
  }
338
338
  ) });
339
339
  }
340
- function Pi({
340
+ function Ni({
341
341
  values: t,
342
342
  errors: r,
343
343
  disabled: n,
@@ -348,26 +348,26 @@ function Pi({
348
348
  }) {
349
349
  const {
350
350
  setFieldValue: c
351
- } = G(), [u, m] = Y.useState(), [p, s] = Y.useState(), [f, g] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, P = (b, w) => {
352
- const T = u === w, C = r?.enumValues && r?.enumValues[b];
351
+ } = G(), [u, m] = Y.useState(), [p, s] = Y.useState(), [f, g] = Y.useState(!1), y = Y.useRef(/* @__PURE__ */ new Set()).current, x = (b, T) => {
352
+ const w = u === T, C = r?.enumValues && r?.enumValues[b];
353
353
  return /* @__PURE__ */ e(
354
354
  xi,
355
355
  {
356
356
  index: b,
357
357
  disabled: n,
358
358
  enumValuesPath: i,
359
- autoFocus: T,
359
+ autoFocus: w,
360
360
  entryError: C,
361
- shouldUpdateId: l || T,
361
+ shouldUpdateId: l || w,
362
362
  onDialogOpen: () => s(b),
363
363
  inferredEntry: y.has(t.enumValues[b]?.id)
364
364
  },
365
- `${w}`
365
+ `${T}`
366
366
  );
367
367
  };
368
368
  return /* @__PURE__ */ a("div", { className: "col-span-12", children: [
369
369
  /* @__PURE__ */ a("div", { className: "ml-3.5 flex flex-row items-center", children: [
370
- /* @__PURE__ */ e(Br, {}),
370
+ /* @__PURE__ */ e(Mr, {}),
371
371
  /* @__PURE__ */ e(
372
372
  V,
373
373
  {
@@ -387,7 +387,7 @@ function Pi({
387
387
  d && (g(!0), d?.().then((b) => {
388
388
  if (!b)
389
389
  return;
390
- const w = b.flat(), T = Array.from(new Set(w)), C = t.enumValues, N = ti(T).filter((F) => !C?.some((D) => D.id === F.id));
390
+ const T = b.flat(), w = Array.from(new Set(T)), C = t.enumValues, N = ri(w).filter((F) => !C?.some((D) => D.id === F.id));
391
391
  N.forEach((F) => {
392
392
  y.add(F.id);
393
393
  }), c(i, [...N, ...C], !0);
@@ -404,14 +404,14 @@ function Pi({
404
404
  ] }),
405
405
  /* @__PURE__ */ a(ge, { className: "p-4 m-1", children: [
406
406
  /* @__PURE__ */ e(
407
- br,
407
+ Cr,
408
408
  {
409
409
  droppableId: i,
410
410
  addLabel: "Add enum value",
411
411
  value: t.enumValues,
412
412
  disabled: n,
413
413
  size: "small",
414
- buildEntry: P,
414
+ buildEntry: x,
415
415
  onInternalIdAdded: m,
416
416
  includeAddButton: !0,
417
417
  onValueChange: (b) => c(i, b),
@@ -419,7 +419,7 @@ function Pi({
419
419
  }
420
420
  ),
421
421
  /* @__PURE__ */ e(
422
- wi,
422
+ Pi,
423
423
  {
424
424
  index: p,
425
425
  open: p !== void 0,
@@ -447,9 +447,9 @@ const xi = Y.memo(
447
447
  errors: s,
448
448
  setFieldValue: f,
449
449
  touched: g
450
- } = G(), x = Y.useRef(!I(m, `${i}[${r}].id`)), y = n || x.current, P = I(m, `${i}[${r}].id`), v = I(m, `${i}[${r}].label`), b = Y.useRef(v);
450
+ } = G(), P = Y.useRef(!I(m, `${i}[${r}].id`)), y = n || P.current, x = I(m, `${i}[${r}].id`), v = I(m, `${i}[${r}].label`), b = Y.useRef(v);
451
451
  return Y.useEffect(() => {
452
- (b.current === P || !P) && y && f(`${i}[${r}].id`, v), b.current = v;
452
+ (b.current === x || !x) && y && f(`${i}[${r}].id`, v), b.current = v;
453
453
  }, [v]), /* @__PURE__ */ a(R, { children: [
454
454
  /* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
455
455
  /* @__PURE__ */ e(
@@ -467,7 +467,7 @@ const xi = Y.memo(
467
467
  error: !!u?.label
468
468
  }
469
469
  ),
470
- !d && /* @__PURE__ */ e(Dr, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
470
+ !d && /* @__PURE__ */ e(Br, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
471
471
  ae,
472
472
  {
473
473
  size: "small",
@@ -500,7 +500,7 @@ const xi = Y.memo(
500
500
  return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry && be(r.entryError, n.entryError) && r.autoFocus === n.autoFocus;
501
501
  }
502
502
  );
503
- function wi({
503
+ function Pi({
504
504
  index: t,
505
505
  open: r,
506
506
  onClose: n,
@@ -640,7 +640,7 @@ function Se({
640
640
  values: m,
641
641
  handleChange: p,
642
642
  errors: s
643
- } = G(), f = "validation.length", g = "validation.min", x = "validation.max", y = "validation.trim", P = "validation.matches", v = "validation.lowercase", b = "validation.uppercase", w = I(s, P), T = I(m, P), C = typeof T == "string" ? T : Cr(T);
643
+ } = G(), f = "validation.length", g = "validation.min", P = "validation.max", y = "validation.trim", x = "validation.matches", v = "validation.lowercase", b = "validation.uppercase", T = I(s, x), w = I(m, x), C = typeof w == "string" ? w : Nr(w);
644
644
  return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
645
645
  /* @__PURE__ */ e(Ee, { disabled: c }),
646
646
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
@@ -721,9 +721,9 @@ function Se({
721
721
  i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
722
722
  W,
723
723
  {
724
- value: I(m, x),
724
+ value: I(m, P),
725
725
  label: "Max length",
726
- name: x,
726
+ name: P,
727
727
  type: "number",
728
728
  size: "small",
729
729
  disabled: c,
@@ -735,16 +735,16 @@ function Se({
735
735
  /* @__PURE__ */ e(
736
736
  $,
737
737
  {
738
- name: P,
738
+ name: x,
739
739
  as: W,
740
740
  label: "Matches regex",
741
741
  size: "small",
742
742
  disabled: c,
743
743
  value: C,
744
- error: !!w
744
+ error: !!T
745
745
  }
746
746
  ),
747
- /* @__PURE__ */ e(X, { error: !!w, children: w ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
747
+ /* @__PURE__ */ e(X, { error: !!T, children: T ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
748
748
  ] })
749
749
  ] });
750
750
  }
@@ -785,7 +785,7 @@ function It({
785
785
  ) })
786
786
  ] });
787
787
  }
788
- function Pe({
788
+ function xe({
789
789
  children: t
790
790
  }) {
791
791
  return /* @__PURE__ */ e(
@@ -795,7 +795,7 @@ function Pe({
795
795
  asField: !0,
796
796
  className: "p-4",
797
797
  title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
798
- /* @__PURE__ */ e(Mr, {}),
798
+ /* @__PURE__ */ e(zr, {}),
799
799
  /* @__PURE__ */ e(
800
800
  V,
801
801
  {
@@ -821,10 +821,10 @@ function Ut({
821
821
  values: d,
822
822
  setFieldError: c,
823
823
  setFieldValue: u
824
- } = G(), m = Ie(), p = t ? "of.enumValues" : "enumValues", s = I(d, "defaultValue"), f = I(d, p), g = Jt(() => !f || typeof f == "boolean" ? [] : Nr(f) ?? [], [f]);
824
+ } = G(), m = Ie(), p = t ? "of.enumValues" : "enumValues", s = I(d, "defaultValue"), f = I(d, p), g = Jt(() => !f || typeof f == "boolean" ? [] : xr(f) ?? [], [f]);
825
825
  return /* @__PURE__ */ a(R, { children: [
826
826
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
827
- Ni,
827
+ Ci,
828
828
  {
829
829
  enumValues: g,
830
830
  updateIds: r,
@@ -833,11 +833,11 @@ function Ut({
833
833
  onError: (y) => {
834
834
  c(p, y ? "This enum property is missing some values" : void 0);
835
835
  },
836
- getData: o ? () => o().then((y) => y.map((P) => d.id && I(P, d.id)).filter(Boolean)) : void 0,
836
+ getData: o ? () => o().then((y) => y.map((x) => d.id && I(x, d.id)).filter(Boolean)) : void 0,
837
837
  onValuesChanged: (y) => {
838
838
  if (d && (u(p, y), !t)) {
839
- const P = y.filter((v) => !!v?.id).map((v) => v.id);
840
- s && !P.includes(s) && (u("defaultValue", void 0), m.open({
839
+ const x = y.filter((v) => !!v?.id).map((v) => v.id);
840
+ s && !x.includes(s) && (u("defaultValue", void 0), m.open({
841
841
  type: "warning",
842
842
  message: "Default value was cleared"
843
843
  }));
@@ -845,7 +845,7 @@ function Ut({
845
845
  }
846
846
  }
847
847
  ) }),
848
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Pe, { children: [
848
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
849
849
  !t && /* @__PURE__ */ e(
850
850
  Se,
851
851
  {
@@ -892,15 +892,15 @@ function jt({
892
892
  const {
893
893
  values: i,
894
894
  setFieldValue: l
895
- } = G(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, c = `${o}.fileName`, u = `${o}.storagePath`, m = `${o}.storeUrl`, p = I(i, c) ?? "{rand}_{file}", s = I(i, u) ?? "/", f = I(i, d), g = Array.isArray(f) ? f : void 0, x = !g || g.length === 0, y = (b) => {
896
- b ? b.includes("all") || b.length >= Object.keys(ot).length ? l(d, void 0) : x ? l(d, Object.keys(ot).filter((w) => !b.includes(w))) : l(d, b) : l(d, void 0);
897
- }, P = typeof p == "function", v = typeof s == "function";
895
+ } = G(), o = t ? "of.storage" : "storage", d = `${o}.acceptedFiles`, c = `${o}.fileName`, u = `${o}.storagePath`, m = `${o}.storeUrl`, p = I(i, c) ?? "{rand}_{file}", s = I(i, u) ?? "/", f = I(i, d), g = Array.isArray(f) ? f : void 0, P = !g || g.length === 0, y = (b) => {
896
+ b ? b.includes("all") || b.length >= Object.keys(ot).length ? l(d, void 0) : P ? l(d, Object.keys(ot).filter((T) => !b.includes(T))) : l(d, b) : l(d, void 0);
897
+ }, x = typeof p == "function", v = typeof s == "function";
898
898
  return /* @__PURE__ */ a(R, { children: [
899
899
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
900
900
  Tt,
901
901
  {
902
902
  title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
903
- /* @__PURE__ */ e(zr, {}),
903
+ /* @__PURE__ */ e(Rr, {}),
904
904
  /* @__PURE__ */ e(
905
905
  V,
906
906
  {
@@ -912,14 +912,14 @@ function jt({
912
912
  ] }),
913
913
  children: /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
914
914
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
915
- Rr,
915
+ Ur,
916
916
  {
917
917
  disabled: n,
918
918
  name: d,
919
919
  value: g ?? [],
920
920
  onMultiValueChange: y,
921
- label: x ? void 0 : "Allowed file types",
922
- renderValues: (b) => !b || b.length === 0 ? "All file types allowed" : b.map((w) => ot[w]).filter((w) => !!w).join(", "),
921
+ label: P ? void 0 : "Allowed file types",
922
+ renderValues: (b) => !b || b.length === 0 ? "All file types allowed" : b.map((T) => ot[T]).filter((T) => !!T).join(", "),
923
923
  children: [
924
924
  /* @__PURE__ */ a(St, { value: "all", className: "flex items-center gap-2", children: [
925
925
  /* @__PURE__ */ e(
@@ -930,20 +930,20 @@ function jt({
930
930
  ),
931
931
  "All"
932
932
  ] }, "all"),
933
- Object.entries(ot).map(([b, w]) => /* @__PURE__ */ a(St, { value: b, className: "flex items-center gap-2", children: [
933
+ Object.entries(ot).map(([b, T]) => /* @__PURE__ */ a(St, { value: b, className: "flex items-center gap-2", children: [
934
934
  /* @__PURE__ */ e(
935
935
  At,
936
936
  {
937
- checked: x || g.indexOf(b) > -1
937
+ checked: P || g.indexOf(b) > -1
938
938
  }
939
939
  ),
940
- /* @__PURE__ */ e("div", { className: "flex-grow", children: w }),
940
+ /* @__PURE__ */ e("div", { className: "flex-grow", children: T }),
941
941
  /* @__PURE__ */ e(
942
942
  z,
943
943
  {
944
944
  size: "small",
945
945
  variant: "outlined",
946
- onClick: (T) => (T.preventDefault(), T.stopPropagation(), l(d, [b])),
946
+ onClick: (w) => (w.preventDefault(), w.stopPropagation(), l(d, [b])),
947
947
  children: "Only"
948
948
  }
949
949
  )
@@ -958,8 +958,8 @@ function jt({
958
958
  as: W,
959
959
  label: "File name",
960
960
  size: "small",
961
- disabled: P || n,
962
- value: P ? "-" : p
961
+ disabled: x || n,
962
+ value: x ? "-" : p
963
963
  }
964
964
  ) }),
965
965
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
@@ -991,12 +991,12 @@ function jt({
991
991
  {
992
992
  name: m,
993
993
  type: "checkbox",
994
- children: ({ field: b, form: w }) => /* @__PURE__ */ e(
994
+ children: ({ field: b, form: T }) => /* @__PURE__ */ e(
995
995
  le,
996
996
  {
997
997
  label: "Save URL instead of storage path",
998
998
  disabled: r || n,
999
- form: w,
999
+ form: T,
1000
1000
  field: b
1001
1001
  }
1002
1002
  )
@@ -1007,7 +1007,7 @@ function jt({
1007
1007
  ] })
1008
1008
  }
1009
1009
  ) }),
1010
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Pe, { children: [
1010
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
1011
1011
  !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Ee, { disabled: n }) }),
1012
1012
  t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(It, { disabled: n }) })
1013
1013
  ] }) })
@@ -1021,19 +1021,19 @@ function qe(t) {
1021
1021
  return r.dataType === "array" && typeof r.of == "function" || r.dataType === "array" && Array.isArray(r.of) ? !1 : !!r.editable;
1022
1022
  }
1023
1023
  }
1024
- function Ti(t) {
1024
+ function wi(t) {
1025
1025
  return Object.entries(t).filter(([r, n]) => qe(n)).map(([r, n]) => {
1026
1026
  const i = n;
1027
1027
  if (qe(i))
1028
1028
  return i.dataType === "map" && i.properties ? {
1029
1029
  [r]: {
1030
1030
  ...i,
1031
- properties: Ti(i.properties)
1031
+ properties: wi(i.properties)
1032
1032
  }
1033
1033
  } : { [r]: i };
1034
1034
  }).filter((r) => !!r).reduce((r, n) => ({ ...r, ...n }), {});
1035
1035
  }
1036
- function ar({
1036
+ function or({
1037
1037
  property: t,
1038
1038
  onClick: r,
1039
1039
  hasError: n,
@@ -1104,7 +1104,7 @@ function ar({
1104
1104
  }
1105
1105
  ) });
1106
1106
  }
1107
- function ki({
1107
+ function Ti({
1108
1108
  name: t,
1109
1109
  selected: r,
1110
1110
  onClick: n,
@@ -1123,10 +1123,10 @@ function ki({
1123
1123
  "div",
1124
1124
  {
1125
1125
  className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
1126
- children: /* @__PURE__ */ e(Ur, { color: "inherit", size: "medium" })
1126
+ children: /* @__PURE__ */ e(jr, { color: "inherit", size: "medium" })
1127
1127
  }
1128
1128
  ),
1129
- /* @__PURE__ */ e(jr, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
1129
+ /* @__PURE__ */ e(qr, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
1130
1130
  ] }),
1131
1131
  /* @__PURE__ */ e(
1132
1132
  ge,
@@ -1210,13 +1210,13 @@ const gt = Y.memo(
1210
1210
  inferredPropertyKeys: s,
1211
1211
  collectionEditable: f
1212
1212
  }) {
1213
- const g = o ?? Object.keys(l), x = J((y) => {
1213
+ const g = o ?? Object.keys(l), P = J((y) => {
1214
1214
  if (!y.destination)
1215
1215
  return;
1216
- const P = y.source.index, v = y.destination.index, b = Array.from(g), [w] = b.splice(P, 1);
1217
- b.splice(v, 0, w), u && u(b, r);
1216
+ const x = y.source.index, v = y.destination.index, b = Array.from(g), [T] = b.splice(x, 1);
1217
+ b.splice(v, 0, T), u && u(b, r);
1218
1218
  }, [r, u, g]);
1219
- return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ni, { onDragEnd: x, children: /* @__PURE__ */ e(ai, { droppableId: `droppable_${r}`, children: (y, P) => /* @__PURE__ */ a(
1219
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ai, { onDragEnd: P, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${r}`, children: (y, x) => /* @__PURE__ */ a(
1220
1220
  "div",
1221
1221
  {
1222
1222
  ...y.droppableProps,
@@ -1224,18 +1224,18 @@ const gt = Y.memo(
1224
1224
  className: p,
1225
1225
  children: [
1226
1226
  g && g.map((v, b) => {
1227
- const w = l[v], T = d?.find((C) => C.key === v);
1228
- return !w && !T ? (console.warn(`Property ${v} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
1229
- oi,
1227
+ const T = l[v], w = d?.find((C) => C.key === v);
1228
+ return !T && !w ? (console.warn(`Property ${v} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
1229
+ li,
1230
1230
  {
1231
1231
  draggableId: `array_field_${r}_${v}}`,
1232
1232
  index: b,
1233
1233
  children: (C, O) => /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1234
- Oi,
1234
+ ki,
1235
1235
  {
1236
1236
  propertyKey: v,
1237
- propertyOrBuilder: w,
1238
- additionalField: T,
1237
+ propertyOrBuilder: T,
1238
+ additionalField: w,
1239
1239
  provided: C,
1240
1240
  errors: c,
1241
1241
  namespace: r,
@@ -1263,7 +1263,7 @@ const gt = Y.memo(
1263
1263
  t.namespace === r.namespace && t.collectionEditable === r.collectionEditable;
1264
1264
  }
1265
1265
  );
1266
- function Oi({
1266
+ function ki({
1267
1267
  propertyKey: t,
1268
1268
  namespace: r,
1269
1269
  propertyOrBuilder: n,
@@ -1277,17 +1277,17 @@ function Oi({
1277
1277
  inferredPropertyKeys: p,
1278
1278
  collectionEditable: s
1279
1279
  }) {
1280
- const f = p?.includes(r ? `${r}.${t}` : t), g = ne(t, r), y = nr(t, r) in d;
1281
- let P;
1280
+ const f = p?.includes(r ? `${r}.${t}` : t), g = ne(t, r), y = ar(t, r) in d;
1281
+ let x;
1282
1282
  if (typeof n == "object") {
1283
- const w = n;
1284
- w.dataType === "map" && w.properties && (P = /* @__PURE__ */ e(
1283
+ const T = n;
1284
+ T.dataType === "map" && T.properties && (x = /* @__PURE__ */ e(
1285
1285
  gt,
1286
1286
  {
1287
1287
  selectedPropertyKey: o,
1288
1288
  namespace: g,
1289
- properties: w.properties,
1290
- propertiesOrder: w.propertiesOrder,
1289
+ properties: T.properties,
1290
+ propertiesOrder: T.propertiesOrder,
1291
1291
  errors: d,
1292
1292
  onPropertyClick: c,
1293
1293
  onPropertyMove: u,
@@ -1305,7 +1305,7 @@ function Oi({
1305
1305
  ...l.dragHandleProps,
1306
1306
  className: "relative -ml-8",
1307
1307
  children: [
1308
- P && /* @__PURE__ */ e(
1308
+ x && /* @__PURE__ */ e(
1309
1309
  "div",
1310
1310
  {
1311
1311
  className: "absolute border-l " + kt,
@@ -1317,7 +1317,7 @@ function Oi({
1317
1317
  }
1318
1318
  ),
1319
1319
  !ie(n) && !i && b ? /* @__PURE__ */ e(
1320
- ar,
1320
+ or,
1321
1321
  {
1322
1322
  property: n,
1323
1323
  onClick: c ? () => c(t, r) : void 0,
@@ -1326,7 +1326,7 @@ function Oi({
1326
1326
  hasError: y
1327
1327
  }
1328
1328
  ) : /* @__PURE__ */ e(
1329
- ki,
1329
+ Ti,
1330
1330
  {
1331
1331
  name: t,
1332
1332
  property: n,
@@ -1342,7 +1342,7 @@ function Oi({
1342
1342
  size: "small",
1343
1343
  color: "inherit",
1344
1344
  onClick: () => m(t, r),
1345
- children: /* @__PURE__ */ e(qr, { size: "small" })
1345
+ children: /* @__PURE__ */ e(Lr, { size: "small" })
1346
1346
  }
1347
1347
  ) }),
1348
1348
  u && /* @__PURE__ */ e(te, { title: "Move", children: /* @__PURE__ */ e(
@@ -1350,39 +1350,39 @@ function Oi({
1350
1350
  {
1351
1351
  component: "span",
1352
1352
  size: "small",
1353
- children: /* @__PURE__ */ e(Lr, { size: "small" })
1353
+ children: /* @__PURE__ */ e($r, { size: "small" })
1354
1354
  }
1355
1355
  ) })
1356
1356
  ] }),
1357
- P && /* @__PURE__ */ e("div", { className: "ml-16", children: P })
1357
+ x && /* @__PURE__ */ e("div", { className: "ml-16", children: x })
1358
1358
  ]
1359
1359
  }
1360
1360
  );
1361
1361
  }
1362
- function Vi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i, collectionEditable: l }) {
1362
+ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i, collectionEditable: l }) {
1363
1363
  const {
1364
1364
  values: o,
1365
1365
  setFieldValue: d
1366
- } = G(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), x = ({
1367
- id: T,
1366
+ } = G(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), P = ({
1367
+ id: w,
1368
1368
  property: C
1369
1369
  }) => {
1370
- if (!T)
1370
+ if (!w)
1371
1371
  throw Error();
1372
1372
  d("properties", {
1373
1373
  ...o.properties ?? {},
1374
- [T]: C
1374
+ [w]: C
1375
1375
  }, !1);
1376
- const O = o.propertiesOrder ?? Object.keys(o.properties ?? {}), N = O.includes(T) ? O : [...O, T];
1376
+ const O = o.propertiesOrder ?? Object.keys(o.properties ?? {}), N = O.includes(w) ? O : [...O, w];
1377
1377
  d("propertiesOrder", N, !1), u(!1);
1378
- }, y = J((T, C) => {
1379
- const O = T ? ne(T, C) : void 0;
1378
+ }, y = J((w, C) => {
1379
+ const O = w ? ne(w, C) : void 0;
1380
1380
  if (!O)
1381
1381
  throw Error("collection editor miss config");
1382
- const N = he(O), F = Ce(C), D = I(o, F) ?? Object.keys(I(o, Ci(C)));
1383
- d(N, void 0, !1), d(F, D.filter((_) => _ !== T), !1), u(!1), p(void 0), f(void 0);
1384
- }, [d, o]), P = m ? ne(m, s) : void 0, v = P ? I(o.properties, P.replaceAll(".", ".properties.")) : void 0, b = !g || g.length < 1, w = J((T, C) => {
1385
- d(Ce(C), T, !1);
1382
+ const N = he(O), F = Ce(C), D = I(o, F) ?? Object.keys(I(o, nr(C)));
1383
+ d(N, void 0, !1), d(F, D.filter((_) => _ !== w), !1), u(!1), p(void 0), f(void 0);
1384
+ }, [d, o]), x = m ? ne(m, s) : void 0, v = x ? I(o.properties, x.replaceAll(".", ".properties.")) : void 0, b = !g || g.length < 1, T = J((w, C) => {
1385
+ d(Ce(C), w, !1);
1386
1386
  }, []);
1387
1387
  return /* @__PURE__ */ a(R, { children: [
1388
1388
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
@@ -1410,10 +1410,10 @@ function Vi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1410
1410
  propertiesOrder: g,
1411
1411
  errors: {},
1412
1412
  collectionEditable: l,
1413
- onPropertyClick: (T, C) => {
1414
- p(T), f(C), u(!0);
1413
+ onPropertyClick: (w, C) => {
1414
+ p(w), f(C), u(!0);
1415
1415
  },
1416
- onPropertyMove: w
1416
+ onPropertyMove: T
1417
1417
  }
1418
1418
  ),
1419
1419
  b && /* @__PURE__ */ e(
@@ -1433,7 +1433,7 @@ function Vi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1433
1433
  position: "start",
1434
1434
  size: "small",
1435
1435
  label: "Spread children as columns",
1436
- onValueChange: (T) => d("spreadChildren", T),
1436
+ onValueChange: (w) => d("spreadChildren", w),
1437
1437
  value: o.spreadChildren ?? !1
1438
1438
  }
1439
1439
  ),
@@ -1461,14 +1461,14 @@ function Vi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1461
1461
  existingProperty: !!m,
1462
1462
  autoUpdateId: !m,
1463
1463
  autoOpenTypeSelect: !m,
1464
- onPropertyChanged: x,
1464
+ onPropertyChanged: P,
1465
1465
  existingPropertyKeys: m ? void 0 : g,
1466
1466
  propertyConfigs: i
1467
1467
  }
1468
1468
  )
1469
1469
  ] });
1470
1470
  }
1471
- function Ii({
1471
+ function Vi({
1472
1472
  showErrors: t,
1473
1473
  existing: r,
1474
1474
  disabled: n,
@@ -1483,9 +1483,9 @@ function Ii({
1483
1483
  errors: m,
1484
1484
  setFieldValue: p,
1485
1485
  touched: s
1486
- } = G(), [f, g] = j(!1), x = I(c, "of"), y = I(s, "of") && I(m, "of"), P = ({ id: b, property: w, namespace: T }) => {
1487
- console.log("onPropertyChanged", b, w, T), p("of", w);
1488
- }, v = x && Le(x, o);
1486
+ } = G(), [f, g] = j(!1), P = I(c, "of"), y = I(s, "of") && I(m, "of"), x = ({ id: b, property: T, namespace: w }) => {
1487
+ console.log("onPropertyChanged", b, T, w), p("of", T);
1488
+ }, v = P && Le(P, o);
1489
1489
  return /* @__PURE__ */ a(R, { children: [
1490
1490
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1491
1491
  /* @__PURE__ */ e(V, { variant: "subtitle2", children: "Repeat component" }),
@@ -1493,12 +1493,12 @@ function Ii({
1493
1493
  $,
1494
1494
  {
1495
1495
  name: "of",
1496
- value: x,
1496
+ value: P,
1497
1497
  children: ({}) => /* @__PURE__ */ a(ge, { className: "p-2 mt-4", children: [
1498
- x && /* @__PURE__ */ e(
1499
- ar,
1498
+ P && /* @__PURE__ */ e(
1499
+ or,
1500
1500
  {
1501
- property: x,
1501
+ property: P,
1502
1502
  onClick: n ? void 0 : () => g(!0),
1503
1503
  includeName: !1,
1504
1504
  includeEditButton: !0,
@@ -1506,7 +1506,7 @@ function Ii({
1506
1506
  hasError: !1
1507
1507
  }
1508
1508
  ),
1509
- !n && !x && /* @__PURE__ */ a(
1509
+ !n && !P && /* @__PURE__ */ a(
1510
1510
  z,
1511
1511
  {
1512
1512
  variant: "text",
@@ -1530,9 +1530,9 @@ function Ii({
1530
1530
  autoOpenTypeSelect: !r,
1531
1531
  onOkClicked: () => g(!1),
1532
1532
  allowDataInference: l,
1533
- property: x,
1533
+ property: P,
1534
1534
  includeIdAndName: !1,
1535
- onPropertyChanged: P,
1535
+ onPropertyChanged: x,
1536
1536
  forceShowErrors: t,
1537
1537
  propertyConfigs: o,
1538
1538
  collectionEditable: d
@@ -1542,10 +1542,10 @@ function Ii({
1542
1542
  }
1543
1543
  )
1544
1544
  ] }),
1545
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(It, { disabled: n }) }) })
1545
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(It, { disabled: n }) }) })
1546
1546
  ] });
1547
1547
  }
1548
- const _i = Y.forwardRef(
1548
+ const Ii = Y.forwardRef(
1549
1549
  function({
1550
1550
  showErrors: r,
1551
1551
  disabledId: n,
@@ -1560,7 +1560,7 @@ const _i = Y.forwardRef(
1560
1560
  setFieldTouched: p,
1561
1561
  touched: s,
1562
1562
  validate: f
1563
- } = G(), g = "name", x = r && I(c, g), y = "id", P = r && I(c, y), v = "description", b = r && I(c, v);
1563
+ } = G(), g = "name", P = r && I(c, g), y = "id", x = r && I(c, y), v = "description", b = r && I(c, v);
1564
1564
  return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 col-span-12", children: [
1565
1565
  /* @__PURE__ */ a("div", { children: [
1566
1566
  /* @__PURE__ */ e(
@@ -1570,18 +1570,18 @@ const _i = Y.forwardRef(
1570
1570
  inputRef: d,
1571
1571
  as: W,
1572
1572
  value: u[g],
1573
- onChange: (w) => {
1574
- const T = w.target.value;
1575
- !I(s, y) && l && m(y, T ? Pt(T) : "", !1), m(g, T, !0), p(g, !0);
1573
+ onChange: (T) => {
1574
+ const w = T.target.value;
1575
+ !I(s, y) && l && m(y, w ? xt(w) : "", !1), m(g, w, !0), p(g, !0);
1576
1576
  },
1577
1577
  style: { fontSize: 20 },
1578
1578
  placeholder: "Field name",
1579
1579
  required: !0,
1580
1580
  disabled: i,
1581
- error: !!x
1581
+ error: !!P
1582
1582
  }
1583
1583
  ),
1584
- /* @__PURE__ */ e(X, { error: !!x, children: x })
1584
+ /* @__PURE__ */ e(X, { error: !!P, children: P })
1585
1585
  ] }),
1586
1586
  /* @__PURE__ */ a("div", { children: [
1587
1587
  /* @__PURE__ */ e(
@@ -1591,17 +1591,17 @@ const _i = Y.forwardRef(
1591
1591
  as: W,
1592
1592
  label: "ID",
1593
1593
  value: u[y],
1594
- onChange: (w) => {
1595
- const T = w.target.value;
1596
- !I(s, g) && l && m(g, T ? wt(T) : ""), m(y, T, !0), p(y, !0);
1594
+ onChange: (T) => {
1595
+ const w = T.target.value;
1596
+ !I(s, g) && l && m(g, w ? wt(w) : ""), m(y, w, !0), p(y, !0);
1597
1597
  },
1598
1598
  disabled: n || i,
1599
1599
  required: !0,
1600
1600
  size: "small",
1601
- error: !!P
1601
+ error: !!x
1602
1602
  }
1603
1603
  ),
1604
- /* @__PURE__ */ e(X, { error: !!P, children: P })
1604
+ /* @__PURE__ */ e(X, { error: !!x, children: x })
1605
1605
  ] }),
1606
1606
  /* @__PURE__ */ a("div", { children: [
1607
1607
  /* @__PURE__ */ e(
@@ -1619,14 +1619,14 @@ const _i = Y.forwardRef(
1619
1619
  ] });
1620
1620
  }
1621
1621
  );
1622
- function Fi({
1622
+ function _i({
1623
1623
  widgetId: t,
1624
1624
  disabled: r,
1625
1625
  showErrors: n
1626
1626
  }) {
1627
1627
  const { values: i, setFieldValue: l } = G();
1628
1628
  return /* @__PURE__ */ a(R, { children: [
1629
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Pe, { children: [
1629
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
1630
1630
  t === "text_field" && /* @__PURE__ */ e(
1631
1631
  Se,
1632
1632
  {
@@ -1692,10 +1692,10 @@ function Fi({
1692
1692
  ) })
1693
1693
  ] });
1694
1694
  }
1695
- function Ei({ disabled: t }) {
1695
+ function Fi({ disabled: t }) {
1696
1696
  const { values: r } = G(), n = I(r, "defaultValue");
1697
1697
  return /* @__PURE__ */ a(R, { children: [
1698
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }),
1698
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }),
1699
1699
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1700
1700
  $,
1701
1701
  {
@@ -1714,29 +1714,35 @@ function Ei({ disabled: t }) {
1714
1714
  ) })
1715
1715
  ] });
1716
1716
  }
1717
- function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i, collectionEditable: l }) {
1717
+ function Ei({
1718
+ disabled: t,
1719
+ getData: r,
1720
+ allowDataInference: n,
1721
+ propertyConfigs: i,
1722
+ collectionEditable: l
1723
+ }) {
1718
1724
  const {
1719
1725
  values: o,
1720
1726
  setFieldValue: d
1721
1727
  } = G(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = ({
1722
- id: w,
1723
- property: T
1728
+ id: T,
1729
+ property: w
1724
1730
  }) => {
1725
- if (!w)
1731
+ if (!T)
1726
1732
  throw Error();
1727
1733
  d("oneOf.properties", {
1728
1734
  ...o.oneOf?.properties ?? {},
1729
- [w]: T
1735
+ [T]: w
1730
1736
  }, !1);
1731
- const C = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), O = C.includes(w) ? C : [...C, w];
1737
+ const C = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), O = C.includes(T) ? C : [...C, T];
1732
1738
  d("oneOf.propertiesOrder", O, !1), u(!1);
1733
- }, x = m ? ne(m, s) : void 0, y = x ? I(o.oneOf?.properties, x.replaceAll(".", ".properties.")) : void 0, P = J((w, T) => {
1734
- const C = w ? ne(w, T) : void 0;
1739
+ }, P = m ? ne(m, s) : void 0, y = P ? I(o.oneOf?.properties, P.replaceAll(".", ".properties.")) : void 0, x = J((T, w) => {
1740
+ const C = T ? ne(T, w) : void 0;
1735
1741
  if (!C)
1736
1742
  throw Error("collection editor miss config");
1737
1743
  d(`oneOf.${he(C)}`, void 0, !1);
1738
- const O = `oneOf.${Ce(T)}`, N = I(o, O);
1739
- d(O, N.filter((F) => F !== w), !1), u(!1), p(void 0), f(void 0);
1744
+ const O = `oneOf.${Ce(w)}`, N = I(o, O) ?? Object.keys(I(o, nr(w)));
1745
+ d(O, N.filter((F) => F !== T), !1), u(!1), p(void 0), f(void 0);
1740
1746
  }, [d, o]), v = /* @__PURE__ */ a(
1741
1747
  z,
1742
1748
  {
@@ -1749,8 +1755,8 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1749
1755
  o.name ?? "this block"
1750
1756
  ]
1751
1757
  }
1752
- ), b = J((w, T) => {
1753
- d(`oneOf.${Ce(T)}`, w, !1);
1758
+ ), b = J((T, w) => {
1759
+ d(`oneOf.${Ce(w)}`, T, !1);
1754
1760
  }, []);
1755
1761
  return /* @__PURE__ */ a(R, { children: [
1756
1762
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
@@ -1766,8 +1772,8 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1766
1772
  propertiesOrder: o.oneOf?.propertiesOrder,
1767
1773
  errors: {},
1768
1774
  collectionEditable: l,
1769
- onPropertyClick: t ? void 0 : (w, T) => {
1770
- p(w), f(T), u(!0);
1775
+ onPropertyClick: t ? void 0 : (T, w) => {
1776
+ p(T), f(w), u(!0);
1771
1777
  },
1772
1778
  onPropertyMove: t ? void 0 : b
1773
1779
  }
@@ -1790,7 +1796,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1790
1796
  u(!1), p(void 0), f(void 0);
1791
1797
  },
1792
1798
  collectionEditable: l,
1793
- onDelete: P,
1799
+ onDelete: x,
1794
1800
  propertyKey: m,
1795
1801
  propertyNamespace: s,
1796
1802
  property: y,
@@ -1804,7 +1810,7 @@ function Si({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1804
1810
  )
1805
1811
  ] });
1806
1812
  }
1807
- function Ai({ disabled: t }) {
1813
+ function Si({ disabled: t }) {
1808
1814
  const {
1809
1815
  values: r,
1810
1816
  handleChange: n
@@ -1909,10 +1915,10 @@ function Ai({ disabled: t }) {
1909
1915
  ) })
1910
1916
  ] });
1911
1917
  }
1912
- function Di({ disabled: t }) {
1918
+ function Ai({ disabled: t }) {
1913
1919
  const { values: r, setFieldValue: n } = G();
1914
1920
  return /* @__PURE__ */ a(R, { children: [
1915
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(Ai, { disabled: t }) }) }),
1921
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Si, { disabled: t }) }) }),
1916
1922
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1917
1923
  Oe,
1918
1924
  {
@@ -1952,11 +1958,11 @@ function qt({
1952
1958
  value: m,
1953
1959
  error: p,
1954
1960
  handleChange: o,
1955
- as: Bi
1961
+ as: Di
1956
1962
  }
1957
1963
  ) }) });
1958
1964
  }
1959
- function Bi({
1965
+ function Di({
1960
1966
  disabled: t,
1961
1967
  pathPath: r,
1962
1968
  value: n,
@@ -2046,7 +2052,7 @@ function Bi({
2046
2052
  /* @__PURE__ */ e(X, { children: "You can only edit the reference collection upon field creation." })
2047
2053
  ] });
2048
2054
  }
2049
- function Mi({ disabled: t }) {
2055
+ function Bi({ disabled: t }) {
2050
2056
  const {
2051
2057
  values: r,
2052
2058
  errors: n,
@@ -2109,10 +2115,10 @@ function Mi({ disabled: t }) {
2109
2115
  ),
2110
2116
  /* @__PURE__ */ e(X, { error: !!p, children: p ?? "Update this field automatically when creating or updating the entity" })
2111
2117
  ] }),
2112
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) })
2118
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) })
2113
2119
  ] });
2114
2120
  }
2115
- function zi({ disabled: t }) {
2121
+ function Mi({ disabled: t }) {
2116
2122
  return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
2117
2123
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e($, { type: "checkbox", name: "hideFromCollection", children: ({ field: i, form: l }) => /* @__PURE__ */ e(
2118
2124
  le,
@@ -2143,10 +2149,10 @@ function zi({ disabled: t }) {
2143
2149
  ) })
2144
2150
  ] });
2145
2151
  }
2146
- function Ri({ disabled: t }) {
2147
- return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }) });
2152
+ function zi({ disabled: t }) {
2153
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }) });
2148
2154
  }
2149
- function or(t, r, n) {
2155
+ function lr(t, r, n) {
2150
2156
  let i;
2151
2157
  return r === "text_field" ? i = K(
2152
2158
  t,
@@ -2358,7 +2364,7 @@ function or(t, r, n) {
2358
2364
  propertyConfig: r
2359
2365
  }), i;
2360
2366
  }
2361
- function lr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
2367
+ function sr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
2362
2368
  return /* @__PURE__ */ e(
2363
2369
  ee,
2364
2370
  {
@@ -2392,7 +2398,7 @@ function lr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
2392
2398
  }
2393
2399
  );
2394
2400
  }
2395
- function Ui({
2401
+ function Ri({
2396
2402
  disabled: t,
2397
2403
  showErrors: r
2398
2404
  }) {
@@ -2428,7 +2434,7 @@ function Ui({
2428
2434
  ]
2429
2435
  }
2430
2436
  ) }),
2431
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2437
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(
2432
2438
  Se,
2433
2439
  {
2434
2440
  disabled: t,
@@ -2452,7 +2458,7 @@ function Ui({
2452
2458
  ) })
2453
2459
  ] });
2454
2460
  }
2455
- const ji = [
2461
+ const Ui = [
2456
2462
  "text_field",
2457
2463
  "multiline",
2458
2464
  "markdown",
@@ -2473,7 +2479,7 @@ const ji = [
2473
2479
  "key_value",
2474
2480
  "repeat",
2475
2481
  "block"
2476
- ], sr = Object.entries(Kt).filter(([t]) => ji.includes(t)).map(([t, r]) => ({ [t]: r })).reduce((t, r) => ({ ...t, ...r }), {}), dr = Y.memo(
2482
+ ], dr = Object.entries(Kt).filter(([t]) => Ui.includes(t)).map(([t, r]) => ({ [t]: r })).reduce((t, r) => ({ ...t, ...r }), {}), cr = Y.memo(
2477
2483
  function(r) {
2478
2484
  const {
2479
2485
  includeIdAndName: n = !0,
@@ -2488,13 +2494,13 @@ const ji = [
2488
2494
  onPropertyChanged: s,
2489
2495
  onPropertyChangedImmediate: f = !0,
2490
2496
  onDelete: g,
2491
- onError: x,
2497
+ onError: P,
2492
2498
  initialErrors: y,
2493
- forceShowErrors: P,
2499
+ forceShowErrors: x,
2494
2500
  allowDataInference: v,
2495
2501
  getController: b,
2496
- getData: w,
2497
- propertyConfigs: T,
2502
+ getData: T,
2503
+ propertyConfigs: w,
2498
2504
  collectionEditable: C
2499
2505
  } = r, O = {
2500
2506
  id: "",
@@ -2536,13 +2542,13 @@ const ji = [
2536
2542
  if (!S.name)
2537
2543
  h.name = "Required";
2538
2544
  else {
2539
- const B = Hi(S.name);
2545
+ const B = $i(S.name);
2540
2546
  B && (h.name = B);
2541
2547
  }
2542
2548
  if (!S.id)
2543
2549
  h.id = "Required";
2544
2550
  else {
2545
- const B = $i(S.id, u);
2551
+ const B = Li(S.id, u);
2546
2552
  B && (h.id = B);
2547
2553
  }
2548
2554
  }
@@ -2554,22 +2560,22 @@ const ji = [
2554
2560
  return ue(() => {
2555
2561
  b?.(_);
2556
2562
  }, [_, b]), /* @__PURE__ */ e(Vt, { value: _, children: /* @__PURE__ */ e(
2557
- qi,
2563
+ ji,
2558
2564
  {
2559
2565
  onPropertyChanged: f ? D : void 0,
2560
2566
  onDelete: g,
2561
2567
  includeIdAndTitle: n,
2562
2568
  propertyNamespace: m,
2563
- onError: x,
2564
- showErrors: P || _.submitCount > 0,
2569
+ onError: P,
2570
+ showErrors: x || _.submitCount > 0,
2565
2571
  existing: l,
2566
2572
  autoUpdateId: o,
2567
2573
  inArray: d,
2568
2574
  autoOpenTypeSelect: i,
2569
2575
  disabled: N,
2570
- getData: w,
2576
+ getData: T,
2571
2577
  allowDataInference: v,
2572
- propertyConfigs: T,
2578
+ propertyConfigs: w,
2573
2579
  collectionEditable: C,
2574
2580
  ..._
2575
2581
  }
@@ -2603,7 +2609,7 @@ function Ve({
2603
2609
  },
2604
2610
  children: [
2605
2611
  /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
2606
- dr,
2612
+ cr,
2607
2613
  {
2608
2614
  ...d,
2609
2615
  onPropertyChanged: (m) => {
@@ -2644,7 +2650,7 @@ function Ve({
2644
2650
  }
2645
2651
  );
2646
2652
  }
2647
- function qi({
2653
+ function ji({
2648
2654
  values: t,
2649
2655
  errors: r,
2650
2656
  setValues: n,
@@ -2659,12 +2665,12 @@ function qi({
2659
2665
  showErrors: s,
2660
2666
  disabled: f,
2661
2667
  inArray: g,
2662
- getData: x,
2668
+ getData: P,
2663
2669
  allowDataInference: y,
2664
- propertyConfigs: P,
2670
+ propertyConfigs: x,
2665
2671
  collectionEditable: v
2666
2672
  }) {
2667
- const [b, w] = j(o), [T, C] = j(!1), [O, N] = j(t?.dataType ? Wt(t) : void 0), F = Object.entries(sr).concat(Object.entries(P)), D = g ? F.filter(([Z, H]) => !ie(H.property) && H.property?.dataType !== "array") : F, _ = Fr(t), S = je(null), h = je(t), B = s && I(r, "selectedWidget");
2673
+ const [b, T] = j(o), [w, C] = j(!1), [O, N] = j(t?.dataType ? Wt(t) : void 0), F = Object.entries(dr).concat(Object.entries(x)), D = g ? F.filter(([Z, H]) => !ie(H.property) && H.property?.dataType !== "array") : F, _ = Er(t), S = je(null), h = je(t), B = s && I(r, "selectedWidget");
2668
2674
  ue(() => {
2669
2675
  if (c && (!d || _.id)) {
2670
2676
  const {
@@ -2681,20 +2687,20 @@ function qi({
2681
2687
  t?.id && p && p(t?.id, m, r);
2682
2688
  }, [r, p, m, t?.id]);
2683
2689
  const oe = (Z) => {
2684
- N(Z), n(or(t, Z, P)), setTimeout(() => {
2690
+ N(Z), n(lr(t, Z, x)), setTimeout(() => {
2685
2691
  S.current?.focus();
2686
2692
  }, 0);
2687
2693
  };
2688
2694
  let q;
2689
2695
  return O === "text_field" || O === "multiline" || O === "markdown" || O === "email" ? q = /* @__PURE__ */ e(
2690
- Fi,
2696
+ _i,
2691
2697
  {
2692
2698
  widgetId: O,
2693
2699
  disabled: f,
2694
2700
  showErrors: s
2695
2701
  }
2696
2702
  ) : O === "url" ? q = /* @__PURE__ */ e(
2697
- Ui,
2703
+ Ri,
2698
2704
  {
2699
2705
  disabled: f,
2700
2706
  showErrors: s
@@ -2706,7 +2712,7 @@ function qi({
2706
2712
  allowDataInference: y,
2707
2713
  updateIds: !i,
2708
2714
  disabled: f,
2709
- getData: x,
2715
+ getData: P,
2710
2716
  showErrors: s
2711
2717
  }
2712
2718
  ) : O === "multi_select" || O === "multi_number_select" ? q = /* @__PURE__ */ e(
@@ -2716,7 +2722,7 @@ function qi({
2716
2722
  updateIds: !i,
2717
2723
  disabled: f,
2718
2724
  allowDataInference: y,
2719
- getData: x,
2725
+ getData: P,
2720
2726
  showErrors: s
2721
2727
  }
2722
2728
  ) : O === "file_upload" ? q = /* @__PURE__ */ e(
@@ -2733,23 +2739,23 @@ function qi({
2733
2739
  multiple: !0,
2734
2740
  disabled: f
2735
2741
  }
2736
- ) : O === "switch" ? q = /* @__PURE__ */ e(Ei, { disabled: f }) : O === "number_input" ? q = /* @__PURE__ */ e(Di, { disabled: f }) : O === "group" ? q = /* @__PURE__ */ e(
2737
- Vi,
2742
+ ) : O === "switch" ? q = /* @__PURE__ */ e(Fi, { disabled: f }) : O === "number_input" ? q = /* @__PURE__ */ e(Ai, { disabled: f }) : O === "group" ? q = /* @__PURE__ */ e(
2743
+ Oi,
2738
2744
  {
2739
2745
  disabled: f,
2740
- getData: x,
2746
+ getData: P,
2741
2747
  allowDataInference: y,
2742
2748
  collectionEditable: v,
2743
- propertyConfigs: P
2749
+ propertyConfigs: x
2744
2750
  }
2745
2751
  ) : O === "block" ? q = /* @__PURE__ */ e(
2746
- Si,
2752
+ Ei,
2747
2753
  {
2748
2754
  disabled: f,
2749
- getData: x,
2755
+ getData: P,
2750
2756
  allowDataInference: y,
2751
2757
  collectionEditable: v,
2752
- propertyConfigs: P
2758
+ propertyConfigs: x
2753
2759
  }
2754
2760
  ) : O === "reference" ? q = /* @__PURE__ */ e(
2755
2761
  qt,
@@ -2759,7 +2765,7 @@ function qi({
2759
2765
  multiple: !1,
2760
2766
  disabled: f
2761
2767
  }
2762
- ) : O === "date_time" ? q = /* @__PURE__ */ e(Mi, { disabled: f }) : O === "multi_references" ? q = /* @__PURE__ */ e(
2768
+ ) : O === "date_time" ? q = /* @__PURE__ */ e(Bi, { disabled: f }) : O === "multi_references" ? q = /* @__PURE__ */ e(
2763
2769
  qt,
2764
2770
  {
2765
2771
  showErrors: s,
@@ -2768,18 +2774,18 @@ function qi({
2768
2774
  disabled: f
2769
2775
  }
2770
2776
  ) : O === "repeat" ? q = /* @__PURE__ */ e(
2771
- Ii,
2777
+ Vi,
2772
2778
  {
2773
2779
  showErrors: s,
2774
2780
  existing: i,
2775
- getData: x,
2781
+ getData: P,
2776
2782
  allowDataInference: y,
2777
2783
  disabled: f,
2778
2784
  collectionEditable: v,
2779
- propertyConfigs: P
2785
+ propertyConfigs: x
2780
2786
  }
2781
- ) : O === "key_value" ? q = /* @__PURE__ */ e(Ri, { disabled: f }) : q = null, /* @__PURE__ */ a(R, { children: [
2782
- f && /* @__PURE__ */ a($r, { mode: "warn", children: [
2787
+ ) : O === "key_value" ? q = /* @__PURE__ */ e(zi, { disabled: f }) : q = null, /* @__PURE__ */ a(R, { children: [
2788
+ f && /* @__PURE__ */ a(Hr, { mode: "warn", children: [
2783
2789
  /* @__PURE__ */ e(V, { children: "This property can't be edited" }),
2784
2790
  /* @__PURE__ */ a(V, { variant: "caption", children: [
2785
2791
  "You may not have permission to edit it or it is defined in code with no ",
@@ -2796,13 +2802,13 @@ function qi({
2796
2802
  value: O ?? "",
2797
2803
  placeholder: "Select a property widget",
2798
2804
  open: b,
2799
- onOpenChange: w,
2805
+ onOpenChange: T,
2800
2806
  position: "item-aligned",
2801
2807
  disabled: f,
2802
2808
  renderValue: (Z) => {
2803
2809
  if (!Z)
2804
2810
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
2805
- const H = Z, Q = Kt[H] ?? P[H], se = Q.property, Me = se && !ie(se) ? Le(se, P) : void 0, we = ie(se) || i && se.dataType !== t?.dataType, de = Me ? K(Me, Q) : Q;
2811
+ const H = Z, Q = Kt[H] ?? x[H], se = Q.property, Me = se && !ie(se) ? Le(se, x) : void 0, we = ie(se) || i && se.dataType !== t?.dataType, de = Me ? K(Me, Q) : Q;
2806
2812
  return /* @__PURE__ */ a(
2807
2813
  "div",
2808
2814
  {
@@ -2836,7 +2842,7 @@ function qi({
2836
2842
  children: D.map(([Z, H]) => {
2837
2843
  const Q = H.property, se = i && !ie(Q) && Q.dataType !== t?.dataType;
2838
2844
  return /* @__PURE__ */ e(
2839
- lr,
2845
+ sr,
2840
2846
  {
2841
2847
  value: Z,
2842
2848
  optionDisabled: se,
@@ -2871,7 +2877,7 @@ function qi({
2871
2877
  ] }),
2872
2878
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
2873
2879
  d && /* @__PURE__ */ e(
2874
- _i,
2880
+ Ii,
2875
2881
  {
2876
2882
  showErrors: s,
2877
2883
  disabledId: i,
@@ -2882,12 +2888,12 @@ function qi({
2882
2888
  }
2883
2889
  ),
2884
2890
  q,
2885
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled: f }) })
2891
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Mi, { disabled: f }) })
2886
2892
  ] }),
2887
2893
  u && /* @__PURE__ */ e(
2888
2894
  ct,
2889
2895
  {
2890
- open: T,
2896
+ open: w,
2891
2897
  onAccept: () => u(t?.id, m),
2892
2898
  onCancel: () => C(!1),
2893
2899
  title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
@@ -2900,26 +2906,26 @@ function qi({
2900
2906
  )
2901
2907
  ] });
2902
2908
  }
2903
- const Li = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
2904
- function $i(t, r) {
2909
+ const qi = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
2910
+ function Li(t, r) {
2905
2911
  let n;
2906
- return t || (n = "You must specify an id for the field"), t && !t.match(Li) && (n = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && r && r.includes(t) && (n = "There is another field with this ID already"), n;
2912
+ return t || (n = "You must specify an id for the field"), t && !t.match(qi) && (n = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && r && r.includes(t) && (n = "There is another field with this ID already"), n;
2907
2913
  }
2908
- function Hi(t) {
2914
+ function $i(t) {
2909
2915
  let r;
2910
2916
  return t || (r = "You must specify a title for the field"), r;
2911
2917
  }
2912
- function Yi(t) {
2918
+ function Hi(t) {
2913
2919
  return t ? (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((r, n) => r + n[0].toUpperCase() + n.substring(1), "") : "";
2914
2920
  }
2915
- function Gi({
2921
+ function Yi({
2916
2922
  collection: t,
2917
2923
  onOpenChange: r,
2918
2924
  open: n
2919
2925
  }) {
2920
2926
  const i = Ie(), l = t ? `import { EntityCollection } from "firecms";
2921
2927
 
2922
- const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + li.stringify(cr(t), null, " ") : "No collection selected";
2928
+ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.stringify(ur(t), null, " ") : "No collection selected";
2923
2929
  return /* @__PURE__ */ a(
2924
2930
  Fe,
2925
2931
  {
@@ -2945,9 +2951,9 @@ const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + li.
2945
2951
  "."
2946
2952
  ] }),
2947
2953
  /* @__PURE__ */ e(
2948
- si,
2954
+ di,
2949
2955
  {
2950
- theme: di.vsDark,
2956
+ theme: ci.vsDark,
2951
2957
  code: l,
2952
2958
  language: "typescript",
2953
2959
  children: ({
@@ -2971,7 +2977,7 @@ const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + li.
2971
2977
  message: "Copied"
2972
2978
  }), navigator.clipboard.writeText(l)),
2973
2979
  children: [
2974
- /* @__PURE__ */ e(Hr, { size: "small" }),
2980
+ /* @__PURE__ */ e(Yr, { size: "small" }),
2975
2981
  "Copy to clipboard"
2976
2982
  ]
2977
2983
  }
@@ -2982,7 +2988,7 @@ const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + li.
2982
2988
  }
2983
2989
  );
2984
2990
  }
2985
- function cr(t) {
2991
+ function ur(t) {
2986
2992
  const r = (n) => {
2987
2993
  const i = {
2988
2994
  ...n
@@ -3008,10 +3014,10 @@ function cr(t) {
3008
3014
  properties: Object.entries(t.properties ?? {}).map(([n, i]) => ({
3009
3015
  [n]: r(i)
3010
3016
  })).reduce((n, i) => ({ ...n, ...i }), {}),
3011
- subcollections: (t.subcollections ?? []).map(cr)
3017
+ subcollections: (t.subcollections ?? []).map(ur)
3012
3018
  };
3013
3019
  }
3014
- function Ki({
3020
+ function Gi({
3015
3021
  showErrors: t,
3016
3022
  isNewCollection: r,
3017
3023
  propertyErrorsRef: n,
@@ -3028,11 +3034,11 @@ function Ki({
3028
3034
  const {
3029
3035
  values: f,
3030
3036
  setFieldValue: g,
3031
- setFieldError: x,
3037
+ setFieldError: P,
3032
3038
  setFieldTouched: y,
3033
- errors: P,
3039
+ errors: x,
3034
3040
  dirty: v
3035
- } = G(), b = Ie(), w = xr(), T = !w, [C, O] = j(), [N, F] = j(), [D, _] = j(), S = N ? ne(N, D) : void 0, h = S ? I(f.properties, S.replaceAll(".", ".properties.")) : void 0, [B, oe] = j(!1), [q, Z] = j(!1), [H, Q] = j(!1), [se, Me] = j([]), we = Y.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
3041
+ } = G(), b = Ie(), T = wr(), w = !T, [C, O] = j(), [N, F] = j(), [D, _] = j(), S = N ? ne(N, D) : void 0, h = S ? I(f.properties, S.replaceAll(".", ".properties.")) : void 0, [B, oe] = j(!1), [q, Z] = j(!1), [H, Q] = j(!1), [se, Me] = j([]), we = Y.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
3036
3042
  ue(() => {
3037
3043
  l && l(v);
3038
3044
  }, [v]);
@@ -3087,7 +3093,7 @@ function Ki({
3087
3093
  [A]: U
3088
3094
  }, !1);
3089
3095
  const k = [...f.propertiesOrder ?? Object.keys(f.properties), A];
3090
- ve(k), Q(!1), w && (O(k.indexOf(A)), F(A)), _(void 0);
3096
+ ve(k), Q(!1), T && (O(k.indexOf(A)), F(A)), _(void 0);
3091
3097
  }, pe = ({
3092
3098
  id: A,
3093
3099
  property: U,
@@ -3121,7 +3127,7 @@ function Ki({
3121
3127
  propertyPath: E
3122
3128
  }), E) {
3123
3129
  const M = k && Object.keys(k).length > 0;
3124
- i(A, U, M ? k : void 0), x(he(E), M ? "Property error" : void 0);
3130
+ i(A, U, M ? k : void 0), P(he(E), M ? "Property error" : void 0);
3125
3131
  }
3126
3132
  }, []), Ze = () => {
3127
3133
  O(void 0), F(void 0);
@@ -3134,7 +3140,7 @@ function Ki({
3134
3140
  /* @__PURE__ */ a("div", { className: fe(
3135
3141
  "p-4 md:p-8 pb-20 md:pb-20",
3136
3142
  "col-span-12 lg:col-span-5 h-full overflow-auto",
3137
- !T && "border-r " + kt
3143
+ !w && "border-r " + kt
3138
3144
  ), children: [
3139
3145
  /* @__PURE__ */ a("div", { className: "flex my-2", children: [
3140
3146
  /* @__PURE__ */ a("div", { className: "flex-grow mb-4", children: [
@@ -3149,7 +3155,7 @@ function Ki({
3149
3155
  placeholder: "Collection name",
3150
3156
  size: "small",
3151
3157
  required: !0,
3152
- error: !!P?.name
3158
+ error: !!x?.name
3153
3159
  }
3154
3160
  ),
3155
3161
  Xe && /* @__PURE__ */ a(
@@ -3173,7 +3179,7 @@ function Ki({
3173
3179
  variant: "filled",
3174
3180
  disabled: q,
3175
3181
  onClick: () => oe(!0),
3176
- children: /* @__PURE__ */ e(Yr, {})
3182
+ children: /* @__PURE__ */ e(Gr, {})
3177
3183
  }
3178
3184
  ) }),
3179
3185
  de && /* @__PURE__ */ e(te, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
@@ -3208,7 +3214,7 @@ function Ki({
3208
3214
  onPropertyMove: Ke,
3209
3215
  onPropertyRemove: r ? ke : void 0,
3210
3216
  collectionEditable: s,
3211
- errors: P
3217
+ errors: x
3212
3218
  }
3213
3219
  ) }),
3214
3220
  /* @__PURE__ */ e(
@@ -3224,13 +3230,13 @@ function Ki({
3224
3230
  }
3225
3231
  )
3226
3232
  ] }),
3227
- !T && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ a(
3233
+ !w && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 p-4 md:py-8 md:px-4 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ a(
3228
3234
  ge,
3229
3235
  {
3230
3236
  className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
3231
3237
  children: [
3232
3238
  S && h && !ie(h) && /* @__PURE__ */ e(
3233
- dr,
3239
+ cr,
3234
3240
  {
3235
3241
  inArray: !1,
3236
3242
  existingProperty: !r,
@@ -3269,7 +3275,7 @@ function Ki({
3269
3275
  ]
3270
3276
  }
3271
3277
  ) }),
3272
- T && /* @__PURE__ */ e(
3278
+ w && /* @__PURE__ */ e(
3273
3279
  Ve,
3274
3280
  {
3275
3281
  inArray: !1,
@@ -3289,7 +3295,7 @@ function Ki({
3289
3295
  getData: u,
3290
3296
  propertyConfigs: p,
3291
3297
  collectionEditable: s,
3292
- onOkClicked: T ? Ze : void 0
3298
+ onOkClicked: w ? Ze : void 0
3293
3299
  },
3294
3300
  `edit_view_${C}`
3295
3301
  )
@@ -3315,7 +3321,7 @@ function Ki({
3315
3321
  }
3316
3322
  ),
3317
3323
  /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
3318
- Gi,
3324
+ Yi,
3319
3325
  {
3320
3326
  collection: f,
3321
3327
  open: B,
@@ -3324,7 +3330,7 @@ function Ki({
3324
3330
  ) })
3325
3331
  ] });
3326
3332
  }
3327
- function Wi({
3333
+ function Ki({
3328
3334
  open: t,
3329
3335
  handleOk: r,
3330
3336
  handleCancel: n,
@@ -3352,7 +3358,7 @@ function Wi({
3352
3358
  }
3353
3359
  );
3354
3360
  }
3355
- function Zi({ open: t, onClose: r }) {
3361
+ function Wi({ open: t, onClose: r }) {
3356
3362
  const {
3357
3363
  entityViews: n
3358
3364
  } = Ae();
@@ -3386,7 +3392,7 @@ function Zi({ open: t, onClose: r }) {
3386
3392
  }
3387
3393
  );
3388
3394
  }
3389
- function Ji({
3395
+ function Zi({
3390
3396
  collection: t,
3391
3397
  parentCollection: r,
3392
3398
  configController: n,
@@ -3394,10 +3400,10 @@ function Ji({
3394
3400
  getUser: l,
3395
3401
  parentCollectionIds: o
3396
3402
  }) {
3397
- const { entityViews: d } = Ae(), [c, u] = Y.useState(), [m, p] = Y.useState(!1), [s, f] = Y.useState(), [g, x] = Y.useState(), {
3403
+ const { entityViews: d } = Ae(), [c, u] = Y.useState(), [m, p] = Y.useState(!1), [s, f] = Y.useState(), [g, P] = Y.useState(), {
3398
3404
  values: y,
3399
- setFieldValue: P
3400
- } = G(), v = t.subcollections ?? [], b = y.entityViews?.filter((C) => typeof C == "string").map((C) => wr(C, d)).filter(Boolean) ?? [], w = t.entityViews?.filter((C) => typeof C != "string") ?? [], T = b.length + w.length;
3405
+ setFieldValue: x
3406
+ } = G(), v = t.subcollections ?? [], b = y.entityViews?.filter((C) => typeof C == "string").map((C) => Tr(C, d)).filter(Boolean) ?? [], T = t.entityViews?.filter((C) => typeof C != "string") ?? [], w = b.length + T.length;
3401
3407
  return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
3402
3408
  /* @__PURE__ */ e(ht, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-16", children: [
3403
3409
  /* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
@@ -3409,7 +3415,7 @@ function Ji({
3409
3415
  v && v.length > 0 && /* @__PURE__ */ e(Bt, { children: /* @__PURE__ */ e(Mt, { children: v.map((C) => /* @__PURE__ */ a(
3410
3416
  Ct,
3411
3417
  {
3412
- onClick: () => x({
3418
+ onClick: () => P({
3413
3419
  isNewCollection: !1,
3414
3420
  editedCollectionId: C.id
3415
3421
  }),
@@ -3446,7 +3452,7 @@ function Ji({
3446
3452
  z,
3447
3453
  {
3448
3454
  onClick: () => {
3449
- x({
3455
+ P({
3450
3456
  isNewCollection: !0
3451
3457
  });
3452
3458
  },
@@ -3459,7 +3465,7 @@ function Ji({
3459
3465
  ] }),
3460
3466
  /* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
3461
3467
  /* @__PURE__ */ e(V, { variant: "h5", children: "Custom views" }),
3462
- T === 0 && /* @__PURE__ */ e(Gr, { action: /* @__PURE__ */ e(
3468
+ w === 0 && /* @__PURE__ */ e(Kr, { action: /* @__PURE__ */ e(
3463
3469
  z,
3464
3470
  {
3465
3471
  variant: "text",
@@ -3499,7 +3505,7 @@ function Ji({
3499
3505
  }
3500
3506
  )
3501
3507
  ] }, C.key)),
3502
- w.map((C) => /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ a(
3508
+ T.map((C) => /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ a(
3503
3509
  Re,
3504
3510
  {
3505
3511
  align: "left",
@@ -3553,7 +3559,7 @@ function Ji({
3553
3559
  {
3554
3560
  open: !!s,
3555
3561
  onAccept: () => {
3556
- P("entityViews", y.entityViews?.filter((C) => C !== s)), f(void 0);
3562
+ x("entityViews", y.entityViews?.filter((C) => C !== s)), f(void 0);
3557
3563
  },
3558
3564
  onCancel: () => f(void 0),
3559
3565
  title: /* @__PURE__ */ e(R, { children: "Remove this view?" }),
@@ -3565,7 +3571,7 @@ function Ji({
3565
3571
  }
3566
3572
  ),
3567
3573
  /* @__PURE__ */ e(
3568
- pr,
3574
+ mr,
3569
3575
  {
3570
3576
  open: !!g,
3571
3577
  configController: n,
@@ -3576,16 +3582,16 @@ function Ji({
3576
3582
  ...g,
3577
3583
  getUser: l,
3578
3584
  handleClose: () => {
3579
- x(void 0);
3585
+ P(void 0);
3580
3586
  }
3581
3587
  }
3582
3588
  ),
3583
3589
  /* @__PURE__ */ e(
3584
- Zi,
3590
+ Wi,
3585
3591
  {
3586
3592
  open: m,
3587
3593
  onClose: (C) => {
3588
- C && P("entityViews", [...y.entityViews ?? [], C]), p(!1);
3594
+ C && x("entityViews", [...y.entityViews ?? [], C]), p(!1);
3589
3595
  }
3590
3596
  }
3591
3597
  )
@@ -4013,7 +4019,7 @@ const Lt = {
4013
4019
  }
4014
4020
  }
4015
4021
  };
4016
- function Qi({
4022
+ function Ji({
4017
4023
  path: t,
4018
4024
  pathSuggestions: r,
4019
4025
  parentCollection: n,
@@ -4023,8 +4029,8 @@ function Qi({
4023
4029
  const [o, d] = j(!1), [c, u] = j();
4024
4030
  ue(() => {
4025
4031
  r && l && (d(!0), r(t).then((g) => {
4026
- const x = g.filter((y) => !(l ?? []).find((P) => P.trim().toLowerCase() === y.trim().toLowerCase()));
4027
- u(x);
4032
+ const P = g.filter((y) => !(l ?? []).find((x) => x.trim().toLowerCase() === y.trim().toLowerCase()));
4033
+ u(P);
4028
4034
  }).finally(() => d(!1)));
4029
4035
  }, [l, t, r]);
4030
4036
  const {
@@ -4041,7 +4047,7 @@ function Qi({
4041
4047
  children: /* @__PURE__ */ e(V, { variant: "h4", className: "flex-grow", children: "New collection" })
4042
4048
  }
4043
4049
  ),
4044
- n && /* @__PURE__ */ e(xt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
4050
+ n && /* @__PURE__ */ e(Pt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
4045
4051
  "This is a subcollection of ",
4046
4052
  /* @__PURE__ */ e("b", { children: n.name })
4047
4053
  ] }) }),
@@ -4056,8 +4062,8 @@ function Qi({
4056
4062
  ),
4057
4063
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
4058
4064
  o && !c && /* @__PURE__ */ e(Ge, { size: "small" }),
4059
- c?.map((g, x) => /* @__PURE__ */ e(
4060
- xt,
4065
+ c?.map((g, P) => /* @__PURE__ */ e(
4066
+ Pt,
4061
4067
  {
4062
4068
  colorScheme: "cyanLighter",
4063
4069
  onClick: () => {
@@ -4137,7 +4143,7 @@ function Qi({
4137
4143
  children: "● Create a collection from a file (csv, json, xls, xslx...)"
4138
4144
  }
4139
4145
  ),
4140
- /* @__PURE__ */ e(ci, { onDataAdded: (g, x) => i(g, x) })
4146
+ /* @__PURE__ */ e(ui, { onDataAdded: (g, P) => i(g, P) })
4141
4147
  ] }),
4142
4148
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(z, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
4143
4149
  ] }) });
@@ -4165,7 +4171,7 @@ function lt({
4165
4171
  }
4166
4172
  ) });
4167
4173
  }
4168
- function Xi({
4174
+ function Qi({
4169
4175
  importConfig: t,
4170
4176
  propertyConfigs: r,
4171
4177
  collectionEditable: n
@@ -4176,67 +4182,63 @@ function Xi({
4176
4182
  values: o
4177
4183
  } = G(), [d, c] = j(void 0), u = Y.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), m = d ? d.id : void 0, p = d || void 0, s = ({
4178
4184
  id: g,
4179
- property: x,
4185
+ property: P,
4180
4186
  previousId: y,
4181
- namespace: P
4187
+ namespace: x
4182
4188
  }) => {
4183
- const v = g ? ne(g, P) : void 0, b = v ? he(v) : void 0, w = (C) => C ? u.current[C] ?? I(o, Ce(C)) : u.current[""], T = (C, O) => {
4189
+ const v = g ? ne(g, x) : void 0, b = v ? he(v) : void 0, T = (C) => C ? u.current[C] ?? I(o, Ce(C)) : u.current[""], w = (C, O) => {
4184
4190
  const N = Ce(O);
4185
4191
  i(N, C, !1), u.current[O ?? ""] = C;
4186
4192
  };
4187
4193
  if (y && y !== g) {
4188
- const C = ne(y, P), O = he(C), F = w(P).map((_) => _ === y ? g : _).filter((_) => _ !== void 0);
4189
- T(F, P);
4194
+ const C = ne(y, x), O = he(C), F = T(x).map((_) => _ === y ? g : _).filter((_) => _ !== void 0);
4195
+ w(F, x);
4190
4196
  const D = { ...t.headersMapping };
4191
4197
  Object.keys(D).forEach((_) => {
4192
4198
  D[_] === y && (D[_] = g ?? "");
4193
4199
  }), t.setHeadersMapping(D), i(O, void 0, !1), l(O, !1, !1);
4194
4200
  }
4195
- b && (i(b, x, !1), l(b, !0, !1));
4201
+ b && (i(b, P, !1), l(b, !0, !1));
4196
4202
  }, f = async ({
4197
4203
  id: g,
4198
- importKey: x,
4204
+ importKey: P,
4199
4205
  property: y,
4200
- namespace: P
4206
+ namespace: x
4201
4207
  }) => {
4202
- const v = g ? ne(g, P) : void 0, b = v ? he(v) : void 0, w = t.importData.map((C) => I(C, x)), T = {
4203
- ...ri(w, y, ir),
4208
+ const v = g ? ne(g, x) : void 0, b = v ? he(v) : void 0, T = t.importData.map((C) => I(C, P)), w = {
4209
+ ...ii(T, y, ir),
4204
4210
  editable: !0
4205
4211
  };
4206
- b && (T ? i(b, T, !1) : i(b, y, !1), l(b, !0, !1));
4212
+ b && (w ? i(b, w, !1) : i(b, y, !1), l(b, !0, !1));
4207
4213
  };
4208
4214
  return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
4209
4215
  /* @__PURE__ */ a(ht, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
4210
4216
  /* @__PURE__ */ e(V, { variant: "h6", className: "my-4 ml-3.5", children: "Data property mapping" }),
4211
4217
  /* @__PURE__ */ e(
4212
- ui,
4218
+ pi,
4213
4219
  {
4214
- headersMapping: t.headersMapping,
4215
- headingsOrder: t.headingsOrder,
4216
- idColumn: t.idColumn,
4217
- originProperties: t.originProperties,
4220
+ importConfig: t,
4218
4221
  destinationProperties: o.properties,
4219
- onIdPropertyChanged: (g) => t.setIdColumn(g ?? void 0),
4220
4222
  buildPropertyView: ({
4221
4223
  property: g,
4222
- propertyKey: x,
4224
+ propertyKey: P,
4223
4225
  importKey: y,
4224
- isIdColumn: P
4225
- }) => P ? /* @__PURE__ */ e(V, { children: " This column will be used as ID" }) : /* @__PURE__ */ e(
4226
- pi,
4226
+ isIdColumn: x
4227
+ }) => x ? /* @__PURE__ */ e(V, { children: " This column will be used as ID" }) : /* @__PURE__ */ e(
4228
+ mi,
4227
4229
  {
4228
4230
  property: g,
4229
- propertyKey: x,
4231
+ propertyKey: P,
4230
4232
  onPropertyNameChanged: (v, b) => i(`properties.${v}.name`, b, !1),
4231
4233
  onEditClick: () => {
4232
- !x || !g || c({
4234
+ !P || !g || c({
4233
4235
  ...g,
4234
- id: x,
4236
+ id: P,
4235
4237
  editable: !0
4236
4238
  });
4237
4239
  },
4238
4240
  propertyTypeView: /* @__PURE__ */ e(
4239
- en,
4241
+ Xi,
4240
4242
  {
4241
4243
  property: g,
4242
4244
  disabled: !1,
@@ -4244,7 +4246,7 @@ function Xi({
4244
4246
  ...v,
4245
4247
  importKey: y
4246
4248
  }),
4247
- propertyKey: x,
4249
+ propertyKey: P,
4248
4250
  propertyConfigs: r
4249
4251
  }
4250
4252
  )
@@ -4278,7 +4280,7 @@ function Xi({
4278
4280
  /* @__PURE__ */ e("div", { style: { height: "52px" } })
4279
4281
  ] });
4280
4282
  }
4281
- function en({
4283
+ function Xi({
4282
4284
  property: t,
4283
4285
  onPropertyChanged: r,
4284
4286
  propertyKey: n,
@@ -4305,7 +4307,7 @@ function en({
4305
4307
  position: "item-aligned",
4306
4308
  renderValue: (m) => d ? /* @__PURE__ */ e($e, { propertyConfig: d }) : null,
4307
4309
  onValueChange: (m) => {
4308
- const p = or(t, m, i);
4310
+ const p = lr(t, m, i);
4309
4311
  n && r({
4310
4312
  id: n,
4311
4313
  property: p,
@@ -4313,8 +4315,8 @@ function en({
4313
4315
  namespace: void 0
4314
4316
  });
4315
4317
  },
4316
- children: Object.entries(sr).map(([m, p]) => /* @__PURE__ */ e(
4317
- lr,
4318
+ children: Object.entries(dr).map(([m, p]) => /* @__PURE__ */ e(
4319
+ sr,
4318
4320
  {
4319
4321
  value: m,
4320
4322
  optionDisabled: !1,
@@ -4328,22 +4330,22 @@ function en({
4328
4330
  }
4329
4331
  );
4330
4332
  }
4331
- function tn({
4333
+ function en({
4332
4334
  importConfig: t,
4333
4335
  properties: r,
4334
4336
  propertiesOrder: n
4335
4337
  }) {
4336
4338
  const [i, l] = j(!1);
4337
4339
  async function o() {
4338
- const c = mi(t.originProperties, r), u = t.importData.map((m) => hi(m, t.idColumn, t.headersMapping, r, c, "TEMP_PATH"));
4339
- t.setEntities(u);
4340
+ const c = t.importData.map((u) => hi(u, t.idColumn, t.headersMapping, r, "TEMP_PATH", t.defaultValues));
4341
+ t.setEntities(c);
4340
4342
  }
4341
4343
  ue(() => {
4342
4344
  o().finally(() => l(!1));
4343
4345
  }, []);
4344
- const d = Tr();
4346
+ const d = kr();
4345
4347
  return i ? /* @__PURE__ */ e(ut, {}) : /* @__PURE__ */ e(
4346
- kr,
4348
+ Or,
4347
4349
  {
4348
4350
  title: /* @__PURE__ */ a("div", { children: [
4349
4351
  /* @__PURE__ */ e(V, { variant: "subtitle2", children: "Imported data preview" }),
@@ -4366,11 +4368,11 @@ function tn({
4366
4368
  }
4367
4369
  );
4368
4370
  }
4369
- function ur(t, r = "") {
4371
+ function pr(t, r = "") {
4370
4372
  const n = Object.keys(t).reduce((o, d) => {
4371
- const c = t[d], u = Or(d), m = r ? `${r}.${u}` : u;
4373
+ const c = t[d], u = Vr(d), m = r ? `${r}.${u}` : u;
4372
4374
  if (c.dataType === "map" && c.properties) {
4373
- const f = ur(c.properties, m);
4375
+ const f = pr(c.properties, m);
4374
4376
  return {
4375
4377
  headersMapping: { ...o.headersMapping, [d]: m },
4376
4378
  properties: {
@@ -4398,7 +4400,7 @@ function ur(t, r = "") {
4398
4400
  idColumn: l
4399
4401
  };
4400
4402
  }
4401
- function pr(t) {
4403
+ function mr(t) {
4402
4404
  const r = t.open, [n, i] = Ue.useState(!1), [l, o] = Ue.useState(!1), d = J(() => {
4403
4405
  n ? o(!0) : t.handleClose(void 0);
4404
4406
  }, [n, t.handleClose]);
@@ -4415,7 +4417,7 @@ function pr(t) {
4415
4417
  onOpenChange: (c) => c ? void 0 : d(),
4416
4418
  children: [
4417
4419
  r && /* @__PURE__ */ e(
4418
- rn,
4420
+ tn,
4419
4421
  {
4420
4422
  ...t,
4421
4423
  handleCancel: d,
@@ -4423,7 +4425,7 @@ function pr(t) {
4423
4425
  }
4424
4426
  ),
4425
4427
  /* @__PURE__ */ e(
4426
- Wi,
4428
+ Ki,
4427
4429
  {
4428
4430
  open: l,
4429
4431
  handleOk: () => t.handleClose(void 0),
@@ -4435,14 +4437,14 @@ function pr(t) {
4435
4437
  }
4436
4438
  );
4437
4439
  }
4438
- function rn(t) {
4440
+ function tn(t) {
4439
4441
  const { propertyConfigs: r } = Ae(), n = Te(), i = _e(), {
4440
4442
  topLevelNavigation: l,
4441
4443
  collections: o
4442
- } = n, d = t.initialValues, c = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], m = u.map((b) => b.path.trim().toLowerCase()), p = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [s, f] = Ue.useState(), [g, x] = Ue.useState(!1);
4444
+ } = n, d = t.initialValues, c = !d?.path && (t.parentCollectionIds ?? []).length === 0, u = (t.parentCollection ? t.parentCollection.subcollections : o) ?? [], m = u.map((b) => b.path.trim().toLowerCase()), p = u.map((b) => b.id?.trim().toLowerCase()).filter(Boolean), [s, f] = Ue.useState(), [g, P] = Ue.useState(!1);
4443
4445
  if (ue(() => {
4444
4446
  try {
4445
- n.initialised && (t.editedCollectionId ? f(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : f(void 0), x(!0));
4447
+ n.initialised && (t.editedCollectionId ? f(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : f(void 0), P(!0));
4446
4448
  } catch (b) {
4447
4449
  console.error(b);
4448
4450
  }
@@ -4450,10 +4452,10 @@ function rn(t) {
4450
4452
  throw Error("Internal: Navigation not ready in collection editor");
4451
4453
  const {
4452
4454
  groups: y
4453
- } = l, P = s ? {
4455
+ } = l, x = s ? {
4454
4456
  ...s,
4455
4457
  id: s.id ?? s.path ?? Ft(16)
4456
- } : void 0, v = P ? an(P, r) : {
4458
+ } : void 0, v = x ? nn(x, r) : {
4457
4459
  id: d?.path ?? Ft(16),
4458
4460
  path: d?.path ?? "",
4459
4461
  name: d?.name ?? "",
@@ -4464,7 +4466,7 @@ function rn(t) {
4464
4466
  ownerId: i.user?.uid ?? ""
4465
4467
  };
4466
4468
  return g ? !t.isNewCollection && (!n.initialised || !g) ? /* @__PURE__ */ e(ut, {}) : /* @__PURE__ */ e(
4467
- nn,
4469
+ rn,
4468
4470
  {
4469
4471
  ...t,
4470
4472
  initialValues: v,
@@ -4478,7 +4480,7 @@ function rn(t) {
4478
4480
  }
4479
4481
  ) : /* @__PURE__ */ e(ut, {});
4480
4482
  }
4481
- function nn({
4483
+ function rn({
4482
4484
  isNewCollection: t,
4483
4485
  configController: r,
4484
4486
  editedCollectionId: n,
@@ -4493,13 +4495,13 @@ function nn({
4493
4495
  pathSuggestions: s,
4494
4496
  getUser: f,
4495
4497
  parentCollection: g,
4496
- getData: x,
4498
+ getData: P,
4497
4499
  existingPaths: y,
4498
- existingIds: P,
4500
+ existingIds: x,
4499
4501
  includeTemplates: v,
4500
4502
  collection: b,
4501
- setCollection: w,
4502
- initialValues: T,
4503
+ setCollection: T,
4504
+ initialValues: w,
4503
4505
  propertyConfigs: C,
4504
4506
  groups: O
4505
4507
  }) {
@@ -4522,15 +4524,15 @@ function nn({
4522
4524
  }, [o, i]), se = J(async (k) => {
4523
4525
  try {
4524
4526
  if (!Q)
4525
- return w(k), Promise.resolve(k);
4527
+ return T(k), Promise.resolve(k);
4526
4528
  B("loading");
4527
4529
  const E = await Q?.(k);
4528
4530
  if (!E)
4529
- return w(k), Promise.resolve(k);
4531
+ return T(k), Promise.resolve(k);
4530
4532
  const M = {
4531
4533
  ...k ?? {}
4532
4534
  };
4533
- return Object.keys(E.properties ?? {}).length > 0 && (M.properties = E.properties, M.propertiesOrder = E.propertiesOrder), M.propertiesOrder ? (w(M), console.debug("Inferred collection", {
4535
+ return Object.keys(E.properties ?? {}).length > 0 && (M.properties = E.properties, M.propertiesOrder = E.propertiesOrder), M.propertiesOrder ? (T(M), console.debug("Inferred collection", {
4534
4536
  newCollection: k ?? {},
4535
4537
  values: M
4536
4538
  }), M) : (M.propertiesOrder = Object.keys(M.properties), M);
@@ -4541,13 +4543,13 @@ function nn({
4541
4543
  }), k;
4542
4544
  }
4543
4545
  }, [i, Q]), de = Ot({
4544
- initialValues: T,
4546
+ initialValues: w,
4545
4547
  onSubmit: (k, E) => {
4546
4548
  console.log("Submitting collection", k);
4547
4549
  try {
4548
4550
  if (!t) {
4549
4551
  Z(k).then(() => {
4550
- E.resetForm({ values: T }), d(k);
4552
+ E.resetForm({ values: w }), d(k);
4551
4553
  });
4552
4554
  return;
4553
4555
  }
@@ -4562,7 +4564,7 @@ function nn({
4562
4564
  }).finally(() => {
4563
4565
  H();
4564
4566
  }) : (E.resetForm({ values: k }), H()) : h === "extra_view" ? (H(), E.resetForm({ values: k })) : h === "import_data_mapping" || h === "import_data_preview" ? H() : h === "properties" ? Z(k).then(() => {
4565
- E.resetForm({ values: T }), H(), d(k);
4567
+ E.resetForm({ values: w }), H(), d(k);
4566
4568
  }) : (H(), E.resetForm({ values: k }));
4567
4569
  } catch (M) {
4568
4570
  D.open({
@@ -4585,7 +4587,7 @@ function nn({
4585
4587
  if (h === "properties" && (E = { ...E, ..._.current }), h === "details") {
4586
4588
  const L = Gt(k.path, t, y, k.id);
4587
4589
  L && (E.path = L);
4588
- const ye = on(k.id, t, y, P);
4590
+ const ye = an(k.id, t, y, x);
4589
4591
  ye && (E.id = ye);
4590
4592
  }
4591
4593
  return E;
@@ -4596,13 +4598,13 @@ function nn({
4596
4598
  isSubmitting: ke,
4597
4599
  dirty: Ke,
4598
4600
  submitCount: vt
4599
- } = de, pe = re.path, We = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + pe : pe, Ze = Gt(pe, t, y, re.id), Je = !Ze && i ? F.convertIdsToPaths(i) : void 0, Qe = Ze ? void 0 : F.resolveAliasesFrom(We), ze = Qe && x ? () => x(Qe, Je ?? []) : void 0;
4601
+ } = de, pe = re.path, We = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + pe : pe, Ze = Gt(pe, t, y, re.id), Je = !Ze && i ? F.convertIdsToPaths(i) : void 0, Qe = Ze ? void 0 : F.resolveAliasesFrom(We), ze = Qe && P ? () => P(Qe, Je ?? []) : void 0;
4600
4602
  ue(() => {
4601
4603
  p(Ke);
4602
4604
  }, [Ke]);
4603
4605
  function Xe(k, E) {
4604
- N.setInUse(!0), ii(k, ir).then((M) => {
4605
- const L = ur(M);
4606
+ N.setInUse(!0), ni(k, ir).then((M) => {
4607
+ const L = pr(M);
4606
4608
  N.setIdColumn(L.idColumn), N.setImportData(k), N.setHeadersMapping(L.headersMapping);
4607
4609
  const ye = (E ?? []).filter((tt) => L.headersMapping[tt]) ?? Object.keys(L.properties);
4608
4610
  N.setHeadingsOrder(ye), N.setOriginProperties(L.properties);
@@ -4616,7 +4618,7 @@ function nn({
4616
4618
  }, U = b?.editable === void 0 || b?.editable === !0 || t;
4617
4619
  return /* @__PURE__ */ e(De, { fullHeight: !0, children: /* @__PURE__ */ e(Vt, { value: de, children: /* @__PURE__ */ a(R, { children: [
4618
4620
  !t && /* @__PURE__ */ a(
4619
- Kr,
4621
+ Wr,
4620
4622
  {
4621
4623
  value: h,
4622
4624
  className: fe(kt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
@@ -4641,7 +4643,7 @@ function nn({
4641
4643
  h === "loading" && /* @__PURE__ */ e(ut, {}),
4642
4644
  h === "extra_view" && pe && u?.View && /* @__PURE__ */ e(u.View, { path: pe }),
4643
4645
  h === "welcome" && /* @__PURE__ */ e(
4644
- Qi,
4646
+ Ji,
4645
4647
  {
4646
4648
  path: pe,
4647
4649
  onContinue: (k, E) => {
@@ -4653,7 +4655,7 @@ function nn({
4653
4655
  }
4654
4656
  ),
4655
4657
  h === "import_data_mapping" && N && /* @__PURE__ */ e(
4656
- Xi,
4658
+ Qi,
4657
4659
  {
4658
4660
  importConfig: N,
4659
4661
  collectionEditable: U,
@@ -4661,7 +4663,7 @@ function nn({
4661
4663
  }
4662
4664
  ),
4663
4665
  h === "import_data_preview" && N && /* @__PURE__ */ e(
4664
- tn,
4666
+ en,
4665
4667
  {
4666
4668
  importConfig: N,
4667
4669
  properties: re.properties,
@@ -4686,7 +4688,7 @@ function nn({
4686
4688
  bi,
4687
4689
  {
4688
4690
  existingPaths: y,
4689
- existingIds: P,
4691
+ existingIds: x,
4690
4692
  groups: O,
4691
4693
  parentCollectionIds: i,
4692
4694
  parentCollection: g,
@@ -4694,7 +4696,7 @@ function nn({
4694
4696
  }
4695
4697
  ),
4696
4698
  h === "subcollections" && b && /* @__PURE__ */ e(
4697
- Ji,
4699
+ Zi,
4698
4700
  {
4699
4701
  parentCollection: g,
4700
4702
  configController: r,
@@ -4705,7 +4707,7 @@ function nn({
4705
4707
  }
4706
4708
  ),
4707
4709
  h === "properties" && /* @__PURE__ */ e(
4708
- Ki,
4710
+ Gi,
4709
4711
  {
4710
4712
  showErrors: vt > 0,
4711
4713
  isNewCollection: t,
@@ -4713,7 +4715,7 @@ function nn({
4713
4715
  onPropertyError: (k, E, M) => {
4714
4716
  const L = Et({
4715
4717
  ..._.current,
4716
- [nr(k, E)]: Et(M, !0)
4718
+ [ar(k, E)]: Et(M, !0)
4717
4719
  }, !0);
4718
4720
  _.current = L, de.validate();
4719
4721
  },
@@ -4826,7 +4828,7 @@ function nn({
4826
4828
  type: "submit",
4827
4829
  loading: ke,
4828
4830
  disabled: ke || h === "details" && !yt,
4829
- startIcon: h === "properties" ? /* @__PURE__ */ e(Wr, {}) : void 0,
4831
+ startIcon: h === "properties" ? /* @__PURE__ */ e(Zr, {}) : void 0,
4830
4832
  children: [
4831
4833
  h === "details" && "Next",
4832
4834
  h === "properties" && "Create collection"
@@ -4851,19 +4853,19 @@ function nn({
4851
4853
  )
4852
4854
  ] }) }) });
4853
4855
  }
4854
- function an(t, r) {
4856
+ function nn(t, r) {
4855
4857
  const {
4856
4858
  properties: n,
4857
4859
  ...i
4858
4860
  } = t, l = {};
4859
4861
  return n && Object.keys(n).forEach((o) => {
4860
- l[o] = mr(n[o], r);
4862
+ l[o] = hr(n[o], r);
4861
4863
  }), {
4862
4864
  ...i,
4863
4865
  properties: l
4864
4866
  };
4865
4867
  }
4866
- function mr(t, r) {
4868
+ function hr(t, r) {
4867
4869
  let n = t;
4868
4870
  if (r && typeof n == "object" && n.propertyConfig) {
4869
4871
  const i = r[n.propertyConfig];
@@ -4872,7 +4874,7 @@ function mr(t, r) {
4872
4874
  else if (i && (n = K(i.property, n)), !ie(n) && n.dataType === "map" && n.properties) {
4873
4875
  const l = {};
4874
4876
  Object.keys(n.properties).forEach((o) => {
4875
- l[o] = mr(n.properties[o], r);
4877
+ l[o] = hr(n.properties[o], r);
4876
4878
  }), n = {
4877
4879
  ...n,
4878
4880
  properties: l
@@ -4883,13 +4885,13 @@ function mr(t, r) {
4883
4885
  }
4884
4886
  const Gt = (t, r, n, i) => {
4885
4887
  let l;
4886
- return t || (l = "You must specify a path in the database for this collection"), r && n?.includes(t.trim().toLowerCase()) && !i && (l = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, make sure the have different ids"), Vr(t).split("/").length % 2 === 0 && (l = `Collection paths must have an odd number of segments: ${t}`), l;
4887
- }, on = (t, r, n, i) => {
4888
+ return t || (l = "You must specify a path in the database for this collection"), r && n?.includes(t.trim().toLowerCase()) && !i && (l = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, make sure the have different ids"), Ir(t).split("/").length % 2 === 0 && (l = `Collection paths must have an odd number of segments: ${t}`), l;
4889
+ }, an = (t, r, n, i) => {
4888
4890
  if (!t)
4889
4891
  return;
4890
4892
  let l;
4891
4893
  return r && n?.includes(t.trim().toLowerCase()) && (l = "There is already a collection that uses this value as a path"), r && i?.includes(t.trim().toLowerCase()) && (l = "There is already a collection which uses this id"), l;
4892
- }, hr = Y.createContext({}), fr = Y.createContext({}), ln = Y.memo(
4894
+ }, fr = Y.createContext({}), gr = Y.createContext({}), on = Y.memo(
4893
4895
  function({
4894
4896
  children: r,
4895
4897
  collectionConfigController: n,
@@ -4902,11 +4904,11 @@ const Gt = (t, r, n, i) => {
4902
4904
  getData: m,
4903
4905
  onAnalyticsEvent: p
4904
4906
  }) {
4905
- const s = Te(), f = vi(), g = Ie(), { propertyConfigs: x } = Ae(), [y, P] = Y.useState(), [v, b] = Y.useState(), w = J(() => ({
4907
+ const s = Te(), f = vi(), g = Ie(), { propertyConfigs: P } = Ae(), [y, x] = Y.useState(), [v, b] = Y.useState(), T = J(() => ({
4906
4908
  createCollections: !0,
4907
4909
  editCollections: !0,
4908
4910
  deleteCollections: !0
4909
- }), []), T = J(({
4911
+ }), []), w = J(({
4910
4912
  id: N,
4911
4913
  fullPath: F,
4912
4914
  parentCollectionIds: D,
@@ -4915,7 +4917,7 @@ const Gt = (t, r, n, i) => {
4915
4917
  console.debug("Edit collection", N, F, D, _), p?.("edit_collection", {
4916
4918
  id: N,
4917
4919
  fullPath: F
4918
- }), P({
4920
+ }), x({
4919
4921
  editedCollectionId: N,
4920
4922
  fullPath: F,
4921
4923
  parentCollectionIds: D,
@@ -4964,7 +4966,7 @@ const Gt = (t, r, n, i) => {
4964
4966
  initialValues: D,
4965
4967
  redirect: _,
4966
4968
  sourceClick: S
4967
- }), P({
4969
+ }), x({
4968
4970
  isNewCollection: !0,
4969
4971
  parentCollectionIds: N,
4970
4972
  parentCollection: F,
@@ -4972,20 +4974,20 @@ const Gt = (t, r, n, i) => {
4972
4974
  redirect: _
4973
4975
  });
4974
4976
  }, []);
4975
- return /* @__PURE__ */ e(hr.Provider, { value: n, children: /* @__PURE__ */ a(
4976
- fr.Provider,
4977
+ return /* @__PURE__ */ e(fr.Provider, { value: n, children: /* @__PURE__ */ a(
4978
+ gr.Provider,
4977
4979
  {
4978
4980
  value: {
4979
- editCollection: T,
4981
+ editCollection: w,
4980
4982
  createCollection: O,
4981
4983
  editProperty: C,
4982
- configPermissions: i ?? w,
4984
+ configPermissions: i ?? T,
4983
4985
  getPathSuggestions: c
4984
4986
  },
4985
4987
  children: [
4986
4988
  r,
4987
4989
  /* @__PURE__ */ e(
4988
- pr,
4990
+ mr,
4989
4991
  {
4990
4992
  open: !!y,
4991
4993
  configController: n,
@@ -5002,7 +5004,7 @@ const Gt = (t, r, n, i) => {
5002
5004
  const F = s.buildUrlCollectionPath(N.id ?? N.path);
5003
5005
  f(F);
5004
5006
  }
5005
- P(void 0);
5007
+ x(void 0);
5006
5008
  }
5007
5009
  }
5008
5010
  ),
@@ -5070,7 +5072,7 @@ const Gt = (t, r, n, i) => {
5070
5072
  forceShowErrors: !1,
5071
5073
  existingPropertyKeys: [],
5072
5074
  allowDataInference: !0,
5073
- propertyConfigs: x,
5075
+ propertyConfigs: P,
5074
5076
  property: v?.property,
5075
5077
  propertyKey: v?.propertyKey
5076
5078
  }
@@ -5080,14 +5082,14 @@ const Gt = (t, r, n, i) => {
5080
5082
  ) });
5081
5083
  },
5082
5084
  be
5083
- ), xe = () => Qt(fr);
5084
- function sn({
5085
+ ), Pe = () => Qt(gr);
5086
+ function ln({
5085
5087
  path: t,
5086
5088
  parentCollectionIds: r,
5087
5089
  collection: n,
5088
5090
  tableController: i
5089
5091
  }) {
5090
- const l = _e(), o = Te(), d = xe(), c = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
5092
+ const l = _e(), o = Te(), d = Pe(), c = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
5091
5093
  user: l.user,
5092
5094
  collection: n
5093
5095
  }).editCollections : !0;
@@ -5107,12 +5109,12 @@ function sn({
5107
5109
  }
5108
5110
  ) });
5109
5111
  }
5110
- const gr = () => Qt(hr);
5111
- function dn({
5112
+ const vr = () => Qt(fr);
5113
+ function sn({
5112
5114
  path: t,
5113
5115
  collection: r
5114
5116
  }) {
5115
- const n = Ie(), i = _e(), l = gr(), o = xe(), d = o.configPermissions({
5117
+ const n = Ie(), i = _e(), l = vr(), o = Pe(), d = o.configPermissions({
5116
5118
  user: i.user,
5117
5119
  collection: r
5118
5120
  }), c = J(() => {
@@ -5128,10 +5130,10 @@ function dn({
5128
5130
  return /* @__PURE__ */ a(R, { children: [
5129
5131
  /* @__PURE__ */ a("div", { children: [
5130
5132
  d.deleteCollections && /* @__PURE__ */ e(
5131
- Zr,
5133
+ Jr,
5132
5134
  {
5133
- trigger: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(Jr, { size: "small" }) }),
5134
- children: /* @__PURE__ */ a(Qr, { onClick: (s) => {
5135
+ trigger: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(Qr, { size: "small" }) }),
5136
+ children: /* @__PURE__ */ a(Xr, { onClick: (s) => {
5135
5137
  s.preventDefault(), s.stopPropagation(), m(!0);
5136
5138
  }, children: [
5137
5139
  /* @__PURE__ */ e(mt, {}),
@@ -5165,7 +5167,7 @@ function dn({
5165
5167
  )
5166
5168
  ] });
5167
5169
  }
5168
- function cn({
5170
+ function dn({
5169
5171
  propertyKey: t,
5170
5172
  onHover: r,
5171
5173
  property: n,
@@ -5173,7 +5175,7 @@ function cn({
5173
5175
  parentCollectionIds: l,
5174
5176
  collection: o
5175
5177
  }) {
5176
- const d = xe();
5178
+ const d = Pe();
5177
5179
  return /* @__PURE__ */ e(te, { title: "Edit", children: /* @__PURE__ */ e(
5178
5180
  ae,
5179
5181
  {
@@ -5192,12 +5194,12 @@ function cn({
5192
5194
  }
5193
5195
  ) });
5194
5196
  }
5195
- function un({
5197
+ function cn({
5196
5198
  fullPath: t,
5197
5199
  parentCollectionIds: r,
5198
5200
  collection: n
5199
5201
  }) {
5200
- const i = _e(), l = xe(), o = l.configPermissions ? l.configPermissions({
5202
+ const i = _e(), l = Pe(), o = l.configPermissions ? l.configPermissions({
5201
5203
  user: i.user,
5202
5204
  collection: n
5203
5205
  }).editCollections : !0;
@@ -5209,7 +5211,7 @@ function un({
5209
5211
  l.editProperty({
5210
5212
  editedCollectionId: n.id,
5211
5213
  parentCollectionIds: r,
5212
- currentPropertiesOrder: Ir(n),
5214
+ currentPropertiesOrder: _r(n),
5213
5215
  collection: n
5214
5216
  });
5215
5217
  },
@@ -5217,8 +5219,8 @@ function un({
5217
5219
  }
5218
5220
  ) });
5219
5221
  }
5220
- function pn() {
5221
- const t = xe();
5222
+ function un() {
5223
+ const t = Pe();
5222
5224
  return /* @__PURE__ */ e("div", { className: "bg-gray-50 dark:bg-gray-900 min-w-fit rounded", children: /* @__PURE__ */ a(
5223
5225
  z,
5224
5226
  {
@@ -5236,13 +5238,13 @@ function pn() {
5236
5238
  }
5237
5239
  ) });
5238
5240
  }
5239
- function mn({
5241
+ function pn({
5240
5242
  path: t,
5241
5243
  parentCollectionIds: r,
5242
5244
  collection: n,
5243
5245
  tableController: i
5244
5246
  }) {
5245
- const l = _e(), o = xe(), d = gr(), c = Ie(), u = o.configPermissions ? o.configPermissions({
5247
+ const l = _e(), o = Pe(), d = vr(), c = Ie(), u = o.configPermissions ? o.configPermissions({
5246
5248
  user: l.user,
5247
5249
  collection: n
5248
5250
  }).editCollections : !0;
@@ -5274,7 +5276,7 @@ function mn({
5274
5276
  message: "Default config saved"
5275
5277
  });
5276
5278
  }),
5277
- children: /* @__PURE__ */ e(Xr, {})
5279
+ children: /* @__PURE__ */ e(ei, {})
5278
5280
  }
5279
5281
  )
5280
5282
  }
@@ -5292,7 +5294,7 @@ function mn({
5292
5294
  onClick: () => {
5293
5295
  i.clearFilter?.(), n?.initialFilter && i.setFilterValues?.(n?.initialFilter), n?.initialSort && i.setSortBy?.(n?.initialSort);
5294
5296
  },
5295
- children: /* @__PURE__ */ e(ei, {})
5297
+ children: /* @__PURE__ */ e(ti, {})
5296
5298
  }
5297
5299
  )
5298
5300
  }
@@ -5302,13 +5304,13 @@ function mn({
5302
5304
  function st(t) {
5303
5305
  return t && Object.keys(t).length === 0 ? t : t ?? null;
5304
5306
  }
5305
- function hn({
5307
+ function mn({
5306
5308
  group: t,
5307
5309
  context: r
5308
5310
  }) {
5309
5311
  if (!r.navigation.topLevelNavigation)
5310
5312
  throw Error("Navigation not ready in FireCMSHomePage");
5311
- const n = _e(), i = xe(), l = i.configPermissions ? i.configPermissions({
5313
+ const n = _e(), i = Pe(), l = i.configPermissions ? i.configPermissions({
5312
5314
  user: n.user
5313
5315
  }).createCollections : !0;
5314
5316
  return /* @__PURE__ */ e(
@@ -5343,7 +5345,7 @@ function hn({
5343
5345
  }
5344
5346
  );
5345
5347
  }
5346
- function In({
5348
+ function Vn({
5347
5349
  collectionConfigController: t,
5348
5350
  configPermissions: r,
5349
5351
  reservedGroups: n,
@@ -5358,7 +5360,7 @@ function In({
5358
5360
  key: "collection_editor",
5359
5361
  loading: t.loading,
5360
5362
  provider: {
5361
- Component: ln,
5363
+ Component: on,
5362
5364
  props: {
5363
5365
  collectionConfigController: t,
5364
5366
  configPermissions: r,
@@ -5372,38 +5374,38 @@ function In({
5372
5374
  }
5373
5375
  },
5374
5376
  homePage: {
5375
- additionalActions: /* @__PURE__ */ e(pn, {}),
5376
- additionalChildrenStart: /* @__PURE__ */ e(fn, {}),
5377
+ additionalActions: /* @__PURE__ */ e(un, {}),
5378
+ additionalChildrenStart: /* @__PURE__ */ e(hn, {}),
5377
5379
  // additionalChildrenEnd: <RootCollectionSuggestions introMode={introMode}/>,
5378
- CollectionActions: dn,
5379
- AdditionalCards: hn
5380
+ CollectionActions: sn,
5381
+ AdditionalCards: mn
5380
5382
  },
5381
5383
  collectionView: {
5382
- CollectionActionsStart: mn,
5383
- CollectionActions: sn,
5384
- HeaderAction: cn,
5385
- AddColumnComponent: un
5384
+ CollectionActionsStart: pn,
5385
+ CollectionActions: ln,
5386
+ HeaderAction: dn,
5387
+ AddColumnComponent: cn
5386
5388
  }
5387
5389
  };
5388
5390
  }
5389
- function fn({ introMode: t }) {
5390
- const r = Te();
5391
- if (!r.topLevelNavigation)
5391
+ function hn({}) {
5392
+ const t = Te();
5393
+ if (!t.topLevelNavigation)
5392
5394
  throw Error("Navigation not ready in FireCMSHomePage");
5393
- const n = _e(), i = xe(), l = i.configPermissions ? i.configPermissions({
5394
- user: n.user
5395
+ const r = _e(), n = Pe(), i = n.configPermissions ? n.configPermissions({
5396
+ user: r.user
5395
5397
  }).createCollections : !0;
5396
- return (r.collections ?? []).length > 0 ? null : /* @__PURE__ */ a(
5398
+ return !t.initialised || t.collections === void 0 || (t.collections ?? []).length > 0 ? null : /* @__PURE__ */ a(
5397
5399
  ge,
5398
5400
  {
5399
5401
  className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-slate-800 gap-2",
5400
5402
  children: [
5401
5403
  /* @__PURE__ */ e(V, { variant: "subtitle2", className: "uppercase", children: "No collections found" }),
5402
5404
  /* @__PURE__ */ e(V, { children: "Start building collections in FireCMS easily. Map them to your existing database data, import from files, or use our templates." }),
5403
- l && /* @__PURE__ */ a(
5405
+ i && /* @__PURE__ */ a(
5404
5406
  z,
5405
5407
  {
5406
- onClick: i && l ? () => i.createCollection({
5408
+ onClick: n && i ? () => n.createCollection({
5407
5409
  parentCollectionIds: [],
5408
5410
  redirect: !0,
5409
5411
  sourceClick: "new_collection_card"
@@ -5419,16 +5421,16 @@ function fn({ introMode: t }) {
5419
5421
  }
5420
5422
  );
5421
5423
  }
5422
- const _n = (t, r, n) => {
5424
+ const In = (t, r, n) => {
5423
5425
  const i = (d) => {
5424
5426
  He(d.properties), d.subcollections?.forEach(i);
5425
5427
  }, l = r ?? [];
5426
5428
  l.forEach(i), console.debug("Collections specified in code:", t), console.debug("Collections stored in the backend", l);
5427
- const o = _r(t, l, [], n);
5429
+ const o = Fr(t, l, [], n);
5428
5430
  return console.debug("Collections after joining:", o), o;
5429
5431
  };
5430
- function Fn({ path: t }) {
5431
- const r = Te(), n = gn(t), i = r.getParentCollectionIds(t), l = xe();
5432
+ function _n({ path: t }) {
5433
+ const r = Te(), n = fn(t), i = r.getParentCollectionIds(t), l = Pe();
5432
5434
  return /* @__PURE__ */ a("div", { className: "p-1 flex flex-col items-center", children: [
5433
5435
  /* @__PURE__ */ e(Zt, { error: "No collection for path: " + n }),
5434
5436
  /* @__PURE__ */ e(
@@ -5450,22 +5452,22 @@ function Fn({ path: t }) {
5450
5452
  )
5451
5453
  ] });
5452
5454
  }
5453
- function gn(t) {
5455
+ function fn(t) {
5454
5456
  const r = t.split("/");
5455
5457
  return r[r.length - 1];
5456
5458
  }
5457
5459
  export {
5458
- Fn as MissingReferenceWidget,
5460
+ _n as MissingReferenceWidget,
5459
5461
  qe as editableProperty,
5460
5462
  ne as getFullId,
5461
- nr as getFullIdPath,
5463
+ ar as getFullIdPath,
5462
5464
  he as idToPropertiesPath,
5463
- _n as mergeCollections,
5465
+ In as mergeCollections,
5464
5466
  Ce as namespaceToPropertiesOrderPath,
5465
- Ci as namespaceToPropertiesPath,
5466
- Ti as removeNonEditableProperties,
5467
- xe as useCollectionEditorController,
5468
- In as useCollectionEditorPlugin,
5469
- gr as useCollectionsConfigController
5467
+ nr as namespaceToPropertiesPath,
5468
+ wi as removeNonEditableProperties,
5469
+ Pe as useCollectionEditorController,
5470
+ Vn as useCollectionEditorPlugin,
5471
+ vr as useCollectionsConfigController
5470
5472
  };
5471
5473
  //# sourceMappingURL=index.es.js.map