ode-explorer 1.4.1 → 1.4.2-develop-b2school.202403201820

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