@firecms/collection_editor 3.0.0-alpha.31 → 3.0.0-alpha.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/index.d.ts +2 -2
  2. package/dist/index.es.js +910 -802
  3. package/dist/index.es.js.map +1 -1
  4. package/dist/index.umd.js +1 -1
  5. package/dist/index.umd.js.map +1 -1
  6. package/dist/ui/collection_editor/GetCodeDialog.d.ts +5 -0
  7. package/dist/ui/collection_editor/utils/strings.d.ts +1 -0
  8. package/package.json +6 -4
  9. package/src/ConfigControllerProvider.tsx +2 -2
  10. package/src/index.ts +2 -2
  11. package/src/{components → ui}/collection_editor/CollectionPropertiesEditorForm.tsx +25 -8
  12. package/src/ui/collection_editor/GetCodeDialog.tsx +118 -0
  13. package/src/{components → ui}/collection_editor/PropertyFieldPreview.tsx +0 -4
  14. package/src/{components → ui}/collection_editor/PropertyTree.tsx +1 -1
  15. package/src/ui/collection_editor/utils/strings.ts +8 -0
  16. package/src/useCollectionEditorPlugin.tsx +6 -6
  17. package/src/utils/join_collections.ts +10 -2
  18. /package/dist/{components → ui}/CollectionViewHeaderAction.d.ts +0 -0
  19. /package/dist/{components → ui}/EditorCollectionAction.d.ts +0 -0
  20. /package/dist/{components → ui}/HomePageEditorCollectionAction.d.ts +0 -0
  21. /package/dist/{components → ui}/MissingReferenceWidget.d.ts +0 -0
  22. /package/dist/{components → ui}/NewCollectionCard.d.ts +0 -0
  23. /package/dist/{components → ui}/PropertyAddColumnComponent.d.ts +0 -0
  24. /package/dist/{components → ui}/RootCollectionSuggestions.d.ts +0 -0
  25. /package/dist/{components → ui}/collection_editor/CollectionDetailsForm.d.ts +0 -0
  26. /package/dist/{components → ui}/collection_editor/CollectionEditorDialog.d.ts +0 -0
  27. /package/dist/{components → ui}/collection_editor/CollectionEditorWelcomeView.d.ts +0 -0
  28. /package/dist/{components → ui}/collection_editor/CollectionPropertiesEditorForm.d.ts +0 -0
  29. /package/dist/{components → ui}/collection_editor/CollectionYupValidation.d.ts +0 -0
  30. /package/dist/{components → ui}/collection_editor/EntityCustomViewsSelectDialog.d.ts +0 -0
  31. /package/dist/{components → ui}/collection_editor/EnumForm.d.ts +0 -0
  32. /package/dist/{components → ui}/collection_editor/PropertyEditView.d.ts +0 -0
  33. /package/dist/{components → ui}/collection_editor/PropertyFieldPreview.d.ts +0 -0
  34. /package/dist/{components → ui}/collection_editor/PropertySelectItem.d.ts +0 -0
  35. /package/dist/{components → ui}/collection_editor/PropertyTree.d.ts +0 -0
  36. /package/dist/{components → ui}/collection_editor/SelectIcons.d.ts +0 -0
  37. /package/dist/{components → ui}/collection_editor/SubcollectionsEditTab.d.ts +0 -0
  38. /package/dist/{components → ui}/collection_editor/UnsavedChangesDialog.d.ts +0 -0
  39. /package/dist/{components → ui}/collection_editor/import/CollectionEditorImportDataPreview.d.ts +0 -0
  40. /package/dist/{components → ui}/collection_editor/import/CollectionEditorImportMapping.d.ts +0 -0
  41. /package/dist/{components → ui}/collection_editor/import/clean_import_data.d.ts +0 -0
  42. /package/dist/{components → ui}/collection_editor/properties/BlockPropertyField.d.ts +0 -0
  43. /package/dist/{components → ui}/collection_editor/properties/BooleanPropertyField.d.ts +0 -0
  44. /package/dist/{components → ui}/collection_editor/properties/CommonPropertyFields.d.ts +0 -0
  45. /package/dist/{components → ui}/collection_editor/properties/DateTimePropertyField.d.ts +0 -0
  46. /package/dist/{components → ui}/collection_editor/properties/EnumPropertyField.d.ts +0 -0
  47. /package/dist/{components → ui}/collection_editor/properties/FieldHelperView.d.ts +0 -0
  48. /package/dist/{components → ui}/collection_editor/properties/KeyValuePropertyField.d.ts +0 -0
  49. /package/dist/{components → ui}/collection_editor/properties/MapPropertyField.d.ts +0 -0
  50. /package/dist/{components → ui}/collection_editor/properties/NumberPropertyField.d.ts +0 -0
  51. /package/dist/{components → ui}/collection_editor/properties/ReferencePropertyField.d.ts +0 -0
  52. /package/dist/{components → ui}/collection_editor/properties/RepeatPropertyField.d.ts +0 -0
  53. /package/dist/{components → ui}/collection_editor/properties/StoragePropertyField.d.ts +0 -0
  54. /package/dist/{components → ui}/collection_editor/properties/StringPropertyField.d.ts +0 -0
  55. /package/dist/{components → ui}/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +0 -0
  56. /package/dist/{components → ui}/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +0 -0
  57. /package/dist/{components → ui}/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +0 -0
  58. /package/dist/{components → ui}/collection_editor/properties/validation/NumberPropertyValidation.d.ts +0 -0
  59. /package/dist/{components → ui}/collection_editor/properties/validation/StringPropertyValidation.d.ts +0 -0
  60. /package/dist/{components → ui}/collection_editor/properties/validation/ValidationPanel.d.ts +0 -0
  61. /package/dist/{components → ui}/collection_editor/templates/blog_template.d.ts +0 -0
  62. /package/dist/{components → ui}/collection_editor/templates/products_template.d.ts +0 -0
  63. /package/dist/{components → ui}/collection_editor/templates/users_template.d.ts +0 -0
  64. /package/dist/{components → ui}/collection_editor/util.d.ts +0 -0
  65. /package/dist/{components → ui}/collection_editor/utils/supported_fields.d.ts +0 -0
  66. /package/dist/{components → ui}/collection_editor/utils/update_property_for_widget.d.ts +0 -0
  67. /package/dist/{components → ui}/collection_editor/utils/useTraceUpdate.d.ts +0 -0
  68. /package/src/{components → ui}/CollectionViewHeaderAction.tsx +0 -0
  69. /package/src/{components → ui}/EditorCollectionAction.tsx +0 -0
  70. /package/src/{components → ui}/HomePageEditorCollectionAction.tsx +0 -0
  71. /package/src/{components → ui}/MissingReferenceWidget.tsx +0 -0
  72. /package/src/{components → ui}/NewCollectionCard.tsx +0 -0
  73. /package/src/{components → ui}/PropertyAddColumnComponent.tsx +0 -0
  74. /package/src/{components → ui}/RootCollectionSuggestions.tsx +0 -0
  75. /package/src/{components → ui}/collection_editor/CollectionDetailsForm.tsx +0 -0
  76. /package/src/{components → ui}/collection_editor/CollectionEditorDialog.tsx +0 -0
  77. /package/src/{components → ui}/collection_editor/CollectionEditorWelcomeView.tsx +0 -0
  78. /package/src/{components → ui}/collection_editor/CollectionYupValidation.tsx +0 -0
  79. /package/src/{components → ui}/collection_editor/EntityCustomViewsSelectDialog.tsx +0 -0
  80. /package/src/{components → ui}/collection_editor/EnumForm.tsx +0 -0
  81. /package/src/{components → ui}/collection_editor/PropertyEditView.tsx +0 -0
  82. /package/src/{components → ui}/collection_editor/PropertySelectItem.tsx +0 -0
  83. /package/src/{components → ui}/collection_editor/SelectIcons.tsx +0 -0
  84. /package/src/{components → ui}/collection_editor/SubcollectionsEditTab.tsx +0 -0
  85. /package/src/{components → ui}/collection_editor/UnsavedChangesDialog.tsx +0 -0
  86. /package/src/{components → ui}/collection_editor/import/CollectionEditorImportDataPreview.tsx +0 -0
  87. /package/src/{components → ui}/collection_editor/import/CollectionEditorImportMapping.tsx +0 -0
  88. /package/src/{components → ui}/collection_editor/import/clean_import_data.ts +0 -0
  89. /package/src/{components → ui}/collection_editor/properties/BlockPropertyField.tsx +0 -0
  90. /package/src/{components → ui}/collection_editor/properties/BooleanPropertyField.tsx +0 -0
  91. /package/src/{components → ui}/collection_editor/properties/CommonPropertyFields.tsx +0 -0
  92. /package/src/{components → ui}/collection_editor/properties/DateTimePropertyField.tsx +0 -0
  93. /package/src/{components → ui}/collection_editor/properties/EnumPropertyField.tsx +0 -0
  94. /package/src/{components → ui}/collection_editor/properties/FieldHelperView.tsx +0 -0
  95. /package/src/{components → ui}/collection_editor/properties/KeyValuePropertyField.tsx +0 -0
  96. /package/src/{components → ui}/collection_editor/properties/MapPropertyField.tsx +0 -0
  97. /package/src/{components → ui}/collection_editor/properties/NumberPropertyField.tsx +0 -0
  98. /package/src/{components → ui}/collection_editor/properties/ReferencePropertyField.tsx +0 -0
  99. /package/src/{components → ui}/collection_editor/properties/RepeatPropertyField.tsx +0 -0
  100. /package/src/{components → ui}/collection_editor/properties/StoragePropertyField.tsx +0 -0
  101. /package/src/{components → ui}/collection_editor/properties/StringPropertyField.tsx +0 -0
  102. /package/src/{components → ui}/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +0 -0
  103. /package/src/{components → ui}/collection_editor/properties/validation/ArrayPropertyValidation.tsx +0 -0
  104. /package/src/{components → ui}/collection_editor/properties/validation/GeneralPropertyValidation.tsx +0 -0
  105. /package/src/{components → ui}/collection_editor/properties/validation/NumberPropertyValidation.tsx +0 -0
  106. /package/src/{components → ui}/collection_editor/properties/validation/StringPropertyValidation.tsx +0 -0
  107. /package/src/{components → ui}/collection_editor/properties/validation/ValidationPanel.tsx +0 -0
  108. /package/src/{components → ui}/collection_editor/templates/blog_template.ts +0 -0
  109. /package/src/{components → ui}/collection_editor/templates/products_template.ts +0 -0
  110. /package/src/{components → ui}/collection_editor/templates/users_template.ts +0 -0
  111. /package/src/{components → ui}/collection_editor/util.ts +0 -0
  112. /package/src/{components → ui}/collection_editor/utils/supported_fields.tsx +0 -0
  113. /package/src/{components → ui}/collection_editor/utils/update_property_for_widget.ts +0 -0
  114. /package/src/{components → ui}/collection_editor/utils/useTraceUpdate.tsx +0 -0
package/dist/index.es.js CHANGED
@@ -1,18 +1,20 @@
1
1
  import { jsxs as n, Fragment as B, jsx as e } from "react/jsx-runtime";
