@vidispine/vdt-react 26.2.1 → 26.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1394 -1370
- package/dist/index.umd.cjs +7 -7
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { useRef as z, useReducer as fe, useCallback as
|
|
2
|
-
import { utils as
|
|
3
|
-
import { createMetadataType as de, formatTimeCodeText as _t, formatTimeCodeSeconds as bt, parseMetadataType as
|
|
1
|
+
import { useRef as z, useReducer as fe, useCallback as v, useEffect as $, useState as x, useMemo as he, Children as oe, cloneElement as se, Component as ze, createContext as Ee, useContext as Ie, isValidElement as _e } from "react";
|
|
2
|
+
import { utils as Q, search as Ue, vsimport as qe, collection as k, ChunkedTransferManager as Rt, ChunkedUpload as Pt, access as Pe, metadatafield as Ke, fieldgroup as Ze, item as ue, library as ge, user as X, group as te, storage as Nt, job as et, file as It, metadata as Ne, noauth as tt } from "@vidispine/vdt-api";
|
|
3
|
+
import { createMetadataType as de, formatTimeCodeText as _t, formatTimeCodeSeconds as bt, parseMetadataType as nt, ROLE_NAMES as Gt } from "@vidispine/vdt-js";
|
|
4
4
|
import { compressToEncodedURIComponent as wt, decompressFromEncodedURIComponent as Dt } from "lz-string";
|
|
5
5
|
import Z from "use-deep-compare-effect";
|
|
6
|
-
import
|
|
6
|
+
import rt from "lodash.debounce";
|
|
7
7
|
import { jsx as B, jsxs as Ot } from "react/jsx-runtime";
|
|
8
8
|
import { useCookies as ot } from "react-cookie";
|
|
9
9
|
import st from "react-is";
|
|
10
10
|
const Ht = ({
|
|
11
11
|
hasLoaded: e = !1,
|
|
12
12
|
isLoading: t = !0,
|
|
13
|
-
isError:
|
|
14
|
-
response:
|
|
13
|
+
isError: r = !1,
|
|
14
|
+
response: n = void 0,
|
|
15
15
|
data: o = void 0
|
|
16
16
|
} = {}, s = void 0) => ({
|
|
17
17
|
isLoading: t,
|
|
18
18
|
hasLoaded: e,
|
|
19
|
-
isError:
|
|
20
|
-
response:
|
|
19
|
+
isError: r,
|
|
20
|
+
response: n,
|
|
21
21
|
data: s && s.current ? s.current : o
|
|
22
22
|
}), Lt = (e, t) => {
|
|
23
23
|
switch (t.type) {
|
|
@@ -28,14 +28,14 @@ const Ht = ({
|
|
|
28
28
|
isError: !1
|
|
29
29
|
};
|
|
30
30
|
case "SUCCESS": {
|
|
31
|
-
const { responseType:
|
|
31
|
+
const { responseType: r } = t.response, n = {
|
|
32
32
|
isLoading: !1,
|
|
33
33
|
isError: !1,
|
|
34
34
|
hasLoaded: !0,
|
|
35
35
|
response: t.response,
|
|
36
36
|
data: t.response.data
|
|
37
37
|
};
|
|
38
|
-
return
|
|
38
|
+
return r && (n[r] = t.response[r]), n;
|
|
39
39
|
}
|
|
40
40
|
case "ERROR":
|
|
41
41
|
return {
|
|
@@ -60,38 +60,38 @@ const Ht = ({
|
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
function j(e, t,
|
|
64
|
-
const
|
|
65
|
-
(
|
|
63
|
+
function j(e, t, r) {
|
|
64
|
+
const n = z(() => null), o = Ht(t, r), s = z(o), [a, i] = fe(Lt, o), d = v(
|
|
65
|
+
(m) => (i({ type: "START" }), new Promise((p, l) => {
|
|
66
66
|
e({
|
|
67
|
-
cancelToken: new
|
|
68
|
-
|
|
67
|
+
cancelToken: new Q.CancelToken((h) => {
|
|
68
|
+
n.current = h;
|
|
69
69
|
}),
|
|
70
|
-
...
|
|
70
|
+
...m
|
|
71
71
|
}).then((h) => {
|
|
72
|
-
|
|
72
|
+
p(h), i({ type: "SUCCESS", response: h }), r && (r.current = h.data);
|
|
73
73
|
}).catch((h) => {
|
|
74
|
-
h.__CANCEL__ ? i({ type: "CANCEL" }) : (
|
|
74
|
+
h.__CANCEL__ ? i({ type: "CANCEL" }) : (l(h), i({ type: "ERROR", response: h }));
|
|
75
75
|
});
|
|
76
76
|
})),
|
|
77
|
-
[e,
|
|
78
|
-
), u =
|
|
77
|
+
[e, r]
|
|
78
|
+
), u = v(
|
|
79
79
|
() => i({ type: "RESET", initialState: s.current }),
|
|
80
80
|
[]
|
|
81
|
-
), c =
|
|
81
|
+
), c = v(() => n.current(), []);
|
|
82
82
|
return $(
|
|
83
83
|
() => () => {
|
|
84
84
|
c(), u();
|
|
85
85
|
},
|
|
86
86
|
[c, u]
|
|
87
87
|
), {
|
|
88
|
-
request:
|
|
88
|
+
request: d,
|
|
89
89
|
reset: u,
|
|
90
90
|
cancel: c,
|
|
91
91
|
...a
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
const Ut = "CHANGE_PAGE", xt = "CHANGE_ROWS", Mt = "CHANGE_SORT", Ft = "CHANGE_SEARCHTEXT", qt = "CHANGE_SEARCHFIELD", $t = "CHANGE_SEARCHFIELDFACET", jt = "CHANGE_SEARCHFILTER", Wt = "CHANGE_SEARCHFILTERFACET", Vt = "CHANGE_PARENT_COLLECTION", kt = "CHANGE_FACET", Yt = "CHANGE_ITEMSEARCHDOCUMENT", Bt = "CHANGE_QUERYPARAMS",
|
|
94
|
+
const Ut = "CHANGE_PAGE", xt = "CHANGE_ROWS", Mt = "CHANGE_SORT", Ft = "CHANGE_SEARCHTEXT", qt = "CHANGE_SEARCHFIELD", $t = "CHANGE_SEARCHFIELDFACET", jt = "CHANGE_SEARCHFILTER", Wt = "CHANGE_SEARCHFILTERFACET", Vt = "CHANGE_PARENT_COLLECTION", kt = "CHANGE_FACET", Yt = "CHANGE_ITEMSEARCHDOCUMENT", Bt = "CHANGE_QUERYPARAMS", Jt = "CHANGE_MATRIXPARAMS", Qt = "CHANGE_SUGGESTION", M = {
|
|
95
95
|
CHANGE_PAGE: Ut,
|
|
96
96
|
CHANGE_ROWS: xt,
|
|
97
97
|
CHANGE_SORT: Mt,
|
|
@@ -104,16 +104,16 @@ const Ut = "CHANGE_PAGE", xt = "CHANGE_ROWS", Mt = "CHANGE_SORT", Ft = "CHANGE_S
|
|
|
104
104
|
CHANGE_FACET: kt,
|
|
105
105
|
CHANGE_ITEMSEARCHDOCUMENT: Yt,
|
|
106
106
|
CHANGE_QUERYPARAMS: Bt,
|
|
107
|
-
CHANGE_MATRIXPARAMS:
|
|
108
|
-
CHANGE_SUGGESTION:
|
|
107
|
+
CHANGE_MATRIXPARAMS: Jt,
|
|
108
|
+
CHANGE_SUGGESTION: Qt
|
|
109
109
|
}, Xt = ({
|
|
110
110
|
queryParams: e = {},
|
|
111
111
|
matrixParams: t = {},
|
|
112
|
-
itemSearchDocument:
|
|
113
|
-
rowsPerPage:
|
|
112
|
+
itemSearchDocument: r = {},
|
|
113
|
+
rowsPerPage: n = 10,
|
|
114
114
|
page: o = 0,
|
|
115
115
|
...s
|
|
116
|
-
} = {}) => ({
|
|
116
|
+
} = {}, a = !1) => ({
|
|
117
117
|
...s,
|
|
118
118
|
queryParams: {
|
|
119
119
|
content: "metadata",
|
|
@@ -121,17 +121,17 @@ const Ut = "CHANGE_PAGE", xt = "CHANGE_ROWS", Mt = "CHANGE_SORT", Ft = "CHANGE_S
|
|
|
121
121
|
...e
|
|
122
122
|
},
|
|
123
123
|
matrixParams: {
|
|
124
|
-
first: o *
|
|
125
|
-
number:
|
|
124
|
+
first: o * n + 1,
|
|
125
|
+
number: n,
|
|
126
126
|
...t
|
|
127
127
|
},
|
|
128
128
|
itemSearchDocument: {
|
|
129
|
-
intervals: "generic",
|
|
130
|
-
|
|
131
|
-
...n
|
|
129
|
+
...a ? {} : { intervals: "generic", filter: [] },
|
|
130
|
+
...r
|
|
132
131
|
},
|
|
133
|
-
rowsPerPage:
|
|
134
|
-
page: o
|
|
132
|
+
rowsPerPage: n,
|
|
133
|
+
page: o,
|
|
134
|
+
enableSearch2: a
|
|
135
135
|
}), zt = (e, t) => {
|
|
136
136
|
switch (t.type) {
|
|
137
137
|
case M.CHANGE_ITEMSEARCHDOCUMENT:
|
|
@@ -199,12 +199,23 @@ const Ut = "CHANGE_PAGE", xt = "CHANGE_ROWS", Mt = "CHANGE_SORT", Ft = "CHANGE_S
|
|
|
199
199
|
...e,
|
|
200
200
|
page: 0,
|
|
201
201
|
searchText: t.value,
|
|
202
|
-
itemSearchDocument: t.value ? {
|
|
202
|
+
itemSearchDocument: t.value && t.value.length > 0 ? {
|
|
203
203
|
...e.itemSearchDocument,
|
|
204
|
-
|
|
204
|
+
...e.enableSearch2 ? {
|
|
205
|
+
field: [
|
|
206
|
+
{
|
|
207
|
+
name: "title",
|
|
208
|
+
value: [
|
|
209
|
+
{
|
|
210
|
+
value: `${t.value}`
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
} : { text: [{ value: `${t.value}` }] }
|
|
205
216
|
} : {
|
|
206
217
|
...e.itemSearchDocument,
|
|
207
|
-
text:
|
|
218
|
+
text: void 0
|
|
208
219
|
},
|
|
209
220
|
matrixParams: {
|
|
210
221
|
...e.matrixParams,
|
|
@@ -336,230 +347,230 @@ const Ut = "CHANGE_PAGE", xt = "CHANGE_ROWS", Mt = "CHANGE_SORT", Ft = "CHANGE_S
|
|
|
336
347
|
return e;
|
|
337
348
|
}
|
|
338
349
|
};
|
|
339
|
-
function Kt(e) {
|
|
340
|
-
const
|
|
350
|
+
function Kt(e, t = !1) {
|
|
351
|
+
const r = Xt(e, t), [n, o] = fe(zt, r), s = ({ target: { value: E } } = {}) => o({
|
|
341
352
|
type: M.CHANGE_ROWS,
|
|
342
|
-
rowsPerPage:
|
|
343
|
-
}),
|
|
353
|
+
rowsPerPage: E
|
|
354
|
+
}), a = ({ page: E }) => o({
|
|
344
355
|
type: M.CHANGE_PAGE,
|
|
345
|
-
page:
|
|
346
|
-
}),
|
|
356
|
+
page: E
|
|
357
|
+
}), i = (E, S, R) => o({
|
|
347
358
|
type: M.CHANGE_SORT,
|
|
348
|
-
field:
|
|
349
|
-
order:
|
|
350
|
-
}),
|
|
351
|
-
(
|
|
359
|
+
field: S,
|
|
360
|
+
order: R
|
|
361
|
+
}), d = v(
|
|
362
|
+
(E) => o({
|
|
352
363
|
type: M.CHANGE_SEARCHTEXT,
|
|
353
|
-
value:
|
|
364
|
+
value: E
|
|
354
365
|
}),
|
|
355
366
|
[]
|
|
356
|
-
),
|
|
357
|
-
(
|
|
367
|
+
), u = v(
|
|
368
|
+
(E, S) => o({
|
|
358
369
|
type: M.CHANGE_ITEMSEARCHDOCUMENT,
|
|
359
|
-
itemSearchDocument:
|
|
360
|
-
page:
|
|
370
|
+
itemSearchDocument: E,
|
|
371
|
+
page: S
|
|
361
372
|
}),
|
|
362
373
|
[]
|
|
363
|
-
),
|
|
364
|
-
(
|
|
374
|
+
), c = v(
|
|
375
|
+
(E) => o({
|
|
365
376
|
type: M.CHANGE_QUERYPARAMS,
|
|
366
|
-
queryParams:
|
|
377
|
+
queryParams: E
|
|
367
378
|
}),
|
|
368
379
|
[]
|
|
369
|
-
),
|
|
370
|
-
(
|
|
380
|
+
), m = v(
|
|
381
|
+
(E) => o({
|
|
371
382
|
type: M.CHANGE_MATRIXPARAMS,
|
|
372
|
-
matrixParams:
|
|
383
|
+
matrixParams: E
|
|
373
384
|
}),
|
|
374
385
|
[]
|
|
375
|
-
), p =
|
|
376
|
-
(
|
|
386
|
+
), p = v(
|
|
387
|
+
(E) => o({
|
|
377
388
|
type: M.CHANGE_SEARCHFIELD,
|
|
378
|
-
field:
|
|
389
|
+
field: E
|
|
379
390
|
}),
|
|
380
391
|
[]
|
|
381
|
-
),
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
}, []),
|
|
385
|
-
(
|
|
392
|
+
), l = v((E) => {
|
|
393
|
+
const S = E.map(({ name: R }) => ({ field: R, count: !0 }));
|
|
394
|
+
o({ type: M.CHANGE_SEARCHFIELDFACET, field: E, facet: S });
|
|
395
|
+
}, []), h = v(
|
|
396
|
+
(E) => o({
|
|
386
397
|
type: M.CHANGE_SEARCHFILTER,
|
|
387
|
-
filter:
|
|
398
|
+
filter: E
|
|
388
399
|
}),
|
|
389
400
|
[]
|
|
390
|
-
),
|
|
391
|
-
(
|
|
392
|
-
const
|
|
393
|
-
name:
|
|
394
|
-
field:
|
|
401
|
+
), f = v(
|
|
402
|
+
(E) => {
|
|
403
|
+
const R = E.reduce((y, { field: N = [] }) => y.concat(N), []).map(({ name: y }) => ({
|
|
404
|
+
name: y,
|
|
405
|
+
field: y,
|
|
395
406
|
count: !0,
|
|
396
|
-
exclude: [
|
|
407
|
+
exclude: [y]
|
|
397
408
|
}));
|
|
398
|
-
|
|
409
|
+
o({ type: M.CHANGE_SEARCHFILTERFACET, filter: E, facet: R });
|
|
399
410
|
},
|
|
400
|
-
[
|
|
401
|
-
),
|
|
402
|
-
(
|
|
403
|
-
|
|
411
|
+
[o]
|
|
412
|
+
), A = v(
|
|
413
|
+
(E) => {
|
|
414
|
+
o({ type: M.CHANGE_FACET, facet: E });
|
|
404
415
|
},
|
|
405
|
-
[
|
|
406
|
-
), C =
|
|
407
|
-
(
|
|
416
|
+
[o]
|
|
417
|
+
), C = v(
|
|
418
|
+
(E) => o({
|
|
408
419
|
type: M.CHANGE_PARENT_COLLECTION,
|
|
409
|
-
value:
|
|
420
|
+
value: E
|
|
410
421
|
}),
|
|
411
422
|
[]
|
|
412
|
-
),
|
|
413
|
-
|
|
423
|
+
), P = v((E) => {
|
|
424
|
+
o({ type: M.CHANGE_SUGGESTION, suggestion: E });
|
|
414
425
|
}, []);
|
|
415
426
|
return {
|
|
416
427
|
state: n,
|
|
417
|
-
onChangeRowsPerPage:
|
|
418
|
-
onChangePage:
|
|
419
|
-
onChangeSort:
|
|
420
|
-
setSearchText:
|
|
428
|
+
onChangeRowsPerPage: s,
|
|
429
|
+
onChangePage: a,
|
|
430
|
+
onChangeSort: i,
|
|
431
|
+
setSearchText: d,
|
|
421
432
|
setSearchField: p,
|
|
422
|
-
setSearchFieldFacet:
|
|
423
|
-
setSearchFilter:
|
|
424
|
-
setSearchFilterFacet:
|
|
425
|
-
setFacet:
|
|
426
|
-
setItemSearchDocument:
|
|
427
|
-
setQueryParams:
|
|
428
|
-
setMatrixParams:
|
|
433
|
+
setSearchFieldFacet: l,
|
|
434
|
+
setSearchFilter: h,
|
|
435
|
+
setSearchFilterFacet: f,
|
|
436
|
+
setFacet: A,
|
|
437
|
+
setItemSearchDocument: u,
|
|
438
|
+
setQueryParams: c,
|
|
439
|
+
setMatrixParams: m,
|
|
429
440
|
setParentCollection: C,
|
|
430
|
-
setSuggestion:
|
|
441
|
+
setSuggestion: P
|
|
431
442
|
};
|
|
432
443
|
}
|
|
433
444
|
function xe(e, t) {
|
|
434
|
-
const
|
|
445
|
+
const r = z(!1);
|
|
435
446
|
$(() => {
|
|
436
|
-
|
|
447
|
+
r.current ? e() : r.current = !0;
|
|
437
448
|
}, t);
|
|
438
449
|
}
|
|
439
450
|
const Zt = ({
|
|
440
451
|
field: e = void 0,
|
|
441
452
|
text: t = "",
|
|
442
|
-
maximumSuggestions:
|
|
453
|
+
maximumSuggestions: r = 10
|
|
443
454
|
} = {}) => ({
|
|
444
455
|
field: e,
|
|
445
456
|
text: t,
|
|
446
|
-
maximumSuggestions:
|
|
457
|
+
maximumSuggestions: r
|
|
447
458
|
});
|
|
448
|
-
function
|
|
449
|
-
const t = Zt(e), [
|
|
450
|
-
|
|
451
|
-
}, []), s =
|
|
452
|
-
|
|
453
|
-
}, []), a =
|
|
454
|
-
|
|
455
|
-
}, []), { request: i, data: { suggestion:
|
|
459
|
+
function xr(e) {
|
|
460
|
+
const t = Zt(e), [r, n] = x(t), o = v((u, c = "") => {
|
|
461
|
+
n((m) => ({ ...m, field: u, text: c }));
|
|
462
|
+
}, []), s = v((u) => {
|
|
463
|
+
n((c) => ({ ...c, text: u }));
|
|
464
|
+
}, []), a = v((u) => {
|
|
465
|
+
n((c) => ({ ...c, maximumSuggestions: u }));
|
|
466
|
+
}, []), { request: i, data: { suggestion: d = [] } = {} } = j(
|
|
456
467
|
Ue.searchAutoComplete
|
|
457
468
|
);
|
|
458
469
|
return xe(() => {
|
|
459
|
-
i({ autocompleteRequestDocument:
|
|
460
|
-
}, [
|
|
461
|
-
suggestions:
|
|
470
|
+
i({ autocompleteRequestDocument: r });
|
|
471
|
+
}, [r]), {
|
|
472
|
+
suggestions: d,
|
|
462
473
|
setAutocompleteField: o,
|
|
463
474
|
setAutocompleteText: s,
|
|
464
475
|
setAutocompleteMaxSuggestions: a
|
|
465
476
|
};
|
|
466
477
|
}
|
|
467
|
-
const
|
|
478
|
+
const en = ({
|
|
468
479
|
field: e = void 0,
|
|
469
480
|
text: t = "",
|
|
470
|
-
maximumSuggestions:
|
|
481
|
+
maximumSuggestions: r = 10
|
|
471
482
|
} = {}) => ({
|
|
472
483
|
field: e,
|
|
473
484
|
text: t,
|
|
474
|
-
maximumSuggestions:
|
|
485
|
+
maximumSuggestions: r
|
|
475
486
|
});
|
|
476
|
-
function
|
|
477
|
-
const t =
|
|
478
|
-
s(
|
|
479
|
-
}, []), i =
|
|
480
|
-
|
|
481
|
-
}, []),
|
|
482
|
-
|
|
483
|
-
}, []), u =
|
|
484
|
-
|
|
485
|
-
}, []), { request: c, data: { suggestion:
|
|
487
|
+
function Mr(e) {
|
|
488
|
+
const t = en(e), [r, n] = x(t), [o, s] = x("NESTED"), a = v((p = "NESTED") => {
|
|
489
|
+
s(p);
|
|
490
|
+
}, []), i = v((p, l = "") => {
|
|
491
|
+
n((h) => ({ ...h, field: p, text: l }));
|
|
492
|
+
}, []), d = v((p) => {
|
|
493
|
+
n((l) => ({ ...l, text: p }));
|
|
494
|
+
}, []), u = v((p) => {
|
|
495
|
+
n((l) => ({ ...l, maximumSuggestions: p }));
|
|
496
|
+
}, []), { request: c, data: { suggestion: m = [] } = {} } = j(
|
|
486
497
|
Ue.searchAutoComplete
|
|
487
498
|
);
|
|
488
499
|
return xe(() => {
|
|
489
500
|
c({
|
|
490
|
-
autocompleteRequestDocument:
|
|
501
|
+
autocompleteRequestDocument: r,
|
|
491
502
|
path: `/API/search2/autocomplete?searchLang=${o}`
|
|
492
503
|
});
|
|
493
|
-
}, [
|
|
494
|
-
suggestions:
|
|
504
|
+
}, [r, o]), {
|
|
505
|
+
suggestions: m,
|
|
495
506
|
setAutocompleteField: i,
|
|
496
|
-
setAutocompleteText:
|
|
507
|
+
setAutocompleteText: d,
|
|
497
508
|
setAutocompleteMaxSuggestions: u,
|
|
498
509
|
setAutocompleteLanguage: a
|
|
499
510
|
};
|
|
500
511
|
}
|
|
501
|
-
const
|
|
502
|
-
const [
|
|
512
|
+
const Fr = (e = "id", t = []) => {
|
|
513
|
+
const [r, n] = x(t);
|
|
503
514
|
return {
|
|
504
|
-
selected:
|
|
505
|
-
onSelect: (i,
|
|
506
|
-
const c = u[e],
|
|
507
|
-
if (
|
|
508
|
-
|
|
509
|
-
else if (
|
|
510
|
-
const
|
|
511
|
-
|
|
515
|
+
selected: r,
|
|
516
|
+
onSelect: (i, d, u) => {
|
|
517
|
+
const c = u[e], m = r.findIndex((p) => p[e] === c);
|
|
518
|
+
if (m === -1 && d === !0)
|
|
519
|
+
d === !0 && n([...r, u]);
|
|
520
|
+
else if (m > -1 && d === !1) {
|
|
521
|
+
const p = [...r];
|
|
522
|
+
p.splice(m, 1), n(p);
|
|
512
523
|
}
|
|
513
524
|
},
|
|
514
|
-
onClear: () =>
|
|
525
|
+
onClear: () => n([]),
|
|
515
526
|
isSelected: (i) => {
|
|
516
|
-
const
|
|
517
|
-
return
|
|
527
|
+
const d = i[e];
|
|
528
|
+
return r.findIndex((c) => c[e] === d) > -1;
|
|
518
529
|
}
|
|
519
530
|
};
|
|
520
|
-
},
|
|
521
|
-
const [t,
|
|
522
|
-
return { activeTab: t, changeTab: (o, s) =>
|
|
531
|
+
}, qr = (e) => {
|
|
532
|
+
const [t, r] = x(e);
|
|
533
|
+
return { activeTab: t, changeTab: (o, s) => r(s) };
|
|
523
534
|
};
|
|
524
|
-
function $
|
|
525
|
-
const
|
|
535
|
+
function $r(e, t) {
|
|
536
|
+
const r = z();
|
|
526
537
|
$(() => {
|
|
527
|
-
|
|
538
|
+
r.current = e;
|
|
528
539
|
}, [e]), $(() => {
|
|
529
|
-
const o = setInterval(() =>
|
|
540
|
+
const o = setInterval(() => r.current(), t);
|
|
530
541
|
return () => clearInterval(o);
|
|
531
542
|
}, [t]);
|
|
532
543
|
}
|
|
533
|
-
function
|
|
534
|
-
const t = z(),
|
|
544
|
+
function jr(e = []) {
|
|
545
|
+
const t = z(), r = he(() => Math.floor(e.length / 2), [e]), [n, o] = x(), s = z(n);
|
|
535
546
|
if ($(() => () => t.current && clearInterval(t.current), []), e.length === 0)
|
|
536
547
|
return { width: 0 };
|
|
537
|
-
s.current =
|
|
548
|
+
s.current = n;
|
|
538
549
|
const a = () => {
|
|
539
|
-
const
|
|
550
|
+
const m = () => {
|
|
540
551
|
s.current === void 0 ? o(0) : s.current === e.length - 1 ? clearInterval(t.current) : o(s.current + 1);
|
|
541
552
|
};
|
|
542
|
-
t.current = setInterval(
|
|
553
|
+
t.current = setInterval(m, 500);
|
|
543
554
|
}, i = () => {
|
|
544
555
|
o(), clearInterval(t.current);
|
|
545
|
-
},
|
|
556
|
+
}, d = e[n === void 0 ? r : n], u = n === void 0 ? 0 : `${Math.floor(n / (e.length - 1) * 100)}%`;
|
|
546
557
|
return {
|
|
547
|
-
imageSrc:
|
|
558
|
+
imageSrc: d,
|
|
548
559
|
onMouseEnter: a,
|
|
549
560
|
onMouseLeave: i,
|
|
550
561
|
width: u
|
|
551
562
|
};
|
|
552
563
|
}
|
|
553
|
-
const
|
|
554
|
-
CHANGE_PAGE:
|
|
555
|
-
CHANGE_ROWS:
|
|
556
|
-
CHANGE_SORT:
|
|
557
|
-
CHANGE_TYPE:
|
|
558
|
-
CHANGE_STATE:
|
|
559
|
-
CHANGE_PRIORITY:
|
|
560
|
-
CHANGE_STARTTIME:
|
|
561
|
-
CHANGE_FINISHTIME:
|
|
562
|
-
},
|
|
564
|
+
const tn = "CHANGE_PAGE", nn = "CHANGE_ROWS", rn = "CHANGE_SORT", on = "CHANGE_TYPE", sn = "CHANGE_STATE", an = "CHANGE_PRIORITY", cn = "CHANGE_STARTTIME", un = "CHANGE_FINISHTIME", Y = {
|
|
565
|
+
CHANGE_PAGE: tn,
|
|
566
|
+
CHANGE_ROWS: nn,
|
|
567
|
+
CHANGE_SORT: rn,
|
|
568
|
+
CHANGE_TYPE: on,
|
|
569
|
+
CHANGE_STATE: sn,
|
|
570
|
+
CHANGE_PRIORITY: an,
|
|
571
|
+
CHANGE_STARTTIME: cn,
|
|
572
|
+
CHANGE_FINISHTIME: un
|
|
573
|
+
}, ln = ({ queryParams: e = {}, matrixParams: t = {} } = {}) => ({
|
|
563
574
|
queryParams: e,
|
|
564
575
|
matrixParams: {
|
|
565
576
|
first: 1,
|
|
@@ -569,9 +580,9 @@ const tr = "CHANGE_PAGE", rr = "CHANGE_ROWS", nr = "CHANGE_SORT", or = "CHANGE_T
|
|
|
569
580
|
rowsPerPage: 10,
|
|
570
581
|
page: 0,
|
|
571
582
|
jobMetadata: []
|
|
572
|
-
}),
|
|
573
|
-
const { type:
|
|
574
|
-
switch (
|
|
583
|
+
}), dn = (e, t) => {
|
|
584
|
+
const { type: r, ...n } = t;
|
|
585
|
+
switch (r) {
|
|
575
586
|
case Y.CHANGE_PAGE: {
|
|
576
587
|
const { page: o = 0 } = t, { rowsPerPage: s = 10 } = e;
|
|
577
588
|
return {
|
|
@@ -611,7 +622,7 @@ const tr = "CHANGE_PAGE", rr = "CHANGE_ROWS", nr = "CHANGE_SORT", or = "CHANGE_T
|
|
|
611
622
|
case Y.CHANGE_TYPE:
|
|
612
623
|
case Y.CHANGE_STATE:
|
|
613
624
|
case Y.CHANGE_PRIORITY: {
|
|
614
|
-
const { field: o, value: s = [] } =
|
|
625
|
+
const { field: o, value: s = [] } = n;
|
|
615
626
|
let a;
|
|
616
627
|
if (s)
|
|
617
628
|
a = {
|
|
@@ -620,8 +631,8 @@ const tr = "CHANGE_PAGE", rr = "CHANGE_ROWS", nr = "CHANGE_SORT", or = "CHANGE_T
|
|
|
620
631
|
[o]: Array.isArray(s) ? s.join(",") : s
|
|
621
632
|
};
|
|
622
633
|
else {
|
|
623
|
-
const { [o]: i, ...
|
|
624
|
-
a = { ...
|
|
634
|
+
const { [o]: i, ...d } = e.matrixParams;
|
|
635
|
+
a = { ...d, first: 1 };
|
|
625
636
|
}
|
|
626
637
|
return {
|
|
627
638
|
...e,
|
|
@@ -631,7 +642,7 @@ const tr = "CHANGE_PAGE", rr = "CHANGE_ROWS", nr = "CHANGE_SORT", or = "CHANGE_T
|
|
|
631
642
|
}
|
|
632
643
|
case Y.CHANGE_STARTTIME:
|
|
633
644
|
case Y.CHANGE_FINISHTIME: {
|
|
634
|
-
const { field: o, value: s = [] } =
|
|
645
|
+
const { field: o, value: s = [] } = n;
|
|
635
646
|
let a;
|
|
636
647
|
if (s)
|
|
637
648
|
a = {
|
|
@@ -640,8 +651,8 @@ const tr = "CHANGE_PAGE", rr = "CHANGE_ROWS", nr = "CHANGE_SORT", or = "CHANGE_T
|
|
|
640
651
|
[o]: s
|
|
641
652
|
};
|
|
642
653
|
else {
|
|
643
|
-
const { [o]: i, ...
|
|
644
|
-
a = { ...
|
|
654
|
+
const { [o]: i, ...d } = e.queryParams;
|
|
655
|
+
a = { ...d, first: 1 };
|
|
645
656
|
}
|
|
646
657
|
return {
|
|
647
658
|
...e,
|
|
@@ -650,7 +661,7 @@ const tr = "CHANGE_PAGE", rr = "CHANGE_ROWS", nr = "CHANGE_SORT", or = "CHANGE_T
|
|
|
650
661
|
};
|
|
651
662
|
}
|
|
652
663
|
case Y.CHANGE_JOBMETADATA: {
|
|
653
|
-
const { field: o, value: s = [] } =
|
|
664
|
+
const { field: o, value: s = [] } = n;
|
|
654
665
|
let a;
|
|
655
666
|
if (s.length)
|
|
656
667
|
a = {
|
|
@@ -659,8 +670,8 @@ const tr = "CHANGE_PAGE", rr = "CHANGE_ROWS", nr = "CHANGE_SORT", or = "CHANGE_T
|
|
|
659
670
|
[o]: s
|
|
660
671
|
};
|
|
661
672
|
else {
|
|
662
|
-
const { [o]: i, ...
|
|
663
|
-
a = { ...
|
|
673
|
+
const { [o]: i, ...d } = e.queryParams;
|
|
674
|
+
a = { ...d, first: 1 };
|
|
664
675
|
}
|
|
665
676
|
return {
|
|
666
677
|
...e,
|
|
@@ -673,82 +684,82 @@ const tr = "CHANGE_PAGE", rr = "CHANGE_ROWS", nr = "CHANGE_SORT", or = "CHANGE_T
|
|
|
673
684
|
return e;
|
|
674
685
|
}
|
|
675
686
|
};
|
|
676
|
-
function
|
|
677
|
-
const t =
|
|
687
|
+
function Wr(e) {
|
|
688
|
+
const t = ln(e), [r, n] = fe(dn, t);
|
|
678
689
|
return {
|
|
679
|
-
state:
|
|
680
|
-
onChangePage: ({ page:
|
|
690
|
+
state: r,
|
|
691
|
+
onChangePage: ({ page: l }) => n({
|
|
681
692
|
type: Y.CHANGE_PAGE,
|
|
682
|
-
page:
|
|
693
|
+
page: l
|
|
683
694
|
}),
|
|
684
|
-
onChangeSort: (
|
|
685
|
-
const
|
|
686
|
-
|
|
695
|
+
onChangeSort: (l, h, f) => {
|
|
696
|
+
const A = typeof h == "object" ? h.value : h;
|
|
697
|
+
n({
|
|
687
698
|
type: Y.CHANGE_SORT,
|
|
688
|
-
field:
|
|
689
|
-
order:
|
|
699
|
+
field: A,
|
|
700
|
+
order: f
|
|
690
701
|
});
|
|
691
702
|
},
|
|
692
|
-
onChangeType: ({ field:
|
|
693
|
-
const [{ name: h = "type", value:
|
|
694
|
-
|
|
703
|
+
onChangeType: ({ field: l = [] }) => {
|
|
704
|
+
const [{ name: h = "type", value: f = [] }] = l;
|
|
705
|
+
n({
|
|
695
706
|
type: Y.CHANGE_TYPE,
|
|
696
707
|
field: h,
|
|
697
|
-
value:
|
|
708
|
+
value: f.length ? f[0].value : null
|
|
698
709
|
});
|
|
699
710
|
},
|
|
700
|
-
onChangeState: ({ field:
|
|
701
|
-
const [{ name: h = "state", value:
|
|
702
|
-
|
|
711
|
+
onChangeState: ({ field: l = [] }) => {
|
|
712
|
+
const [{ name: h = "state", value: f = [] }] = l;
|
|
713
|
+
n({
|
|
703
714
|
type: Y.CHANGE_STATE,
|
|
704
715
|
field: h,
|
|
705
|
-
value:
|
|
716
|
+
value: f.length ? f[0].value : null
|
|
706
717
|
});
|
|
707
718
|
},
|
|
708
|
-
onChangePriority: ({ field:
|
|
709
|
-
const [{ name: h = "priority", value:
|
|
710
|
-
|
|
719
|
+
onChangePriority: ({ field: l = [] }) => {
|
|
720
|
+
const [{ name: h = "priority", value: f = [] }] = l;
|
|
721
|
+
n({
|
|
711
722
|
type: Y.CHANGE_PRIORITY,
|
|
712
723
|
field: h,
|
|
713
|
-
value:
|
|
724
|
+
value: f.length ? f[0].value : null
|
|
714
725
|
});
|
|
715
726
|
},
|
|
716
|
-
onChangeStarttime: ({ field:
|
|
717
|
-
const [{ name: h = "starttime-from", value:
|
|
718
|
-
|
|
727
|
+
onChangeStarttime: ({ field: l = [] }) => {
|
|
728
|
+
const [{ name: h = "starttime-from", value: f = [] }] = l;
|
|
729
|
+
n({
|
|
719
730
|
type: Y.CHANGE_STARTTIME,
|
|
720
731
|
field: h,
|
|
721
|
-
value:
|
|
732
|
+
value: f.length ? f[0].value : null
|
|
722
733
|
});
|
|
723
734
|
},
|
|
724
|
-
onChangeFinishtime: ({ field:
|
|
725
|
-
const [{ name: h = "finishtime-from", value:
|
|
726
|
-
|
|
735
|
+
onChangeFinishtime: ({ field: l = [] }) => {
|
|
736
|
+
const [{ name: h = "finishtime-from", value: f = [] }] = l;
|
|
737
|
+
n({
|
|
727
738
|
type: Y.CHANGE_FINISHTIME,
|
|
728
739
|
field: h,
|
|
729
|
-
value:
|
|
740
|
+
value: f.length ? f[0].value : null
|
|
730
741
|
});
|
|
731
742
|
},
|
|
732
|
-
onChangeRowsPerPage: ({ target: { value:
|
|
743
|
+
onChangeRowsPerPage: ({ target: { value: l } } = {}) => n({
|
|
733
744
|
type: Y.CHANGE_ROWS,
|
|
734
|
-
rowsPerPage:
|
|
745
|
+
rowsPerPage: l
|
|
735
746
|
}),
|
|
736
|
-
onChangeJobmetadata: (
|
|
737
|
-
|
|
747
|
+
onChangeJobmetadata: (l) => {
|
|
748
|
+
n({
|
|
738
749
|
type: Y.CHANGE_JOBMETADATA,
|
|
739
750
|
field: "jobmetadata",
|
|
740
|
-
value:
|
|
751
|
+
value: l
|
|
741
752
|
});
|
|
742
753
|
}
|
|
743
754
|
};
|
|
744
755
|
}
|
|
745
|
-
const
|
|
746
|
-
const [
|
|
756
|
+
const Vr = (e, t) => {
|
|
757
|
+
const [r, n] = x(
|
|
747
758
|
JSON.parse(window.localStorage.getItem(e) || JSON.stringify(t))
|
|
748
759
|
);
|
|
749
760
|
return $(() => {
|
|
750
|
-
window.localStorage.setItem(e, JSON.stringify(
|
|
751
|
-
}, [e,
|
|
761
|
+
window.localStorage.setItem(e, JSON.stringify(r));
|
|
762
|
+
}, [e, r]), [r, n, () => JSON.parse(window.localStorage.getItem(e))];
|
|
752
763
|
};
|
|
753
764
|
function at() {
|
|
754
765
|
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(
|
|
@@ -759,233 +770,233 @@ function at() {
|
|
|
759
770
|
)
|
|
760
771
|
);
|
|
761
772
|
}
|
|
762
|
-
function
|
|
773
|
+
function fn(e) {
|
|
763
774
|
return wt(e);
|
|
764
775
|
}
|
|
765
|
-
function
|
|
776
|
+
function mn(e) {
|
|
766
777
|
return e.slice(-1) === "=" ? decodeURIComponent(
|
|
767
778
|
atob(e).split("").map((t) => `%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")
|
|
768
779
|
) : Dt(e);
|
|
769
780
|
}
|
|
770
|
-
const
|
|
781
|
+
const pn = ["__mp3_160k"], hn = ["__mp4"], En = ["__png"], gn = "audio", yn = "video", An = "image", Sn = ["application/mxf"], Cn = [], vn = [], Tn = (e) => {
|
|
771
782
|
if (!e || !e.type)
|
|
772
783
|
return [];
|
|
773
784
|
const t = e.type.toLowerCase();
|
|
774
|
-
return t.startsWith(
|
|
775
|
-
},
|
|
785
|
+
return t.startsWith(gn) || vn.includes(t) ? pn : t.startsWith(yn) || Sn.includes(t) ? hn : t.startsWith(An) || Cn.includes(t) ? En : [];
|
|
786
|
+
}, Rn = (e, t = {}) => new Promise((r, n) => {
|
|
776
787
|
const o = new Rt(), s = new Pt(e, {
|
|
777
|
-
onFail: (a) =>
|
|
778
|
-
onComplete: (a) =>
|
|
788
|
+
onFail: (a) => n(a),
|
|
789
|
+
onComplete: (a) => r(a),
|
|
779
790
|
...t
|
|
780
791
|
});
|
|
781
792
|
o.addChunkedUpload(s), o.upload();
|
|
782
|
-
}),
|
|
793
|
+
}), Pn = ({
|
|
783
794
|
file: e,
|
|
784
795
|
collectionId: t,
|
|
785
|
-
onProgress:
|
|
786
|
-
metadata:
|
|
796
|
+
onProgress: r,
|
|
797
|
+
metadata: n = {},
|
|
787
798
|
placeholderParams: o = {},
|
|
788
799
|
importParams: s = {},
|
|
789
800
|
chunkedUploadProps: a = {},
|
|
790
801
|
generateTransferId: i = at,
|
|
791
|
-
getShapeTags:
|
|
802
|
+
getShapeTags: d = Tn
|
|
792
803
|
}) => new Promise((u, c) => {
|
|
793
804
|
try {
|
|
794
|
-
let
|
|
795
|
-
|
|
796
|
-
const
|
|
797
|
-
originalFilename:
|
|
805
|
+
let m;
|
|
806
|
+
r({});
|
|
807
|
+
const p = d(e), l = e.name, h = e.type, [f] = h.split("/"), A = {
|
|
808
|
+
originalFilename: l,
|
|
798
809
|
mimeType: h,
|
|
799
|
-
mediaType:
|
|
800
|
-
...
|
|
801
|
-
},
|
|
810
|
+
mediaType: f,
|
|
811
|
+
...n
|
|
812
|
+
}, C = de(A);
|
|
802
813
|
qe.createImportPlaceholder({
|
|
803
|
-
metadataDocument:
|
|
814
|
+
metadataDocument: C,
|
|
804
815
|
queryParams: {
|
|
805
816
|
container: 1,
|
|
806
817
|
...o
|
|
807
818
|
}
|
|
808
|
-
}).then(({ data:
|
|
809
|
-
if (
|
|
819
|
+
}).then(({ data: P }) => {
|
|
820
|
+
if (m = P.id, !t)
|
|
810
821
|
return Promise.resolve();
|
|
811
|
-
const
|
|
822
|
+
const E = Array.isArray(t) ? t : [t];
|
|
812
823
|
return Promise.all(
|
|
813
|
-
|
|
824
|
+
E.map(
|
|
814
825
|
(S) => k.addCollectionEntity({
|
|
815
826
|
collectionId: S,
|
|
816
|
-
entityId:
|
|
827
|
+
entityId: m
|
|
817
828
|
})
|
|
818
829
|
)
|
|
819
830
|
);
|
|
820
831
|
}).then(() => {
|
|
821
|
-
const
|
|
822
|
-
filename:
|
|
823
|
-
transferId:
|
|
824
|
-
tag:
|
|
832
|
+
const P = i(), E = {
|
|
833
|
+
filename: l,
|
|
834
|
+
transferId: P,
|
|
835
|
+
tag: p,
|
|
825
836
|
...s
|
|
826
837
|
};
|
|
827
|
-
return
|
|
838
|
+
return Rn(e, {
|
|
828
839
|
api: {
|
|
829
840
|
method: qe.createImportComponentRaw,
|
|
830
841
|
props: {
|
|
831
|
-
itemId:
|
|
842
|
+
itemId: m,
|
|
832
843
|
component: "container",
|
|
833
|
-
queryParams:
|
|
844
|
+
queryParams: E
|
|
834
845
|
}
|
|
835
846
|
},
|
|
836
|
-
onProgress:
|
|
847
|
+
onProgress: r,
|
|
837
848
|
...a
|
|
838
849
|
});
|
|
839
|
-
}).then((
|
|
840
|
-
u({ ...
|
|
841
|
-
}).catch((
|
|
842
|
-
} catch (
|
|
843
|
-
console.error(
|
|
850
|
+
}).then((P) => {
|
|
851
|
+
u({ ...P, itemId: m, collectionId: t });
|
|
852
|
+
}).catch((P) => c(P));
|
|
853
|
+
} catch (m) {
|
|
854
|
+
console.error(m), c(m);
|
|
844
855
|
}
|
|
845
856
|
});
|
|
846
|
-
function
|
|
847
|
-
onUploadFile: e =
|
|
857
|
+
function kr({
|
|
858
|
+
onUploadFile: e = Pn,
|
|
848
859
|
initialMetadata: t = {},
|
|
849
|
-
...
|
|
860
|
+
...r
|
|
850
861
|
}) {
|
|
851
|
-
const [
|
|
862
|
+
const [n, o] = x([]);
|
|
852
863
|
$(
|
|
853
864
|
() => () => {
|
|
854
|
-
|
|
865
|
+
n.forEach((p) => URL.revokeObjectURL(p.preview));
|
|
855
866
|
},
|
|
856
|
-
[
|
|
867
|
+
[n]
|
|
857
868
|
);
|
|
858
|
-
const s =
|
|
859
|
-
(
|
|
860
|
-
const
|
|
869
|
+
const s = v(
|
|
870
|
+
(p = []) => {
|
|
871
|
+
const l = p.map((h) => ({
|
|
861
872
|
file: h,
|
|
862
873
|
metadata: { title: h.name, ...t }
|
|
863
874
|
}));
|
|
864
|
-
o((h) =>
|
|
875
|
+
o((h) => l.concat(h));
|
|
865
876
|
},
|
|
866
877
|
[t]
|
|
867
|
-
), a =
|
|
868
|
-
(
|
|
878
|
+
), a = v(
|
|
879
|
+
(p, l = {}) => {
|
|
869
880
|
o((h) => {
|
|
870
|
-
const
|
|
871
|
-
return
|
|
881
|
+
const f = h[p], { metadata: A, progress: C } = l, { metadata: P = {}, progress: E = {} } = f, S = [...h], R = { ...f };
|
|
882
|
+
return A && (R.metadata = { ...P, ...A }), C && (R.progress = { ...E, ...C }), S[p] = R, S;
|
|
872
883
|
});
|
|
873
884
|
},
|
|
874
885
|
[o]
|
|
875
|
-
), i =
|
|
876
|
-
(
|
|
877
|
-
a(
|
|
886
|
+
), i = v(
|
|
887
|
+
(p) => (l = {}) => {
|
|
888
|
+
a(p, { progress: l });
|
|
878
889
|
},
|
|
879
890
|
[a]
|
|
880
|
-
),
|
|
881
|
-
(
|
|
882
|
-
a(
|
|
891
|
+
), d = v(
|
|
892
|
+
(p) => (l = {}) => {
|
|
893
|
+
a(p, { metadata: l });
|
|
883
894
|
},
|
|
884
895
|
[a]
|
|
885
|
-
), u =
|
|
886
|
-
(
|
|
887
|
-
(
|
|
896
|
+
), u = v(
|
|
897
|
+
(p) => n.reduce(
|
|
898
|
+
(l, h, f) => l.then((A) => h.progress ? l : e({
|
|
888
899
|
file: h.file,
|
|
889
|
-
onProgress: i(
|
|
900
|
+
onProgress: i(f),
|
|
890
901
|
metadata: h.metadata,
|
|
891
|
-
...
|
|
892
|
-
...
|
|
893
|
-
}).then((
|
|
902
|
+
...p,
|
|
903
|
+
...r
|
|
904
|
+
}).then((C) => [...A, C])),
|
|
894
905
|
Promise.resolve([])
|
|
895
906
|
),
|
|
896
|
-
[
|
|
897
|
-
), c =
|
|
898
|
-
(
|
|
899
|
-
o([...
|
|
907
|
+
[n, e, i, r]
|
|
908
|
+
), c = v(
|
|
909
|
+
(p) => () => {
|
|
910
|
+
o([...n].filter((l, h) => h !== p));
|
|
900
911
|
},
|
|
901
|
-
[o,
|
|
902
|
-
),
|
|
903
|
-
(
|
|
904
|
-
o([...
|
|
912
|
+
[o, n]
|
|
913
|
+
), m = v(
|
|
914
|
+
(p) => () => {
|
|
915
|
+
o([...n].filter((l, h) => !p.includes(h)));
|
|
905
916
|
},
|
|
906
|
-
[o,
|
|
917
|
+
[o, n]
|
|
907
918
|
);
|
|
908
919
|
return {
|
|
909
920
|
onAddFiles: s,
|
|
910
921
|
onChangeFile: a,
|
|
911
|
-
onChangeMetadata:
|
|
922
|
+
onChangeMetadata: d,
|
|
912
923
|
onUpload: u,
|
|
913
924
|
onRemoveFile: c,
|
|
914
|
-
onRemoveFiles:
|
|
915
|
-
files:
|
|
925
|
+
onRemoveFiles: m,
|
|
926
|
+
files: n,
|
|
916
927
|
setFiles: o
|
|
917
928
|
};
|
|
918
929
|
}
|
|
919
|
-
function
|
|
930
|
+
function Yr({
|
|
920
931
|
history: e,
|
|
921
932
|
navigate: t,
|
|
922
|
-
location:
|
|
923
|
-
queryName:
|
|
933
|
+
location: r,
|
|
934
|
+
queryName: n = "q",
|
|
924
935
|
defaultState: o = void 0
|
|
925
936
|
}) {
|
|
926
937
|
const s = z(o);
|
|
927
938
|
return { queryInitialState: he(() => {
|
|
928
|
-
const { location: i =
|
|
939
|
+
const { location: i = r } = e || {}, u = new URLSearchParams(i.search).get(n);
|
|
929
940
|
if (!u)
|
|
930
941
|
return s.current;
|
|
931
942
|
try {
|
|
932
|
-
const c =
|
|
943
|
+
const c = mn(u);
|
|
933
944
|
return JSON.parse(c);
|
|
934
945
|
} catch {
|
|
935
946
|
e ? e.replace({ pathName: e.location.pathName, search: "" }) : t && t(i.pathName, { replace: !0 });
|
|
936
947
|
}
|
|
937
|
-
}, [e, t,
|
|
948
|
+
}, [e, t, r, n]) };
|
|
938
949
|
}
|
|
939
|
-
function
|
|
950
|
+
function Br({
|
|
940
951
|
history: e,
|
|
941
952
|
navigate: t,
|
|
942
|
-
location:
|
|
943
|
-
state:
|
|
953
|
+
location: r,
|
|
954
|
+
state: n,
|
|
944
955
|
queryName: o = "q"
|
|
945
956
|
}) {
|
|
946
|
-
const s =
|
|
947
|
-
const { location: a =
|
|
957
|
+
const s = v(() => {
|
|
958
|
+
const { location: a = r } = e || {}, i = fn(JSON.stringify(n));
|
|
948
959
|
e ? e.replace({
|
|
949
960
|
pathName: a.pathName,
|
|
950
961
|
search: `?${o}=${i}`
|
|
951
962
|
}) : t && t(`${a.pathName}?${o}=${i}`, { replace: !0 });
|
|
952
|
-
}, [e, t,
|
|
963
|
+
}, [e, t, r, o, n]);
|
|
953
964
|
xe(() => {
|
|
954
|
-
s(
|
|
955
|
-
}, [s,
|
|
965
|
+
s(n);
|
|
966
|
+
}, [s, n]);
|
|
956
967
|
}
|
|
957
|
-
const
|
|
968
|
+
const Jr = ({ entityId: e, entityType: t }) => {
|
|
958
969
|
const {
|
|
959
|
-
request:
|
|
960
|
-
data:
|
|
970
|
+
request: r,
|
|
971
|
+
data: n = {},
|
|
961
972
|
isLoading: o
|
|
962
|
-
} = j(Pe.listEntityAccess), s =
|
|
963
|
-
(
|
|
973
|
+
} = j(Pe.listEntityAccess), s = v(
|
|
974
|
+
(d = {}) => r({
|
|
964
975
|
entityId: e,
|
|
965
976
|
entityType: t,
|
|
966
|
-
...
|
|
977
|
+
...d
|
|
967
978
|
}),
|
|
968
979
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
969
980
|
[e, t]
|
|
970
|
-
), a =
|
|
971
|
-
({ accessId:
|
|
972
|
-
accessId:
|
|
981
|
+
), a = v(
|
|
982
|
+
({ accessId: d, ...u }) => Pe.removeEntityAccess({
|
|
983
|
+
accessId: d,
|
|
973
984
|
entityId: e,
|
|
974
985
|
entityType: t,
|
|
975
986
|
...u
|
|
976
987
|
}),
|
|
977
988
|
[e, t]
|
|
978
|
-
), i =
|
|
979
|
-
({ accessControlDocument:
|
|
989
|
+
), i = v(
|
|
990
|
+
({ accessControlDocument: d, ...u }) => Pe.createEntityAccess({
|
|
980
991
|
entityType: t,
|
|
981
992
|
entityId: e,
|
|
982
|
-
accessControlDocument:
|
|
993
|
+
accessControlDocument: d,
|
|
983
994
|
...u
|
|
984
995
|
}),
|
|
985
996
|
[e, t]
|
|
986
997
|
);
|
|
987
998
|
return {
|
|
988
|
-
accessControlList:
|
|
999
|
+
accessControlList: n,
|
|
989
1000
|
isLoading: o,
|
|
990
1001
|
onList: s,
|
|
991
1002
|
onRemove: a,
|
|
@@ -994,150 +1005,150 @@ const Qn = ({ entityId: e, entityType: t }) => {
|
|
|
994
1005
|
}, it = ({ data: e = [] } = {}, t = void 0) => {
|
|
995
1006
|
if (!t)
|
|
996
1007
|
return;
|
|
997
|
-
const { value:
|
|
998
|
-
return
|
|
999
|
-
},
|
|
1008
|
+
const { value: r } = e.find((n) => n.key === t) || {};
|
|
1009
|
+
return r;
|
|
1010
|
+
}, Nn = (e, t) => Object.assign(
|
|
1000
1011
|
{},
|
|
1001
|
-
...t.map((
|
|
1002
|
-
[
|
|
1012
|
+
...t.map((r) => ({
|
|
1013
|
+
[r]: it(e, r)
|
|
1003
1014
|
}))
|
|
1004
|
-
),
|
|
1005
|
-
const
|
|
1006
|
-
if (!
|
|
1015
|
+
), In = ({ values: { field: e } = {} } = {}) => e ? e.map((t) => ({ value: t.value, label: t.key || t.value })) : void 0, _n = (e) => {
|
|
1016
|
+
const r = new DOMParser().parseFromString(e, "application/xml").getElementsByTagName("field");
|
|
1017
|
+
if (!r.length)
|
|
1007
1018
|
return;
|
|
1008
|
-
const
|
|
1009
|
-
for (let o = 0; o <
|
|
1010
|
-
const [s, a] =
|
|
1011
|
-
|
|
1019
|
+
const n = { field: [] };
|
|
1020
|
+
for (let o = 0; o < r.length; o += 1) {
|
|
1021
|
+
const [s, a] = r[o].childNodes;
|
|
1022
|
+
n.field.push({
|
|
1012
1023
|
[s.nodeName]: s.firstChild.nodeValue,
|
|
1013
1024
|
[a.nodeName]: a.firstChild.nodeValue
|
|
1014
1025
|
});
|
|
1015
1026
|
}
|
|
1016
|
-
return
|
|
1017
|
-
},
|
|
1027
|
+
return n;
|
|
1028
|
+
}, Qr = ({
|
|
1018
1029
|
fields: e,
|
|
1019
1030
|
groups: t,
|
|
1020
|
-
getDataAttributes:
|
|
1021
|
-
fieldDataToInclude:
|
|
1031
|
+
getDataAttributes: r = Nn,
|
|
1032
|
+
fieldDataToInclude: n = "label,displayType,required",
|
|
1022
1033
|
groupDataToInclude: o = "label,order",
|
|
1023
1034
|
fieldQueryParams: s = {},
|
|
1024
1035
|
groupQueryParams: a = {},
|
|
1025
1036
|
getAttributes: i = !0
|
|
1026
1037
|
}) => {
|
|
1027
|
-
const [
|
|
1038
|
+
const [d, u] = x(!1), [c, m] = x(e), [p, l] = x(t);
|
|
1028
1039
|
return Z(() => {
|
|
1029
1040
|
let h = !1;
|
|
1030
1041
|
if (i === !1)
|
|
1031
1042
|
return () => {
|
|
1032
1043
|
h = !0;
|
|
1033
1044
|
};
|
|
1034
|
-
const
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
|
|
1045
|
+
const f = (P = [], E = {}) => P.map(({ name: S, ...R }) => {
|
|
1046
|
+
const y = E[S] || {}, { label: N, ..._ } = r(
|
|
1047
|
+
y,
|
|
1048
|
+
n.split(",")
|
|
1038
1049
|
);
|
|
1039
1050
|
return {
|
|
1040
1051
|
name: S,
|
|
1041
1052
|
label: N || S,
|
|
1042
|
-
type:
|
|
1043
|
-
constraint:
|
|
1044
|
-
options:
|
|
1053
|
+
type: y.type,
|
|
1054
|
+
constraint: y.constraint,
|
|
1055
|
+
options: In(y),
|
|
1045
1056
|
..._,
|
|
1046
|
-
...
|
|
1057
|
+
...R
|
|
1047
1058
|
};
|
|
1048
|
-
}),
|
|
1049
|
-
const b =
|
|
1059
|
+
}), A = (P = [], E = {}, S = {}) => P.map(({ name: R, field: y, group: N, ..._ }) => {
|
|
1060
|
+
const b = E[R] || {}, W = y || b && b.field, V = N || b && b.group, { label: J, ...ne } = r(
|
|
1050
1061
|
b,
|
|
1051
1062
|
o.split(",")
|
|
1052
1063
|
);
|
|
1053
1064
|
return {
|
|
1054
|
-
name:
|
|
1055
|
-
label:
|
|
1065
|
+
name: R,
|
|
1066
|
+
label: J || R,
|
|
1056
1067
|
order: it(b, "order"),
|
|
1057
|
-
fields:
|
|
1058
|
-
groups:
|
|
1059
|
-
...
|
|
1068
|
+
fields: f(W, S),
|
|
1069
|
+
groups: A(V, E, S),
|
|
1070
|
+
...ne,
|
|
1060
1071
|
..._
|
|
1061
1072
|
};
|
|
1062
1073
|
});
|
|
1063
|
-
async function
|
|
1074
|
+
async function C() {
|
|
1064
1075
|
u(!0);
|
|
1065
|
-
const
|
|
1076
|
+
const P = {}, E = {};
|
|
1066
1077
|
let S = [];
|
|
1067
1078
|
if (e) {
|
|
1068
|
-
const
|
|
1079
|
+
const y = { ...s, data: n };
|
|
1069
1080
|
S = e.map(async ({ name: N }) => {
|
|
1070
1081
|
try {
|
|
1071
1082
|
const { data: _ } = await Ke.getMetadataField({
|
|
1072
1083
|
fieldName: N,
|
|
1073
|
-
queryParams:
|
|
1084
|
+
queryParams: y
|
|
1074
1085
|
});
|
|
1075
|
-
|
|
1086
|
+
P[N] = _;
|
|
1076
1087
|
} catch {
|
|
1077
1088
|
console.warn(`Could not retrieve attributes for ${N}`);
|
|
1078
1089
|
}
|
|
1079
1090
|
});
|
|
1080
1091
|
}
|
|
1081
|
-
let
|
|
1092
|
+
let R = [];
|
|
1082
1093
|
if (t) {
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1094
|
+
const y = [...t], N = { ...a, data: o };
|
|
1095
|
+
R = y.map(async ({ name: _ }) => {
|
|
1085
1096
|
try {
|
|
1086
1097
|
const { data: b } = await Ze.getFieldGroup({
|
|
1087
1098
|
groupName: _,
|
|
1088
1099
|
queryParams: N
|
|
1089
1100
|
}), { field: W = [], group: V = [] } = b;
|
|
1090
|
-
W.forEach((
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1101
|
+
W.forEach((J) => {
|
|
1102
|
+
const ne = J.data && J.data.find((re) => re.key === "__values");
|
|
1103
|
+
if (ne) {
|
|
1104
|
+
const re = _n(ne.value);
|
|
1105
|
+
P[J.name] = { ...J, values: re };
|
|
1095
1106
|
}
|
|
1096
|
-
}), V.forEach((
|
|
1097
|
-
|
|
1098
|
-
}),
|
|
1107
|
+
}), V.forEach((J) => {
|
|
1108
|
+
y.push(J);
|
|
1109
|
+
}), E[_] = b;
|
|
1099
1110
|
} catch {
|
|
1100
1111
|
console.warn(`Could not retrieve attributes for ${_}`);
|
|
1101
1112
|
}
|
|
1102
1113
|
});
|
|
1103
1114
|
}
|
|
1104
|
-
await Promise.all([...S, ...
|
|
1105
|
-
const
|
|
1115
|
+
await Promise.all([...S, ...R]), h || (Object.values(P).some((y) => y) && m(() => f(e, P)), Object.values(E).some((y) => y) && l(() => {
|
|
1116
|
+
const y = A(
|
|
1106
1117
|
t,
|
|
1107
|
-
|
|
1108
|
-
|
|
1118
|
+
E,
|
|
1119
|
+
P
|
|
1109
1120
|
);
|
|
1110
|
-
return
|
|
1121
|
+
return y.forEach((N) => {
|
|
1111
1122
|
const { order: _ } = N;
|
|
1112
1123
|
_ && N.fields.sort((b, W) => _.indexOf(b.name) - _.indexOf(W.name));
|
|
1113
|
-
}),
|
|
1124
|
+
}), y;
|
|
1114
1125
|
}), u(!1));
|
|
1115
1126
|
}
|
|
1116
|
-
return
|
|
1127
|
+
return C(), () => {
|
|
1117
1128
|
h = !0;
|
|
1118
1129
|
};
|
|
1119
1130
|
}, [
|
|
1120
1131
|
e,
|
|
1121
1132
|
t,
|
|
1122
|
-
|
|
1133
|
+
n,
|
|
1123
1134
|
o,
|
|
1124
1135
|
s,
|
|
1125
1136
|
a,
|
|
1126
1137
|
i
|
|
1127
|
-
]), { fieldsWithAttributes: c, groupsWithAttributes:
|
|
1128
|
-
},
|
|
1129
|
-
function
|
|
1138
|
+
]), { fieldsWithAttributes: c, groupsWithAttributes: p, isLoading: d };
|
|
1139
|
+
}, bn = "TRANSIENT";
|
|
1140
|
+
function Gn({ metadata: e, markerField: t, markerValue: r, itemSearchDocument: n }) {
|
|
1130
1141
|
return ue.searchItem({
|
|
1131
1142
|
queryParams: {
|
|
1132
1143
|
result: "library",
|
|
1133
|
-
updateMode:
|
|
1144
|
+
updateMode: bn
|
|
1134
1145
|
},
|
|
1135
|
-
itemSearchDocument:
|
|
1146
|
+
itemSearchDocument: n
|
|
1136
1147
|
}).then(
|
|
1137
1148
|
({ data: { library: o } }) => k.createCollection({
|
|
1138
1149
|
collectionDocument: {
|
|
1139
1150
|
metadata: t ? de({
|
|
1140
|
-
[t]:
|
|
1151
|
+
[t]: r || o,
|
|
1141
1152
|
...e
|
|
1142
1153
|
}) : e,
|
|
1143
1154
|
content: [
|
|
@@ -1150,48 +1161,52 @@ function br({ metadata: e, markerField: t, markerValue: n, itemSearchDocument: r
|
|
|
1150
1161
|
})
|
|
1151
1162
|
);
|
|
1152
1163
|
}
|
|
1153
|
-
const ct = ({ collectionId: e }) => new Promise((t,
|
|
1164
|
+
const ct = ({ collectionId: e }) => new Promise((t, r) => {
|
|
1154
1165
|
k.getCollection({ collectionId: e, queryParams: { children: "library" } }).then(
|
|
1155
|
-
({ data:
|
|
1156
|
-
const { content: o = [] } =
|
|
1157
|
-
s ||
|
|
1166
|
+
({ data: n }) => {
|
|
1167
|
+
const { content: o = [] } = n, [s] = o;
|
|
1168
|
+
s || r(new Error("No Libraries")), t(s);
|
|
1158
1169
|
}
|
|
1159
1170
|
);
|
|
1160
|
-
}),
|
|
1161
|
-
({
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
)
|
|
1166
|
-
|
|
1171
|
+
}), wn = ({ collectionId: e }) => new Promise((t) => {
|
|
1172
|
+
ct({ collectionId: e }).then(
|
|
1173
|
+
({ id: r }) => Promise.all([
|
|
1174
|
+
ge.removeLibrary({ libraryId: r }),
|
|
1175
|
+
k.removeCollection({ collectionId: e })
|
|
1176
|
+
])
|
|
1177
|
+
).catch((r) => {
|
|
1178
|
+
r.response.data.forbidden && t(JSON.stringify(r.response.data.forbidden)), r.response.data.internalServer && t(JSON.stringify(r.response.data.internalServer)), r.response.data.notFound && t(JSON.stringify(r.response.data.notFound)), r.response.data.notAuthorized && t(JSON.stringify(r.response.data.notAuthorized));
|
|
1179
|
+
});
|
|
1180
|
+
});
|
|
1181
|
+
function Dn({ libraryId: e }) {
|
|
1167
1182
|
return new Promise((t) => {
|
|
1168
|
-
ge.getLibrarySettings({ libraryId: e }).then(({ data: { query:
|
|
1169
|
-
t(
|
|
1183
|
+
ge.getLibrarySettings({ libraryId: e }).then(({ data: { query: r } }) => {
|
|
1184
|
+
t(r);
|
|
1170
1185
|
});
|
|
1171
1186
|
});
|
|
1172
1187
|
}
|
|
1173
|
-
const
|
|
1174
|
-
ct({ collectionId: e }).then(({ id:
|
|
1188
|
+
const On = ({ collectionId: e }) => new Promise((t) => {
|
|
1189
|
+
ct({ collectionId: e }).then(({ id: r }) => Dn({ libraryId: r })).then(t);
|
|
1175
1190
|
});
|
|
1176
|
-
function
|
|
1191
|
+
function Xr({
|
|
1177
1192
|
markerField: e,
|
|
1178
1193
|
markerValue: t,
|
|
1179
|
-
initialSearchState:
|
|
1180
|
-
onSaveSearch:
|
|
1181
|
-
onDeleteSearch: o =
|
|
1194
|
+
initialSearchState: r,
|
|
1195
|
+
onSaveSearch: n = Gn,
|
|
1196
|
+
onDeleteSearch: o = wn,
|
|
1182
1197
|
onUpdateSearchMetadata: s = k.updateCollectionMetadata,
|
|
1183
|
-
onGetSavedSearchSettings: a =
|
|
1184
|
-
}) {
|
|
1185
|
-
const
|
|
1186
|
-
({ metadata:
|
|
1187
|
-
metadata:
|
|
1198
|
+
onGetSavedSearchSettings: a = On
|
|
1199
|
+
}, i = !1) {
|
|
1200
|
+
const d = v(
|
|
1201
|
+
({ metadata: l, itemSearchDocument: h }) => n({
|
|
1202
|
+
metadata: l,
|
|
1188
1203
|
markerField: e,
|
|
1189
1204
|
markerValue: t,
|
|
1190
|
-
itemSearchDocument:
|
|
1205
|
+
itemSearchDocument: h
|
|
1191
1206
|
}),
|
|
1192
|
-
[e, t,
|
|
1193
|
-
),
|
|
1194
|
-
...
|
|
1207
|
+
[e, t, n]
|
|
1208
|
+
), u = (l = {}) => ({
|
|
1209
|
+
...l,
|
|
1195
1210
|
operator: {
|
|
1196
1211
|
field: [
|
|
1197
1212
|
{
|
|
@@ -1199,64 +1214,67 @@ function Xn({
|
|
|
1199
1214
|
value: [{ value: t || "*" }]
|
|
1200
1215
|
}
|
|
1201
1216
|
],
|
|
1202
|
-
operator:
|
|
1217
|
+
operator: l.operator ? [l.operator] : [],
|
|
1203
1218
|
operation: "AND"
|
|
1204
1219
|
}
|
|
1205
|
-
}),
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1220
|
+
}), c = Kt(
|
|
1221
|
+
{
|
|
1222
|
+
...r,
|
|
1223
|
+
itemSearchDocument: u()
|
|
1224
|
+
},
|
|
1225
|
+
i
|
|
1226
|
+
), { setItemSearchDocument: m, ...p } = c;
|
|
1209
1227
|
return {
|
|
1210
|
-
onSaveSearch:
|
|
1228
|
+
onSaveSearch: d,
|
|
1211
1229
|
onDeleteSearch: o,
|
|
1212
1230
|
onUpdateSearchMetadata: s,
|
|
1213
1231
|
onGetSavedSearchSettings: a,
|
|
1214
1232
|
searchProps: {
|
|
1215
|
-
setItemSearchDocument: (
|
|
1233
|
+
setItemSearchDocument: (l) => m(u(l)),
|
|
1216
1234
|
...p
|
|
1217
1235
|
}
|
|
1218
1236
|
};
|
|
1219
1237
|
}
|
|
1220
|
-
function
|
|
1238
|
+
function Hn({ itemSearchDocument: e, queryParams: t, matrixParams: r, path: n }) {
|
|
1221
1239
|
const {
|
|
1222
1240
|
request: o,
|
|
1223
1241
|
data: s = {},
|
|
1224
1242
|
isLoading: a,
|
|
1225
1243
|
isError: i,
|
|
1226
|
-
cancel:
|
|
1227
|
-
} = j(ue.searchItem), u =
|
|
1244
|
+
cancel: d
|
|
1245
|
+
} = j(ue.searchItem), u = n ? { path: n } : {}, c = () => o({ itemSearchDocument: e, queryParams: t, matrixParams: r, ...u });
|
|
1228
1246
|
return Z(() => {
|
|
1229
1247
|
c();
|
|
1230
|
-
}, [e, t,
|
|
1248
|
+
}, [e, t, r, n]), {
|
|
1231
1249
|
itemListType: s,
|
|
1232
1250
|
isLoading: a,
|
|
1233
1251
|
isError: i,
|
|
1234
1252
|
onRefresh: c,
|
|
1235
|
-
cancel:
|
|
1253
|
+
cancel: d
|
|
1236
1254
|
};
|
|
1237
1255
|
}
|
|
1238
|
-
const
|
|
1256
|
+
const zr = () => {
|
|
1239
1257
|
const [e, t] = x({ x: 0, y: 0 });
|
|
1240
1258
|
return $(() => {
|
|
1241
|
-
const
|
|
1242
|
-
return window.addEventListener("mousedown",
|
|
1243
|
-
window.removeEventListener("mousedown",
|
|
1259
|
+
const r = (n) => t({ x: n.clientX, y: n.clientY });
|
|
1260
|
+
return window.addEventListener("mousedown", r), () => {
|
|
1261
|
+
window.removeEventListener("mousedown", r);
|
|
1244
1262
|
};
|
|
1245
1263
|
}, []), e;
|
|
1246
1264
|
};
|
|
1247
|
-
function
|
|
1265
|
+
function Ln({
|
|
1248
1266
|
collectionId: e,
|
|
1249
1267
|
queryParams: t = {},
|
|
1250
|
-
refreshOnMount:
|
|
1268
|
+
refreshOnMount: r = !0
|
|
1251
1269
|
}) {
|
|
1252
1270
|
const {
|
|
1253
|
-
request:
|
|
1271
|
+
request: n,
|
|
1254
1272
|
data: o = {},
|
|
1255
1273
|
isLoading: s,
|
|
1256
1274
|
isError: a
|
|
1257
|
-
} = j(k.getCollection), i = () =>
|
|
1275
|
+
} = j(k.getCollection), i = () => n({ collectionId: e, queryParams: t });
|
|
1258
1276
|
return Z(() => {
|
|
1259
|
-
|
|
1277
|
+
r && i();
|
|
1260
1278
|
}, [e, t]), {
|
|
1261
1279
|
collectionType: o,
|
|
1262
1280
|
isLoading: s,
|
|
@@ -1264,81 +1282,81 @@ function Hr({
|
|
|
1264
1282
|
onRefresh: i
|
|
1265
1283
|
};
|
|
1266
1284
|
}
|
|
1267
|
-
function
|
|
1285
|
+
function Kr({
|
|
1268
1286
|
collectionId: e,
|
|
1269
1287
|
queryParams: t = {},
|
|
1270
|
-
refreshOnMount:
|
|
1288
|
+
refreshOnMount: r = !0
|
|
1271
1289
|
}) {
|
|
1272
|
-
const { request:
|
|
1290
|
+
const { request: n, data: o = {} } = j(k.getCollectionItem), s = () => n({ collectionId: e, queryParams: t });
|
|
1273
1291
|
return Z(() => {
|
|
1274
|
-
|
|
1292
|
+
r && s();
|
|
1275
1293
|
}, [e, t]), {
|
|
1276
1294
|
itemListType: o,
|
|
1277
1295
|
onRefresh: s
|
|
1278
1296
|
};
|
|
1279
1297
|
}
|
|
1280
|
-
const
|
|
1281
|
-
let
|
|
1298
|
+
const Zr = ({ entityId: e, entityType: t }) => {
|
|
1299
|
+
let r, n, o;
|
|
1282
1300
|
switch (t) {
|
|
1283
1301
|
case "collection":
|
|
1284
|
-
|
|
1302
|
+
r = "collectionType", o = "collectionId", n = k.getCollection;
|
|
1285
1303
|
break;
|
|
1286
1304
|
case "library":
|
|
1287
|
-
|
|
1305
|
+
r = "libraryType", o = "libraryId", n = ge.getLibrary;
|
|
1288
1306
|
break;
|
|
1289
1307
|
case "item":
|
|
1290
|
-
|
|
1308
|
+
r = "itemType", o = "itemId", n = ue.getItem;
|
|
1291
1309
|
break;
|
|
1292
1310
|
default:
|
|
1293
1311
|
throw new Error("unknown entityType");
|
|
1294
1312
|
}
|
|
1295
|
-
const { request: s, data: a, ...i } = j(
|
|
1313
|
+
const { request: s, data: a, ...i } = j(n), d = v(
|
|
1296
1314
|
(u) => s({ [o]: e, ...u }),
|
|
1297
1315
|
[e, o, s]
|
|
1298
1316
|
);
|
|
1299
1317
|
return {
|
|
1300
|
-
[
|
|
1318
|
+
[r]: a,
|
|
1301
1319
|
[o]: e,
|
|
1302
|
-
onGetEntity:
|
|
1320
|
+
onGetEntity: d,
|
|
1303
1321
|
...i
|
|
1304
1322
|
};
|
|
1305
1323
|
};
|
|
1306
1324
|
function eo(e) {
|
|
1307
|
-
const { data: t, request:
|
|
1325
|
+
const { data: t, request: r } = j(X.getUser, { data: e }), { userName: n } = t || {}, o = v(() => r({ userName: n }), [r, n]);
|
|
1308
1326
|
$(() => {
|
|
1309
|
-
|
|
1310
|
-
}, [o,
|
|
1311
|
-
const s =
|
|
1312
|
-
({ userDocument:
|
|
1313
|
-
userName:
|
|
1314
|
-
userDocument:
|
|
1315
|
-
}).then(() =>
|
|
1316
|
-
[
|
|
1317
|
-
), a =
|
|
1318
|
-
({ groups:
|
|
1319
|
-
userName:
|
|
1327
|
+
n && o();
|
|
1328
|
+
}, [o, n]);
|
|
1329
|
+
const s = v(
|
|
1330
|
+
({ userDocument: p }) => X.updateUser({
|
|
1331
|
+
userName: n,
|
|
1332
|
+
userDocument: p
|
|
1333
|
+
}).then(() => r({ userName: p.userName })),
|
|
1334
|
+
[r, n]
|
|
1335
|
+
), a = v(
|
|
1336
|
+
({ groups: p = [] }) => X.updateUserGroup({
|
|
1337
|
+
userName: n,
|
|
1320
1338
|
groupListDocument: {
|
|
1321
|
-
group:
|
|
1339
|
+
group: p.map((l) => ({ groupName: l }))
|
|
1322
1340
|
}
|
|
1323
1341
|
}).then(o),
|
|
1324
|
-
[o,
|
|
1325
|
-
), i =
|
|
1326
|
-
(
|
|
1327
|
-
groupName:
|
|
1328
|
-
userName:
|
|
1342
|
+
[o, n]
|
|
1343
|
+
), i = v(
|
|
1344
|
+
(p) => te.removeGroupUser({
|
|
1345
|
+
groupName: p,
|
|
1346
|
+
userName: n
|
|
1329
1347
|
}).then(o),
|
|
1330
|
-
[o,
|
|
1331
|
-
),
|
|
1332
|
-
(
|
|
1333
|
-
userName:
|
|
1348
|
+
[o, n]
|
|
1349
|
+
), d = v(
|
|
1350
|
+
(p) => X.updateUser({
|
|
1351
|
+
userName: n,
|
|
1334
1352
|
userDocument: {
|
|
1335
|
-
password:
|
|
1353
|
+
password: p
|
|
1336
1354
|
},
|
|
1337
1355
|
queryParams: {
|
|
1338
1356
|
passwordType: "raw"
|
|
1339
1357
|
}
|
|
1340
1358
|
}),
|
|
1341
|
-
[
|
|
1359
|
+
[n]
|
|
1342
1360
|
);
|
|
1343
1361
|
return {
|
|
1344
1362
|
userType: t,
|
|
@@ -1346,25 +1364,25 @@ function eo(e) {
|
|
|
1346
1364
|
updateUser: s,
|
|
1347
1365
|
updateUserGroups: a,
|
|
1348
1366
|
removeUserFromGroup: i,
|
|
1349
|
-
disableUser: (
|
|
1350
|
-
enableUser: (
|
|
1351
|
-
deleteUser: ({ queryParams:
|
|
1352
|
-
changePassword:
|
|
1367
|
+
disableUser: (p) => X.disableUser({ userName: n, ...p }).then(o),
|
|
1368
|
+
enableUser: (p) => X.enableUser({ userName: n, ...p }).then(o),
|
|
1369
|
+
deleteUser: ({ queryParams: p = {} } = {}) => X.disableUser({ userName: n, queryParams: { hard: !0, ...p } }),
|
|
1370
|
+
changePassword: d
|
|
1353
1371
|
};
|
|
1354
1372
|
}
|
|
1355
|
-
const
|
|
1356
|
-
CHANGE_PAGE:
|
|
1357
|
-
CHANGE_ROWS:
|
|
1358
|
-
CHANGE_SORT:
|
|
1359
|
-
CHANGE_QUERY:
|
|
1360
|
-
},
|
|
1373
|
+
const Un = "CHANGE_PAGE", xn = "CHANGE_ROWS", Mn = "CHANGE_SORT", Fn = "CHANGE_QUERY", ce = {
|
|
1374
|
+
CHANGE_PAGE: Un,
|
|
1375
|
+
CHANGE_ROWS: xn,
|
|
1376
|
+
CHANGE_SORT: Mn,
|
|
1377
|
+
CHANGE_QUERY: Fn
|
|
1378
|
+
}, qn = ({ queryParams: e = {}, rowsPerPage: t = 10, page: r = 0 } = {}) => ({
|
|
1361
1379
|
queryParams: {
|
|
1362
|
-
first:
|
|
1380
|
+
first: r * t + 1,
|
|
1363
1381
|
number: t,
|
|
1364
1382
|
...e
|
|
1365
1383
|
},
|
|
1366
1384
|
rowsPerPage: t,
|
|
1367
|
-
page:
|
|
1385
|
+
page: r,
|
|
1368
1386
|
userSearchDocument: {
|
|
1369
1387
|
sort: [
|
|
1370
1388
|
{
|
|
@@ -1373,30 +1391,30 @@ const Lr = "CHANGE_PAGE", Ur = "CHANGE_ROWS", xr = "CHANGE_SORT", Mr = "CHANGE_Q
|
|
|
1373
1391
|
}
|
|
1374
1392
|
]
|
|
1375
1393
|
}
|
|
1376
|
-
}),
|
|
1377
|
-
const { type:
|
|
1378
|
-
switch (
|
|
1394
|
+
}), $n = (e, t) => {
|
|
1395
|
+
const { type: r } = t;
|
|
1396
|
+
switch (r) {
|
|
1379
1397
|
case ce.CHANGE_PAGE: {
|
|
1380
|
-
const { page:
|
|
1398
|
+
const { page: n } = t;
|
|
1381
1399
|
return {
|
|
1382
1400
|
...e,
|
|
1383
|
-
page:
|
|
1401
|
+
page: n,
|
|
1384
1402
|
queryParams: {
|
|
1385
1403
|
...e.queryParams,
|
|
1386
|
-
first:
|
|
1404
|
+
first: n * e.rowsPerPage + 1
|
|
1387
1405
|
}
|
|
1388
1406
|
};
|
|
1389
1407
|
}
|
|
1390
1408
|
case ce.CHANGE_ROWS: {
|
|
1391
|
-
const { rowsPerPage:
|
|
1409
|
+
const { rowsPerPage: n } = t;
|
|
1392
1410
|
return {
|
|
1393
1411
|
...e,
|
|
1394
|
-
rowsPerPage:
|
|
1412
|
+
rowsPerPage: n,
|
|
1395
1413
|
page: 0,
|
|
1396
1414
|
queryParams: {
|
|
1397
1415
|
...e.queryParams,
|
|
1398
1416
|
first: 1,
|
|
1399
|
-
number:
|
|
1417
|
+
number: n
|
|
1400
1418
|
}
|
|
1401
1419
|
};
|
|
1402
1420
|
}
|
|
@@ -1423,110 +1441,110 @@ const Lr = "CHANGE_PAGE", Ur = "CHANGE_ROWS", xr = "CHANGE_SORT", Mr = "CHANGE_Q
|
|
|
1423
1441
|
}
|
|
1424
1442
|
};
|
|
1425
1443
|
function to(e) {
|
|
1426
|
-
const t =
|
|
1444
|
+
const t = qn(e), [r, n] = fe($n, t), {
|
|
1427
1445
|
data: o,
|
|
1428
1446
|
request: s,
|
|
1429
1447
|
hasLoaded: a,
|
|
1430
1448
|
isError: i
|
|
1431
|
-
} = j(X.searchUser),
|
|
1432
|
-
userSearchDocument:
|
|
1433
|
-
queryParams:
|
|
1449
|
+
} = j(X.searchUser), d = () => s({
|
|
1450
|
+
userSearchDocument: r.userSearchDocument,
|
|
1451
|
+
queryParams: r.queryParams
|
|
1434
1452
|
});
|
|
1435
1453
|
return $(() => {
|
|
1436
|
-
|
|
1437
|
-
}, [
|
|
1438
|
-
...
|
|
1454
|
+
d();
|
|
1455
|
+
}, [r.queryParams, r.userSearchDocument]), {
|
|
1456
|
+
...r,
|
|
1439
1457
|
hasLoaded: a,
|
|
1440
1458
|
isError: i,
|
|
1441
1459
|
userListDocument: o,
|
|
1442
|
-
onSearchUser:
|
|
1443
|
-
onChangePage: ({ page:
|
|
1460
|
+
onSearchUser: d,
|
|
1461
|
+
onChangePage: ({ page: l }) => n({
|
|
1444
1462
|
type: ce.CHANGE_PAGE,
|
|
1445
|
-
page:
|
|
1463
|
+
page: l
|
|
1446
1464
|
}),
|
|
1447
|
-
onChangeSort: (
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1465
|
+
onChangeSort: (l, h, f) => {
|
|
1466
|
+
const A = typeof h == "object" ? h.value : h;
|
|
1467
|
+
n({
|
|
1450
1468
|
type: ce.CHANGE_SORT,
|
|
1451
|
-
field:
|
|
1452
|
-
order:
|
|
1469
|
+
field: A,
|
|
1470
|
+
order: f
|
|
1453
1471
|
});
|
|
1454
1472
|
},
|
|
1455
|
-
onChangeRowsPerPage: ({ target: { value:
|
|
1473
|
+
onChangeRowsPerPage: ({ target: { value: l } } = {}) => n({
|
|
1456
1474
|
type: ce.CHANGE_ROWS,
|
|
1457
|
-
rowsPerPage:
|
|
1475
|
+
rowsPerPage: l
|
|
1458
1476
|
}),
|
|
1459
|
-
onChangeQuery: (
|
|
1460
|
-
|
|
1477
|
+
onChangeQuery: (l, h) => {
|
|
1478
|
+
n({
|
|
1461
1479
|
type: ce.CHANGE_QUERY,
|
|
1462
|
-
field:
|
|
1480
|
+
field: l,
|
|
1463
1481
|
query: h
|
|
1464
1482
|
});
|
|
1465
1483
|
}
|
|
1466
1484
|
};
|
|
1467
1485
|
}
|
|
1468
|
-
const
|
|
1469
|
-
const { request: t, data:
|
|
1486
|
+
const no = (e) => {
|
|
1487
|
+
const { request: t, data: r = {}, isLoading: n } = j(te.listGroup), o = () => t(e);
|
|
1470
1488
|
return $(() => {
|
|
1471
1489
|
o();
|
|
1472
1490
|
}, [e]), {
|
|
1473
1491
|
onRefresh: o,
|
|
1474
|
-
groupListType:
|
|
1475
|
-
isLoading:
|
|
1492
|
+
groupListType: r,
|
|
1493
|
+
isLoading: n
|
|
1476
1494
|
};
|
|
1477
|
-
},
|
|
1478
|
-
const { request: t, data:
|
|
1495
|
+
}, ro = (e) => {
|
|
1496
|
+
const { request: t, data: r = {}, isLoading: n } = j(X.listUser), o = () => t(e);
|
|
1479
1497
|
return $(() => {
|
|
1480
1498
|
o();
|
|
1481
1499
|
}, [e]), {
|
|
1482
1500
|
onRefresh: o,
|
|
1483
|
-
userListType:
|
|
1484
|
-
isLoading:
|
|
1501
|
+
userListType: r,
|
|
1502
|
+
isLoading: n
|
|
1485
1503
|
};
|
|
1486
|
-
},
|
|
1487
|
-
CHANGE_PAGE:
|
|
1488
|
-
CHANGE_ROWS:
|
|
1489
|
-
CHANGE_SORT:
|
|
1490
|
-
CHANGE_QUERY:
|
|
1491
|
-
HIDE_ROLES:
|
|
1492
|
-
},
|
|
1504
|
+
}, jn = "CHANGE_PAGE", Wn = "CHANGE_ROWS", Vn = "CHANGE_SORT", kn = "CHANGE_QUERY", Yn = "HIDE_ROLES", ae = {
|
|
1505
|
+
CHANGE_PAGE: jn,
|
|
1506
|
+
CHANGE_ROWS: Wn,
|
|
1507
|
+
CHANGE_SORT: Vn,
|
|
1508
|
+
CHANGE_QUERY: kn,
|
|
1509
|
+
HIDE_ROLES: Yn
|
|
1510
|
+
}, Bn = ({ queryParams: e = {}, rowsPerPage: t = 10, page: r = 0 } = {}) => ({
|
|
1493
1511
|
queryParams: {
|
|
1494
|
-
first:
|
|
1512
|
+
first: r * t + 1,
|
|
1495
1513
|
number: t,
|
|
1496
1514
|
...e
|
|
1497
1515
|
},
|
|
1498
1516
|
rowsPerPage: t,
|
|
1499
|
-
page:
|
|
1517
|
+
page: r,
|
|
1500
1518
|
groupSearchDocument: {}
|
|
1501
|
-
}),
|
|
1502
|
-
const { type:
|
|
1503
|
-
switch (
|
|
1519
|
+
}), Jn = (e, t) => {
|
|
1520
|
+
const { type: r } = t;
|
|
1521
|
+
switch (r) {
|
|
1504
1522
|
case ae.CHANGE_PAGE: {
|
|
1505
|
-
const { page:
|
|
1523
|
+
const { page: n } = t;
|
|
1506
1524
|
return {
|
|
1507
1525
|
...e,
|
|
1508
|
-
page:
|
|
1526
|
+
page: n,
|
|
1509
1527
|
queryParams: {
|
|
1510
1528
|
...e.queryParams,
|
|
1511
|
-
first:
|
|
1529
|
+
first: n * e.rowsPerPage + 1
|
|
1512
1530
|
}
|
|
1513
1531
|
};
|
|
1514
1532
|
}
|
|
1515
1533
|
case ae.CHANGE_ROWS: {
|
|
1516
|
-
const { rowsPerPage:
|
|
1534
|
+
const { rowsPerPage: n } = t;
|
|
1517
1535
|
return {
|
|
1518
1536
|
...e,
|
|
1519
|
-
rowsPerPage:
|
|
1537
|
+
rowsPerPage: n,
|
|
1520
1538
|
page: 0,
|
|
1521
1539
|
queryParams: {
|
|
1522
1540
|
...e.queryParams,
|
|
1523
1541
|
first: 1,
|
|
1524
|
-
number:
|
|
1542
|
+
number: n
|
|
1525
1543
|
}
|
|
1526
1544
|
};
|
|
1527
1545
|
}
|
|
1528
1546
|
case ae.HIDE_ROLES: {
|
|
1529
|
-
const { hideRoles:
|
|
1547
|
+
const { hideRoles: n } = t, o = n === !0 ? !1 : void 0;
|
|
1530
1548
|
return {
|
|
1531
1549
|
...e,
|
|
1532
1550
|
page: 0,
|
|
@@ -1560,129 +1578,129 @@ const ro = (e) => {
|
|
|
1560
1578
|
}
|
|
1561
1579
|
};
|
|
1562
1580
|
function oo(e) {
|
|
1563
|
-
const t =
|
|
1581
|
+
const t = Bn(e), [r, n] = fe(Jn, t), {
|
|
1564
1582
|
data: o,
|
|
1565
1583
|
request: s,
|
|
1566
1584
|
hasLoaded: a,
|
|
1567
1585
|
isError: i
|
|
1568
|
-
} = j(te.searchGroup),
|
|
1569
|
-
groupSearchDocument:
|
|
1570
|
-
queryParams:
|
|
1586
|
+
} = j(te.searchGroup), d = () => s({
|
|
1587
|
+
groupSearchDocument: r.groupSearchDocument,
|
|
1588
|
+
queryParams: r.queryParams
|
|
1571
1589
|
});
|
|
1572
1590
|
return $(() => {
|
|
1573
|
-
|
|
1574
|
-
}, [
|
|
1575
|
-
...
|
|
1591
|
+
d();
|
|
1592
|
+
}, [r.queryParams, r.groupSearchDocument]), {
|
|
1593
|
+
...r,
|
|
1576
1594
|
hasLoaded: a,
|
|
1577
1595
|
isError: i,
|
|
1578
1596
|
groupListDocument: o,
|
|
1579
|
-
onSearchGroup:
|
|
1580
|
-
onChangePage: ({ page: h }) =>
|
|
1597
|
+
onSearchGroup: d,
|
|
1598
|
+
onChangePage: ({ page: h }) => n({
|
|
1581
1599
|
type: ae.CHANGE_PAGE,
|
|
1582
1600
|
page: h
|
|
1583
1601
|
}),
|
|
1584
|
-
onChangeSort: (h,
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1602
|
+
onChangeSort: (h, f, A) => {
|
|
1603
|
+
const C = typeof f == "object" ? f.value : f;
|
|
1604
|
+
n({
|
|
1587
1605
|
type: ae.CHANGE_SORT,
|
|
1588
|
-
field:
|
|
1589
|
-
order:
|
|
1606
|
+
field: C,
|
|
1607
|
+
order: A
|
|
1590
1608
|
});
|
|
1591
1609
|
},
|
|
1592
|
-
onChangeRowsPerPage: ({ target: { value: h } } = {}) =>
|
|
1610
|
+
onChangeRowsPerPage: ({ target: { value: h } } = {}) => n({
|
|
1593
1611
|
type: ae.CHANGE_ROWS,
|
|
1594
1612
|
rowsPerPage: h
|
|
1595
1613
|
}),
|
|
1596
|
-
onChangeQuery: (h,
|
|
1597
|
-
|
|
1614
|
+
onChangeQuery: (h, f) => {
|
|
1615
|
+
n({
|
|
1598
1616
|
type: ae.CHANGE_QUERY,
|
|
1599
1617
|
field: h,
|
|
1600
|
-
query:
|
|
1618
|
+
query: f
|
|
1601
1619
|
});
|
|
1602
1620
|
},
|
|
1603
|
-
onHideRoles: ({ hideRoles: h }) =>
|
|
1621
|
+
onHideRoles: ({ hideRoles: h }) => n({
|
|
1604
1622
|
type: ae.HIDE_ROLES,
|
|
1605
1623
|
hideRoles: h
|
|
1606
1624
|
})
|
|
1607
1625
|
};
|
|
1608
1626
|
}
|
|
1609
1627
|
function so(e) {
|
|
1610
|
-
const { data: t, request:
|
|
1628
|
+
const { data: t, request: r } = j(te.getGroup, { data: e }), { groupName: n } = t || {}, o = v(() => r({ groupName: n }), [r, n]);
|
|
1611
1629
|
$(() => {
|
|
1612
|
-
|
|
1613
|
-
}, [o,
|
|
1614
|
-
const s =
|
|
1615
|
-
({ groupDocument:
|
|
1616
|
-
groupName:
|
|
1617
|
-
groupDocument:
|
|
1630
|
+
n && o();
|
|
1631
|
+
}, [o, n]);
|
|
1632
|
+
const s = v(
|
|
1633
|
+
({ groupDocument: l }) => te.updateGroup({
|
|
1634
|
+
groupName: n,
|
|
1635
|
+
groupDocument: l
|
|
1618
1636
|
}).then(o),
|
|
1619
|
-
[o,
|
|
1620
|
-
), a =
|
|
1621
|
-
({ groups:
|
|
1622
|
-
groupName:
|
|
1637
|
+
[o, n]
|
|
1638
|
+
), a = v(
|
|
1639
|
+
({ groups: l }) => te.updateGroup({
|
|
1640
|
+
groupName: n,
|
|
1623
1641
|
groupDocument: {
|
|
1624
1642
|
childGroupList: {
|
|
1625
|
-
group:
|
|
1643
|
+
group: l.map((h) => ({ groupName: h }))
|
|
1626
1644
|
}
|
|
1627
1645
|
}
|
|
1628
1646
|
}).then(o),
|
|
1629
|
-
[o,
|
|
1630
|
-
), i =
|
|
1631
|
-
({ groups:
|
|
1632
|
-
groupName:
|
|
1647
|
+
[o, n]
|
|
1648
|
+
), i = v(
|
|
1649
|
+
({ groups: l }) => te.updateGroup({
|
|
1650
|
+
groupName: n,
|
|
1633
1651
|
groupDocument: {
|
|
1634
1652
|
parentGroupList: {
|
|
1635
|
-
group:
|
|
1653
|
+
group: l.map((h) => ({ groupName: h }))
|
|
1636
1654
|
}
|
|
1637
1655
|
}
|
|
1638
1656
|
}).then(o),
|
|
1639
|
-
[o,
|
|
1640
|
-
),
|
|
1641
|
-
({ users:
|
|
1642
|
-
groupName:
|
|
1657
|
+
[o, n]
|
|
1658
|
+
), d = v(
|
|
1659
|
+
({ users: l }) => te.updateGroup({
|
|
1660
|
+
groupName: n,
|
|
1643
1661
|
groupDocument: {
|
|
1644
1662
|
userList: {
|
|
1645
|
-
user:
|
|
1663
|
+
user: l.map((h) => ({ userName: h }))
|
|
1646
1664
|
}
|
|
1647
1665
|
}
|
|
1648
1666
|
}).then(o),
|
|
1649
|
-
[o,
|
|
1650
|
-
), u =
|
|
1651
|
-
(
|
|
1652
|
-
groupName:
|
|
1653
|
-
userName:
|
|
1667
|
+
[o, n]
|
|
1668
|
+
), u = v(
|
|
1669
|
+
(l) => te.removeGroupUser({
|
|
1670
|
+
groupName: n,
|
|
1671
|
+
userName: l
|
|
1654
1672
|
}).then(o),
|
|
1655
|
-
[o,
|
|
1656
|
-
), c =
|
|
1657
|
-
(
|
|
1658
|
-
groupName:
|
|
1659
|
-
childGroupName:
|
|
1673
|
+
[o, n]
|
|
1674
|
+
), c = v(
|
|
1675
|
+
(l) => te.removeGroupChildren({
|
|
1676
|
+
groupName: n,
|
|
1677
|
+
childGroupName: l
|
|
1660
1678
|
}).then(o),
|
|
1661
|
-
[o,
|
|
1662
|
-
),
|
|
1663
|
-
(
|
|
1664
|
-
groupName:
|
|
1665
|
-
childGroupName:
|
|
1679
|
+
[o, n]
|
|
1680
|
+
), m = v(
|
|
1681
|
+
(l) => te.removeGroupChildren({
|
|
1682
|
+
groupName: l,
|
|
1683
|
+
childGroupName: n
|
|
1666
1684
|
}).then(o),
|
|
1667
|
-
[o,
|
|
1668
|
-
),
|
|
1685
|
+
[o, n]
|
|
1686
|
+
), p = v(() => te.removeGroup({ groupName: n }), [n]);
|
|
1669
1687
|
return {
|
|
1670
1688
|
groupType: t,
|
|
1671
1689
|
getGroup: o,
|
|
1672
1690
|
updateGroup: s,
|
|
1673
|
-
removeGroup:
|
|
1691
|
+
removeGroup: p,
|
|
1674
1692
|
addChildGroups: a,
|
|
1675
1693
|
addParentGroups: i,
|
|
1676
|
-
addUsersToGroup:
|
|
1694
|
+
addUsersToGroup: d,
|
|
1677
1695
|
removeUserFromGroup: u,
|
|
1678
1696
|
removeChildGroup: c,
|
|
1679
|
-
removeFromParentGroup:
|
|
1697
|
+
removeFromParentGroup: m
|
|
1680
1698
|
};
|
|
1681
1699
|
}
|
|
1682
|
-
function
|
|
1683
|
-
const { request:
|
|
1700
|
+
function Qn({ itemId: e, queryParams: t = {}, refreshOnMount: r = !0 }) {
|
|
1701
|
+
const { request: n, data: o = {}, isLoading: s, isError: a } = j(ue.getItem), i = () => n({ itemId: e, queryParams: t });
|
|
1684
1702
|
return Z(() => {
|
|
1685
|
-
|
|
1703
|
+
r && i();
|
|
1686
1704
|
}, [e, t]), {
|
|
1687
1705
|
itemType: o,
|
|
1688
1706
|
isLoading: s,
|
|
@@ -1691,20 +1709,20 @@ function Qr({ itemId: e, queryParams: t = {}, refreshOnMount: n = !0 }) {
|
|
|
1691
1709
|
};
|
|
1692
1710
|
}
|
|
1693
1711
|
const ao = ({ collectionId: e, defaultEnabled: t = !0 }) => {
|
|
1694
|
-
const [
|
|
1695
|
-
({ itemId:
|
|
1712
|
+
const [r, n] = x(), [o, s] = x(t), a = (m) => s((p) => m !== void 0 ? m : !p), i = z(), d = z(), u = z(), c = v(
|
|
1713
|
+
({ itemId: m }) => {
|
|
1696
1714
|
if (o === !1)
|
|
1697
1715
|
return;
|
|
1698
|
-
const
|
|
1716
|
+
const p = {
|
|
1699
1717
|
field: [
|
|
1700
1718
|
{
|
|
1701
1719
|
name: "mediaType",
|
|
1702
1720
|
value: [{ value: "video" }, { value: "audio" }]
|
|
1703
1721
|
}
|
|
1704
1722
|
]
|
|
1705
|
-
},
|
|
1706
|
-
const { current:
|
|
1707
|
-
if (!Array.isArray(
|
|
1723
|
+
}, l = ({ first: h, number: f } = {}) => {
|
|
1724
|
+
const { current: A } = i, { current: C } = d;
|
|
1725
|
+
if (!Array.isArray(A)) {
|
|
1708
1726
|
Promise.all([
|
|
1709
1727
|
k.getCollection({
|
|
1710
1728
|
collectionId: e,
|
|
@@ -1712,108 +1730,108 @@ const ao = ({ collectionId: e, defaultEnabled: t = !0 }) => {
|
|
|
1712
1730
|
}),
|
|
1713
1731
|
k.searchCollectionItem({
|
|
1714
1732
|
collectionId: e,
|
|
1715
|
-
searchDocument:
|
|
1716
|
-
queryParams: { first: h, number:
|
|
1733
|
+
searchDocument: p,
|
|
1734
|
+
queryParams: { first: h, number: f }
|
|
1717
1735
|
})
|
|
1718
|
-
]).then(([{ data:
|
|
1736
|
+
]).then(([{ data: y }, { data: N }]) => {
|
|
1719
1737
|
const { hits: _, item: b = [] } = N;
|
|
1720
1738
|
i.current = b.map(({ id: V }) => V), u.current = _;
|
|
1721
|
-
const { content: W } =
|
|
1722
|
-
|
|
1739
|
+
const { content: W } = y;
|
|
1740
|
+
d.current = W, l({ first: 1, number: 100 });
|
|
1723
1741
|
});
|
|
1724
1742
|
return;
|
|
1725
1743
|
}
|
|
1726
|
-
const { current:
|
|
1727
|
-
if (
|
|
1728
|
-
|
|
1744
|
+
const { current: P } = u, E = C.findIndex(({ id: y }) => y === m);
|
|
1745
|
+
if (E + 1 === C.length) {
|
|
1746
|
+
n();
|
|
1729
1747
|
return;
|
|
1730
1748
|
}
|
|
1731
|
-
if (
|
|
1749
|
+
if (E === -1 && P > A.length) {
|
|
1732
1750
|
k.searchCollectionItem({
|
|
1733
1751
|
collectionId: e,
|
|
1734
|
-
searchDocument:
|
|
1735
|
-
queryParams: { first: h +
|
|
1736
|
-
}).then(({ data:
|
|
1737
|
-
const { item: N = [] } =
|
|
1738
|
-
i.current.push(...N.map(({ id: _ }) => _)),
|
|
1752
|
+
searchDocument: p,
|
|
1753
|
+
queryParams: { first: h + f, number: f }
|
|
1754
|
+
}).then(({ data: y }) => {
|
|
1755
|
+
const { item: N = [] } = y;
|
|
1756
|
+
i.current.push(...N.map(({ id: _ }) => _)), l({ first: h + f, number: f });
|
|
1739
1757
|
});
|
|
1740
1758
|
return;
|
|
1741
1759
|
}
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1760
|
+
const R = C.slice(E + 1).find(({ id: y }) => A.includes(y));
|
|
1761
|
+
n(R);
|
|
1744
1762
|
};
|
|
1745
|
-
|
|
1763
|
+
l();
|
|
1746
1764
|
},
|
|
1747
1765
|
[e, o]
|
|
1748
1766
|
);
|
|
1749
1767
|
return {
|
|
1750
1768
|
isAutoPlayEnabled: o,
|
|
1751
1769
|
toggleAutoPlay: a,
|
|
1752
|
-
setNextPlaying:
|
|
1753
|
-
nextPlaying:
|
|
1770
|
+
setNextPlaying: n,
|
|
1771
|
+
nextPlaying: r,
|
|
1754
1772
|
onNext: c
|
|
1755
1773
|
};
|
|
1756
|
-
},
|
|
1774
|
+
}, Xn = (e) => {
|
|
1757
1775
|
const t = [];
|
|
1758
|
-
for (let
|
|
1759
|
-
const
|
|
1760
|
-
if (
|
|
1776
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
1777
|
+
const n = e[r];
|
|
1778
|
+
if (n && typeof n == "string")
|
|
1761
1779
|
try {
|
|
1762
|
-
const o =
|
|
1780
|
+
const o = n.split("version")[1].split("/")[1].split("?")[0], s = _t(o);
|
|
1763
1781
|
t.push(s);
|
|
1764
1782
|
} catch {
|
|
1765
1783
|
}
|
|
1766
1784
|
}
|
|
1767
1785
|
return t;
|
|
1768
1786
|
};
|
|
1769
|
-
function io(e = [], t = 0,
|
|
1770
|
-
const [o, s] = x(0), [a, i] = x(0), [
|
|
1771
|
-
|
|
1772
|
-
i(
|
|
1787
|
+
function io(e = [], t = 0, r = void 0, n = Xn) {
|
|
1788
|
+
const [o, s] = x(0), [a, i] = x(0), [d, u] = x(!1), [c, m] = x([]), [p, l] = x(), [h, f] = x(0), A = z(
|
|
1789
|
+
rt((y) => {
|
|
1790
|
+
i(y);
|
|
1773
1791
|
}, 10)
|
|
1774
|
-
).current,
|
|
1792
|
+
).current, C = (y) => {
|
|
1775
1793
|
try {
|
|
1776
|
-
return Math.round(
|
|
1794
|
+
return Math.round(y.getBoundingClientRect().left);
|
|
1777
1795
|
} catch {
|
|
1778
1796
|
return 0;
|
|
1779
1797
|
}
|
|
1780
|
-
},
|
|
1781
|
-
(
|
|
1782
|
-
const N =
|
|
1798
|
+
}, P = v(
|
|
1799
|
+
(y) => {
|
|
1800
|
+
const N = y.clientX - C(y.currentTarget) - t, _ = y.currentTarget.offsetWidth;
|
|
1783
1801
|
return N < 0 ? 0 : N > _ ? _ : N;
|
|
1784
1802
|
},
|
|
1785
1803
|
[t]
|
|
1786
|
-
),
|
|
1787
|
-
let _ = N[0], b = Math.abs(
|
|
1804
|
+
), E = (y, N) => {
|
|
1805
|
+
let _ = N[0], b = Math.abs(y - _), W = 0;
|
|
1788
1806
|
for (let V = 0; V < N.length; V += 1) {
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1807
|
+
const J = Math.abs(y - N[V]), ne = y - N[V] > 0;
|
|
1808
|
+
J < b && ne && (b = J, _ = N[V], W = V);
|
|
1791
1809
|
}
|
|
1792
1810
|
return W;
|
|
1793
|
-
}, S = (
|
|
1794
|
-
if (
|
|
1795
|
-
const N =
|
|
1796
|
-
s(N - 1), h !==
|
|
1797
|
-
const _ = N / (
|
|
1798
|
-
|
|
1799
|
-
const b =
|
|
1811
|
+
}, S = (y) => {
|
|
1812
|
+
if (r) {
|
|
1813
|
+
const N = P(y);
|
|
1814
|
+
s(N - 1), h !== y.currentTarget.offsetWidth && f(y.currentTarget.offsetWidth);
|
|
1815
|
+
const _ = N / (y.currentTarget.offsetWidth / +r);
|
|
1816
|
+
l(bt(_));
|
|
1817
|
+
const b = E(
|
|
1800
1818
|
_,
|
|
1801
1819
|
c.map((W) => W.toSeconds().toFixed(0))
|
|
1802
1820
|
);
|
|
1803
|
-
b !== a &&
|
|
1821
|
+
b !== a && A(b);
|
|
1804
1822
|
}
|
|
1805
1823
|
};
|
|
1806
1824
|
return Z(() => {
|
|
1807
|
-
const
|
|
1808
|
-
|
|
1825
|
+
const y = n(e);
|
|
1826
|
+
m(y);
|
|
1809
1827
|
}, [e]), {
|
|
1810
1828
|
thumbnailIndex: a,
|
|
1811
|
-
thumbnailTimeCode:
|
|
1829
|
+
thumbnailTimeCode: p,
|
|
1812
1830
|
thumbnailWidth: h,
|
|
1813
|
-
showScrub:
|
|
1831
|
+
showScrub: d,
|
|
1814
1832
|
scrubPosition: o,
|
|
1815
|
-
handleShowScrub: (
|
|
1816
|
-
|
|
1833
|
+
handleShowScrub: (y) => () => {
|
|
1834
|
+
r > 0 && u(y);
|
|
1817
1835
|
},
|
|
1818
1836
|
onMouseMove: S
|
|
1819
1837
|
};
|
|
@@ -1821,17 +1839,17 @@ function io(e = [], t = 0, n = void 0, r = Jr) {
|
|
|
1821
1839
|
function co({
|
|
1822
1840
|
searchDoc: e,
|
|
1823
1841
|
queryParams: t,
|
|
1824
|
-
debounceTime:
|
|
1825
|
-
suggestionSettings:
|
|
1842
|
+
debounceTime: r,
|
|
1843
|
+
suggestionSettings: n = { maximumSuggestions: 10, accuracy: 1 },
|
|
1826
1844
|
triggerLength: o = 1,
|
|
1827
1845
|
apiCall: s = ue.searchItem
|
|
1828
1846
|
}) {
|
|
1829
|
-
const [a, i] = x(""),
|
|
1847
|
+
const [a, i] = x(""), d = z(rt(i, r)).current, { data: { autocomplete: u = [] } = {}, request: c } = j(s), { suggestion: m = [] } = u[0] || {};
|
|
1830
1848
|
return Z(() => {
|
|
1831
1849
|
e && a && a.length >= o && c({
|
|
1832
1850
|
body: {
|
|
1833
1851
|
...e,
|
|
1834
|
-
suggestion:
|
|
1852
|
+
suggestion: n,
|
|
1835
1853
|
autocomplete: [
|
|
1836
1854
|
{
|
|
1837
1855
|
text: a
|
|
@@ -1842,15 +1860,15 @@ function co({
|
|
|
1842
1860
|
queryParams: { count: !1, number: 0, ...t }
|
|
1843
1861
|
});
|
|
1844
1862
|
}, [c, a, t, o]), {
|
|
1845
|
-
suggestion:
|
|
1846
|
-
handleAutocompleteChange:
|
|
1863
|
+
suggestion: m,
|
|
1864
|
+
handleAutocompleteChange: d
|
|
1847
1865
|
};
|
|
1848
1866
|
}
|
|
1849
1867
|
function uo() {
|
|
1850
1868
|
const {
|
|
1851
1869
|
request: e,
|
|
1852
1870
|
data: { value: t = [] } = {},
|
|
1853
|
-
isLoading:
|
|
1871
|
+
isLoading: r
|
|
1854
1872
|
} = j(Ke.getMetadataFieldAllowedValues);
|
|
1855
1873
|
return {
|
|
1856
1874
|
getMetadataDataset: (o, s, a) => {
|
|
@@ -1862,57 +1880,57 @@ function uo() {
|
|
|
1862
1880
|
});
|
|
1863
1881
|
},
|
|
1864
1882
|
dataset: t,
|
|
1865
|
-
isLoading:
|
|
1883
|
+
isLoading: r
|
|
1866
1884
|
};
|
|
1867
1885
|
}
|
|
1868
|
-
const
|
|
1886
|
+
const zn = "TRANSIENT", $e = (e) => e.find((t) => t.name === "title").value[0].value;
|
|
1869
1887
|
function lo({
|
|
1870
1888
|
childFolders: e = [],
|
|
1871
1889
|
queryParams: t = { content: ["metadata"] },
|
|
1872
|
-
markerProps:
|
|
1890
|
+
markerProps: r = {
|
|
1873
1891
|
markerValue: "savedSearch",
|
|
1874
1892
|
markerField: "eidr_referentType"
|
|
1875
1893
|
},
|
|
1876
|
-
expand:
|
|
1894
|
+
expand: n
|
|
1877
1895
|
}) {
|
|
1878
|
-
const [o, s] = x(e), [a, i] = x([]), [
|
|
1896
|
+
const [o, s] = x(e), [a, i] = x([]), [d, u] = x(), c = v(() => {
|
|
1879
1897
|
Promise.all(
|
|
1880
|
-
o.map(async (
|
|
1898
|
+
o.map(async (f) => {
|
|
1881
1899
|
const {
|
|
1882
|
-
data: { content:
|
|
1900
|
+
data: { content: A, metadata: C = {} }
|
|
1883
1901
|
} = await k.getCollection({
|
|
1884
|
-
collectionId:
|
|
1902
|
+
collectionId: f,
|
|
1885
1903
|
queryParams: t
|
|
1886
|
-
}), { field:
|
|
1887
|
-
return
|
|
1888
|
-
id:
|
|
1889
|
-
libraryId:
|
|
1890
|
-
title: $e(
|
|
1904
|
+
}), { field: P } = C.timespan[0];
|
|
1905
|
+
return A && A[0].type === "library" ? {
|
|
1906
|
+
id: f,
|
|
1907
|
+
libraryId: A[0].id,
|
|
1908
|
+
title: $e(P),
|
|
1891
1909
|
type: "query",
|
|
1892
|
-
metadata:
|
|
1910
|
+
metadata: C
|
|
1893
1911
|
} : {
|
|
1894
|
-
id:
|
|
1895
|
-
title: $e(
|
|
1896
|
-
subFolders:
|
|
1912
|
+
id: f,
|
|
1913
|
+
title: $e(P),
|
|
1914
|
+
subFolders: A && A.map((E) => E.id),
|
|
1897
1915
|
type: "folder",
|
|
1898
|
-
metadata:
|
|
1916
|
+
metadata: C
|
|
1899
1917
|
};
|
|
1900
1918
|
})
|
|
1901
|
-
).then((
|
|
1902
|
-
i((
|
|
1903
|
-
}).catch((
|
|
1904
|
-
u(
|
|
1919
|
+
).then((f) => {
|
|
1920
|
+
i((A) => [...f, ...A]);
|
|
1921
|
+
}).catch((f) => {
|
|
1922
|
+
u(f);
|
|
1905
1923
|
});
|
|
1906
|
-
}, [o, t]),
|
|
1924
|
+
}, [o, t]), m = (f, A, C, P, E) => {
|
|
1907
1925
|
k.createCollection({
|
|
1908
1926
|
collectionDocument: {
|
|
1909
1927
|
metadata: de({
|
|
1910
|
-
[
|
|
1911
|
-
title:
|
|
1928
|
+
[A]: C,
|
|
1929
|
+
title: P
|
|
1912
1930
|
})
|
|
1913
1931
|
}
|
|
1914
|
-
}).then(({ data: { id: S } }) =>
|
|
1915
|
-
collectionId:
|
|
1932
|
+
}).then(({ data: { id: S } }) => f ? k.updateCollection({
|
|
1933
|
+
collectionId: f,
|
|
1916
1934
|
collectionDocument: {
|
|
1917
1935
|
content: [
|
|
1918
1936
|
{
|
|
@@ -1922,45 +1940,45 @@ function lo({
|
|
|
1922
1940
|
}
|
|
1923
1941
|
]
|
|
1924
1942
|
}
|
|
1925
|
-
}).then(({ data: { content:
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
),
|
|
1929
|
-
}).catch((
|
|
1930
|
-
u(
|
|
1943
|
+
}).then(({ data: { content: R } }) => {
|
|
1944
|
+
R && (s(
|
|
1945
|
+
R.filter((y) => y.id === S).map((y) => y.id)
|
|
1946
|
+
), E && E());
|
|
1947
|
+
}).catch((R) => {
|
|
1948
|
+
u(R);
|
|
1931
1949
|
}) : null).catch((S) => {
|
|
1932
1950
|
u(S);
|
|
1933
1951
|
});
|
|
1934
|
-
},
|
|
1952
|
+
}, p = (f, A, C, P) => {
|
|
1935
1953
|
try {
|
|
1936
1954
|
ue.searchItem({
|
|
1937
1955
|
queryParams: {
|
|
1938
1956
|
result: "library",
|
|
1939
|
-
updateMode:
|
|
1957
|
+
updateMode: zn
|
|
1940
1958
|
},
|
|
1941
|
-
itemSearchDocument:
|
|
1959
|
+
itemSearchDocument: C
|
|
1942
1960
|
}).then(
|
|
1943
|
-
({ data: { library:
|
|
1961
|
+
({ data: { library: E } }) => k.createCollection({
|
|
1944
1962
|
collectionDocument: {
|
|
1945
1963
|
metadata: de({
|
|
1946
|
-
[
|
|
1947
|
-
title:
|
|
1964
|
+
[r.markerField]: r.markerValue,
|
|
1965
|
+
title: A
|
|
1948
1966
|
}),
|
|
1949
1967
|
content: [
|
|
1950
1968
|
{
|
|
1951
|
-
id:
|
|
1969
|
+
id: E,
|
|
1952
1970
|
type: "library"
|
|
1953
1971
|
}
|
|
1954
1972
|
]
|
|
1955
1973
|
}
|
|
1956
1974
|
})
|
|
1957
1975
|
).then(
|
|
1958
|
-
({ data: { id:
|
|
1959
|
-
collectionId:
|
|
1976
|
+
({ data: { id: E } }) => k.updateCollection({
|
|
1977
|
+
collectionId: f,
|
|
1960
1978
|
collectionDocument: {
|
|
1961
1979
|
content: [
|
|
1962
1980
|
{
|
|
1963
|
-
id:
|
|
1981
|
+
id: E,
|
|
1964
1982
|
mode: "add",
|
|
1965
1983
|
type: "collection"
|
|
1966
1984
|
}
|
|
@@ -1968,40 +1986,40 @@ function lo({
|
|
|
1968
1986
|
}
|
|
1969
1987
|
}).then(({ data: { content: S } }) => {
|
|
1970
1988
|
S && (s(
|
|
1971
|
-
S.filter((
|
|
1972
|
-
),
|
|
1989
|
+
S.filter((R) => R.id === E).map((R) => R.id)
|
|
1990
|
+
), P && P());
|
|
1973
1991
|
}).catch((S) => {
|
|
1974
1992
|
u(S);
|
|
1975
1993
|
})
|
|
1976
|
-
).catch((
|
|
1977
|
-
u(
|
|
1994
|
+
).catch((E) => {
|
|
1995
|
+
u(E);
|
|
1978
1996
|
});
|
|
1979
|
-
} catch (
|
|
1980
|
-
u(
|
|
1997
|
+
} catch (E) {
|
|
1998
|
+
u(E);
|
|
1981
1999
|
}
|
|
1982
|
-
},
|
|
1983
|
-
u(
|
|
1984
|
-
}), h = (
|
|
1985
|
-
i((
|
|
2000
|
+
}, l = (f) => k.removeCollection({ collectionId: f }).catch((A) => {
|
|
2001
|
+
u(A);
|
|
2002
|
+
}), h = (f) => {
|
|
2003
|
+
i((A) => A.filter((C) => C.id !== f));
|
|
1986
2004
|
};
|
|
1987
2005
|
return Z(() => {
|
|
1988
|
-
o.length > 0 &&
|
|
1989
|
-
}, [o,
|
|
1990
|
-
!
|
|
1991
|
-
}, [
|
|
1992
|
-
createFolder:
|
|
1993
|
-
saveSearch:
|
|
2006
|
+
o.length > 0 && n && c();
|
|
2007
|
+
}, [o, n]), $(() => {
|
|
2008
|
+
!n && typeof n == "boolean" && (s(() => a.map((f) => f.id)), i([]));
|
|
2009
|
+
}, [n]), {
|
|
2010
|
+
createFolder: m,
|
|
2011
|
+
saveSearch: p,
|
|
1994
2012
|
getSubFolders: c,
|
|
1995
|
-
deleteFolder:
|
|
2013
|
+
deleteFolder: l,
|
|
1996
2014
|
removeItem: h,
|
|
1997
2015
|
subFolders: a,
|
|
1998
2016
|
setSubFolders: i,
|
|
1999
2017
|
setCurrentFolders: s,
|
|
2000
|
-
errors:
|
|
2018
|
+
errors: d
|
|
2001
2019
|
};
|
|
2002
2020
|
}
|
|
2003
2021
|
const fo = ({ collectionId: e, onError: t }) => {
|
|
2004
|
-
const [
|
|
2022
|
+
const [r, n] = x([]), s = async () => {
|
|
2005
2023
|
try {
|
|
2006
2024
|
if (!e)
|
|
2007
2025
|
throw Error("Missing collectionId");
|
|
@@ -2011,13 +2029,13 @@ const fo = ({ collectionId: e, onError: t }) => {
|
|
|
2011
2029
|
content: "metadata",
|
|
2012
2030
|
field: "representativeItems"
|
|
2013
2031
|
}
|
|
2014
|
-
}).catch((
|
|
2015
|
-
t && t(
|
|
2016
|
-
}), { representativeItems: c = [] } =
|
|
2032
|
+
}).catch((m) => {
|
|
2033
|
+
t && t(m);
|
|
2034
|
+
}), { representativeItems: c = [] } = nt(u, {
|
|
2017
2035
|
flat: !0,
|
|
2018
2036
|
includeValueAttributes: !0
|
|
2019
2037
|
});
|
|
2020
|
-
|
|
2038
|
+
n(() => c);
|
|
2021
2039
|
} catch (u) {
|
|
2022
2040
|
t && t(u);
|
|
2023
2041
|
}
|
|
@@ -2025,20 +2043,20 @@ const fo = ({ collectionId: e, onError: t }) => {
|
|
|
2025
2043
|
try {
|
|
2026
2044
|
const c = de({
|
|
2027
2045
|
representativeItems: Array.isArray(u) ? u : [u]
|
|
2028
|
-
}),
|
|
2046
|
+
}), m = await k.updateCollectionMetadata({
|
|
2029
2047
|
collectionId: e,
|
|
2030
2048
|
metadataDocument: c
|
|
2031
2049
|
});
|
|
2032
|
-
return s(),
|
|
2050
|
+
return s(), m;
|
|
2033
2051
|
} catch (c) {
|
|
2034
2052
|
t && t(c);
|
|
2035
2053
|
return;
|
|
2036
2054
|
}
|
|
2037
|
-
}, i = (u) => a({ value: u, mode: "add" }),
|
|
2055
|
+
}, i = (u) => a({ value: u, mode: "add" }), d = (u) => {
|
|
2038
2056
|
try {
|
|
2039
|
-
const c =
|
|
2057
|
+
const c = r.filter((m) => m.value === u).map((m) => m.uuid);
|
|
2040
2058
|
return c.length ? a(
|
|
2041
|
-
c.map((
|
|
2059
|
+
c.map((m) => ({ uuid: m, mode: "remove" }))
|
|
2042
2060
|
) : void 0;
|
|
2043
2061
|
} catch (c) {
|
|
2044
2062
|
t && t(c);
|
|
@@ -2048,19 +2066,19 @@ const fo = ({ collectionId: e, onError: t }) => {
|
|
|
2048
2066
|
return $(() => {
|
|
2049
2067
|
s();
|
|
2050
2068
|
}, [e]), {
|
|
2051
|
-
representativeItems:
|
|
2069
|
+
representativeItems: r,
|
|
2052
2070
|
onRefresh: s,
|
|
2053
2071
|
onAdd: i,
|
|
2054
|
-
onRemove:
|
|
2072
|
+
onRemove: d
|
|
2055
2073
|
};
|
|
2056
2074
|
};
|
|
2057
|
-
function
|
|
2075
|
+
function Kn() {
|
|
2058
2076
|
return Nt.listStorage().then((t) => ({
|
|
2059
2077
|
id: t.data.storage[0].id,
|
|
2060
2078
|
uri: t.data.storage[0].method[0].uri
|
|
2061
2079
|
}));
|
|
2062
2080
|
}
|
|
2063
|
-
function
|
|
2081
|
+
function Zn(e) {
|
|
2064
2082
|
return ge.createLibrary({
|
|
2065
2083
|
itemListDocument: {
|
|
2066
2084
|
item: [
|
|
@@ -2071,140 +2089,140 @@ function Kr(e) {
|
|
|
2071
2089
|
}
|
|
2072
2090
|
});
|
|
2073
2091
|
}
|
|
2074
|
-
function
|
|
2075
|
-
const { fileName:
|
|
2092
|
+
function er(e, t, r) {
|
|
2093
|
+
const { fileName: n = "output", outputFormat: o = "csv" } = r, { uri: s } = t, { data: { uri: [a] = [] } = {} } = e, d = encodeURIComponent((() => {
|
|
2076
2094
|
if (s.includes("s3")) {
|
|
2077
2095
|
const [u, c] = s.split("?region");
|
|
2078
|
-
return `${u}${
|
|
2096
|
+
return `${u}${n}.${o}?region${c}`;
|
|
2079
2097
|
}
|
|
2080
|
-
return `${s}${
|
|
2098
|
+
return `${s}${n}.${o}`;
|
|
2081
2099
|
})());
|
|
2082
2100
|
return ge.getLibraryBatch({
|
|
2083
2101
|
libraryId: a,
|
|
2084
|
-
queryParams: { destinationUri:
|
|
2102
|
+
queryParams: { destinationUri: d, ...r }
|
|
2085
2103
|
});
|
|
2086
2104
|
}
|
|
2087
|
-
const
|
|
2088
|
-
function ut(e, t,
|
|
2089
|
-
const { data: { jobId: o } = {} } = e, { id: s } = t, { fileName: a = "output", outputFormat: i = "csv" } =
|
|
2105
|
+
const tr = ["FINISHED", "FINISHED_WARNING"], nr = ["FINISHED", "FINISHED_WARNING", "FAILED_TOTAL", "ABORTED"];
|
|
2106
|
+
function ut(e, t, r, n) {
|
|
2107
|
+
const { data: { jobId: o } = {} } = e, { id: s } = t, { fileName: a = "output", outputFormat: i = "csv" } = r, d = `${a}.${i}`;
|
|
2090
2108
|
et.getJob({ jobId: o }).then(({ data: { status: u } = {} } = {}) => {
|
|
2091
|
-
if (
|
|
2109
|
+
if (tr.includes(u))
|
|
2092
2110
|
try {
|
|
2093
2111
|
It.listFileStorage({
|
|
2094
2112
|
storageId: s,
|
|
2095
2113
|
queryParams: {
|
|
2096
|
-
path:
|
|
2114
|
+
path: d,
|
|
2097
2115
|
methodMetadata: [
|
|
2098
2116
|
{ key: "format", value: "SIGNED-AUTO" },
|
|
2099
|
-
{ key: "contentDisposition", value: `attachment;+filename=${
|
|
2117
|
+
{ key: "contentDisposition", value: `attachment;+filename=${d}` }
|
|
2100
2118
|
],
|
|
2101
2119
|
"noauth-url": !0
|
|
2102
2120
|
}
|
|
2103
2121
|
}).then((c) => window.open(c.data.file[0].uri[0]));
|
|
2104
2122
|
} catch (c) {
|
|
2105
2123
|
console.error(`Download error:
|
|
2106
|
-
${c}`),
|
|
2124
|
+
${c}`), n({ message: "Download failed" });
|
|
2107
2125
|
}
|
|
2108
2126
|
else
|
|
2109
|
-
|
|
2110
|
-
ut(e, t,
|
|
2127
|
+
nr.includes(u) ? n({ message: "Download failed" }) : setTimeout(() => {
|
|
2128
|
+
ut(e, t, r, n);
|
|
2111
2129
|
}, 1e3);
|
|
2112
2130
|
});
|
|
2113
2131
|
}
|
|
2114
2132
|
const mo = ({
|
|
2115
2133
|
itemListType: e,
|
|
2116
2134
|
queryParams: t,
|
|
2117
|
-
onSuccess:
|
|
2118
|
-
onError:
|
|
2135
|
+
onSuccess: r,
|
|
2136
|
+
onError: n = ({ message: d, error: u }) => console.error(`${d}
|
|
2119
2137
|
${u}`),
|
|
2120
2138
|
onGetFile: o = ut,
|
|
2121
|
-
onCreateList: s =
|
|
2122
|
-
onList: a =
|
|
2123
|
-
onGetStorage: i =
|
|
2139
|
+
onCreateList: s = Zn,
|
|
2140
|
+
onList: a = er,
|
|
2141
|
+
onGetStorage: i = Kn
|
|
2124
2142
|
}) => ({ onDownload: () => i().then(
|
|
2125
2143
|
(u) => Promise.all([
|
|
2126
|
-
s(e).then((c) => a(c, u, t)).then(
|
|
2144
|
+
s(e).then((c) => a(c, u, t)).then(r()).then((c) => o(c, u, t, n))
|
|
2127
2145
|
])
|
|
2128
2146
|
) });
|
|
2129
|
-
function po(e, t,
|
|
2130
|
-
const
|
|
2131
|
-
const { value:
|
|
2132
|
-
o(
|
|
2133
|
-
},
|
|
2134
|
-
const
|
|
2135
|
-
|
|
2147
|
+
function po(e, t, r, n, o, s, a, i) {
|
|
2148
|
+
const d = r[0].fields.map((l) => l), [u, c] = x(n), m = (l, h, f, A) => {
|
|
2149
|
+
const { value: C } = l.target, E = n.map((S) => S).map((S, R) => f === R ? { ...h, [A]: C } : S);
|
|
2150
|
+
o(E), c(E);
|
|
2151
|
+
}, p = async (l, h) => {
|
|
2152
|
+
const f = de(l), { timespan: A } = f, C = [];
|
|
2153
|
+
A.forEach((R, y) => {
|
|
2136
2154
|
const N = {
|
|
2137
2155
|
field: [],
|
|
2138
2156
|
name: "V3_sport_Team",
|
|
2139
2157
|
mode: "add"
|
|
2140
2158
|
};
|
|
2141
|
-
|
|
2159
|
+
R.field.forEach((_) => {
|
|
2142
2160
|
N.field.push(_);
|
|
2143
|
-
}), h.includes(
|
|
2161
|
+
}), h.includes(y) && C.push(N);
|
|
2144
2162
|
});
|
|
2145
|
-
const
|
|
2163
|
+
const P = {
|
|
2146
2164
|
timespan: [
|
|
2147
2165
|
{
|
|
2148
2166
|
start: "-INF",
|
|
2149
2167
|
end: "+INF",
|
|
2150
2168
|
field: [],
|
|
2151
|
-
group:
|
|
2169
|
+
group: C
|
|
2152
2170
|
}
|
|
2153
2171
|
]
|
|
2154
|
-
},
|
|
2155
|
-
|
|
2156
|
-
const
|
|
2157
|
-
(N, _) =>
|
|
2172
|
+
}, E = [...new Set(h)], S = [];
|
|
2173
|
+
E.forEach((R) => {
|
|
2174
|
+
const y = t.itemType.metadata.timespan[0].group.find(
|
|
2175
|
+
(N, _) => R === _
|
|
2158
2176
|
);
|
|
2159
|
-
S.push(
|
|
2177
|
+
S.push(y.uuid);
|
|
2160
2178
|
});
|
|
2161
2179
|
try {
|
|
2162
|
-
await S.forEach((
|
|
2180
|
+
await S.forEach((R) => setTimeout(Ne.removeMetadata({ metadataUuid: R }), 500)), await ue.updateItemMetadata({
|
|
2163
2181
|
itemId: e,
|
|
2164
|
-
metadataDocument:
|
|
2182
|
+
metadataDocument: P
|
|
2165
2183
|
}), await s(), o(u), a();
|
|
2166
|
-
} catch (
|
|
2167
|
-
i(
|
|
2184
|
+
} catch (R) {
|
|
2185
|
+
i(R);
|
|
2168
2186
|
}
|
|
2169
2187
|
};
|
|
2170
2188
|
return Z(() => {
|
|
2171
2189
|
o(t.group);
|
|
2172
2190
|
}, [t]), {
|
|
2173
|
-
tableColumns:
|
|
2174
|
-
onChange:
|
|
2175
|
-
onSubmit:
|
|
2191
|
+
tableColumns: d,
|
|
2192
|
+
onChange: m,
|
|
2193
|
+
onSubmit: p
|
|
2176
2194
|
};
|
|
2177
2195
|
}
|
|
2178
|
-
function
|
|
2196
|
+
function rr({
|
|
2179
2197
|
entity: e,
|
|
2180
2198
|
entityId: t,
|
|
2181
|
-
queryParams:
|
|
2182
|
-
refreshOnMount:
|
|
2199
|
+
queryParams: r = {},
|
|
2200
|
+
refreshOnMount: n = !0
|
|
2183
2201
|
}) {
|
|
2184
2202
|
const {
|
|
2185
2203
|
request: o,
|
|
2186
2204
|
data: s = {},
|
|
2187
2205
|
isLoading: a,
|
|
2188
2206
|
isError: i
|
|
2189
|
-
} = j(Ne.getEntityMetadata),
|
|
2207
|
+
} = j(Ne.getEntityMetadata), d = () => o({ entity: e, entityId: t, queryParams: r });
|
|
2190
2208
|
return Z(() => {
|
|
2191
|
-
|
|
2192
|
-
}, [e, t,
|
|
2209
|
+
n && d();
|
|
2210
|
+
}, [e, t, r]), {
|
|
2193
2211
|
metadataType: s,
|
|
2194
2212
|
isLoading: a,
|
|
2195
2213
|
isError: i,
|
|
2196
|
-
onRefresh:
|
|
2214
|
+
onRefresh: d
|
|
2197
2215
|
};
|
|
2198
2216
|
}
|
|
2199
|
-
function
|
|
2217
|
+
function or({ groupName: e, queryParams: t = {}, refreshOnMount: r = !0 }) {
|
|
2200
2218
|
const {
|
|
2201
|
-
request:
|
|
2219
|
+
request: n,
|
|
2202
2220
|
data: o = {},
|
|
2203
2221
|
isLoading: s,
|
|
2204
2222
|
isError: a
|
|
2205
|
-
} = j(Ze.getFieldGroup), i = () =>
|
|
2223
|
+
} = j(Ze.getFieldGroup), i = () => n({ groupName: e, queryParams: t });
|
|
2206
2224
|
return Z(() => {
|
|
2207
|
-
|
|
2225
|
+
r && i();
|
|
2208
2226
|
}, [e, t]), {
|
|
2209
2227
|
metadataFieldGroupType: o,
|
|
2210
2228
|
isLoading: s,
|
|
@@ -2215,190 +2233,196 @@ function nn({ groupName: e, queryParams: t = {}, refreshOnMount: n = !0 }) {
|
|
|
2215
2233
|
function ho({
|
|
2216
2234
|
itemType: e,
|
|
2217
2235
|
collectionType: t,
|
|
2218
|
-
metadataType:
|
|
2219
|
-
joinValue:
|
|
2236
|
+
metadataType: r,
|
|
2237
|
+
joinValue: n = ",",
|
|
2220
2238
|
flat: o = !0,
|
|
2221
2239
|
groupAsList: s = !0,
|
|
2222
2240
|
children: a,
|
|
2223
2241
|
...i
|
|
2224
2242
|
}) {
|
|
2225
|
-
let
|
|
2243
|
+
let d = r;
|
|
2226
2244
|
if (e || t) {
|
|
2227
|
-
const
|
|
2228
|
-
|
|
2245
|
+
const p = e || t || {};
|
|
2246
|
+
d = p == null ? void 0 : p.metadata;
|
|
2229
2247
|
}
|
|
2230
2248
|
const u = he(
|
|
2231
|
-
() =>
|
|
2232
|
-
[o, s,
|
|
2249
|
+
() => nt(d, { joinValue: n, flat: o, groupAsList: s }),
|
|
2250
|
+
[o, s, n, d]
|
|
2233
2251
|
), c = {
|
|
2234
2252
|
...i,
|
|
2235
2253
|
...u,
|
|
2236
2254
|
itemType: e
|
|
2237
|
-
},
|
|
2238
|
-
return oe.map(a,
|
|
2255
|
+
}, m = (p) => se(p, c);
|
|
2256
|
+
return oe.map(a, m);
|
|
2239
2257
|
}
|
|
2240
2258
|
function Eo({
|
|
2241
2259
|
itemSearchDocument: e,
|
|
2242
2260
|
queryParams: t,
|
|
2243
|
-
matrixParams:
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2261
|
+
matrixParams: r,
|
|
2262
|
+
enableSearch2: n,
|
|
2263
|
+
responseRef: o,
|
|
2264
|
+
initialState: s,
|
|
2265
|
+
children: a
|
|
2247
2266
|
}) {
|
|
2248
2267
|
const {
|
|
2249
|
-
request:
|
|
2250
|
-
data:
|
|
2251
|
-
isLoading:
|
|
2252
|
-
isError:
|
|
2253
|
-
} = j(k.searchCollection,
|
|
2268
|
+
request: i,
|
|
2269
|
+
data: d = {},
|
|
2270
|
+
isLoading: u,
|
|
2271
|
+
isError: c
|
|
2272
|
+
} = j(k.searchCollection, s, o), m = () => i({
|
|
2273
|
+
itemSearchDocument: e,
|
|
2274
|
+
queryParams: t,
|
|
2275
|
+
matrixParams: r,
|
|
2276
|
+
...n ? { path: "/API/search2/collection/" } : {}
|
|
2277
|
+
});
|
|
2254
2278
|
Z(() => {
|
|
2255
|
-
|
|
2256
|
-
}, [e, t,
|
|
2279
|
+
m();
|
|
2280
|
+
}, [e, t, r]);
|
|
2257
2281
|
const p = {
|
|
2258
2282
|
itemSearchDocument: e,
|
|
2259
|
-
matrixParams:
|
|
2283
|
+
matrixParams: r,
|
|
2260
2284
|
queryParams: t,
|
|
2261
|
-
collectionListType:
|
|
2262
|
-
onRefresh:
|
|
2263
|
-
isLoading:
|
|
2264
|
-
isError:
|
|
2265
|
-
},
|
|
2266
|
-
return oe.map(
|
|
2285
|
+
collectionListType: d,
|
|
2286
|
+
onRefresh: m,
|
|
2287
|
+
isLoading: u,
|
|
2288
|
+
isError: c
|
|
2289
|
+
}, l = (h) => se(h, p);
|
|
2290
|
+
return oe.map(a, l);
|
|
2267
2291
|
}
|
|
2268
2292
|
function go({
|
|
2269
2293
|
itemSearchDocument: e,
|
|
2270
2294
|
queryParams: t,
|
|
2271
|
-
matrixParams:
|
|
2272
|
-
path:
|
|
2295
|
+
matrixParams: r,
|
|
2296
|
+
path: n,
|
|
2273
2297
|
children: o
|
|
2274
2298
|
}) {
|
|
2275
|
-
const { itemListType: s, onRefresh: a, isLoading: i, isError:
|
|
2299
|
+
const { itemListType: s, onRefresh: a, isLoading: i, isError: d } = Hn({
|
|
2276
2300
|
itemSearchDocument: e,
|
|
2277
2301
|
queryParams: t,
|
|
2278
|
-
matrixParams:
|
|
2279
|
-
path:
|
|
2302
|
+
matrixParams: r,
|
|
2303
|
+
path: n
|
|
2280
2304
|
}), u = {
|
|
2281
2305
|
itemSearchDocument: e,
|
|
2282
|
-
matrixParams:
|
|
2306
|
+
matrixParams: r,
|
|
2283
2307
|
queryParams: t,
|
|
2284
2308
|
itemListType: s,
|
|
2285
2309
|
onRefresh: a,
|
|
2286
2310
|
isLoading: i,
|
|
2287
|
-
isError:
|
|
2288
|
-
}, c = (
|
|
2311
|
+
isError: d
|
|
2312
|
+
}, c = (m) => se(m, u);
|
|
2289
2313
|
return oe.map(o, c);
|
|
2290
2314
|
}
|
|
2291
2315
|
function yo({
|
|
2292
2316
|
itemSearchDocument: e,
|
|
2293
2317
|
queryParams: t,
|
|
2294
|
-
matrixParams:
|
|
2295
|
-
children:
|
|
2318
|
+
matrixParams: r,
|
|
2319
|
+
children: n
|
|
2296
2320
|
}) {
|
|
2297
2321
|
const {
|
|
2298
2322
|
request: o,
|
|
2299
2323
|
data: s = {},
|
|
2300
2324
|
isLoading: a,
|
|
2301
2325
|
isError: i
|
|
2302
|
-
} = j(Ue.searchItemCollection),
|
|
2326
|
+
} = j(Ue.searchItemCollection), d = () => o({ itemSearchDocument: e, queryParams: t, matrixParams: r });
|
|
2303
2327
|
Z(() => {
|
|
2304
|
-
|
|
2305
|
-
}, [e, t,
|
|
2328
|
+
d();
|
|
2329
|
+
}, [e, t, r]);
|
|
2306
2330
|
const u = {
|
|
2307
2331
|
itemSearchDocument: e,
|
|
2308
|
-
matrixParams:
|
|
2332
|
+
matrixParams: r,
|
|
2309
2333
|
queryParams: t,
|
|
2310
2334
|
searchResultType: s,
|
|
2311
|
-
onRefresh:
|
|
2335
|
+
onRefresh: d,
|
|
2312
2336
|
isLoading: a,
|
|
2313
2337
|
isError: i
|
|
2314
|
-
}, c = (
|
|
2315
|
-
return oe.map(
|
|
2338
|
+
}, c = (m) => se(m, u);
|
|
2339
|
+
return oe.map(n, c);
|
|
2316
2340
|
}
|
|
2317
|
-
function Ao({ itemId: e, queryParams: t, refreshOnMount:
|
|
2318
|
-
const { itemType: o, onRefresh: s, isLoading: a, isError: i } =
|
|
2341
|
+
function Ao({ itemId: e, queryParams: t, refreshOnMount: r, children: n }) {
|
|
2342
|
+
const { itemType: o, onRefresh: s, isLoading: a, isError: i } = Qn({
|
|
2319
2343
|
itemId: e,
|
|
2320
2344
|
queryParams: t,
|
|
2321
|
-
refreshOnMount:
|
|
2322
|
-
}),
|
|
2345
|
+
refreshOnMount: r
|
|
2346
|
+
}), d = {
|
|
2323
2347
|
itemId: e,
|
|
2324
2348
|
queryParams: t,
|
|
2325
2349
|
itemType: o,
|
|
2326
2350
|
onRefresh: s,
|
|
2327
2351
|
isLoading: a,
|
|
2328
2352
|
isError: i
|
|
2329
|
-
}, u = (c) => se(c,
|
|
2330
|
-
return oe.map(
|
|
2353
|
+
}, u = (c) => se(c, d);
|
|
2354
|
+
return oe.map(n, u);
|
|
2331
2355
|
}
|
|
2332
|
-
function
|
|
2356
|
+
function So({
|
|
2333
2357
|
collectionId: e,
|
|
2334
2358
|
queryParams: t,
|
|
2335
|
-
refreshOnMount:
|
|
2336
|
-
children:
|
|
2359
|
+
refreshOnMount: r,
|
|
2360
|
+
children: n
|
|
2337
2361
|
}) {
|
|
2338
|
-
const { collectionType: o, onRefresh: s, isLoading: a, isError: i } =
|
|
2362
|
+
const { collectionType: o, onRefresh: s, isLoading: a, isError: i } = Ln({
|
|
2339
2363
|
collectionId: e,
|
|
2340
2364
|
queryParams: t,
|
|
2341
|
-
refreshOnMount:
|
|
2342
|
-
}),
|
|
2365
|
+
refreshOnMount: r
|
|
2366
|
+
}), d = {
|
|
2343
2367
|
collectionId: e,
|
|
2344
2368
|
queryParams: t,
|
|
2345
2369
|
collectionType: o,
|
|
2346
2370
|
onRefresh: s,
|
|
2347
2371
|
isLoading: a,
|
|
2348
2372
|
isError: i
|
|
2349
|
-
}, u = (c) => se(c,
|
|
2350
|
-
return oe.map(
|
|
2373
|
+
}, u = (c) => se(c, d);
|
|
2374
|
+
return oe.map(n, u);
|
|
2351
2375
|
}
|
|
2352
|
-
function
|
|
2353
|
-
const { request:
|
|
2376
|
+
function Co({ matrixParams: e, queryParams: t, children: r }) {
|
|
2377
|
+
const { request: n, data: o = {}, isLoading: s, isError: a } = j(et.listJob), i = () => n({ matrixParams: e, queryParams: t });
|
|
2354
2378
|
Z(() => {
|
|
2355
2379
|
i();
|
|
2356
2380
|
}, [e, t]);
|
|
2357
|
-
const
|
|
2381
|
+
const d = {
|
|
2358
2382
|
matrixParams: e,
|
|
2359
2383
|
queryParams: t,
|
|
2360
2384
|
onRefresh: i,
|
|
2361
2385
|
isLoading: s,
|
|
2362
2386
|
isError: a,
|
|
2363
2387
|
jobs: o
|
|
2364
|
-
}, u = (c) => se(c,
|
|
2365
|
-
return oe.map(
|
|
2388
|
+
}, u = (c) => se(c, d);
|
|
2389
|
+
return oe.map(r, u);
|
|
2366
2390
|
}
|
|
2367
|
-
function vo({ entityId: e, entityType: t, queryParams:
|
|
2368
|
-
const { request: o, data: s = {}, isLoading: a } = j(Pe.listEntityAccess), i = () => o({ entityId: e, entityType: t, queryParams:
|
|
2391
|
+
function vo({ entityId: e, entityType: t, queryParams: r, children: n }) {
|
|
2392
|
+
const { request: o, data: s = {}, isLoading: a } = j(Pe.listEntityAccess), i = () => o({ entityId: e, entityType: t, queryParams: r });
|
|
2369
2393
|
$(() => {
|
|
2370
2394
|
i();
|
|
2371
|
-
}, [e, t,
|
|
2372
|
-
const
|
|
2395
|
+
}, [e, t, r]);
|
|
2396
|
+
const d = {
|
|
2373
2397
|
entityId: e,
|
|
2374
2398
|
entityType: t,
|
|
2375
|
-
queryParams:
|
|
2399
|
+
queryParams: r,
|
|
2376
2400
|
accessControlList: s,
|
|
2377
2401
|
onRefresh: i,
|
|
2378
2402
|
isLoading: a
|
|
2379
|
-
}, u = (c) => se(c,
|
|
2380
|
-
return oe.map(
|
|
2403
|
+
}, u = (c) => se(c, d);
|
|
2404
|
+
return oe.map(n, u);
|
|
2381
2405
|
}
|
|
2382
2406
|
class lt extends ze {
|
|
2383
2407
|
constructor(t) {
|
|
2384
2408
|
super(t);
|
|
2385
|
-
const { serverUrl:
|
|
2386
|
-
|
|
2409
|
+
const { serverUrl: r, token: n, username: o, password: s, runAs: a } = t;
|
|
2410
|
+
r && (Q.defaultClient.defaults.baseURL = r), n ? Q.defaultClient.defaults.headers.Authorization = `token ${n}` : Q.defaultClient.defaults.auth = { username: o, password: s }, a && (Q.defaultClient.defaults.headers.RunAs = a);
|
|
2387
2411
|
}
|
|
2388
2412
|
componentDidUpdate(t) {
|
|
2389
|
-
const { serverUrl:
|
|
2390
|
-
t.serverUrl !==
|
|
2413
|
+
const { serverUrl: r, token: n, username: o, password: s, runAs: a } = this.props;
|
|
2414
|
+
t.serverUrl !== r && (r ? Q.defaultClient.defaults.baseURL = r : delete Q.defaultClient.defaults.baseURL), t.token !== n && (n ? Q.defaultClient.defaults.headers.Authorization = `token ${n}` : delete Q.defaultClient.defaults.headers.Authorization), !n && (t.username !== o || t.password !== s) && (Q.defaultClient.defaults.auth = { username: o, password: s }), t.runAs !== a && (a ? Q.defaultClient.defaults.headers.RunAs = a : delete Q.defaultClient.defaults.headers.RunAs);
|
|
2391
2415
|
}
|
|
2392
2416
|
render() {
|
|
2393
|
-
const { children: t, username:
|
|
2417
|
+
const { children: t, username: r, serverUrl: n } = this.props, o = { username: r, serverUrl: n }, s = (a) => se(a, o);
|
|
2394
2418
|
return oe.map(t, s);
|
|
2395
2419
|
}
|
|
2396
2420
|
}
|
|
2397
|
-
const ye = "VIDISPINE-TOKEN", Ae = "VIDISPINE-USERNAME",
|
|
2398
|
-
|
|
2399
|
-
const
|
|
2421
|
+
const ye = "VIDISPINE-TOKEN", Ae = "VIDISPINE-USERNAME", Se = "VIDISPINE-SERVER-URL", Ce = "VIDISPINE-REMEMBER-ME", sr = ({ userName: e, password: t, serverUrl: r }) => {
|
|
2422
|
+
r && (Q.defaultClient.defaults.baseURL = r);
|
|
2423
|
+
const n = { seconds: 2592e3, autoRefresh: "true" }, o = { password: t, username: e };
|
|
2400
2424
|
try {
|
|
2401
|
-
X.getToken({ queryParams:
|
|
2425
|
+
X.getToken({ queryParams: n, headers: o }).then(({ data: s }) => s).catch(({ response: s = {}, message: a = "Unknown error." }) => {
|
|
2402
2426
|
let i = a;
|
|
2403
2427
|
throw s.status === 401 && (i = "Incorrect Username/Password"), i;
|
|
2404
2428
|
});
|
|
@@ -2409,62 +2433,62 @@ const ye = "VIDISPINE-TOKEN", Ae = "VIDISPINE-USERNAME", Ce = "VIDISPINE-SERVER-
|
|
|
2409
2433
|
function To({
|
|
2410
2434
|
LoginComponent: e,
|
|
2411
2435
|
LoginProps: t = {},
|
|
2412
|
-
AppComponent:
|
|
2413
|
-
AppProps:
|
|
2414
|
-
onGetToken: o =
|
|
2436
|
+
AppComponent: r,
|
|
2437
|
+
AppProps: n = {},
|
|
2438
|
+
onGetToken: o = sr,
|
|
2415
2439
|
onSuccess: s,
|
|
2416
2440
|
onError: a,
|
|
2417
2441
|
cookieOptions: i = {
|
|
2418
2442
|
maxAge: 604800,
|
|
2419
2443
|
path: "/"
|
|
2420
2444
|
},
|
|
2421
|
-
...
|
|
2445
|
+
...d
|
|
2422
2446
|
}) {
|
|
2423
|
-
const [u, c,
|
|
2447
|
+
const [u, c, m] = ot([
|
|
2424
2448
|
ye,
|
|
2425
2449
|
Ae,
|
|
2426
|
-
|
|
2427
|
-
|
|
2450
|
+
Se,
|
|
2451
|
+
Ce
|
|
2428
2452
|
]), {
|
|
2429
|
-
[ye]:
|
|
2430
|
-
[Ae]:
|
|
2431
|
-
[
|
|
2432
|
-
} = u,
|
|
2433
|
-
return
|
|
2434
|
-
|
|
2435
|
-
}, ...
|
|
2453
|
+
[ye]: p,
|
|
2454
|
+
[Ae]: l,
|
|
2455
|
+
[Se]: h
|
|
2456
|
+
} = u, f = u[Ce] === "true";
|
|
2457
|
+
return p ? /* @__PURE__ */ B(lt, { token: p, username: l, serverUrl: h, children: /* @__PURE__ */ B(r, { onLogout: () => {
|
|
2458
|
+
m(ye, i), f || (m(Ae, i), m(Se, i), m(Ce, i));
|
|
2459
|
+
}, ...d, ...n }) }) : /* @__PURE__ */ B(
|
|
2436
2460
|
e,
|
|
2437
2461
|
{
|
|
2438
|
-
onLogin: (
|
|
2439
|
-
let
|
|
2462
|
+
onLogin: (P) => {
|
|
2463
|
+
let E;
|
|
2440
2464
|
try {
|
|
2441
|
-
o(
|
|
2465
|
+
o(P).then((S) => {
|
|
2442
2466
|
const {
|
|
2443
|
-
userName:
|
|
2444
|
-
serverUrl:
|
|
2467
|
+
userName: R,
|
|
2468
|
+
serverUrl: y,
|
|
2445
2469
|
rememberMe: N
|
|
2446
|
-
} =
|
|
2447
|
-
|
|
2470
|
+
} = P;
|
|
2471
|
+
R && c(Ae, R, i), y && c(Se, y, i), N && c(Ce, N, i), S && c(ye, S, i), s && s(P);
|
|
2448
2472
|
}).catch((S) => {
|
|
2449
|
-
if (
|
|
2450
|
-
return a(
|
|
2451
|
-
throw
|
|
2473
|
+
if (E = S, a)
|
|
2474
|
+
return a(E);
|
|
2475
|
+
throw E;
|
|
2452
2476
|
});
|
|
2453
2477
|
} catch (S) {
|
|
2454
|
-
if (
|
|
2455
|
-
return a(
|
|
2478
|
+
if (E = S, a)
|
|
2479
|
+
return a(E);
|
|
2456
2480
|
}
|
|
2457
|
-
return
|
|
2481
|
+
return E;
|
|
2458
2482
|
},
|
|
2459
|
-
userName:
|
|
2483
|
+
userName: l,
|
|
2460
2484
|
serverUrl: h,
|
|
2461
|
-
rememberMe:
|
|
2462
|
-
...
|
|
2485
|
+
rememberMe: f,
|
|
2486
|
+
...d,
|
|
2463
2487
|
...t
|
|
2464
2488
|
}
|
|
2465
2489
|
);
|
|
2466
2490
|
}
|
|
2467
|
-
function
|
|
2491
|
+
function ar({ error: e, info: t }) {
|
|
2468
2492
|
return /* @__PURE__ */ Ot(
|
|
2469
2493
|
"div",
|
|
2470
2494
|
{
|
|
@@ -2483,180 +2507,180 @@ function sn({ error: e, info: t }) {
|
|
|
2483
2507
|
}
|
|
2484
2508
|
);
|
|
2485
2509
|
}
|
|
2486
|
-
class
|
|
2510
|
+
class ir extends ze {
|
|
2487
2511
|
constructor(t) {
|
|
2488
2512
|
super(t), this.state = { hasError: !1 };
|
|
2489
2513
|
}
|
|
2490
2514
|
static getDerivedStateFromError(t) {
|
|
2491
2515
|
return { error: t, hasError: !0 };
|
|
2492
2516
|
}
|
|
2493
|
-
shouldComponentUpdate(t,
|
|
2494
|
-
const { hasError:
|
|
2495
|
-
return !(o === s &&
|
|
2517
|
+
shouldComponentUpdate(t, r) {
|
|
2518
|
+
const { hasError: n, info: o } = this.state, { info: s } = r;
|
|
2519
|
+
return !(o === s && n === !0);
|
|
2496
2520
|
}
|
|
2497
|
-
componentDidCatch(t,
|
|
2498
|
-
const { onError:
|
|
2499
|
-
if (typeof
|
|
2521
|
+
componentDidCatch(t, r) {
|
|
2522
|
+
const { onError: n } = this.props;
|
|
2523
|
+
if (typeof n == "function")
|
|
2500
2524
|
try {
|
|
2501
|
-
|
|
2525
|
+
n(t, r);
|
|
2502
2526
|
} catch {
|
|
2503
2527
|
return;
|
|
2504
2528
|
}
|
|
2505
|
-
this.setState({ info:
|
|
2529
|
+
this.setState({ info: r });
|
|
2506
2530
|
}
|
|
2507
2531
|
render() {
|
|
2508
|
-
const { children: t } = this.props, { hasError:
|
|
2509
|
-
return
|
|
2532
|
+
const { children: t } = this.props, { hasError: r, error: n, info: o } = this.state;
|
|
2533
|
+
return r ? /* @__PURE__ */ B(ar, { info: o, error: n }) : t;
|
|
2510
2534
|
}
|
|
2511
2535
|
}
|
|
2512
|
-
function Ro({ groupName: e, queryParams: t, refreshOnMount:
|
|
2513
|
-
const { metadataFieldGroupType: o, onRefresh: s, isLoading: a, isError: i } =
|
|
2536
|
+
function Ro({ groupName: e, queryParams: t, refreshOnMount: r, children: n }) {
|
|
2537
|
+
const { metadataFieldGroupType: o, onRefresh: s, isLoading: a, isError: i } = or({
|
|
2514
2538
|
groupName: e,
|
|
2515
2539
|
queryParams: t,
|
|
2516
|
-
refreshOnMount:
|
|
2517
|
-
}),
|
|
2540
|
+
refreshOnMount: r
|
|
2541
|
+
}), d = {
|
|
2518
2542
|
groupName: e,
|
|
2519
2543
|
queryParams: t,
|
|
2520
2544
|
metadataFieldGroupType: o,
|
|
2521
2545
|
onRefresh: s,
|
|
2522
2546
|
isLoading: a,
|
|
2523
2547
|
isError: i
|
|
2524
|
-
}, u = (c) => se(c,
|
|
2525
|
-
return oe.map(
|
|
2548
|
+
}, u = (c) => se(c, d);
|
|
2549
|
+
return oe.map(n, u);
|
|
2526
2550
|
}
|
|
2527
2551
|
const dt = Ee();
|
|
2528
|
-
function Po({ intialState: e = {}, onRefresh: t, userName:
|
|
2552
|
+
function Po({ intialState: e = {}, onRefresh: t, userName: r, children: n }) {
|
|
2529
2553
|
const [o, s] = x(e);
|
|
2530
2554
|
return $(() => {
|
|
2531
|
-
if (
|
|
2532
|
-
X.getUserRole({ userName:
|
|
2555
|
+
if (r)
|
|
2556
|
+
X.getUserRole({ userName: r }).then(({ data: i }) => {
|
|
2533
2557
|
s(i), t && t(i);
|
|
2534
2558
|
});
|
|
2535
2559
|
else {
|
|
2536
2560
|
let i;
|
|
2537
|
-
X.whoAmI().then(({ data:
|
|
2538
|
-
s(
|
|
2561
|
+
X.whoAmI().then(({ data: d }) => (i = d, X.getUserRole({ userName: d }))).then(({ data: d }) => {
|
|
2562
|
+
s(d), t && t(d, i);
|
|
2539
2563
|
});
|
|
2540
2564
|
}
|
|
2541
|
-
}, [
|
|
2565
|
+
}, [r]), /* @__PURE__ */ B(dt.Provider, { value: o, children: n });
|
|
2542
2566
|
}
|
|
2543
|
-
function
|
|
2567
|
+
function cr() {
|
|
2544
2568
|
const e = Ie(dt);
|
|
2545
2569
|
if (e === void 0)
|
|
2546
2570
|
throw new Error("useRoles must be used within RolesContext");
|
|
2547
|
-
return { hasRole: (
|
|
2548
|
-
if (
|
|
2571
|
+
return { hasRole: (r) => {
|
|
2572
|
+
if (r === void 0)
|
|
2549
2573
|
throw new Error("roleName is undefined");
|
|
2550
|
-
const { group:
|
|
2551
|
-
if (!Array.isArray(
|
|
2574
|
+
const { group: n } = e;
|
|
2575
|
+
if (!Array.isArray(n))
|
|
2552
2576
|
return null;
|
|
2553
|
-
const o =
|
|
2554
|
-
return o.includes(Gt.SUPER_ACCESS_USER) ? !0 : Array.isArray(
|
|
2577
|
+
const o = n.map(({ groupName: s }) => s);
|
|
2578
|
+
return o.includes(Gt.SUPER_ACCESS_USER) ? !0 : Array.isArray(r) ? r.findIndex((s) => o.includes(s)) > -1 : o.includes(r);
|
|
2555
2579
|
}, groupListType: e };
|
|
2556
2580
|
}
|
|
2557
|
-
function No({ roleName: e, allow: t, deny:
|
|
2581
|
+
function No({ roleName: e, allow: t, deny: r, loading: n }) {
|
|
2558
2582
|
if (e === void 0)
|
|
2559
2583
|
throw new Error("roleName is undefined");
|
|
2560
|
-
const { hasRole: o } =
|
|
2561
|
-
return _e(t) && s === !0 ? t : _e(
|
|
2584
|
+
const { hasRole: o } = cr(), s = o(e);
|
|
2585
|
+
return _e(t) && s === !0 ? t : _e(r) && s === !1 ? r : _e(n) && s === null ? n : null;
|
|
2562
2586
|
}
|
|
2563
|
-
function Io({ providers: e = [], children: t, ...
|
|
2564
|
-
return e.reduceRight((
|
|
2587
|
+
function Io({ providers: e = [], children: t, ...r }) {
|
|
2588
|
+
return e.reduceRight((n, o) => {
|
|
2565
2589
|
if (typeof o == "function")
|
|
2566
|
-
return /* @__PURE__ */ B(o, { ...
|
|
2590
|
+
return /* @__PURE__ */ B(o, { ...r, children: n });
|
|
2567
2591
|
const { provider: s, ...a } = o;
|
|
2568
|
-
return /* @__PURE__ */ B(s, { ...
|
|
2592
|
+
return /* @__PURE__ */ B(s, { ...r, ...a, children: n });
|
|
2569
2593
|
}, t);
|
|
2570
2594
|
}
|
|
2571
2595
|
function _o({
|
|
2572
2596
|
entity: e,
|
|
2573
2597
|
entityId: t,
|
|
2574
|
-
queryParams:
|
|
2575
|
-
refreshOnMount:
|
|
2598
|
+
queryParams: r,
|
|
2599
|
+
refreshOnMount: n,
|
|
2576
2600
|
children: o
|
|
2577
2601
|
}) {
|
|
2578
|
-
const { metadataType: s, onRefresh: a, isLoading: i, isError:
|
|
2602
|
+
const { metadataType: s, onRefresh: a, isLoading: i, isError: d } = rr({
|
|
2579
2603
|
entity: e,
|
|
2580
2604
|
entityId: t,
|
|
2581
|
-
queryParams:
|
|
2582
|
-
refreshOnMount:
|
|
2605
|
+
queryParams: r,
|
|
2606
|
+
refreshOnMount: n
|
|
2583
2607
|
}), u = {
|
|
2584
2608
|
entity: e,
|
|
2585
2609
|
entityId: t,
|
|
2586
|
-
queryParams:
|
|
2610
|
+
queryParams: r,
|
|
2587
2611
|
metadataType: s,
|
|
2588
2612
|
onRefresh: a,
|
|
2589
2613
|
isLoading: i,
|
|
2590
|
-
isError:
|
|
2614
|
+
isError: d
|
|
2591
2615
|
};
|
|
2592
2616
|
e === "collection" ? u.collectionId = t : e === "item" && (u.itemId = t);
|
|
2593
|
-
const c = (
|
|
2617
|
+
const c = (m) => se(m, u);
|
|
2594
2618
|
return oe.map(o, c);
|
|
2595
2619
|
}
|
|
2596
|
-
const bo = (e, t = {}) => (
|
|
2597
|
-
(t,
|
|
2620
|
+
const bo = (e, t = {}) => (r) => /* @__PURE__ */ B(ir, { ...t, children: /* @__PURE__ */ B(e, { ...r }) }), Go = (...e) => e.reduce(
|
|
2621
|
+
(t, r) => (...n) => t(r(...n)),
|
|
2598
2622
|
(t) => t
|
|
2599
|
-
),
|
|
2623
|
+
), ur = Ee(), lr = (e, { entityId: t, entityType: r, entityTimespan: { start: n, end: o, field: [{ name: s } = {}] = [] } = {} }) => {
|
|
2600
2624
|
const a = e.some(
|
|
2601
|
-
(
|
|
2625
|
+
(d) => d.entity.id === t && d.entityType === r
|
|
2602
2626
|
);
|
|
2603
2627
|
let i = !1;
|
|
2604
2628
|
return a && e.filter(
|
|
2605
|
-
(u) => u.entity.id === t && u.entityType ===
|
|
2629
|
+
(u) => u.entity.id === t && u.entityType === r
|
|
2606
2630
|
).forEach(
|
|
2607
2631
|
({
|
|
2608
|
-
entityTimespan: { start: u, end: c, field: [{ name:
|
|
2632
|
+
entityTimespan: { start: u, end: c, field: [{ name: m } = {}] = [] } = {}
|
|
2609
2633
|
}) => {
|
|
2610
|
-
|
|
2634
|
+
n === u && o === c && s === m && (i = !0);
|
|
2611
2635
|
}
|
|
2612
2636
|
), !a || !i;
|
|
2613
2637
|
};
|
|
2614
2638
|
function wo({
|
|
2615
2639
|
onChange: e,
|
|
2616
2640
|
children: t,
|
|
2617
|
-
initialState:
|
|
2618
|
-
allowDuplicates:
|
|
2619
|
-
isUniqueBinItem: o =
|
|
2641
|
+
initialState: r = [],
|
|
2642
|
+
allowDuplicates: n = !1,
|
|
2643
|
+
isUniqueBinItem: o = lr
|
|
2620
2644
|
}) {
|
|
2621
|
-
const [s, a] = x(
|
|
2622
|
-
(
|
|
2623
|
-
if (!
|
|
2645
|
+
const [s, a] = x(r), [i, d] = x(n), u = v(
|
|
2646
|
+
(f) => {
|
|
2647
|
+
if (!f || !["string", "number"].includes(typeof f)) {
|
|
2624
2648
|
console.error("BinProvider onDelete called without a binId of the entity to delete");
|
|
2625
2649
|
return;
|
|
2626
2650
|
}
|
|
2627
|
-
a((
|
|
2628
|
-
const
|
|
2629
|
-
return e && e(
|
|
2651
|
+
a((A) => {
|
|
2652
|
+
const C = A.filter((P) => P.binId !== f);
|
|
2653
|
+
return e && e(C), C;
|
|
2630
2654
|
});
|
|
2631
2655
|
},
|
|
2632
2656
|
[e]
|
|
2633
|
-
), c =
|
|
2657
|
+
), c = v(() => {
|
|
2634
2658
|
a([]), e && e([]);
|
|
2635
|
-
}, [e]),
|
|
2636
|
-
const [
|
|
2637
|
-
return { binId:
|
|
2638
|
-
},
|
|
2639
|
-
({ dragInfo:
|
|
2640
|
-
const { entityId:
|
|
2641
|
-
if (!
|
|
2659
|
+
}, [e]), m = (f) => {
|
|
2660
|
+
const [A] = at().split("-");
|
|
2661
|
+
return { binId: A, ...f };
|
|
2662
|
+
}, p = v(
|
|
2663
|
+
({ dragInfo: f = {} } = {}) => {
|
|
2664
|
+
const { entityId: A, entityType: C, entity: P } = f;
|
|
2665
|
+
if (!A || !C || !P)
|
|
2642
2666
|
throw new Error("Dragged element needs to have entityId, entityType and entity props");
|
|
2643
|
-
a((
|
|
2644
|
-
if (o(
|
|
2645
|
-
const S = [...
|
|
2667
|
+
a((E = []) => {
|
|
2668
|
+
if (o(E, f) || i) {
|
|
2669
|
+
const S = [...E, m(f)];
|
|
2646
2670
|
return e && e(S), S;
|
|
2647
2671
|
}
|
|
2648
|
-
return
|
|
2672
|
+
return E;
|
|
2649
2673
|
});
|
|
2650
2674
|
},
|
|
2651
2675
|
[i, o, e]
|
|
2652
|
-
),
|
|
2653
|
-
({ dragId:
|
|
2654
|
-
|
|
2655
|
-
const
|
|
2656
|
-
return [y
|
|
2657
|
-
|
|
2658
|
-
y
|
|
2659
|
-
], e && e(
|
|
2676
|
+
), l = v(
|
|
2677
|
+
({ dragId: f, hoverId: A, originalDragIndex: C }) => {
|
|
2678
|
+
f === void 0 || A === void 0 && C === void 0 || a((P) => {
|
|
2679
|
+
const E = [...P], S = s.findIndex((N) => N.binId === f), R = s.findIndex((N) => N.binId === A), y = R > -1 ? R : C;
|
|
2680
|
+
return [E[y], E[S]] = [
|
|
2681
|
+
E[S],
|
|
2682
|
+
E[y]
|
|
2683
|
+
], e && e(E), E;
|
|
2660
2684
|
});
|
|
2661
2685
|
},
|
|
2662
2686
|
[s, e]
|
|
@@ -2665,18 +2689,18 @@ function wo({
|
|
|
2665
2689
|
setBin: a,
|
|
2666
2690
|
bin: s,
|
|
2667
2691
|
allowDuplicates: i,
|
|
2668
|
-
setAllowDuplicates:
|
|
2669
|
-
onDrop:
|
|
2670
|
-
onSort:
|
|
2692
|
+
setAllowDuplicates: d,
|
|
2693
|
+
onDrop: p,
|
|
2694
|
+
onSort: l,
|
|
2671
2695
|
onFind: () => null,
|
|
2672
2696
|
onEmptyBin: c,
|
|
2673
2697
|
onDelete: u
|
|
2674
2698
|
}),
|
|
2675
|
-
[i, s,
|
|
2699
|
+
[i, s, p, l, u, c]
|
|
2676
2700
|
);
|
|
2677
|
-
return /* @__PURE__ */ B(
|
|
2701
|
+
return /* @__PURE__ */ B(ur.Provider, { value: h, children: t });
|
|
2678
2702
|
}
|
|
2679
|
-
function
|
|
2703
|
+
function dr(e) {
|
|
2680
2704
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2681
2705
|
}
|
|
2682
2706
|
var Le = { exports: {} };
|
|
@@ -2686,12 +2710,12 @@ object-assign
|
|
|
2686
2710
|
@license MIT
|
|
2687
2711
|
*/
|
|
2688
2712
|
var be, je;
|
|
2689
|
-
function
|
|
2713
|
+
function fr() {
|
|
2690
2714
|
if (je)
|
|
2691
2715
|
return be;
|
|
2692
2716
|
je = 1;
|
|
2693
|
-
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty,
|
|
2694
|
-
function
|
|
2717
|
+
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
|
|
2718
|
+
function n(s) {
|
|
2695
2719
|
if (s == null)
|
|
2696
2720
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
2697
2721
|
return Object(s);
|
|
@@ -2705,10 +2729,10 @@ function fn() {
|
|
|
2705
2729
|
return !1;
|
|
2706
2730
|
for (var a = {}, i = 0; i < 10; i++)
|
|
2707
2731
|
a["_" + String.fromCharCode(i)] = i;
|
|
2708
|
-
var
|
|
2732
|
+
var d = Object.getOwnPropertyNames(a).map(function(c) {
|
|
2709
2733
|
return a[c];
|
|
2710
2734
|
});
|
|
2711
|
-
if (
|
|
2735
|
+
if (d.join("") !== "0123456789")
|
|
2712
2736
|
return !1;
|
|
2713
2737
|
var u = {};
|
|
2714
2738
|
return "abcdefghijklmnopqrst".split("").forEach(function(c) {
|
|
@@ -2719,17 +2743,17 @@ function fn() {
|
|
|
2719
2743
|
}
|
|
2720
2744
|
}
|
|
2721
2745
|
return be = o() ? Object.assign : function(s, a) {
|
|
2722
|
-
for (var i,
|
|
2746
|
+
for (var i, d = n(s), u, c = 1; c < arguments.length; c++) {
|
|
2723
2747
|
i = Object(arguments[c]);
|
|
2724
|
-
for (var
|
|
2725
|
-
t.call(i,
|
|
2748
|
+
for (var m in i)
|
|
2749
|
+
t.call(i, m) && (d[m] = i[m]);
|
|
2726
2750
|
if (e) {
|
|
2727
2751
|
u = e(i);
|
|
2728
|
-
for (var
|
|
2729
|
-
|
|
2752
|
+
for (var p = 0; p < u.length; p++)
|
|
2753
|
+
r.call(i, u[p]) && (d[u[p]] = i[u[p]]);
|
|
2730
2754
|
}
|
|
2731
2755
|
}
|
|
2732
|
-
return
|
|
2756
|
+
return d;
|
|
2733
2757
|
}, be;
|
|
2734
2758
|
}
|
|
2735
2759
|
var Ge, We;
|
|
@@ -2745,14 +2769,14 @@ function ft() {
|
|
|
2745
2769
|
return Ve || (Ve = 1, we = Function.call.bind(Object.prototype.hasOwnProperty)), we;
|
|
2746
2770
|
}
|
|
2747
2771
|
var De, ke;
|
|
2748
|
-
function
|
|
2772
|
+
function mr() {
|
|
2749
2773
|
if (ke)
|
|
2750
2774
|
return De;
|
|
2751
2775
|
ke = 1;
|
|
2752
2776
|
var e = function() {
|
|
2753
2777
|
};
|
|
2754
2778
|
if (process.env.NODE_ENV !== "production") {
|
|
2755
|
-
var t = Me(),
|
|
2779
|
+
var t = Me(), r = {}, n = ft();
|
|
2756
2780
|
e = function(s) {
|
|
2757
2781
|
var a = "Warning: " + s;
|
|
2758
2782
|
typeof console < "u" && console.error(a);
|
|
@@ -2762,312 +2786,312 @@ function mn() {
|
|
|
2762
2786
|
}
|
|
2763
2787
|
};
|
|
2764
2788
|
}
|
|
2765
|
-
function o(s, a, i,
|
|
2789
|
+
function o(s, a, i, d, u) {
|
|
2766
2790
|
if (process.env.NODE_ENV !== "production") {
|
|
2767
2791
|
for (var c in s)
|
|
2768
|
-
if (
|
|
2769
|
-
var
|
|
2792
|
+
if (n(s, c)) {
|
|
2793
|
+
var m;
|
|
2770
2794
|
try {
|
|
2771
2795
|
if (typeof s[c] != "function") {
|
|
2772
|
-
var
|
|
2773
|
-
(
|
|
2796
|
+
var p = Error(
|
|
2797
|
+
(d || "React class") + ": " + i + " type `" + c + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[c] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
2774
2798
|
);
|
|
2775
|
-
throw
|
|
2799
|
+
throw p.name = "Invariant Violation", p;
|
|
2776
2800
|
}
|
|
2777
|
-
|
|
2801
|
+
m = s[c](a, c, d, i, null, t);
|
|
2778
2802
|
} catch (h) {
|
|
2779
|
-
|
|
2803
|
+
m = h;
|
|
2780
2804
|
}
|
|
2781
|
-
if (
|
|
2782
|
-
(
|
|
2783
|
-
),
|
|
2784
|
-
|
|
2785
|
-
var
|
|
2805
|
+
if (m && !(m instanceof Error) && e(
|
|
2806
|
+
(d || "React class") + ": type specification of " + i + " `" + c + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof m + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
2807
|
+
), m instanceof Error && !(m.message in r)) {
|
|
2808
|
+
r[m.message] = !0;
|
|
2809
|
+
var l = u ? u() : "";
|
|
2786
2810
|
e(
|
|
2787
|
-
"Failed " + i + " type: " +
|
|
2811
|
+
"Failed " + i + " type: " + m.message + (l ?? "")
|
|
2788
2812
|
);
|
|
2789
2813
|
}
|
|
2790
2814
|
}
|
|
2791
2815
|
}
|
|
2792
2816
|
}
|
|
2793
2817
|
return o.resetWarningCache = function() {
|
|
2794
|
-
process.env.NODE_ENV !== "production" && (
|
|
2818
|
+
process.env.NODE_ENV !== "production" && (r = {});
|
|
2795
2819
|
}, De = o, De;
|
|
2796
2820
|
}
|
|
2797
2821
|
var Oe, Ye;
|
|
2798
|
-
function
|
|
2822
|
+
function pr() {
|
|
2799
2823
|
if (Ye)
|
|
2800
2824
|
return Oe;
|
|
2801
2825
|
Ye = 1;
|
|
2802
|
-
var e = st, t =
|
|
2826
|
+
var e = st, t = fr(), r = Me(), n = ft(), o = mr(), s = function() {
|
|
2803
2827
|
};
|
|
2804
2828
|
process.env.NODE_ENV !== "production" && (s = function(i) {
|
|
2805
|
-
var
|
|
2806
|
-
typeof console < "u" && console.error(
|
|
2829
|
+
var d = "Warning: " + i;
|
|
2830
|
+
typeof console < "u" && console.error(d);
|
|
2807
2831
|
try {
|
|
2808
|
-
throw new Error(
|
|
2832
|
+
throw new Error(d);
|
|
2809
2833
|
} catch {
|
|
2810
2834
|
}
|
|
2811
2835
|
});
|
|
2812
2836
|
function a() {
|
|
2813
2837
|
return null;
|
|
2814
2838
|
}
|
|
2815
|
-
return Oe = function(i,
|
|
2839
|
+
return Oe = function(i, d) {
|
|
2816
2840
|
var u = typeof Symbol == "function" && Symbol.iterator, c = "@@iterator";
|
|
2817
|
-
function
|
|
2818
|
-
var
|
|
2819
|
-
if (typeof
|
|
2820
|
-
return
|
|
2821
|
-
}
|
|
2822
|
-
var
|
|
2823
|
-
array:
|
|
2824
|
-
bigint:
|
|
2825
|
-
bool:
|
|
2826
|
-
func:
|
|
2827
|
-
number:
|
|
2828
|
-
object:
|
|
2829
|
-
string:
|
|
2830
|
-
symbol:
|
|
2831
|
-
any:
|
|
2832
|
-
arrayOf:
|
|
2841
|
+
function m(g) {
|
|
2842
|
+
var T = g && (u && g[u] || g[c]);
|
|
2843
|
+
if (typeof T == "function")
|
|
2844
|
+
return T;
|
|
2845
|
+
}
|
|
2846
|
+
var p = "<<anonymous>>", l = {
|
|
2847
|
+
array: C("array"),
|
|
2848
|
+
bigint: C("bigint"),
|
|
2849
|
+
bool: C("boolean"),
|
|
2850
|
+
func: C("function"),
|
|
2851
|
+
number: C("number"),
|
|
2852
|
+
object: C("object"),
|
|
2853
|
+
string: C("string"),
|
|
2854
|
+
symbol: C("symbol"),
|
|
2855
|
+
any: P(),
|
|
2856
|
+
arrayOf: E,
|
|
2833
2857
|
element: S(),
|
|
2834
|
-
elementType:
|
|
2835
|
-
instanceOf:
|
|
2858
|
+
elementType: R(),
|
|
2859
|
+
instanceOf: y,
|
|
2836
2860
|
node: W(),
|
|
2837
2861
|
objectOf: _,
|
|
2838
2862
|
oneOf: N,
|
|
2839
2863
|
oneOfType: b,
|
|
2840
|
-
shape:
|
|
2841
|
-
exact:
|
|
2864
|
+
shape: J,
|
|
2865
|
+
exact: ne
|
|
2842
2866
|
};
|
|
2843
|
-
function h(
|
|
2844
|
-
return
|
|
2867
|
+
function h(g, T) {
|
|
2868
|
+
return g === T ? g !== 0 || 1 / g === 1 / T : g !== g && T !== T;
|
|
2845
2869
|
}
|
|
2846
|
-
function
|
|
2847
|
-
this.message =
|
|
2870
|
+
function f(g, T) {
|
|
2871
|
+
this.message = g, this.data = T && typeof T == "object" ? T : {}, this.stack = "";
|
|
2848
2872
|
}
|
|
2849
|
-
|
|
2850
|
-
function
|
|
2873
|
+
f.prototype = Error.prototype;
|
|
2874
|
+
function A(g) {
|
|
2851
2875
|
if (process.env.NODE_ENV !== "production")
|
|
2852
|
-
var
|
|
2876
|
+
var T = {}, O = 0;
|
|
2853
2877
|
function w(H, G, D, L, F, U, ee) {
|
|
2854
|
-
if (L = L ||
|
|
2855
|
-
if (
|
|
2878
|
+
if (L = L || p, U = U || D, ee !== r) {
|
|
2879
|
+
if (d) {
|
|
2856
2880
|
var K = new Error(
|
|
2857
2881
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
2858
2882
|
);
|
|
2859
2883
|
throw K.name = "Invariant Violation", K;
|
|
2860
2884
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
2861
2885
|
var le = L + ":" + D;
|
|
2862
|
-
!
|
|
2886
|
+
!T[le] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
2863
2887
|
O < 3 && (s(
|
|
2864
2888
|
"You are manually calling a React.PropTypes validation function for the `" + U + "` prop on `" + L + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
2865
|
-
),
|
|
2889
|
+
), T[le] = !0, O++);
|
|
2866
2890
|
}
|
|
2867
2891
|
}
|
|
2868
|
-
return G[D] == null ? H ? G[D] === null ? new
|
|
2892
|
+
return G[D] == null ? H ? G[D] === null ? new f("The " + F + " `" + U + "` is marked as required " + ("in `" + L + "`, but its value is `null`.")) : new f("The " + F + " `" + U + "` is marked as required in " + ("`" + L + "`, but its value is `undefined`.")) : null : g(G, D, L, F, U);
|
|
2869
2893
|
}
|
|
2870
2894
|
var I = w.bind(null, !1);
|
|
2871
2895
|
return I.isRequired = w.bind(null, !0), I;
|
|
2872
2896
|
}
|
|
2873
|
-
function
|
|
2874
|
-
function
|
|
2897
|
+
function C(g) {
|
|
2898
|
+
function T(O, w, I, H, G, D) {
|
|
2875
2899
|
var L = O[w], F = ie(L);
|
|
2876
|
-
if (F !==
|
|
2900
|
+
if (F !== g) {
|
|
2877
2901
|
var U = me(L);
|
|
2878
|
-
return new
|
|
2879
|
-
"Invalid " + H + " `" + G + "` of type " + ("`" + U + "` supplied to `" + I + "`, expected ") + ("`" +
|
|
2880
|
-
{ expectedType:
|
|
2902
|
+
return new f(
|
|
2903
|
+
"Invalid " + H + " `" + G + "` of type " + ("`" + U + "` supplied to `" + I + "`, expected ") + ("`" + g + "`."),
|
|
2904
|
+
{ expectedType: g }
|
|
2881
2905
|
);
|
|
2882
2906
|
}
|
|
2883
2907
|
return null;
|
|
2884
2908
|
}
|
|
2885
|
-
return
|
|
2909
|
+
return A(T);
|
|
2886
2910
|
}
|
|
2887
|
-
function
|
|
2888
|
-
return
|
|
2911
|
+
function P() {
|
|
2912
|
+
return A(a);
|
|
2889
2913
|
}
|
|
2890
|
-
function
|
|
2891
|
-
function
|
|
2892
|
-
if (typeof
|
|
2893
|
-
return new
|
|
2914
|
+
function E(g) {
|
|
2915
|
+
function T(O, w, I, H, G) {
|
|
2916
|
+
if (typeof g != "function")
|
|
2917
|
+
return new f("Property `" + G + "` of component `" + I + "` has invalid PropType notation inside arrayOf.");
|
|
2894
2918
|
var D = O[w];
|
|
2895
2919
|
if (!Array.isArray(D)) {
|
|
2896
2920
|
var L = ie(D);
|
|
2897
|
-
return new
|
|
2921
|
+
return new f("Invalid " + H + " `" + G + "` of type " + ("`" + L + "` supplied to `" + I + "`, expected an array."));
|
|
2898
2922
|
}
|
|
2899
2923
|
for (var F = 0; F < D.length; F++) {
|
|
2900
|
-
var U =
|
|
2924
|
+
var U = g(D, F, I, H, G + "[" + F + "]", r);
|
|
2901
2925
|
if (U instanceof Error)
|
|
2902
2926
|
return U;
|
|
2903
2927
|
}
|
|
2904
2928
|
return null;
|
|
2905
2929
|
}
|
|
2906
|
-
return
|
|
2930
|
+
return A(T);
|
|
2907
2931
|
}
|
|
2908
2932
|
function S() {
|
|
2909
|
-
function
|
|
2910
|
-
var G =
|
|
2933
|
+
function g(T, O, w, I, H) {
|
|
2934
|
+
var G = T[O];
|
|
2911
2935
|
if (!i(G)) {
|
|
2912
2936
|
var D = ie(G);
|
|
2913
|
-
return new
|
|
2937
|
+
return new f("Invalid " + I + " `" + H + "` of type " + ("`" + D + "` supplied to `" + w + "`, expected a single ReactElement."));
|
|
2914
2938
|
}
|
|
2915
2939
|
return null;
|
|
2916
2940
|
}
|
|
2917
|
-
return
|
|
2941
|
+
return A(g);
|
|
2918
2942
|
}
|
|
2919
|
-
function
|
|
2920
|
-
function
|
|
2921
|
-
var G =
|
|
2943
|
+
function R() {
|
|
2944
|
+
function g(T, O, w, I, H) {
|
|
2945
|
+
var G = T[O];
|
|
2922
2946
|
if (!e.isValidElementType(G)) {
|
|
2923
2947
|
var D = ie(G);
|
|
2924
|
-
return new
|
|
2948
|
+
return new f("Invalid " + I + " `" + H + "` of type " + ("`" + D + "` supplied to `" + w + "`, expected a single ReactElement type."));
|
|
2925
2949
|
}
|
|
2926
2950
|
return null;
|
|
2927
2951
|
}
|
|
2928
|
-
return
|
|
2952
|
+
return A(g);
|
|
2929
2953
|
}
|
|
2930
|
-
function
|
|
2931
|
-
function
|
|
2932
|
-
if (!(O[w] instanceof
|
|
2933
|
-
var D =
|
|
2934
|
-
return new
|
|
2954
|
+
function y(g) {
|
|
2955
|
+
function T(O, w, I, H, G) {
|
|
2956
|
+
if (!(O[w] instanceof g)) {
|
|
2957
|
+
var D = g.name || p, L = Tt(O[w]);
|
|
2958
|
+
return new f("Invalid " + H + " `" + G + "` of type " + ("`" + L + "` supplied to `" + I + "`, expected ") + ("instance of `" + D + "`."));
|
|
2935
2959
|
}
|
|
2936
2960
|
return null;
|
|
2937
2961
|
}
|
|
2938
|
-
return
|
|
2962
|
+
return A(T);
|
|
2939
2963
|
}
|
|
2940
|
-
function N(
|
|
2941
|
-
if (!Array.isArray(
|
|
2964
|
+
function N(g) {
|
|
2965
|
+
if (!Array.isArray(g))
|
|
2942
2966
|
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s(
|
|
2943
2967
|
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
2944
2968
|
) : s("Invalid argument supplied to oneOf, expected an array.")), a;
|
|
2945
|
-
function
|
|
2946
|
-
for (var D = O[w], L = 0; L <
|
|
2947
|
-
if (h(D,
|
|
2969
|
+
function T(O, w, I, H, G) {
|
|
2970
|
+
for (var D = O[w], L = 0; L < g.length; L++)
|
|
2971
|
+
if (h(D, g[L]))
|
|
2948
2972
|
return null;
|
|
2949
|
-
var F = JSON.stringify(
|
|
2973
|
+
var F = JSON.stringify(g, function(ee, K) {
|
|
2950
2974
|
var le = me(K);
|
|
2951
2975
|
return le === "symbol" ? String(K) : K;
|
|
2952
2976
|
});
|
|
2953
|
-
return new
|
|
2977
|
+
return new f("Invalid " + H + " `" + G + "` of value `" + String(D) + "` " + ("supplied to `" + I + "`, expected one of " + F + "."));
|
|
2954
2978
|
}
|
|
2955
|
-
return
|
|
2979
|
+
return A(T);
|
|
2956
2980
|
}
|
|
2957
|
-
function _(
|
|
2958
|
-
function
|
|
2959
|
-
if (typeof
|
|
2960
|
-
return new
|
|
2981
|
+
function _(g) {
|
|
2982
|
+
function T(O, w, I, H, G) {
|
|
2983
|
+
if (typeof g != "function")
|
|
2984
|
+
return new f("Property `" + G + "` of component `" + I + "` has invalid PropType notation inside objectOf.");
|
|
2961
2985
|
var D = O[w], L = ie(D);
|
|
2962
2986
|
if (L !== "object")
|
|
2963
|
-
return new
|
|
2987
|
+
return new f("Invalid " + H + " `" + G + "` of type " + ("`" + L + "` supplied to `" + I + "`, expected an object."));
|
|
2964
2988
|
for (var F in D)
|
|
2965
|
-
if (
|
|
2966
|
-
var U =
|
|
2989
|
+
if (n(D, F)) {
|
|
2990
|
+
var U = g(D, F, I, H, G + "." + F, r);
|
|
2967
2991
|
if (U instanceof Error)
|
|
2968
2992
|
return U;
|
|
2969
2993
|
}
|
|
2970
2994
|
return null;
|
|
2971
2995
|
}
|
|
2972
|
-
return
|
|
2996
|
+
return A(T);
|
|
2973
2997
|
}
|
|
2974
|
-
function b(
|
|
2975
|
-
if (!Array.isArray(
|
|
2998
|
+
function b(g) {
|
|
2999
|
+
if (!Array.isArray(g))
|
|
2976
3000
|
return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), a;
|
|
2977
|
-
for (var
|
|
2978
|
-
var O =
|
|
3001
|
+
for (var T = 0; T < g.length; T++) {
|
|
3002
|
+
var O = g[T];
|
|
2979
3003
|
if (typeof O != "function")
|
|
2980
3004
|
return s(
|
|
2981
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + vt(O) + " at index " +
|
|
3005
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + vt(O) + " at index " + T + "."
|
|
2982
3006
|
), a;
|
|
2983
3007
|
}
|
|
2984
3008
|
function w(I, H, G, D, L) {
|
|
2985
|
-
for (var F = [], U = 0; U <
|
|
2986
|
-
var ee =
|
|
3009
|
+
for (var F = [], U = 0; U < g.length; U++) {
|
|
3010
|
+
var ee = g[U], K = ee(I, H, G, D, L, r);
|
|
2987
3011
|
if (K == null)
|
|
2988
3012
|
return null;
|
|
2989
|
-
K.data &&
|
|
3013
|
+
K.data && n(K.data, "expectedType") && F.push(K.data.expectedType);
|
|
2990
3014
|
}
|
|
2991
3015
|
var le = F.length > 0 ? ", expected one of type [" + F.join(", ") + "]" : "";
|
|
2992
|
-
return new
|
|
3016
|
+
return new f("Invalid " + D + " `" + L + "` supplied to " + ("`" + G + "`" + le + "."));
|
|
2993
3017
|
}
|
|
2994
|
-
return
|
|
3018
|
+
return A(w);
|
|
2995
3019
|
}
|
|
2996
3020
|
function W() {
|
|
2997
|
-
function
|
|
2998
|
-
return
|
|
3021
|
+
function g(T, O, w, I, H) {
|
|
3022
|
+
return re(T[O]) ? null : new f("Invalid " + I + " `" + H + "` supplied to " + ("`" + w + "`, expected a ReactNode."));
|
|
2999
3023
|
}
|
|
3000
|
-
return
|
|
3024
|
+
return A(g);
|
|
3001
3025
|
}
|
|
3002
|
-
function V(
|
|
3003
|
-
return new
|
|
3004
|
-
(
|
|
3026
|
+
function V(g, T, O, w, I) {
|
|
3027
|
+
return new f(
|
|
3028
|
+
(g || "React class") + ": " + T + " type `" + O + "." + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + I + "`."
|
|
3005
3029
|
);
|
|
3006
3030
|
}
|
|
3007
|
-
function
|
|
3008
|
-
function
|
|
3031
|
+
function J(g) {
|
|
3032
|
+
function T(O, w, I, H, G) {
|
|
3009
3033
|
var D = O[w], L = ie(D);
|
|
3010
3034
|
if (L !== "object")
|
|
3011
|
-
return new
|
|
3012
|
-
for (var F in
|
|
3013
|
-
var U =
|
|
3035
|
+
return new f("Invalid " + H + " `" + G + "` of type `" + L + "` " + ("supplied to `" + I + "`, expected `object`."));
|
|
3036
|
+
for (var F in g) {
|
|
3037
|
+
var U = g[F];
|
|
3014
3038
|
if (typeof U != "function")
|
|
3015
3039
|
return V(I, H, G, F, me(U));
|
|
3016
|
-
var ee = U(D, F, I, H, G + "." + F,
|
|
3040
|
+
var ee = U(D, F, I, H, G + "." + F, r);
|
|
3017
3041
|
if (ee)
|
|
3018
3042
|
return ee;
|
|
3019
3043
|
}
|
|
3020
3044
|
return null;
|
|
3021
3045
|
}
|
|
3022
|
-
return
|
|
3046
|
+
return A(T);
|
|
3023
3047
|
}
|
|
3024
|
-
function
|
|
3025
|
-
function
|
|
3048
|
+
function ne(g) {
|
|
3049
|
+
function T(O, w, I, H, G) {
|
|
3026
3050
|
var D = O[w], L = ie(D);
|
|
3027
3051
|
if (L !== "object")
|
|
3028
|
-
return new
|
|
3029
|
-
var F = t({}, O[w],
|
|
3052
|
+
return new f("Invalid " + H + " `" + G + "` of type `" + L + "` " + ("supplied to `" + I + "`, expected `object`."));
|
|
3053
|
+
var F = t({}, O[w], g);
|
|
3030
3054
|
for (var U in F) {
|
|
3031
|
-
var ee =
|
|
3032
|
-
if (
|
|
3055
|
+
var ee = g[U];
|
|
3056
|
+
if (n(g, U) && typeof ee != "function")
|
|
3033
3057
|
return V(I, H, G, U, me(ee));
|
|
3034
3058
|
if (!ee)
|
|
3035
|
-
return new
|
|
3059
|
+
return new f(
|
|
3036
3060
|
"Invalid " + H + " `" + G + "` key `" + U + "` supplied to `" + I + "`.\nBad object: " + JSON.stringify(O[w], null, " ") + `
|
|
3037
|
-
Valid keys: ` + JSON.stringify(Object.keys(
|
|
3061
|
+
Valid keys: ` + JSON.stringify(Object.keys(g), null, " ")
|
|
3038
3062
|
);
|
|
3039
|
-
var K = ee(D, U, I, H, G + "." + U,
|
|
3063
|
+
var K = ee(D, U, I, H, G + "." + U, r);
|
|
3040
3064
|
if (K)
|
|
3041
3065
|
return K;
|
|
3042
3066
|
}
|
|
3043
3067
|
return null;
|
|
3044
3068
|
}
|
|
3045
|
-
return
|
|
3069
|
+
return A(T);
|
|
3046
3070
|
}
|
|
3047
|
-
function
|
|
3048
|
-
switch (typeof
|
|
3071
|
+
function re(g) {
|
|
3072
|
+
switch (typeof g) {
|
|
3049
3073
|
case "number":
|
|
3050
3074
|
case "string":
|
|
3051
3075
|
case "undefined":
|
|
3052
3076
|
return !0;
|
|
3053
3077
|
case "boolean":
|
|
3054
|
-
return !
|
|
3078
|
+
return !g;
|
|
3055
3079
|
case "object":
|
|
3056
|
-
if (Array.isArray(
|
|
3057
|
-
return
|
|
3058
|
-
if (
|
|
3080
|
+
if (Array.isArray(g))
|
|
3081
|
+
return g.every(re);
|
|
3082
|
+
if (g === null || i(g))
|
|
3059
3083
|
return !0;
|
|
3060
|
-
var
|
|
3061
|
-
if (
|
|
3062
|
-
var O =
|
|
3063
|
-
if (
|
|
3084
|
+
var T = m(g);
|
|
3085
|
+
if (T) {
|
|
3086
|
+
var O = T.call(g), w;
|
|
3087
|
+
if (T !== g.entries) {
|
|
3064
3088
|
for (; !(w = O.next()).done; )
|
|
3065
|
-
if (!
|
|
3089
|
+
if (!re(w.value))
|
|
3066
3090
|
return !1;
|
|
3067
3091
|
} else
|
|
3068
3092
|
for (; !(w = O.next()).done; ) {
|
|
3069
3093
|
var I = w.value;
|
|
3070
|
-
if (I && !
|
|
3094
|
+
if (I && !re(I[1]))
|
|
3071
3095
|
return !1;
|
|
3072
3096
|
}
|
|
3073
3097
|
} else
|
|
@@ -3077,113 +3101,113 @@ Valid keys: ` + JSON.stringify(Object.keys(E), null, " ")
|
|
|
3077
3101
|
return !1;
|
|
3078
3102
|
}
|
|
3079
3103
|
}
|
|
3080
|
-
function
|
|
3081
|
-
return
|
|
3104
|
+
function Ct(g, T) {
|
|
3105
|
+
return g === "symbol" ? !0 : T ? T["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && T instanceof Symbol : !1;
|
|
3082
3106
|
}
|
|
3083
|
-
function ie(
|
|
3084
|
-
var
|
|
3085
|
-
return Array.isArray(
|
|
3107
|
+
function ie(g) {
|
|
3108
|
+
var T = typeof g;
|
|
3109
|
+
return Array.isArray(g) ? "array" : g instanceof RegExp ? "object" : Ct(T, g) ? "symbol" : T;
|
|
3086
3110
|
}
|
|
3087
|
-
function me(
|
|
3088
|
-
if (typeof
|
|
3089
|
-
return "" +
|
|
3090
|
-
var
|
|
3091
|
-
if (
|
|
3092
|
-
if (
|
|
3111
|
+
function me(g) {
|
|
3112
|
+
if (typeof g > "u" || g === null)
|
|
3113
|
+
return "" + g;
|
|
3114
|
+
var T = ie(g);
|
|
3115
|
+
if (T === "object") {
|
|
3116
|
+
if (g instanceof Date)
|
|
3093
3117
|
return "date";
|
|
3094
|
-
if (
|
|
3118
|
+
if (g instanceof RegExp)
|
|
3095
3119
|
return "regexp";
|
|
3096
3120
|
}
|
|
3097
|
-
return
|
|
3121
|
+
return T;
|
|
3098
3122
|
}
|
|
3099
|
-
function vt(
|
|
3100
|
-
var
|
|
3101
|
-
switch (
|
|
3123
|
+
function vt(g) {
|
|
3124
|
+
var T = me(g);
|
|
3125
|
+
switch (T) {
|
|
3102
3126
|
case "array":
|
|
3103
3127
|
case "object":
|
|
3104
|
-
return "an " +
|
|
3128
|
+
return "an " + T;
|
|
3105
3129
|
case "boolean":
|
|
3106
3130
|
case "date":
|
|
3107
3131
|
case "regexp":
|
|
3108
|
-
return "a " +
|
|
3132
|
+
return "a " + T;
|
|
3109
3133
|
default:
|
|
3110
|
-
return
|
|
3134
|
+
return T;
|
|
3111
3135
|
}
|
|
3112
3136
|
}
|
|
3113
|
-
function Tt(
|
|
3114
|
-
return !
|
|
3137
|
+
function Tt(g) {
|
|
3138
|
+
return !g.constructor || !g.constructor.name ? p : g.constructor.name;
|
|
3115
3139
|
}
|
|
3116
|
-
return
|
|
3140
|
+
return l.checkPropTypes = o, l.resetWarningCache = o.resetWarningCache, l.PropTypes = l, l;
|
|
3117
3141
|
}, Oe;
|
|
3118
3142
|
}
|
|
3119
3143
|
var He, Be;
|
|
3120
|
-
function
|
|
3144
|
+
function hr() {
|
|
3121
3145
|
if (Be)
|
|
3122
3146
|
return He;
|
|
3123
3147
|
Be = 1;
|
|
3124
3148
|
var e = Me();
|
|
3125
3149
|
function t() {
|
|
3126
3150
|
}
|
|
3127
|
-
function
|
|
3151
|
+
function r() {
|
|
3128
3152
|
}
|
|
3129
|
-
return
|
|
3130
|
-
function
|
|
3131
|
-
if (
|
|
3132
|
-
var
|
|
3153
|
+
return r.resetWarningCache = t, He = function() {
|
|
3154
|
+
function n(a, i, d, u, c, m) {
|
|
3155
|
+
if (m !== e) {
|
|
3156
|
+
var p = new Error(
|
|
3133
3157
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
3134
3158
|
);
|
|
3135
|
-
throw
|
|
3159
|
+
throw p.name = "Invariant Violation", p;
|
|
3136
3160
|
}
|
|
3137
3161
|
}
|
|
3138
|
-
|
|
3162
|
+
n.isRequired = n;
|
|
3139
3163
|
function o() {
|
|
3140
|
-
return
|
|
3164
|
+
return n;
|
|
3141
3165
|
}
|
|
3142
3166
|
var s = {
|
|
3143
|
-
array:
|
|
3144
|
-
bigint:
|
|
3145
|
-
bool:
|
|
3146
|
-
func:
|
|
3147
|
-
number:
|
|
3148
|
-
object:
|
|
3149
|
-
string:
|
|
3150
|
-
symbol:
|
|
3151
|
-
any:
|
|
3167
|
+
array: n,
|
|
3168
|
+
bigint: n,
|
|
3169
|
+
bool: n,
|
|
3170
|
+
func: n,
|
|
3171
|
+
number: n,
|
|
3172
|
+
object: n,
|
|
3173
|
+
string: n,
|
|
3174
|
+
symbol: n,
|
|
3175
|
+
any: n,
|
|
3152
3176
|
arrayOf: o,
|
|
3153
|
-
element:
|
|
3154
|
-
elementType:
|
|
3177
|
+
element: n,
|
|
3178
|
+
elementType: n,
|
|
3155
3179
|
instanceOf: o,
|
|
3156
|
-
node:
|
|
3180
|
+
node: n,
|
|
3157
3181
|
objectOf: o,
|
|
3158
3182
|
oneOf: o,
|
|
3159
3183
|
oneOfType: o,
|
|
3160
3184
|
shape: o,
|
|
3161
3185
|
exact: o,
|
|
3162
|
-
checkPropTypes:
|
|
3186
|
+
checkPropTypes: r,
|
|
3163
3187
|
resetWarningCache: t
|
|
3164
3188
|
};
|
|
3165
3189
|
return s.PropTypes = s, s;
|
|
3166
3190
|
}, He;
|
|
3167
3191
|
}
|
|
3168
3192
|
if (process.env.NODE_ENV !== "production") {
|
|
3169
|
-
var
|
|
3170
|
-
Le.exports =
|
|
3193
|
+
var Er = st, gr = !0;
|
|
3194
|
+
Le.exports = pr()(Er.isElement, gr);
|
|
3171
3195
|
} else
|
|
3172
|
-
Le.exports =
|
|
3173
|
-
var
|
|
3174
|
-
const q = /* @__PURE__ */
|
|
3196
|
+
Le.exports = hr()();
|
|
3197
|
+
var yr = Le.exports;
|
|
3198
|
+
const q = /* @__PURE__ */ dr(yr), mt = Ee(), pt = Ee(), Fe = "UPDATE_ALL_SETTINGS", ht = "UPDATE_SETTING", Et = "UPDATE_USERNAME", gt = "REMOVE_SETTING", Ar = (e, t) => {
|
|
3175
3199
|
switch (t.type) {
|
|
3176
3200
|
case Et:
|
|
3177
3201
|
return { ...e, userName: t.userName };
|
|
3178
3202
|
case Fe:
|
|
3179
3203
|
return { ...e, settings: t.settings };
|
|
3180
3204
|
case ht: {
|
|
3181
|
-
const
|
|
3182
|
-
return { ...e, settings:
|
|
3205
|
+
const r = { ...e.settings, ...t.setting };
|
|
3206
|
+
return { ...e, settings: r };
|
|
3183
3207
|
}
|
|
3184
3208
|
case gt: {
|
|
3185
|
-
const
|
|
3186
|
-
return delete
|
|
3209
|
+
const r = { ...e.settings };
|
|
3210
|
+
return delete r[t.key], { ...e, settings: r };
|
|
3187
3211
|
}
|
|
3188
3212
|
default:
|
|
3189
3213
|
return e;
|
|
@@ -3192,14 +3216,14 @@ const q = /* @__PURE__ */ dn(yn), mt = Ee(), pt = Ee(), Fe = "UPDATE_ALL_SETTING
|
|
|
3192
3216
|
function yt({
|
|
3193
3217
|
userName: e,
|
|
3194
3218
|
settingsKey: t,
|
|
3195
|
-
children:
|
|
3196
|
-
initialSettings:
|
|
3219
|
+
children: r,
|
|
3220
|
+
initialSettings: n,
|
|
3197
3221
|
onChange: o,
|
|
3198
3222
|
getSettingsApi: s,
|
|
3199
3223
|
updateSettingsApi: a
|
|
3200
3224
|
}) {
|
|
3201
|
-
const [i,
|
|
3202
|
-
settings:
|
|
3225
|
+
const [i, d] = fe(Ar, {
|
|
3226
|
+
settings: n,
|
|
3203
3227
|
userName: e
|
|
3204
3228
|
}), u = z();
|
|
3205
3229
|
return $(() => {
|
|
@@ -3208,66 +3232,66 @@ function yt({
|
|
|
3208
3232
|
entityType: "user",
|
|
3209
3233
|
entityId: c,
|
|
3210
3234
|
key: t
|
|
3211
|
-
}).then(({ data:
|
|
3212
|
-
|
|
3235
|
+
}).then(({ data: m }) => {
|
|
3236
|
+
d({
|
|
3213
3237
|
type: Fe,
|
|
3214
|
-
settings:
|
|
3238
|
+
settings: m,
|
|
3215
3239
|
userName: c,
|
|
3216
3240
|
settingsKey: t
|
|
3217
|
-
}), u.current = JSON.stringify(
|
|
3218
|
-
}).catch((
|
|
3219
|
-
const { response:
|
|
3220
|
-
if (
|
|
3221
|
-
throw new Error(
|
|
3241
|
+
}), u.current = JSON.stringify(m);
|
|
3242
|
+
}).catch((m) => {
|
|
3243
|
+
const { response: p } = m;
|
|
3244
|
+
if (p.status !== 404)
|
|
3245
|
+
throw new Error(m);
|
|
3222
3246
|
});
|
|
3223
3247
|
}, [i.userName]), $(() => {
|
|
3224
3248
|
o && o(i.settings);
|
|
3225
3249
|
const { userName: c } = i;
|
|
3226
3250
|
if (!a || !c)
|
|
3227
3251
|
return;
|
|
3228
|
-
const
|
|
3229
|
-
!
|
|
3252
|
+
const m = JSON.stringify(i.settings), p = u.current;
|
|
3253
|
+
!p || m === p || (a({
|
|
3230
3254
|
entityType: "user",
|
|
3231
3255
|
entityId: c,
|
|
3232
3256
|
key: t,
|
|
3233
|
-
value:
|
|
3234
|
-
}), u.current =
|
|
3235
|
-
}, [i.settings]), /* @__PURE__ */ B(pt.Provider, { value: i, children: /* @__PURE__ */ B(mt.Provider, { value:
|
|
3257
|
+
value: m
|
|
3258
|
+
}), u.current = m);
|
|
3259
|
+
}, [i.settings]), /* @__PURE__ */ B(pt.Provider, { value: i, children: /* @__PURE__ */ B(mt.Provider, { value: d, children: r }) });
|
|
3236
3260
|
}
|
|
3237
|
-
const
|
|
3261
|
+
const Sr = () => {
|
|
3238
3262
|
const e = Ie(pt);
|
|
3239
3263
|
if (!e)
|
|
3240
3264
|
throw new Error("useSettingsState must be used within SettingsStateContext");
|
|
3241
3265
|
return e;
|
|
3242
|
-
},
|
|
3266
|
+
}, Cr = () => {
|
|
3243
3267
|
const e = Ie(mt);
|
|
3244
3268
|
if (!e)
|
|
3245
3269
|
throw new Error("useSettingsDispatch must be used within SettingsDispatchContext");
|
|
3246
3270
|
return e;
|
|
3247
|
-
},
|
|
3248
|
-
const e =
|
|
3271
|
+
}, vr = () => {
|
|
3272
|
+
const e = Cr(), t = v(
|
|
3249
3273
|
(s) => e({ type: Fe, settings: s }),
|
|
3250
3274
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3251
3275
|
[]
|
|
3252
|
-
),
|
|
3276
|
+
), r = v(
|
|
3253
3277
|
(s) => e({ type: ht, setting: s }),
|
|
3254
3278
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3255
3279
|
[]
|
|
3256
|
-
),
|
|
3280
|
+
), n = v(
|
|
3257
3281
|
(s) => e({ type: Et, userName: s }),
|
|
3258
3282
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3259
3283
|
[]
|
|
3260
|
-
), o =
|
|
3284
|
+
), o = v((s) => e({ type: gt, key: s }), []);
|
|
3261
3285
|
return {
|
|
3262
3286
|
updateAllSettings: t,
|
|
3263
|
-
updateSetting:
|
|
3264
|
-
updateUsername:
|
|
3287
|
+
updateSetting: r,
|
|
3288
|
+
updateUsername: n,
|
|
3265
3289
|
removeSetting: o
|
|
3266
3290
|
};
|
|
3267
3291
|
}, Do = () => {
|
|
3268
|
-
const { settings: e = {} } =
|
|
3292
|
+
const { settings: e = {} } = Sr();
|
|
3269
3293
|
return {
|
|
3270
|
-
...
|
|
3294
|
+
...vr(),
|
|
3271
3295
|
settings: e
|
|
3272
3296
|
};
|
|
3273
3297
|
};
|
|
@@ -3289,25 +3313,25 @@ yt.defaultProps = {
|
|
|
3289
3313
|
getSettingsApi: Ne.getSimpleMetadataKey,
|
|
3290
3314
|
updateSettingsApi: Ne.updateSimpleMetadataKey
|
|
3291
3315
|
};
|
|
3292
|
-
const ve = "VIDISPINE-TOKEN", pe = "VIDISPINE-USERNAME", Te = "VIDISPINE-SERVER-URL", Re = "VIDISPINE-REMEMBER-ME",
|
|
3316
|
+
const ve = "VIDISPINE-TOKEN", pe = "VIDISPINE-USERNAME", Te = "VIDISPINE-SERVER-URL", Re = "VIDISPINE-REMEMBER-ME", Tr = "Incorrect username or password", Je = "Offline or CORS not configured", Qe = "Session expired", Rr = "VIDISPINE_URL mismatch", Xe = (e) => {
|
|
3293
3317
|
try {
|
|
3294
|
-
return tt.getSelfTest({ baseURL: e }).then(() =>
|
|
3318
|
+
return tt.getSelfTest({ baseURL: e }).then(() => Tr).catch(() => Je);
|
|
3295
3319
|
} catch {
|
|
3296
|
-
return Promise.resolve(
|
|
3320
|
+
return Promise.resolve(Je);
|
|
3297
3321
|
}
|
|
3298
|
-
},
|
|
3322
|
+
}, Pr = ({ maxAge: e = 60, userName: t, password: r, serverUrl: n }) => {
|
|
3299
3323
|
try {
|
|
3300
3324
|
return X.getToken({
|
|
3301
3325
|
queryParams: { seconds: e, autoRefresh: "true" },
|
|
3302
|
-
headers: { password:
|
|
3303
|
-
baseURL:
|
|
3326
|
+
headers: { password: r, username: t },
|
|
3327
|
+
baseURL: n
|
|
3304
3328
|
}).then(({ data: o }) => o).catch(
|
|
3305
|
-
() => Xe(
|
|
3329
|
+
() => Xe(n).then((o) => {
|
|
3306
3330
|
throw Error(o);
|
|
3307
3331
|
})
|
|
3308
3332
|
);
|
|
3309
3333
|
} catch {
|
|
3310
|
-
return Xe(
|
|
3334
|
+
return Xe(n).then((s) => {
|
|
3311
3335
|
throw Error(s);
|
|
3312
3336
|
});
|
|
3313
3337
|
}
|
|
@@ -3319,38 +3343,38 @@ const ve = "VIDISPINE-TOKEN", pe = "VIDISPINE-USERNAME", Te = "VIDISPINE-SERVER-
|
|
|
3319
3343
|
onLogin: () => null,
|
|
3320
3344
|
onLogout: () => null
|
|
3321
3345
|
});
|
|
3322
|
-
function
|
|
3346
|
+
function St({
|
|
3323
3347
|
cookieOptions: e,
|
|
3324
3348
|
LoginComponent: t,
|
|
3325
|
-
LoginProps:
|
|
3326
|
-
onGetToken:
|
|
3349
|
+
LoginProps: r,
|
|
3350
|
+
onGetToken: n,
|
|
3327
3351
|
onSuccess: o,
|
|
3328
3352
|
onError: s,
|
|
3329
3353
|
serverUrl: a,
|
|
3330
3354
|
userName: i,
|
|
3331
|
-
token:
|
|
3355
|
+
token: d,
|
|
3332
3356
|
children: u
|
|
3333
3357
|
}) {
|
|
3334
|
-
const { data: c, request:
|
|
3358
|
+
const { data: c, request: m } = j(X.getUser), [p, l, h] = ot([
|
|
3335
3359
|
ve,
|
|
3336
3360
|
pe,
|
|
3337
3361
|
Te,
|
|
3338
3362
|
Re
|
|
3339
3363
|
]), {
|
|
3340
|
-
[ve]:
|
|
3341
|
-
[pe]:
|
|
3342
|
-
[Te]:
|
|
3343
|
-
} =
|
|
3364
|
+
[ve]: f = d,
|
|
3365
|
+
[pe]: A = i,
|
|
3366
|
+
[Te]: C = a
|
|
3367
|
+
} = p, P = p[Re] === "true", { maxAge: E } = e, S = v(
|
|
3344
3368
|
(b) => {
|
|
3345
3369
|
let W;
|
|
3346
3370
|
try {
|
|
3347
|
-
return
|
|
3371
|
+
return n({ maxAge: E, ...b }).then((V) => {
|
|
3348
3372
|
const {
|
|
3349
|
-
userName:
|
|
3350
|
-
serverUrl:
|
|
3351
|
-
rememberMe:
|
|
3373
|
+
userName: J,
|
|
3374
|
+
serverUrl: ne,
|
|
3375
|
+
rememberMe: re
|
|
3352
3376
|
} = b;
|
|
3353
|
-
|
|
3377
|
+
J && l(pe, J, e), ne && l(Te, ne, e), re && l(Re, re, e), V && l(ve, V, e), m({ userName: J }), o && o(b);
|
|
3354
3378
|
}).catch((V) => {
|
|
3355
3379
|
W = V, s && s(W);
|
|
3356
3380
|
});
|
|
@@ -3359,55 +3383,55 @@ function Ct({
|
|
|
3359
3383
|
}
|
|
3360
3384
|
return W;
|
|
3361
3385
|
},
|
|
3362
|
-
[e,
|
|
3363
|
-
),
|
|
3364
|
-
h(ve, e),
|
|
3365
|
-
}, [e,
|
|
3366
|
-
$(() => (
|
|
3386
|
+
[e, E, s, n, o, m, l]
|
|
3387
|
+
), R = v(() => {
|
|
3388
|
+
h(ve, e), P || (h(pe, e), h(Te, e), h(Re, e));
|
|
3389
|
+
}, [e, P, h]), y = z(), N = z();
|
|
3390
|
+
$(() => (f && (y.current && Q.defaultClient.interceptors.response.eject(y.current), y.current = Q.defaultClient.interceptors.response.use(
|
|
3367
3391
|
(b) => b,
|
|
3368
3392
|
(b) => {
|
|
3369
3393
|
if (b.response)
|
|
3370
|
-
b.response.status === 401 && (
|
|
3394
|
+
b.response.status === 401 && (R(), s && s(Error(Qe)));
|
|
3371
3395
|
else {
|
|
3372
3396
|
const { config: { baseURL: W } = {} } = b;
|
|
3373
3397
|
N.current !== !0 && (N.current = !0, tt.getSelfTest({ baseURL: W }).then(() => {
|
|
3374
|
-
N.current = void 0,
|
|
3398
|
+
N.current = void 0, R(), s && s(Error(Qe));
|
|
3375
3399
|
}).catch(() => (N.current = void 0, null)));
|
|
3376
3400
|
}
|
|
3377
3401
|
return Promise.reject(b);
|
|
3378
3402
|
}
|
|
3379
3403
|
)), () => {
|
|
3380
|
-
|
|
3381
|
-
}), [
|
|
3382
|
-
|
|
3383
|
-
({ data: b }) =>
|
|
3404
|
+
y.current && Q.defaultClient.interceptors.response.eject(y.current);
|
|
3405
|
+
}), [R, s, f]), $(() => {
|
|
3406
|
+
f && A === void 0 && X.whoAmI().then(
|
|
3407
|
+
({ data: b }) => l(pe, b, e)
|
|
3384
3408
|
);
|
|
3385
|
-
}, [
|
|
3386
|
-
|
|
3387
|
-
}, [
|
|
3409
|
+
}, [A, f]), $(() => {
|
|
3410
|
+
f && C && a && C !== a && (R(), s && s(Error(Rr)));
|
|
3411
|
+
}, [f, C, a, R, s]);
|
|
3388
3412
|
const _ = he(
|
|
3389
3413
|
() => ({
|
|
3390
|
-
serverUrl:
|
|
3391
|
-
token:
|
|
3414
|
+
serverUrl: C,
|
|
3415
|
+
token: f,
|
|
3392
3416
|
userType: c,
|
|
3393
|
-
userName:
|
|
3417
|
+
userName: A,
|
|
3394
3418
|
onLogin: S,
|
|
3395
|
-
onLogout:
|
|
3419
|
+
onLogout: R
|
|
3396
3420
|
}),
|
|
3397
|
-
[S,
|
|
3421
|
+
[S, R, C, f, A, c]
|
|
3398
3422
|
);
|
|
3399
|
-
return
|
|
3423
|
+
return f ? /* @__PURE__ */ B(lt, { token: f, username: A, serverUrl: C, children: /* @__PURE__ */ B(At.Provider, { value: _, children: u }) }) : /* @__PURE__ */ B(
|
|
3400
3424
|
t,
|
|
3401
3425
|
{
|
|
3402
3426
|
onLogin: S,
|
|
3403
|
-
userName:
|
|
3404
|
-
serverUrl:
|
|
3405
|
-
rememberMe:
|
|
3406
|
-
...
|
|
3427
|
+
userName: A,
|
|
3428
|
+
serverUrl: C,
|
|
3429
|
+
rememberMe: P,
|
|
3430
|
+
...r
|
|
3407
3431
|
}
|
|
3408
3432
|
);
|
|
3409
3433
|
}
|
|
3410
|
-
|
|
3434
|
+
St.propTypes = {
|
|
3411
3435
|
cookieOptions: q.shape({
|
|
3412
3436
|
maxAge: q.number,
|
|
3413
3437
|
path: q.string
|
|
@@ -3422,13 +3446,13 @@ Ct.propTypes = {
|
|
|
3422
3446
|
userName: q.string,
|
|
3423
3447
|
token: q.string
|
|
3424
3448
|
};
|
|
3425
|
-
|
|
3449
|
+
St.defaultProps = {
|
|
3426
3450
|
cookieOptions: {
|
|
3427
3451
|
maxAge: 604800,
|
|
3428
3452
|
path: "/"
|
|
3429
3453
|
},
|
|
3430
3454
|
LoginProps: {},
|
|
3431
|
-
onGetToken:
|
|
3455
|
+
onGetToken: Pr,
|
|
3432
3456
|
children: null,
|
|
3433
3457
|
onSuccess: null,
|
|
3434
3458
|
onError: null,
|
|
@@ -3440,11 +3464,11 @@ const Oo = () => {
|
|
|
3440
3464
|
if (e === void 0)
|
|
3441
3465
|
throw new Error("useAuth must be used within an AuthContext");
|
|
3442
3466
|
return e;
|
|
3443
|
-
},
|
|
3444
|
-
if (
|
|
3467
|
+
}, Nr = ({ entityId: e, entityType: t, collectionId: r, rootParentId: n, onError: o }) => {
|
|
3468
|
+
if (r && r !== n)
|
|
3445
3469
|
try {
|
|
3446
3470
|
return k.addCollectionEntity({
|
|
3447
|
-
collectionId:
|
|
3471
|
+
collectionId: r,
|
|
3448
3472
|
entityId: e,
|
|
3449
3473
|
queryParams: {
|
|
3450
3474
|
type: t.toLowerCase()
|
|
@@ -3452,21 +3476,21 @@ const Oo = () => {
|
|
|
3452
3476
|
});
|
|
3453
3477
|
} catch (s) {
|
|
3454
3478
|
o({
|
|
3455
|
-
message: `Could not add ${e} to collection ${
|
|
3479
|
+
message: `Could not add ${e} to collection ${r}`,
|
|
3456
3480
|
error: s
|
|
3457
3481
|
});
|
|
3458
3482
|
}
|
|
3459
|
-
},
|
|
3483
|
+
}, Ir = ({
|
|
3460
3484
|
entityId: e,
|
|
3461
3485
|
entityType: t,
|
|
3462
|
-
collectionId:
|
|
3463
|
-
rootParentId:
|
|
3486
|
+
collectionId: r,
|
|
3487
|
+
rootParentId: n,
|
|
3464
3488
|
onError: o
|
|
3465
3489
|
}) => {
|
|
3466
|
-
if (
|
|
3490
|
+
if (r && r !== n)
|
|
3467
3491
|
try {
|
|
3468
3492
|
return k.removeCollectionEntity({
|
|
3469
|
-
collectionId:
|
|
3493
|
+
collectionId: r,
|
|
3470
3494
|
entityId: e,
|
|
3471
3495
|
queryParams: {
|
|
3472
3496
|
type: t.toLowerCase()
|
|
@@ -3474,77 +3498,77 @@ const Oo = () => {
|
|
|
3474
3498
|
});
|
|
3475
3499
|
} catch (s) {
|
|
3476
3500
|
o({
|
|
3477
|
-
message: `Could not remove ${e} from collection ${
|
|
3501
|
+
message: `Could not remove ${e} from collection ${r}`,
|
|
3478
3502
|
error: s
|
|
3479
3503
|
});
|
|
3480
3504
|
}
|
|
3481
3505
|
}, Ho = ({
|
|
3482
3506
|
entityId: e,
|
|
3483
3507
|
entityType: t,
|
|
3484
|
-
addToCollectionId:
|
|
3485
|
-
removeFromCollectionId:
|
|
3508
|
+
addToCollectionId: r,
|
|
3509
|
+
removeFromCollectionId: n,
|
|
3486
3510
|
rootParentId: o,
|
|
3487
|
-
onAddEntity: s =
|
|
3488
|
-
onRemoveEntity: a =
|
|
3511
|
+
onAddEntity: s = Nr,
|
|
3512
|
+
onRemoveEntity: a = Ir,
|
|
3489
3513
|
onMoved: i = () => null,
|
|
3490
|
-
onAdded:
|
|
3514
|
+
onAdded: d = () => null,
|
|
3491
3515
|
onRemoved: u = () => null,
|
|
3492
3516
|
// eslint-disable-next-line no-console
|
|
3493
|
-
onError: c = ({ message:
|
|
3494
|
-
${
|
|
3517
|
+
onError: c = ({ message: m, error: p }) => console.error(`${m}
|
|
3518
|
+
${p}`)
|
|
3495
3519
|
}) => {
|
|
3496
|
-
if (!
|
|
3520
|
+
if (!r) {
|
|
3497
3521
|
c({ message: "Missing the collection id to add entity to", error: "" });
|
|
3498
3522
|
return;
|
|
3499
3523
|
}
|
|
3500
|
-
if (!
|
|
3524
|
+
if (!n) {
|
|
3501
3525
|
c({ message: "Missing the collection id to remove entity from", error: "" });
|
|
3502
3526
|
return;
|
|
3503
3527
|
}
|
|
3504
3528
|
try {
|
|
3505
|
-
const
|
|
3529
|
+
const m = s({
|
|
3506
3530
|
entityId: e,
|
|
3507
3531
|
entityType: t,
|
|
3508
3532
|
rootParentId: o,
|
|
3509
|
-
collectionId:
|
|
3533
|
+
collectionId: r,
|
|
3510
3534
|
onError: c
|
|
3511
|
-
}),
|
|
3535
|
+
}), p = a({
|
|
3512
3536
|
entityId: e,
|
|
3513
3537
|
entityType: t,
|
|
3514
3538
|
rootParentId: o,
|
|
3515
|
-
collectionId:
|
|
3539
|
+
collectionId: n,
|
|
3516
3540
|
onError: c
|
|
3517
|
-
}),
|
|
3518
|
-
Promise.allSettled(
|
|
3519
|
-
const
|
|
3520
|
-
if (
|
|
3521
|
-
i(),
|
|
3522
|
-
else if (
|
|
3541
|
+
}), l = [m, p].filter((h) => h !== void 0);
|
|
3542
|
+
Promise.allSettled(l).then((h) => {
|
|
3543
|
+
const f = h.filter((E) => E.status !== "fulfilled"), A = f.length === 0, C = f.length === l.length, P = f.length === 1;
|
|
3544
|
+
if (A)
|
|
3545
|
+
i(), d(), u();
|
|
3546
|
+
else if (C)
|
|
3523
3547
|
c({
|
|
3524
|
-
message: `Could not move ${e} from ${
|
|
3525
|
-
error:
|
|
3548
|
+
message: `Could not move ${e} from ${n} to ${r}`,
|
|
3549
|
+
error: f.map((E) => E.reason).join(`
|
|
3526
3550
|
`)
|
|
3527
3551
|
});
|
|
3528
|
-
else if (
|
|
3529
|
-
const
|
|
3552
|
+
else if (P) {
|
|
3553
|
+
const E = f[0].reason.config.method, S = E === "delete", R = E === "put";
|
|
3530
3554
|
c({
|
|
3531
|
-
message: S ? `Could not remove ${e} from collection ${
|
|
3532
|
-
error:
|
|
3555
|
+
message: S ? `Could not remove ${e} from collection ${n}` : `Could not add ${e} to collection ${r}`,
|
|
3556
|
+
error: f[0].reason
|
|
3533
3557
|
});
|
|
3534
|
-
let
|
|
3535
|
-
S ?
|
|
3558
|
+
let y;
|
|
3559
|
+
S ? y = a({
|
|
3536
3560
|
entityId: e,
|
|
3537
3561
|
entityType: t,
|
|
3538
|
-
collectionId:
|
|
3562
|
+
collectionId: r,
|
|
3539
3563
|
onError: c
|
|
3540
|
-
}) :
|
|
3564
|
+
}) : R && (y = s({
|
|
3541
3565
|
entityId: e,
|
|
3542
3566
|
entityType: t,
|
|
3543
|
-
collectionId:
|
|
3567
|
+
collectionId: n,
|
|
3544
3568
|
onError: c
|
|
3545
|
-
})),
|
|
3569
|
+
})), y && y.then(() => {
|
|
3546
3570
|
console.info(
|
|
3547
|
-
`Rollbacked moving ${e} from ${
|
|
3571
|
+
`Rollbacked moving ${e} from ${n} to ${r}`
|
|
3548
3572
|
);
|
|
3549
3573
|
}).catch((N) => {
|
|
3550
3574
|
c({ message: "Could not rollback after moving entity", error: N });
|
|
@@ -3552,42 +3576,42 @@ ${f}`)
|
|
|
3552
3576
|
}
|
|
3553
3577
|
}).catch((h) => {
|
|
3554
3578
|
c({
|
|
3555
|
-
message: `Could not add ${e} to collection ${
|
|
3579
|
+
message: `Could not add ${e} to collection ${r}`,
|
|
3556
3580
|
error: h
|
|
3557
3581
|
});
|
|
3558
3582
|
});
|
|
3559
|
-
} catch (
|
|
3583
|
+
} catch (m) {
|
|
3560
3584
|
c({
|
|
3561
|
-
message: `Could not move ${e} from ${
|
|
3562
|
-
error:
|
|
3585
|
+
message: `Could not move ${e} from ${n} to collection ${r}`,
|
|
3586
|
+
error: m
|
|
3563
3587
|
});
|
|
3564
3588
|
}
|
|
3565
3589
|
};
|
|
3566
3590
|
function Lo({
|
|
3567
3591
|
children: e,
|
|
3568
3592
|
setDrag: t,
|
|
3569
|
-
onDrop:
|
|
3570
|
-
onDragEnter:
|
|
3593
|
+
onDrop: r,
|
|
3594
|
+
onDragEnter: n,
|
|
3571
3595
|
onDragOver: o,
|
|
3572
3596
|
onDragLeave: s,
|
|
3573
3597
|
style: a
|
|
3574
3598
|
}) {
|
|
3575
|
-
const [i,
|
|
3576
|
-
|
|
3577
|
-
}, c = (
|
|
3578
|
-
|
|
3579
|
-
},
|
|
3580
|
-
|
|
3581
|
-
},
|
|
3582
|
-
|
|
3599
|
+
const [i, d] = x(0), u = (l) => {
|
|
3600
|
+
l.preventDefault(), l.stopPropagation(), t(!1), r && r(l);
|
|
3601
|
+
}, c = (l) => {
|
|
3602
|
+
l.preventDefault(), l.stopPropagation(), d(i + 1), i === 0 && t(!0), n && n(l);
|
|
3603
|
+
}, m = (l) => {
|
|
3604
|
+
l.preventDefault(), l.stopPropagation(), o && o(l);
|
|
3605
|
+
}, p = (l) => {
|
|
3606
|
+
l.preventDefault(), l.stopPropagation(), d(i - 1), i === 1 && t(!1), s && s(l);
|
|
3583
3607
|
};
|
|
3584
3608
|
return /* @__PURE__ */ B(
|
|
3585
3609
|
"div",
|
|
3586
3610
|
{
|
|
3587
|
-
onDragEnter: (
|
|
3588
|
-
onDragOver: (
|
|
3589
|
-
onDrop: (
|
|
3590
|
-
onDragLeave: (
|
|
3611
|
+
onDragEnter: (l) => c(l),
|
|
3612
|
+
onDragOver: (l) => m(l),
|
|
3613
|
+
onDrop: (l) => u(l),
|
|
3614
|
+
onDragLeave: (l) => p(l),
|
|
3591
3615
|
style: a,
|
|
3592
3616
|
children: e
|
|
3593
3617
|
}
|
|
@@ -3596,17 +3620,17 @@ function Lo({
|
|
|
3596
3620
|
export {
|
|
3597
3621
|
To as Auth,
|
|
3598
3622
|
At as AuthContext,
|
|
3599
|
-
|
|
3600
|
-
|
|
3623
|
+
St as AuthProvider,
|
|
3624
|
+
ur as BinContext,
|
|
3601
3625
|
wo as BinProvider,
|
|
3602
3626
|
Io as ComposeProviders,
|
|
3603
3627
|
Lo as DropArea,
|
|
3604
|
-
|
|
3605
|
-
|
|
3628
|
+
ir as ErrorBoundary,
|
|
3629
|
+
So as GetCollection,
|
|
3606
3630
|
_o as GetEntityMetadata,
|
|
3607
3631
|
Ro as GetFieldGroup,
|
|
3608
3632
|
Ao as GetItem,
|
|
3609
|
-
|
|
3633
|
+
Co as GetJobs,
|
|
3610
3634
|
No as HasRole,
|
|
3611
3635
|
vo as ListEntityAccess,
|
|
3612
3636
|
ho as MetadataType,
|
|
@@ -3617,51 +3641,51 @@ export {
|
|
|
3617
3641
|
yt as SettingsProvider,
|
|
3618
3642
|
lt as VidispineApi,
|
|
3619
3643
|
Go as compose,
|
|
3620
|
-
|
|
3644
|
+
Nr as handleAddEntity,
|
|
3621
3645
|
Ho as handleMoveEntity,
|
|
3622
|
-
|
|
3623
|
-
|
|
3646
|
+
Ir as handleRemoveEntity,
|
|
3647
|
+
Qr as useAddMetadataFieldAttributes,
|
|
3624
3648
|
j as useApi,
|
|
3625
3649
|
Oo as useAuthContext,
|
|
3626
|
-
|
|
3627
|
-
|
|
3650
|
+
xr as useAutocomplete,
|
|
3651
|
+
Mr as useAutocomplete2,
|
|
3628
3652
|
ao as useCollectionAutoPlay,
|
|
3629
3653
|
po as useCompoundMetadata,
|
|
3630
3654
|
mo as useCsvDownload,
|
|
3631
3655
|
co as useDocSearchAutocomplete,
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3656
|
+
Jr as useEntityAccess,
|
|
3657
|
+
Ln as useGetCollection,
|
|
3658
|
+
Kr as useGetCollectionItem,
|
|
3659
|
+
Zr as useGetEntity,
|
|
3660
|
+
rr as useGetEntityMetadata,
|
|
3661
|
+
or as useGetFieldGroup,
|
|
3638
3662
|
uo as useGetFieldMetadataDataset,
|
|
3639
|
-
|
|
3663
|
+
Qn as useGetItem,
|
|
3640
3664
|
lo as useGetSavedSearchFolders,
|
|
3641
3665
|
so as useGroup,
|
|
3642
3666
|
io as useHoverScrub,
|
|
3643
|
-
$
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3667
|
+
$r as useInterval,
|
|
3668
|
+
Wr as useJobSearch,
|
|
3669
|
+
no as useListGroup,
|
|
3670
|
+
ro as useListUser,
|
|
3671
|
+
Vr as useLocalStorage,
|
|
3672
|
+
zr as useMouseDownPosition,
|
|
3673
|
+
Yr as useQueryInitialState,
|
|
3650
3674
|
fo as useRepresentativeItems,
|
|
3651
|
-
|
|
3652
|
-
|
|
3675
|
+
cr as useRoles,
|
|
3676
|
+
Xr as useSavedSearch,
|
|
3653
3677
|
Kt as useSearch,
|
|
3654
3678
|
oo as useSearchGroup,
|
|
3655
|
-
|
|
3679
|
+
Hn as useSearchItem,
|
|
3656
3680
|
to as useSearchUser,
|
|
3657
|
-
|
|
3681
|
+
Fr as useSelected,
|
|
3658
3682
|
Do as useSettings,
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3683
|
+
vr as useSettingsActions,
|
|
3684
|
+
qr as useTab,
|
|
3685
|
+
jr as useThumbnailScrub,
|
|
3662
3686
|
xe as useUpdateEffect,
|
|
3663
|
-
|
|
3664
|
-
|
|
3687
|
+
Br as useUpdateQueryState,
|
|
3688
|
+
kr as useUploadFiles,
|
|
3665
3689
|
eo as useUser,
|
|
3666
3690
|
bo as withErrorBoundary
|
|
3667
3691
|
};
|