@rebasepro/admin 0.2.3 → 0.3.0

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 (210) hide show
  1. package/dist/{CollectionEditorDialog-CmGXXSY9.js → CollectionEditorDialog-D0VqpLPO.js} +70 -77
  2. package/dist/CollectionEditorDialog-D0VqpLPO.js.map +1 -0
  3. package/dist/{CollectionsStudioView-DcLHT5bU.js → CollectionsStudioView-Bc3Rxxc2.js} +5 -4
  4. package/dist/{CollectionsStudioView-DcLHT5bU.js.map → CollectionsStudioView-Bc3Rxxc2.js.map} +1 -1
  5. package/dist/{ExportCollectionAction-BfN34eWX.js → ExportCollectionAction-Ckc-09BQ.js} +4 -3
  6. package/dist/ExportCollectionAction-Ckc-09BQ.js.map +1 -0
  7. package/dist/{ImportCollectionAction-SZrInjhx.js → ImportCollectionAction-BqjIrC3Z.js} +3 -2
  8. package/dist/{ImportCollectionAction-SZrInjhx.js.map → ImportCollectionAction-BqjIrC3Z.js.map} +1 -1
  9. package/dist/{PropertyEditView-Cvryrb3B.js → PropertyEditView-CvRSV-A2.js} +128 -121
  10. package/dist/PropertyEditView-CvRSV-A2.js.map +1 -0
  11. package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -5
  12. package/dist/collection_editor/index.d.ts +0 -1
  13. package/dist/collection_editor/types/collection_editor_controller.d.ts +0 -2
  14. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -3
  15. package/dist/collection_editor_ui.js +3 -3
  16. package/dist/components/ArrayContainer.d.ts +2 -2
  17. package/dist/components/DefaultAppBar.d.ts +18 -1
  18. package/dist/components/DefaultDrawer.d.ts +51 -3
  19. package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
  20. package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
  21. package/dist/components/EntityCollectionTable/table_bindings.d.ts +4 -3
  22. package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +4 -3
  23. package/dist/components/EntityEditView.d.ts +2 -1
  24. package/dist/components/HomePage/HomePageDnD.d.ts +3 -3
  25. package/dist/components/PropertyCollectionView.d.ts +1 -1
  26. package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
  27. package/dist/components/SelectableTable/SelectionStore.d.ts +4 -1
  28. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -2
  29. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -2
  30. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -2
  31. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -2
  32. package/dist/components/admin/RolesView.d.ts +3 -3
  33. package/dist/components/admin/UsersView.d.ts +3 -3
  34. package/dist/components/app/Drawer.d.ts +8 -1
  35. package/dist/data_export/export/export.d.ts +3 -3
  36. package/dist/editor/components/editor-bubble.d.ts +5 -1
  37. package/dist/editor/components/image-bubble.d.ts +5 -1
  38. package/dist/editor/components/index.d.ts +3 -3
  39. package/dist/editor/components/table-bubble.d.ts +5 -1
  40. package/dist/editor/nodeViews/ReactNodeView.d.ts +4 -1
  41. package/dist/editor/useProseMirror.d.ts +2 -2
  42. package/dist/editor/utils/remove_classes.d.ts +1 -1
  43. package/dist/editor.js +15 -14
  44. package/dist/editor.js.map +1 -1
  45. package/dist/form/EntityForm.d.ts +2 -2
  46. package/dist/form/components/StorageUploadProgress.d.ts +2 -2
  47. package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
  48. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
  49. package/dist/form/validation.d.ts +3 -3
  50. package/dist/hooks/navigation/useResolvedCollections.d.ts +6 -0
  51. package/dist/hooks/navigation/useResolvedViews.d.ts +3 -4
  52. package/dist/{index-PLIQXpTt.js → index-BCcLwgfe.js} +3 -2
  53. package/dist/{index-PLIQXpTt.js.map → index-BCcLwgfe.js.map} +1 -1
  54. package/dist/{index-DjduZG1T.js → index-DY2k5TtG.js} +3 -3
  55. package/dist/index-DY2k5TtG.js.map +1 -0
  56. package/dist/{index-MKPc70-v.js → index-UQOMHwt1.js} +3 -3
  57. package/dist/index-UQOMHwt1.js.map +1 -0
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +2813 -372
  60. package/dist/index.js.map +1 -1
  61. package/dist/{markdown-z2Ir7Cgo.js → markdown-DD2JDU1X.js} +2 -2
  62. package/dist/markdown-DD2JDU1X.js.map +1 -0
  63. package/dist/preview/components/UrlComponentPreview.d.ts +1 -0
  64. package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
  65. package/dist/types/components/EntityFormProps.d.ts +2 -2
  66. package/dist/types/fields.d.ts +1 -1
  67. package/dist/{util-DbWax_sV.js → util-ZM9gQuCv.js} +2031 -2078
  68. package/dist/util-ZM9gQuCv.js.map +1 -0
  69. package/package.json +8 -8
  70. package/src/collection_editor/ConfigControllerProvider.tsx +3 -13
  71. package/src/collection_editor/index.ts +1 -3
  72. package/src/collection_editor/types/collection_editor_controller.tsx +0 -3
  73. package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -6
  74. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -6
  75. package/src/collection_editor/ui/EditorEntityAction.tsx +1 -6
  76. package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +7 -14
  77. package/src/collection_editor/ui/NewCollectionCard.tsx +1 -5
  78. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -8
  79. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +8 -12
  80. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +21 -21
  81. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -4
  82. package/src/collection_editor/ui/collection_editor/EnumForm.tsx +1 -1
  83. package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +3 -3
  84. package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +3 -3
  85. package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +8 -8
  86. package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +5 -5
  87. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
  88. package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +5 -5
  89. package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +5 -5
  90. package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
  91. package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -2
  92. package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +8 -8
  93. package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +5 -5
  94. package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +3 -2
  95. package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +2 -2
  96. package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
  97. package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +1 -1
  98. package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +4 -7
  99. package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +4 -4
  100. package/src/components/ArrayContainer.tsx +3 -3
  101. package/src/components/DefaultAppBar.tsx +52 -31
  102. package/src/components/DefaultDrawer.tsx +279 -66
  103. package/src/components/DrawerNavigationItem.tsx +1 -1
  104. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +6 -5
  105. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +9 -7
  106. package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
  107. package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +12 -9
  108. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
  109. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
  110. package/src/components/EntityCollectionTable/table_bindings.tsx +5 -4
  111. package/src/components/EntityCollectionView/EntityCollectionView.tsx +6 -4
  112. package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +1 -1
  113. package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +7 -6
  114. package/src/components/EntityDetailView.tsx +46 -24
  115. package/src/components/EntityEditView.tsx +51 -28
  116. package/src/components/EntityEditViewFormActions.tsx +4 -4
  117. package/src/components/EntityPreview.tsx +9 -4
  118. package/src/components/HomePage/HomePageDnD.tsx +3 -2
  119. package/src/components/PropertyCollectionView.tsx +1 -1
  120. package/src/components/PropertyIdCopyTooltip.tsx +1 -1
  121. package/src/components/RebaseLayout.tsx +5 -1
  122. package/src/components/RebaseNavigation.tsx +2 -2
  123. package/src/components/RebaseRouteDefs.tsx +4 -7
  124. package/src/components/RebaseShell.tsx +16 -13
  125. package/src/components/SearchIconsView.tsx +1 -8
  126. package/src/components/SelectableTable/SelectableTable.tsx +8 -11
  127. package/src/components/SelectableTable/SelectionStore.ts +1 -1
  128. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +3 -3
  129. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +3 -3
  130. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +5 -5
  131. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +3 -3
  132. package/src/components/SideEntityProvider.tsx +2 -1
  133. package/src/components/admin/RolesView.tsx +7 -2
  134. package/src/components/admin/UsersView.tsx +12 -6
  135. package/src/components/app/Drawer.tsx +9 -1
  136. package/src/components/app/Scaffold.tsx +5 -1
  137. package/src/data_export/export/export.ts +17 -17
  138. package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
  139. package/src/editor/components/editor-bubble.tsx +32 -9
  140. package/src/editor/components/image-bubble.tsx +27 -11
  141. package/src/editor/components/index.ts +3 -3
  142. package/src/editor/components/table-bubble.tsx +79 -17
  143. package/src/editor/extensions/HighlightDecorationExtension.ts +3 -2
  144. package/src/editor/nodeViews/ReactNodeView.tsx +1 -1
  145. package/src/editor/nodeViews/TaskItemComponent.tsx +9 -8
  146. package/src/editor/schema.ts +135 -59
  147. package/src/editor/selectors/link-selector.tsx +8 -5
  148. package/src/editor/useProseMirror.ts +2 -2
  149. package/src/editor/utils/remove_classes.ts +6 -5
  150. package/src/form/EntityForm.tsx +15 -15
  151. package/src/form/EntityFormActions.tsx +2 -2
  152. package/src/form/PropertyFieldBinding.tsx +64 -64
  153. package/src/form/components/FieldHelperText.tsx +4 -4
  154. package/src/form/components/StorageUploadProgress.tsx +2 -2
  155. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
  156. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
  157. package/src/form/field_bindings/BlockFieldBinding.tsx +54 -53
  158. package/src/form/field_bindings/KeyValueFieldBinding.tsx +290 -289
  159. package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
  160. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
  161. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -1
  162. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +1 -1
  163. package/src/form/field_bindings/ReferenceFieldBinding.tsx +8 -6
  164. package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
  165. package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
  166. package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
  167. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +84 -84
  168. package/src/form/field_bindings/SwitchFieldBinding.tsx +16 -16
  169. package/src/form/field_bindings/TextFieldBinding.tsx +77 -73
  170. package/src/form/field_bindings/UserSelectFieldBinding.tsx +17 -17
  171. package/src/form/validation.ts +43 -43
  172. package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -5
  173. package/src/hooks/navigation/useResolvedCollections.ts +27 -7
  174. package/src/hooks/navigation/useResolvedViews.tsx +24 -44
  175. package/src/index.ts +2 -0
  176. package/src/preview/PropertyPreview.tsx +2 -2
  177. package/src/preview/components/ImagePreview.tsx +2 -1
  178. package/src/preview/components/UrlComponentPreview.tsx +11 -2
  179. package/src/preview/components/UserPreview.tsx +1 -1
  180. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
  181. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -4
  182. package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +3 -3
  183. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
  184. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +3 -2
  185. package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -8
  186. package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +1 -1
  187. package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
  188. package/src/preview/property_previews/MapPropertyPreview.tsx +4 -3
  189. package/src/preview/property_previews/NumberPropertyPreview.tsx +5 -3
  190. package/src/preview/property_previews/StringPropertyPreview.tsx +10 -8
  191. package/src/types/components/EntityFormActionsProps.tsx +1 -1
  192. package/src/types/components/EntityFormProps.tsx +2 -2
  193. package/src/types/fields.tsx +2 -2
  194. package/dist/CollectionEditorDialog-CmGXXSY9.js.map +0 -1
  195. package/dist/ContentHomePage-C7vFqKSe.js +0 -1784
  196. package/dist/ContentHomePage-C7vFqKSe.js.map +0 -1
  197. package/dist/ExportCollectionAction-BfN34eWX.js.map +0 -1
  198. package/dist/PropertyEditView-Cvryrb3B.js.map +0 -1
  199. package/dist/RoleChip-QtUFXeTp.js +0 -67
  200. package/dist/RoleChip-QtUFXeTp.js.map +0 -1
  201. package/dist/RolesView-BCb7qwWs.js +0 -437
  202. package/dist/RolesView-BCb7qwWs.js.map +0 -1
  203. package/dist/UsersView-Cex24r8H.js +0 -408
  204. package/dist/UsersView-Cex24r8H.js.map +0 -1
  205. package/dist/collection_editor/types/config_permissions.d.ts +0 -19
  206. package/dist/index-DjduZG1T.js.map +0 -1
  207. package/dist/index-MKPc70-v.js.map +0 -1
  208. package/dist/markdown-z2Ir7Cgo.js.map +0 -1
  209. package/dist/util-DbWax_sV.js.map +0 -1
  210. package/src/collection_editor/types/config_permissions.ts +0 -20
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
- import { be as useCMSContext, bh as useCollectionRegistryController, bj as useEntitySelectionDialog, a9 as ReferencePreview, bt as useUrlController, s as Drawer, A as AppBar, ah as SideDialogs, ac as Scaffold, a4 as RebaseNavigation, a6 as RebaseRouteDefs, a2 as PropertyPreview, bg as useCollectionEditorController } from "./util-DbWax_sV.js";
2
- import { a, b, c, d, e, f, g, h, i, j, B, k, C, l, m, n, D, o, p, q, r, E, t, u, v, w, x, y, z, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a3, a5, a7, a8, aa, ab, ad, ae, af, ag, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, bf, bi, bk, bl, bm, bn, bo, bp, bq, br, bs, bu, bv } from "./util-DbWax_sV.js";
1
+ import { bk as useCMSContext, bn as useCollectionRegistryController, bp as useEntitySelectionDialog, ac as ReferencePreview, bz as useUrlController, t as Drawer, A as AppBar, am as SideDialogs, ah as Scaffold, bs as useNavigationStateController, a1 as NavigationCard, bf as useBreadcrumbsController, z as EntityCollectionView, G as EntityDetailView, H as EntityEditView, ag as RolesView, C as CollectionEditorDialogs, a9 as RebaseNavigation, a7 as PropertyPreview, bm as useCollectionEditorController, af as RoleChip } from "./util-ZM9gQuCv.js";
2
+ import { a, b, c, d, e, f, g, h, i, j, B, k, l, m, n, D, o, p, q, r, s, u, E, v, w, x, y, F, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, $, a0, a2, a3, a4, a5, a6, a8, aa, ab, ad, ae, ai, aj, ak, al, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bg, bh, bi, bj, bl, bo, bq, br, bt, bu, bv, bw, bx, by, bA, bB } from "./util-ZM9gQuCv.js";
3
3
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
4
4
  import { c as c2 } from "react-compiler-runtime";
5
- import { Button, cls, CircularProgressCenter, ErrorBoundary, SelectItem, Select, MultiSelectItem, MultiSelect } from "@rebasepro/ui";
6
- import { useAdminModeController, useRebaseRegistryDispatch, useRebaseRegistry, useAuthController, LoginView, useTranslation, ErrorView, useInternalUserManagementController } from "@rebasepro/core";
7
- import React__default, { useState, useEffect, useMemo, useCallback, useLayoutEffect } from "react";
5
+ import { Button, cls, CircularProgressCenter, Chip, StarIcon, Collapse, IconButton, PencilIcon, iconSize, ExpandablePanel, Typography, DialogTitle, TextField, DialogContent, DialogActions, Dialog, Container, SearchBar, ErrorBoundary, SelectItem, Select, MultiSelectItem, MultiSelect } from "@rebasepro/ui";
6
+ import React__default, { useState, useEffect, useMemo, useCallback, useLayoutEffect, useRef, Suspense } from "react";
7
+ import "fast-equals";
8
8
  import { getNavigationEntriesFromPath, getReferenceFrom, getLastSegment } from "@rebasepro/common";
9
9
  import { addInitialSlash, getCollectionBySlugWithin, getCollectionPathsCombinations, getLastSegment as getLastSegment2, removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, resolveCollectionPathIds } from "@rebasepro/common";
10
- import "date-fns";
11
- import "date-fns/locale";
12
- import { prettifyIdentifier } from "@rebasepro/utils";
13
- import "fast-equals";
10
+ import { useAdminModeController, useRebaseRegistryDispatch, useRebaseRegistry, useAuthController, LoginView, useUserConfigurationPersistence, useTranslation, useRebaseContext, useSlot, IconForView, useCustomizationController, buildCollapsedDefaults, useCollapsedGroups, useRestoreScroll, BootstrapAdminBanner, NotFoundPage, UnsavedChangesDialog, useInternalUserManagementController, UIReferenceView, RebaseRoutes, UserSettingsView, ErrorView } from "@rebasepro/core";
14
11
  import "@rebasepro/formex";
15
12
  import "zod";
16
- import "@dnd-kit/core";
17
- import "@dnd-kit/modifiers";
18
- import "@dnd-kit/sortable";
19
- import "@dnd-kit/utilities";
20
- import "react-dropzone";
13
+ import { toArray, prettifyIdentifier } from "@rebasepro/utils";
14
+ import "date-fns";
15
+ import "date-fns/locale";
21
16
  import "@rebasepro/types";
