@firecms/collection_editor 3.0.0-alpha.51 → 3.0.0-alpha.52

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,9 +1,9 @@
1
- import { jsxs as n, Fragment as M, jsx as e } from "react/jsx-runtime";
2
- import * as we from "react";
3
- import L, { useState as $, useEffect as pe, useMemo as Kt, useCallback as X, useRef as He, useDeferredValue as ba, useContext as Yt } from "react";
4
- import { iconKeys as Gt, debounce as ya, SearchBar as va, Tooltip as re, IconButton as ne, Icon as lt, coolIconKeys as xt, Typography as C, getIconForView as ct, useAutoComplete as wa, Container as ht, Chip as dt, TextField as Te, cn as ke, DebouncedTextField as H, Autocomplete as _a, AutocompleteItem as ka, ExpandablePanel as Ot, SettingsIcon as Qe, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Ht, Dialog as Ee, toSnakeCase as Ct, singular as xa, ListIcon as Ca, Button as B, CircularProgress as We, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Oa, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Pa, isValidRegExp as Na, RuleIcon as Sa, useSnackbarController as De, resolveEnumValues as qa, FileUploadIcon as Aa, MultiSelect as za, MultiSelectItem as zt, Checkbox as Tt, isPropertyBuilder as oe, useFireCMSContext as Ke, getFieldConfig as Ze, ErrorBoundary as Pe, FieldConfigBadge as Xe, cardMixin as Jt, cardClickableMixin as Qt, cardSelectedMixin as Wt, FunctionsIcon as Ta, RemoveCircleIcon as Va, defaultBorderMixin as Pt, RemoveIcon as Ia, DragHandleIcon as Fa, AddIcon as Ae, useNavigationController as Be, SelectGroup as Vt, mergeDeep as Y, DEFAULT_FIELD_CONFIGS as Zt, getFieldId as Xt, InfoLabel as ea, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as ja, useLargeLayout as Ea, CodeIcon as Da, makePropertiesEditable as et, resolveEntityView as Ba, Table as It, TableBody as Ft, TableRow as wt, TableCell as Ge, unslugify as Nt, Card as ta, useSelectionController as Ma, EntityCollectionTable as Ra, slugify as Ua, useAuthController as Ye, randomString as jt, CircularProgressCenter as Et, Tabs as $a, Tab as _t, removeUndefined as La, ErrorView as aa, ArrowBackIcon as rt, LoadingButton as Dt, DoneIcon as Ka, SaveIcon as Ya, Menu as Ga, MoreVertIcon as Ha, MenuItem as Ja, Collapse as Qa, getDefaultPropertiesOrder as Wa, joinCollectionLists as Za } from "@firecms/core";
1
+ import { jsxs as n, Fragment as $, jsx as e } from "react/jsx-runtime";
2
+ import * as _e from "react";
3
+ import K, { useState as L, useEffect as pe, useMemo as Kt, useCallback as Z, useRef as He, useDeferredValue as ba, useContext as Yt } from "react";
4
+ import { iconKeys as Gt, debounce as ya, SearchBar as va, Tooltip as re, IconButton as ne, Icon as lt, coolIconKeys as xt, Typography as C, getIconForView as ct, useAutoComplete as wa, Container as ht, Chip as dt, TextField as Te, cn as xe, DebouncedTextField as J, Autocomplete as _a, AutocompleteItem as ka, ExpandablePanel as Ot, SettingsIcon as Qe, Select as Se, SelectItem as ee, BooleanSwitchWithLabel as Ht, Dialog as Ee, toSnakeCase as Ct, singular as xa, ListIcon as Ca, Button as U, CircularProgress as We, AutoAwesomeIcon as gt, Paper as qe, FormikArrayContainer as Oa, DialogContent as $e, DialogActions as Le, SwitchControl as he, serializeRegExp as Na, isValidRegExp as Pa, RuleIcon as Sa, useSnackbarController as De, resolveEnumValues as qa, FileUploadIcon as Aa, MultiSelect as za, MultiSelectItem as zt, Checkbox as Tt, isPropertyBuilder as oe, useFireCMSContext as Ke, getFieldConfig as Ze, ErrorBoundary as Ne, FieldConfigBadge as Xe, cardMixin as Jt, cardClickableMixin as Qt, cardSelectedMixin as Wt, FunctionsIcon as Ta, RemoveCircleIcon as Va, defaultBorderMixin as Nt, RemoveIcon as Ia, DragHandleIcon as Fa, AddIcon as Ae, useNavigationController as Be, SelectGroup as Vt, mergeDeep as G, DEFAULT_FIELD_CONFIGS as Zt, getFieldId as Xt, InfoLabel as ea, DeleteIcon as pt, DeleteConfirmationDialog as mt, ContentCopyIcon as ja, useLargeLayout as Ea, CodeIcon as Da, makePropertiesEditable as et, resolveEntityView as Ba, Table as It, TableBody as Ft, TableRow as wt, TableCell as Ge, unslugify as Pt, Card as ta, useSelectionController as Ma, EntityCollectionTable as Ra, slugify as Ua, useAuthController as Ye, randomString as jt, CircularProgressCenter as Et, Tabs as $a, Tab as _t, removeUndefined as La, ErrorView as aa, ArrowBackIcon as rt, LoadingButton as Dt, DoneIcon as Ka, SaveIcon as Ya, Menu as Ga, MoreVertIcon as Ha, MenuItem as Ja, Collapse as Qa, getDefaultPropertiesOrder as Wa, joinCollectionLists as Za } from "@firecms/core";
5
5
  import ut from "react-fast-compare";
6
- import { useFormikContext as K, Field as be, getIn as P, Formik as St, FastField as de, Form as Xa } from "formik";
6
+ import { useFormikContext as Y, Field as ye, getIn as P, Formik as St, FastField as de, Form as Xa } from "formik";
7
7
  import * as ot from "yup";
8
8
  import * as ei from "js-search";
9
9
  import { extractEnumFromValues as ti, buildPropertyFromData as ai, buildEntityPropertiesFromData as ii } from "@firecms/schema_inference";
@@ -1977,20 +1977,20 @@ process.env.NODE_ENV !== "production" && Object.keys(ra).forEach((t) => {
1977
1977
  Gt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
1978
1978
  });