2
- import * as ve from "react";
3
- import R, { useState as Y, useCallback as Q, useEffect as pe, useMemo as Ut, useRef as $e, useDeferredValue as ga, useContext as $t } from "react";
4
- import { iconKeys as Lt, debounce as fa, SearchBar as ba, Tooltip as ae, IconButton as me, Icon as rt, coolIconKeys as wt, Typography as P, getIconForView as ot, useAutoComplete as ya, Container as dt, Chip as nt, TextField as Ve, cn as _e, DebouncedTextField as G, Autocomplete as va, AutocompleteItem as wa, ExpandablePanel as kt, SettingsIcon as Ke, Select as je, SelectItem as ye, BooleanSwitchWithLabel as Kt, Dialog as Me, toSnakeCase as Yt, singular as _a, ListIcon as ka, Button as E, CircularProgress as Ye, AutoAwesomeIcon as pt, Paper as Pe, FormikArrayContainer as xa, DialogContent as He, DialogActions as Ge, SwitchControl as ue, serializeRegExp as Ca, isValidRegExp as Oa, RuleIcon as Pa, useSnackbarController as Qe, resolveEnumValues as Na, FileUploadIcon as Sa, MultiSelect as qa, MultiSelectItem as St, Checkbox as qt, isPropertyBuilder as le, useFireCMSContext as qe, getFieldConfig as Ze, ErrorBoundary as Ce, FieldConfigBadge as Je, cardMixin as Ht, cardClickableMixin as Gt, cardSelectedMixin as Qt, RemoveCircleIcon as Zt, FunctionsIcon as Aa, defaultBorderMixin as xt, RemoveIcon as za, DragHandleIcon as Ta, AddIcon as Ne, useNavigationContext as De, SelectGroup as At, mergeDeep as $, getFieldId as Jt, DEFAULT_FIELD_CONFIGS as _t, InfoLabel as Wt, DeleteIcon as st, DeleteConfirmationDialog as lt, useLargeLayout as Va, makePropertiesEditable as Xt, resolveEntityView as ja, Table as zt, TableBody as Tt, TableRow as ft, TableCell as Ue, unslugify as Ct, Card as ea, useSelectionController as Fa, EntityCollectionTable as Ia, slugify as Ea, useAuthController as Re, CircularProgressCenter as Vt, Tabs as Ba, Tab as bt, removeUndefined as Ma, ErrorView as ta, ArrowBackIcon as tt, LoadingButton as jt, DoneIcon as Da, SaveIcon as Ra, Menu as Ua, MoreVertIcon as $a, MenuItem as La, Collapse as Ka, sortProperties as Ya, getDefaultPropertiesOrder as Ha } from "@firecms/core";
5
- import ct from "react-fast-compare";
6
- import { useFormikContext as L, Field as ge, getIn as N, Formik as Ot, FastField as ce, Form as Ga } from "formik";
7
- import * as yt from "yup";
8
- import * as Qa from "js-search";
9
- import { extractEnumFromValues as Za, buildPropertyFromData as Ja, buildEntityPropertiesFromData as Wa } from "@firecms/schema_inference";
10
- import { DragDropContext as Xa, Droppable as ei, Draggable as ti } from "@hello-pangea/dnd";
11
- import { ImportFileUpload as ai, DataNewPropertiesMapping as ii, ImportNewPropertyFieldPreview as ri, getInferenceType as aa, getPropertiesMapping as oi, convertDataToEntity as ni, useImportConfig as si, ImportSaveInProgress as li } from "@firecms/data_import";
12
- import { useNavigate as ci } from "react-router";
13
- const di = yt.object().shape({
14
- name: yt.string().required("Required"),
15
- path: yt.string().required("Required")
2
+ import * as _e from "react";
3
+ import D, { useState as L, useCallback as J, useEffect as de, useMemo as $t, useRef as Ge, useDeferredValue as fa, useContext as Lt } from "react";
4
+ import { iconKeys as Kt, debounce as ba, SearchBar as ya, Tooltip as ae, IconButton as re, Icon as st, coolIconKeys as _t, Typography as P, getIconForView as lt, useAutoComplete as va, Container as ut, Chip as ct, TextField as Ve, cn as xe, DebouncedTextField as H, Autocomplete as wa, AutocompleteItem as _a, ExpandablePanel as xt, SettingsIcon as Je, Select as je, SelectItem as we, BooleanSwitchWithLabel as Yt, Dialog as Ie, toSnakeCase as Gt, singular as ka, ListIcon as xa, Button as E, CircularProgress as Qe, AutoAwesomeIcon as ht, Paper as Se, FormikArrayContainer as Ca, DialogContent as De, DialogActions as Re, SwitchControl as ue, serializeRegExp as Oa, isValidRegExp as Pa, RuleIcon as Na, useSnackbarController as Ue, resolveEnumValues as Sa, FileUploadIcon as qa, MultiSelect as Aa, MultiSelectItem as qt, Checkbox as At, isPropertyBuilder as se, useFireCMSContext as Ae, getFieldConfig as We, ErrorBoundary as Pe, FieldConfigBadge as Ze, cardMixin as Ht, cardClickableMixin as Jt, cardSelectedMixin as Qt, FunctionsIcon as za, RemoveCircleIcon as Ta, defaultBorderMixin as Ct, RemoveIcon as Va, DragHandleIcon as ja, AddIcon as qe, useNavigationContext as $e, SelectGroup as zt, mergeDeep as $, getFieldId as Wt, DEFAULT_FIELD_CONFIGS as kt, InfoLabel as Zt, DeleteIcon as dt, DeleteConfirmationDialog as pt, ContentCopyIcon as Fa, useLargeLayout as Ia, CodeIcon as Ea, makePropertiesEditable as Xt, resolveEntityView as Ba, Table as Tt, TableBody as Vt, TableRow as bt, TableCell as Ye, unslugify as Ot, Card as ea, useSelectionController as Ma, EntityCollectionTable as Da, slugify as Ra, useAuthController as Le, CircularProgressCenter as jt, Tabs as Ua, Tab as yt, removeUndefined as $a, ErrorView as ta, ArrowBackIcon as rt, LoadingButton as Ft, DoneIcon as La, SaveIcon as Ka, Menu as Ya, MoreVertIcon as Ga, MenuItem as Ha, Collapse as Ja, sortProperties as Qa, getDefaultPropertiesOrder as Wa } from "@firecms/core";
5
+ import mt from "react-fast-compare";
6
+ import { useFormikContext as K, Field as be, getIn as N, Formik as Pt, FastField as le, Form as Za } from "formik";
7
+ import * as vt from "yup";
8
+ import * as Xa from "js-search";
9
+ import { extractEnumFromValues as ei, buildPropertyFromData as ti, buildEntityPropertiesFromData as ai } from "@firecms/schema_inference";
10
+ import { DragDropContext as ii, Droppable as ri, Draggable as oi } from "@hello-pangea/dnd";
11
+ import ni from "json5";
12
+ import { Highlight as si, themes as li } from "prism-react-renderer";
13
+ import { ImportFileUpload as ci, DataNewPropertiesMapping as di, ImportNewPropertyFieldPreview as pi, getInferenceType as aa, getPropertiesMapping as mi, convertDataToEntity as ui, useImportConfig as hi, ImportSaveInProgress as gi } from "@firecms/data_import";
14
+ import { useNavigate as fi } from "react-router";
15
+ const bi = vt.object().shape({
16
+ name: vt.string().required("Required"),
17
+ path: vt.string().required("Required")
16
18
  }), ia = {
17
19
  abc: "alphabet character font letter symbol text type",
18
20
  access_alarm: "clock time",
@@ -1962,34 +1964,34 @@ const di = yt.object().shape({
1962
1964
  zoom_in_map: "arrows destination location maps move place stop",
1963
1965
  zoom_out: "find glass look magnifier magnifying minus negative scale search see size smaller",
1964
1966
  zoom_out_map: "arrows destination location maps move place stop"
1965
- }, Pt = new Qa.Search("key");
1966
- Pt.addIndex("synonyms");
1967
- Pt.addDocuments(Lt.map((t) => ({
1967
+ }, Nt = new Xa.Search("key");
1968
+ Nt.addIndex("synonyms");
1969
+ Nt.addDocuments(Kt.map((t) => ({
1968
1970
  key: t,
1969
1971
  // @ts-ignore
1970
1972
  synonyms: ia[t] ?? []
1971
1973
  })));
1972
- const pi = 220;
1974
+ const yi = 220;
1973
1975
  process.env.NODE_ENV !== "production" && Object.keys(ia).forEach((t) => {
1974
- Lt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
1976
+ Kt.includes(t) || console.warn(`The icon ${t} no longer exists. Remove it from \`synonyms\``);
1975
1977
  });
1976
- function mi({ selectedIcon: t = "", onIconSelected: a }) {
1977
- const [r, i] = ve.useState(null), [s, o] = ve.useState(""), l = ve.useMemo(
1978
- () => fa((m) => {
1978
+ function vi({ selectedIcon: t = "", onIconSelected: a }) {
1979
+ const [r, i] = _e.useState(null), [s, o] = _e.useState(""), l = _e.useMemo(
1980
+ () => ba((m) => {
1979
1981
  if (!m || m === "")
1980
1982
  i(null);
1981
1983
  else {
1982
- const u = Pt.search(m);
1984
+ const u = Nt.search(m);
1983
1985
  i(u.map((c) => c.key));
1984
1986
  }
1985
- }, pi),
1987
+ }, yi),
1986
1988
  []
1987
1989
  );
1988
- return ve.useEffect(() => (l(s), () => {
1990
+ return _e.useEffect(() => (l(s), () => {
1989
1991
  l.clear();
1990
1992
  }), [s, l]), /* @__PURE__ */ n(B, { children: [
1991
1993
  /* @__PURE__ */ e(
1992
- ba,
1994
+ ya,
1993
1995
  {
1994
1996
  autoFocus: !0,
1995
1997
  className: "w-full sticky top-0 z-10",
@@ -1997,25 +1999,25 @@ function mi({ selectedIcon: t = "", onIconSelected: a }) {
1997
1999
  placeholder: "Search for more icons…"
1998
2000
  }
1999
2001
  ),
2000
- /* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ? wt : r).map((m) => /* @__PURE__ */ e(ae, { title: m, children: /* @__PURE__ */ e(
2001
- me,
2002
+ /* @__PURE__ */ e("div", { className: "flex max-w-full flex-wrap mt-4", children: (r === null ? _t : r).map((m) => /* @__PURE__ */ e(ae, { title: m, children: /* @__PURE__ */ e(
2003
+ re,
2002
2004
  {
2003
2005
  shape: "square",
2004
2006
  toggled: t === m,
2005
2007
  onClick: () => a(m),
2006
2008
  className: "box-content m-1",
2007
- children: /* @__PURE__ */ e(rt, { iconKey: m, size: 24 })
2009
+ children: /* @__PURE__ */ e(st, { iconKey: m, size: 24 })
2008
2010
  }
2009
2011
  ) }, m)) })
2010
2012
  ] });
2011
2013
  }
2012
- function ee({
2014
+ function te({
2013
2015
  error: t,
2014
2016
  children: a
2015
2017
  }) {
2016
2018
  return a ? /* @__PURE__ */ e(P, { variant: "caption", color: t ? "error" : "secondary", className: "ml-3.5 mt-0.5", children: a }) : null;
2017
2019
  }
2018
- function ui({
2020
+ function wi({
2019
2021
  isNewCollection: t,
2020
2022
  reservedGroups: a,
2021
2023
  existingPaths: r,
@@ -2023,7 +2025,7 @@ function ui({
2023
2025
  groups: s,
2024
2026
  parentCollection: o
2025
2027
  }) {
2026
- const l = R.useRef(null), {
2028
+ const l = D.useRef(null), {
2027
2029
  values: d,
2028
2030
  setFieldValue: m,
2029
2031
  handleChange: u,
@@ -2032,24 +2034,24 @@ function ui({
2032
2034
  setFieldTouched: g,
2033
2035
  isSubmitting: f,
2034
2036
  submitCount: y
2035
- } = L(), [k, _] = Y(!1), O = (x) => {
2036
- m("name", x), !N(c, "path") && t && x && m("path", Yt(x)), !N(c, "singularName") && t && x && m("singularName", _a(x));
2037
- }, h = ot(d), w = Q((x) => {
2037
+ } = K(), [k, _] = L(!1), O = (x) => {
2038
+ m("name", x), !N(c, "path") && t && x && m("path", Gt(x)), !N(c, "singularName") && t && x && m("singularName", ka(x));
2039
+ }, h = lt(d), w = J((x) => {
2038
2040
  let C;
2039
2041
  return x || (C = "You must specify a path in the database for this collection"), t && i?.includes(x.trim().toLowerCase()) && (C = "There is already a collection which uses this path as an alias"), t && r?.includes(x.trim().toLowerCase()) && !d.alias && (C = "There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, you need to define an alias in at least one of the collections"), C;
2040
- }, [t, i, r, d.alias]), b = Q((x) => {
2042
+ }, [t, i, r, d.alias]), b = J((x) => {
2041
2043
  if (!x)
2042
2044
  return;
2043
2045
  let C;
2044
2046
  return t && r?.includes(x.trim().toLowerCase()) && (C = "There is already a collection that uses this value as a path"), t && i?.includes(x.trim().toLowerCase()) && (C = "There is already a collection which uses this alias"), C;
2045
2047
  }, [t, r, i]), v = s?.filter((x) => !a?.includes(x)), {
2046
2048
  inputFocused: T,
2047
- autoCompleteOpen: I,
2049
+ autoCompleteOpen: F,
2048
2050
  setAutoCompleteOpen: A
2049
- } = ya({
2051
+ } = va({
2050
2052
  ref: l
2051
2053
  }), S = !!o;
2052
- return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(dt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
2054
+ return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ut, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
2053
2055
  /* @__PURE__ */ n("div", { children: [
2054
2056
  /* @__PURE__ */ n(
2055
2057
  "div",
@@ -2058,7 +2060,7 @@ function ui({
2058
2060
  children: [
2059
2061
  /* @__PURE__ */ e(P, { variant: t ? "h4" : "h5", className: "flex-grow", children: t ? "New collection" : `${d.name} collection` }),
2060
2062
  /* @__PURE__ */ e(ae, { title: "Change icon", children: /* @__PURE__ */ e(
2061
- me,
2063
+ re,
2062
2064
  {
2063
2065
  shape: "square",
2064
2066
  onClick: () => _(!0),
@@ -2068,7 +2070,7 @@ function ui({
2068
2070
  ]
2069
2071
  }
2070
2072
  ),
2071
- o && /* @__PURE__ */ e(nt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
2073
+ o && /* @__PURE__ */ e(ct, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
2072
2074
  "This is a subcollection of ",
2073
2075
  /* @__PURE__ */ e("b", { children: o.name })
2074
2076
  ] }) })
@@ -2085,14 +2087,14 @@ function ui({
2085
2087
  error: c.name && !!p.name
2086
2088
  }
2087
2089
  ),
2088
- /* @__PURE__ */ e(ee, { error: c.name && !!p.name, children: c.name && p.name ? p.name : "Name of in this collection, usually a plural name (e.g. Products)" })
2090
+ /* @__PURE__ */ e(te, { error: c.name && !!p.name, children: c.name && p.name ? p.name : "Name of in this collection, usually a plural name (e.g. Products)" })
2089
2091
  ] }),
2090
- /* @__PURE__ */ n("div", { className: _e("col-span-12 ", S ? "" : "sm:col-span-8"), children: [
2092
+ /* @__PURE__ */ n("div", { className: xe("col-span-12 ", S ? "" : "sm:col-span-8"), children: [
2091
2093
  /* @__PURE__ */ e(
2092
- ge,
2094
+ be,
2093
2095
  {
2094
2096
  name: "path",
2095
- as: G,
2097
+ as: H,
2096
2098
  label: "Path",
2097
2099
  validate: w,
2098
2100
  disabled: !t,
@@ -2100,7 +2102,7 @@ function ui({
2100
2102
  error: c.path && !!p.path
2101
2103
  }
2102
2104
  ),
2103
- /* @__PURE__ */ e(ee, { error: c.path && !!p.path, children: c.path && p.path ? p.path : "Path that this collection is stored in" })
2105
+ /* @__PURE__ */ e(te, { error: c.path && !!p.path, children: c.path && p.path ? p.path : "Path that this collection is stored in" })
2104
2106
  ] }),
2105
2107
  !S && /* @__PURE__ */ n("div", { className: "col-span-12 sm:col-span-4 relative", children: [
2106
2108
  /* @__PURE__ */ e(
@@ -2117,12 +2119,12 @@ function ui({
2117
2119
  }
2118
2120
  ),
2119
2121
  /* @__PURE__ */ e(
2120
- va,
2122
+ wa,
2121
2123
  {
2122
- open: I && (v ?? []).length > 0,
2124
+ open: F && (v ?? []).length > 0,
2123
2125
  setOpen: A,
2124
2126
  children: v?.map((x, C) => /* @__PURE__ */ e(
2125
- wa,
2127
+ _a,
2126
2128
  {
2127
2129
  onClick: () => {
2128
2130
  A(!1), m("group", x ?? null);
@@ -2133,13 +2135,13 @@ function ui({
2133
2135
  ))
2134
2136
  }
2135
2137
  ),
2136
- /* @__PURE__ */ e(ee, { children: c.group && p.group ? p.group : "Group of the collection" })
2138
+ /* @__PURE__ */ e(te, { children: c.group && p.group ? p.group : "Group of the collection" })
2137
2139
  ] }),
2138
2140
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2139
- kt,
2141
+ xt,
2140
2142
  {
2141
2143
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2142
- /* @__PURE__ */ e(Ke, {}),
2144
+ /* @__PURE__ */ e(Je, {}),
2143
2145
  /* @__PURE__ */ e(
2144
2146
  P,
2145
2147
  {
@@ -2163,7 +2165,7 @@ function ui({
2163
2165
  label: "Singular name"
2164
2166
  }
2165
2167
  ),
2166
- /* @__PURE__ */ e(ee, { error: c.singularName && !!p.singularName, children: c.singularName && p.singularName ? p.singularName : "Optionally define a singular name for your entities" })
2168
+ /* @__PURE__ */ e(te, { error: c.singularName && !!p.singularName, children: c.singularName && p.singularName ? p.singularName : "Optionally define a singular name for your entities" })
2167
2169
  ] }),
2168
2170
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2169
2171
  /* @__PURE__ */ e(
@@ -2179,21 +2181,21 @@ function ui({
2179
2181
  label: "Description"
2180
2182
  }
2181
2183
  ),
2182
- /* @__PURE__ */ e(ee, { error: c.description && !!p.description, children: c.description && p.description ? p.description : "Description of the collection, you can use markdown" })
2184
+ /* @__PURE__ */ e(te, { error: c.description && !!p.description, children: c.description && p.description ? p.description : "Description of the collection, you can use markdown" })
2183
2185
  ] }),
2184
2186
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2185
2187
  /* @__PURE__ */ e(
2186
- ge,
2188
+ be,
2187
2189
  {
2188
2190
  name: "alias",
2189
- as: G,
2191
+ as: H,
2190
2192
  disabled: !t,
2191
2193
  label: "Alias",
2192
2194
  validate: b,
2193
2195
  error: c.alias && !!p.alias
2194
2196
  }
2195
2197
  ),
2196
- /* @__PURE__ */ e(ee, { error: c.alias && !!p.alias, children: c.alias && p.alias ? p.alias : "Use an alias as an ID when you have multiple collections located in the same path" })
2198
+ /* @__PURE__ */ e(te, { error: c.alias && !!p.alias, children: c.alias && p.alias ? p.alias : "Use an alias as an ID when you have multiple collections located in the same path" })
2197
2199
  ] }),
2198
2200
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2199
2201
  je,
@@ -2205,7 +2207,7 @@ function ui({
2205
2207
  value: d.defaultSize ?? "",
2206
2208
  renderValue: (x) => x.toUpperCase(),
2207
2209
  children: ["xs", "s", "m", "l", "xl"].map((x) => /* @__PURE__ */ e(
2208
- ye,
2210
+ we,
2209
2211
  {
2210
2212
  value: x,
2211
2213
  children: x.toUpperCase()
@@ -2216,7 +2218,7 @@ function ui({
2216
2218
  ) }),
2217
2219
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2218
2220
  /* @__PURE__ */ e(
2219
- Kt,
2221
+ Yt,
2220
2222
  {
2221
2223
  position: "start",
2222
2224
  label: "Collection group",
@@ -2224,7 +2226,7 @@ function ui({
2224
2226
  value: d.collectionGroup ?? !1
2225
2227
  }
2226
2228
  ),
2227
- /* @__PURE__ */ e(ee, { children: "A collection group consists of all collections with the same ID. This allows you to query over multiple collections at once." })
2229
+ /* @__PURE__ */ e(te, { children: "A collection group consists of all collections with the same ID. This allows you to query over multiple collections at once." })
2228
2230
  ] })
2229
2231
  ] })
2230
2232
  }
@@ -2232,14 +2234,14 @@ function ui({
2232
2234
  ] }),
2233
2235
  /* @__PURE__ */ e("div", { style: { height: "52px" } }),
2234
2236
  /* @__PURE__ */ e(
2235
- Me,
2237
+ Ie,
2236
2238
  {
2237
2239
  open: k,
2238
2240
  onOpenChange: _,
2239
2241
  maxWidth: "xl",
2240
2242
  fullWidth: !0,
2241
2243
  children: /* @__PURE__ */ e("div", { className: "p-4 overflow-auto min-h-[200px]", children: /* @__PURE__ */ e(
2242
- mi,
2244
+ vi,
2243
2245
  {
2244
2246
  selectedIcon: d.icon,
2245
2247
  onIconSelected: (x) => {
@@ -2251,19 +2253,19 @@ function ui({
2251
2253
  )
2252
2254
  ] }) });
2253
2255
  }
2254
- function we(t) {
2256
+ function ke(t) {
2255
2257
  return "properties." + t.replaceAll(".", ".properties.");
2256
2258
  }
2257
- function hi(t) {
2259
+ function _i(t) {
2258
2260
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".properties" : "properties";
2259
2261
  }
2260
- function Oe(t) {
2262
+ function Ne(t) {
2261
2263
  return t ? "properties." + t.replaceAll(".", ".properties.") + ".propertiesOrder" : "propertiesOrder";
2262
2264
  }
2263
- function se(t, a) {
2265
+ function ne(t, a) {
2264
2266
  return a ? `${a}.${t}` : t;
2265
2267
  }
2266
- const gi = R.memo(
2268
+ const ki = D.memo(
2267
2269
  function({
2268
2270
  enumValues: a,
2269
2271
  onValuesChanged: r,
@@ -2274,7 +2276,7 @@ const gi = R.memo(
2274
2276
  getData: d
2275
2277
  }) {
2276
2278
  return /* @__PURE__ */ e(
2277
- Ot,
2279
+ Pt,
2278
2280
  {
2279
2281
  initialValues: { enumValues: a },
2280
2282
  validateOnMount: !0,
@@ -2283,12 +2285,12 @@ const gi = R.memo(
2283
2285
  children: ({
2284
2286
  values: m,
2285
2287
  errors: u
2286
- }) => (pe(() => {
2288
+ }) => (de(() => {
2287
2289
  r && r(m.enumValues);
2288
- }, [m.enumValues]), pe(() => {
2290
+ }, [m.enumValues]), de(() => {
2289
2291
  i && i(!!(u?.enumValues ?? !1));
2290
2292
  }, [u]), /* @__PURE__ */ e(
2291
- fi,
2293
+ xi,
2292
2294
  {
2293
2295
  enumValuesPath: "enumValues",
2294
2296
  values: m,
@@ -2306,7 +2308,7 @@ const gi = R.memo(
2306
2308
  return a.enumValues.length === r.enumValues.length && a.onValuesChanged === r.onValuesChanged && a.getData === r.getData;
2307
2309
  }
2308
2310
  );
2309
- function fi({
2311
+ function xi({
2310
2312
  values: t,
2311
2313
  errors: a,
2312
2314
  disabled: r,
@@ -2317,10 +2319,10 @@ function fi({
2317
2319
  }) {
2318
2320
  const {
2319
2321
  setFieldValue: d
2320
- } = L(), [m, u] = R.useState(), [c, p] = R.useState(), [g, f] = R.useState(!1), k = R.useRef(/* @__PURE__ */ new Set()).current, _ = (h, w) => {
2322
+ } = K(), [m, u] = D.useState(), [c, p] = D.useState(), [g, f] = D.useState(!1), k = D.useRef(/* @__PURE__ */ new Set()).current, _ = (h, w) => {
2321
2323
  const b = m === w;
2322
2324
  return /* @__PURE__ */ e(
2323
- bi,
2325
+ Ci,
2324
2326
  {
2325
2327
  index: h,
2326
2328
  disabled: r,
@@ -2335,7 +2337,7 @@ function fi({
2335
2337
  };
2336
2338
  return /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2337
2339
  /* @__PURE__ */ n("div", { className: "ml-3.5 flex flex-row items-center", children: [
2338
- /* @__PURE__ */ e(ka, {}),
2340
+ /* @__PURE__ */ e(xa, {}),
2339
2341
  /* @__PURE__ */ e(
2340
2342
  P,
2341
2343
  {
@@ -2355,24 +2357,24 @@ function fi({
2355
2357
  l && (f(!0), l?.().then((h) => {
2356
2358
  if (!h)
2357
2359
  return;
2358
- const w = h.flat(), b = Array.from(new Set(w)), v = t.enumValues, I = Za(b).filter((A) => !v?.some((S) => S.id === A.id));
2359
- I.forEach((A) => {
2360
+ const w = h.flat(), b = Array.from(new Set(w)), v = t.enumValues, F = ei(b).filter((A) => !v?.some((S) => S.id === A.id));
2361
+ F.forEach((A) => {
2360
2362
  k.add(A.id);
2361
- }), d(i, [...I, ...v]);
2363
+ }), d(i, [...F, ...v]);
2362
2364
  }).catch((h) => {
2363
2365
  console.error(h);
2364
2366
  }).finally(() => f(!1)));
2365
2367
  },
2366
2368
  children: [
2367
- g ? /* @__PURE__ */ e(Ye, { size: "small" }) : /* @__PURE__ */ e(pt, {}),
2369
+ g ? /* @__PURE__ */ e(Qe, { size: "small" }) : /* @__PURE__ */ e(ht, {}),
2368
2370
  "Infer values from data"
2369
2371
  ]
2370
2372
  }
2371
2373
  )
2372
2374
  ] }),
2373
- /* @__PURE__ */ n(Pe, { className: "p-4 m-1", children: [
2375
+ /* @__PURE__ */ n(Se, { className: "p-4 m-1", children: [
2374
2376
  /* @__PURE__ */ e(
2375
- xa,
2377
+ Ca,
2376
2378
  {
2377
2379
  value: t.enumValues,
2378
2380
  addLabel: "Add enum value",
@@ -2386,7 +2388,7 @@ function fi({
2386
2388
  }
2387
2389
  ),
2388
2390
  /* @__PURE__ */ e(
2389
- yi,
2391
+ Oi,
2390
2392
  {
2391
2393
  index: c,
2392
2394
  open: c !== void 0,
@@ -2397,7 +2399,7 @@ function fi({
2397
2399
  ] })
2398
2400
  ] });
2399
2401
  }
2400
- const bi = R.memo(
2402
+ const Ci = D.memo(
2401
2403
  function({
2402
2404
  index: a,
2403
2405
  shouldUpdateId: r,
@@ -2413,34 +2415,34 @@ const bi = R.memo(
2413
2415
  errors: c,
2414
2416
  setFieldValue: p,
2415
2417
  touched: g
2416
- } = L(), f = R.useRef(!N(m, `${i}[${a}].id`)), y = r || f.current, k = N(m, `${i}[${a}].id`), _ = N(m, `${i}[${a}].label`), O = N(c, `${i}[${a}].label`), h = R.useRef(_);
2417
- return R.useEffect(() => {
2418
+ } = K(), f = D.useRef(!N(m, `${i}[${a}].id`)), y = r || f.current, k = N(m, `${i}[${a}].id`), _ = N(m, `${i}[${a}].label`), O = N(c, `${i}[${a}].label`), h = D.useRef(_);
2419
+ return D.useEffect(() => {
2418
2420
  (h.current === k || !k) && y && p(`${i}[${a}].id`, _), h.current = _;
2419
2421
  }, [_]), /* @__PURE__ */ n("div", { className: "flex w-full align-center justify-center", children: [
2420
2422
  /* @__PURE__ */ e(
2421
- ce,
2423
+ le,
2422
2424
  {
2423
2425
  name: `${i}[${a}].label`,
2424
- as: G,
2426
+ as: H,
2425
2427
  className: "flex-grow",
2426
2428
  required: !0,
2427
2429
  disabled: l,
2428
2430
  size: "small",
2429
- validate: vi,
2431
+ validate: Pi,
2430
2432
  autoFocus: s,
2431
2433
  autoComplete: "off",
2432
- endAdornment: d && /* @__PURE__ */ e(pt, { size: "small" }),
2434
+ endAdornment: d && /* @__PURE__ */ e(ht, { size: "small" }),
2433
2435
  error: !!O
2434
2436
  }
2435
2437
  ),
2436
2438
  !l && /* @__PURE__ */ e(
2437
- me,
2439
+ re,
2438
2440
  {
2439
2441
  size: "small",
2440
2442
  "aria-label": "edit",
2441
2443
  className: "m-1",
2442
2444
  onClick: () => o(),
2443
- children: /* @__PURE__ */ e(Ke, { size: "small" })
2445
+ children: /* @__PURE__ */ e(Je, { size: "small" })
2444
2446
  }
2445
2447
  )
2446
2448
  ] });
@@ -2449,7 +2451,7 @@ const bi = R.memo(
2449
2451
  return a.index === r.index && a.enumValuesPath === r.enumValuesPath && a.shouldUpdateId === r.shouldUpdateId && a.inferredEntry === r.inferredEntry && a.autoFocus === r.autoFocus;
2450
2452
  }
2451
2453
  );
2452
- function yi({
2454
+ function Oi({
2453
2455
  index: t,
2454
2456
  open: a,
2455
2457
  onClose: r,
@@ -2461,32 +2463,32 @@ function yi({
2461
2463
  errors: l,
2462
2464
  setFieldValue: d,
2463
2465
  touched: m
2464
- } = L(), u = t !== void 0 ? N(l, `${i}[${t}].id`) : void 0;
2466
+ } = K(), u = t !== void 0 ? N(l, `${i}[${t}].id`) : void 0;
2465
2467
  return /* @__PURE__ */ n(
2466
- Me,
2468
+ Ie,
2467
2469
  {
2468
2470
  maxWidth: "md",
2469
2471
  "aria-labelledby": "enum-edit-dialog",
2470
2472
  open: a,
2471
2473
  onOpenChange: (c) => c ? void 0 : r(),
2472
2474
  children: [
2473
- /* @__PURE__ */ e(He, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
2475
+ /* @__PURE__ */ e(De, { children: t !== void 0 && /* @__PURE__ */ n("div", { children: [
2474
2476
  /* @__PURE__ */ e(
2475
- ce,
2477
+ le,
2476
2478
  {
2477
2479
  name: `${i}[${t}]id`,
2478
- as: G,
2480
+ as: H,
2479
2481
  required: !0,
2480
- validate: wi,
2482
+ validate: Ni,
2481
2483
  label: "ID",
2482
2484
  size: "small",
2483
2485
  autoComplete: "off",
2484
2486
  error: !!u
2485
2487
  }
2486
2488
  ),
2487
- /* @__PURE__ */ e(ee, { error: !!u, children: u ?? "Value saved in the data source" })
2489
+ /* @__PURE__ */ e(te, { error: !!u, children: u ?? "Value saved in the data source" })
2488
2490
  ] }) }),
2489
- /* @__PURE__ */ e(Ge, { children: /* @__PURE__ */ e(
2491
+ /* @__PURE__ */ e(Re, { children: /* @__PURE__ */ e(
2490
2492
  E,
2491
2493
  {
2492
2494
  autoFocus: !0,
@@ -2500,19 +2502,19 @@ function yi({
2500
2502
  }
2501
2503
  );
2502
2504
  }
2503
- function vi(t) {
2505
+ function Pi(t) {
2504
2506
  let a;
2505
2507
  return t || (a = "You must specify a label"), a;
2506
2508
  }
2507
- function wi(t) {
2509
+ function Ni(t) {
2508
2510
  let a;
2509
2511
  return t || (a = "You must specify an ID"), a;
2510
2512
  }
2511
- function Ie({ disabled: t }) {
2512
- const { values: a, handleChange: r } = L(), i = "validation.required", s = "validation.requiredMessage";
2513
+ function Ee({ disabled: t }) {
2514
+ const { values: a, handleChange: r } = K(), i = "validation.required", s = "validation.requiredMessage";
2513
2515
  return /* @__PURE__ */ n(B, { children: [
2514
2516
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2515
- ce,
2517
+ le,
2516
2518
  {
2517
2519
  type: "checkbox",
2518
2520
  disabled: t,
@@ -2523,7 +2525,7 @@ function Ie({ disabled: t }) {
2523
2525
  }
2524
2526
  ) }),
2525
2527
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2526
- ce,
2528
+ le,
2527
2529
  {
2528
2530
  type: "checkbox",
2529
2531
  disabled: t,
@@ -2534,7 +2536,7 @@ function Ie({ disabled: t }) {
2534
2536
  }
2535
2537
  ) }),
2536
2538
  N(a, i) && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2537
- G,
2539
+ H,
2538
2540
  {
2539
2541
  disabled: t,
2540
2542
  value: N(a, s),
@@ -2546,7 +2548,7 @@ function Ie({ disabled: t }) {
2546
2548
  ) })
2547
2549
  ] });
2548
2550
  }
2549
- function Be({
2551
+ function Me({
2550
2552
  length: t,
2551
2553
  lowercase: a,
2552
2554
  matches: r,
@@ -2561,12 +2563,12 @@ function Be({
2561
2563
  values: u,
2562
2564
  handleChange: c,
2563
2565
  errors: p
2564
- } = L(), g = "validation.length", f = "validation.min", y = "validation.max", k = "validation.trim", _ = "validation.matches", O = "validation.lowercase", h = "validation.uppercase", w = N(p, _), b = N(u, _), v = typeof b == "string" ? b : Ca(b);
2566
+ } = K(), g = "validation.length", f = "validation.min", y = "validation.max", k = "validation.trim", _ = "validation.matches", O = "validation.lowercase", h = "validation.uppercase", w = N(p, _), b = N(u, _), v = typeof b == "string" ? b : Oa(b);
2565
2567
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2566
- /* @__PURE__ */ e(Ie, { disabled: d }),
2568
+ /* @__PURE__ */ e(Ee, { disabled: d }),
2567
2569
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
2568
2570
  a && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2569
- ce,
2571
+ le,
2570
2572
  {
2571
2573
  type: "checkbox",
2572
2574
  name: O,
@@ -2576,7 +2578,7 @@ function Be({
2576
2578
  }
2577
2579
  ) }),
2578
2580
  l && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2579
- ce,
2581
+ le,
2580
2582
  {
2581
2583
  type: "checkbox",
2582
2584
  name: h,
@@ -2586,7 +2588,7 @@ function Be({
2586
2588
  }
2587
2589
  ) }),
2588
2590
  o && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2589
- ce,
2591
+ le,
2590
2592
  {
2591
2593
  type: "checkbox",
2592
2594
  name: k,
@@ -2598,7 +2600,7 @@ function Be({
2598
2600
  ] }),
2599
2601
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 col-span-12", children: [
2600
2602
  t && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2601
- G,
2603
+ H,
2602
2604
  {
2603
2605
  value: N(u, g),
2604
2606
  label: "Exact length",
@@ -2610,7 +2612,7 @@ function Be({
2610
2612
  }
2611
2613
  ) }),
2612
2614
  s && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2613
- G,
2615
+ H,
2614
2616
  {
2615
2617
  value: N(u, f),
2616
2618
  label: "Min length",
@@ -2622,7 +2624,7 @@ function Be({
2622
2624
  }
2623
2625
  ) }),
2624
2626
  i && /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
2625
- G,
2627
+ H,
2626
2628
  {
2627
2629
  value: N(u, y),
2628
2630
  label: "Max length",
@@ -2636,11 +2638,11 @@ function Be({
2636
2638
  ] }),
2637
2639
  r && /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2638
2640
  /* @__PURE__ */ e(
2639
- ce,
2641
+ le,
2640
2642
  {
2641
2643
  name: _,
2642
- as: G,
2643
- validate: (T) => T && !Oa(T),
2644
+ as: H,
2645
+ validate: (T) => T && !Pa(T),
2644
2646
  label: "Matches regex",
2645
2647
  size: "small",
2646
2648
  disabled: d,
@@ -2648,11 +2650,11 @@ function Be({
2648
2650
  error: !!w
2649
2651
  }
2650
2652
  ),
2651
- /* @__PURE__ */ e(ee, { error: !!w, children: w ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
2653
+ /* @__PURE__ */ e(te, { error: !!w, children: w ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only" })
2652
2654
  ] })
2653
2655
  ] });
2654
2656
  }
2655
- function Nt({
2657
+ function St({
2656
2658
  max: t = !0,
2657
2659
  min: a = !0,
2658
2660
  disabled: r
@@ -2660,11 +2662,11 @@ function Nt({
2660
2662
  const {
2661
2663
  values: i,
2662
2664
  handleChange: s
2663
- } = L(), o = "validation.min", l = "validation.max";
2665
+ } = K(), o = "validation.min", l = "validation.max";
2664
2666
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
2665
- /* @__PURE__ */ e(Ie, { disabled: r }),
2667
+ /* @__PURE__ */ e(Ee, { disabled: r }),
2666
2668
  a && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2667
- G,
2669
+ H,
2668
2670
  {
2669
2671
  value: N(i, o),
2670
2672
  disabled: r,
@@ -2676,7 +2678,7 @@ function Nt({
2676
2678
  }
2677
2679
  ) }),
2678
2680
  t && /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
2679
- G,
2681
+ H,
2680
2682
  {
2681
2683
  value: N(i, l),
2682
2684
  disabled: r,
@@ -2689,17 +2691,17 @@ function Nt({
2689
2691
  ) })
2690
2692
  ] });
2691
2693
  }
2692
- function Ae({
2694
+ function ze({
2693
2695
  children: t
2694
2696
  }) {
2695
2697
  return /* @__PURE__ */ e(
2696
- kt,
2698
+ xt,
2697
2699
  {
2698
2700
  initiallyExpanded: !1,
2699
2701
  asField: !0,
2700
2702
  className: "p-4",
2701
2703
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2702
- /* @__PURE__ */ e(Pa, {}),
2704
+ /* @__PURE__ */ e(Na, {}),
2703
2705
  /* @__PURE__ */ e(
2704
2706
  P,
2705
2707
  {
@@ -2713,7 +2715,7 @@ function Ae({
2713
2715
  }
2714
2716
  );
2715
2717
  }
2716
- function Ft({
2718
+ function It({
2717
2719
  multiselect: t,
2718
2720
  updateIds: a,
2719
2721
  disabled: r,
@@ -2728,10 +2730,10 @@ function Ft({
2728
2730
  touched: u,
2729
2731
  setFieldError: c,
2730
2732
  setFieldValue: p
2731
- } = L(), g = Qe(), f = t ? "of.enumValues" : "enumValues", y = N(l, "defaultValue"), k = N(l, f), _ = Ut(() => !k || typeof k == "boolean" ? [] : Na(k) ?? [], [k]);
2733
+ } = K(), g = Ue(), f = t ? "of.enumValues" : "enumValues", y = N(l, "defaultValue"), k = N(l, f), _ = $t(() => !k || typeof k == "boolean" ? [] : Sa(k) ?? [], [k]);
2732
2734
  return /* @__PURE__ */ n(B, { children: [
2733
2735
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2734
- gi,
2736
+ ki,
2735
2737
  {
2736
2738
  enumValues: _,
2737
2739
  updateIds: a,
@@ -2752,15 +2754,15 @@ function Ft({
2752
2754
  }
2753
2755
  }
2754
2756
  ) }),
2755
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ae, { children: [
2757
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
2756
2758
  !t && /* @__PURE__ */ e(
2757
- Be,
2759
+ Me,
2758
2760
  {
2759
2761
  disabled: r,
2760
2762
  showErrors: i
2761
2763
  }
2762
2764
  ),
2763
- t && /* @__PURE__ */ e(Nt, { disabled: r })
2765
+ t && /* @__PURE__ */ e(St, { disabled: r })
2764
2766
  ] }) }),
2765
2767
  !t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2766
2768
  je,
@@ -2773,7 +2775,7 @@ function Ft({
2773
2775
  label: "Default value",
2774
2776
  value: y ?? "",
2775
2777
  children: _.filter((h) => !!h?.id).map((h) => /* @__PURE__ */ e(
2776
- ye,
2778
+ we,
2777
2779
  {
2778
2780
  value: h.id?.toString(),
2779
2781
  children: h.label
@@ -2784,14 +2786,14 @@ function Ft({
2784
2786
  ) })
2785
2787
  ] });
2786
2788
  }
2787
- const at = {
2789
+ const ot = {
2788
2790
  "image/*": "Images",
2789
2791
  "video/*": "Videos",
2790
2792
  "audio/*": "Audio files",
2791
2793
  "application/*": "Files (pdf, zip, csv, excel...)",
2792
2794
  "text/*": "Text files"
2793
2795
  };
2794
- function It({
2796
+ function Et({
2795
2797
  multiple: t,
2796
2798
  existing: a,
2797
2799
  disabled: r
@@ -2799,15 +2801,15 @@ function It({
2799
2801
  const {
2800
2802
  values: i,
2801
2803
  setFieldValue: s
2802
- } = L(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, d = `${o}.fileName`, m = `${o}.storagePath`, u = `${o}.storeUrl`, c = N(i, d) ?? "{rand}_{file}", p = N(i, m) ?? "/", g = N(i, l), f = Array.isArray(g) ? g : void 0, y = !f || f.length === 0, k = (h) => {
2803
- h ? h.includes("all") || h.length >= Object.keys(at).length ? s(l, void 0) : y ? s(l, Object.keys(at).filter((w) => !h.includes(w))) : s(l, h) : s(l, void 0);
2804
+ } = K(), o = t ? "of.storage" : "storage", l = `${o}.acceptedFiles`, d = `${o}.fileName`, m = `${o}.storagePath`, u = `${o}.storeUrl`, c = N(i, d) ?? "{rand}_{file}", p = N(i, m) ?? "/", g = N(i, l), f = Array.isArray(g) ? g : void 0, y = !f || f.length === 0, k = (h) => {
2805
+ h ? h.includes("all") || h.length >= Object.keys(ot).length ? s(l, void 0) : y ? s(l, Object.keys(ot).filter((w) => !h.includes(w))) : s(l, h) : s(l, void 0);
2804
2806
  }, _ = typeof c == "function", O = typeof p == "function";
2805
2807
  return /* @__PURE__ */ n(B, { children: [
2806
2808
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2807
- kt,
2809
+ xt,
2808
2810
  {
2809
2811
  title: /* @__PURE__ */ n("div", { className: "flex flex-row text-gray-500", children: [
2810
- /* @__PURE__ */ e(Sa, {}),
2812
+ /* @__PURE__ */ e(qa, {}),
2811
2813
  /* @__PURE__ */ e(
2812
2814
  P,
2813
2815
  {
@@ -2819,27 +2821,27 @@ function It({
2819
2821
  ] }),
2820
2822
  children: /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 p-4", children: [
2821
2823
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(
2822
- qa,
2824
+ Aa,
2823
2825
  {
2824
2826
  disabled: r,
2825
2827
  name: l,
2826
2828
  value: f ?? [],
2827
2829
  onMultiValueChange: k,
2828
2830
  label: y ? void 0 : "Allowed file types",
2829
- renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((w) => at[w]).filter((w) => !!w).join(", "),
2831
+ renderValues: (h) => !h || h.length === 0 ? "All file types allowed" : h.map((w) => ot[w]).filter((w) => !!w).join(", "),
2830
2832
  children: [
2831
- /* @__PURE__ */ n(St, { value: "all", className: "flex items-center gap-2", children: [
2833
+ /* @__PURE__ */ n(qt, { value: "all", className: "flex items-center gap-2", children: [
2832
2834
  /* @__PURE__ */ e(
2833
- qt,
2835
+ At,
2834
2836
  {
2835
2837
  checked: !f
2836
2838
  }
2837
2839
  ),
2838
2840
  "All"
2839
2841
  ] }, "all"),
2840
- Object.entries(at).map(([h, w]) => /* @__PURE__ */ n(St, { value: h, className: "flex items-center gap-2", children: [
2842
+ Object.entries(ot).map(([h, w]) => /* @__PURE__ */ n(qt, { value: h, className: "flex items-center gap-2", children: [
2841
2843
  /* @__PURE__ */ e(
2842
- qt,
2844
+ At,
2843
2845
  {
2844
2846
  checked: y || f.indexOf(h) > -1
2845
2847
  }
@@ -2859,10 +2861,10 @@ function It({
2859
2861
  }
2860
2862
  ) }),
2861
2863
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
2862
- ge,
2864
+ be,
2863
2865
  {
2864
2866
  name: d,
2865
- as: G,
2867
+ as: H,
2866
2868
  label: "File name",
2867
2869
  size: "small",
2868
2870
  disabled: _ || r,
@@ -2871,10 +2873,10 @@ function It({
2871
2873
  ) }),
2872
2874
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
2873
2875
  /* @__PURE__ */ e(
2874
- ge,
2876
+ be,
2875
2877
  {
2876
2878
  name: m,
2877
- as: G,
2879
+ as: H,
2878
2880
  label: "Storage path",
2879
2881
  disabled: O || r,
2880
2882
  size: "small",
@@ -2894,7 +2896,7 @@ function It({
2894
2896
  ] })
2895
2897
  ] }),
2896
2898
  /* @__PURE__ */ e(
2897
- ge,
2899
+ be,
2898
2900
  {
2899
2901
  type: "checkbox",
2900
2902
  name: u,
@@ -2909,28 +2911,28 @@ function It({
2909
2911
  ] })
2910
2912
  }
2911
2913
  ) }),
2912
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ae, { children: [
2913
- !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Ie, { disabled: r }) }),
2914
- t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Nt, { disabled: r }) })
2914
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
2915
+ !t && /* @__PURE__ */ e("div", { className: "grid grid-cols-12 gap-2", children: /* @__PURE__ */ e(Ee, { disabled: r }) }),
2916
+ t && /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(St, { disabled: r }) })
2915
2917
  ] }) })
2916
2918
  ] });
2917
2919
  }
2918
- function Le(t) {
2919
- if (le(t) || le(t))
2920
+ function He(t) {
2921
+ if (se(t) || se(t))
2920
2922
  return !1;
2921
2923
  {
2922
2924
  const a = t;
2923
2925
  return a.dataType === "array" && typeof a.of == "function" || a.dataType === "array" && Array.isArray(a.of) ? !1 : !!a.editable;
2924
2926
  }
2925
2927
  }
2926
- function _i(t) {
2927
- return Object.entries(t).filter(([a, r]) => Le(r)).map(([a, r]) => {
2928
+ function Si(t) {
2929
+ return Object.entries(t).filter(([a, r]) => He(r)).map(([a, r]) => {
2928
2930
  const i = r;
2929
- if (Le(i))
2931
+ if (He(i))
2930
2932
  return i.dataType === "map" && i.properties ? {
2931
2933
  [a]: {
2932
2934
  ...i,
2933
- properties: _i(i.properties)
2935
+ properties: Si(i.properties)
2934
2936
  }
2935
2937
  } : { [a]: i };
2936
2938
  }).filter((a) => !!a).reduce((a, r) => ({ ...a, ...r }), {});
@@ -2943,28 +2945,28 @@ function ra({
2943
2945
  includeEditButton: s,
2944
2946
  selected: o
2945
2947
  }) {
2946
- const { fields: l } = qe(), d = Ze(t, l), m = !Le(t);
2947
- return /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
2948
+ const { fields: l } = Ae(), d = We(t, l);
2949
+ return He(t), /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ n(
2948
2950
  "div",
2949
2951
  {
2950
2952
  onClick: a,
2951
2953
  className: "flex flex-row w-full cursor-pointer",
2952
2954
  children: [
2953
- /* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Je, { propertyConfig: d }) }),
2955
+ /* @__PURE__ */ e("div", { className: "m-4", children: /* @__PURE__ */ e(Ze, { propertyConfig: d }) }),
2954
2956
  /* @__PURE__ */ n(
2955
- Pe,
2957
+ Se,
2956
2958
  {
2957
- className: _e(
2959
+ className: xe(
2958
2960
  "pl-2 w-full flex flex-row gap-4 items-center",
2959
2961
  Ht,
2960
- a ? Gt : "",
2962
+ a ? Jt : "",
2961
2963
  o ? Qt : "",
2962
2964
  "flex-grow p-4 border transition-colors duration-200",
2963
2965
  r ? "border-red-500" : o ? "border-blue-500" : "border-transparent"
2964
2966
  ),
2965
2967
  children: [
2966
2968
  /* @__PURE__ */ n("div", { className: "w-full flex flex-col", children: [
2967
- i && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
2969
+ i && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2968
2970
  P,
2969
2971
  {
2970
2972
  variant: "body1",
@@ -2974,7 +2976,7 @@ function ra({
2974
2976
  }
2975
2977
  ) }),
2976
2978
  /* @__PURE__ */ n("div", { className: "flex flex-row items-center", children: [
2977
- /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
2979
+ /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2978
2980
  P,
2979
2981
  {
2980
2982
  className: "flex-grow pr-2",
@@ -2984,7 +2986,7 @@ function ra({
2984
2986
  children: d?.name
2985
2987
  }
2986
2988
  ) }),
2987
- /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
2989
+ /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
2988
2990
  P,
2989
2991
  {
2990
2992
  variant: "body2",
@@ -2992,14 +2994,7 @@ function ra({
2992
2994
  color: "disabled",
2993
2995
  children: t.dataType
2994
2996
  }
2995
- ) }),
2996
- m && /* @__PURE__ */ e(
2997
- "div",
2998
- {
2999
- className: "text-xs h-3 ml-0.5",
3000
- children: /* @__PURE__ */ e(Zt, { color: "disabled" })
3001
- }
3002
- )
2997
+ ) })
3003
2998
  ] })
3004
2999
  ] }),
3005
3000
  s && /* @__PURE__ */ e(P, { variant: "button", children: "EDIT" })
@@ -3010,13 +3005,13 @@ function ra({
3010
3005
  }
3011
3006
  ) });
3012
3007
  }
3013
- function ki({
3008
+ function qi({
3014
3009
  name: t,
3015
3010
  selected: a,
3016
3011
  onClick: r,
3017
3012
  property: i
3018
3013
  }) {
3019
- const { fields: s } = qe(), o = !le(i) && i ? Ze(i, s) : void 0;
3014
+ const { fields: s } = Ae(), o = !se(i) && i ? We(i, s) : void 0;
3020
3015
  return /* @__PURE__ */ n(
3021
3016
  "div",
3022
3017
  {
@@ -3024,23 +3019,23 @@ function ki({
3024
3019
  className: "flex flex-row w-full cursor-pointer",
3025
3020
  children: [
3026
3021
  /* @__PURE__ */ n("div", { className: "relative m-4", children: [
3027
- o && /* @__PURE__ */ e(Je, { propertyConfig: o }),
3022
+ o && /* @__PURE__ */ e(Ze, { propertyConfig: o }),
3028
3023
  !o && /* @__PURE__ */ e(
3029
3024
  "div",
3030
3025
  {
3031
3026
  className: "h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",
3032
- children: /* @__PURE__ */ e(Aa, { color: "inherit", size: "medium" })
3027
+ children: /* @__PURE__ */ e(za, { color: "inherit", size: "medium" })
3033
3028
  }
3034
3029
  ),
3035
- /* @__PURE__ */ e(Zt, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
3030
+ /* @__PURE__ */ e(Ta, { color: "disabled", size: "small", className: "absolute -right-2 -top-2" })
3036
3031
  ] }),
3037
3032
  /* @__PURE__ */ e(
3038
- Pe,
3033
+ Se,
3039
3034
  {
3040
- className: _e(
3035
+ className: xe(
3041
3036
  "pl-2 w-full flex flex-row gap-4 items-center",
3042
3037
  Ht,
3043
- r ? Gt : "",
3038
+ r ? Jt : "",
3044
3039
  a ? Qt : "",
3045
3040
  "flex-grow p-4 border transition-colors duration-200",
3046
3041
  a ? "border-blue-500" : "border-transparent"
@@ -3066,7 +3061,7 @@ function ki({
3066
3061
  children: o?.name
3067
3062
  }
3068
3063
  ),
3069
- i && !le(i) && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3064
+ i && !se(i) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3070
3065
  P,
3071
3066
  {
3072
3067
  variant: "body2",
@@ -3075,7 +3070,7 @@ function ki({
3075
3070
  children: i.dataType
3076
3071
  }
3077
3072
  ) }),
3078
- i && le(i) && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3073
+ i && se(i) && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3079
3074
  P,
3080
3075
  {
3081
3076
  variant: "body2",
@@ -3084,7 +3079,7 @@ function ki({
3084
3079
  children: "This property is defined as a property builder in code"
3085
3080
  }
3086
3081
  ) }),
3087
- !i && /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3082
+ !i && /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3088
3083
  P,
3089
3084
  {
3090
3085
  variant: "body2",
@@ -3101,7 +3096,7 @@ function ki({
3101
3096
  }
3102
3097
  );
3103
3098
  }
3104
- function mt({
3099
+ function gt({
3105
3100
  namespace: t,
3106
3101
  selectedPropertyKey: a,
3107
3102
  onPropertyClick: r,
@@ -3115,13 +3110,13 @@ function mt({
3115
3110
  inferredPropertyKeys: c,
3116
3111
  collectionEditable: p
3117
3112
  }) {
3118
- const g = s ?? Object.keys(i), f = Q((y) => {
3113
+ const g = s ?? Object.keys(i), f = J((y) => {
3119
3114
  if (!y.destination)
3120
3115
  return;
3121
3116
  const k = y.source.index, _ = y.destination.index, O = Array.from(g), [h] = O.splice(k, 1);
3122
3117
  O.splice(_, 0, h), d && d(O, t);
3123
3118
  }, [t, d, g]);
3124
- return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(Xa, { onDragEnd: f, children: /* @__PURE__ */ e(ei, { droppableId: `droppable_${t}`, children: (y, k) => /* @__PURE__ */ n(
3119
+ return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(ii, { onDragEnd: f, children: /* @__PURE__ */ e(ri, { droppableId: `droppable_${t}`, children: (y, k) => /* @__PURE__ */ n(
3125
3120
  "div",
3126
3121
  {
3127
3122
  ...y.droppableProps,
@@ -3129,14 +3124,14 @@ function mt({
3129
3124
  className: u,
3130
3125
  children: [
3131
3126
  g && g.map((_, O) => {
3132
- const h = i[_], w = o?.find((b) => b.id === _);
3127
+ const h = i[_], w = o?.find((b) => b.key === _);
3133
3128
  return !h && !w ? (console.warn(`Property ${_} not found in properties or additionalFields`), null) : /* @__PURE__ */ e(
3134
- ti,
3129
+ oi,
3135
3130
  {
3136
3131
  draggableId: `array_field_${t}_${_}}`,
3137
3132
  index: O,
3138
- children: (b, v) => /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
3139
- xi,
3133
+ children: (b, v) => /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
3134
+ Ai,
3140
3135
  {
3141
3136
  propertyKey: _,
3142
3137
  propertyOrBuilder: h,
@@ -3161,7 +3156,7 @@ function mt({
3161
3156
  }
3162
3157
  ) }) }) });
3163
3158
  }
3164
- function xi({
3159
+ function Ai({
3165
3160
  propertyKey: t,
3166
3161
  namespace: a,
3167
3162
  propertyOrBuilder: r,
@@ -3175,12 +3170,12 @@ function xi({
3175
3170
  inferredPropertyKeys: c,
3176
3171
  collectionEditable: p
3177
3172
  }) {
3178
- const g = c?.includes(a ? `${a}.${t}` : t), f = se(t, a);
3173
+ const g = c?.includes(a ? `${a}.${t}` : t), f = ne(t, a);
3179
3174
  let y;
3180
3175
  if (typeof r == "object") {
3181
3176
  const h = r;
3182
3177
  h.dataType === "map" && h.properties && (y = /* @__PURE__ */ e(
3183
- mt,
3178
+ gt,
3184
3179
  {
3185
3180
  selectedPropertyKey: o,
3186
3181
  namespace: f,
@@ -3194,7 +3189,7 @@ function xi({
3194
3189
  }
3195
3190
  ));
3196
3191
  }
3197
- const k = f ? N(l, we(f)) : !1, _ = o === f, O = r && (p && !le(r) || Le(r));
3192
+ const k = f ? N(l, ke(f)) : !1, _ = o === f, O = r && (p && !se(r) || He(r));
3198
3193
  return /* @__PURE__ */ n(
3199
3194
  "div",
3200
3195
  {
@@ -3206,7 +3201,7 @@ function xi({
3206
3201
  y && /* @__PURE__ */ e(
3207
3202
  "div",
3208
3203
  {
3209
- className: "absolute border-l " + xt,
3204
+ className: "absolute border-l " + Ct,
3210
3205
  style: {
3211
3206
  left: "32px",
3212
3207
  top: "64px",
@@ -3214,7 +3209,7 @@ function xi({
3214
3209
  }
3215
3210
  }
3216
3211
  ),
3217
- !le(r) && !i && O ? /* @__PURE__ */ e(
3212
+ !se(r) && !i && O ? /* @__PURE__ */ e(
3218
3213
  ra,
3219
3214
  {
3220
3215
  property: r,
@@ -3224,7 +3219,7 @@ function xi({
3224
3219
  hasError: k
3225
3220
  }
3226
3221
  ) : /* @__PURE__ */ e(
3227
- ki,
3222
+ qi,
3228
3223
  {
3229
3224
  name: t,
3230
3225
  property: r,
@@ -3233,22 +3228,22 @@ function xi({
3233
3228
  }
3234
3229
  ),
3235
3230
  /* @__PURE__ */ n("div", { className: "absolute top-2 right-2 flex flex-row ", children: [
3236
- g && /* @__PURE__ */ e(ae, { title: "Inferred property", children: /* @__PURE__ */ e(pt, { size: "small", className: "p-2" }) }),
3231
+ g && /* @__PURE__ */ e(ae, { title: "Inferred property", children: /* @__PURE__ */ e(ht, { size: "small", className: "p-2" }) }),
3237
3232
  u && /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
3238
- me,
3233
+ re,
3239
3234
  {
3240
3235
  size: "small",
3241
3236
  color: "inherit",
3242
3237
  onClick: () => u(t, a),
3243
- children: /* @__PURE__ */ e(za, { size: "small" })
3238
+ children: /* @__PURE__ */ e(Va, { size: "small" })
3244
3239
  }
3245
3240
  ) }),
3246
3241
  m && /* @__PURE__ */ e(ae, { title: "Move", children: /* @__PURE__ */ e(
3247
- me,
3242
+ re,
3248
3243
  {
3249
3244
  component: "span",
3250
3245
  size: "small",
3251
- children: /* @__PURE__ */ e(Ta, { size: "small" })
3246
+ children: /* @__PURE__ */ e(ja, { size: "small" })
3252
3247
  }
3253
3248
  ) })
3254
3249
  ] }),
@@ -3257,11 +3252,11 @@ function xi({
3257
3252
  }
3258
3253
  );
3259
3254
  }
3260
- function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, collectionEditable: s }) {
3255
+ function zi({ disabled: t, getData: a, allowDataInference: r, customFields: i, collectionEditable: s }) {
3261
3256
  const {
3262
3257
  values: o,
3263
3258
  setFieldValue: l
3264
- } = L(), [d, m] = Y(!1), [u, c] = Y(), [p, g] = Y(), f = o.propertiesOrder ?? Object.keys(o.properties ?? {}), y = Q(({
3259
+ } = K(), [d, m] = L(!1), [u, c] = L(), [p, g] = L(), f = o.propertiesOrder ?? Object.keys(o.properties ?? {}), y = J(({
3265
3260
  id: v,
3266
3261
  property: T
3267
3262
  }) => {
@@ -3271,26 +3266,26 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
3271
3266
  ...o.properties ?? {},
3272
3267
  [v]: T
3273
3268
  }, !1), l("propertiesOrder", [...f, v], !1), m(!1);
3274
- }, [o.properties, f]), k = Q((v, T) => {
3275
- const I = v ? se(v, T) : void 0;
3276
- if (!I)
3269
+ }, [o.properties, f]), k = J((v, T) => {
3270
+ const F = v ? ne(v, T) : void 0;
3271
+ if (!F)
3277
3272
  throw Error("collection editor miss config");
3278
- const A = we(I), S = Oe(T), x = N(o, S) ?? Object.keys(N(o, hi(T)));
3273
+ const A = ke(F), S = Ne(T), x = N(o, S) ?? Object.keys(N(o, _i(T)));
3279
3274
  l(A, void 0, !1), l(S, x.filter((C) => C !== v), !1), m(!1), c(void 0), g(void 0);
3280
- }, [l, o]), _ = u ? se(u, p) : void 0, O = _ ? N(o.properties, _.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ n(
3275
+ }, [l, o]), _ = u ? ne(u, p) : void 0, O = _ ? N(o.properties, _.replaceAll(".", ".properties.")) : void 0, h = /* @__PURE__ */ n(
3281
3276
  E,
3282
3277
  {
3283
3278
  color: "primary",
3284
3279
  variant: "outlined",
3285
3280
  onClick: () => m(!0),
3286
- startIcon: /* @__PURE__ */ e(Ne, {}),
3281
+ startIcon: /* @__PURE__ */ e(qe, {}),
3287
3282
  children: [
3288
3283
  "Add property to ",
3289
3284
  o.name ?? "this group"
3290
3285
  ]
3291
3286
  }
3292
- ), w = !f || f.length < 1, b = Q((v, T) => {
3293
- l(Oe(T), v, !1);
3287
+ ), w = !f || f.length < 1, b = J((v, T) => {
3288
+ l(Ne(T), v, !1);
3294
3289
  }, []);
3295
3290
  return /* @__PURE__ */ n(B, { children: [
3296
3291
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
@@ -3298,9 +3293,9 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
3298
3293
  /* @__PURE__ */ e(P, { variant: "subtitle2", children: "Properties in this group" }),
3299
3294
  h
3300
3295
  ] }),
3301
- /* @__PURE__ */ n(Pe, { className: "p-2 pl-8", children: [
3296
+ /* @__PURE__ */ n(Se, { className: "p-2 pl-8", children: [
3302
3297
  /* @__PURE__ */ e(
3303
- mt,
3298
+ gt,
3304
3299
  {
3305
3300
  properties: o.properties ?? {},
3306
3301
  propertiesOrder: f,
@@ -3324,7 +3319,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
3324
3319
  ] }),
3325
3320
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3326
3321
  /* @__PURE__ */ e(
3327
- Kt,
3322
+ Yt,
3328
3323
  {
3329
3324
  position: "start",
3330
3325
  size: "small",
@@ -3333,7 +3328,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
3333
3328
  value: o.spreadChildren ?? !1
3334
3329
  }
3335
3330
  ),
3336
- /* @__PURE__ */ e(ee, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
3331
+ /* @__PURE__ */ e(te, { children: "Set this flag to true if you want to display the children of this group as individual columns." })
3337
3332
  ] }),
3338
3333
  /* @__PURE__ */ e(
3339
3334
  Fe,
@@ -3364,7 +3359,7 @@ function Ci({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
3364
3359
  )
3365
3360
  ] });
3366
3361
  }
3367
- function Oi({
3362
+ function Ti({
3368
3363
  showErrors: t,
3369
3364
  existing: a,
3370
3365
  disabled: r,
@@ -3373,25 +3368,25 @@ function Oi({
3373
3368
  customFields: o,
3374
3369
  collectionEditable: l
3375
3370
  }) {
3376
- const { fields: d } = qe(), {
3371
+ const { fields: d } = Ae(), {
3377
3372
  values: m,
3378
3373
  handleChange: u,
3379
3374
  errors: c,
3380
3375
  setFieldValue: p,
3381
3376
  touched: g
3382
- } = L(), [f, y] = Y(!1), k = N(m, "of"), _ = N(g, "of") && N(c, "of"), O = Q(({ id: w, property: b, namespace: v }) => {
3377
+ } = K(), [f, y] = L(!1), k = N(m, "of"), _ = N(g, "of") && N(c, "of"), O = J(({ id: w, property: b, namespace: v }) => {
3383
3378
  p("of", b);
3384
- }, []), h = k && Ze(k, d);
3379
+ }, []), h = k && We(k, d);
3385
3380
  return /* @__PURE__ */ n(B, { children: [
3386
3381
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
3387
3382
  /* @__PURE__ */ e(P, { variant: "subtitle2", children: "Repeat component" }),
3388
3383
  /* @__PURE__ */ e(
3389
- ge,
3384
+ be,
3390
3385
  {
3391
3386
  name: "of",
3392
3387
  value: k,
3393
3388
  validate: (w) => w?.dataType ? void 0 : "You need to specify a repeat field",
3394
- children: () => /* @__PURE__ */ n(Pe, { className: "p-2 mt-4", children: [
3389
+ children: () => /* @__PURE__ */ n(Se, { className: "p-2 mt-4", children: [
3395
3390
  k && /* @__PURE__ */ e(
3396
3391
  ra,
3397
3392
  {
@@ -3439,10 +3434,10 @@ function Oi({
3439
3434
  }
3440
3435
  )
3441
3436
  ] }),
3442
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Nt, { disabled: r }) }) })
3437
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(St, { disabled: r }) }) })
3443
3438
  ] });
3444
3439
  }
3445
- const Pi = R.forwardRef(
3440
+ const Vi = D.forwardRef(
3446
3441
  function({
3447
3442
  showErrors: a,
3448
3443
  disabledId: r,
@@ -3452,75 +3447,75 @@ const Pi = R.forwardRef(
3452
3447
  }, l) {
3453
3448
  const {
3454
3449
  errors: d
3455
- } = L(), m = "name", u = a && N(d, m), c = "id", p = a && N(d, c), g = "description", f = a && N(d, g);
3450
+ } = K(), m = "name", u = a && N(d, m), c = "id", p = a && N(d, c), g = "description", f = a && N(d, g);
3456
3451
  return /* @__PURE__ */ n("div", { className: "flex flex-col gap-2 col-span-12", children: [
3457
3452
  /* @__PURE__ */ n("div", { children: [
3458
3453
  /* @__PURE__ */ e(
3459
- ge,
3454
+ be,
3460
3455
  {
3461
3456
  inputRef: l,
3462
3457
  name: m,
3463
- as: G,
3458
+ as: H,
3464
3459
  style: { fontSize: 20 },
3465
- validate: qi,
3460
+ validate: Ii,
3466
3461
  placeholder: "Field name",
3467
3462
  required: !0,
3468
3463
  disabled: s,
3469
3464
  error: !!u
3470
3465
  }
3471
3466
  ),
3472
- /* @__PURE__ */ e(ee, { error: !!u, children: u })
3467
+ /* @__PURE__ */ e(te, { error: !!u, children: u })
3473
3468
  ] }),
3474
3469
  /* @__PURE__ */ n("div", { children: [
3475
3470
  /* @__PURE__ */ e(
3476
- ge,
3471
+ be,
3477
3472
  {
3478
3473
  name: c,
3479
3474
  as: Ve,
3480
3475
  label: "ID",
3481
- validate: (y) => Si(y, i),
3476
+ validate: (y) => Fi(y, i),
3482
3477
  disabled: r || s,
3483
3478
  required: !0,
3484
3479
  size: "small",
3485
3480
  error: !!p
3486
3481
  }
3487
3482
  ),
3488
- /* @__PURE__ */ e(ee, { error: !!p, children: p })
3483
+ /* @__PURE__ */ e(te, { error: !!p, children: p })
3489
3484
  ] }),
3490
3485
  /* @__PURE__ */ n("div", { children: [
3491
3486
  /* @__PURE__ */ e(
3492
- ge,
3487
+ be,
3493
3488
  {
3494
3489
  name: g,
3495
- as: G,
3490
+ as: H,
3496
3491
  label: "Description",
3497
3492
  disabled: s,
3498
3493
  error: !!f
3499
3494
  }
3500
3495
  ),
3501
- /* @__PURE__ */ e(ee, { error: !!f, children: f })
3496
+ /* @__PURE__ */ e(te, { error: !!f, children: f })
3502
3497
  ] })
3503
3498
  ] });
3504
3499
  }
3505
- ), Ni = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
3506
- function Si(t, a) {
3500
+ ), ji = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
3501
+ function Fi(t, a) {
3507
3502
  let r;
3508
- return t || (r = "You must specify an id for the field"), t && !t.match(Ni) && (r = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && a && a.includes(t) && (r = "There is another field with this ID already"), r;
3503
+ return t || (r = "You must specify an id for the field"), t && !t.match(ji) && (r = "The id can only contain letters, numbers and underscores (_), and not start with a number"), t && a && a.includes(t) && (r = "There is another field with this ID already"), r;
3509
3504
  }
3510
- function qi(t) {
3505
+ function Ii(t) {
3511
3506
  let a;
3512
3507
  return t || (a = "You must specify a title for the field"), a;
3513
3508
  }
3514
- function Ai({
3509
+ function Ei({
3515
3510
  widgetId: t,
3516
3511
  disabled: a,
3517
3512
  showErrors: r
3518
3513
  }) {
3519
- const { values: i, setFieldValue: s } = L();
3514
+ const { values: i, setFieldValue: s } = K();
3520
3515
  return /* @__PURE__ */ n(B, { children: [
3521
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(Ae, { children: [
3516
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ n(ze, { children: [
3522
3517
  t === "text_field" && /* @__PURE__ */ e(
3523
- Be,
3518
+ Me,
3524
3519
  {
3525
3520
  disabled: a,
3526
3521
  length: !0,
@@ -3534,7 +3529,7 @@ function Ai({
3534
3529
  }
3535
3530
  ),
3536
3531
  t === "multiline" && /* @__PURE__ */ e(
3537
- Be,
3532
+ Me,
3538
3533
  {
3539
3534
  disabled: a,
3540
3535
  length: !0,
@@ -3547,7 +3542,7 @@ function Ai({
3547
3542
  }
3548
3543
  ),
3549
3544
  t === "markdown" && /* @__PURE__ */ e(
3550
- Be,
3545
+ Me,
3551
3546
  {
3552
3547
  disabled: a,
3553
3548
  length: !0,
@@ -3560,7 +3555,7 @@ function Ai({
3560
3555
  }
3561
3556
  ),
3562
3557
  t === "url" && /* @__PURE__ */ e(
3563
- Be,
3558
+ Me,
3564
3559
  {
3565
3560
  disabled: a,
3566
3561
  max: !0,
@@ -3570,7 +3565,7 @@ function Ai({
3570
3565
  }
3571
3566
  ),
3572
3567
  t === "email" && /* @__PURE__ */ e(
3573
- Be,
3568
+ Me,
3574
3569
  {
3575
3570
  disabled: a,
3576
3571
  max: !0,
@@ -3594,12 +3589,12 @@ function Ai({
3594
3589
  ) })
3595
3590
  ] });
3596
3591
  }
3597
- function zi({ disabled: t }) {
3598
- const { values: a } = L(), r = N(a, "defaultValue");
3592
+ function Bi({ disabled: t }) {
3593
+ const { values: a } = K(), r = N(a, "defaultValue");
3599
3594
  return /* @__PURE__ */ n(B, { children: [
3600
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Ie, { disabled: t }) }) }),
3595
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }),
3601
3596
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3602
- ce,
3597
+ le,
3603
3598
  {
3604
3599
  type: "checkbox",
3605
3600
  name: "defaultValue",
@@ -3611,11 +3606,11 @@ function zi({ disabled: t }) {
3611
3606
  ) })
3612
3607
  ] });
3613
3608
  }
3614
- function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i, collectionEditable: s }) {
3609
+ function Mi({ disabled: t, getData: a, allowDataInference: r, customFields: i, collectionEditable: s }) {
3615
3610
  const {
3616
3611
  values: o,
3617
3612
  setFieldValue: l
3618
- } = L(), [d, m] = Y(!1), [u, c] = Y(), [p, g] = Y(), f = Q(({
3613
+ } = K(), [d, m] = L(!1), [u, c] = L(), [p, g] = L(), f = J(({
3619
3614
  id: w,
3620
3615
  property: b
3621
3616
  }) => {
@@ -3625,27 +3620,27 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
3625
3620
  ...o.oneOf?.properties ?? {},
3626
3621
  [w]: b
3627
3622
  }, !1), l("oneOf.propertiesOrder", [...o.oneOf?.propertiesOrder ?? Object.keys(o.oneOf?.properties ?? {}), w], !1), m(!1);
3628
- }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ? se(u, p) : void 0, k = y ? N(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, _ = Q((w, b) => {
3629
- const v = w ? se(w, b) : void 0;
3623
+ }, [o.oneOf?.properties, o.oneOf?.propertiesOrder]), y = u ? ne(u, p) : void 0, k = y ? N(o.oneOf?.properties, y.replaceAll(".", ".properties.")) : void 0, _ = J((w, b) => {
3624
+ const v = w ? ne(w, b) : void 0;
3630
3625
  if (!v)
3631
3626
  throw Error("collection editor miss config");
3632
- l(`oneOf.${we(v)}`, void 0, !1);
3633
- const T = `oneOf.${Oe(b)}`, I = N(o, T);
3634
- l(T, I.filter((A) => A !== w), !1), m(!1), c(void 0), g(void 0);
3627
+ l(`oneOf.${ke(v)}`, void 0, !1);
3628
+ const T = `oneOf.${Ne(b)}`, F = N(o, T);
3629
+ l(T, F.filter((A) => A !== w), !1), m(!1), c(void 0), g(void 0);
3635
3630
  }, [l, o]), O = /* @__PURE__ */ n(
3636
3631
  E,
3637
3632
  {
3638
3633
  autoFocus: !0,
3639
3634
  color: "primary",
3640
3635
  onClick: () => m(!0),
3641
- startIcon: /* @__PURE__ */ e(Ne, {}),
3636
+ startIcon: /* @__PURE__ */ e(qe, {}),
3642
3637
  children: [
3643
3638
  "Add property to ",
3644
3639
  o.name ?? "this block"
3645
3640
  ]
3646
3641
  }
3647
- ), h = Q((w, b) => {
3648
- l(`oneOf.${Oe(b)}`, w, !1);
3642
+ ), h = J((w, b) => {
3643
+ l(`oneOf.${Ne(b)}`, w, !1);
3649
3644
  }, []);
3650
3645
  return /* @__PURE__ */ n(B, { children: [
3651
3646
  /* @__PURE__ */ n("div", { className: "col-span-12", children: [
@@ -3653,9 +3648,9 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
3653
3648
  /* @__PURE__ */ e(P, { variant: "subtitle2", children: "Properties in this block" }),
3654
3649
  O
3655
3650
  ] }),
3656
- /* @__PURE__ */ n(Pe, { className: "p-2 pl-8", children: [
3651
+ /* @__PURE__ */ n(Se, { className: "p-2 pl-8", children: [
3657
3652
  /* @__PURE__ */ e(
3658
- mt,
3653
+ gt,
3659
3654
  {
3660
3655
  properties: o.oneOf?.properties ?? {},
3661
3656
  propertiesOrder: o.oneOf?.propertiesOrder,
@@ -3699,15 +3694,15 @@ function Ti({ disabled: t, getData: a, allowDataInference: r, customFields: i, c
3699
3694
  )
3700
3695
  ] });
3701
3696
  }
3702
- function Vi({ disabled: t }) {
3697
+ function Di({ disabled: t }) {
3703
3698
  const {
3704
3699
  values: a,
3705
3700
  handleChange: r
3706
- } = L(), i = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", d = "validation.positive", m = "validation.negative", u = "validation.integer";
3701
+ } = K(), i = "validation.min", s = "validation.max", o = "validation.lessThan", l = "validation.moreThan", d = "validation.positive", m = "validation.negative", u = "validation.integer";
3707
3702
  return /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
3708
- /* @__PURE__ */ e(Ie, { disabled: t }),
3703
+ /* @__PURE__ */ e(Ee, { disabled: t }),
3709
3704
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3710
- G,
3705
+ H,
3711
3706
  {
3712
3707
  value: N(a, i),
3713
3708
  label: "Min value",
@@ -3719,7 +3714,7 @@ function Vi({ disabled: t }) {
3719
3714
  }
3720
3715
  ) }),
3721
3716
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3722
- G,
3717
+ H,
3723
3718
  {
3724
3719
  value: N(a, s),
3725
3720
  label: "Max value",
@@ -3731,7 +3726,7 @@ function Vi({ disabled: t }) {
3731
3726
  }
3732
3727
  ) }),
3733
3728
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3734
- G,
3729
+ H,
3735
3730
  {
3736
3731
  value: N(a, o),
3737
3732
  label: "Less than",
@@ -3743,7 +3738,7 @@ function Vi({ disabled: t }) {
3743
3738
  }
3744
3739
  ) }),
3745
3740
  /* @__PURE__ */ e("div", { className: "col-span-6", children: /* @__PURE__ */ e(
3746
- G,
3741
+ H,
3747
3742
  {
3748
3743
  value: N(a, l),
3749
3744
  label: "More than",
@@ -3755,7 +3750,7 @@ function Vi({ disabled: t }) {
3755
3750
  }
3756
3751
  ) }),
3757
3752
  /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
3758
- ce,
3753
+ le,
3759
3754
  {
3760
3755
  type: "checkbox",
3761
3756
  name: d,
@@ -3765,7 +3760,7 @@ function Vi({ disabled: t }) {
3765
3760
  }
3766
3761
  ) }),
3767
3762
  /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
3768
- ce,
3763
+ le,
3769
3764
  {
3770
3765
  type: "checkbox",
3771
3766
  name: m,
@@ -3775,7 +3770,7 @@ function Vi({ disabled: t }) {
3775
3770
  }
3776
3771
  ) }),
3777
3772
  /* @__PURE__ */ e("div", { className: "col-span-4", children: /* @__PURE__ */ e(
3778
- ce,
3773
+ le,
3779
3774
  {
3780
3775
  type: "checkbox",
3781
3776
  name: u,
@@ -3786,10 +3781,10 @@ function Vi({ disabled: t }) {
3786
3781
  ) })
3787
3782
  ] });
3788
3783
  }
3789
- function ji({ disabled: t }) {
3790
- const { values: a, setFieldValue: r } = L();
3784
+ function Ri({ disabled: t }) {
3785
+ const { values: a, setFieldValue: r } = K();
3791
3786
  return /* @__PURE__ */ n(B, { children: [
3792
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Vi, { disabled: t }) }) }),
3787
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Di, { disabled: t }) }) }),
3793
3788
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3794
3789
  Ve,
3795
3790
  {
@@ -3805,7 +3800,7 @@ function ji({ disabled: t }) {
3805
3800
  ) })
3806
3801
  ] });
3807
3802
  }
3808
- function Et({
3803
+ function Bt({
3809
3804
  existing: t,
3810
3805
  multiple: a,
3811
3806
  disabled: r,
@@ -3818,31 +3813,31 @@ function Et({
3818
3813
  touched: d,
3819
3814
  setFieldError: m,
3820
3815
  setFieldValue: u
3821
- } = L();
3822
- if (!De())
3823
- return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ye, {}) });
3816
+ } = K();
3817
+ if (!$e())
3818
+ return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Qe, {}) });
3824
3819
  const p = a ? "of.path" : "path", g = N(s, p), f = i && N(l, p);
3825
3820
  return console.log("pathError", l, f), /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
3826
- ge,
3821
+ be,
3827
3822
  {
3828
3823
  required: !0,
3829
3824
  name: p,
3830
3825
  pathPath: p,
3831
3826
  type: "select",
3832
- validate: Fi,
3827
+ validate: Ui,
3833
3828
  disabled: t || r,
3834
3829
  value: g,
3835
3830
  error: f,
3836
3831
  handleChange: o,
3837
- component: Ii
3832
+ component: $i
3838
3833
  }
3839
3834
  ) }) });
3840
3835
  }
3841
- function Fi(t) {
3836
+ function Ui(t) {
3842
3837
  let a;
3843
3838
  return t || (a = "You must specify a target collection for the field"), a;
3844
3839
  }
3845
- function Ii({
3840
+ function $i({
3846
3841
  disabled: t,
3847
3842
  pathPath: a,
3848
3843
  value: r,
@@ -3851,9 +3846,9 @@ function Ii({
3851
3846
  ...o
3852
3847
  }) {
3853
3848
  console.log("error", s);
3854
- const l = De();
3849
+ const l = $e();
3855
3850
  if (!l)
3856
- return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ye, {}) });
3851
+ return /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Qe, {}) });
3857
3852
  const d = l?.collections ?? [], m = Array.from(new Set(
3858
3853
  Object.values(d).map((c) => c.group).filter(Boolean)
3859
3854
  ).values()), u = d.filter((c) => !c.group);
@@ -3872,7 +3867,7 @@ function Ii({
3872
3867
  const p = d.find((f) => f.alias === c || f.path === c);
3873
3868
  if (!p)
3874
3869
  return null;
3875
- const g = ot(p);
3870
+ const g = lt(p);
3876
3871
  return /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
3877
3872
  g,
3878
3873
  /* @__PURE__ */ e(
@@ -3888,13 +3883,13 @@ function Ii({
3888
3883
  ...o,
3889
3884
  children: [
3890
3885
  m.flatMap((c) => /* @__PURE__ */ e(
3891
- At,
3886
+ zt,
3892
3887
  {
3893
3888
  label: c || "Views",
3894
3889
  children: d.filter((p) => p.group === c).map((p) => {
3895
- const g = ot(p);
3890
+ const g = lt(p);
3896
3891
  return /* @__PURE__ */ e(
3897
- ye,
3892
+ we,
3898
3893
  {
3899
3894
  value: p.alias ?? p.path,
3900
3895
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
@@ -3915,10 +3910,10 @@ function Ii({
3915
3910
  },
3916
3911
  `group_${c}`
3917
3912
  )),
3918
- u && /* @__PURE__ */ e(At, { label: "Views", children: u.map((c) => {
3919
- const p = ot(c);
3913
+ u && /* @__PURE__ */ e(zt, { label: "Views", children: u.map((c) => {
3914
+ const p = lt(c);
3920
3915
  return /* @__PURE__ */ e(
3921
- ye,
3916
+ we,
3922
3917
  {
3923
3918
  value: c.alias ?? c.path,
3924
3919
  children: /* @__PURE__ */ n("div", { className: "flex flex-row", children: [
@@ -3939,16 +3934,16 @@ function Ii({
3939
3934
  ]
3940
3935
  }
3941
3936
  ),
3942
- /* @__PURE__ */ e(ee, { children: "You can only edit the reference collection upon field creation." })
3937
+ /* @__PURE__ */ e(te, { children: "You can only edit the reference collection upon field creation." })
3943
3938
  ] });
3944
3939
  }
3945
- function Ei({ disabled: t }) {
3940
+ function Li({ disabled: t }) {
3946
3941
  const {
3947
3942
  values: a,
3948
3943
  errors: r,
3949
3944
  touched: i,
3950
3945
  setFieldValue: s
3951
- } = L(), o = "mode", l = N(a, o), d = N(i, o) && N(r, o), m = "autoValue", u = N(a, m), c = N(i, m) && N(r, m);
3946
+ } = K(), o = "mode", l = N(a, o), d = N(i, o) && N(r, o), m = "autoValue", u = N(a, m), c = N(i, m) && N(r, m);
3952
3947
  return /* @__PURE__ */ n(B, { children: [
3953
3948
  /* @__PURE__ */ n("div", { className: "flex flex-col col-span-12", children: [
3954
3949
  /* @__PURE__ */ n(
@@ -3971,12 +3966,12 @@ function Ei({ disabled: t }) {
3971
3966
  },
3972
3967
  disabled: t,
3973
3968
  children: [
3974
- /* @__PURE__ */ e(ye, { value: "date_time", children: " Date/Time " }),
3975
- /* @__PURE__ */ e(ye, { value: "date", children: " Date " })
3969
+ /* @__PURE__ */ e(we, { value: "date_time", children: " Date/Time " }),
3970
+ /* @__PURE__ */ e(we, { value: "date", children: " Date " })
3976
3971
  ]
3977
3972
  }
3978
3973
  ),
3979
- /* @__PURE__ */ e(ee, { error: !!d, children: d }),
3974
+ /* @__PURE__ */ e(te, { error: !!d, children: d }),
3980
3975
  /* @__PURE__ */ n(
3981
3976
  je,
3982
3977
  {
@@ -3997,21 +3992,21 @@ function Ei({ disabled: t }) {
3997
3992
  error: !!c,
3998
3993
  label: "Automatic value",
3999
3994
  children: [
4000
- /* @__PURE__ */ e(ye, { value: "", children: " None " }),
4001
- /* @__PURE__ */ e(ye, { value: "on_create", children: " On create " }),
4002
- /* @__PURE__ */ e(ye, { value: "on_update", children: " On any update " })
3995
+ /* @__PURE__ */ e(we, { value: "", children: " None " }),
3996
+ /* @__PURE__ */ e(we, { value: "on_create", children: " On create " }),
3997
+ /* @__PURE__ */ e(we, { value: "on_update", children: " On any update " })
4003
3998
  ]
4004
3999
  }
4005
4000
  ),
4006
- /* @__PURE__ */ e(ee, { error: !!c, children: c ?? "Update this field automatically when creating or updating the entity" })
4001
+ /* @__PURE__ */ e(te, { error: !!c, children: c ?? "Update this field automatically when creating or updating the entity" })
4007
4002
  ] }),
4008
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Ie, { disabled: t }) }) })
4003
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) })
4009
4004
  ] });
4010
4005
  }
4011
- function Bi({ disabled: t }) {
4012
- return L(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
4006
+ function Ki({ disabled: t }) {
4007
+ return K(), /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2", children: [
4013
4008
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
4014
- ce,
4009
+ le,
4015
4010
  {
4016
4011
  type: "checkbox",
4017
4012
  name: "hideFromCollection",
@@ -4022,7 +4017,7 @@ function Bi({ disabled: t }) {
4022
4017
  }
4023
4018
  ) }),
4024
4019
  /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(
4025
- ce,
4020
+ le,
4026
4021
  {
4027
4022
  type: "checkbox",
4028
4023
  name: "readOnly",
@@ -4034,8 +4029,8 @@ function Bi({ disabled: t }) {
4034
4029
  ) })
4035
4030
  ] });
4036
4031
  }
4037
- function Mi({ disabled: t }) {
4038
- return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(Ie, { disabled: t }) }) }) });
4032
+ function Yi({ disabled: t }) {
4033
+ return /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(Ee, { disabled: t }) }) }) });
4039
4034
  }
4040
4035
  function oa(t, a, r) {
4041
4036
  let i;
@@ -4248,7 +4243,7 @@ function oa(t, a, r) {
4248
4243
  }
4249
4244
  function na({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
4250
4245
  return /* @__PURE__ */ e(
4251
- ye,
4246
+ we,
4252
4247
  {
4253
4248
  value: t,
4254
4249
  disabled: a,
@@ -4256,12 +4251,12 @@ function na({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
4256
4251
  children: /* @__PURE__ */ n(
4257
4252
  "div",
4258
4253
  {
4259
- className: _e(
4254
+ className: xe(
4260
4255
  "flex flex-row items-center text-base min-h-[52px]",
4261
4256
  a ? "w-full" : ""
4262
4257
  ),
4263
4258
  children: [
4264
- /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Je, { propertyConfig: r }) }),
4259
+ /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ze, { propertyConfig: r }) }),
4265
4260
  /* @__PURE__ */ n("div", { children: [
4266
4261
  /* @__PURE__ */ e("div", { children: r.name }),
4267
4262
  /* @__PURE__ */ e(
@@ -4280,7 +4275,7 @@ function na({ value: t, optionDisabled: a, propertyConfig: r, existing: i }) {
4280
4275
  }
4281
4276
  );
4282
4277
  }
4283
- const sa = R.memo(
4278
+ const sa = D.memo(
4284
4279
  function({
4285
4280
  includeIdAndName: a = !0,
4286
4281
  autoOpenTypeSelect: r,
@@ -4306,9 +4301,9 @@ const sa = R.memo(
4306
4301
  const v = {
4307
4302
  id: "",
4308
4303
  name: ""
4309
- }, T = !!(m && !Le(m)) && !b;
4304
+ }, T = !!(m && !He(m)) && !b;
4310
4305
  console.log("PropertyForm disabled", T);
4311
- const I = $e(m ? {
4306
+ const F = Ge(m ? {
4312
4307
  id: l,
4313
4308
  previousId: l,
4314
4309
  property: m
@@ -4318,14 +4313,14 @@ const sa = R.memo(
4318
4313
  }) => {
4319
4314
  const C = {
4320
4315
  id: S,
4321
- previousId: I.current?.id,
4316
+ previousId: F.current?.id,
4322
4317
  property: x,
4323
4318
  namespace: d
4324
4319
  };
4325
- I.current = C, u?.(C);
4320
+ F.current = C, u?.(C);
4326
4321
  };
4327
4322
  return /* @__PURE__ */ e(
4328
- Ot,
4323
+ Pt,
4329
4324
  {
4330
4325
  initialErrors: f,
4331
4326
  initialValues: m ? { id: l, ...m } : v,
@@ -4340,10 +4335,10 @@ const sa = R.memo(
4340
4335
  property: { ...j, editable: j.editable ?? !0 }
4341
4336
  }), i || x.resetForm({ values: v });
4342
4337
  },
4343
- children: (S) => (pe(() => {
4338
+ children: (S) => (de(() => {
4344
4339
  O?.(S);
4345
4340
  }, [S]), /* @__PURE__ */ e(
4346
- Di,
4341
+ Gi,
4347
4342
  {
4348
4343
  onPropertyChanged: c ? A : void 0,
4349
4344
  onDelete: p,
@@ -4379,15 +4374,15 @@ function Fe({
4379
4374
  collectionEditable: o,
4380
4375
  ...l
4381
4376
  }) {
4382
- const d = $e();
4377
+ const d = Ge();
4383
4378
  return /* @__PURE__ */ n(
4384
- Me,
4379
+ Ie,
4385
4380
  {
4386
4381
  open: t ?? !1,
4387
4382
  maxWidth: "xl",
4388
4383
  fullWidth: !0,
4389
4384
  children: [
4390
- /* @__PURE__ */ e(He, { children: /* @__PURE__ */ e(
4385
+ /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
4391
4386
  sa,
4392
4387
  {
4393
4388
  ...l,
@@ -4402,7 +4397,7 @@ function Fe({
4402
4397
  getData: s
4403
4398
  }
4404
4399
  ) }),
4405
- /* @__PURE__ */ n(Ge, { children: [
4400
+ /* @__PURE__ */ n(Re, { children: [
4406
4401
  a && /* @__PURE__ */ e(
4407
4402
  E,
4408
4403
  {
@@ -4427,7 +4422,7 @@ function Fe({
4427
4422
  }
4428
4423
  );
4429
4424
  }
4430
- function Di({
4425
+ function Gi({
4431
4426
  values: t,
4432
4427
  errors: a,
4433
4428
  touched: r,
@@ -4450,39 +4445,39 @@ function Di({
4450
4445
  customFields: w,
4451
4446
  collectionEditable: b
4452
4447
  }) {
4453
- const [v, T] = Y(d), [I, A] = Y(!1), [S, x] = Y(t?.dataType ? Jt(t) : void 0), C = Object.entries(_t).concat(Object.entries(w)), j = k ? C.filter(([Z, te]) => !le(te.property) && te.property?.dataType !== "array") : C, J = ga(t), q = $e(null), U = $e(t), ie = "id", ke = f && N(a, "selectedWidget");
4454
- pe(() => {
4455
- !N(r, ie) && l && t?.name && s(ie, Yt(t.name));
4456
- }, [l, r, t?.name]), pe(() => {
4457
- if (u && (!m || J.id)) {
4448
+ const [v, T] = L(d), [F, A] = L(!1), [S, x] = L(t?.dataType ? Wt(t) : void 0), C = Object.entries(kt).concat(Object.entries(w)), j = k ? C.filter(([Q, ee]) => !se(ee.property) && ee.property?.dataType !== "array") : C, Z = fa(t), q = Ge(null), M = Ge(t), he = "id", Ce = f && N(a, "selectedWidget");
4449
+ de(() => {
4450
+ !N(r, he) && l && t?.name && s(he, Gt(t.name));
4451
+ }, [l, r, t?.name]), de(() => {
4452
+ if (u && (!m || Z.id)) {
4458
4453
  const {
4459
- id: Z,
4460
- ...te
4461
- } = J;
4462
- ct(J, U.current) || (u({
4463
- id: Z,
4464
- property: te,
4454
+ id: Q,
4455
+ ...ee
4456
+ } = Z;
4457
+ mt(Z, M.current) || (u({
4458
+ id: Q,
4459
+ property: ee,
4465
4460
  namespace: p
4466
- }), U.current = J);
4461
+ }), M.current = Z);
4467
4462
  }
4468
- }, [J, m, u, p]), pe(() => {
4463
+ }, [Z, m, u, p]), de(() => {
4469
4464
  t?.id && g && Object.keys(a).length > 0 && g(t?.id, p, a);
4470
4465
  }, [a, g, p, t?.id]);
4471
- const he = (Z) => {
4472
- x(Z), i(oa(t, Z, w)), setTimeout(() => {
4466
+ const ie = (Q) => {
4467
+ x(Q), i(oa(t, Q, w)), setTimeout(() => {
4473
4468
  q.current?.focus();
4474
4469
  }, 0);
4475
4470
  };
4476
- let M;
4477
- return S === "text_field" || S === "multiline" || S === "markdown" || S === "url" || S === "email" ? M = /* @__PURE__ */ e(
4478
- Ai,
4471
+ let R;
4472
+ return S === "text_field" || S === "multiline" || S === "markdown" || S === "url" || S === "email" ? R = /* @__PURE__ */ e(
4473
+ Ei,
4479
4474
  {
4480
4475
  widgetId: S,
4481
4476
  disabled: y,
4482
4477
  showErrors: f
4483
4478
  }
4484
- ) : S === "select" || S === "number_select" ? M = /* @__PURE__ */ e(
4485
- Ft,
4479
+ ) : S === "select" || S === "number_select" ? R = /* @__PURE__ */ e(
4480
+ It,
4486
4481
  {
4487
4482
  multiselect: !1,
4488
4483
  allowDataInference: h,
@@ -4491,8 +4486,8 @@ function Di({
4491
4486
  getData: O,
4492
4487
  showErrors: f
4493
4488
  }
4494
- ) : S === "multi_select" || S === "multi_number_select" ? M = /* @__PURE__ */ e(
4495
- Ft,
4489
+ ) : S === "multi_select" || S === "multi_number_select" ? R = /* @__PURE__ */ e(
4490
+ It,
4496
4491
  {
4497
4492
  multiselect: !0,
4498
4493
  updateIds: !o,
@@ -4501,22 +4496,22 @@ function Di({
4501
4496
  getData: O,
4502
4497
  showErrors: f
4503
4498
  }
4504
- ) : S === "file_upload" ? M = /* @__PURE__ */ e(
4505
- It,
4499
+ ) : S === "file_upload" ? R = /* @__PURE__ */ e(
4500
+ Et,
4506
4501
  {
4507
4502
  existing: o,
4508
4503
  multiple: !1,
4509
4504
  disabled: y
4510
4505
  }
4511
- ) : S === "multi_file_upload" ? M = /* @__PURE__ */ e(
4512
- It,
4506
+ ) : S === "multi_file_upload" ? R = /* @__PURE__ */ e(
4507
+ Et,
4513
4508
  {
4514
4509
  existing: o,
4515
4510
  multiple: !0,
4516
4511
  disabled: y
4517
4512
  }
4518
- ) : S === "switch" ? M = /* @__PURE__ */ e(zi, { disabled: y }) : S === "number_input" ? M = /* @__PURE__ */ e(ji, { disabled: y }) : S === "group" ? M = /* @__PURE__ */ e(
4519
- Ci,
4513
+ ) : S === "switch" ? R = /* @__PURE__ */ e(Bi, { disabled: y }) : S === "number_input" ? R = /* @__PURE__ */ e(Ri, { disabled: y }) : S === "group" ? R = /* @__PURE__ */ e(
4514
+ zi,
4520
4515
  {
4521
4516
  disabled: y,
4522
4517
  getData: O,
@@ -4524,8 +4519,8 @@ function Di({
4524
4519
  collectionEditable: b,
4525
4520
  customFields: w
4526
4521
  }
4527
- ) : S === "block" ? M = /* @__PURE__ */ e(
4528
- Ti,
4522
+ ) : S === "block" ? R = /* @__PURE__ */ e(
4523
+ Mi,
4529
4524
  {
4530
4525
  disabled: y,
4531
4526
  getData: O,
@@ -4533,24 +4528,24 @@ function Di({
4533
4528
  collectionEditable: b,
4534
4529
  customFields: w
4535
4530
  }
4536
- ) : S === "reference" ? M = /* @__PURE__ */ e(
4537
- Et,
4531
+ ) : S === "reference" ? R = /* @__PURE__ */ e(
4532
+ Bt,
4538
4533
  {
4539
4534
  showErrors: f,
4540
4535
  existing: o,
4541
4536
  multiple: !1,
4542
4537
  disabled: y
4543
4538
  }
4544
- ) : S === "date_time" ? M = /* @__PURE__ */ e(Ei, { disabled: y }) : S === "multi_references" ? M = /* @__PURE__ */ e(
4545
- Et,
4539
+ ) : S === "date_time" ? R = /* @__PURE__ */ e(Li, { disabled: y }) : S === "multi_references" ? R = /* @__PURE__ */ e(
4540
+ Bt,
4546
4541
  {
4547
4542
  showErrors: f,
4548
4543
  existing: o,
4549
4544
  multiple: !0,
4550
4545
  disabled: y
4551
4546
  }
4552
- ) : S === "repeat" ? M = /* @__PURE__ */ e(
4553
- Oi,
4547
+ ) : S === "repeat" ? R = /* @__PURE__ */ e(
4548
+ Ti,
4554
4549
  {
4555
4550
  showErrors: f,
4556
4551
  existing: o,
@@ -4560,8 +4555,8 @@ function Di({
4560
4555
  collectionEditable: b,
4561
4556
  customFields: w
4562
4557
  }
4563
- ) : S === "key_value" ? M = /* @__PURE__ */ e(Mi, { disabled: y }) : M = null, /* @__PURE__ */ n(B, { children: [
4564
- y && /* @__PURE__ */ n(Wt, { mode: "warn", children: [
4558
+ ) : S === "key_value" ? R = /* @__PURE__ */ e(Yi, { disabled: y }) : R = null, /* @__PURE__ */ n(B, { children: [
4559
+ y && /* @__PURE__ */ n(Zt, { mode: "warn", children: [
4565
4560
  /* @__PURE__ */ e(P, { children: "This property can't be edited" }),
4566
4561
  /* @__PURE__ */ n(P, { variant: "caption", children: [
4567
4562
  "You may not have permission to edit it or it is defined in code with no ",
@@ -4575,37 +4570,37 @@ function Di({
4575
4570
  je,
4576
4571
  {
4577
4572
  className: "w-full",
4578
- error: !!ke,
4573
+ error: !!Ce,
4579
4574
  value: S ?? "",
4580
4575
  placeholder: "Select a property widget",
4581
4576
  open: v,
4582
4577
  onOpenChange: T,
4583
4578
  position: "item-aligned",
4584
4579
  disabled: y,
4585
- renderValue: (Z) => {
4586
- if (!Z)
4580
+ renderValue: (Q) => {
4581
+ if (!Q)
4587
4582
  return /* @__PURE__ */ e("em", { children: "Select a property widget" });
4588
- const te = Z, re = _t[te] ?? w[te], de = re.property, Se = de && !le(de) ? Ze(de, w) : void 0, xe = le(de) || o && de.dataType !== t?.dataType, W = Se ? $(Se, re) : re;
4583
+ const ee = Q, pe = kt[ee] ?? w[ee], me = pe.property, ge = me && !se(me) ? We(me, w) : void 0, fe = se(me) || o && me.dataType !== t?.dataType, X = ge ? $(ge, pe) : pe;
4589
4584
  return /* @__PURE__ */ n(
4590
4585
  "div",
4591
4586
  {
4592
- onClick: (fe) => {
4593
- xe && (fe.stopPropagation(), fe.preventDefault());
4587
+ onClick: (Oe) => {
4588
+ fe && (Oe.stopPropagation(), Oe.preventDefault());
4594
4589
  },
4595
- className: _e(
4590
+ className: xe(
4596
4591
  "flex items-center",
4597
- xe ? "w-full pointer-events-none opacity-50" : ""
4592
+ fe ? "w-full pointer-events-none opacity-50" : ""
4598
4593
  ),
4599
4594
  children: [
4600
- /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Je, { propertyConfig: W }) }),
4595
+ /* @__PURE__ */ e("div", { className: "mr-8", children: /* @__PURE__ */ e(Ze, { propertyConfig: X }) }),
4601
4596
  /* @__PURE__ */ n("div", { className: "flex flex-col items-start text-base text-left", children: [
4602
- /* @__PURE__ */ e("div", { children: W.name }),
4597
+ /* @__PURE__ */ e("div", { children: X.name }),
4603
4598
  /* @__PURE__ */ e(
4604
4599
  P,
4605
4600
  {
4606
4601
  variant: "caption",
4607
4602
  color: "disabled",
4608
- children: xe ? "You can only switch to widgets that use the same data type" : W.description
4603
+ children: fe ? "You can only switch to widgets that use the same data type" : X.description
4609
4604
  }
4610
4605
  )
4611
4606
  ] })
@@ -4613,25 +4608,25 @@ function Di({
4613
4608
  }
4614
4609
  );
4615
4610
  },
4616
- onValueChange: (Z) => {
4617
- he(Z);
4611
+ onValueChange: (Q) => {
4612
+ ie(Q);
4618
4613
  },
4619
- children: j.map(([Z, te]) => {
4620
- const re = te.property, de = o && !le(re) && re.dataType !== t?.dataType;
4614
+ children: j.map(([Q, ee]) => {
4615
+ const pe = ee.property, me = o && !se(pe) && pe.dataType !== t?.dataType;
4621
4616
  return /* @__PURE__ */ e(
4622
4617
  na,
4623
4618
  {
4624
- value: Z,
4625
- optionDisabled: de,
4626
- propertyConfig: te,
4619
+ value: Q,
4620
+ optionDisabled: me,
4621
+ propertyConfig: ee,
4627
4622
  existing: o
4628
4623
  },
4629
- Z
4624
+ Q
4630
4625
  );
4631
4626
  })
4632
4627
  }
4633
4628
  ),
4634
- ke && /* @__PURE__ */ e(
4629
+ Ce && /* @__PURE__ */ e(
4635
4630
  P,
4636
4631
  {
4637
4632
  variant: "caption",
@@ -4642,19 +4637,19 @@ function Di({
4642
4637
  )
4643
4638
  ] }),
4644
4639
  c && t?.id && /* @__PURE__ */ e(
4645
- me,
4640
+ re,
4646
4641
  {
4647
4642
  variant: "ghost",
4648
4643
  className: "m-4",
4649
4644
  disabled: y,
4650
4645
  onClick: () => A(!0),
4651
- children: /* @__PURE__ */ e(st, {})
4646
+ children: /* @__PURE__ */ e(dt, {})
4652
4647
  }
4653
4648
  )
4654
4649
  ] }),
4655
4650
  /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-y-12 mt-8 mb-8", children: [
4656
4651
  m && /* @__PURE__ */ e(
4657
- Pi,
4652
+ Vi,
4658
4653
  {
4659
4654
  showErrors: f,
4660
4655
  disabledId: o,
@@ -4664,13 +4659,13 @@ function Di({
4664
4659
  ref: q
4665
4660
  }
4666
4661
  ),
4667
- M,
4668
- /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Bi, { disabled: y }) })
4662
+ R,
4663
+ /* @__PURE__ */ e("div", { className: "col-span-12", children: /* @__PURE__ */ e(Ki, { disabled: y }) })
4669
4664
  ] }),
4670
4665
  c && /* @__PURE__ */ e(
4671
- lt,
4666
+ pt,
4672
4667
  {
4673
- open: I,
4668
+ open: F,
4674
4669
  onAccept: () => c(t?.id, p),
4675
4670
  onCancel: () => A(!1),
4676
4671
  title: /* @__PURE__ */ e("div", { children: "Delete this property?" }),
@@ -4683,7 +4678,97 @@ function Di({
4683
4678
  )
4684
4679
  ] });
4685
4680
  }
4686
- function Ri({
4681
+ function Hi(t) {
4682
+ return (t.slice(0, 1).toLowerCase() + t.slice(1)).replace(/([-_ ]){1,}/g, " ").split(/[-_ ]/).reduce((a, r) => a + r[0].toUpperCase() + r.substring(1));
4683
+ }
4684
+ function Ji({ collection: t, onOpenChange: a, open: r }) {
4685
+ const i = Ue(), s = "const " + Hi(t.name) + "Collection = " + ni.stringify(la(t), null, " ");
4686
+ return /* @__PURE__ */ n(
4687
+ Ie,
4688
+ {
4689
+ open: r,
4690
+ onOpenChange: a,
4691
+ maxWidth: "4xl",
4692
+ children: [
4693
+ /* @__PURE__ */ n(De, { children: [
4694
+ /* @__PURE__ */ n(P, { variant: "h6", className: "my-4", children: [
4695
+ "Code for ",
4696
+ t.name
4697
+ ] }),
4698
+ /* @__PURE__ */ n(P, { variant: "body2", className: "my-4 mb-8", children: [
4699
+ "If you want to customise the collection in code, you can add this collection code to your CMS app configuration. More info in the ",
4700
+ /* @__PURE__ */ e(
4701
+ "a",
4702
+ {
4703
+ rel: "noopener noreferrer",
4704
+ href: "https://firecms.co/docs/customization_quickstart",
4705
+ children: "docs"
4706
+ }
4707
+ ),
4708
+ "."
4709
+ ] }),
4710
+ /* @__PURE__ */ e(
4711
+ si,
4712
+ {
4713
+ theme: li.vsDark,
4714
+ code: s,
4715
+ language: "typescript",
4716
+ children: ({ className: o, style: l, tokens: d, getLineProps: m, getTokenProps: u }) => /* @__PURE__ */ e("pre", { style: l, className: "p-4 rounded text-sm", children: d.map((c, p) => /* @__PURE__ */ e("div", { ...m({ line: c }), children: c.map((g, f) => /* @__PURE__ */ e("span", { ...u({ token: g }) }, f)) }, p)) })
4717
+ }
4718
+ )
4719
+ ] }),
4720
+ /* @__PURE__ */ n(Re, { children: [
4721
+ /* @__PURE__ */ n(
4722
+ E,
4723
+ {
4724
+ variant: "text",
4725
+ size: "small",
4726
+ onClick: (o) => (o.stopPropagation(), o.preventDefault(), i.open({
4727
+ type: "success",
4728
+ message: "Copied}"
4729
+ }), navigator.clipboard.writeText(s)),
4730
+ children: [
4731
+ /* @__PURE__ */ e(Fa, { size: "small" }),
4732
+ "Copy to clipboard"
4733
+ ]
4734
+ }
4735
+ ),
4736
+ /* @__PURE__ */ e(E, { onClick: () => a(!1), children: "Close" })
4737
+ ] })
4738
+ ]
4739
+ }
4740
+ );
4741
+ }
4742
+ function la(t) {
4743
+ const a = (r) => {
4744
+ const i = {
4745
+ ...r
4746
+ };
4747
+ return delete i.fromBuilder, delete i.resolved, delete i.propertiesOrder, delete i.editable, i.type === "map" ? {
4748
+ ...i,
4749
+ properties: i.properties.map(a)
4750
+ } : i;
4751
+ };
4752
+ return {
4753
+ name: t.name,
4754
+ singularName: t.singularName,
4755
+ description: t.description,
4756
+ path: t.path,
4757
+ editable: !0,
4758
+ collectionGroup: t.collectionGroup,
4759
+ alias: t.alias,
4760
+ icon: t.icon,
4761
+ group: t.group,
4762
+ customId: t.customId,
4763
+ initialFilter: t.initialFilter,
4764
+ initialSort: t.initialSort,
4765
+ properties: Object.entries(t.properties).map(([r, i]) => ({
4766
+ [r]: a(i)
4767
+ })).reduce((r, i) => ({ ...r, ...i }), {}),
4768
+ subcollections: (t.subcollections ?? []).map(la)
4769
+ };
4770
+ }
4771
+ function Qi({
4687
4772
  showErrors: t,
4688
4773
  isNewCollection: a,
4689
4774
  propertyErrorsRef: r,
@@ -4704,12 +4789,12 @@ function Ri({
4704
4789
  setFieldTouched: k,
4705
4790
  errors: _,
4706
4791
  dirty: O
4707
- } = L(), h = Qe(), w = Va("lg"), b = !w, [v, T] = Y(), [I, A] = Y(), [S, x] = Y(), C = I ? se(I, S) : void 0, j = C ? N(g.properties, C.replaceAll(".", ".properties.")) : void 0, [J, q] = Y(!1), [U, ie] = Y(!1), [ke, he] = Y([]), M = R.useRef(g.propertiesOrder ? { "": g.propertiesOrder } : {});
4708
- pe(() => {
4792
+ } = K(), h = Ue(), w = Ia("lg"), b = !w, [v, T] = L(), [F, A] = L(), [S, x] = L(), C = F ? ne(F, S) : void 0, j = C ? N(g.properties, C.replaceAll(".", ".properties.")) : void 0, [Z, q] = L(!1), [M, he] = L(!1), [Ce, ie] = L(!1), [R, Q] = L([]), ee = D.useRef(g.propertiesOrder ? { "": g.propertiesOrder } : {});
4793
+ de(() => {
4709
4794
  s && s(O);
4710
4795
  }, [O]);
4711
- const Z = u ? () => {
4712
- u && (q(!0), u(g).then((V) => {
4796
+ const pe = u ? () => {
4797
+ u && (he(!0), u(g).then((V) => {
4713
4798
  if (V && Xt(V.properties), !V) {
4714
4799
  h.open({
4715
4800
  type: "error",
@@ -4717,94 +4802,94 @@ function Ri({
4717
4802
  });
4718
4803
  return;
4719
4804
  }
4720
- const F = Object.keys(V.properties).filter((ne) => !g.properties[ne]);
4721
- if (F.length === 0) {
4805
+ const I = Object.keys(V.properties).filter((oe) => !g.properties[oe]);
4806
+ if (I.length === 0) {
4722
4807
  h.open({
4723
4808
  type: "info",
4724
4809
  message: "No new properties found"
4725
4810
  });
4726
4811
  return;
4727
4812
  }
4728
- const H = {
4729
- ...F.reduce((ne, be) => (ne[be] = V.properties[be], ne), {}),
4813
+ const G = {
4814
+ ...I.reduce((oe, ye) => (oe[ye] = V.properties[ye], oe), {}),
4730
4815
  ...g.properties
4731
- }, oe = [
4732
- ...F,
4816
+ }, ce = [
4817
+ ...I,
4733
4818
  ...g.propertiesOrder ?? []
4734
4819
  ];
4735
- f("properties", H, !1), re(oe), he(F);
4820
+ f("properties", G, !1), ge(ce), Q(I);
4736
4821
  }).finally(() => {
4737
- q(!1);
4822
+ he(!1);
4738
4823
  }));
4739
- } : void 0, te = (V) => V ? M.current[V] ?? N(g, Oe(V)) : M.current[""], re = (V, F) => {
4740
- const H = Oe(F);
4741
- f(H, V, !1), M.current[F ?? ""] = V;
4742
- }, de = (V, F) => {
4743
- const H = V ? se(V, F) : void 0;
4744
- if (!H)
4824
+ } : void 0, me = (V) => V ? ee.current[V] ?? N(g, Ne(V)) : ee.current[""], ge = (V, I) => {
4825
+ const G = Ne(I);
4826
+ f(G, V, !1), ee.current[I ?? ""] = V;
4827
+ }, fe = (V, I) => {
4828
+ const G = V ? ne(V, I) : void 0;
4829
+ if (!G)
4745
4830
  throw Error("collection editor miss config");
4746
- f(we(H), void 0, !1);
4747
- const ne = te(F).filter((be) => be !== V);
4748
- re(ne, F), ie(!1), T(void 0), A(void 0), x(void 0);
4749
- }, Se = (V, F) => {
4750
- f(Oe(F), V, !1);
4751
- }, xe = ({
4831
+ f(ke(G), void 0, !1);
4832
+ const oe = me(I).filter((ye) => ye !== V);
4833
+ ge(oe, I), ie(!1), T(void 0), A(void 0), x(void 0);
4834
+ }, X = (V, I) => {
4835
+ f(Ne(I), V, !1);
4836
+ }, Oe = ({
4752
4837
  id: V,
4753
- property: F
4838
+ property: I
4754
4839
  }) => {
4755
4840
  if (console.log("onPropertyCreated", {
4756
4841
  id: V,
4757
- property: F
4842
+ property: I
4758
4843
  }), !V)
4759
4844
  throw Error("Need to include an ID when creating a new property");
4760
4845
  f("properties", {
4761
4846
  ...g.properties ?? {},
4762
- [V]: F
4847
+ [V]: I
4763
4848
  }, !1);
4764
- const H = [...g.propertiesOrder ?? Object.keys(g.properties), V];
4849
+ const G = [...g.propertiesOrder ?? Object.keys(g.properties), V];
4765
4850
  console.log("onPropertyCreated", {
4766
4851
  id: V,
4767
- property: F,
4768
- newPropertiesOrder: H
4769
- }), re(H), ie(!1), w && (T(H.indexOf(V)), A(V)), x(void 0);
4770
- }, W = ({
4852
+ property: I,
4853
+ newPropertiesOrder: G
4854
+ }), ge(G), ie(!1), w && (T(G.indexOf(V)), A(V)), x(void 0);
4855
+ }, Xe = ({
4771
4856
  id: V,
4772
- property: F,
4773
- previousId: H,
4774
- namespace: oe
4857
+ property: I,
4858
+ previousId: G,
4859
+ namespace: ce
4775
4860
  }) => {
4776
- const ne = V ? se(V, oe) : void 0, be = ne ? we(ne) : void 0;
4777
- if (H && H !== V) {
4778
- const ht = se(H, oe), et = we(ht), X = te(oe).map((ze) => ze === H ? V : ze).filter((ze) => ze !== void 0);
4779
- re(X, oe), V && (T(X.indexOf(V)), A(V)), f(et, void 0, !1), k(et, !1, !1);
4861
+ const oe = V ? ne(V, ce) : void 0, ye = oe ? ke(oe) : void 0;
4862
+ if (G && G !== V) {
4863
+ const at = ne(G, ce), W = ke(at), ve = me(ce).map((it) => it === G ? V : it).filter((it) => it !== void 0);
4864
+ ge(ve, ce), V && (T(ve.indexOf(V)), A(V)), f(W, void 0, !1), k(W, !1, !1);
4780
4865
  }
4781
- be && (f(be, F, !1), k(be, !0, !1));
4782
- }, fe = (V, F, H) => {
4783
- const oe = V ? se(V, F) : void 0;
4866
+ ye && (f(ye, I, !1), k(ye, !0, !1));
4867
+ }, et = (V, I, G) => {
4868
+ const ce = V ? ne(V, I) : void 0;
4784
4869
  if (console.warn("onPropertyErrorInternal", {
4785
4870
  id: V,
4786
- namespace: F,
4787
- error: H,
4788
- propertyPath: oe
4789
- }), oe) {
4790
- const ne = H && Object.keys(H).length > 0;
4791
- i(V, F, ne ? H : void 0), y(we(oe), ne ? "Property error" : void 0);
4871
+ namespace: I,
4872
+ error: G,
4873
+ propertyPath: ce
4874
+ }), ce) {
4875
+ const oe = G && Object.keys(G).length > 0;
4876
+ i(V, I, oe ? G : void 0), y(ke(ce), oe ? "Property error" : void 0);
4792
4877
  }
4793
- }, ut = () => {
4878
+ }, z = () => {
4794
4879
  T(void 0), A(void 0);
4795
- }, We = I && r?.current?.properties ? r.current.properties[I] : void 0, z = g?.propertiesOrder === void 0 || g.propertiesOrder.length === 0, K = g.propertiesOrder ? g.propertiesOrder : Object.keys(g.properties), D = Ut(() => d(g.ownerId), [d, g.ownerId]), Xe = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4796
- /* @__PURE__ */ n("div", { className: _e(
4880
+ }, Y = F && r?.current?.properties ? r.current.properties[F] : void 0, U = g?.propertiesOrder === void 0 || g.propertiesOrder.length === 0, Ke = g.propertiesOrder ? g.propertiesOrder : Object.keys(g.properties), tt = $t(() => d(g.ownerId), [d, g.ownerId]), Te = /* @__PURE__ */ n("div", { className: "grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900", children: [
4881
+ /* @__PURE__ */ n("div", { className: xe(
4797
4882
  "p-4 md:p-8 pb-20 md:pb-20",
4798
4883
  "col-span-12 lg:col-span-5 h-full overflow-auto",
4799
- !b && "border-r " + xt
4884
+ !b && "border-r " + Ct
4800
4885
  ), children: [
4801
4886
  /* @__PURE__ */ n("div", { className: "flex my-2", children: [
4802
4887
  /* @__PURE__ */ n("div", { className: "flex-grow mb-4", children: [
4803
4888
  /* @__PURE__ */ e(
4804
- ge,
4889
+ be,
4805
4890
  {
4806
4891
  name: "name",
4807
- as: G,
4892
+ as: H,
4808
4893
  invisible: !0,
4809
4894
  className: "-ml-1",
4810
4895
  inputClassName: "text-2xl font-headers",
@@ -4814,7 +4899,7 @@ function Ri({
4814
4899
  error: !!_.name
4815
4900
  }
4816
4901
  ),
4817
- D && /* @__PURE__ */ n(
4902
+ tt && /* @__PURE__ */ n(
4818
4903
  P,
4819
4904
  {
4820
4905
  variant: "body2",
@@ -4822,20 +4907,29 @@ function Ri({
4822
4907
  color: "secondary",
4823
4908
  children: [
4824
4909
  "Created by ",
4825
- D.displayName
4910
+ tt.displayName
4826
4911
  ]
4827
4912
  }
4828
4913
  )
4829
4914
  ] }),
4830
4915
  l && /* @__PURE__ */ e("div", { className: "ml-4", children: l }),
4831
4916
  /* @__PURE__ */ n("div", { className: "ml-1 mt-2 flex flex-row gap-2", children: [
4832
- Z && /* @__PURE__ */ e(ae, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
4833
- E,
4917
+ /* @__PURE__ */ e(ae, { title: "Get the code for this collection", children: /* @__PURE__ */ e(
4918
+ re,
4834
4919
  {
4835
- variant: "text",
4836
- disabled: J,
4837
- onClick: Z,
4838
- children: J ? /* @__PURE__ */ e(Ye, { size: "small" }) : /* @__PURE__ */ e(pt, {})
4920
+ variant: "filled",
4921
+ disabled: M,
4922
+ onClick: () => q(!0),
4923
+ children: /* @__PURE__ */ e(Ea, {})
4924
+ }
4925
+ ) }),
4926
+ pe && /* @__PURE__ */ e(ae, { title: "Add new properties based on data", children: /* @__PURE__ */ e(
4927
+ re,
4928
+ {
4929
+ variant: "filled",
4930
+ disabled: M,
4931
+ onClick: pe,
4932
+ children: M ? /* @__PURE__ */ e(Qe, { size: "small" }) : /* @__PURE__ */ e(ht, {})
4839
4933
  }
4840
4934
  ) }),
4841
4935
  /* @__PURE__ */ e(ae, { title: "Add new property", children: /* @__PURE__ */ e(
@@ -4843,25 +4937,25 @@ function Ri({
4843
4937
  {
4844
4938
  variant: "outlined",
4845
4939
  onClick: () => ie(!0),
4846
- children: /* @__PURE__ */ e(Ne, {})
4940
+ children: /* @__PURE__ */ e(qe, {})
4847
4941
  }
4848
4942
  ) })
4849
4943
  ] })
4850
4944
  ] }),
4851
- /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(
4852
- mt,
4945
+ /* @__PURE__ */ e(Pe, { children: /* @__PURE__ */ e(
4946
+ gt,
4853
4947
  {
4854
4948
  className: "pl-8",
4855
- onPropertyClick: (V, F) => {
4856
- T(K.indexOf(V)), A(V), x(F);
4949
+ onPropertyClick: (V, I) => {
4950
+ T(Ke.indexOf(V)), A(V), x(I);
4857
4951
  },
4858
- inferredPropertyKeys: ke,
4859
- selectedPropertyKey: I ? se(I, S) : void 0,
4952
+ inferredPropertyKeys: R,
4953
+ selectedPropertyKey: F ? ne(F, S) : void 0,
4860
4954
  properties: g.properties,
4861
4955
  additionalFields: g.additionalFields,
4862
- propertiesOrder: K,
4863
- onPropertyMove: Se,
4864
- onPropertyRemove: a ? de : void 0,
4956
+ propertiesOrder: Ke,
4957
+ onPropertyMove: X,
4958
+ onPropertyRemove: a ? fe : void 0,
4865
4959
  collectionEditable: p,
4866
4960
  errors: t ? _ : {}
4867
4961
  }
@@ -4874,17 +4968,17 @@ function Ri({
4874
4968
  variant: "outlined",
4875
4969
  size: "large",
4876
4970
  onClick: () => ie(!0),
4877
- startIcon: /* @__PURE__ */ e(Ne, {}),
4971
+ startIcon: /* @__PURE__ */ e(qe, {}),
4878
4972
  children: "Add new property"
4879
4973
  }
4880
4974
  )
4881
4975
  ] }),
4882
4976
  !b && /* @__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(
4883
- Pe,
4977
+ Se,
4884
4978
  {
4885
4979
  className: "sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",
4886
4980
  children: [
4887
- C && j && !le(j) && /* @__PURE__ */ e(
4981
+ C && j && !se(j) && /* @__PURE__ */ e(
4888
4982
  sa,
4889
4983
  {
4890
4984
  inArray: !1,
@@ -4892,22 +4986,22 @@ function Ri({
4892
4986
  autoUpdateId: !1,
4893
4987
  allowDataInference: !a,
4894
4988
  autoOpenTypeSelect: !1,
4895
- propertyKey: I,
4989
+ propertyKey: F,
4896
4990
  propertyNamespace: S,
4897
4991
  property: j,
4898
- onPropertyChanged: W,
4899
- onDelete: de,
4900
- onError: fe,
4992
+ onPropertyChanged: Xe,
4993
+ onDelete: fe,
4994
+ onError: et,
4901
4995
  forceShowErrors: t,
4902
- initialErrors: We,
4996
+ initialErrors: Y,
4903
4997
  getData: m,
4904
4998
  customFields: c,
4905
4999
  collectionEditable: p
4906
5000
  },
4907
5001
  `edit_view_${v}`
4908
5002
  ),
4909
- !j && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center h-full", children: z ? "Now you can add your first property" : "Select a property to edit it" }),
4910
- j && le(j) && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
5003
+ !j && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center h-full", children: U ? "Now you can add your first property" : "Select a property to edit it" }),
5004
+ j && se(j) && /* @__PURE__ */ e(P, { variant: "label", className: "flex items-center justify-center", children: "This property is defined as a property builder in code" })
4911
5005
  ]
4912
5006
  }
4913
5007
  ) }),
@@ -4920,24 +5014,24 @@ function Ri({
4920
5014
  allowDataInference: !a,
4921
5015
  existingProperty: !0,
4922
5016
  autoOpenTypeSelect: !1,
4923
- propertyKey: I,
5017
+ propertyKey: F,
4924
5018
  propertyNamespace: S,
4925
5019
  property: j,
4926
- onPropertyChanged: W,
4927
- onDelete: de,
4928
- onError: fe,
5020
+ onPropertyChanged: Xe,
5021
+ onDelete: fe,
5022
+ onError: et,
4929
5023
  forceShowErrors: t,
4930
- initialErrors: We,
5024
+ initialErrors: Y,
4931
5025
  getData: m,
4932
5026
  customFields: c,
4933
5027
  collectionEditable: p,
4934
- onOkClicked: b ? ut : void 0
5028
+ onOkClicked: b ? z : void 0
4935
5029
  },
4936
5030
  `edit_view_${v}`
4937
5031
  )
4938
5032
  ] });
4939
5033
  return /* @__PURE__ */ n(B, { children: [
4940
- Xe,
5034
+ Te,
4941
5035
  /* @__PURE__ */ e(
4942
5036
  Fe,
4943
5037
  {
@@ -4946,19 +5040,27 @@ function Ri({
4946
5040
  autoOpenTypeSelect: !0,
4947
5041
  autoUpdateId: !0,
4948
5042
  forceShowErrors: t,
4949
- open: U,
5043
+ open: Ce,
4950
5044
  onCancel: () => ie(!1),
4951
- onPropertyChanged: xe,
5045
+ onPropertyChanged: Oe,
4952
5046
  getData: m,
4953
5047
  allowDataInference: !a,
4954
5048
  customFields: c,
4955
5049
  collectionEditable: p,
4956
5050
  existingPropertyKeys: g.propertiesOrder
4957
5051
  }
5052
+ ),
5053
+ /* @__PURE__ */ e(
5054
+ Ji,
5055
+ {
5056
+ collection: g,
5057
+ open: Z,
5058
+ onOpenChange: q
5059
+ }
4958
5060
  )
4959
5061
  ] });
4960
5062
  }
4961
- function Ui({
5063
+ function Wi({
4962
5064
  open: t,
4963
5065
  handleOk: a,
4964
5066
  handleCancel: r,
@@ -4966,19 +5068,19 @@ function Ui({
4966
5068
  title: s
4967
5069
  }) {
4968
5070
  return /* @__PURE__ */ n(
4969
- Me,
5071
+ Ie,
4970
5072
  {
4971
5073
  open: t,
4972
5074
  onOpenChange: (o) => o ? r() : a(),
4973
5075
  "aria-labelledby": "alert-dialog-title",
4974
5076
  "aria-describedby": "alert-dialog-description",
4975
5077
  children: [
4976
- /* @__PURE__ */ n(He, { children: [
5078
+ /* @__PURE__ */ n(De, { children: [
4977
5079
  /* @__PURE__ */ e(P, { variant: "h6", children: s ?? "Unsaved changes" }),
4978
5080
  i && /* @__PURE__ */ e(P, { children: i }),
4979
5081
  /* @__PURE__ */ e(P, { children: "Are you sure?" })
4980
5082
  ] }),
4981
- /* @__PURE__ */ n(Ge, { children: [
5083
+ /* @__PURE__ */ n(Re, { children: [
4982
5084
  /* @__PURE__ */ e(E, { variant: "text", onClick: r, autoFocus: !0, children: " Cancel " }),
4983
5085
  /* @__PURE__ */ e(E, { onClick: a, children: " Ok " })
4984
5086
  ] })
@@ -4986,15 +5088,15 @@ function Ui({
4986
5088
  }
4987
5089
  );
4988
5090
  }
4989
- function $i({ open: t, onClose: a }) {
4990
- const { entityViews: r } = qe();
5091
+ function Zi({ open: t, onClose: a }) {
5092
+ const { entityViews: r } = Ae();
4991
5093
  return /* @__PURE__ */ n(
4992
- Me,
5094
+ Ie,
4993
5095
  {
4994
5096
  maxWidth: "md",
4995
5097
  open: t,
4996
5098
  children: [
4997
- /* @__PURE__ */ n(He, { children: [
5099
+ /* @__PURE__ */ n(De, { children: [
4998
5100
  /* @__PURE__ */ e(P, { variant: "h6", children: "Select view" }),
4999
5101
  r?.map((i) => /* @__PURE__ */ n(
5000
5102
  E,
@@ -5012,12 +5114,12 @@ function $i({ open: t, onClose: a }) {
5012
5114
  i.key
5013
5115
  ))
5014
5116
  ] }),
5015
- /* @__PURE__ */ e(Ge, { children: /* @__PURE__ */ e(E, { onClick: () => a(), children: "Cancel" }) })
5117
+ /* @__PURE__ */ e(Re, { children: /* @__PURE__ */ e(E, { onClick: () => a(), children: "Cancel" }) })
5016
5118
  ]
5017
5119
  }
5018
5120
  );
5019
5121
  }
5020
- function Li({
5122
+ function Xi({
5021
5123
  collection: t,
5022
5124
  parentCollection: a,
5023
5125
  configController: r,
@@ -5025,19 +5127,19 @@ function Li({
5025
5127
  getUser: s,
5026
5128
  parentPathSegments: o
5027
5129
  }) {
5028
- const { entityViews: l } = qe(), [d, m] = R.useState(), [u, c] = R.useState(!1), [p, g] = R.useState(), [f, y] = R.useState(), {
5130
+ const { entityViews: l } = Ae(), [d, m] = D.useState(), [u, c] = D.useState(!1), [p, g] = D.useState(), [f, y] = D.useState(), {
5029
5131
  values: k,
5030
5132
  setFieldValue: _
5031
- } = L(), O = t.subcollections ?? [], h = k.entityViews?.filter((v) => typeof v == "string").map((v) => ja(v, l)).filter(Boolean) ?? [], w = t.entityViews?.filter((v) => typeof v != "string") ?? [], b = h.length + w.length;
5133
+ } = K(), O = t.subcollections ?? [], h = k.entityViews?.filter((v) => typeof v == "string").map((v) => Ba(v, l)).filter(Boolean) ?? [], w = t.entityViews?.filter((v) => typeof v != "string") ?? [], b = h.length + w.length;
5032
5134
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto", children: [
5033
- /* @__PURE__ */ e(dt, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
5135
+ /* @__PURE__ */ e(ut, { maxWidth: "2xl", className: "flex flex-col gap-4 p-8 m-auto", children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-16", children: [
5034
5136
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5035
5137
  /* @__PURE__ */ n(P, { variant: "h5", children: [
5036
5138
  "Subcollections of ",
5037
5139
  k.name
5038
5140
  ] }),
5039
- O && O.length > 0 && /* @__PURE__ */ e(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e(Tt, { children: O.map((v) => /* @__PURE__ */ n(
5040
- ft,
5141
+ O && O.length > 0 && /* @__PURE__ */ e(Se, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ e(Vt, { children: O.map((v) => /* @__PURE__ */ n(
5142
+ bt,
5041
5143
  {
5042
5144
  onClick: () => y({
5043
5145
  isNewCollection: !1,
@@ -5045,25 +5147,25 @@ function Li({
5045
5147
  }),
5046
5148
  children: [
5047
5149
  /* @__PURE__ */ e(
5048
- Ue,
5150
+ Ye,
5049
5151
  {
5050
5152
  align: "left",
5051
5153
  children: /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: v.name })
5052
5154
  }
5053
5155
  ),
5054
5156
  /* @__PURE__ */ e(
5055
- Ue,
5157
+ Ye,
5056
5158
  {
5057
5159
  align: "right",
5058
5160
  children: /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
5059
- me,
5161
+ re,
5060
5162
  {
5061
5163
  size: "small",
5062
5164
  onClick: (T) => {
5063
5165
  T.preventDefault(), T.stopPropagation(), m(v.path);
5064
5166
  },
5065
5167
  color: "inherit",
5066
- children: /* @__PURE__ */ e(st, { size: "small" })
5168
+ children: /* @__PURE__ */ e(dt, { size: "small" })
5067
5169
  }
5068
5170
  ) })
5069
5171
  }
@@ -5081,42 +5183,42 @@ function Li({
5081
5183
  });
5082
5184
  },
5083
5185
  variant: "outlined",
5084
- startIcon: /* @__PURE__ */ e(Ne, {}),
5186
+ startIcon: /* @__PURE__ */ e(qe, {}),
5085
5187
  children: "Add subcollection"
5086
5188
  }
5087
5189
  )
5088
5190
  ] }),
5089
5191
  /* @__PURE__ */ n("div", { className: "flex-grow flex flex-col gap-4 items-start", children: [
5090
5192
  /* @__PURE__ */ e(P, { variant: "h5", children: "Custom views" }),
5091
- b > 0 && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(Pe, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ n(Tt, { children: [
5092
- h.map((v) => /* @__PURE__ */ n(ft, { children: [
5193
+ b > 0 && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(Se, { className: "flex flex-col gap-4 p-2 w-full", children: /* @__PURE__ */ e(Tt, { children: /* @__PURE__ */ n(Vt, { children: [
5194
+ h.map((v) => /* @__PURE__ */ n(bt, { children: [
5093
5195
  /* @__PURE__ */ e(
5094
- Ue,
5196
+ Ye,
5095
5197
  {
5096
5198
  align: "left",
5097
5199
  children: /* @__PURE__ */ e(P, { variant: "subtitle2", className: "flex-grow", children: v.name })
5098
5200
  }
5099
5201
  ),
5100
5202
  /* @__PURE__ */ e(
5101
- Ue,
5203
+ Ye,
5102
5204
  {
5103
5205
  align: "right",
5104
5206
  children: /* @__PURE__ */ e(ae, { title: "Remove", children: /* @__PURE__ */ e(
5105
- me,
5207
+ re,
5106
5208
  {
5107
5209
  size: "small",
5108
5210
  onClick: (T) => {
5109
5211
  T.preventDefault(), T.stopPropagation(), g(v.key);
5110
5212
  },
5111
5213
  color: "inherit",
5112
- children: /* @__PURE__ */ e(st, { size: "small" })
5214
+ children: /* @__PURE__ */ e(dt, { size: "small" })
5113
5215
  }
5114
5216
  ) })
5115
5217
  }
5116
5218
  )
5117
5219
  ] }, v.key)),
5118
- w.map((v) => /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ n(
5119
- Ue,
5220
+ w.map((v) => /* @__PURE__ */ e(bt, { children: /* @__PURE__ */ n(
5221
+ Ye,
5120
5222
  {
5121
5223
  align: "left",
5122
5224
  children: [
@@ -5129,7 +5231,7 @@ function Li({
5129
5231
  }
5130
5232
  ) }, v.key))
5131
5233
  ] }) }) }) }),
5132
- b === 0 && /* @__PURE__ */ e(Wt, { children: "COMING SOON: You can define your own custom views by uploading it with the CLI" }),
5234
+ b === 0 && /* @__PURE__ */ e(Zt, { children: "COMING SOON: You can define your own custom views by uploading it with the CLI" }),
5133
5235
  /* @__PURE__ */ e(
5134
5236
  E,
5135
5237
  {
@@ -5137,14 +5239,14 @@ function Li({
5137
5239
  c(!0);
5138
5240
  },
5139
5241
  variant: "outlined",
5140
- startIcon: /* @__PURE__ */ e(Ne, {}),
5242
+ startIcon: /* @__PURE__ */ e(qe, {}),
5141
5243
  children: "Add custom entity view"
5142
5244
  }
5143
5245
  )
5144
5246
  ] })
5145
5247
  ] }) }),
5146
5248
  d && /* @__PURE__ */ e(
5147
- lt,
5249
+ pt,
5148
5250
  {
5149
5251
  open: !!d,
5150
5252
  onAccept: () => {
@@ -5163,7 +5265,7 @@ function Li({
5163
5265
  }
5164
5266
  ),
5165
5267
  p && /* @__PURE__ */ e(
5166
- lt,
5268
+ pt,
5167
5269
  {
5168
5270
  open: !!p,
5169
5271
  onAccept: () => {
@@ -5179,7 +5281,7 @@ function Li({
5179
5281
  }
5180
5282
  ),
5181
5283
  /* @__PURE__ */ e(
5182
- ca,
5284
+ da,
5183
5285
  {
5184
5286
  open: !!f,
5185
5287
  configController: r,
@@ -5195,7 +5297,7 @@ function Li({
5195
5297
  }
5196
5298
  ),
5197
5299
  /* @__PURE__ */ e(
5198
- $i,
5300
+ Zi,
5199
5301
  {
5200
5302
  open: u,
5201
5303
  onClose: (v) => {
@@ -5205,7 +5307,7 @@ function Li({
5205
5307
  )
5206
5308
  ] });
5207
5309
  }
5208
- const Bt = {
5310
+ const Mt = {
5209
5311
  path: "products",
5210
5312
  name: "Products",
5211
5313
  singularName: "Product",
@@ -5290,7 +5392,7 @@ const Bt = {
5290
5392
  autoValue: "on_create"
5291
5393
  }
5292
5394
  }
5293
- }, Mt = {
5395
+ }, Dt = {
5294
5396
  path: "blog",
5295
5397
  name: "Blog",
5296
5398
  singularName: "Blog entry",
@@ -5402,7 +5504,7 @@ const Bt = {
5402
5504
  initialFilter: {
5403
5505
  status: ["==", "published"]
5404
5506
  }
5405
- }, Dt = {
5507
+ }, Rt = {
5406
5508
  path: "users",
5407
5509
  name: "Users",
5408
5510
  singularName: "User",
@@ -5434,15 +5536,15 @@ const Bt = {
5434
5536
  }
5435
5537
  }
5436
5538
  };
5437
- function Ki({
5539
+ function er({
5438
5540
  path: t,
5439
5541
  pathSuggestions: a,
5440
5542
  parentCollection: r,
5441
5543
  onContinue: i,
5442
5544
  collections: s
5443
5545
  }) {
5444
- const [o, l] = Y(!1), [d, m] = Y();
5445
- pe(() => {
5546
+ const [o, l] = L(!1), [d, m] = L();
5547
+ de(() => {
5446
5548
  a && s && (l(!0), a(t).then((h) => {
5447
5549
  const w = h.filter((b) => !s.find((v) => v.path.trim().toLowerCase() === b.trim().toLowerCase()));
5448
5550
  m(w);
@@ -5458,8 +5560,8 @@ function Ki({
5458
5560
  setFieldTouched: k,
5459
5561
  isSubmitting: _,
5460
5562
  submitCount: O
5461
- } = L();
5462
- return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(dt, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5563
+ } = K();
5564
+ return /* @__PURE__ */ e("div", { className: "overflow-auto my-auto", children: /* @__PURE__ */ n(ut, { maxWidth: "4xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5463
5565
  /* @__PURE__ */ e(
5464
5566
  "div",
5465
5567
  {
@@ -5467,7 +5569,7 @@ function Ki({
5467
5569
  children: /* @__PURE__ */ e(P, { variant: "h4", className: "flex-grow", children: "New collection" })
5468
5570
  }
5469
5571
  ),
5470
- r && /* @__PURE__ */ e(nt, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
5572
+ r && /* @__PURE__ */ e(ct, { colorScheme: "tealDarker", children: /* @__PURE__ */ n(P, { variant: "caption", children: [
5471
5573
  "This is a subcollection of ",
5472
5574
  /* @__PURE__ */ e("b", { children: r.name })
5473
5575
  ] }) }),
@@ -5481,13 +5583,13 @@ function Ki({
5481
5583
  }
5482
5584
  ),
5483
5585
  /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7", children: [
5484
- o && !d && /* @__PURE__ */ e(Ye, { size: "small" }),
5586
+ o && !d && /* @__PURE__ */ e(Qe, { size: "small" }),
5485
5587
  d?.map((h, w) => /* @__PURE__ */ e(
5486
- nt,
5588
+ ct,
5487
5589
  {
5488
5590
  colorScheme: "cyanLighter",
5489
5591
  onClick: () => {
5490
- c("name", Ct(h)), c("path", h), c("properties", void 0), i();
5592
+ c("name", Ot(h)), c("path", h), c("properties", void 0), i();
5491
5593
  },
5492
5594
  size: "small",
5493
5595
  children: h
@@ -5508,35 +5610,35 @@ function Ki({
5508
5610
  ),
5509
5611
  /* @__PURE__ */ n("div", { className: "flex gap-4", children: [
5510
5612
  /* @__PURE__ */ e(
5511
- vt,
5613
+ wt,
5512
5614
  {
5513
5615
  title: "Products",
5514
5616
  subtitle: "A collection of products with images, prices and stock",
5515
- icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Bt.icon }),
5617
+ icon: /* @__PURE__ */ e(st, { size: "small", iconKey: Mt.icon }),
5516
5618
  onClick: () => {
5517
- p(Bt), i();
5619
+ p(Mt), i();
5518
5620
  }
5519
5621
  }
5520
5622
  ),
5521
5623
  /* @__PURE__ */ e(
5522
- vt,
5624
+ wt,
5523
5625
  {
5524
5626
  title: "Blog posts",
5525
5627
  subtitle: "A collection of blog posts with images, authors and complex content",
5526
- icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Mt.icon }),
5628
+ icon: /* @__PURE__ */ e(st, { size: "small", iconKey: Dt.icon }),
5527
5629
  onClick: () => {
5528
- p(Mt), i();
5630
+ p(Dt), i();
5529
5631
  }
5530
5632
  }
5531
5633
  ),
5532
5634
  /* @__PURE__ */ e(
5533
- vt,
5635
+ wt,
5534
5636
  {
5535
5637
  title: "Users",
5536
5638
  subtitle: "A collection of users with emails, names and roles",
5537
- icon: /* @__PURE__ */ e(rt, { size: "small", iconKey: Dt.icon }),
5639
+ icon: /* @__PURE__ */ e(st, { size: "small", iconKey: Rt.icon }),
5538
5640
  onClick: () => {
5539
- p(Dt), i();
5641
+ p(Rt), i();
5540
5642
  }
5541
5643
  }
5542
5644
  )
@@ -5552,12 +5654,12 @@ function Ki({
5552
5654
  children: "● Create a collection from a file (csv, json, xls, xslx...)"
5553
5655
  }
5554
5656
  ),
5555
- /* @__PURE__ */ e(ai, { onDataAdded: (h) => i(h) })
5657
+ /* @__PURE__ */ e(ci, { onDataAdded: (h) => i(h) })
5556
5658
  ] }),
5557
5659
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(E, { variant: "text", onClick: () => i(), className: "my-2", children: "Continue from scratch" }) })
5558
5660
  ] }) });
5559
5661
  }
5560
- function vt({
5662
+ function wt({
5561
5663
  title: t,
5562
5664
  subtitle: a,
5563
5665
  icon: r,
@@ -5567,7 +5669,7 @@ function vt({
5567
5669
  ea,
5568
5670
  {
5569
5671
  onClick: i,
5570
- className: _e(
5672
+ className: xe(
5571
5673
  "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",
5572
5674
  "text-gray-700 dark:text-gray-300",
5573
5675
  "hover:border-blue-600 hover:text-blue-600 dark:hover:text-blue-400 focus:ring-blue-400 hover:ring-1 hover:ring-primary",
@@ -5588,7 +5690,7 @@ function vt({
5588
5690
  }
5589
5691
  ) });
5590
5692
  }
5591
- const Yi = [
5693
+ const tr = [
5592
5694
  "text_field",
5593
5695
  "multiline",
5594
5696
  "markdown",
@@ -5609,10 +5711,10 @@ const Yi = [
5609
5711
  "date_time",
5610
5712
  "repeat",
5611
5713
  "block"
5612
- ], Hi = Object.entries(_t).filter(
5613
- ([t]) => Yi.includes(t)
5714
+ ], ar = Object.entries(kt).filter(
5715
+ ([t]) => tr.includes(t)
5614
5716
  );
5615
- function Gi({
5717
+ function ir({
5616
5718
  importConfig: t,
5617
5719
  customFields: a,
5618
5720
  collectionEditable: r
@@ -5621,18 +5723,18 @@ function Gi({
5621
5723
  setFieldValue: i,
5622
5724
  setFieldTouched: s,
5623
5725
  values: o
5624
- } = L(), [l, d] = Y(void 0), m = R.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, c = l || void 0, p = ({
5726
+ } = K(), [l, d] = L(void 0), m = D.useRef(o.propertiesOrder ? { "": o.propertiesOrder } : {}), u = l ? l.id : void 0, c = l || void 0, p = ({
5625
5727
  id: f,
5626
5728
  property: y,
5627
5729
  previousId: k,
5628
5730
  namespace: _
5629
5731
  }) => {
5630
- const O = f ? se(f, _) : void 0, h = O ? we(O) : void 0, w = (v) => v ? m.current[v] ?? N(o, Oe(v)) : m.current[""], b = (v, T) => {
5631
- const I = Oe(T);
5632
- i(I, v, !1), m.current[T ?? ""] = v;
5732
+ const O = f ? ne(f, _) : void 0, h = O ? ke(O) : void 0, w = (v) => v ? m.current[v] ?? N(o, Ne(v)) : m.current[""], b = (v, T) => {
5733
+ const F = Ne(T);
5734
+ i(F, v, !1), m.current[T ?? ""] = v;
5633
5735
  };
5634
5736
  if (k && k !== f) {
5635
- const v = se(k, _), T = we(v), A = w(_).map((x) => x === k ? f : x).filter((x) => x !== void 0);
5737
+ const v = ne(k, _), T = ke(v), A = w(_).map((x) => x === k ? f : x).filter((x) => x !== void 0);
5636
5738
  b(A, _);
5637
5739
  const S = { ...t.headersMapping };
5638
5740
  Object.keys(S).forEach((x) => {
@@ -5646,8 +5748,8 @@ function Gi({
5646
5748
  property: k,
5647
5749
  namespace: _
5648
5750
  }) => {
5649
- const O = f ? se(f, _) : void 0, h = O ? we(O) : void 0, w = t.importData.map((v) => N(v, y)), b = {
5650
- ...Ja(w, k, aa),
5751
+ const O = f ? ne(f, _) : void 0, h = O ? ke(O) : void 0, w = t.importData.map((v) => N(v, y)), b = {
5752
+ ...ti(w, k, aa),
5651
5753
  editable: !0
5652
5754
  };
5653
5755
  h && (b ? (console.log("updating inferredNewProperty", {
@@ -5656,10 +5758,10 @@ function Gi({
5656
5758
  }), i(h, b, !1)) : i(h, k, !1), s(h, !0, !1));
5657
5759
  };
5658
5760
  return /* @__PURE__ */ n("div", { className: "overflow-auto my-auto bg-gray-50 dark:bg-gray-900", children: [
5659
- /* @__PURE__ */ n(dt, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5761
+ /* @__PURE__ */ n(ut, { maxWidth: "6xl", className: "flex flex-col gap-4 p-8 m-auto", children: [
5660
5762
  /* @__PURE__ */ e(P, { variant: "h6", className: "mt-4", children: "Data property mapping" }),
5661
5763
  /* @__PURE__ */ e(
5662
- ii,
5764
+ di,
5663
5765
  {
5664
5766
  headersMapping: t.headersMapping,
5665
5767
  idColumn: t.idColumn,
@@ -5671,7 +5773,7 @@ function Gi({
5671
5773
  propertyKey: y,
5672
5774
  importKey: k
5673
5775
  }) => /* @__PURE__ */ e(
5674
- ri,
5776
+ pi,
5675
5777
  {
5676
5778
  property: f,
5677
5779
  propertyKey: y,
@@ -5684,7 +5786,7 @@ function Gi({
5684
5786
  });
5685
5787
  },
5686
5788
  propertyTypeView: /* @__PURE__ */ e(
5687
- Qi,
5789
+ rr,
5688
5790
  {
5689
5791
  property: f,
5690
5792
  disabled: !1,
@@ -5726,14 +5828,14 @@ function Gi({
5726
5828
  /* @__PURE__ */ e("div", { style: { height: "52px" } })
5727
5829
  ] });
5728
5830
  }
5729
- function Qi({
5831
+ function rr({
5730
5832
  property: t,
5731
5833
  onPropertyChanged: a,
5732
5834
  propertyKey: r,
5733
5835
  customFields: i,
5734
5836
  disabled: s
5735
5837
  }) {
5736
- const { fields: o } = qe(), l = t ? Jt(t) : null, d = t ? Ze(t, o) : null, [m, u] = Y(!1);
5838
+ const { fields: o } = Ae(), l = t ? Wt(t) : null, d = t ? We(t, o) : null, [m, u] = L(!1);
5737
5839
  return /* @__PURE__ */ e(
5738
5840
  ae,
5739
5841
  {
@@ -5751,7 +5853,7 @@ function Qi({
5751
5853
  value: l ?? "",
5752
5854
  placeholder: "Select a property widget",
5753
5855
  position: "item-aligned",
5754
- renderValue: (c) => d ? /* @__PURE__ */ e(Je, { propertyConfig: d }) : null,
5856
+ renderValue: (c) => d ? /* @__PURE__ */ e(Ze, { propertyConfig: d }) : null,
5755
5857
  onValueChange: (c) => {
5756
5858
  const p = oa(t, c, i);
5757
5859
  r && (a({
@@ -5761,7 +5863,7 @@ function Qi({
5761
5863
  namespace: void 0
5762
5864
  }), console.log("newSelectedWidgetId", c));
5763
5865
  },
5764
- children: Hi.map(([c, p]) => /* @__PURE__ */ e(
5866
+ children: ar.map(([c, p]) => /* @__PURE__ */ e(
5765
5867
  na,
5766
5868
  {
5767
5869
  value: c,
@@ -5776,14 +5878,14 @@ function Qi({
5776
5878
  }
5777
5879
  );
5778
5880
  }
5779
- function Zi({ importConfig: t, properties: a, propertiesOrder: r }) {
5780
- pe(() => {
5781
- const s = oi(t.originProperties, a), o = t.importData.map((l) => ni(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
5881
+ function or({ importConfig: t, properties: a, propertiesOrder: r }) {
5882
+ de(() => {
5883
+ const s = mi(t.originProperties, a), o = t.importData.map((l) => ui(l, t.idColumn, t.headersMapping, a, s, "TEMP_PATH"));
5782
5884
  t.setEntities(o), console.log("res", { propertiesMapping: s, mappedData: o });
5783
5885
  }, []);
5784
- const i = Fa();
5886
+ const i = Ma();
5785
5887
  return /* @__PURE__ */ e(
5786
- Ia,
5888
+ Da,
5787
5889
  {
5788
5890
  title: /* @__PURE__ */ n("div", { children: [
5789
5891
  /* @__PURE__ */ e(P, { variant: "subtitle2", children: "Imported data preview" }),
@@ -5803,11 +5905,11 @@ function Zi({ importConfig: t, properties: a, propertiesOrder: r }) {
5803
5905
  }
5804
5906
  );
5805
5907
  }
5806
- function la(t, a = "") {
5908
+ function ca(t, a = "") {
5807
5909
  const r = Object.keys(t).reduce((o, l) => {
5808
- const d = t[l], m = Ea(l), u = a ? `${a}.${m}` : m;
5910
+ const d = t[l], m = Ra(l), u = a ? `${a}.${m}` : m;
5809
5911
  if (d.dataType === "map" && d.properties) {
5810
- const g = la(d.properties, u);
5912
+ const g = ca(d.properties, u);
5811
5913
  return {
5812
5914
  headersMapping: { ...o.headersMapping, [l]: u },
5813
5915
  properties: {
@@ -5835,14 +5937,14 @@ function la(t, a = "") {
5835
5937
  idColumn: s
5836
5938
  };
5837
5939
  }
5838
- function ca(t) {
5839
- const a = t.open, [r, i] = ve.useState(!1), [s, o] = ve.useState(!1), l = Q(() => {
5940
+ function da(t) {
5941
+ const a = t.open, [r, i] = _e.useState(!1), [s, o] = _e.useState(!1), l = J(() => {
5840
5942
  r ? o(!0) : t.handleClose(void 0);
5841
5943
  }, [r, t.handleClose]);
5842
- return pe(() => {
5944
+ return de(() => {
5843
5945
  a || (i(!1), o(!1));
5844
5946
  }, [a]), /* @__PURE__ */ n(
5845
- Me,
5947
+ Ie,
5846
5948
  {
5847
5949
  open: a,
5848
5950
  fullWidth: !0,
@@ -5852,7 +5954,7 @@ function ca(t) {
5852
5954
  onOpenChange: (d) => d ? void 0 : l(),
5853
5955
  children: [
5854
5956
  a && /* @__PURE__ */ e(
5855
- Ji,
5957
+ nr,
5856
5958
  {
5857
5959
  ...t,
5858
5960
  handleCancel: l,
@@ -5860,7 +5962,7 @@ function ca(t) {
5860
5962
  }
5861
5963
  ),
5862
5964
  /* @__PURE__ */ e(
5863
- Ui,
5965
+ Wi,
5864
5966
  {
5865
5967
  open: s,
5866
5968
  handleOk: () => t.handleClose(void 0),
@@ -5872,7 +5974,7 @@ function ca(t) {
5872
5974
  }
5873
5975
  );
5874
5976
  }
5875
- function Ji({
5977
+ function nr({
5876
5978
  isNewCollection: t,
5877
5979
  initialValues: a,
5878
5980
  configController: r,
@@ -5890,153 +5992,153 @@ function Ji({
5890
5992
  parentCollection: y,
5891
5993
  getData: k
5892
5994
  }) {
5893
- const { fields: _ } = qe(), O = De(), {
5995
+ const { fields: _ } = Ae(), O = $e(), {
5894
5996
  topLevelNavigation: h,
5895
5997
  collections: w
5896
- } = O, b = !a?.path && (s ?? []).length === 0, v = (y ? y.subcollections : w) ?? [], T = v.map((z) => z.path.trim().toLowerCase()), I = v.map((z) => z.alias?.trim().toLowerCase()).filter(Boolean), A = si();
5998
+ } = O, b = !a?.path && (s ?? []).length === 0, v = (y ? y.subcollections : w) ?? [], T = v.map((z) => z.path.trim().toLowerCase()), F = v.map((z) => z.alias?.trim().toLowerCase()).filter(Boolean), A = hi();
5897
5999
  if (!h)
5898
6000
  throw Error("Internal: Navigation not ready in collection editor");
5899
6001
  const {
5900
6002
  groups: S
5901
- } = h, x = Qe(), C = Re(), j = $e({}), J = t ? b ? "welcome" : "details" : "properties", [q, U] = Y(J), [ie, ke] = ve.useState(), [he, M] = ve.useState(), [Z, te] = ve.useState(!1), [re, de] = ve.useState();
5902
- pe(() => {
6003
+ } = h, x = Ue(), C = Le(), j = Ge({}), Z = t ? b ? "welcome" : "details" : "properties", [q, M] = L(Z), [he, Ce] = _e.useState(), [ie, R] = _e.useState(), [Q, ee] = _e.useState(!1), [pe, me] = _e.useState();
6004
+ de(() => {
5903
6005
  try {
5904
- O.initialised && (M(i ? O.getCollectionFromPaths([...s ?? [], i]) : void 0), te(!0));
6006
+ O.initialised && (R(i ? O.getCollectionFromPaths([...s ?? [], i]) : void 0), ee(!0));
5905
6007
  } catch (z) {
5906
- console.error(z), de(re);
6008
+ console.error(z), me(pe);
5907
6009
  }
5908
- }, [O.getCollectionFromPaths, i, re, O.initialised]);
5909
- const Se = (z) => {
5910
- const K = z.alias || z.path;
6010
+ }, [O.getCollectionFromPaths, i, pe, O.initialised]);
6011
+ const ge = (z) => {
6012
+ const Y = z.alias || z.path;
5911
6013
  return r.saveCollection({
5912
- path: K,
6014
+ path: Y,
5913
6015
  collectionData: z,
5914
6016
  previousPath: i,
5915
6017
  parentPathSegments: s
5916
- }).then(() => (ke(void 0), !0)).catch((D) => (ke(D), console.error(D), x.open({
6018
+ }).then(() => (Ce(void 0), !0)).catch((U) => (Ce(U), console.error(U), x.open({
5917
6019
  type: "error",
5918
- message: "Error persisting collection: " + (D.message ?? "Details in the console")
6020
+ message: "Error persisting collection: " + (U.message ?? "Details in the console")
5919
6021
  }), !1));
5920
- }, xe = he ?? {
6022
+ }, fe = ie ?? {
5921
6023
  path: a?.path ?? "",
5922
6024
  name: a?.name ?? "",
5923
6025
  group: a?.group ?? "",
5924
6026
  properties: {},
5925
6027
  propertiesOrder: [],
5926
- icon: wt[Math.floor(Math.random() * wt.length)],
6028
+ icon: _t[Math.floor(Math.random() * _t.length)],
5927
6029
  ownerId: C.user?.uid ?? ""
5928
- }, W = Q(() => {
5929
- q === "details" ? A.inUse ? U("import_data_saving") : U(u ? "extra_view" : "properties") : U(q === "welcome" ? "details" : q === "import_data_mapping" ? "import_data_preview" : q === "import_data_preview" ? "details" : q === "extra_view" ? "properties" : "details");
5930
- }, [q, A.inUse, u]), fe = Q((z) => {
6030
+ }, X = J(() => {
6031
+ q === "details" ? A.inUse ? M("import_data_saving") : M(u ? "extra_view" : "properties") : M(q === "welcome" ? "details" : q === "import_data_mapping" ? "import_data_preview" : q === "import_data_preview" ? "details" : q === "extra_view" ? "properties" : "details");
6032
+ }, [q, A.inUse, u]), Oe = J((z) => {
5931
6033
  if (l)
5932
6034
  return l?.(z.path, z.collectionGroup ?? !1, s ?? []);
5933
- }, [l, s]), ut = Q(async (z) => {
5934
- if (!fe)
5935
- return M(z), Promise.resolve(z);
5936
- U("loading");
5937
- const K = await fe?.(z);
5938
- if (!K)
5939
- return M(z), Promise.resolve(z);
5940
- const D = {
6035
+ }, [l, s]), Xe = J(async (z) => {
6036
+ if (!Oe)
6037
+ return R(z), Promise.resolve(z);
6038
+ M("loading");
6039
+ const Y = await Oe?.(z);
6040
+ if (!Y)
6041
+ return R(z), Promise.resolve(z);
6042
+ const U = {
5941
6043
  ...z ?? {}
5942
6044
  };
5943
- return Object.keys(K.properties ?? {}).length > 0 && (D.properties = K.properties, D.propertiesOrder = K.propertiesOrder), D.propertiesOrder ? (M(D), console.log("Inferred collection", {
6045
+ return Object.keys(Y.properties ?? {}).length > 0 && (U.properties = Y.properties, U.propertiesOrder = Y.propertiesOrder), U.propertiesOrder ? (R(U), console.log("Inferred collection", {
5944
6046
  newCollection: z ?? {},
5945
- values: D
5946
- }), D) : (D.propertiesOrder = Object.keys(D.properties), D);
5947
- }, [s, fe]), We = (z, K) => {
6047
+ values: U
6048
+ }), U) : (U.propertiesOrder = Object.keys(U.properties), U);
6049
+ }, [s, Oe]), et = (z, Y) => {
5948
6050
  try {
5949
6051
  if (console.log("Submitting collection", z), !t) {
5950
- Se(z).then(() => {
5951
- K.resetForm({ values: xe }), d(z);
6052
+ ge(z).then(() => {
6053
+ Y.resetForm({ values: fe }), d(z);
5952
6054
  });
5953
6055
  return;
5954
6056
  }
5955
- q === "welcome" ? (W(), K.resetForm({ values: z })) : q === "details" ? u || A.inUse ? (K.resetForm({ values: z }), W()) : t ? ut(z).then((D) => {
5956
- K.resetForm({
5957
- values: D ?? z,
6057
+ q === "welcome" ? (X(), Y.resetForm({ values: z })) : q === "details" ? u || A.inUse ? (Y.resetForm({ values: z }), X()) : t ? Xe(z).then((U) => {
6058
+ Y.resetForm({
6059
+ values: U ?? z,
5958
6060
  touched: {
5959
6061
  path: !0,
5960
6062
  name: !0
5961
6063
  }
5962
6064
  });
5963
6065
  }).finally(() => {
5964
- W();
5965
- }) : (K.resetForm({ values: z }), W()) : q === "extra_view" ? (W(), K.resetForm({ values: z })) : q === "import_data_mapping" || q === "import_data_preview" ? W() : q === "properties" ? Se(z).then(() => {
5966
- K.resetForm({ values: xe }), W(), d(z);
5967
- }) : (W(), K.resetForm({ values: z }));
5968
- } catch (D) {
6066
+ X();
6067
+ }) : (Y.resetForm({ values: z }), X()) : q === "extra_view" ? (X(), Y.resetForm({ values: z })) : q === "import_data_mapping" || q === "import_data_preview" ? X() : q === "properties" ? ge(z).then(() => {
6068
+ Y.resetForm({ values: fe }), X(), d(z);
6069
+ }) : (X(), Y.resetForm({ values: z }));
6070
+ } catch (U) {
5969
6071
  x.open({
5970
6072
  type: "error",
5971
- message: "Error persisting collection: " + (D.message ?? "Details in the console")
5972
- }), console.error(D), K.resetForm({ values: z });
6073
+ message: "Error persisting collection: " + (U.message ?? "Details in the console")
6074
+ }), console.error(U), Y.resetForm({ values: z });
5973
6075
  }
5974
6076
  };
5975
- return !t && (!O.initialised || !Z) ? /* @__PURE__ */ e(Vt, {}) : /* @__PURE__ */ e(He, { fullHeight: !0, children: /* @__PURE__ */ e(
5976
- Ot,
6077
+ return !t && (!O.initialised || !Q) ? /* @__PURE__ */ e(jt, {}) : /* @__PURE__ */ e(De, { fullHeight: !0, children: /* @__PURE__ */ e(
6078
+ Pt,
5977
6079
  {
5978
- initialValues: xe,
5979
- validationSchema: (q === "properties" || q === "subcollections" || q === "details") && di,
6080
+ initialValues: fe,
6081
+ validationSchema: (q === "properties" || q === "subcollections" || q === "details") && bi,
5980
6082
  validate: () => {
5981
6083
  if (q === "properties")
5982
6084
  return j.current;
5983
6085
  },
5984
- onSubmit: We,
6086
+ onSubmit: et,
5985
6087
  children: ({
5986
6088
  values: z,
5987
- setFieldValue: K,
5988
- isSubmitting: D,
5989
- dirty: Xe,
5990
- submitCount: V
6089
+ setFieldValue: Y,
6090
+ isSubmitting: U,
6091
+ dirty: Ke,
6092
+ submitCount: tt
5991
6093
  }) => {
5992
- const F = z.path ?? i, H = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + F : F, oe = O.resolveAliasesFrom(H), ne = oe && k ? () => k(oe) : void 0;
5993
- pe(() => {
5994
- p(Xe);
5995
- }, [Xe]);
5996
- function be(X) {
5997
- A.setInUse(!0), Wa(X, aa).then((ze) => {
5998
- const Te = la(ze);
5999
- K("properties", Te.properties), K("propertiesOrder", Object.keys(Te.properties)), A.setIdColumn(Te.idColumn), A.setImportData(X), A.setHeadersMapping(Te.headersMapping), A.setOriginProperties(Te.properties);
6094
+ const Te = z.path ?? i, V = o?.includes("/") ? o?.split("/").slice(0, -1).join("/") + "/" + Te : Te, I = O.resolveAliasesFrom(V), G = I && k ? () => k(I) : void 0;
6095
+ de(() => {
6096
+ p(Ke);
6097
+ }, [Ke]);
6098
+ function ce(W) {
6099
+ A.setInUse(!0), ai(W, aa).then((ft) => {
6100
+ const ve = ca(ft);
6101
+ Y("properties", ve.properties), Y("propertiesOrder", Object.keys(ve.properties)), A.setIdColumn(ve.idColumn), A.setImportData(W), A.setHeadersMapping(ve.headersMapping), A.setOriginProperties(ve.properties);
6000
6102
  });
6001
6103
  }
6002
- const ht = !!z.name && !!z.path, et = () => {
6003
- const X = { ...z.properties };
6004
- A.idColumn && delete X[A.idColumn], K("properties", X), W(), console.log("onImportMappingComplete", {
6104
+ const oe = !!z.name && !!z.path, ye = () => {
6105
+ const W = { ...z.properties };
6106
+ A.idColumn && delete W[A.idColumn], Y("properties", W), X(), console.log("onImportMappingComplete", {
6005
6107
  importConfig: A,
6006
- properties: X
6108
+ properties: W
6007
6109
  });
6008
- }, gt = he?.editable || t;
6110
+ }, at = ie?.editable || t;
6009
6111
  return /* @__PURE__ */ n(B, { children: [
6010
6112
  !t && /* @__PURE__ */ n(
6011
- Ba,
6113
+ Ua,
6012
6114
  {
6013
6115
  value: q,
6014
- className: _e(xt, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
6015
- onValueChange: (X) => U(X),
6116
+ className: xe(Ct, "justify-end bg-gray-50 dark:bg-gray-950 border-b"),
6117
+ onValueChange: (W) => M(W),
6016
6118
  children: [
6017
- /* @__PURE__ */ e(bt, { value: "details", children: "Details" }),
6018
- /* @__PURE__ */ e(bt, { value: "properties", children: "Properties" }),
6019
- /* @__PURE__ */ e(bt, { value: "subcollections", children: "Additional views" })
6119
+ /* @__PURE__ */ e(yt, { value: "details", children: "Details" }),
6120
+ /* @__PURE__ */ e(yt, { value: "properties", children: "Properties" }),
6121
+ /* @__PURE__ */ e(yt, { value: "subcollections", children: "Additional views" })
6020
6122
  ]
6021
6123
  }
6022
6124
  ),
6023
6125
  /* @__PURE__ */ n(
6024
- Ga,
6126
+ Za,
6025
6127
  {
6026
6128
  noValidate: !0,
6027
- className: _e(
6129
+ className: xe(
6028
6130
  t ? "h-full" : "h-[calc(100%-48px)]",
6029
6131
  "flex-grow flex flex-col relative"
6030
6132
  ),
6031
6133
  children: [
6032
- q === "loading" && /* @__PURE__ */ e(Vt, {}),
6033
- q === "extra_view" && F && u?.View && /* @__PURE__ */ e(u.View, { path: F }),
6134
+ q === "loading" && /* @__PURE__ */ e(jt, {}),
6135
+ q === "extra_view" && Te && u?.View && /* @__PURE__ */ e(u.View, { path: Te }),
6034
6136
  q === "welcome" && /* @__PURE__ */ e(
6035
- Ki,
6137
+ er,
6036
6138
  {
6037
- path: F,
6038
- onContinue: (X) => {
6039
- X ? (be(X), U("import_data_mapping")) : U("details");
6139
+ path: Te,
6140
+ onContinue: (W) => {
6141
+ W ? (ce(W), M("import_data_mapping")) : M("details");
6040
6142
  },
6041
6143
  collections: w,
6042
6144
  parentCollection: y,
@@ -6044,15 +6146,15 @@ function Ji({
6044
6146
  }
6045
6147
  ),
6046
6148
  q === "import_data_mapping" && A && /* @__PURE__ */ e(
6047
- Gi,
6149
+ ir,
6048
6150
  {
6049
6151
  importConfig: A,
6050
- collectionEditable: gt,
6152
+ collectionEditable: at,
6051
6153
  customFields: _
6052
6154
  }
6053
6155
  ),
6054
6156
  q === "import_data_preview" && A && /* @__PURE__ */ e(
6055
- Zi,
6157
+ or,
6056
6158
  {
6057
6159
  importConfig: A,
6058
6160
  properties: z.properties,
@@ -6060,12 +6162,12 @@ function Ji({
6060
6162
  }
6061
6163
  ),
6062
6164
  q === "import_data_saving" && A && /* @__PURE__ */ e(
6063
- li,
6165
+ gi,
6064
6166
  {
6065
6167
  importConfig: A,
6066
6168
  collection: z,
6067
- onImportSuccess: (X) => {
6068
- d(X), x.open({
6169
+ onImportSuccess: (W) => {
6170
+ d(W), x.open({
6069
6171
  type: "info",
6070
6172
  message: "Data imported successfully"
6071
6173
  });
@@ -6073,67 +6175,67 @@ function Ji({
6073
6175
  }
6074
6176
  ),
6075
6177
  q === "details" && /* @__PURE__ */ e(
6076
- ui,
6178
+ wi,
6077
6179
  {
6078
6180
  existingPaths: T,
6079
- existingAliases: I,
6181
+ existingAliases: F,
6080
6182
  groups: S,
6081
6183
  parentCollection: y,
6082
6184
  isNewCollection: t
6083
6185
  }
6084
6186
  ),
6085
- q === "subcollections" && he && /* @__PURE__ */ e(
6086
- Li,
6187
+ q === "subcollections" && ie && /* @__PURE__ */ e(
6188
+ Xi,
6087
6189
  {
6088
6190
  parentCollection: y,
6089
6191
  configController: r,
6090
6192
  getUser: f,
6091
6193
  collectionInference: l,
6092
6194
  parentPathSegments: s,
6093
- collection: he
6195
+ collection: ie
6094
6196
  }
6095
6197
  ),
6096
6198
  q === "properties" && /* @__PURE__ */ e(
6097
- Ri,
6199
+ Qi,
6098
6200
  {
6099
- showErrors: V > 0,
6201
+ showErrors: tt > 0,
6100
6202
  isNewCollection: t,
6101
6203
  reservedGroups: m,
6102
- onPropertyError: (X, ze, Te) => {
6103
- j.current = Ma({
6204
+ onPropertyError: (W, ft, ve) => {
6205
+ j.current = $a({
6104
6206
  ...j.current,
6105
- [X]: Te
6207
+ [W]: ve
6106
6208
  }, !0);
6107
6209
  },
6108
6210
  getUser: f,
6109
- getData: ne,
6110
- doCollectionInference: fe,
6211
+ getData: G,
6212
+ doCollectionInference: Oe,
6111
6213
  customFields: _,
6112
- collectionEditable: gt,
6214
+ collectionEditable: at,
6113
6215
  extraIcon: u?.icon && /* @__PURE__ */ e(
6114
- me,
6216
+ re,
6115
6217
  {
6116
6218
  color: "primary",
6117
- onClick: () => U("extra_view"),
6219
+ onClick: () => M("extra_view"),
6118
6220
  children: u.icon
6119
6221
  }
6120
6222
  )
6121
6223
  }
6122
6224
  ),
6123
6225
  q !== "welcome" && /* @__PURE__ */ n(
6124
- Ge,
6226
+ Re,
6125
6227
  {
6126
6228
  position: "absolute",
6127
6229
  children: [
6128
- ie && /* @__PURE__ */ e(ta, { error: ie }),
6230
+ he && /* @__PURE__ */ e(ta, { error: he }),
6129
6231
  t && b && q === "import_data_mapping" && /* @__PURE__ */ n(
6130
6232
  E,
6131
6233
  {
6132
6234
  variant: "text",
6133
6235
  type: "button",
6134
- onClick: () => (A.setInUse(!1), U("welcome")),
6236
+ onClick: () => (A.setInUse(!1), M("welcome")),
6135
6237
  children: [
6136
- /* @__PURE__ */ e(tt, {}),
6238
+ /* @__PURE__ */ e(rt, {}),
6137
6239
  "Back"
6138
6240
  ]
6139
6241
  }
@@ -6144,10 +6246,10 @@ function Ji({
6144
6246
  variant: "text",
6145
6247
  type: "button",
6146
6248
  onClick: () => {
6147
- Se(z), U("import_data_mapping");
6249
+ ge(z), M("import_data_mapping");
6148
6250
  },
6149
6251
  children: [
6150
- /* @__PURE__ */ e(tt, {}),
6252
+ /* @__PURE__ */ e(rt, {}),
6151
6253
  "Back"
6152
6254
  ]
6153
6255
  }
@@ -6157,9 +6259,9 @@ function Ji({
6157
6259
  {
6158
6260
  variant: "text",
6159
6261
  type: "button",
6160
- onClick: () => U("welcome"),
6262
+ onClick: () => M("welcome"),
6161
6263
  children: [
6162
- /* @__PURE__ */ e(tt, {}),
6264
+ /* @__PURE__ */ e(rt, {}),
6163
6265
  "Back"
6164
6266
  ]
6165
6267
  }
@@ -6169,9 +6271,9 @@ function Ji({
6169
6271
  {
6170
6272
  variant: "text",
6171
6273
  type: "button",
6172
- onClick: () => U("details"),
6274
+ onClick: () => M("details"),
6173
6275
  children: [
6174
- /* @__PURE__ */ e(tt, {}),
6276
+ /* @__PURE__ */ e(rt, {}),
6175
6277
  "Back"
6176
6278
  ]
6177
6279
  }
@@ -6191,7 +6293,7 @@ function Ji({
6191
6293
  {
6192
6294
  variant: "filled",
6193
6295
  color: "primary",
6194
- onClick: et,
6296
+ onClick: ye,
6195
6297
  children: "Next"
6196
6298
  }
6197
6299
  ),
@@ -6201,20 +6303,20 @@ function Ji({
6201
6303
  variant: "filled",
6202
6304
  color: "primary",
6203
6305
  onClick: () => {
6204
- W();
6306
+ X();
6205
6307
  },
6206
6308
  children: "Next"
6207
6309
  }
6208
6310
  ),
6209
6311
  t && (q === "details" || q === "properties") && /* @__PURE__ */ n(
6210
- jt,
6312
+ Ft,
6211
6313
  {
6212
6314
  variant: "filled",
6213
6315
  color: "primary",
6214
6316
  type: "submit",
6215
- loading: D,
6216
- disabled: D || q === "details" && !ht,
6217
- startIcon: q === "properties" ? /* @__PURE__ */ e(Da, {}) : void 0,
6317
+ loading: U,
6318
+ disabled: U || q === "details" && !oe,
6319
+ startIcon: q === "properties" ? /* @__PURE__ */ e(La, {}) : void 0,
6218
6320
  children: [
6219
6321
  q === "details" && "Next",
6220
6322
  q === "properties" && "Create collection"
@@ -6222,12 +6324,12 @@ function Ji({
6222
6324
  }
6223
6325
  ),
6224
6326
  !t && /* @__PURE__ */ e(
6225
- jt,
6327
+ Ft,
6226
6328
  {
6227
6329
  variant: "filled",
6228
6330
  color: "primary",
6229
6331
  type: "submit",
6230
- loading: D,
6332
+ loading: U,
6231
6333
  children: "Update collection"
6232
6334
  }
6233
6335
  )
@@ -6242,7 +6344,7 @@ function Ji({
6242
6344
  }
6243
6345
  ) });
6244
6346
  }
6245
- const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
6347
+ const pa = D.createContext({}), ma = D.createContext({}), sr = D.memo(
6246
6348
  function({
6247
6349
  children: a,
6248
6350
  collectionConfigController: r,
@@ -6254,69 +6356,69 @@ const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
6254
6356
  getUser: m,
6255
6357
  getData: u
6256
6358
  }) {
6257
- const c = De(), p = ci(), g = Qe(), { fields: f } = qe(), {
6359
+ const c = $e(), p = fi(), g = Ue(), { fields: f } = Ae(), {
6258
6360
  collections: y
6259
- } = c, k = y.map((C) => C.path.trim().toLowerCase()), [_, O] = R.useState();
6260
- pe(() => {
6361
+ } = c, k = y.map((C) => C.path.trim().toLowerCase()), [_, O] = D.useState();
6362
+ de(() => {
6261
6363
  d && d().then((C) => {
6262
6364
  O(C.filter((j) => !k.includes(j.trim().toLowerCase())));
6263
6365
  });
6264
6366
  }, [d]);
6265
- const [h, w] = R.useState(), [b, v] = R.useState(), T = Q(() => ({
6367
+ const [h, w] = D.useState(), [b, v] = D.useState(), T = J(() => ({
6266
6368
  createCollections: !0,
6267
6369
  editCollections: !0,
6268
6370
  deleteCollections: !0
6269
- }), []), I = Q(({
6371
+ }), []), F = J(({
6270
6372
  path: C,
6271
6373
  fullPath: j,
6272
- parentPathSegments: J,
6374
+ parentPathSegments: Z,
6273
6375
  parentCollection: q
6274
6376
  }) => {
6275
6377
  w({
6276
6378
  editedCollectionPath: C,
6277
6379
  fullPath: j,
6278
- parentPathSegments: J,
6380
+ parentPathSegments: Z,
6279
6381
  isNewCollection: !1,
6280
6382
  parentCollection: q,
6281
6383
  redirect: !1
6282
6384
  });
6283
- }, []), A = Q(({
6385
+ }, []), A = J(({
6284
6386
  propertyKey: C,
6285
6387
  property: j,
6286
- editedCollectionPath: J,
6388
+ editedCollectionPath: Z,
6287
6389
  currentPropertiesOrder: q,
6288
- parentPathSegments: U,
6289
- collection: ie
6390
+ parentPathSegments: M,
6391
+ collection: he
6290
6392
  }) => {
6291
- const ke = C && C.includes(".") ? C.substring(0, C.lastIndexOf(".")) : void 0, he = C && C.includes(".") ? C.substring(C.lastIndexOf(".") + 1) : C;
6292
- console.log("edit property", he, ie), v({
6293
- propertyKey: he,
6393
+ const Ce = C && C.includes(".") ? C.substring(0, C.lastIndexOf(".")) : void 0, ie = C && C.includes(".") ? C.substring(C.lastIndexOf(".") + 1) : C;
6394
+ console.log("edit property", ie, he), v({
6395
+ propertyKey: ie,
6294
6396
  property: j,
6295
- namespace: ke,
6397
+ namespace: Ce,
6296
6398
  currentPropertiesOrder: q,
6297
- editedCollectionPath: J,
6298
- parentPathSegments: U,
6299
- collectionEditable: ie?.editable ?? !1
6399
+ editedCollectionPath: Z,
6400
+ parentPathSegments: M,
6401
+ collectionEditable: he?.editable ?? !1
6300
6402
  });
6301
- }, []), S = R.useCallback(({
6403
+ }, []), S = D.useCallback(({
6302
6404
  parentPathSegments: C,
6303
6405
  parentCollection: j,
6304
- initialValues: J,
6406
+ initialValues: Z,
6305
6407
  redirect: q
6306
6408
  }) => {
6307
6409
  w({
6308
6410
  isNewCollection: !0,
6309
6411
  parentPathSegments: C,
6310
6412
  parentCollection: j,
6311
- initialValues: J,
6413
+ initialValues: Z,
6312
6414
  redirect: q
6313
6415
  });
6314
6416
  }, []), x = d ? (C) => !C && _ ? Promise.resolve(_) : d?.(C) : void 0;
6315
- return /* @__PURE__ */ e(da.Provider, { value: r, children: /* @__PURE__ */ n(
6316
- pa.Provider,
6417
+ return /* @__PURE__ */ e(pa.Provider, { value: r, children: /* @__PURE__ */ n(
6418
+ ma.Provider,
6317
6419
  {
6318
6420
  value: {
6319
- editCollection: I,
6421
+ editCollection: F,
6320
6422
  createCollection: S,
6321
6423
  editProperty: A,
6322
6424
  configPermissions: i ?? T,
@@ -6325,7 +6427,7 @@ const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
6325
6427
  children: [
6326
6428
  a,
6327
6429
  /* @__PURE__ */ e(
6328
- ca,
6430
+ da,
6329
6431
  {
6330
6432
  open: !!h,
6331
6433
  configController: r,
@@ -6366,12 +6468,12 @@ const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
6366
6468
  }) => {
6367
6469
  if (!b || !C)
6368
6470
  return;
6369
- const J = !b.propertyKey;
6471
+ const Z = !b.propertyKey;
6370
6472
  return r.saveProperty({
6371
6473
  path: b?.editedCollectionPath,
6372
6474
  property: j,
6373
6475
  propertyKey: C,
6374
- newPropertiesOrder: J && b.currentPropertiesOrder ? [...b.currentPropertiesOrder, C] : void 0,
6476
+ newPropertiesOrder: Z && b.currentPropertiesOrder ? [...b.currentPropertiesOrder, C] : void 0,
6375
6477
  namespace: b.namespace,
6376
6478
  parentPathSegments: b.parentPathSegments
6377
6479
  }).catch((q) => (console.error(q), g.open({
@@ -6418,20 +6520,20 @@ const da = R.createContext({}), pa = R.createContext({}), Wi = R.memo(
6418
6520
  }
6419
6521
  ) });
6420
6522
  },
6421
- ct
6422
- ), Ee = () => $t(pa), ma = () => $t(da);
6423
- function Xi({
6523
+ mt
6524
+ ), Be = () => Lt(ma), ua = () => Lt(pa);
6525
+ function lr({
6424
6526
  path: t,
6425
6527
  parentPathSegments: a,
6426
6528
  collection: r,
6427
6529
  tableController: i
6428
6530
  }) {
6429
- const s = Re(), o = De(), l = Ee(), d = ma(), m = Qe(), u = o.getCollectionFromPaths(a), c = l.configPermissions ? l.configPermissions({
6531
+ const s = Le(), o = $e(), l = Be(), d = ua(), m = Ue(), u = o.getCollectionFromPaths(a), c = l.configPermissions ? l.configPermissions({
6430
6532
  user: s.user,
6431
6533
  collection: r
6432
6534
  }).editCollections : !0;
6433
6535
  let p = null;
6434
- return (!ct(it(i.filterValues), it(r.initialFilter)) || !ct(it(i.sortBy), it(r.initialSort))) && (p = /* @__PURE__ */ e(
6536
+ return (!mt(nt(i.filterValues), nt(r.initialFilter)) || !mt(nt(i.sortBy), nt(r.initialSort))) && (p = /* @__PURE__ */ e(
6435
6537
  ae,
6436
6538
  {
6437
6539
  title: i.sortBy || i.filterValues ? "Save default filter and sort" : "Clear default filter and sort",
@@ -6457,7 +6559,7 @@ function Xi({
6457
6559
  message: "Default config saved"
6458
6560
  });
6459
6561
  }),
6460
- children: /* @__PURE__ */ e(Ra, {})
6562
+ children: /* @__PURE__ */ e(Ka, {})
6461
6563
  }
6462
6564
  )
6463
6565
  }
@@ -6468,59 +6570,59 @@ function Xi({
6468
6570
  {
6469
6571
  title: c ? "Edit collection" : "You don't have permissions to edit this collection",
6470
6572
  children: /* @__PURE__ */ e(
6471
- me,
6573
+ re,
6472
6574
  {
6473
6575
  color: "primary",
6474
6576
  disabled: !c,
6475
6577
  onClick: c ? () => l?.editCollection({ path: r.path, fullPath: t, parentPathSegments: a, parentCollection: u }) : void 0,
6476
- children: /* @__PURE__ */ e(Ke, {})
6578
+ children: /* @__PURE__ */ e(Je, {})
6477
6579
  }
6478
6580
  )
6479
6581
  }
6480
6582
  )
6481
6583
  ] });
6482
6584
  }
6483
- function it(t) {
6585
+ function nt(t) {
6484
6586
  return t && Object.keys(t).length === 0 ? t : t ?? null;
6485
6587
  }
6486
- function er({
6588
+ function cr({
6487
6589
  path: t,
6488
6590
  collection: a
6489
6591
  }) {
6490
- const r = Re(), i = ma(), s = Ee(), o = s.configPermissions({
6592
+ const r = Le(), i = ua(), s = Be(), o = s.configPermissions({
6491
6593
  user: r.user,
6492
6594
  collection: a
6493
- }), l = Q(() => {
6595
+ }), l = J(() => {
6494
6596
  s?.editCollection({ path: t, parentPathSegments: [] });
6495
- }, [s, t]), [d, m] = Y(!1), u = Q(() => {
6597
+ }, [s, t]), [d, m] = L(!1), u = J(() => {
6496
6598
  i?.deleteCollection({ path: t });
6497
6599
  }, [t, i]);
6498
6600
  return /* @__PURE__ */ n(B, { children: [
6499
6601
  /* @__PURE__ */ n("div", { children: [
6500
6602
  o.deleteCollections && /* @__PURE__ */ e(
6501
- Ua,
6603
+ Ya,
6502
6604
  {
6503
- trigger: /* @__PURE__ */ e(me, { children: /* @__PURE__ */ e($a, { size: "small" }) }),
6504
- children: /* @__PURE__ */ n(La, { onClick: (c) => {
6605
+ trigger: /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(Ga, { size: "small" }) }),
6606
+ children: /* @__PURE__ */ n(Ha, { onClick: (c) => {
6505
6607
  c.preventDefault(), c.stopPropagation(), m(!0);
6506
6608
  }, children: [
6507
- /* @__PURE__ */ e(st, {}),
6609
+ /* @__PURE__ */ e(dt, {}),
6508
6610
  "Delete"
6509
6611
  ] })
6510
6612
  }
6511
6613
  ),
6512
6614
  o.editCollections && /* @__PURE__ */ e(
6513
- me,
6615
+ re,
6514
6616
  {
6515
6617
  onClick: (c) => {
6516
6618
  l();
6517
6619
  },
6518
- children: /* @__PURE__ */ e(Ke, { size: "small" })
6620
+ children: /* @__PURE__ */ e(Je, { size: "small" })
6519
6621
  }
6520
6622
  )
6521
6623
  ] }),
6522
6624
  /* @__PURE__ */ e(
6523
- lt,
6625
+ pt,
6524
6626
  {
6525
6627
  open: d,
6526
6628
  onAccept: u,
@@ -6535,19 +6637,19 @@ function er({
6535
6637
  )
6536
6638
  ] });
6537
6639
  }
6538
- function tr({
6640
+ function dr({
6539
6641
  group: t,
6540
6642
  context: a
6541
6643
  }) {
6542
6644
  if (!a.navigation.topLevelNavigation)
6543
6645
  throw Error("Navigation not ready in FireCMSHomePage");
6544
- const r = Re(), i = Ee(), s = i.configPermissions ? i.configPermissions({
6646
+ const r = Le(), i = Be(), s = i.configPermissions ? i.configPermissions({
6545
6647
  user: r.user
6546
6648
  }).createCollections : !0;
6547
6649
  return /* @__PURE__ */ e(
6548
6650
  ea,
6549
6651
  {
6550
- className: _e("h-full p-4 min-h-[124px]"),
6652
+ className: xe("h-full p-4 min-h-[124px]"),
6551
6653
  onClick: i && s ? () => i.createCollection({
6552
6654
  initialValues: t ? { group: t } : void 0,
6553
6655
  parentPathSegments: [],
@@ -6558,7 +6660,7 @@ function tr({
6558
6660
  {
6559
6661
  className: "flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",
6560
6662
  children: [
6561
- /* @__PURE__ */ e(Ne, { color: "primary" }),
6663
+ /* @__PURE__ */ e(qe, { color: "primary" }),
6562
6664
  /* @__PURE__ */ e(
6563
6665
  P,
6564
6666
  {
@@ -6575,12 +6677,12 @@ function tr({
6575
6677
  }
6576
6678
  );
6577
6679
  }
6578
- function ar() {
6579
- const t = Re(), a = De(), r = Ee(), i = r.configPermissions ? r.configPermissions({
6680
+ function pr() {
6681
+ const t = Le(), a = $e(), r = Be(), i = r.configPermissions ? r.configPermissions({
6580
6682
  user: t.user
6581
6683
  }).createCollections : !0, s = r.rootPathSuggestions ?? [], o = s.length > 3 || a.collections.length === 0 && s.length > 0;
6582
6684
  return /* @__PURE__ */ e(
6583
- Ka,
6685
+ Ja,
6584
6686
  {
6585
6687
  in: o,
6586
6688
  children: /* @__PURE__ */ n(
@@ -6594,12 +6696,12 @@ function ar() {
6594
6696
  {
6595
6697
  className: "flex flex-row gap-1 overflow-scroll no-scrollbar ",
6596
6698
  children: s.map((l) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
6597
- nt,
6699
+ ct,
6598
6700
  {
6599
- icon: /* @__PURE__ */ e(Ne, { size: "small" }),
6701
+ icon: /* @__PURE__ */ e(qe, { size: "small" }),
6600
6702
  colorScheme: "cyanLighter",
6601
6703
  onClick: r && i ? () => r.createCollection({
6602
- initialValues: { path: l, name: Ct(l) },
6704
+ initialValues: { path: l, name: Ot(l) },
6603
6705
  parentPathSegments: [],
6604
6706
  redirect: !0
6605
6707
  }) : void 0,
@@ -6615,30 +6717,30 @@ function ar() {
6615
6717
  }
6616
6718
  );
6617
6719
  }
6618
- function ua(t, a) {
6720
+ function ha(t, a) {
6619
6721
  const r = (a ?? []).map((s) => {
6620
6722
  const o = t?.find((l) => l.path === s.path || l.alias && s.alias && l.alias === s.alias);
6621
- return o ? ir(o, s) : s;
6723
+ return o ? mr(o, s) : s;
6622
6724
  }), i = t.filter((s) => !r.map((o) => o.path).includes(s.path) || !r.map((o) => o.alias).includes(s.alias));
6623
6725
  return [...r, ...i];
6624
6726
  }
6625
- function ir(t, a) {
6626
- const r = ua(t?.subcollections ?? [], a?.subcollections ?? []), i = { ...t.properties };
6727
+ function mr(t, a) {
6728
+ const r = ha(t?.subcollections ?? [], a?.subcollections ?? []), i = { ...t.properties };
6627
6729
  Object.keys(a.properties).forEach((u) => {
6628
6730
  const c = t.properties[u];
6629
- c ? i[u] = ha(c, a.properties[u]) : i[u] = a.properties[u];
6731
+ c ? i[u] = ga(c, a.properties[u]) : i[u] = a.properties[u];
6630
6732
  });
6631
- const s = $(t, a), o = Rt(t), l = Rt(a), d = [.../* @__PURE__ */ new Set([...o, ...l])], m = [.../* @__PURE__ */ new Set([...t.entityViews ?? [], ...a.entityViews ?? []])];
6733
+ const s = $(t, a), o = Ut(t), l = Ut(a), d = [.../* @__PURE__ */ new Set([...o, ...l])], m = [.../* @__PURE__ */ new Set([...t.entityViews ?? [], ...a.entityViews ?? []])];
6632
6734
  return {
6633
6735
  ...s,
6634
6736
  subcollections: r,
6635
- properties: Ya(i, d),
6737
+ properties: Qa(i, d),
6636
6738
  propertiesOrder: d,
6637
6739
  entityViews: m
6638
6740
  };
6639
6741
  }
6640
- function ha(t, a) {
6641
- if (le(a))
6742
+ function ga(t, a) {
6743
+ if (se(a))
6642
6744
  return a;
6643
6745
  {
6644
6746
  const r = $(t, a), i = !!t.editable, s = !!a.editable;
@@ -6646,19 +6748,25 @@ function ha(t, a) {
6646
6748
  const o = "properties" in t ? t.properties : {}, l = "properties" in a ? a.properties : {}, d = "propertiesOrder" in t && t.propertiesOrder ? t.propertiesOrder : Object.keys(o), m = "propertiesOrder" in a && a.propertiesOrder ? a.propertiesOrder : "properties" in a ? Object.keys(a.properties) : [], u = [.../* @__PURE__ */ new Set([...d, ...m])], c = { ...o };
6647
6749
  return Object.keys(a.properties).forEach((p) => {
6648
6750
  const g = o[p];
6649
- g && (c[p] = ha(g, l[p]));
6751
+ g && (c[p] = ga(g, l[p]));
6650
6752
  }), { ...r, editable: i && s, properties: c, propertiesOrder: u };
6651
6753
  }
6652
6754
  return { ...r, editable: i && s };
6653
6755
  }
6654
6756
  }
6655
- function Rt(t) {
6656
- return t.propertiesOrder && t.propertiesOrder.length > 0 ? t.propertiesOrder : [
6757
+ function Ut(t) {
6758
+ if (t.propertiesOrder && t.propertiesOrder.length > 0) {
6759
+ const a = t.propertiesOrder;
6760
+ return t.additionalFields && t.additionalFields.forEach((r) => {
6761
+ a.includes(r.key) || a.push(r.key);
6762
+ }), a;
6763
+ }
6764
+ return [
6657
6765
  ...Object.keys(t.properties),
6658
- ...(t.additionalFields ?? [])?.map((a) => a.id)
6766
+ ...(t.additionalFields ?? [])?.map((a) => a.key)
6659
6767
  ];
6660
6768
  }
6661
- function rr({
6769
+ function ur({
6662
6770
  propertyKey: t,
6663
6771
  onHover: a,
6664
6772
  property: r,
@@ -6666,9 +6774,9 @@ function rr({
6666
6774
  parentPathSegments: s,
6667
6775
  collection: o
6668
6776
  }) {
6669
- const l = Ee();
6777
+ const l = Be();
6670
6778
  return /* @__PURE__ */ e(ae, { title: "Edit", children: /* @__PURE__ */ e(
6671
- me,
6779
+ re,
6672
6780
  {
6673
6781
  className: a ? "bg-white dark:bg-gray-950" : "hidden",
6674
6782
  onClick: () => {
@@ -6681,16 +6789,16 @@ function rr({
6681
6789
  });
6682
6790
  },
6683
6791
  size: "small",
6684
- children: /* @__PURE__ */ e(Ke, { size: "small" })
6792
+ children: /* @__PURE__ */ e(Je, { size: "small" })
6685
6793
  }
6686
6794
  ) });
6687
6795
  }
6688
- function or({
6796
+ function hr({
6689
6797
  fullPath: t,
6690
6798
  parentPathSegments: a,
6691
6799
  collection: r
6692
6800
  }) {
6693
- const i = Re(), s = Ee(), o = s.configPermissions ? s.configPermissions({
6801
+ const i = Le(), s = Be(), o = s.configPermissions ? s.configPermissions({
6694
6802
  user: i.user,
6695
6803
  collection: r
6696
6804
  }).editCollections : !0;
@@ -6702,15 +6810,15 @@ function or({
6702
6810
  s.editProperty({
6703
6811
  editedCollectionPath: t,
6704
6812
  parentPathSegments: a,
6705
- currentPropertiesOrder: Ha(r),
6813
+ currentPropertiesOrder: Wa(r),
6706
6814
  collection: r
6707
6815
  });
6708
6816
  },
6709
- children: /* @__PURE__ */ e(Ne, { color: "inherit" })
6817
+ children: /* @__PURE__ */ e(qe, { color: "inherit" })
6710
6818
  }
6711
6819
  ) });
6712
6820
  }
6713
- function br({
6821
+ function Sr({
6714
6822
  collectionConfigController: t,
6715
6823
  configPermissions: a,
6716
6824
  reservedGroups: r,
@@ -6720,12 +6828,12 @@ function br({
6720
6828
  collectionInference: l,
6721
6829
  getData: d
6722
6830
  }) {
6723
- const m = Q(
6831
+ const m = J(
6724
6832
  (u) => {
6725
6833
  const c = (g) => {
6726
6834
  Xt(g.properties), g.subcollections?.forEach(c);
6727
6835
  }, p = t.collections ?? [];
6728
- return p.forEach(c), console.debug("Injecting collections", { editableCollections: p, collections: u }), ua(p, u);
6836
+ return p.forEach(c), console.debug("Injecting collections", { editableCollections: p, collections: u }), ha(p, u);
6729
6837
  },
6730
6838
  [t.collections]
6731
6839
  );
@@ -6734,10 +6842,10 @@ function br({
6734
6842
  loading: t.loading,
6735
6843
  collections: {
6736
6844
  injectCollections: m,
6737
- CollectionActions: Xi
6845
+ CollectionActions: lr
6738
6846
  },
6739
6847
  provider: {
6740
- Component: Wi,
6848
+ Component: sr,
6741
6849
  props: {
6742
6850
  collectionConfigController: t,
6743
6851
  configPermissions: a,
@@ -6750,18 +6858,18 @@ function br({
6750
6858
  }
6751
6859
  },
6752
6860
  homePage: {
6753
- additionalChildrenStart: /* @__PURE__ */ e(ar, {}),
6754
- CollectionActions: er,
6755
- AdditionalCards: tr
6861
+ additionalChildrenStart: /* @__PURE__ */ e(pr, {}),
6862
+ CollectionActions: cr,
6863
+ AdditionalCards: dr
6756
6864
  },
6757
6865
  collectionView: {
6758
- HeaderAction: rr,
6759
- AddColumnComponent: or
6866
+ HeaderAction: ur,
6867
+ AddColumnComponent: hr
6760
6868
  }
6761
6869
  };
6762
6870
  }
6763
- function yr({ path: t }) {
6764
- const a = sr(t), r = nr(t), i = Ee();
6871
+ function qr({ path: t }) {
6872
+ const a = fr(t), r = gr(t), i = Be();
6765
6873
  return /* @__PURE__ */ n("div", { className: "p-1 flex flex-col items-center", children: [
6766
6874
  /* @__PURE__ */ e(ta, { error: "No collection for path: " + a }),
6767
6875
  /* @__PURE__ */ e(
@@ -6772,7 +6880,7 @@ function yr({ path: t }) {
6772
6880
  size: "small",
6773
6881
  onClick: () => {
6774
6882
  i.createCollection({
6775
- initialValues: { path: a, name: Ct(a) },
6883
+ initialValues: { path: a, name: Ot(a) },
6776
6884
  parentPathSegments: r,
6777
6885
  redirect: !1
6778
6886
  });
@@ -6782,24 +6890,24 @@ function yr({ path: t }) {
6782
6890
  )
6783
6891
  ] });
6784
6892
  }
6785
- function nr(t) {
6893
+ function gr(t) {
6786
6894
  const a = t.split("/");
6787
6895
  return a.filter((r, i) => i % 2 === 0 && i !== a.length - 1);
6788
6896
  }
6789
- function sr(t) {
6897
+ function fr(t) {
6790
6898
  const a = t.split("/");
6791
6899
  return a[a.length - 1];
6792
6900
  }
6793
6901
  export {
6794
- yr as MissingReferenceWidget,
6795
- Le as editableProperty,
6796
- se as getFullId,
6797
- we as idToPropertiesPath,
6798
- Oe as namespaceToPropertiesOrderPath,
6799
- hi as namespaceToPropertiesPath,
6800
- _i as removeNonEditableProperties,
6801
- Ee as useCollectionEditorController,
6802
- br as useCollectionEditorPlugin,
6803
- ma as useCollectionsConfigController
6902
+ qr as MissingReferenceWidget,
6903
+ He as editableProperty,
6904
+ ne as getFullId,
6905
+ ke as idToPropertiesPath,
6906
+ Ne as namespaceToPropertiesOrderPath,
6907
+ _i as namespaceToPropertiesPath,
6908
+ Si as removeNonEditableProperties,
6909
+ Be as useCollectionEditorController,
6910
+ Sr as useCollectionEditorPlugin,
6911
+ ua as useCollectionsConfigController
6804
6912
  };
6805
6913
  //# sourceMappingURL=index.es.js.map