ode-explorer 1.4.18-develop-integration.202410021150 → 1.4.18-develop-pedago.202410071739

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 (42) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.js +1388 -76626
  3. package/dist/version.txt +1 -1
  4. package/lib/ActionBarContainer.js +172 -166
  5. package/lib/AppAction.js +27 -25
  6. package/lib/DeleteModal.js +6 -4
  7. package/lib/DraggableCard.js +25 -0
  8. package/lib/EmptyScreenApp.js +26 -24
  9. package/lib/ExportModal.js +13 -11
  10. package/lib/FolderModal.js +6 -4
  11. package/lib/FoldersList.js +84 -44
  12. package/lib/Library.js +25 -27
  13. package/lib/MoveModal.js +71 -55
  14. package/lib/ResourcesList.js +96 -73
  15. package/lib/components/Explorer.d.ts +1 -1
  16. package/lib/config/dndkit.d.ts +2 -0
  17. package/lib/config/{getExplorerConfig.d.ts → explorer.d.ts} +5 -1
  18. package/lib/config/index.d.ts +2 -0
  19. package/lib/features/AccessControl/AccessControl.d.ts +1 -1
  20. package/lib/features/ActionBar/Move/useMoveModal.d.ts +3 -4
  21. package/lib/features/ActionBar/useActionBar.d.ts +1 -1
  22. package/lib/features/DndKit/useDndKit.d.ts +7 -0
  23. package/lib/features/List/DraggableCard.d.ts +6 -0
  24. package/lib/features/List/FolderCard.d.ts +6 -2
  25. package/lib/index.d.ts +1 -1
  26. package/lib/index.js +7 -5
  27. package/lib/index2.js +1019 -950
  28. package/lib/providers/index.d.ts +6 -0
  29. package/lib/services/resource/service.d.ts +11 -0
  30. package/lib/store/index.d.ts +87 -33
  31. package/lib/utils/getChildrenIds.d.ts +2 -0
  32. package/package.json +7 -5
  33. package/lib/utils/TreeNodeFolderWrapper.d.ts +0 -12
  34. package/lib/utils/addNode.d.ts +0 -6
  35. package/lib/utils/deleteNode.d.ts +0 -4
  36. package/lib/utils/findNodeById.d.ts +0 -2
  37. package/lib/utils/getAncestors.d.ts +0 -2
  38. package/lib/utils/hasChildren.d.ts +0 -2
  39. package/lib/utils/modifyNode.d.ts +0 -2
  40. package/lib/utils/moveNode.d.ts +0 -5
  41. package/lib/utils/updateNode.d.ts +0 -6
  42. package/lib/utils/wrapTreeNode.d.ts +0 -3