1979
1979
  function wi({ selectedIcon: t = "", onIconSelected: a }) {
1980
- const [i, r] = we.useState(null), [s, o] = we.useState(""), l = we.useMemo(
1980
+ const [i, r] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
1981
1981
  () => ya((m) => {
1982
1982
  if (!m || m === "")
1983
1983
  r(null);
1984
1984
  else {
1985
1985
  const u = qt.search(m);
1986
- r(u.map((c) => c.key));
1986
+ r(u.map((d) => d.key));
1987
1987
  }
1988
1988
  }, vi),
1989
1989
  []
1990
1990
  );
1991
- return we.useEffect(() => (l(s), () => {
1991
+ return _e.useEffect(() => (l(s), () => {
1992
1992
  l.clear();
1993
- }), [s, l]), /* @__PURE__ */ n(M, { children: [
1993
+ }), [s, l]), /* @__PURE__ */ n($, { children: [
1994
1994
  /* @__PURE__ */ e(
1995
1995
  va,
1996
1996
  {
@@ -2026,29 +2026,29 @@ function _i({
2026
2026
  groups: s,
2027
2027
  parentCollection: o
2028
2028
  }) {
2029
- const l = L.useRef(null), {
2029
+ const l = K.useRef(null), {
2030
2030
  values: p,
2031
2031
  setFieldValue: m,
2032
2032
  handleChange: u,
2033
- touched: c,
2034
- errors: d,
2035
- setFieldTouched: f,
2033
+ touched: d,
2034
+ errors: c,
2035
+ setFieldTouched: y,
2036
2036
  isSubmitting: g,
2037
2037
  submitCount: b
2038
- } = K(), [O, k] = $(!1), [x, h] = $(!1), _ = (v) => {
2039
- m("name", v), !P(c, "path") && t && v && m("path", Ct(v)), !P(c, "id") && t && v && m("id", Ct(v)), !P(c, "singularName") && t && v && m("singularName", xa(v));
2038
+ } = Y(), [O, w] = L(!1), [k, f] = L(!1), v = (S) => {
2039
+ m("name", S), !P(d, "path") && t && S && m("path", Ct(S)), !P(d, "id") && t && S && m("id", Ct(S)), !P(d, "singularName") && t && S && m("singularName", xa(S));
2040
2040
  };
2041
2041
  pe(() => {
2042
- d.id && h(!0);
2043
- }, [d.id]);
2044
- const y = ct(p), w = s?.filter((v) => !a?.includes(v)), {
2045
- inputFocused: q,
2046
- autoCompleteOpen: F,
2047
- setAutoCompleteOpen: A
2042
+ c.id && f(!0);
2043
+ }, [c.id]);
2044
+ const _ = ct(p), h = s?.filter((S) => !a?.includes(S)), {
2045
+ inputFocused: A,
2046
+ autoCompleteOpen: E,
2047
+ setAutoCompleteOpen: z
2048
2048
  } = wa({
2049
2049
  ref: l
2050
- }), S = !!o;
2051
- let E;
2050
+ }), q = !!o;
2051
+ let B;
2052
2052
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ht, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
2053
2053
  /* @__PURE__ */ n("div", { children: [
2054
2054
  /* @__PURE__ */ n(
@@ -2061,8 +2061,8 @@ function _i({
2061
2061
  ne,
2062
2062
  {
2063
2063
  shape: "square",
2064
- onClick: () => k(!0),
2065
- children: y
2064
+ onClick: () => w(!0),
2065
+ children: _
2066
2066
  }
2067
2067
  ) })
2068
2068
  ]
@@ -2079,37 +2079,37 @@ function _i({
2079
2079
  Te,
2080
2080
  {
2081
2081
  value: p.name ?? "",
2082
- onChange: (v) => _(v.target.value),
2082
+ onChange: (S) => v(S.target.value),
2083
2083
  label: "Name",
2084
2084
  required: !0,
2085
- error: c.name && !!d.name
2085
+ error: d.name && !!c.name
2086
2086
  }
2087
2087
  ),
2088
- /* @__PURE__ */ e(ie, { error: c.name && !!d.name, children: c.name && d.name ? d.name : "Name of in this collection, usually a plural name (e.g. Products)" })
2088
+ /* @__PURE__ */ e(ie, { error: d.name && !!c.name, children: d.name && c.name ? c.name : "Name of in this collection, usually a plural name (e.g. Products)" })
2089
2089
  ] }),
2090
- /* @__PURE__ */ n("div", { className: ke("col-span-12 ", S ? "" : "sm:col-span-8"), children: [
2090
+ /* @__PURE__ */ n("div", { className: xe("col-span-12 ", q ? "" : "sm:col-span-8"), children: [
2091
2091
  /* @__PURE__ */ e(
2092
- be,
2092
+ ye,
2093
2093
  {
2094
2094
  name: "path",
2095
- as: H,
2095
+ as: J,
2096
2096
  label: "Path",
2097
2097
  disabled: !t,
2098
2098
  required: !0,
2099
- error: c.path && !!d.path
2099
+ error: d.path && !!c.path
2100
2100
  }
2101
2101
  ),
2102
- /* @__PURE__ */ e(ie, { error: c.path && !!d.path, children: c.path && d.path ? d.path : "Path that this collection is stored in, in the database" })
2102
+ /* @__PURE__ */ e(ie, { error: d.path && !!c.path, children: d.path && c.path ? c.path : "Path that this collection is stored in, in the database" })
2103
2103
  ] }),
2104
- !S && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
2104
+ !q && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
2105
2105
  /* @__PURE__ */ e(
2106
2106
  Te,
2107
2107
  {
2108
- error: c.group && !!d.group,
2108
+ error: d.group && !!c.group,
2109
2109
  disabled: g,
2110
2110
  value: p.group ?? "",
2111
2111
  autoComplete: "off",
2112
- onChange: (v) => m("group", v.target.value),
2112
+ onChange: (S) => m("group", S.target.value),
2113
2113
  name: "group",
2114
2114
  inputRef: l,
2115
2115
  label: "Group"
@@ -2118,27 +2118,27 @@ function _i({
2118
2118
  /* @__PURE__ */ e(
2119
2119
  _a,
2120
2120
  {
2121
- open: F && (w ?? []).length > 0,
2122
- setOpen: A,
2123
- children: w?.map((v, V) => /* @__PURE__ */ e(
2121
+ open: E && (h ?? []).length > 0,
2122
+ setOpen: z,
2123
+ children: h?.map((S, N) => /* @__PURE__ */ e(
2124
2124
  ka,
2125
2125
  {
2126
2126
  onClick: () => {
2127
- A(!1), m("group", v ?? null);
2127
+ z(!1), m("group", S ?? null);
2128
2128
  },
2129
- children: /* @__PURE__ */ e("div", { className: "flex-grow", children: v })
2129
+ children: /* @__PURE__ */ e("div", { className: "flex-grow", children: S })
2130
2130
  },
2131
- V + "_" + v
2131
+ N + "_" + S
2132
2132
  ))
2133
2133
  }
2134
2134
  ),
2135
- /* @__PURE__ */ e(ie, { children: c.group && d.group ? d.group : "Group of the collection" })
2135
+ /* @__PURE__ */ e(ie, { children: d.group && c.group ? c.group : "Group of the collection" })
2136
2136
  ] }),
2137
2137
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2138
2138
  Ot,
2139
2139
  {
2140
- expanded: x,
2141
- onExpandedChange: h,
2140
+ expanded: k,
2141
+ onExpandedChange: f,
2142
2142
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2143
2143
  /* @__PURE__ */ e(Qe, {}),
2144
2144
  /* @__PURE__ */ e(
@@ -2156,21 +2156,21 @@ function _i({
2156
2156
  /* @__PURE__ */ e(
2157
2157
  Te,
2158
2158
  {
2159
- error: c.singularName && !!d.singularName,
2159
+ error: d.singularName && !!c.singularName,
2160
2160
  id: "singularName",
2161
2161
  "aria-describedby": "singularName-helper",
2162
- onChange: (v) => (f("singularName", !0), u(v)),
2162
+ onChange: (S) => (y("singularName", !0), u(S)),
2163
2163
  value: p.singularName ?? "",
2164
2164
  label: "Singular name"
2165
2165
  }
2166
2166
  ),
2167
- /* @__PURE__ */ e(ie, { error: c.singularName && !!d.singularName, children: c.singularName && d.singularName ? d.singularName : "Optionally define a singular name for your entities" })
2167
+ /* @__PURE__ */ e(ie, { error: d.singularName && !!c.singularName, children: d.singularName && c.singularName ? c.singularName : "Optionally define a singular name for your entities" })
2168
2168
  ] }),
2169
2169
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2170
2170
  /* @__PURE__ */ e(
2171
2171
  Te,
2172
2172
  {
2173
- error: c.description && !!d.description,
2173
+ error: d.description && !!c.description,
2174
2174
  id: "description",
2175
2175
  value: p.description ?? "",
2176
2176
  onChange: u,
@@ -2180,20 +2180,20 @@ function _i({
2180
2180
  label: "Description"
2181
2181
  }
2182
2182
  ),
2183
- /* @__PURE__ */ e(ie, { error: c.description && !!d.description, children: c.description && d.description ? d.description : "Description of the collection, you can use markdown" })
2183
+ /* @__PURE__ */ e(ie, { error: d.description && !!c.description, children: d.description && c.description ? c.description : "Description of the collection, you can use markdown" })
2184
2184
  ] }),
2185
2185
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2186
2186
  /* @__PURE__ */ e(
2187
- be,
2187
+ ye,
2188
2188
  {
2189
2189
  name: "id",
2190
- as: H,
2190
+ as: J,
2191
2191
  disabled: !t,
2192
2192
  label: "Collection id",
2193
- error: c.id && !!d.id
2193
+ error: d.id && !!c.id
2194
2194
  }
2195
2195
  ),
2196
- /* @__PURE__ */ e(ie, { error: c.id && !!d.id, children: c.id && d.id ? d.id : "This id identifies this collection" })
2196
+ /* @__PURE__ */ e(ie, { error: d.id && !!c.id, children: d.id && c.id ? c.id : "This id identifies this collection" })
2197
2197
  ] }),
2198
2198
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2199
2199
  Se,
@@ -2203,14 +2203,14 @@ function _i({
2203
2203
  position: "item-aligned",
2204
2204
  onChange: u,
2205
2205
  value: p.defaultSize ?? "",
2206
- renderValue: (v) => v.toUpperCase(),
2207
- children: ["xs", "s", "m", "l", "xl"].map((v) => /* @__PURE__ */ e(
2206
+ renderValue: (S) => S.toUpperCase(),
2207
+ children: ["xs", "s", "m", "l", "xl"].map((S) => /* @__PURE__ */ e(
2208
2208
  ee,
2209
2209
  {
2210
- value: v,
2211
- children: v.toUpperCase()
2210
+ value: S,
2211
+ children: S.toUpperCase()
2212
2212
  },
2213
- `size-select-${v}`
2213
+ `size-select-${S}`
2214
2214
  ))
2215
2215
  }
2216
2216
  ) }),
@@ -2220,14 +2220,14 @@ function _i({
2220
2220
  name: "customId",
2221
2221
  label: "Data IDs generation",
2222
2222
  position: "item-aligned",
2223
- disabled: E === "code_defined",
2224
- onValueChange: (v) => {
2225
- if (v === "code_defined")
2223
+ disabled: B === "code_defined",
2224
+ onValueChange: (S) => {
2225
+ if (S === "code_defined")
2226
2226
  throw new Error("This should not happen");
2227
- v === "true" ? m("customId", !0) : v === "false" ? m("customId", !1) : v === "optional" && m("customId", "optional");
2227
+ S === "true" ? m("customId", !0) : S === "false" ? m("customId", !1) : S === "optional" && m("customId", "optional");
2228
2228
  },
2229
2229
  value: "",
2230
- renderValue: (v) => v === "code_defined" ? "Code defined" : v === "true" ? "Users must define an ID" : v === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
2230
+ renderValue: (S) => S === "code_defined" ? "Code defined" : S === "true" ? "Users must define an ID" : S === "optional" ? "Users can define an ID, but it is not required" : "Document ID is generated automatically",
2231
2231
  children: [
2232
2232
  /* @__PURE__ */ e(ee, { value: "false", children: "Document ID is generated automatically" }),
2233
2233
  /* @__PURE__ */ e(ee, { value: "true", children: "Users must define an ID" }),
@@ -2241,7 +2241,7 @@ function _i({
2241
2241
  {
2242
2242
  position: "start",
2243
2243
  label: "Collection group",
2244
- onValueChange: (v) => m("collectionGroup", v),
2244
+ onValueChange: (S) => m("collectionGroup", S),
2245
2245
  value: p.collectionGroup ?? !1
2246
2246
  }
2247
2247
  ),
@@ -2256,15 +2256,15 @@ function _i({
2256
2256
  Ee,
2257
2257
  {
2258
2258
  open: O,
2259
- onOpenChange: k,
2259
+ onOpenChange: w,
2260
2260
  maxWidth: "xl",
2261
2261
  fullWidth: !0,
2262
2262
  children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
2263
2263
  wi,
2264
2264
  {
2265
2265
  selectedIcon: p.icon,
2266
- onIconSelected: (v) => {
2267
- k(!1), m("icon", v);
2266
+ onIconSelected: (S) => {
2267
+ w(!1), m("icon", S);
2268
2268
  }
2269
2269
  }
2270
2270
  ) })
@@ -2272,19 +2272,19 @@ function _i({
2272
2272
  )
2273
2273
  ] }) });
2274
2274
  }
2275
- function _e(t) {
2275
+ function ke(t) {
2276
2276
  return "properties." + t.replaceAll(".", ".properties.");
2277
2277
  }
2278
2278
  function ki(t) {
2279
2279
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
2280
2280
  }
2281
- function Ne(t) {
2281
+ function Pe(t) {
2282
2282
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
2283
2283
  }
2284
2284
  function ce(t, a) {
2285
2285
  return a ? `${a}.${t}` : t;
2286
2286
  }
2287
- const xi = L.memo(
2287
+ const xi = K.memo(
2288
2288
  function({
2289
2289
  enumValues: a,
2290
2290
  onValuesChanged: i,
@@ -2338,20 +2338,20 @@ function Ci({
2338
2338
  }) {
2339
2339
  const {
2340
2340
  setFieldValue: p
2341
- } = K(), [m, u] = L.useState(), [c, d] = L.useState(), [f, g] = L.useState(!1), O = L.useRef(/* @__PURE__ */ new Set()).current, k = (h, _) => {
2342
- const y = m === _;
2341
+ } = Y(), [m, u] = K.useState(), [d, c] = K.useState(), [y, g] = K.useState(!1), O = K.useRef(/* @__PURE__ */ new Set()).current, w = (f, v) => {
2342
+ const _ = m === v;
2343
2343
  return /* @__PURE__ */ e(
2344
2344
  Oi,
2345
2345
  {
2346
- index: h,
2346
+ index: f,
2347
2347
  disabled: i,
2348
2348
  enumValuesPath: r,
2349
- autoFocus: y,
2350
- shouldUpdateId: s || y,
2351
- onDialogOpen: () => d(h),
2352
- inferredEntry: O.has(t.enumValues[h]?.id)
2349
+ autoFocus: _,
2350
+ shouldUpdateId: s || _,
2351
+ onDialogOpen: () => c(f),
2352
+ inferredEntry: O.has(t.enumValues[f]?.id)
2353
2353
  },
2354
- `${_}`
2354
+ `${v}`
2355
2355
  );
2356
2356
  };
2357
2357
  return /* @__PURE__ */ n("div", { className: "col-span-12", children: [
@@ -2366,26 +2366,26 @@ function Ci({
2366
2366
  }
2367
2367
  ),
2368
2368
  o && /* @__PURE__ */ n(
2369
- B,
2369
+ U,
2370
2370
  {
2371
- loading: f,
2372
- disabled: i || f,
2371
+ loading: y,
2372
+ disabled: i || y,
2373
2373
  variant: "text",
2374
2374
  size: "small",
2375
2375
  onClick: async () => {
2376
- l && (g(!0), l?.().then((h) => {
2377
- if (!h)
2376
+ l && (g(!0), l?.().then((f) => {
2377
+ if (!f)
2378
2378
  return;
2379
- const _ = h.flat(), y = Array.from(new Set(_)), w = t.enumValues, F = ti(y).filter((A) => !w?.some((S) => S.id === A.id));
2380
- F.forEach((A) => {
2381
- O.add(A.id);
2382
- }), p(r, [...F, ...w]);
2383
- }).catch((h) => {
2384
- console.error(h);
2379
+ const v = f.flat(), _ = Array.from(new Set(v)), h = t.enumValues, E = ti(_).filter((z) => !h?.some((q) => q.id === z.id));
2380
+ E.forEach((z) => {
2381
+ O.add(z.id);
2382
+ }), p(r, [...E, ...h]);
2383
+ }).catch((f) => {
2384
+ console.error(f);
2385
2385
  }).finally(() => g(!1)));
2386
2386
  },
2387
2387
  children: [
2388
- f ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {}),
2388
+ y ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {}),
2389
2389
  "Infer values from data"
2390
2390
  ]
2391
2391
  }
@@ -2398,7 +2398,7 @@ function Ci({
2398
2398
  value: t.enumValues,
2399
2399
  addLabel: "Add enum value",
2400
2400
  name: r,
2401
- buildEntry: k,
2401
+ buildEntry: w,
2402
2402
  disabled: i,
2403
2403
  onInternalIdAdded: u,
2404
2404
  small: !0,
@@ -2407,18 +2407,18 @@ function Ci({
2407
2407
  }
2408
2408
  ),
2409
2409
  /* @__PURE__ */ e(
2410
- Pi,
2410
+ Ni,
2411
2411
  {
2412
- index: c,
2413
- open: c !== void 0,
2412
+ index: d,
2413
+ open: d !== void 0,
2414
2414
  enumValuesPath: r,
2415
- onClose: () => d(void 0)
2415
+ onClose: () => c(void 0)
2416
2416
  }
2417
2417
  )
2418
2418
  ] })
2419
2419
  ] });
2420
2420
  }
2421
- const Oi = L.memo(
2421
+ const Oi = K.memo(
2422
2422
  function({
2423
2423
  index: a,
2424
2424
  shouldUpdateId: i,
@@ -2431,27 +2431,27 @@ const Oi = L.memo(
2431
2431
  const {
2432
2432
  values: m,
2433
2433
  handleChange: u,
2434
- errors: c,
2435
- setFieldValue: d,
2436
- touched: f
2437
- } = K(), g = L.useRef(!P(m, `${r}[${a}].id`)), b = i || g.current, O = P(m, `${r}[${a}].id`), k = P(m, `${r}[${a}].label`), x = P(c, `${r}[${a}].label`), h = L.useRef(k);
2438
- return L.useEffect(() => {
2439
- (h.current === O || !O) && b && d(`${r}[${a}].id`, k), h.current = k;
2440
- }, [k]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
2434
+ errors: d,
2435
+ setFieldValue: c,
2436
+ touched: y
2437
+ } = Y(), g = K.useRef(!P(m, `${r}[${a}].id`)), b = i || g.current, O = P(m, `${r}[${a}].id`), w = P(m, `${r}[${a}].label`), k = P(d, `${r}[${a}].label`), f = K.useRef(w);
2438
+ return K.useEffect(() => {
2439
+ (f.current === O || !O) && b && c(`${r}[${a}].id`, w), f.current = w;
2440
+ }, [w]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
2441
2441
  /* @__PURE__ */ e(
2442
2442
  de,
2443
2443
  {
2444
2444
  name: `${r}[${a}].label`,
2445
- as: H,
2445
+ as: J,
2446
2446
  className: "flex-grow",
2447
2447
  required: !0,
2448
2448
  disabled: l,
2449
2449
  size: "small",
2450
- validate: Ni,
2450
+ validate: Pi,
2451
2451
  autoFocus: s,
2452
2452
  autoComplete: "off",
2453
2453
  endAdornment: p && /* @__PURE__ */ e(gt, { size: "small" }),
2454
- error: !!x
2454
+ error: !!k
2455
2455
  }
2456
2456
  ),
2457
2457
  !l && /* @__PURE__ */ e(
@@ -2470,7 +2470,7 @@ const Oi = L.memo(
2470
2470
  return a.index === i.index && a.enumValuesPath === i.enumValuesPath && a.shouldUpdateId === i.shouldUpdateId && a.inferredEntry === i.inferredEntry && a.autoFocus === i.autoFocus;
2471
2471
  }
2472
2472
  );
2473
- function Pi({
2473
+ function Ni({
2474
2474
  index: t,
2475
2475
  open: a,
2476
2476
  onClose: i,
@@ -2482,21 +2482,21 @@ function Pi({
2482
2482
  errors: l,
2483
2483
  setFieldValue: p,
2484
2484
  touched: m
2485
- } = K(), u = t !== void 0 ? P(l, `${r}[${t}].id`) : void 0;
2485
+ } = Y(), u = t !== void 0 ? P(l, `${r}[${t}].id`) : void 0;
2486
2486
  return /* @__PURE__ */ n(
2487
2487
  Ee,
2488
2488
  {
2489
2489
  maxWidth: "md",
2490
2490
  "aria-labelledby": "enum-edit-dialog",
2491
2491
  open: a,
2492
- onOpenChange: (c) => c ? void 0 : i(),
2492
+ onOpenChange: (d) => d ? void 0 : i(),
2493
2493
  children: [
2494
2494
  /* @__PURE__ */ e($e, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
2495
2495
  /* @__PURE__ */ e(
2496
2496
  de,
2497
2497
  {
2498
2498
  name: `${r}[${t}]id`,
2499
- as: H,
2499
+ as: J,
2500
2500
  required: !0,
2501
2501
  validate: Si,
2502
2502
  label: "ID",
@@ -2508,7 +2508,7 @@ function Pi({
2508
2508
  /* @__PURE__ */ e(ie, { error: !!u, children: u ?? "Value saved in the data source" })
2509
2509
  ] }) }),
2510
2510
  /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(
2511
- B,
2511
+ U,
2512
2512
  {
2513
2513
  autoFocus: !0,
2514
2514
  variant: "outlined",
@@ -2521,7 +2521,7 @@ function Pi({
2521
2521
  }
2522
2522
  );
2523
2523
  }
2524
- function Ni(t) {
2524
+ function Pi(t) {
2525
2525
  let a;
2526
2526
  return t || (a = "You must specify a label"), a;
2527
2527
  }
@@ -2530,8 +2530,8 @@ function Si(t) {
2530
2530
  return t || (a = "You must specify an ID"), a;
2531
2531
  }
2532
2532
  function Me({ disabled: t }) {
2533
- const { values: a, handleChange: i } = K(), r = "validation.required", s = "validation.requiredMessage";
2534
- return /* @__PURE__ */ n(M, { children: [
2533
+ const { values: a, handleChange: i } = Y(), r = "validation.required", s = "validation.requiredMessage";
2534
+ return /* @__PURE__ */ n($, { children: [
2535
2535
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2536
2536
  de,
2537
2537
  {
@@ -2555,7 +2555,7 @@ function Me({ disabled: t }) {
2555
2555
  }
2556
2556
  ) }),
2557
2557
  P(a, r) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2558
- H,
2558
+ J,
2559
2559
  {
2560
2560
  disabled: t,
2561
2561
  value: P(a, s),
@@ -2580,9 +2580,9 @@ function Ue({
2580
2580
  }) {
2581
2581
  const {
2582
2582
  values: u,
2583
- handleChange: c,
2584
- errors: d
2585
- } = K(), f = "validation.length", g = "validation.min", b = "validation.max", O = "validation.trim", k = "validation.matches", x = "validation.lowercase", h = "validation.uppercase", _ = P(d, k), y = P(u, k), w = typeof y == "string" ? y : Pa(y);
2583
+ handleChange: d,
2584
+ errors: c
2585
+ } = Y(), y = "validation.length", g = "validation.min", b = "validation.max", O = "validation.trim", w = "validation.matches", k = "validation.lowercase", f = "validation.uppercase", v = P(c, w), _ = P(u, w), h = typeof _ == "string" ? _ : Na(_);
2586
2586
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2587
2587
  /* @__PURE__ */ e(Me, { disabled: p }),
2588
2588
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
@@ -2590,7 +2590,7 @@ function Ue({
2590
2590
  de,
2591
2591
  {
2592
2592
  type: "checkbox",
2593
- name: x,
2593
+ name: k,
2594
2594
  label: "Lowercase",
2595
2595
  disabled: p,
2596
2596
  component: he
@@ -2600,7 +2600,7 @@ function Ue({
2600
2600
  de,
2601
2601
  {
2602
2602
  type: "checkbox",
2603
- name: h,
2603
+ name: f,
2604
2604
  label: "Uppercase",
2605
2605
  disabled: p,
2606
2606
  component: he
@@ -2619,19 +2619,19 @@ function Ue({
2619
2619
  ] }),
2620
2620
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
2621
2621
  t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2622
- H,
2622
+ J,
2623
2623
  {
2624
- value: P(u, f),
2624
+ value: P(u, y),
2625
2625
  label: "Exact length",
2626
- name: f,
2626
+ name: y,
2627
2627
  type: "number",
2628
2628
  size: "small",
2629
2629
  disabled: p,
2630
- onChange: c
2630
+ onChange: d
2631
2631
  }
2632
2632
  ) }),
2633
2633
  s && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2634
- H,
2634
+ J,
2635
2635
  {
2636
2636
  value: P(u, g),
2637
2637
  label: "Min length",
@@ -2639,11 +2639,11 @@ function Ue({
2639
2639
  type: "number",
2640
2640
  size: "small",
2641
2641
  disabled: p,
2642
- onChange: c
2642
+ onChange: d
2643
2643
  }
2644
2644
  ) }),
2645
2645
  r && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2646
- H,
2646
+ J,
2647
2647
  {
2648
2648
  value: P(u, b),
2649
2649
  label: "Max length",
@@ -2651,7 +2651,7 @@ function Ue({
2651
2651
  type: "number",
2652
2652
  size: "small",
2653
2653
  disabled: p,
2654
- onChange: c
2654
+ onChange: d
2655
2655
  }
2656
2656
  ) })
2657
2657
  ] }),
@@ -2659,17 +2659,17 @@ function Ue({
2659
2659
  /* @__PURE__ */ e(
2660
2660
  de,
2661
2661
  {
2662
- name: k,
2663
- as: H,
2664
- validate: (q) => q && !Na(q),
2662
+ name: w,
2663
+ as: J,
2664
+ validate: (A) => A && !Pa(A),
2665
2665
  label: "Matches regex",
2666
2666
  size: "small",
2667
2667
  disabled: p,
2668
- value: w,
2669
- error: !!_
2668
+ value: h,
2669
+ error: !!v
2670
2670
  }
2671
2671
  ),
2672
- /* @__PURE__ */ e(ie, { error: !!_, children: _ ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
2672
+ /* @__PURE__ */ e(ie, { error: !!v, children: v ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
2673
2673
  ] })
2674
2674
  ] });
2675
2675
  }
@@ -2681,11 +2681,11 @@ function At({
2681
2681
  const {
2682
2682
  values: r,
2683
2683
  handleChange: s
2684
- } = K(), o = "validation.min", l = "validation.max";
2684
+ } = Y(), o = "validation.min", l = "validation.max";
2685
2685
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2686
2686
  /* @__PURE__ */ e(Me, { disabled: i }),
2687
2687
  a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2688
- H,
2688
+ J,
2689
2689
  {
2690
2690
  value: P(r, o),
2691
2691
  disabled: i,
@@ -2697,7 +2697,7 @@ function At({
2697
2697
  }
2698
2698
  ) }),
2699
2699
  t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2700
- H,
2700
+ J,
2701
2701
  {
2702
2702
  value: P(r, l),
2703
2703
  disabled: i,
@@ -2747,25 +2747,25 @@ function Bt({
2747
2747
  handleChange: p,
2748
2748
  errors: m,
2749
2749
  touched: u,
2750
- setFieldError: c,
2751
- setFieldValue: d
2752
- } = K(), f = De(), g = t ? "of.enumValues" : "enumValues", b = P(l, "defaultValue"), O = P(l, g), k = Kt(() => !O || typeof O == "boolean" ? [] : qa(O) ?? [], [O]);
2753
- return /* @__PURE__ */ n(M, { children: [
2750
+ setFieldError: d,
2751
+ setFieldValue: c
2752
+ } = Y(), y = De(), g = t ? "of.enumValues" : "enumValues", b = P(l, "defaultValue"), O = P(l, g), w = Kt(() => !O || typeof O == "boolean" ? [] : qa(O) ?? [], [O]);
2753
+ return /* @__PURE__ */ n($, { children: [
2754
2754
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2755
2755
  xi,
2756
2756
  {
2757
- enumValues: k,
2757
+ enumValues: w,
2758
2758
  updateIds: a,
2759
2759
  disabled: i,
2760
2760
  allowDataInference: s,
2761
- onError: (h) => {
2762
- c(g, h ? "" : void 0);
2761
+ onError: (f) => {
2762
+ d(g, f ? "" : void 0);
2763
2763
  },
2764
- getData: o ? () => o().then((h) => h.map((_) => l.id && P(_, l.id)).filter(Boolean)) : void 0,
2765
- onValuesChanged: (h) => {
2766
- if (l && (d(g, h), !t)) {
2767
- const _ = h.filter((y) => !!y?.id).map((y) => y.id);
2768
- b && !_.includes(b) && (d("defaultValue", void 0), f.open({
2764
+ getData: o ? () => o().then((f) => f.map((v) => l.id && P(v, l.id)).filter(Boolean)) : void 0,
2765
+ onValuesChanged: (f) => {
2766
+ if (l && (c(g, f), !t)) {
2767
+ const v = f.filter((_) => !!_?.id).map((_) => _.id);
2768
+ b && !v.includes(b) && (c("defaultValue", void 0), y.open({
2769
2769
  type: "warning",
2770
2770
  message: "Default value was cleared"
2771
2771
  }));
@@ -2788,18 +2788,18 @@ function Bt({
2788
2788
  {
2789
2789
  disabled: i,
2790
2790
  position: "item-aligned",
2791
- onValueChange: (h) => {
2792
- d("defaultValue", h);
2791
+ onValueChange: (f) => {
2792
+ c("defaultValue", f);
2793
2793
  },
2794
2794
  label: "Default value",
2795
2795
  value: b ?? "",
2796
- children: k.filter((h) => !!h?.id).map((h) => /* @__PURE__ */ e(
2796
+ children: w.filter((f) => !!f?.id).map((f) => /* @__PURE__ */ e(
2797
2797
  ee,
2798
2798
  {
2799
- value: h.id?.toString(),
2800
- children: h.label
2799
+ value: f.id?.toString(),
2800
+ children: f.label
2801
2801
  },
2802
- h.id
2802
+ f.id
2803
2803
  ))
2804
2804
  }
2805
2805
  ) })
@@ -2820,10 +2820,10 @@ function Mt({
2820
2820
  const {
2821
2821
  values: r,
2822
2822
  setFieldValue: s
2823
- } = K(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, p = `${o}.fileName`, m = `${o}.storagePath`, u = `${o}.storeUrl`, c = P(r, p) ?? "{rand}_{file}", d = P(r, m) ?? "/", f = P(r, l), g = Array.isArray(f) ? f : void 0, b = !g || g.length === 0, O = (h) => {
2824
- h ? h.includes("all") || h.length >= Object.keys(nt).length ? s(l, void 0) : b ? s(l, Object.keys(nt).filter((_) => !h.includes(_))) : s(l, h) : s(l, void 0);
2825
- }, k = typeof c == "function", x = typeof d == "function";
2826
- return /* @__PURE__ */ n(M, { children: [
2823
+ } = Y(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, p = `${o}.fileName`, m = `${o}.storagePath`, u = `${o}.storeUrl`, d = P(r, p) ?? "{rand}_{file}", c = P(r, m) ?? "/", y = P(r, l), g = Array.isArray(y) ? y : void 0, b = !g || g.length === 0, O = (f) => {
2824
+ f ? f.includes("all") || f.length >= Object.keys(nt).length ? s(l, void 0) : b ? s(l, Object.keys(nt).filter((v) => !f.includes(v))) : s(l, f) : s(l, void 0);
2825
+ }, w = typeof d == "function", k = typeof c == "function";
2826
+ return /* @__PURE__ */ n($, { children: [
2827
2827
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2828
2828
  Ot,
2829
2829
  {
@@ -2847,7 +2847,7 @@ function Mt({
2847
2847
  value: g ?? [],
2848
2848
  onMultiValueChange: O,
2849
2849
  label: b ? void 0 : "Allowed file types",
2850
- renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((_) => nt[_]).filter((_) => !!_).join(", "),
2850
+ renderValues: (f) => !f || f.length === 0 ? "All file types allowed" : f.map((v) => nt[v]).filter((v) => !!v).join(", "),
2851
2851
  children: [
2852
2852
  /* @__PURE__ */ n(zt, { value: "all", className: "flex items-center gap-2", children: [
2853
2853
  /* @__PURE__ */ e(
@@ -2858,48 +2858,48 @@ function Mt({
2858
2858
  ),
2859
2859
  "All"
2860
2860
  ] }, "all"),
2861
- Object.entries(nt).map(([h, _]) => /* @__PURE__ */ n(zt, { value: h, className: "flex items-center gap-2", children: [
2861
+ Object.entries(nt).map(([f, v]) => /* @__PURE__ */ n(zt, { value: f, className: "flex items-center gap-2", children: [
2862
2862
  /* @__PURE__ */ e(
2863
2863
  Tt,
2864
2864
  {
2865
- checked: b || g.indexOf(h) > -1
2865
+ checked: b || g.indexOf(f) > -1
2866
2866
  }
2867
2867
  ),
2868
- /* @__PURE__ */ e("div", { className: "flex-grow", children: _ }),
2868
+ /* @__PURE__ */ e("div", { className: "flex-grow", children: v }),
2869
2869
  /* @__PURE__ */ e(
2870
- B,
2870
+ U,
2871
2871
  {
2872
2872
  size: "small",
2873
2873
  variant: "outlined",
2874
- onClick: (y) => (y.preventDefault(), y.stopPropagation(), s(l, [h])),
2874
+ onClick: (_) => (_.preventDefault(), _.stopPropagation(), s(l, [f])),
2875
2875
  children: "Only"
2876
2876
  }
2877
2877
  )
2878
- ] }, h))
2878
+ ] }, f))
2879
2879
  ]
2880
2880
  }
2881
2881
  ) }),
2882
2882
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2883
- be,
2883
+ ye,
2884
2884
  {
2885
2885
  name: p,
2886
- as: H,
2886
+ as: J,
2887
2887
  label: "File name",
2888
2888
  size: "small",
2889
- disabled: k || i,
2890
- value: k ? "-" : c
2889
+ disabled: w || i,
2890
+ value: w ? "-" : d
2891
2891
  }
2892
2892
  ) }),
2893
2893
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2894
2894
  /* @__PURE__ */ e(
2895
- be,
2895
+ ye,
2896
2896
  {
2897
2897
  name: m,
2898
- as: H,
2898
+ as: J,
2899
2899
  label: "Storage path",
2900
- disabled: x || i,
2900
+ disabled: k || i,
2901
2901
  size: "small",
2902
- value: x ? "-" : d
2902
+ value: k ? "-" : c
2903
2903
  }
2904
2904
  ),
2905
2905
  /* @__PURE__ */ n(C, { variant: "caption", className: "ml-3.5 mt-1 mb-2", children: [
@@ -2915,7 +2915,7 @@ function Mt({
2915
2915
  ] })
2916
2916
  ] }),
2917
2917
  /* @__PURE__ */ e(
2918
- be,
2918
+ ye,
2919
2919
  {
2920
2920
  type: "checkbox",
2921
2921
  name: u,
@@ -2965,7 +2965,7 @@ function oa({
2965
2965
  selected: o
2966
2966
  }) {
2967
2967
  const { propertyConfigs: l } = Ke(), p = Ze(t, l);
2968
- return Je(t), /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ n(
2968
+ return Je(t), /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ n(
2969
2969
  "div",
2970
2970
  {
2971
2971
  onClick: a,
@@ -2975,7 +2975,7 @@ function oa({
2975
2975
  /* @__PURE__ */ n(
2976
2976
  qe,
2977
2977
  {
2978
- className: ke(
2978
+ className: xe(
2979
2979
  "pl-2 w-full flex flex-row gap-4 items-center",
2980
2980
  Jt,
2981
2981
  a ? Qt : "",
@@ -2985,7 +2985,7 @@ function oa({
2985
2985
  ),
2986
2986
  children: [
2987
2987
  /* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
2988
- r && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2988
+ r && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
2989
2989
  C,
2990
2990
  {
2991
2991
  variant: "body1",
@@ -2995,7 +2995,7 @@ function oa({
2995
2995
  }
2996
2996
  ) }),
2997
2997
  /* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
2998
- /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2998
+ /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
2999
2999
  C,
3000
3000
  {
3001
3001
  className: "flex-grow pr-2",
@@ -3005,7 +3005,7 @@ function oa({
3005
3005
  children: p?.name
3006
3006
  }
3007
3007
  ) }),
3008
- /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3008
+ /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3009
3009
  C,
3010
3010
  {
3011
3011
  variant: "body2",
@@ -3051,7 +3051,7 @@ function Ai({
3051
3051
  /* @__PURE__ */ e(
3052
3052
  qe,
3053
3053
  {
3054
- className: ke(
3054
+ className: xe(
3055
3055
  "pl-2 w-full flex flex-row gap-4 items-center",
3056
3056
  Jt,
3057
3057
  i ? Qt : "",
@@ -3080,7 +3080,7 @@ function Ai({
3080
3080
  children: o?.name
3081
3081
  }
3082
3082
  ),
3083
- r && !oe(r) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3083
+ r && !oe(r) && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3084
3084
  C,
3085
3085
  {
3086
3086
  variant: "body2",
@@ -3089,7 +3089,7 @@ function Ai({
3089
3089
  children: r.dataType
3090
3090
  }
3091
3091
  ) }),
3092
- r && oe(r) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3092
+ r && oe(r) && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3093
3093
  C,
3094
3094
  {
3095
3095
  variant: "body2",
@@ -3098,7 +3098,7 @@ function Ai({
3098
3098
  children: "This property is defined as a property builder in code"
3099
3099
  }
3100
3100
  ) }),
3101
- !r && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3101
+ !r && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3102
3102
  C,
3103
3103
  {
3104
3104
  variant: "body2",
@@ -3126,48 +3126,48 @@ function ft({
3126
3126
  onPropertyMove: p,
3127
3127
  onPropertyRemove: m,
3128
3128
  className: u,
3129
- inferredPropertyKeys: c,
3130
- collectionEditable: d
3129
+ inferredPropertyKeys: d,
3130
+ collectionEditable: c
3131
3131
  }) {
3132
- const f = s ?? Object.keys(r), g = X((b) => {
3132
+ const y = s ?? Object.keys(r), g = Z((b) => {
3133
3133
  if (!b.destination)
3134
3134
  return;
3135
- const O = b.source.index, k = b.destination.index, x = Array.from(f), [h] = x.splice(O, 1);
3136
- x.splice(k, 0, h), p && p(x, t);
3137
- }, [t, p, f]);
3138
- return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ri, { onDragEnd: g, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${t}`, children: (b, O) => /* @__PURE__ */ n(
3135
+ const O = b.source.index, w = b.destination.index, k = Array.from(y), [f] = k.splice(O, 1);
3136
+ k.splice(w, 0, f), p && p(k, t);
3137
+ }, [t, p, y]);
3138
+ return /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(ri, { onDragEnd: g, children: /* @__PURE__ */ e(oi, { droppableId: `droppable_${t}`, children: (b, O) => /* @__PURE__ */ n(
3139
3139
  "div",
3140
3140
  {
3141
3141
  ...b.droppableProps,
3142
3142
  ref: b.innerRef,
3143
3143
  className: u,
3144
3144
  children: [
3145
- f && f.map((k, x) => {
3146
- const h = r[k], _ = o?.find((y) => y.key === k);
3147
- return !h && !_ ? (console.warn(`Property ${k} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
3145
+ y && y.map((w, k) => {
3146
+ const f = r[w], v = o?.find((_) => _.key === w);
3147
+ return !f && !v ? (console.warn(`Property ${w} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
3148
3148
  ni,
3149
3149
  {
3150
- draggableId: `array_field_${t}_${k}}`,
3151
- index: x,
3152
- children: (y, w) => /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3150
+ draggableId: `array_field_${t}_${w}}`,
3151
+ index: k,
3152
+ children: (_, h) => /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
3153
3153
  zi,
3154
3154
  {
3155
- propertyKey: k,
3156
- propertyOrBuilder: h,
3157
- additionalField: _,
3158
- provided: y,
3155
+ propertyKey: w,
3156
+ propertyOrBuilder: f,
3157
+ additionalField: v,
3158
+ provided: _,
3159
3159
  errors: l,
3160
3160
  namespace: t,
3161
- inferredPropertyKeys: c,
3161
+ inferredPropertyKeys: d,
3162
3162
  onPropertyMove: p,
3163
3163
  onPropertyRemove: m,
3164
- onPropertyClick: w.isDragging ? void 0 : i,
3164
+ onPropertyClick: h.isDragging ? void 0 : i,
3165
3165
  selectedPropertyKey: a,
3166
- collectionEditable: d
3166
+ collectionEditable: c
3167
3167
  }
3168
3168
  ) })
3169
3169
  },
3170
- `array_field_${t}_${k}}`
3170
+ `array_field_${t}_${w}}`
3171
3171
  );
3172
3172
  }).filter(Boolean),
3173
3173
  b.placeholder
@@ -3186,29 +3186,29 @@ function zi({
3186
3186
  onPropertyClick: p,
3187
3187
  onPropertyMove: m,
3188
3188
  onPropertyRemove: u,
3189
- inferredPropertyKeys: c,
3190
- collectionEditable: d
3189
+ inferredPropertyKeys: d,
3190
+ collectionEditable: c
3191
3191
  }) {
3192
- const f = c?.includes(a ? `${a}.${t}` : t), g = ce(t, a);
3192
+ const y = d?.includes(a ? `${a}.${t}` : t), g = ce(t, a);
3193
3193
  let b;
3194
3194
  if (typeof i == "object") {
3195
- const h = i;
3196
- h.dataType === "map" && h.properties && (b = /* @__PURE__ */ e(
3195
+ const f = i;
3196
+ f.dataType === "map" && f.properties && (b = /* @__PURE__ */ e(
3197
3197
  ft,
3198
3198
  {
3199
3199
  selectedPropertyKey: o,
3200
3200
  namespace: g,
3201
- properties: h.properties,
3202
- propertiesOrder: h.propertiesOrder,
3201
+ properties: f.properties,
3202
+ propertiesOrder: f.propertiesOrder,
3203
3203
  errors: l,
3204
3204
  onPropertyClick: p,
3205
3205
  onPropertyMove: m,
3206
3206
  onPropertyRemove: u,
3207
- collectionEditable: d
3207
+ collectionEditable: c
3208
3208
  }
3209
3209
  ));
3210
3210
  }
3211
- const O = g ? P(l, _e(g)) : !1, k = o === g, x = i && (d && !oe(i) || Je(i));
3211
+ const O = g ? P(l, ke(g)) : !1, w = o === g, k = i && (c && !oe(i) || Je(i));
3212
3212
  return /* @__PURE__ */ n(
3213
3213
  "div",
3214
3214
  {
@@ -3220,7 +3220,7 @@ function zi({
3220
3220
  b && /* @__PURE__ */ e(
3221
3221
  "div",
3222
3222
  {
3223
- className: "absolute border-l " + Pt,
3223
+ className: "absolute border-l " + Nt,
3224
3224
  style: {
3225
3225
  left: "32px",
3226
3226
  top: "64px",
@@ -3228,13 +3228,13 @@ function zi({
3228
3228
  }
3229
3229
  }
3230
3230
  ),
3231
- !oe(i) && !r && x ? /* @__PURE__ */ e(
3231
+ !oe(i) && !r && k ? /* @__PURE__ */ e(
3232
3232
  oa,
3233
3233
  {
3234
3234
  property: i,
3235
3235
  onClick: p ? () => p(t, a) : void 0,
3236
3236
  includeName: !0,
3237
- selected: k,
3237
+ selected: w,
3238
3238
  hasError: O
3239
3239
  }
3240
3240
  ) : /* @__PURE__ */ e(
@@ -3243,11 +3243,11 @@ function zi({
3243
3243
  name: t,
3244
3244
  property: i,
3245
3245
  onClick: p ? () => p(t, a) : void 0,
3246
- selected: k
3246
+ selected: w
3247
3247
  }
3248
3248
  ),
3249
3249
  /* @__PURE__ */ n("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
3250
- f && /* @__PURE__ */ e(re, { title: "Inferred property", children: /* @__PURE__ */ e(gt, { size: "small", className: "p-2" }) }),
3250
+ y && /* @__PURE__ */ e(re, { title: "Inferred property", children: /* @__PURE__ */ e(gt, { size: "small", className: "p-2" }) }),
3251
3251
  u && /* @__PURE__ */ e(re, { title: "Remove", children: /* @__PURE__ */ e(
3252
3252
  ne,
3253
3253
  {
@@ -3275,24 +3275,24 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3275
3275
  const {
3276
3276
  values: o,
3277
3277
  setFieldValue: l
3278
- } = K(), [p, m] = $(!1), [u, c] = $(), [d, f] = $(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), b = X(({
3279
- id: w,
3280
- property: q
3278
+ } = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), g = o.propertiesOrder ?? Object.keys(o.properties ?? {}), b = Z(({
3279
+ id: h,
3280
+ property: A
3281
3281
  }) => {
3282
- if (!w)
3282
+ if (!h)
3283
3283
  throw Error();
3284
3284
  l("properties", {
3285
3285
  ...o.properties ?? {},
3286
- [w]: q
3287
- }, !1), l("propertiesOrder", [...g, w], !1), m(!1);
3288
- }, [o.properties, g]), O = X((w, q) => {
3289
- const F = w ? ce(w, q) : void 0;
3290
- if (!F)
3286
+ [h]: A
3287
+ }, !1), l("propertiesOrder", [...g, h], !1), m(!1);
3288
+ }, [o.properties, g]), O = Z((h, A) => {
3289
+ const E = h ? ce(h, A) : void 0;
3290
+ if (!E)
3291
3291
  throw Error("collection editor miss config");
3292
- const A = _e(F), S = Ne(q), E = P(o, S) ?? Object.keys(P(o, ki(q)));
3293
- l(A, void 0, !1), l(S, E.filter((v) => v !== w), !1), m(!1), c(void 0), f(void 0);
3294
- }, [l, o]), k = u ? ce(u, d) : void 0, x = k ? P(o.properties, k.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ n(
3295
- B,
3292
+ const z = ke(E), q = Pe(A), B = P(o, q) ?? Object.keys(P(o, ki(A)));
3293
+ l(z, void 0, !1), l(q, B.filter((S) => S !== h), !1), m(!1), d(void 0), y(void 0);
3294
+ }, [l, o]), w = u ? ce(u, c) : void 0, k = w ? P(o.properties, w.replaceAll(".", ".properties.")) : void 0, f = /* @__PURE__ */ n(
3295
+ U,
3296
3296
  {
3297
3297
  color: "primary",
3298
3298
  variant: "outlined",
@@ -3303,14 +3303,14 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3303
3303
  o.name ?? "this group"
3304
3304
  ]
3305
3305
  }
3306
- ), _ = !g || g.length < 1, y = X((w, q) => {
3307
- l(Ne(q), w, !1);
3306
+ ), v = !g || g.length < 1, _ = Z((h, A) => {
3307
+ l(Pe(A), h, !1);
3308
3308
  }, []);
3309
- return /* @__PURE__ */ n(M, { children: [
3309
+ return /* @__PURE__ */ n($, { children: [
3310
3310
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3311
3311
  /* @__PURE__ */ n("div", { className: "flex justify-between items-end my-4", children: [
3312
3312
  /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Properties in this group" }),
3313
- h
3313
+ f
3314
3314
  ] }),
3315
3315
  /* @__PURE__ */ n(qe, { className: "p-2 pl-8", children: [
3316
3316
  /* @__PURE__ */ e(
@@ -3320,13 +3320,13 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3320
3320
  propertiesOrder: g,
3321
3321
  errors: {},
3322
3322
  collectionEditable: s,
3323
- onPropertyClick: (w, q) => {
3324
- c(w), f(q), m(!0);
3323
+ onPropertyClick: (h, A) => {
3324
+ d(h), y(A), m(!0);
3325
3325
  },
3326
- onPropertyMove: y
3326
+ onPropertyMove: _
3327
3327
  }
3328
3328
  ),
3329
- _ && /* @__PURE__ */ e(
3329
+ v && /* @__PURE__ */ e(
3330
3330
  C,
3331
3331
  {
3332
3332
  variant: "label",
@@ -3343,7 +3343,7 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3343
3343
  position: "start",
3344
3344
  size: "small",
3345
3345
  label: "Spread children as columns",
3346
- onValueChange: (w) => l("spreadChildren", w),
3346
+ onValueChange: (h) => l("spreadChildren", h),
3347
3347
  value: o.spreadChildren ?? !1
3348
3348
  }
3349
3349
  ),
@@ -3358,16 +3358,16 @@ function Ti({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3358
3358
  allowDataInference: i,
3359
3359
  collectionEditable: s,
3360
3360
  onCancel: () => {
3361
- m(!1), c(void 0), f(void 0);
3361
+ m(!1), d(void 0), y(void 0);
3362
3362
  },
3363
3363
  onOkClicked: () => {
3364
- m(!1), c(void 0), f(void 0);
3364
+ m(!1), d(void 0), y(void 0);
3365
3365
  },
3366
3366
  getData: a,
3367
3367
  onDelete: O,
3368
3368
  propertyKey: u,
3369
- propertyNamespace: d,
3370
- property: x,
3369
+ propertyNamespace: c,
3370
+ property: k,
3371
3371
  existingProperty: !!u,
3372
3372
  autoUpdateId: !u,
3373
3373
  autoOpenTypeSelect: !u,
@@ -3391,20 +3391,20 @@ function Vi({
3391
3391
  values: p,
3392
3392
  handleChange: m,
3393
3393
  errors: u,
3394
- setFieldValue: c,
3395
- touched: d
3396
- } = K(), [f, g] = $(!1), b = P(p, "of"), O = P(d, "of") && P(u, "of"), k = X(({ id: h, property: _, namespace: y }) => {
3397
- c("of", _);
3398
- }, []), x = b && Ze(b, o);
3399
- return /* @__PURE__ */ n(M, { children: [
3394
+ setFieldValue: d,
3395
+ touched: c
3396
+ } = Y(), [y, g] = L(!1), b = P(p, "of"), O = P(c, "of") && P(u, "of"), w = Z(({ id: f, property: v, namespace: _ }) => {
3397
+ d("of", v);
3398
+ }, []), k = b && Ze(b, o);
3399
+ return /* @__PURE__ */ n($, { children: [
3400
3400
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3401
3401
  /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Repeat component" }),
3402
3402
  /* @__PURE__ */ e(
3403
- be,
3403
+ ye,
3404
3404
  {
3405
3405
  name: "of",
3406
3406
  value: b,
3407
- validate: (h) => h?.dataType ? void 0 : "You need to specify a repeat field",
3407
+ validate: (f) => f?.dataType ? void 0 : "You need to specify a repeat field",
3408
3408
  children: () => /* @__PURE__ */ n(qe, { className: "p-2 mt-4", children: [
3409
3409
  b && /* @__PURE__ */ e(
3410
3410
  oa,
@@ -3418,7 +3418,7 @@ function Vi({
3418
3418
  }
3419
3419
  ),
3420
3420
  !i && !b && /* @__PURE__ */ n(
3421
- B,
3421
+ U,
3422
3422
  {
3423
3423
  variant: "text",
3424
3424
  size: "large",
@@ -3426,7 +3426,7 @@ function Vi({
3426
3426
  onClick: () => g(!0),
3427
3427
  children: [
3428
3428
  "Edit ",
3429
- `${x ? x.name : "repeat component"}`
3429
+ `${k ? k.name : "repeat component"}`
3430
3430
  ]
3431
3431
  }
3432
3432
  ),
@@ -3434,7 +3434,7 @@ function Vi({
3434
3434
  je,
3435
3435
  {
3436
3436
  inArray: !0,
3437
- open: f,
3437
+ open: y,
3438
3438
  existingProperty: a,
3439
3439
  getData: r,
3440
3440
  autoUpdateId: !a,
@@ -3443,7 +3443,7 @@ function Vi({
3443
3443
  allowDataInference: s,
3444
3444
  property: b,
3445
3445
  includeIdAndName: !1,
3446
- onPropertyChanged: k,
3446
+ onPropertyChanged: w,
3447
3447
  forceShowErrors: t,
3448
3448
  propertyConfigs: o,
3449
3449
  collectionEditable: l
@@ -3456,7 +3456,7 @@ function Vi({
3456
3456
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(At, { disabled: i }) }) })
3457
3457
  ] });
3458
3458
  }
3459
- const Ii = L.forwardRef(
3459
+ const Ii = K.forwardRef(
3460
3460
  function({
3461
3461
  showErrors: a,
3462
3462
  disabledId: i,
@@ -3466,15 +3466,15 @@ const Ii = L.forwardRef(
3466
3466
  }, l) {
3467
3467
  const {
3468
3468
  errors: p
3469
- } = K(), m = "name", u = a && P(p, m), c = "id", d = a && P(p, c), f = "description", g = a && P(p, f);
3469
+ } = Y(), m = "name", u = a && P(p, m), d = "id", c = a && P(p, d), y = "description", g = a && P(p, y);
3470
3470
  return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 col-span-12", children: [
3471
3471
  /* @__PURE__ */ n("div", { children: [
3472
3472
  /* @__PURE__ */ e(
3473
- be,
3473
+ ye,
3474
3474
  {
3475
3475
  inputRef: l,
3476
3476
  name: m,
3477
- as: H,
3477
+ as: J,
3478
3478
  style: { fontSize: 20 },
3479
3479
  validate: Ei,
3480
3480
  placeholder: "Field name",
@@ -3487,26 +3487,26 @@ const Ii = L.forwardRef(
3487
3487
  ] }),
3488
3488
  /* @__PURE__ */ n("div", { children: [
3489
3489
  /* @__PURE__ */ e(
3490
- be,
3490
+ ye,
3491
3491
  {
3492
- name: c,
3492
+ name: d,
3493
3493
  as: Te,
3494
3494
  label: "ID",
3495
3495
  validate: (b) => ji(b, r),
3496
3496
  disabled: i || s,
3497
3497
  required: !0,
3498
3498
  size: "small",
3499
- error: !!d
3499
+ error: !!c
3500
3500
  }
3501
3501
  ),
3502
- /* @__PURE__ */ e(ie, { error: !!d, children: d })
3502
+ /* @__PURE__ */ e(ie, { error: !!c, children: c })
3503
3503
  ] }),
3504
3504
  /* @__PURE__ */ n("div", { children: [
3505
3505
  /* @__PURE__ */ e(
3506
- be,
3506
+ ye,
3507
3507
  {
3508
- name: f,
3509
- as: H,
3508
+ name: y,
3509
+ as: J,
3510
3510
  label: "Description",
3511
3511
  disabled: s,
3512
3512
  error: !!g
@@ -3530,8 +3530,8 @@ function Di({
3530
3530
  disabled: a,
3531
3531
  showErrors: i
3532
3532
  }) {
3533
- const { values: r, setFieldValue: s } = K();
3534
- return /* @__PURE__ */ n(M, { children: [
3533
+ const { values: r, setFieldValue: s } = Y();
3534
+ return /* @__PURE__ */ n($, { children: [
3535
3535
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
3536
3536
  t === "text_field" && /* @__PURE__ */ e(
3537
3537
  Ue,
@@ -3599,8 +3599,8 @@ function Di({
3599
3599
  ] });
3600
3600
  }
3601
3601
  function Bi({ disabled: t }) {
3602
- const { values: a } = K(), i = P(a, "defaultValue");
3603
- return /* @__PURE__ */ n(M, { children: [
3602
+ const { values: a } = Y(), i = P(a, "defaultValue");
3603
+ return /* @__PURE__ */ n($, { children: [
3604
3604
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }),
3605
3605
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3606
3606
  de,
@@ -3619,25 +3619,25 @@ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3619
3619
  const {
3620
3620
  values: o,
3621
3621
  setFieldValue: l
3622
- } = K(), [p, m] = $(!1), [u, c] = $(), [d, f] = $(), g = X(({
3623
- id: _,
3624
- property: y
3622
+ } = Y(), [p, m] = L(!1), [u, d] = L(), [c, y] = L(), g = Z(({
3623
+ id: v,
3624
+ property: _
3625
3625
  }) => {
3626
- if (!_)
3626
+ if (!v)
3627
3627
  throw Error();
3628
3628
  l("oneOf.properties", {
3629
3629
  ...o.oneOf?.properties ?? {},
3630
- [_]: y
3631
- }, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), _], !1), m(!1);
3632
- }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = u ? ce(u, d) : void 0, O = b ? P(o.oneOf?.properties, b.replaceAll(".", ".properties.")) : void 0, k = X((_, y) => {
3633
- const w = _ ? ce(_, y) : void 0;
3634
- if (!w)
3630
+ [v]: _
3631
+ }, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), v], !1), m(!1);
3632
+ }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), b = u ? ce(u, c) : void 0, O = b ? P(o.oneOf?.properties, b.replaceAll(".", ".properties.")) : void 0, w = Z((v, _) => {
3633
+ const h = v ? ce(v, _) : void 0;
3634
+ if (!h)
3635
3635
  throw Error("collection editor miss config");
3636
- l(`oneOf.${_e(w)}`, void 0, !1);
3637
- const q = `oneOf.${Ne(y)}`, F = P(o, q);
3638
- l(q, F.filter((A) => A !== _), !1), m(!1), c(void 0), f(void 0);
3639
- }, [l, o]), x = /* @__PURE__ */ n(
3640
- B,
3636
+ l(`oneOf.${ke(h)}`, void 0, !1);
3637
+ const A = `oneOf.${Pe(_)}`, E = P(o, A);
3638
+ l(A, E.filter((z) => z !== v), !1), m(!1), d(void 0), y(void 0);
3639
+ }, [l, o]), k = /* @__PURE__ */ n(
3640
+ U,
3641
3641
  {
3642
3642
  autoFocus: !0,
3643
3643
  color: "primary",
@@ -3648,14 +3648,14 @@ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3648
3648
  o.name ?? "this block"
3649
3649
  ]
3650
3650
  }
3651
- ), h = X((_, y) => {
3652
- l(`oneOf.${Ne(y)}`, _, !1);
3651
+ ), f = Z((v, _) => {
3652
+ l(`oneOf.${Pe(_)}`, v, !1);
3653
3653
  }, []);
3654
- return /* @__PURE__ */ n(M, { children: [
3654
+ return /* @__PURE__ */ n($, { children: [
3655
3655
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3656
3656
  /* @__PURE__ */ n("div", { className: "flex justify-between items-end mt-8 mb-4", children: [
3657
3657
  /* @__PURE__ */ e(C, { variant: "subtitle2", children: "Properties in this block" }),
3658
- x
3658
+ k
3659
3659
  ] }),
3660
3660
  /* @__PURE__ */ n(qe, { className: "p-2 pl-8", children: [
3661
3661
  /* @__PURE__ */ e(
@@ -3665,10 +3665,10 @@ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3665
3665
  propertiesOrder: o.oneOf?.propertiesOrder,
3666
3666
  errors: {},
3667
3667
  collectionEditable: s,
3668
- onPropertyClick: t ? void 0 : (_, y) => {
3669
- c(_), f(y), m(!0);
3668
+ onPropertyClick: t ? void 0 : (v, _) => {
3669
+ d(v), y(_), m(!0);
3670
3670
  },
3671
- onPropertyMove: t ? void 0 : h
3671
+ onPropertyMove: t ? void 0 : f
3672
3672
  }
3673
3673
  ),
3674
3674
  !t && !o.oneOf?.propertiesOrder?.length && /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center p-4", children: "Add the first property to this block" })
@@ -3683,15 +3683,15 @@ function Mi({ disabled: t, getData: a, allowDataInference: i, propertyConfigs: r
3683
3683
  getData: a,
3684
3684
  allowDataInference: i,
3685
3685
  onCancel: () => {
3686
- m(!1), c(void 0), f(void 0);
3686
+ m(!1), d(void 0), y(void 0);
3687
3687
  },
3688
3688
  onOkClicked: () => {
3689
- m(!1), c(void 0), f(void 0);
3689
+ m(!1), d(void 0), y(void 0);
3690
3690
  },
3691
3691
  collectionEditable: s,
3692
- onDelete: k,
3692
+ onDelete: w,
3693
3693
  propertyKey: u,
3694
- propertyNamespace: d,
3694
+ propertyNamespace: c,
3695
3695
  property: O,
3696
3696
  existingProperty: !!u,
3697
3697
  autoUpdateId: !u,
@@ -3707,11 +3707,11 @@ function Ri({ disabled: t }) {
3707
3707
  const {
3708
3708
  values: a,
3709
3709
  handleChange: i
3710
- } = K(), r = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", p = "validation.positive", m = "validation.negative", u = "validation.integer";
3710
+ } = Y(), r = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", p = "validation.positive", m = "validation.negative", u = "validation.integer";
3711
3711
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
3712
3712
  /* @__PURE__ */ e(Me, { disabled: t }),
3713
3713
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3714
- H,
3714
+ J,
3715
3715
  {
3716
3716
  value: P(a, r),
3717
3717
  label: "Min value",
@@ -3723,7 +3723,7 @@ function Ri({ disabled: t }) {
3723
3723
  }
3724
3724
  ) }),
3725
3725
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3726
- H,
3726
+ J,
3727
3727
  {
3728
3728
  value: P(a, s),
3729
3729
  label: "Max value",
@@ -3735,7 +3735,7 @@ function Ri({ disabled: t }) {
3735
3735
  }
3736
3736
  ) }),
3737
3737
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3738
- H,
3738
+ J,
3739
3739
  {
3740
3740
  value: P(a, o),
3741
3741
  label: "Less than",
@@ -3747,7 +3747,7 @@ function Ri({ disabled: t }) {
3747
3747
  }
3748
3748
  ) }),
3749
3749
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3750
- H,
3750
+ J,
3751
3751
  {
3752
3752
  value: P(a, l),
3753
3753
  label: "More than",
@@ -3791,8 +3791,8 @@ function Ri({ disabled: t }) {
3791
3791
  ] });
3792
3792
  }
3793
3793
  function Ui({ disabled: t }) {
3794
- const { values: a, setFieldValue: i } = K();
3795
- return /* @__PURE__ */ n(M, { children: [
3794
+ const { values: a, setFieldValue: i } = Y();
3795
+ return /* @__PURE__ */ n($, { children: [
3796
3796
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ri, { disabled: t }) }) }),
3797
3797
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3798
3798
  Te,
@@ -3822,20 +3822,20 @@ function Rt({
3822
3822
  touched: p,
3823
3823
  setFieldError: m,
3824
3824
  setFieldValue: u
3825
- } = K();
3825
+ } = Y();
3826
3826
  if (!Be())
3827
3827
  return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(We, {}) });
3828
- const d = a ? "of.path" : "path", f = P(s, d), g = r && P(l, d);
3829
- return console.log("pathError", l, g), /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3830
- be,
3828
+ const c = a ? "of.path" : "path", y = P(s, c), g = r && P(l, c);
3829
+ return console.log("pathError", l, g), /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3830
+ ye,
3831
3831
  {
3832
3832
  required: !0,
3833
- name: d,
3834
- pathPath: d,
3833
+ name: c,
3834
+ pathPath: c,
3835
3835
  type: "select",
3836
3836
  validate: $i,
3837
3837
  disabled: t || i,
3838
- value: f,
3838
+ value: y,
3839
3839
  error: g,
3840
3840
  handleChange: o,
3841
3841
  component: Li
@@ -3859,9 +3859,9 @@ function Li({
3859
3859
  if (!l)
3860
3860
  return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(We, {}) });
3861
3861
  const p = l?.collections ?? [], m = Array.from(new Set(
3862
- Object.values(p).map((c) => c.group).filter(Boolean)
3863
- ).values()), u = p.filter((c) => !c.group);
3864
- return /* @__PURE__ */ n(M, { children: [
3862
+ Object.values(p).map((d) => d.group).filter(Boolean)
3863
+ ).values()), u = p.filter((d) => !d.group);
3864
+ return /* @__PURE__ */ n($, { children: [
3865
3865
  /* @__PURE__ */ n(
3866
3866
  Se,
3867
3867
  {
@@ -3872,72 +3872,72 @@ function Li({
3872
3872
  name: a,
3873
3873
  onChange: r,
3874
3874
  label: "Target collection",
3875
- renderValue: (c) => {
3876
- const d = p.find((g) => g.id === c || g.path === c);
3877
- if (!d)
3875
+ renderValue: (d) => {
3876
+ const c = p.find((g) => g.id === d || g.path === d);
3877
+ if (!c)
3878
3878
  return null;
3879
- const f = ct(d);
3879
+ const y = ct(c);
3880
3880
  return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3881
- f,
3881
+ y,
3882
3882
  /* @__PURE__ */ e(
3883
3883
  C,
3884
3884
  {
3885
3885
  variant: "subtitle2",
3886
3886
  className: "font-medium ml-4",
3887
- children: d?.name.toUpperCase()
3887
+ children: c?.name.toUpperCase()
3888
3888
  }
3889
3889
  )
3890
3890
  ] });
3891
3891
  },
3892
3892
  ...o,
3893
3893
  children: [
3894
- m.flatMap((c) => /* @__PURE__ */ e(
3894
+ m.flatMap((d) => /* @__PURE__ */ e(
3895
3895
  Vt,
3896
3896
  {
3897
- label: c || "Views",
3898
- children: p.filter((d) => d.group === c).map((d) => {
3899
- const f = ct(d);
3897
+ label: d || "Views",
3898
+ children: p.filter((c) => c.group === d).map((c) => {
3899
+ const y = ct(c);
3900
3900
  return /* @__PURE__ */ e(
3901
3901
  ee,
3902
3902
  {
3903
- value: d.id ?? d.path,
3903
+ value: c.id ?? c.path,
3904
3904
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3905
- f,
3905
+ y,
3906
3906
  /* @__PURE__ */ e(
3907
3907
  C,
3908
3908
  {
3909
3909
  variant: "subtitle2",
3910
3910
  className: "font-medium ml-4",
3911
- children: d?.name.toUpperCase()
3911
+ children: c?.name.toUpperCase()
3912
3912
  }
3913
3913
  )
3914
3914
  ] })
3915
3915
  },
3916
- `${d.id ?? d.path}-${c}`
3916
+ `${c.id ?? c.path}-${d}`
3917
3917
  );
3918
3918
  })
3919
3919
  },
3920
- `group_${c}`
3920
+ `group_${d}`
3921
3921
  )),
3922
- u && /* @__PURE__ */ e(Vt, { label: "Views", children: u.map((c) => {
3923
- const d = ct(c);
3922
+ u && /* @__PURE__ */ e(Vt, { label: "Views", children: u.map((d) => {
3923
+ const c = ct(d);
3924
3924
  return /* @__PURE__ */ e(
3925
3925
  ee,
3926
3926
  {
3927
- value: c.id ?? c.path,
3927
+ value: d.id ?? d.path,
3928
3928
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3929
- d,
3929
+ c,
3930
3930
  /* @__PURE__ */ e(
3931
3931
  C,
3932
3932
  {
3933
3933
  variant: "subtitle2",
3934
3934
  className: "font-medium ml-4",
3935
- children: c?.name.toUpperCase()
3935
+ children: d?.name.toUpperCase()
3936
3936
  }
3937
3937
  )
3938
3938
  ] })
3939
3939
  },
3940
- c.id ?? c.path
3940
+ d.id ?? d.path
3941
3941
  );
3942
3942
  }) })
3943
3943
  ]
@@ -3952,8 +3952,8 @@ function Ki({ disabled: t }) {
3952
3952
  errors: i,
3953
3953
  touched: r,
3954
3954
  setFieldValue: s
3955
- } = K(), o = "mode", l = P(a, o), p = P(r, o) && P(i, o), m = "autoValue", u = P(a, m), c = P(r, m) && P(i, m);
3956
- return /* @__PURE__ */ n(M, { children: [
3955
+ } = Y(), o = "mode", l = P(a, o), p = P(r, o) && P(i, o), m = "autoValue", u = P(a, m), d = P(r, m) && P(i, m);
3956
+ return /* @__PURE__ */ n($, { children: [
3957
3957
  /* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
3958
3958
  /* @__PURE__ */ n(
3959
3959
  Se,
@@ -3961,10 +3961,10 @@ function Ki({ disabled: t }) {
3961
3961
  name: o,
3962
3962
  value: l ?? "date",
3963
3963
  error: !!p,
3964
- onValueChange: (d) => s(o, d),
3964
+ onValueChange: (c) => s(o, c),
3965
3965
  label: "Mode",
3966
- renderValue: (d) => {
3967
- switch (d) {
3966
+ renderValue: (c) => {
3967
+ switch (c) {
3968
3968
  case "date_time":
3969
3969
  return "Date/Time";
3970
3970
  case "date":
@@ -3987,9 +3987,9 @@ function Ki({ disabled: t }) {
3987
3987
  name: m,
3988
3988
  disabled: t,
3989
3989
  value: u ?? "",
3990
- onValueChange: (d) => s(m, d),
3991
- renderValue: (d) => {
3992
- switch (d) {
3990
+ onValueChange: (c) => s(m, c),
3991
+ renderValue: (c) => {
3992
+ switch (c) {
3993
3993
  case "on_create":
3994
3994
  return "On create";
3995
3995
  case "on_update":
@@ -3998,7 +3998,7 @@ function Ki({ disabled: t }) {
3998
3998
  return "None";
3999
3999
  }
4000
4000
  },
4001
- error: !!c,
4001
+ error: !!d,
4002
4002
  label: "Automatic value",
4003
4003
  children: [
4004
4004
  /* @__PURE__ */ e(ee, { value: "", children: " None " }),
@@ -4007,13 +4007,13 @@ function Ki({ disabled: t }) {
4007
4007
  ]
4008
4008
  }
4009
4009
  ),
4010
- /* @__PURE__ */ e(ie, { error: !!c, children: c ?? "Update this field automatically when creating or updating the entity" })
4010
+ /* @__PURE__ */ e(ie, { error: !!d, children: d ?? "Update this field automatically when creating or updating the entity" })
4011
4011
  ] }),
4012
4012
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) })
4013
4013
  ] });
4014
4014
  }
4015
4015
  function Yi({ disabled: t }) {
4016
- return K(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
4016
+ return Y(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
4017
4017
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
4018
4018
  de,
4019
4019
  {
@@ -4039,11 +4039,11 @@ function Yi({ disabled: t }) {
4039
4039
  ] });
4040
4040
  }
4041
4041
  function Gi({ disabled: t }) {
4042
- return /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }) });
4042
+ return /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Me, { disabled: t }) }) }) });
4043
4043
  }
4044
4044
  function na(t, a, i) {
4045
4045
  let r;
4046
- return a === "text_field" ? r = Y(
4046
+ return a === "text_field" ? r = G(
4047
4047
  t,
4048
4048
  {
4049
4049
  dataType: "string",
@@ -4056,7 +4056,7 @@ function na(t, a, i) {
4056
4056
  url: void 0,
4057
4057
  enumValues: void 0
4058
4058
  }
4059
- ) : a === "multiline" ? r = Y(
4059
+ ) : a === "multiline" ? r = G(
4060
4060
  t,
4061
4061
  {
4062
4062
  dataType: "string",
@@ -4069,7 +4069,7 @@ function na(t, a, i) {
4069
4069
  url: void 0,
4070
4070
  enumValues: void 0
4071
4071
  }
4072
- ) : a === "markdown" ? r = Y(
4072
+ ) : a === "markdown" ? r = G(
4073
4073
  t,
4074
4074
  {
4075
4075
  dataType: "string",
@@ -4081,7 +4081,7 @@ function na(t, a, i) {
4081
4081
  email: void 0,
4082
4082
  url: void 0
4083
4083
  }
4084
- ) : a === "url" ? r = Y(
4084
+ ) : a === "url" ? r = G(
4085
4085
  t,
4086
4086
  {
4087
4087
  dataType: "string",
@@ -4094,7 +4094,7 @@ function na(t, a, i) {
4094
4094
  url: !0,
4095
4095
  enumValues: void 0
4096
4096
  }
4097
- ) : a === "email" ? r = Y(
4097
+ ) : a === "email" ? r = G(
4098
4098
  t,
4099
4099
  {
4100
4100
  dataType: "string",
@@ -4107,7 +4107,7 @@ function na(t, a, i) {
4107
4107
  url: void 0,
4108
4108
  enumValues: void 0
4109
4109
  }
4110
- ) : a === "select" ? r = Y(
4110
+ ) : a === "select" ? r = G(
4111
4111
  t,
4112
4112
  {
4113
4113
  dataType: "string",
@@ -4120,7 +4120,7 @@ function na(t, a, i) {
4120
4120
  url: void 0,
4121
4121
  enumValues: t.enumValues ?? []
4122
4122
  }
4123
- ) : a === "multi_select" ? r = Y(
4123
+ ) : a === "multi_select" ? r = G(
4124
4124
  t,
4125
4125
  {
4126
4126
  dataType: "array",
@@ -4131,7 +4131,7 @@ function na(t, a, i) {
4131
4131
  enumValues: t.of?.enumValues ?? []
4132
4132
  }
4133
4133
  }
4134
- ) : a === "number_input" ? r = Y(
4134
+ ) : a === "number_input" ? r = G(
4135
4135
  t,
4136
4136
  {
4137
4137
  dataType: "number",
@@ -4139,7 +4139,7 @@ function na(t, a, i) {
4139
4139
  editable: t.editable !== void 0 ? t.editable : !0,
4140
4140
  enumValues: void 0
4141
4141
  }
4142
- ) : a === "number_select" ? r = Y(
4142
+ ) : a === "number_select" ? r = G(
4143
4143
  t,
4144
4144
  {
4145
4145
  dataType: "number",
@@ -4147,7 +4147,7 @@ function na(t, a, i) {
4147
4147
  editable: t.editable !== void 0 ? t.editable : !0,
4148
4148
  enumValues: t.enumValues ?? []
4149
4149
  }
4150
- ) : a === "multi_number_select" ? r = Y(
4150
+ ) : a === "multi_number_select" ? r = G(
4151
4151
  t,
4152
4152
  {
4153
4153
  dataType: "array",
@@ -4158,7 +4158,7 @@ function na(t, a, i) {
4158
4158
  enumValues: t.of?.enumValues ?? []
4159
4159
  }
4160
4160
  }
4161
- ) : a === "file_upload" ? r = Y(
4161
+ ) : a === "file_upload" ? r = G(
4162
4162
  t,
4163
4163
  {
4164
4164
  dataType: "string",
@@ -4168,7 +4168,7 @@ function na(t, a, i) {
4168
4168
  storagePath: "/"
4169
4169
  }
4170
4170
  }
4171
- ) : a === "multi_file_upload" ? r = Y(
4171
+ ) : a === "multi_file_upload" ? r = G(
4172
4172
  t,
4173
4173
  {
4174
4174
  dataType: "array",
@@ -4181,7 +4181,7 @@ function na(t, a, i) {
4181
4181
  }
4182
4182
  }
4183
4183
  }
4184
- ) : a === "group" ? r = Y(
4184
+ ) : a === "group" ? r = G(
4185
4185
  t,
4186
4186
  {
4187
4187
  dataType: "map",
@@ -4190,7 +4190,7 @@ function na(t, a, i) {
4190
4190
  keyValue: !1,
4191
4191
  properties: t.properties ?? {}
4192
4192
  }
4193
- ) : a === "key_value" ? r = Y(
4193
+ ) : a === "key_value" ? r = G(
4194
4194
  t,
4195
4195
  {
4196
4196
  dataType: "map",
@@ -4199,14 +4199,14 @@ function na(t, a, i) {
4199
4199
  keyValue: !0,
4200
4200
  properties: void 0
4201
4201
  }
4202
- ) : a === "reference" ? r = Y(
4202
+ ) : a === "reference" ? r = G(
4203
4203
  t,
4204
4204
  {
4205
4205
  dataType: "reference",
4206
4206
  propertyConfig: "reference",
4207
4207
  editable: t.editable !== void 0 ? t.editable : !0
4208
4208
  }
4209
- ) : a === "multi_references" ? r = Y(
4209
+ ) : a === "multi_references" ? r = G(
4210
4210
  t,
4211
4211
  {
4212
4212
  dataType: "array",
@@ -4216,14 +4216,14 @@ function na(t, a, i) {
4216
4216
  dataType: "reference"
4217
4217
  }
4218
4218
  }
4219
- ) : a === "switch" ? r = Y(
4219
+ ) : a === "switch" ? r = G(
4220
4220
  t,
4221
4221
  {
4222
4222
  dataType: "boolean",
4223
4223
  propertyConfig: "switch",
4224
4224
  editable: t.editable !== void 0 ? t.editable : !0
4225
4225
  }
4226
- ) : a === "date_time" ? r = Y(
4226
+ ) : a === "date_time" ? r = G(
4227
4227
  t,
4228
4228
  {
4229
4229
  dataType: "date",
@@ -4231,14 +4231,14 @@ function na(t, a, i) {
4231
4231
  editable: t.editable !== void 0 ? t.editable : !0,
4232
4232
  mode: "date_time"
4233
4233
  }
4234
- ) : a === "repeat" ? r = Y(
4234
+ ) : a === "repeat" ? r = G(
4235
4235
  t,
4236
4236
  {
4237
4237
  dataType: "array",
4238
4238
  propertyConfig: "repeat",
4239
4239
  editable: t.editable !== void 0 ? t.editable : !0
4240
4240
  }
4241
- ) : a === "block" ? r = Y(
4241
+ ) : a === "block" ? r = G(
4242
4242
  t,
4243
4243
  {
4244
4244
  dataType: "array",
@@ -4263,7 +4263,7 @@ function sa({ value: t, optionDisabled: a, propertyConfig: i, existing: r }) {
4263
4263
  children: /* @__PURE__ */ n(
4264
4264
  "div",
4265
4265
  {
4266
- className: ke(
4266
+ className: xe(
4267
4267
  "flex flex-row items-center text-base min-h-[52px]",
4268
4268
  a ? "w-full" : ""
4269
4269
  ),
@@ -4291,8 +4291,8 @@ function Hi({
4291
4291
  disabled: t,
4292
4292
  showErrors: a
4293
4293
  }) {
4294
- const { values: i, setFieldValue: r } = K(), s = P(i, "url");
4295
- return /* @__PURE__ */ n(M, { children: [
4294
+ const { values: i, setFieldValue: r } = Y(), s = P(i, "url");
4295
+ return /* @__PURE__ */ n($, { children: [
4296
4296
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
4297
4297
  Se,
4298
4298
  {
@@ -4368,7 +4368,7 @@ const Ji = [
4368
4368
  "key_value",
4369
4369
  "repeat",
4370
4370
  "block"
4371
- ], la = Object.entries(Zt).filter(([t]) => Ji.includes(t)).map(([t, a]) => ({ [t]: a })).reduce((t, a) => ({ ...t, ...a }), {}), ca = L.memo(
4371
+ ], la = Object.entries(Zt).filter(([t]) => Ji.includes(t)).map(([t, a]) => ({ [t]: a })).reduce((t, a) => ({ ...t, ...a }), {}), ca = K.memo(
4372
4372
  function({
4373
4373
  includeIdAndName: a = !0,
4374
4374
  autoOpenTypeSelect: i,
@@ -4379,75 +4379,75 @@ const Ji = [
4379
4379
  propertyNamespace: p,
4380
4380
  property: m,
4381
4381
  onPropertyChanged: u,
4382
- onPropertyChangedImmediate: c = !0,
4383
- onDelete: d,
4384
- onError: f,
4382
+ onPropertyChangedImmediate: d = !0,
4383
+ onDelete: c,
4384
+ onError: y,
4385
4385
  initialErrors: g,
4386
4386
  forceShowErrors: b,
4387
4387
  existingPropertyKeys: O,
4388
- allowDataInference: k,
4389
- getHelpers: x,
4390
- getData: h,
4391
- propertyConfigs: _,
4392
- collectionEditable: y
4388
+ allowDataInference: w,
4389
+ getHelpers: k,
4390
+ getData: f,
4391
+ propertyConfigs: v,
4392
+ collectionEditable: _
4393
4393
  }) {
4394
- const w = {
4394
+ const h = {
4395
4395
  id: "",
4396
4396
  name: ""
4397
- }, q = !!(m && !Je(m)) && !y, F = He(m ? {
4397
+ }, A = !!(m && !Je(m)) && !_, E = He(m ? {
4398
4398
  id: l,
4399
4399
  previousId: l,
4400
4400
  property: m
4401
- } : void 0), A = ({
4402
- id: S,
4403
- property: E
4401
+ } : void 0), z = ({
4402
+ id: q,
4403
+ property: B
4404
4404
  }) => {
4405
- const v = {
4406
- id: S,
4407
- previousId: F.current?.id,
4408
- property: E,
4405
+ const S = {
4406
+ id: q,
4407
+ previousId: E.current?.id,
4408
+ property: B,
4409
4409
  namespace: p
4410
4410
  };
4411
- F.current = v, u?.(v);
4411
+ E.current = S, u?.(S);
4412
4412
  };
4413
4413
  return /* @__PURE__ */ e(
4414
4414
  St,
4415
4415
  {
4416
4416
  initialErrors: g,
4417
- initialValues: m ? { id: l, ...m } : w,
4418
- onSubmit: (S, E) => {
4419
- console.log("Submitting property", S);
4417
+ initialValues: m ? { id: l, ...m } : h,
4418
+ onSubmit: (q, B) => {
4419
+ console.log("Submitting property", q);
4420
4420
  const {
4421
- id: v,
4422
- ...V
4423
- } = S;
4424
- A({
4425
- id: v,
4426
- property: { ...V, editable: V.editable ?? !0 }
4427
- }), r || E.resetForm({ values: w });
4421
+ id: S,
4422
+ ...N
4423
+ } = q;
4424
+ z({
4425
+ id: S,
4426
+ property: { ...N, editable: N.editable ?? !0 }
4427
+ }), r || B.resetForm({ values: h });
4428
4428
  },
4429
- children: (S) => (pe(() => {
4430
- x?.(S);
4431
- }, [S]), /* @__PURE__ */ e(
4429
+ children: (q) => (pe(() => {
4430
+ k?.(q);
4431
+ }, [q]), /* @__PURE__ */ e(
4432
4432
  Qi,
4433
4433
  {
4434
- onPropertyChanged: c ? A : void 0,
4435
- onDelete: d,
4434
+ onPropertyChanged: d ? z : void 0,
4435
+ onDelete: c,
4436
4436
  includeIdAndTitle: a,
4437
4437
  propertyNamespace: p,
4438
- onError: f,
4439
- showErrors: b || S.submitCount > 0,
4438
+ onError: y,
4439
+ showErrors: b || q.submitCount > 0,
4440
4440
  existing: r,
4441
4441
  autoUpdateId: s,
4442
4442
  inArray: o,
4443
4443
  autoOpenTypeSelect: i,
4444
4444
  existingPropertyKeys: O,
4445
- disabled: q,
4446
- getData: h,
4447
- allowDataInference: k,
4448
- propertyConfigs: _,
4449
- collectionEditable: y,
4450
- ...S
4445
+ disabled: A,
4446
+ getData: f,
4447
+ allowDataInference: w,
4448
+ propertyConfigs: v,
4449
+ collectionEditable: _,
4450
+ ...q
4451
4451
  }
4452
4452
  ))
4453
4453
  },
@@ -4490,7 +4490,7 @@ function je({
4490
4490
  ) }),
4491
4491
  /* @__PURE__ */ n(Le, { children: [
4492
4492
  a && /* @__PURE__ */ e(
4493
- B,
4493
+ U,
4494
4494
  {
4495
4495
  variant: "text",
4496
4496
  onClick: () => {
@@ -4500,7 +4500,7 @@ function je({
4500
4500
  }
4501
4501
  ),
4502
4502
  /* @__PURE__ */ e(
4503
- B,
4503
+ U,
4504
4504
  {
4505
4505
  variant: "outlined",
4506
4506
  color: "primary",
@@ -4524,108 +4524,108 @@ function Qi({
4524
4524
  autoOpenTypeSelect: p,
4525
4525
  includeIdAndTitle: m,
4526
4526
  onPropertyChanged: u,
4527
- onDelete: c,
4528
- propertyNamespace: d,
4529
- onError: f,
4527
+ onDelete: d,
4528
+ propertyNamespace: c,
4529
+ onError: y,
4530
4530
  showErrors: g,
4531
4531
  disabled: b,
4532
4532
  inArray: O,
4533
- existingPropertyKeys: k,
4534
- getData: x,
4535
- allowDataInference: h,
4536
- propertyConfigs: _,
4537
- collectionEditable: y
4533
+ existingPropertyKeys: w,
4534
+ getData: k,
4535
+ allowDataInference: f,
4536
+ propertyConfigs: v,
4537
+ collectionEditable: _
4538
4538
  }) {
4539
- const [w, q] = $(p), [F, A] = $(!1), [S, E] = $(t?.dataType ? Xt(t) : void 0), v = Object.entries(la).concat(Object.entries(_)), V = O ? v.filter(([W, te]) => !oe(te.property) && te.property?.dataType !== "array") : v, J = ba(t), N = He(null), R = He(t), ge = "id", xe = g && P(a, "selectedWidget");
4539
+ const [h, A] = L(p), [E, z] = L(!1), [q, B] = L(t?.dataType ? Xt(t) : void 0), S = Object.entries(la).concat(Object.entries(v)), N = O ? S.filter(([Q, te]) => !oe(te.property) && te.property?.dataType !== "array") : S, j = ba(t), x = He(null), I = He(t), ge = "id", fe = g && P(a, "selectedWidget");
4540
4540
  pe(() => {
4541
4541
  !P(i, ge) && l && t?.name && s(ge, Ct(t.name));
4542
4542
  }, [l, i, t?.name]), pe(() => {
4543
- if (u && (!m || J.id)) {
4543
+ if (u && (!m || j.id)) {
4544
4544
  const {
4545
- id: W,
4545
+ id: Q,
4546
4546
  ...te
4547
- } = J;
4548
- ut(J, R.current) || (u({
4549
- id: W,
4547
+ } = j;
4548
+ ut(j, I.current) || (u({
4549
+ id: Q,
4550
4550
  property: te,
4551
- namespace: d
4552
- }), R.current = J);
4551
+ namespace: c
4552
+ }), I.current = j);
4553
4553
  }
4554
- }, [J, m, u, d]), pe(() => {
4555
- t?.id && f && Object.keys(a).length > 0 && f(t?.id, d, a);
4556
- }, [a, f, d, t?.id]);
4557
- const Q = (W) => {
4558
- E(W), r(na(t, W, _)), setTimeout(() => {
4559
- N.current?.focus();
4554
+ }, [j, m, u, c]), pe(() => {
4555
+ t?.id && y && Object.keys(a).length > 0 && y(t?.id, c, a);
4556
+ }, [a, y, c, t?.id]);
4557
+ const X = (Q) => {
4558
+ B(Q), r(na(t, Q, v)), setTimeout(() => {
4559
+ x.current?.focus();
4560
4560
  }, 0);
4561
4561
  };
4562
- let U;
4563
- return S === "text_field" || S === "multiline" || S === "markdown" || S === "email" ? U = /* @__PURE__ */ e(
4562
+ let M;
4563
+ return q === "text_field" || q === "multiline" || q === "markdown" || q === "email" ? M = /* @__PURE__ */ e(
4564
4564
  Di,
4565
4565
  {
4566
- widgetId: S,
4566
+ widgetId: q,
4567
4567
  disabled: b,
4568
4568
  showErrors: g
4569
4569
  }
4570
- ) : S === "url" ? U = /* @__PURE__ */ e(
4570
+ ) : q === "url" ? M = /* @__PURE__ */ e(
4571
4571
  Hi,
4572
4572
  {
4573
4573
  disabled: b,
4574
4574
  showErrors: g
4575
4575
  }
4576
- ) : S === "select" || S === "number_select" ? U = /* @__PURE__ */ e(
4576
+ ) : q === "select" || q === "number_select" ? M = /* @__PURE__ */ e(
4577
4577
  Bt,
4578
4578
  {
4579
4579
  multiselect: !1,
4580
- allowDataInference: h,
4580
+ allowDataInference: f,
4581
4581
  updateIds: !o,
4582
4582
  disabled: b,
4583
- getData: x,
4583
+ getData: k,
4584
4584
  showErrors: g
4585
4585
  }
4586
- ) : S === "multi_select" || S === "multi_number_select" ? U = /* @__PURE__ */ e(
4586
+ ) : q === "multi_select" || q === "multi_number_select" ? M = /* @__PURE__ */ e(
4587
4587
  Bt,
4588
4588
  {
4589
4589
  multiselect: !0,
4590
4590
  updateIds: !o,
4591
4591
  disabled: b,
4592
- allowDataInference: h,
4593
- getData: x,
4592
+ allowDataInference: f,
4593
+ getData: k,
4594
4594
  showErrors: g
4595
4595
  }
4596
- ) : S === "file_upload" ? U = /* @__PURE__ */ e(
4596
+ ) : q === "file_upload" ? M = /* @__PURE__ */ e(
4597
4597
  Mt,
4598
4598
  {
4599
4599
  existing: o,
4600
4600
  multiple: !1,
4601
4601
  disabled: b
4602
4602
  }
4603
- ) : S === "multi_file_upload" ? U = /* @__PURE__ */ e(
4603
+ ) : q === "multi_file_upload" ? M = /* @__PURE__ */ e(
4604
4604
  Mt,
4605
4605
  {
4606
4606
  existing: o,
4607
4607
  multiple: !0,
4608
4608
  disabled: b
4609
4609
  }
4610
- ) : S === "switch" ? U = /* @__PURE__ */ e(Bi, { disabled: b }) : S === "number_input" ? U = /* @__PURE__ */ e(Ui, { disabled: b }) : S === "group" ? U = /* @__PURE__ */ e(
4610
+ ) : q === "switch" ? M = /* @__PURE__ */ e(Bi, { disabled: b }) : q === "number_input" ? M = /* @__PURE__ */ e(Ui, { disabled: b }) : q === "group" ? M = /* @__PURE__ */ e(
4611
4611
  Ti,
4612
4612
  {
4613
4613
  disabled: b,
4614
- getData: x,
4615
- allowDataInference: h,
4616
- collectionEditable: y,
4617
- propertyConfigs: _
4614
+ getData: k,
4615
+ allowDataInference: f,
4616
+ collectionEditable: _,
4617
+ propertyConfigs: v
4618
4618
  }
4619
- ) : S === "block" ? U = /* @__PURE__ */ e(
4619
+ ) : q === "block" ? M = /* @__PURE__ */ e(
4620
4620
  Mi,
4621
4621
  {
4622
4622
  disabled: b,
4623
- getData: x,
4624
- allowDataInference: h,
4625
- collectionEditable: y,
4626
- propertyConfigs: _
4623
+ getData: k,
4624
+ allowDataInference: f,
4625
+ collectionEditable: _,
4626
+ propertyConfigs: v
4627
4627
  }
4628
- ) : S === "reference" ? U = /* @__PURE__ */ e(
4628
+ ) : q === "reference" ? M = /* @__PURE__ */ e(
4629
4629
  Rt,
4630
4630
  {
4631
4631
  showErrors: g,
@@ -4633,7 +4633,7 @@ function Qi({
4633
4633
  multiple: !1,
4634
4634
  disabled: b
4635
4635
  }
4636
- ) : S === "date_time" ? U = /* @__PURE__ */ e(Ki, { disabled: b }) : S === "multi_references" ? U = /* @__PURE__ */ e(
4636
+ ) : q === "date_time" ? M = /* @__PURE__ */ e(Ki, { disabled: b }) : q === "multi_references" ? M = /* @__PURE__ */ e(
4637
4637
  Rt,
4638
4638
  {
4639
4639
  showErrors: g,
@@ -4641,18 +4641,18 @@ function Qi({
4641
4641
  multiple: !0,
4642
4642
  disabled: b
4643
4643
  }
4644
- ) : S === "repeat" ? U = /* @__PURE__ */ e(
4644
+ ) : q === "repeat" ? M = /* @__PURE__ */ e(
4645
4645
  Vi,
4646
4646
  {
4647
4647
  showErrors: g,
4648
4648
  existing: o,
4649
- getData: x,
4650
- allowDataInference: h,
4649
+ getData: k,
4650
+ allowDataInference: f,
4651
4651
  disabled: b,
4652
- collectionEditable: y,
4653
- propertyConfigs: _
4652
+ collectionEditable: _,
4653
+ propertyConfigs: v
4654
4654
  }
4655
- ) : S === "key_value" ? U = /* @__PURE__ */ e(Gi, { disabled: b }) : U = null, /* @__PURE__ */ n(M, { children: [
4655
+ ) : q === "key_value" ? M = /* @__PURE__ */ e(Gi, { disabled: b }) : M = null, /* @__PURE__ */ n($, { children: [
4656
4656
  b && /* @__PURE__ */ n(ea, { mode: "warn", children: [
4657
4657
  /* @__PURE__ */ e(C, { children: "This property can't be edited" }),
4658
4658
  /* @__PURE__ */ n(C, { variant: "caption", children: [
@@ -4666,26 +4666,26 @@ function Qi({
4666
4666
  /* @__PURE__ */ e(
4667
4667
  Se,
4668
4668
  {
4669
- error: !!xe,
4670
- value: S ?? "",
4669
+ error: !!fe,
4670
+ value: q ?? "",
4671
4671
  placeholder: "Select a property widget",
4672
- open: w,
4673
- onOpenChange: q,
4672
+ open: h,
4673
+ onOpenChange: A,
4674
4674
  position: "item-aligned",
4675
4675
  disabled: b,
4676
- renderValue: (W) => {
4677
- if (!W)
4676
+ renderValue: (Q) => {
4677
+ if (!Q)
4678
4678
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
4679
- const te = W, me = Zt[te] ?? _[te], ue = me.property, fe = ue && !oe(ue) ? Ze(ue, _) : void 0, ye = oe(ue) || o && ue.dataType !== t?.dataType, Ce = fe ? Y(fe, me) : me;
4679
+ const te = Q, me = Zt[te] ?? v[te], ue = me.property, be = ue && !oe(ue) ? Ze(ue, v) : void 0, ve = oe(ue) || o && ue.dataType !== t?.dataType, Ce = be ? G(be, me) : me;
4680
4680
  return /* @__PURE__ */ n(
4681
4681
  "div",
4682
4682
  {
4683
4683
  onClick: (ae) => {
4684
- ye && (ae.stopPropagation(), ae.preventDefault());
4684
+ ve && (ae.stopPropagation(), ae.preventDefault());
4685
4685
  },
4686
- className: ke(
4686
+ className: xe(
4687
4687
  "flex items-center",
4688
- ye ? "w-full pointer-events-none opacity-50" : ""
4688
+ ve ? "w-full pointer-events-none opacity-50" : ""
4689
4689
  ),
4690
4690
  children: [
4691
4691
  /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Xe, { propertyConfig: Ce }) }),
@@ -4696,7 +4696,7 @@ function Qi({
4696
4696
  {
4697
4697
  variant: "caption",
4698
4698
  color: "disabled",
4699
- children: ye ? "You can only switch to widgets that use the same data type" : Ce.description
4699
+ children: ve ? "You can only switch to widgets that use the same data type" : Ce.description
4700
4700
  }
4701
4701
  )
4702
4702
  ] })
@@ -4704,25 +4704,25 @@ function Qi({
4704
4704
  }
4705
4705
  );
4706
4706
  },
4707
- onValueChange: (W) => {
4708
- Q(W);
4707
+ onValueChange: (Q) => {
4708
+ X(Q);
4709
4709
  },
4710
- children: V.map(([W, te]) => {
4710
+ children: N.map(([Q, te]) => {
4711
4711
  const me = te.property, ue = o && !oe(me) && me.dataType !== t?.dataType;
4712
4712
  return /* @__PURE__ */ e(
4713
4713
  sa,
4714
4714
  {
4715
- value: W,
4715
+ value: Q,
4716
4716
  optionDisabled: ue,
4717
4717
  propertyConfig: te,
4718
4718
  existing: o
4719
4719
  },
4720
- W
4720
+ Q
4721
4721
  );
4722
4722
  })
4723
4723
  }
4724
4724
  ),
4725
- xe && /* @__PURE__ */ e(
4725
+ fe && /* @__PURE__ */ e(
4726
4726
  C,
4727
4727
  {
4728
4728
  variant: "caption",
@@ -4732,13 +4732,13 @@ function Qi({
4732
4732
  }
4733
4733
  )
4734
4734
  ] }),
4735
- c && t?.id && /* @__PURE__ */ e(
4735
+ d && t?.id && /* @__PURE__ */ e(
4736
4736
  ne,
4737
4737
  {
4738
4738
  variant: "ghost",
4739
4739
  className: "m-4",
4740
4740
  disabled: b,
4741
- onClick: () => A(!0),
4741
+ onClick: () => z(!0),
4742
4742
  children: /* @__PURE__ */ e(pt, {})
4743
4743
  }
4744
4744
  )
@@ -4750,20 +4750,20 @@ function Qi({
4750
4750
  showErrors: g,
4751
4751
  disabledId: o,
4752
4752
  isNewProperty: !o,
4753
- existingPropertyKeys: k,
4753
+ existingPropertyKeys: w,
4754
4754
  disabled: b,
4755
- ref: N
4755
+ ref: x
4756
4756
  }
4757
4757
  ),
4758
- U,
4758
+ M,
4759
4759
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Yi, { disabled: b }) })
4760
4760
  ] }),
4761
- c && /* @__PURE__ */ e(
4761
+ d && /* @__PURE__ */ e(
4762
4762
  mt,
4763
4763
  {
4764
- open: F,
4765
- onAccept: () => c(t?.id, d),
4766
- onCancel: () => A(!1),
4764
+ open: E,
4765
+ onAccept: () => d(t?.id, c),
4766
+ onCancel: () => z(!1),
4767
4767
  title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
4768
4768
  body: /* @__PURE__ */ n("div", { children: [
4769
4769
  " This will ",
@@ -4811,13 +4811,13 @@ const ` + Wi(t.name) + "Collection:EntityCollection = " + si.stringify(da(t), nu
4811
4811
  theme: ci.vsDark,
4812
4812
  code: s,
4813
4813
  language: "typescript",
4814
- children: ({ className: o, style: l, tokens: p, getLineProps: m, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: p.map((c, d) => /* @__PURE__ */ e("div", { ...m({ line: c }), children: c.map((f, g) => /* @__PURE__ */ e("span", { ...u({ token: f }) }, g)) }, d)) })
4814
+ children: ({ className: o, style: l, tokens: p, getLineProps: m, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: p.map((d, c) => /* @__PURE__ */ e("div", { ...m({ line: d }), children: d.map((y, g) => /* @__PURE__ */ e("span", { ...u({ token: y }) }, g)) }, c)) })
4815
4815
  }
4816
4816
  )
4817
4817
  ] }),
4818
4818
  /* @__PURE__ */ n(Le, { children: [
4819
4819
  /* @__PURE__ */ n(
4820
- B,
4820
+ U,
4821
4821
  {
4822
4822
  variant: "text",
4823
4823
  size: "small",
@@ -4831,7 +4831,7 @@ const ` + Wi(t.name) + "Collection:EntityCollection = " + si.stringify(da(t), nu
4831
4831
  ]
4832
4832
  }
4833
4833
  ),
4834
- /* @__PURE__ */ e(B, { onClick: () => a(!1), children: "Close" })
4834
+ /* @__PURE__ */ e(U, { onClick: () => a(!1), children: "Close" })
4835
4835
  ] })
4836
4836
  ]
4837
4837
  }
@@ -4877,124 +4877,124 @@ function Xi({
4877
4877
  getUser: p,
4878
4878
  getData: m,
4879
4879
  doCollectionInference: u,
4880
- propertyConfigs: c,
4881
- collectionEditable: d
4880
+ propertyConfigs: d,
4881
+ collectionEditable: c
4882
4882
  }) {
4883
4883
  const {
4884
- values: f,
4884
+ values: y,
4885
4885
  setFieldValue: g,
4886
4886
  setFieldError: b,
4887
4887
  setFieldTouched: O,
4888
- errors: k,
4889
- dirty: x
4890
- } = K(), h = De(), _ = Ea("lg"), y = !_, [w, q] = $(), [F, A] = $(), [S, E] = $(), v = F ? ce(F, S) : void 0, V = v ? P(f.properties, v.replaceAll(".", ".properties.")) : void 0, [J, N] = $(!1), [R, ge] = $(!1), [xe, Q] = $(!1), [U, W] = $([]), te = L.useRef(f.propertiesOrder ? { "": f.propertiesOrder } : {});
4888
+ errors: w,
4889
+ dirty: k
4890
+ } = Y(), f = De(), v = Ea("lg"), _ = !v, [h, A] = L(), [E, z] = L(), [q, B] = L(), S = E ? ce(E, q) : void 0, N = S ? P(y.properties, S.replaceAll(".", ".properties.")) : void 0, [j, x] = L(!1), [I, ge] = L(!1), [fe, X] = L(!1), [M, Q] = L([]), te = K.useRef(y.propertiesOrder ? { "": y.propertiesOrder } : {});
4891
4891
  pe(() => {
4892
- s && s(x);
4893
- }, [x]);
4892
+ s && s(k);
4893
+ }, [k]);
4894
4894
  const me = u ? () => {
4895
- u && (ge(!0), u(f).then((z) => {
4896
- if (z && et(z.properties), !z) {
4897
- h.open({
4895
+ u && (ge(!0), u(y).then((T) => {
4896
+ if (T && et(T.properties), !T) {
4897
+ f.open({
4898
4898
  type: "error",
4899
4899
  message: "Could not infer properties from data"
4900
4900
  });
4901
4901
  return;
4902
4902
  }
4903
- const j = (z.properties ? Object.keys(z.properties) : []).filter((le) => !f.properties[le]);
4904
- if (j.length === 0) {
4905
- h.open({
4903
+ const D = (T.properties ? Object.keys(T.properties) : []).filter((le) => !y.properties[le]);
4904
+ if (D.length === 0) {
4905
+ f.open({
4906
4906
  type: "info",
4907
4907
  message: "No new properties found in existing data"
4908
4908
  });
4909
4909
  return;
4910
4910
  }
4911
- const G = {
4912
- ...j.reduce((le, ve) => (le[ve] = (z.properties ?? {})[ve], le), {}),
4913
- ...f.properties
4911
+ const H = {
4912
+ ...D.reduce((le, we) => (le[we] = (T.properties ?? {})[we], le), {}),
4913
+ ...y.properties
4914
4914
  }, se = [
4915
- ...j,
4916
- ...f.propertiesOrder ?? []
4915
+ ...D,
4916
+ ...y.propertiesOrder ?? []
4917
4917
  ];
4918
- g("properties", G, !1), fe(se), W(j);
4918
+ g("properties", H, !1), be(se), Q(D);
4919
4919
  }).finally(() => {
4920
4920
  ge(!1);
4921
4921
  }));
4922
- } : void 0, ue = (z) => z ? te.current[z] ?? P(f, Ne(z)) : te.current[""], fe = (z, j) => {
4923
- const G = Ne(j);
4924
- g(G, z, !1), te.current[j ?? ""] = z;
4925
- }, ye = (z, j) => {
4926
- const G = z ? ce(z, j) : void 0;
4927
- if (!G)
4922
+ } : void 0, ue = (T) => T ? te.current[T] ?? P(y, Pe(T)) : te.current[""], be = (T, D) => {
4923
+ const H = Pe(D);
4924
+ g(H, T, !1), te.current[D ?? ""] = T;
4925
+ }, ve = (T, D) => {
4926
+ const H = T ? ce(T, D) : void 0;
4927
+ if (!H)
4928
4928
  throw Error("collection editor miss config");
4929
- g(_e(G), void 0, !1);
4930
- const le = ue(j).filter((ve) => ve !== z);
4931
- fe(le, j), Q(!1), q(void 0), A(void 0), E(void 0);
4932
- }, Ce = (z, j) => {
4933
- g(Ne(j), z, !1);
4929
+ g(ke(H), void 0, !1);
4930
+ const le = ue(D).filter((we) => we !== T);
4931
+ be(le, D), X(!1), A(void 0), z(void 0), B(void 0);
4932
+ }, Ce = (T, D) => {
4933
+ g(Pe(D), T, !1);
4934
4934
  }, ae = ({
4935
- id: z,
4936
- property: j
4935
+ id: T,
4936
+ property: D
4937
4937
  }) => {
4938
4938
  if (console.log("onPropertyCreated", {
4939
- id: z,
4940
- property: j
4941
- }), !z)
4939
+ id: T,
4940
+ property: D
4941
+ }), !T)
4942
4942
  throw Error("Need to include an ID when creating a new property");
4943
4943
  g("properties", {
4944
- ...f.properties ?? {},
4945
- [z]: j
4944
+ ...y.properties ?? {},
4945
+ [T]: D
4946
4946
  }, !1);
4947
- const G = [...f.propertiesOrder ?? Object.keys(f.properties), z];
4947
+ const H = [...y.propertiesOrder ?? Object.keys(y.properties), T];
4948
4948
  console.log("onPropertyCreated", {
4949
- id: z,
4950
- property: j,
4951
- newPropertiesOrder: G
4952
- }), fe(G), Q(!1), _ && (q(G.indexOf(z)), A(z)), E(void 0);
4949
+ id: T,
4950
+ property: D,
4951
+ newPropertiesOrder: H
4952
+ }), be(H), X(!1), v && (A(H.indexOf(T)), z(T)), B(void 0);
4953
4953
  }, Ve = ({
4954
- id: z,
4955
- property: j,
4956
- previousId: G,
4954
+ id: T,
4955
+ property: D,
4956
+ previousId: H,
4957
4957
  namespace: se
4958
4958
  }) => {
4959
- const le = z ? ce(z, se) : void 0, ve = le ? _e(le) : void 0;
4960
- if (G && G !== z) {
4961
- const yt = ce(G, se), it = _e(yt), Z = ue(se).map((Ie) => Ie === G ? z : Ie).filter((Ie) => Ie !== void 0);
4962
- fe(Z, se), z && (q(Z.indexOf(z)), A(z)), g(it, void 0, !1), O(it, !1, !1);
4959
+ const le = T ? ce(T, se) : void 0, we = le ? ke(le) : void 0;
4960
+ if (H && H !== T) {
4961
+ const yt = ce(H, se), it = ke(yt), W = ue(se).map((Ie) => Ie === H ? T : Ie).filter((Ie) => Ie !== void 0);
4962
+ be(W, se), T && (A(W.indexOf(T)), z(T)), g(it, void 0, !1), O(it, !1, !1);
4963
4963
  }
4964
- ve && (g(ve, j, !1), O(ve, !0, !1));
4965
- }, tt = (z, j, G) => {
4966
- const se = z ? ce(z, j) : void 0;
4964
+ we && (g(we, D, !1), O(we, !0, !1));
4965
+ }, tt = (T, D, H) => {
4966
+ const se = T ? ce(T, D) : void 0;
4967
4967
  if (console.warn("onPropertyErrorInternal", {
4968
- id: z,
4969
- namespace: j,
4970
- error: G,
4968
+ id: T,
4969
+ namespace: D,
4970
+ error: H,
4971
4971
  propertyPath: se
4972
4972
  }), se) {
4973
- const le = G && Object.keys(G).length > 0;
4974
- r(z, j, le ? G : void 0), b(_e(se), le ? "Property error" : void 0);
4973
+ const le = H && Object.keys(H).length > 0;
4974
+ r(T, D, le ? H : void 0), b(ke(se), le ? "Property error" : void 0);
4975
4975
  }
4976
4976
  }, bt = () => {
4977
- q(void 0), A(void 0);
4978
- }, T = F && i?.current?.properties ? i.current.properties[F] : void 0, I = f?.propertiesOrder === void 0 || f.propertiesOrder.length === 0, D = f.propertiesOrder ? f.propertiesOrder : Object.keys(f.properties), Oe = Kt(() => p(f.ownerId), [p, f.ownerId]), at = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4979
- /* @__PURE__ */ n("div", { className: ke(
4977
+ A(void 0), z(void 0);
4978
+ }, V = E && i?.current?.properties ? i.current.properties[E] : void 0, F = y?.propertiesOrder === void 0 || y.propertiesOrder.length === 0, R = y.propertiesOrder ? y.propertiesOrder : Object.keys(y.properties), Oe = Kt(() => p(y.ownerId), [p, y.ownerId]), at = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4979
+ /* @__PURE__ */ n("div", { className: xe(
4980
4980
  "p-4 md:p-8 pb-20 md:pb-20",
4981
4981
  "col-span-12 lg:col-span-5 h-full overflow-auto",
4982
- !y && "border-r " + Pt
4982
+ !_ && "border-r " + Nt
4983
4983
  ), children: [
4984
4984
  /* @__PURE__ */ n("div", { className: "flex my-2", children: [
4985
4985
  /* @__PURE__ */ n("div", { className: "flex-grow mb-4", children: [
4986
4986
  /* @__PURE__ */ e(
4987
- be,
4987
+ ye,
4988
4988
  {
4989
4989
  name: "name",
4990
- as: H,
4990
+ as: J,
4991
4991
  invisible: !0,
4992
4992
  className: "-ml-1",
4993
4993
  inputClassName: "text-2xl font-headers",
4994
4994
  placeholder: "Collection name",
4995
4995
  size: "small",
4996
4996
  required: !0,
4997
- error: !!k?.name
4997
+ error: !!w?.name
4998
4998
  }
4999
4999
  ),
5000
5000
  Oe && /* @__PURE__ */ n(
@@ -5016,8 +5016,8 @@ function Xi({
5016
5016
  ne,
5017
5017
  {
5018
5018
  variant: "filled",
5019
- disabled: R,
5020
- onClick: () => N(!0),
5019
+ disabled: I,
5020
+ onClick: () => x(!0),
5021
5021
  children: /* @__PURE__ */ e(Da, {})
5022
5022
  }
5023
5023
  ) }),
@@ -5025,58 +5025,58 @@ function Xi({
5025
5025
  ne,
5026
5026
  {
5027
5027
  variant: "filled",
5028
- disabled: R,
5028
+ disabled: I,
5029
5029
  onClick: me,
5030
- children: R ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {})
5030
+ children: I ? /* @__PURE__ */ e(We, { size: "small" }) : /* @__PURE__ */ e(gt, {})
5031
5031
  }
5032
5032
  ) }),
5033
5033
  /* @__PURE__ */ e(re, { title: "Add new property", children: /* @__PURE__ */ e(
5034
- B,
5034
+ U,
5035
5035
  {
5036
5036
  variant: "outlined",
5037
- onClick: () => Q(!0),
5037
+ onClick: () => X(!0),
5038
5038
  children: /* @__PURE__ */ e(Ae, {})
5039
5039
  }
5040
5040
  ) })
5041
5041
  ] })
5042
5042
  ] }),
5043
- /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
5043
+ /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
5044
5044
  ft,
5045
5045
  {
5046
5046
  className: "pl-8",
5047
- onPropertyClick: (z, j) => {
5048
- q(D.indexOf(z)), A(z), E(j);
5047
+ onPropertyClick: (T, D) => {
5048
+ A(R.indexOf(T)), z(T), B(D);
5049
5049
  },
5050
- inferredPropertyKeys: U,
5051
- selectedPropertyKey: F ? ce(F, S) : void 0,
5052
- properties: f.properties,
5053
- additionalFields: f.additionalFields,
5054
- propertiesOrder: D,
5050
+ inferredPropertyKeys: M,
5051
+ selectedPropertyKey: E ? ce(E, q) : void 0,
5052
+ properties: y.properties,
5053
+ additionalFields: y.additionalFields,
5054
+ propertiesOrder: R,
5055
5055
  onPropertyMove: Ce,
5056
- onPropertyRemove: a ? ye : void 0,
5057
- collectionEditable: d,
5058
- errors: t ? k : {}
5056
+ onPropertyRemove: a ? ve : void 0,
5057
+ collectionEditable: c,
5058
+ errors: t ? w : {}
5059
5059
  }
5060
5060
  ) }),
5061
5061
  /* @__PURE__ */ e(
5062
- B,
5062
+ U,
5063
5063
  {
5064
5064
  className: "mt-8 w-full",
5065
5065
  color: "primary",
5066
5066
  variant: "outlined",
5067
5067
  size: "large",
5068
- onClick: () => Q(!0),
5068
+ onClick: () => X(!0),
5069
5069
  startIcon: /* @__PURE__ */ e(Ae, {}),
5070
5070
  children: "Add new property"
5071
5071
  }
5072
5072
  )
5073
5073
  ] }),
5074
- !y && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 ml-2 p-4 md:p-8 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ n(
5074
+ !_ && /* @__PURE__ */ e("div", { className: "col-span-12 lg:col-span-7 ml-2 p-4 md:p-8 h-full overflow-auto pb-20 md:pb-20", children: /* @__PURE__ */ n(
5075
5075
  qe,
5076
5076
  {
5077
5077
  className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
5078
5078
  children: [
5079
- v && V && !oe(V) && /* @__PURE__ */ e(
5079
+ S && N && !oe(N) && /* @__PURE__ */ e(
5080
5080
  ca,
5081
5081
  {
5082
5082
  inArray: !1,
@@ -5084,51 +5084,51 @@ function Xi({
5084
5084
  autoUpdateId: !1,
5085
5085
  allowDataInference: !a,
5086
5086
  autoOpenTypeSelect: !1,
5087
- propertyKey: F,
5088
- propertyNamespace: S,
5089
- property: V,
5087
+ propertyKey: E,
5088
+ propertyNamespace: q,
5089
+ property: N,
5090
5090
  onPropertyChanged: Ve,
5091
- onDelete: ye,
5091
+ onDelete: ve,
5092
5092
  onError: tt,
5093
5093
  forceShowErrors: t,
5094
- initialErrors: T,
5094
+ initialErrors: V,
5095
5095
  getData: m,
5096
- propertyConfigs: c,
5097
- collectionEditable: d
5096
+ propertyConfigs: d,
5097
+ collectionEditable: c
5098
5098
  },
5099
- `edit_view_${w}`
5099
+ `edit_view_${h}`
5100
5100
  ),
5101
- !V && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center h-full", children: I ? "Now you can add your first property" : "Select a property to edit it" }),
5102
- V && oe(V) && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
5101
+ !N && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center h-full", children: F ? "Now you can add your first property" : "Select a property to edit it" }),
5102
+ N && oe(N) && /* @__PURE__ */ e(C, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
5103
5103
  ]
5104
5104
  }
5105
5105
  ) }),
5106
- y && /* @__PURE__ */ e(
5106
+ _ && /* @__PURE__ */ e(
5107
5107
  je,
5108
5108
  {
5109
5109
  inArray: !1,
5110
- open: w !== void 0,
5110
+ open: h !== void 0,
5111
5111
  autoUpdateId: a,
5112
5112
  allowDataInference: !a,
5113
5113
  existingProperty: !0,
5114
5114
  autoOpenTypeSelect: !1,
5115
- propertyKey: F,
5116
- propertyNamespace: S,
5117
- property: V,
5115
+ propertyKey: E,
5116
+ propertyNamespace: q,
5117
+ property: N,
5118
5118
  onPropertyChanged: Ve,
5119
- onDelete: ye,
5119
+ onDelete: ve,
5120
5120
  onError: tt,
5121
5121
  forceShowErrors: t,
5122
- initialErrors: T,
5122
+ initialErrors: V,
5123
5123
  getData: m,
5124
- propertyConfigs: c,
5125
- collectionEditable: d,
5126
- onOkClicked: y ? bt : void 0
5124
+ propertyConfigs: d,
5125
+ collectionEditable: c,
5126
+ onOkClicked: _ ? bt : void 0
5127
5127
  },
5128
- `edit_view_${w}`
5128
+ `edit_view_${h}`
5129
5129
  )
5130
5130
  ] });
5131
- return /* @__PURE__ */ n(M, { children: [
5131
+ return /* @__PURE__ */ n($, { children: [
5132
5132
  at,
5133
5133
  /* @__PURE__ */ e(
5134
5134
  je,
@@ -5138,22 +5138,22 @@ function Xi({
5138
5138
  autoOpenTypeSelect: !0,
5139
5139
  autoUpdateId: !0,
5140
5140
  forceShowErrors: t,
5141
- open: xe,
5142
- onCancel: () => Q(!1),
5141
+ open: fe,
5142
+ onCancel: () => X(!1),
5143
5143
  onPropertyChanged: ae,
5144
5144
  getData: m,
5145
5145
  allowDataInference: !a,
5146
- propertyConfigs: c,
5147
- collectionEditable: d,
5148
- existingPropertyKeys: f.propertiesOrder
5146
+ propertyConfigs: d,
5147
+ collectionEditable: c,
5148
+ existingPropertyKeys: y.propertiesOrder
5149
5149
  }
5150
5150
  ),
5151
5151
  /* @__PURE__ */ e(
5152
5152
  Zi,
5153
5153
  {
5154
- collection: f,
5155
- open: J,
5156
- onOpenChange: N
5154
+ collection: y,
5155
+ open: j,
5156
+ onOpenChange: x
5157
5157
  }
5158
5158
  )
5159
5159
  ] });
@@ -5179,8 +5179,8 @@ function er({
5179
5179
  /* @__PURE__ */ e(C, { children: "Are you sure?" })
5180
5180
  ] }),
5181
5181
  /* @__PURE__ */ n(Le, { children: [
5182
- /* @__PURE__ */ e(B, { variant: "text", onClick: i, autoFocus: !0, children: " Cancel " }),
5183
- /* @__PURE__ */ e(B, { onClick: a, children: " Ok " })
5182
+ /* @__PURE__ */ e(U, { variant: "text", onClick: i, autoFocus: !0, children: " Cancel " }),
5183
+ /* @__PURE__ */ e(U, { onClick: a, children: " Ok " })
5184
5184
  ] })
5185
5185
  ]
5186
5186
  }
@@ -5199,7 +5199,7 @@ function tr({ open: t, onClose: a }) {
5199
5199
  /* @__PURE__ */ n($e, { children: [
5200
5200
  /* @__PURE__ */ e(C, { variant: "h6", children: "Select view" }),
5201
5201
  i?.map((r) => /* @__PURE__ */ n(
5202
- B,
5202
+ U,
5203
5203
  {
5204
5204
  onClick: () => a(r.key),
5205
5205
  fullWidth: !0,
@@ -5215,7 +5215,7 @@ function tr({ open: t, onClose: a }) {
5215
5215
  )),
5216
5216
  (i ?? []).length === 0 && /* @__PURE__ */ e(C, { variant: "body2", children: "No custom views defined" })
5217
5217
  ] }),
5218
- /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(B, { onClick: () => a(), children: "Cancel" }) })
5218
+ /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(U, { onClick: () => a(), children: "Cancel" }) })
5219
5219
  ]
5220
5220
  }
5221
5221
  );
@@ -5228,10 +5228,10 @@ function ar({
5228
5228
  getUser: s,
5229
5229
  parentCollectionIds: o
5230
5230
  }) {
5231
- const { entityViews: l } = Ke(), [p, m] = L.useState(), [u, c] = L.useState(!1), [d, f] = L.useState(), [g, b] = L.useState(), {
5231
+ const { entityViews: l } = Ke(), [p, m] = K.useState(), [u, d] = K.useState(!1), [c, y] = K.useState(), [g, b] = K.useState(), {
5232
5232
  values: O,
5233
- setFieldValue: k
5234
- } = K(), x = t.subcollections ?? [], h = O.entityViews?.filter((w) => typeof w == "string").map((w) => Ba(w, l)).filter(Boolean) ?? [], _ = t.entityViews?.filter((w) => typeof w != "string") ?? [], y = h.length + _.length;
5233
+ setFieldValue: w
5234
+ } = Y(), k = t.subcollections ?? [], f = O.entityViews?.filter((h) => typeof h == "string").map((h) => Ba(h, l)).filter(Boolean) ?? [], v = t.entityViews?.filter((h) => typeof h != "string") ?? [], _ = f.length + v.length;
5235
5235
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
5236
5236
  /* @__PURE__ */ e(ht, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
5237
5237
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
@@ -5239,19 +5239,19 @@ function ar({
5239
5239
  "Subcollections of ",
5240
5240
  O.name
5241
5241
  ] }),
5242
- x && x.length > 0 && /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(Ft, { children: x.map((w) => /* @__PURE__ */ n(
5242
+ k && k.length > 0 && /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(Ft, { children: k.map((h) => /* @__PURE__ */ n(
5243
5243
  wt,
5244
5244
  {
5245
5245
  onClick: () => b({
5246
5246
  isNewCollection: !1,
5247
- editedCollectionPath: w.path
5247
+ editedCollectionPath: h.path
5248
5248
  }),
5249
5249
  children: [
5250
5250
  /* @__PURE__ */ e(
5251
5251
  Ge,
5252
5252
  {
5253
5253
  align: "left",
5254
- children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name })
5254
+ children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name })
5255
5255
  }
5256
5256
  ),
5257
5257
  /* @__PURE__ */ e(
@@ -5262,8 +5262,8 @@ function ar({
5262
5262
  ne,
5263
5263
  {
5264
5264
  size: "small",
5265
- onClick: (q) => {
5266
- q.preventDefault(), q.stopPropagation(), m(w.path);
5265
+ onClick: (A) => {
5266
+ A.preventDefault(), A.stopPropagation(), m(h.path);
5267
5267
  },
5268
5268
  color: "inherit",
5269
5269
  children: /* @__PURE__ */ e(pt, { size: "small" })
@@ -5273,10 +5273,10 @@ function ar({
5273
5273
  )
5274
5274
  ]
5275
5275
  },
5276
- w.path
5276
+ h.path
5277
5277
  )) }) }) }),
5278
5278
  /* @__PURE__ */ e(
5279
- B,
5279
+ U,
5280
5280
  {
5281
5281
  onClick: () => {
5282
5282
  b({
@@ -5291,13 +5291,13 @@ function ar({
5291
5291
  ] }),
5292
5292
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5293
5293
  /* @__PURE__ */ e(C, { variant: "h5", children: "Custom views" }),
5294
- y > 0 && /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ n(Ft, { children: [
5295
- h.map((w) => /* @__PURE__ */ n(wt, { children: [
5294
+ _ > 0 && /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(qe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(It, { children: /* @__PURE__ */ n(Ft, { children: [
5295
+ f.map((h) => /* @__PURE__ */ n(wt, { children: [
5296
5296
  /* @__PURE__ */ e(
5297
5297
  Ge,
5298
5298
  {
5299
5299
  align: "left",
5300
- children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name })
5300
+ children: /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name })
5301
5301
  }
5302
5302
  ),
5303
5303
  /* @__PURE__ */ e(
@@ -5308,8 +5308,8 @@ function ar({
5308
5308
  ne,
5309
5309
  {
5310
5310
  size: "small",
5311
- onClick: (q) => {
5312
- q.preventDefault(), q.stopPropagation(), f(w.key);
5311
+ onClick: (A) => {
5312
+ A.preventDefault(), A.stopPropagation(), y(h.key);
5313
5313
  },
5314
5314
  color: "inherit",
5315
5315
  children: /* @__PURE__ */ e(pt, { size: "small" })
@@ -5317,30 +5317,30 @@ function ar({
5317
5317
  ) })
5318
5318
  }
5319
5319
  )
5320
- ] }, w.key)),
5321
- _.map((w) => /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ n(
5320
+ ] }, h.key)),
5321
+ v.map((h) => /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ n(
5322
5322
  Ge,
5323
5323
  {
5324
5324
  align: "left",
5325
5325
  children: [
5326
- /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: w.name }),
5326
+ /* @__PURE__ */ e(C, { variant: "subtitle2", className: "flex-grow", children: h.name }),
5327
5327
  /* @__PURE__ */ n(C, { variant: "caption", className: "flex-grow", children: [
5328
5328
  "This view is defined in code with key ",
5329
- /* @__PURE__ */ e("code", { children: w.key })
5329
+ /* @__PURE__ */ e("code", { children: h.key })
5330
5330
  ] })
5331
5331
  ]
5332
5332
  }
5333
- ) }, w.key))
5333
+ ) }, h.key))
5334
5334
  ] }) }) }) }),
5335
- y === 0 && /* @__PURE__ */ n(ea, { children: [
5335
+ _ === 0 && /* @__PURE__ */ n(ea, { children: [
5336
5336
  /* @__PURE__ */ e("b", { children: "COMING SOON" }),
5337
5337
  " Define your own custom views by uploading it with the CLI"
5338
5338
  ] }),
5339
5339
  /* @__PURE__ */ e(
5340
- B,
5340
+ U,
5341
5341
  {
5342
5342
  onClick: () => {
5343
- c(!0);
5343
+ d(!0);
5344
5344
  },
5345
5345
  variant: "outlined",
5346
5346
  startIcon: /* @__PURE__ */ e(Ae, {}),
@@ -5361,24 +5361,24 @@ function ar({
5361
5361
  }), m(void 0);
5362
5362
  },
5363
5363
  onCancel: () => m(void 0),
5364
- title: /* @__PURE__ */ e(M, { children: "Delete this subcollection?" }),
5365
- body: /* @__PURE__ */ n(M, { children: [
5364
+ title: /* @__PURE__ */ e($, { children: "Delete this subcollection?" }),
5365
+ body: /* @__PURE__ */ n($, { children: [
5366
5366
  " This will ",
5367
5367
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
5368
5368
  ", only the collection in the CMS"
5369
5369
  ] })
5370
5370
  }
5371
5371
  ),
5372
- d && /* @__PURE__ */ e(
5372
+ c && /* @__PURE__ */ e(
5373
5373
  mt,
5374
5374
  {
5375
- open: !!d,
5375
+ open: !!c,
5376
5376
  onAccept: () => {
5377
- k("entityViews", O.entityViews?.filter((w) => w !== d)), f(void 0);
5377
+ w("entityViews", O.entityViews?.filter((h) => h !== c)), y(void 0);
5378
5378
  },
5379
- onCancel: () => f(void 0),
5380
- title: /* @__PURE__ */ e(M, { children: "Remove this view?" }),
5381
- body: /* @__PURE__ */ n(M, { children: [
5379
+ onCancel: () => y(void 0),
5380
+ title: /* @__PURE__ */ e($, { children: "Remove this view?" }),
5381
+ body: /* @__PURE__ */ n($, { children: [
5382
5382
  "This will ",
5383
5383
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
5384
5384
  ", only the view in the CMS"
@@ -5405,8 +5405,8 @@ function ar({
5405
5405
  tr,
5406
5406
  {
5407
5407
  open: u,
5408
- onClose: (w) => {
5409
- w && (console.log("selectedViewKey", w), k("entityViews", [...O.entityViews ?? [], w])), c(!1);
5408
+ onClose: (h) => {
5409
+ h && (console.log("selectedViewKey", h), w("entityViews", [...O.entityViews ?? [], h])), d(!1);
5410
5410
  }
5411
5411
  }
5412
5412
  )
@@ -5648,24 +5648,24 @@ function ir({
5648
5648
  onContinue: r,
5649
5649
  collections: s
5650
5650
  }) {
5651
- const [o, l] = $(!1), [p, m] = $();
5651
+ const [o, l] = L(!1), [p, m] = L();
5652
5652
  pe(() => {
5653
- a && s && (l(!0), a(t).then((h) => {
5654
- const _ = h.filter((y) => !s.find((w) => w.path.trim().toLowerCase() === y.trim().toLowerCase()));
5655
- m(_);
5653
+ a && s && (l(!0), a(t).then((f) => {
5654
+ const v = f.filter((_) => !s.find((h) => h.path.trim().toLowerCase() === _.trim().toLowerCase()));
5655
+ m(v);
5656
5656
  }).finally(() => l(!1)));
5657
5657
  }, [s, t, a]);
5658
5658
  const {
5659
5659
  values: u,
5660
- setFieldValue: c,
5661
- setValues: d,
5662
- handleChange: f,
5660
+ setFieldValue: d,
5661
+ setValues: c,
5662
+ handleChange: y,
5663
5663
  touched: g,
5664
5664
  errors: b,
5665
5665
  setFieldTouched: O,
5666
- isSubmitting: k,
5667
- submitCount: x
5668
- } = K();
5666
+ isSubmitting: w,
5667
+ submitCount: k
5668
+ } = Y();
5669
5669
  return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ht, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5670
5670
  /* @__PURE__ */ e(
5671
5671
  "div",
@@ -5689,17 +5689,17 @@ function ir({
5689
5689
  ),
5690
5690
  /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
5691
5691
  o && !p && /* @__PURE__ */ e(We, { size: "small" }),
5692
- p?.map((h, _) => /* @__PURE__ */ e(
5692
+ p?.map((f, v) => /* @__PURE__ */ e(
5693
5693
  dt,
5694
5694
  {
5695
5695
  colorScheme: "cyanLighter",
5696
5696
  onClick: () => {
5697
- c("name", Nt(h)), c("path", h), c("properties", void 0), r();
5697
+ d("name", Pt(f)), d("path", f), d("properties", void 0), r();
5698
5698
  },
5699
5699
  size: "small",
5700
- children: h
5700
+ children: f
5701
5701
  },
5702
- h
5702
+ f
5703
5703
  )),
5704
5704
  !o && p?.length === 0 && /* @__PURE__ */ e(C, { variant: "caption", children: "No suggestions" })
5705
5705
  ] })
@@ -5721,7 +5721,7 @@ function ir({
5721
5721
  subtitle: "A collection of products with images, prices and stock",
5722
5722
  icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Ut.icon }),
5723
5723
  onClick: () => {
5724
- d(Ut), r();
5724
+ c(Ut), r();
5725
5725
  }
5726
5726
  }
5727
5727
  ),
@@ -5732,7 +5732,7 @@ function ir({
5732
5732
  subtitle: "A collection of blog posts with images, authors and complex content",
5733
5733
  icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: $t.icon }),
5734
5734
  onClick: () => {
5735
- d($t), r();
5735
+ c($t), r();
5736
5736
  }
5737
5737
  }
5738
5738
  ),
@@ -5743,7 +5743,7 @@ function ir({
5743
5743
  subtitle: "A collection of users with emails, names and roles",
5744
5744
  icon: /* @__PURE__ */ e(lt, { size: "small", iconKey: Lt.icon }),
5745
5745
  onClick: () => {
5746
- d(Lt), r();
5746
+ c(Lt), r();
5747
5747
  }
5748
5748
  }
5749
5749
  )
@@ -5759,9 +5759,9 @@ function ir({
5759
5759
  children: "● Create a collection from a file (csv, json, xls, xslx...)"
5760
5760
  }
5761
5761
  ),
5762
- /* @__PURE__ */ e(di, { onDataAdded: (h) => r(h) })
5762
+ /* @__PURE__ */ e(di, { onDataAdded: (f) => r(f) })
5763
5763
  ] }),
5764
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(B, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
5764
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(U, { variant: "text", onClick: () => r(), className: "my-2", children: "Continue from scratch" }) })
5765
5765
  ] }) });
5766
5766
  }
5767
5767
  function kt({
@@ -5774,7 +5774,7 @@ function kt({
5774
5774
  ta,
5775
5775
  {
5776
5776
  onClick: r,
5777
- className: ke(
5777
+ className: xe(
5778
5778
  "my-2 rounded-md border mx-0 p-6 px-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center",
5779
5779
  "text-gray-700 dark:text-gray-300",
5780
5780
  "hover:border-blue-600 hover:text-blue-600 dark:hover:text-blue-400 focus:ring-blue-400 hover:ring-1 hover:ring-primary",
@@ -5804,39 +5804,39 @@ function rr({
5804
5804
  setFieldValue: r,
5805
5805
  setFieldTouched: s,
5806
5806
  values: o
5807
- } = K(), [l, p] = $(void 0), m = L.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, c = l || void 0, d = ({
5807
+ } = Y(), [l, p] = L(void 0), m = K.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, d = l || void 0, c = ({
5808
5808
  id: g,
5809
5809
  property: b,
5810
5810
  previousId: O,
5811
- namespace: k
5811
+ namespace: w
5812
5812
  }) => {
5813
- const x = g ? ce(g, k) : void 0, h = x ? _e(x) : void 0, _ = (w) => w ? m.current[w] ?? P(o, Ne(w)) : m.current[""], y = (w, q) => {
5814
- const F = Ne(q);
5815
- r(F, w, !1), m.current[q ?? ""] = w;
5813
+ const k = g ? ce(g, w) : void 0, f = k ? ke(k) : void 0, v = (h) => h ? m.current[h] ?? P(o, Pe(h)) : m.current[""], _ = (h, A) => {
5814
+ const E = Pe(A);
5815
+ r(E, h, !1), m.current[A ?? ""] = h;
5816
5816
  };
5817
5817
  if (O && O !== g) {
5818
- const w = ce(O, k), q = _e(w), A = _(k).map((E) => E === O ? g : E).filter((E) => E !== void 0);
5819
- y(A, k);
5820
- const S = { ...t.headersMapping };
5821
- Object.keys(S).forEach((E) => {
5822
- S[E] === O && (S[E] = g ?? "");
5823
- }), t.setHeadersMapping(S), r(q, void 0, !1), s(q, !1, !1);
5818
+ const h = ce(O, w), A = ke(h), z = v(w).map((B) => B === O ? g : B).filter((B) => B !== void 0);
5819
+ _(z, w);
5820
+ const q = { ...t.headersMapping };
5821
+ Object.keys(q).forEach((B) => {
5822
+ q[B] === O && (q[B] = g ?? "");
5823
+ }), t.setHeadersMapping(q), r(A, void 0, !1), s(A, !1, !1);
5824
5824
  }
5825
- h && (r(h, b, !1), s(h, !0, !1));
5826
- }, f = async ({
5825
+ f && (r(f, b, !1), s(f, !0, !1));
5826
+ }, y = async ({
5827
5827
  id: g,
5828
5828
  importKey: b,
5829
5829
  property: O,
5830
- namespace: k
5830
+ namespace: w
5831
5831
  }) => {
5832
- const x = g ? ce(g, k) : void 0, h = x ? _e(x) : void 0, _ = t.importData.map((w) => P(w, b)), y = {
5833
- ...ai(_, O, ia),
5832
+ const k = g ? ce(g, w) : void 0, f = k ? ke(k) : void 0, v = t.importData.map((h) => P(h, b)), _ = {
5833
+ ...ai(v, O, ia),
5834
5834
  editable: !0
5835
5835
  };
5836
- h && (y ? (console.log("updating inferredNewProperty", {
5836
+ f && (_ ? (console.log("updating inferredNewProperty", {
5837
5837
  property: O,
5838
- inferredNewProperty: y
5839
- }), r(h, y, !1)) : r(h, O, !1), s(h, !0, !1));
5838
+ inferredNewProperty: _
5839
+ }), r(f, _, !1)) : r(f, O, !1), s(f, !0, !1));
5840
5840
  };
5841
5841
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
5842
5842
  /* @__PURE__ */ n(ht, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
@@ -5858,7 +5858,7 @@ function rr({
5858
5858
  {
5859
5859
  property: g,
5860
5860
  propertyKey: b,
5861
- onPropertyNameChanged: (k, x) => r(`properties.${k}.name`, x, !1),
5861
+ onPropertyNameChanged: (w, k) => r(`properties.${w}.name`, k, !1),
5862
5862
  onEditClick: () => {
5863
5863
  !b || !g || p({
5864
5864
  ...g,
@@ -5871,8 +5871,8 @@ function rr({
5871
5871
  {
5872
5872
  property: g,
5873
5873
  disabled: !1,
5874
- onPropertyChanged: (k) => f({
5875
- ...k,
5874
+ onPropertyChanged: (w) => y({
5875
+ ...w,
5876
5876
  importKey: O
5877
5877
  }),
5878
5878
  propertyKey: b,
@@ -5889,10 +5889,10 @@ function rr({
5889
5889
  {
5890
5890
  open: l !== void 0,
5891
5891
  propertyKey: u,
5892
- property: c,
5892
+ property: d,
5893
5893
  inArray: !1,
5894
5894
  autoUpdateId: !1,
5895
- onPropertyChanged: d,
5895
+ onPropertyChanged: c,
5896
5896
  allowDataInference: !1,
5897
5897
  collectionEditable: i,
5898
5898
  onOkClicked: () => {
@@ -5916,7 +5916,7 @@ function or({
5916
5916
  propertyConfigs: r,
5917
5917
  disabled: s
5918
5918
  }) {
5919
- const o = t ? Xt(t) : null, l = t ? Ze(t, r) : null, [p, m] = $(!1);
5919
+ const o = t ? Xt(t) : null, l = t ? Ze(t, r) : null, [p, m] = L(!1);
5920
5920
  return /* @__PURE__ */ e(
5921
5921
  re,
5922
5922
  {
@@ -5936,20 +5936,20 @@ function or({
5936
5936
  position: "item-aligned",
5937
5937
  renderValue: (u) => l ? /* @__PURE__ */ e(Xe, { propertyConfig: l }) : null,
5938
5938
  onValueChange: (u) => {
5939
- const c = na(t, u, r);
5939
+ const d = na(t, u, r);
5940
5940
  i && (a({
5941
5941
  id: i,
5942
- property: c,
5942
+ property: d,
5943
5943
  previousId: i,
5944
5944
  namespace: void 0
5945
5945
  }), console.log("newSelectedWidgetId", u));
5946
5946
  },
5947
- children: Object.entries(la).map(([u, c]) => /* @__PURE__ */ e(
5947
+ children: Object.entries(la).map(([u, d]) => /* @__PURE__ */ e(
5948
5948
  sa,
5949
5949
  {
5950
5950
  value: u,
5951
5951
  optionDisabled: !1,
5952
- propertyConfig: c,
5952
+ propertyConfig: d,
5953
5953
  existing: !1
5954
5954
  },
5955
5955
  u
@@ -5990,26 +5990,26 @@ function pa(t, a = "") {
5990
5990
  const i = Object.keys(t).reduce((o, l) => {
5991
5991
  const p = t[l], m = Ua(l), u = a ? `${a}.${m}` : m;
5992
5992
  if (p.dataType === "map" && p.properties) {
5993
- const f = pa(p.properties, u);
5993
+ const y = pa(p.properties, u);
5994
5994
  return {
5995
5995
  headersMapping: { ...o.headersMapping, [l]: u },
5996
5996
  properties: {
5997
5997
  ...o.properties,
5998
5998
  [m]: {
5999
5999
  ...p,
6000
- properties: f.properties,
6001
- propertiesOrder: Object.keys(f.properties)
6000
+ properties: y.properties,
6001
+ propertiesOrder: Object.keys(y.properties)
6002
6002
  }
6003
6003
  }
6004
6004
  };
6005
6005
  }
6006
- const c = {
6006
+ const d = {
6007
6007
  ...o.properties,
6008
6008
  [m]: p
6009
6009
  };
6010
6010
  return {
6011
6011
  headersMapping: { ...o.headersMapping, [l]: u },
6012
- properties: c
6012
+ properties: d
6013
6013
  };
6014
6014
  }, { headersMapping: {}, properties: {} }), r = Object.keys(i.headersMapping)?.[0];
6015
6015
  let s;
@@ -6019,7 +6019,7 @@ function pa(t, a = "") {
6019
6019
  };
6020
6020
  }
6021
6021
  function ma(t) {
6022
- const a = t.open, [i, r] = we.useState(!1), [s, o] = we.useState(!1), l = X(() => {
6022
+ const a = t.open, [i, r] = _e.useState(!1), [s, o] = _e.useState(!1), l = Z(() => {
6023
6023
  i ? o(!0) : t.handleClose(void 0);
6024
6024
  }, [i, t.handleClose]);
6025
6025
  return pe(() => {
@@ -6066,44 +6066,44 @@ function sr({
6066
6066
  handleClose: p,
6067
6067
  reservedGroups: m,
6068
6068
  extraView: u,
6069
- handleCancel: c,
6070
- setFormDirty: d,
6071
- pathSuggestions: f,
6069
+ handleCancel: d,
6070
+ setFormDirty: c,
6071
+ pathSuggestions: y,
6072
6072
  getUser: g,
6073
6073
  parentCollection: b,
6074
6074
  getData: O
6075
6075
  }) {
6076
- const { propertyConfigs: k } = Ke(), x = Be(), {
6077
- topLevelNavigation: h,
6078
- collections: _
6079
- } = x, y = !a?.path && (s ?? []).length === 0, w = (b ? b.subcollections : _) ?? [], q = w.map((T) => T.path.trim().toLowerCase()), F = w.map((T) => T.id?.trim().toLowerCase()).filter(Boolean), A = gi();
6080
- if (!h)
6076
+ const { propertyConfigs: w } = Ke(), k = Be(), {
6077
+ topLevelNavigation: f,
6078
+ collections: v
6079
+ } = k, _ = !a?.path && (s ?? []).length === 0, h = (b ? b.subcollections : v) ?? [], A = h.map((V) => V.path.trim().toLowerCase()), E = h.map((V) => V.id?.trim().toLowerCase()).filter(Boolean), z = gi();
6080
+ if (!f)
6081
6081
  throw Error("Internal: Navigation not ready in collection editor");
6082
6082
  const {
6083
- groups: S
6084
- } = h, E = De(), v = Ye(), V = He({}), J = t ? y ? "welcome" : "details" : "properties", [N, R] = $(J), [ge, xe] = we.useState(), [Q, U] = we.useState(), [W, te] = we.useState(!1), [me, ue] = we.useState();
6083
+ groups: q
6084
+ } = f, B = De(), S = Ye(), N = He({}), j = t ? _ ? "welcome" : "details" : "properties", [x, I] = L(j), [ge, fe] = _e.useState(), [X, M] = _e.useState(), [Q, te] = _e.useState(!1), [me, ue] = _e.useState();
6085
6085
  pe(() => {
6086
6086
  try {
6087
- x.initialised && (U(r ? x.getCollectionFromPaths([...s ?? [], r]) : void 0), te(!0));
6088
- } catch (T) {
6089
- console.error(T), ue(me);
6087
+ k.initialised && (M(r ? k.getCollectionFromPaths([...s ?? [], r]) : void 0), te(!0));
6088
+ } catch (V) {
6089
+ console.error(V), ue(me);
6090
6090
  }
6091
- }, [x.getCollectionFromPaths, r, me, x.initialised]);
6092
- const fe = (T) => {
6093
- const I = T.id || T.path;
6091
+ }, [k.getCollectionFromPaths, r, me, k.initialised]);
6092
+ const be = (V) => {
6093
+ const F = V.id || V.path;
6094
6094
  return i.saveCollection({
6095
- id: I,
6096
- collectionData: T,
6095
+ id: F,
6096
+ collectionData: V,
6097
6097
  previousPath: r,
6098
6098
  parentCollectionIds: s
6099
- }).then(() => (xe(void 0), !0)).catch((D) => (xe(D), console.error(D), E.open({
6099
+ }).then(() => (fe(void 0), !0)).catch((R) => (fe(R), console.error(R), B.open({
6100
6100
  type: "error",
6101
- message: "Error persisting collection: " + (D.message ?? "Details in the console")
6101
+ message: "Error persisting collection: " + (R.message ?? "Details in the console")
6102
6102
  }), !1));
6103
- }, ye = Q ? {
6104
- ...Q,
6105
- id: Q.id ?? Q.path ?? jt(16)
6106
- } : void 0, Ce = ye ? lr(ye, k) : {
6103
+ }, ve = X ? {
6104
+ ...X,
6105
+ id: X.id ?? X.path ?? jt(16)
6106
+ } : void 0, Ce = ve ? lr(ve, w) : {
6107
6107
  id: a?.path ?? jt(16),
6108
6108
  path: a?.path ?? "",
6109
6109
  name: a?.name ?? "",
@@ -6111,44 +6111,44 @@ function sr({
6111
6111
  properties: {},
6112
6112
  propertiesOrder: [],
6113
6113
  icon: xt[Math.floor(Math.random() * xt.length)],
6114
- ownerId: v.user?.uid ?? ""
6115
- }, ae = X(() => {
6116
- N === "details" ? A.inUse ? R("import_data_saving") : R(u ? "extra_view" : "properties") : R(N === "welcome" ? "details" : N === "import_data_mapping" ? "import_data_preview" : N === "import_data_preview" ? "details" : N === "extra_view" ? "properties" : "details");
6117
- }, [N, A.inUse, u]), Ve = X((T) => {
6114
+ ownerId: S.user?.uid ?? ""
6115
+ }, ae = Z(() => {
6116
+ x === "details" ? z.inUse ? I("import_data_saving") : I(u ? "extra_view" : "properties") : I(x === "welcome" ? "details" : x === "import_data_mapping" ? "import_data_preview" : x === "import_data_preview" ? "details" : x === "extra_view" ? "properties" : "details");
6117
+ }, [x, z.inUse, u]), Ve = Z((V) => {
6118
6118
  if (l)
6119
- return l?.(T.path, T.collectionGroup ?? !1, s ?? []);
6120
- }, [l, s]), tt = X(async (T) => {
6119
+ return l?.(V.path, V.collectionGroup ?? !1, s ?? []);
6120
+ }, [l, s]), tt = Z(async (V) => {
6121
6121
  try {
6122
6122
  if (!Ve)
6123
- return U(T), Promise.resolve(T);
6124
- R("loading");
6125
- const I = await Ve?.(T);
6126
- if (!I)
6127
- return U(T), Promise.resolve(T);
6128
- const D = {
6129
- ...T ?? {}
6123
+ return M(V), Promise.resolve(V);
6124
+ I("loading");
6125
+ const F = await Ve?.(V);
6126
+ if (!F)
6127
+ return M(V), Promise.resolve(V);
6128
+ const R = {
6129
+ ...V ?? {}
6130
6130
  };
6131
- return Object.keys(I.properties ?? {}).length > 0 && (D.properties = I.properties, D.propertiesOrder = I.propertiesOrder), D.propertiesOrder ? (U(D), console.log("Inferred collection", {
6132
- newCollection: T ?? {},
6133
- values: D
6134
- }), D) : (D.propertiesOrder = Object.keys(D.properties), D);
6135
- } catch (I) {
6136
- return console.error(I), E.open({
6131
+ return Object.keys(F.properties ?? {}).length > 0 && (R.properties = F.properties, R.propertiesOrder = F.propertiesOrder), R.propertiesOrder ? (M(R), console.log("Inferred collection", {
6132
+ newCollection: V ?? {},
6133
+ values: R
6134
+ }), R) : (R.propertiesOrder = Object.keys(R.properties), R);
6135
+ } catch (F) {
6136
+ return console.error(F), B.open({
6137
6137
  type: "error",
6138
- message: "Error inferring collection: " + (I.message ?? "Details in the console")
6139
- }), T;
6138
+ message: "Error inferring collection: " + (F.message ?? "Details in the console")
6139
+ }), V;
6140
6140
  }
6141
- }, [s, Ve]), bt = (T, I) => {
6141
+ }, [s, Ve]), bt = (V, F) => {
6142
6142
  try {
6143
- if (console.log("Submitting collection", T), !t) {
6144
- fe(T).then(() => {
6145
- I.resetForm({ values: Ce }), p(T);
6143
+ if (console.log("Submitting collection", V), !t) {
6144
+ be(V).then(() => {
6145
+ F.resetForm({ values: Ce }), p(V);
6146
6146
  });
6147
6147
  return;
6148
6148
  }
6149
- N === "welcome" ? (ae(), I.resetForm({ values: T })) : N === "details" ? u || A.inUse ? (I.resetForm({ values: T }), ae()) : t ? tt(T).then((D) => {
6150
- I.resetForm({
6151
- values: D ?? T,
6149
+ x === "welcome" ? (ae(), F.resetForm({ values: V })) : x === "details" ? u || z.inUse ? (F.resetForm({ values: V }), ae()) : t ? tt(V).then((R) => {
6150
+ F.resetForm({
6151
+ values: R ?? V,
6152
6152
  touched: {
6153
6153
  path: !0,
6154
6154
  name: !0
@@ -6156,65 +6156,65 @@ function sr({
6156
6156
  });
6157
6157
  }).finally(() => {
6158
6158
  ae();
6159
- }) : (I.resetForm({ values: T }), ae()) : N === "extra_view" ? (ae(), I.resetForm({ values: T })) : N === "import_data_mapping" || N === "import_data_preview" ? ae() : N === "properties" ? fe(T).then(() => {
6160
- I.resetForm({ values: Ce }), ae(), p(T);
6161
- }) : (ae(), I.resetForm({ values: T }));
6162
- } catch (D) {
6163
- E.open({
6159
+ }) : (F.resetForm({ values: V }), ae()) : x === "extra_view" ? (ae(), F.resetForm({ values: V })) : x === "import_data_mapping" || x === "import_data_preview" ? ae() : x === "properties" ? be(V).then(() => {
6160
+ F.resetForm({ values: Ce }), ae(), p(V);
6161
+ }) : (ae(), F.resetForm({ values: V }));
6162
+ } catch (R) {
6163
+ B.open({
6164
6164
  type: "error",
6165
- message: "Error persisting collection: " + (D.message ?? "Details in the console")
6166
- }), console.error(D), I.resetForm({ values: T });
6165
+ message: "Error persisting collection: " + (R.message ?? "Details in the console")
6166
+ }), console.error(R), F.resetForm({ values: V });
6167
6167
  }
6168
6168
  };
6169
- return !t && (!x.initialised || !W) ? /* @__PURE__ */ e(Et, {}) : /* @__PURE__ */ e($e, { fullHeight: !0, children: /* @__PURE__ */ e(
6169
+ return !t && (!k.initialised || !Q) ? /* @__PURE__ */ e(Et, {}) : /* @__PURE__ */ e($e, { fullHeight: !0, children: /* @__PURE__ */ e(
6170
6170
  St,
6171
6171
  {
6172
6172
  initialValues: Ce,
6173
- validationSchema: (N === "properties" || N === "subcollections" || N === "details") && yi,
6174
- validate: (T) => {
6175
- if (N === "properties")
6176
- return V.current;
6177
- const I = {};
6178
- if (N === "details") {
6179
- const D = cr(T.path, t, q, T.id);
6180
- D && (I.path = D);
6181
- const Oe = dr(T.id, t, q, F);
6182
- Oe && (I.id = Oe);
6173
+ validationSchema: (x === "properties" || x === "subcollections" || x === "details") && yi,
6174
+ validate: (V) => {
6175
+ if (x === "properties")
6176
+ return N.current;
6177
+ const F = {};
6178
+ if (x === "details") {
6179
+ const R = cr(V.path, t, A, V.id);
6180
+ R && (F.path = R);
6181
+ const Oe = dr(V.id, t, A, E);
6182
+ Oe && (F.id = Oe);
6183
6183
  }
6184
- return I;
6184
+ return F;
6185
6185
  },
6186
6186
  onSubmit: bt,
6187
- children: (T) => {
6187
+ children: (V) => {
6188
6188
  const {
6189
- values: I,
6190
- setFieldValue: D,
6189
+ values: F,
6190
+ setFieldValue: R,
6191
6191
  isSubmitting: Oe,
6192
6192
  dirty: at,
6193
- submitCount: z
6194
- } = T, j = I.path ?? r, G = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + j : j, se = x.resolveAliasesFrom(G), le = se && O ? () => O(se) : void 0;
6193
+ submitCount: T
6194
+ } = V, D = F.path ?? r, H = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + D : D, se = k.resolveAliasesFrom(H), le = se && O ? () => O(se) : void 0;
6195
6195
  pe(() => {
6196
- d(at);
6196
+ c(at);
6197
6197
  }, [at]);
6198
- function ve(Z) {
6199
- A.setInUse(!0), ii(Z, ia).then((Ie) => {
6198
+ function we(W) {
6199
+ z.setInUse(!0), ii(W, ia).then((Ie) => {
6200
6200
  const Fe = pa(Ie);
6201
- D("properties", Fe.properties), D("propertiesOrder", Object.keys(Fe.properties)), A.setIdColumn(Fe.idColumn), A.setImportData(Z), A.setHeadersMapping(Fe.headersMapping), A.setOriginProperties(Fe.properties);
6201
+ R("properties", Fe.properties), R("propertiesOrder", Object.keys(Fe.properties)), z.setIdColumn(Fe.idColumn), z.setImportData(W), z.setHeadersMapping(Fe.headersMapping), z.setOriginProperties(Fe.properties);
6202
6202
  });
6203
6203
  }
6204
- const yt = !!I.name && !!I.id, it = () => {
6205
- const Z = { ...I.properties };
6206
- A.idColumn && delete Z[A.idColumn], D("properties", Z), ae(), console.log("onImportMappingComplete", {
6207
- importConfig: A,
6208
- properties: Z
6204
+ const yt = !!F.name && !!F.id, it = () => {
6205
+ const W = { ...F.properties };
6206
+ z.idColumn && delete W[z.idColumn], R("properties", W), ae(), console.log("onImportMappingComplete", {
6207
+ importConfig: z,
6208
+ properties: W
6209
6209
  });
6210
- }, vt = Q?.editable || t;
6211
- return /* @__PURE__ */ n(M, { children: [
6210
+ }, vt = X?.editable || t;
6211
+ return /* @__PURE__ */ n($, { children: [
6212
6212
  !t && /* @__PURE__ */ n(
6213
6213
  $a,
6214
6214
  {
6215
- value: N,
6216
- className: ke(Pt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
6217
- onValueChange: (Z) => R(Z),
6215
+ value: x,
6216
+ className: xe(Nt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
6217
+ onValueChange: (W) => I(W),
6218
6218
  children: [
6219
6219
  /* @__PURE__ */ e(_t, { value: "details", children: "Details" }),
6220
6220
  /* @__PURE__ */ e(_t, { value: "properties", children: "Properties" }),
@@ -6226,65 +6226,65 @@ function sr({
6226
6226
  Xa,
6227
6227
  {
6228
6228
  noValidate: !0,
6229
- className: ke(
6229
+ className: xe(
6230
6230
  t ? "h-full" : "h-[calc(100%-48px)]",
6231
6231
  "flex-grow flex flex-col relative"
6232
6232
  ),
6233
6233
  children: [
6234
- N === "loading" && /* @__PURE__ */ e(Et, {}),
6235
- N === "extra_view" && j && u?.View && /* @__PURE__ */ e(u.View, { path: j }),
6236
- N === "welcome" && /* @__PURE__ */ e(
6234
+ x === "loading" && /* @__PURE__ */ e(Et, {}),
6235
+ x === "extra_view" && D && u?.View && /* @__PURE__ */ e(u.View, { path: D }),
6236
+ x === "welcome" && /* @__PURE__ */ e(
6237
6237
  ir,
6238
6238
  {
6239
- path: j,
6240
- onContinue: (Z) => {
6241
- Z ? (ve(Z), R("import_data_mapping")) : R("details");
6239
+ path: D,
6240
+ onContinue: (W) => {
6241
+ W ? (we(W), I("import_data_mapping")) : I("details");
6242
6242
  },
6243
- collections: _,
6243
+ collections: v,
6244
6244
  parentCollection: b,
6245
- pathSuggestions: f
6245
+ pathSuggestions: y
6246
6246
  }
6247
6247
  ),
6248
- N === "import_data_mapping" && A && /* @__PURE__ */ e(
6248
+ x === "import_data_mapping" && z && /* @__PURE__ */ e(
6249
6249
  rr,
6250
6250
  {
6251
- importConfig: A,
6251
+ importConfig: z,
6252
6252
  collectionEditable: vt,
6253
- propertyConfigs: k
6253
+ propertyConfigs: w
6254
6254
  }
6255
6255
  ),
6256
- N === "import_data_preview" && A && /* @__PURE__ */ e(
6256
+ x === "import_data_preview" && z && /* @__PURE__ */ e(
6257
6257
  nr,
6258
6258
  {
6259
- importConfig: A,
6260
- properties: I.properties,
6261
- propertiesOrder: I.propertiesOrder
6259
+ importConfig: z,
6260
+ properties: F.properties,
6261
+ propertiesOrder: F.propertiesOrder
6262
6262
  }
6263
6263
  ),
6264
- N === "import_data_saving" && A && /* @__PURE__ */ e(
6264
+ x === "import_data_saving" && z && /* @__PURE__ */ e(
6265
6265
  fi,
6266
6266
  {
6267
- importConfig: A,
6268
- collection: I,
6269
- onImportSuccess: (Z) => {
6270
- p(Z), E.open({
6267
+ importConfig: z,
6268
+ collection: F,
6269
+ onImportSuccess: (W) => {
6270
+ p(W), B.open({
6271
6271
  type: "info",
6272
6272
  message: "Data imported successfully"
6273
6273
  });
6274
6274
  }
6275
6275
  }
6276
6276
  ),
6277
- N === "details" && /* @__PURE__ */ e(
6277
+ x === "details" && /* @__PURE__ */ e(
6278
6278
  _i,
6279
6279
  {
6280
- existingPaths: q,
6281
- existingIds: F,
6282
- groups: S,
6280
+ existingPaths: A,
6281
+ existingIds: E,
6282
+ groups: q,
6283
6283
  parentCollection: b,
6284
6284
  isNewCollection: t
6285
6285
  }
6286
6286
  ),
6287
- N === "subcollections" && Q && /* @__PURE__ */ e(
6287
+ x === "subcollections" && X && /* @__PURE__ */ e(
6288
6288
  ar,
6289
6289
  {
6290
6290
  parentCollection: b,
@@ -6292,61 +6292,61 @@ function sr({
6292
6292
  getUser: g,
6293
6293
  collectionInference: l,
6294
6294
  parentCollectionIds: s,
6295
- collection: Q
6295
+ collection: X
6296
6296
  }
6297
6297
  ),
6298
- N === "properties" && /* @__PURE__ */ e(
6298
+ x === "properties" && /* @__PURE__ */ e(
6299
6299
  Xi,
6300
6300
  {
6301
- showErrors: z > 0,
6301
+ showErrors: T > 0,
6302
6302
  isNewCollection: t,
6303
6303
  reservedGroups: m,
6304
- onPropertyError: (Z, Ie, Fe) => {
6305
- V.current = La({
6306
- ...V.current,
6307
- [Z]: Fe
6304
+ onPropertyError: (W, Ie, Fe) => {
6305
+ N.current = La({
6306
+ ...N.current,
6307
+ [W]: Fe
6308
6308
  }, !0);
6309
6309
  },
6310
6310
  getUser: g,
6311
6311
  getData: le,
6312
6312
  doCollectionInference: Ve,
6313
- propertyConfigs: k,
6313
+ propertyConfigs: w,
6314
6314
  collectionEditable: vt,
6315
6315
  extraIcon: u?.icon && /* @__PURE__ */ e(
6316
6316
  ne,
6317
6317
  {
6318
6318
  color: "primary",
6319
- onClick: () => R("extra_view"),
6319
+ onClick: () => I("extra_view"),
6320
6320
  children: u.icon
6321
6321
  }
6322
6322
  )
6323
6323
  }
6324
6324
  ),
6325
- N !== "welcome" && /* @__PURE__ */ n(
6325
+ x !== "welcome" && /* @__PURE__ */ n(
6326
6326
  Le,
6327
6327
  {
6328
6328
  position: "absolute",
6329
6329
  children: [
6330
6330
  ge && /* @__PURE__ */ e(aa, { error: ge }),
6331
- t && y && N === "import_data_mapping" && /* @__PURE__ */ n(
6332
- B,
6331
+ t && _ && x === "import_data_mapping" && /* @__PURE__ */ n(
6332
+ U,
6333
6333
  {
6334
6334
  variant: "text",
6335
6335
  type: "button",
6336
- onClick: () => (A.setInUse(!1), R("welcome")),
6336
+ onClick: () => (z.setInUse(!1), I("welcome")),
6337
6337
  children: [
6338
6338
  /* @__PURE__ */ e(rt, {}),
6339
6339
  "Back"
6340
6340
  ]
6341
6341
  }
6342
6342
  ),
6343
- t && y && N === "import_data_preview" && /* @__PURE__ */ n(
6344
- B,
6343
+ t && _ && x === "import_data_preview" && /* @__PURE__ */ n(
6344
+ U,
6345
6345
  {
6346
6346
  variant: "text",
6347
6347
  type: "button",
6348
6348
  onClick: () => {
6349
- fe(I), R("import_data_mapping");
6349
+ be(F), I("import_data_mapping");
6350
6350
  },
6351
6351
  children: [
6352
6352
  /* @__PURE__ */ e(rt, {}),
@@ -6354,24 +6354,24 @@ function sr({
6354
6354
  ]
6355
6355
  }
6356
6356
  ),
6357
- t && y && N === "details" && /* @__PURE__ */ n(
6358
- B,
6357
+ t && _ && x === "details" && /* @__PURE__ */ n(
6358
+ U,
6359
6359
  {
6360
6360
  variant: "text",
6361
6361
  type: "button",
6362
- onClick: () => R("welcome"),
6362
+ onClick: () => I("welcome"),
6363
6363
  children: [
6364
6364
  /* @__PURE__ */ e(rt, {}),
6365
6365
  "Back"
6366
6366
  ]
6367
6367
  }
6368
6368
  ),
6369
- t && N === "properties" && /* @__PURE__ */ n(
6370
- B,
6369
+ t && x === "properties" && /* @__PURE__ */ n(
6370
+ U,
6371
6371
  {
6372
6372
  variant: "text",
6373
6373
  type: "button",
6374
- onClick: () => R("details"),
6374
+ onClick: () => I("details"),
6375
6375
  children: [
6376
6376
  /* @__PURE__ */ e(rt, {}),
6377
6377
  "Back"
@@ -6379,17 +6379,17 @@ function sr({
6379
6379
  }
6380
6380
  ),
6381
6381
  /* @__PURE__ */ e(
6382
- B,
6382
+ U,
6383
6383
  {
6384
6384
  variant: "text",
6385
6385
  onClick: () => {
6386
- c();
6386
+ d();
6387
6387
  },
6388
6388
  children: "Cancel"
6389
6389
  }
6390
6390
  ),
6391
- t && N === "import_data_mapping" && /* @__PURE__ */ e(
6392
- B,
6391
+ t && x === "import_data_mapping" && /* @__PURE__ */ e(
6392
+ U,
6393
6393
  {
6394
6394
  variant: "filled",
6395
6395
  color: "primary",
@@ -6397,8 +6397,8 @@ function sr({
6397
6397
  children: "Next"
6398
6398
  }
6399
6399
  ),
6400
- t && N === "import_data_preview" && /* @__PURE__ */ e(
6401
- B,
6400
+ t && x === "import_data_preview" && /* @__PURE__ */ e(
6401
+ U,
6402
6402
  {
6403
6403
  variant: "filled",
6404
6404
  color: "primary",
@@ -6408,18 +6408,18 @@ function sr({
6408
6408
  children: "Next"
6409
6409
  }
6410
6410
  ),
6411
- t && (N === "details" || N === "properties") && /* @__PURE__ */ n(
6411
+ t && (x === "details" || x === "properties") && /* @__PURE__ */ n(
6412
6412
  Dt,
6413
6413
  {
6414
6414
  variant: "filled",
6415
6415
  color: "primary",
6416
6416
  type: "submit",
6417
6417
  loading: Oe,
6418
- disabled: Oe || N === "details" && !yt,
6419
- startIcon: N === "properties" ? /* @__PURE__ */ e(Ka, {}) : void 0,
6418
+ disabled: Oe || x === "details" && !yt,
6419
+ startIcon: x === "properties" ? /* @__PURE__ */ e(Ka, {}) : void 0,
6420
6420
  children: [
6421
- N === "details" && "Next",
6422
- N === "properties" && "Create collection"
6421
+ x === "details" && "Next",
6422
+ x === "properties" && "Create collection"
6423
6423
  ]
6424
6424
  }
6425
6425
  ),
@@ -6456,7 +6456,7 @@ function ua(t, a) {
6456
6456
  const r = a[i.propertyConfig];
6457
6457
  if (r && oe(r.property))
6458
6458
  i = r.property;
6459
- else if (r && (i = Y(r.property, i)), !oe(i) && i.dataType === "map" && i.properties) {
6459
+ else if (r && (i = G(r.property, i)), !oe(i) && i.dataType === "map" && i.properties) {
6460
6460
  const s = {};
6461
6461
  Object.keys(i.properties).forEach((o) => {
6462
6462
  s[o] = ua(i.properties[o], a);
@@ -6473,7 +6473,7 @@ const cr = (t, a, i, r) => {
6473
6473
  return;
6474
6474
  let s;
6475
6475
  return a && i?.includes(t.trim().toLowerCase()) && (s = "There is already a collection that uses this value as a path"), a && r?.includes(t.trim().toLowerCase()) && (s = "There is already a collection which uses this id"), s;
6476
- }, ha = L.createContext({}), ga = L.createContext({}), pr = L.memo(
6476
+ }, ha = K.createContext({}), ga = K.createContext({}), pr = K.memo(
6477
6477
  function({
6478
6478
  children: a,
6479
6479
  collectionConfigController: i,
@@ -6483,74 +6483,76 @@ const cr = (t, a, i, r) => {
6483
6483
  extraView: l,
6484
6484
  pathSuggestions: p,
6485
6485
  getUser: m,
6486
- getData: u
6486
+ getData: u,
6487
+ onAnalyticsEvent: d
6487
6488
  }) {
6488
- const c = Be(), d = bi(), f = De(), { propertyConfigs: g } = Ke(), {
6489
- collections: b
6490
- } = c, O = b.map((v) => v.path.trim().toLowerCase()), [k, x] = L.useState();
6489
+ const c = Be(), y = bi(), g = De(), { propertyConfigs: b } = Ke(), {
6490
+ collections: O
6491
+ } = c, w = O.map((N) => N.path.trim().toLowerCase()), [k, f] = K.useState();
6491
6492
  pe(() => {
6492
- p && p().then((v) => {
6493
- x(v.filter((V) => !O.includes(V.trim().toLowerCase())));
6493
+ p && p().then((N) => {
6494
+ f(N.filter((j) => !w.includes(j.trim().toLowerCase())));
6494
6495
  });
6495
6496
  }, [p]);
6496
- const [h, _] = L.useState(), [y, w] = L.useState(), q = X(() => ({
6497
+ const [v, _] = K.useState(), [h, A] = K.useState(), E = Z(() => ({
6497
6498
  createCollections: !0,
6498
6499
  editCollections: !0,
6499
6500
  deleteCollections: !0
6500
- }), []), F = X(({
6501
- path: v,
6502
- fullPath: V,
6503
- parentCollectionIds: J,
6504
- parentCollection: N
6501
+ }), []), z = Z(({
6502
+ path: N,
6503
+ fullPath: j,
6504
+ parentCollectionIds: x,
6505
+ parentCollection: I
6505
6506
  }) => {
6506
- _({
6507
- editedCollectionPath: v,
6508
- fullPath: V,
6509
- parentCollectionIds: J,
6507
+ console.debug("edit collection", N, j, x, I), d?.("edit_collection", { path: N, fullPath: j }), _({
6508
+ editedCollectionPath: N,
6509
+ fullPath: j,
6510
+ parentCollectionIds: x,
6510
6511
  isNewCollection: !1,
6511
- parentCollection: N,
6512
+ parentCollection: I,
6512
6513
  redirect: !1
6513
6514
  });
6514
- }, []), A = X(({
6515
- propertyKey: v,
6516
- property: V,
6517
- editedCollectionPath: J,
6518
- currentPropertiesOrder: N,
6519
- parentCollectionIds: R,
6520
- collection: ge
6515
+ }, []), q = Z(({
6516
+ propertyKey: N,
6517
+ property: j,
6518
+ editedCollectionPath: x,
6519
+ currentPropertiesOrder: I,
6520
+ parentCollectionIds: ge,
6521
+ collection: fe
6521
6522
  }) => {
6522
- const xe = v && v.includes(".") ? v.substring(0, v.lastIndexOf(".")) : void 0, Q = v && v.includes(".") ? v.substring(v.lastIndexOf(".") + 1) : v;
6523
- console.log("edit property", Q, ge), w({
6524
- propertyKey: Q,
6525
- property: V,
6526
- namespace: xe,
6527
- currentPropertiesOrder: N,
6528
- editedCollectionPath: J,
6529
- parentCollectionIds: R,
6530
- collectionEditable: ge?.editable ?? !1
6523
+ console.debug("edit property", N, j, x, I, ge, fe), d?.("edit_property", { propertyKey: N, editedCollectionPath: x });
6524
+ const X = N && N.includes(".") ? N.substring(0, N.lastIndexOf(".")) : void 0, M = N && N.includes(".") ? N.substring(N.lastIndexOf(".") + 1) : N;
6525
+ console.log("edit property", M, fe), A({
6526
+ propertyKey: M,
6527
+ property: j,
6528
+ namespace: X,
6529
+ currentPropertiesOrder: I,
6530
+ editedCollectionPath: x,
6531
+ parentCollectionIds: ge,
6532
+ collectionEditable: fe?.editable ?? !1
6531
6533
  });
6532
- }, []), S = L.useCallback(({
6533
- parentCollectionIds: v,
6534
- parentCollection: V,
6535
- initialValues: J,
6536
- redirect: N
6534
+ }, []), B = K.useCallback(({
6535
+ parentCollectionIds: N,
6536
+ parentCollection: j,
6537
+ initialValues: x,
6538
+ redirect: I
6537
6539
  }) => {
6538
- _({
6540
+ console.debug("create collection", N, j, x, I), d?.("create_collection", { parentCollectionIds: N, parentCollection: j, initialValues: x, redirect: I }), _({
6539
6541
  isNewCollection: !0,
6540
- parentCollectionIds: v,
6541
- parentCollection: V,
6542
- initialValues: J,
6543
- redirect: N
6542
+ parentCollectionIds: N,
6543
+ parentCollection: j,
6544
+ initialValues: x,
6545
+ redirect: I
6544
6546
  });
6545
- }, []), E = p ? (v) => !v && k ? Promise.resolve(k) : p?.(v) : void 0;
6547
+ }, []), S = p ? (N) => !N && k ? Promise.resolve(k) : p?.(N) : void 0;
6546
6548
  return /* @__PURE__ */ e(ha.Provider, { value: i, children: /* @__PURE__ */ n(
6547
6549
  ga.Provider,
6548
6550
  {
6549
6551
  value: {
6550
- editCollection: F,
6551
- createCollection: S,
6552
- editProperty: A,
6553
- configPermissions: r ?? q,
6552
+ editCollection: z,
6553
+ createCollection: B,
6554
+ editProperty: q,
6555
+ configPermissions: r ?? E,
6554
6556
  rootPathSuggestions: k
6555
6557
  },
6556
6558
  children: [
@@ -6558,20 +6560,20 @@ const cr = (t, a, i, r) => {
6558
6560
  /* @__PURE__ */ e(
6559
6561
  ma,
6560
6562
  {
6561
- open: !!h,
6563
+ open: !!v,
6562
6564
  configController: i,
6563
6565
  isNewCollection: !1,
6564
6566
  collectionInference: o,
6565
- ...h,
6567
+ ...v,
6566
6568
  getData: u,
6567
6569
  reservedGroups: s,
6568
6570
  extraView: l,
6569
- pathSuggestions: E,
6571
+ pathSuggestions: S,
6570
6572
  getUser: m,
6571
- handleClose: (v) => {
6572
- if (h?.redirect && v && h?.isNewCollection && !h.parentCollectionIds.length) {
6573
- const V = c.buildUrlCollectionPath(v.id ?? v.path);
6574
- d(V);
6573
+ handleClose: (N) => {
6574
+ if (v?.redirect && N && v?.isNewCollection && !v.parentCollectionIds.length) {
6575
+ const j = c.buildUrlCollectionPath(N.id ?? N.path);
6576
+ y(j);
6575
6577
  }
6576
6578
  _(void 0);
6577
6579
  }
@@ -6580,69 +6582,69 @@ const cr = (t, a, i, r) => {
6580
6582
  /* @__PURE__ */ e(
6581
6583
  je,
6582
6584
  {
6583
- open: !!y,
6585
+ open: !!h,
6584
6586
  includeIdAndName: !0,
6585
- existingProperty: !!y?.propertyKey,
6586
- autoUpdateId: y ? !y?.propertyKey : !1,
6587
- autoOpenTypeSelect: y ? !y?.propertyKey : !1,
6587
+ existingProperty: !!h?.propertyKey,
6588
+ autoUpdateId: h ? !h?.propertyKey : !1,
6589
+ autoOpenTypeSelect: h ? !h?.propertyKey : !1,
6588
6590
  inArray: !1,
6589
- collectionEditable: y?.collectionEditable ?? !1,
6590
- getData: u && y?.editedCollectionPath ? () => {
6591
- const v = c.resolveAliasesFrom(y.editedCollectionPath);
6592
- return u(v);
6591
+ collectionEditable: h?.collectionEditable ?? !1,
6592
+ getData: u && h?.editedCollectionPath ? () => {
6593
+ const N = c.resolveAliasesFrom(h.editedCollectionPath);
6594
+ return u(N);
6593
6595
  } : void 0,
6594
6596
  onPropertyChanged: ({
6595
- id: v,
6596
- property: V
6597
+ id: N,
6598
+ property: j
6597
6599
  }) => {
6598
- if (!y || !v)
6600
+ if (!h || !N)
6599
6601
  return;
6600
- const J = !y.propertyKey;
6602
+ const x = !h.propertyKey;
6601
6603
  return i.saveProperty({
6602
- path: y?.editedCollectionPath,
6603
- property: V,
6604
- propertyKey: v,
6605
- newPropertiesOrder: J && y.currentPropertiesOrder ? [...y.currentPropertiesOrder, v] : void 0,
6606
- namespace: y.namespace,
6607
- parentCollectionIds: y.parentCollectionIds
6608
- }).catch((N) => (console.error(N), f.open({
6604
+ path: h?.editedCollectionPath,
6605
+ property: j,
6606
+ propertyKey: N,
6607
+ newPropertiesOrder: x && h.currentPropertiesOrder ? [...h.currentPropertiesOrder, N] : void 0,
6608
+ namespace: h.namespace,
6609
+ parentCollectionIds: h.parentCollectionIds
6610
+ }).catch((I) => (console.error(I), g.open({
6609
6611
  type: "error",
6610
- message: "Error persisting property: " + (N.message ?? "Details in the console")
6612
+ message: "Error persisting property: " + (I.message ?? "Details in the console")
6611
6613
  }), !1));
6612
6614
  },
6613
6615
  onPropertyChangedImmediate: !1,
6614
6616
  onDelete: () => {
6615
- if (!y?.propertyKey)
6617
+ if (!h?.propertyKey)
6616
6618
  return;
6617
- const v = y?.currentPropertiesOrder?.filter((V) => V !== y?.propertyKey);
6619
+ const N = h?.currentPropertiesOrder?.filter((j) => j !== h?.propertyKey);
6618
6620
  return i.deleteProperty({
6619
- path: y?.editedCollectionPath,
6620
- propertyKey: y?.propertyKey,
6621
- namespace: y?.namespace,
6622
- newPropertiesOrder: v,
6623
- parentCollectionIds: y?.parentCollectionIds
6621
+ path: h?.editedCollectionPath,
6622
+ propertyKey: h?.propertyKey,
6623
+ namespace: h?.namespace,
6624
+ newPropertiesOrder: N,
6625
+ parentCollectionIds: h?.parentCollectionIds
6624
6626
  }).then(() => {
6625
- w(void 0);
6626
- }).catch((V) => (console.error(V), f.open({
6627
+ A(void 0);
6628
+ }).catch((j) => (console.error(j), g.open({
6627
6629
  type: "error",
6628
- message: "Error deleting property: " + (V.message ?? "Details in the console")
6630
+ message: "Error deleting property: " + (j.message ?? "Details in the console")
6629
6631
  }), !1));
6630
6632
  },
6631
6633
  onError: () => {
6632
6634
  },
6633
6635
  onOkClicked: () => {
6634
- w(void 0);
6636
+ A(void 0);
6635
6637
  },
6636
6638
  onCancel: () => {
6637
- w(void 0);
6639
+ A(void 0);
6638
6640
  },
6639
6641
  initialErrors: {},
6640
6642
  forceShowErrors: !1,
6641
6643
  existingPropertyKeys: [],
6642
6644
  allowDataInference: !0,
6643
- propertyConfigs: g,
6644
- property: y?.property,
6645
- propertyKey: y?.propertyKey
6645
+ propertyConfigs: b,
6646
+ property: h?.property,
6647
+ propertyKey: h?.propertyKey
6646
6648
  }
6647
6649
  )
6648
6650
  ]
@@ -6657,17 +6659,17 @@ function mr({
6657
6659
  collection: i,
6658
6660
  tableController: r
6659
6661
  }) {
6660
- const s = Ye(), o = Be(), l = Re(), p = fa(), m = De(), u = o.getCollectionFromIds(a), c = l.configPermissions ? l.configPermissions({
6662
+ const s = Ye(), o = Be(), l = Re(), p = fa(), m = De(), u = o.getCollectionFromIds(a), d = l.configPermissions ? l.configPermissions({
6661
6663
  user: s.user,
6662
6664
  collection: i
6663
6665
  }).editCollections : !0;
6664
- let d = null;
6665
- return (!ut(st(r.filterValues), st(i.initialFilter)) || !ut(st(r.sortBy), st(i.initialSort))) && (d = /* @__PURE__ */ e(
6666
+ let c = null;
6667
+ return (!ut(st(r.filterValues), st(i.initialFilter)) || !ut(st(r.sortBy), st(i.initialSort))) && (c = /* @__PURE__ */ e(
6666
6668
  re,
6667
6669
  {
6668
6670
  title: r.sortBy || r.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
6669
6671
  children: /* @__PURE__ */ e(
6670
- B,
6672
+ U,
6671
6673
  {
6672
6674
  color: "primary",
6673
6675
  size: "small",
@@ -6675,7 +6677,7 @@ function mr({
6675
6677
  onClick: () => p?.saveCollection({
6676
6678
  id: i.path,
6677
6679
  parentCollectionIds: a,
6678
- collectionData: Y(
6680
+ collectionData: G(
6679
6681
  i,
6680
6682
  {
6681
6683
  initialFilter: r.filterValues ?? null,
@@ -6692,18 +6694,18 @@ function mr({
6692
6694
  }
6693
6695
  )
6694
6696
  }
6695
- )), /* @__PURE__ */ n(M, { children: [
6696
- c && d,
6697
+ )), /* @__PURE__ */ n($, { children: [
6698
+ d && c,
6697
6699
  /* @__PURE__ */ e(
6698
6700
  re,
6699
6701
  {
6700
- title: c ? "Edit collection" : "You don't have permissions to edit this collection",
6702
+ title: d ? "Edit collection" : "You don't have permissions to edit this collection",
6701
6703
  children: /* @__PURE__ */ e(
6702
6704
  ne,
6703
6705
  {
6704
6706
  color: "primary",
6705
- disabled: !c,
6706
- onClick: c ? () => l?.editCollection({ path: i.path, fullPath: t, parentCollectionIds: a, parentCollection: u }) : void 0,
6707
+ disabled: !d,
6708
+ onClick: d ? () => l?.editCollection({ path: i.path, fullPath: t, parentCollectionIds: a, parentCollection: u }) : void 0,
6707
6709
  children: /* @__PURE__ */ e(Qe, {})
6708
6710
  }
6709
6711
  )
@@ -6721,9 +6723,9 @@ function ur({
6721
6723
  const i = De(), r = Ye(), s = fa(), o = Re(), l = o.configPermissions({
6722
6724
  user: r.user,
6723
6725
  collection: a
6724
- }), p = X(() => {
6726
+ }), p = Z(() => {
6725
6727
  o?.editCollection({ path: t, parentCollectionIds: [] });
6726
- }, [o, t]), [m, u] = $(!1), c = X(() => {
6728
+ }, [o, t]), [m, u] = L(!1), d = Z(() => {
6727
6729
  s?.deleteCollection({ path: t }).then(() => {
6728
6730
  u(!1), i.open({
6729
6731
  message: "Collection deleted",
@@ -6731,14 +6733,14 @@ function ur({
6731
6733
  });
6732
6734
  });
6733
6735
  }, [t, s]);
6734
- return /* @__PURE__ */ n(M, { children: [
6736
+ return /* @__PURE__ */ n($, { children: [
6735
6737
  /* @__PURE__ */ n("div", { children: [
6736
6738
  l.deleteCollections && /* @__PURE__ */ e(
6737
6739
  Ga,
6738
6740
  {
6739
6741
  trigger: /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(Ha, { size: "small" }) }),
6740
- children: /* @__PURE__ */ n(Ja, { onClick: (d) => {
6741
- d.preventDefault(), d.stopPropagation(), u(!0);
6742
+ children: /* @__PURE__ */ n(Ja, { onClick: (c) => {
6743
+ c.preventDefault(), c.stopPropagation(), u(!0);
6742
6744
  }, children: [
6743
6745
  /* @__PURE__ */ e(pt, {}),
6744
6746
  "Delete"
@@ -6748,7 +6750,7 @@ function ur({
6748
6750
  l.editCollections && /* @__PURE__ */ e(
6749
6751
  ne,
6750
6752
  {
6751
- onClick: (d) => {
6753
+ onClick: (c) => {
6752
6754
  p();
6753
6755
  },
6754
6756
  children: /* @__PURE__ */ e(Qe, { size: "small" })
@@ -6759,10 +6761,10 @@ function ur({
6759
6761
  mt,
6760
6762
  {
6761
6763
  open: m,
6762
- onAccept: c,
6764
+ onAccept: d,
6763
6765
  onCancel: () => u(!1),
6764
- title: /* @__PURE__ */ e(M, { children: "Delete this collection?" }),
6765
- body: /* @__PURE__ */ n(M, { children: [
6766
+ title: /* @__PURE__ */ e($, { children: "Delete this collection?" }),
6767
+ body: /* @__PURE__ */ n($, { children: [
6766
6768
  " This will ",
6767
6769
  /* @__PURE__ */ e("b", { children: "not delete any data" }),
6768
6770
  ", only the collection in the CMS"
@@ -6783,7 +6785,7 @@ function hr({
6783
6785
  return /* @__PURE__ */ e(
6784
6786
  ta,
6785
6787
  {
6786
- className: ke("h-full p-4 min-h-[124px]"),
6788
+ className: xe("h-full p-4 min-h-[124px]"),
6787
6789
  onClick: r && s ? () => r.createCollection({
6788
6790
  initialValues: t ? { group: t } : void 0,
6789
6791
  parentCollectionIds: [],
@@ -6835,7 +6837,7 @@ function gr() {
6835
6837
  icon: /* @__PURE__ */ e(Ae, { size: "small" }),
6836
6838
  colorScheme: "cyanLighter",
6837
6839
  onClick: i && r ? () => i.createCollection({
6838
- initialValues: { path: l, name: Nt(l) },
6840
+ initialValues: { path: l, name: Pt(l) },
6839
6841
  parentCollectionIds: [],
6840
6842
  redirect: !0
6841
6843
  }) : void 0,
@@ -6912,14 +6914,15 @@ function Ar({
6912
6914
  pathSuggestions: o,
6913
6915
  getUser: l,
6914
6916
  collectionInference: p,
6915
- getData: m
6917
+ getData: m,
6918
+ onAnalyticsEvent: u
6916
6919
  }) {
6917
- const u = X(
6920
+ const d = Z(
6918
6921
  (c) => {
6919
- const d = (g) => {
6920
- et(g.properties), g.subcollections?.forEach(d);
6921
- }, f = t.collections ?? [];
6922
- return f.forEach(d), Za(c, f, [], a);
6922
+ const y = (b) => {
6923
+ et(b.properties), b.subcollections?.forEach(y);
6924
+ }, g = t.collections ?? [];
6925
+ return g.forEach(y), Za(c, g, [], a);
6923
6926
  },
6924
6927
  [t.collections, a]
6925
6928
  );
@@ -6927,7 +6930,7 @@ function Ar({
6927
6930
  name: "Collection Editor",
6928
6931
  loading: t.loading,
6929
6932
  collections: {
6930
- injectCollections: u,
6933
+ injectCollections: d,
6931
6934
  CollectionActions: mr
6932
6935
  },
6933
6936
  provider: {
@@ -6940,7 +6943,8 @@ function Ar({
6940
6943
  extraView: s,
6941
6944
  pathSuggestions: o,
6942
6945
  getUser: l,
6943
- getData: m
6946
+ getData: m,
6947
+ onAnalyticsEvent: u
6944
6948
  }
6945
6949
  },
6946
6950
  homePage: {
@@ -6959,14 +6963,14 @@ function zr({ path: t }) {
6959
6963
  return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
6960
6964
  /* @__PURE__ */ e(aa, { error: "No collection for path: " + i }),
6961
6965
  /* @__PURE__ */ e(
6962
- B,
6966
+ U,
6963
6967
  {
6964
6968
  className: "mx-2",
6965
6969
  variant: "outlined",
6966
6970
  size: "small",
6967
6971
  onClick: () => {
6968
6972
  s.createCollection({
6969
- initialValues: { path: i, name: Nt(i) },
6973
+ initialValues: { path: i, name: Pt(i) },
6970
6974
  parentCollectionIds: r,
6971
6975
  redirect: !1
6972
6976
  });
@@ -6984,8 +6988,8 @@ export {
6984
6988
  zr as MissingReferenceWidget,
6985
6989
  Je as editableProperty,
6986
6990
  ce as getFullId,
6987
- _e as idToPropertiesPath,
6988
- Ne as namespaceToPropertiesOrderPath,
6991
+ ke as idToPropertiesPath,
6992
+ Pe as namespaceToPropertiesOrderPath,
6989
6993
  ki as namespaceToPropertiesPath,
6990
6994
  qi as removeNonEditableProperties,
6991
6995
  Re as useCollectionEditorController,