@firecms/collection_editor 3.0.0-beta.6 → 3.0.0-beta.7

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,23 +1,23 @@
1
1
  import { jsx as e, jsxs as a, Fragment as R } from "react/jsx-runtime";
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
- 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 Er, useContext as Qt } from "react";
5
- import be from "react-fast-compare";
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
- import * as at from "yup";
8
- import { useFormex as G, Field as $, getIn as I, useCreateFormex as Ot, Formex as Vt } from "@firecms/formex";
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
- import { useNavigate as vi } from "react-router";
15
- const yi = at.object().shape({
16
- id: at.string().required("Required"),
17
- name: at.string().required("Required"),
18
- path: at.string().required("Required")
2
+ import { FieldCaption as J, SearchIconsView as vr, toSnakeCase as Nt, singular as yr, IconForView as st, ArrayContainer as br, serializeRegExp as Cr, useSnackbarController as Ve, resolveEnumValues as Nr, isPropertyBuilder as re, useCustomizationController as Se, getFieldConfig as je, ErrorBoundary as pe, PropertyConfigBadge as qe, unslugify as Pt, useNavigationController as Te, mergeDeep as W, DEFAULT_FIELD_CONFIGS as Wt, isValidRegExp as xr, getFieldId as Gt, DeleteConfirmationDialog as dt, useLargeLayout as Pr, makePropertiesEditable as Le, resolveEntityView as wr, useSelectionController as Tr, CircularProgressCenter as ct, EntityCollectionTable as kr, slugify as Or, useAuthController as Ie, randomString as _t, removeUndefined as Ft, ErrorView as Kt, removeInitialAndTrailingSlashes as Vr, getDefaultPropertiesOrder as Ir, joinCollectionLists as _r } from "@firecms/core";
3
+ import * as ze from "react";
4
+ import G, { useState as j, useEffect as ce, useMemo as Zt, useRef as Re, useDeferredValue as Fr, useCallback as Er, useContext as Jt } from "react";
5
+ import ye from "react-fast-compare";
6
+ import { useAutoComplete as Sr, Container as mt, Typography as V, Tooltip as ee, IconButton as ie, Chip as xt, TextField as we, cls as fe, DebouncedTextField as K, Autocomplete as Ar, AutocompleteItem as Dr, ExpandablePanel as wt, SettingsIcon as $e, ClearIcon as Br, Select as be, SelectItem as X, BooleanSwitchWithLabel as ut, Dialog as _e, AutoAwesomeIcon as ht, Badge as Mr, ListIcon as zr, Button as z, CircularProgress as He, Paper as ge, DialogContent as Ae, DialogActions as De, RuleIcon as Rr, FileUploadIcon as Ur, MultiSelect as jr, MultiSelectItem as Et, Checkbox as St, cardMixin as Qt, cardClickableMixin as Xt, cardSelectedMixin as er, FunctionsIcon as qr, RemoveCircleIcon as Lr, defaultBorderMixin as Tt, RemoveIcon as $r, DragHandleIcon as Hr, AddIcon as de, SelectGroup as At, InfoLabel as Yr, DeleteIcon as pt, ContentCopyIcon as Wr, CodeIcon as Gr, Table as Dt, TableBody as Bt, TableRow as bt, TableCell as Me, Alert as Kr, Icon as rt, Card as tr, coolIconKeys as Mt, Tabs as Zr, Tab as Ct, ArrowBackIcon as it, LoadingButton as zt, DoneIcon as Jr, Menu as Qr, MoreVertIcon as Xr, MenuItem as ei, SaveIcon as ti, UndoIcon as ri } from "@firecms/ui";
7
+ import * as nt from "yup";
8
+ import { useFormex as Y, Field as $, getIn as I, useCreateFormex as kt, Formex as Ot } from "@firecms/formex";
9
+ import { extractEnumFromValues as ii, buildPropertyFromData as ni, buildEntityPropertiesFromData as ai } from "@firecms/schema_inference";
10
+ import { DragDropContext as oi, Droppable as li, Draggable as si } from "@hello-pangea/dnd";
11
+ import di from "json5";
12
+ import { Highlight as ci, themes as ui } from "prism-react-renderer";
13
+ import { ImportFileUpload as pi, DataNewPropertiesMapping as mi, ImportNewPropertyFieldPreview as hi, getInferenceType as rr, convertDataToEntity as fi, useImportConfig as gi, ImportSaveInProgress as vi } from "@firecms/data_import_export";
14
+ import { useNavigate as yi } from "react-router";
15
+ const bi = nt.object().shape({
16
+ id: nt.string().required("Required"),
17
+ name: nt.string().required("Required"),
18
+ path: nt.string().required("Required")
19
19
  });
20
- function bi({
20
+ function Ci({
21
21
  isNewCollection: t,
22
22
  reservedGroups: r,
23
23
  existingPaths: n,
@@ -25,7 +25,7 @@ function bi({
25
25
  groups: l,
26
26
  parentCollection: o
27
27
  }) {
28
- const d = Y.useRef(null), {
28
+ const d = G.useRef(null), {
29
29
  values: c,
30
30
  setFieldValue: u,
31
31
  handleChange: m,
@@ -34,23 +34,23 @@ function bi({
34
34
  setFieldTouched: f,
35
35
  isSubmitting: g,
36
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));
37
+ } = Y(), [y, x] = j(!1), [v, b] = j(!1), T = (h) => {
38
+ u("name", h), !I(p, "path") && t && h && u("path", Nt(h)), !I(p, "id") && t && h && u("id", Nt(h)), !I(p, "singularName") && t && h && u("singularName", yr(h));
39
39
  };
40
- ue(() => {
40
+ ce(() => {
41
41
  s.id && b(!0);
42
42
  }, [s.id]);
43
- const w = /* @__PURE__ */ e(dt, { collectionOrView: c }), C = l?.filter((h) => !r?.includes(h)), {
43
+ const w = /* @__PURE__ */ e(st, { collectionOrView: c }), C = l?.filter((h) => !r?.includes(h)), {
44
44
  inputFocused: O,
45
45
  autoCompleteOpen: N,
46
- setAutoCompleteOpen: F
46
+ setAutoCompleteOpen: E
47
47
  } = Sr({
48
48
  ref: d
49
- }), D = !!o;
49
+ }), B = !!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
52
  const S = P > 0;
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: [
53
+ return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(mt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
54
54
  /* @__PURE__ */ a("div", { children: [
55
55
  /* @__PURE__ */ a(
56
56
  "div",
@@ -58,8 +58,8 @@ function bi({
58
58
  className: "flex flex-row py-2 pt-3 items-center",
59
59
  children: [
60
60
  /* @__PURE__ */ e(V, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${c?.name} collection` }),
61
- /* @__PURE__ */ e(te, { title: "Change icon", children: /* @__PURE__ */ e(
62
- ae,
61
+ /* @__PURE__ */ e(ee, { title: "Change icon", children: /* @__PURE__ */ e(
62
+ ie,
63
63
  {
64
64
  shape: "square",
65
65
  onClick: () => x(!0),
@@ -69,7 +69,7 @@ function bi({
69
69
  ]
70
70
  }
71
71
  ),
72
- o && /* @__PURE__ */ e(Pt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
72
+ o && /* @__PURE__ */ e(xt, { 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
  ] }) })
@@ -77,7 +77,7 @@ function bi({
77
77
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-4", children: [
78
78
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
79
79
  /* @__PURE__ */ e(
80
- Oe,
80
+ we,
81
81
  {
82
82
  value: c.name ?? "",
83
83
  onChange: (h) => T(h.target.value),
@@ -86,25 +86,25 @@ function bi({
86
86
  error: S && !!s.name
87
87
  }
88
88
  ),
89
- /* @__PURE__ */ e(X, { error: p.name && !!s.name, children: p.name && s.name ? s.name : "Name of in this collection, usually a plural name (e.g. Products)" })
89
+ /* @__PURE__ */ e(J, { error: p.name && !!s.name, children: p.name && s.name ? s.name : "Name of in this collection, usually a plural name (e.g. Products)" })
90
90
  ] }),
91
- /* @__PURE__ */ a("div", { className: fe("col-span-12 ", D ? "" : "sm:col-span-8"), children: [
91
+ /* @__PURE__ */ a("div", { className: fe("col-span-12 ", B ? "" : "sm:col-span-8"), children: [
92
92
  /* @__PURE__ */ e(
93
93
  $,
94
94
  {
95
95
  name: "path",
96
- as: W,
96
+ as: K,
97
97
  label: "Path",
98
98
  disabled: !t,
99
99
  required: !0,
100
100
  error: S && !!s.path
101
101
  }
102
102
  ),
103
- /* @__PURE__ */ e(X, { error: p.path && !!s.path, children: p.path && s.path ? s.path : D ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
103
+ /* @__PURE__ */ e(J, { error: p.path && !!s.path, children: p.path && s.path ? s.path : B ? "Relative path to the parent (no need to include the parent path)" : "Path that this collection is stored in, in the database" })
104
104
  ] }),
105
- !D && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
105
+ !B && /* @__PURE__ */ a("div", { className: "col-span-12 sm:col-span-4 relative", children: [
106
106
  /* @__PURE__ */ e(
107
- Oe,
107
+ we,
108
108
  {
109
109
  error: S && !!s.group,
110
110
  disabled: g,
@@ -120,28 +120,28 @@ function bi({
120
120
  Ar,
121
121
  {
122
122
  open: N && (C ?? []).length > 0,
123
- setOpen: F,
124
- children: C?.map((h, B) => /* @__PURE__ */ e(
123
+ setOpen: E,
124
+ children: C?.map((h, D) => /* @__PURE__ */ e(
125
125
  Dr,
126
126
  {
127
127
  onClick: () => {
128
- F(!1), u("group", h ?? null);
128
+ E(!1), u("group", h ?? null);
129
129
  },
130
130
  children: /* @__PURE__ */ e("div", { className: "flex-grow", children: h })
131
131
  },
132
- B + "_" + h
132
+ D + "_" + h
133
133
  ))
134
134
  }
135
135
  ),
136
- /* @__PURE__ */ e(X, { children: S && s.group ? s.group : "Group of the collection" })
136
+ /* @__PURE__ */ e(J, { children: S && s.group ? s.group : "Group of the collection" })
137
137
  ] }),
138
138
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
139
- Tt,
139
+ wt,
140
140
  {
141
141
  expanded: v,
142
142
  onExpandedChange: b,
143
143
  title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
144
- /* @__PURE__ */ e(Ye, {}),
144
+ /* @__PURE__ */ e($e, {}),
145
145
  /* @__PURE__ */ e(
146
146
  V,
147
147
  {
@@ -158,17 +158,17 @@ function bi({
158
158
  $,
159
159
  {
160
160
  name: "id",
161
- as: W,
161
+ as: K,
162
162
  disabled: !t,
163
163
  label: "Collection id",
164
164
  error: S && !!s.id
165
165
  }
166
166
  ),
167
- /* @__PURE__ */ e(X, { error: p.id && !!s.id, children: p.id && s.id ? s.id : "This id identifies this collection. Typically the same as the path." })
167
+ /* @__PURE__ */ e(J, { error: p.id && !!s.id, children: p.id && s.id ? s.id : "This id identifies this collection. Typically the same as the path." })
168
168
  ] }),
169
169
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
170
170
  /* @__PURE__ */ e(
171
- Oe,
171
+ we,
172
172
  {
173
173
  error: S && !!s.singularName,
174
174
  name: "singularName",
@@ -178,11 +178,41 @@ function bi({
178
178
  label: "Singular name"
179
179
  }
180
180
  ),
181
- /* @__PURE__ */ e(X, { error: S && !!s.singularName, children: S && s.singularName ? s.singularName : "Optionally define a singular name for your entities" })
181
+ /* @__PURE__ */ e(J, { error: S && !!s.singularName, children: S && s.singularName ? s.singularName : "Optionally define a singular name for your entities" })
182
+ ] }),
183
+ /* @__PURE__ */ a("div", { className: "col-span-12", children: [
184
+ /* @__PURE__ */ e(
185
+ we,
186
+ {
187
+ error: S && !!s.sideDialogWidth,
188
+ name: "sideDialogWidth",
189
+ type: "number",
190
+ "aria-describedby": "sideDialogWidth-helper",
191
+ onChange: (h) => {
192
+ f("sideDialogWidth", !0);
193
+ const D = h.target.value;
194
+ D ? isNaN(Number(D)) || u("sideDialogWidth", Number(D)) : u("sideDialogWidth", null);
195
+ },
196
+ endAdornment: /* @__PURE__ */ e(
197
+ ie,
198
+ {
199
+ size: "small",
200
+ onClick: () => {
201
+ u("sideDialogWidth", null);
202
+ },
203
+ disabled: !c.sideDialogWidth,
204
+ children: /* @__PURE__ */ e(Br, { size: "small" })
205
+ }
206
+ ),
207
+ value: c.sideDialogWidth ?? "",
208
+ label: "Side dialog width"
209
+ }
210
+ ),
211
+ /* @__PURE__ */ e(J, { error: S && !!s.singularName, children: S && s.singularName ? s.singularName : "Optionally define the width (in pixels) of entities side dialog. Default is 768px" })
182
212
  ] }),
183
213
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
184
214
  /* @__PURE__ */ e(
185
- Oe,
215
+ we,
186
216
  {
187
217
  error: S && !!s.description,
188
218
  name: "description",
@@ -194,10 +224,10 @@ function bi({
194
224
  label: "Description"
195
225
  }
196
226
  ),
197
- /* @__PURE__ */ e(X, { error: S && !!s.description, children: S && s.description ? s.description : "Description of the collection, you can use markdown" })
227
+ /* @__PURE__ */ e(J, { error: S && !!s.description, children: S && s.description ? s.description : "Description of the collection, you can use markdown" })
198
228
  ] }),
199
229
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
200
- Ne,
230
+ be,
201
231
  {
202
232
  name: "defaultSize",
203
233
  label: "Default row size",
@@ -206,7 +236,7 @@ function bi({
206
236
  value: c.defaultSize ?? "",
207
237
  renderValue: (h) => h.toUpperCase(),
208
238
  children: ["xs", "s", "m", "l", "xl"].map((h) => /* @__PURE__ */ e(
209
- ee,
239
+ X,
210
240
  {
211
241
  value: h,
212
242
  children: h.toUpperCase()
@@ -216,10 +246,10 @@ function bi({
216
246
  }
217
247
  ) }),
218
248
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
219
- Ne,
249
+ be,
220
250
  {
221
251
  name: "customId",
222
- label: "Data IDs generation",
252
+ label: "Document IDs generation",
223
253
  position: "item-aligned",
224
254
  disabled: _ === "code_defined",
225
255
  onValueChange: (h) => {
@@ -230,15 +260,15 @@ function bi({
230
260
  value: _ ?? "",
231
261
  renderValue: (h) => h === "code_defined" ? "Code defined" : h === "true" ? "Users must define an ID" : h === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
232
262
  children: [
233
- /* @__PURE__ */ e(ee, { value: "false", children: "Document ID is generated automatically" }),
234
- /* @__PURE__ */ e(ee, { value: "true", children: "Users must define an ID" }),
235
- /* @__PURE__ */ e(ee, { value: "optional", children: "Users can define an ID, but it is not required" })
263
+ /* @__PURE__ */ e(X, { value: "false", children: "Document ID is generated automatically" }),
264
+ /* @__PURE__ */ e(X, { value: "true", children: "Users must define an ID" }),
265
+ /* @__PURE__ */ e(X, { value: "optional", children: "Users can define an ID, but it is not required" })
236
266
  ]
237
267
  }
238
268
  ) }),
239
269
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
240
270
  /* @__PURE__ */ e(
241
- pt,
271
+ ut,
242
272
  {
243
273
  position: "start",
244
274
  label: "Collection group",
@@ -246,11 +276,11 @@ function bi({
246
276
  value: c.collectionGroup ?? !1
247
277
  }
248
278
  ),
249
- /* @__PURE__ */ e(X, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." })
279
+ /* @__PURE__ */ e(J, { children: "A collection group consists of all collections with the same path. This allows you to query over multiple collections at once." })
250
280
  ] }),
251
281
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
252
282
  /* @__PURE__ */ e(
253
- pt,
283
+ ut,
254
284
  {
255
285
  position: "start",
256
286
  label: "Enable text search for this collection",
@@ -258,7 +288,7 @@ function bi({
258
288
  value: c.textSearchEnabled ?? !1
259
289
  }
260
290
  ),
261
- /* @__PURE__ */ e(X, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." })
291
+ /* @__PURE__ */ e(J, { children: "Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues." })
262
292
  ] })
263
293
  ] })
264
294
  }
@@ -266,14 +296,14 @@ function bi({
266
296
  ] }),
267
297
  /* @__PURE__ */ e("div", { style: { height: "52px" } }),
268
298
  /* @__PURE__ */ e(
269
- Fe,
299
+ _e,
270
300
  {
271
301
  open: y,
272
302
  onOpenChange: x,
273
303
  maxWidth: "xl",
274
304
  fullWidth: !0,
275
305
  children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
276
- yr,
306
+ vr,
277
307
  {
278
308
  selectedIcon: c.icon,
279
309
  onIconSelected: (h) => {
@@ -285,23 +315,23 @@ function bi({
285
315
  )
286
316
  ] }) });
287
317
  }
288
- function he(t) {
318
+ function me(t) {
289
319
  return "properties." + t.replaceAll(".", ".properties.");
290
320
  }
291
- function nr(t) {
321
+ function ir(t) {
292
322
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
293
323
  }
294
- function Ce(t) {
324
+ function he(t) {
295
325
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
296
326
  }
297
327
  function ne(t, r) {
298
328
  return r ? `${r}.${t}` : t;
299
329
  }
300
- function ar(t, r) {
330
+ function nr(t, r) {
301
331
  const n = r ? `${r}.${t}` : t;
302
- return he(n);
332
+ return me(n);
303
333
  }
304
- function Ci({
334
+ function Ni({
305
335
  enumValues: t,
306
336
  onValuesChanged: r,
307
337
  onError: n,
@@ -310,7 +340,7 @@ function Ci({
310
340
  allowDataInference: o,
311
341
  getData: d
312
342
  }) {
313
- const c = Ot({
343
+ const c = kt({
314
344
  initialValues: { enumValues: t },
315
345
  validateOnChange: !0,
316
346
  validation: (p) => {
@@ -322,10 +352,10 @@ function Ci({
322
352
  return n?.(f), s;
323
353
  }
324
354
  }), { values: u, errors: m } = c;
325
- return ue(() => {
355
+ return ce(() => {
326
356
  r && r(u.enumValues);
327
- }, [u.enumValues]), /* @__PURE__ */ e(Vt, { value: c, children: /* @__PURE__ */ e(
328
- Ni,
357
+ }, [u.enumValues]), /* @__PURE__ */ e(Ot, { value: c, children: /* @__PURE__ */ e(
358
+ xi,
329
359
  {
330
360
  enumValuesPath: "enumValues",
331
361
  values: u,
@@ -337,7 +367,7 @@ function Ci({
337
367
  }
338
368
  ) });
339
369
  }
340
- function Ni({
370
+ function xi({
341
371
  values: t,
342
372
  errors: r,
343
373
  disabled: n,
@@ -348,10 +378,10 @@ function Ni({
348
378
  }) {
349
379
  const {
350
380
  setFieldValue: c
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) => {
381
+ } = Y(), [u, m] = G.useState(), [p, s] = G.useState(), [f, g] = G.useState(!1), y = G.useRef(/* @__PURE__ */ new Set()).current, x = (b, T) => {
352
382
  const w = u === T, C = r?.enumValues && r?.enumValues[b];
353
383
  return /* @__PURE__ */ e(
354
- xi,
384
+ Pi,
355
385
  {
356
386
  index: b,
357
387
  disabled: n,
@@ -367,7 +397,7 @@ function Ni({
367
397
  };
368
398
  return /* @__PURE__ */ a("div", { className: "col-span-12", children: [
369
399
  /* @__PURE__ */ a("div", { className: "ml-3.5 flex flex-row items-center", children: [
370
- /* @__PURE__ */ e(Mr, {}),
400
+ /* @__PURE__ */ e(zr, {}),
371
401
  /* @__PURE__ */ e(
372
402
  V,
373
403
  {
@@ -387,16 +417,16 @@ function Ni({
387
417
  d && (g(!0), d?.().then((b) => {
388
418
  if (!b)
389
419
  return;
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
- N.forEach((F) => {
392
- y.add(F.id);
420
+ const T = b.flat(), w = Array.from(new Set(T)), C = t.enumValues, N = ii(w).filter((E) => !C?.some((B) => B.id === E.id));
421
+ N.forEach((E) => {
422
+ y.add(E.id);
393
423
  }), c(i, [...N, ...C], !0);
394
424
  }).catch((b) => {
395
425
  console.error(b);
396
426
  }).finally(() => g(!1)));
397
427
  },
398
428
  children: [
399
- f ? /* @__PURE__ */ e(Ge, { size: "small" }) : /* @__PURE__ */ e(ft, {}),
429
+ f ? /* @__PURE__ */ e(He, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
400
430
  "Infer values from data"
401
431
  ]
402
432
  }
@@ -404,7 +434,7 @@ function Ni({
404
434
  ] }),
405
435
  /* @__PURE__ */ a(ge, { className: "p-4 m-1", children: [
406
436
  /* @__PURE__ */ e(
407
- Cr,
437
+ br,
408
438
  {
409
439
  droppableId: i,
410
440
  addLabel: "Add enum value",
@@ -419,7 +449,7 @@ function Ni({
419
449
  }
420
450
  ),
421
451
  /* @__PURE__ */ e(
422
- Pi,
452
+ wi,
423
453
  {
424
454
  index: p,
425
455
  open: p !== void 0,
@@ -430,7 +460,7 @@ function Ni({
430
460
  ] })
431
461
  ] });
432
462
  }
433
- const xi = Y.memo(
463
+ const Pi = G.memo(
434
464
  function({
435
465
  index: r,
436
466
  shouldUpdateId: n,
@@ -447,8 +477,8 @@ const xi = Y.memo(
447
477
  errors: s,
448
478
  setFieldValue: f,
449
479
  touched: g
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
- return Y.useEffect(() => {
480
+ } = Y(), P = G.useRef(!I(m, `${i}[${r}].id`)), y = n || P.current, x = I(m, `${i}[${r}].id`), v = I(m, `${i}[${r}].label`), b = G.useRef(v);
481
+ return G.useEffect(() => {
452
482
  (b.current === x || !x) && y && f(`${i}[${r}].id`, v), b.current = v;
453
483
  }, [v]), /* @__PURE__ */ a(R, { children: [
454
484
  /* @__PURE__ */ a("div", { className: "flex w-full align-center justify-center", children: [
@@ -456,25 +486,25 @@ const xi = Y.memo(
456
486
  $,
457
487
  {
458
488
  name: `${i}[${r}].label`,
459
- as: W,
489
+ as: K,
460
490
  className: "flex-grow",
461
491
  required: !0,
462
492
  disabled: d,
463
493
  size: "small",
464
494
  autoFocus: l,
465
495
  autoComplete: "off",
466
- endAdornment: c && /* @__PURE__ */ e(ft, { size: "small" }),
496
+ endAdornment: c && /* @__PURE__ */ e(ht, { size: "small" }),
467
497
  error: !!u?.label
468
498
  }
469
499
  ),
470
- !d && /* @__PURE__ */ e(Br, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
471
- ae,
500
+ !d && /* @__PURE__ */ e(Mr, { color: "error", invisible: !u?.id, children: /* @__PURE__ */ e(
501
+ ie,
472
502
  {
473
503
  size: "small",
474
504
  "aria-label": "edit",
475
505
  className: "m-1",
476
506
  onClick: () => o(),
477
- children: /* @__PURE__ */ e(Ye, { size: "small" })
507
+ children: /* @__PURE__ */ e($e, { size: "small" })
478
508
  }
479
509
  ) })
480
510
  ] }),
@@ -497,10 +527,10 @@ const xi = Y.memo(
497
527
  ] });
498
528
  },
499
529
  function(r, n) {
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;
530
+ return r.index === n.index && r.enumValuesPath === n.enumValuesPath && r.shouldUpdateId === n.shouldUpdateId && r.inferredEntry === n.inferredEntry && ye(r.entryError, n.entryError) && r.autoFocus === n.autoFocus;
501
531
  }
502
532
  );
503
- function Pi({
533
+ function wi({
504
534
  index: t,
505
535
  open: r,
506
536
  onClose: n,
@@ -508,21 +538,21 @@ function Pi({
508
538
  }) {
509
539
  const {
510
540
  errors: l
511
- } = G(), o = t !== void 0 ? I(l, `${i}[${t}].id`) : void 0;
541
+ } = Y(), o = t !== void 0 ? I(l, `${i}[${t}].id`) : void 0;
512
542
  return /* @__PURE__ */ a(
513
- Fe,
543
+ _e,
514
544
  {
515
545
  maxWidth: "md",
516
546
  "aria-labelledby": "enum-edit-dialog",
517
547
  open: r,
518
548
  onOpenChange: (d) => d ? void 0 : n(),
519
549
  children: [
520
- /* @__PURE__ */ e(De, { children: t !== void 0 && /* @__PURE__ */ a("div", { children: [
550
+ /* @__PURE__ */ e(Ae, { children: t !== void 0 && /* @__PURE__ */ a("div", { children: [
521
551
  /* @__PURE__ */ e(
522
552
  $,
523
553
  {
524
554
  name: `${i}[${t}].id`,
525
- as: W,
555
+ as: K,
526
556
  required: !0,
527
557
  label: "ID",
528
558
  size: "small",
@@ -530,9 +560,9 @@ function Pi({
530
560
  error: !!o
531
561
  }
532
562
  ),
533
- /* @__PURE__ */ e(X, { error: !!o, children: o ?? "Value saved in the data source" })
563
+ /* @__PURE__ */ e(J, { error: !!o, children: o ?? "Value saved in the data source" })
534
564
  ] }) }),
535
- /* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(
565
+ /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
536
566
  z,
537
567
  {
538
568
  autoFocus: !0,
@@ -546,7 +576,7 @@ function Pi({
546
576
  }
547
577
  );
548
578
  }
549
- function le({
579
+ function oe({
550
580
  field: t,
551
581
  form: r,
552
582
  label: n,
@@ -556,7 +586,7 @@ function le({
556
586
  allowIndeterminate: d
557
587
  }) {
558
588
  const c = /* @__PURE__ */ e(
559
- pt,
589
+ ut,
560
590
  {
561
591
  label: n,
562
592
  size: o,
@@ -568,15 +598,15 @@ function le({
568
598
  }
569
599
  );
570
600
  return i ? /* @__PURE__ */ e(
571
- te,
601
+ ee,
572
602
  {
573
603
  title: i,
574
604
  children: c
575
605
  }
576
606
  ) : c;
577
607
  }
578
- function Ee({ disabled: t }) {
579
- const { values: r, handleChange: n } = G(), i = "validation.required", l = "validation.requiredMessage";
608
+ function Fe({ disabled: t }) {
609
+ const { values: r, handleChange: n } = Y(), i = "validation.required", l = "validation.requiredMessage";
580
610
  return /* @__PURE__ */ a(R, { children: [
581
611
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
582
612
  $,
@@ -584,7 +614,7 @@ function Ee({ disabled: t }) {
584
614
  name: i,
585
615
  type: "checkbox",
586
616
  children: ({ field: d, form: c }) => /* @__PURE__ */ e(
587
- le,
617
+ oe,
588
618
  {
589
619
  disabled: t,
590
620
  label: "Required",
@@ -601,7 +631,7 @@ function Ee({ disabled: t }) {
601
631
  name: "validation.unique",
602
632
  type: "checkbox",
603
633
  children: ({ field: d, form: c }) => /* @__PURE__ */ e(
604
- le,
634
+ oe,
605
635
  {
606
636
  disabled: t,
607
637
  label: "Unique",
@@ -613,7 +643,7 @@ function Ee({ disabled: t }) {
613
643
  }
614
644
  ) }),
615
645
  I(r, i) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
616
- W,
646
+ K,
617
647
  {
618
648
  disabled: t,
619
649
  value: I(r, l),
@@ -625,7 +655,7 @@ function Ee({ disabled: t }) {
625
655
  ) })
626
656
  ] });
627
657
  }
628
- function Se({
658
+ function Ee({
629
659
  length: t,
630
660
  lowercase: r,
631
661
  matches: n,
@@ -640,9 +670,9 @@ function Se({
640
670
  values: m,
641
671
  handleChange: p,
642
672
  errors: s
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);
673
+ } = Y(), 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 : Cr(w);
644
674
  return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
645
- /* @__PURE__ */ e(Ee, { disabled: c }),
675
+ /* @__PURE__ */ e(Fe, { disabled: c }),
646
676
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
647
677
  r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
648
678
  $,
@@ -650,7 +680,7 @@ function Se({
650
680
  name: v,
651
681
  type: "checkbox",
652
682
  children: ({ field: O, form: N }) => /* @__PURE__ */ e(
653
- le,
683
+ oe,
654
684
  {
655
685
  label: "Lowercase",
656
686
  disabled: c,
@@ -666,7 +696,7 @@ function Se({
666
696
  name: b,
667
697
  type: "checkbox",
668
698
  children: ({ field: O, form: N }) => /* @__PURE__ */ e(
669
- le,
699
+ oe,
670
700
  {
671
701
  label: "Uppercase",
672
702
  disabled: c,
@@ -682,7 +712,7 @@ function Se({
682
712
  name: y,
683
713
  type: "checkbox",
684
714
  children: ({ field: O, form: N }) => /* @__PURE__ */ e(
685
- le,
715
+ oe,
686
716
  {
687
717
  label: "Trim",
688
718
  disabled: c,
@@ -695,7 +725,7 @@ function Se({
695
725
  ] }),
696
726
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
697
727
  t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
698
- W,
728
+ K,
699
729
  {
700
730
  value: I(m, f),
701
731
  label: "Exact length",
@@ -707,7 +737,7 @@ function Se({
707
737
  }
708
738
  ) }),
709
739
  l && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
710
- W,
740
+ K,
711
741
  {
712
742
  value: I(m, g),
713
743
  label: "Min length",
@@ -719,7 +749,7 @@ function Se({
719
749
  }
720
750
  ) }),
721
751
  i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
722
- W,
752
+ K,
723
753
  {
724
754
  value: I(m, P),
725
755
  label: "Max length",
@@ -736,7 +766,7 @@ function Se({
736
766
  $,
737
767
  {
738
768
  name: x,
739
- as: W,
769
+ as: K,
740
770
  label: "Matches regex",
741
771
  size: "small",
742
772
  disabled: c,
@@ -744,11 +774,11 @@ function Se({
744
774
  error: !!T
745
775
  }
746
776
  ),
747
- /* @__PURE__ */ e(X, { error: !!T, children: T ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
777
+ /* @__PURE__ */ e(J, { error: !!T, children: T ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
748
778
  ] })
749
779
  ] });
750
780
  }
751
- function It({
781
+ function Vt({
752
782
  max: t = !0,
753
783
  min: r = !0,
754
784
  disabled: n
@@ -756,11 +786,11 @@ function It({
756
786
  const {
757
787
  values: i,
758
788
  handleChange: l
759
- } = G(), o = "validation.min", d = "validation.max";
789
+ } = Y(), o = "validation.min", d = "validation.max";
760
790
  return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
761
- /* @__PURE__ */ e(Ee, { disabled: n }),
791
+ /* @__PURE__ */ e(Fe, { disabled: n }),
762
792
  r && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
763
- W,
793
+ K,
764
794
  {
765
795
  value: I(i, o),
766
796
  disabled: n,
@@ -772,7 +802,7 @@ function It({
772
802
  }
773
803
  ) }),
774
804
  t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
775
- W,
805
+ K,
776
806
  {
777
807
  value: I(i, d),
778
808
  disabled: n,
@@ -785,17 +815,17 @@ function It({
785
815
  ) })
786
816
  ] });
787
817
  }
788
- function xe({
818
+ function Ce({
789
819
  children: t
790
820
  }) {
791
821
  return /* @__PURE__ */ e(
792
- Tt,
822
+ wt,
793
823
  {
794
824
  initiallyExpanded: !1,
795
825
  asField: !0,
796
826
  className: "p-4",
797
827
  title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
798
- /* @__PURE__ */ e(zr, {}),
828
+ /* @__PURE__ */ e(Rr, {}),
799
829
  /* @__PURE__ */ e(
800
830
  V,
801
831
  {
@@ -809,7 +839,7 @@ function xe({
809
839
  }
810
840
  );
811
841
  }
812
- function Ut({
842
+ function Rt({
813
843
  multiselect: t,
814
844
  updateIds: r,
815
845
  disabled: n,
@@ -821,10 +851,10 @@ function Ut({
821
851
  values: d,
822
852
  setFieldError: c,
823
853
  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" ? [] : xr(f) ?? [], [f]);
854
+ } = Y(), m = Ve(), p = t ? "of.enumValues" : "enumValues", s = I(d, "defaultValue"), f = I(d, p), g = Zt(() => !f || typeof f == "boolean" ? [] : Nr(f) ?? [], [f]);
825
855
  return /* @__PURE__ */ a(R, { children: [
826
856
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
827
- Ci,
857
+ Ni,
828
858
  {
829
859
  enumValues: g,
830
860
  updateIds: r,
@@ -845,18 +875,18 @@ function Ut({
845
875
  }
846
876
  }
847
877
  ) }),
848
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
878
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ce, { children: [
849
879
  !t && /* @__PURE__ */ e(
850
- Se,
880
+ Ee,
851
881
  {
852
882
  disabled: n,
853
883
  showErrors: i
854
884
  }
855
885
  ),
856
- t && /* @__PURE__ */ e(It, { disabled: n })
886
+ t && /* @__PURE__ */ e(Vt, { disabled: n })
857
887
  ] }) }),
858
888
  !t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
859
- Ne,
889
+ be,
860
890
  {
861
891
  disabled: n,
862
892
  position: "item-aligned",
@@ -866,7 +896,7 @@ function Ut({
866
896
  label: "Default value",
867
897
  value: s ?? "",
868
898
  children: g.filter((y) => !!y?.id).map((y) => /* @__PURE__ */ e(
869
- ee,
899
+ X,
870
900
  {
871
901
  value: y.id?.toString(),
872
902
  children: y.label
@@ -877,14 +907,14 @@ function Ut({
877
907
  ) })
878
908
  ] });
879
909
  }
880
- const ot = {
910
+ const at = {
881
911
  "image/*": "Images",
882
912
  "video/*": "Videos",
883
913
  "audio/*": "Audio files",
884
914
  "application/*": "Files (pdf, zip, csv, excel...)",
885
915
  "text/*": "Text files"
886
916
  };
887
- function jt({
917
+ function Ut({
888
918
  multiple: t,
889
919
  existing: r,
890
920
  disabled: n
@@ -892,15 +922,15 @@ function jt({
892
922
  const {
893
923
  values: i,
894
924
  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, 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);
925
+ } = Y(), 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) => {
926
+ b ? b.includes("all") || b.length >= Object.keys(at).length ? l(d, void 0) : P ? l(d, Object.keys(at).filter((T) => !b.includes(T))) : l(d, b) : l(d, void 0);
897
927
  }, x = typeof p == "function", v = typeof s == "function";
898
928
  return /* @__PURE__ */ a(R, { children: [
899
929
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
900
- Tt,
930
+ wt,
901
931
  {
902
932
  title: /* @__PURE__ */ a("div", { className: "flex flex-row text-gray-500", children: [
903
- /* @__PURE__ */ e(Rr, {}),
933
+ /* @__PURE__ */ e(Ur, {}),
904
934
  /* @__PURE__ */ e(
905
935
  V,
906
936
  {
@@ -912,27 +942,27 @@ function jt({
912
942
  ] }),
913
943
  children: /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
914
944
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
915
- Ur,
945
+ jr,
916
946
  {
917
947
  disabled: n,
918
948
  name: d,
919
949
  value: g ?? [],
920
950
  onMultiValueChange: y,
921
951
  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(", "),
952
+ renderValues: (b) => !b || b.length === 0 ? "All file types allowed" : b.map((T) => at[T]).filter((T) => !!T).join(", "),
923
953
  children: [
924
- /* @__PURE__ */ a(St, { value: "all", className: "flex items-center gap-2", children: [
954
+ /* @__PURE__ */ a(Et, { value: "all", className: "flex items-center gap-2", children: [
925
955
  /* @__PURE__ */ e(
926
- At,
956
+ St,
927
957
  {
928
958
  checked: !g
929
959
  }
930
960
  ),
931
961
  "All"
932
962
  ] }, "all"),
933
- Object.entries(ot).map(([b, T]) => /* @__PURE__ */ a(St, { value: b, className: "flex items-center gap-2", children: [
963
+ Object.entries(at).map(([b, T]) => /* @__PURE__ */ a(Et, { value: b, className: "flex items-center gap-2", children: [
934
964
  /* @__PURE__ */ e(
935
- At,
965
+ St,
936
966
  {
937
967
  checked: P || g.indexOf(b) > -1
938
968
  }
@@ -955,7 +985,7 @@ function jt({
955
985
  $,
956
986
  {
957
987
  name: c,
958
- as: W,
988
+ as: K,
959
989
  label: "File name",
960
990
  size: "small",
961
991
  disabled: x || n,
@@ -967,7 +997,7 @@ function jt({
967
997
  $,
968
998
  {
969
999
  name: u,
970
- as: W,
1000
+ as: K,
971
1001
  label: "Storage path",
972
1002
  disabled: v || n,
973
1003
  size: "small",
@@ -992,7 +1022,7 @@ function jt({
992
1022
  name: m,
993
1023
  type: "checkbox",
994
1024
  children: ({ field: b, form: T }) => /* @__PURE__ */ e(
995
- le,
1025
+ oe,
996
1026
  {
997
1027
  label: "Save URL instead of storage path",
998
1028
  disabled: r || n,
@@ -1007,33 +1037,33 @@ function jt({
1007
1037
  ] })
1008
1038
  }
1009
1039
  ) }),
1010
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
1011
- !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Ee, { disabled: n }) }),
1012
- t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(It, { disabled: n }) })
1040
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ce, { children: [
1041
+ !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Fe, { disabled: n }) }),
1042
+ t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Vt, { disabled: n }) })
1013
1043
  ] }) })
1014
1044
  ] });
1015
1045
  }
1016
- function qe(t) {
1017
- if (ie(t) || ie(t))
1046
+ function Ue(t) {
1047
+ if (re(t) || re(t))
1018
1048
  return !1;
1019
1049
  {
1020
1050
  const r = t;
1021
1051
  return r.dataType === "array" && typeof r.of == "function" || r.dataType === "array" && Array.isArray(r.of) ? !1 : !!r.editable;
1022
1052
  }
1023
1053
  }
1024
- function wi(t) {
1025
- return Object.entries(t).filter(([r, n]) => qe(n)).map(([r, n]) => {
1054
+ function Ti(t) {
1055
+ return Object.entries(t).filter(([r, n]) => Ue(n)).map(([r, n]) => {
1026
1056
  const i = n;
1027
- if (qe(i))
1057
+ if (Ue(i))
1028
1058
  return i.dataType === "map" && i.properties ? {
1029
1059
  [r]: {
1030
1060
  ...i,
1031
- properties: wi(i.properties)
1061
+ properties: Ti(i.properties)
1032
1062
  }
1033
1063
  } : { [r]: i };
1034
1064
  }).filter((r) => !!r).reduce((r, n) => ({ ...r, ...n }), {});
1035
1065
  }
1036
- function or({
1066
+ function ar({
1037
1067
  property: t,
1038
1068
  onClick: r,
1039
1069
  hasError: n,
@@ -1041,31 +1071,29 @@ function or({
1041
1071
  includeEditButton: l,
1042
1072
  selected: o
1043
1073
  }) {
1044
- const { propertyConfigs: d } = Ae(), c = Le(t, d);
1045
- qe(t);
1046
- const u = n ? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100 ring-0 dark:ring-0" : o ? "border-primary" : "border-transparent";
1047
- return n && console.log("PropertyFieldPreview", t), /* @__PURE__ */ e(me, { children: /* @__PURE__ */ a(
1074
+ const { propertyConfigs: d } = Se(), c = je(t, d);
1075
+ return Ue(t), /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ a(
1048
1076
  "div",
1049
1077
  {
1050
1078
  onClick: r,
1051
1079
  className: "flex flex-row w-full cursor-pointer",
1052
1080
  children: [
1053
- /* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e($e, { propertyConfig: c }) }),
1081
+ /* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(qe, { propertyConfig: c }) }),
1054
1082
  /* @__PURE__ */ a(
1055
1083
  ge,
1056
1084
  {
1057
1085
  className: fe(
1058
1086
  "border",
1059
1087
  "pl-2 w-full flex flex-row gap-4 items-center",
1060
- Xt,
1061
- r ? er : "",
1062
- o ? tr : "",
1088
+ Qt,
1089
+ r ? Xt : "",
1090
+ o ? er : "",
1063
1091
  "flex-grow p-4 border transition-colors duration-200",
1064
- u
1092
+ n ? "border-red-500 dark:border-red-500 border-opacity-100 dark:border-opacity-100 ring-0 dark:ring-0" : o ? "border-primary" : "border-transparent"
1065
1093
  ),
1066
1094
  children: [
1067
1095
  /* @__PURE__ */ a("div", { className: "w-full flex flex-col", children: [
1068
- i && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1096
+ i && /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
1069
1097
  V,
1070
1098
  {
1071
1099
  variant: "body1",
@@ -1075,7 +1103,7 @@ function or({
1075
1103
  }
1076
1104
  ) }),
1077
1105
  /* @__PURE__ */ a("div", { className: "flex flex-row items-center", children: [
1078
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1106
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
1079
1107
  V,
1080
1108
  {
1081
1109
  className: "flex-grow pr-2",
@@ -1085,7 +1113,7 @@ function or({
1085
1113
  children: c?.name
1086
1114
  }
1087
1115
  ) }),
1088
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1116
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
1089
1117
  V,
1090
1118
  {
1091
1119
  variant: "body2",
@@ -1104,13 +1132,13 @@ function or({
1104
1132
  }
1105
1133
  ) });
1106
1134
  }
1107
- function Ti({
1135
+ function ki({
1108
1136
  name: t,
1109
1137
  selected: r,
1110
1138
  onClick: n,
1111
1139
  property: i
1112
1140
  }) {
1113
- const { propertyConfigs: l } = Ae(), o = !ie(i) && i ? Le(i, l) : void 0;
1141
+ const { propertyConfigs: l } = Se(), o = !re(i) && i ? je(i, l) : void 0;
1114
1142
  return /* @__PURE__ */ a(
1115
1143
  "div",
1116
1144
  {
@@ -1118,24 +1146,24 @@ function Ti({
1118
1146
  className: "flex flex-row w-full cursor-pointer",
1119
1147
  children: [
1120
1148
  /* @__PURE__ */ a("div", { className: "relative m-4", children: [
1121
- o && /* @__PURE__ */ e($e, { propertyConfig: o }),
1149
+ o && /* @__PURE__ */ e(qe, { propertyConfig: o }),
1122
1150
  !o && /* @__PURE__ */ e(
1123
1151
  "div",
1124
1152
  {
1125
1153
  className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
1126
- children: /* @__PURE__ */ e(jr, { color: "inherit", size: "medium" })
1154
+ children: /* @__PURE__ */ e(qr, { color: "inherit", size: "medium" })
1127
1155
  }
1128
1156
  ),
1129
- /* @__PURE__ */ e(qr, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
1157
+ /* @__PURE__ */ e(Lr, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
1130
1158
  ] }),
1131
1159
  /* @__PURE__ */ e(
1132
1160
  ge,
1133
1161
  {
1134
1162
  className: fe(
1135
1163
  "pl-2 w-full flex flex-row gap-4 items-center",
1136
- Xt,
1137
- n ? er : "",
1138
- r ? tr : "",
1164
+ Qt,
1165
+ n ? Xt : "",
1166
+ r ? er : "",
1139
1167
  "flex-grow p-4 border transition-colors duration-200",
1140
1168
  r ? "border-primary" : "border-transparent"
1141
1169
  ),
@@ -1160,7 +1188,7 @@ function Ti({
1160
1188
  children: o?.name
1161
1189
  }
1162
1190
  ),
1163
- i && !ie(i) && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1191
+ i && !re(i) && /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
1164
1192
  V,
1165
1193
  {
1166
1194
  variant: "body2",
@@ -1169,7 +1197,7 @@ function Ti({
1169
1197
  children: i.dataType
1170
1198
  }
1171
1199
  ) }),
1172
- i && ie(i) && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1200
+ i && re(i) && /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
1173
1201
  V,
1174
1202
  {
1175
1203
  variant: "body2",
@@ -1178,7 +1206,7 @@ function Ti({
1178
1206
  children: "This property is defined as a property builder in code"
1179
1207
  }
1180
1208
  ) }),
1181
- !i && /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1209
+ !i && /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
1182
1210
  V,
1183
1211
  {
1184
1212
  variant: "body2",
@@ -1195,7 +1223,7 @@ function Ti({
1195
1223
  }
1196
1224
  );
1197
1225
  }
1198
- const gt = Y.memo(
1226
+ const ft = G.memo(
1199
1227
  function({
1200
1228
  namespace: r,
1201
1229
  selectedPropertyKey: n,
@@ -1210,13 +1238,13 @@ const gt = Y.memo(
1210
1238
  inferredPropertyKeys: s,
1211
1239
  collectionEditable: f
1212
1240
  }) {
1213
- const g = o ?? Object.keys(l), P = J((y) => {
1241
+ const g = o ?? Object.keys(l);
1242
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(oi, { onDragEnd: (y) => {
1214
1243
  if (!y.destination)
1215
1244
  return;
1216
1245
  const x = y.source.index, v = y.destination.index, b = Array.from(g), [T] = b.splice(x, 1);
1217
1246
  b.splice(v, 0, T), u && u(b, r);
1218
- }, [r, u, g]);
1219
- return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ai, { onDragEnd: P, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${r}`, children: (y, x) => /* @__PURE__ */ a(
1247
+ }, children: /* @__PURE__ */ e(li, { droppableId: `droppable_${r}`, children: (y, x) => /* @__PURE__ */ a(
1220
1248
  "div",
1221
1249
  {
1222
1250
  ...y.droppableProps,
@@ -1226,12 +1254,12 @@ const gt = Y.memo(
1226
1254
  g && g.map((v, b) => {
1227
1255
  const T = l[v], w = d?.find((C) => C.key === v);
1228
1256
  return !T && !w ? (console.warn(`Property ${v} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
1229
- li,
1257
+ si,
1230
1258
  {
1231
1259
  draggableId: `array_field_${r}_${v}}`,
1232
1260
  index: b,
1233
- children: (C, O) => /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
1234
- ki,
1261
+ children: (C, O) => /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
1262
+ Oi,
1235
1263
  {
1236
1264
  propertyKey: v,
1237
1265
  propertyOrBuilder: T,
@@ -1258,12 +1286,12 @@ const gt = Y.memo(
1258
1286
  },
1259
1287
  (t, r) => {
1260
1288
  const n = r.selectedPropertyKey?.startsWith(r.namespace ?? ""), i = t.selectedPropertyKey?.startsWith(t.namespace ?? "");
1261
- return n || i ? !1 : be(t.properties, r.properties) && t.propertiesOrder === r.propertiesOrder && be(t.additionalFields, r.additionalFields) && be(t.errors, r.errors) && be(t.onPropertyClick, r.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
1289
+ return n || i ? !1 : ye(t.properties, r.properties) && t.propertiesOrder === r.propertiesOrder && ye(t.additionalFields, r.additionalFields) && ye(t.errors, r.errors) && ye(t.onPropertyClick, r.onPropertyClick) && // equal(prevProps.onPropertyMove, nextProps.onPropertyMove) &&
1262
1290
  // equal(prevProps.onPropertyRemove, nextProps.onPropertyRemove) &&
1263
1291
  t.namespace === r.namespace && t.collectionEditable === r.collectionEditable;
1264
1292
  }
1265
1293
  );
1266
- function ki({
1294
+ function Oi({
1267
1295
  propertyKey: t,
1268
1296
  namespace: r,
1269
1297
  propertyOrBuilder: n,
@@ -1277,12 +1305,12 @@ function ki({
1277
1305
  inferredPropertyKeys: p,
1278
1306
  collectionEditable: s
1279
1307
  }) {
1280
- const f = p?.includes(r ? `${r}.${t}` : t), g = ne(t, r), y = ar(t, r) in d;
1308
+ const f = p?.includes(r ? `${r}.${t}` : t), g = ne(t, r), y = nr(t, r) in d;
1281
1309
  let x;
1282
1310
  if (typeof n == "object") {
1283
1311
  const T = n;
1284
1312
  T.dataType === "map" && T.properties && (x = /* @__PURE__ */ e(
1285
- gt,
1313
+ ft,
1286
1314
  {
1287
1315
  selectedPropertyKey: o,
1288
1316
  namespace: g,
@@ -1296,7 +1324,7 @@ function ki({
1296
1324
  }
1297
1325
  ));
1298
1326
  }
1299
- const v = o === g, b = n && (s && !ie(n) || qe(n));
1327
+ const v = o === g, b = n && (s && !re(n) || Ue(n));
1300
1328
  return /* @__PURE__ */ a(
1301
1329
  "div",
1302
1330
  {
@@ -1308,7 +1336,7 @@ function ki({
1308
1336
  x && /* @__PURE__ */ e(
1309
1337
  "div",
1310
1338
  {
1311
- className: "absolute border-l " + kt,
1339
+ className: "absolute border-l " + Tt,
1312
1340
  style: {
1313
1341
  left: "32px",
1314
1342
  top: "64px",
@@ -1316,8 +1344,8 @@ function ki({
1316
1344
  }
1317
1345
  }
1318
1346
  ),
1319
- !ie(n) && !i && b ? /* @__PURE__ */ e(
1320
- or,
1347
+ !re(n) && !i && b ? /* @__PURE__ */ e(
1348
+ ar,
1321
1349
  {
1322
1350
  property: n,
1323
1351
  onClick: c ? () => c(t, r) : void 0,
@@ -1326,7 +1354,7 @@ function ki({
1326
1354
  hasError: y
1327
1355
  }
1328
1356
  ) : /* @__PURE__ */ e(
1329
- Ti,
1357
+ ki,
1330
1358
  {
1331
1359
  name: t,
1332
1360
  property: n,
@@ -1335,22 +1363,22 @@ function ki({
1335
1363
  }
1336
1364
  ),
1337
1365
  /* @__PURE__ */ a("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
1338
- f && /* @__PURE__ */ e(te, { title: "Inferred property", children: /* @__PURE__ */ e(ft, { size: "small", className: "p-2" }) }),
1339
- m && /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
1340
- ae,
1366
+ f && /* @__PURE__ */ e(ee, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
1367
+ m && /* @__PURE__ */ e(ee, { title: "Remove", children: /* @__PURE__ */ e(
1368
+ ie,
1341
1369
  {
1342
1370
  size: "small",
1343
1371
  color: "inherit",
1344
1372
  onClick: () => m(t, r),
1345
- children: /* @__PURE__ */ e(Lr, { size: "small" })
1373
+ children: /* @__PURE__ */ e($r, { size: "small" })
1346
1374
  }
1347
1375
  ) }),
1348
- u && /* @__PURE__ */ e(te, { title: "Move", children: /* @__PURE__ */ e(
1349
- ae,
1376
+ u && /* @__PURE__ */ e(ee, { title: "Move", children: /* @__PURE__ */ e(
1377
+ ie,
1350
1378
  {
1351
1379
  component: "span",
1352
1380
  size: "small",
1353
- children: /* @__PURE__ */ e($r, { size: "small" })
1381
+ children: /* @__PURE__ */ e(Hr, { size: "small" })
1354
1382
  }
1355
1383
  ) })
1356
1384
  ] }),
@@ -1359,11 +1387,11 @@ function ki({
1359
1387
  }
1360
1388
  );
1361
1389
  }
1362
- function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i, collectionEditable: l }) {
1390
+ function Vi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i, collectionEditable: l }) {
1363
1391
  const {
1364
1392
  values: o,
1365
1393
  setFieldValue: d
1366
- } = G(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), P = ({
1394
+ } = Y(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), P = ({
1367
1395
  id: w,
1368
1396
  property: C
1369
1397
  }) => {
@@ -1375,15 +1403,15 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1375
1403
  }, !1);
1376
1404
  const O = o.propertiesOrder ?? Object.keys(o.properties ?? {}), N = O.includes(w) ? O : [...O, w];
1377
1405
  d("propertiesOrder", N, !1), u(!1);
1378
- }, y = J((w, C) => {
1406
+ }, y = (w, C) => {
1379
1407
  const O = w ? ne(w, C) : void 0;
1380
1408
  if (!O)
1381
1409
  throw Error("collection editor miss config");
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
- }, []);
1410
+ const N = me(O), E = he(C), B = I(o, E) ?? Object.keys(I(o, ir(C)));
1411
+ d(N, void 0, !1), d(E, B.filter((_) => _ !== w), !1), u(!1), p(void 0), f(void 0);
1412
+ }, x = m ? ne(m, s) : void 0, v = x ? I(o.properties, x.replaceAll(".", ".properties.")) : void 0, b = !g || g.length < 1, T = (w, C) => {
1413
+ d(he(C), w, !1);
1414
+ };
1387
1415
  return /* @__PURE__ */ a(R, { children: [
1388
1416
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1389
1417
  /* @__PURE__ */ a("div", { className: "flex justify-between items-end my-4", children: [
@@ -1394,7 +1422,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1394
1422
  color: "primary",
1395
1423
  variant: "outlined",
1396
1424
  onClick: () => u(!0),
1397
- startIcon: /* @__PURE__ */ e(ce, {}),
1425
+ startIcon: /* @__PURE__ */ e(de, {}),
1398
1426
  children: [
1399
1427
  "Add property to ",
1400
1428
  o.name ?? "this group"
@@ -1404,7 +1432,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1404
1432
  ] }),
1405
1433
  /* @__PURE__ */ a(ge, { className: "p-2 pl-8", children: [
1406
1434
  /* @__PURE__ */ e(
1407
- gt,
1435
+ ft,
1408
1436
  {
1409
1437
  properties: o.properties ?? {},
1410
1438
  propertiesOrder: g,
@@ -1428,7 +1456,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1428
1456
  ] }),
1429
1457
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1430
1458
  /* @__PURE__ */ e(
1431
- pt,
1459
+ ut,
1432
1460
  {
1433
1461
  position: "start",
1434
1462
  size: "small",
@@ -1437,10 +1465,10 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1437
1465
  value: o.spreadChildren ?? !1
1438
1466
  }
1439
1467
  ),
1440
- /* @__PURE__ */ e(X, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
1468
+ /* @__PURE__ */ e(J, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
1441
1469
  ] }),
1442
1470
  /* @__PURE__ */ e(
1443
- Ve,
1471
+ Oe,
1444
1472
  {
1445
1473
  inArray: !1,
1446
1474
  forceShowErrors: !1,
@@ -1468,7 +1496,7 @@ function Oi({ disabled: t, getData: r, allowDataInference: n, propertyConfigs: i
1468
1496
  )
1469
1497
  ] });
1470
1498
  }
1471
- function Vi({
1499
+ function Ii({
1472
1500
  showErrors: t,
1473
1501
  existing: r,
1474
1502
  disabled: n,
@@ -1483,9 +1511,9 @@ function Vi({
1483
1511
  errors: m,
1484
1512
  setFieldValue: p,
1485
1513
  touched: s
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);
1514
+ } = Y(), [f, g] = j(!1), P = I(c, "of"), y = I(s, "of") && I(m, "of"), x = ({ id: b, property: T, namespace: w }) => {
1515
+ p("of", T);
1516
+ }, v = P && je(P, o);
1489
1517
  return /* @__PURE__ */ a(R, { children: [
1490
1518
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1491
1519
  /* @__PURE__ */ e(V, { variant: "subtitle2", children: "Repeat component" }),
@@ -1496,7 +1524,7 @@ function Vi({
1496
1524
  value: P,
1497
1525
  children: ({}) => /* @__PURE__ */ a(ge, { className: "p-2 mt-4", children: [
1498
1526
  P && /* @__PURE__ */ e(
1499
- or,
1527
+ ar,
1500
1528
  {
1501
1529
  property: P,
1502
1530
  onClick: n ? void 0 : () => g(!0),
@@ -1520,7 +1548,7 @@ function Vi({
1520
1548
  }
1521
1549
  ),
1522
1550
  /* @__PURE__ */ e(
1523
- Ve,
1551
+ Oe,
1524
1552
  {
1525
1553
  inArray: !0,
1526
1554
  open: f,
@@ -1542,10 +1570,10 @@ function Vi({
1542
1570
  }
1543
1571
  )
1544
1572
  ] }),
1545
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(It, { disabled: n }) }) })
1573
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Vt, { disabled: n }) }) })
1546
1574
  ] });
1547
1575
  }
1548
- const Ii = Y.forwardRef(
1576
+ const _i = G.forwardRef(
1549
1577
  function({
1550
1578
  showErrors: r,
1551
1579
  disabledId: n,
@@ -1560,7 +1588,7 @@ const Ii = Y.forwardRef(
1560
1588
  setFieldTouched: p,
1561
1589
  touched: s,
1562
1590
  validate: f
1563
- } = G(), g = "name", P = r && I(c, g), y = "id", x = r && I(c, y), v = "description", b = r && I(c, v);
1591
+ } = Y(), g = "name", P = r && I(c, g), y = "id", x = r && I(c, y), v = "description", b = r && I(c, v);
1564
1592
  return /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 col-span-12", children: [
1565
1593
  /* @__PURE__ */ a("div", { children: [
1566
1594
  /* @__PURE__ */ e(
@@ -1568,11 +1596,11 @@ const Ii = Y.forwardRef(
1568
1596
  {
1569
1597
  name: g,
1570
1598
  inputRef: d,
1571
- as: W,
1599
+ as: K,
1572
1600
  value: u[g],
1573
1601
  onChange: (T) => {
1574
1602
  const w = T.target.value;
1575
- !I(s, y) && l && m(y, w ? xt(w) : "", !1), m(g, w, !0), p(g, !0);
1603
+ !I(s, y) && l && m(y, w ? Nt(w) : "", !1), m(g, w, !0), p(g, !0);
1576
1604
  },
1577
1605
  style: { fontSize: 20 },
1578
1606
  placeholder: "Field name",
@@ -1581,19 +1609,19 @@ const Ii = Y.forwardRef(
1581
1609
  error: !!P
1582
1610
  }
1583
1611
  ),
1584
- /* @__PURE__ */ e(X, { error: !!P, children: P })
1612
+ /* @__PURE__ */ e(J, { error: !!P, children: P })
1585
1613
  ] }),
1586
1614
  /* @__PURE__ */ a("div", { children: [
1587
1615
  /* @__PURE__ */ e(
1588
1616
  $,
1589
1617
  {
1590
1618
  name: y,
1591
- as: W,
1619
+ as: K,
1592
1620
  label: "ID",
1593
1621
  value: u[y],
1594
1622
  onChange: (T) => {
1595
1623
  const w = T.target.value;
1596
- !I(s, g) && l && m(g, w ? wt(w) : ""), m(y, w, !0), p(y, !0);
1624
+ !I(s, g) && l && m(g, w ? Pt(w) : ""), m(y, w, !0), p(y, !0);
1597
1625
  },
1598
1626
  disabled: n || i,
1599
1627
  required: !0,
@@ -1601,34 +1629,34 @@ const Ii = Y.forwardRef(
1601
1629
  error: !!x
1602
1630
  }
1603
1631
  ),
1604
- /* @__PURE__ */ e(X, { error: !!x, children: x })
1632
+ /* @__PURE__ */ e(J, { error: !!x, children: x })
1605
1633
  ] }),
1606
1634
  /* @__PURE__ */ a("div", { children: [
1607
1635
  /* @__PURE__ */ e(
1608
1636
  $,
1609
1637
  {
1610
1638
  name: v,
1611
- as: W,
1639
+ as: K,
1612
1640
  label: "Description",
1613
1641
  disabled: i,
1614
1642
  error: !!b
1615
1643
  }
1616
1644
  ),
1617
- /* @__PURE__ */ e(X, { error: !!b, children: b })
1645
+ /* @__PURE__ */ e(J, { error: !!b, children: b })
1618
1646
  ] })
1619
1647
  ] });
1620
1648
  }
1621
1649
  );
1622
- function _i({
1650
+ function Fi({
1623
1651
  widgetId: t,
1624
1652
  disabled: r,
1625
1653
  showErrors: n
1626
1654
  }) {
1627
- const { values: i, setFieldValue: l } = G();
1655
+ const { values: i, setFieldValue: l } = Y();
1628
1656
  return /* @__PURE__ */ a(R, { children: [
1629
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(xe, { children: [
1657
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(Ce, { children: [
1630
1658
  t === "text_field" && /* @__PURE__ */ e(
1631
- Se,
1659
+ Ee,
1632
1660
  {
1633
1661
  disabled: r,
1634
1662
  length: !0,
@@ -1642,7 +1670,7 @@ function _i({
1642
1670
  }
1643
1671
  ),
1644
1672
  t === "multiline" && /* @__PURE__ */ e(
1645
- Se,
1673
+ Ee,
1646
1674
  {
1647
1675
  disabled: r,
1648
1676
  length: !0,
@@ -1655,7 +1683,7 @@ function _i({
1655
1683
  }
1656
1684
  ),
1657
1685
  t === "markdown" && /* @__PURE__ */ e(
1658
- Se,
1686
+ Ee,
1659
1687
  {
1660
1688
  disabled: r,
1661
1689
  length: !0,
@@ -1668,7 +1696,7 @@ function _i({
1668
1696
  }
1669
1697
  ),
1670
1698
  t === "email" && /* @__PURE__ */ e(
1671
- Se,
1699
+ Ee,
1672
1700
  {
1673
1701
  disabled: r,
1674
1702
  max: !0,
@@ -1679,7 +1707,7 @@ function _i({
1679
1707
  )
1680
1708
  ] }) }),
1681
1709
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1682
- Oe,
1710
+ we,
1683
1711
  {
1684
1712
  name: "defaultValue",
1685
1713
  disabled: r,
@@ -1692,16 +1720,16 @@ function _i({
1692
1720
  ) })
1693
1721
  ] });
1694
1722
  }
1695
- function Fi({ disabled: t }) {
1696
- const { values: r } = G(), n = I(r, "defaultValue");
1723
+ function Ei({ disabled: t }) {
1724
+ const { values: r } = Y(), n = I(r, "defaultValue");
1697
1725
  return /* @__PURE__ */ a(R, { children: [
1698
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }),
1726
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Fe, { disabled: t }) }) }),
1699
1727
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1700
1728
  $,
1701
1729
  {
1702
1730
  name: "defaultValue",
1703
1731
  children: ({ field: i, form: l }) => /* @__PURE__ */ e(
1704
- le,
1732
+ oe,
1705
1733
  {
1706
1734
  label: n == null ? "Default value not set" : "Default value is " + n.toString(),
1707
1735
  disabled: t,
@@ -1714,7 +1742,7 @@ function Fi({ disabled: t }) {
1714
1742
  ) })
1715
1743
  ] });
1716
1744
  }
1717
- function Ei({
1745
+ function Si({
1718
1746
  disabled: t,
1719
1747
  getData: r,
1720
1748
  allowDataInference: n,
@@ -1724,7 +1752,7 @@ function Ei({
1724
1752
  const {
1725
1753
  values: o,
1726
1754
  setFieldValue: d
1727
- } = G(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = ({
1755
+ } = Y(), [c, u] = j(!1), [m, p] = j(), [s, f] = j(), g = ({
1728
1756
  id: T,
1729
1757
  property: w
1730
1758
  }) => {
@@ -1736,28 +1764,28 @@ function Ei({
1736
1764
  }, !1);
1737
1765
  const C = o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), O = C.includes(T) ? C : [...C, T];
1738
1766
  d("oneOf.propertiesOrder", O, !1), u(!1);
1739
- }, P = m ? ne(m, s) : void 0, y = P ? I(o.oneOf?.properties, P.replaceAll(".", ".properties.")) : void 0, x = J((T, w) => {
1767
+ }, P = m ? ne(m, s) : void 0, y = P ? I(o.oneOf?.properties, P.replaceAll(".", ".properties.")) : void 0, x = (T, w) => {
1740
1768
  const C = T ? ne(T, w) : void 0;
1741
1769
  if (!C)
1742
1770
  throw Error("collection editor miss config");
1743
- d(`oneOf.${he(C)}`, void 0, !1);
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);
1746
- }, [d, o]), v = /* @__PURE__ */ a(
1771
+ d(`oneOf.${me(C)}`, void 0, !1);
1772
+ const O = `oneOf.${he(w)}`, N = I(o, O) ?? Object.keys(I(o, ir(w)));
1773
+ d(O, N.filter((E) => E !== T), !1), u(!1), p(void 0), f(void 0);
1774
+ }, v = /* @__PURE__ */ a(
1747
1775
  z,
1748
1776
  {
1749
1777
  autoFocus: !0,
1750
1778
  color: "primary",
1751
1779
  onClick: () => u(!0),
1752
- startIcon: /* @__PURE__ */ e(ce, {}),
1780
+ startIcon: /* @__PURE__ */ e(de, {}),
1753
1781
  children: [
1754
1782
  "Add property to ",
1755
1783
  o.name ?? "this block"
1756
1784
  ]
1757
1785
  }
1758
- ), b = J((T, w) => {
1759
- d(`oneOf.${Ce(w)}`, T, !1);
1760
- }, []);
1786
+ ), b = (T, w) => {
1787
+ d(`oneOf.${he(w)}`, T, !1);
1788
+ };
1761
1789
  return /* @__PURE__ */ a(R, { children: [
1762
1790
  /* @__PURE__ */ a("div", { className: "col-span-12", children: [
1763
1791
  /* @__PURE__ */ a("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
@@ -1766,7 +1794,7 @@ function Ei({
1766
1794
  ] }),
1767
1795
  /* @__PURE__ */ a(ge, { className: "p-2 pl-8", children: [
1768
1796
  /* @__PURE__ */ e(
1769
- gt,
1797
+ ft,
1770
1798
  {
1771
1799
  properties: o.oneOf?.properties ?? {},
1772
1800
  propertiesOrder: o.oneOf?.propertiesOrder,
@@ -1782,7 +1810,7 @@ function Ei({
1782
1810
  ] })
1783
1811
  ] }),
1784
1812
  !t && /* @__PURE__ */ e(
1785
- Ve,
1813
+ Oe,
1786
1814
  {
1787
1815
  inArray: !1,
1788
1816
  forceShowErrors: !1,
@@ -1810,15 +1838,15 @@ function Ei({
1810
1838
  )
1811
1839
  ] });
1812
1840
  }
1813
- function Si({ disabled: t }) {
1841
+ function Ai({ disabled: t }) {
1814
1842
  const {
1815
1843
  values: r,
1816
1844
  handleChange: n
1817
- } = G(), i = "validation.min", l = "validation.max", o = "validation.lessThan", d = "validation.moreThan";
1845
+ } = Y(), i = "validation.min", l = "validation.max", o = "validation.lessThan", d = "validation.moreThan";
1818
1846
  return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
1819
- /* @__PURE__ */ e(Ee, { disabled: t }),
1847
+ /* @__PURE__ */ e(Fe, { disabled: t }),
1820
1848
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
1821
- W,
1849
+ K,
1822
1850
  {
1823
1851
  value: I(r, i),
1824
1852
  label: "Min value",
@@ -1830,7 +1858,7 @@ function Si({ disabled: t }) {
1830
1858
  }
1831
1859
  ) }),
1832
1860
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
1833
- W,
1861
+ K,
1834
1862
  {
1835
1863
  value: I(r, l),
1836
1864
  label: "Max value",
@@ -1842,7 +1870,7 @@ function Si({ disabled: t }) {
1842
1870
  }
1843
1871
  ) }),
1844
1872
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
1845
- W,
1873
+ K,
1846
1874
  {
1847
1875
  value: I(r, o),
1848
1876
  label: "Less than",
@@ -1854,7 +1882,7 @@ function Si({ disabled: t }) {
1854
1882
  }
1855
1883
  ) }),
1856
1884
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
1857
- W,
1885
+ K,
1858
1886
  {
1859
1887
  value: I(r, d),
1860
1888
  label: "More than",
@@ -1871,7 +1899,7 @@ function Si({ disabled: t }) {
1871
1899
  name: "validation.positive",
1872
1900
  type: "checkbox",
1873
1901
  children: ({ field: p, form: s }) => /* @__PURE__ */ e(
1874
- le,
1902
+ oe,
1875
1903
  {
1876
1904
  label: "Positive value",
1877
1905
  disabled: t,
@@ -1887,7 +1915,7 @@ function Si({ disabled: t }) {
1887
1915
  name: "validation.negative",
1888
1916
  type: "checkbox",
1889
1917
  children: ({ field: p, form: s }) => /* @__PURE__ */ e(
1890
- le,
1918
+ oe,
1891
1919
  {
1892
1920
  label: "Negative value",
1893
1921
  disabled: t,
@@ -1903,7 +1931,7 @@ function Si({ disabled: t }) {
1903
1931
  name: "validation.integer",
1904
1932
  type: "checkbox",
1905
1933
  children: ({ field: p, form: s }) => /* @__PURE__ */ e(
1906
- le,
1934
+ oe,
1907
1935
  {
1908
1936
  label: "Integer value",
1909
1937
  disabled: t,
@@ -1915,12 +1943,12 @@ function Si({ disabled: t }) {
1915
1943
  ) })
1916
1944
  ] });
1917
1945
  }
1918
- function Ai({ disabled: t }) {
1919
- const { values: r, setFieldValue: n } = G();
1946
+ function Di({ disabled: t }) {
1947
+ const { values: r, setFieldValue: n } = Y();
1920
1948
  return /* @__PURE__ */ a(R, { children: [
1921
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Si, { disabled: t }) }) }),
1949
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Ai, { disabled: t }) }) }),
1922
1950
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1923
- Oe,
1951
+ we,
1924
1952
  {
1925
1953
  name: "defaultValue",
1926
1954
  disabled: t,
@@ -1934,7 +1962,7 @@ function Ai({ disabled: t }) {
1934
1962
  ) })
1935
1963
  ] });
1936
1964
  }
1937
- function qt({
1965
+ function jt({
1938
1966
  existing: t,
1939
1967
  multiple: r,
1940
1968
  disabled: n,
@@ -1944,9 +1972,9 @@ function qt({
1944
1972
  values: l,
1945
1973
  handleChange: o,
1946
1974
  errors: d
1947
- } = G();
1975
+ } = Y();
1948
1976
  if (!Te())
1949
- return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ge, {}) });
1977
+ return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(He, {}) });
1950
1978
  const u = r ? "of.path" : "path", m = I(l, u), p = i && I(d, u);
1951
1979
  return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
1952
1980
  $,
@@ -1958,11 +1986,11 @@ function qt({
1958
1986
  value: m,
1959
1987
  error: p,
1960
1988
  handleChange: o,
1961
- as: Di
1989
+ as: Bi
1962
1990
  }
1963
1991
  ) }) });
1964
1992
  }
1965
- function Di({
1993
+ function Bi({
1966
1994
  disabled: t,
1967
1995
  pathPath: r,
1968
1996
  value: n,
@@ -1972,13 +2000,13 @@ function Di({
1972
2000
  }) {
1973
2001
  const d = Te();
1974
2002
  if (!d)
1975
- return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ge, {}) });
2003
+ return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(He, {}) });
1976
2004
  const c = d?.collections ?? [], u = Array.from(new Set(
1977
2005
  Object.values(c).map((p) => p.group).filter(Boolean)
1978
2006
  ).values()), m = c.filter((p) => !p.group);
1979
2007
  return /* @__PURE__ */ a(R, { children: [
1980
2008
  /* @__PURE__ */ a(
1981
- Ne,
2009
+ be,
1982
2010
  {
1983
2011
  error: !!l,
1984
2012
  disabled: t,
@@ -1990,7 +2018,7 @@ function Di({
1990
2018
  renderValue: (p) => {
1991
2019
  const s = c.find((f) => f.id === p || f.path === p);
1992
2020
  return s ? /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
1993
- /* @__PURE__ */ e(dt, { collectionOrView: s }),
2021
+ /* @__PURE__ */ e(st, { collectionOrView: s }),
1994
2022
  /* @__PURE__ */ e(
1995
2023
  V,
1996
2024
  {
@@ -2004,15 +2032,15 @@ function Di({
2004
2032
  ...o,
2005
2033
  children: [
2006
2034
  u.flatMap((p) => /* @__PURE__ */ e(
2007
- Dt,
2035
+ At,
2008
2036
  {
2009
2037
  label: p || "Views",
2010
2038
  children: c.filter((s) => s.group === p).map((s) => /* @__PURE__ */ e(
2011
- ee,
2039
+ X,
2012
2040
  {
2013
2041
  value: s.id ?? s.path,
2014
2042
  children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
2015
- /* @__PURE__ */ e(dt, { collectionOrView: s }),
2043
+ /* @__PURE__ */ e(st, { collectionOrView: s }),
2016
2044
  /* @__PURE__ */ e(
2017
2045
  V,
2018
2046
  {
@@ -2028,12 +2056,12 @@ function Di({
2028
2056
  },
2029
2057
  `group_${p}`
2030
2058
  )),
2031
- m && /* @__PURE__ */ e(Dt, { label: "Views", children: m.map((p) => /* @__PURE__ */ e(
2032
- ee,
2059
+ m && /* @__PURE__ */ e(At, { label: "Views", children: m.map((p) => /* @__PURE__ */ e(
2060
+ X,
2033
2061
  {
2034
2062
  value: p.id ?? p.path,
2035
2063
  children: /* @__PURE__ */ a("div", { className: "flex flex-row", children: [
2036
- /* @__PURE__ */ e(dt, { collectionOrView: p }),
2064
+ /* @__PURE__ */ e(st, { collectionOrView: p }),
2037
2065
  /* @__PURE__ */ e(
2038
2066
  V,
2039
2067
  {
@@ -2049,20 +2077,20 @@ function Di({
2049
2077
  ]
2050
2078
  }
2051
2079
  ),
2052
- /* @__PURE__ */ e(X, { children: "You can only edit the reference collection upon field creation." })
2080
+ /* @__PURE__ */ e(J, { children: "You can only edit the reference collection upon field creation." })
2053
2081
  ] });
2054
2082
  }
2055
- function Bi({ disabled: t }) {
2083
+ function Mi({ disabled: t }) {
2056
2084
  const {
2057
2085
  values: r,
2058
2086
  errors: n,
2059
2087
  touched: i,
2060
2088
  setFieldValue: l
2061
- } = G(), o = "mode", d = I(r, o), c = I(i, o) && I(n, o), u = "autoValue", m = I(r, u), p = I(i, u) && I(n, u);
2089
+ } = Y(), o = "mode", d = I(r, o), c = I(i, o) && I(n, o), u = "autoValue", m = I(r, u), p = I(i, u) && I(n, u);
2062
2090
  return /* @__PURE__ */ a(R, { children: [
2063
2091
  /* @__PURE__ */ a("div", { className: "flex flex-col col-span-12", children: [
2064
2092
  /* @__PURE__ */ a(
2065
- Ne,
2093
+ be,
2066
2094
  {
2067
2095
  name: o,
2068
2096
  value: d ?? "date",
@@ -2081,14 +2109,14 @@ function Bi({ disabled: t }) {
2081
2109
  },
2082
2110
  disabled: t,
2083
2111
  children: [
2084
- /* @__PURE__ */ e(ee, { value: "date_time", children: " Date/Time " }),
2085
- /* @__PURE__ */ e(ee, { value: "date", children: " Date " })
2112
+ /* @__PURE__ */ e(X, { value: "date_time", children: " Date/Time " }),
2113
+ /* @__PURE__ */ e(X, { value: "date", children: " Date " })
2086
2114
  ]
2087
2115
  }
2088
2116
  ),
2089
- /* @__PURE__ */ e(X, { error: !!c, children: c }),
2117
+ /* @__PURE__ */ e(J, { error: !!c, children: c }),
2090
2118
  /* @__PURE__ */ a(
2091
- Ne,
2119
+ be,
2092
2120
  {
2093
2121
  name: u,
2094
2122
  disabled: t,
@@ -2107,21 +2135,21 @@ function Bi({ disabled: t }) {
2107
2135
  error: !!p,
2108
2136
  label: "Automatic value",
2109
2137
  children: [
2110
- /* @__PURE__ */ e(ee, { value: "none", children: " None " }),
2111
- /* @__PURE__ */ e(ee, { value: "on_create", children: " On create " }),
2112
- /* @__PURE__ */ e(ee, { value: "on_update", children: " On any update " })
2138
+ /* @__PURE__ */ e(X, { value: "none", children: " None " }),
2139
+ /* @__PURE__ */ e(X, { value: "on_create", children: " On create " }),
2140
+ /* @__PURE__ */ e(X, { value: "on_update", children: " On any update " })
2113
2141
  ]
2114
2142
  }
2115
2143
  ),
2116
- /* @__PURE__ */ e(X, { error: !!p, children: p ?? "Update this field automatically when creating or updating the entity" })
2144
+ /* @__PURE__ */ e(J, { error: !!p, children: p ?? "Update this field automatically when creating or updating the entity" })
2117
2145
  ] }),
2118
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) })
2146
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Fe, { disabled: t }) }) })
2119
2147
  ] });
2120
2148
  }
2121
- function Mi({ disabled: t }) {
2149
+ function zi({ disabled: t }) {
2122
2150
  return /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2", children: [
2123
2151
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e($, { type: "checkbox", name: "hideFromCollection", children: ({ field: i, form: l }) => /* @__PURE__ */ e(
2124
- le,
2152
+ oe,
2125
2153
  {
2126
2154
  label: "Hide from collection",
2127
2155
  disabled: t,
@@ -2136,7 +2164,7 @@ function Mi({ disabled: t }) {
2136
2164
  name: "readOnly",
2137
2165
  type: "checkbox",
2138
2166
  children: ({ field: i, form: l }) => /* @__PURE__ */ e(
2139
- le,
2167
+ oe,
2140
2168
  {
2141
2169
  label: "Read only",
2142
2170
  disabled: t,
@@ -2149,12 +2177,12 @@ function Mi({ disabled: t }) {
2149
2177
  ) })
2150
2178
  ] });
2151
2179
  }
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 }) }) }) });
2180
+ function Ri({ disabled: t }) {
2181
+ return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(Fe, { disabled: t }) }) }) });
2154
2182
  }
2155
- function lr(t, r, n) {
2183
+ function or(t, r, n) {
2156
2184
  let i;
2157
- return r === "text_field" ? i = K(
2185
+ return r === "text_field" ? i = W(
2158
2186
  t,
2159
2187
  {
2160
2188
  dataType: "string",
@@ -2167,7 +2195,7 @@ function lr(t, r, n) {
2167
2195
  url: void 0,
2168
2196
  enumValues: void 0
2169
2197
  }
2170
- ) : r === "multiline" ? i = K(
2198
+ ) : r === "multiline" ? i = W(
2171
2199
  t,
2172
2200
  {
2173
2201
  dataType: "string",
@@ -2180,7 +2208,7 @@ function lr(t, r, n) {
2180
2208
  url: void 0,
2181
2209
  enumValues: void 0
2182
2210
  }
2183
- ) : r === "markdown" ? i = K(
2211
+ ) : r === "markdown" ? i = W(
2184
2212
  t,
2185
2213
  {
2186
2214
  dataType: "string",
@@ -2192,7 +2220,7 @@ function lr(t, r, n) {
2192
2220
  email: void 0,
2193
2221
  url: void 0
2194
2222
  }
2195
- ) : r === "url" ? i = K(
2223
+ ) : r === "url" ? i = W(
2196
2224
  t,
2197
2225
  {
2198
2226
  dataType: "string",
@@ -2205,7 +2233,7 @@ function lr(t, r, n) {
2205
2233
  url: !0,
2206
2234
  enumValues: void 0
2207
2235
  }
2208
- ) : r === "email" ? i = K(
2236
+ ) : r === "email" ? i = W(
2209
2237
  t,
2210
2238
  {
2211
2239
  dataType: "string",
@@ -2218,7 +2246,7 @@ function lr(t, r, n) {
2218
2246
  url: void 0,
2219
2247
  enumValues: void 0
2220
2248
  }
2221
- ) : r === "select" ? i = K(
2249
+ ) : r === "select" ? i = W(
2222
2250
  t,
2223
2251
  {
2224
2252
  dataType: "string",
@@ -2231,7 +2259,7 @@ function lr(t, r, n) {
2231
2259
  url: void 0,
2232
2260
  enumValues: t.enumValues ?? []
2233
2261
  }
2234
- ) : r === "multi_select" ? i = K(
2262
+ ) : r === "multi_select" ? i = W(
2235
2263
  t,
2236
2264
  {
2237
2265
  dataType: "array",
@@ -2242,7 +2270,7 @@ function lr(t, r, n) {
2242
2270
  enumValues: t.of?.enumValues ?? []
2243
2271
  }
2244
2272
  }
2245
- ) : r === "number_input" ? i = K(
2273
+ ) : r === "number_input" ? i = W(
2246
2274
  t,
2247
2275
  {
2248
2276
  dataType: "number",
@@ -2250,7 +2278,7 @@ function lr(t, r, n) {
2250
2278
  editable: t.editable !== void 0 ? t.editable : !0,
2251
2279
  enumValues: void 0
2252
2280
  }
2253
- ) : r === "number_select" ? i = K(
2281
+ ) : r === "number_select" ? i = W(
2254
2282
  t,
2255
2283
  {
2256
2284
  dataType: "number",
@@ -2258,7 +2286,7 @@ function lr(t, r, n) {
2258
2286
  editable: t.editable !== void 0 ? t.editable : !0,
2259
2287
  enumValues: t.enumValues ?? []
2260
2288
  }
2261
- ) : r === "multi_number_select" ? i = K(
2289
+ ) : r === "multi_number_select" ? i = W(
2262
2290
  t,
2263
2291
  {
2264
2292
  dataType: "array",
@@ -2269,7 +2297,7 @@ function lr(t, r, n) {
2269
2297
  enumValues: t.of?.enumValues ?? []
2270
2298
  }
2271
2299
  }
2272
- ) : r === "file_upload" ? i = K(
2300
+ ) : r === "file_upload" ? i = W(
2273
2301
  t,
2274
2302
  {
2275
2303
  dataType: "string",
@@ -2279,7 +2307,7 @@ function lr(t, r, n) {
2279
2307
  storagePath: "/"
2280
2308
  }
2281
2309
  }
2282
- ) : r === "multi_file_upload" ? i = K(
2310
+ ) : r === "multi_file_upload" ? i = W(
2283
2311
  t,
2284
2312
  {
2285
2313
  dataType: "array",
@@ -2292,7 +2320,7 @@ function lr(t, r, n) {
2292
2320
  }
2293
2321
  }
2294
2322
  }
2295
- ) : r === "group" ? i = K(
2323
+ ) : r === "group" ? i = W(
2296
2324
  t,
2297
2325
  {
2298
2326
  dataType: "map",
@@ -2301,7 +2329,7 @@ function lr(t, r, n) {
2301
2329
  keyValue: !1,
2302
2330
  properties: t.properties ?? {}
2303
2331
  }
2304
- ) : r === "key_value" ? i = K(
2332
+ ) : r === "key_value" ? i = W(
2305
2333
  t,
2306
2334
  {
2307
2335
  dataType: "map",
@@ -2310,14 +2338,14 @@ function lr(t, r, n) {
2310
2338
  keyValue: !0,
2311
2339
  properties: void 0
2312
2340
  }
2313
- ) : r === "reference" ? i = K(
2341
+ ) : r === "reference" ? i = W(
2314
2342
  t,
2315
2343
  {
2316
2344
  dataType: "reference",
2317
2345
  propertyConfig: "reference",
2318
2346
  editable: t.editable !== void 0 ? t.editable : !0
2319
2347
  }
2320
- ) : r === "multi_references" ? i = K(
2348
+ ) : r === "multi_references" ? i = W(
2321
2349
  t,
2322
2350
  {
2323
2351
  dataType: "array",
@@ -2327,14 +2355,14 @@ function lr(t, r, n) {
2327
2355
  dataType: "reference"
2328
2356
  }
2329
2357
  }
2330
- ) : r === "switch" ? i = K(
2358
+ ) : r === "switch" ? i = W(
2331
2359
  t,
2332
2360
  {
2333
2361
  dataType: "boolean",
2334
2362
  propertyConfig: "switch",
2335
2363
  editable: t.editable !== void 0 ? t.editable : !0
2336
2364
  }
2337
- ) : r === "date_time" ? i = K(
2365
+ ) : r === "date_time" ? i = W(
2338
2366
  t,
2339
2367
  {
2340
2368
  dataType: "date",
@@ -2342,14 +2370,14 @@ function lr(t, r, n) {
2342
2370
  editable: t.editable !== void 0 ? t.editable : !0,
2343
2371
  mode: "date_time"
2344
2372
  }
2345
- ) : r === "repeat" ? i = K(
2373
+ ) : r === "repeat" ? i = W(
2346
2374
  t,
2347
2375
  {
2348
2376
  dataType: "array",
2349
2377
  propertyConfig: "repeat",
2350
2378
  editable: t.editable !== void 0 ? t.editable : !0
2351
2379
  }
2352
- ) : r === "block" ? i = K(
2380
+ ) : r === "block" ? i = W(
2353
2381
  t,
2354
2382
  {
2355
2383
  dataType: "array",
@@ -2364,9 +2392,9 @@ function lr(t, r, n) {
2364
2392
  propertyConfig: r
2365
2393
  }), i;
2366
2394
  }
2367
- function sr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
2395
+ function lr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
2368
2396
  return /* @__PURE__ */ e(
2369
- ee,
2397
+ X,
2370
2398
  {
2371
2399
  value: t,
2372
2400
  disabled: r,
@@ -2379,7 +2407,7 @@ function sr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
2379
2407
  r ? "w-full" : ""
2380
2408
  ),
2381
2409
  children: [
2382
- /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e($e, { propertyConfig: n }) }),
2410
+ /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(qe, { propertyConfig: n }) }),
2383
2411
  /* @__PURE__ */ a("div", { children: [
2384
2412
  /* @__PURE__ */ e("div", { children: n.name }),
2385
2413
  /* @__PURE__ */ e(
@@ -2398,14 +2426,14 @@ function sr({ value: t, optionDisabled: r, propertyConfig: n, existing: i }) {
2398
2426
  }
2399
2427
  );
2400
2428
  }
2401
- function Ri({
2429
+ function Ui({
2402
2430
  disabled: t,
2403
2431
  showErrors: r
2404
2432
  }) {
2405
- const { values: n, setFieldValue: i } = G(), l = I(n, "url");
2433
+ const { values: n, setFieldValue: i } = Y(), l = I(n, "url");
2406
2434
  return /* @__PURE__ */ a(R, { children: [
2407
2435
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ a(
2408
- Ne,
2436
+ be,
2409
2437
  {
2410
2438
  disabled: t,
2411
2439
  position: "item-aligned",
@@ -2427,15 +2455,15 @@ function Ri({
2427
2455
  },
2428
2456
  value: l ?? "[NONE]",
2429
2457
  children: [
2430
- /* @__PURE__ */ e(ee, { value: "[NONE]", children: "Display URL" }),
2431
- /* @__PURE__ */ e(ee, { value: "image", children: "Image" }),
2432
- /* @__PURE__ */ e(ee, { value: "video", children: "Video" }),
2433
- /* @__PURE__ */ e(ee, { value: "audio", children: "Audio" })
2458
+ /* @__PURE__ */ e(X, { value: "[NONE]", children: "Display URL" }),
2459
+ /* @__PURE__ */ e(X, { value: "image", children: "Image" }),
2460
+ /* @__PURE__ */ e(X, { value: "video", children: "Video" }),
2461
+ /* @__PURE__ */ e(X, { value: "audio", children: "Audio" })
2434
2462
  ]
2435
2463
  }
2436
2464
  ) }),
2437
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(xe, { children: /* @__PURE__ */ e(
2438
- Se,
2465
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
2466
+ Ee,
2439
2467
  {
2440
2468
  disabled: t,
2441
2469
  max: !0,
@@ -2445,7 +2473,7 @@ function Ri({
2445
2473
  }
2446
2474
  ) }) }),
2447
2475
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2448
- Oe,
2476
+ we,
2449
2477
  {
2450
2478
  name: "defaultValue",
2451
2479
  disabled: t,
@@ -2458,7 +2486,7 @@ function Ri({
2458
2486
  ) })
2459
2487
  ] });
2460
2488
  }
2461
- const Ui = [
2489
+ const ji = [
2462
2490
  "text_field",
2463
2491
  "multiline",
2464
2492
  "markdown",
@@ -2479,7 +2507,7 @@ const Ui = [
2479
2507
  "key_value",
2480
2508
  "repeat",
2481
2509
  "block"
2482
- ], dr = Object.entries(Kt).filter(([t]) => Ui.includes(t)).map(([t, r]) => ({ [t]: r })).reduce((t, r) => ({ ...t, ...r }), {}), cr = Y.memo(
2510
+ ], sr = Object.entries(Wt).filter(([t]) => ji.includes(t)).map(([t, r]) => ({ [t]: r })).reduce((t, r) => ({ ...t, ...r }), {}), dr = G.memo(
2483
2511
  function(r) {
2484
2512
  const {
2485
2513
  includeIdAndName: n = !0,
@@ -2505,22 +2533,22 @@ const Ui = [
2505
2533
  } = r, O = {
2506
2534
  id: "",
2507
2535
  name: ""
2508
- }, N = !!(p && !qe(p)) && !C, F = je(p ? {
2536
+ }, N = !!(p && !Ue(p)) && !C, E = Re(p ? {
2509
2537
  id: c,
2510
2538
  previousId: c,
2511
2539
  property: p
2512
- } : void 0), D = ({
2540
+ } : void 0), B = ({
2513
2541
  id: S,
2514
2542
  property: h
2515
2543
  }) => {
2516
- const B = {
2544
+ const D = {
2517
2545
  id: S,
2518
- previousId: F.current?.id,
2546
+ previousId: E.current?.id,
2519
2547
  property: h,
2520
2548
  namespace: m
2521
2549
  };
2522
- F.current = B, s?.(B);
2523
- }, _ = Ot({
2550
+ E.current = D, s?.(D);
2551
+ }, _ = kt({
2524
2552
  initialValues: p ? { id: c, ...p } : O,
2525
2553
  initialErrors: y,
2526
2554
  validateOnChange: !0,
@@ -2528,12 +2556,12 @@ const Ui = [
2528
2556
  onSubmit: (S, h) => {
2529
2557
  console.debug("onSubmit", S);
2530
2558
  const {
2531
- id: B,
2532
- ...oe
2559
+ id: D,
2560
+ ...ae
2533
2561
  } = S;
2534
- D({
2535
- id: B,
2536
- property: { ...oe, editable: oe.editable ?? !0 }
2562
+ B({
2563
+ id: D,
2564
+ property: { ...ae, editable: ae.editable ?? !0 }
2537
2565
  }), l || h.resetForm({ values: O });
2538
2566
  },
2539
2567
  validation: (S) => {
@@ -2542,27 +2570,27 @@ const Ui = [
2542
2570
  if (!S.name)
2543
2571
  h.name = "Required";
2544
2572
  else {
2545
- const B = $i(S.name);
2546
- B && (h.name = B);
2573
+ const D = Hi(S.name);
2574
+ D && (h.name = D);
2547
2575
  }
2548
2576
  if (!S.id)
2549
2577
  h.id = "Required";
2550
2578
  else {
2551
- const B = Li(S.id, u);
2552
- B && (h.id = B);
2579
+ const D = $i(S.id, u);
2580
+ D && (h.id = D);
2553
2581
  }
2554
2582
  }
2555
- return S.dataType === "string" && S.validation?.matches && !Pr(S.validation?.matches.toString()) && (h.validation = {
2583
+ return S.dataType === "string" && S.validation?.matches && !xr(S.validation?.matches.toString()) && (h.validation = {
2556
2584
  matches: "Invalid regular expression"
2557
2585
  }), S.dataType === "reference" && !S.path && (h.path = "You must specify a target collection for the field"), S.propertyConfig === "repeat" && (S.of || (h.of = "You need to specify a repeat field")), S.propertyConfig === "block" && (S.oneOf || (h.oneOf = "You need to specify the properties of this block")), h;
2558
2586
  }
2559
2587
  });
2560
- return ue(() => {
2588
+ return ce(() => {
2561
2589
  b?.(_);
2562
- }, [_, b]), /* @__PURE__ */ e(Vt, { value: _, children: /* @__PURE__ */ e(
2563
- ji,
2590
+ }, [_, b]), /* @__PURE__ */ e(Ot, { value: _, children: /* @__PURE__ */ e(
2591
+ qi,
2564
2592
  {
2565
- onPropertyChanged: f ? D : void 0,
2593
+ onPropertyChanged: f ? B : void 0,
2566
2594
  onDelete: g,
2567
2595
  includeIdAndTitle: n,
2568
2596
  propertyNamespace: m,
@@ -2581,9 +2609,9 @@ const Ui = [
2581
2609
  }
2582
2610
  ) });
2583
2611
  },
2584
- (t, r) => t.getData === r.getData && t.propertyKey === r.propertyKey && t.propertyNamespace === r.propertyNamespace && t.includeIdAndName === r.includeIdAndName && t.autoOpenTypeSelect === r.autoOpenTypeSelect && t.autoUpdateId === r.autoUpdateId && t.existingProperty === r.existingProperty
2612
+ (t, r) => t.getData === r.getData && t.propertyKey === r.propertyKey && t.propertyNamespace === r.propertyNamespace && t.includeIdAndName === r.includeIdAndName && t.autoOpenTypeSelect === r.autoOpenTypeSelect && t.autoUpdateId === r.autoUpdateId && t.existingPropertyKeys === r.existingPropertyKeys && t.existingProperty === r.existingProperty
2585
2613
  );
2586
- function Ve({
2614
+ function Oe({
2587
2615
  open: t,
2588
2616
  onCancel: r,
2589
2617
  onOkClicked: n,
@@ -2592,9 +2620,9 @@ function Ve({
2592
2620
  collectionEditable: o,
2593
2621
  ...d
2594
2622
  }) {
2595
- const c = je();
2623
+ const c = Re();
2596
2624
  return /* @__PURE__ */ e(
2597
- Fe,
2625
+ _e,
2598
2626
  {
2599
2627
  open: t ?? !1,
2600
2628
  maxWidth: "xl",
@@ -2608,8 +2636,8 @@ function Ve({
2608
2636
  m.preventDefault(), m.stopPropagation(), c.current?.handleSubmit(m);
2609
2637
  },
2610
2638
  children: [
2611
- /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
2612
- cr,
2639
+ /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(
2640
+ dr,
2613
2641
  {
2614
2642
  ...d,
2615
2643
  onPropertyChanged: (m) => {
@@ -2623,7 +2651,7 @@ function Ve({
2623
2651
  getData: l
2624
2652
  }
2625
2653
  ) }),
2626
- /* @__PURE__ */ a(Be, { children: [
2654
+ /* @__PURE__ */ a(De, { children: [
2627
2655
  r && /* @__PURE__ */ e(
2628
2656
  z,
2629
2657
  {
@@ -2650,7 +2678,7 @@ function Ve({
2650
2678
  }
2651
2679
  );
2652
2680
  }
2653
- function ji({
2681
+ function qi({
2654
2682
  values: t,
2655
2683
  errors: r,
2656
2684
  setValues: n,
@@ -2670,43 +2698,43 @@ function ji({
2670
2698
  propertyConfigs: x,
2671
2699
  collectionEditable: v
2672
2700
  }) {
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");
2674
- ue(() => {
2701
+ const [b, T] = j(o), [w, C] = j(!1), [O, N] = j(t?.dataType ? Gt(t) : void 0), E = Object.entries(sr).concat(Object.entries(x)), B = g ? E.filter(([Z, H]) => !re(H.property) && H.property?.dataType !== "array") : E, _ = Fr(t), S = Re(null), h = Re(t), D = s && I(r, "selectedWidget");
2702
+ ce(() => {
2675
2703
  if (c && (!d || _.id)) {
2676
2704
  const {
2677
2705
  id: Z,
2678
2706
  ...H
2679
2707
  } = _;
2680
- be(_, h.current) || (c({
2708
+ ye(_, h.current) || (c({
2681
2709
  id: Z,
2682
2710
  property: H,
2683
2711
  namespace: m
2684
2712
  }), h.current = _);
2685
2713
  }
2686
- }, [_, d, c, m]), ue(() => {
2714
+ }, [_, d, m]), ce(() => {
2687
2715
  t?.id && p && p(t?.id, m, r);
2688
- }, [r, p, m, t?.id]);
2689
- const oe = (Z) => {
2690
- N(Z), n(lr(t, Z, x)), setTimeout(() => {
2716
+ }, [r, m, t?.id]);
2717
+ const ae = (Z) => {
2718
+ N(Z), n(or(t, Z, x)), setTimeout(() => {
2691
2719
  S.current?.focus();
2692
2720
  }, 0);
2693
2721
  };
2694
2722
  let q;
2695
2723
  return O === "text_field" || O === "multiline" || O === "markdown" || O === "email" ? q = /* @__PURE__ */ e(
2696
- _i,
2724
+ Fi,
2697
2725
  {
2698
2726
  widgetId: O,
2699
2727
  disabled: f,
2700
2728
  showErrors: s
2701
2729
  }
2702
2730
  ) : O === "url" ? q = /* @__PURE__ */ e(
2703
- Ri,
2731
+ Ui,
2704
2732
  {
2705
2733
  disabled: f,
2706
2734
  showErrors: s
2707
2735
  }
2708
2736
  ) : O === "select" || O === "number_select" ? q = /* @__PURE__ */ e(
2709
- Ut,
2737
+ Rt,
2710
2738
  {
2711
2739
  multiselect: !1,
2712
2740
  allowDataInference: y,
@@ -2716,7 +2744,7 @@ function ji({
2716
2744
  showErrors: s
2717
2745
  }
2718
2746
  ) : O === "multi_select" || O === "multi_number_select" ? q = /* @__PURE__ */ e(
2719
- Ut,
2747
+ Rt,
2720
2748
  {
2721
2749
  multiselect: !0,
2722
2750
  updateIds: !i,
@@ -2726,21 +2754,21 @@ function ji({
2726
2754
  showErrors: s
2727
2755
  }
2728
2756
  ) : O === "file_upload" ? q = /* @__PURE__ */ e(
2729
- jt,
2757
+ Ut,
2730
2758
  {
2731
2759
  existing: i,
2732
2760
  multiple: !1,
2733
2761
  disabled: f
2734
2762
  }
2735
2763
  ) : O === "multi_file_upload" ? q = /* @__PURE__ */ e(
2736
- jt,
2764
+ Ut,
2737
2765
  {
2738
2766
  existing: i,
2739
2767
  multiple: !0,
2740
2768
  disabled: f
2741
2769
  }
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,
2770
+ ) : O === "switch" ? q = /* @__PURE__ */ e(Ei, { disabled: f }) : O === "number_input" ? q = /* @__PURE__ */ e(Di, { disabled: f }) : O === "group" ? q = /* @__PURE__ */ e(
2771
+ Vi,
2744
2772
  {
2745
2773
  disabled: f,
2746
2774
  getData: P,
@@ -2749,7 +2777,7 @@ function ji({
2749
2777
  propertyConfigs: x
2750
2778
  }
2751
2779
  ) : O === "block" ? q = /* @__PURE__ */ e(
2752
- Ei,
2780
+ Si,
2753
2781
  {
2754
2782
  disabled: f,
2755
2783
  getData: P,
@@ -2758,15 +2786,15 @@ function ji({
2758
2786
  propertyConfigs: x
2759
2787
  }
2760
2788
  ) : O === "reference" ? q = /* @__PURE__ */ e(
2761
- qt,
2789
+ jt,
2762
2790
  {
2763
2791
  showErrors: s,
2764
2792
  existing: i,
2765
2793
  multiple: !1,
2766
2794
  disabled: f
2767
2795
  }
2768
- ) : O === "date_time" ? q = /* @__PURE__ */ e(Bi, { disabled: f }) : O === "multi_references" ? q = /* @__PURE__ */ e(
2769
- qt,
2796
+ ) : O === "date_time" ? q = /* @__PURE__ */ e(Mi, { disabled: f }) : O === "multi_references" ? q = /* @__PURE__ */ e(
2797
+ jt,
2770
2798
  {
2771
2799
  showErrors: s,
2772
2800
  existing: i,
@@ -2774,7 +2802,7 @@ function ji({
2774
2802
  disabled: f
2775
2803
  }
2776
2804
  ) : O === "repeat" ? q = /* @__PURE__ */ e(
2777
- Vi,
2805
+ Ii,
2778
2806
  {
2779
2807
  showErrors: s,
2780
2808
  existing: i,
@@ -2784,8 +2812,8 @@ function ji({
2784
2812
  collectionEditable: v,
2785
2813
  propertyConfigs: x
2786
2814
  }
2787
- ) : O === "key_value" ? q = /* @__PURE__ */ e(zi, { disabled: f }) : q = null, /* @__PURE__ */ a(R, { children: [
2788
- f && /* @__PURE__ */ a(Hr, { mode: "warn", children: [
2815
+ ) : O === "key_value" ? q = /* @__PURE__ */ e(Ri, { disabled: f }) : q = null, /* @__PURE__ */ a(R, { children: [
2816
+ f && /* @__PURE__ */ a(Yr, { mode: "warn", children: [
2789
2817
  /* @__PURE__ */ e(V, { children: "This property can't be edited" }),
2790
2818
  /* @__PURE__ */ a(V, { variant: "caption", children: [
2791
2819
  "You may not have permission to edit it or it is defined in code with no ",
@@ -2796,9 +2824,9 @@ function ji({
2796
2824
  /* @__PURE__ */ a("div", { className: "flex mt-2 justify-between", children: [
2797
2825
  /* @__PURE__ */ a("div", { className: "w-full flex flex-col gap-2", children: [
2798
2826
  /* @__PURE__ */ e(
2799
- Ne,
2827
+ be,
2800
2828
  {
2801
- error: !!B,
2829
+ error: !!D,
2802
2830
  value: O ?? "",
2803
2831
  placeholder: "Select a property widget",
2804
2832
  open: b,
@@ -2808,27 +2836,27 @@ function ji({
2808
2836
  renderValue: (Z) => {
2809
2837
  if (!Z)
2810
2838
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
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;
2839
+ const H = Z, Q = Wt[H] ?? x[H], le = Q.property, Be = le && !re(le) ? je(le, x) : void 0, xe = re(le) || i && le.dataType !== t?.dataType, se = Be ? W(Be, Q) : Q;
2812
2840
  return /* @__PURE__ */ a(
2813
2841
  "div",
2814
2842
  {
2815
- onClick: (re) => {
2816
- we && (re.stopPropagation(), re.preventDefault());
2843
+ onClick: (te) => {
2844
+ xe && (te.stopPropagation(), te.preventDefault());
2817
2845
  },
2818
2846
  className: fe(
2819
2847
  "flex items-center",
2820
- we ? "w-full pointer-events-none opacity-50" : ""
2848
+ xe ? "w-full pointer-events-none opacity-50" : ""
2821
2849
  ),
2822
2850
  children: [
2823
- /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e($e, { propertyConfig: de }) }),
2851
+ /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(qe, { propertyConfig: se }) }),
2824
2852
  /* @__PURE__ */ a("div", { className: "flex flex-col items-start text-base text-left", children: [
2825
- /* @__PURE__ */ e("div", { children: de.name }),
2853
+ /* @__PURE__ */ e("div", { children: se.name }),
2826
2854
  /* @__PURE__ */ e(
2827
2855
  V,
2828
2856
  {
2829
2857
  variant: "caption",
2830
2858
  color: "disabled",
2831
- children: we ? "You can only switch to widgets that use the same data type" : de.description
2859
+ children: xe ? "You can only switch to widgets that use the same data type" : se.description
2832
2860
  }
2833
2861
  )
2834
2862
  ] })
@@ -2837,15 +2865,15 @@ function ji({
2837
2865
  );
2838
2866
  },
2839
2867
  onValueChange: (Z) => {
2840
- oe(Z);
2868
+ ae(Z);
2841
2869
  },
2842
- children: D.map(([Z, H]) => {
2843
- const Q = H.property, se = i && !ie(Q) && Q.dataType !== t?.dataType;
2870
+ children: B.map(([Z, H]) => {
2871
+ const Q = H.property, le = i && !re(Q) && Q.dataType !== t?.dataType;
2844
2872
  return /* @__PURE__ */ e(
2845
- sr,
2873
+ lr,
2846
2874
  {
2847
2875
  value: Z,
2848
- optionDisabled: se,
2876
+ optionDisabled: le,
2849
2877
  propertyConfig: H,
2850
2878
  existing: i
2851
2879
  },
@@ -2854,7 +2882,7 @@ function ji({
2854
2882
  })
2855
2883
  }
2856
2884
  ),
2857
- B && /* @__PURE__ */ e(
2885
+ D && /* @__PURE__ */ e(
2858
2886
  V,
2859
2887
  {
2860
2888
  variant: "caption",
@@ -2865,19 +2893,19 @@ function ji({
2865
2893
  )
2866
2894
  ] }),
2867
2895
  u && t?.id && /* @__PURE__ */ e(
2868
- ae,
2896
+ ie,
2869
2897
  {
2870
2898
  variant: "ghost",
2871
2899
  className: "m-4",
2872
2900
  disabled: f,
2873
2901
  onClick: () => C(!0),
2874
- children: /* @__PURE__ */ e(mt, {})
2902
+ children: /* @__PURE__ */ e(pt, {})
2875
2903
  }
2876
2904
  )
2877
2905
  ] }),
2878
2906
  /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
2879
2907
  d && /* @__PURE__ */ e(
2880
- Ii,
2908
+ _i,
2881
2909
  {
2882
2910
  showErrors: s,
2883
2911
  disabledId: i,
@@ -2888,10 +2916,10 @@ function ji({
2888
2916
  }
2889
2917
  ),
2890
2918
  q,
2891
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Mi, { disabled: f }) })
2919
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(zi, { disabled: f }) })
2892
2920
  ] }),
2893
2921
  u && /* @__PURE__ */ e(
2894
- ct,
2922
+ dt,
2895
2923
  {
2896
2924
  open: w,
2897
2925
  onAccept: () => u(t?.id, m),
@@ -2906,34 +2934,34 @@ function ji({
2906
2934
  )
2907
2935
  ] });
2908
2936
  }
2909
- const qi = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
2910
- function Li(t, r) {
2937
+ const Li = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
2938
+ function $i(t, r) {
2911
2939
  let 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;
2940
+ 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;
2913
2941
  }
2914
- function $i(t) {
2942
+ function Hi(t) {
2915
2943
  let r;
2916
2944
  return t || (r = "You must specify a title for the field"), r;
2917
2945
  }
2918
- function Hi(t) {
2946
+ function Yi(t) {
2919
2947
  return t ? (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((r, n) => r + n[0].toUpperCase() + n.substring(1), "") : "";
2920
2948
  }
2921
- function Yi({
2949
+ function Wi({
2922
2950
  collection: t,
2923
2951
  onOpenChange: r,
2924
2952
  open: n
2925
2953
  }) {
2926
- const i = Ie(), l = t ? `import { EntityCollection } from "firecms";
2954
+ const i = Ve(), l = t ? `import { EntityCollection } from "firecms";
2927
2955
 
2928
- const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.stringify(ur(t), null, " ") : "No collection selected";
2956
+ const ` + (t?.name ? Yi(t.name) : "my") + "Collection:EntityCollection = " + di.stringify(cr(t), null, " ") : "No collection selected";
2929
2957
  return /* @__PURE__ */ a(
2930
- Fe,
2958
+ _e,
2931
2959
  {
2932
2960
  open: n,
2933
2961
  onOpenChange: r,
2934
2962
  maxWidth: "4xl",
2935
2963
  children: [
2936
- /* @__PURE__ */ a(De, { children: [
2964
+ /* @__PURE__ */ a(Ae, { children: [
2937
2965
  /* @__PURE__ */ a(V, { variant: "h6", className: "my-4", children: [
2938
2966
  "Code for ",
2939
2967
  t.name
@@ -2951,9 +2979,9 @@ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.
2951
2979
  "."
2952
2980
  ] }),
2953
2981
  /* @__PURE__ */ e(
2954
- di,
2982
+ ci,
2955
2983
  {
2956
- theme: ci.vsDark,
2984
+ theme: ui.vsDark,
2957
2985
  code: l,
2958
2986
  language: "typescript",
2959
2987
  children: ({
@@ -2966,7 +2994,7 @@ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.
2966
2994
  }
2967
2995
  )
2968
2996
  ] }),
2969
- /* @__PURE__ */ a(Be, { children: [
2997
+ /* @__PURE__ */ a(De, { children: [
2970
2998
  /* @__PURE__ */ a(
2971
2999
  z,
2972
3000
  {
@@ -2977,7 +3005,7 @@ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.
2977
3005
  message: "Copied"
2978
3006
  }), navigator.clipboard.writeText(l)),
2979
3007
  children: [
2980
- /* @__PURE__ */ e(Yr, { size: "small" }),
3008
+ /* @__PURE__ */ e(Wr, { size: "small" }),
2981
3009
  "Copy to clipboard"
2982
3010
  ]
2983
3011
  }
@@ -2988,7 +3016,7 @@ const ` + (t?.name ? Hi(t.name) : "my") + "Collection:EntityCollection = " + si.
2988
3016
  }
2989
3017
  );
2990
3018
  }
2991
- function ur(t) {
3019
+ function cr(t) {
2992
3020
  const r = (n) => {
2993
3021
  const i = {
2994
3022
  ...n
@@ -3014,7 +3042,7 @@ function ur(t) {
3014
3042
  properties: Object.entries(t.properties ?? {}).map(([n, i]) => ({
3015
3043
  [n]: r(i)
3016
3044
  })).reduce((n, i) => ({ ...n, ...i }), {}),
3017
- subcollections: (t.subcollections ?? []).map(ur)
3045
+ subcollections: (t.subcollections ?? []).map(cr)
3018
3046
  };
3019
3047
  }
3020
3048
  function Gi({
@@ -3038,13 +3066,13 @@ function Gi({
3038
3066
  setFieldTouched: y,
3039
3067
  errors: x,
3040
3068
  dirty: v
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 } : {});
3042
- ue(() => {
3069
+ } = Y(), b = Ve(), T = Pr(), w = !T, [C, O] = j(), [N, E] = j(), [B, _] = j(), S = N ? ne(N, B) : void 0, h = S ? I(f.properties, S.replaceAll(".", ".properties.")) : void 0, [D, ae] = j(!1), [q, Z] = j(!1), [H, Q] = j(!1), [le, Be] = j([]), xe = G.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
3070
+ ce(() => {
3043
3071
  l && l(v);
3044
3072
  }, [v]);
3045
- const de = m ? () => {
3073
+ const se = m ? () => {
3046
3074
  m && (Z(!0), m(f).then((A) => {
3047
- if (A && He(A.properties), !A) {
3075
+ if (A && Le(A.properties), !A) {
3048
3076
  b.open({
3049
3077
  type: "error",
3050
3078
  message: "Could not infer properties from data"
@@ -3062,27 +3090,31 @@ function Gi({
3062
3090
  const k = {
3063
3091
  ...U.reduce((M, L) => (M[L] = (A.properties ?? {})[L], M), {}),
3064
3092
  ...f.properties
3065
- }, E = [
3093
+ }, F = [
3066
3094
  ...U,
3067
3095
  ...f.propertiesOrder ?? []
3068
3096
  ];
3069
- g("properties", k, !1), ve(E), Me(U);
3097
+ g("properties", k, !1), Pe(F), Be(U);
3070
3098
  }).finally(() => {
3071
3099
  Z(!1);
3072
3100
  }));
3073
- } : void 0, re = J((A) => A ? we.current[A] ?? I(f, Ce(A)) : we.current[""], [f]), ve = J((A, U) => {
3074
- const k = Ce(U);
3075
- g(k, A, !1), we.current[U ?? ""] = A;
3076
- }, [g]), ke = J((A, U) => {
3101
+ } : void 0, te = (A) => A ? xe.current[A] ?? I(f, he(A)) : xe.current[""] ?? I(f, he()), Pe = (A, U) => {
3102
+ const k = he(U);
3103
+ g(k, A, !1), xe.current[U ?? ""] = A;
3104
+ }, ke = (A, U) => {
3077
3105
  const k = A ? ne(A, U) : void 0;
3078
3106
  if (!k)
3079
3107
  throw Error("collection editor miss config");
3080
- g(he(k), void 0, !1);
3081
- const M = re(U).filter((L) => L !== A);
3082
- ve(M, U), Q(!1), O(void 0), F(void 0), _(void 0);
3083
- }, [re, g, ve]), Ke = (A, U) => {
3084
- g(Ce(U), A, !1);
3085
- }, vt = ({
3108
+ g(me(k), void 0, !1);
3109
+ const F = te(U);
3110
+ if (F) {
3111
+ const M = F.filter((L) => L !== A);
3112
+ Pe(M, U);
3113
+ }
3114
+ Q(!1), O(void 0), E(void 0), _(void 0);
3115
+ }, Ye = (A, U) => {
3116
+ g(he(U), A, !1);
3117
+ }, gt = ({
3086
3118
  id: A,
3087
3119
  property: U
3088
3120
  }) => {
@@ -3093,54 +3125,54 @@ function Gi({
3093
3125
  [A]: U
3094
3126
  }, !1);
3095
3127
  const k = [...f.propertiesOrder ?? Object.keys(f.properties), A];
3096
- ve(k), Q(!1), T && (O(k.indexOf(A)), F(A)), _(void 0);
3097
- }, pe = ({
3128
+ Pe(k), Q(!1), T && (O(k.indexOf(A)), E(A)), _(void 0);
3129
+ }, ue = ({
3098
3130
  id: A,
3099
3131
  property: U,
3100
3132
  previousId: k,
3101
- namespace: E
3133
+ namespace: F
3102
3134
  }) => {
3103
- const M = A ? ne(A, E) : void 0, L = M ? he(M) : void 0;
3135
+ const M = A ? ne(A, F) : void 0, L = M ? me(M) : void 0;
3104
3136
  if (k && k !== A) {
3105
3137
  console.debug("onPropertyChanged, id change", {
3106
3138
  id: A,
3107
3139
  property: U,
3108
3140
  previousId: k,
3109
- namespace: E
3141
+ namespace: F
3110
3142
  });
3111
- const ye = ne(k, E), et = he(ye), _t = re(E).map((rt) => rt === k ? A : rt).filter((rt) => rt !== void 0);
3112
- ve(_t, E), A && (O(_t.indexOf(A)), F(A)), g(et, void 0, !1), y(et, !1, !1);
3143
+ const ve = ne(k, F), Xe = me(ve), It = te(F).map((tt) => tt === k ? A : tt).filter((tt) => tt !== void 0);
3144
+ Pe(It, F), A && (O(It.indexOf(A)), E(A)), g(Xe, void 0, !1), y(Xe, !1, !1);
3113
3145
  }
3114
3146
  console.debug("onPropertyChanged", {
3115
3147
  id: A,
3116
3148
  property: U,
3117
3149
  previousId: k,
3118
- namespace: E,
3150
+ namespace: F,
3119
3151
  propertyPath: L
3120
3152
  }), L && (g(L, U, !1), y(L, !0, !1));
3121
- }, We = J((A, U, k) => {
3122
- const E = A ? ne(A, U) : void 0;
3153
+ }, We = (A, U, k) => {
3154
+ const F = A ? ne(A, U) : void 0;
3123
3155
  if (console.debug("onPropertyErrorInternal", {
3124
3156
  id: A,
3125
3157
  namespace: U,
3126
3158
  error: k,
3127
- propertyPath: E
3128
- }), E) {
3159
+ propertyPath: F
3160
+ }), F) {
3129
3161
  const M = k && Object.keys(k).length > 0;
3130
- i(A, U, M ? k : void 0), P(he(E), M ? "Property error" : void 0);
3162
+ i(A, U, M ? k : void 0), P(me(F), M ? "Property error" : void 0);
3131
3163
  }
3132
- }, []), Ze = () => {
3133
- O(void 0), F(void 0);
3134
- }, Je = N && n?.current?.properties ? n.current.properties[N] : void 0, Qe = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, ze = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Xe = Jt(() => f.ownerId && c ? c(f.ownerId) : null, [c, f.ownerId]), yt = J((A, U) => {
3164
+ }, Ge = () => {
3165
+ O(void 0), E(void 0);
3166
+ }, Ke = N && n?.current?.properties ? n.current.properties[N] : void 0, Ze = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, Je = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Qe = Zt(() => f.ownerId && c ? c(f.ownerId) : null, [c, f.ownerId]), vt = (A, U) => {
3135
3167
  console.debug("CollectionEditor: onPropertyClick", {
3136
3168
  propertyKey: A,
3137
3169
  namespace: U
3138
- }), O(ze.indexOf(A)), F(A), _(U);
3139
- }, [ze]), bt = /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
3170
+ }), O(Je.indexOf(A)), E(A), _(U);
3171
+ }, yt = /* @__PURE__ */ a("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
3140
3172
  /* @__PURE__ */ a("div", { className: fe(
3141
3173
  "p-4 md:p-8 pb-20 md:pb-20",
3142
3174
  "col-span-12 lg:col-span-5 h-full overflow-auto",
3143
- !w && "border-r " + kt
3175
+ !w && "border-r " + Tt
3144
3176
  ), children: [
3145
3177
  /* @__PURE__ */ a("div", { className: "flex my-2", children: [
3146
3178
  /* @__PURE__ */ a("div", { className: "flex-grow mb-4", children: [
@@ -3148,7 +3180,7 @@ function Gi({
3148
3180
  $,
3149
3181
  {
3150
3182
  name: "name",
3151
- as: W,
3183
+ as: K,
3152
3184
  invisible: !0,
3153
3185
  className: "-ml-1",
3154
3186
  inputClassName: "text-2xl font-headers",
@@ -3158,7 +3190,7 @@ function Gi({
3158
3190
  error: !!x?.name
3159
3191
  }
3160
3192
  ),
3161
- Xe && /* @__PURE__ */ a(
3193
+ Qe && /* @__PURE__ */ a(
3162
3194
  V,
3163
3195
  {
3164
3196
  variant: "body2",
@@ -3166,52 +3198,52 @@ function Gi({
3166
3198
  color: "secondary",
3167
3199
  children: [
3168
3200
  "Created by ",
3169
- Xe.displayName
3201
+ Qe.displayName
3170
3202
  ]
3171
3203
  }
3172
3204
  )
3173
3205
  ] }),
3174
3206
  d && /* @__PURE__ */ e("div", { className: "ml-4", children: d }),
3175
3207
  /* @__PURE__ */ a("div", { className: "ml-1 mt-2 flex flex-row gap-2", children: [
3176
- /* @__PURE__ */ e(te, { title: "Get the code for this collection", children: /* @__PURE__ */ e(
3177
- ae,
3208
+ /* @__PURE__ */ e(ee, { title: "Get the code for this collection", children: /* @__PURE__ */ e(
3209
+ ie,
3178
3210
  {
3179
3211
  variant: "filled",
3180
3212
  disabled: q,
3181
- onClick: () => oe(!0),
3213
+ onClick: () => ae(!0),
3182
3214
  children: /* @__PURE__ */ e(Gr, {})
3183
3215
  }
3184
3216
  ) }),
3185
- de && /* @__PURE__ */ e(te, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
3186
- ae,
3217
+ se && /* @__PURE__ */ e(ee, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
3218
+ ie,
3187
3219
  {
3188
3220
  variant: "filled",
3189
3221
  disabled: q,
3190
- onClick: de,
3191
- children: q ? /* @__PURE__ */ e(Ge, { size: "small" }) : /* @__PURE__ */ e(ft, {})
3222
+ onClick: se,
3223
+ children: q ? /* @__PURE__ */ e(He, { size: "small" }) : /* @__PURE__ */ e(ht, {})
3192
3224
  }
3193
3225
  ) }),
3194
- /* @__PURE__ */ e(te, { title: "Add new property", children: /* @__PURE__ */ e(
3226
+ /* @__PURE__ */ e(ee, { title: "Add new property", children: /* @__PURE__ */ e(
3195
3227
  z,
3196
3228
  {
3197
3229
  variant: "outlined",
3198
3230
  onClick: () => Q(!0),
3199
- children: /* @__PURE__ */ e(ce, {})
3231
+ children: /* @__PURE__ */ e(de, {})
3200
3232
  }
3201
3233
  ) })
3202
3234
  ] })
3203
3235
  ] }),
3204
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
3205
- gt,
3236
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
3237
+ ft,
3206
3238
  {
3207
3239
  className: "pl-8",
3208
- inferredPropertyKeys: se,
3209
- selectedPropertyKey: N ? ne(N, D) : void 0,
3240
+ inferredPropertyKeys: le,
3241
+ selectedPropertyKey: N ? ne(N, B) : void 0,
3210
3242
  properties: f.properties,
3211
3243
  additionalFields: f.additionalFields,
3212
- propertiesOrder: ze,
3213
- onPropertyClick: yt,
3214
- onPropertyMove: Ke,
3244
+ propertiesOrder: Je,
3245
+ onPropertyClick: vt,
3246
+ onPropertyMove: Ye,
3215
3247
  onPropertyRemove: r ? ke : void 0,
3216
3248
  collectionEditable: s,
3217
3249
  errors: x
@@ -3225,7 +3257,7 @@ function Gi({
3225
3257
  variant: "outlined",
3226
3258
  size: "large",
3227
3259
  onClick: () => Q(!0),
3228
- startIcon: /* @__PURE__ */ e(ce, {}),
3260
+ startIcon: /* @__PURE__ */ e(de, {}),
3229
3261
  children: "Add new property"
3230
3262
  }
3231
3263
  )
@@ -3235,8 +3267,8 @@ function Gi({
3235
3267
  {
3236
3268
  className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
3237
3269
  children: [
3238
- S && h && !ie(h) && /* @__PURE__ */ e(
3239
- cr,
3270
+ S && h && !re(h) && /* @__PURE__ */ e(
3271
+ dr,
3240
3272
  {
3241
3273
  inArray: !1,
3242
3274
  existingProperty: !r,
@@ -3244,13 +3276,13 @@ function Gi({
3244
3276
  allowDataInference: !r,
3245
3277
  autoOpenTypeSelect: !1,
3246
3278
  propertyKey: N,
3247
- propertyNamespace: D,
3279
+ propertyNamespace: B,
3248
3280
  property: h,
3249
- onPropertyChanged: pe,
3281
+ onPropertyChanged: ue,
3250
3282
  onDelete: ke,
3251
3283
  onError: We,
3252
3284
  forceShowErrors: t,
3253
- initialErrors: Je,
3285
+ initialErrors: Ke,
3254
3286
  getData: u,
3255
3287
  propertyConfigs: p,
3256
3288
  collectionEditable: s
@@ -3258,25 +3290,25 @@ function Gi({
3258
3290
  `edit_view_${C}`
3259
3291
  ),
3260
3292
  !h && /* @__PURE__ */ a("div", { className: "w-full flex flex-col items-center justify-center h-full gap-4", children: [
3261
- /* @__PURE__ */ e(V, { variant: "label", className: "", children: Qe ? "Now you can add your first property" : "Select a property to edit it" }),
3293
+ /* @__PURE__ */ e(V, { variant: "label", className: "", children: Ze ? "Now you can add your first property" : "Select a property to edit it" }),
3262
3294
  /* @__PURE__ */ a(
3263
3295
  z,
3264
3296
  {
3265
3297
  variant: "outlined",
3266
3298
  onClick: () => Q(!0),
3267
3299
  children: [
3268
- /* @__PURE__ */ e(ce, {}),
3300
+ /* @__PURE__ */ e(de, {}),
3269
3301
  "Add new property"
3270
3302
  ]
3271
3303
  }
3272
3304
  )
3273
3305
  ] }),
3274
- h && ie(h) && /* @__PURE__ */ e(V, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
3306
+ h && re(h) && /* @__PURE__ */ e(V, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
3275
3307
  ]
3276
3308
  }
3277
3309
  ) }),
3278
3310
  w && /* @__PURE__ */ e(
3279
- Ve,
3311
+ Oe,
3280
3312
  {
3281
3313
  inArray: !1,
3282
3314
  open: C !== void 0,
@@ -3285,25 +3317,25 @@ function Gi({
3285
3317
  existingProperty: !0,
3286
3318
  autoOpenTypeSelect: !1,
3287
3319
  propertyKey: N,
3288
- propertyNamespace: D,
3320
+ propertyNamespace: B,
3289
3321
  property: h,
3290
- onPropertyChanged: pe,
3322
+ onPropertyChanged: ue,
3291
3323
  onDelete: ke,
3292
3324
  onError: We,
3293
3325
  forceShowErrors: t,
3294
- initialErrors: Je,
3326
+ initialErrors: Ke,
3295
3327
  getData: u,
3296
3328
  propertyConfigs: p,
3297
3329
  collectionEditable: s,
3298
- onOkClicked: w ? Ze : void 0
3330
+ onOkClicked: w ? Ge : void 0
3299
3331
  },
3300
3332
  `edit_view_${C}`
3301
3333
  )
3302
3334
  ] });
3303
3335
  return /* @__PURE__ */ a(R, { children: [
3304
- bt,
3336
+ yt,
3305
3337
  /* @__PURE__ */ e(
3306
- Ve,
3338
+ Oe,
3307
3339
  {
3308
3340
  inArray: !1,
3309
3341
  existingProperty: !1,
@@ -3312,7 +3344,7 @@ function Gi({
3312
3344
  forceShowErrors: t,
3313
3345
  open: H,
3314
3346
  onCancel: () => Q(!1),
3315
- onPropertyChanged: vt,
3347
+ onPropertyChanged: gt,
3316
3348
  getData: u,
3317
3349
  allowDataInference: !r,
3318
3350
  propertyConfigs: p,
@@ -3320,12 +3352,12 @@ function Gi({
3320
3352
  existingPropertyKeys: f.propertiesOrder
3321
3353
  }
3322
3354
  ),
3323
- /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e(
3324
- Yi,
3355
+ /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ e(
3356
+ Wi,
3325
3357
  {
3326
3358
  collection: f,
3327
- open: B,
3328
- onOpenChange: oe
3359
+ open: D,
3360
+ onOpenChange: ae
3329
3361
  }
3330
3362
  ) })
3331
3363
  ] });
@@ -3338,19 +3370,19 @@ function Ki({
3338
3370
  title: l
3339
3371
  }) {
3340
3372
  return /* @__PURE__ */ a(
3341
- Fe,
3373
+ _e,
3342
3374
  {
3343
3375
  open: t,
3344
3376
  onOpenChange: (o) => o ? n() : r(),
3345
3377
  "aria-labelledby": "alert-dialog-title",
3346
3378
  "aria-describedby": "alert-dialog-description",
3347
3379
  children: [
3348
- /* @__PURE__ */ a(De, { children: [
3380
+ /* @__PURE__ */ a(Ae, { children: [
3349
3381
  /* @__PURE__ */ e(V, { variant: "h6", children: l ?? "Unsaved changes" }),
3350
3382
  i && /* @__PURE__ */ e(V, { children: i }),
3351
3383
  /* @__PURE__ */ e(V, { children: "Are you sure?" })
3352
3384
  ] }),
3353
- /* @__PURE__ */ a(Be, { children: [
3385
+ /* @__PURE__ */ a(De, { children: [
3354
3386
  /* @__PURE__ */ e(z, { variant: "text", onClick: n, autoFocus: !0, children: " Cancel " }),
3355
3387
  /* @__PURE__ */ e(z, { onClick: r, children: " Ok " })
3356
3388
  ] })
@@ -3358,17 +3390,17 @@ function Ki({
3358
3390
  }
3359
3391
  );
3360
3392
  }
3361
- function Wi({ open: t, onClose: r }) {
3393
+ function Zi({ open: t, onClose: r }) {
3362
3394
  const {
3363
3395
  entityViews: n
3364
- } = Ae();
3396
+ } = Se();
3365
3397
  return /* @__PURE__ */ a(
3366
- Fe,
3398
+ _e,
3367
3399
  {
3368
3400
  maxWidth: "md",
3369
3401
  open: t,
3370
3402
  children: [
3371
- /* @__PURE__ */ a(De, { className: "flex flex-col gap-4", children: [
3403
+ /* @__PURE__ */ a(Ae, { className: "flex flex-col gap-4", children: [
3372
3404
  /* @__PURE__ */ e(V, { variant: "h6", children: "Select view" }),
3373
3405
  n?.map((i) => /* @__PURE__ */ a(
3374
3406
  z,
@@ -3387,12 +3419,12 @@ function Wi({ open: t, onClose: r }) {
3387
3419
  )),
3388
3420
  (n ?? []).length === 0 && /* @__PURE__ */ e(V, { variant: "body2", children: "No custom views defined" })
3389
3421
  ] }),
3390
- /* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(z, { variant: "outlined", onClick: () => r(), children: "Cancel" }) })
3422
+ /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(z, { variant: "outlined", onClick: () => r(), children: "Cancel" }) })
3391
3423
  ]
3392
3424
  }
3393
3425
  );
3394
3426
  }
3395
- function Zi({
3427
+ function Ji({
3396
3428
  collection: t,
3397
3429
  parentCollection: r,
3398
3430
  configController: n,
@@ -3400,20 +3432,20 @@ function Zi({
3400
3432
  getUser: l,
3401
3433
  parentCollectionIds: o
3402
3434
  }) {
3403
- const { entityViews: d } = Ae(), [c, u] = Y.useState(), [m, p] = Y.useState(!1), [s, f] = Y.useState(), [g, P] = Y.useState(), {
3435
+ const { entityViews: d } = Se(), [c, u] = G.useState(), [m, p] = G.useState(!1), [s, f] = G.useState(), [g, P] = G.useState(), {
3404
3436
  values: y,
3405
3437
  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;
3438
+ } = Y(), v = t.subcollections ?? [], b = y.entityViews?.filter((C) => typeof C == "string").map((C) => wr(C, d)).filter(Boolean) ?? [], T = t.entityViews?.filter((C) => typeof C != "string") ?? [], w = b.length + T.length;
3407
3439
  return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
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: [
3440
+ /* @__PURE__ */ e(mt, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-16", children: [
3409
3441
  /* @__PURE__ */ a("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
3410
3442
  /* @__PURE__ */ a(V, { variant: "h5", children: [
3411
3443
  "Subcollections of ",
3412
3444
  y.name
3413
3445
  ] }),
3414
3446
  /* @__PURE__ */ a(ge, { className: "flex flex-col gap-4 p-2 w-full", children: [
3415
- v && v.length > 0 && /* @__PURE__ */ e(Bt, { children: /* @__PURE__ */ e(Mt, { children: v.map((C) => /* @__PURE__ */ a(
3416
- Ct,
3447
+ v && v.length > 0 && /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ e(Bt, { children: v.map((C) => /* @__PURE__ */ a(
3448
+ bt,
3417
3449
  {
3418
3450
  onClick: () => P({
3419
3451
  isNewCollection: !1,
@@ -3421,25 +3453,25 @@ function Zi({
3421
3453
  }),
3422
3454
  children: [
3423
3455
  /* @__PURE__ */ e(
3424
- Re,
3456
+ Me,
3425
3457
  {
3426
3458
  align: "left",
3427
3459
  children: /* @__PURE__ */ e(V, { variant: "subtitle2", className: "flex-grow", children: C.name })
3428
3460
  }
3429
3461
  ),
3430
3462
  /* @__PURE__ */ e(
3431
- Re,
3463
+ Me,
3432
3464
  {
3433
3465
  align: "right",
3434
- children: /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
3435
- ae,
3466
+ children: /* @__PURE__ */ e(ee, { title: "Remove", children: /* @__PURE__ */ e(
3467
+ ie,
3436
3468
  {
3437
3469
  size: "small",
3438
3470
  onClick: (O) => {
3439
3471
  O.preventDefault(), O.stopPropagation(), u(C.id);
3440
3472
  },
3441
3473
  color: "inherit",
3442
- children: /* @__PURE__ */ e(mt, { size: "small" })
3474
+ children: /* @__PURE__ */ e(pt, { size: "small" })
3443
3475
  }
3444
3476
  ) })
3445
3477
  }
@@ -3457,7 +3489,7 @@ function Zi({
3457
3489
  });
3458
3490
  },
3459
3491
  variant: "text",
3460
- startIcon: /* @__PURE__ */ e(ce, {}),
3492
+ startIcon: /* @__PURE__ */ e(de, {}),
3461
3493
  children: "Add subcollection"
3462
3494
  }
3463
3495
  )
@@ -3478,35 +3510,35 @@ function Zi({
3478
3510
  }
3479
3511
  ), children: "Define your own custom views by uploading them with the CLI." }),
3480
3512
  /* @__PURE__ */ e(R, { children: /* @__PURE__ */ a(ge, { className: "flex flex-col gap-4 p-2 w-full", children: [
3481
- /* @__PURE__ */ e(Bt, { children: /* @__PURE__ */ a(Mt, { children: [
3482
- b.map((C) => /* @__PURE__ */ a(Ct, { children: [
3513
+ /* @__PURE__ */ e(Dt, { children: /* @__PURE__ */ a(Bt, { children: [
3514
+ b.map((C) => /* @__PURE__ */ a(bt, { children: [
3483
3515
  /* @__PURE__ */ e(
3484
- Re,
3516
+ Me,
3485
3517
  {
3486
3518
  align: "left",
3487
3519
  children: /* @__PURE__ */ e(V, { variant: "subtitle2", className: "flex-grow", children: C.name })
3488
3520
  }
3489
3521
  ),
3490
3522
  /* @__PURE__ */ e(
3491
- Re,
3523
+ Me,
3492
3524
  {
3493
3525
  align: "right",
3494
- children: /* @__PURE__ */ e(te, { title: "Remove", children: /* @__PURE__ */ e(
3495
- ae,
3526
+ children: /* @__PURE__ */ e(ee, { title: "Remove", children: /* @__PURE__ */ e(
3527
+ ie,
3496
3528
  {
3497
3529
  size: "small",
3498
3530
  onClick: (O) => {
3499
3531
  O.preventDefault(), O.stopPropagation(), f(C.key);
3500
3532
  },
3501
3533
  color: "inherit",
3502
- children: /* @__PURE__ */ e(mt, { size: "small" })
3534
+ children: /* @__PURE__ */ e(pt, { size: "small" })
3503
3535
  }
3504
3536
  ) })
3505
3537
  }
3506
3538
  )
3507
3539
  ] }, C.key)),
3508
- T.map((C) => /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ a(
3509
- Re,
3540
+ T.map((C) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ a(
3541
+ Me,
3510
3542
  {
3511
3543
  align: "left",
3512
3544
  children: [
@@ -3526,7 +3558,7 @@ function Zi({
3526
3558
  p(!0);
3527
3559
  },
3528
3560
  variant: "text",
3529
- startIcon: /* @__PURE__ */ e(ce, {}),
3561
+ startIcon: /* @__PURE__ */ e(de, {}),
3530
3562
  children: "Add custom entity view"
3531
3563
  }
3532
3564
  )
@@ -3535,7 +3567,7 @@ function Zi({
3535
3567
  ] }) }),
3536
3568
  /* @__PURE__ */ e("div", { style: { height: "52px" } }),
3537
3569
  c && /* @__PURE__ */ e(
3538
- ct,
3570
+ dt,
3539
3571
  {
3540
3572
  open: !!c,
3541
3573
  onAccept: () => {
@@ -3555,7 +3587,7 @@ function Zi({
3555
3587
  }
3556
3588
  ),
3557
3589
  s && /* @__PURE__ */ e(
3558
- ct,
3590
+ dt,
3559
3591
  {
3560
3592
  open: !!s,
3561
3593
  onAccept: () => {
@@ -3571,7 +3603,7 @@ function Zi({
3571
3603
  }
3572
3604
  ),
3573
3605
  /* @__PURE__ */ e(
3574
- mr,
3606
+ pr,
3575
3607
  {
3576
3608
  open: !!g,
3577
3609
  configController: n,
@@ -3587,7 +3619,7 @@ function Zi({
3587
3619
  }
3588
3620
  ),
3589
3621
  /* @__PURE__ */ e(
3590
- Wi,
3622
+ Zi,
3591
3623
  {
3592
3624
  open: m,
3593
3625
  onClose: (C) => {
@@ -3597,14 +3629,14 @@ function Zi({
3597
3629
  )
3598
3630
  ] });
3599
3631
  }
3600
- const Lt = {
3632
+ const qt = {
3601
3633
  id: "products",
3602
3634
  path: "products",
3603
3635
  name: "Products",
3604
3636
  singularName: "Product",
3605
3637
  icon: "shopping_cart",
3606
3638
  description: "List of the products currently sold in your shop",
3607
- properties: He({
3639
+ properties: Le({
3608
3640
  name: {
3609
3641
  dataType: "string",
3610
3642
  name: "Name",
@@ -3682,7 +3714,7 @@ const Lt = {
3682
3714
  autoValue: "on_create"
3683
3715
  }
3684
3716
  })
3685
- }, $t = {
3717
+ }, Lt = {
3686
3718
  id: "blog",
3687
3719
  path: "blog",
3688
3720
  name: "Blog",
@@ -3690,7 +3722,7 @@ const Lt = {
3690
3722
  icon: "article",
3691
3723
  description: "A collection of blog entries",
3692
3724
  defaultSize: "l",
3693
- properties: He({
3725
+ properties: Le({
3694
3726
  name: {
3695
3727
  name: "Name",
3696
3728
  validation: { required: !0 },
@@ -3794,14 +3826,14 @@ const Lt = {
3794
3826
  initialFilter: {
3795
3827
  status: ["==", "published"]
3796
3828
  }
3797
- }, Ht = {
3829
+ }, $t = {
3798
3830
  id: "users",
3799
3831
  path: "users",
3800
3832
  name: "Users",
3801
3833
  singularName: "User",
3802
3834
  description: "Registered users in the app/web",
3803
3835
  icon: "person",
3804
- properties: He({
3836
+ properties: Le({
3805
3837
  displayName: {
3806
3838
  name: "Display name",
3807
3839
  dataType: "string"
@@ -3833,7 +3865,7 @@ const Lt = {
3833
3865
  url: "image"
3834
3866
  }
3835
3867
  })
3836
- }, Yt = {
3868
+ }, Ht = {
3837
3869
  id: "pages",
3838
3870
  path: "pages",
3839
3871
  name: "Pages",
@@ -4019,7 +4051,7 @@ const Lt = {
4019
4051
  }
4020
4052
  }
4021
4053
  };
4022
- function Ji({
4054
+ function Qi({
4023
4055
  path: t,
4024
4056
  pathSuggestions: r,
4025
4057
  parentCollection: n,
@@ -4027,7 +4059,7 @@ function Ji({
4027
4059
  existingCollectionPaths: l
4028
4060
  }) {
4029
4061
  const [o, d] = j(!1), [c, u] = j();
4030
- ue(() => {
4062
+ ce(() => {
4031
4063
  r && l && (d(!0), r(t).then((g) => {
4032
4064
  const P = g.filter((y) => !(l ?? []).find((x) => x.trim().toLowerCase() === y.trim().toLowerCase()));
4033
4065
  u(P);
@@ -4038,8 +4070,8 @@ function Ji({
4038
4070
  setFieldValue: p,
4039
4071
  setValues: s,
4040
4072
  submitCount: f
4041
- } = G();
4042
- 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: [
4073
+ } = Y();
4074
+ return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ a(mt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
4043
4075
  /* @__PURE__ */ e(
4044
4076
  "div",
4045
4077
  {
@@ -4047,7 +4079,7 @@ function Ji({
4047
4079
  children: /* @__PURE__ */ e(V, { variant: "h4", className: "flex-grow", children: "New collection" })
4048
4080
  }
4049
4081
  ),
4050
- n && /* @__PURE__ */ e(Pt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
4082
+ n && /* @__PURE__ */ e(xt, { colorScheme: "tealDarker", children: /* @__PURE__ */ a(V, { variant: "caption", children: [
4051
4083
  "This is a subcollection of ",
4052
4084
  /* @__PURE__ */ e("b", { children: n.name })
4053
4085
  ] }) }),
@@ -4061,13 +4093,13 @@ function Ji({
4061
4093
  }
4062
4094
  ),
4063
4095
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
4064
- o && !c && /* @__PURE__ */ e(Ge, { size: "small" }),
4096
+ o && !c && /* @__PURE__ */ e(He, { size: "small" }),
4065
4097
  c?.map((g, P) => /* @__PURE__ */ e(
4066
- Pt,
4098
+ xt,
4067
4099
  {
4068
4100
  colorScheme: "cyanLighter",
4069
4101
  onClick: () => {
4070
- p("name", wt(g)), p("id", g), p("path", g), p("properties", void 0), i();
4102
+ p("name", Pt(g)), p("id", g), p("path", g), p("properties", void 0), i();
4071
4103
  },
4072
4104
  size: "small",
4073
4105
  children: g
@@ -4088,46 +4120,46 @@ function Ji({
4088
4120
  ),
4089
4121
  /* @__PURE__ */ a("div", { className: "flex gap-4", children: [
4090
4122
  /* @__PURE__ */ e(
4091
- lt,
4123
+ ot,
4092
4124
  {
4093
4125
  title: "Products",
4094
4126
  subtitle: "A collection of products with images, prices and stock",
4095
- icon: /* @__PURE__ */ e(it, { size: "small", iconKey: Lt.icon }),
4127
+ icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: qt.icon }),
4096
4128
  onClick: () => {
4097
- s(Lt), i();
4129
+ s(qt), i();
4098
4130
  }
4099
4131
  }
4100
4132
  ),
4101
4133
  /* @__PURE__ */ e(
4102
- lt,
4134
+ ot,
4103
4135
  {
4104
4136
  title: "Users",
4105
4137
  subtitle: "A collection of users with emails, names and roles",
4106
- icon: /* @__PURE__ */ e(it, { size: "small", iconKey: Ht.icon }),
4138
+ icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: $t.icon }),
4107
4139
  onClick: () => {
4108
- s(Ht), i();
4140
+ s($t), i();
4109
4141
  }
4110
4142
  }
4111
4143
  ),
4112
4144
  /* @__PURE__ */ e(
4113
- lt,
4145
+ ot,
4114
4146
  {
4115
4147
  title: "Blog posts",
4116
4148
  subtitle: "A collection of blog posts with images, authors and complex content",
4117
- icon: /* @__PURE__ */ e(it, { size: "small", iconKey: $t.icon }),
4149
+ icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Lt.icon }),
4118
4150
  onClick: () => {
4119
- s($t), i();
4151
+ s(Lt), i();
4120
4152
  }
4121
4153
  }
4122
4154
  ),
4123
4155
  /* @__PURE__ */ e(
4124
- lt,
4156
+ ot,
4125
4157
  {
4126
4158
  title: "Pages",
4127
4159
  subtitle: "A collection of pages with images, authors and complex content",
4128
- icon: /* @__PURE__ */ e(it, { size: "small", iconKey: Yt.icon }),
4160
+ icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Ht.icon }),
4129
4161
  onClick: () => {
4130
- s(Yt), i();
4162
+ s(Ht), i();
4131
4163
  }
4132
4164
  }
4133
4165
  )
@@ -4143,19 +4175,19 @@ function Ji({
4143
4175
  children: "● Create a collection from a file (csv, json, xls, xslx...)"
4144
4176
  }
4145
4177
  ),
4146
- /* @__PURE__ */ e(ui, { onDataAdded: (g, P) => i(g, P) })
4178
+ /* @__PURE__ */ e(pi, { onDataAdded: (g, P) => i(g, P) })
4147
4179
  ] }),
4148
4180
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(z, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
4149
4181
  ] }) });
4150
4182
  }
4151
- function lt({
4183
+ function ot({
4152
4184
  title: t,
4153
4185
  subtitle: r,
4154
4186
  icon: n,
4155
4187
  onClick: i
4156
4188
  }) {
4157
- return /* @__PURE__ */ e(te, { title: r, children: /* @__PURE__ */ a(
4158
- rr,
4189
+ return /* @__PURE__ */ e(ee, { title: r, children: /* @__PURE__ */ a(
4190
+ tr,
4159
4191
  {
4160
4192
  onClick: i,
4161
4193
  className: fe(
@@ -4171,7 +4203,7 @@ function lt({
4171
4203
  }
4172
4204
  ) });
4173
4205
  }
4174
- function Qi({
4206
+ function Xi({
4175
4207
  importConfig: t,
4176
4208
  propertyConfigs: r,
4177
4209
  collectionEditable: n
@@ -4180,23 +4212,23 @@ function Qi({
4180
4212
  setFieldValue: i,
4181
4213
  setFieldTouched: l,
4182
4214
  values: o
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 = ({
4215
+ } = Y(), [d, c] = j(void 0), u = G.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), m = d ? d.id : void 0, p = d || void 0, s = ({
4184
4216
  id: g,
4185
4217
  property: P,
4186
4218
  previousId: y,
4187
4219
  namespace: x
4188
4220
  }) => {
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) => {
4190
- const N = Ce(O);
4221
+ const v = g ? ne(g, x) : void 0, b = v ? me(v) : void 0, T = (C) => C ? u.current[C] ?? I(o, he(C)) : u.current[""], w = (C, O) => {
4222
+ const N = he(O);
4191
4223
  i(N, C, !1), u.current[O ?? ""] = C;
4192
4224
  };
4193
4225
  if (y && y !== g) {
4194
- const C = ne(y, x), O = he(C), F = T(x).map((_) => _ === y ? g : _).filter((_) => _ !== void 0);
4195
- w(F, x);
4196
- const D = { ...t.headersMapping };
4197
- Object.keys(D).forEach((_) => {
4198
- D[_] === y && (D[_] = g ?? "");
4199
- }), t.setHeadersMapping(D), i(O, void 0, !1), l(O, !1, !1);
4226
+ const C = ne(y, x), O = me(C), E = T(x).map((_) => _ === y ? g : _).filter((_) => _ !== void 0);
4227
+ w(E, x);
4228
+ const B = { ...t.headersMapping };
4229
+ Object.keys(B).forEach((_) => {
4230
+ B[_] === y && (B[_] = g ?? "");
4231
+ }), t.setHeadersMapping(B), i(O, void 0, !1), l(O, !1, !1);
4200
4232
  }
4201
4233
  b && (i(b, P, !1), l(b, !0, !1));
4202
4234
  }, f = async ({
@@ -4205,17 +4237,17 @@ function Qi({
4205
4237
  property: y,
4206
4238
  namespace: x
4207
4239
  }) => {
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),
4240
+ const v = g ? ne(g, x) : void 0, b = v ? me(v) : void 0, T = t.importData.map((C) => I(C, P)), w = {
4241
+ ...ni(T, y, rr),
4210
4242
  editable: !0
4211
4243
  };
4212
4244
  b && (w ? i(b, w, !1) : i(b, y, !1), l(b, !0, !1));
4213
4245
  };
4214
4246
  return /* @__PURE__ */ a("div", { className: "overflow-auto my-auto", children: [
4215
- /* @__PURE__ */ a(ht, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
4247
+ /* @__PURE__ */ a(mt, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
4216
4248
  /* @__PURE__ */ e(V, { variant: "h6", className: "my-4 ml-3.5", children: "Data property mapping" }),
4217
4249
  /* @__PURE__ */ e(
4218
- pi,
4250
+ mi,
4219
4251
  {
4220
4252
  importConfig: t,
4221
4253
  destinationProperties: o.properties,
@@ -4225,7 +4257,7 @@ function Qi({
4225
4257
  importKey: y,
4226
4258
  isIdColumn: x
4227
4259
  }) => x ? /* @__PURE__ */ e(V, { children: " This column will be used as ID" }) : /* @__PURE__ */ e(
4228
- mi,
4260
+ hi,
4229
4261
  {
4230
4262
  property: g,
4231
4263
  propertyKey: P,
@@ -4238,7 +4270,7 @@ function Qi({
4238
4270
  });
4239
4271
  },
4240
4272
  propertyTypeView: /* @__PURE__ */ e(
4241
- Xi,
4273
+ en,
4242
4274
  {
4243
4275
  property: g,
4244
4276
  disabled: !1,
@@ -4256,7 +4288,7 @@ function Qi({
4256
4288
  )
4257
4289
  ] }),
4258
4290
  /* @__PURE__ */ e(
4259
- Ve,
4291
+ Oe,
4260
4292
  {
4261
4293
  open: d !== void 0,
4262
4294
  propertyKey: m,
@@ -4280,21 +4312,21 @@ function Qi({
4280
4312
  /* @__PURE__ */ e("div", { style: { height: "52px" } })
4281
4313
  ] });
4282
4314
  }
4283
- function Xi({
4315
+ function en({
4284
4316
  property: t,
4285
4317
  onPropertyChanged: r,
4286
4318
  propertyKey: n,
4287
4319
  propertyConfigs: i,
4288
4320
  disabled: l
4289
4321
  }) {
4290
- const o = t ? Wt(t) : null, d = t ? Le(t, i) : null, [c, u] = j(!1);
4322
+ const o = t ? Gt(t) : null, d = t ? je(t, i) : null, [c, u] = j(!1);
4291
4323
  return /* @__PURE__ */ e(
4292
- te,
4324
+ ee,
4293
4325
  {
4294
4326
  title: t && d ? `${d?.name} - ${t.dataType}` : void 0,
4295
4327
  open: c ? !1 : void 0,
4296
4328
  children: /* @__PURE__ */ e(
4297
- Ne,
4329
+ be,
4298
4330
  {
4299
4331
  open: c,
4300
4332
  onOpenChange: u,
@@ -4305,9 +4337,9 @@ function Xi({
4305
4337
  value: o ?? "",
4306
4338
  placeholder: "Select a property widget",
4307
4339
  position: "item-aligned",
4308
- renderValue: (m) => d ? /* @__PURE__ */ e($e, { propertyConfig: d }) : null,
4340
+ renderValue: (m) => d ? /* @__PURE__ */ e(qe, { propertyConfig: d }) : null,
4309
4341
  onValueChange: (m) => {
4310
- const p = lr(t, m, i);
4342
+ const p = or(t, m, i);
4311
4343
  n && r({
4312
4344
  id: n,
4313
4345
  property: p,
@@ -4315,8 +4347,8 @@ function Xi({
4315
4347
  namespace: void 0
4316
4348
  });
4317
4349
  },
4318
- children: Object.entries(dr).map(([m, p]) => /* @__PURE__ */ e(
4319
- sr,
4350
+ children: Object.entries(sr).map(([m, p]) => /* @__PURE__ */ e(
4351
+ lr,
4320
4352
  {
4321
4353
  value: m,
4322
4354
  optionDisabled: !1,
@@ -4330,22 +4362,22 @@ function Xi({
4330
4362
  }
4331
4363
  );
4332
4364
  }
4333
- function en({
4365
+ function tn({
4334
4366
  importConfig: t,
4335
4367
  properties: r,
4336
4368
  propertiesOrder: n
4337
4369
  }) {
4338
4370
  const [i, l] = j(!1);
4339
4371
  async function o() {
4340
- const c = t.importData.map((u) => hi(u, t.idColumn, t.headersMapping, r, "TEMP_PATH", t.defaultValues));
4372
+ const c = t.importData.map((u) => fi(u, t.idColumn, t.headersMapping, r, "TEMP_PATH", t.defaultValues));
4341
4373
  t.setEntities(c);
4342
4374
  }
4343
- ue(() => {
4375
+ ce(() => {
4344
4376
  o().finally(() => l(!1));
4345
4377
  }, []);
4346
- const d = kr();
4347
- return i ? /* @__PURE__ */ e(ut, {}) : /* @__PURE__ */ e(
4348
- Or,
4378
+ const d = Tr();
4379
+ return i ? /* @__PURE__ */ e(ct, {}) : /* @__PURE__ */ e(
4380
+ kr,
4349
4381
  {
4350
4382
  title: /* @__PURE__ */ a("div", { children: [
4351
4383
  /* @__PURE__ */ e(V, { variant: "subtitle2", children: "Imported data preview" }),
@@ -4364,15 +4396,16 @@ function en({
4364
4396
  key: c,
4365
4397
  disabled: !1
4366
4398
  })),
4367
- properties: r
4399
+ properties: r,
4400
+ enablePopupIcon: !1
4368
4401
  }
4369
4402
  );
4370
4403
  }
4371
- function pr(t, r = "") {
4404
+ function ur(t, r = "") {
4372
4405
  const n = Object.keys(t).reduce((o, d) => {
4373
- const c = t[d], u = Vr(d), m = r ? `${r}.${u}` : u;
4406
+ const c = t[d], u = Or(d), m = r ? `${r}.${u}` : u;
4374
4407
  if (c.dataType === "map" && c.properties) {
4375
- const f = pr(c.properties, m);
4408
+ const f = ur(c.properties, m);
4376
4409
  return {
4377
4410
  headersMapping: { ...o.headersMapping, [d]: m },
4378
4411
  properties: {
@@ -4400,14 +4433,14 @@ function pr(t, r = "") {
4400
4433
  idColumn: l
4401
4434
  };
4402
4435
  }
4403
- function mr(t) {
4404
- const r = t.open, [n, i] = Ue.useState(!1), [l, o] = Ue.useState(!1), d = J(() => {
4436
+ function pr(t) {
4437
+ const r = t.open, [n, i] = ze.useState(!1), [l, o] = ze.useState(!1), d = () => {
4405
4438
  n ? o(!0) : t.handleClose(void 0);
4406
- }, [n, t.handleClose]);
4407
- return ue(() => {
4439
+ };
4440
+ return ce(() => {
4408
4441
  r || (i(!1), o(!1));
4409
4442
  }, [r]), /* @__PURE__ */ a(
4410
- Fe,
4443
+ _e,
4411
4444
  {
4412
4445
  open: r,
4413
4446
  fullWidth: !0,
@@ -4417,7 +4450,7 @@ function mr(t) {
4417
4450
  onOpenChange: (c) => c ? void 0 : d(),
4418
4451
  children: [
4419
4452
  r && /* @__PURE__ */ e(
4420
- tn,
4453
+ rn,
4421
4454
  {
4422
4455
  ...t,
4423
4456
  handleCancel: d,
@@ -4437,36 +4470,36 @@ function mr(t) {
4437
4470
  }
4438
4471
  );
4439
4472
  }
4440
- function tn(t) {
4441
- const { propertyConfigs: r } = Ae(), n = Te(), i = _e(), {
4473
+ function rn(t) {
4474
+ const { propertyConfigs: r } = Se(), n = Te(), i = Ie(), {
4442
4475
  topLevelNavigation: l,
4443
4476
  collections: o
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);
4445
- if (ue(() => {
4477
+ } = 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] = ze.useState(), [g, P] = ze.useState(!1);
4478
+ if (ce(() => {
4446
4479
  try {
4447
4480
  n.initialised && (t.editedCollectionId ? f(n.getCollectionFromPaths([...t.parentCollectionIds ?? [], t.editedCollectionId])) : f(void 0), P(!0));
4448
4481
  } catch (b) {
4449
4482
  console.error(b);
4450
4483
  }
4451
- }, [t.editedCollectionId, t.parentCollectionIds, n]), !l)
4484
+ }, [t.editedCollectionId, t.parentCollectionIds, n.initialised, n.getCollectionFromPaths]), !l)
4452
4485
  throw Error("Internal: Navigation not ready in collection editor");
4453
4486
  const {
4454
4487
  groups: y
4455
4488
  } = l, x = s ? {
4456
4489
  ...s,
4457
- id: s.id ?? s.path ?? Ft(16)
4458
- } : void 0, v = x ? nn(x, r) : {
4459
- id: d?.path ?? Ft(16),
4490
+ id: s.id ?? s.path ?? _t(16)
4491
+ } : void 0, v = x ? an(x, r) : {
4492
+ id: d?.path ?? _t(16),
4460
4493
  path: d?.path ?? "",
4461
4494
  name: d?.name ?? "",
4462
4495
  group: d?.group ?? "",
4463
4496
  properties: {},
4464
4497
  propertiesOrder: [],
4465
- icon: zt[Math.floor(Math.random() * zt.length)],
4498
+ icon: Mt[Math.floor(Math.random() * Mt.length)],
4466
4499
  ownerId: i.user?.uid ?? ""
4467
4500
  };
4468
- return g ? !t.isNewCollection && (!n.initialised || !g) ? /* @__PURE__ */ e(ut, {}) : /* @__PURE__ */ e(
4469
- rn,
4501
+ return g ? !t.isNewCollection && (!n.initialised || !g) ? /* @__PURE__ */ e(ct, {}) : /* @__PURE__ */ e(
4502
+ nn,
4470
4503
  {
4471
4504
  ...t,
4472
4505
  initialValues: v,
@@ -4478,9 +4511,9 @@ function tn(t) {
4478
4511
  groups: y,
4479
4512
  propertyConfigs: r
4480
4513
  }
4481
- ) : /* @__PURE__ */ e(ut, {});
4514
+ ) : /* @__PURE__ */ e(ct, {});
4482
4515
  }
4483
- function rn({
4516
+ function nn({
4484
4517
  isNewCollection: t,
4485
4518
  configController: r,
4486
4519
  editedCollectionId: n,
@@ -4505,56 +4538,56 @@ function rn({
4505
4538
  propertyConfigs: C,
4506
4539
  groups: O
4507
4540
  }) {
4508
- const N = fi(), F = Te(), D = Ie(), _ = je({}), S = t ? v ? "welcome" : "details" : "properties", [h, B] = j(S), [oe, q] = Ue.useState(), Z = (k) => {
4509
- const E = k.id || k.path;
4541
+ const N = gi(), E = Te(), B = Ve(), _ = Re({}), S = t ? v ? "welcome" : "details" : "properties", [h, D] = j(S), [ae, q] = ze.useState(), Z = (k) => {
4542
+ const F = k.id || k.path;
4510
4543
  return r.saveCollection({
4511
- id: E,
4544
+ id: F,
4512
4545
  collectionData: k,
4513
4546
  previousId: n,
4514
4547
  parentCollectionIds: i
4515
- }).then(() => (q(void 0), !0)).catch((M) => (q(M), console.error(M), D.open({
4548
+ }).then(() => (q(void 0), !0)).catch((M) => (q(M), console.error(M), B.open({
4516
4549
  type: "error",
4517
4550
  message: "Error persisting collection: " + (M.message ?? "Details in the console")
4518
4551
  }), !1));
4519
- }, H = J(() => {
4520
- h === "details" ? N.inUse ? B("import_data_saving") : B(u ? "extra_view" : "properties") : B(h === "welcome" ? "details" : h === "import_data_mapping" ? "import_data_preview" : h === "import_data_preview" ? "details" : h === "extra_view" ? "properties" : "details");
4521
- }, [h, N.inUse, u]), Q = J((k) => {
4552
+ }, H = () => {
4553
+ h === "details" ? N.inUse ? D("import_data_saving") : D(u ? "extra_view" : "properties") : D(h === "welcome" ? "details" : h === "import_data_mapping" ? "import_data_preview" : h === "import_data_preview" ? "details" : h === "extra_view" ? "properties" : "details");
4554
+ }, Q = (k) => {
4522
4555
  if (o)
4523
4556
  return o?.(k.path, k.collectionGroup ?? !1, i ?? []);
4524
- }, [o, i]), se = J(async (k) => {
4557
+ }, le = async (k) => {
4525
4558
  try {
4526
4559
  if (!Q)
4527
4560
  return T(k), Promise.resolve(k);
4528
- B("loading");
4529
- const E = await Q?.(k);
4530
- if (!E)
4561
+ D("loading");
4562
+ const F = await Q?.(k);
4563
+ if (!F)
4531
4564
  return T(k), Promise.resolve(k);
4532
4565
  const M = {
4533
4566
  ...k ?? {}
4534
4567
  };
4535
- return Object.keys(E.properties ?? {}).length > 0 && (M.properties = E.properties, M.propertiesOrder = E.propertiesOrder), M.propertiesOrder ? (T(M), console.debug("Inferred collection", {
4568
+ return Object.keys(F.properties ?? {}).length > 0 && (M.properties = F.properties, M.propertiesOrder = F.propertiesOrder), M.propertiesOrder ? (T(M), console.debug("Inferred collection", {
4536
4569
  newCollection: k ?? {},
4537
4570
  values: M
4538
4571
  }), M) : (M.propertiesOrder = Object.keys(M.properties), M);
4539
- } catch (E) {
4540
- return console.error(E), D.open({
4572
+ } catch (F) {
4573
+ return console.error(F), B.open({
4541
4574
  type: "error",
4542
- message: "Error inferring collection: " + (E.message ?? "Details in the console")
4575
+ message: "Error inferring collection: " + (F.message ?? "Details in the console")
4543
4576
  }), k;
4544
4577
  }
4545
- }, [i, Q]), de = Ot({
4578
+ }, se = kt({
4546
4579
  initialValues: w,
4547
- onSubmit: (k, E) => {
4548
- console.log("Submitting collection", k);
4580
+ onSubmit: (k, F) => {
4581
+ console.debug("Submitting collection", k);
4549
4582
  try {
4550
4583
  if (!t) {
4551
4584
  Z(k).then(() => {
4552
- E.resetForm({ values: w }), d(k);
4585
+ F.resetForm({ values: w }), d(k);
4553
4586
  });
4554
4587
  return;
4555
4588
  }
4556
- h === "welcome" ? (H(), E.resetForm({ values: k })) : h === "details" ? u || N.inUse ? (E.resetForm({ values: k }), H()) : t ? se(k).then((M) => {
4557
- E.resetForm({
4589
+ h === "welcome" ? (H(), F.resetForm({ values: k })) : h === "details" ? u || N.inUse ? (F.resetForm({ values: k }), H()) : t ? le(k).then((M) => {
4590
+ F.resetForm({
4558
4591
  values: M ?? k,
4559
4592
  touched: {
4560
4593
  path: !0,
@@ -4563,70 +4596,70 @@ function rn({
4563
4596
  });
4564
4597
  }).finally(() => {
4565
4598
  H();
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(() => {
4567
- E.resetForm({ values: w }), H(), d(k);
4568
- }) : (H(), E.resetForm({ values: k }));
4599
+ }) : (F.resetForm({ values: k }), H()) : h === "extra_view" ? (H(), F.resetForm({ values: k })) : h === "import_data_mapping" || h === "import_data_preview" ? H() : h === "properties" ? Z(k).then(() => {
4600
+ F.resetForm({ values: w }), H(), d(k);
4601
+ }) : (H(), F.resetForm({ values: k }));
4569
4602
  } catch (M) {
4570
- D.open({
4603
+ B.open({
4571
4604
  type: "error",
4572
4605
  message: "Error persisting collection: " + (M.message ?? "Details in the console")
4573
- }), console.error(M), E.resetForm({ values: k });
4606
+ }), console.error(M), F.resetForm({ values: k });
4574
4607
  }
4575
4608
  },
4576
4609
  validation: (k) => {
4577
- let E = {};
4578
- const M = (h === "properties" || h === "subcollections" || h === "details") && yi;
4610
+ let F = {};
4611
+ const M = (h === "properties" || h === "subcollections" || h === "details") && bi;
4579
4612
  if (M)
4580
4613
  try {
4581
4614
  M.validateSync(k, { abortEarly: !1 });
4582
4615
  } catch (L) {
4583
- L.inner.forEach((ye) => {
4584
- E[ye.path] = ye.message;
4616
+ L.inner.forEach((ve) => {
4617
+ F[ve.path] = ve.message;
4585
4618
  });
4586
4619
  }
4587
- if (h === "properties" && (E = { ...E, ..._.current }), h === "details") {
4588
- const L = Gt(k.path, t, y, k.id);
4589
- L && (E.path = L);
4590
- const ye = an(k.id, t, y, x);
4591
- ye && (E.id = ye);
4620
+ if (h === "properties" && (F = { ...F, ..._.current }), h === "details") {
4621
+ const L = Yt(k.path, t, y, k.id);
4622
+ L && (F.path = L);
4623
+ const ve = on(k.id, t, y, x);
4624
+ ve && (F.id = ve);
4592
4625
  }
4593
- return E;
4626
+ return F;
4594
4627
  }
4595
4628
  }), {
4596
- values: re,
4597
- setFieldValue: ve,
4629
+ values: te,
4630
+ setFieldValue: Pe,
4598
4631
  isSubmitting: ke,
4599
- dirty: Ke,
4600
- submitCount: vt
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;
4602
- ue(() => {
4603
- p(Ke);
4604
- }, [Ke]);
4605
- function Xe(k, E) {
4606
- N.setInUse(!0), ni(k, ir).then((M) => {
4607
- const L = pr(M);
4632
+ dirty: Ye,
4633
+ submitCount: gt
4634
+ } = se, ue = te.path, We = l?.includes("/") ? l?.split("/").slice(0, -1).join("/") + "/" + ue : ue, Ge = Yt(ue, t, y, te.id), Ke = !Ge && i ? E.convertIdsToPaths(i) : void 0, Ze = Ge ? void 0 : E.resolveAliasesFrom(We), Je = Ze && P ? () => P(Ze, Ke ?? []) : void 0;
4635
+ ce(() => {
4636
+ p(Ye);
4637
+ }, [Ye]);
4638
+ function Qe(k, F) {
4639
+ N.setInUse(!0), ai(k, rr).then((M) => {
4640
+ const L = ur(M);
4608
4641
  N.setIdColumn(L.idColumn), N.setImportData(k), N.setHeadersMapping(L.headersMapping);
4609
- const ye = (E ?? []).filter((tt) => L.headersMapping[tt]) ?? Object.keys(L.properties);
4610
- N.setHeadingsOrder(ye), N.setOriginProperties(L.properties);
4611
- const et = (E ?? []).map((tt) => L.headersMapping[tt]).filter(Boolean) ?? Object.keys(L.properties);
4612
- ve("properties", L.properties), ve("propertiesOrder", et);
4642
+ const ve = (F ?? []).filter((et) => L.headersMapping[et]) ?? Object.keys(L.properties);
4643
+ N.setHeadingsOrder(ve), N.setOriginProperties(L.properties);
4644
+ const Xe = (F ?? []).map((et) => L.headersMapping[et]).filter(Boolean) ?? Object.keys(L.properties);
4645
+ Pe("properties", L.properties), Pe("propertiesOrder", Xe);
4613
4646
  });
4614
4647
  }
4615
- const yt = !!re.name && !!re.id, bt = () => {
4616
- const k = { ...re.properties };
4617
- N.idColumn && delete k[N.idColumn], ve("properties", k), H();
4648
+ const vt = !!te.name && !!te.id, yt = () => {
4649
+ const k = { ...te.properties };
4650
+ N.idColumn && delete k[N.idColumn], Pe("properties", k), H();
4618
4651
  }, U = b?.editable === void 0 || b?.editable === !0 || t;
4619
- return /* @__PURE__ */ e(De, { fullHeight: !0, children: /* @__PURE__ */ e(Vt, { value: de, children: /* @__PURE__ */ a(R, { children: [
4652
+ return /* @__PURE__ */ e(Ae, { fullHeight: !0, children: /* @__PURE__ */ e(Ot, { value: se, children: /* @__PURE__ */ a(R, { children: [
4620
4653
  !t && /* @__PURE__ */ a(
4621
- Wr,
4654
+ Zr,
4622
4655
  {
4623
4656
  value: h,
4624
- className: fe(kt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
4625
- onValueChange: (k) => B(k),
4657
+ className: fe(Tt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
4658
+ onValueChange: (k) => D(k),
4626
4659
  children: [
4627
- /* @__PURE__ */ e(Nt, { value: "details", children: "Details" }),
4628
- /* @__PURE__ */ e(Nt, { value: "properties", children: "Properties" }),
4629
- /* @__PURE__ */ e(Nt, { value: "subcollections", children: "Additional views" })
4660
+ /* @__PURE__ */ e(Ct, { value: "details", children: "Details" }),
4661
+ /* @__PURE__ */ e(Ct, { value: "properties", children: "Properties" }),
4662
+ /* @__PURE__ */ e(Ct, { value: "subcollections", children: "Additional views" })
4630
4663
  ]
4631
4664
  }
4632
4665
  ),
@@ -4634,20 +4667,20 @@ function rn({
4634
4667
  "form",
4635
4668
  {
4636
4669
  noValidate: !0,
4637
- onSubmit: de.handleSubmit,
4670
+ onSubmit: se.handleSubmit,
4638
4671
  className: fe(
4639
4672
  t ? "h-full" : "h-[calc(100%-48px)]",
4640
4673
  "flex-grow flex flex-col relative"
4641
4674
  ),
4642
4675
  children: [
4643
- h === "loading" && /* @__PURE__ */ e(ut, {}),
4644
- h === "extra_view" && pe && u?.View && /* @__PURE__ */ e(u.View, { path: pe }),
4676
+ h === "loading" && /* @__PURE__ */ e(ct, {}),
4677
+ h === "extra_view" && ue && u?.View && /* @__PURE__ */ e(u.View, { path: ue }),
4645
4678
  h === "welcome" && /* @__PURE__ */ e(
4646
- Ji,
4679
+ Qi,
4647
4680
  {
4648
- path: pe,
4649
- onContinue: (k, E) => {
4650
- k ? (Xe(k, E), B("import_data_mapping")) : B("details");
4681
+ path: ue,
4682
+ onContinue: (k, F) => {
4683
+ k ? (Qe(k, F), D("import_data_mapping")) : D("details");
4651
4684
  },
4652
4685
  existingCollectionPaths: y,
4653
4686
  parentCollection: g,
@@ -4655,7 +4688,7 @@ function rn({
4655
4688
  }
4656
4689
  ),
4657
4690
  h === "import_data_mapping" && N && /* @__PURE__ */ e(
4658
- Qi,
4691
+ Xi,
4659
4692
  {
4660
4693
  importConfig: N,
4661
4694
  collectionEditable: U,
@@ -4663,29 +4696,29 @@ function rn({
4663
4696
  }
4664
4697
  ),
4665
4698
  h === "import_data_preview" && N && /* @__PURE__ */ e(
4666
- en,
4699
+ tn,
4667
4700
  {
4668
4701
  importConfig: N,
4669
- properties: re.properties,
4670
- propertiesOrder: re.propertiesOrder
4702
+ properties: te.properties,
4703
+ propertiesOrder: te.propertiesOrder
4671
4704
  }
4672
4705
  ),
4673
4706
  h === "import_data_saving" && N && /* @__PURE__ */ e(
4674
- gi,
4707
+ vi,
4675
4708
  {
4676
4709
  importConfig: N,
4677
- collection: re,
4678
- path: pe,
4710
+ collection: te,
4711
+ path: ue,
4679
4712
  onImportSuccess: async (k) => {
4680
- D.open({
4713
+ B.open({
4681
4714
  type: "info",
4682
4715
  message: "Data imported successfully"
4683
- }), await Z(re), d(k);
4716
+ }), await Z(te), d(k);
4684
4717
  }
4685
4718
  }
4686
4719
  ),
4687
4720
  h === "details" && /* @__PURE__ */ e(
4688
- bi,
4721
+ Ci,
4689
4722
  {
4690
4723
  existingPaths: y,
4691
4724
  existingIds: x,
@@ -4696,7 +4729,7 @@ function rn({
4696
4729
  }
4697
4730
  ),
4698
4731
  h === "subcollections" && b && /* @__PURE__ */ e(
4699
- Zi,
4732
+ Ji,
4700
4733
  {
4701
4734
  parentCollection: g,
4702
4735
  configController: r,
@@ -4709,45 +4742,45 @@ function rn({
4709
4742
  h === "properties" && /* @__PURE__ */ e(
4710
4743
  Gi,
4711
4744
  {
4712
- showErrors: vt > 0,
4745
+ showErrors: gt > 0,
4713
4746
  isNewCollection: t,
4714
4747
  reservedGroups: c,
4715
- onPropertyError: (k, E, M) => {
4716
- const L = Et({
4748
+ onPropertyError: (k, F, M) => {
4749
+ const L = Ft({
4717
4750
  ..._.current,
4718
- [ar(k, E)]: Et(M, !0)
4751
+ [nr(k, F)]: Ft(M, !0)
4719
4752
  }, !0);
4720
- _.current = L, de.validate();
4753
+ _.current = L, se.validate();
4721
4754
  },
4722
4755
  getUser: f,
4723
- getData: ze,
4756
+ getData: Je,
4724
4757
  doCollectionInference: Q,
4725
4758
  propertyConfigs: C,
4726
4759
  collectionEditable: U,
4727
4760
  extraIcon: u?.icon && /* @__PURE__ */ e(
4728
- ae,
4761
+ ie,
4729
4762
  {
4730
4763
  color: "primary",
4731
- onClick: () => B("extra_view"),
4764
+ onClick: () => D("extra_view"),
4732
4765
  children: u.icon
4733
4766
  }
4734
4767
  )
4735
4768
  }
4736
4769
  ),
4737
4770
  h !== "welcome" && /* @__PURE__ */ a(
4738
- Be,
4771
+ De,
4739
4772
  {
4740
4773
  position: "absolute",
4741
4774
  children: [
4742
- oe && /* @__PURE__ */ e(Zt, { error: oe }),
4775
+ ae && /* @__PURE__ */ e(Kt, { error: ae }),
4743
4776
  t && v && h === "import_data_mapping" && /* @__PURE__ */ a(
4744
4777
  z,
4745
4778
  {
4746
4779
  variant: "text",
4747
4780
  type: "button",
4748
- onClick: () => (N.setInUse(!1), B("welcome")),
4781
+ onClick: () => (N.setInUse(!1), D("welcome")),
4749
4782
  children: [
4750
- /* @__PURE__ */ e(nt, {}),
4783
+ /* @__PURE__ */ e(it, {}),
4751
4784
  "Back"
4752
4785
  ]
4753
4786
  }
@@ -4758,10 +4791,10 @@ function rn({
4758
4791
  variant: "text",
4759
4792
  type: "button",
4760
4793
  onClick: () => {
4761
- B("import_data_mapping");
4794
+ D("import_data_mapping");
4762
4795
  },
4763
4796
  children: [
4764
- /* @__PURE__ */ e(nt, {}),
4797
+ /* @__PURE__ */ e(it, {}),
4765
4798
  "Back"
4766
4799
  ]
4767
4800
  }
@@ -4771,9 +4804,9 @@ function rn({
4771
4804
  {
4772
4805
  variant: "text",
4773
4806
  type: "button",
4774
- onClick: () => B("welcome"),
4807
+ onClick: () => D("welcome"),
4775
4808
  children: [
4776
- /* @__PURE__ */ e(nt, {}),
4809
+ /* @__PURE__ */ e(it, {}),
4777
4810
  "Back"
4778
4811
  ]
4779
4812
  }
@@ -4783,9 +4816,9 @@ function rn({
4783
4816
  {
4784
4817
  variant: "text",
4785
4818
  type: "button",
4786
- onClick: () => B("details"),
4819
+ onClick: () => D("details"),
4787
4820
  children: [
4788
- /* @__PURE__ */ e(nt, {}),
4821
+ /* @__PURE__ */ e(it, {}),
4789
4822
  "Back"
4790
4823
  ]
4791
4824
  }
@@ -4805,7 +4838,7 @@ function rn({
4805
4838
  {
4806
4839
  variant: "filled",
4807
4840
  color: "primary",
4808
- onClick: bt,
4841
+ onClick: yt,
4809
4842
  children: "Next"
4810
4843
  }
4811
4844
  ),
@@ -4821,14 +4854,14 @@ function rn({
4821
4854
  }
4822
4855
  ),
4823
4856
  t && (h === "details" || h === "properties") && /* @__PURE__ */ a(
4824
- Rt,
4857
+ zt,
4825
4858
  {
4826
4859
  variant: "filled",
4827
4860
  color: "primary",
4828
4861
  type: "submit",
4829
4862
  loading: ke,
4830
- disabled: ke || h === "details" && !yt,
4831
- startIcon: h === "properties" ? /* @__PURE__ */ e(Zr, {}) : void 0,
4863
+ disabled: ke || h === "details" && !vt,
4864
+ startIcon: h === "properties" ? /* @__PURE__ */ e(Jr, {}) : void 0,
4832
4865
  children: [
4833
4866
  h === "details" && "Next",
4834
4867
  h === "properties" && "Create collection"
@@ -4836,7 +4869,7 @@ function rn({
4836
4869
  }
4837
4870
  ),
4838
4871
  !t && /* @__PURE__ */ e(
4839
- Rt,
4872
+ zt,
4840
4873
  {
4841
4874
  variant: "filled",
4842
4875
  color: "primary",
@@ -4853,28 +4886,28 @@ function rn({
4853
4886
  )
4854
4887
  ] }) }) });
4855
4888
  }
4856
- function nn(t, r) {
4889
+ function an(t, r) {
4857
4890
  const {
4858
4891
  properties: n,
4859
4892
  ...i
4860
4893
  } = t, l = {};
4861
4894
  return n && Object.keys(n).forEach((o) => {
4862
- l[o] = hr(n[o], r);
4895
+ l[o] = mr(n[o], r);
4863
4896
  }), {
4864
4897
  ...i,
4865
4898
  properties: l
4866
4899
  };
4867
4900
  }
4868
- function hr(t, r) {
4901
+ function mr(t, r) {
4869
4902
  let n = t;
4870
4903
  if (r && typeof n == "object" && n.propertyConfig) {
4871
4904
  const i = r[n.propertyConfig];
4872
- if (i && ie(i.property))
4905
+ if (i && re(i.property))
4873
4906
  n = i.property;
4874
- else if (i && (n = K(i.property, n)), !ie(n) && n.dataType === "map" && n.properties) {
4907
+ else if (i && (n = W(i.property, n)), !re(n) && n.dataType === "map" && n.properties) {
4875
4908
  const l = {};
4876
4909
  Object.keys(n.properties).forEach((o) => {
4877
- l[o] = hr(n.properties[o], r);
4910
+ l[o] = mr(n.properties[o], r);
4878
4911
  }), n = {
4879
4912
  ...n,
4880
4913
  properties: l
@@ -4883,15 +4916,15 @@ function hr(t, r) {
4883
4916
  }
4884
4917
  return n;
4885
4918
  }
4886
- const Gt = (t, r, n, i) => {
4919
+ const Yt = (t, r, n, i) => {
4887
4920
  let l;
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) => {
4921
+ 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;
4922
+ }, on = (t, r, n, i) => {
4890
4923
  if (!t)
4891
4924
  return;
4892
4925
  let l;
4893
4926
  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;
4894
- }, fr = Y.createContext({}), gr = Y.createContext({}), on = Y.memo(
4927
+ }, hr = G.createContext({}), fr = G.createContext({}), ln = G.memo(
4895
4928
  function({
4896
4929
  children: r,
4897
4930
  collectionConfigController: n,
@@ -4904,78 +4937,78 @@ const Gt = (t, r, n, i) => {
4904
4937
  getData: m,
4905
4938
  onAnalyticsEvent: p
4906
4939
  }) {
4907
- const s = Te(), f = vi(), g = Ie(), { propertyConfigs: P } = Ae(), [y, x] = Y.useState(), [v, b] = Y.useState(), T = J(() => ({
4940
+ const s = Te(), f = yi(), g = Ve(), { propertyConfigs: P } = Se(), [y, x] = G.useState(), [v, b] = G.useState(), T = Er(() => ({
4908
4941
  createCollections: !0,
4909
4942
  editCollections: !0,
4910
4943
  deleteCollections: !0
4911
- }), []), w = J(({
4944
+ }), []), w = ({
4912
4945
  id: N,
4913
- fullPath: F,
4914
- parentCollectionIds: D,
4946
+ fullPath: E,
4947
+ parentCollectionIds: B,
4915
4948
  parentCollection: _
4916
4949
  }) => {
4917
- console.debug("Edit collection", N, F, D, _), p?.("edit_collection", {
4950
+ console.debug("Edit collection", N, E, B, _), p?.("edit_collection", {
4918
4951
  id: N,
4919
- fullPath: F
4952
+ fullPath: E
4920
4953
  }), x({
4921
4954
  editedCollectionId: N,
4922
- fullPath: F,
4923
- parentCollectionIds: D,
4955
+ fullPath: E,
4956
+ parentCollectionIds: B,
4924
4957
  isNewCollection: !1,
4925
4958
  parentCollection: _,
4926
4959
  redirect: !1
4927
4960
  });
4928
- }, []), C = J(({
4961
+ }, C = ({
4929
4962
  propertyKey: N,
4930
- property: F,
4931
- editedCollectionId: D,
4963
+ property: E,
4964
+ editedCollectionId: B,
4932
4965
  currentPropertiesOrder: _,
4933
4966
  parentCollectionIds: S,
4934
4967
  collection: h
4935
4968
  }) => {
4936
- console.debug("Edit property", N, F, D, _, S, h), p?.("edit_property", {
4969
+ console.debug("Edit property", N, E, B, _, S, h), p?.("edit_property", {
4937
4970
  propertyKey: N,
4938
- editedCollectionId: D
4971
+ editedCollectionId: B
4939
4972
  });
4940
- const B = N && N.includes(".") ? N.substring(0, N.lastIndexOf(".")) : void 0, oe = N && N.includes(".") ? N.substring(N.lastIndexOf(".") + 1) : N;
4973
+ const D = N && N.includes(".") ? N.substring(0, N.lastIndexOf(".")) : void 0, ae = N && N.includes(".") ? N.substring(N.lastIndexOf(".") + 1) : N;
4941
4974
  b({
4942
- propertyKey: oe,
4943
- property: F,
4944
- namespace: B,
4975
+ propertyKey: ae,
4976
+ property: E,
4977
+ namespace: D,
4945
4978
  currentPropertiesOrder: _,
4946
- editedCollectionId: D,
4979
+ editedCollectionId: B,
4947
4980
  parentCollectionIds: S,
4948
4981
  collectionEditable: h?.editable ?? !1
4949
4982
  });
4950
- }, []), O = Y.useCallback(({
4983
+ }, O = ({
4951
4984
  parentCollectionIds: N,
4952
- parentCollection: F,
4953
- initialValues: D,
4985
+ parentCollection: E,
4986
+ initialValues: B,
4954
4987
  redirect: _,
4955
4988
  sourceClick: S
4956
4989
  }) => {
4957
4990
  console.debug("Create collection", {
4958
4991
  parentCollectionIds: N,
4959
- parentCollection: F,
4960
- initialValues: D,
4992
+ parentCollection: E,
4993
+ initialValues: B,
4961
4994
  redirect: _,
4962
4995
  sourceClick: S
4963
4996
  }), p?.("create_collection", {
4964
4997
  parentCollectionIds: N,
4965
- parentCollection: F,
4966
- initialValues: D,
4998
+ parentCollection: E,
4999
+ initialValues: B,
4967
5000
  redirect: _,
4968
5001
  sourceClick: S
4969
5002
  }), x({
4970
5003
  isNewCollection: !0,
4971
5004
  parentCollectionIds: N,
4972
- parentCollection: F,
4973
- initialValues: D,
5005
+ parentCollection: E,
5006
+ initialValues: B,
4974
5007
  redirect: _
4975
5008
  });
4976
- }, []);
4977
- return /* @__PURE__ */ e(fr.Provider, { value: n, children: /* @__PURE__ */ a(
4978
- gr.Provider,
5009
+ };
5010
+ return /* @__PURE__ */ e(hr.Provider, { value: n, children: /* @__PURE__ */ a(
5011
+ fr.Provider,
4979
5012
  {
4980
5013
  value: {
4981
5014
  editCollection: w,
@@ -4987,7 +5020,7 @@ const Gt = (t, r, n, i) => {
4987
5020
  children: [
4988
5021
  r,
4989
5022
  /* @__PURE__ */ e(
4990
- mr,
5023
+ pr,
4991
5024
  {
4992
5025
  open: !!y,
4993
5026
  configController: n,
@@ -5001,15 +5034,15 @@ const Gt = (t, r, n, i) => {
5001
5034
  getUser: u,
5002
5035
  handleClose: (N) => {
5003
5036
  if (y?.redirect && N && y?.isNewCollection && !y.parentCollectionIds.length) {
5004
- const F = s.buildUrlCollectionPath(N.id ?? N.path);
5005
- f(F);
5037
+ const E = s.buildUrlCollectionPath(N.id ?? N.path);
5038
+ f(E);
5006
5039
  }
5007
5040
  x(void 0);
5008
5041
  }
5009
5042
  }
5010
5043
  ),
5011
5044
  /* @__PURE__ */ e(
5012
- Ve,
5045
+ Oe,
5013
5046
  {
5014
5047
  open: !!v,
5015
5048
  includeIdAndName: !0,
@@ -5025,16 +5058,16 @@ const Gt = (t, r, n, i) => {
5025
5058
  } : void 0,
5026
5059
  onPropertyChanged: ({
5027
5060
  id: N,
5028
- property: F
5061
+ property: E
5029
5062
  }) => {
5030
5063
  if (!v || !N)
5031
5064
  return;
5032
- const D = !v.propertyKey;
5065
+ const B = !v.propertyKey;
5033
5066
  return n.saveProperty({
5034
5067
  path: v?.editedCollectionId,
5035
- property: F,
5068
+ property: E,
5036
5069
  propertyKey: N,
5037
- newPropertiesOrder: D && v.currentPropertiesOrder ? [...v.currentPropertiesOrder, N] : void 0,
5070
+ newPropertiesOrder: B && v.currentPropertiesOrder ? [...v.currentPropertiesOrder, N] : void 0,
5038
5071
  namespace: v.namespace,
5039
5072
  parentCollectionIds: v.parentCollectionIds
5040
5073
  }).catch((_) => (console.error(_), g.open({
@@ -5046,7 +5079,7 @@ const Gt = (t, r, n, i) => {
5046
5079
  onDelete: () => {
5047
5080
  if (!v?.propertyKey)
5048
5081
  return;
5049
- const N = v?.currentPropertiesOrder?.filter((F) => F !== v?.propertyKey);
5082
+ const N = v?.currentPropertiesOrder?.filter((E) => E !== v?.propertyKey);
5050
5083
  return n.deleteProperty({
5051
5084
  path: v?.editedCollectionId,
5052
5085
  propertyKey: v?.propertyKey,
@@ -5055,9 +5088,9 @@ const Gt = (t, r, n, i) => {
5055
5088
  parentCollectionIds: v?.parentCollectionIds
5056
5089
  }).then(() => {
5057
5090
  b(void 0);
5058
- }).catch((F) => (console.error(F), g.open({
5091
+ }).catch((E) => (console.error(E), g.open({
5059
5092
  type: "error",
5060
- message: "Error deleting property: " + (F.message ?? "Details in the console")
5093
+ message: "Error deleting property: " + (E.message ?? "Details in the console")
5061
5094
  }), !1));
5062
5095
  },
5063
5096
  onError: () => {
@@ -5081,78 +5114,78 @@ const Gt = (t, r, n, i) => {
5081
5114
  }
5082
5115
  ) });
5083
5116
  },
5084
- be
5085
- ), Pe = () => Qt(gr);
5086
- function ln({
5117
+ ye
5118
+ ), Ne = () => Jt(fr);
5119
+ function sn({
5087
5120
  path: t,
5088
5121
  parentCollectionIds: r,
5089
5122
  collection: n,
5090
5123
  tableController: i
5091
5124
  }) {
5092
- const l = _e(), o = Te(), d = Pe(), c = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
5125
+ const l = Ie(), o = Te(), d = Ne(), c = o.getCollectionFromIds(r), u = d.configPermissions ? d.configPermissions({
5093
5126
  user: l.user,
5094
5127
  collection: n
5095
5128
  }).editCollections : !0;
5096
5129
  return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(
5097
- te,
5130
+ ee,
5098
5131
  {
5099
5132
  title: u ? "Edit collection" : "You don't have permissions to edit this collection",
5100
5133
  children: /* @__PURE__ */ e(
5101
- ae,
5134
+ ie,
5102
5135
  {
5103
5136
  color: "primary",
5104
5137
  disabled: !u,
5105
5138
  onClick: u ? () => d?.editCollection({ id: n.id, fullPath: t, parentCollectionIds: r, parentCollection: c }) : void 0,
5106
- children: /* @__PURE__ */ e(Ye, {})
5139
+ children: /* @__PURE__ */ e($e, {})
5107
5140
  }
5108
5141
  )
5109
5142
  }
5110
5143
  ) });
5111
5144
  }
5112
- const vr = () => Qt(fr);
5113
- function sn({
5145
+ const gr = () => Jt(hr);
5146
+ function dn({
5114
5147
  path: t,
5115
5148
  collection: r
5116
5149
  }) {
5117
- const n = Ie(), i = _e(), l = vr(), o = Pe(), d = o.configPermissions({
5150
+ const n = Ve(), i = Ie(), l = gr(), o = Ne(), d = o.configPermissions({
5118
5151
  user: i.user,
5119
5152
  collection: r
5120
- }), c = J(() => {
5153
+ }), c = () => {
5121
5154
  o?.editCollection({ id: r.id, parentCollectionIds: [] });
5122
- }, [o, t]), [u, m] = j(!1), p = J(() => {
5155
+ }, [u, m] = j(!1), p = () => {
5123
5156
  l?.deleteCollection({ id: r.id }).then(() => {
5124
5157
  m(!1), n.open({
5125
5158
  message: "Collection deleted",
5126
5159
  type: "success"
5127
5160
  });
5128
5161
  });
5129
- }, [t, l]);
5162
+ };
5130
5163
  return /* @__PURE__ */ a(R, { children: [
5131
5164
  /* @__PURE__ */ a("div", { children: [
5132
5165
  d.deleteCollections && /* @__PURE__ */ e(
5133
- Jr,
5166
+ Qr,
5134
5167
  {
5135
- trigger: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(Qr, { size: "small" }) }),
5136
- children: /* @__PURE__ */ a(Xr, { onClick: (s) => {
5168
+ trigger: /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(Xr, { size: "small" }) }),
5169
+ children: /* @__PURE__ */ a(ei, { onClick: (s) => {
5137
5170
  s.preventDefault(), s.stopPropagation(), m(!0);
5138
5171
  }, children: [
5139
- /* @__PURE__ */ e(mt, {}),
5172
+ /* @__PURE__ */ e(pt, {}),
5140
5173
  "Delete"
5141
5174
  ] })
5142
5175
  }
5143
5176
  ),
5144
5177
  d.editCollections && /* @__PURE__ */ e(
5145
- ae,
5178
+ ie,
5146
5179
  {
5147
5180
  onClick: (s) => {
5148
5181
  c();
5149
5182
  },
5150
- children: /* @__PURE__ */ e(Ye, { size: "small" })
5183
+ children: /* @__PURE__ */ e($e, { size: "small" })
5151
5184
  }
5152
5185
  )
5153
5186
  ] }),
5154
5187
  /* @__PURE__ */ e(
5155
- ct,
5188
+ dt,
5156
5189
  {
5157
5190
  open: u,
5158
5191
  onAccept: p,
@@ -5167,7 +5200,7 @@ function sn({
5167
5200
  )
5168
5201
  ] });
5169
5202
  }
5170
- function dn({
5203
+ function cn({
5171
5204
  propertyKey: t,
5172
5205
  onHover: r,
5173
5206
  property: n,
@@ -5175,9 +5208,9 @@ function dn({
5175
5208
  parentCollectionIds: l,
5176
5209
  collection: o
5177
5210
  }) {
5178
- const d = Pe();
5179
- return /* @__PURE__ */ e(te, { title: "Edit", children: /* @__PURE__ */ e(
5180
- ae,
5211
+ const d = Ne();
5212
+ return /* @__PURE__ */ e(ee, { title: "Edit", children: /* @__PURE__ */ e(
5213
+ ie,
5181
5214
  {
5182
5215
  className: r ? "bg-white dark:bg-gray-950" : "hidden",
5183
5216
  onClick: () => {
@@ -5190,20 +5223,20 @@ function dn({
5190
5223
  });
5191
5224
  },
5192
5225
  size: "small",
5193
- children: /* @__PURE__ */ e(Ye, { size: "small" })
5226
+ children: /* @__PURE__ */ e($e, { size: "small" })
5194
5227
  }
5195
5228
  ) });
5196
5229
  }
5197
- function cn({
5230
+ function un({
5198
5231
  fullPath: t,
5199
5232
  parentCollectionIds: r,
5200
5233
  collection: n
5201
5234
  }) {
5202
- const i = _e(), l = Pe(), o = l.configPermissions ? l.configPermissions({
5235
+ const i = Ie(), l = Ne(), o = l.configPermissions ? l.configPermissions({
5203
5236
  user: i.user,
5204
5237
  collection: n
5205
5238
  }).editCollections : !0;
5206
- return /* @__PURE__ */ e(te, { title: o ? "Add new property" : "You don't have permission to add new properties", children: /* @__PURE__ */ e(
5239
+ return /* @__PURE__ */ e(ee, { title: o ? "Add new property" : "You don't have permission to add new properties", children: /* @__PURE__ */ e(
5207
5240
  "div",
5208
5241
  {
5209
5242
  className: "p-0.5 w-20 h-full flex items-center justify-center cursor-pointer bg-gray-100 bg-opacity-40 hover:bg-gray-100 dark:bg-gray-950 dark:bg-opacity-40 dark:hover:bg-gray-950",
@@ -5211,16 +5244,16 @@ function cn({
5211
5244
  l.editProperty({
5212
5245
  editedCollectionId: n.id,
5213
5246
  parentCollectionIds: r,
5214
- currentPropertiesOrder: _r(n),
5247
+ currentPropertiesOrder: Ir(n),
5215
5248
  collection: n
5216
5249
  });
5217
5250
  },
5218
- children: /* @__PURE__ */ e(ce, { color: "inherit" })
5251
+ children: /* @__PURE__ */ e(de, { color: "inherit" })
5219
5252
  }
5220
5253
  ) });
5221
5254
  }
5222
- function un() {
5223
- const t = Pe();
5255
+ function pn() {
5256
+ const t = Ne();
5224
5257
  return /* @__PURE__ */ e("div", { className: "bg-gray-50 dark:bg-gray-900 min-w-fit rounded", children: /* @__PURE__ */ a(
5225
5258
  z,
5226
5259
  {
@@ -5232,26 +5265,26 @@ function un() {
5232
5265
  sourceClick: "new_collection_button"
5233
5266
  }),
5234
5267
  children: [
5235
- /* @__PURE__ */ e(ce, {}),
5268
+ /* @__PURE__ */ e(de, {}),
5236
5269
  "New collection"
5237
5270
  ]
5238
5271
  }
5239
5272
  ) });
5240
5273
  }
5241
- function pn({
5274
+ function mn({
5242
5275
  path: t,
5243
5276
  parentCollectionIds: r,
5244
5277
  collection: n,
5245
5278
  tableController: i
5246
5279
  }) {
5247
- const l = _e(), o = Pe(), d = vr(), c = Ie(), u = o.configPermissions ? o.configPermissions({
5280
+ const l = Ie(), o = Ne(), d = gr(), c = Ve(), u = o.configPermissions ? o.configPermissions({
5248
5281
  user: l.user,
5249
5282
  collection: n
5250
5283
  }).editCollections : !0;
5251
5284
  let m = null;
5252
- return (!be(st(i.filterValues), st(n.initialFilter)) || !be(st(i.sortBy), st(n.initialSort))) && (m = /* @__PURE__ */ a(R, { children: [
5285
+ return (!ye(lt(i.filterValues), lt(n.initialFilter)) || !ye(lt(i.sortBy), lt(n.initialSort))) && (m = /* @__PURE__ */ a(R, { children: [
5253
5286
  /* @__PURE__ */ e(
5254
- te,
5287
+ ee,
5255
5288
  {
5256
5289
  title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
5257
5290
  children: /* @__PURE__ */ e(
@@ -5263,7 +5296,7 @@ function pn({
5263
5296
  onClick: () => d?.saveCollection({
5264
5297
  id: n.id,
5265
5298
  parentCollectionIds: r,
5266
- collectionData: K(
5299
+ collectionData: W(
5267
5300
  n,
5268
5301
  {
5269
5302
  initialFilter: i.filterValues ?? null,
@@ -5276,13 +5309,13 @@ function pn({
5276
5309
  message: "Default config saved"
5277
5310
  });
5278
5311
  }),
5279
- children: /* @__PURE__ */ e(ei, {})
5312
+ children: /* @__PURE__ */ e(ti, {})
5280
5313
  }
5281
5314
  )
5282
5315
  }
5283
5316
  ),
5284
5317
  (n.initialFilter || n.initialSort) && /* @__PURE__ */ e(
5285
- te,
5318
+ ee,
5286
5319
  {
5287
5320
  title: "Reset to default filter and sort",
5288
5321
  children: /* @__PURE__ */ e(
@@ -5294,27 +5327,27 @@ function pn({
5294
5327
  onClick: () => {
5295
5328
  i.clearFilter?.(), n?.initialFilter && i.setFilterValues?.(n?.initialFilter), n?.initialSort && i.setSortBy?.(n?.initialSort);
5296
5329
  },
5297
- children: /* @__PURE__ */ e(ti, {})
5330
+ children: /* @__PURE__ */ e(ri, {})
5298
5331
  }
5299
5332
  )
5300
5333
  }
5301
5334
  )
5302
5335
  ] })), /* @__PURE__ */ e(R, { children: u && m });
5303
5336
  }
5304
- function st(t) {
5337
+ function lt(t) {
5305
5338
  return t && Object.keys(t).length === 0 ? t : t ?? null;
5306
5339
  }
5307
- function mn({
5340
+ function hn({
5308
5341
  group: t,
5309
5342
  context: r
5310
5343
  }) {
5311
5344
  if (!r.navigation.topLevelNavigation)
5312
5345
  throw Error("Navigation not ready in FireCMSHomePage");
5313
- const n = _e(), i = Pe(), l = i.configPermissions ? i.configPermissions({
5346
+ const n = Ie(), i = Ne(), l = i.configPermissions ? i.configPermissions({
5314
5347
  user: n.user
5315
5348
  }).createCollections : !0;
5316
5349
  return /* @__PURE__ */ e(
5317
- rr,
5350
+ tr,
5318
5351
  {
5319
5352
  className: fe("h-full p-4 min-h-[124px]"),
5320
5353
  onClick: i && l ? () => i.createCollection({
@@ -5326,9 +5359,9 @@ function mn({
5326
5359
  children: /* @__PURE__ */ a(
5327
5360
  "div",
5328
5361
  {
5329
- className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
5362
+ className: "flex items-center justify-center h-full w-full flex-grow flex-col",
5330
5363
  children: [
5331
- /* @__PURE__ */ e(ce, { color: "primary", size: "large" }),
5364
+ /* @__PURE__ */ e(de, { color: "primary", size: "large" }),
5332
5365
  /* @__PURE__ */ e(
5333
5366
  V,
5334
5367
  {
@@ -5345,7 +5378,7 @@ function mn({
5345
5378
  }
5346
5379
  );
5347
5380
  }
5348
- function Vn({
5381
+ function In({
5349
5382
  collectionConfigController: t,
5350
5383
  configPermissions: r,
5351
5384
  reservedGroups: n,
@@ -5360,7 +5393,7 @@ function Vn({
5360
5393
  key: "collection_editor",
5361
5394
  loading: t.loading,
5362
5395
  provider: {
5363
- Component: on,
5396
+ Component: ln,
5364
5397
  props: {
5365
5398
  collectionConfigController: t,
5366
5399
  configPermissions: r,
@@ -5374,28 +5407,28 @@ function Vn({
5374
5407
  }
5375
5408
  },
5376
5409
  homePage: {
5377
- additionalActions: /* @__PURE__ */ e(un, {}),
5378
- additionalChildrenStart: /* @__PURE__ */ e(hn, {}),
5410
+ additionalActions: /* @__PURE__ */ e(pn, {}),
5411
+ additionalChildrenStart: /* @__PURE__ */ e(fn, {}),
5379
5412
  // additionalChildrenEnd: <RootCollectionSuggestions introMode={introMode}/>,
5380
- CollectionActions: sn,
5381
- AdditionalCards: mn
5413
+ CollectionActions: dn,
5414
+ AdditionalCards: hn
5382
5415
  },
5383
5416
  collectionView: {
5384
- CollectionActionsStart: pn,
5385
- CollectionActions: ln,
5386
- HeaderAction: dn,
5387
- AddColumnComponent: cn
5417
+ CollectionActionsStart: mn,
5418
+ CollectionActions: sn,
5419
+ HeaderAction: cn,
5420
+ AddColumnComponent: un
5388
5421
  }
5389
5422
  };
5390
5423
  }
5391
- function hn({}) {
5424
+ function fn({}) {
5392
5425
  const t = Te();
5393
5426
  if (!t.topLevelNavigation)
5394
5427
  throw Error("Navigation not ready in FireCMSHomePage");
5395
- const r = _e(), n = Pe(), i = n.configPermissions ? n.configPermissions({
5428
+ const r = Ie(), n = Ne(), i = n.configPermissions ? n.configPermissions({
5396
5429
  user: r.user
5397
5430
  }).createCollections : !0;
5398
- return !t.initialised || t.collections === void 0 || (t.collections ?? []).length > 0 ? null : /* @__PURE__ */ a(
5431
+ return !t.initialised || (t.collections ?? []).length > 0 ? null : /* @__PURE__ */ a(
5399
5432
  ge,
5400
5433
  {
5401
5434
  className: "my-4 px-4 py-6 flex flex-col bg-white dark:bg-slate-800 gap-2",
@@ -5411,7 +5444,7 @@ function hn({}) {
5411
5444
  sourceClick: "new_collection_card"
5412
5445
  }) : void 0,
5413
5446
  children: [
5414
- /* @__PURE__ */ e(ce, {}),
5447
+ /* @__PURE__ */ e(de, {}),
5415
5448
  "Create your first collection"
5416
5449
  ]
5417
5450
  }
@@ -5421,18 +5454,18 @@ function hn({}) {
5421
5454
  }
5422
5455
  );
5423
5456
  }
5424
- const In = (t, r, n) => {
5457
+ const _n = (t, r, n) => {
5425
5458
  const i = (d) => {
5426
- He(d.properties), d.subcollections?.forEach(i);
5459
+ Le(d.properties), d.subcollections?.forEach(i);
5427
5460
  }, l = r ?? [];
5428
5461
  l.forEach(i), console.debug("Collections specified in code:", t), console.debug("Collections stored in the backend", l);
5429
- const o = Fr(t, l, [], n);
5462
+ const o = _r(t, l, [], n);
5430
5463
  return console.debug("Collections after joining:", o), o;
5431
5464
  };
5432
- function _n({ path: t }) {
5433
- const r = Te(), n = fn(t), i = r.getParentCollectionIds(t), l = Pe();
5465
+ function Fn({ path: t }) {
5466
+ const r = Te(), n = gn(t), i = r.getParentCollectionIds(t), l = Ne();
5434
5467
  return /* @__PURE__ */ a("div", { className: "p-1 flex flex-col items-center", children: [
5435
- /* @__PURE__ */ e(Zt, { error: "No collection for path: " + n }),
5468
+ /* @__PURE__ */ e(Kt, { error: "No collection for path: " + n }),
5436
5469
  /* @__PURE__ */ e(
5437
5470
  z,
5438
5471
  {
@@ -5441,7 +5474,7 @@ function _n({ path: t }) {
5441
5474
  size: "small",
5442
5475
  onClick: () => {
5443
5476
  l.createCollection({
5444
- initialValues: { path: n, name: wt(n) },
5477
+ initialValues: { path: n, name: Pt(n) },
5445
5478
  parentCollectionIds: i,
5446
5479
  redirect: !1,
5447
5480
  sourceClick: "missing_reference"
@@ -5452,22 +5485,22 @@ function _n({ path: t }) {
5452
5485
  )
5453
5486
  ] });
5454
5487
  }
5455
- function fn(t) {
5488
+ function gn(t) {
5456
5489
  const r = t.split("/");
5457
5490
  return r[r.length - 1];
5458
5491
  }
5459
5492
  export {
5460
- _n as MissingReferenceWidget,
5461
- qe as editableProperty,
5493
+ Fn as MissingReferenceWidget,
5494
+ Ue as editableProperty,
5462
5495
  ne as getFullId,
5463
- ar as getFullIdPath,
5464
- he as idToPropertiesPath,
5465
- In as mergeCollections,
5466
- Ce as namespaceToPropertiesOrderPath,
5467
- nr as namespaceToPropertiesPath,
5468
- wi as removeNonEditableProperties,
5469
- Pe as useCollectionEditorController,
5470
- Vn as useCollectionEditorPlugin,
5471
- vr as useCollectionsConfigController
5496
+ nr as getFullIdPath,
5497
+ me as idToPropertiesPath,
5498
+ _n as mergeCollections,
5499
+ he as namespaceToPropertiesOrderPath,
5500
+ ir as namespaceToPropertiesPath,
5501
+ Ti as removeNonEditableProperties,
5502
+ Ne as useCollectionEditorController,
5503
+ In as useCollectionEditorPlugin,
5504
+ gr as useCollectionsConfigController
5472
5505
  };
5473
5506
  //# sourceMappingURL=index.es.js.map