package/lib/index2.js CHANGED
@@ -1,196 +1,154 @@
1
- var ge = Object.defineProperty;
2
- var ye = (e, s, t) => s in e ? ge(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
3
- var $ = (e, s, t) => (ye(e, typeof s != "symbol" ? s + "" : s, t), t);
4
- import { jsx as c, jsxs as N, Fragment as ce } from "react/jsx-runtime";
5
- import { useState as ie, useRef as Ie, useEffect as M, Suspense as O, lazy as F, Fragment as Se } from "react";
6
- import { useScrollToTop as we, useOdeClient as K, IconButton as xe, useToast as k, useUser as le, useShareMutation as De, useUpdateMutation as be, LoadingScreen as A, FormControl as Te, Input as Fe, SearchButton as Ce, Dropdown as z, useToggle as Ne, TreeView as Re, Button as Pe, useXitiTrackPageLoad as Ae, isActionAvailable as oe, AppHeader as Ee, Breadcrumb as Qe, Grid as te } from "@edifice-ui/react";
7
- import { ArrowLeft as qe, Filter as Oe, Delete as ke, Plus as Ue } from "@edifice-ui/icons";
8
- import { useTranslation as j } from "react-i18next";
9
- import { odeServices as D, FOLDER as w, SORT_ORDER as Le } from "edifice-ts-client";
10
- import { t as x } from "i18next";
11
- import { create as ve } from "zustand";
12
- import { useQuery as Me, useInfiniteQuery as Ke, useQueryClient as E, useMutation as L } from "@tanstack/react-query";
13
- const de = async (e) => {
14
- const s = await D.resource(e.application).searchContext(e);
1
+ import { jsxs as N, Fragment as G, jsx as c } from "react/jsx-runtime";
2
+ import { useEffect as $, Suspense as U, lazy as Q, useState as de, useRef as be, Fragment as we } from "react";
3
+ import { useSensor as se, MouseSensor as xe, TouchSensor as Te, KeyboardSensor as Ce, useSensors as Fe, DndContext as Re } from "@dnd-kit/core";
4
+ import { snapCenterToCursor as Ne } from "@dnd-kit/modifiers";
5
+ import { findNodeById as J, wrapTreeNode as Ee, findParentNode as Pe, useToast as L, moveNode as Ae, deleteNode as Qe, useUser as ue, useShareMutation as qe, useUpdateMutation as Oe, useOdeClient as v, addNode as ke, updateNode as Me, getAncestors as ae, LoadingScreen as M, FormControl as Ue, Input as Le, SearchButton as ve, Dropdown as j, useToggle as Be, useScrollToTop as Ke, TreeView as $e, Button as _e, IconButton as ze, useXitiTrackPageLoad as je, isActionAvailable as ce, AppHeader as Ve, Breadcrumb as We, Grid as re } from "@edifice-ui/react";
6
+ import { odeServices as P, FOLDER as R, SORT_ORDER as He, ResourceService as he } from "edifice-ts-client";
7
+ import { t as E } from "i18next";
8
+ import { createStore as Ge, useStore as Je } from "zustand";
9
+ import { useQuery as Xe, queryOptions as Ye, useQueryClient as k, useMutation as B, useInfiniteQuery as Ze } from "@tanstack/react-query";
10
+ import { useTranslation as _ } from "react-i18next";
11
+ import { Filter as et, Delete as tt, Plus as st, ArrowLeft as rt } from "@edifice-ui/icons";
12
+ const pe = async (e) => {
13
+ const t = await P.resource(e.application).searchContext(e);
15
14
  return {
16
- ...s,
17
- folders: s.folders.filter((t) => !t.trashed)
15
+ ...t,
16
+ folders: t.folders.filter((s) => !s.trashed)
18
17
  };
19
- }, Be = async ({
18
+ }, ot = async ({
20
19
  searchParams: e,
21
- name: s,
22
- parentId: t
20
+ name: t,
21
+ parentId: s
23
22
  }) => {
24
23
  const r = {
25
- name: s,
26
- parentId: t,
24
+ name: t,
25
+ parentId: s,
27
26
  application: e.application,
28
27
  type: e.types[0]
29
28
  };
30
- return await D.resource(e.application).createFolder(r);
31
- }, _e = async ({
29
+ return await P.resource(e.application).createFolder(r);
30
+ }, nt = async ({
32
31
  folderId: e,
33
- searchParams: s,
34
- parentId: t,
32
+ searchParams: t,
33
+ parentId: s,
35
34
  name: r
36
35
  }) => {
37
- const n = {
36
+ const o = {
38
37
  folderId: e,
39
38
  name: r,
40
- parentId: t,
41
- application: s.application,
42
- type: s.types[0]
39
+ parentId: s,
40
+ application: t.application,
41
+ type: t.types[0]
43
42
  };
44
- return await D.resource(s.application).updateFolder(n);
45
- }, $e = async ({
43
+ return await P.resource(t.application).updateFolder(o);
44
+ }, at = async ({
46
45
  searchParams: e,
47
- resourceIds: s,
48
- useAssetIds: t,
46
+ resourceIds: t,
47
+ useAssetIds: s,
49
48
  folderIds: r
50
49
  }) => {
51
- const n = {
50
+ const o = {
52
51
  application: e.application,
53
52
  resourceType: e.types[0],
54
- resourceIds: s,
53
+ resourceIds: t,
55
54
  folderIds: r
56
55
  };
57
- return await D.resource(e.application).trashAll(n, t);
58
- }, ze = async ({
56
+ return await P.resource(e.application).trashAll(o, s);
57
+ }, ct = async ({
59
58
  searchParams: e,
60
- resourceIds: s,
61
- useAssetIds: t,
59
+ resourceIds: t,
60
+ useAssetIds: s,
62
61
  folderIds: r
63
62
  }) => {
64
- const n = {
63
+ const o = {
65
64
  application: e.application,
66
65
  resourceType: e.types[0],
67
- resourceIds: s,
66
+ resourceIds: t,
68
67
  folderIds: r
69
68
  };
70
- return await D.resource(e.application).deleteAll(n, t);
71
- }, je = async ({
69
+ return await P.resource(e.application).deleteAll(o, s);
70
+ }, it = async ({
72
71
  searchParams: e,
73
- resourceIds: s,
74
- folderIds: t,
72
+ resourceIds: t,
73
+ folderIds: s,
75
74
  useAssetIds: r
76
75
  }) => {
77
- const n = {
76
+ const o = {
78
77
  application: e.application,
79
78
  resourceType: e.types[0],
80
- resourceIds: s,
81
- folderIds: t
79
+ resourceIds: t,
80
+ folderIds: s
82
81
  };
83
- return await D.resource(e.application).restoreAll(n, r);
84
- }, Ve = async (e, s) => await D.resource(e.application).copy({
82
+ return await P.resource(e.application).restoreAll(o, r);
83
+ }, lt = async (e, t) => await P.resource(e.application).copy({
85
84
  application: e.application,
86
- resourceId: s
87
- }), ue = async ({
85
+ resourceId: t
86
+ }), fe = async ({
88
87
  searchParams: e,
89
- resourceIds: s,
90
- folderId: t,
88
+ resourceIds: t,
89
+ folderId: s,
91
90
  folderIds: r,
92
- useAssetIds: n
91
+ useAssetIds: o
93
92
  }) => {
94
93
  const a = {
95
94
  application: e.application,
96
- folderId: t,
97
- resourceIds: s,
95
+ folderId: s,
96
+ resourceIds: t,
98
97
  folderIds: r
99
98
  };
100
- return await D.resource(e.application).moveToFolder(a, n);
101
- }, He = async (e) => await D.rights().sessionHasWorkflowRights(e), We = ({
99
+ return await P.resource(e.application).moveToFolder(a, o);
100
+ }, dt = async (e) => await P.rights().sessionHasWorkflowRights(e), ut = ({
102
101
  searchParams: e,
103
- assetId: s
102
+ assetId: t
104
103
  }) => {
105
- const t = D.resource(e.application).getViewUrl(s);
106
- window.open(t, "_self");
107
- }, Ge = ({
104
+ const s = P.resource(e.application).getViewUrl(t);
105
+ window.open(s, "_self");
106
+ }, ht = ({
108
107
  searchParams: e,
109
- params: s
110
- }) => D.resource(e.application).create(s), Je = ({
108
+ params: t
109
+ }) => P.resource(e.application).create(t), pt = ({
111
110
  searchParams: e,
112
- assetId: s
111
+ assetId: t
113
112
  }) => {
114
- const t = D.resource(e.application).getPrintUrl(s);
115
- return window.open(t, "_blank");
116
- }, $t = ({
113
+ const s = P.resource(e.application).getPrintUrl(t);
114
+ return window.open(s, "_blank");
115
+ }, ds = ({
117
116
  searchParams: e,
118
- folderId: s
117
+ folderId: t
119
118
  }) => {
120
- const t = D.resource(e.application).getFormUrl(s);
121
- return window.open(t, "_self");
122
- }, zt = ({
119
+ const s = P.resource(e.application).getFormUrl(t);
120
+ return window.open(s, "_self");
121
+ }, us = ({
123
122
  searchParams: e,
124
- assetId: s
123
+ assetId: t
125
124
  }) => {
126
- const t = D.resource(e.application).getEditUrl(s);
127
- return window.open(t, "_self");
128
- }, jt = ({
125
+ const s = P.resource(e.application).getEditUrl(t);
126
+ return window.open(s, "_self");
127
+ }, hs = ({
129
128
  searchParams: e,
130
- assetId: s
129
+ assetId: t
131
130
  }) => {
132
- const t = D.resource(e.application).getExportUrl(s);
133
- return window.open(t, "_self");
134
- };
135
- function se(e) {
136
- return e.filter((s, t) => e.indexOf(s) === t);
137
- }
138
- function W(e, s) {
139
- var r, n;
140
- let t;
141
- return (s == null ? void 0 : s.id) === e ? s : ((r = s == null ? void 0 : s.children) != null && r.length && ((n = s == null ? void 0 : s.children) == null || n.every((a) => (t = W(e, a), t === void 0))), t);
142
- }
143
- function Xe(e, s) {
144
- var r;
145
- const t = W(e, s);
146
- return (r = t == null ? void 0 : t.folder) != null && r.ancestors ? [...(t == null ? void 0 : t.folder.ancestors) || [], e] : e === w.BIN ? [w.BIN] : [w.DEFAULT];
147
- }
148
- function fe(e, s) {
149
- return s.id === e && s.children ? s.children.length > 0 : s.children ? s.children.some((t) => fe(s.id, t)) : !1;
150
- }
151
- function G(e, s) {
152
- return he(e, s) || e;
153
- }
154
- function he(e, s, t) {
155
- var n;
156
- const r = s(e, t);
157
- if ((n = r == null ? void 0 : r.children) != null && n.length) {
158
- const a = [];
159
- for (const o of (r == null ? void 0 : r.children) || []) {
160
- const i = he(o, s, r);
161
- i && a.push(i);
162
- }
163
- return {
164
- ...r,
165
- children: a
166
- };
167
- }
168
- return r;
169
- }
170
- class J {
171
- constructor(s) {
172
- $(this, "id");
173
- $(this, "name");
174
- $(this, "childNumber");
175
- $(this, "section", !1);
176
- $(this, "children", []);
177
- this.folder = s, this.id = s.id, this.name = s.name, this.childNumber = s.childNumber;
178
- }
179
- }
180
- const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? void 0 : s.map((n) => new J(n))), r)), Ye = {
181
- config: null,
131
+ const s = P.resource(e.application).getExportUrl(t);
132
+ return window.open(s, "_self");
133
+ }, ge = {
134
+ id: R.DEFAULT,
135
+ name: E("explorer.filters.mine"),
136
+ section: !0,
137
+ children: []
138
+ }, ft = {
139
+ config: void 0,
182
140
  searchConfig: {
183
141
  minLength: 1
184
142
  },
185
143
  searchParams: {
186
144
  filters: {
187
- folder: w.DEFAULT,
145
+ folder: R.DEFAULT,
188
146
  owner: void 0,
189
147
  shared: void 0,
190
148
  public: void 0
191
149
  },
192
150
  orders: {
193
- updatedAt: Le.DESC
151
+ updatedAt: He.DESC
194
152
  },
195
153
  application: "",
196
154
  types: [],
@@ -201,13 +159,8 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
201
159
  },
202
160
  trashed: !1
203
161
  },
204
- treeData: {
205
- id: w.DEFAULT,
206
- name: x("explorer.filters.mine"),
207
- section: !0,
208
- children: []
209
- },
210
- selectedNodesIds: ["default"],
162
+ treeData: ge,
163
+ selectedNodeId: "default",
211
164
  currentFolder: {
212
165
  id: "default"
213
166
  },
@@ -216,87 +169,100 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
216
169
  folderIds: [],
217
170
  resourceIds: [],
218
171
  resourceIsTrash: !1,
172
+ resourceOrFolderIsDraggable: {
173
+ isDrag: !1,
174
+ elementDrag: void 0
175
+ },
176
+ elementDragOver: {
177
+ isOver: !1,
178
+ isTreeview: !1,
179
+ canMove: !0,
180
+ overId: void 0
181
+ },
219
182
  resourceActionDisable: !1,
220
183
  status: void 0
221
- }, S = ve()((e, s) => ({
222
- ...Ye,
223
- updaters: {
224
- setConfig: (t) => e({
225
- config: t
184
+ }, gt = Ge()((e, t) => ({
185
+ ...ft,
186
+ actions: {
187
+ setConfig: (s) => e({
188
+ config: s
226
189
  }),
227
- setSearchConfig: (t) => e((r) => ({
190
+ setSearchConfig: (s) => e((r) => ({
228
191
  searchConfig: {
229
192
  ...r.searchConfig,
230
- ...t
193
+ ...s
231
194
  }
232
195
  })),
233
- setTreeData: (t) => e(() => ({
234
- treeData: t
196
+ setTreeData: (s) => e(() => ({
197
+ treeData: s
235
198
  })),
236
- setSearchParams: (t) => {
199
+ setSearchParams: (s) => {
237
200
  e((r) => {
238
201
  const {
239
- searchParams: n
202
+ searchParams: o
240
203
  } = r;
241
- return n.search !== t.search ? t.search ? {
204
+ return o.search !== s.search ? s.search ? {
242
205
  ...r,
243
206
  selectedFolders: [],
244
- selectedNodesIds: [],
207
+ selectedNodeId: void 0,
245
208
  selectedResources: [],
246
209
  currentFolder: void 0,
247
210
  searchParams: {
248
- ...n,
249
- ...t,
211
+ ...o,
212
+ ...s,
250
213
  trashed: !1,
251
214
  filters: {
252
- ...n.filters,
215
+ ...o.filters,
253
216
  folder: void 0
254
217
  }
255
218
  }
256
219
  } : {
257
220
  ...r,
258
221
  selectedFolders: [],
259
- selectedNodesIds: ["default"],
222
+ selectedNodeId: "default",
260
223
  selectedResources: [],
261
224
  currentFolder: {
262
225
  id: "default"
263
226
  },
264
227
  searchParams: {
265
- ...n,
266
- ...t,
228
+ ...o,
229
+ ...s,
267
230
  trashed: !1,
268
231
  filters: {
269
- ...n.filters
232
+ ...o.filters
270
233
  }
271
234
  }
272
235
  } : {
273
236
  searchParams: {
274
- ...n,
275
- ...t
237
+ ...o,
238
+ ...s
276
239
  }
277
240
  };
278
241
  });
279
242
  },
280
- setSelectedFolders: (t) => e(() => ({
281
- selectedFolders: t
243
+ setSelectedFolders: (s) => e(() => ({
244
+ selectedFolders: s
245
+ })),
246
+ setSelectedResources: (s) => e(() => ({
247
+ selectedResources: s
282
248
  })),
283
- setSelectedResources: (t) => e(() => ({
284
- selectedResources: t
249
+ setFolderIds: (s) => e(() => ({
250
+ folderIds: s
285
251
  })),
286
- setFolderIds: (t) => e(() => ({
287
- folderIds: t
252
+ setResourceIds: (s) => e(() => ({
253
+ resourceIds: s
288
254
  })),
289
- setResourceIds: (t) => e(() => ({
290
- resourceIds: t
255
+ setResourceIsTrash: (s) => e(() => ({
256
+ resourceIsTrash: s
291
257
  })),
292
- setResourceIsTrash: (t) => e(() => ({
293
- resourceIsTrash: t
258
+ setResourceOrFolderIsDraggable: (s) => e(() => ({
259
+ resourceOrFolderIsDraggable: s
294
260
  })),
295
- setResourceActionDisable: (t) => e(() => ({
296
- resourceActionDisable: t
261
+ setElementDragOver: (s) => e(() => ({
262
+ elementDragOver: s
297
263
  })),
298
- setCurrentFolder: (t) => e(() => ({
299
- currentFolder: t
264
+ setResourceActionDisable: (s) => e(() => ({
265
+ resourceActionDisable: s
300
266
  })),
301
267
  clearSelectedItems: () => e(() => ({
302
268
  selectedFolders: [],
@@ -306,14 +272,14 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
306
272
  resourceIds: [],
307
273
  folderIds: []
308
274
  })),
309
- openResource: (t) => {
275
+ openResource: (s) => {
310
276
  try {
311
277
  const {
312
278
  searchParams: r
313
- } = s();
314
- We({
279
+ } = t();
280
+ ut({
315
281
  searchParams: r,
316
- assetId: t.assetId
282
+ assetId: s.assetId
317
283
  });
318
284
  } catch (r) {
319
285
  console.error("explorer open failed: ", r);
@@ -322,512 +288,467 @@ const pe = (e, s, t) => G(e, (r) => (r.id === t && (r.children = s == null ? voi
322
288
  printSelectedResource: () => {
323
289
  try {
324
290
  const {
325
- searchParams: t,
291
+ searchParams: s,
326
292
  selectedResources: r,
327
- resourceIds: n
328
- } = s();
293
+ resourceIds: o
294
+ } = t();
329
295
  if (r.length !== 1)
330
296
  throw new Error("Cannot open more than 1 resource");
331
- const a = r.find((o) => o.id === n[0]);
332
- Je({
333
- searchParams: t,
297
+ const a = r.find((n) => n.id === o[0]);
298
+ pt({
299
+ searchParams: s,
334
300
  assetId: a.assetId
335
301
  });
336
- } catch (t) {
337
- console.error("explorer print failed: ", t);
302
+ } catch (s) {
303
+ console.error("explorer print failed: ", s);
338
304
  }
339
305
  },
340
306
  openFolder: ({
341
- folderId: t,
342
- folder: r
307
+ folderId: s,
308
+ folder: r,
309
+ queryClient: o
343
310
  }) => {
344
311
  const {
345
- searchParams: n,
346
- treeData: a
347
- } = s(), o = n.filters.folder, i = Xe(t, a), f = se([...i, t]);
348
- o !== t && e((d) => ({
349
- ...d,
312
+ searchParams: a
313
+ } = t(), n = a.filters.folder, u = s;
314
+ n !== s && (t().actions.fetchTreeData(s, o), e((p) => ({
315
+ ...p,
350
316
  // reset selection when changing folder
351
317
  folderIds: [],
352
318
  resourceIds: [],
353
- selectedNodesIds: f,
319
+ selectedNodeId: u,
354
320
  currentFolder: r || {
355
- id: t
321
+ id: s
356
322
  },
357
323
  searchParams: {
358
- ...n,
324
+ ...a,
359
325
  search: void 0,
360
326
  filters: {
361
- ...n.filters,
362
- folder: t
327
+ ...a.filters,
328
+ folder: s
363
329
  },
364
- trashed: t === w.BIN
330
+ trashed: s === R.BIN
365
331
  }
366
- }));
332
+ })));
367
333
  },
368
- foldTreeItem: () => e((t) => ({
369
- ...t,
334
+ foldTreeItem: () => e((s) => ({
335
+ ...s,
370
336
  status: "fold"
371
337
  })),
372
- unfoldTreeItem: async (t, r) => {
373
- const {
374
- treeData: n,
375
- searchParams: a
376
- } = s();
377
- if (e((o) => ({
378
- ...o,
379
- status: "unfold"
380
- })), !fe(t, n)) {
381
- await r.prefetchInfiniteQuery({
382
- initialPageParam: 0,
383
- queryKey: ["prefetchContext", {
384
- folderId: t,
385
- trashed: !1
386
- }],
387
- queryFn: async () => await de({
388
- ...a,
389
- filters: {
390
- ...a.filters,
391
- folder: t
392
- }
393
- })
394
- });
395
- const o = r.getQueryData(["prefetchContext", {
396
- folderId: t,
338
+ fetchTreeData: async (s, r) => {
339
+ const o = J(t().treeData, s), a = o == null ? void 0 : o.id;
340
+ if (Array.isArray(o == null ? void 0 : o.children) && o.children.length)
341
+ return;
342
+ const n = await r.fetchQuery({
343
+ queryKey: ["prefetchContext", {
344
+ folderId: a,
397
345
  trashed: !1
398
- }]);
399
- e((i) => {
400
- var f;
401
- return {
402
- ...i,
403
- treeData: pe(n, (f = o == null ? void 0 : o.pages[0]) == null ? void 0 : f.folders, t || w.DEFAULT)
404
- };
405
- });
406
- }
346
+ }],
347
+ queryFn: async () => await pe({
348
+ ...t().searchParams,
349
+ filters: {
350
+ ...t().searchParams.filters,
351
+ folder: a
352
+ }
353
+ })
354
+ });
355
+ t().actions.setTreeData(Ee(t().treeData, n == null ? void 0 : n.folders, a || R.DEFAULT));
407
356
  },
408
- selectTreeItem: (t) => {
357
+ selectTreeItem: (s, r) => {
409
358
  const {
410
- treeData: r
411
- } = s(), {
412
- openFolder: n
413
- } = s().updaters, a = W(t, r);
414
- we()(), e((i) => ({
415
- ...i,
359
+ treeData: o
360
+ } = t(), {
361
+ openFolder: a,
362
+ fetchTreeData: n
363
+ } = t().actions, u = J(o, s);
364
+ n(s, r), e((p) => ({
365
+ ...p,
416
366
  searchParams: {
417
- ...i.searchParams,
367
+ ...p.searchParams,
418
368
  search: void 0
419
369
  },
420
370
  status: "select",
421
371
  selectedResources: []
422
- })), n({
423
- folder: a,
424
- folderId: t
372
+ })), a({
373
+ folder: u,
374
+ folderId: s
425
375
  });
426
376
  },
427
377
  gotoPreviousFolder: () => {
428
378
  const {
429
- selectedNodesIds: t,
430
- treeData: r
431
- } = s(), {
432
- openFolder: n
433
- } = s().updaters, a = t.length;
434
- if (a < 2)
379
+ selectedNodeId: s,
380
+ treeData: r,
381
+ searchParams: o
382
+ } = t(), {
383
+ openFolder: a
384
+ } = t().actions;
385
+ if (o.search && a({
386
+ folder: ge,
387
+ folderId: R.DEFAULT
388
+ }), !s)
435
389
  return;
436
- const o = W(t[a - 2], r);
437
- n({
438
- folder: o,
439
- folderId: (o == null ? void 0 : o.id) || w.DEFAULT
390
+ const n = Pe(r, s);
391
+ a({
392
+ folder: n,
393
+ folderId: (n == null ? void 0 : n.id) || R.DEFAULT
440
394
  });
441
395
  },
442
- goToTrash: () => e((t) => ({
443
- ...t,
444
- selectedNodesIds: [],
445
- selectedResources: [],
446
- resourceIds: [],
447
- folderIds: [],
448
- status: "select",
449
- searchParams: {
450
- ...t.searchParams,
451
- search: void 0,
452
- filters: {
453
- folder: w.BIN
396
+ goToTrash: () => {
397
+ e((s) => ({
398
+ ...s,
399
+ selectedNodeId: void 0,
400
+ selectedResources: [],
401
+ resourceIds: [],
402
+ folderIds: [],
403
+ status: "select",
404
+ searchParams: {
405
+ ...s.searchParams,
406
+ search: void 0,
407
+ filters: {
408
+ folder: R.BIN
409
+ },
410
+ trashed: !0
454
411
  },
455
- trashed: !0
456
- },
457
- currentFolder: {
458
- id: w.BIN
459
- }
460
- }))
412
+ currentFolder: {
413
+ id: R.BIN
414
+ }
415
+ }));
416
+ }
461
417
  }
462
- })), b = () => S((e) => e.searchParams), re = () => S((e) => e.selectedNodesIds), V = () => S((e) => e.treeData), Vt = () => S((e) => e.selectedFolders), Ht = () => S((e) => e.selectedResources), Ze = () => S((e) => e.searchConfig), X = () => S((e) => e.folderIds), Y = () => S((e) => e.resourceIds), Z = () => S((e) => e.selectedResources.map((s) => s.assetId)), ee = () => S((e) => e.selectedResources.filter((s) => s.assetId === s.id)), H = () => S((e) => e.currentFolder), T = () => S((e) => e.updaters), ne = () => {
463
- const e = H();
464
- return (e == null ? void 0 : e.id) === w.BIN;
465
- }, et = () => S((e) => e.resourceIsTrash), tt = () => S((e) => e.resourceActionDisable), st = () => {
466
- const e = H();
467
- return (e == null ? void 0 : e.id) === "default";
468
- }, rt = () => re().length > 1, nt = () => S((e) => e.status), me = () => {
469
- const e = b(), [s, t] = ie(""), r = Ze(), n = nt(), a = Ie(null), {
470
- setSearchParams: o
471
- } = T(), i = (u) => {
472
- const h = u.target.value;
473
- t(h.toString());
474
- }, f = (u) => {
475
- (u.key === "Enter" || u.key === "Return") && (u.preventDefault(), o({
476
- search: s || void 0
477
- }));
478
- }, d = (u) => {
479
- u.preventDefault(), o({
480
- search: s || void 0
481
- });
482
- };
483
- return M(() => {
484
- const h = s.length == 0 || s.length >= r.minLength ? {
485
- search: s || void 0
486
- } : {};
487
- o({
488
- ...e,
489
- ...h
490
- });
491
- }, [s, r.minLength]), M(() => {
492
- n === "select" && t("");
493
- }, [n]), M(() => {
494
- t(() => {
495
- var u;
496
- return ((u = e.search) == null ? void 0 : u.toString()) ?? "";
497
- });
498
- }, [e]), {
499
- formRef: a,
500
- inputSearch: s,
501
- handleInputSearchChange: i,
502
- handleKeyPress: f,
503
- handleSearchSubmit: d
504
- };
505
- };
506
- function ot() {
507
- const {
508
- appCode: e
509
- } = K(), {
510
- gotoPreviousFolder: s
511
- } = T(), {
512
- t
513
- } = j(["common", e]), {
514
- inputSearch: r
515
- } = me(), n = re(), a = ne(), o = H(), i = t("explorer.tree.trash"), f = t("explorer.tree.search"), d = t("explorer.filters.mine", {
516
- ns: e
517
- }), u = (o == null ? void 0 : o.name) || d;
518
- return /* @__PURE__ */ c("div", { className: "py-16", children: n.length > 1 && !a ? /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8", children: [
519
- /* @__PURE__ */ c(xe, { icon: /* @__PURE__ */ c(qe, {}), variant: "ghost", color: "tertiary", "aria-label": t("back"), className: "ms-n16", onClick: s }),
520
- /* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: u }) })
521
- ] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? f : a ? i : d }) });
418
+ }));
419
+ function T(e) {
420
+ return Je(gt, e);
522
421
  }
523
- const at = () => {
524
- const e = tt(), {
525
- clearSelectedIds: s,
526
- setResourceActionDisable: t,
422
+ const mt = (e) => e.treeData, yt = (e) => e.actions, V = () => T(mt), F = () => T(yt), A = () => T((e) => e.searchParams), oe = () => T((e) => e.selectedNodeId), ps = () => T((e) => e.selectedFolders), fs = () => T((e) => e.selectedResources), It = () => T((e) => e.searchConfig), X = () => T((e) => e.folderIds), Y = () => T((e) => e.resourceIds), Z = () => T((e) => e.selectedResources.map((t) => t.assetId)), ee = () => T((e) => e.selectedResources.filter((t) => t.assetId === t.id)), W = () => T((e) => e.currentFolder), ne = () => {
423
+ const e = W();
424
+ return (e == null ? void 0 : e.id) === R.BIN;
425
+ }, Dt = () => T((e) => e.resourceIsTrash), gs = () => T((e) => e.resourceOrFolderIsDraggable), St = () => T((e) => e.elementDragOver), bt = () => T((e) => e.resourceActionDisable), wt = () => {
426
+ const e = W();
427
+ return (e == null ? void 0 : e.id) === "default";
428
+ }, xt = () => T((e) => e.status), Tt = () => {
429
+ const e = bt(), {
430
+ clearSelectedIds: t,
431
+ setResourceActionDisable: s,
527
432
  clearSelectedItems: r
528
- } = T();
433
+ } = F();
529
434
  return {
530
435
  isActionDisableModalOpen: e,
531
436
  onActionDisableCancel: () => {
532
- s(), r(), t(!1);
437
+ t(), r(), s(!1);
533
438
  }
534
439
  };
535
- }, ct = () => {
536
- const e = et(), {
537
- clearSelectedIds: s,
538
- setResourceIsTrash: t,
440
+ }, Ct = () => {
441
+ const e = Dt(), {
442
+ clearSelectedIds: t,
443
+ setResourceIsTrash: s,
539
444
  clearSelectedItems: r
540
- } = T();
445
+ } = F();
541
446
  return {
542
447
  isTrashedModalOpen: e,
543
448
  onTrashedCancel: () => {
544
- s(), r(), t(!1);
449
+ t(), r(), s(!1);
545
450
  }
546
451
  };
547
- };
548
- function it(e, {
549
- parentId: s,
550
- newFolder: t
551
- }) {
552
- return G(e, (r) => {
553
- var n;
554
- if (r.id === s) {
555
- const a = [...((n = r.folder) == null ? void 0 : n.ancestors) || []], o = se([...a, r.id]);
556
- return {
557
- ...r,
558
- children: [...r.children || [], new J({
559
- ...t,
560
- ancestors: o
561
- })]
562
- };
563
- } else
564
- return r;
565
- });
566
- }
567
- function lt(e, {
568
- folders: s
569
- }) {
570
- return G(e, (t) => {
571
- if (!s.includes(t.id))
572
- return t;
573
- });
452
+ }, Ft = 175, Rt = 10, me = "blog", ye = "blog";
453
+ class Ie extends he {
454
+ getEditUrl() {
455
+ throw new Error("Method not implemented.");
456
+ }
457
+ async create(t) {
458
+ const s = t.thumbnail ? await this.getThumbnailPath(t.thumbnail) : "", r = t.public ? "/blog/pub" : "/blog", o = await this.http.post(r, {
459
+ title: t.name,
460
+ description: t.description,
461
+ visibility: t.public ? "PUBLIC" : "OWNER",
462
+ thumbnail: s,
463
+ trashed: !1,
464
+ folder: t.folder,
465
+ slug: t.public ? t.slug : "",
466
+ "publish-type": t.publishType || "RESTRAINT",
467
+ "comment-type": "IMMEDIATE"
468
+ });
469
+ return this.checkHttpResponse(o), o;
470
+ }
471
+ async update(t) {
472
+ const s = t.thumbnail ? await this.getThumbnailPath(t.thumbnail) : "", r = await this.http.put(`/blog/${t.entId}`, {
473
+ trashed: t.trashed,
474
+ _id: t.entId,
475
+ title: t.name,
476
+ thumbnail: s,
477
+ description: t.description,
478
+ visibility: t.public ? "PUBLIC" : "OWNER",
479
+ slug: t.public ? t.slug : "",
480
+ "publish-type": t["publish-type"] || "RESTRAINT",
481
+ "comment-type": "IMMEDIATE"
482
+ });
483
+ return this.checkHttpResponse(r), {
484
+ thumbnail: s,
485
+ entId: t.entId
486
+ };
487
+ }
488
+ getResourceType() {
489
+ return ye;
490
+ }
491
+ getApplication() {
492
+ return me;
493
+ }
494
+ getFormUrl(t) {
495
+ return t ? `/blog?folderid=${t}#/edit/new` : "/blog#/edit/new";
496
+ }
497
+ getViewUrl(t) {
498
+ return `/blog/id/${t}`;
499
+ }
500
+ getPrintUrl(t) {
501
+ return `/blog/print/${t}`;
502
+ }
574
503
  }
575
- function dt(e, {
576
- destinationId: s,
577
- folders: t
578
- }) {
579
- return G(e, (r, n) => {
580
- var a, o;
581
- if (s === r.id) {
582
- const i = [...((a = r.folder) == null ? void 0 : a.ancestors) || []], f = se([...i, r.id]), d = [...r.children || []], u = ((o = r.children) == null ? void 0 : o.map((l) => l.id)) || [];
583
- for (const l of t)
584
- if (!u.includes(l)) {
585
- const p = W(l, e);
586
- p && d.push({
587
- ...p,
588
- folder: {
589
- ...p == null ? void 0 : p.folder,
590
- ancestors: f
591
- }
592
- });
593
- }
594
- return {
595
- ...r,
596
- children: d
504
+ he.register({
505
+ application: me,
506
+ resourceType: ye
507
+ }, (e) => new Ie(e));
508
+ const K = document.querySelector("[data-explorer-config]");
509
+ let ie;
510
+ function ms() {
511
+ var e;
512
+ if ((e = K == null ? void 0 : K.dataset) != null && e.explorerConfig) {
513
+ const {
514
+ explorerConfig: t
515
+ } = K.dataset;
516
+ try {
517
+ const s = JSON.parse(t);
518
+ ie = {
519
+ ...s,
520
+ service: Ie,
521
+ enableOnboarding: s.enableOnboarding !== void 0 ? s.enableOnboarding : !0
597
522
  };
598
- } else
599
- return t.includes(r.id) && s !== (n == null ? void 0 : n.id) ? void 0 : r;
600
- });
601
- }
602
- function ut(e, {
603
- folderId: s,
604
- newFolder: t
605
- }) {
606
- return G(e, (r) => r.id === s ? new J(t) : r);
523
+ } catch (s) {
524
+ console.error("[Explorer Config] could not parse app params from root data attributes:", K == null ? void 0 : K.dataset, s);
525
+ }
526
+ }
527
+ return ie;
607
528
  }
608
- const ft = () => {
609
- const e = S((s) => s.config);
610
- return Me({
611
- queryKey: ["actions"],
612
- queryFn: async () => {
613
- const s = e == null ? void 0 : e.actions.map((r) => r.workflow);
614
- return await He(s);
615
- },
616
- select: (s) => e == null ? void 0 : e.actions.map((t) => ({
617
- ...t,
618
- available: s[t.workflow]
529
+ const Nt = (e, t) => {
530
+ const s = e.map((o) => o.workflow), r = new Set(s);
531
+ return Ye({
532
+ queryKey: [...r],
533
+ queryFn: () => dt([...r]),
534
+ select: (o) => e.filter((a) => o[a.workflow]).map((a) => ({
535
+ ...a,
536
+ available: !0
619
537
  })),
620
538
  staleTime: 1 / 0,
621
- enabled: !!e
539
+ enabled: !!t
622
540
  });
623
- }, ht = () => {
624
- const e = S((o) => o.config), s = b(), {
625
- filters: t,
541
+ }, Et = (e) => {
542
+ const t = T((s) => s.config);
543
+ return Xe(Nt(e, t));
544
+ }, Pt = () => {
545
+ const e = T((n) => n.config), t = A(), {
546
+ filters: s,
626
547
  trashed: r,
627
- search: n
628
- } = s, a = ["context", {
629
- folderId: t.folder,
630
- filters: t,
548
+ search: o
549
+ } = t, a = ["context", {
550
+ folderId: s.folder,
551
+ filters: s,
631
552
  trashed: r,
632
- search: n
553
+ search: o
633
554
  }];
634
- return Ke({
555
+ return Ze({
635
556
  queryKey: a,
636
557
  queryFn: async ({
637
- pageParam: o
638
- }) => await de({
639
- ...s,
558
+ pageParam: n
559
+ }) => await pe({
560
+ ...t,
640
561
  application: e == null ? void 0 : e.app,
641
562
  types: e == null ? void 0 : e.types,
642
563
  pagination: {
643
- ...s.pagination,
644
- startIdx: o
564
+ ...t.pagination,
565
+ startIdx: n
645
566
  }
646
567
  }),
647
568
  staleTime: 5e3,
648
569
  initialPageParam: 0,
649
570
  enabled: !!e,
650
571
  retry: !1,
651
- getNextPageParam: (o) => o.pagination.startIdx + o.pagination.pageSize
572
+ getNextPageParam: (n) => n.pagination.startIdx + n.pagination.pageSize
652
573
  });
653
- }, Wt = () => {
654
- const e = k(), s = E(), t = b(), r = V(), n = X(), a = Z(), o = Y(), i = ee().length > 0, f = i ? a : o, {
655
- clearSelectedItems: d,
656
- clearSelectedIds: u,
574
+ }, ys = () => {
575
+ const e = L(), t = k(), s = A(), r = V(), o = X(), a = Z(), n = Y(), u = ee().length > 0, p = u ? a : n, {
576
+ clearSelectedItems: l,
577
+ clearSelectedIds: d,
657
578
  setTreeData: h,
658
- setSearchParams: l
659
- } = T(), {
660
- filters: p,
579
+ setSearchParams: i
580
+ } = F(), {
581
+ filters: f,
661
582
  trashed: m
662
- } = t, y = ["context", {
663
- folderId: p.folder,
664
- filters: p,
583
+ } = s, S = ["context", {
584
+ folderId: f.folder,
585
+ filters: f,
665
586
  trashed: m
666
587
  }];
667
- return L({
668
- mutationFn: async () => await $e({
669
- searchParams: t,
670
- folderIds: n,
671
- resourceIds: f,
672
- useAssetIds: i
588
+ return B({
589
+ mutationFn: async () => await at({
590
+ searchParams: s,
591
+ folderIds: o,
592
+ resourceIds: p,
593
+ useAssetIds: u
673
594
  }),
674
- onError(g) {
675
- typeof g == "string" && e.error(x(g));
595
+ onError(y) {
596
+ typeof y == "string" && e.error(E(y));
676
597
  },
677
- onSuccess: async (g) => {
678
- if (await s.cancelQueries({
679
- queryKey: y
680
- }), s.getQueryData(y))
681
- return e.success(x("explorer.trash.title")), s.setQueryData(y, (C) => {
682
- var Q;
598
+ onSuccess: async (y) => {
599
+ if (await t.cancelQueries({
600
+ queryKey: S
601
+ }), t.getQueryData(S))
602
+ return e.success(E("explorer.trash.title")), t.setQueryData(S, (C) => {
603
+ var q;
683
604
  if (C) {
684
- const U = {
605
+ const O = {
685
606
  ...C,
686
- pages: C == null ? void 0 : C.pages.map((R) => {
687
- var P;
607
+ pages: C == null ? void 0 : C.pages.map((b) => {
608
+ var I;
688
609
  return {
689
- ...R,
690
- folders: R.folders.filter((q) => !n.includes(q.id)),
610
+ ...b,
611
+ folders: b.folders.filter((g) => !o.includes(g.id)),
691
612
  pagination: {
692
- ...R.pagination,
613
+ ...b.pagination,
693
614
  // @ts-ignore
694
- maxIdx: ((P = R == null ? void 0 : R.pagination) == null ? void 0 : P.maxIdx) - g.resources.length
615
+ maxIdx: ((I = b == null ? void 0 : b.pagination) == null ? void 0 : I.maxIdx) - y.resources.length
695
616
  },
696
- resources: R.resources.filter((q) => i ? !a.includes(q.assetId) : !f.includes(q.id))
617
+ resources: b.resources.filter((g) => u ? !a.includes(g.assetId) : !p.includes(g.id))
697
618
  };
698
619
  })
699
- }, B = lt(r, {
700
- folders: n
620
+ }, x = Qe(r, {
621
+ folders: o
701
622
  });
702
- return h(B), l({
703
- ...t,
623
+ return h(x), i({
624
+ ...s,
704
625
  pagination: {
705
- ...t.pagination,
626
+ ...s.pagination,
706
627
  // @ts-ignore
707
- maxIdx: ((Q = t.pagination) == null ? void 0 : Q.maxIdx) - g.resources.length
628
+ maxIdx: ((q = s.pagination) == null ? void 0 : q.maxIdx) - y.resources.length
708
629
  }
709
- }), U;
630
+ }), O;
710
631
  }
711
632
  });
712
633
  },
713
634
  onSettled: () => {
714
- d(), u();
635
+ l(), d();
715
636
  }
716
637
  });
717
- }, Gt = () => {
718
- const e = k(), s = E(), t = b(), r = X(), n = Z(), a = Y(), o = ee().length > 0, i = o ? n : a, {
719
- setFolderIds: f,
720
- setResourceIds: d,
721
- setSelectedResources: u,
638
+ }, Is = () => {
639
+ const e = L(), t = k(), s = A(), r = X(), o = Z(), a = Y(), n = ee().length > 0, u = n ? o : a, {
640
+ setFolderIds: p,
641
+ setResourceIds: l,
642
+ setSelectedResources: d,
722
643
  setSelectedFolders: h
723
- } = T(), {
724
- filters: l,
725
- trashed: p
726
- } = t, m = ["context", {
727
- folderId: l.folder,
728
- filters: l,
729
- trashed: p
644
+ } = F(), {
645
+ filters: i,
646
+ trashed: f
647
+ } = s, m = ["context", {
648
+ folderId: i.folder,
649
+ filters: i,
650
+ trashed: f
730
651
  }];
731
- return L({
732
- mutationFn: async () => await je({
733
- searchParams: t,
652
+ return B({
653
+ mutationFn: async () => await it({
654
+ searchParams: s,
734
655
  folderIds: r,
735
- resourceIds: i,
736
- useAssetIds: o
656
+ resourceIds: u,
657
+ useAssetIds: n
737
658
  }),
738
- onError(y) {
739
- typeof y == "string" && e.error(x(y));
659
+ onError(S) {
660
+ typeof S == "string" && e.error(E(S));
740
661
  },
741
662
  onSuccess: async () => {
742
- if (await s.cancelQueries({
663
+ if (await t.cancelQueries({
743
664
  queryKey: m
744
- }), s.getQueryData(m))
745
- return e.success(x("explorer.trash.toast")), s.setQueryData(m, (g) => {
746
- if (g)
665
+ }), t.getQueryData(m))
666
+ return e.success(E("explorer.trash.toast")), t.setQueryData(m, (y) => {
667
+ if (y)
747
668
  return {
748
- ...g,
749
- pages: g == null ? void 0 : g.pages.map((I) => ({
750
- ...I,
751
- folders: I.folders.filter((C) => !r.includes(C.id)),
752
- resources: I.resources.filter((C) => o ? !n.includes(C.assetId) : !i.includes(C.id))
669
+ ...y,
670
+ pages: y == null ? void 0 : y.pages.map((w) => ({
671
+ ...w,
672
+ folders: w.folders.filter((C) => !r.includes(C.id)),
673
+ resources: w.resources.filter((C) => n ? !o.includes(C.assetId) : !u.includes(C.id))
753
674
  }))
754
675
  };
755
676
  });
756
677
  },
757
678
  onSettled: () => {
758
- d([]), u([]), f([]), h([]);
679
+ l([]), d([]), p([]), h([]);
759
680
  }
760
681
  });
761
- }, Jt = () => {
762
- const e = k(), s = E(), t = b(), r = X(), n = Z(), a = Y(), o = ee().length > 0, i = o ? n : a, {
763
- clearSelectedItems: f,
764
- clearSelectedIds: d
765
- } = T(), {
766
- filters: u,
682
+ }, Ds = () => {
683
+ const e = L(), t = k(), s = A(), r = X(), o = Z(), a = Y(), n = ee().length > 0, u = n ? o : a, {
684
+ clearSelectedItems: p,
685
+ clearSelectedIds: l
686
+ } = F(), {
687
+ filters: d,
767
688
  trashed: h
768
- } = t, l = ["context", {
769
- folderId: u.folder,
770
- filters: u,
689
+ } = s, i = ["context", {
690
+ folderId: d.folder,
691
+ filters: d,
771
692
  trashed: h
772
693
  }];
773
- return L({
774
- mutationFn: async () => await ze({
775
- searchParams: t,
694
+ return B({
695
+ mutationFn: async () => await ct({
696
+ searchParams: s,
776
697
  folderIds: r,
777
- resourceIds: i,
778
- useAssetIds: o
698
+ resourceIds: u,
699
+ useAssetIds: n
779
700
  }),
780
- onError(p) {
781
- typeof p == "string" && e.error(x(p));
701
+ onError(f) {
702
+ typeof f == "string" && e.error(E(f));
782
703
  },
783
704
  onSuccess: async () => {
784
- if (await s.cancelQueries({
785
- queryKey: l
786
- }), s.getQueryData(l))
787
- return e.success(x("explorer.removed.from.trash")), s.setQueryData(l, (m) => {
705
+ if (await t.cancelQueries({
706
+ queryKey: i
707
+ }), t.getQueryData(i))
708
+ return e.success(E("explorer.removed.from.trash")), t.setQueryData(i, (m) => {
788
709
  if (m)
789
710
  return {
790
711
  ...m,
791
- pages: m == null ? void 0 : m.pages.map((g) => ({
792
- ...g,
793
- folders: g.folders.filter((I) => !r.includes(I.id)),
794
- resources: g.resources.filter((I) => o ? !n.includes(I.assetId) : !i.includes(I.id))
712
+ pages: m == null ? void 0 : m.pages.map((y) => ({
713
+ ...y,
714
+ folders: y.folders.filter((w) => !r.includes(w.id)),
715
+ resources: y.resources.filter((w) => n ? !o.includes(w.assetId) : !u.includes(w.id))
795
716
  }))
796
717
  };
797
718
  });
798
719
  },
799
720
  onSettled: () => {
800
- f(), d();
721
+ p(), l();
801
722
  }
802
723
  });
803
- }, Xt = () => {
804
- const e = k(), s = b(), t = E(), {
724
+ }, Ss = () => {
725
+ const e = L(), t = A(), s = k(), {
805
726
  user: r
806
- } = le(), n = H(), {
727
+ } = ue(), o = W(), {
807
728
  filters: a,
808
- trashed: o
809
- } = s, i = "duplicate_start", f = ["context", {
729
+ trashed: n
730
+ } = t, u = "duplicate_start", p = ["context", {
810
731
  folderId: a.folder,
811
732
  filters: a,
812
- trashed: o
733
+ trashed: n
813
734
  }];
814
- return L({
815
- mutationFn: async (d) => (e.info(x("duplicate.start"), {
816
- id: i
817
- }), await Ve(s, d.assetId)),
818
- onSuccess: async (d, u) => {
819
- e.remove(i), e.success(x("duplicate.done")), await t.cancelQueries({
820
- queryKey: f
735
+ return B({
736
+ mutationFn: async (l) => (e.info(E("duplicate.start"), {
737
+ id: u
738
+ }), await lt(t, l.assetId)),
739
+ onSuccess: async (l, d) => {
740
+ e.remove(u), e.success(E("duplicate.done")), await s.cancelQueries({
741
+ queryKey: p
821
742
  });
822
- const h = t.getQueryData(f), l = {
823
- ...u,
824
- name: `${u.name}${x("duplicate.suffix")}`,
825
- assetId: d.duplicateId,
826
- id: d.duplicateId,
743
+ const h = s.getQueryData(p), i = {
744
+ ...d,
745
+ name: `${d.name}${E("duplicate.suffix")}`,
746
+ assetId: l.duplicateId,
747
+ id: l.duplicateId,
827
748
  creatorId: r == null ? void 0 : r.userId,
828
749
  creatorName: r == null ? void 0 : r.username,
829
750
  createdAt: Date.now(),
830
- slug: u.slug || "",
751
+ slug: d.slug || "",
831
752
  modifiedAt: Date.now(),
832
753
  modifierId: (r == null ? void 0 : r.userId) || "",
833
754
  modifierName: (r == null ? void 0 : r.username) || "",
@@ -835,282 +756,283 @@ const ft = () => {
835
756
  trashed: !1,
836
757
  rights: [`creator:${r == null ? void 0 : r.userId}`]
837
758
  };
838
- h && t.setQueryData(f, (p) => {
839
- if (p)
759
+ h && s.setQueryData(p, (f) => {
760
+ if (f)
840
761
  return {
841
- ...p,
842
- pages: p == null ? void 0 : p.pages.map((m) => ({
762
+ ...f,
763
+ pages: f == null ? void 0 : f.pages.map((m) => ({
843
764
  ...m,
844
- resources: [l, ...m.resources]
765
+ resources: [i, ...m.resources]
845
766
  }))
846
767
  };
847
- }), n.id && n.id !== w.DEFAULT && ue({
848
- searchParams: s,
849
- resourceIds: [d.duplicateId],
850
- folderId: n.id,
768
+ }), o.id && o.id !== R.DEFAULT && fe({
769
+ searchParams: t,
770
+ resourceIds: [l.duplicateId],
771
+ folderId: o.id,
851
772
  folderIds: [],
852
773
  useAssetIds: !0
853
774
  });
854
775
  },
855
- onError: (d) => {
856
- e.remove(i), typeof d == "string" && e.error(`${x("duplicate.error")}: ${d}`);
776
+ onError: (l) => {
777
+ e.remove(u), typeof l == "string" && e.error(`${E("duplicate.error")}: ${l}`);
857
778
  }
858
779
  });
859
- }, Yt = () => {
860
- const e = k(), s = E(), t = b(), r = V(), n = X(), a = Z(), o = Y(), i = ee().length > 0, f = i ? a : o, {
861
- clearSelectedIds: d,
862
- clearSelectedItems: u,
780
+ }, At = () => {
781
+ const e = L(), t = k(), s = A(), r = V(), o = X(), a = Z(), n = Y(), u = ee().length > 0, p = u ? a : n, {
782
+ clearSelectedIds: l,
783
+ clearSelectedItems: d,
863
784
  setTreeData: h,
864
- setSearchParams: l
865
- } = T(), {
866
- filters: p,
785
+ setSearchParams: i
786
+ } = F(), {
787
+ filters: f,
867
788
  trashed: m
868
- } = t, y = ["context", {
869
- folderId: p.folder,
870
- filters: p,
789
+ } = s, S = ["context", {
790
+ folderId: f.folder,
791
+ filters: f,
871
792
  trashed: m
872
793
  }];
873
- return L({
874
- mutationFn: async (g) => await ue({
875
- searchParams: t,
876
- folderId: g,
877
- folderIds: n,
878
- resourceIds: f,
879
- useAssetIds: i
794
+ return B({
795
+ mutationFn: async (y) => await fe({
796
+ searchParams: s,
797
+ folderId: y,
798
+ folderIds: o,
799
+ resourceIds: p,
800
+ useAssetIds: u
880
801
  }),
881
- onError(g) {
882
- typeof g == "string" && e.error(x(g));
802
+ onError(y) {
803
+ typeof y == "string" && e.error(E(y));
883
804
  },
884
- onSuccess: async (g, I) => {
885
- if (s.getQueryData(y))
886
- return s.setQueryData(y, (Q) => {
887
- var U;
888
- if (Q) {
889
- const B = dt(r, {
890
- destinationId: I,
891
- folders: n
892
- }), R = {
893
- ...Q,
894
- pages: Q == null ? void 0 : Q.pages.map((P) => {
895
- var q;
805
+ onSuccess: async (y, w) => {
806
+ if (t.getQueryData(S))
807
+ return t.setQueryData(S, (q) => {
808
+ var O;
809
+ if (q) {
810
+ const x = Ae(r, {
811
+ destinationId: w,
812
+ folders: o
813
+ }), b = {
814
+ ...q,
815
+ pages: q == null ? void 0 : q.pages.map((I) => {
816
+ var g;
896
817
  return {
897
- ...P,
898
- folders: P.folders.filter((_) => !n.includes(_.id)),
818
+ ...I,
819
+ folders: I.folders.filter((D) => !o.includes(D.id)),
899
820
  pagination: {
900
- ...P.pagination,
821
+ ...I.pagination,
901
822
  // @ts-ignore
902
- maxIdx: ((q = P.pagination) == null ? void 0 : q.maxIdx) - g.resources.length
823
+ maxIdx: ((g = I.pagination) == null ? void 0 : g.maxIdx) - y.resources.length
903
824
  },
904
- resources: P.resources.filter((_) => i ? !a.includes(_.assetId) : !f.includes(_.id))
825
+ resources: I.resources.filter((D) => u ? !a.includes(D.assetId) : !p.includes(D.id))
905
826
  };
906
827
  })
907
828
  };
908
- return h(B), l({
909
- ...t,
829
+ return h(x), i({
830
+ ...s,
910
831
  pagination: {
911
- ...t.pagination,
832
+ ...s.pagination,
912
833
  // @ts-ignore
913
- maxIdx: ((U = t.pagination) == null ? void 0 : U.maxIdx) - g.resources.length
834
+ maxIdx: ((O = s.pagination) == null ? void 0 : O.maxIdx) - y.resources.length
914
835
  }
915
- }), R;
836
+ }), b;
916
837
  }
917
838
  });
839
+ t.invalidateQueries();
918
840
  },
919
841
  onSettled: () => {
920
- u(), d();
842
+ d(), l();
921
843
  }
922
844
  });
923
- }, Zt = () => {
924
- const e = k(), s = E(), t = b(), r = V(), {
925
- setTreeData: n
926
- } = T(), {
845
+ }, bs = () => {
846
+ const e = L(), t = k(), s = A(), r = V(), {
847
+ setTreeData: o
848
+ } = F(), {
927
849
  filters: a,
928
- trashed: o
929
- } = t, i = ["context", {
850
+ trashed: n
851
+ } = s, u = ["context", {
930
852
  folderId: a.folder,
931
853
  filters: a,
932
- trashed: o
854
+ trashed: n
933
855
  }];
934
- return L({
856
+ return B({
935
857
  mutationFn: async ({
936
- name: f,
937
- parentId: d
938
- }) => await Be({
939
- searchParams: t,
940
- name: f,
941
- parentId: d
858
+ name: p,
859
+ parentId: l
860
+ }) => await ot({
861
+ searchParams: s,
862
+ name: p,
863
+ parentId: l
942
864
  }),
943
- onError(f) {
944
- typeof f == "string" && e.error(x(f));
865
+ onError(p) {
866
+ typeof p == "string" && e.error(E(p));
945
867
  },
946
- onSuccess: async (f, d) => {
947
- await s.cancelQueries({
948
- queryKey: i
868
+ onSuccess: async (p, l) => {
869
+ await t.cancelQueries({
870
+ queryKey: u
949
871
  });
950
- const u = s.getQueryData(i), h = {
951
- ...f,
952
- parentId: d.parentId,
872
+ const d = t.getQueryData(u), h = {
873
+ ...p,
874
+ parentId: l.parentId,
953
875
  children: [],
954
- rights: [`creator:${f == null ? void 0 : f.creator_id}`]
876
+ rights: [`creator:${p == null ? void 0 : p.creator_id}`]
955
877
  };
956
- if (u)
957
- return s.setQueryData(i, (l) => {
958
- if (l) {
959
- const p = {
960
- ...l,
961
- pages: l == null ? void 0 : l.pages.map((y) => ({
962
- ...y,
963
- folders: [...y.folders, h]
878
+ if (d)
879
+ return t.setQueryData(u, (i) => {
880
+ if (i) {
881
+ const f = {
882
+ ...i,
883
+ pages: i == null ? void 0 : i.pages.map((S) => ({
884
+ ...S,
885
+ folders: [...S.folders, h]
964
886
  }))
965
- }, m = it(r, {
966
- parentId: d.parentId,
887
+ }, m = ke(r, {
888
+ parentId: l.parentId,
967
889
  newFolder: h
968
890
  });
969
- return n(m), p;
891
+ return o(m), f;
970
892
  }
971
893
  });
972
894
  }
973
895
  });
974
- }, es = () => {
975
- const e = k(), s = E(), t = b(), r = V(), {
976
- setFolderIds: n,
896
+ }, ws = () => {
897
+ const e = L(), t = k(), s = A(), r = V(), {
898
+ setFolderIds: o,
977
899
  setSelectedFolders: a,
978
- setTreeData: o
979
- } = T(), {
980
- filters: i,
981
- trashed: f
982
- } = t, d = ["context", {
983
- folderId: i.folder,
984
- filters: i,
985
- trashed: f
900
+ setTreeData: n
901
+ } = F(), {
902
+ filters: u,
903
+ trashed: p
904
+ } = s, l = ["context", {
905
+ folderId: u.folder,
906
+ filters: u,
907
+ trashed: p
986
908
  }];
987
- return L({
909
+ return B({
988
910
  mutationFn: async ({
989
- folderId: u,
911
+ folderId: d,
990
912
  name: h,
991
- parentId: l
992
- }) => await _e({
993
- searchParams: t,
994
- folderId: u,
995
- parentId: l,
913
+ parentId: i
914
+ }) => await nt({
915
+ searchParams: s,
916
+ folderId: d,
917
+ parentId: i,
996
918
  name: h
997
919
  }),
998
- onError(u) {
999
- typeof u == "string" && e.error(x(u));
920
+ onError(d) {
921
+ typeof d == "string" && e.error(E(d));
1000
922
  },
1001
- onSuccess: async (u, h) => {
1002
- if (await s.cancelQueries({
1003
- queryKey: d
1004
- }), s.getQueryData(d))
1005
- return s.setQueryData(d, (p) => {
1006
- if (p) {
923
+ onSuccess: async (d, h) => {
924
+ if (await t.cancelQueries({
925
+ queryKey: l
926
+ }), t.getQueryData(l))
927
+ return t.setQueryData(l, (f) => {
928
+ if (f) {
1007
929
  const m = {
1008
- ...p,
1009
- pages: p == null ? void 0 : p.pages.map((g) => ({
1010
- ...g,
1011
- folders: g.folders.map((I) => I.id === u.id ? {
1012
- ...u,
930
+ ...f,
931
+ pages: f == null ? void 0 : f.pages.map((y) => ({
932
+ ...y,
933
+ folders: y.folders.map((w) => w.id === d.id ? {
934
+ ...d,
1013
935
  parentId: h.parentId,
1014
- rights: I.rights
1015
- } : I)
936
+ rights: w.rights
937
+ } : w)
1016
938
  }))
1017
- }, y = ut(r, {
939
+ }, S = Me(r, {
1018
940
  folderId: h.folderId,
1019
- newFolder: u
941
+ newFolder: d
1020
942
  });
1021
- return o(y), m;
943
+ return n(S), m;
1022
944
  }
1023
945
  });
1024
946
  },
1025
947
  onSettled: () => {
1026
- n([]), a([]);
948
+ o([]), a([]);
1027
949
  }
1028
950
  });
1029
- }, ts = (e) => {
1030
- const s = E(), t = b(), {
951
+ }, xs = (e) => {
952
+ const t = k(), s = A(), {
1031
953
  setResourceIds: r,
1032
- setSelectedResources: n
1033
- } = T(), {
954
+ setSelectedResources: o
955
+ } = F(), {
1034
956
  filters: a,
1035
- trashed: o
1036
- } = t, i = ["context", {
957
+ trashed: n
958
+ } = s, u = ["context", {
1037
959
  folderId: a.folder,
1038
960
  filters: a,
1039
- trashed: o
961
+ trashed: n
1040
962
  }];
1041
- return De({
963
+ return qe({
1042
964
  application: e,
1043
965
  options: {
1044
- onSuccess: async (f, d) => {
1045
- if (await s.cancelQueries({
1046
- queryKey: i
1047
- }), s.getQueryData(i))
1048
- return s.setQueryData(i, (h) => {
966
+ onSuccess: async (p, l) => {
967
+ if (await t.cancelQueries({
968
+ queryKey: u
969
+ }), t.getQueryData(u))
970
+ return t.setQueryData(u, (h) => {
1049
971
  if (h)
1050
972
  return {
1051
973
  ...h,
1052
- pages: h == null ? void 0 : h.pages.map((l) => ({
1053
- ...l,
1054
- resources: l.resources.map((p) => {
1055
- if (p.assetId === (d == null ? void 0 : d.resourceId)) {
1056
- let m = [`creator:${p.creatorId}`];
1057
- return (d == null ? void 0 : d.rights.length) >= 1 && (m = [...m, ...d.rights.flatMap((y) => y.actions.map((g) => `${y.type}:${y.id}:${g.id}`))]), {
1058
- ...p,
974
+ pages: h == null ? void 0 : h.pages.map((i) => ({
975
+ ...i,
976
+ resources: i.resources.map((f) => {
977
+ if (f.assetId === (l == null ? void 0 : l.resourceId)) {
978
+ let m = [`creator:${f.creatorId}`];
979
+ return (l == null ? void 0 : l.rights.length) >= 1 && (m = [...m, ...l.rights.flatMap((S) => S.actions.map((y) => `${S.type}:${S.id}:${y.id}`))]), {
980
+ ...f,
1059
981
  rights: m
1060
982
  };
1061
983
  } else
1062
- return p;
984
+ return f;
1063
985
  })
1064
986
  }))
1065
987
  };
1066
988
  });
1067
989
  },
1068
990
  onSettled: () => {
1069
- r([]), n([]);
991
+ r([]), o([]);
1070
992
  }
1071
993
  }
1072
994
  });
1073
- }, ss = (e) => {
1074
- const s = E(), t = b(), {
995
+ }, Ts = (e) => {
996
+ const t = k(), s = A(), {
1075
997
  filters: r,
1076
- trashed: n
1077
- } = t, a = ["context", {
998
+ trashed: o
999
+ } = s, a = ["context", {
1078
1000
  folderId: r.folder,
1079
1001
  filters: r,
1080
- trashed: n
1002
+ trashed: o
1081
1003
  }];
1082
- return be({
1004
+ return Oe({
1083
1005
  application: e,
1084
1006
  options: {
1085
- onSuccess: async (o, i) => {
1086
- if (await s.cancelQueries({
1007
+ onSuccess: async (n, u) => {
1008
+ if (await t.cancelQueries({
1087
1009
  queryKey: a
1088
- }), s.getQueryData(a))
1089
- return s.setQueryData(a, (d) => {
1090
- if (d)
1010
+ }), t.getQueryData(a))
1011
+ return t.setQueryData(a, (l) => {
1012
+ if (l)
1091
1013
  return {
1092
- ...d,
1093
- pages: d == null ? void 0 : d.pages.map((u) => ({
1094
- ...u,
1095
- resources: u.resources.map((h) => {
1096
- if (h.assetId === (i == null ? void 0 : i.entId)) {
1014
+ ...l,
1015
+ pages: l == null ? void 0 : l.pages.map((d) => ({
1016
+ ...d,
1017
+ resources: d.resources.map((h) => {
1018
+ if (h.assetId === (u == null ? void 0 : u.entId)) {
1097
1019
  const {
1098
- name: l,
1099
- thumbnail: p,
1020
+ name: i,
1021
+ thumbnail: f,
1100
1022
  public: m,
1101
- description: y,
1102
- slug: g,
1103
- ...I
1104
- } = i;
1023
+ description: S,
1024
+ slug: y,
1025
+ ...w
1026
+ } = u;
1105
1027
  return {
1106
1028
  ...h,
1107
- ...I,
1029
+ ...w,
1108
1030
  // add any custom field
1109
- name: l,
1110
- thumbnail: typeof p == "string" ? p : URL.createObjectURL(p),
1031
+ name: i,
1032
+ thumbnail: typeof f == "string" ? f : URL.createObjectURL(f),
1111
1033
  public: m,
1112
- description: y,
1113
- slug: g
1034
+ description: S,
1035
+ slug: y
1114
1036
  };
1115
1037
  } else
1116
1038
  return h;
@@ -1121,278 +1043,442 @@ const ft = () => {
1121
1043
  }
1122
1044
  }
1123
1045
  });
1124
- }, rs = () => {
1125
- const e = k(), s = E(), t = b(), {
1046
+ }, Cs = () => {
1047
+ const e = L(), t = k(), s = A(), {
1126
1048
  user: r
1127
- } = le(), {
1128
- appCode: n
1129
- } = K(), a = ["context", {
1130
- folderId: t.filters.folder,
1131
- filters: t.filters,
1132
- trashed: t.trashed
1049
+ } = ue(), {
1050
+ appCode: o
1051
+ } = v(), a = ["context", {
1052
+ folderId: s.filters.folder,
1053
+ filters: s.filters,
1054
+ trashed: s.trashed
1133
1055
  }];
1134
- return L({
1135
- mutationFn: async (o) => await Ge({
1136
- searchParams: t,
1137
- params: o
1056
+ return B({
1057
+ mutationFn: async (n) => await ht({
1058
+ searchParams: s,
1059
+ params: n
1138
1060
  }),
1139
- onError(o) {
1140
- typeof o == "string" && e.error(x(o));
1061
+ onError(n) {
1062
+ typeof n == "string" && e.error(E(n));
1141
1063
  },
1142
- onSuccess: async (o, i) => {
1143
- var u, h, l;
1144
- await s.cancelQueries({
1064
+ onSuccess: async (n, u) => {
1065
+ var d, h, i;
1066
+ await t.cancelQueries({
1145
1067
  queryKey: a
1146
1068
  });
1147
- const f = s.getQueryData(a), d = {
1148
- ...i,
1149
- thumbnail: o.thumbnail || "",
1150
- application: n,
1151
- assetId: o._id || o.entId || "",
1152
- id: o._id || o.entId || "",
1069
+ const p = t.getQueryData(a), l = {
1070
+ ...u,
1071
+ thumbnail: n.thumbnail || "",
1072
+ application: o,
1073
+ assetId: n._id || n.entId || "",
1074
+ id: n._id || n.entId || "",
1153
1075
  creatorId: r == null ? void 0 : r.userId,
1154
1076
  creatorName: r == null ? void 0 : r.username,
1155
1077
  createdAt: Date.now(),
1156
- slug: i.slug || "",
1157
- modifiedAt: ((u = o.modified) == null ? void 0 : u.$date) || "",
1158
- modifierId: ((h = o.author) == null ? void 0 : h.userId) || "",
1159
- modifierName: ((l = o.author) == null ? void 0 : l.username) || "",
1078
+ slug: u.slug || "",
1079
+ modifiedAt: ((d = n.modified) == null ? void 0 : d.$date) || "",
1080
+ modifierId: ((h = n.author) == null ? void 0 : h.userId) || "",
1081
+ modifierName: ((i = n.author) == null ? void 0 : i.username) || "",
1160
1082
  updatedAt: Date.now(),
1161
1083
  trashed: !1,
1162
1084
  rights: [`creator:${r == null ? void 0 : r.userId}`]
1163
1085
  };
1164
- if (f)
1165
- return s.setQueryData(a, (p) => {
1166
- if (p)
1086
+ if (p)
1087
+ return t.setQueryData(a, (f) => {
1088
+ if (f)
1167
1089
  return {
1168
- ...p,
1169
- pages: p == null ? void 0 : p.pages.map((m) => ({
1090
+ ...f,
1091
+ pages: f == null ? void 0 : f.pages.map((m) => ({
1170
1092
  ...m,
1171
- resources: [d, ...m.resources]
1093
+ resources: [l, ...m.resources]
1172
1094
  }))
1173
1095
  };
1174
1096
  });
1175
1097
  }
1176
1098
  });
1177
- }, pt = /* @__PURE__ */ F(async () => await import("./EmptyScreenApp.js")), mt = /* @__PURE__ */ F(async () => await import("./EmptyScreenSearch.js")), gt = /* @__PURE__ */ F(async () => await import("./EmptyScreenError.js")), yt = /* @__PURE__ */ F(async () => await import("./EmptyScreenNoContentInFolder.js")), It = /* @__PURE__ */ F(async () => await import("./EmptyScreenTrash.js")), St = /* @__PURE__ */ F(async () => await import("./FoldersList.js")), wt = /* @__PURE__ */ F(async () => await import("./ResourcesList.js")), xt = () => {
1178
- const e = st(), s = ne(), t = rt(), r = b(), n = H(), a = V(), o = k(), {
1179
- appCode: i
1180
- } = K(), {
1181
- t: f
1182
- } = j([i]), {
1183
- setSearchParams: d,
1184
- setSearchConfig: u,
1185
- setTreeData: h
1186
- } = T(), {
1187
- data: l,
1188
- isError: p,
1189
- error: m,
1190
- isLoading: y,
1191
- isFetching: g,
1192
- fetchNextPage: I
1193
- } = ht(), C = (l == null ? void 0 : l.pages[0].folders.length) === 0, Q = (l == null ? void 0 : l.pages[0].resources.length) === 0, U = C && Q;
1194
- return M(() => {
1195
- var B, R, P;
1196
- if (l) {
1197
- const q = [...((B = l == null ? void 0 : l.pages[0]) == null ? void 0 : B.folders) ?? []];
1198
- (R = l == null ? void 0 : l.pages[0]) != null && R.searchConfig && u(l.pages[0].searchConfig), r.search || ((n == null ? void 0 : n.id) === "default" ? h({
1199
- id: w.DEFAULT,
1200
- section: !0,
1201
- children: q.map((_) => new J(_)),
1202
- name: f("explorer.filters.mine", {
1203
- ns: i
1204
- })
1205
- }) : h(pe(a, q, r.filters.folder || w.DEFAULT))), d({
1206
- ...r,
1207
- pagination: (P = l == null ? void 0 : l.pages[(l == null ? void 0 : l.pages.length) - 1]) == null ? void 0 : P.pagination
1099
+ };
1100
+ function le(e, t) {
1101
+ var r;
1102
+ const s = J(e, t);
1103
+ return (r = s == null ? void 0 : s.folder) != null && r.childrenIds ? [...(s == null ? void 0 : s.folder.childrenIds) || [], t] : t === R.BIN ? [R.BIN] : [R.DEFAULT];
1104
+ }
1105
+ function Qt() {
1106
+ const e = k(), t = At(), s = L(), {
1107
+ appCode: r
1108
+ } = v(), {
1109
+ t: o
1110
+ } = _(["common", r]), a = o("explorer.filters.mine", {
1111
+ ns: r
1112
+ }), {
1113
+ setResourceOrFolderIsDraggable: n,
1114
+ setElementDragOver: u,
1115
+ setResourceIds: p,
1116
+ setFolderIds: l,
1117
+ fetchTreeData: d
1118
+ } = F(), h = V(), i = {
1119
+ delay: Ft,
1120
+ tolerance: Rt
1121
+ }, f = se(xe, {
1122
+ activationConstraint: i
1123
+ }), m = se(Te, {
1124
+ activationConstraint: i
1125
+ }), S = se(Ce), y = Fe(f, m, S), w = (x, b) => {
1126
+ var I;
1127
+ ((I = x.data.current) == null ? void 0 : I.type) === "resource" ? s.success(/* @__PURE__ */ N(G, { children: [
1128
+ o("explorer.dragged.resource"),
1129
+ " ",
1130
+ /* @__PURE__ */ c("strong", { children: b })
1131
+ ] })) : s.success(/* @__PURE__ */ N(G, { children: [
1132
+ o("explorer.dragged.folder"),
1133
+ " ",
1134
+ /* @__PURE__ */ c("strong", { children: b })
1135
+ ] }));
1136
+ };
1137
+ return {
1138
+ handleDragEnd: async (x) => {
1139
+ const {
1140
+ over: b,
1141
+ active: I
1142
+ } = x, g = b == null ? void 0 : b.data.current, D = I.data.current, z = ae(h, g == null ? void 0 : g.id), te = le(h, g == null ? void 0 : g.id);
1143
+ if ((D == null ? void 0 : D.id) == (g == null ? void 0 : g.id) || z.includes(D == null ? void 0 : D.id) || te.includes(D == null ? void 0 : D.id))
1144
+ p([]), l([]);
1145
+ else {
1146
+ const H = (g == null ? void 0 : g.name) ?? a;
1147
+ if (b)
1148
+ try {
1149
+ await t.mutate(g == null ? void 0 : g.id), w(I, H);
1150
+ } catch (Se) {
1151
+ console.error(Se);
1152
+ } finally {
1153
+ u({
1154
+ isOver: !1,
1155
+ overId: void 0,
1156
+ canMove: !0,
1157
+ isTreeview: !1
1158
+ });
1159
+ }
1160
+ }
1161
+ n({
1162
+ isDrag: !1,
1163
+ elementDrag: void 0
1208
1164
  });
1209
- }
1210
- }, [l]), M(() => {
1211
- m && typeof m == "string" && o.error(f(m));
1212
- }, [m]), y ? /* @__PURE__ */ c(A, {}) : p ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(gt, {}) }) : r.search && U ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(mt, {}) }) : e && U ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(pt, {}) }) : t && U && !s ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(yt, {}) }) : s && (l == null ? void 0 : l.pages[0].resources.length) === 0 ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(It, {}) }) : /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
1213
- /* @__PURE__ */ c(St, { data: l, isFetching: g }),
1214
- /* @__PURE__ */ c(wt, { data: l, isFetching: g, fetchNextPage: I })
1165
+ },
1166
+ handleDragStart: (x) => {
1167
+ const {
1168
+ active: b
1169
+ } = x, I = b.data.current;
1170
+ (I == null ? void 0 : I.type) === "resource" ? p([I == null ? void 0 : I.id]) : (I == null ? void 0 : I.type) === "folder" && l([I == null ? void 0 : I.id]), n({
1171
+ isDrag: !0,
1172
+ elementDrag: I == null ? void 0 : I.id
1173
+ });
1174
+ },
1175
+ handleDragOver: (x) => {
1176
+ const {
1177
+ over: b,
1178
+ active: I
1179
+ } = x, g = b == null ? void 0 : b.data.current, D = I == null ? void 0 : I.data.current, z = ae(h, g == null ? void 0 : g.id), te = le(h, g == null ? void 0 : g.id);
1180
+ if (b) {
1181
+ const H = {
1182
+ isOver: !0,
1183
+ canMove: !1,
1184
+ overId: g == null ? void 0 : g.id,
1185
+ isTreeview: g == null ? void 0 : g.isTreeview
1186
+ };
1187
+ (D == null ? void 0 : D.id) === (g == null ? void 0 : g.id) || z.includes(D == null ? void 0 : D.id) || te.includes(D == null ? void 0 : D.id) ? u({
1188
+ ...H,
1189
+ canMove: !1
1190
+ }) : (d(g == null ? void 0 : g.id, e), u({
1191
+ ...H,
1192
+ canMove: !0
1193
+ }));
1194
+ } else
1195
+ u({
1196
+ isOver: !1,
1197
+ overId: void 0,
1198
+ canMove: !0,
1199
+ isTreeview: !1
1200
+ });
1201
+ },
1202
+ sensors: y
1203
+ };
1204
+ }
1205
+ const qt = /* @__PURE__ */ Q(async () => await import("./EmptyScreenApp.js")), Ot = /* @__PURE__ */ Q(async () => await import("./EmptyScreenSearch.js")), kt = /* @__PURE__ */ Q(async () => await import("./EmptyScreenError.js")), Mt = /* @__PURE__ */ Q(async () => await import("./EmptyScreenNoContentInFolder.js")), Ut = /* @__PURE__ */ Q(async () => await import("./EmptyScreenTrash.js")), Lt = /* @__PURE__ */ Q(async () => await import("./FoldersList.js")), vt = /* @__PURE__ */ Q(async () => await import("./ResourcesList.js")), Bt = () => {
1206
+ const e = wt(), t = ne(), s = oe(), r = A(), o = W(), a = L(), n = k(), {
1207
+ appCode: u
1208
+ } = v(), {
1209
+ t: p
1210
+ } = _([u]), {
1211
+ setSearchParams: l,
1212
+ setSearchConfig: d,
1213
+ fetchTreeData: h
1214
+ } = F(), {
1215
+ data: i,
1216
+ isError: f,
1217
+ error: m,
1218
+ isLoading: S,
1219
+ isFetching: y,
1220
+ fetchNextPage: w
1221
+ } = Pt(), C = (i == null ? void 0 : i.pages[0].folders.length) === 0, q = (i == null ? void 0 : i.pages[0].resources.length) === 0, O = C && q;
1222
+ return $(() => {
1223
+ var x, b;
1224
+ i && ((x = i == null ? void 0 : i.pages[0]) != null && x.searchConfig && d(i.pages[0].searchConfig), !r.search && o.id === "default" && h(o.id, n), l({
1225
+ ...r,
1226
+ pagination: (b = i == null ? void 0 : i.pages[(i == null ? void 0 : i.pages.length) - 1]) == null ? void 0 : b.pagination
1227
+ }));
1228
+ }, [i]), $(() => {
1229
+ m && typeof m == "string" && a.error(p(m));
1230
+ }, [m]), S ? /* @__PURE__ */ c(M, {}) : f ? /* @__PURE__ */ c(U, { fallback: /* @__PURE__ */ c(M, {}), children: /* @__PURE__ */ c(kt, {}) }) : r.search && O ? /* @__PURE__ */ c(U, { fallback: /* @__PURE__ */ c(M, {}), children: /* @__PURE__ */ c(Ot, {}) }) : e && O ? /* @__PURE__ */ c(U, { fallback: /* @__PURE__ */ c(M, {}), children: /* @__PURE__ */ c(qt, {}) }) : s && O && !t ? /* @__PURE__ */ c(U, { fallback: /* @__PURE__ */ c(M, {}), children: /* @__PURE__ */ c(Mt, {}) }) : t && (i == null ? void 0 : i.pages[0].resources.length) === 0 ? /* @__PURE__ */ c(U, { fallback: /* @__PURE__ */ c(M, {}), children: /* @__PURE__ */ c(Ut, {}) }) : /* @__PURE__ */ N(U, { fallback: /* @__PURE__ */ c(M, {}), children: [
1231
+ /* @__PURE__ */ c(Lt, { data: i, isFetching: y }),
1232
+ /* @__PURE__ */ c(vt, { data: i, isFetching: y, fetchNextPage: w })
1215
1233
  ] });
1216
- }, Dt = () => {
1234
+ }, De = () => {
1235
+ const e = A(), [t, s] = de(""), r = It(), o = xt(), a = be(null), {
1236
+ setSearchParams: n
1237
+ } = F(), u = (d) => {
1238
+ const h = d.target.value;
1239
+ s(h.toString());
1240
+ }, p = (d) => {
1241
+ (d.key === "Enter" || d.key === "Return") && (d.preventDefault(), n({
1242
+ search: t || void 0
1243
+ }));
1244
+ }, l = (d) => {
1245
+ d.preventDefault(), n({
1246
+ search: t || void 0
1247
+ });
1248
+ };
1249
+ return $(() => {
1250
+ const h = t.length == 0 || t.length >= r.minLength ? {
1251
+ search: t || void 0
1252
+ } : {};
1253
+ n({
1254
+ ...e,
1255
+ ...h
1256
+ });
1257
+ }, [t, r.minLength]), $(() => {
1258
+ o === "select" && s("");
1259
+ }, [o]), $(() => {
1260
+ s(() => {
1261
+ var d;
1262
+ return ((d = e.search) == null ? void 0 : d.toString()) ?? "";
1263
+ });
1264
+ }, [e]), {
1265
+ formRef: a,
1266
+ inputSearch: t,
1267
+ handleInputSearchChange: u,
1268
+ handleKeyPress: p,
1269
+ handleSearchSubmit: l
1270
+ };
1271
+ }, Kt = () => {
1217
1272
  const {
1218
1273
  appCode: e,
1219
- currentApp: s
1220
- } = K(), {
1221
- t
1222
- } = j(), [r, n] = ie(""), a = (u) => {
1223
- if (u === "0") {
1224
- n("");
1274
+ currentApp: t
1275
+ } = v(), {
1276
+ t: s
1277
+ } = _(), [r, o] = de(""), a = (d) => {
1278
+ if (d === "0") {
1279
+ o("");
1225
1280
  return;
1226
1281
  }
1227
- n(u);
1228
- }, o = H(), i = b(), {
1229
- setSearchParams: f
1230
- } = T();
1231
- M(() => {
1232
- const u = () => r.includes("1") ? !0 : void 0, h = () => r.includes("2") ? !0 : void 0, l = () => r.includes("7") ? !0 : void 0;
1233
- f({
1234
- ...i,
1282
+ o(d);
1283
+ }, n = W(), u = A(), {
1284
+ setSearchParams: p
1285
+ } = F();
1286
+ $(() => {
1287
+ const d = () => r.includes("1") ? !0 : void 0, h = () => r.includes("2") ? !0 : void 0, i = () => r.includes("7") ? !0 : void 0;
1288
+ p({
1289
+ ...u,
1235
1290
  filters: {
1236
- owner: u(),
1237
- public: l(),
1291
+ owner: d(),
1292
+ public: i(),
1238
1293
  shared: h(),
1239
- folder: o ? o.id : "default"
1294
+ folder: n ? n.id : "default"
1240
1295
  }
1241
1296
  });
1242
- }, [o, f, r]);
1243
- const d = [{
1244
- label: t("explorer.filter.all", {
1297
+ }, [n, p, r]);
1298
+ const l = [{
1299
+ label: s("explorer.filter.all", {
1245
1300
  ns: e
1246
1301
  }),
1247
1302
  value: "0"
1248
1303
  }, {
1249
- label: t("explorer.filter.owner", {
1304
+ label: s("explorer.filter.owner", {
1250
1305
  ns: e
1251
1306
  }),
1252
1307
  value: "1"
1253
1308
  }, {
1254
- label: t("explorer.filter.shared", {
1309
+ label: s("explorer.filter.shared", {
1255
1310
  ns: e
1256
1311
  }),
1257
1312
  value: "2"
1258
- }, ...(s == null ? void 0 : s.displayName) == "exercizer" ? [{
1313
+ }, ...(t == null ? void 0 : t.displayName) == "exercizer" ? [{
1259
1314
  label: "Exercices interactifs",
1260
1315
  value: "3"
1261
- }] : [], ...(s == null ? void 0 : s.displayName) == "exercizer" ? [{
1316
+ }] : [], ...(t == null ? void 0 : t.displayName) == "exercizer" ? [{
1262
1317
  label: "Exercices à rendre",
1263
1318
  value: "4"
1264
- }] : [], ...(s == null ? void 0 : s.displayName) == "pages" ? [{
1319
+ }] : [], ...(t == null ? void 0 : t.displayName) == "pages" ? [{
1265
1320
  label: "Projets publics",
1266
1321
  value: "5"
1267
- }] : [], ...(s == null ? void 0 : s.displayName) == "pages" ? [{
1322
+ }] : [], ...(t == null ? void 0 : t.displayName) == "pages" ? [{
1268
1323
  label: "Projets internes",
1269
1324
  value: "6"
1270
- }] : [], ...(s == null ? void 0 : s.displayName) == "blog" ? [{
1271
- label: t("explorer.filter.public", {
1325
+ }] : [], ...(t == null ? void 0 : t.displayName) == "blog" ? [{
1326
+ label: s("explorer.filter.public", {
1272
1327
  ns: e
1273
1328
  }),
1274
1329
  value: "7"
1275
1330
  }] : []];
1276
1331
  return {
1277
1332
  selectedFilters: r,
1278
- options: d,
1333
+ options: l,
1279
1334
  handleOnSelectFilter: a
1280
1335
  };
1281
- }, bt = () => {
1336
+ }, $t = () => {
1282
1337
  const {
1283
1338
  appCode: e
1284
- } = K(), {
1285
- t: s
1286
- } = j(), {
1287
- selectedFilters: t,
1339
+ } = v(), {
1340
+ t
1341
+ } = _(), {
1342
+ selectedFilters: s,
1288
1343
  options: r,
1289
- handleOnSelectFilter: n
1290
- } = Dt(), {
1344
+ handleOnSelectFilter: o
1345
+ } = Kt(), {
1291
1346
  formRef: a,
1292
- inputSearch: o,
1293
- handleInputSearchChange: i,
1294
- handleKeyPress: f,
1295
- handleSearchSubmit: d
1296
- } = me(), u = t.length > 0 ? t.length : void 0;
1347
+ inputSearch: n,
1348
+ handleInputSearchChange: u,
1349
+ handleKeyPress: p,
1350
+ handleSearchSubmit: l
1351
+ } = De(), d = s.length > 0 ? s.length : void 0;
1297
1352
  return /* @__PURE__ */ N("form", { noValidate: !0, className: "bg-light p-16 ps-24 ms-n16 ms-lg-n24 me-n16 position-relative d-flex gap-8", ref: a, children: [
1298
- /* @__PURE__ */ N(Te, { id: "search", className: "input-group", children: [
1299
- /* @__PURE__ */ c(Fe, { type: "search", placeholder: s("explorer.label.search", {
1353
+ /* @__PURE__ */ N(Ue, { id: "search", className: "input-group", children: [
1354
+ /* @__PURE__ */ c(Le, { type: "search", placeholder: t("explorer.label.search", {
1300
1355
  ns: e
1301
- }), size: "lg", noValidationIcon: !0, value: o, onChange: i, onKeyDown: f }),
1302
- /* @__PURE__ */ c(Ce, { type: "submit", "aria-label": s("explorer.label.search", {
1356
+ }), size: "lg", noValidationIcon: !0, value: n, onChange: u, onKeyDown: p }),
1357
+ /* @__PURE__ */ c(ve, { type: "submit", "aria-label": t("explorer.label.search", {
1303
1358
  ns: e
1304
- }), onClick: d })
1359
+ }), onClick: l })
1305
1360
  ] }),
1306
- /* @__PURE__ */ N(z, { placement: "bottom-end", children: [
1307
- /* @__PURE__ */ c(z.Trigger, { label: s("explorer.filters"), icon: /* @__PURE__ */ c(Oe, { width: 20 }), variant: "ghost", badgeContent: u }),
1308
- /* @__PURE__ */ c(z.Menu, { children: r.map((h) => h.value === "0" ? /* @__PURE__ */ N(Se, { children: [
1309
- /* @__PURE__ */ c(z.RadioItem, { value: h.value, model: t, onChange: () => n(h.value), children: h.label }),
1310
- /* @__PURE__ */ c(z.Separator, {})
1311
- ] }, "0") : /* @__PURE__ */ c(z.RadioItem, { value: h.value, model: t, onChange: () => n(h.value), children: h.label }, h.value)) })
1361
+ /* @__PURE__ */ N(j, { placement: "bottom-end", children: [
1362
+ /* @__PURE__ */ c(j.Trigger, { label: t("explorer.filters"), icon: /* @__PURE__ */ c(et, { width: 20 }), variant: "ghost", badgeContent: d }),
1363
+ /* @__PURE__ */ c(j.Menu, { children: r.map((h) => h.value === "0" ? /* @__PURE__ */ N(we, { children: [
1364
+ /* @__PURE__ */ c(j.RadioItem, { value: h.value, model: s, onChange: () => o(h.value), children: h.label }),
1365
+ /* @__PURE__ */ c(j.Separator, {})
1366
+ ] }, "0") : /* @__PURE__ */ c(j.RadioItem, { value: h.value, model: s, onChange: () => o(h.value), children: h.label }, h.value)) })
1312
1367
  ] })
1313
1368
  ] });
1314
- }, Tt = ({
1369
+ }, _t = ({
1315
1370
  id: e,
1316
- selected: s,
1317
- onSelect: t
1371
+ selected: t,
1372
+ onSelect: s
1318
1373
  }) => {
1319
1374
  const {
1320
1375
  t: r
1321
- } = j();
1322
- return /* @__PURE__ */ c("div", { className: "treeview", children: /* @__PURE__ */ c("ul", { role: "tree", className: "m-0 p-0", children: /* @__PURE__ */ c("li", { id: e, role: "treeitem", "aria-selected": s, children: /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("div", { className: "action-container", children: /* @__PURE__ */ c("div", { onClick: t, role: "button", tabIndex: 0, children: /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
1323
- /* @__PURE__ */ c(ke, { width: "20", height: "20" }),
1376
+ } = _();
1377
+ return /* @__PURE__ */ c("div", { className: "treeview", children: /* @__PURE__ */ c("ul", { role: "tree", className: "m-0 p-0", children: /* @__PURE__ */ c("li", { id: e, role: "treeitem", "aria-selected": t, children: /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("div", { className: "action-container", children: /* @__PURE__ */ c("div", { onClick: s, role: "button", tabIndex: 0, children: /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8 py-8 ps-24", children: [
1378
+ /* @__PURE__ */ c(tt, { width: "20", height: "20" }),
1324
1379
  /* @__PURE__ */ c("span", { children: r("explorer.tree.trash") })
1325
1380
  ] }) }) }) }) }) }) });
1326
- }, Ft = /* @__PURE__ */ F(async () => await import("./FolderModal.js")), Ct = () => {
1327
- const e = E(), [s, t] = Ne(), r = V(), n = ne(), a = re(), {
1328
- appCode: o
1329
- } = K(), {
1330
- t: i
1331
- } = j(["common", o]), {
1332
- goToTrash: f,
1333
- selectTreeItem: d,
1334
- unfoldTreeItem: u,
1335
- foldTreeItem: h,
1336
- clearSelectedItems: l,
1337
- clearSelectedIds: p
1338
- } = T(), m = async (g) => {
1339
- await u(g, e);
1340
- }, y = () => {
1341
- l(), p(), t();
1381
+ }, zt = /* @__PURE__ */ Q(async () => await import("./FolderModal.js")), jt = () => {
1382
+ const [e, t] = Be(), s = k(), r = V(), o = ne(), a = oe(), n = St(), u = Ke(), p = o ? R.BIN : a, {
1383
+ appCode: l
1384
+ } = v(), {
1385
+ t: d
1386
+ } = _(["common", l]), h = {
1387
+ ...r,
1388
+ name: d("explorer.filters.mine", {
1389
+ ns: l
1390
+ })
1391
+ }, {
1392
+ goToTrash: i,
1393
+ selectTreeItem: f,
1394
+ clearSelectedItems: m,
1395
+ clearSelectedIds: S,
1396
+ fetchTreeData: y
1397
+ } = F(), w = (O) => {
1398
+ f(O, s), u();
1399
+ }, C = (O) => {
1400
+ var I, g;
1401
+ const x = J(r, O), b = (I = x == null ? void 0 : x.children) == null ? void 0 : I.some((D) => {
1402
+ var z;
1403
+ return Array.isArray(D == null ? void 0 : D.children) && ((z = D.children) == null ? void 0 : z.length) > 0;
1404
+ });
1405
+ (g = x == null ? void 0 : x.children) == null || g.forEach((D) => {
1406
+ b || y(D.id, s);
1407
+ });
1408
+ }, q = () => {
1409
+ m(), S(), t();
1342
1410
  };
1343
- return /* @__PURE__ */ N(ce, { children: [
1344
- /* @__PURE__ */ c(Re, { data: {
1345
- ...r,
1346
- name: i("explorer.filters.mine", {
1347
- ns: o
1348
- })
1349
- }, selectedNodesIds: a, onTreeItemSelect: d, onTreeItemFold: h, onTreeItemUnfold: m }),
1350
- /* @__PURE__ */ c(Tt, { id: w.BIN, selected: n, onSelect: f }),
1351
- /* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(Pe, { disabled: n, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(Ue, {}), onClick: y, children: i("explorer.folder.new") }) }),
1352
- /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: s && /* @__PURE__ */ c(Ft, { edit: !1, isOpen: s, onSuccess: t, onCancel: t }) })
1411
+ return /* @__PURE__ */ N(G, { children: [
1412
+ /* @__PURE__ */ c($e, { data: h, selectedNodeId: p, draggedNode: n != null && n.isTreeview ? n : void 0, onTreeItemClick: w, onTreeItemUnfold: C }),
1413
+ /* @__PURE__ */ c(_t, { id: R.BIN, selected: o, onSelect: i }),
1414
+ /* @__PURE__ */ c("div", { className: "d-grid my-16", children: /* @__PURE__ */ c(_e, { disabled: o, type: "button", color: "primary", variant: "outline", leftIcon: /* @__PURE__ */ c(st, {}), onClick: q, children: d("explorer.folder.new") }) }),
1415
+ /* @__PURE__ */ c(U, { fallback: /* @__PURE__ */ c(M, {}), children: e && /* @__PURE__ */ c(zt, { edit: !1, isOpen: e, onSuccess: t, onCancel: t }) })
1353
1416
  ] });
1354
- }, Nt = /* @__PURE__ */ F(async () => await import("./AppAction.js")), Rt = /* @__PURE__ */ F(async () => await import("./Library.js")), Pt = /* @__PURE__ */ F(async () => await import("./ActionBarContainer.js")), At = /* @__PURE__ */ F(async () => await import("./DisableModal.js")), Et = /* @__PURE__ */ F(async () => await import("./TrashModal.js")), Qt = /* @__PURE__ */ F(async () => await import("./OnboardingModal.js")), ns = ({
1417
+ };
1418
+ function Vt() {
1419
+ const {
1420
+ appCode: e
1421
+ } = v(), {
1422
+ gotoPreviousFolder: t
1423
+ } = F(), {
1424
+ t: s
1425
+ } = _(["common", e]), {
1426
+ inputSearch: r
1427
+ } = De(), o = oe(), a = ne(), n = W(), u = s("explorer.tree.trash"), p = s("explorer.tree.search"), l = s("explorer.filters.mine", {
1428
+ ns: e
1429
+ }), d = (n == null ? void 0 : n.name) || l;
1430
+ return /* @__PURE__ */ c("div", { className: "py-16", children: o && o !== "bin" && o !== "default" && !a ? /* @__PURE__ */ N("div", { className: "d-flex align-items-center gap-8", children: [
1431
+ /* @__PURE__ */ c(ze, { icon: /* @__PURE__ */ c(rt, {}), variant: "ghost", color: "tertiary", "aria-label": s("back"), className: "ms-n16", onClick: t }),
1432
+ /* @__PURE__ */ c("p", { className: "body py-8 text-truncate", children: /* @__PURE__ */ c("strong", { children: d }) })
1433
+ ] }) : /* @__PURE__ */ c("h2", { className: "body py-8 fw-bold", children: r.length !== 0 ? p : a ? u : l }) });
1434
+ }
1435
+ const Wt = /* @__PURE__ */ Q(async () => await import("./AppAction.js")), Ht = /* @__PURE__ */ Q(async () => await import("./Library.js")), Gt = /* @__PURE__ */ Q(async () => await import("./ActionBarContainer.js")), Jt = /* @__PURE__ */ Q(async () => await import("./DisableModal.js")), Xt = /* @__PURE__ */ Q(async () => await import("./TrashModal.js")), Yt = /* @__PURE__ */ Q(async () => await import("./OnboardingModal.js")), Fs = ({
1355
1436
  config: e
1356
1437
  }) => {
1357
- const s = b(), {
1358
- setConfig: t,
1438
+ const t = A(), {
1439
+ setConfig: s,
1359
1440
  setSearchParams: r
1360
- } = T();
1361
- M(() => {
1362
- t(e || {}), r({
1363
- ...s,
1441
+ } = F();
1442
+ $(() => {
1443
+ s(e || {}), r({
1444
+ ...t,
1364
1445
  application: e.app,
1365
1446
  types: e.types
1366
1447
  });
1367
1448
  }, [e]);
1368
1449
  const {
1369
- currentApp: n
1370
- } = K(), {
1450
+ currentApp: o
1451
+ } = v(), {
1371
1452
  data: a
1372
- } = ft(), {
1373
- isTrashedModalOpen: o,
1374
- onTrashedCancel: i
1375
- } = ct(), {
1376
- isActionDisableModalOpen: f,
1377
- onActionDisableCancel: d
1378
- } = at();
1379
- Ae();
1380
- const u = oe("publish", a), h = oe("create", a);
1381
- return e && /* @__PURE__ */ N(ce, { children: [
1382
- /* @__PURE__ */ c(Ee, { render: () => h ? /* @__PURE__ */ c(O, { fallback: /* @__PURE__ */ c(A, {}), children: /* @__PURE__ */ c(Nt, {}) }) : null, children: /* @__PURE__ */ c(Qe, { app: n }) }),
1383
- /* @__PURE__ */ N(te, { className: "flex-grow-1", children: [
1384
- /* @__PURE__ */ c(te.Col, { sm: "3", lg: "2", xl: "3", className: "border-end pt-16 pe-16 d-none d-lg-block", as: "aside", children: /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
1385
- /* @__PURE__ */ c(Ct, {}),
1386
- u && /* @__PURE__ */ c(Rt, {})
1453
+ } = Et(e.actions), {
1454
+ isTrashedModalOpen: n,
1455
+ onTrashedCancel: u
1456
+ } = Ct(), {
1457
+ isActionDisableModalOpen: p,
1458
+ onActionDisableCancel: l
1459
+ } = Tt(), {
1460
+ handleDragEnd: d,
1461
+ handleDragOver: h,
1462
+ handleDragStart: i,
1463
+ sensors: f
1464
+ } = Qt();
1465
+ je();
1466
+ const m = ce("publish", a), S = ce("create", a);
1467
+ return e && /* @__PURE__ */ N(G, { children: [
1468
+ /* @__PURE__ */ c(Ve, { render: () => S ? /* @__PURE__ */ c(U, { fallback: /* @__PURE__ */ c(M, {}), children: /* @__PURE__ */ c(Wt, {}) }) : null, children: /* @__PURE__ */ c(We, { app: o }) }),
1469
+ /* @__PURE__ */ c(re, { className: "flex-grow-1", children: /* @__PURE__ */ N(Re, { sensors: f, modifiers: [Ne], onDragStart: i, onDragEnd: d, onDragOver: h, children: [
1470
+ /* @__PURE__ */ c(re.Col, { sm: "3", lg: "2", xl: "3", className: "border-end pt-16 pe-16 d-none d-lg-block", as: "aside", children: /* @__PURE__ */ N(U, { fallback: /* @__PURE__ */ c(M, {}), children: [
1471
+ /* @__PURE__ */ c(jt, {}),
1472
+ m && /* @__PURE__ */ c(Ht, {})
1387
1473
  ] }) }),
1388
- /* @__PURE__ */ N(te.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
1389
- /* @__PURE__ */ c(bt, {}),
1390
- /* @__PURE__ */ c(ot, {}),
1391
- /* @__PURE__ */ c(xt, {})
1474
+ /* @__PURE__ */ N(re.Col, { sm: "4", md: "8", lg: "6", xl: "9", children: [
1475
+ /* @__PURE__ */ c($t, {}),
1476
+ /* @__PURE__ */ c(Vt, {}),
1477
+ /* @__PURE__ */ c(Bt, {})
1392
1478
  ] }),
1393
- /* @__PURE__ */ N(O, { fallback: /* @__PURE__ */ c(A, {}), children: [
1394
- /* @__PURE__ */ c(Pt, {}),
1395
- e.enableOnboarding && /* @__PURE__ */ c(Qt, { id: "showOnboardingTrash", items: [{
1479
+ /* @__PURE__ */ N(U, { fallback: /* @__PURE__ */ c(M, {}), children: [
1480
+ /* @__PURE__ */ c(Gt, {}),
1481
+ e.enableOnboarding && /* @__PURE__ */ c(Yt, { id: "showOnboardingTrash", items: [{
1396
1482
  src: "onboarding/illu-trash-menu.svg",
1397
1483
  alt: "explorer.modal.onboarding.trash.screen1.alt",
1398
1484
  text: "explorer.modal.onboarding.trash.screen1.title"
@@ -1410,57 +1496,40 @@ const ft = () => {
1410
1496
  nextText: "explorer.modal.onboarding.trash.next",
1411
1497
  closeText: "explorer.modal.onboarding.trash.close"
1412
1498
  } }),
1413
- o && /* @__PURE__ */ c(Et, { isOpen: o, onCancel: i }),
1414
- f && /* @__PURE__ */ c(At, { isOpen: f, onCancel: d })
1499
+ n && /* @__PURE__ */ c(Xt, { isOpen: n, onCancel: u }),
1500
+ p && /* @__PURE__ */ c(Jt, { isOpen: p, onCancel: l })
1415
1501
  ] })
1416
- ] })
1502
+ ] }) })
1417
1503
  ] });
1418
- }, v = document.querySelector("[data-explorer-config]");
1419
- let ae;
1420
- function os() {
1421
- var e;
1422
- if ((e = v == null ? void 0 : v.dataset) != null && e.explorerConfig) {
1423
- const {
1424
- explorerConfig: s
1425
- } = v.dataset;
1426
- try {
1427
- const t = JSON.parse(s);
1428
- ae = {
1429
- ...t,
1430
- enableOnboarding: t.enableOnboarding !== void 0 ? t.enableOnboarding : !0
1431
- };
1432
- } catch (t) {
1433
- console.error("[Explorer Config] could not parse app params from root data attributes:", v == null ? void 0 : v.dataset, t);
1434
- }
1435
- }
1436
- return ae;
1437
- }
1504
+ };
1438
1505
  export {
1439
- ns as E,
1440
- ft as a,
1441
- H as b,
1442
- rs as c,
1443
- b as d,
1444
- ne as e,
1445
- S as f,
1446
- $t as g,
1506
+ hs as A,
1507
+ ms as B,
1508
+ Fs as E,
1509
+ F as a,
1510
+ Et as b,
1511
+ W as c,
1512
+ Cs as d,
1513
+ A as e,
1514
+ ne as f,
1515
+ ds as g,
1447
1516
  Y as h,
1448
- Ht as i,
1449
- Vt as j,
1517
+ fs as i,
1518
+ ps as j,
1450
1519
  X as k,
1451
- Gt as l,
1452
- et as m,
1453
- Xt as n,
1454
- zt as o,
1455
- ts as p,
1456
- ss as q,
1457
- Zt as r,
1458
- es as s,
1459
- Jt as t,
1520
+ Is as l,
1521
+ Dt as m,
1522
+ Ss as n,
1523
+ gs as o,
1524
+ us as p,
1525
+ xs as q,
1526
+ Ts as r,
1527
+ St as s,
1528
+ bs as t,
1460
1529
  T as u,
1461
- Wt as v,
1462
- Yt as w,
1463
- V as x,
1464
- jt as y,
1465
- os as z
1530
+ ws as v,
1531
+ Ds as w,
1532
+ ys as x,
1533
+ At as y,
1534
+ V as z
1466
1535
  };