22
- import { useLocation, Outlet } from "react-router-dom";
17
+ import { useSensor, MouseSensor, TouchSensor, KeyboardSensor, useSensors, closestCenter, pointerWithin, closestCorners, getFirstCollision, rectIntersection, useDroppable, useDndMonitor, DndContext, MeasuringStrategy, DragOverlay } from "@dnd-kit/core";
18
+ import { restrictToVerticalAxis, restrictToWindowEdges } from "@dnd-kit/modifiers";
19
+ import { useSortable, arrayMove, defaultAnimateLayoutChanges, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from "@dnd-kit/sortable";
20
+ import { CSS } from "@dnd-kit/utilities";
21
+ import "react-dropzone";
22
+ import { useLocation, Outlet, useNavigate, useBlocker, Route } from "react-router-dom";
23
+ import Fuse from "fuse.js";
23
24
  import "exceljs";
24
25
  import "@rebasepro/schema-inference";
25
26
  import { u as u2 } from "./useEntityHistory-UVsSclfZ.js";
26
- import { I as I2, a as a2, P as P2 } from "./ImportCollectionAction-SZrInjhx.js";
27
- import { B as B2, E as E2, d as d2, a as a4, b as b10, g as g2, c as c3 } from "./ExportCollectionAction-BfN34eWX.js";
28
- import { R as RoleChip } from "./RoleChip-QtUFXeTp.js";
27
+ import { I as I2, a as a7, P as P2 } from "./ImportCollectionAction-BqjIrC3Z.js";
28
+ import { B as B2, E as E2, d as d2, a as a9, b as b10, g as g2, c as c3 } from "./ExportCollectionAction-Ckc-09BQ.js";
29
29
  function resolveNavigationFrom({
30
30
  path,
31
31
  context
@@ -358,7 +358,7 @@ function RebaseLayout(props) {
358
358
  const adminModeController = useAdminModeController();
359
359
  let t4;
360
360
  if ($2[2] !== appBar) {
361
- t4 = appBar ?? /* @__PURE__ */ jsx(AppBar, {});
361
+ t4 = appBar ?? /* @__PURE__ */ jsx(AppBar, { includeLanguageToggle: false, includeModeToggle: false, includeUserMenu: false });
362
362
  $2[2] = appBar;
363
363
  $2[3] = t4;
364
364
  } else {
@@ -414,290 +414,2728 @@ function RebaseLayout(props) {
414
414
  }
415
415
  return t9;
416
416
  }
417
- function RebaseShell(props) {
418
- const $2 = c2(11);
417
+ function NavigationChip(t0) {
418
+ const $2 = c2(18);
419
419
  const {
420
- title: t0,
421
- appBar,
422
- drawer,
423
- autoOpenDrawer: t1,
424
- children
425
- } = props;
426
- const title = t0 === void 0 ? "Rebase" : t0;
427
- const autoOpenDrawer = t1 === void 0 ? false : t1;
428
- const registry = useRebaseRegistry();
429
- registry.studioConfig?.devViews;
420
+ entry
421
+ } = t0;
422
+ const navigate = useNavigate();
423
+ const userConfigurationPersistence = useUserConfigurationPersistence();
424
+ if (!userConfigurationPersistence) {
425
+ return null;
426
+ }
427
+ let t1;
428
+ if ($2[0] !== entry.slug || $2[1] !== userConfigurationPersistence.favouritePaths) {
429
+ t1 = userConfigurationPersistence.favouritePaths.includes(entry.slug);
430
+ $2[0] = entry.slug;
431
+ $2[1] = userConfigurationPersistence.favouritePaths;
432
+ $2[2] = t1;
433
+ } else {
434
+ t1 = $2[2];
435
+ }
436
+ const favourite = t1;
430
437
  let t2;
431
- let t3;
432
- if ($2[0] !== registry.studioConfig?.devViews) {
433
- t3 = registry.studioConfig?.devViews ?? [];
434
- $2[0] = registry.studioConfig?.devViews;
435
- $2[1] = t3;
438
+ if ($2[3] !== entry.slug || $2[4] !== favourite || $2[5] !== userConfigurationPersistence) {
439
+ t2 = (e2) => {
440
+ e2.preventDefault();
441
+ e2.stopPropagation();
442
+ if (favourite) {
443
+ userConfigurationPersistence.setFavouritePaths(userConfigurationPersistence.favouritePaths.filter((p2) => p2 !== entry.slug));
444
+ } else {
445
+ userConfigurationPersistence.setFavouritePaths([...userConfigurationPersistence.favouritePaths, entry.slug]);
446
+ }
447
+ };
448
+ $2[3] = entry.slug;
449
+ $2[4] = favourite;
450
+ $2[5] = userConfigurationPersistence;
451
+ $2[6] = t2;
436
452
  } else {
437
- t3 = $2[1];
453
+ t2 = $2[6];
438
454
  }
439
- t2 = t3;
440
- const devViews = t2;
441
- let t4;
442
- if ($2[2] !== appBar || $2[3] !== autoOpenDrawer || $2[4] !== devViews || $2[5] !== drawer || $2[6] !== title) {
443
- t4 = /* @__PURE__ */ jsx(RebaseLayout, { title, appBar, drawer, autoOpenDrawer, devViews });
444
- $2[2] = appBar;
445
- $2[3] = autoOpenDrawer;
446
- $2[4] = devViews;
447
- $2[5] = drawer;
448
- $2[6] = title;
449
- $2[7] = t4;
455
+ const onIconClick = t2;
456
+ let t3;
457
+ if ($2[7] !== entry.url || $2[8] !== navigate) {
458
+ t3 = () => navigate(entry.url);
459
+ $2[7] = entry.url;
460
+ $2[8] = navigate;
461
+ $2[9] = t3;
450
462
  } else {
451
- t4 = $2[7];
463
+ t3 = $2[9];
452
464
  }
465
+ const t4 = favourite ? "text-secondary" : "text-surface-400 dark:text-surface-500";
453
466
  let t5;
454
- if ($2[8] !== children || $2[9] !== t4) {
455
- t5 = /* @__PURE__ */ jsx(RebaseAuthGate, { children: /* @__PURE__ */ jsx(RebaseNavigation, { children: /* @__PURE__ */ jsx(RebaseRouteDefs, { layout: t4, children }) }) });
456
- $2[8] = children;
457
- $2[9] = t4;
458
- $2[10] = t5;
467
+ if ($2[10] !== onIconClick || $2[11] !== t4) {
468
+ t5 = /* @__PURE__ */ jsx(StarIcon, { onClick: onIconClick, size: "small", className: t4 });
469
+ $2[10] = onIconClick;
470
+ $2[11] = t4;
471
+ $2[12] = t5;
459
472
  } else {
460
- t5 = $2[10];
473
+ t5 = $2[12];
461
474
  }
462
- return t5;
475
+ let t6;
476
+ if ($2[13] !== entry.name || $2[14] !== entry.slug || $2[15] !== t3 || $2[16] !== t5) {
477
+ t6 = /* @__PURE__ */ jsx(Chip, { onClick: t3, icon: t5, children: entry.name }, entry.slug);
478
+ $2[13] = entry.name;
479
+ $2[14] = entry.slug;
480
+ $2[15] = t3;
481
+ $2[16] = t5;
482
+ $2[17] = t6;
483
+ } else {
484
+ t6 = $2[17];
485
+ }
486
+ return t6;
463
487
  }
464
- function ArrayOfMapsPreview(t0) {
465
- const $2 = c2(9);
488
+ function FavouritesView(t0) {
489
+ const $2 = c2(17);
490
+ const navigationStateController = useNavigationStateController();
491
+ const userConfigurationPersistence = useUserConfigurationPersistence();
492
+ if (!userConfigurationPersistence) {
493
+ return null;
494
+ }
466
495
  let t1;
467
- let t2;
468
- let t3;
469
- if ($2[0] !== t0) {
470
- t3 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
471
- bb0: {
472
- const {
473
- propertyKey,
474
- value,
475
- property,
476
- size
477
- } = t0;
478
- if (Array.isArray(property?.of)) {
479
- throw Error("Using array properties instead of single one in `of` in ArrayProperty");
480
- }
481
- if (property?.type !== "array" || !property.of || property.of.type !== "map") {
482
- throw Error("Picked wrong preview component ArrayOfMapsPreview");
483
- }
484
- const mapProperty = property.of;
485
- const properties = mapProperty.properties;
486
- if (!properties) {
487
- throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property ${propertyKey}`);
488
- }
489
- const values = value;
490
- const previewProperties = mapProperty.previewProperties;
491
- if (!values) {
492
- t3 = null;
493
- break bb0;
494
- }
495
- let mapProperties;
496
- mapProperties = previewProperties;
497
- if (!mapProperties || !mapProperties.length) {
498
- mapProperties = Object.keys(properties);
499
- if (size) {
500
- mapProperties = mapProperties.slice(0, 3);
501
- }
502
- }
503
- t2 = "table-auto text-xs";
504
- t1 = values && values.map((v2, index) => /* @__PURE__ */ jsx("div", { className: "border-b last:border-b-0 py-2", children: mapProperties && mapProperties.map((key) => /* @__PURE__ */ jsx("div", { className: "table-cell", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyPreview, { propertyKey: key, value: v2[key], property: properties[key], size: "small" }) }) }, `table-cell-${key}`)) }, `table_${v2}_${index}`));
505
- }
506
- $2[0] = t0;
496
+ if ($2[0] !== userConfigurationPersistence?.favouritePaths) {
497
+ t1 = userConfigurationPersistence?.favouritePaths ?? [];
498
+ $2[0] = userConfigurationPersistence?.favouritePaths;
507
499
  $2[1] = t1;
508
- $2[2] = t2;
509
- $2[3] = t3;
510
500
  } else {
511
501
  t1 = $2[1];
512
- t2 = $2[2];
513
- t3 = $2[3];
514
- }
515
- if (t3 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
516
- return t3;
517
502
  }
503
+ let T0;
504
+ let t2;
505
+ let t3;
518
506
  let t4;
519
- if ($2[4] !== t1) {
520
- t4 = /* @__PURE__ */ jsx("div", { children: t1 });
521
- $2[4] = t1;
522
- $2[5] = t4;
507
+ if ($2[2] !== navigationStateController || $2[3] !== t1) {
508
+ let t52;
509
+ if ($2[8] !== navigationStateController) {
510
+ t52 = (path) => navigationStateController.topLevelNavigation?.navigationEntries.find((entry) => entry.slug === path);
511
+ $2[8] = navigationStateController;
512
+ $2[9] = t52;
513
+ } else {
514
+ t52 = $2[9];
515
+ }
516
+ const favouriteCollections = t1.map(t52).filter(Boolean);
517
+ T0 = Collapse;
518
+ t4 = favouriteCollections.length > 0;
519
+ t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
520
+ t3 = favouriteCollections.map(_temp$3);
521
+ $2[2] = navigationStateController;
522
+ $2[3] = t1;
523
+ $2[4] = T0;
524
+ $2[5] = t2;
525
+ $2[6] = t3;
526
+ $2[7] = t4;
523
527
  } else {
524
- t4 = $2[5];
528
+ T0 = $2[4];
529
+ t2 = $2[5];
530
+ t3 = $2[6];
531
+ t4 = $2[7];
525
532
  }
526
533
  let t5;
527
- if ($2[6] !== t2 || $2[7] !== t4) {
528
- t5 = /* @__PURE__ */ jsx("div", { className: t2, children: t4 });
529
- $2[6] = t2;
530
- $2[7] = t4;
531
- $2[8] = t5;
534
+ if ($2[10] !== t2 || $2[11] !== t3) {
535
+ t5 = /* @__PURE__ */ jsx("div", { className: t2, children: t3 });
536
+ $2[10] = t2;
537
+ $2[11] = t3;
538
+ $2[12] = t5;
532
539
  } else {
533
- t5 = $2[8];
540
+ t5 = $2[12];
534
541
  }
535
- return t5;
542
+ let t6;
543
+ if ($2[13] !== T0 || $2[14] !== t4 || $2[15] !== t5) {
544
+ t6 = /* @__PURE__ */ jsx(T0, { in: t4, children: t5 });
545
+ $2[13] = T0;
546
+ $2[14] = t4;
547
+ $2[15] = t5;
548
+ $2[16] = t6;
549
+ } else {
550
+ t6 = $2[16];
551
+ }
552
+ return t6;
536
553
  }
537
- function MissingReferenceWidget(t0) {
538
- const $2 = c2(22);
554
+ function _temp$3(entry_0) {
555
+ return /* @__PURE__ */ jsx(NavigationChip, { entry: entry_0 }, entry_0.slug);
556
+ }
557
+ function NavigationGroup(t0) {
558
+ const $2 = c2(45);
539
559
  const {
540
- path: pathProp
560
+ children,
561
+ group,
562
+ minimised,
563
+ isPreview,
564
+ isPotentialCardDropTarget,
565
+ onEditGroup,
566
+ dndDisabled,
567
+ collapsed,
568
+ onToggleCollapsed
541
569
  } = t0;
542
- const registry = useCollectionRegistryController();
543
- const path = getLastSegment(pathProp);
570
+ const {
571
+ t
572
+ } = useTranslation();
573
+ const [isHovered, setIsHovered] = useState(false);
544
574
  let t1;
545
- if ($2[0] !== pathProp || $2[1] !== registry) {
546
- t1 = registry.getParentCollectionSlugs(pathProp);
547
- $2[0] = pathProp;
548
- $2[1] = registry;
575
+ if ($2[0] !== group || $2[1] !== t) {
576
+ t1 = group ?? t("views_group");
577
+ $2[0] = group;
578
+ $2[1] = t;
549
579
  $2[2] = t1;
550
580
  } else {
551
581
  t1 = $2[2];
552
582
  }
553
- const parentCollectionSlugs = t1;
554
- let t2;
555
- if ($2[3] !== pathProp || $2[4] !== registry) {
556
- t2 = registry.getParentEntityIds(pathProp);
557
- $2[3] = pathProp;
558
- $2[4] = registry;
559
- $2[5] = t2;
583
+ const currentGroupName = t1;
584
+ const showCaret = !isPreview && !!onToggleCollapsed;
585
+ const t2 = isPreview ? "px-1 py-0.5" : "";
586
+ let t3;
587
+ if ($2[3] !== t2) {
588
+ t3 = cls("flex items-center", t2);
589
+ $2[3] = t2;
590
+ $2[4] = t3;
560
591
  } else {
561
- t2 = $2[5];
592
+ t3 = $2[4];
562
593
  }
563
- const parentEntityIds = t2;
564
- const collectionEditor = useCollectionEditorController();
565
- const {
566
- t: t3
567
- } = useTranslation();
568
- const t32 = "p-1 flex flex-col items-center";
569
- const T0 = ErrorView;
570
- const t4 = t3("studio_missing_reference_error", {
571
- path
572
- });
594
+ const t4 = isPreview ? "body2" : "caption";
573
595
  let t5;
574
- if ($2[6] !== T0 || $2[7] !== t4) {
575
- t5 = /* @__PURE__ */ jsx(T0, { error: t4 });
576
- $2[6] = T0;
577
- $2[7] = t4;
578
- $2[8] = t5;
596
+ if ($2[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
597
+ t5 = cls("px-4 py-1 rounded", "font-semibold text-[11px] uppercase tracking-wider text-surface-400 dark:text-surface-400");
598
+ $2[5] = t5;
579
599
  } else {
580
- t5 = $2[8];
600
+ t5 = $2[5];
581
601
  }
582
602
  let t6;
583
- if ($2[9] !== collectionEditor || $2[10] !== parentCollectionSlugs || $2[11] !== parentEntityIds || $2[12] !== path) {
584
- t6 = () => {
585
- collectionEditor.createCollection({
586
- initialValues: {
587
- path,
588
- name: prettifyIdentifier(path)
589
- },
590
- parentCollectionSlugs,
591
- parentEntityIds,
592
- redirect: false,
593
- sourceClick: "missing_reference"
594
- });
595
- };
596
- $2[9] = collectionEditor;
597
- $2[10] = parentCollectionSlugs;
598
- $2[11] = parentEntityIds;
599
- $2[12] = path;
600
- $2[13] = t6;
603
+ if ($2[6] !== currentGroupName || $2[7] !== t4) {
604
+ t6 = /* @__PURE__ */ jsx(Typography, { variant: t4, component: "h2", color: "secondary", className: t5, children: currentGroupName });
605
+ $2[6] = currentGroupName;
606
+ $2[7] = t4;
607
+ $2[8] = t6;
601
608
  } else {
602
- t6 = $2[13];
609
+ t6 = $2[8];
603
610
  }
604
611
  let t7;
605
- if ($2[14] !== t3) {
606
- t7 = t3("studio_missing_reference_create");
607
- $2[14] = t3;
608
- $2[15] = t7;
612
+ if ($2[9] !== currentGroupName || $2[10] !== dndDisabled || $2[11] !== isHovered || $2[12] !== isPreview || $2[13] !== onEditGroup) {
613
+ t7 = !isPreview && onEditGroup && !dndDisabled && /* @__PURE__ */ jsx(IconButton, { size: "smallest", onClick: (e2) => {
614
+ e2.stopPropagation();
615
+ onEditGroup(currentGroupName);
616
+ }, className: cls("ml-2 ", isHovered ? "opacity-100" : "opacity-0", "transition-opacity duration-100"), children: /* @__PURE__ */ jsx(PencilIcon, { size: iconSize.smallest }) });
617
+ $2[9] = currentGroupName;
618
+ $2[10] = dndDisabled;
619
+ $2[11] = isHovered;
620
+ $2[12] = isPreview;
621
+ $2[13] = onEditGroup;
622
+ $2[14] = t7;
609
623
  } else {
610
- t7 = $2[15];
624
+ t7 = $2[14];
611
625
  }
612
626
  let t8;
613
- if ($2[16] !== t6 || $2[17] !== t7) {
614
- t8 = /* @__PURE__ */ jsx(Button, { className: "mx-2", size: "small", onClick: t6, children: t7 });
627
+ if ($2[15] !== t3 || $2[16] !== t6 || $2[17] !== t7) {
628
+ t8 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
629
+ t6,
630
+ t7
631
+ ] });
632
+ $2[15] = t3;
615
633
  $2[16] = t6;
616
634
  $2[17] = t7;
617
635
  $2[18] = t8;
618
636
  } else {
619
637
  t8 = $2[18];
620
638
  }
621
- let t9;
622
- if ($2[19] !== t5 || $2[20] !== t8) {
623
- t9 = /* @__PURE__ */ jsxs("div", { className: t32, children: [
624
- t5,
625
- t8
626
- ] });
627
- $2[19] = t5;
628
- $2[20] = t8;
629
- $2[21] = t9;
639
+ const TitleContent = t8;
640
+ const t9 = !isPotentialCardDropTarget ? "my-10" : "my-6";
641
+ let t10;
642
+ if ($2[19] !== t9) {
643
+ t10 = cls(t9, "transition-all duration-200 ease-in-out");
644
+ $2[19] = t9;
645
+ $2[20] = t10;
630
646
  } else {
631
- t9 = $2[21];
647
+ t10 = $2[20];
632
648
  }
633
- return t9;
634
- }
635
- function RolesFilterSelect(t0) {
636
- const $2 = c2(20);
637
- const {
638
- tableController
639
- } = t0;
640
- const {
641
- t: t2
642
- } = useTranslation();
643
- const userManagement = useInternalUserManagementController();
644
- let t1;
645
- if ($2[0] !== userManagement?.roles) {
646
- t1 = userManagement?.roles || [];
647
- $2[0] = userManagement?.roles;
648
- $2[1] = t1;
649
+ let t11;
650
+ if ($2[21] !== TitleContent || $2[22] !== children || $2[23] !== isPreview) {
651
+ t11 = isPreview && /* @__PURE__ */ jsxs(Fragment, { children: [
652
+ /* @__PURE__ */ jsx("div", { className: cls("flex items-center justify-between w-full", "p-4 py-2"), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: TitleContent }),
653
+ children
654
+ ] });
655
+ $2[21] = TitleContent;
656
+ $2[22] = children;
657
+ $2[23] = isPreview;
658
+ $2[24] = t11;
649
659
  } else {
650
- t1 = $2[1];
660
+ t11 = $2[24];
651
661
  }
652
- const roles = t1;
653
- const currentFilterValue = tableController.filterValues?.roles?.[1] || "";
654
- let t22;
655
- if ($2[2] !== tableController) {
656
- t22 = (newRole) => {
657
- const filterVal = newRole === "" ? void 0 : newRole;
658
- if (filterVal) {
659
- tableController.setFilterValues?.({
660
- ...tableController.filterValues,
661
- roles: ["array-contains", filterVal]
662
- });
663
- } else {
664
- const nextFilters = {
665
- ...tableController.filterValues
666
- };
667
- delete nextFilters.roles;
668
- tableController.setFilterValues?.(nextFilters);
662
+ let t12;
663
+ if ($2[25] !== TitleContent || $2[26] !== children || $2[27] !== collapsed || $2[28] !== isPreview || $2[29] !== minimised || $2[30] !== onToggleCollapsed || $2[31] !== showCaret) {
664
+ t12 = !isPreview && showCaret && /* @__PURE__ */ jsx(ExpandablePanel, { invisible: true, expanded: !collapsed, onExpandedChange: (open) => {
665
+ if (open !== !collapsed) {
666
+ onToggleCollapsed?.();
669
667
  }
670
- };
671
- $2[2] = tableController;
672
- $2[3] = t22;
668
+ }, className: cls("mt-6"), titleClassName: cls("min-h-0 p-0 border-none", "rounded flex items-center justify-between w-full", "hover:bg-transparent", "cursor-pointer select-none", collapsed && "bg-surface-100 dark:bg-surface-900/50"), innerClassName: cls("mt-4", !minimised ? "pt-0" : ""), title: /* @__PURE__ */ jsx("div", { onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), className: "flex items-center", children: TitleContent }), children: minimised ? /* @__PURE__ */ jsx("div", { className: cls("mt-4 p-8 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg"), style: {
669
+ minHeight: "50px"
670
+ } }) : /* @__PURE__ */ jsx("div", { className: cls("mt-4", !minimised ? "pt-0" : ""), children }) });
671
+ $2[25] = TitleContent;
672
+ $2[26] = children;
673
+ $2[27] = collapsed;
674
+ $2[28] = isPreview;
675
+ $2[29] = minimised;
676
+ $2[30] = onToggleCollapsed;
677
+ $2[31] = showCaret;
678
+ $2[32] = t12;
673
679
  } else {
674
- t22 = $2[3];
675
- }
676
- const handleRoleChange = t22;
677
- if (!roles || roles.length === 0) {
678
- return null;
680
+ t12 = $2[32];
679
681
  }
680
- const t3 = currentFilterValue || "__all__";
681
- let t4;
682
- if ($2[4] !== handleRoleChange) {
683
- t4 = (v2) => handleRoleChange(v2 === "__all__" ? "" : v2);
684
- $2[4] = handleRoleChange;
685
- $2[5] = t4;
682
+ let t13;
683
+ if ($2[33] !== TitleContent || $2[34] !== children || $2[35] !== collapsed || $2[36] !== isPreview || $2[37] !== minimised || $2[38] !== showCaret) {
684
+ t13 = !isPreview && !showCaret && /* @__PURE__ */ jsxs(Fragment, { children: [
685
+ /* @__PURE__ */ jsx("div", { className: cls("flex items-center justify-between w-full", "mt-6"), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: TitleContent }),
686
+ !collapsed && (minimised ? /* @__PURE__ */ jsx("div", { className: cls("mt-4 p-8 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg"), style: {
687
+ minHeight: "50px"
688
+ } }) : /* @__PURE__ */ jsx("div", { className: cls("mt-4", !minimised ? "pt-0" : ""), children }))
689
+ ] });
690
+ $2[33] = TitleContent;
691
+ $2[34] = children;
692
+ $2[35] = collapsed;
693
+ $2[36] = isPreview;
694
+ $2[37] = minimised;
695
+ $2[38] = showCaret;
696
+ $2[39] = t13;
686
697
  } else {
687
- t4 = $2[5];
698
+ t13 = $2[39];
699
+ }
700
+ let t14;
701
+ if ($2[40] !== t10 || $2[41] !== t11 || $2[42] !== t12 || $2[43] !== t13) {
702
+ t14 = /* @__PURE__ */ jsxs("div", { className: t10, children: [
703
+ t11,
704
+ t12,
705
+ t13
706
+ ] });
707
+ $2[40] = t10;
708
+ $2[41] = t11;
709
+ $2[42] = t12;
710
+ $2[43] = t13;
711
+ $2[44] = t14;
712
+ } else {
713
+ t14 = $2[44];
714
+ }
715
+ return t14;
716
+ }
717
+ function NavigationCardBinding(t0) {
718
+ const $2 = c2(38);
719
+ const {
720
+ slug,
721
+ collection,
722
+ view,
723
+ url,
724
+ name,
725
+ description,
726
+ onClick,
727
+ shrink
728
+ } = t0;
729
+ const userConfigurationPersistence = useUserConfigurationPersistence();
730
+ const t1 = collection ?? view;
731
+ let t2;
732
+ if ($2[0] !== t1) {
733
+ t2 = /* @__PURE__ */ jsx(IconForView, { collectionOrView: t1 });
734
+ $2[0] = t1;
735
+ $2[1] = t2;
736
+ } else {
737
+ t2 = $2[1];
738
+ }
739
+ const collectionIcon = t2;
740
+ const navigate = useNavigate();
741
+ const context = useRebaseContext();
742
+ let t3;
743
+ if ($2[2] !== userConfigurationPersistence?.favouritePaths) {
744
+ t3 = userConfigurationPersistence?.favouritePaths ?? [];
745
+ $2[2] = userConfigurationPersistence?.favouritePaths;
746
+ $2[3] = t3;
747
+ } else {
748
+ t3 = $2[3];
749
+ }
750
+ let t4;
751
+ if ($2[4] !== slug || $2[5] !== t3) {
752
+ t4 = t3.includes(slug);
753
+ $2[4] = slug;
754
+ $2[5] = t3;
755
+ $2[6] = t4;
756
+ } else {
757
+ t4 = $2[6];
758
+ }
759
+ const favourite = t4;
760
+ let t5;
761
+ if ($2[7] !== favourite || $2[8] !== slug || $2[9] !== userConfigurationPersistence) {
762
+ t5 = userConfigurationPersistence ? [/* @__PURE__ */ jsx(IconButton, { size: "small", onClick: (e2) => {
763
+ e2.preventDefault();
764
+ e2.stopPropagation();
765
+ if (favourite) {
766
+ userConfigurationPersistence.setFavouritePaths(userConfigurationPersistence.favouritePaths.filter((p2) => p2 !== slug));
767
+ } else {
768
+ userConfigurationPersistence.setFavouritePaths([...userConfigurationPersistence.favouritePaths, slug]);
769
+ }
770
+ }, children: /* @__PURE__ */ jsx(StarIcon, { className: favourite ? "text-secondary" : "text-surface-400 dark:text-surface-500" }) }, "favourite")] : [];
771
+ $2[7] = favourite;
772
+ $2[8] = slug;
773
+ $2[9] = userConfigurationPersistence;
774
+ $2[10] = t5;
775
+ } else {
776
+ t5 = $2[10];
777
+ }
778
+ const actionsArray = t5;
779
+ let t6;
780
+ if ($2[11] !== collection || $2[12] !== context || $2[13] !== slug) {
781
+ t6 = {
782
+ slug,
783
+ collection,
784
+ context
785
+ };
786
+ $2[11] = collection;
787
+ $2[12] = context;
788
+ $2[13] = slug;
789
+ $2[14] = t6;
790
+ } else {
791
+ t6 = $2[14];
792
+ }
793
+ const pluginCardActions = useSlot("home.collection.actions", t6);
794
+ let t7;
795
+ if ($2[15] !== collection || $2[16] !== context || $2[17] !== slug) {
796
+ t7 = {
797
+ slug,
798
+ collection,
799
+ context
800
+ };
801
+ $2[15] = collection;
802
+ $2[16] = context;
803
+ $2[17] = slug;
804
+ $2[18] = t7;
805
+ } else {
806
+ t7 = $2[18];
807
+ }
808
+ const pluginCardInsights = useSlot("home.card.insight", t7);
809
+ let t8;
810
+ if ($2[19] !== actionsArray || $2[20] !== pluginCardActions) {
811
+ t8 = /* @__PURE__ */ jsxs(Fragment, { children: [
812
+ actionsArray,
813
+ pluginCardActions
814
+ ] });
815
+ $2[19] = actionsArray;
816
+ $2[20] = pluginCardActions;
817
+ $2[21] = t8;
818
+ } else {
819
+ t8 = $2[21];
820
+ }
821
+ const actions = t8;
822
+ let t9;
823
+ if ($2[22] !== pluginCardInsights) {
824
+ t9 = pluginCardInsights.length > 0 ? /* @__PURE__ */ jsx(Fragment, { children: pluginCardInsights }) : void 0;
825
+ $2[22] = pluginCardInsights;
826
+ $2[23] = t9;
827
+ } else {
828
+ t9 = $2[23];
829
+ }
830
+ let t10;
831
+ if ($2[24] !== navigate || $2[25] !== onClick || $2[26] !== slug || $2[27] !== url || $2[28] !== userConfigurationPersistence) {
832
+ t10 = () => {
833
+ onClick?.();
834
+ navigate(url);
835
+ if (userConfigurationPersistence) {
836
+ userConfigurationPersistence.setRecentlyVisitedPaths([slug, ...(userConfigurationPersistence.recentlyVisitedPaths ?? []).filter((p_0) => p_0 !== slug)]);
837
+ }
838
+ };
839
+ $2[24] = navigate;
840
+ $2[25] = onClick;
841
+ $2[26] = slug;
842
+ $2[27] = url;
843
+ $2[28] = userConfigurationPersistence;
844
+ $2[29] = t10;
845
+ } else {
846
+ t10 = $2[29];
847
+ }
848
+ let t11;
849
+ if ($2[30] !== actions || $2[31] !== collectionIcon || $2[32] !== description || $2[33] !== name || $2[34] !== shrink || $2[35] !== t10 || $2[36] !== t9) {
850
+ t11 = /* @__PURE__ */ jsx(NavigationCard, { icon: collectionIcon, name, description, actions, additionalContent: t9, onClick: t10, shrink });
851
+ $2[30] = actions;
852
+ $2[31] = collectionIcon;
853
+ $2[32] = description;
854
+ $2[33] = name;
855
+ $2[34] = shrink;
856
+ $2[35] = t10;
857
+ $2[36] = t9;
858
+ $2[37] = t11;
859
+ } else {
860
+ t11 = $2[37];
861
+ }
862
+ return t11;
863
+ }
864
+ const animateLayoutChanges = (args) => defaultAnimateLayoutChanges({
865
+ ...args,
866
+ wasDragging: true
867
+ });
868
+ const dropAnimationConfig = {};
869
+ const cloneSerializableNavigationEntry = (entry) => {
870
+ const clonedEntry = {
871
+ id: entry.id,
872
+ slug: entry.slug,
873
+ url: entry.url,
874
+ name: entry.name,
875
+ type: entry.type,
876
+ collection: entry.collection ? {
877
+ ...entry.collection
878
+ } : void 0,
879
+ view: entry.view ? {
880
+ ...entry.view
881
+ } : void 0,
882
+ ...entry.group && {
883
+ group: entry.group
884
+ },
885
+ ...entry.description && {
886
+ description: entry.description
887
+ }
888
+ };
889
+ return clonedEntry;
890
+ };
891
+ const cloneItemsForDnd = (items) => items.map((g3) => ({
892
+ name: g3.name,
893
+ entries: g3.entries.map(cloneSerializableNavigationEntry)
894
+ }));
895
+ function SortableNavigationCard(t0) {
896
+ const $2 = c2(17);
897
+ const {
898
+ entry,
899
+ onClick
900
+ } = t0;
901
+ let t1;
902
+ if ($2[0] !== entry.url) {
903
+ t1 = {
904
+ id: entry.url,
905
+ animateLayoutChanges
906
+ };
907
+ $2[0] = entry.url;
908
+ $2[1] = t1;
909
+ } else {
910
+ t1 = $2[1];
911
+ }
912
+ const {
913
+ setNodeRef,
914
+ listeners,
915
+ attributes,
916
+ transform,
917
+ transition,
918
+ isDragging
919
+ } = useSortable(t1);
920
+ let t2;
921
+ if ($2[2] !== transform) {
922
+ t2 = transform ? CSS.Transform.toString(transform) : void 0;
923
+ $2[2] = transform;
924
+ $2[3] = t2;
925
+ } else {
926
+ t2 = $2[3];
927
+ }
928
+ const t3 = isDragging ? 0 : 1;
929
+ let t4;
930
+ if ($2[4] !== t2 || $2[5] !== t3 || $2[6] !== transition) {
931
+ t4 = {
932
+ transform: t2,
933
+ transition,
934
+ opacity: t3
935
+ };
936
+ $2[4] = t2;
937
+ $2[5] = t3;
938
+ $2[6] = transition;
939
+ $2[7] = t4;
940
+ } else {
941
+ t4 = $2[7];
942
+ }
943
+ const style = t4;
944
+ let t5;
945
+ if ($2[8] !== entry || $2[9] !== onClick) {
946
+ t5 = /* @__PURE__ */ jsx(NavigationCardBinding, { ...entry, onClick });
947
+ $2[8] = entry;
948
+ $2[9] = onClick;
949
+ $2[10] = t5;
950
+ } else {
951
+ t5 = $2[10];
952
+ }
953
+ let t6;
954
+ if ($2[11] !== attributes || $2[12] !== listeners || $2[13] !== setNodeRef || $2[14] !== style || $2[15] !== t5) {
955
+ t6 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, ...attributes, ...listeners, children: t5 });
956
+ $2[11] = attributes;
957
+ $2[12] = listeners;
958
+ $2[13] = setNodeRef;
959
+ $2[14] = style;
960
+ $2[15] = t5;
961
+ $2[16] = t6;
962
+ } else {
963
+ t6 = $2[16];
964
+ }
965
+ return t6;
966
+ }
967
+ function NavigationGroupDroppable(t0) {
968
+ const $2 = c2(11);
969
+ const {
970
+ id,
971
+ itemIds,
972
+ children,
973
+ isPotentialCardDropTarget: t1
974
+ } = t0;
975
+ const isPotentialCardDropTarget = t1 === void 0 ? false : t1;
976
+ let t2;
977
+ if ($2[0] !== id) {
978
+ t2 = {
979
+ id
980
+ };
981
+ $2[0] = id;
982
+ $2[1] = t2;
983
+ } else {
984
+ t2 = $2[1];
985
+ }
986
+ const {
987
+ setNodeRef
988
+ } = useDroppable(t2);
989
+ const t3 = isPotentialCardDropTarget ? "p-2 bg-surface-accent-200 dark:bg-surface-accent-800 rounded-lg" : void 0;
990
+ let t4;
991
+ if ($2[2] !== t3) {
992
+ t4 = cls(t3, "transition-all duration-200 ease-in-out");
993
+ $2[2] = t3;
994
+ $2[3] = t4;
995
+ } else {
996
+ t4 = $2[3];
997
+ }
998
+ let t5;
999
+ if ($2[4] !== children || $2[5] !== itemIds) {
1000
+ t5 = /* @__PURE__ */ jsx(SortableContext, { items: itemIds, strategy: rectSortingStrategy, children });
1001
+ $2[4] = children;
1002
+ $2[5] = itemIds;
1003
+ $2[6] = t5;
1004
+ } else {
1005
+ t5 = $2[6];
1006
+ }
1007
+ let t6;
1008
+ if ($2[7] !== setNodeRef || $2[8] !== t4 || $2[9] !== t5) {
1009
+ t6 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, className: t4, children: t5 });
1010
+ $2[7] = setNodeRef;
1011
+ $2[8] = t4;
1012
+ $2[9] = t5;
1013
+ $2[10] = t6;
1014
+ } else {
1015
+ t6 = $2[10];
1016
+ }
1017
+ return t6;
1018
+ }
1019
+ function SortableNavigationGroup(t0) {
1020
+ const $2 = c2(15);
1021
+ const {
1022
+ groupName,
1023
+ children,
1024
+ disabled
1025
+ } = t0;
1026
+ let t1;
1027
+ if ($2[0] !== disabled || $2[1] !== groupName) {
1028
+ t1 = {
1029
+ id: groupName,
1030
+ animateLayoutChanges,
1031
+ disabled
1032
+ };
1033
+ $2[0] = disabled;
1034
+ $2[1] = groupName;
1035
+ $2[2] = t1;
1036
+ } else {
1037
+ t1 = $2[2];
1038
+ }
1039
+ const {
1040
+ attributes,
1041
+ listeners,
1042
+ setNodeRef,
1043
+ transform,
1044
+ transition,
1045
+ isDragging
1046
+ } = useSortable(t1);
1047
+ let t2;
1048
+ if ($2[3] !== transform) {
1049
+ t2 = transform ? CSS.Transform.toString(transform) : void 0;
1050
+ $2[3] = transform;
1051
+ $2[4] = t2;
1052
+ } else {
1053
+ t2 = $2[4];
1054
+ }
1055
+ const t3 = isDragging ? 0 : 1;
1056
+ let t4;
1057
+ if ($2[5] !== t2 || $2[6] !== t3 || $2[7] !== transition) {
1058
+ t4 = {
1059
+ transform: t2,
1060
+ transition,
1061
+ opacity: t3
1062
+ };
1063
+ $2[5] = t2;
1064
+ $2[6] = t3;
1065
+ $2[7] = transition;
1066
+ $2[8] = t4;
1067
+ } else {
1068
+ t4 = $2[8];
1069
+ }
1070
+ const style = t4;
1071
+ let t5;
1072
+ if ($2[9] !== attributes || $2[10] !== children || $2[11] !== listeners || $2[12] !== setNodeRef || $2[13] !== style) {
1073
+ t5 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, style, ...attributes, ...listeners, children });
1074
+ $2[9] = attributes;
1075
+ $2[10] = children;
1076
+ $2[11] = listeners;
1077
+ $2[12] = setNodeRef;
1078
+ $2[13] = style;
1079
+ $2[14] = t5;
1080
+ } else {
1081
+ t5 = $2[14];
1082
+ }
1083
+ return t5;
1084
+ }
1085
+ function useHomePageDnd({
1086
+ items,
1087
+ setItems,
1088
+ disabled,
1089
+ onCardMovedBetweenGroups,
1090
+ onGroupMoved,
1091
+ onNewGroupDrop,
1092
+ onPersist
1093
+ }) {
1094
+ const dndItems = items;
1095
+ const setDndItems = setItems;
1096
+ const [activeId, setActiveId] = useState(null);
1097
+ const [activeIsGroup, setActiveIsGroup] = useState(false);
1098
+ const [currentDraggingGroupId, setCurrentDraggingGroupId] = useState(null);
1099
+ const [dndKitActiveNode, setDndKitActiveNode] = useState(null);
1100
+ const [isDraggingCardOnly, setIsDraggingCardOnly] = useState(false);
1101
+ const [dialogOpenForGroup, setDialogOpenForGroup] = useState(null);
1102
+ const [isHoveringNewGroupDropZone, setIsHoveringNewGroupDropZone] = useState(false);
1103
+ const [pendingNewGroupName, setPendingNewGroupName] = useState(null);
1104
+ const [stateBeforeNewGroup, setStateBeforeNewGroup] = useState(null);
1105
+ const preDragItemsRef = useRef(null);
1106
+ const interimItemsRef = useRef(null);
1107
+ useEffect(() => {
1108
+ interimItemsRef.current = dndItems;
1109
+ }, [dndItems]);
1110
+ const mouseSensor = useSensor(MouseSensor, {
1111
+ activationConstraint: {
1112
+ distance: 10
1113
+ }
1114
+ });
1115
+ const touchSensor = useSensor(TouchSensor, {
1116
+ activationConstraint: {
1117
+ delay: 150,
1118
+ tolerance: 5
1119
+ }
1120
+ });
1121
+ const keyboardSensor = useSensor(KeyboardSensor);
1122
+ const sensors = useSensors(mouseSensor, touchSensor, keyboardSensor);
1123
+ const dndContainers = dndItems.map((g3) => g3.name);
1124
+ const findDndContainer = useCallback((id) => {
1125
+ if (!id) return void 0;
1126
+ const group = dndItems.find((g_0) => g_0.name === id);
1127
+ if (group) return group.name;
1128
+ for (const g_1 of dndItems) {
1129
+ if (g_1.entries.some((e2) => e2.url === id)) return g_1.name;
1130
+ }
1131
+ return void 0;
1132
+ }, [dndItems]);
1133
+ const lastOverId = useRef(null);
1134
+ const recentlyMovedToNewContainer = useRef(false);
1135
+ const collisionDetection = useCallback((args) => {
1136
+ if (disabled || !activeId) return [];
1137
+ if (activeIsGroup) {
1138
+ const groups = args.droppableContainers.filter((c4) => dndItems.some((g_2) => g_2.name === c4.id));
1139
+ if (!groups.length) return [];
1140
+ return closestCenter({
1141
+ ...args,
1142
+ droppableContainers: groups
1143
+ });
1144
+ }
1145
+ const pointer = pointerWithin(args);
1146
+ if (pointer.length) {
1147
+ const zone = pointer.find((c_0) => c_0.id === "new-group-drop-zone");
1148
+ if (zone) return [zone];
1149
+ const container = pointer.find((c_1) => dndItems.some((g_3) => g_3.name === c_1.id));
1150
+ if (container) {
1151
+ const itemsIn = dndItems.find((g_4) => g_4.name === container.id)?.entries;
1152
+ if (itemsIn?.length) {
1153
+ const closest = closestCorners({
1154
+ ...args,
1155
+ droppableContainers: args.droppableContainers.filter((c_2) => itemsIn.some((e_0) => e_0.url === c_2.id))
1156
+ });
1157
+ if (closest.length) return closest;
1158
+ }
1159
+ return [container];
1160
+ }
1161
+ const first = getFirstCollision(pointer, "id");
1162
+ if (first) return [{
1163
+ id: first
1164
+ }];
1165
+ }
1166
+ const rects = rectIntersection(args);
1167
+ const zoneRect = rects.find((c_3) => c_3.id === "new-group-drop-zone");
1168
+ if (zoneRect) return [zoneRect];
1169
+ let overId = getFirstCollision(rects, "id");
1170
+ if (overId != null) {
1171
+ const overIsContainer = dndItems.some((g_5) => g_5.name === overId);
1172
+ if (overIsContainer) {
1173
+ const itemsIn_0 = dndItems.find((g_6) => g_6.name === overId)?.entries;
1174
+ if (itemsIn_0?.length) {
1175
+ const closestItem = closestCorners({
1176
+ ...args,
1177
+ droppableContainers: args.droppableContainers.filter((c_4) => itemsIn_0.some((e_1) => e_1.url === c_4.id))
1178
+ })[0]?.id;
1179
+ if (closestItem) overId = closestItem;
1180
+ }
1181
+ }
1182
+ lastOverId.current = overId;
1183
+ return [{
1184
+ id: overId
1185
+ }];
1186
+ }
1187
+ if (recentlyMovedToNewContainer.current && lastOverId.current && !activeIsGroup) return [{
1188
+ id: lastOverId.current
1189
+ }];
1190
+ return [];
1191
+ }, [activeId, dndItems, disabled, activeIsGroup]);
1192
+ const handleDragStart = ({
1193
+ active
1194
+ }) => {
1195
+ setDndKitActiveNode(active);
1196
+ if (disabled) return;
1197
+ preDragItemsRef.current = cloneItemsForDnd(dndItems);
1198
+ const isGroup = dndItems.some((g_7) => g_7.name === active.id);
1199
+ if (!active.data.current) active.data.current = {};
1200
+ active.data.current.type = isGroup ? "group" : "item";
1201
+ setActiveId(active.id);
1202
+ setActiveIsGroup(isGroup);
1203
+ setIsDraggingCardOnly(!isGroup);
1204
+ if (isGroup) setCurrentDraggingGroupId(active.id);
1205
+ recentlyMovedToNewContainer.current = false;
1206
+ };
1207
+ const handleDragOver = ({
1208
+ active: active_0,
1209
+ over
1210
+ }) => {
1211
+ if (disabled || !over) return;
1212
+ const activeIdNow = active_0.id;
1213
+ const overIdNow = over.id;
1214
+ if (activeIdNow === overIdNow) return;
1215
+ if (activeIsGroup) return;
1216
+ const activeCont = findDndContainer(activeIdNow);
1217
+ const overCont = findDndContainer(overIdNow);
1218
+ if (!activeCont) return;
1219
+ if (overCont && activeCont !== overCont) {
1220
+ recentlyMovedToNewContainer.current = true;
1221
+ lastOverId.current = overIdNow;
1222
+ setDndItems((current) => {
1223
+ const newState = cloneItemsForDnd(current);
1224
+ const srcIdx = newState.findIndex((g_8) => g_8.name === activeCont);
1225
+ const tgtIdx = newState.findIndex((g_9) => g_9.name === overCont);
1226
+ if (srcIdx === -1 || tgtIdx === -1) return current;
1227
+ const src = newState[srcIdx];
1228
+ const tgt = newState[tgtIdx];
1229
+ const idxInSrc = src.entries.findIndex((e_2) => e_2.url === activeIdNow);
1230
+ if (idxInSrc === -1) return current;
1231
+ const [moved] = src.entries.splice(idxInSrc, 1);
1232
+ const overIsContainer_0 = overIdNow === overCont;
1233
+ if (overIsContainer_0) {
1234
+ tgt.entries.push(moved);
1235
+ } else {
1236
+ const overIdx = tgt.entries.findIndex((e_3) => e_3.url === overIdNow);
1237
+ if (overIdx !== -1) {
1238
+ tgt.entries.splice(overIdx, 0, moved);
1239
+ } else {
1240
+ tgt.entries.push(moved);
1241
+ }
1242
+ }
1243
+ return newState;
1244
+ });
1245
+ } else if (activeCont === overCont) {
1246
+ recentlyMovedToNewContainer.current = false;
1247
+ }
1248
+ };
1249
+ const handleDragEnd = ({
1250
+ active: active_1,
1251
+ over: over_0
1252
+ }) => {
1253
+ if (disabled || !over_0) {
1254
+ resetDragState();
1255
+ return;
1256
+ }
1257
+ const activeIdNow_0 = active_1.id;
1258
+ const overIdNow_0 = over_0.id;
1259
+ if (activeIsGroup) {
1260
+ if (activeIdNow_0 !== overIdNow_0 && dndItems.some((g_12) => g_12.name === overIdNow_0)) {
1261
+ const from = dndItems.findIndex((g_10) => g_10.name === activeIdNow_0);
1262
+ const to = dndItems.findIndex((g_11) => g_11.name === overIdNow_0);
1263
+ if (from !== -1 && to !== -1) {
1264
+ const newState_0 = arrayMove(dndItems, from, to);
1265
+ setDndItems(newState_0);
1266
+ onPersist?.(newState_0);
1267
+ onGroupMoved?.(activeIdNow_0, from, to);
1268
+ }
1269
+ }
1270
+ } else {
1271
+ const findContainerInState = (id_0, state) => {
1272
+ const group_0 = state.find((g_13) => g_13.name === id_0);
1273
+ if (group_0) return group_0.name;
1274
+ for (const g_14 of state) {
1275
+ if (g_14.entries.some((e_4) => e_4.url === id_0)) return g_14.name;
1276
+ }
1277
+ return void 0;
1278
+ };
1279
+ const sourceState = preDragItemsRef.current || dndItems;
1280
+ const activeCont_0 = findContainerInState(activeIdNow_0, sourceState);
1281
+ findDndContainer(overIdNow_0);
1282
+ if (overIdNow_0 === "new-group-drop-zone") {
1283
+ if (activeCont_0) {
1284
+ setStateBeforeNewGroup(cloneItemsForDnd(dndItems));
1285
+ const newState_1 = cloneItemsForDnd(dndItems);
1286
+ const srcIdx_0 = newState_1.findIndex((g_15) => g_15.name === activeCont_0);
1287
+ if (srcIdx_0 !== -1) {
1288
+ const src_0 = newState_1[srcIdx_0];
1289
+ const idxInSrc_0 = src_0.entries.findIndex((e_5) => e_5.url === activeIdNow_0);
1290
+ if (idxInSrc_0 !== -1) {
1291
+ const [dragged] = src_0.entries.splice(idxInSrc_0, 1);
1292
+ if (src_0.entries.length === 0) newState_1.splice(srcIdx_0, 1);
1293
+ let tentative = "New Group";
1294
+ let counter = 1;
1295
+ while (newState_1.some((g_16) => g_16.name === tentative)) tentative = `New Group ${counter++}`;
1296
+ newState_1.push({
1297
+ name: tentative,
1298
+ entries: [dragged]
1299
+ });
1300
+ setDndItems(newState_1);
1301
+ setPendingNewGroupName(tentative);
1302
+ setDialogOpenForGroup(tentative);
1303
+ onNewGroupDrop?.();
1304
+ }
1305
+ }
1306
+ }
1307
+ } else {
1308
+ const overCont_1 = findDndContainer(overIdNow_0);
1309
+ if (activeCont_0 === overCont_1) {
1310
+ const grpIdx = dndItems.findIndex((g_17) => g_17.name === activeCont_0);
1311
+ if (grpIdx !== -1) {
1312
+ const group_1 = dndItems[grpIdx];
1313
+ const oldIdx = group_1.entries.findIndex((e_6) => e_6.url === activeIdNow_0);
1314
+ let newIdx = group_1.entries.findIndex((e_7) => e_7.url === overIdNow_0);
1315
+ if (newIdx === -1 && overIdNow_0 === activeCont_0) newIdx = group_1.entries.length - 1;
1316
+ if (oldIdx !== -1 && newIdx !== -1 && oldIdx !== newIdx) {
1317
+ const reordered = arrayMove(group_1.entries, oldIdx, newIdx);
1318
+ const newState_2 = [...dndItems];
1319
+ newState_2[grpIdx] = {
1320
+ ...group_1,
1321
+ entries: reordered
1322
+ };
1323
+ setDndItems(newState_2);
1324
+ onPersist?.(newState_2);
1325
+ }
1326
+ }
1327
+ } else if (overCont_1 && activeCont_0 !== overCont_1) {
1328
+ const finalState = cloneItemsForDnd(sourceState);
1329
+ const finalOverId = lastOverId.current || overIdNow_0;
1330
+ const cleanOverCont = findContainerInState(finalOverId, sourceState) || overCont_1;
1331
+ const srcIdx_1 = finalState.findIndex((g_18) => g_18.name === activeCont_0);
1332
+ const tgtIdx_0 = finalState.findIndex((g_19) => g_19.name === cleanOverCont);
1333
+ if (srcIdx_1 !== -1 && tgtIdx_0 !== -1) {
1334
+ const src_1 = finalState[srcIdx_1];
1335
+ const tgt_0 = finalState[tgtIdx_0];
1336
+ const idxInSrc_1 = src_1.entries.findIndex((e_8) => e_8.url === activeIdNow_0);
1337
+ if (idxInSrc_1 !== -1) {
1338
+ const [moved_0] = src_1.entries.splice(idxInSrc_1, 1);
1339
+ const overIsContainer_1 = finalOverId === cleanOverCont;
1340
+ if (overIsContainer_1) {
1341
+ tgt_0.entries.push(moved_0);
1342
+ } else {
1343
+ const overIdx_0 = tgt_0.entries.findIndex((e_9) => e_9.url === finalOverId);
1344
+ if (overIdx_0 !== -1) {
1345
+ tgt_0.entries.splice(overIdx_0, 0, moved_0);
1346
+ } else {
1347
+ tgt_0.entries.push(moved_0);
1348
+ }
1349
+ }
1350
+ if (src_1.entries.length === 0) {
1351
+ finalState.splice(srcIdx_1, 1);
1352
+ }
1353
+ setDndItems(finalState);
1354
+ onPersist?.(finalState);
1355
+ onCardMovedBetweenGroups?.(moved_0);
1356
+ }
1357
+ }
1358
+ } else if (recentlyMovedToNewContainer.current) {
1359
+ console.error("Move between containers detected but conditions not met", {
1360
+ activeCont: activeCont_0,
1361
+ overCont: overCont_1,
1362
+ activeIdNow: activeIdNow_0,
1363
+ overIdNow: overIdNow_0
1364
+ });
1365
+ }
1366
+ }
1367
+ }
1368
+ resetDragState();
1369
+ };
1370
+ const resetDragState = () => {
1371
+ setDndKitActiveNode(null);
1372
+ setActiveId(null);
1373
+ setActiveIsGroup(false);
1374
+ setCurrentDraggingGroupId(null);
1375
+ setIsDraggingCardOnly(false);
1376
+ recentlyMovedToNewContainer.current = false;
1377
+ };
1378
+ const handleDragCancel = () => resetDragState();
1379
+ const handleRenameGroup = (oldName, newName) => {
1380
+ setDndItems((current_0) => {
1381
+ const idx = current_0.findIndex((g_20) => g_20.name === oldName);
1382
+ if (idx === -1) return current_0;
1383
+ if (current_0.some((g_21) => g_21.name === newName && g_21.name !== oldName)) return current_0;
1384
+ const updated = [...current_0];
1385
+ updated[idx] = {
1386
+ ...updated[idx],
1387
+ name: newName
1388
+ };
1389
+ onPersist?.(updated);
1390
+ return updated;
1391
+ });
1392
+ setPendingNewGroupName(null);
1393
+ setStateBeforeNewGroup(null);
1394
+ setDialogOpenForGroup(null);
1395
+ };
1396
+ const handleDialogClose = () => {
1397
+ if (pendingNewGroupName && dialogOpenForGroup === pendingNewGroupName && stateBeforeNewGroup) {
1398
+ setDndItems(stateBeforeNewGroup);
1399
+ }
1400
+ setPendingNewGroupName(null);
1401
+ setStateBeforeNewGroup(null);
1402
+ setDialogOpenForGroup(null);
1403
+ };
1404
+ const activeItemForOverlay = disabled || !activeId || activeIsGroup ? null : dndItems.flatMap((g_22) => g_22.entries).find((e_10) => e_10.url === activeId) || null;
1405
+ const activeGroupData = disabled || !activeId || !activeIsGroup ? null : dndItems.find((g_23) => g_23.name === activeId) || null;
1406
+ return {
1407
+ sensors,
1408
+ collisionDetection,
1409
+ onDragStart: handleDragStart,
1410
+ onDragOver: handleDragOver,
1411
+ onDragEnd: handleDragEnd,
1412
+ onDragCancel: handleDragCancel,
1413
+ dropAnimation: dropAnimationConfig,
1414
+ activeItemForOverlay,
1415
+ activeGroupData,
1416
+ draggingGroupId: currentDraggingGroupId,
1417
+ containers: dndContainers,
1418
+ dndKitActiveNode,
1419
+ isDraggingCardOnly,
1420
+ dialogOpenForGroup,
1421
+ setDialogOpenForGroup,
1422
+ handleRenameGroup,
1423
+ handleDialogClose,
1424
+ isHoveringNewGroupDropZone,
1425
+ setIsHoveringNewGroupDropZone
1426
+ };
1427
+ }
1428
+ function NewGroupDropZone(t0) {
1429
+ const $2 = c2(15);
1430
+ const {
1431
+ disabled,
1432
+ setIsHovering
1433
+ } = t0;
1434
+ let t1;
1435
+ if ($2[0] !== disabled) {
1436
+ t1 = {
1437
+ id: "new-group-drop-zone",
1438
+ disabled
1439
+ };
1440
+ $2[0] = disabled;
1441
+ $2[1] = t1;
1442
+ } else {
1443
+ t1 = $2[1];
1444
+ }
1445
+ const {
1446
+ setNodeRef,
1447
+ isOver
1448
+ } = useDroppable(t1);
1449
+ const [isVisible, setIsVisible] = useState(false);
1450
+ let t2;
1451
+ if ($2[2] !== disabled) {
1452
+ t2 = {
1453
+ onDragStart(t32) {
1454
+ const {
1455
+ active
1456
+ } = t32;
1457
+ if (disabled) {
1458
+ return;
1459
+ }
1460
+ const tp = active.data.current?.type;
1461
+ setIsVisible(tp === "item");
1462
+ },
1463
+ onDragEnd() {
1464
+ setIsVisible(false);
1465
+ },
1466
+ onDragCancel() {
1467
+ setIsVisible(false);
1468
+ }
1469
+ };
1470
+ $2[2] = disabled;
1471
+ $2[3] = t2;
1472
+ } else {
1473
+ t2 = $2[3];
1474
+ }
1475
+ useDndMonitor(t2);
1476
+ let t3;
1477
+ let t4;
1478
+ if ($2[4] !== isOver || $2[5] !== isVisible || $2[6] !== setIsHovering) {
1479
+ t3 = () => {
1480
+ setIsHovering(isOver && isVisible);
1481
+ };
1482
+ t4 = [isOver, isVisible, setIsHovering];
1483
+ $2[4] = isOver;
1484
+ $2[5] = isVisible;
1485
+ $2[6] = setIsHovering;
1486
+ $2[7] = t3;
1487
+ $2[8] = t4;
1488
+ } else {
1489
+ t3 = $2[7];
1490
+ t4 = $2[8];
1491
+ }
1492
+ useEffect(t3, t4);
1493
+ if (!isVisible || disabled) {
1494
+ return null;
1495
+ }
1496
+ const t5 = isOver ? "bg-surface-accent-100 dark:bg-surface-accent-800 border-surface-300 dark:border-surface-600" : "bg-surface-50 dark:bg-surface-900 border-surface-200 dark:border-surface-700";
1497
+ let t6;
1498
+ if ($2[9] !== t5) {
1499
+ t6 = cls("fixed right-8 top-1/2 -translate-y-1/2 w-[200px] h-[120px] border border-dashed rounded-lg flex items-center justify-center transition-all", t5);
1500
+ $2[9] = t5;
1501
+ $2[10] = t6;
1502
+ } else {
1503
+ t6 = $2[10];
1504
+ }
1505
+ let t7;
1506
+ if ($2[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1507
+ t7 = /* @__PURE__ */ jsx("div", { className: "text-center p-4", children: /* @__PURE__ */ jsx("span", { className: "block font-medium text-sm", children: "Drop here to create a new group" }) });
1508
+ $2[11] = t7;
1509
+ } else {
1510
+ t7 = $2[11];
1511
+ }
1512
+ let t8;
1513
+ if ($2[12] !== setNodeRef || $2[13] !== t6) {
1514
+ t8 = /* @__PURE__ */ jsx("div", { ref: setNodeRef, className: t6, children: t7 });
1515
+ $2[12] = setNodeRef;
1516
+ $2[13] = t6;
1517
+ $2[14] = t8;
1518
+ } else {
1519
+ t8 = $2[14];
1520
+ }
1521
+ return t8;
1522
+ }
1523
+ function RenameGroupDialog(t0) {
1524
+ const $2 = c2(56);
1525
+ const {
1526
+ open,
1527
+ initialName,
1528
+ existingGroupNames,
1529
+ onClose,
1530
+ onRename
1531
+ } = t0;
1532
+ const {
1533
+ t
1534
+ } = useTranslation();
1535
+ const [name, setName] = useState(initialName);
1536
+ const [error, setError] = useState(null);
1537
+ const inputRef = useRef(null);
1538
+ let t1;
1539
+ let t2;
1540
+ if ($2[0] !== initialName || $2[1] !== open) {
1541
+ t1 = () => {
1542
+ if (open) {
1543
+ setName(initialName);
1544
+ setError(null);
1545
+ setTimeout(() => {
1546
+ if (inputRef.current) {
1547
+ inputRef.current.focus();
1548
+ inputRef.current.select();
1549
+ }
1550
+ }, 100);
1551
+ }
1552
+ };
1553
+ t2 = [initialName, open];
1554
+ $2[0] = initialName;
1555
+ $2[1] = open;
1556
+ $2[2] = t1;
1557
+ $2[3] = t2;
1558
+ } else {
1559
+ t1 = $2[2];
1560
+ t2 = $2[3];
1561
+ }
1562
+ useEffect(t1, t2);
1563
+ let t3;
1564
+ if ($2[4] !== existingGroupNames || $2[5] !== t) {
1565
+ t3 = (event) => {
1566
+ const newName = event.target.value;
1567
+ setName(newName);
1568
+ if (!newName.trim()) {
1569
+ setError(t("group_name_empty_error"));
1570
+ } else {
1571
+ if (existingGroupNames.includes(newName.trim())) {
1572
+ setError(t("group_name_exists_error"));
1573
+ } else {
1574
+ setError(null);
1575
+ }
1576
+ }
1577
+ };
1578
+ $2[4] = existingGroupNames;
1579
+ $2[5] = t;
1580
+ $2[6] = t3;
1581
+ } else {
1582
+ t3 = $2[6];
1583
+ }
1584
+ const handleNameChange = t3;
1585
+ let t4;
1586
+ if ($2[7] !== error || $2[8] !== existingGroupNames || $2[9] !== name || $2[10] !== onClose || $2[11] !== onRename || $2[12] !== t) {
1587
+ t4 = () => {
1588
+ const trimmedName = name.trim();
1589
+ if (!trimmedName) {
1590
+ setError(t("group_name_empty_error"));
1591
+ return;
1592
+ }
1593
+ if (existingGroupNames.includes(trimmedName)) {
1594
+ setError(t("group_name_exists_error"));
1595
+ return;
1596
+ }
1597
+ if (!error) {
1598
+ onRename(trimmedName);
1599
+ onClose();
1600
+ }
1601
+ };
1602
+ $2[7] = error;
1603
+ $2[8] = existingGroupNames;
1604
+ $2[9] = name;
1605
+ $2[10] = onClose;
1606
+ $2[11] = onRename;
1607
+ $2[12] = t;
1608
+ $2[13] = t4;
1609
+ } else {
1610
+ t4 = $2[13];
1611
+ }
1612
+ const handleSave = t4;
1613
+ let t5;
1614
+ if ($2[14] !== existingGroupNames || $2[15] !== handleSave || $2[16] !== name || $2[17] !== t) {
1615
+ t5 = (event_0) => {
1616
+ if (event_0.key === "Enter") {
1617
+ event_0.preventDefault();
1618
+ const trimmedName_0 = name.trim();
1619
+ let currentError = null;
1620
+ if (!trimmedName_0) {
1621
+ currentError = t("group_name_empty_error");
1622
+ } else {
1623
+ if (existingGroupNames.includes(trimmedName_0)) {
1624
+ currentError = t("group_name_exists_error");
1625
+ }
1626
+ }
1627
+ if (!currentError && trimmedName_0) {
1628
+ handleSave();
1629
+ } else {
1630
+ if (currentError) {
1631
+ setError(currentError);
1632
+ }
1633
+ }
1634
+ }
1635
+ };
1636
+ $2[14] = existingGroupNames;
1637
+ $2[15] = handleSave;
1638
+ $2[16] = name;
1639
+ $2[17] = t;
1640
+ $2[18] = t5;
1641
+ } else {
1642
+ t5 = $2[18];
1643
+ }
1644
+ const handleKeyDown = t5;
1645
+ if (!open) {
1646
+ return null;
1647
+ }
1648
+ let t6;
1649
+ if ($2[19] !== t) {
1650
+ t6 = t("rename_group");
1651
+ $2[19] = t;
1652
+ $2[20] = t6;
1653
+ } else {
1654
+ t6 = $2[20];
1655
+ }
1656
+ let t7;
1657
+ if ($2[21] !== t6) {
1658
+ t7 = /* @__PURE__ */ jsx(DialogTitle, { children: t6 });
1659
+ $2[21] = t6;
1660
+ $2[22] = t7;
1661
+ } else {
1662
+ t7 = $2[22];
1663
+ }
1664
+ let t8;
1665
+ if ($2[23] !== t) {
1666
+ t8 = t("group_name_label");
1667
+ $2[23] = t;
1668
+ $2[24] = t8;
1669
+ } else {
1670
+ t8 = $2[24];
1671
+ }
1672
+ const t9 = !!error;
1673
+ const t10 = error ? "group-name-error" : void 0;
1674
+ let t11;
1675
+ if ($2[25] !== handleKeyDown || $2[26] !== handleNameChange || $2[27] !== name || $2[28] !== t10 || $2[29] !== t8 || $2[30] !== t9) {
1676
+ t11 = /* @__PURE__ */ jsx(TextField, { inputRef, label: t8, value: name, onChange: handleNameChange, onKeyDown: handleKeyDown, error: t9, "aria-describedby": t10 });
1677
+ $2[25] = handleKeyDown;
1678
+ $2[26] = handleNameChange;
1679
+ $2[27] = name;
1680
+ $2[28] = t10;
1681
+ $2[29] = t8;
1682
+ $2[30] = t9;
1683
+ $2[31] = t11;
1684
+ } else {
1685
+ t11 = $2[31];
1686
+ }
1687
+ let t12;
1688
+ if ($2[32] !== error) {
1689
+ t12 = error && /* @__PURE__ */ jsx("p", { id: "group-name-error", style: {
1690
+ display: "none"
1691
+ }, children: error });
1692
+ $2[32] = error;
1693
+ $2[33] = t12;
1694
+ } else {
1695
+ t12 = $2[33];
1696
+ }
1697
+ let t13;
1698
+ if ($2[34] !== t11 || $2[35] !== t12) {
1699
+ t13 = /* @__PURE__ */ jsxs(DialogContent, { children: [
1700
+ t11,
1701
+ t12
1702
+ ] });
1703
+ $2[34] = t11;
1704
+ $2[35] = t12;
1705
+ $2[36] = t13;
1706
+ } else {
1707
+ t13 = $2[36];
1708
+ }
1709
+ let t14;
1710
+ if ($2[37] !== t) {
1711
+ t14 = t("cancel");
1712
+ $2[37] = t;
1713
+ $2[38] = t14;
1714
+ } else {
1715
+ t14 = $2[38];
1716
+ }
1717
+ let t15;
1718
+ if ($2[39] !== onClose || $2[40] !== t14) {
1719
+ t15 = /* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "text", children: t14 });
1720
+ $2[39] = onClose;
1721
+ $2[40] = t14;
1722
+ $2[41] = t15;
1723
+ } else {
1724
+ t15 = $2[41];
1725
+ }
1726
+ const t16 = !!error || !name.trim();
1727
+ let t17;
1728
+ if ($2[42] !== t) {
1729
+ t17 = t("save");
1730
+ $2[42] = t;
1731
+ $2[43] = t17;
1732
+ } else {
1733
+ t17 = $2[43];
1734
+ }
1735
+ let t18;
1736
+ if ($2[44] !== handleSave || $2[45] !== t16 || $2[46] !== t17) {
1737
+ t18 = /* @__PURE__ */ jsx(Button, { onClick: handleSave, disabled: t16, children: t17 });
1738
+ $2[44] = handleSave;
1739
+ $2[45] = t16;
1740
+ $2[46] = t17;
1741
+ $2[47] = t18;
1742
+ } else {
1743
+ t18 = $2[47];
1744
+ }
1745
+ let t19;
1746
+ if ($2[48] !== t15 || $2[49] !== t18) {
1747
+ t19 = /* @__PURE__ */ jsxs(DialogActions, { children: [
1748
+ t15,
1749
+ t18
1750
+ ] });
1751
+ $2[48] = t15;
1752
+ $2[49] = t18;
1753
+ $2[50] = t19;
1754
+ } else {
1755
+ t19 = $2[50];
1756
+ }
1757
+ let t20;
1758
+ if ($2[51] !== open || $2[52] !== t13 || $2[53] !== t19 || $2[54] !== t7) {
1759
+ t20 = /* @__PURE__ */ jsxs(Dialog, { open, children: [
1760
+ t7,
1761
+ t13,
1762
+ t19
1763
+ ] });
1764
+ $2[51] = open;
1765
+ $2[52] = t13;
1766
+ $2[53] = t19;
1767
+ $2[54] = t7;
1768
+ $2[55] = t20;
1769
+ } else {
1770
+ t20 = $2[55];
1771
+ }
1772
+ return t20;
1773
+ }
1774
+ const DEFAULT_GROUP_NAME = "Views";
1775
+ const ADMIN_GROUP_NAME = "Admin";
1776
+ function ContentHomePage({
1777
+ additionalActions,
1778
+ additionalChildrenStart,
1779
+ additionalChildrenEnd,
1780
+ sections,
1781
+ hiddenGroups
1782
+ }) {
1783
+ const context = useCMSContext();
1784
+ const {
1785
+ navigationStateController
1786
+ } = context;
1787
+ const customizationController = useCustomizationController();
1788
+ const adminModeController = useAdminModeController();
1789
+ const registry = useRebaseRegistry();
1790
+ const {
1791
+ resolvedSlots
1792
+ } = customizationController;
1793
+ const breadcrumbs = useBreadcrumbsController();
1794
+ const {
1795
+ t
1796
+ } = useTranslation();
1797
+ useEffect(() => {
1798
+ breadcrumbs.set({
1799
+ breadcrumbs: []
1800
+ });
1801
+ }, [breadcrumbs.set]);
1802
+ const {
1803
+ allowDragAndDrop = false,
1804
+ navigationEntries: unFilteredNavigationEntries = [],
1805
+ groups: unFilteredGroupOrder = [],
1806
+ onNavigationEntriesUpdate = () => {
1807
+ }
1808
+ } = navigationStateController.topLevelNavigation || {};
1809
+ const rawNavigationEntries = useMemo(() => {
1810
+ if (adminModeController.mode === "studio") {
1811
+ return unFilteredNavigationEntries.filter((e2) => e2.type === "view" || e2.type === "admin");
1812
+ }
1813
+ return unFilteredNavigationEntries.filter((e_0) => e_0.type !== "view");
1814
+ }, [unFilteredNavigationEntries, adminModeController.mode]);
1815
+ const groupOrderFromNavController = useMemo(() => {
1816
+ const entryGroups = new Set(rawNavigationEntries.map((e_1) => e_1.group).filter(Boolean));
1817
+ return unFilteredGroupOrder.filter((g3) => entryGroups.has(g3));
1818
+ }, [unFilteredGroupOrder, rawNavigationEntries]);
1819
+ const fuse = useRef(null);
1820
+ const [filteredUrls, setFilteredUrls] = useState(null);
1821
+ const performingSearch = Boolean(filteredUrls);
1822
+ const filteredNavigationEntries = useMemo(() => {
1823
+ return filteredUrls ? rawNavigationEntries.filter((e_2) => filteredUrls.includes(e_2.url)) : rawNavigationEntries;
1824
+ }, [filteredUrls, rawNavigationEntries]);
1825
+ useEffect(() => {
1826
+ fuse.current = new Fuse(rawNavigationEntries, {
1827
+ keys: ["name", "description", "group", "path"]
1828
+ });
1829
+ }, [rawNavigationEntries]);
1830
+ const updateSearch = useCallback((v2) => {
1831
+ if (!v2?.trim()) {
1832
+ setFilteredUrls(null);
1833
+ return;
1834
+ }
1835
+ const results = fuse.current?.search(v2.trim());
1836
+ setFilteredUrls(results ? results.map((x2) => x2.item.url) : []);
1837
+ }, []);
1838
+ const [items, setItems] = useState([]);
1839
+ const [adminGroupData, setAdminGroupData] = useState(null);
1840
+ const isDndDirtyRef = useRef(false);
1841
+ const dndDirtyTimeoutRef = useRef(null);
1842
+ const processedGroups = useMemo(() => {
1843
+ const src = filteredNavigationEntries;
1844
+ const entriesByGroup = {};
1845
+ src.forEach((e_3) => {
1846
+ const g_0 = e_3.type === "admin" ? ADMIN_GROUP_NAME : e_3.group ?? DEFAULT_GROUP_NAME;
1847
+ (entriesByGroup[g_0] ??= []).push(e_3);
1848
+ });
1849
+ const hasPluginAdditionalCards = customizationController.resolvedSlots.some((s2) => s2.slot === "home.cards");
1850
+ let allProcessed;
1851
+ if (performingSearch) {
1852
+ const ordered = [...new Set(src.map((e_4) => e_4.group ?? DEFAULT_GROUP_NAME))];
1853
+ allProcessed = ordered.map((name) => ({
1854
+ name,
1855
+ entries: entriesByGroup[name] || []
1856
+ })).filter((g_1) => g_1.entries.length);
1857
+ } else {
1858
+ allProcessed = groupOrderFromNavController.map((g_2) => ({
1859
+ name: g_2,
1860
+ entries: entriesByGroup[g_2] || []
1861
+ }));
1862
+ Object.keys(entriesByGroup).forEach((g_3) => {
1863
+ if (!groupOrderFromNavController.includes(g_3)) allProcessed.push({
1864
+ name: g_3,
1865
+ entries: entriesByGroup[g_3]
1866
+ });
1867
+ });
1868
+ if (hasPluginAdditionalCards && !allProcessed.some((g_4) => g_4.name === DEFAULT_GROUP_NAME)) {
1869
+ allProcessed.push({
1870
+ name: DEFAULT_GROUP_NAME,
1871
+ entries: []
1872
+ });
1873
+ }
1874
+ allProcessed = allProcessed.filter((g_5) => g_5.entries.length || g_5.name === DEFAULT_GROUP_NAME && hasPluginAdditionalCards);
1875
+ }
1876
+ const admin = allProcessed.find((g_6) => g_6.name === ADMIN_GROUP_NAME);
1877
+ return {
1878
+ adminGroupData: admin || null,
1879
+ items: allProcessed.filter((g_7) => g_7.name !== ADMIN_GROUP_NAME && !hiddenGroups?.includes(g_7.name))
1880
+ };
1881
+ }, [filteredNavigationEntries, performingSearch, groupOrderFromNavController, customizationController.resolvedSlots, hiddenGroups]);
1882
+ useEffect(() => {
1883
+ if (isDndDirtyRef.current) {
1884
+ return;
1885
+ }
1886
+ setAdminGroupData(processedGroups.adminGroupData);
1887
+ setItems(processedGroups.items);
1888
+ }, [processedGroups]);
1889
+ const updateItems = (updater) => {
1890
+ setItems(updater);
1891
+ };
1892
+ const persistNavigationGroups = (latest) => {
1893
+ isDndDirtyRef.current = true;
1894
+ if (dndDirtyTimeoutRef.current) {
1895
+ clearTimeout(dndDirtyTimeoutRef.current);
1896
+ }
1897
+ dndDirtyTimeoutRef.current = setTimeout(() => {
1898
+ isDndDirtyRef.current = false;
1899
+ }, 1e3);
1900
+ const draggable = latest.map((g_8) => ({
1901
+ name: g_8.name,
1902
+ entries: g_8.entries.map((e_5) => e_5.slug)
1903
+ }));
1904
+ const all = adminGroupData ? [...draggable, {
1905
+ name: adminGroupData.name,
1906
+ entries: adminGroupData.entries.map((e_6) => e_6.slug)
1907
+ }] : draggable;
1908
+ onNavigationEntriesUpdate(all);
1909
+ };
1910
+ const groupNames = useMemo(() => [...items.map((item) => item.name), ...adminGroupData ? [adminGroupData.name] : []], [items, adminGroupData]);
1911
+ const collapsedDefaults = useMemo(() => buildCollapsedDefaults(registry.cmsConfig?.navigationGroupMappings, "home"), [registry.cmsConfig?.navigationGroupMappings]);
1912
+ const {
1913
+ isGroupCollapsed,
1914
+ toggleGroupCollapsed
1915
+ } = useCollapsedGroups(groupNames, "home", collapsedDefaults);
1916
+ const {
1917
+ sensors,
1918
+ collisionDetection,
1919
+ onDragStart,
1920
+ onDragOver,
1921
+ onDragEnd,
1922
+ dropAnimation,
1923
+ activeItemForOverlay,
1924
+ activeGroupData,
1925
+ draggingGroupId,
1926
+ containers,
1927
+ dndKitActiveNode,
1928
+ onDragCancel,
1929
+ isDraggingCardOnly,
1930
+ dialogOpenForGroup,
1931
+ setDialogOpenForGroup,
1932
+ handleRenameGroup,
1933
+ handleDialogClose,
1934
+ isHoveringNewGroupDropZone,
1935
+ setIsHoveringNewGroupDropZone
1936
+ } = useHomePageDnd({
1937
+ items,
1938
+ setItems: updateItems,
1939
+ disabled: !allowDragAndDrop || performingSearch,
1940
+ onPersist: persistNavigationGroups,
1941
+ onGroupMoved: (g_9) => context.analyticsController?.onAnalyticsEvent?.("home_move_group", {
1942
+ name: g_9
1943
+ }),
1944
+ onCardMovedBetweenGroups: (card) => context.analyticsController?.onAnalyticsEvent?.("home_move_card", {
1945
+ id: card.id
1946
+ }),
1947
+ onNewGroupDrop: () => context.analyticsController?.onAnalyticsEvent?.("home_drop_new_group")
1948
+ });
1949
+ const {
1950
+ containerRef,
1951
+ direction
1952
+ } = useRestoreScroll();
1953
+ const dndDisabled = !allowDragAndDrop || performingSearch;
1954
+ const dndModifiers = dndKitActiveNode?.data.current?.type === "group" ? [restrictToVerticalAxis, restrictToWindowEdges] : [restrictToWindowEdges];
1955
+ const sectionProps = {
1956
+ context
1957
+ };
1958
+ const additionalPluginChildrenStart = useSlot("home.children.start", sectionProps);
1959
+ const additionalPluginChildrenEnd = useSlot("home.children.end", sectionProps);
1960
+ const additionalPluginActions = useSlot("home.actions", sectionProps);
1961
+ const homeCardContributions = useMemo(() => {
1962
+ return resolvedSlots.filter((s_0) => s_0.slot === "home.cards").sort((a10, b11) => (a10.order ?? 50) - (b11.order ?? 50));
1963
+ }, [resolvedSlots]);
1964
+ return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "py-2 overflow-auto h-full w-full bg-surface-50 dark:bg-surface-800", children: [
1965
+ /* @__PURE__ */ jsxs(Container, { maxWidth: "6xl", children: [
1966
+ /* @__PURE__ */ jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsx(BootstrapAdminBanner, {}) }),
1967
+ /* @__PURE__ */ jsxs("div", { className: "w-full sticky py-4 transition-all duration-400 ease-in-out top-0 z-10 flex flex-row gap-4", style: {
1968
+ top: direction === "down" ? -84 : 0
1969
+ }, children: [
1970
+ /* @__PURE__ */ jsx(SearchBar, { onTextSearch: updateSearch, placeholder: t("search_collections"), autoFocus: true, size: "small", innerClassName: "w-full", className: "w-full grow" }),
1971
+ additionalActions,
1972
+ additionalPluginActions
1973
+ ] }),
1974
+ /* @__PURE__ */ jsx(FavouritesView, { hidden: performingSearch }),
1975
+ additionalChildrenStart,
1976
+ additionalPluginChildrenStart,
1977
+ /* @__PURE__ */ jsxs(DndContext, { sensors, collisionDetection, measuring: {
1978
+ droppable: {
1979
+ strategy: MeasuringStrategy.Always,
1980
+ frequency: 500
1981
+ }
1982
+ }, onDragStart, onDragOver, onDragEnd, onDragCancel, modifiers: dndModifiers, children: [
1983
+ /* @__PURE__ */ jsx(SortableContext, { items: containers, strategy: verticalListSortingStrategy, children: items.map((groupData, groupIndex) => {
1984
+ const groupKey = groupData.name;
1985
+ const entriesInGroup = groupData.entries;
1986
+ const homeCardsProps = {
1987
+ group: groupKey === DEFAULT_GROUP_NAME ? void 0 : groupKey,
1988
+ context
1989
+ };
1990
+ const additionalCards = homeCardContributions.map((s_1, i2) => /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(s_1.Component, { ...homeCardsProps, ...s_1.props ?? {} }) }, `home_cards_${groupKey}_${i2}`));
1991
+ if (entriesInGroup.length === 0 && (additionalCards.length === 0 || performingSearch)) return null;
1992
+ return /* @__PURE__ */ jsx(SortableNavigationGroup, { groupName: groupKey, disabled: dndDisabled, children: /* @__PURE__ */ jsx(NavigationGroup, { group: groupKey === DEFAULT_GROUP_NAME ? void 0 : groupKey, minimised: draggingGroupId === groupKey && !isDraggingCardOnly, isPotentialCardDropTarget: isDraggingCardOnly, dndDisabled, onEditGroup: () => {
1993
+ if (dndDisabled) return;
1994
+ setDialogOpenForGroup(groupKey);
1995
+ }, collapsed: isGroupCollapsed(groupKey), onToggleCollapsed: () => toggleGroupCollapsed(groupKey), children: /* @__PURE__ */ jsx(NavigationGroupDroppable, { id: groupKey, itemIds: entriesInGroup.map((e_7) => e_7.url), isPotentialCardDropTarget: isDraggingCardOnly, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 ", children: [
1996
+ entriesInGroup.map((entry) => /* @__PURE__ */ jsx(SortableNavigationCard, { entry, onClick: () => {
1997
+ let event = "unmapped_event";
1998
+ if (entry.type === "collection") event = "home_navigate_to_collection";
1999
+ else if (entry.type === "view") event = "home_navigate_to_view";
2000
+ else if (entry.type === "admin") event = "home_navigate_to_admin_view";
2001
+ context.analyticsController?.onAnalyticsEvent?.(event, {
2002
+ path: entry.slug
2003
+ });
2004
+ } }, entry.url)),
2005
+ !performingSearch && groupKey.toLowerCase() !== ADMIN_GROUP_NAME.toLowerCase() && additionalCards
2006
+ ] }) }) }) }, `group-${groupIndex}`);
2007
+ }) }, containers.join(",")),
2008
+ /* @__PURE__ */ jsx(NewGroupDropZone, { disabled: dndDisabled, setIsHovering: setIsHoveringNewGroupDropZone }),
2009
+ /* @__PURE__ */ jsx(DragOverlay, { adjustScale: false, dropAnimation, children: activeGroupData && draggingGroupId === activeGroupData.name ? /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-transparent", style: {
2010
+ padding: 0,
2011
+ margin: 0
2012
+ }, children: /* @__PURE__ */ jsx(NavigationGroup, { group: activeGroupData.name === DEFAULT_GROUP_NAME ? void 0 : activeGroupData.name, isPreview: false, minimised: true }) }) : activeItemForOverlay ? /* @__PURE__ */ jsx(NavigationCardBinding, { ...activeItemForOverlay, shrink: isHoveringNewGroupDropZone }) : null })
2013
+ ] }),
2014
+ !performingSearch && adminGroupData && /* @__PURE__ */ jsx(NavigationGroup, { group: adminGroupData.name, collapsed: isGroupCollapsed(adminGroupData.name), onToggleCollapsed: () => toggleGroupCollapsed(adminGroupData.name), children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 ", children: adminGroupData.entries.map((entry_0) => /* @__PURE__ */ jsx(NavigationCardBinding, { ...entry_0, onClick: () => {
2015
+ let event_0 = "unmapped_event";
2016
+ if (entry_0.type === "collection") event_0 = "home_navigate_to_collection";
2017
+ else if (entry_0.type === "view") event_0 = "home_navigate_to_view";
2018
+ else if (entry_0.type === "admin") event_0 = "home_navigate_to_admin_view";
2019
+ context.analyticsController?.onAnalyticsEvent?.(event_0, {
2020
+ path: entry_0.slug
2021
+ });
2022
+ } }, entry_0.url)) }) }),
2023
+ sections && sections.map((section) => /* @__PURE__ */ jsx(NavigationGroup, { group: section.title, children: section.children }, section.key)),
2024
+ additionalPluginChildrenEnd,
2025
+ additionalChildrenEnd
2026
+ ] }),
2027
+ dialogOpenForGroup && /* @__PURE__ */ jsx(RenameGroupDialog, { open: true, initialName: dialogOpenForGroup, existingGroupNames: items.map((g_10) => g_10.name).filter((n2) => n2 !== dialogOpenForGroup), onClose: handleDialogClose, onRename: (newName) => {
2028
+ handleRenameGroup(dialogOpenForGroup, newName);
2029
+ } })
2030
+ ] });
2031
+ }
2032
+ function RebaseRoute() {
2033
+ const $2 = c2(57);
2034
+ const location = useLocation();
2035
+ const collectionRegistry = useCollectionRegistryController();
2036
+ const urlController = useUrlController();
2037
+ const breadcrumbs = useBreadcrumbsController();
2038
+ const userConfigPersistence = useUserConfigurationPersistence();
2039
+ const hash = location.hash;
2040
+ const isSidePanel = hash.includes("#side");
2041
+ let t0;
2042
+ if ($2[0] !== hash) {
2043
+ t0 = hash.includes("#new") || hash.includes("#new_side");
2044
+ $2[0] = hash;
2045
+ $2[1] = t0;
2046
+ } else {
2047
+ t0 = $2[1];
2048
+ }
2049
+ const isNew = t0;
2050
+ let t1;
2051
+ if ($2[2] !== hash) {
2052
+ t1 = hash.includes("#copy");
2053
+ $2[2] = hash;
2054
+ $2[3] = t1;
2055
+ } else {
2056
+ t1 = $2[3];
2057
+ }
2058
+ const isCopy = t1;
2059
+ const isFullScreen = hash.includes("#full");
2060
+ const pathname = location.pathname;
2061
+ let navigationEntries;
2062
+ let t2;
2063
+ let t3;
2064
+ let t4;
2065
+ if ($2[4] !== breadcrumbs || $2[5] !== collectionRegistry.collections || $2[6] !== pathname || $2[7] !== urlController) {
2066
+ const navigationPath = urlController.urlPathToDataPath(pathname);
2067
+ let t52;
2068
+ if ($2[12] !== collectionRegistry.collections) {
2069
+ t52 = collectionRegistry.collections ?? [];
2070
+ $2[12] = collectionRegistry.collections;
2071
+ $2[13] = t52;
2072
+ } else {
2073
+ t52 = $2[13];
2074
+ }
2075
+ navigationEntries = getNavigationEntriesFromPath({
2076
+ path: navigationPath,
2077
+ collections: t52
2078
+ });
2079
+ t3 = useEffect;
2080
+ t4 = () => {
2081
+ const lastEntry = navigationEntries[navigationEntries.length - 1];
2082
+ const isViewingCollection = lastEntry?.type === "collection";
2083
+ breadcrumbs.set({
2084
+ breadcrumbs: navigationEntries.map((entry, index) => {
2085
+ const isLastEntry = index === navigationEntries.length - 1;
2086
+ if (entry.type === "entity") {
2087
+ return {
2088
+ title: String(entry.entityId),
2089
+ url: urlController.buildUrlCollectionPath(entry.path)
2090
+ };
2091
+ } else {
2092
+ if (entry.type === "custom_view") {
2093
+ return {
2094
+ title: String(entry.view.name ?? entry.view.key),
2095
+ url: urlController.buildUrlCollectionPath(entry.path)
2096
+ };
2097
+ } else {
2098
+ if (entry.type === "collection") {
2099
+ const showCount = isLastEntry && isViewingCollection;
2100
+ return {
2101
+ title: entry.collection.name,
2102
+ url: urlController.buildUrlCollectionPath(entry.path),
2103
+ id: entry.path,
2104
+ ...showCount ? {
2105
+ count: null
2106
+ } : {}
2107
+ };
2108
+ } else {
2109
+ throw new Error("Unexpected navigation entry type");
2110
+ }
2111
+ }
2112
+ }
2113
+ })
2114
+ });
2115
+ };
2116
+ t2 = navigationEntries.map(_temp$2).join(",");
2117
+ $2[4] = breadcrumbs;
2118
+ $2[5] = collectionRegistry.collections;
2119
+ $2[6] = pathname;
2120
+ $2[7] = urlController;
2121
+ $2[8] = navigationEntries;
2122
+ $2[9] = t2;
2123
+ $2[10] = t3;
2124
+ $2[11] = t4;
2125
+ } else {
2126
+ navigationEntries = $2[8];
2127
+ t2 = $2[9];
2128
+ t3 = $2[10];
2129
+ t4 = $2[11];
2130
+ }
2131
+ let t5;
2132
+ if ($2[14] !== t2) {
2133
+ t5 = [t2];
2134
+ $2[14] = t2;
2135
+ $2[15] = t5;
2136
+ } else {
2137
+ t5 = $2[15];
2138
+ }
2139
+ t3(t4, t5);
2140
+ if (isNew) {
2141
+ let t62;
2142
+ if ($2[16] !== navigationEntries || $2[17] !== pathname) {
2143
+ t62 = /* @__PURE__ */ jsx(EntityFullScreenRoute, { pathname, navigationEntries, isNew: true, isCopy: false });
2144
+ $2[16] = navigationEntries;
2145
+ $2[17] = pathname;
2146
+ $2[18] = t62;
2147
+ } else {
2148
+ t62 = $2[18];
2149
+ }
2150
+ return t62;
2151
+ }
2152
+ if (navigationEntries.length === 1 && navigationEntries[0].type === "collection") {
2153
+ let t62;
2154
+ let t72;
2155
+ if ($2[19] !== collectionRegistry || $2[20] !== navigationEntries[0].id || $2[21] !== navigationEntries[0].slug) {
2156
+ t72 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
2157
+ bb0: {
2158
+ let collection;
2159
+ collection = collectionRegistry.getCollection(navigationEntries[0].id);
2160
+ if (!collection) {
2161
+ collection = collectionRegistry.getCollection(navigationEntries[0].slug);
2162
+ }
2163
+ if (!collection) {
2164
+ if (!collectionRegistry.initialised) {
2165
+ let t82;
2166
+ if ($2[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2167
+ t82 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
2168
+ $2[24] = t82;
2169
+ } else {
2170
+ t82 = $2[24];
2171
+ }
2172
+ t72 = t82;
2173
+ break bb0;
2174
+ }
2175
+ t72 = null;
2176
+ break bb0;
2177
+ }
2178
+ let t8;
2179
+ let t9;
2180
+ if ($2[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2181
+ t8 = [];
2182
+ t9 = [];
2183
+ $2[25] = t8;
2184
+ $2[26] = t9;
2185
+ } else {
2186
+ t8 = $2[25];
2187
+ t9 = $2[26];
2188
+ }
2189
+ t62 = /* @__PURE__ */ jsx(EntityCollectionView, { ...collection, parentCollectionSlugs: t8, parentEntityIds: t9, path: collection.slug, updateUrl: true, Actions: toArray(collection.Actions) }, `collection_view_${collection.slug}`);
2190
+ }
2191
+ $2[19] = collectionRegistry;
2192
+ $2[20] = navigationEntries[0].id;
2193
+ $2[21] = navigationEntries[0].slug;
2194
+ $2[22] = t62;
2195
+ $2[23] = t72;
2196
+ } else {
2197
+ t62 = $2[22];
2198
+ t72 = $2[23];
2199
+ }
2200
+ if (t72 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
2201
+ return t72;
2202
+ }
2203
+ return t62;
2204
+ }
2205
+ if (isSidePanel) {
2206
+ const lastCollectionEntry = [...navigationEntries].reverse().find(_temp2$1);
2207
+ if (lastCollectionEntry) {
2208
+ let t62;
2209
+ let t72;
2210
+ if ($2[27] !== collectionRegistry || $2[28] !== navigationEntries[0]) {
2211
+ t72 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
2212
+ bb1: {
2213
+ let collection_0;
2214
+ const firstEntry = navigationEntries[0];
2215
+ collection_0 = collectionRegistry.getCollection(firstEntry.id);
2216
+ if (!collection_0) {
2217
+ collection_0 = collectionRegistry.getCollection(firstEntry.slug);
2218
+ }
2219
+ if (!collection_0) {
2220
+ if (!collectionRegistry.initialised) {
2221
+ let t82;
2222
+ if ($2[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2223
+ t82 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
2224
+ $2[31] = t82;
2225
+ } else {
2226
+ t82 = $2[31];
2227
+ }
2228
+ t72 = t82;
2229
+ break bb1;
2230
+ }
2231
+ t72 = null;
2232
+ break bb1;
2233
+ }
2234
+ let t8;
2235
+ let t9;
2236
+ if ($2[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2237
+ t8 = [];
2238
+ t9 = [];
2239
+ $2[32] = t8;
2240
+ $2[33] = t9;
2241
+ } else {
2242
+ t8 = $2[32];
2243
+ t9 = $2[33];
2244
+ }
2245
+ t62 = /* @__PURE__ */ jsx(EntityCollectionView, { ...collection_0, parentCollectionSlugs: t8, parentEntityIds: t9, path: collection_0.slug, updateUrl: true, Actions: toArray(collection_0.Actions) }, `collection_view_${collection_0.slug}`);
2246
+ }
2247
+ $2[27] = collectionRegistry;
2248
+ $2[28] = navigationEntries[0];
2249
+ $2[29] = t62;
2250
+ $2[30] = t72;
2251
+ } else {
2252
+ t62 = $2[29];
2253
+ t72 = $2[30];
2254
+ }
2255
+ if (t72 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
2256
+ return t72;
2257
+ }
2258
+ return t62;
2259
+ }
2260
+ }
2261
+ let t6;
2262
+ if ($2[34] !== navigationEntries) {
2263
+ t6 = navigationEntries.find(_temp3$1);
2264
+ $2[34] = navigationEntries;
2265
+ $2[35] = t6;
2266
+ } else {
2267
+ t6 = $2[35];
2268
+ }
2269
+ const lastEntityEntry = t6;
2270
+ const firstCollectionEntry = navigationEntries[0];
2271
+ if (!isFullScreen && !isCopy && firstCollectionEntry?.type === "collection" && lastEntityEntry?.type === "entity" && (navigationEntries.length === 2 || navigationEntries.length === 3)) {
2272
+ let t72;
2273
+ if ($2[36] !== collectionRegistry || $2[37] !== firstCollectionEntry.id || $2[38] !== firstCollectionEntry.slug || $2[39] !== lastEntityEntry || $2[40] !== location.search || $2[41] !== navigationEntries[2] || $2[42] !== navigationEntries.length || $2[43] !== pathname || $2[44] !== userConfigPersistence) {
2274
+ t72 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
2275
+ bb2: {
2276
+ let collection_1;
2277
+ collection_1 = collectionRegistry.getCollection(firstCollectionEntry.id);
2278
+ if (!collection_1) {
2279
+ collection_1 = collectionRegistry.getCollection(firstCollectionEntry.slug);
2280
+ }
2281
+ let effectiveOpenMode = collection_1?.openEntityMode;
2282
+ if (!effectiveOpenMode && collection_1) {
2283
+ const urlViewParam = new URLSearchParams(location.search).get("__view");
2284
+ let currentViewMode = collection_1.defaultViewMode ?? "list";
2285
+ if (urlViewParam && ["list", "table", "kanban", "cards"].includes(urlViewParam)) {
2286
+ currentViewMode = urlViewParam;
2287
+ } else {
2288
+ const savedView = userConfigPersistence?.getCollectionConfig(collection_1.slug)?.defaultViewMode;
2289
+ if (savedView) {
2290
+ currentViewMode = savedView;
2291
+ }
2292
+ }
2293
+ if (currentViewMode === "kanban") {
2294
+ effectiveOpenMode = "side_panel";
2295
+ } else {
2296
+ if (currentViewMode === "table" || currentViewMode === "cards") {
2297
+ effectiveOpenMode = "full_screen";
2298
+ } else {
2299
+ effectiveOpenMode = "split";
2300
+ }
2301
+ }
2302
+ }
2303
+ if (collection_1 && effectiveOpenMode === "split") {
2304
+ let selectedTab;
2305
+ if (navigationEntries.length === 3) {
2306
+ const thirdEntry = navigationEntries[2];
2307
+ if (thirdEntry.type === "collection") {
2308
+ selectedTab = thirdEntry.collection.slug;
2309
+ } else {
2310
+ if (thirdEntry.type === "custom_view") {
2311
+ selectedTab = thirdEntry.view.key;
2312
+ }
2313
+ }
2314
+ }
2315
+ if (!selectedTab && navigationEntries.length === 2 && lastEntityEntry) {
2316
+ const entityIdStr = String(lastEntityEntry.entityId);
2317
+ const entityIdIdx = pathname.lastIndexOf(`/${entityIdStr}`);
2318
+ if (entityIdIdx >= 0) {
2319
+ let t82;
2320
+ if ($2[46] !== entityIdIdx || $2[47] !== entityIdStr.length || $2[48] !== pathname) {
2321
+ const afterEntity = pathname.substring(entityIdIdx + 1 + entityIdStr.length);
2322
+ t82 = afterEntity.startsWith("/") ? afterEntity.substring(1) : afterEntity;
2323
+ $2[46] = entityIdIdx;
2324
+ $2[47] = entityIdStr.length;
2325
+ $2[48] = pathname;
2326
+ $2[49] = t82;
2327
+ } else {
2328
+ t82 = $2[49];
2329
+ }
2330
+ const trailingSegment = t82;
2331
+ if (trailingSegment.length > 0) {
2332
+ selectedTab = trailingSegment;
2333
+ }
2334
+ }
2335
+ }
2336
+ let t8;
2337
+ let t9;
2338
+ if ($2[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2339
+ t8 = [];
2340
+ t9 = [];
2341
+ $2[50] = t8;
2342
+ $2[51] = t9;
2343
+ } else {
2344
+ t8 = $2[50];
2345
+ t9 = $2[51];
2346
+ }
2347
+ t72 = /* @__PURE__ */ jsx(EntityCollectionView, { ...collection_1, parentCollectionSlugs: t8, parentEntityIds: t9, path: collection_1.slug, updateUrl: true, selectedEntityId: lastEntityEntry.entityId, selectedTab, Actions: toArray(collection_1.Actions) }, `collection_view_${collection_1.slug}`);
2348
+ break bb2;
2349
+ }
2350
+ }
2351
+ $2[36] = collectionRegistry;
2352
+ $2[37] = firstCollectionEntry.id;
2353
+ $2[38] = firstCollectionEntry.slug;
2354
+ $2[39] = lastEntityEntry;
2355
+ $2[40] = location.search;
2356
+ $2[41] = navigationEntries[2];
2357
+ $2[42] = navigationEntries.length;
2358
+ $2[43] = pathname;
2359
+ $2[44] = userConfigPersistence;
2360
+ $2[45] = t72;
2361
+ } else {
2362
+ t72 = $2[45];
2363
+ }
2364
+ if (t72 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
2365
+ return t72;
2366
+ }
2367
+ }
2368
+ let t7;
2369
+ if ($2[52] !== isCopy || $2[53] !== isNew || $2[54] !== navigationEntries || $2[55] !== pathname) {
2370
+ t7 = /* @__PURE__ */ jsx(EntityFullScreenRoute, { pathname, navigationEntries, isNew, isCopy });
2371
+ $2[52] = isCopy;
2372
+ $2[53] = isNew;
2373
+ $2[54] = navigationEntries;
2374
+ $2[55] = pathname;
2375
+ $2[56] = t7;
2376
+ } else {
2377
+ t7 = $2[56];
2378
+ }
2379
+ return t7;
2380
+ }
2381
+ function _temp3$1(entry_2) {
2382
+ return entry_2.type === "entity";
2383
+ }
2384
+ function _temp2$1(entry_1) {
2385
+ return entry_1.type === "collection";
2386
+ }
2387
+ function _temp$2(entry_0) {
2388
+ return entry_0.path;
2389
+ }
2390
+ function getSelectedTabFromUrl(isNew, lastCustomView) {
2391
+ if (isNew) {
2392
+ return void 0;
2393
+ } else if (lastCustomView) {
2394
+ if (lastCustomView.type === "custom_view") {
2395
+ return lastCustomView.view.key;
2396
+ } else if (lastCustomView.type === "collection") {
2397
+ return lastCustomView.id ?? lastCustomView.slug;
2398
+ }
2399
+ }
2400
+ return void 0;
2401
+ }
2402
+ function EntityFullScreenRoute(t0) {
2403
+ const $2 = c2(80);
2404
+ const {
2405
+ pathname,
2406
+ navigationEntries,
2407
+ isNew,
2408
+ isCopy
2409
+ } = t0;
2410
+ const collectionRegistry = useCollectionRegistryController();
2411
+ const urlController = useUrlController();
2412
+ const navigate = useNavigate();
2413
+ const location = useLocation();
2414
+ const defaultValues = location.state?.defaultValues;
2415
+ const hash = location.hash;
2416
+ const navigationPath = urlController.urlPathToDataPath(pathname);
2417
+ const blocked = useRef(false);
2418
+ const lastEntityEntry = [...navigationEntries].reverse().find(_temp4);
2419
+ const navigationEntriesAfterEntity = lastEntityEntry ? navigationEntries.slice(navigationEntries.indexOf(lastEntityEntry) + 1) : [];
2420
+ const lastCustomView = [...navigationEntriesAfterEntity].reverse().find(_temp5);
2421
+ const entityId = lastEntityEntry && "entityId" in lastEntityEntry ? lastEntityEntry.entityId : void 0;
2422
+ let urlTab;
2423
+ urlTab = getSelectedTabFromUrl(isNew, lastCustomView);
2424
+ if (!urlTab && entityId && !isNew) {
2425
+ const entityIdStr = String(entityId);
2426
+ const entityIdIdx = pathname.lastIndexOf(`/${entityIdStr}`);
2427
+ if (entityIdIdx >= 0) {
2428
+ const afterEntity = pathname.substring(entityIdIdx + 1 + entityIdStr.length);
2429
+ const trailingSegment = afterEntity.startsWith("/") ? afterEntity.substring(1) : afterEntity;
2430
+ if (trailingSegment.length > 0 && trailingSegment !== "edit") {
2431
+ urlTab = trailingSegment;
2432
+ }
2433
+ }
2434
+ }
2435
+ const [selectedTab, setSelectedTab] = useState(urlTab);
2436
+ const parentCollectionSlugs = collectionRegistry.getParentCollectionSlugs(navigationPath);
2437
+ const parentEntityIds = collectionRegistry.getParentEntityIds(navigationPath);
2438
+ let t1;
2439
+ if ($2[0] !== selectedTab || $2[1] !== setSelectedTab || $2[2] !== urlTab) {
2440
+ t1 = () => {
2441
+ if (urlTab !== selectedTab) {
2442
+ setSelectedTab(urlTab);
2443
+ }
2444
+ };
2445
+ $2[0] = selectedTab;
2446
+ $2[1] = setSelectedTab;
2447
+ $2[2] = urlTab;
2448
+ $2[3] = t1;
2449
+ } else {
2450
+ t1 = $2[3];
2451
+ }
2452
+ const t2 = urlTab;
2453
+ let t3;
2454
+ if ($2[4] !== t2) {
2455
+ t3 = [t2];
2456
+ $2[4] = t2;
2457
+ $2[5] = t3;
2458
+ } else {
2459
+ t3 = $2[5];
2460
+ }
2461
+ useEffect(t1, t3);
2462
+ let t4;
2463
+ if ($2[6] !== entityId || $2[7] !== isNew || $2[8] !== pathname) {
2464
+ t4 = !entityId || isNew ? pathname : pathname.substring(0, pathname.lastIndexOf(`/${entityId}`));
2465
+ $2[6] = entityId;
2466
+ $2[7] = isNew;
2467
+ $2[8] = pathname;
2468
+ $2[9] = t4;
2469
+ } else {
2470
+ t4 = $2[9];
2471
+ }
2472
+ const basePath = t4;
2473
+ const entityPath = basePath + `/${entityId}`;
2474
+ let t5;
2475
+ if ($2[10] !== basePath || $2[11] !== entityPath) {
2476
+ t5 = (t62) => {
2477
+ const {
2478
+ currentLocation,
2479
+ nextLocation
2480
+ } = t62;
2481
+ if (nextLocation.pathname.startsWith(entityPath)) {
2482
+ return false;
2483
+ }
2484
+ const nextHash = nextLocation.hash;
2485
+ if (nextHash === "#side" || nextHash === "#new_side") {
2486
+ return false;
2487
+ }
2488
+ const currentHash = currentLocation.hash;
2489
+ if ((currentHash === "#side" || currentHash === "#new_side") && (nextLocation.pathname === basePath || nextLocation.pathname.startsWith(entityPath))) {
2490
+ return false;
2491
+ }
2492
+ return blocked.current;
2493
+ };
2494
+ $2[10] = basePath;
2495
+ $2[11] = entityPath;
2496
+ $2[12] = t5;
2497
+ } else {
2498
+ t5 = $2[12];
2499
+ }
2500
+ const blocker = useBlocker(t5);
2501
+ const lastCollectionEntry = [...navigationEntries].reverse().find(_temp6);
2502
+ if (isNew && !lastCollectionEntry) {
2503
+ if (!collectionRegistry.initialised) {
2504
+ let t62;
2505
+ if ($2[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2506
+ t62 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
2507
+ $2[13] = t62;
2508
+ } else {
2509
+ t62 = $2[13];
2510
+ }
2511
+ return t62;
2512
+ }
2513
+ throw new Error("INTERNAL: No collection found in the navigation");
2514
+ }
2515
+ if (!isNew && !lastEntityEntry) {
2516
+ if (!collectionRegistry.initialised) {
2517
+ let t63;
2518
+ if ($2[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2519
+ t63 = /* @__PURE__ */ jsx(CircularProgressCenter, {});
2520
+ $2[14] = t63;
2521
+ } else {
2522
+ t63 = $2[14];
2523
+ }
2524
+ return t63;
2525
+ }
2526
+ let t62;
2527
+ if ($2[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2528
+ t62 = /* @__PURE__ */ jsx(NotFoundPage, {});
2529
+ $2[15] = t62;
2530
+ } else {
2531
+ t62 = $2[15];
2532
+ }
2533
+ return t62;
2534
+ }
2535
+ const rawCollection = isNew ? lastCollectionEntry && "collection" in lastCollectionEntry ? lastCollectionEntry.collection : void 0 : lastEntityEntry && "parentCollection" in lastEntityEntry ? lastEntityEntry.parentCollection : void 0;
2536
+ const collection = collectionRegistry.getCollection(rawCollection.slug) || rawCollection;
2537
+ const fullIdPath = isNew ? lastCollectionEntry.slug : lastEntityEntry.slug;
2538
+ const collectionPath = urlController.resolveDatabasePathsFrom(fullIdPath);
2539
+ const isEditRoute = pathname.endsWith("/edit") || pathname.split("/").pop() === "edit";
2540
+ const isDetailMode = collection.defaultEntityAction === "view" && !isNew && !isCopy && entityId && !isEditRoute;
2541
+ if (isDetailMode) {
2542
+ const t62 = collection.slug + "_view_" + entityId;
2543
+ const t72 = selectedTab ?? void 0;
2544
+ let t82;
2545
+ if ($2[16] !== collectionPath || $2[17] !== entityId || $2[18] !== hash || $2[19] !== navigate || $2[20] !== urlController) {
2546
+ t82 = () => {
2547
+ const editUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`) + "/edit";
2548
+ navigate(editUrl + hash);
2549
+ };
2550
+ $2[16] = collectionPath;
2551
+ $2[17] = entityId;
2552
+ $2[18] = hash;
2553
+ $2[19] = navigate;
2554
+ $2[20] = urlController;
2555
+ $2[21] = t82;
2556
+ } else {
2557
+ t82 = $2[21];
2558
+ }
2559
+ let t92;
2560
+ if ($2[22] !== basePath || $2[23] !== entityId || $2[24] !== hash || $2[25] !== navigate || $2[26] !== setSelectedTab) {
2561
+ t92 = (params) => {
2562
+ setSelectedTab(params.selectedTab);
2563
+ const newSelectedTab = params.selectedTab;
2564
+ if (newSelectedTab) {
2565
+ navigate(`${basePath}/${entityId}/${newSelectedTab}${hash}`, {
2566
+ replace: true
2567
+ });
2568
+ } else {
2569
+ navigate(`${basePath}/${entityId}${hash}`, {
2570
+ replace: true
2571
+ });
2572
+ }
2573
+ };
2574
+ $2[22] = basePath;
2575
+ $2[23] = entityId;
2576
+ $2[24] = hash;
2577
+ $2[25] = navigate;
2578
+ $2[26] = setSelectedTab;
2579
+ $2[27] = t92;
2580
+ } else {
2581
+ t92 = $2[27];
2582
+ }
2583
+ let t102;
2584
+ if ($2[28] !== collection || $2[29] !== collectionPath || $2[30] !== entityId || $2[31] !== parentCollectionSlugs || $2[32] !== parentEntityIds || $2[33] !== t62 || $2[34] !== t72 || $2[35] !== t82 || $2[36] !== t92) {
2585
+ t102 = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(EntityDetailView, { entityId, collection, layout: "full_screen", path: collectionPath, selectedTab: t72, onEditClick: t82, onTabChange: t92, parentCollectionSlugs, parentEntityIds }, t62) });
2586
+ $2[28] = collection;
2587
+ $2[29] = collectionPath;
2588
+ $2[30] = entityId;
2589
+ $2[31] = parentCollectionSlugs;
2590
+ $2[32] = parentEntityIds;
2591
+ $2[33] = t62;
2592
+ $2[34] = t72;
2593
+ $2[35] = t82;
2594
+ $2[36] = t92;
2595
+ $2[37] = t102;
2596
+ } else {
2597
+ t102 = $2[37];
2598
+ }
2599
+ return t102;
2600
+ }
2601
+ const t6 = collection.slug + "_" + (isNew ? "new" : isCopy ? entityId + "_copy" : entityId);
2602
+ const t7 = isNew ? void 0 : entityId;
2603
+ const t8 = selectedTab ?? void 0;
2604
+ const t9 = isNew ? defaultValues : void 0;
2605
+ let t10;
2606
+ if ($2[38] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2607
+ t10 = (modified) => blocked.current = modified;
2608
+ $2[38] = t10;
2609
+ } else {
2610
+ t10 = $2[38];
2611
+ }
2612
+ let t11;
2613
+ if ($2[39] !== collectionPath || $2[40] !== entityId || $2[41] !== hash || $2[42] !== navigate || $2[43] !== urlController) {
2614
+ t11 = () => {
2615
+ const detailUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`);
2616
+ navigate(detailUrl + hash);
2617
+ };
2618
+ $2[39] = collectionPath;
2619
+ $2[40] = entityId;
2620
+ $2[41] = hash;
2621
+ $2[42] = navigate;
2622
+ $2[43] = urlController;
2623
+ $2[44] = t11;
2624
+ } else {
2625
+ t11 = $2[44];
2626
+ }
2627
+ let t12;
2628
+ if ($2[45] !== basePath || $2[46] !== hash || $2[47] !== isNew || $2[48] !== navigate) {
2629
+ t12 = (params_0) => {
2630
+ const newSelectedTab_0 = params_0.selectedTab;
2631
+ const newEntityId = params_0.entityId;
2632
+ const savedHash = isNew ? "" : hash;
2633
+ if (newSelectedTab_0) {
2634
+ navigate(`${basePath}/${newEntityId}/${newSelectedTab_0}${savedHash}`, {
2635
+ replace: true
2636
+ });
2637
+ } else {
2638
+ navigate(`${basePath}/${newEntityId}${savedHash}`, {
2639
+ replace: true
2640
+ });
2641
+ }
2642
+ };
2643
+ $2[45] = basePath;
2644
+ $2[46] = hash;
2645
+ $2[47] = isNew;
2646
+ $2[48] = navigate;
2647
+ $2[49] = t12;
2648
+ } else {
2649
+ t12 = $2[49];
2650
+ }
2651
+ let t13;
2652
+ if ($2[50] !== basePath || $2[51] !== entityId || $2[52] !== hash || $2[53] !== isNew || $2[54] !== navigate || $2[55] !== setSelectedTab) {
2653
+ t13 = (params_1) => {
2654
+ setSelectedTab(params_1.selectedTab);
2655
+ if (isNew) {
2656
+ return;
2657
+ }
2658
+ const newSelectedTab_1 = params_1.selectedTab;
2659
+ if (newSelectedTab_1) {
2660
+ navigate(`${basePath}/${entityId}/${newSelectedTab_1}${hash}`, {
2661
+ replace: true
2662
+ });
2663
+ } else {
2664
+ navigate(`${basePath}/${entityId}${hash}`, {
2665
+ replace: true
2666
+ });
2667
+ }
2668
+ };
2669
+ $2[50] = basePath;
2670
+ $2[51] = entityId;
2671
+ $2[52] = hash;
2672
+ $2[53] = isNew;
2673
+ $2[54] = navigate;
2674
+ $2[55] = setSelectedTab;
2675
+ $2[56] = t13;
2676
+ } else {
2677
+ t13 = $2[56];
2678
+ }
2679
+ let t14;
2680
+ if ($2[57] !== collection || $2[58] !== collectionPath || $2[59] !== isCopy || $2[60] !== parentCollectionSlugs || $2[61] !== parentEntityIds || $2[62] !== t11 || $2[63] !== t12 || $2[64] !== t13 || $2[65] !== t6 || $2[66] !== t7 || $2[67] !== t8 || $2[68] !== t9) {
2681
+ t14 = /* @__PURE__ */ jsx(EntityEditView, { entityId: t7, collection, layout: "full_screen", path: collectionPath, copy: isCopy, selectedTab: t8, defaultValues: t9, onValuesModified: t10, navigateBack: t11, onSaved: t12, onTabChange: t13, parentCollectionSlugs, parentEntityIds }, t6);
2682
+ $2[57] = collection;
2683
+ $2[58] = collectionPath;
2684
+ $2[59] = isCopy;
2685
+ $2[60] = parentCollectionSlugs;
2686
+ $2[61] = parentEntityIds;
2687
+ $2[62] = t11;
2688
+ $2[63] = t12;
2689
+ $2[64] = t13;
2690
+ $2[65] = t6;
2691
+ $2[66] = t7;
2692
+ $2[67] = t8;
2693
+ $2[68] = t9;
2694
+ $2[69] = t14;
2695
+ } else {
2696
+ t14 = $2[69];
2697
+ }
2698
+ const t15 = blocker?.state === "blocked";
2699
+ let t16;
2700
+ let t17;
2701
+ if ($2[70] !== blocker) {
2702
+ t16 = () => blocker?.proceed?.();
2703
+ t17 = () => blocker?.reset?.();
2704
+ $2[70] = blocker;
2705
+ $2[71] = t16;
2706
+ $2[72] = t17;
2707
+ } else {
2708
+ t16 = $2[71];
2709
+ t17 = $2[72];
2710
+ }
2711
+ let t18;
2712
+ if ($2[73] !== t15 || $2[74] !== t16 || $2[75] !== t17) {
2713
+ t18 = /* @__PURE__ */ jsx(UnsavedChangesDialog, { open: t15, handleOk: t16, handleCancel: t17, body: "You have unsaved changes in this entity." });
2714
+ $2[73] = t15;
2715
+ $2[74] = t16;
2716
+ $2[75] = t17;
2717
+ $2[76] = t18;
2718
+ } else {
2719
+ t18 = $2[76];
2720
+ }
2721
+ let t19;
2722
+ if ($2[77] !== t14 || $2[78] !== t18) {
2723
+ t19 = /* @__PURE__ */ jsxs(Fragment, { children: [
2724
+ t14,
2725
+ t18
2726
+ ] });
2727
+ $2[77] = t14;
2728
+ $2[78] = t18;
2729
+ $2[79] = t19;
2730
+ } else {
2731
+ t19 = $2[79];
2732
+ }
2733
+ return t19;
2734
+ }
2735
+ function _temp6(entry_1) {
2736
+ return entry_1.type === "collection";
2737
+ }
2738
+ function _temp5(entry_0) {
2739
+ return entry_0.type === "custom_view" || entry_0.type === "collection";
2740
+ }
2741
+ function _temp4(entry) {
2742
+ return entry.type === "entity";
2743
+ }
2744
+ function CustomViewRoute(t0) {
2745
+ const $2 = c2(8);
2746
+ const {
2747
+ view
2748
+ } = t0;
2749
+ const breadcrumbs = useBreadcrumbsController();
2750
+ const urlController = useUrlController();
2751
+ let t1;
2752
+ if ($2[0] !== breadcrumbs || $2[1] !== urlController || $2[2] !== view.name || $2[3] !== view.slug) {
2753
+ t1 = () => {
2754
+ breadcrumbs.set({
2755
+ breadcrumbs: [{
2756
+ title: view.name,
2757
+ url: urlController.buildAppUrlPath(view.slug)
2758
+ }]
2759
+ });
2760
+ };
2761
+ $2[0] = breadcrumbs;
2762
+ $2[1] = urlController;
2763
+ $2[2] = view.name;
2764
+ $2[3] = view.slug;
2765
+ $2[4] = t1;
2766
+ } else {
2767
+ t1 = $2[4];
2768
+ }
2769
+ let t2;
2770
+ if ($2[5] !== urlController || $2[6] !== view.slug) {
2771
+ t2 = [view.slug, urlController];
2772
+ $2[5] = urlController;
2773
+ $2[6] = view.slug;
2774
+ $2[7] = t2;
2775
+ } else {
2776
+ t2 = $2[7];
2777
+ }
2778
+ useEffect(t1, t2);
2779
+ return view.view;
2780
+ }
2781
+ function SettingsView() {
2782
+ const $2 = c2(5);
2783
+ const {
2784
+ t
2785
+ } = useTranslation();
2786
+ const breadcrumbs = useBreadcrumbsController();
2787
+ let t0;
2788
+ if ($2[0] !== breadcrumbs || $2[1] !== t) {
2789
+ t0 = () => {
2790
+ breadcrumbs.set({
2791
+ breadcrumbs: [{
2792
+ title: t("account_settings"),
2793
+ url: "/settings"
2794
+ }]
2795
+ });
2796
+ };
2797
+ $2[0] = breadcrumbs;
2798
+ $2[1] = t;
2799
+ $2[2] = t0;
2800
+ } else {
2801
+ t0 = $2[2];
2802
+ }
2803
+ let t1;
2804
+ if ($2[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2805
+ t1 = [];
2806
+ $2[3] = t1;
2807
+ } else {
2808
+ t1 = $2[3];
2809
+ }
2810
+ useEffect(t0, t1);
2811
+ let t2;
2812
+ if ($2[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
2813
+ t2 = /* @__PURE__ */ jsx(UserSettingsView, {});
2814
+ $2[4] = t2;
2815
+ } else {
2816
+ t2 = $2[4];
2817
+ }
2818
+ return t2;
2819
+ }
2820
+ function RebaseRouteDefs({
2821
+ children,
2822
+ layout
2823
+ }) {
2824
+ const registry = useRebaseRegistry();
2825
+ const userManagement = useInternalUserManagementController();
2826
+ const navigationStateController = useNavigationStateController();
2827
+ const cmsHomePage = registry.cmsConfig?.homePage ?? /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(CircularProgressCenter, {}), children: /* @__PURE__ */ jsx(ContentHomePage, {}) });
2828
+ const studioHomePage = registry.studioConfig?.homePage;
2829
+ const combinedViews = useMemo(() => [...navigationStateController.views ?? [], ...navigationStateController.adminViews ?? []], [navigationStateController.views, navigationStateController.adminViews]);
2830
+ const routeContents = /* @__PURE__ */ jsxs(Fragment, { children: [
2831
+ /* @__PURE__ */ jsx(Route, { path: "/", element: cmsHomePage }),
2832
+ registry.studioConfig && /* @__PURE__ */ jsx(Route, { path: "/s", element: studioHomePage }),
2833
+ /* @__PURE__ */ jsx(Route, { path: "/c/*", element: /* @__PURE__ */ jsx(RebaseRoute, {}) }),
2834
+ /* @__PURE__ */ jsx(Route, { path: "/settings", element: /* @__PURE__ */ jsx(SettingsView, {}) }),
2835
+ userManagement && /* @__PURE__ */ jsx(Route, { path: "/roles", element: /* @__PURE__ */ jsx(RolesView, { userManagement }) }),
2836
+ /* @__PURE__ */ jsx(Route, { path: "/debug/ui", element: /* @__PURE__ */ jsx(UIReferenceView, {}) }),
2837
+ combinedViews.map((view) => {
2838
+ const slugs = Array.isArray(view.slug) ? view.slug : [view.slug];
2839
+ return slugs.flatMap((slug) => {
2840
+ const routes = [/* @__PURE__ */ jsx(Route, { path: slug, element: /* @__PURE__ */ jsx(CustomViewRoute, { view }) }, slug)];
2841
+ if (view.nestedRoutes) {
2842
+ routes.push(/* @__PURE__ */ jsx(Route, { path: slug + "/*", element: /* @__PURE__ */ jsx(CustomViewRoute, { view }) }, slug + "/*"));
2843
+ }
2844
+ return routes;
2845
+ });
2846
+ }),
2847
+ children,
2848
+ /* @__PURE__ */ jsx(Route, { path: "*", element: navigationStateController.loading ? /* @__PURE__ */ jsx(CircularProgressCenter, {}) : /* @__PURE__ */ jsx(NotFoundPage, {}) })
2849
+ ] });
2850
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2851
+ /* @__PURE__ */ jsx(RebaseRoutes, { children: layout ? /* @__PURE__ */ jsx(Route, { element: layout, children: routeContents }) : /* @__PURE__ */ jsx(Route, { element: /* @__PURE__ */ jsx(Fragment, { children: routeContents }), children: routeContents }) }),
2852
+ /* @__PURE__ */ jsx(CollectionEditorDialogs, {})
2853
+ ] });
2854
+ }
2855
+ function RebaseShell(props) {
2856
+ const $2 = c2(11);
2857
+ const {
2858
+ title: t0,
2859
+ appBar,
2860
+ drawer,
2861
+ autoOpenDrawer: t1,
2862
+ children
2863
+ } = props;
2864
+ const title = t0 === void 0 ? "Rebase" : t0;
2865
+ const autoOpenDrawer = t1 === void 0 ? false : t1;
2866
+ const registry = useRebaseRegistry();
2867
+ registry.studioConfig?.devViews;
2868
+ let t2;
2869
+ let t3;
2870
+ if ($2[0] !== registry.studioConfig?.devViews) {
2871
+ t3 = registry.studioConfig?.devViews ?? [];
2872
+ $2[0] = registry.studioConfig?.devViews;
2873
+ $2[1] = t3;
2874
+ } else {
2875
+ t3 = $2[1];
2876
+ }
2877
+ t2 = t3;
2878
+ const devViews = t2;
2879
+ let t4;
2880
+ if ($2[2] !== appBar || $2[3] !== autoOpenDrawer || $2[4] !== devViews || $2[5] !== drawer || $2[6] !== title) {
2881
+ t4 = /* @__PURE__ */ jsx(RebaseLayout, { title, appBar, drawer, autoOpenDrawer, devViews });
2882
+ $2[2] = appBar;
2883
+ $2[3] = autoOpenDrawer;
2884
+ $2[4] = devViews;
2885
+ $2[5] = drawer;
2886
+ $2[6] = title;
2887
+ $2[7] = t4;
2888
+ } else {
2889
+ t4 = $2[7];
2890
+ }
2891
+ let t5;
2892
+ if ($2[8] !== children || $2[9] !== t4) {
2893
+ t5 = /* @__PURE__ */ jsx(RebaseAuthGate, { children: /* @__PURE__ */ jsx(RebaseNavigation, { children: /* @__PURE__ */ jsx(ErrorBoundary, { fullPage: true, children: /* @__PURE__ */ jsx(RebaseRouteDefs, { layout: t4, children }) }) }) });
2894
+ $2[8] = children;
2895
+ $2[9] = t4;
2896
+ $2[10] = t5;
2897
+ } else {
2898
+ t5 = $2[10];
2899
+ }
2900
+ return t5;
2901
+ }
2902
+ function ArrayOfMapsPreview(t0) {
2903
+ const $2 = c2(9);
2904
+ let t1;
2905
+ let t2;
2906
+ let t3;
2907
+ if ($2[0] !== t0) {
2908
+ t3 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
2909
+ bb0: {
2910
+ const {
2911
+ propertyKey,
2912
+ value,
2913
+ property,
2914
+ size
2915
+ } = t0;
2916
+ if (Array.isArray(property?.of)) {
2917
+ throw Error("Using array properties instead of single one in `of` in ArrayProperty");
2918
+ }
2919
+ if (property?.type !== "array" || !property.of || property.of.type !== "map") {
2920
+ throw Error("Picked wrong preview component ArrayOfMapsPreview");
2921
+ }
2922
+ const mapProperty = property.of;
2923
+ const properties = mapProperty.properties;
2924
+ if (!properties) {
2925
+ throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property ${propertyKey}`);
2926
+ }
2927
+ const values = value;
2928
+ const previewProperties = mapProperty.previewProperties;
2929
+ if (!values) {
2930
+ t3 = null;
2931
+ break bb0;
2932
+ }
2933
+ let mapProperties;
2934
+ mapProperties = previewProperties;
2935
+ if (!mapProperties || !mapProperties.length) {
2936
+ mapProperties = Object.keys(properties);
2937
+ if (size) {
2938
+ mapProperties = mapProperties.slice(0, 3);
2939
+ }
2940
+ }
2941
+ t2 = "table-auto text-xs";
2942
+ t1 = values && values.map((v2, index) => /* @__PURE__ */ jsx("div", { className: "border-b last:border-b-0 py-2", children: mapProperties && mapProperties.map((key) => /* @__PURE__ */ jsx("div", { className: "table-cell", children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(PropertyPreview, { propertyKey: key, value: v2[key], property: properties[key], size: "small" }) }) }, `table-cell-${key}`)) }, `table_${v2}_${index}`));
2943
+ }
2944
+ $2[0] = t0;
2945
+ $2[1] = t1;
2946
+ $2[2] = t2;
2947
+ $2[3] = t3;
2948
+ } else {
2949
+ t1 = $2[1];
2950
+ t2 = $2[2];
2951
+ t3 = $2[3];
2952
+ }
2953
+ if (t3 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel")) {
2954
+ return t3;
2955
+ }
2956
+ let t4;
2957
+ if ($2[4] !== t1) {
2958
+ t4 = /* @__PURE__ */ jsx("div", { children: t1 });
2959
+ $2[4] = t1;
2960
+ $2[5] = t4;
2961
+ } else {
2962
+ t4 = $2[5];
688
2963
  }
689
2964
  let t5;
690
- if ($2[6] !== t2) {
691
- t5 = t2("all_roles") || "All Roles";
2965
+ if ($2[6] !== t2 || $2[7] !== t4) {
2966
+ t5 = /* @__PURE__ */ jsx("div", { className: t2, children: t4 });
692
2967
  $2[6] = t2;
2968
+ $2[7] = t4;
2969
+ $2[8] = t5;
2970
+ } else {
2971
+ t5 = $2[8];
2972
+ }
2973
+ return t5;
2974
+ }
2975
+ function MissingReferenceWidget(t0) {
2976
+ const $2 = c2(22);
2977
+ const {
2978
+ path: pathProp
2979
+ } = t0;
2980
+ const registry = useCollectionRegistryController();
2981
+ const path = getLastSegment(pathProp);
2982
+ let t1;
2983
+ if ($2[0] !== pathProp || $2[1] !== registry) {
2984
+ t1 = registry.getParentCollectionSlugs(pathProp);
2985
+ $2[0] = pathProp;
2986
+ $2[1] = registry;
2987
+ $2[2] = t1;
2988
+ } else {
2989
+ t1 = $2[2];
2990
+ }
2991
+ const parentCollectionSlugs = t1;
2992
+ let t2;
2993
+ if ($2[3] !== pathProp || $2[4] !== registry) {
2994
+ t2 = registry.getParentEntityIds(pathProp);
2995
+ $2[3] = pathProp;
2996
+ $2[4] = registry;
2997
+ $2[5] = t2;
2998
+ } else {
2999
+ t2 = $2[5];
3000
+ }
3001
+ const parentEntityIds = t2;
3002
+ const collectionEditor = useCollectionEditorController();
3003
+ const {
3004
+ t
3005
+ } = useTranslation();
3006
+ const t3 = "p-1 flex flex-col items-center";
3007
+ const T0 = ErrorView;
3008
+ const t4 = t("studio_missing_reference_error", {
3009
+ path
3010
+ });
3011
+ let t5;
3012
+ if ($2[6] !== T0 || $2[7] !== t4) {
3013
+ t5 = /* @__PURE__ */ jsx(T0, { error: t4 });
3014
+ $2[6] = T0;
3015
+ $2[7] = t4;
3016
+ $2[8] = t5;
3017
+ } else {
3018
+ t5 = $2[8];
3019
+ }
3020
+ let t6;
3021
+ if ($2[9] !== collectionEditor || $2[10] !== parentCollectionSlugs || $2[11] !== parentEntityIds || $2[12] !== path) {
3022
+ t6 = () => {
3023
+ collectionEditor.createCollection({
3024
+ initialValues: {
3025
+ path,
3026
+ name: prettifyIdentifier(path)
3027
+ },
3028
+ parentCollectionSlugs,
3029
+ parentEntityIds,
3030
+ redirect: false,
3031
+ sourceClick: "missing_reference"
3032
+ });
3033
+ };
3034
+ $2[9] = collectionEditor;
3035
+ $2[10] = parentCollectionSlugs;
3036
+ $2[11] = parentEntityIds;
3037
+ $2[12] = path;
3038
+ $2[13] = t6;
3039
+ } else {
3040
+ t6 = $2[13];
3041
+ }
3042
+ let t7;
3043
+ if ($2[14] !== t) {
3044
+ t7 = t("studio_missing_reference_create");
3045
+ $2[14] = t;
3046
+ $2[15] = t7;
3047
+ } else {
3048
+ t7 = $2[15];
3049
+ }
3050
+ let t8;
3051
+ if ($2[16] !== t6 || $2[17] !== t7) {
3052
+ t8 = /* @__PURE__ */ jsx(Button, { className: "mx-2", size: "small", onClick: t6, children: t7 });
3053
+ $2[16] = t6;
3054
+ $2[17] = t7;
3055
+ $2[18] = t8;
3056
+ } else {
3057
+ t8 = $2[18];
3058
+ }
3059
+ let t9;
3060
+ if ($2[19] !== t5 || $2[20] !== t8) {
3061
+ t9 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
3062
+ t5,
3063
+ t8
3064
+ ] });
3065
+ $2[19] = t5;
3066
+ $2[20] = t8;
3067
+ $2[21] = t9;
3068
+ } else {
3069
+ t9 = $2[21];
3070
+ }
3071
+ return t9;
3072
+ }
3073
+ function RolesFilterSelect(t0) {
3074
+ const $2 = c2(20);
3075
+ const {
3076
+ tableController
3077
+ } = t0;
3078
+ const {
3079
+ t
3080
+ } = useTranslation();
3081
+ const userManagement = useInternalUserManagementController();
3082
+ let t1;
3083
+ if ($2[0] !== userManagement?.roles) {
3084
+ t1 = userManagement?.roles || [];
3085
+ $2[0] = userManagement?.roles;
3086
+ $2[1] = t1;
3087
+ } else {
3088
+ t1 = $2[1];
3089
+ }
3090
+ const roles = t1;
3091
+ const currentFilterValue = tableController.filterValues?.roles?.[1] || "";
3092
+ let t2;
3093
+ if ($2[2] !== tableController) {
3094
+ t2 = (newRole) => {
3095
+ const filterVal = newRole === "" ? void 0 : newRole;
3096
+ if (filterVal) {
3097
+ tableController.setFilterValues?.({
3098
+ ...tableController.filterValues,
3099
+ roles: ["array-contains", filterVal]
3100
+ });
3101
+ } else {
3102
+ const nextFilters = {
3103
+ ...tableController.filterValues
3104
+ };
3105
+ delete nextFilters.roles;
3106
+ tableController.setFilterValues?.(nextFilters);
3107
+ }
3108
+ };
3109
+ $2[2] = tableController;
3110
+ $2[3] = t2;
3111
+ } else {
3112
+ t2 = $2[3];
3113
+ }
3114
+ const handleRoleChange = t2;
3115
+ if (!roles || roles.length === 0) {
3116
+ return null;
3117
+ }
3118
+ const t3 = currentFilterValue || "__all__";
3119
+ let t4;
3120
+ if ($2[4] !== handleRoleChange) {
3121
+ t4 = (v2) => handleRoleChange(v2 === "__all__" ? "" : v2);
3122
+ $2[4] = handleRoleChange;
3123
+ $2[5] = t4;
3124
+ } else {
3125
+ t4 = $2[5];
3126
+ }
3127
+ let t5;
3128
+ if ($2[6] !== t) {
3129
+ t5 = t("all_roles") || "All Roles";
3130
+ $2[6] = t;
693
3131
  $2[7] = t5;
694
3132
  } else {
695
3133
  t5 = $2[7];
696
3134
  }
697
3135
  let t6;
698
- if ($2[8] !== t2) {
699
- t6 = t2("all_roles") || "All Roles";
700
- $2[8] = t2;
3136
+ if ($2[8] !== t) {
3137
+ t6 = t("all_roles") || "All Roles";
3138
+ $2[8] = t;
701
3139
  $2[9] = t6;
702
3140
  } else {
703
3141
  t6 = $2[9];
@@ -746,7 +3184,7 @@ function UserRolesSelectField(t0) {
746
3184
  disabled
747
3185
  } = t0;
748
3186
  const {
749
- t: t2
3187
+ t
750
3188
  } = useTranslation();
751
3189
  const userManagement = useInternalUserManagementController();
752
3190
  let t1;
@@ -758,18 +3196,18 @@ function UserRolesSelectField(t0) {
758
3196
  t1 = $2[1];
759
3197
  }
760
3198
  const roles = t1;
761
- let t22;
3199
+ let t2;
762
3200
  if ($2[2] !== value) {
763
- t22 = value || [];
3201
+ t2 = value || [];
764
3202
  $2[2] = value;
765
- $2[3] = t22;
3203
+ $2[3] = t2;
766
3204
  } else {
767
- t22 = $2[3];
3205
+ t2 = $2[3];
768
3206
  }
769
3207
  let t3;
770
- if ($2[4] !== t22) {
771
- t3 = t22.map(_temp);
772
- $2[4] = t22;
3208
+ if ($2[4] !== t2) {
3209
+ t3 = t2.map(_temp);
3210
+ $2[4] = t2;
773
3211
  $2[5] = t3;
774
3212
  } else {
775
3213
  t3 = $2[5];
@@ -788,9 +3226,9 @@ function UserRolesSelectField(t0) {
788
3226
  }
789
3227
  const handleValueChange = t4;
790
3228
  let t5;
791
- if ($2[8] !== t2) {
792
- t5 = t2("roles") || "Roles";
793
- $2[8] = t2;
3229
+ if ($2[8] !== t) {
3230
+ t5 = t("roles") || "Roles";
3231
+ $2[8] = t;
794
3232
  $2[9] = t5;
795
3233
  } else {
796
3234
  t5 = $2[9];
@@ -850,170 +3288,173 @@ export {
850
3288
  B2 as BasicExportAction,
851
3289
  B as BlockFieldBinding,
852
3290
  k as BooleanPreview,
853
- C as CollectionGenerationApiError,
854
- l as CollectionRegistryContext,
855
- m as CreationResultDialog,
856
- n as CustomViewRoute,
3291
+ l as CollectionGenerationApiError,
3292
+ m as CollectionRegistryContext,
3293
+ n as CreationResultDialog,
3294
+ CustomViewRoute,
857
3295
  D as DEFAULT_COLLECTION_GENERATION_ENDPOINT,
858
3296
  o as DEFAULT_FIELD_CONFIGS,
859
3297
  p as DataNewPropertiesMapping,
860
3298
  q as DatePreview,
861
3299
  r as DateTimeFieldBinding,
3300
+ s as DefaultDrawer,
862
3301
  Drawer,
3302
+ u as DrawerFooterActions,
863
3303
  E as EmptyValue,
864
- t as EntityCard,
865
- u as EntityCollectionCardView,
866
- v as EntityCollectionRowActions,
867
- w as EntityCollectionTable,
868
- x as EntityCollectionView,
869
- y as EntityCollectionViewActions,
870
- z as EntityForm,
871
- F as EntityPreview,
872
- G as EntitySelectionTable,
873
- H as EntityView,
874
- I as EnumValuesChip,
3304
+ v as EntityCard,
3305
+ w as EntityCollectionCardView,
3306
+ x as EntityCollectionRowActions,
3307
+ y as EntityCollectionTable,
3308
+ EntityCollectionView,
3309
+ F as EntityCollectionViewActions,
3310
+ I as EntityForm,
3311
+ J as EntityPreview,
3312
+ K as EntitySelectionTable,
3313
+ L as EntityView,
3314
+ M as EnumValuesChip,
875
3315
  E2 as ExportCollectionAction,
876
- J as FieldCaption,
877
- K as FieldHelperText,
878
- L as FormEntry,
879
- M as FormLayout,
880
- N as ImagePreview,
3316
+ N as FieldCaption,
3317
+ O as FieldHelperText,
3318
+ P as FormEntry,
3319
+ Q as FormLayout,
3320
+ R as ImagePreview,
881
3321
  I2 as ImportCollectionAction,
882
- a2 as ImportDataPreview,
883
- O as ImportFileUpload,
884
- P as ImportNewPropertyFieldPreview,
885
- Q as ImportSaveInProgress,
886
- R as KeyValueFieldBinding,
887
- S as KeyValuePreview,
888
- T as LabelWithIcon,
889
- U as LabelWithIconAndTooltip,
890
- V as MapFieldBinding,
891
- W as MapPropertyPreview,
892
- X as MarkdownEditorFieldBinding,
3322
+ a7 as ImportDataPreview,
3323
+ S as ImportFileUpload,
3324
+ T as ImportNewPropertyFieldPreview,
3325
+ U as ImportSaveInProgress,
3326
+ V as KeyValueFieldBinding,
3327
+ W as KeyValuePreview,
3328
+ X as LabelWithIcon,
3329
+ Y as LabelWithIconAndTooltip,
3330
+ Z as MapFieldBinding,
3331
+ _ as MapPropertyPreview,
3332
+ $ as MarkdownEditorFieldBinding,
893
3333
  MissingReferenceWidget,
894
- Y as MultiSelectFieldBinding,
895
- Z as NavigationStateContext,
896
- _ as NumberPropertyPreview,
897
- $ as PropertyConfigBadge,
898
- a0 as PropertyFieldBinding,
899
- a1 as PropertyIdCopyTooltip,
3334
+ a0 as MultiSelectFieldBinding,
3335
+ a2 as NavigationStateContext,
3336
+ a3 as NumberPropertyPreview,
3337
+ a4 as PropertyConfigBadge,
3338
+ a5 as PropertyFieldBinding,
3339
+ a6 as PropertyIdCopyTooltip,
900
3340
  PropertyPreview,
901
3341
  P2 as PropertySelectEntry,
902
- a3 as ReadOnlyFieldBinding,
3342
+ a8 as ReadOnlyFieldBinding,
903
3343
  RebaseAuthGate,
904
3344
  RebaseCMS,
905
3345
  RebaseLayout,
906
3346
  RebaseNavigation,
907
- a5 as RebaseRoute,
3347
+ RebaseRoute,
908
3348
  RebaseRouteDefs,
909
3349
  RebaseShell,
910
- a7 as ReferenceAsStringFieldBinding,
911
- a8 as ReferenceFieldBinding,
3350
+ aa as ReferenceAsStringFieldBinding,
3351
+ ab as ReferenceFieldBinding,
912
3352
  ReferencePreview,
913
3353
  ReferenceWidget,
914
- aa as RelationPreview,
915
- ab as RepeatFieldBinding,
3354
+ ad as RelationPreview,
3355
+ ae as RepeatFieldBinding,
916
3356
  RolesFilterSelect,
917
3357
  Scaffold,
918
- ad as SearchIconsView,
919
- ae as SelectFieldBinding,
920
- af as SelectableTable,
921
- ag as SelectableTableContext,
3358
+ ai as SearchIconsView,
3359
+ aj as SelectFieldBinding,
3360
+ ak as SelectableTable,
3361
+ al as SelectableTableContext,
922
3362
  SideDialogs,
923
- ai as SideEntityControllerContext,
924
- aj as SideEntityProvider,
925
- ak as SkeletonPropertyComponent,
926
- al as StorageThumbnail,
927
- am as StorageThumbnailInternal,
928
- an as StorageUploadFieldBinding,
929
- ao as StringPropertyPreview,
930
- ap as SwitchFieldBinding,
931
- aq as TextFieldBinding,
932
- ar as UrlComponentPreview,
933
- as as UrlContext,
934
- at as UserPreview,
3363
+ an as SideEntityControllerContext,
3364
+ ao as SideEntityProvider,
3365
+ ap as SkeletonPropertyComponent,
3366
+ aq as StorageThumbnail,
3367
+ ar as StorageThumbnailInternal,
3368
+ as as StorageUploadFieldBinding,
3369
+ at as StringPropertyPreview,
3370
+ au as SwitchFieldBinding,
3371
+ av as TextFieldBinding,
3372
+ aw as UrlComponentPreview,
3373
+ ax as UrlContext,
3374
+ ay as UserPreview,
935
3375
  UserRolesSelectField,
936
- au as VectorFieldBinding,
937
- av as VirtualTableInput,
3376
+ az as VectorFieldBinding,
3377
+ aA as VirtualTableInput,
938
3378
  addInitialSlash,
939
- aw as buildCollectionGenerationCallback,
940
- ax as buildSidePanelsFromUrl,
941
- ay as convertDataToEntity,
942
- az as convertFileToJson,
943
- aA as copyEntityAction,
944
- aB as deleteEntityAction,
3379
+ aB as buildCollectionGenerationCallback,
3380
+ aC as buildSidePanelsFromUrl,
3381
+ aD as convertDataToEntity,
3382
+ aE as convertFileToJson,
3383
+ aF as copyEntityAction,
3384
+ aG as deleteEntityAction,
945
3385
  d2 as downloadBlob,
946
- a4 as downloadDataAsCsv,
3386
+ a9 as downloadDataAsCsv,
947
3387
  b10 as downloadEntitiesExport,
948
- aC as editEntityAction,
949
- aD as flattenEntry,
950
- aE as getBracketNotation,
3388
+ aH as editEntityAction,
3389
+ aI as flattenEntry,
3390
+ aJ as getBracketNotation,
951
3391
  getCollectionBySlugWithin,
952
3392
  getCollectionPathsCombinations,
953
- aF as getDefaultFieldConfig,
954
- aG as getDefaultFieldId,
955
- aH as getDefaultPropertiesOrder,
3393
+ aK as getDefaultFieldConfig,
3394
+ aL as getDefaultFieldId,
3395
+ aM as getDefaultPropertiesOrder,
956
3396
  g2 as getEntityCSVExportableData,
957
3397
  c3 as getEntityJsonExportableData,
958
- aI as getEntityPreviewKeys,
959
- aJ as getEntityTitlePropertyKey,
960
- aK as getEntityViewWidth,
961
- aL as getFieldConfig,
962
- aM as getFieldId,
963
- aN as getFullId,
964
- aO as getFullIdPath,
965
- aP as getIconForProperty,
966
- aQ as getIconForWidget,
967
- aR as getInferenceType,
3398
+ aN as getEntityPreviewKeys,
3399
+ aO as getEntityTitlePropertyKey,
3400
+ aP as getEntityViewWidth,
3401
+ aQ as getFieldConfig,
3402
+ aR as getFieldId,
3403
+ aS as getFullId,
3404
+ aT as getFullIdPath,
3405
+ aU as getIconForProperty,
3406
+ aV as getIconForWidget,
3407
+ aW as getInferenceType,
968
3408
  getLastSegment2 as getLastSegment,
969
- aS as getPropertiesWithPropertiesOrder,
970
- aT as getPropertyInPath,
971
- aU as getResolvedPropertyInPath,
972
- aV as idToPropertiesPath,
973
- aW as isReferenceProperty,
974
- aX as isRelationProperty,
975
- aY as mergeEntityActions,
976
- aZ as namespaceToPropertiesOrderPath,
977
- a_ as namespaceToPropertiesPath,
978
- a$ as processValueMapping,
3409
+ aX as getPropertiesWithPropertiesOrder,
3410
+ aY as getPropertyInPath,
3411
+ aZ as getResolvedPropertyInPath,
3412
+ a_ as idToPropertiesPath,
3413
+ a$ as isReferenceProperty,
3414
+ b0 as isRelationProperty,
3415
+ b1 as mergeEntityActions,
3416
+ b2 as namespaceToPropertiesOrderPath,
3417
+ b3 as namespaceToPropertiesPath,
3418
+ b4 as processValueMapping,
979
3419
  removeInitialAndTrailingSlashes,
980
3420
  removeInitialSlash,
981
3421
  removeTrailingSlash,
982
- b0 as renderSkeletonCaptionText,
983
- b1 as renderSkeletonIcon,
984
- b2 as renderSkeletonImageThumbnail,
985
- b3 as renderSkeletonText,
986
- b4 as resetPasswordAction,
3422
+ b5 as renderSkeletonCaptionText,
3423
+ b6 as renderSkeletonIcon,
3424
+ b7 as renderSkeletonImageThumbnail,
3425
+ b8 as renderSkeletonText,
3426
+ b9 as resetPasswordAction,
987
3427
  resolveCollectionPathIds,
988
- b5 as resolveEntityAction,
989
- b6 as resolveEntityView,
3428
+ ba as resolveEntityAction,
3429
+ bb as resolveEntityView,
990
3430
  resolveNavigationFrom,
991
- b7 as unflattenObject,
992
- b8 as useApp,
993
- b9 as useBreadcrumbsController,
994
- ba as useBuildCollectionRegistryController,
995
- bb as useBuildNavigationStateController,
996
- bc as useBuildSideEntityController,
997
- bd as useBuildUrlController,
3431
+ bc as sanitizeUrl,
3432
+ bd as unflattenObject,
3433
+ be as useApp,
3434
+ useBreadcrumbsController,
3435
+ bg as useBuildCollectionRegistryController,
3436
+ bh as useBuildNavigationStateController,
3437
+ bi as useBuildSideEntityController,
3438
+ bj as useBuildUrlController,
998
3439
  useCMSContext,
999
- bf as useClearRestoreValue,
3440
+ bl as useClearRestoreValue,
1000
3441
  useCollectionEditorController,
1001
3442
  useCollectionRegistryController,
1002
- bi as useCollectionsConfigController,
3443
+ bo as useCollectionsConfigController,
1003
3444
  u2 as useEntityHistory,
1004
3445
  useEntitySelectionDialog,
1005
- bk as useImportConfig,
1006
- bl as useLocalCollectionsConfigController,
1007
- bm as useNavigationStateController,
1008
- bn as useResolvedCollections,
3446
+ bq as useImportConfig,
3447
+ br as useLocalCollectionsConfigController,
3448
+ useNavigationStateController,
3449
+ bt as useResolvedCollections,
1009
3450
  useResolvedNavigationFrom,
1010
- bo as useResolvedViews,
1011
- bp as useSelectionController,
1012
- bq as useSideDialogsController,
1013
- br as useSideEntityController,
1014
- bs as useTopLevelNavigation,
3451
+ bu as useResolvedViews,
3452
+ bv as useSelectionController,
3453
+ bw as useSideDialogsController,
3454
+ bx as useSideEntityController,
3455
+ by as useTopLevelNavigation,
1015
3456
  useUrlController,
1016
- bu as validateCollectionJson,
1017
- bv as zodToFormErrors
3457
+ bA as validateCollectionJson,
3458
+ bB as zodToFormErrors
1018
3459
  };
1019
3460
  //# sourceMappingURL=index.js.map