@edifice.io/collect-frontend 0.2.0 → 0.2.2-develop-pedago.2

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.
@@ -0,0 +1,695 @@
1
+ import { r, _ as L, J as je, K as Ne, M as G, Q as q, R as ue, U as we, V as Re, X as Me, Y as ie, Z as K, $ as me, a0 as Ie, a1 as Oe, a2 as De, a3 as Ee, a4 as E, a5 as Pe, a6 as Be, a7 as He, a8 as Le, a9 as Ve, j as s, c as Fe, k as Ae, l as ze, u as J, d as Z, aa as se, q as Te, ab as re, ac as W, F as U, ad as _e, s as Ke, ae as Ue, af as Xe, h as We, L as qe, E as Ge, G as Q, B as Ye, ag as Qe, n as Je, ah as Ze } from "./index-Dt9ykSDF.js";
2
+ import { S as ke } from "./SearchBarCollect-BAnLCwAC.js";
3
+ import { E as et } from "./emptyscreen-list-collection-CWGxO4Ss.js";
4
+ import { u as tt } from "./useGetStatusSubmission-D77F1XUy.js";
5
+ var oe = function(t, i) {
6
+ if (!t) return null;
7
+ var a = {
8
+ left: t.offsetLeft,
9
+ right: t.parentElement.clientWidth - t.clientWidth - t.offsetLeft,
10
+ width: t.clientWidth,
11
+ top: t.offsetTop,
12
+ bottom: t.parentElement.clientHeight - t.clientHeight - t.offsetTop,
13
+ height: t.clientHeight
14
+ };
15
+ return i ? {
16
+ left: 0,
17
+ right: 0,
18
+ width: 0,
19
+ top: a.top,
20
+ bottom: a.bottom,
21
+ height: a.height
22
+ } : {
23
+ left: a.left,
24
+ right: a.right,
25
+ width: a.width,
26
+ top: 0,
27
+ bottom: 0,
28
+ height: 0
29
+ };
30
+ }, C = function(t) {
31
+ return t !== void 0 ? "".concat(t, "px") : void 0;
32
+ };
33
+ function at(e) {
34
+ var t = e.prefixCls, i = e.containerRef, a = e.value, n = e.getValueIndex, h = e.motionName, d = e.onMotionStart, u = e.onMotionEnd, l = e.direction, g = e.vertical, o = g === void 0 ? !1 : g, S = r.useRef(null), x = r.useState(a), p = L(x, 2), j = p[0], P = p[1], N = function(I) {
35
+ var R, O = n(I), M = (R = i.current) === null || R === void 0 ? void 0 : R.querySelectorAll(".".concat(t, "-item"))[O];
36
+ return (M == null ? void 0 : M.offsetParent) && M;
37
+ }, V = r.useState(null), b = L(V, 2), c = b[0], F = b[1], y = r.useState(null), B = L(y, 2), m = B[0], $ = B[1];
38
+ je(function() {
39
+ if (j !== a) {
40
+ var v = N(j), I = N(a), R = oe(v, o), O = oe(I, o);
41
+ P(a), F(R), $(O), v && I ? d() : u();
42
+ }
43
+ }, [a]);
44
+ var H = r.useMemo(function() {
45
+ if (o) {
46
+ var v;
47
+ return C((v = c == null ? void 0 : c.top) !== null && v !== void 0 ? v : 0);
48
+ }
49
+ return C(l === "rtl" ? -(c == null ? void 0 : c.right) : c == null ? void 0 : c.left);
50
+ }, [o, l, c]), w = r.useMemo(function() {
51
+ if (o) {
52
+ var v;
53
+ return C((v = m == null ? void 0 : m.top) !== null && v !== void 0 ? v : 0);
54
+ }
55
+ return C(l === "rtl" ? -(m == null ? void 0 : m.right) : m == null ? void 0 : m.left);
56
+ }, [o, l, m]), A = function() {
57
+ return o ? {
58
+ transform: "translateY(var(--thumb-start-top))",
59
+ height: "var(--thumb-start-height)"
60
+ } : {
61
+ transform: "translateX(var(--thumb-start-left))",
62
+ width: "var(--thumb-start-width)"
63
+ };
64
+ }, z = function() {
65
+ return o ? {
66
+ transform: "translateY(var(--thumb-active-top))",
67
+ height: "var(--thumb-active-height)"
68
+ } : {
69
+ transform: "translateX(var(--thumb-active-left))",
70
+ width: "var(--thumb-active-width)"
71
+ };
72
+ }, T = function() {
73
+ F(null), $(null), u();
74
+ };
75
+ return !c || !m ? null : /* @__PURE__ */ r.createElement(Ne, {
76
+ visible: !0,
77
+ motionName: h,
78
+ motionAppear: !0,
79
+ onAppearStart: A,
80
+ onAppearActive: z,
81
+ onVisibleChanged: T
82
+ }, function(v, I) {
83
+ var R = v.className, O = v.style, M = G(G({}, O), {}, {
84
+ "--thumb-start-left": H,
85
+ "--thumb-start-width": C(c == null ? void 0 : c.width),
86
+ "--thumb-active-left": w,
87
+ "--thumb-active-width": C(m == null ? void 0 : m.width),
88
+ "--thumb-start-top": H,
89
+ "--thumb-start-height": C(c == null ? void 0 : c.height),
90
+ "--thumb-active-top": w,
91
+ "--thumb-active-height": C(m == null ? void 0 : m.height)
92
+ }), X = {
93
+ ref: ue(S, I),
94
+ style: M,
95
+ className: q("".concat(t, "-thumb"), R)
96
+ };
97
+ return process.env.NODE_ENV === "test" && (X["data-test-style"] = JSON.stringify(M)), /* @__PURE__ */ r.createElement("div", X);
98
+ });
99
+ }
100
+ var nt = ["prefixCls", "direction", "vertical", "options", "disabled", "defaultValue", "value", "name", "onChange", "className", "motionName"];
101
+ function it(e) {
102
+ if (typeof e.title < "u")
103
+ return e.title;
104
+ if (me(e.label) !== "object") {
105
+ var t;
106
+ return (t = e.label) === null || t === void 0 ? void 0 : t.toString();
107
+ }
108
+ }
109
+ function st(e) {
110
+ return e.map(function(t) {
111
+ if (me(t) === "object" && t !== null) {
112
+ var i = it(t);
113
+ return G(G({}, t), {}, {
114
+ title: i
115
+ });
116
+ }
117
+ return {
118
+ label: t == null ? void 0 : t.toString(),
119
+ title: t == null ? void 0 : t.toString(),
120
+ value: t
121
+ };
122
+ });
123
+ }
124
+ var rt = function(t) {
125
+ var i = t.prefixCls, a = t.className, n = t.disabled, h = t.checked, d = t.label, u = t.title, l = t.value, g = t.name, o = t.onChange, S = t.onFocus, x = t.onBlur, p = t.onKeyDown, j = t.onKeyUp, P = t.onMouseDown, N = function(b) {
126
+ n || o(b, l);
127
+ };
128
+ return /* @__PURE__ */ r.createElement("label", {
129
+ className: q(a, K({}, "".concat(i, "-item-disabled"), n)),
130
+ onMouseDown: P
131
+ }, /* @__PURE__ */ r.createElement("input", {
132
+ name: g,
133
+ className: "".concat(i, "-item-input"),
134
+ type: "radio",
135
+ disabled: n,
136
+ checked: h,
137
+ onChange: N,
138
+ onFocus: S,
139
+ onBlur: x,
140
+ onKeyDown: p,
141
+ onKeyUp: j
142
+ }), /* @__PURE__ */ r.createElement("div", {
143
+ className: "".concat(i, "-item-label"),
144
+ title: u
145
+ }, d));
146
+ }, he = /* @__PURE__ */ r.forwardRef(function(e, t) {
147
+ var i, a = e.prefixCls, n = a === void 0 ? "rc-segmented" : a, h = e.direction, d = e.vertical, u = e.options, l = u === void 0 ? [] : u, g = e.disabled, o = e.defaultValue, S = e.value, x = e.name, p = e.onChange, j = e.className, P = j === void 0 ? "" : j, N = e.motionName, V = N === void 0 ? "thumb-motion" : N, b = we(e, nt), c = r.useRef(null), F = r.useMemo(function() {
148
+ return ue(c, t);
149
+ }, [c, t]), y = r.useMemo(function() {
150
+ return st(l);
151
+ }, [l]), B = Re((i = y[0]) === null || i === void 0 ? void 0 : i.value, {
152
+ value: S,
153
+ defaultValue: o
154
+ }), m = L(B, 2), $ = m[0], H = m[1], w = r.useState(!1), A = L(w, 2), z = A[0], T = A[1], v = function(D, _) {
155
+ H(_), p == null || p(_);
156
+ }, I = Me(b, ["children"]), R = r.useState(!1), O = L(R, 2), M = O[0], X = O[1], ve = r.useState(!1), ee = L(ve, 2), fe = ee[0], te = ee[1], be = function() {
157
+ te(!0);
158
+ }, pe = function() {
159
+ te(!1);
160
+ }, Se = function() {
161
+ X(!1);
162
+ }, xe = function(D) {
163
+ D.key === "Tab" && X(!0);
164
+ }, ae = function(D) {
165
+ var _ = y.findIndex(function(Ce) {
166
+ return Ce.value === $;
167
+ }), ne = y.length, $e = (_ + D + ne) % ne, Y = y[$e];
168
+ Y && (H(Y.value), p == null || p(Y.value));
169
+ }, ye = function(D) {
170
+ switch (D.key) {
171
+ case "ArrowLeft":
172
+ case "ArrowUp":
173
+ ae(-1);
174
+ break;
175
+ case "ArrowRight":
176
+ case "ArrowDown":
177
+ ae(1);
178
+ break;
179
+ }
180
+ };
181
+ return /* @__PURE__ */ r.createElement("div", ie({
182
+ role: "radiogroup",
183
+ "aria-label": "segmented control",
184
+ tabIndex: g ? void 0 : 0,
185
+ "aria-orientation": d ? "vertical" : "horizontal"
186
+ }, I, {
187
+ className: q(n, K(K(K({}, "".concat(n, "-rtl"), h === "rtl"), "".concat(n, "-disabled"), g), "".concat(n, "-vertical"), d), P),
188
+ ref: F
189
+ }), /* @__PURE__ */ r.createElement("div", {
190
+ className: "".concat(n, "-group")
191
+ }, /* @__PURE__ */ r.createElement(at, {
192
+ vertical: d,
193
+ prefixCls: n,
194
+ value: $,
195
+ containerRef: c,
196
+ motionName: "".concat(n, "-").concat(V),
197
+ direction: h,
198
+ getValueIndex: function(D) {
199
+ return y.findIndex(function(_) {
200
+ return _.value === D;
201
+ });
202
+ },
203
+ onMotionStart: function() {
204
+ T(!0);
205
+ },
206
+ onMotionEnd: function() {
207
+ T(!1);
208
+ }
209
+ }), y.map(function(f) {
210
+ return /* @__PURE__ */ r.createElement(rt, ie({}, f, {
211
+ name: x,
212
+ key: f.value,
213
+ prefixCls: n,
214
+ className: q(f.className, "".concat(n, "-item"), K(K({}, "".concat(n, "-item-selected"), f.value === $ && !z), "".concat(n, "-item-focused"), fe && M && f.value === $)),
215
+ checked: f.value === $,
216
+ onChange: v,
217
+ onFocus: be,
218
+ onBlur: pe,
219
+ onKeyDown: ye,
220
+ onKeyUp: xe,
221
+ onMouseDown: Se,
222
+ disabled: !!g || !!f.disabled
223
+ }));
224
+ })));
225
+ });
226
+ process.env.NODE_ENV !== "production" && (he.displayName = "Segmented");
227
+ var ot = he;
228
+ function le(e, t) {
229
+ return {
230
+ [`${e}, ${e}:hover, ${e}:focus`]: {
231
+ color: t.colorTextDisabled,
232
+ cursor: "not-allowed"
233
+ }
234
+ };
235
+ }
236
+ function ce(e) {
237
+ return {
238
+ background: e.itemSelectedBg,
239
+ boxShadow: e.boxShadowTertiary
240
+ };
241
+ }
242
+ const lt = Object.assign({
243
+ overflow: "hidden"
244
+ }, Be), ct = (e) => {
245
+ const {
246
+ componentCls: t
247
+ } = e, i = e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(), a = e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(), n = e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();
248
+ return {
249
+ [t]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, De(e)), {
250
+ display: "inline-block",
251
+ padding: e.trackPadding,
252
+ color: e.itemColor,
253
+ background: e.trackBg,
254
+ borderRadius: e.borderRadius,
255
+ transition: `all ${e.motionDurationMid}`
256
+ }), Ee(e)), {
257
+ [`${t}-group`]: {
258
+ position: "relative",
259
+ display: "flex",
260
+ alignItems: "stretch",
261
+ justifyItems: "flex-start",
262
+ flexDirection: "row",
263
+ width: "100%"
264
+ },
265
+ // RTL styles
266
+ [`&${t}-rtl`]: {
267
+ direction: "rtl"
268
+ },
269
+ [`&${t}-vertical`]: {
270
+ [`${t}-group`]: {
271
+ flexDirection: "column"
272
+ },
273
+ [`${t}-thumb`]: {
274
+ width: "100%",
275
+ height: 0,
276
+ padding: `0 ${E(e.paddingXXS)}`
277
+ }
278
+ },
279
+ // block styles
280
+ [`&${t}-block`]: {
281
+ display: "flex"
282
+ },
283
+ [`&${t}-block ${t}-item`]: {
284
+ flex: 1,
285
+ minWidth: 0
286
+ },
287
+ // item styles
288
+ [`${t}-item`]: {
289
+ position: "relative",
290
+ textAlign: "center",
291
+ cursor: "pointer",
292
+ transition: `color ${e.motionDurationMid}`,
293
+ borderRadius: e.borderRadiusSM,
294
+ // Fix Safari render bug
295
+ // https://github.com/ant-design/ant-design/issues/45250
296
+ transform: "translateZ(0)",
297
+ "&-selected": Object.assign(Object.assign({}, ce(e)), {
298
+ color: e.itemSelectedColor
299
+ }),
300
+ "&-focused": Pe(e),
301
+ "&::after": {
302
+ content: '""',
303
+ position: "absolute",
304
+ zIndex: -1,
305
+ width: "100%",
306
+ height: "100%",
307
+ top: 0,
308
+ insetInlineStart: 0,
309
+ borderRadius: "inherit",
310
+ opacity: 0,
311
+ transition: `opacity ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,
312
+ // This is mandatory to make it not clickable or hoverable
313
+ // Ref: https://github.com/ant-design/ant-design/issues/40888
314
+ pointerEvents: "none"
315
+ },
316
+ [`&:not(${t}-item-selected):not(${t}-item-disabled)`]: {
317
+ "&:hover, &:active": {
318
+ color: e.itemHoverColor
319
+ },
320
+ "&:hover::after": {
321
+ opacity: 1,
322
+ backgroundColor: e.itemHoverBg
323
+ },
324
+ "&:active::after": {
325
+ opacity: 1,
326
+ backgroundColor: e.itemActiveBg
327
+ }
328
+ },
329
+ "&-label": Object.assign({
330
+ minHeight: i,
331
+ lineHeight: E(i),
332
+ padding: `0 ${E(e.segmentedPaddingHorizontal)}`
333
+ }, lt),
334
+ // syntactic sugar to add `icon` for Segmented Item
335
+ "&-icon + *": {
336
+ marginInlineStart: e.calc(e.marginSM).div(2).equal()
337
+ },
338
+ "&-input": {
339
+ position: "absolute",
340
+ insetBlockStart: 0,
341
+ insetInlineStart: 0,
342
+ width: 0,
343
+ height: 0,
344
+ opacity: 0,
345
+ pointerEvents: "none"
346
+ }
347
+ },
348
+ // thumb styles
349
+ [`${t}-thumb`]: Object.assign(Object.assign({}, ce(e)), {
350
+ position: "absolute",
351
+ insetBlockStart: 0,
352
+ insetInlineStart: 0,
353
+ width: 0,
354
+ height: "100%",
355
+ padding: `${E(e.paddingXXS)} 0`,
356
+ borderRadius: e.borderRadiusSM,
357
+ [`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]: {
358
+ backgroundColor: "transparent"
359
+ }
360
+ }),
361
+ // size styles
362
+ [`&${t}-lg`]: {
363
+ borderRadius: e.borderRadiusLG,
364
+ [`${t}-item-label`]: {
365
+ minHeight: a,
366
+ lineHeight: E(a),
367
+ padding: `0 ${E(e.segmentedPaddingHorizontal)}`,
368
+ fontSize: e.fontSizeLG
369
+ },
370
+ [`${t}-item, ${t}-thumb`]: {
371
+ borderRadius: e.borderRadius
372
+ }
373
+ },
374
+ [`&${t}-sm`]: {
375
+ borderRadius: e.borderRadiusSM,
376
+ [`${t}-item-label`]: {
377
+ minHeight: n,
378
+ lineHeight: E(n),
379
+ padding: `0 ${E(e.segmentedPaddingHorizontalSM)}`
380
+ },
381
+ [`${t}-item, ${t}-thumb`]: {
382
+ borderRadius: e.borderRadiusXS
383
+ }
384
+ }
385
+ }), le(`&-disabled ${t}-item`, e)), le(`${t}-item-disabled`, e)), {
386
+ // transition effect when `appear-active`
387
+ [`${t}-thumb-motion-appear-active`]: {
388
+ transition: `transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,
389
+ willChange: "transform, width"
390
+ },
391
+ [`&${t}-shape-round`]: {
392
+ borderRadius: 9999,
393
+ [`${t}-item, ${t}-thumb`]: {
394
+ borderRadius: 9999
395
+ }
396
+ }
397
+ })
398
+ };
399
+ }, dt = (e) => {
400
+ const {
401
+ colorTextLabel: t,
402
+ colorText: i,
403
+ colorFillSecondary: a,
404
+ colorBgElevated: n,
405
+ colorFill: h,
406
+ lineWidthBold: d,
407
+ colorBgLayout: u
408
+ } = e;
409
+ return {
410
+ trackPadding: d,
411
+ trackBg: u,
412
+ itemColor: t,
413
+ itemHoverColor: i,
414
+ itemHoverBg: a,
415
+ itemSelectedBg: n,
416
+ itemActiveBg: h,
417
+ itemSelectedColor: i
418
+ };
419
+ }, ut = Ie("Segmented", (e) => {
420
+ const {
421
+ lineWidth: t,
422
+ calc: i
423
+ } = e, a = Oe(e, {
424
+ segmentedPaddingHorizontal: i(e.controlPaddingHorizontal).sub(t).equal(),
425
+ segmentedPaddingHorizontalSM: i(e.controlPaddingHorizontalSM).sub(t).equal()
426
+ });
427
+ return ct(a);
428
+ }, dt);
429
+ var de = function(e, t) {
430
+ var i = {};
431
+ for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (i[a] = e[a]);
432
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, a = Object.getOwnPropertySymbols(e); n < a.length; n++)
433
+ t.indexOf(a[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[n]) && (i[a[n]] = e[a[n]]);
434
+ return i;
435
+ };
436
+ function mt(e) {
437
+ return typeof e == "object" && !!(e != null && e.icon);
438
+ }
439
+ const ht = /* @__PURE__ */ r.forwardRef((e, t) => {
440
+ const i = He(), {
441
+ prefixCls: a,
442
+ className: n,
443
+ rootClassName: h,
444
+ block: d,
445
+ options: u = [],
446
+ size: l = "middle",
447
+ style: g,
448
+ vertical: o,
449
+ shape: S = "default",
450
+ name: x = i
451
+ } = e, p = de(e, ["prefixCls", "className", "rootClassName", "block", "options", "size", "style", "vertical", "shape", "name"]), {
452
+ getPrefixCls: j,
453
+ direction: P,
454
+ className: N,
455
+ style: V
456
+ } = Le("segmented"), b = j("segmented", a), [c, F, y] = ut(b), B = Ve(l), m = r.useMemo(() => u.map((w) => {
457
+ if (mt(w)) {
458
+ const {
459
+ icon: A,
460
+ label: z
461
+ } = w, T = de(w, ["icon", "label"]);
462
+ return Object.assign(Object.assign({}, T), {
463
+ label: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("span", {
464
+ className: `${b}-item-icon`
465
+ }, A), z && /* @__PURE__ */ r.createElement("span", null, z))
466
+ });
467
+ }
468
+ return w;
469
+ }), [u, b]), $ = q(n, h, N, {
470
+ [`${b}-block`]: d,
471
+ [`${b}-sm`]: B === "small",
472
+ [`${b}-lg`]: B === "large",
473
+ [`${b}-vertical`]: o,
474
+ [`${b}-shape-${S}`]: S === "round"
475
+ }, F, y), H = Object.assign(Object.assign({}, V), g);
476
+ return c(/* @__PURE__ */ r.createElement(ot, Object.assign({}, p, {
477
+ name: x,
478
+ className: $,
479
+ style: H,
480
+ options: m,
481
+ ref: t,
482
+ prefixCls: b,
483
+ direction: P,
484
+ vertical: o
485
+ })));
486
+ }), ge = ht;
487
+ process.env.NODE_ENV !== "production" && (ge.displayName = "Segmented");
488
+ const gt = /* @__PURE__ */ r.forwardRef(({
489
+ options: e,
490
+ value: t,
491
+ onChange: i,
492
+ variant: a = "default",
493
+ className: n,
494
+ ...h
495
+ }, d) => {
496
+ const u = e.map((o) => ({
497
+ ...o,
498
+ label: /* @__PURE__ */ s.jsx("span", { "data-testid": `segmented-option-${o.value}`, children: o.label })
499
+ })), l = Fe(n, {
500
+ ghost: a === "ghost"
501
+ }), g = {
502
+ options: u,
503
+ value: t,
504
+ onChange: i,
505
+ ref: d,
506
+ className: l,
507
+ ...h
508
+ };
509
+ return /* @__PURE__ */ s.jsx(ge, { ...g });
510
+ }), vt = {
511
+ search: "",
512
+ filter: void 0
513
+ }, k = Ae(
514
+ ze((e) => ({
515
+ ...vt,
516
+ setFilter: (t) => e({ filter: t }),
517
+ setSearchSubmission: (t) => e({ search: t })
518
+ }))
519
+ ), ft = () => {
520
+ const { appCode: e } = J(), { t } = Z(e), { filter: i, setFilter: a } = k(), n = [
521
+ {
522
+ label: t("collection.submissionList.filter.all"),
523
+ value: "all"
524
+ },
525
+ {
526
+ label: t("collection.submissionList.filter.toSubmit"),
527
+ value: se.TO_SUBMIT
528
+ },
529
+ {
530
+ label: t("collection.submissionList.filter.submitted"),
531
+ value: se.SUBMITTED
532
+ }
533
+ ], h = (d) => {
534
+ a(d === "all" ? void 0 : d);
535
+ };
536
+ return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsx(
537
+ gt,
538
+ {
539
+ "data-testid": "collect-segmented-control-submission-filter",
540
+ onChange: h,
541
+ options: n,
542
+ value: i ?? "all"
543
+ }
544
+ ) });
545
+ }, bt = ({
546
+ collectionToSubmit: e,
547
+ onClick: t
548
+ }) => {
549
+ const { fromNow: i, formatDate: a } = Te(), { getAvatarURL: n } = Ue(), { appCode: h } = J(), { t: d } = Z(h), { getSubmissionStatus: u } = tt(), l = e.status === re.SUBMITTED || e.status === re.VERIFIED, g = n(e.createdBy.entId, "user"), o = new Date(e.deadline) < /* @__PURE__ */ new Date(), S = u({
550
+ status: e.status,
551
+ isPastDeadline: o,
552
+ isSubmissionCard: !0
553
+ });
554
+ return /* @__PURE__ */ s.jsxs(W, { isSelectable: !1, onClick: t, isSelected: !1, children: [
555
+ /* @__PURE__ */ s.jsxs(W.Body, { children: [
556
+ /* @__PURE__ */ s.jsxs(
557
+ U,
558
+ {
559
+ justify: "center",
560
+ align: "center",
561
+ direction: "column",
562
+ className: `rounded-2 ${o ? "bg-gray-300" : l ? "bg-green-200" : "bg-orange-200"}`,
563
+ style: { minWidth: "80px", height: "80px" },
564
+ children: [
565
+ /* @__PURE__ */ s.jsx(
566
+ "p",
567
+ {
568
+ className: `h2 ${o ? "text-gray-800" : l ? "text-green-800" : "text-orange-500"}`,
569
+ children: a(e.deadline, "D")
570
+ }
571
+ ),
572
+ /* @__PURE__ */ s.jsx(
573
+ "p",
574
+ {
575
+ className: `caption ${o ? "text-gray-800" : l ? "text-green-800" : "text-orange-500"}`,
576
+ children: a(e.deadline, "MMM")
577
+ }
578
+ ),
579
+ /* @__PURE__ */ s.jsx(
580
+ "p",
581
+ {
582
+ className: `caption ${o ? "text-gray-800" : l ? "text-green-800" : "text-orange-500"}`,
583
+ children: a(e.deadline, "YYYY")
584
+ }
585
+ )
586
+ ]
587
+ }
588
+ ),
589
+ /* @__PURE__ */ s.jsxs("div", { className: "text-truncate", children: [
590
+ /* @__PURE__ */ s.jsx(W.Title, { children: e.name }),
591
+ /* @__PURE__ */ s.jsx(W.Text, { children: /* @__PURE__ */ s.jsxs("em", { children: [
592
+ d("collection.planned"),
593
+ " ",
594
+ i(e.createdAt)
595
+ ] }) })
596
+ ] })
597
+ ] }),
598
+ /* @__PURE__ */ s.jsx(W.Footer, { children: /* @__PURE__ */ s.jsxs(U, { className: "gap-8 text-truncate w-100", justify: "between", children: [
599
+ /* @__PURE__ */ s.jsxs(U, { className: "gap-8", align: "center", children: [
600
+ /* @__PURE__ */ s.jsx(
601
+ _e,
602
+ {
603
+ alt: e.createdBy.displayName,
604
+ size: "xs",
605
+ src: g,
606
+ variant: "circle"
607
+ }
608
+ ),
609
+ /* @__PURE__ */ s.jsx("div", { className: "small text-truncate", children: e.createdBy.displayName })
610
+ ] }),
611
+ /* @__PURE__ */ s.jsx(U, { className: "gap-8", align: "center", children: /* @__PURE__ */ s.jsx(Ke, { variant: S.variant, children: S.text }) })
612
+ ] }) })
613
+ ] });
614
+ }, pt = () => {
615
+ var S, x;
616
+ const { filter: e, search: t } = k(), i = e || void 0, a = t || void 0, { data: n, isLoading: h, fetchNextPage: d } = Xe({
617
+ filter: i,
618
+ search: a
619
+ }), u = (x = (S = n == null ? void 0 : n.pages) == null ? void 0 : S[n.pages.length - 1]) == null ? void 0 : x.meta, l = !!u && Number(u.currentPage ?? 0) < Number(u.totalPages ?? 0), g = (n == null ? void 0 : n.pages.flatMap((p) => p.items)) ?? [], o = g.length > 0;
620
+ return {
621
+ collectionsToSubmit: g,
622
+ isLoading: h,
623
+ hasMoreResources: l,
624
+ hasData: o,
625
+ fetchNextPage: d
626
+ };
627
+ }, St = () => {
628
+ const { appCode: e } = J(), { t } = Z(e), i = We(), {
629
+ collectionsToSubmit: a,
630
+ isLoading: n,
631
+ hasMoreResources: h,
632
+ hasData: d,
633
+ fetchNextPage: u
634
+ } = pt();
635
+ return n ? /* @__PURE__ */ s.jsx(qe, {}) : d ? /* @__PURE__ */ s.jsxs(Q, { className: "w-100 p-24", "data-testid": "collect-list-submissions-grid", children: [
636
+ a.map((l, g) => /* @__PURE__ */ s.jsx(Q.Col, { sm: "4", md: "4", lg: "4", xl: "4", children: /* @__PURE__ */ s.jsx(
637
+ bt,
638
+ {
639
+ "data-testid": "collect-list-submissions-card",
640
+ collectionToSubmit: l,
641
+ onClick: () => i(
642
+ `/list-collections/id/${l.collectionId}/submission/${l.submissionId}`
643
+ )
644
+ }
645
+ ) }, g)),
646
+ h && /* @__PURE__ */ s.jsx(Q.Col, { sm: "4", md: "8", lg: "12", xl: "12", children: /* @__PURE__ */ s.jsx(U, { justify: "center", children: /* @__PURE__ */ s.jsx(
647
+ Ye,
648
+ {
649
+ "data-testid": "collect-list-submissions-button-more",
650
+ className: "px-48",
651
+ type: "button",
652
+ color: "secondary",
653
+ variant: "filled",
654
+ rightIcon: /* @__PURE__ */ s.jsx(Qe, {}),
655
+ onClick: () => u(),
656
+ children: t("collection.see.more")
657
+ }
658
+ ) }) })
659
+ ] }) : /* @__PURE__ */ s.jsx("div", { className: "py-24", children: /* @__PURE__ */ s.jsx(
660
+ Ge,
661
+ {
662
+ imageSrc: et,
663
+ title: t("collection.collectionList.emptyScreen.title"),
664
+ text: t("collection.collectionList.emptyScreen.description")
665
+ }
666
+ ) });
667
+ }, jt = async (e) => (await e.prefetchInfiniteQuery(
668
+ Ze({
669
+ search: void 0,
670
+ filter: void 0
671
+ })
672
+ ), null), Nt = () => {
673
+ const { lg: e } = Je(), t = k(
674
+ (i) => i.setSearchSubmission
675
+ );
676
+ return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
677
+ /* @__PURE__ */ s.jsxs(
678
+ U,
679
+ {
680
+ align: e ? "center" : "start",
681
+ direction: e ? "row" : "column",
682
+ className: "bg-gray-200 px-24 py-16 gap-16",
683
+ children: [
684
+ /* @__PURE__ */ s.jsx(ke, { setSearch: t }),
685
+ /* @__PURE__ */ s.jsx(ft, {})
686
+ ]
687
+ }
688
+ ),
689
+ /* @__PURE__ */ s.jsx(St, {})
690
+ ] });
691
+ };
692
+ export {
693
+ Nt as SubmissionsList,
694
+ jt as loader
695
+ };