@nice2dev/events 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +415 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1179 -1169
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { NtdMove as
|
|
3
|
-
import { NiceUpload as en, NiceTextInput as
|
|
4
|
-
import { useNiceTranslation as
|
|
5
|
-
import
|
|
6
|
-
function
|
|
7
|
-
return
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as Ge } from "react/jsx-runtime";
|
|
2
|
+
import { NtdMove as Mn, NtdHeart as Nt, NtdTrash as De, NtdPlay as Ke, NtdImage as Ln, NtdPlus as an, NtdCheck as je, NtdHelp as sn, NtdClose as $n, NtdSearch as bt, NtdQrCode as kt, NtdMail as Rn, NtdWheelchair as Dn, NtdZoomIn as wt, NtdZoomOut as St, NtdMaximize as Ct, NtdSend as xt, NtdGiftCard as It, NtdStar as Pt, NtdLink as zt, NtdReceipt as At, NtdCoins as Tt, NtdArrowRight as Mt, NtdSkipForward as rn, NtdBarChart as Lt, NtdThumbsUp as cn, NtdClock as En, NtdTrophy as ln, NtdMedal as Je, NtdStop as $t, NtdMusic as Pe, NtdMicrophone as Xe, NtdFileText as Rt, NtdSparkle as On, NtdCamera as Bn, NtdGamepad as Yn, NtdClipboardCheck as Dt } from "@nice2dev/icons";
|
|
3
|
+
import { NiceUpload as en, NiceTextInput as J, NiceCardGroup as Un, NiceEmpty as Et, NiceButton as U, NiceSegmentedControl as Vn, NiceTextArea as on, NiceToggle as Ze, NiceAvatarGroup as bn, NiceAvatar as Ve, NiceBadge as ae, NiceSelect as ze, NiceAmountBreakdown as Ot, NiceTabs as Bt, NiceNumericInput as dn, NiceCollapse as Yt, NiceHtmlEditor as Ut, NiceProgress as Vt } from "@nice2dev/ui";
|
|
4
|
+
import { useNiceTranslation as ee, NiceIcon as re, useControllableState as Ft, clickOnActivationKey as un } from "@nice2dev/ui-core";
|
|
5
|
+
import Re, { useState as D, useRef as ye, useCallback as H, forwardRef as te, useMemo as F, useEffect as Fe } from "react";
|
|
6
|
+
function Xt(a) {
|
|
7
|
+
return a.map((i, r) => ({ item: i, index: r, key: i.order ?? r })).sort((i, r) => i.key - r.key || i.index - r.index).map((i) => i.item);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function kn(a, i, r) {
|
|
10
10
|
if (i === r)
|
|
11
|
-
return [...
|
|
12
|
-
if (i < 0 || i >=
|
|
13
|
-
return [...
|
|
14
|
-
if (r < 0 || r >=
|
|
15
|
-
return [...
|
|
16
|
-
const n = [...
|
|
11
|
+
return [...a];
|
|
12
|
+
if (i < 0 || i >= a.length)
|
|
13
|
+
return [...a];
|
|
14
|
+
if (r < 0 || r >= a.length)
|
|
15
|
+
return [...a];
|
|
16
|
+
const n = [...a], [t] = n.splice(i, 1);
|
|
17
17
|
return n.splice(r, 0, t), n;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const { items: i, onReorder: r, disabled: n = !1 } =
|
|
21
|
-
(
|
|
22
|
-
const k = m(
|
|
23
|
-
k < 0 || T < 0 || k === T || r == null || r(
|
|
19
|
+
function Fn(a) {
|
|
20
|
+
const { items: i, onReorder: r, disabled: n = !1 } = a, [t, d] = D(null), [o, u] = D(null), [_, c] = D(!1), l = ye(null), m = H((g) => i.findIndex((P) => P.id === g), [i]), h = H(
|
|
21
|
+
(g, P) => {
|
|
22
|
+
const k = m(g), T = m(P);
|
|
23
|
+
k < 0 || T < 0 || k === T || r == null || r(kn([...i], k, T).map((f) => f.id));
|
|
24
24
|
},
|
|
25
25
|
[i, m, r]
|
|
26
|
-
), z =
|
|
26
|
+
), z = H(() => {
|
|
27
27
|
d(null), u(null), c(!1), l.current = null;
|
|
28
|
-
}, []),
|
|
29
|
-
(
|
|
28
|
+
}, []), v = H(
|
|
29
|
+
(g, P) => ({
|
|
30
30
|
role: "button",
|
|
31
31
|
// Explicitly off: this is a pointer-driven control, and leaving the
|
|
32
32
|
// native HTML5 drag enabled would fight it on desktop.
|
|
33
33
|
draggable: !1,
|
|
34
34
|
tabIndex: n ? -1 : 0,
|
|
35
|
-
"aria-grabbed": t ===
|
|
35
|
+
"aria-grabbed": t === g,
|
|
36
36
|
onPointerDown: (k) => {
|
|
37
37
|
var p, A;
|
|
38
38
|
if (n || k.button !== 0 && k.pointerType === "mouse")
|
|
39
39
|
return;
|
|
40
|
-
(A = (p = k.currentTarget).setPointerCapture) == null || A.call(p, k.pointerId), d(
|
|
40
|
+
(A = (p = k.currentTarget).setPointerCapture) == null || A.call(p, k.pointerId), d(g), c(!0), l.current = i.map((y) => y.id);
|
|
41
41
|
const T = () => {
|
|
42
42
|
window.removeEventListener("pointerup", T), window.removeEventListener("pointercancel", f), c(!1), d(null), u(null);
|
|
43
43
|
}, f = () => {
|
|
@@ -46,60 +46,59 @@ function Vn(s) {
|
|
|
46
46
|
window.addEventListener("pointerup", T), window.addEventListener("pointercancel", f);
|
|
47
47
|
},
|
|
48
48
|
onPointerEnter: () => {
|
|
49
|
-
n || !t || t ===
|
|
49
|
+
n || !t || t === g || (u(g), h(t, g));
|
|
50
50
|
},
|
|
51
51
|
onKeyDown: (k) => {
|
|
52
52
|
if (n)
|
|
53
53
|
return;
|
|
54
54
|
if (k.key === " " || k.key === "Enter") {
|
|
55
|
-
k.preventDefault(), t ===
|
|
55
|
+
k.preventDefault(), t === g ? z() : (d(g), l.current = i.map((y) => y.id));
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
if (k.key === "Escape" && t ===
|
|
58
|
+
if (k.key === "Escape" && t === g) {
|
|
59
59
|
k.preventDefault(), l.current && (r == null || r(l.current)), z();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if (t !==
|
|
62
|
+
if (t !== g)
|
|
63
63
|
return;
|
|
64
64
|
const f = k.key === "ArrowLeft" || k.key === "ArrowUp" ? -1 : k.key === "ArrowRight" || k.key === "ArrowDown" ? 1 : 0;
|
|
65
65
|
if (f === 0)
|
|
66
66
|
return;
|
|
67
67
|
k.preventDefault();
|
|
68
|
-
const p = m(
|
|
69
|
-
A < 0 || A >= i.length || r == null || r(
|
|
68
|
+
const p = m(g), A = p + f;
|
|
69
|
+
A < 0 || A >= i.length || r == null || r(kn([...i], p, A).map((y) => y.id));
|
|
70
70
|
},
|
|
71
71
|
...P ? { "aria-label": P } : {}
|
|
72
72
|
}),
|
|
73
73
|
[t, h, n, z, m, i, r]
|
|
74
74
|
);
|
|
75
|
-
return { activeId: t, overId: o, getHandleProps:
|
|
75
|
+
return { activeId: t, overId: o, getHandleProps: v, dragging: _ };
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
const { t: i } =
|
|
79
|
-
return
|
|
77
|
+
const qt = ({ item: a }) => {
|
|
78
|
+
const { t: i } = ee(), [r, n] = D(!1), t = a.thumbnailUrl ?? a.url;
|
|
79
|
+
return a.type === "video" ? /* @__PURE__ */ e("div", { className: "nice-event-media__video-thumb", children: /* @__PURE__ */ e(Ke, { size: 26 }) }) : r || !t ? /* @__PURE__ */ e(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: "nice-event-media__broken",
|
|
83
83
|
title: i("eventMedia.imageUnavailable", "Image unavailable"),
|
|
84
|
-
children: /* @__PURE__ */ e(
|
|
84
|
+
children: /* @__PURE__ */ e(Ln, { size: 24 })
|
|
85
85
|
}
|
|
86
86
|
) : (
|
|
87
87
|
// onError swaps in the placeholder when the file fails to load — no user interaction
|
|
88
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
89
88
|
/* @__PURE__ */ e(
|
|
90
89
|
"img",
|
|
91
90
|
{
|
|
92
91
|
src: t,
|
|
93
|
-
alt:
|
|
92
|
+
alt: a.caption ?? "",
|
|
94
93
|
className: "nice-event-media__thumb",
|
|
95
94
|
loading: "lazy",
|
|
96
95
|
onError: () => n(!0)
|
|
97
96
|
}
|
|
98
97
|
)
|
|
99
98
|
);
|
|
100
|
-
}, Wt = [],
|
|
99
|
+
}, Wt = [], ia = /* @__PURE__ */ te(
|
|
101
100
|
function(i, r) {
|
|
102
|
-
const { t: n } =
|
|
101
|
+
const { t: n } = ee(), {
|
|
103
102
|
items: t = Wt,
|
|
104
103
|
onUpload: d,
|
|
105
104
|
onDelete: o,
|
|
@@ -110,24 +109,23 @@ const Xt = ({ item: s }) => {
|
|
|
110
109
|
typeFilter: m = "all",
|
|
111
110
|
onReorder: h,
|
|
112
111
|
className: z,
|
|
113
|
-
style:
|
|
114
|
-
} = i, [
|
|
112
|
+
style: v
|
|
113
|
+
} = i, [g, P] = D(""), k = F(() => Xt(t), [t]), T = F(() => m === "all" ? k : k.filter((M) => M.type === m), [k, m]), f = !!h && m === "all", p = Fn({ items: k, onReorder: h, disabled: !f }), A = (M) => {
|
|
115
114
|
const w = M[0];
|
|
116
|
-
!w || !d || (d(w,
|
|
115
|
+
!w || !d || (d(w, g.trim() || void 0), P(""));
|
|
117
116
|
}, y = c === "list";
|
|
118
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ s(
|
|
119
118
|
"div",
|
|
120
119
|
{
|
|
121
120
|
ref: r,
|
|
122
121
|
className: `nice-event-media nice-event-media--${c} ${z ?? ""}`,
|
|
123
|
-
style:
|
|
122
|
+
style: v,
|
|
124
123
|
children: [
|
|
125
|
-
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */
|
|
126
|
-
"
|
|
127
|
-
T.length
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
l && d && /* @__PURE__ */ a("div", { className: "nice-event-media__upload", children: [
|
|
124
|
+
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ e("h3", { children: n("eventMedia.media", "Media ({filtered})").replace(
|
|
125
|
+
"{filtered}",
|
|
126
|
+
String(T.length)
|
|
127
|
+
) }) }),
|
|
128
|
+
l && d && /* @__PURE__ */ s("div", { className: "nice-event-media__upload", children: [
|
|
131
129
|
/* @__PURE__ */ e(
|
|
132
130
|
en,
|
|
133
131
|
{
|
|
@@ -138,16 +136,16 @@ const Xt = ({ item: s }) => {
|
|
|
138
136
|
}
|
|
139
137
|
),
|
|
140
138
|
/* @__PURE__ */ e(
|
|
141
|
-
|
|
139
|
+
J,
|
|
142
140
|
{
|
|
143
|
-
value:
|
|
141
|
+
value: g,
|
|
144
142
|
onChange: P,
|
|
145
143
|
placeholder: n("eventMedia.addACaption", "Add a caption…")
|
|
146
144
|
}
|
|
147
145
|
)
|
|
148
146
|
] }),
|
|
149
147
|
T.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-media__empty", children: n("eventMedia.noMediaYet", "No media yet.") }) : /* @__PURE__ */ e(
|
|
150
|
-
|
|
148
|
+
Un,
|
|
151
149
|
{
|
|
152
150
|
columns: y ? 1 : void 0,
|
|
153
151
|
minColumnWidth: 200,
|
|
@@ -161,7 +159,7 @@ const Xt = ({ item: s }) => {
|
|
|
161
159
|
M.caption ?? n("eventMedia.itemN", "item {n}").replace("{n}", String(w + 1))
|
|
162
160
|
)
|
|
163
161
|
) : null;
|
|
164
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ s(
|
|
165
163
|
"div",
|
|
166
164
|
{
|
|
167
165
|
className: `nice-event-media__card${y ? " nice-event-media__card--row" : ""}${p.activeId === M.id ? " nice-event-media__card--dragging" : ""}`,
|
|
@@ -185,15 +183,15 @@ const Xt = ({ item: s }) => {
|
|
|
185
183
|
onPointerDown: N.onPointerDown,
|
|
186
184
|
onKeyDown: N.onKeyDown,
|
|
187
185
|
onClick: (x) => x.stopPropagation(),
|
|
188
|
-
children: /* @__PURE__ */ e(
|
|
186
|
+
children: /* @__PURE__ */ e(Mn, { size: 14 })
|
|
189
187
|
}
|
|
190
188
|
),
|
|
191
|
-
/* @__PURE__ */ e(
|
|
192
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ e(qt, { item: M }),
|
|
190
|
+
/* @__PURE__ */ s("div", { className: "nice-event-media__body", children: [
|
|
193
191
|
M.caption && /* @__PURE__ */ e("span", { className: "nice-event-media__caption", children: M.caption }),
|
|
194
192
|
M.uploadedByName && /* @__PURE__ */ e("span", { className: "nice-event-media__uploader", children: M.uploadedByName }),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
u && /* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ s("div", { className: "nice-event-media__actions", children: [
|
|
194
|
+
u && /* @__PURE__ */ s(
|
|
197
195
|
"button",
|
|
198
196
|
{
|
|
199
197
|
type: "button",
|
|
@@ -203,7 +201,7 @@ const Xt = ({ item: s }) => {
|
|
|
203
201
|
},
|
|
204
202
|
"aria-label": n("eventMedia.like", "Like"),
|
|
205
203
|
children: [
|
|
206
|
-
/* @__PURE__ */ e(
|
|
204
|
+
/* @__PURE__ */ e(Nt, { size: 15 }),
|
|
207
205
|
" ",
|
|
208
206
|
M.likes ?? 0
|
|
209
207
|
]
|
|
@@ -218,7 +216,7 @@ const Xt = ({ item: s }) => {
|
|
|
218
216
|
x.stopPropagation(), o(M.id);
|
|
219
217
|
},
|
|
220
218
|
"aria-label": n("eventMedia.delete", "Delete"),
|
|
221
|
-
children: /* @__PURE__ */ e(
|
|
219
|
+
children: /* @__PURE__ */ e(De, { size: 15 })
|
|
222
220
|
}
|
|
223
221
|
)
|
|
224
222
|
] })
|
|
@@ -235,25 +233,25 @@ const Xt = ({ item: s }) => {
|
|
|
235
233
|
);
|
|
236
234
|
}
|
|
237
235
|
), Ne = ({
|
|
238
|
-
title:
|
|
236
|
+
title: a,
|
|
239
237
|
description: i,
|
|
240
238
|
icon: r,
|
|
241
239
|
action: n,
|
|
242
240
|
className: t
|
|
243
241
|
}) => /* @__PURE__ */ e(
|
|
244
|
-
|
|
242
|
+
Et,
|
|
245
243
|
{
|
|
246
244
|
size: "sm",
|
|
247
|
-
title:
|
|
245
|
+
title: a,
|
|
248
246
|
description: i,
|
|
249
247
|
icon: r,
|
|
250
248
|
action: n,
|
|
251
249
|
className: t
|
|
252
250
|
}
|
|
253
|
-
),
|
|
251
|
+
), Gt = [], aa = /* @__PURE__ */ te(
|
|
254
252
|
function(i, r) {
|
|
255
|
-
const { t: n } =
|
|
256
|
-
items: t =
|
|
253
|
+
const { t: n } = ee(), {
|
|
254
|
+
items: t = Gt,
|
|
257
255
|
layout: d = "grid",
|
|
258
256
|
onReorder: o,
|
|
259
257
|
onItemAdd: u,
|
|
@@ -263,32 +261,32 @@ const Xt = ({ item: s }) => {
|
|
|
263
261
|
previewMode: m = !1,
|
|
264
262
|
transition: h = "fade",
|
|
265
263
|
defaultDurationMs: z = 3e3,
|
|
266
|
-
autoPlay:
|
|
267
|
-
disabled:
|
|
264
|
+
autoPlay: v = !0,
|
|
265
|
+
disabled: g = !1,
|
|
268
266
|
readOnly: P = !1,
|
|
269
267
|
size: k = "md",
|
|
270
268
|
className: T,
|
|
271
269
|
style: f
|
|
272
|
-
} = i, [p, A] =
|
|
270
|
+
} = i, [p, A] = D(0), [y, M] = D(null), [w, N] = D(""), x = g || P, B = !!o && !x, X = Fn({ items: t, onReorder: o, disabled: !B }), E = t.length > 0 ? Math.min(p, t.length - 1) : 0, R = t[E], q = (R == null ? void 0 : R.durationMs) ?? z;
|
|
273
271
|
Fe(() => {
|
|
274
|
-
if (!m || !
|
|
272
|
+
if (!m || !v || t.length < 2)
|
|
275
273
|
return;
|
|
276
|
-
const
|
|
277
|
-
() => A((
|
|
278
|
-
Math.max(250,
|
|
274
|
+
const L = window.setTimeout(
|
|
275
|
+
() => A((j) => (j + 1) % t.length),
|
|
276
|
+
Math.max(250, q)
|
|
279
277
|
);
|
|
280
|
-
return () => window.clearTimeout(
|
|
281
|
-
}, [m,
|
|
282
|
-
const
|
|
283
|
-
() => t.reduce((
|
|
278
|
+
return () => window.clearTimeout(L);
|
|
279
|
+
}, [m, v, t.length, E, q]);
|
|
280
|
+
const C = F(
|
|
281
|
+
() => t.reduce((L, j) => L + (j.durationMs ?? z), 0),
|
|
284
282
|
[t, z]
|
|
285
|
-
), b = (
|
|
286
|
-
c == null || c(
|
|
283
|
+
), b = (L) => {
|
|
284
|
+
c == null || c(L, w), M(null), N("");
|
|
287
285
|
};
|
|
288
286
|
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-media-collage ${T ?? ""}`, style: f, children: /* @__PURE__ */ e(
|
|
289
287
|
Ne,
|
|
290
288
|
{
|
|
291
|
-
icon: /* @__PURE__ */ e(
|
|
289
|
+
icon: /* @__PURE__ */ e(Ln, { size: 28 }),
|
|
292
290
|
title: n("mediaCollage.nothingInTheCollageYet", "Nothing in the collage yet"),
|
|
293
291
|
description: n(
|
|
294
292
|
"mediaCollage.addPhotosOrVideoTo",
|
|
@@ -296,44 +294,44 @@ const Xt = ({ item: s }) => {
|
|
|
296
294
|
),
|
|
297
295
|
action: u && !x ? /* @__PURE__ */ e(en, { accept: "image/*,video/*", multiple: !0, onFilesSelected: u }) : void 0
|
|
298
296
|
}
|
|
299
|
-
) }) : m ? /* @__PURE__ */
|
|
297
|
+
) }) : m ? /* @__PURE__ */ s(
|
|
300
298
|
"div",
|
|
301
299
|
{
|
|
302
300
|
ref: r,
|
|
303
301
|
className: `nice-media-collage nice-media-collage--preview nice-media-collage--${h} ${T ?? ""}`,
|
|
304
302
|
style: f,
|
|
305
303
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
(
|
|
304
|
+
/* @__PURE__ */ s("div", { className: "nice-media-collage__stage", "aria-live": "polite", children: [
|
|
305
|
+
(R == null ? void 0 : R.type) === "video" ? /* @__PURE__ */ e(
|
|
308
306
|
"video",
|
|
309
307
|
{
|
|
310
308
|
className: "nice-media-collage__slide",
|
|
311
|
-
src:
|
|
309
|
+
src: R.mediaUrl,
|
|
312
310
|
controls: !0
|
|
313
311
|
},
|
|
314
|
-
|
|
312
|
+
R.id
|
|
315
313
|
) : /* @__PURE__ */ e(
|
|
316
314
|
"img",
|
|
317
315
|
{
|
|
318
316
|
className: "nice-media-collage__slide",
|
|
319
|
-
src:
|
|
320
|
-
alt: (
|
|
317
|
+
src: R == null ? void 0 : R.mediaUrl,
|
|
318
|
+
alt: (R == null ? void 0 : R.caption) ?? ""
|
|
321
319
|
},
|
|
322
|
-
|
|
320
|
+
R == null ? void 0 : R.id
|
|
323
321
|
),
|
|
324
|
-
(
|
|
322
|
+
(R == null ? void 0 : R.caption) && /* @__PURE__ */ e("p", { className: "nice-media-collage__slide-caption", children: R.caption })
|
|
325
323
|
] }),
|
|
326
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ s("div", { className: "nice-media-collage__playbar", children: [
|
|
327
325
|
/* @__PURE__ */ e(
|
|
328
326
|
U,
|
|
329
327
|
{
|
|
330
328
|
size: "sm",
|
|
331
329
|
variant: "ghost",
|
|
332
|
-
onClick: () => A((
|
|
330
|
+
onClick: () => A((L) => (L - 1 + t.length) % t.length),
|
|
333
331
|
children: n("mediaCollage.previous", "Previous")
|
|
334
332
|
}
|
|
335
333
|
),
|
|
336
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ s("span", { className: "nice-media-collage__counter", children: [
|
|
337
335
|
E + 1,
|
|
338
336
|
" / ",
|
|
339
337
|
t.length
|
|
@@ -343,23 +341,23 @@ const Xt = ({ item: s }) => {
|
|
|
343
341
|
{
|
|
344
342
|
size: "sm",
|
|
345
343
|
variant: "ghost",
|
|
346
|
-
onClick: () => A((
|
|
344
|
+
onClick: () => A((L) => (L + 1) % t.length),
|
|
347
345
|
children: n("mediaCollage.next", "Next")
|
|
348
346
|
}
|
|
349
347
|
)
|
|
350
348
|
] })
|
|
351
349
|
]
|
|
352
350
|
}
|
|
353
|
-
) : /* @__PURE__ */
|
|
351
|
+
) : /* @__PURE__ */ s(
|
|
354
352
|
"div",
|
|
355
353
|
{
|
|
356
354
|
ref: r,
|
|
357
355
|
className: `nice-media-collage nice-media-collage--${d} nice-media-collage--${k} ${T ?? ""}`,
|
|
358
356
|
style: f,
|
|
359
357
|
children: [
|
|
360
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ s("div", { className: "nice-media-collage__toolbar", children: [
|
|
361
359
|
/* @__PURE__ */ e(
|
|
362
|
-
|
|
360
|
+
Vn,
|
|
363
361
|
{
|
|
364
362
|
size: "sm",
|
|
365
363
|
value: d,
|
|
@@ -371,14 +369,7 @@ const Xt = ({ item: s }) => {
|
|
|
371
369
|
]
|
|
372
370
|
}
|
|
373
371
|
),
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
t.length,
|
|
376
|
-
" item",
|
|
377
|
-
t.length === 1 ? "" : "s",
|
|
378
|
-
" · ",
|
|
379
|
-
Math.round(S / 1e3),
|
|
380
|
-
"s"
|
|
381
|
-
] }),
|
|
372
|
+
/* @__PURE__ */ e("span", { className: "nice-media-collage__duration", children: t.length === 1 ? n("mediaCollage.itemsOne", "{items} item · {totalDuration}s").replace("{items}", String(t.length)).replace("{totalDuration}", String(Math.round(C / 1e3))) : n("mediaCollage.itemsMany", "{items} items · {totalDuration}s").replace("{items}", String(t.length)).replace("{totalDuration}", String(Math.round(C / 1e3))) }),
|
|
382
373
|
u && !x && /* @__PURE__ */ e(
|
|
383
374
|
en,
|
|
384
375
|
{
|
|
@@ -395,50 +386,50 @@ const Xt = ({ item: s }) => {
|
|
|
395
386
|
className: "nice-media-collage__tiles",
|
|
396
387
|
"aria-label": n("mediaCollage.collageOrder", "Collage order"),
|
|
397
388
|
"aria-busy": X.dragging,
|
|
398
|
-
children: t.map((
|
|
399
|
-
const
|
|
400
|
-
|
|
389
|
+
children: t.map((L, j) => {
|
|
390
|
+
const W = B ? X.getHandleProps(
|
|
391
|
+
L.id,
|
|
401
392
|
n("mediaCollage.moveItem", "Move {name}").replace(
|
|
402
393
|
"{name}",
|
|
403
|
-
|
|
394
|
+
L.caption ?? n("mediaCollage.itemN", "item {n}").replace("{n}", String(j + 1))
|
|
404
395
|
)
|
|
405
396
|
) : null;
|
|
406
|
-
return /* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ s(
|
|
407
398
|
"li",
|
|
408
399
|
{
|
|
409
|
-
className: `nice-media-collage__tile${X.activeId ===
|
|
410
|
-
onPointerEnter:
|
|
400
|
+
className: `nice-media-collage__tile${X.activeId === L.id ? " nice-media-collage__tile--active" : ""}${X.overId === L.id ? " nice-media-collage__tile--over" : ""}`,
|
|
401
|
+
onPointerEnter: W == null ? void 0 : W.onPointerEnter,
|
|
411
402
|
children: [
|
|
412
|
-
/* @__PURE__ */ e("span", { className: "nice-media-collage__index", "aria-hidden": "true", children:
|
|
403
|
+
/* @__PURE__ */ e("span", { className: "nice-media-collage__index", "aria-hidden": "true", children: j + 1 }),
|
|
413
404
|
/* @__PURE__ */ e(
|
|
414
405
|
"button",
|
|
415
406
|
{
|
|
416
407
|
type: "button",
|
|
417
408
|
className: "nice-media-collage__thumb-button",
|
|
418
|
-
onClick: () => l == null ? void 0 : l(
|
|
409
|
+
onClick: () => l == null ? void 0 : l(L),
|
|
419
410
|
disabled: !l,
|
|
420
|
-
children:
|
|
411
|
+
children: L.type === "video" ? /* @__PURE__ */ e("span", { className: "nice-media-collage__video-thumb", children: /* @__PURE__ */ e(Ke, { size: 22 }) }) : /* @__PURE__ */ e(
|
|
421
412
|
"img",
|
|
422
413
|
{
|
|
423
414
|
className: "nice-media-collage__thumb",
|
|
424
|
-
src:
|
|
425
|
-
alt:
|
|
415
|
+
src: L.mediaUrl,
|
|
416
|
+
alt: L.caption ?? "",
|
|
426
417
|
loading: "lazy"
|
|
427
418
|
}
|
|
428
419
|
)
|
|
429
420
|
}
|
|
430
421
|
),
|
|
431
|
-
y ===
|
|
432
|
-
|
|
422
|
+
y === L.id ? /* @__PURE__ */ e(
|
|
423
|
+
J,
|
|
433
424
|
{
|
|
434
425
|
value: w,
|
|
435
426
|
onChange: N,
|
|
436
427
|
placeholder: n("mediaCollage.caption", "Caption"),
|
|
437
428
|
autoFocus: !0,
|
|
438
429
|
size: "sm",
|
|
439
|
-
onBlur: () => b(
|
|
430
|
+
onBlur: () => b(L.id),
|
|
440
431
|
onKeyDown: (I) => {
|
|
441
|
-
I.key === "Enter" && b(
|
|
432
|
+
I.key === "Enter" && b(L.id), I.key === "Escape" && M(null);
|
|
442
433
|
}
|
|
443
434
|
}
|
|
444
435
|
) : /* @__PURE__ */ e(
|
|
@@ -448,24 +439,24 @@ const Xt = ({ item: s }) => {
|
|
|
448
439
|
className: "nice-media-collage__caption",
|
|
449
440
|
disabled: !c || x,
|
|
450
441
|
onClick: () => {
|
|
451
|
-
M(
|
|
442
|
+
M(L.id), N(L.caption ?? "");
|
|
452
443
|
},
|
|
453
|
-
children:
|
|
444
|
+
children: L.caption || /* @__PURE__ */ e("em", { children: n("mediaCollage.addACaption", "Add a caption") })
|
|
454
445
|
}
|
|
455
446
|
),
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
|
|
447
|
+
/* @__PURE__ */ s("div", { className: "nice-media-collage__tile-actions", children: [
|
|
448
|
+
W && /* @__PURE__ */ e(
|
|
458
449
|
"span",
|
|
459
450
|
{
|
|
460
451
|
className: "nice-media-collage__grip",
|
|
461
|
-
role:
|
|
462
|
-
tabIndex:
|
|
463
|
-
"aria-grabbed":
|
|
464
|
-
"aria-label":
|
|
465
|
-
draggable:
|
|
466
|
-
onPointerDown:
|
|
467
|
-
onKeyDown:
|
|
468
|
-
children: /* @__PURE__ */ e(
|
|
452
|
+
role: W.role,
|
|
453
|
+
tabIndex: W.tabIndex,
|
|
454
|
+
"aria-grabbed": W["aria-grabbed"],
|
|
455
|
+
"aria-label": W["aria-label"],
|
|
456
|
+
draggable: W.draggable,
|
|
457
|
+
onPointerDown: W.onPointerDown,
|
|
458
|
+
onKeyDown: W.onKeyDown,
|
|
459
|
+
children: /* @__PURE__ */ e(Mn, { size: 14 })
|
|
469
460
|
}
|
|
470
461
|
),
|
|
471
462
|
_ && !P && /* @__PURE__ */ e(
|
|
@@ -475,22 +466,22 @@ const Xt = ({ item: s }) => {
|
|
|
475
466
|
variant: "ghost",
|
|
476
467
|
ariaLabel: n("mediaCollage.removeItem", "Remove {name}").replace(
|
|
477
468
|
"{name}",
|
|
478
|
-
|
|
469
|
+
L.caption ?? n("mediaCollage.itemN", "item {n}").replace("{n}", String(j + 1))
|
|
479
470
|
),
|
|
480
|
-
disabled:
|
|
481
|
-
onClick: () => _(
|
|
482
|
-
children: /* @__PURE__ */ e(
|
|
471
|
+
disabled: g,
|
|
472
|
+
onClick: () => _(L.id),
|
|
473
|
+
children: /* @__PURE__ */ e(De, { size: 14 })
|
|
483
474
|
}
|
|
484
475
|
)
|
|
485
476
|
] })
|
|
486
477
|
]
|
|
487
478
|
},
|
|
488
|
-
|
|
479
|
+
L.id
|
|
489
480
|
);
|
|
490
481
|
})
|
|
491
482
|
}
|
|
492
483
|
),
|
|
493
|
-
u && !x && t.length > 0 && /* @__PURE__ */
|
|
484
|
+
u && !x && t.length > 0 && /* @__PURE__ */ s("p", { className: "nice-media-collage__hint", children: [
|
|
494
485
|
/* @__PURE__ */ e(an, { size: 12 }),
|
|
495
486
|
" ",
|
|
496
487
|
n(
|
|
@@ -503,11 +494,11 @@ const Xt = ({ item: s }) => {
|
|
|
503
494
|
);
|
|
504
495
|
}
|
|
505
496
|
);
|
|
506
|
-
function
|
|
507
|
-
const i =
|
|
497
|
+
function Be(a) {
|
|
498
|
+
const i = a.toLowerCase();
|
|
508
499
|
return ["active", "live", "published", "completed", "confirmed"].includes(i) ? "success" : ["cancelled", "canceled", "rejected", "failed"].includes(i) ? "error" : ["scheduled", "pending", "planning"].includes(i) ? "info" : ["draft", "archived"].includes(i) ? "secondary" : "warning";
|
|
509
500
|
}
|
|
510
|
-
const
|
|
501
|
+
const Kt = {
|
|
511
502
|
micro: [],
|
|
512
503
|
compact: ["details", "location", "budget"],
|
|
513
504
|
normal: ["details", "location", "schedule", "participants", "tasks", "surveys", "budget"],
|
|
@@ -523,10 +514,10 @@ const Gt = {
|
|
|
523
514
|
"documents",
|
|
524
515
|
"settings"
|
|
525
516
|
]
|
|
526
|
-
},
|
|
517
|
+
}, sa = /* @__PURE__ */ te(
|
|
527
518
|
function(i, r) {
|
|
528
|
-
var
|
|
529
|
-
const { t: n } =
|
|
519
|
+
var gn, vn, fn, _n, yn, Nn;
|
|
520
|
+
const { t: n } = ee(), {
|
|
530
521
|
event: t,
|
|
531
522
|
participants: d = [],
|
|
532
523
|
surveys: o = [],
|
|
@@ -537,8 +528,8 @@ const Gt = {
|
|
|
537
528
|
documents: m = [],
|
|
538
529
|
displayMode: h = "normal",
|
|
539
530
|
tabs: z,
|
|
540
|
-
activeTab:
|
|
541
|
-
onTabChange:
|
|
531
|
+
activeTab: v,
|
|
532
|
+
onTabChange: g,
|
|
542
533
|
tabsIconOnly: P = !0,
|
|
543
534
|
tabsCentered: k = "auto",
|
|
544
535
|
countLocation: T = "bottom",
|
|
@@ -550,21 +541,21 @@ const Gt = {
|
|
|
550
541
|
showSurveys: w = !0,
|
|
551
542
|
showVendors: N = !0,
|
|
552
543
|
showBudget: x = !0,
|
|
553
|
-
showDocuments:
|
|
544
|
+
showDocuments: B = !0,
|
|
554
545
|
showSettings: X = !0,
|
|
555
546
|
editable: E = !1,
|
|
556
|
-
onSave:
|
|
557
|
-
onPublish:
|
|
558
|
-
onShare:
|
|
547
|
+
onSave: R,
|
|
548
|
+
onPublish: q,
|
|
549
|
+
onShare: C,
|
|
559
550
|
onExport: b,
|
|
560
|
-
onUpdateEvent:
|
|
561
|
-
onUpdateLocation:
|
|
562
|
-
onAddSurvey:
|
|
551
|
+
onUpdateEvent: L,
|
|
552
|
+
onUpdateLocation: j,
|
|
553
|
+
onAddSurvey: W,
|
|
563
554
|
onSurveyRespond: I,
|
|
564
555
|
onAddBilling: V,
|
|
565
556
|
className: G,
|
|
566
|
-
style:
|
|
567
|
-
} = i, [
|
|
557
|
+
style: ne
|
|
558
|
+
} = i, [Y, ie] = D(t.title), [Z, be] = D(t.description ?? ""), [oe, he] = D(t.startDate ?? ""), [ke, Ee] = D(t.endDate ?? ""), [we, ge] = D(((gn = t.location) == null ? void 0 : gn.name) ?? ""), [Se, He] = D(((vn = t.location) == null ? void 0 : vn.address) ?? ""), [ve, ue] = D(((fn = t.location) == null ? void 0 : fn.virtualUrl) ?? ""), [le, Te] = D(((_n = t.location) == null ? void 0 : _n.isVirtual) ?? !1), [fe, Me] = D(""), [_e, Qe] = D("single"), [Ce, xe] = D(""), [me, Le] = D(""), [Ie, $] = D(""), [O, K] = D("PLN"), Q = {
|
|
568
559
|
details: f,
|
|
569
560
|
location: p,
|
|
570
561
|
schedule: A,
|
|
@@ -573,51 +564,51 @@ const Gt = {
|
|
|
573
564
|
surveys: w,
|
|
574
565
|
vendors: N,
|
|
575
566
|
budget: x,
|
|
576
|
-
documents:
|
|
567
|
+
documents: B,
|
|
577
568
|
settings: X
|
|
578
|
-
}, pe = (z ??
|
|
579
|
-
(
|
|
580
|
-
const de =
|
|
581
|
-
|
|
569
|
+
}, pe = (z ?? Kt[h]).filter((S) => Q[S] !== !1), [Oe, Kn] = D(pe[0] ?? "details"), jn = v ?? Oe, Hn = H(
|
|
570
|
+
(S) => {
|
|
571
|
+
const de = S;
|
|
572
|
+
v === void 0 && Kn(de), g == null || g(de);
|
|
582
573
|
},
|
|
583
|
-
[
|
|
584
|
-
),
|
|
585
|
-
|
|
586
|
-
title:
|
|
587
|
-
description:
|
|
574
|
+
[v, g]
|
|
575
|
+
), Qn = H(() => {
|
|
576
|
+
L == null || L({
|
|
577
|
+
title: Y,
|
|
578
|
+
description: Z || void 0,
|
|
588
579
|
startDate: oe || void 0,
|
|
589
580
|
endDate: ke || void 0
|
|
590
581
|
});
|
|
591
|
-
}, [
|
|
592
|
-
|
|
582
|
+
}, [Y, Z, oe, ke, L]), Zn = H(() => {
|
|
583
|
+
j == null || j({
|
|
593
584
|
name: we,
|
|
594
|
-
address:
|
|
585
|
+
address: Se || void 0,
|
|
595
586
|
virtualUrl: ve || void 0,
|
|
596
587
|
isVirtual: le
|
|
597
588
|
});
|
|
598
|
-
}, [we,
|
|
599
|
-
if (!fe.trim() || !
|
|
589
|
+
}, [we, Se, ve, le, j]), Jn = H(() => {
|
|
590
|
+
if (!fe.trim() || !W)
|
|
600
591
|
return;
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
}, [fe, _e,
|
|
592
|
+
const S = Ce.split(",").map((de) => de.trim()).filter(Boolean);
|
|
593
|
+
W(fe.trim(), _e, S.length > 0 ? S : void 0), Me(""), xe("");
|
|
594
|
+
}, [fe, _e, Ce, W]), et = H(() => {
|
|
604
595
|
!me.trim() || !V || (V({
|
|
605
596
|
label: me.trim(),
|
|
606
|
-
amount: parseFloat(
|
|
597
|
+
amount: parseFloat(Ie) || 0,
|
|
607
598
|
currency: O
|
|
608
|
-
}),
|
|
609
|
-
}, [me,
|
|
610
|
-
() => u.map((
|
|
611
|
-
label:
|
|
612
|
-
amount:
|
|
599
|
+
}), Le(""), $(""));
|
|
600
|
+
}, [me, Ie, O, V]), nt = F(
|
|
601
|
+
() => u.map((S) => ({
|
|
602
|
+
label: S.label,
|
|
603
|
+
amount: S.amount
|
|
613
604
|
})),
|
|
614
605
|
[u]
|
|
615
|
-
),
|
|
606
|
+
), tt = F(() => u.reduce((S, de) => S + de.amount, 0), [u]), it = ((yn = u[0]) == null ? void 0 : yn.currency) ?? "PLN", at = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
616
607
|
/* @__PURE__ */ e(
|
|
617
|
-
|
|
608
|
+
J,
|
|
618
609
|
{
|
|
619
610
|
label: n("eventPlanning.title", "Title"),
|
|
620
|
-
value:
|
|
611
|
+
value: Y,
|
|
621
612
|
onChange: ie,
|
|
622
613
|
readOnly: !E
|
|
623
614
|
}
|
|
@@ -626,14 +617,14 @@ const Gt = {
|
|
|
626
617
|
on,
|
|
627
618
|
{
|
|
628
619
|
label: n("eventPlanning.description", "Description"),
|
|
629
|
-
value:
|
|
620
|
+
value: Z,
|
|
630
621
|
onChange: be,
|
|
631
622
|
readOnly: !E,
|
|
632
623
|
rows: 3
|
|
633
624
|
}
|
|
634
625
|
),
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ s("div", { className: "nice-event-planning__row", children: [
|
|
627
|
+
/* @__PURE__ */ s("label", { className: "nice-field", children: [
|
|
637
628
|
/* @__PURE__ */ e("span", { className: "nice-field__label", children: n("eventPlanning.start", "Start") }),
|
|
638
629
|
/* @__PURE__ */ e(
|
|
639
630
|
"input",
|
|
@@ -641,20 +632,20 @@ const Gt = {
|
|
|
641
632
|
className: "nice-input",
|
|
642
633
|
type: "datetime-local",
|
|
643
634
|
value: oe,
|
|
644
|
-
onChange: (
|
|
635
|
+
onChange: (S) => he(S.target.value),
|
|
645
636
|
readOnly: !E
|
|
646
637
|
}
|
|
647
638
|
)
|
|
648
639
|
] }),
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
/* @__PURE__ */ e("span", { className: "nice-field__label", children: "End" }),
|
|
640
|
+
/* @__PURE__ */ s("label", { className: "nice-field", children: [
|
|
641
|
+
/* @__PURE__ */ e("span", { className: "nice-field__label", children: n("eventPlanning.end", "End") }),
|
|
651
642
|
/* @__PURE__ */ e(
|
|
652
643
|
"input",
|
|
653
644
|
{
|
|
654
645
|
className: "nice-input",
|
|
655
646
|
type: "datetime-local",
|
|
656
647
|
value: ke,
|
|
657
|
-
onChange: (
|
|
648
|
+
onChange: (S) => Ee(S.target.value),
|
|
658
649
|
readOnly: !E
|
|
659
650
|
}
|
|
660
651
|
)
|
|
@@ -664,23 +655,23 @@ const Gt = {
|
|
|
664
655
|
U,
|
|
665
656
|
{
|
|
666
657
|
variant: "primary",
|
|
667
|
-
leftIcon: /* @__PURE__ */ e(
|
|
668
|
-
onClick:
|
|
658
|
+
leftIcon: /* @__PURE__ */ e(re, { name: "check", size: "sm" }),
|
|
659
|
+
onClick: Qn,
|
|
669
660
|
children: n("eventPlanning.saveDetails", "Save details")
|
|
670
661
|
}
|
|
671
662
|
)
|
|
672
|
-
] }),
|
|
663
|
+
] }), st = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
673
664
|
/* @__PURE__ */ e(
|
|
674
665
|
Ze,
|
|
675
666
|
{
|
|
676
667
|
label: n("eventPlanning.virtualEvent", "Virtual event"),
|
|
677
668
|
checked: le,
|
|
678
|
-
onChange:
|
|
669
|
+
onChange: Te,
|
|
679
670
|
disabled: !E
|
|
680
671
|
}
|
|
681
672
|
),
|
|
682
673
|
/* @__PURE__ */ e(
|
|
683
|
-
|
|
674
|
+
J,
|
|
684
675
|
{
|
|
685
676
|
label: n("eventPlanning.venueName", "Venue name"),
|
|
686
677
|
value: we,
|
|
@@ -689,7 +680,7 @@ const Gt = {
|
|
|
689
680
|
}
|
|
690
681
|
),
|
|
691
682
|
le ? /* @__PURE__ */ e(
|
|
692
|
-
|
|
683
|
+
J,
|
|
693
684
|
{
|
|
694
685
|
label: n("eventPlanning.virtualUrl", "Virtual URL"),
|
|
695
686
|
value: ve,
|
|
@@ -697,10 +688,10 @@ const Gt = {
|
|
|
697
688
|
readOnly: !E
|
|
698
689
|
}
|
|
699
690
|
) : /* @__PURE__ */ e(
|
|
700
|
-
|
|
691
|
+
J,
|
|
701
692
|
{
|
|
702
693
|
label: n("eventPlanning.address", "Address"),
|
|
703
|
-
value:
|
|
694
|
+
value: Se,
|
|
704
695
|
onChange: He,
|
|
705
696
|
readOnly: !E
|
|
706
697
|
}
|
|
@@ -709,54 +700,54 @@ const Gt = {
|
|
|
709
700
|
U,
|
|
710
701
|
{
|
|
711
702
|
variant: "primary",
|
|
712
|
-
leftIcon: /* @__PURE__ */ e(
|
|
713
|
-
onClick:
|
|
703
|
+
leftIcon: /* @__PURE__ */ e(re, { name: "check", size: "sm" }),
|
|
704
|
+
onClick: Zn,
|
|
714
705
|
children: n("eventPlanning.saveLocation", "Save location")
|
|
715
706
|
}
|
|
716
707
|
)
|
|
717
|
-
] }),
|
|
718
|
-
/* @__PURE__ */ e(
|
|
719
|
-
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: d.map((
|
|
720
|
-
/* @__PURE__ */ e(Ve, { name:
|
|
721
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children:
|
|
722
|
-
/* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant:
|
|
723
|
-
] },
|
|
724
|
-
] }) }),
|
|
725
|
-
o.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noSurveysYet", "No surveys yet.") }) : o.map((
|
|
726
|
-
/* @__PURE__ */ e("strong", { children:
|
|
708
|
+
] }), rt = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children: d.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noParticipantsYet", "No participants yet.") }) : /* @__PURE__ */ s(Ge, { children: [
|
|
709
|
+
/* @__PURE__ */ e(bn, { max: 8, children: d.map((S) => /* @__PURE__ */ e(Ve, { name: S.name, src: S.avatarUrl }, S.id)) }),
|
|
710
|
+
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: d.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__participant", children: [
|
|
711
|
+
/* @__PURE__ */ e(Ve, { name: S.name, src: S.avatarUrl, size: "sm" }),
|
|
712
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children: S.name }),
|
|
713
|
+
/* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: Be(S.status), children: n(`participantList.status.${S.status}`, S.status) })
|
|
714
|
+
] }, S.id)) })
|
|
715
|
+
] }) }), ct = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
716
|
+
o.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noSurveysYet", "No surveys yet.") }) : o.map((S) => /* @__PURE__ */ s("div", { className: "nice-event-planning__survey", children: [
|
|
717
|
+
/* @__PURE__ */ e("strong", { children: S.question }),
|
|
727
718
|
" ",
|
|
728
|
-
/* @__PURE__ */ e(ae, { size: "xs", outline: !0, variant: "info", children: n(`eventPlanning.surveyType.${
|
|
729
|
-
|
|
719
|
+
/* @__PURE__ */ e(ae, { size: "xs", outline: !0, variant: "info", children: n(`eventPlanning.surveyType.${S.type}`, S.type) }),
|
|
720
|
+
S.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: S.options.map((de, yt) => /* @__PURE__ */ e(
|
|
730
721
|
U,
|
|
731
722
|
{
|
|
732
723
|
size: "sm",
|
|
733
724
|
variant: "outline",
|
|
734
|
-
onClick: () => I == null ? void 0 : I(
|
|
725
|
+
onClick: () => I == null ? void 0 : I(S.id, de),
|
|
735
726
|
children: de
|
|
736
727
|
},
|
|
737
|
-
|
|
728
|
+
yt
|
|
738
729
|
)) }),
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
] },
|
|
744
|
-
E &&
|
|
730
|
+
S.responses && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: n("eventPlanning.responses", "{responses} responses").replace(
|
|
731
|
+
"{responses}",
|
|
732
|
+
String(S.responses.length)
|
|
733
|
+
) })
|
|
734
|
+
] }, S.id)),
|
|
735
|
+
E && W && /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
745
736
|
/* @__PURE__ */ e(
|
|
746
|
-
|
|
737
|
+
J,
|
|
747
738
|
{
|
|
748
739
|
label: n("eventPlanning.newSurveyQuestion", "New survey question"),
|
|
749
740
|
value: fe,
|
|
750
|
-
onChange:
|
|
741
|
+
onChange: Me,
|
|
751
742
|
placeholder: n("eventPlanning.question", "Question")
|
|
752
743
|
}
|
|
753
744
|
),
|
|
754
745
|
/* @__PURE__ */ e(
|
|
755
|
-
|
|
746
|
+
ze,
|
|
756
747
|
{
|
|
757
748
|
label: n("eventPlanning.type", "Type"),
|
|
758
749
|
value: _e,
|
|
759
|
-
onChange: (
|
|
750
|
+
onChange: (S) => Qe(S),
|
|
760
751
|
options: [
|
|
761
752
|
{ value: "single", label: n("eventPlanning.singleChoice", "Single choice") },
|
|
762
753
|
{ value: "multiple", label: n("eventPlanning.multipleChoice", "Multiple choice") },
|
|
@@ -766,11 +757,11 @@ const Gt = {
|
|
|
766
757
|
}
|
|
767
758
|
),
|
|
768
759
|
/* @__PURE__ */ e(
|
|
769
|
-
|
|
760
|
+
J,
|
|
770
761
|
{
|
|
771
762
|
label: n("eventPlanning.optionsCommaSeparated", "Options (comma-separated)"),
|
|
772
|
-
value:
|
|
773
|
-
onChange:
|
|
763
|
+
value: Ce,
|
|
764
|
+
onChange: xe,
|
|
774
765
|
placeholder: n("eventPlanning.yesNoMaybe", "Yes, No, Maybe")
|
|
775
766
|
}
|
|
776
767
|
),
|
|
@@ -778,49 +769,49 @@ const Gt = {
|
|
|
778
769
|
U,
|
|
779
770
|
{
|
|
780
771
|
variant: "primary",
|
|
781
|
-
leftIcon: /* @__PURE__ */ e(
|
|
782
|
-
onClick:
|
|
772
|
+
leftIcon: /* @__PURE__ */ e(re, { name: "plus", size: "sm" }),
|
|
773
|
+
onClick: Jn,
|
|
783
774
|
disabled: !fe.trim(),
|
|
784
775
|
children: n("eventPlanning.addSurvey", "Add survey")
|
|
785
776
|
}
|
|
786
777
|
)
|
|
787
778
|
] })
|
|
788
|
-
] }),
|
|
779
|
+
] }), lt = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
789
780
|
u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noBillingItemsYet", "No billing items yet.") }) : /* @__PURE__ */ e(
|
|
790
|
-
|
|
781
|
+
Ot,
|
|
791
782
|
{
|
|
792
783
|
lines: [
|
|
793
|
-
...
|
|
794
|
-
{ label: n("eventPlanning.total", "Total"), amount:
|
|
784
|
+
...nt,
|
|
785
|
+
{ label: n("eventPlanning.total", "Total"), amount: tt, isSummary: !0 }
|
|
795
786
|
],
|
|
796
|
-
currency:
|
|
787
|
+
currency: it
|
|
797
788
|
}
|
|
798
789
|
),
|
|
799
|
-
E && V && /* @__PURE__ */
|
|
790
|
+
E && V && /* @__PURE__ */ s("div", { className: "nice-event-planning__row", children: [
|
|
800
791
|
/* @__PURE__ */ e(
|
|
801
|
-
|
|
792
|
+
J,
|
|
802
793
|
{
|
|
803
794
|
label: n("eventPlanning.item", "Item"),
|
|
804
795
|
value: me,
|
|
805
|
-
onChange:
|
|
796
|
+
onChange: Le,
|
|
806
797
|
placeholder: n("eventPlanning.catering", "Catering")
|
|
807
798
|
}
|
|
808
799
|
),
|
|
809
800
|
/* @__PURE__ */ e(
|
|
810
|
-
|
|
801
|
+
J,
|
|
811
802
|
{
|
|
812
803
|
label: n("eventPlanning.amount", "Amount"),
|
|
813
|
-
value:
|
|
814
|
-
onChange:
|
|
804
|
+
value: Ie,
|
|
805
|
+
onChange: $,
|
|
815
806
|
placeholder: "0.00"
|
|
816
807
|
}
|
|
817
808
|
),
|
|
818
809
|
/* @__PURE__ */ e(
|
|
819
|
-
|
|
810
|
+
ze,
|
|
820
811
|
{
|
|
821
812
|
label: n("eventPlanning.currency", "Currency"),
|
|
822
813
|
value: O,
|
|
823
|
-
onChange: (
|
|
814
|
+
onChange: (S) => K(S),
|
|
824
815
|
options: ["PLN", "EUR", "USD", "GBP"]
|
|
825
816
|
}
|
|
826
817
|
),
|
|
@@ -828,14 +819,14 @@ const Gt = {
|
|
|
828
819
|
U,
|
|
829
820
|
{
|
|
830
821
|
variant: "primary",
|
|
831
|
-
leftIcon: /* @__PURE__ */ e(
|
|
832
|
-
onClick:
|
|
822
|
+
leftIcon: /* @__PURE__ */ e(re, { name: "plus", size: "sm" }),
|
|
823
|
+
onClick: et,
|
|
833
824
|
disabled: !me.trim(),
|
|
834
|
-
children: "Add"
|
|
825
|
+
children: n("eventPlanning.add", "Add")
|
|
835
826
|
}
|
|
836
827
|
)
|
|
837
828
|
] })
|
|
838
|
-
] }),
|
|
829
|
+
] }), ot = /* @__PURE__ */ s("div", { className: "nice-event-planning__form", children: [
|
|
839
830
|
/* @__PURE__ */ e(
|
|
840
831
|
Ze,
|
|
841
832
|
{
|
|
@@ -845,7 +836,7 @@ const Gt = {
|
|
|
845
836
|
}
|
|
846
837
|
),
|
|
847
838
|
/* @__PURE__ */ e(
|
|
848
|
-
|
|
839
|
+
J,
|
|
849
840
|
{
|
|
850
841
|
label: n("eventPlanning.maxParticipants", "Max participants"),
|
|
851
842
|
value: t.maxParticipants != null ? String(t.maxParticipants) : "",
|
|
@@ -854,54 +845,49 @@ const Gt = {
|
|
|
854
845
|
readOnly: !E
|
|
855
846
|
}
|
|
856
847
|
),
|
|
857
|
-
/* @__PURE__ */
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
] }), ot = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: _.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noAgendaItemsYet", "No agenda items yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__schedule", children: _.map((C) => /* @__PURE__ */ a("li", { className: "nice-event-planning__schedule-item", children: [
|
|
864
|
-
/* @__PURE__ */ a("span", { className: "nice-event-planning__schedule-time", children: [
|
|
865
|
-
/* @__PURE__ */ e(se, { name: "clock", size: "sm" }),
|
|
866
|
-
C.startTime ?? "",
|
|
867
|
-
C.endTime ? `–${C.endTime}` : ""
|
|
848
|
+
/* @__PURE__ */ e("div", { className: "nice-event-planning__muted", children: n("eventPlanning.hostCreated", "Host: {hostName} · Created {createdAt}").replace("{hostName}", String(t.hostName)).replace("{createdAt}", String(new Date(t.createdAt).toLocaleDateString())) })
|
|
849
|
+
] }), dt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: _.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noAgendaItemsYet", "No agenda items yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__schedule", children: _.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__schedule-item", children: [
|
|
850
|
+
/* @__PURE__ */ s("span", { className: "nice-event-planning__schedule-time", children: [
|
|
851
|
+
/* @__PURE__ */ e(re, { name: "clock", size: "sm" }),
|
|
852
|
+
S.startTime ?? "",
|
|
853
|
+
S.endTime ? `–${S.endTime}` : ""
|
|
868
854
|
] }),
|
|
869
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__schedule-title", children:
|
|
870
|
-
|
|
871
|
-
] },
|
|
872
|
-
/* @__PURE__ */ e(Ze, { label:
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
] },
|
|
876
|
-
/* @__PURE__ */ e(
|
|
877
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__vendor-name", children:
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
855
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__schedule-title", children: S.title }),
|
|
856
|
+
S.location && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.location })
|
|
857
|
+
] }, S.id)) }) }), ut = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: c.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noTasksYet", "No tasks yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__tasks", children: c.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__task", children: [
|
|
858
|
+
/* @__PURE__ */ e(Ze, { label: S.title, checked: S.done ?? !1, disabled: !E }),
|
|
859
|
+
S.assigneeName && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "info", children: S.assigneeName }),
|
|
860
|
+
S.dueDate && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.dueDate })
|
|
861
|
+
] }, S.id)) }) }), mt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: l.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noVendorsYet", "No vendors yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__vendors", children: l.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__vendor", children: [
|
|
862
|
+
/* @__PURE__ */ e(re, { name: "briefcase", size: "sm" }),
|
|
863
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__vendor-name", children: S.name }),
|
|
864
|
+
S.category && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: S.category }),
|
|
865
|
+
S.status && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: Be(S.status), children: n(`eventPlanning.vendorStatus.${S.status}`, S.status) }),
|
|
866
|
+
S.cost != null && /* @__PURE__ */ s("span", { className: "nice-event-planning__vendor-cost", children: [
|
|
867
|
+
S.cost,
|
|
882
868
|
" ",
|
|
883
|
-
|
|
869
|
+
S.currency ?? ""
|
|
884
870
|
] })
|
|
885
|
-
] },
|
|
886
|
-
/* @__PURE__ */ e(
|
|
887
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__document-name", children:
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
871
|
+
] }, S.id)) }) }), pt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: m.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: n("eventPlanning.noDocumentsYet", "No documents yet.") }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__documents", children: m.map((S) => /* @__PURE__ */ s("li", { className: "nice-event-planning__document", children: [
|
|
872
|
+
/* @__PURE__ */ e(re, { name: "file", size: "sm" }),
|
|
873
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__document-name", children: S.name }),
|
|
874
|
+
S.fileType && /* @__PURE__ */ e(ae, { size: "xs", outline: !0, variant: "secondary", children: S.fileType }),
|
|
875
|
+
S.sizeKb != null && /* @__PURE__ */ s("span", { className: "nice-event-planning__muted", children: [
|
|
876
|
+
S.sizeKb,
|
|
891
877
|
" KB"
|
|
892
878
|
] })
|
|
893
|
-
] },
|
|
894
|
-
details:
|
|
895
|
-
location:
|
|
896
|
-
schedule:
|
|
897
|
-
participants:
|
|
898
|
-
tasks:
|
|
899
|
-
surveys:
|
|
900
|
-
vendors:
|
|
901
|
-
budget:
|
|
902
|
-
documents:
|
|
903
|
-
settings:
|
|
904
|
-
},
|
|
879
|
+
] }, S.id)) }) }), ht = {
|
|
880
|
+
details: at,
|
|
881
|
+
location: st,
|
|
882
|
+
schedule: dt,
|
|
883
|
+
participants: rt,
|
|
884
|
+
tasks: ut,
|
|
885
|
+
surveys: ct,
|
|
886
|
+
vendors: mt,
|
|
887
|
+
budget: lt,
|
|
888
|
+
documents: pt,
|
|
889
|
+
settings: ot
|
|
890
|
+
}, gt = {
|
|
905
891
|
details: "file",
|
|
906
892
|
location: "home",
|
|
907
893
|
schedule: "clock",
|
|
@@ -912,7 +898,7 @@ const Gt = {
|
|
|
912
898
|
budget: "dollar",
|
|
913
899
|
documents: "folder",
|
|
914
900
|
settings: "settings"
|
|
915
|
-
},
|
|
901
|
+
}, vt = {
|
|
916
902
|
schedule: _.length || void 0,
|
|
917
903
|
participants: d.length || void 0,
|
|
918
904
|
tasks: c.length || void 0,
|
|
@@ -920,47 +906,47 @@ const Gt = {
|
|
|
920
906
|
vendors: l.length || void 0,
|
|
921
907
|
budget: u.length || void 0,
|
|
922
908
|
documents: m.length || void 0
|
|
923
|
-
},
|
|
924
|
-
id:
|
|
925
|
-
label:
|
|
926
|
-
icon: /* @__PURE__ */ e(
|
|
927
|
-
badge:
|
|
928
|
-
content:
|
|
929
|
-
})),
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */ e(
|
|
909
|
+
}, ft = pe.map((S) => ({
|
|
910
|
+
id: S,
|
|
911
|
+
label: S.charAt(0).toUpperCase() + S.slice(1),
|
|
912
|
+
icon: /* @__PURE__ */ e(re, { name: gt[S], size: "sm" }),
|
|
913
|
+
badge: vt[S],
|
|
914
|
+
content: ht[S]
|
|
915
|
+
})), _t = /* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar", children: [
|
|
916
|
+
/* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar-title", children: [
|
|
917
|
+
/* @__PURE__ */ e(re, { name: "calendar", size: "md" }),
|
|
932
918
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: t.title }),
|
|
933
|
-
/* @__PURE__ */ e(ae, { size: "sm", variant:
|
|
919
|
+
/* @__PURE__ */ e(ae, { size: "sm", variant: Be(t.status), children: n(`eventPlanning.eventStatus.${t.status}`, t.status) })
|
|
934
920
|
] }),
|
|
935
921
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__toolbar-spacer" }),
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
-
|
|
922
|
+
/* @__PURE__ */ s("div", { className: "nice-event-planning__toolbar-actions", children: [
|
|
923
|
+
R && /* @__PURE__ */ e(
|
|
938
924
|
U,
|
|
939
925
|
{
|
|
940
926
|
size: "sm",
|
|
941
927
|
variant: "primary",
|
|
942
|
-
leftIcon: /* @__PURE__ */ e(
|
|
943
|
-
onClick: () =>
|
|
928
|
+
leftIcon: /* @__PURE__ */ e(re, { name: "check", size: "sm" }),
|
|
929
|
+
onClick: () => R({ title: Y, description: Z }),
|
|
944
930
|
children: n("eventPlanning.save", "Save")
|
|
945
931
|
}
|
|
946
932
|
),
|
|
947
|
-
|
|
933
|
+
q && /* @__PURE__ */ e(
|
|
948
934
|
U,
|
|
949
935
|
{
|
|
950
936
|
size: "sm",
|
|
951
937
|
variant: "success",
|
|
952
|
-
leftIcon: /* @__PURE__ */ e(
|
|
953
|
-
onClick:
|
|
938
|
+
leftIcon: /* @__PURE__ */ e(re, { name: "upload", size: "sm" }),
|
|
939
|
+
onClick: q,
|
|
954
940
|
children: n("eventPlanning.publish", "Publish")
|
|
955
941
|
}
|
|
956
942
|
),
|
|
957
|
-
|
|
943
|
+
C && /* @__PURE__ */ e(
|
|
958
944
|
U,
|
|
959
945
|
{
|
|
960
946
|
size: "sm",
|
|
961
947
|
variant: "ghost",
|
|
962
|
-
leftIcon: /* @__PURE__ */ e(
|
|
963
|
-
onClick:
|
|
948
|
+
leftIcon: /* @__PURE__ */ e(re, { name: "link", size: "sm" }),
|
|
949
|
+
onClick: C,
|
|
964
950
|
children: n("eventPlanning.share", "Share")
|
|
965
951
|
}
|
|
966
952
|
),
|
|
@@ -969,7 +955,7 @@ const Gt = {
|
|
|
969
955
|
{
|
|
970
956
|
size: "sm",
|
|
971
957
|
variant: "ghost",
|
|
972
|
-
leftIcon: /* @__PURE__ */ e(
|
|
958
|
+
leftIcon: /* @__PURE__ */ e(re, { name: "download", size: "sm" }),
|
|
973
959
|
onClick: b,
|
|
974
960
|
children: n("eventPlanning.export", "Export")
|
|
975
961
|
}
|
|
@@ -981,34 +967,34 @@ const Gt = {
|
|
|
981
967
|
{
|
|
982
968
|
ref: r,
|
|
983
969
|
className: `nice-event-planning nice-event-planning--micro ${G ?? ""}`,
|
|
984
|
-
style:
|
|
985
|
-
children: /* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */ e(
|
|
987
|
-
/* @__PURE__ */
|
|
970
|
+
style: ne,
|
|
971
|
+
children: /* @__PURE__ */ s("div", { className: "nice-event-planning__micro", children: [
|
|
972
|
+
/* @__PURE__ */ e(re, { name: "calendar", size: "md" }),
|
|
973
|
+
/* @__PURE__ */ s("div", { className: "nice-event-planning__micro-body", children: [
|
|
988
974
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: t.title }),
|
|
989
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ s("span", { className: "nice-event-planning__muted", children: [
|
|
990
976
|
t.startDate ? new Date(t.startDate).toLocaleString() : n("eventPlanning.noDate", "No date"),
|
|
991
|
-
(
|
|
977
|
+
(Nn = t.location) != null && Nn.name ? ` · ${t.location.name}` : ""
|
|
992
978
|
] })
|
|
993
979
|
] }),
|
|
994
|
-
/* @__PURE__ */ e(ae, { size: "sm", variant:
|
|
995
|
-
d.length > 0 && /* @__PURE__ */ e(
|
|
980
|
+
/* @__PURE__ */ e(ae, { size: "sm", variant: Be(t.status), children: n(`eventPlanning.eventStatus.${t.status}`, t.status) }),
|
|
981
|
+
d.length > 0 && /* @__PURE__ */ e(bn, { max: 4, size: "sm", children: d.map((S) => /* @__PURE__ */ e(Ve, { name: S.name, src: S.avatarUrl, size: "sm" }, S.id)) })
|
|
996
982
|
] })
|
|
997
983
|
}
|
|
998
|
-
) : /* @__PURE__ */
|
|
984
|
+
) : /* @__PURE__ */ s(
|
|
999
985
|
"div",
|
|
1000
986
|
{
|
|
1001
987
|
ref: r,
|
|
1002
988
|
className: `nice-event-planning nice-event-planning--${h} ${G ?? ""}`,
|
|
1003
|
-
style:
|
|
989
|
+
style: ne,
|
|
1004
990
|
children: [
|
|
1005
|
-
|
|
991
|
+
_t,
|
|
1006
992
|
/* @__PURE__ */ e(
|
|
1007
|
-
|
|
993
|
+
Bt,
|
|
1008
994
|
{
|
|
1009
|
-
tabs:
|
|
1010
|
-
activeTab:
|
|
1011
|
-
onChange:
|
|
995
|
+
tabs: ft,
|
|
996
|
+
activeTab: jn,
|
|
997
|
+
onChange: Hn,
|
|
1012
998
|
iconOnly: P,
|
|
1013
999
|
centered: k,
|
|
1014
1000
|
countLocation: T
|
|
@@ -1019,8 +1005,8 @@ const Gt = {
|
|
|
1019
1005
|
);
|
|
1020
1006
|
}
|
|
1021
1007
|
);
|
|
1022
|
-
function
|
|
1023
|
-
switch (
|
|
1008
|
+
function jt(a) {
|
|
1009
|
+
switch (a) {
|
|
1024
1010
|
case "confirmed":
|
|
1025
1011
|
return "success";
|
|
1026
1012
|
case "checked-in":
|
|
@@ -1034,7 +1020,7 @@ function Kt(s) {
|
|
|
1034
1020
|
}
|
|
1035
1021
|
}
|
|
1036
1022
|
const nn = ({
|
|
1037
|
-
participant:
|
|
1023
|
+
participant: a,
|
|
1038
1024
|
showRole: i = !0,
|
|
1039
1025
|
showStatus: r = !0,
|
|
1040
1026
|
meta: n,
|
|
@@ -1042,31 +1028,31 @@ const nn = ({
|
|
|
1042
1028
|
size: d = "md",
|
|
1043
1029
|
className: o
|
|
1044
1030
|
}) => {
|
|
1045
|
-
const { t: u } =
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */ e(Ve, { name:
|
|
1048
|
-
/* @__PURE__ */ e("span", { className: "nice-participant-row__name", children:
|
|
1049
|
-
i &&
|
|
1050
|
-
r &&
|
|
1031
|
+
const { t: u } = ee();
|
|
1032
|
+
return /* @__PURE__ */ s("li", { className: `nice-participant-row nice-participant-row--${d} ${o ?? ""}`, children: [
|
|
1033
|
+
/* @__PURE__ */ e(Ve, { name: a.name, src: a.avatarUrl, size: d }),
|
|
1034
|
+
/* @__PURE__ */ e("span", { className: "nice-participant-row__name", children: a.name }),
|
|
1035
|
+
i && a.role && /* @__PURE__ */ e(ae, { size: "xs", outline: !0, variant: "info", children: u(`participantList.role.${a.role}`, a.role) }),
|
|
1036
|
+
r && a.status && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: jt(a.status), children: u(`participantList.status.${a.status}`, a.status) }),
|
|
1051
1037
|
n && /* @__PURE__ */ e("span", { className: "nice-participant-row__meta", children: n }),
|
|
1052
1038
|
t && /* @__PURE__ */ e("span", { className: "nice-participant-row__trailing", children: t })
|
|
1053
1039
|
] });
|
|
1054
|
-
},
|
|
1055
|
-
function
|
|
1040
|
+
}, Ht = /^[^\s@,;]+@[^\s@,;]+\.[^\s@,;]{2,}$/, wn = /^.*<\s*([^<>\s]+)\s*>$/;
|
|
1041
|
+
function Xn(a) {
|
|
1056
1042
|
var d, o;
|
|
1057
1043
|
const i = [], r = [], n = /* @__PURE__ */ new Set();
|
|
1058
1044
|
let t = 0;
|
|
1059
|
-
if (!
|
|
1045
|
+
if (!a)
|
|
1060
1046
|
return { valid: i, invalid: r, duplicates: t };
|
|
1061
|
-
for (const u of
|
|
1047
|
+
for (const u of a.split(/[,;\r\n\t]+/)) {
|
|
1062
1048
|
const _ = u.trim();
|
|
1063
1049
|
if (!_)
|
|
1064
1050
|
continue;
|
|
1065
|
-
const c = ((o = (d =
|
|
1051
|
+
const c = ((o = (d = wn.exec(_)) == null ? void 0 : d[1]) == null ? void 0 : o.trim()) ?? _, l = wn.test(_) ? [c] : c.split(/\s+/);
|
|
1066
1052
|
for (const m of l) {
|
|
1067
1053
|
if (!m)
|
|
1068
1054
|
continue;
|
|
1069
|
-
if (!
|
|
1055
|
+
if (!Ht.test(m)) {
|
|
1070
1056
|
r.push(m);
|
|
1071
1057
|
continue;
|
|
1072
1058
|
}
|
|
@@ -1080,16 +1066,16 @@ function Fn(s) {
|
|
|
1080
1066
|
}
|
|
1081
1067
|
return { valid: i, invalid: r, duplicates: t };
|
|
1082
1068
|
}
|
|
1083
|
-
function
|
|
1084
|
-
const r = new Set(
|
|
1069
|
+
function Qt(a, i) {
|
|
1070
|
+
const r = new Set(a.map((t) => t.toLowerCase())), n = [...a];
|
|
1085
1071
|
for (const t of i) {
|
|
1086
1072
|
const d = t.toLowerCase();
|
|
1087
1073
|
r.has(d) || (r.add(d), n.push(t));
|
|
1088
1074
|
}
|
|
1089
1075
|
return n;
|
|
1090
1076
|
}
|
|
1091
|
-
function
|
|
1092
|
-
const { currentUserId: i, currentUserName: r, requireIdentity: n = !0 } =
|
|
1077
|
+
function qn(a = {}) {
|
|
1078
|
+
const { currentUserId: i, currentUserName: r, requireIdentity: n = !0 } = a, [t, d] = D(""), o = !i, u = r ?? t, _ = !n || u.trim().length > 0;
|
|
1093
1079
|
return {
|
|
1094
1080
|
isAnonymous: o,
|
|
1095
1081
|
name: u,
|
|
@@ -1098,13 +1084,13 @@ function Xn(s = {}) {
|
|
|
1098
1084
|
actor: { userId: i, userName: u.trim() }
|
|
1099
1085
|
};
|
|
1100
1086
|
}
|
|
1101
|
-
const
|
|
1087
|
+
const Zt = [
|
|
1102
1088
|
{ answer: "yes", label: "Yes", variant: "success", Icon: je },
|
|
1103
1089
|
{ answer: "maybe", label: "Maybe", variant: "warning", Icon: sn },
|
|
1104
1090
|
{ answer: "no", label: "No", variant: "error", Icon: $n }
|
|
1105
|
-
],
|
|
1091
|
+
], Sn = /* @__PURE__ */ te(
|
|
1106
1092
|
function(i, r) {
|
|
1107
|
-
const { t: n } =
|
|
1093
|
+
const { t: n } = ee(), {
|
|
1108
1094
|
value: t,
|
|
1109
1095
|
onRespond: d,
|
|
1110
1096
|
allowPlusOnes: o = !1,
|
|
@@ -1115,11 +1101,11 @@ const Qt = [
|
|
|
1115
1101
|
currentUserName: m,
|
|
1116
1102
|
compact: h = !1,
|
|
1117
1103
|
disabled: z = !1,
|
|
1118
|
-
readOnly:
|
|
1119
|
-
size:
|
|
1104
|
+
readOnly: v = !1,
|
|
1105
|
+
size: g = "md",
|
|
1120
1106
|
className: P,
|
|
1121
1107
|
style: k
|
|
1122
|
-
} = i, T =
|
|
1108
|
+
} = i, T = qn({ currentUserId: l, currentUserName: m }), [f, p] = D(_), [A, y] = D(""), M = !h && T.isAnonymous && !T.canAct, w = z || v, N = (x) => {
|
|
1123
1109
|
w || !d || d({
|
|
1124
1110
|
answer: x,
|
|
1125
1111
|
plusOnes: o && x !== "no" ? f : void 0,
|
|
@@ -1128,15 +1114,15 @@ const Qt = [
|
|
|
1128
1114
|
userName: T.actor.userName || void 0
|
|
1129
1115
|
});
|
|
1130
1116
|
};
|
|
1131
|
-
return /* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ s(
|
|
1132
1118
|
"div",
|
|
1133
1119
|
{
|
|
1134
1120
|
ref: r,
|
|
1135
|
-
className: `nice-rsvp-control nice-rsvp-control--${
|
|
1121
|
+
className: `nice-rsvp-control nice-rsvp-control--${g}${h ? " nice-rsvp-control--compact" : ""} ${P ?? ""}`,
|
|
1136
1122
|
style: k,
|
|
1137
1123
|
children: [
|
|
1138
1124
|
!h && T.isAnonymous && /* @__PURE__ */ e(
|
|
1139
|
-
|
|
1125
|
+
J,
|
|
1140
1126
|
{
|
|
1141
1127
|
label: n("rsvpControl.yourName", "Your name"),
|
|
1142
1128
|
value: T.name,
|
|
@@ -1144,7 +1130,7 @@ const Qt = [
|
|
|
1144
1130
|
placeholder: n("rsvpControl.whoIsReplying", "Who is replying?"),
|
|
1145
1131
|
required: !0,
|
|
1146
1132
|
disabled: w,
|
|
1147
|
-
size:
|
|
1133
|
+
size: g
|
|
1148
1134
|
}
|
|
1149
1135
|
),
|
|
1150
1136
|
/* @__PURE__ */ e(
|
|
@@ -1153,22 +1139,22 @@ const Qt = [
|
|
|
1153
1139
|
className: "nice-rsvp-control__answers",
|
|
1154
1140
|
role: "group",
|
|
1155
1141
|
"aria-label": n("rsvpControl.yourReply", "Your reply"),
|
|
1156
|
-
children:
|
|
1142
|
+
children: Zt.map(({ answer: x, label: B, variant: X, Icon: E }) => /* @__PURE__ */ e(
|
|
1157
1143
|
U,
|
|
1158
1144
|
{
|
|
1159
|
-
size:
|
|
1145
|
+
size: g,
|
|
1160
1146
|
variant: t === x ? X : "outline",
|
|
1161
1147
|
leftIcon: /* @__PURE__ */ e(E, { size: 16 }),
|
|
1162
1148
|
disabled: w || M,
|
|
1163
1149
|
"aria-pressed": t === x,
|
|
1164
1150
|
onClick: () => N(x),
|
|
1165
|
-
children: n(`rsvpControl.answer.${x}`,
|
|
1151
|
+
children: n(`rsvpControl.answer.${x}`, B)
|
|
1166
1152
|
},
|
|
1167
1153
|
x
|
|
1168
1154
|
))
|
|
1169
1155
|
}
|
|
1170
1156
|
),
|
|
1171
|
-
!h && o && t !== "no" && /* @__PURE__ */
|
|
1157
|
+
!h && o && t !== "no" && /* @__PURE__ */ s("label", { className: "nice-rsvp-control__field", children: [
|
|
1172
1158
|
/* @__PURE__ */ e("span", { className: "nice-rsvp-control__field-label", children: n("rsvpControl.additionalGuests", "Additional guests") }),
|
|
1173
1159
|
/* @__PURE__ */ e(
|
|
1174
1160
|
dn,
|
|
@@ -1184,14 +1170,14 @@ const Qt = [
|
|
|
1184
1170
|
)
|
|
1185
1171
|
] }),
|
|
1186
1172
|
!h && c && /* @__PURE__ */ e(
|
|
1187
|
-
|
|
1173
|
+
J,
|
|
1188
1174
|
{
|
|
1189
1175
|
label: n("rsvpControl.note", "Note"),
|
|
1190
1176
|
value: A,
|
|
1191
1177
|
onChange: y,
|
|
1192
1178
|
placeholder: n("rsvpControl.anythingWeShouldKnow", "Anything we should know?"),
|
|
1193
1179
|
disabled: w,
|
|
1194
|
-
size:
|
|
1180
|
+
size: g
|
|
1195
1181
|
}
|
|
1196
1182
|
),
|
|
1197
1183
|
M && /* @__PURE__ */ e("p", { className: "nice-rsvp-control__hint", children: n("rsvpControl.enterYourNameToReply", "Enter your name to reply.") })
|
|
@@ -1199,7 +1185,7 @@ const Qt = [
|
|
|
1199
1185
|
}
|
|
1200
1186
|
);
|
|
1201
1187
|
}
|
|
1202
|
-
),
|
|
1188
|
+
), Jt = {
|
|
1203
1189
|
yes: "confirmed",
|
|
1204
1190
|
maybe: "invited",
|
|
1205
1191
|
no: "declined"
|
|
@@ -1207,15 +1193,15 @@ const Qt = [
|
|
|
1207
1193
|
confirmed: "yes",
|
|
1208
1194
|
"checked-in": "yes",
|
|
1209
1195
|
declined: "no"
|
|
1210
|
-
},
|
|
1196
|
+
}, Ye = [
|
|
1211
1197
|
"confirmed",
|
|
1212
1198
|
"checked-in",
|
|
1213
1199
|
"invited",
|
|
1214
1200
|
"declined",
|
|
1215
1201
|
"no-show"
|
|
1216
|
-
],
|
|
1217
|
-
const { t: n } =
|
|
1218
|
-
participants: t =
|
|
1202
|
+
], ei = [], ra = /* @__PURE__ */ te(function(i, r) {
|
|
1203
|
+
const { t: n } = ee(), {
|
|
1204
|
+
participants: t = ei,
|
|
1219
1205
|
mode: d = "organizer",
|
|
1220
1206
|
currentUserId: o,
|
|
1221
1207
|
currentUserName: u,
|
|
@@ -1225,8 +1211,8 @@ const Qt = [
|
|
|
1225
1211
|
checkInSlot: m,
|
|
1226
1212
|
onInvite: h,
|
|
1227
1213
|
extraFields: z,
|
|
1228
|
-
groupBy:
|
|
1229
|
-
showSummary:
|
|
1214
|
+
groupBy: v = "none",
|
|
1215
|
+
showSummary: g = !0,
|
|
1230
1216
|
showSearch: P = !0,
|
|
1231
1217
|
allowPlusOnes: k = !1,
|
|
1232
1218
|
disabled: T = !1,
|
|
@@ -1234,35 +1220,35 @@ const Qt = [
|
|
|
1234
1220
|
size: p = "md",
|
|
1235
1221
|
className: A,
|
|
1236
1222
|
style: y
|
|
1237
|
-
} = i, [M, w] =
|
|
1223
|
+
} = i, [M, w] = D(""), [N, x] = D("all"), [B, X] = D(""), E = T || f, R = d === "guest", q = F(() => {
|
|
1238
1224
|
const I = { total: t.length };
|
|
1239
|
-
for (const V of
|
|
1225
|
+
for (const V of Ye)
|
|
1240
1226
|
I[V] = 0;
|
|
1241
1227
|
for (const V of t)
|
|
1242
1228
|
I[V.status] = (I[V.status] ?? 0) + 1;
|
|
1243
1229
|
return I;
|
|
1244
|
-
}, [t]),
|
|
1245
|
-
if (
|
|
1230
|
+
}, [t]), C = F(() => {
|
|
1231
|
+
if (R)
|
|
1246
1232
|
return t.filter((V) => V.userId === o || V.id === o);
|
|
1247
1233
|
const I = M.trim().toLowerCase();
|
|
1248
1234
|
return t.filter((V) => N !== "all" && V.status !== N ? !1 : !I || V.name.toLowerCase().includes(I));
|
|
1249
|
-
}, [t,
|
|
1250
|
-
if (
|
|
1251
|
-
return [{ key: "all", label: "", items:
|
|
1235
|
+
}, [t, R, o, M, N]), b = F(() => {
|
|
1236
|
+
if (v === "none" || R)
|
|
1237
|
+
return [{ key: "all", label: "", items: C }];
|
|
1252
1238
|
const I = /* @__PURE__ */ new Map();
|
|
1253
|
-
for (const G of
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1239
|
+
for (const G of C) {
|
|
1240
|
+
const ne = v === "status" ? G.status : G.role, Y = I.get(ne);
|
|
1241
|
+
Y ? Y.push(G) : I.set(ne, [G]);
|
|
1256
1242
|
}
|
|
1257
|
-
return [...I.keys()].sort((G,
|
|
1258
|
-
}, [
|
|
1259
|
-
_ == null || _(I,
|
|
1260
|
-
},
|
|
1261
|
-
!h ||
|
|
1243
|
+
return [...I.keys()].sort((G, ne) => v !== "status" ? G.localeCompare(ne) : Ye.indexOf(G) - Ye.indexOf(ne)).map((G) => ({ key: G, label: G, items: I.get(G) ?? [] }));
|
|
1244
|
+
}, [C, v, R]), L = F(() => Xn(B), [B]), j = (I) => (V) => {
|
|
1245
|
+
_ == null || _(I, Jt[V.answer], V);
|
|
1246
|
+
}, W = () => {
|
|
1247
|
+
!h || L.valid.length === 0 || (h(L.valid), X(""));
|
|
1262
1248
|
};
|
|
1263
|
-
if (
|
|
1264
|
-
const I =
|
|
1265
|
-
return I ? /* @__PURE__ */
|
|
1249
|
+
if (R) {
|
|
1250
|
+
const I = C[0];
|
|
1251
|
+
return I ? /* @__PURE__ */ s(
|
|
1266
1252
|
"div",
|
|
1267
1253
|
{
|
|
1268
1254
|
ref: r,
|
|
@@ -1271,10 +1257,10 @@ const Qt = [
|
|
|
1271
1257
|
children: [
|
|
1272
1258
|
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(nn, { participant: I, size: p }) }),
|
|
1273
1259
|
/* @__PURE__ */ e(
|
|
1274
|
-
|
|
1260
|
+
Sn,
|
|
1275
1261
|
{
|
|
1276
1262
|
value: Cn[I.status],
|
|
1277
|
-
onRespond:
|
|
1263
|
+
onRespond: j(I.id),
|
|
1278
1264
|
allowPlusOnes: k,
|
|
1279
1265
|
currentUserId: o ?? I.userId,
|
|
1280
1266
|
currentUserName: u ?? I.name,
|
|
@@ -1296,50 +1282,55 @@ const Qt = [
|
|
|
1296
1282
|
}
|
|
1297
1283
|
) });
|
|
1298
1284
|
}
|
|
1299
|
-
return /* @__PURE__ */
|
|
1300
|
-
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1303
|
-
"
|
|
1285
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-participant-list ${A ?? ""}`, style: y, children: [
|
|
1286
|
+
g && /* @__PURE__ */ s("div", { className: "nice-participant-list__summary", children: [
|
|
1287
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1288
|
+
/* @__PURE__ */ e("strong", { children: q.confirmed }),
|
|
1289
|
+
" ",
|
|
1290
|
+
n("participantList.confirmed", "confirmed")
|
|
1304
1291
|
] }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1307
|
-
"
|
|
1292
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1293
|
+
/* @__PURE__ */ e("strong", { children: q.invited }),
|
|
1294
|
+
" ",
|
|
1295
|
+
n("participantList.awaitingReply", "awaiting reply")
|
|
1308
1296
|
] }),
|
|
1309
|
-
/* @__PURE__ */
|
|
1310
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1311
|
-
"
|
|
1297
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1298
|
+
/* @__PURE__ */ e("strong", { children: q.declined }),
|
|
1299
|
+
" ",
|
|
1300
|
+
n("participantList.declined", "declined")
|
|
1312
1301
|
] }),
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1315
|
-
"
|
|
1302
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat", children: [
|
|
1303
|
+
/* @__PURE__ */ e("strong", { children: q["checked-in"] }),
|
|
1304
|
+
" ",
|
|
1305
|
+
n("participantList.checkedIn", "checked in")
|
|
1316
1306
|
] }),
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1319
|
-
"
|
|
1307
|
+
/* @__PURE__ */ s("span", { className: "nice-participant-list__stat nice-participant-list__stat--total", children: [
|
|
1308
|
+
/* @__PURE__ */ e("strong", { children: q.total }),
|
|
1309
|
+
" ",
|
|
1310
|
+
n("participantList.total", "total")
|
|
1320
1311
|
] })
|
|
1321
1312
|
] }),
|
|
1322
|
-
(P || m || l) && /* @__PURE__ */
|
|
1323
|
-
P && /* @__PURE__ */
|
|
1313
|
+
(P || m || l) && /* @__PURE__ */ s("div", { className: "nice-participant-list__toolbar", children: [
|
|
1314
|
+
P && /* @__PURE__ */ s(Ge, { children: [
|
|
1324
1315
|
/* @__PURE__ */ e(
|
|
1325
|
-
|
|
1316
|
+
J,
|
|
1326
1317
|
{
|
|
1327
1318
|
value: M,
|
|
1328
1319
|
onChange: w,
|
|
1329
1320
|
placeholder: n("participantList.searchGuests", "Search guests…"),
|
|
1330
|
-
prefix: /* @__PURE__ */ e(
|
|
1321
|
+
prefix: /* @__PURE__ */ e(bt, { size: 15 }),
|
|
1331
1322
|
size: p
|
|
1332
1323
|
}
|
|
1333
1324
|
),
|
|
1334
1325
|
/* @__PURE__ */ e(
|
|
1335
|
-
|
|
1326
|
+
ze,
|
|
1336
1327
|
{
|
|
1337
1328
|
value: N,
|
|
1338
1329
|
onChange: (I) => x(I),
|
|
1339
1330
|
size: p,
|
|
1340
1331
|
options: [
|
|
1341
1332
|
{ value: "all", label: n("participantList.allStatuses", "All statuses") },
|
|
1342
|
-
...
|
|
1333
|
+
...Ye.map((I) => ({
|
|
1343
1334
|
value: I,
|
|
1344
1335
|
label: n(`participantList.status.${I}`, I)
|
|
1345
1336
|
}))
|
|
@@ -1348,29 +1339,29 @@ const Qt = [
|
|
|
1348
1339
|
)
|
|
1349
1340
|
] }),
|
|
1350
1341
|
m,
|
|
1351
|
-
l && !m && /* @__PURE__ */
|
|
1352
|
-
/* @__PURE__ */ e(
|
|
1342
|
+
l && !m && /* @__PURE__ */ s("span", { className: "nice-participant-list__scan-hint", children: [
|
|
1343
|
+
/* @__PURE__ */ e(kt, { size: 15 }),
|
|
1353
1344
|
" ",
|
|
1354
1345
|
n("participantList.scannerReady", "Scanner ready")
|
|
1355
1346
|
] })
|
|
1356
1347
|
] }),
|
|
1357
|
-
|
|
1348
|
+
C.length === 0 ? /* @__PURE__ */ e(
|
|
1358
1349
|
Ne,
|
|
1359
1350
|
{
|
|
1360
1351
|
title: n("participantList.noGuestsYet", "No guests yet"),
|
|
1361
1352
|
description: t.length > 0 ? n("participantList.noMatch", "No one matches the current filter.") : n("participantList.invitePeopleHint", "Invite people to see them here.")
|
|
1362
1353
|
}
|
|
1363
|
-
) : b.map((I) => /* @__PURE__ */
|
|
1364
|
-
I.label && /* @__PURE__ */
|
|
1354
|
+
) : b.map((I) => /* @__PURE__ */ s("section", { className: "nice-participant-list__group", children: [
|
|
1355
|
+
I.label && /* @__PURE__ */ s("h4", { className: "nice-participant-list__group-title", children: [
|
|
1365
1356
|
I.label,
|
|
1366
1357
|
" ",
|
|
1367
|
-
/* @__PURE__ */
|
|
1358
|
+
/* @__PURE__ */ s("span", { children: [
|
|
1368
1359
|
"(",
|
|
1369
1360
|
I.items.length,
|
|
1370
1361
|
")"
|
|
1371
1362
|
] })
|
|
1372
1363
|
] }),
|
|
1373
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: I.items.map((V) => /* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: I.items.map((V) => /* @__PURE__ */ s(
|
|
1374
1365
|
nn,
|
|
1375
1366
|
{
|
|
1376
1367
|
participant: V,
|
|
@@ -1380,11 +1371,11 @@ const Qt = [
|
|
|
1380
1371
|
) }, G.key)),
|
|
1381
1372
|
children: [
|
|
1382
1373
|
_ && /* @__PURE__ */ e(
|
|
1383
|
-
|
|
1374
|
+
Sn,
|
|
1384
1375
|
{
|
|
1385
1376
|
compact: !0,
|
|
1386
1377
|
value: Cn[V.status],
|
|
1387
|
-
onRespond:
|
|
1378
|
+
onRespond: j(V.id),
|
|
1388
1379
|
currentUserId: V.userId,
|
|
1389
1380
|
currentUserName: V.name,
|
|
1390
1381
|
disabled: E,
|
|
@@ -1407,12 +1398,12 @@ const Qt = [
|
|
|
1407
1398
|
V.id
|
|
1408
1399
|
)) })
|
|
1409
1400
|
] }, I.key)),
|
|
1410
|
-
h && !f && /* @__PURE__ */
|
|
1401
|
+
h && !f && /* @__PURE__ */ s("div", { className: "nice-participant-list__invite", children: [
|
|
1411
1402
|
/* @__PURE__ */ e(
|
|
1412
1403
|
on,
|
|
1413
1404
|
{
|
|
1414
1405
|
label: n("participantList.inviteByEmail", "Invite by email"),
|
|
1415
|
-
value:
|
|
1406
|
+
value: B,
|
|
1416
1407
|
onChange: X,
|
|
1417
1408
|
placeholder: n(
|
|
1418
1409
|
"participantList.pasteAddressesCommasSemicolonsOr",
|
|
@@ -1428,28 +1419,28 @@ const Qt = [
|
|
|
1428
1419
|
{
|
|
1429
1420
|
variant: "primary",
|
|
1430
1421
|
size: p,
|
|
1431
|
-
leftIcon: /* @__PURE__ */ e(
|
|
1432
|
-
disabled: T ||
|
|
1433
|
-
onClick:
|
|
1422
|
+
leftIcon: /* @__PURE__ */ e(Rn, { size: 15 }),
|
|
1423
|
+
disabled: T || L.valid.length === 0,
|
|
1424
|
+
onClick: W,
|
|
1434
1425
|
children: n("participantList.invite", "Invite {valid}").replace(
|
|
1435
1426
|
"{valid}",
|
|
1436
|
-
|
|
1427
|
+
L.valid.length > 0 ? `(${L.valid.length})` : ""
|
|
1437
1428
|
)
|
|
1438
1429
|
}
|
|
1439
1430
|
),
|
|
1440
|
-
(
|
|
1441
|
-
|
|
1431
|
+
(L.invalid.length > 0 || L.duplicates > 0) && /* @__PURE__ */ s("p", { className: "nice-participant-list__invite-hint", children: [
|
|
1432
|
+
L.duplicates > 0 && `${n("participantList.duplicatesRemoved", "{count} duplicate(s) removed.").replace(
|
|
1442
1433
|
"{count}",
|
|
1443
|
-
String(
|
|
1434
|
+
String(L.duplicates)
|
|
1444
1435
|
)} `,
|
|
1445
|
-
|
|
1436
|
+
L.invalid.length > 0 && n("participantList.notRecognised", "{count} entry(ies) not recognised.").replace(
|
|
1446
1437
|
"{count}",
|
|
1447
|
-
String(
|
|
1438
|
+
String(L.invalid.length)
|
|
1448
1439
|
)
|
|
1449
1440
|
] })
|
|
1450
1441
|
] })
|
|
1451
1442
|
] });
|
|
1452
|
-
}),
|
|
1443
|
+
}), ni = {
|
|
1453
1444
|
// No minor unit at all.
|
|
1454
1445
|
BIF: 0,
|
|
1455
1446
|
CLP: 0,
|
|
@@ -1477,18 +1468,18 @@ const Qt = [
|
|
|
1477
1468
|
OMR: 3,
|
|
1478
1469
|
TND: 3
|
|
1479
1470
|
};
|
|
1480
|
-
function
|
|
1481
|
-
return
|
|
1471
|
+
function mn(a) {
|
|
1472
|
+
return ni[a == null ? void 0 : a.toUpperCase()] ?? 2;
|
|
1482
1473
|
}
|
|
1483
|
-
function
|
|
1484
|
-
return Number.isFinite(
|
|
1474
|
+
function pn(a, i) {
|
|
1475
|
+
return Number.isFinite(a) ? Math.round(a * 10 ** mn(i)) : 0;
|
|
1485
1476
|
}
|
|
1486
|
-
function
|
|
1487
|
-
const r =
|
|
1488
|
-
return r === 0 ?
|
|
1477
|
+
function qe(a, i) {
|
|
1478
|
+
const r = mn(i);
|
|
1479
|
+
return r === 0 ? a : a / 10 ** r;
|
|
1489
1480
|
}
|
|
1490
|
-
function
|
|
1491
|
-
const n =
|
|
1481
|
+
function ti(a, i, r) {
|
|
1482
|
+
const n = mn(i), t = qe(a, i);
|
|
1492
1483
|
try {
|
|
1493
1484
|
return new Intl.NumberFormat(r, {
|
|
1494
1485
|
style: "currency",
|
|
@@ -1500,31 +1491,31 @@ function ni(s, i, r) {
|
|
|
1500
1491
|
return `${t.toFixed(n)} ${i}`;
|
|
1501
1492
|
}
|
|
1502
1493
|
}
|
|
1503
|
-
function ce(
|
|
1504
|
-
return
|
|
1494
|
+
function ce(a, i, r) {
|
|
1495
|
+
return ti(pn(a, i), i, r);
|
|
1505
1496
|
}
|
|
1506
1497
|
const tn = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
1507
|
-
function
|
|
1508
|
-
if (
|
|
1498
|
+
function ii(a, i = 0) {
|
|
1499
|
+
if (a.length === 0)
|
|
1509
1500
|
return { ...tn };
|
|
1510
1501
|
let r = 1 / 0, n = 1 / 0, t = -1 / 0, d = -1 / 0;
|
|
1511
|
-
for (const o of
|
|
1502
|
+
for (const o of a)
|
|
1512
1503
|
o.x < r && (r = o.x), o.y < n && (n = o.y), o.x > t && (t = o.x), o.y > d && (d = o.y);
|
|
1513
1504
|
return { minX: r - i, minY: n - i, maxX: t + i, maxY: d + i };
|
|
1514
1505
|
}
|
|
1515
|
-
function xn(
|
|
1506
|
+
function xn(a, i) {
|
|
1516
1507
|
return {
|
|
1517
|
-
minX: Math.min(
|
|
1518
|
-
minY: Math.min(
|
|
1519
|
-
maxX: Math.max(
|
|
1520
|
-
maxY: Math.max(
|
|
1508
|
+
minX: Math.min(a.minX, i.minX),
|
|
1509
|
+
minY: Math.min(a.minY, i.minY),
|
|
1510
|
+
maxX: Math.max(a.maxX, i.maxX),
|
|
1511
|
+
maxY: Math.max(a.maxY, i.maxY)
|
|
1521
1512
|
};
|
|
1522
1513
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return
|
|
1514
|
+
function In(a, i) {
|
|
1515
|
+
return a.minX <= i.maxX && a.maxX >= i.minX && a.minY <= i.maxY && a.maxY >= i.minY;
|
|
1525
1516
|
}
|
|
1526
|
-
function
|
|
1527
|
-
const n =
|
|
1517
|
+
function ai(a, i, r = 0) {
|
|
1518
|
+
const n = a.zoom || 1, t = -a.pan.x / n - r, d = -a.pan.y / n - r;
|
|
1528
1519
|
return {
|
|
1529
1520
|
minX: t,
|
|
1530
1521
|
minY: d,
|
|
@@ -1532,19 +1523,19 @@ function ii(s, i, r = 0) {
|
|
|
1532
1523
|
maxY: d + i.height / n + r * 2
|
|
1533
1524
|
};
|
|
1534
1525
|
}
|
|
1535
|
-
function
|
|
1526
|
+
function si(a, i = 12) {
|
|
1536
1527
|
const r = [], n = [], t = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
1537
1528
|
let o = null, u = 0;
|
|
1538
|
-
for (const _ of
|
|
1529
|
+
for (const _ of a.sections ?? []) {
|
|
1539
1530
|
let c = null, l = 0;
|
|
1540
1531
|
(_.rows ?? []).forEach((h, z) => {
|
|
1541
|
-
const
|
|
1542
|
-
if (
|
|
1532
|
+
const v = ri(h.seats ?? []);
|
|
1533
|
+
if (v.length === 0)
|
|
1543
1534
|
return;
|
|
1544
|
-
const
|
|
1545
|
-
n.push({ sectionId: _.id, rowIndex: z, label: h.label, seats:
|
|
1535
|
+
const g = ii(v, i);
|
|
1536
|
+
n.push({ sectionId: _.id, rowIndex: z, label: h.label, seats: v, bounds: g }), v.forEach((P, k) => {
|
|
1546
1537
|
t.set(P.id, P), d.set(P.id, { sectionId: _.id, rowIndex: z, seatIndex: k });
|
|
1547
|
-
}), l +=
|
|
1538
|
+
}), l += v.length, c = c ? xn(c, g) : g;
|
|
1548
1539
|
});
|
|
1549
1540
|
const m = c ?? { ...tn };
|
|
1550
1541
|
r.push({ section: _, bounds: m, seatCount: l }), u += l, l > 0 && (o = o ? xn(o, m) : m);
|
|
@@ -1558,21 +1549,21 @@ function ai(s, i = 12) {
|
|
|
1558
1549
|
locationById: d
|
|
1559
1550
|
};
|
|
1560
1551
|
}
|
|
1561
|
-
function
|
|
1562
|
-
return [...
|
|
1552
|
+
function ri(a) {
|
|
1553
|
+
return [...a].sort((i, r) => i.number - r.number || i.x - r.x);
|
|
1563
1554
|
}
|
|
1564
|
-
function
|
|
1565
|
-
return
|
|
1555
|
+
function ci(a, i) {
|
|
1556
|
+
return a > i * 4 ? "section" : a > i ? "row" : "seat";
|
|
1566
1557
|
}
|
|
1567
|
-
function
|
|
1568
|
-
const t =
|
|
1569
|
-
(l) => d.has(l.sectionId) &&
|
|
1558
|
+
function li(a, i, r = 2500, n) {
|
|
1559
|
+
const t = a.sections.filter((l) => In(l.bounds, i)), d = new Set(t.map((l) => l.section.id)), o = a.rows.filter(
|
|
1560
|
+
(l) => d.has(l.sectionId) && In(l.bounds, i)
|
|
1570
1561
|
);
|
|
1571
1562
|
let u = 0;
|
|
1572
1563
|
for (const l of o)
|
|
1573
1564
|
for (const m of l.seats)
|
|
1574
1565
|
m.x >= i.minX && m.x <= i.maxX && m.y >= i.minY && m.y <= i.maxY && (u += 1);
|
|
1575
|
-
const _ = n ??
|
|
1566
|
+
const _ = n ?? ci(u, r);
|
|
1576
1567
|
let c = [];
|
|
1577
1568
|
if (_ === "seat") {
|
|
1578
1569
|
c = [];
|
|
@@ -1582,51 +1573,51 @@ function ci(s, i, r = 2500, n) {
|
|
|
1582
1573
|
}
|
|
1583
1574
|
return { tier: _, sections: t, rows: _ === "section" ? [] : o, seats: c, visibleSeatCount: u };
|
|
1584
1575
|
}
|
|
1585
|
-
function
|
|
1586
|
-
if (
|
|
1587
|
-
return
|
|
1588
|
-
if (
|
|
1589
|
-
return
|
|
1576
|
+
function hn(a) {
|
|
1577
|
+
if (a.accessType)
|
|
1578
|
+
return a.accessType;
|
|
1579
|
+
if (a.status === "wheelchair" || a.status === "companion")
|
|
1580
|
+
return a.status;
|
|
1590
1581
|
}
|
|
1591
|
-
function
|
|
1592
|
-
const r = (i == null ? void 0 : i[
|
|
1582
|
+
function Ae(a, i) {
|
|
1583
|
+
const r = (i == null ? void 0 : i[a.id]) ?? a.status;
|
|
1593
1584
|
return r === "wheelchair" || r === "companion" ? "available" : r;
|
|
1594
1585
|
}
|
|
1595
|
-
function
|
|
1586
|
+
function Pn(a, i, r) {
|
|
1596
1587
|
var t;
|
|
1597
|
-
const n = (t = i.priceCategories) == null ? void 0 : t.find((d) => d.id ===
|
|
1588
|
+
const n = (t = i.priceCategories) == null ? void 0 : t.find((d) => d.id === a.priceCategoryId);
|
|
1598
1589
|
return {
|
|
1599
1590
|
amount: (n == null ? void 0 : n.price) ?? r.basePrice,
|
|
1600
1591
|
currency: r.currency
|
|
1601
1592
|
};
|
|
1602
1593
|
}
|
|
1603
|
-
function
|
|
1604
|
-
return !(
|
|
1594
|
+
function oi(a, i = {}, r) {
|
|
1595
|
+
return !(Ae(a, r) !== "available" || i.allowedCategories && !i.allowedCategories.includes(a.priceCategoryId));
|
|
1605
1596
|
}
|
|
1606
|
-
function Wn(
|
|
1597
|
+
function Wn(a, i = {}, r) {
|
|
1607
1598
|
const n = [];
|
|
1608
1599
|
let t = null;
|
|
1609
|
-
return
|
|
1610
|
-
|
|
1600
|
+
return a.forEach((d, o) => {
|
|
1601
|
+
oi(d, i, r) ? t ? t.seats.push(d) : t = { start: o, seats: [d] } : t && (n.push(t), t = null);
|
|
1611
1602
|
}), t && n.push(t), n;
|
|
1612
1603
|
}
|
|
1613
|
-
function
|
|
1604
|
+
function di(a, i, r = {}, n) {
|
|
1614
1605
|
const t = r.maxSeats ?? 8;
|
|
1615
|
-
if (
|
|
1606
|
+
if (a.length > t)
|
|
1616
1607
|
return { ok: !1, reason: "max-seats" };
|
|
1617
|
-
for (const o of
|
|
1608
|
+
for (const o of a) {
|
|
1618
1609
|
const u = i.seatById.get(o);
|
|
1619
1610
|
if (u) {
|
|
1620
|
-
if (
|
|
1611
|
+
if (Ae(u, n) !== "available")
|
|
1621
1612
|
return { ok: !1, reason: "unavailable", seatId: o };
|
|
1622
1613
|
if (r.allowedCategories && !r.allowedCategories.includes(u.priceCategoryId))
|
|
1623
1614
|
return { ok: !1, reason: "category-not-allowed", seatId: o };
|
|
1624
1615
|
}
|
|
1625
1616
|
}
|
|
1626
|
-
if (!r.adjacentOnly ||
|
|
1617
|
+
if (!r.adjacentOnly || a.length === 0)
|
|
1627
1618
|
return { ok: !0 };
|
|
1628
1619
|
const d = /* @__PURE__ */ new Map();
|
|
1629
|
-
for (const o of
|
|
1620
|
+
for (const o of a) {
|
|
1630
1621
|
const u = i.locationById.get(o);
|
|
1631
1622
|
if (!u)
|
|
1632
1623
|
continue;
|
|
@@ -1638,39 +1629,39 @@ function oi(s, i, r = {}, n) {
|
|
|
1638
1629
|
if (!m)
|
|
1639
1630
|
continue;
|
|
1640
1631
|
const h = Wn(m.seats, r, n), z = new Set(u);
|
|
1641
|
-
let
|
|
1632
|
+
let v = null;
|
|
1642
1633
|
for (const f of h)
|
|
1643
1634
|
if (f.seats.some((p) => z.has(p.id))) {
|
|
1644
|
-
if (
|
|
1635
|
+
if (v)
|
|
1645
1636
|
return { ok: !1, reason: "not-adjacent", seatId: u[0] };
|
|
1646
|
-
|
|
1637
|
+
v = f;
|
|
1647
1638
|
}
|
|
1648
|
-
if (!
|
|
1639
|
+
if (!v)
|
|
1649
1640
|
continue;
|
|
1650
|
-
const
|
|
1651
|
-
if (
|
|
1641
|
+
const g = v.seats.map((f, p) => z.has(f.id) ? p : -1).filter((f) => f >= 0);
|
|
1642
|
+
if (g.length === 0)
|
|
1652
1643
|
continue;
|
|
1653
|
-
const P =
|
|
1654
|
-
if (k - P + 1 !==
|
|
1644
|
+
const P = g[0], k = g[g.length - 1];
|
|
1645
|
+
if (k - P + 1 !== g.length)
|
|
1655
1646
|
return { ok: !1, reason: "not-adjacent", seatId: u[0] };
|
|
1656
|
-
const T =
|
|
1647
|
+
const T = v.seats.length;
|
|
1657
1648
|
if (T > 1 && (P === 1 || T - 1 - k === 1))
|
|
1658
1649
|
return { ok: !1, reason: "orphan-seat", seatId: u[0] };
|
|
1659
1650
|
}
|
|
1660
1651
|
return { ok: !0 };
|
|
1661
1652
|
}
|
|
1662
|
-
function
|
|
1663
|
-
if (
|
|
1664
|
-
return { selected:
|
|
1665
|
-
const d = [...
|
|
1653
|
+
function ui(a, i, r, n = {}, t) {
|
|
1654
|
+
if (a.includes(i))
|
|
1655
|
+
return { selected: a.filter((u) => u !== i) };
|
|
1656
|
+
const d = [...a, i], o = di(d, r, n, t);
|
|
1666
1657
|
return o.ok ? { selected: d } : { rejected: o.reason ?? "not-adjacent" };
|
|
1667
1658
|
}
|
|
1668
|
-
function
|
|
1659
|
+
function mi(a, i, r = {}, n = {}, t) {
|
|
1669
1660
|
if (i <= 0)
|
|
1670
1661
|
return [];
|
|
1671
1662
|
const d = n.categoryId ? { ...r, allowedCategories: [n.categoryId] } : r;
|
|
1672
1663
|
let o = null;
|
|
1673
|
-
for (const u of
|
|
1664
|
+
for (const u of a.rows)
|
|
1674
1665
|
if (!(n.sectionId && u.sectionId !== n.sectionId))
|
|
1675
1666
|
for (const _ of Wn(u.seats, d, t)) {
|
|
1676
1667
|
const c = _.seats.length;
|
|
@@ -1679,23 +1670,23 @@ function ui(s, i, r = {}, n = {}, t) {
|
|
|
1679
1670
|
const m = l + i - 1;
|
|
1680
1671
|
if (c > i && (l === 1 || c - 1 - m === 1))
|
|
1681
1672
|
continue;
|
|
1682
|
-
const h = _.seats.slice(l, m + 1), z = h.reduce((
|
|
1683
|
-
(!o || z > o.score) && (o = { ids: h.map((
|
|
1673
|
+
const h = _.seats.slice(l, m + 1), z = h.reduce((v, g) => v + (g.viewScore ?? 50), 0) / i;
|
|
1674
|
+
(!o || z > o.score) && (o = { ids: h.map((v) => v.id), score: z });
|
|
1684
1675
|
}
|
|
1685
1676
|
}
|
|
1686
1677
|
return (o == null ? void 0 : o.ids) ?? [];
|
|
1687
1678
|
}
|
|
1688
|
-
function
|
|
1679
|
+
function pi(a, i, r) {
|
|
1689
1680
|
var l, m, h, z;
|
|
1690
|
-
const n =
|
|
1681
|
+
const n = a.locationById.get(i);
|
|
1691
1682
|
if (!n)
|
|
1692
1683
|
return null;
|
|
1693
|
-
const t =
|
|
1694
|
-
(
|
|
1684
|
+
const t = a.rows.findIndex(
|
|
1685
|
+
(v) => v.sectionId === n.sectionId && v.rowIndex === n.rowIndex
|
|
1695
1686
|
);
|
|
1696
1687
|
if (t < 0)
|
|
1697
1688
|
return null;
|
|
1698
|
-
const d =
|
|
1689
|
+
const d = a.rows[t];
|
|
1699
1690
|
if (r === "left")
|
|
1700
1691
|
return ((l = d.seats[n.seatIndex - 1]) == null ? void 0 : l.id) ?? null;
|
|
1701
1692
|
if (r === "right")
|
|
@@ -1704,31 +1695,31 @@ function mi(s, i, r) {
|
|
|
1704
1695
|
return ((h = d.seats[0]) == null ? void 0 : h.id) ?? null;
|
|
1705
1696
|
if (r === "row-end")
|
|
1706
1697
|
return ((z = d.seats[d.seats.length - 1]) == null ? void 0 : z.id) ?? null;
|
|
1707
|
-
const o =
|
|
1698
|
+
const o = a.rows[r === "up" ? t - 1 : t + 1];
|
|
1708
1699
|
if (!o)
|
|
1709
1700
|
return null;
|
|
1710
1701
|
const u = d.seats[n.seatIndex].x;
|
|
1711
1702
|
let _ = null, c = 1 / 0;
|
|
1712
|
-
for (const
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1703
|
+
for (const v of o.seats) {
|
|
1704
|
+
const g = Math.abs(v.x - u);
|
|
1705
|
+
g < c && (c = g, _ = v);
|
|
1715
1706
|
}
|
|
1716
1707
|
return (_ == null ? void 0 : _.id) ?? null;
|
|
1717
1708
|
}
|
|
1718
|
-
function
|
|
1709
|
+
function hi(a, i, r) {
|
|
1719
1710
|
var _, c, l;
|
|
1720
|
-
const n =
|
|
1711
|
+
const n = a.sections.filter((m) => m.seatCount > 0);
|
|
1721
1712
|
if (n.length === 0)
|
|
1722
1713
|
return null;
|
|
1723
|
-
const t = i ? (_ =
|
|
1724
|
-
return u ? ((l = (c =
|
|
1714
|
+
const t = i ? (_ = a.locationById.get(i)) == null ? void 0 : _.sectionId : void 0, d = n.findIndex((m) => m.section.id === t), o = d < 0 ? 0 : r === "next" ? d + 1 : d - 1, u = n[o];
|
|
1715
|
+
return u ? ((l = (c = a.rows.find((m) => m.sectionId === u.section.id)) == null ? void 0 : c.seats[0]) == null ? void 0 : l.id) ?? null : null;
|
|
1725
1716
|
}
|
|
1726
|
-
const
|
|
1727
|
-
function
|
|
1728
|
-
return
|
|
1717
|
+
const $e = 8;
|
|
1718
|
+
function gi(a, i) {
|
|
1719
|
+
return a.seats.length === 0 ? 0 : a.seats.filter((n) => Ae(n, i) === "available").length / a.seats.length;
|
|
1729
1720
|
}
|
|
1730
|
-
const
|
|
1731
|
-
cull:
|
|
1721
|
+
const vi = ({
|
|
1722
|
+
cull: a,
|
|
1732
1723
|
selectedIds: i,
|
|
1733
1724
|
cursorId: r,
|
|
1734
1725
|
statusOverrides: n,
|
|
@@ -1738,8 +1729,8 @@ const gi = ({
|
|
|
1738
1729
|
onSectionClick: u,
|
|
1739
1730
|
describeSeat: _
|
|
1740
1731
|
}) => {
|
|
1741
|
-
const { t: c } =
|
|
1742
|
-
return
|
|
1732
|
+
const { t: c } = ee();
|
|
1733
|
+
return a.tier === "section" ? /* @__PURE__ */ e("g", { className: "nice-seating-chart__sections", children: a.sections.map(({ section: l, bounds: m, seatCount: h }) => /* @__PURE__ */ s("g", { className: "nice-seating-chart__section", children: [
|
|
1743
1734
|
/* @__PURE__ */ e(
|
|
1744
1735
|
"rect",
|
|
1745
1736
|
{
|
|
@@ -1768,9 +1759,9 @@ const gi = ({
|
|
|
1768
1759
|
children: l.name
|
|
1769
1760
|
}
|
|
1770
1761
|
)
|
|
1771
|
-
] }, l.id)) }) :
|
|
1772
|
-
const m =
|
|
1773
|
-
return /* @__PURE__ */
|
|
1762
|
+
] }, l.id)) }) : a.tier === "row" ? /* @__PURE__ */ e("g", { className: "nice-seating-chart__rows", children: a.rows.map((l) => {
|
|
1763
|
+
const m = gi(l, n);
|
|
1764
|
+
return /* @__PURE__ */ s("g", { children: [
|
|
1774
1765
|
/* @__PURE__ */ e(
|
|
1775
1766
|
"rect",
|
|
1776
1767
|
{
|
|
@@ -1801,15 +1792,15 @@ const gi = ({
|
|
|
1801
1792
|
}
|
|
1802
1793
|
)
|
|
1803
1794
|
] }, `${l.sectionId}-${l.rowIndex}`);
|
|
1804
|
-
}) }) : /* @__PURE__ */ e("g", { className: "nice-seating-chart__seats", children:
|
|
1805
|
-
const m =
|
|
1795
|
+
}) }) : /* @__PURE__ */ e("g", { className: "nice-seating-chart__seats", children: a.seats.map((l) => {
|
|
1796
|
+
const m = Ae(l, n), h = hn(l), z = i.has(l.id), v = r === l.id, g = { row: l.row, number: l.number }, P = [
|
|
1806
1797
|
"nice-seating-chart__seat",
|
|
1807
1798
|
`nice-seating-chart__seat--${m}`,
|
|
1808
1799
|
z ? "nice-seating-chart__seat--selected" : "",
|
|
1809
1800
|
h ? `nice-seating-chart__seat--${h}` : "",
|
|
1810
|
-
|
|
1801
|
+
v ? "nice-seating-chart__seat--cursor" : ""
|
|
1811
1802
|
].filter(Boolean).join(" ");
|
|
1812
|
-
return /* @__PURE__ */
|
|
1803
|
+
return /* @__PURE__ */ s(
|
|
1813
1804
|
"g",
|
|
1814
1805
|
{
|
|
1815
1806
|
className: P,
|
|
@@ -1818,16 +1809,16 @@ const gi = ({
|
|
|
1818
1809
|
"aria-selected": z,
|
|
1819
1810
|
"aria-disabled": m !== "available",
|
|
1820
1811
|
"aria-label": _(l),
|
|
1821
|
-
tabIndex:
|
|
1812
|
+
tabIndex: v ? 0 : -1,
|
|
1822
1813
|
onClick: d && o ? () => o(l) : void 0,
|
|
1823
1814
|
children: [
|
|
1824
1815
|
h ? /* @__PURE__ */ e(
|
|
1825
1816
|
"rect",
|
|
1826
1817
|
{
|
|
1827
|
-
x: l.x -
|
|
1828
|
-
y: l.y -
|
|
1829
|
-
width:
|
|
1830
|
-
height:
|
|
1818
|
+
x: l.x - $e,
|
|
1819
|
+
y: l.y - $e,
|
|
1820
|
+
width: $e * 2,
|
|
1821
|
+
height: $e * 2,
|
|
1831
1822
|
rx: 3,
|
|
1832
1823
|
className: "nice-seating-chart__seat-shape",
|
|
1833
1824
|
fill: h === "companion" ? "url(#nice-seat-companion-hatch)" : void 0
|
|
@@ -1837,7 +1828,7 @@ const gi = ({
|
|
|
1837
1828
|
{
|
|
1838
1829
|
cx: l.x,
|
|
1839
1830
|
cy: l.y,
|
|
1840
|
-
r:
|
|
1831
|
+
r: $e,
|
|
1841
1832
|
className: "nice-seating-chart__seat-shape"
|
|
1842
1833
|
}
|
|
1843
1834
|
),
|
|
@@ -1860,7 +1851,7 @@ const gi = ({
|
|
|
1860
1851
|
textAnchor: "middle",
|
|
1861
1852
|
dominantBaseline: "middle",
|
|
1862
1853
|
"aria-hidden": "true",
|
|
1863
|
-
children:
|
|
1854
|
+
children: g.number
|
|
1864
1855
|
}
|
|
1865
1856
|
)
|
|
1866
1857
|
]
|
|
@@ -1868,8 +1859,8 @@ const gi = ({
|
|
|
1868
1859
|
l.id
|
|
1869
1860
|
);
|
|
1870
1861
|
}) });
|
|
1871
|
-
},
|
|
1872
|
-
index:
|
|
1862
|
+
}, fi = ({
|
|
1863
|
+
index: a,
|
|
1873
1864
|
selectedIds: i,
|
|
1874
1865
|
statusOverrides: r,
|
|
1875
1866
|
maxSeats: n,
|
|
@@ -1880,27 +1871,27 @@ const gi = ({
|
|
|
1880
1871
|
defaultOpen: _ = !1
|
|
1881
1872
|
}) => {
|
|
1882
1873
|
var f;
|
|
1883
|
-
const { t: c } =
|
|
1884
|
-
() =>
|
|
1885
|
-
[
|
|
1886
|
-
), [m, h] =
|
|
1887
|
-
() =>
|
|
1888
|
-
[
|
|
1874
|
+
const { t: c } = ee(), l = F(
|
|
1875
|
+
() => a.sections.filter((p) => p.seatCount > 0),
|
|
1876
|
+
[a.sections]
|
|
1877
|
+
), [m, h] = D(((f = l[0]) == null ? void 0 : f.section.id) ?? ""), [z, v] = D(0), [g, P] = D(2), k = F(
|
|
1878
|
+
() => a.rows.filter((p) => p.sectionId === m),
|
|
1879
|
+
[a.rows, m]
|
|
1889
1880
|
), T = k.find((p) => p.rowIndex === z) ?? k[0];
|
|
1890
|
-
return /* @__PURE__ */
|
|
1881
|
+
return /* @__PURE__ */ s(
|
|
1891
1882
|
Yt,
|
|
1892
1883
|
{
|
|
1893
1884
|
trigger: c("seatListPanel.chooseWithoutMap", "Choose seats without the map"),
|
|
1894
1885
|
defaultExpanded: _,
|
|
1895
1886
|
className: "nice-seating-chart__list-panel",
|
|
1896
1887
|
children: [
|
|
1897
|
-
d && /* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
1888
|
+
d && /* @__PURE__ */ s("div", { className: "nice-seating-chart__best", children: [
|
|
1889
|
+
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1899
1890
|
/* @__PURE__ */ e("span", { children: c("seatListPanel.howManySeats", "How many seats?") }),
|
|
1900
1891
|
/* @__PURE__ */ e(
|
|
1901
1892
|
dn,
|
|
1902
1893
|
{
|
|
1903
|
-
value:
|
|
1894
|
+
value: g,
|
|
1904
1895
|
onChange: (p) => P(Math.max(1, Math.min(n, p ?? 1))),
|
|
1905
1896
|
min: 1,
|
|
1906
1897
|
max: n,
|
|
@@ -1915,22 +1906,22 @@ const gi = ({
|
|
|
1915
1906
|
size: "sm",
|
|
1916
1907
|
variant: "primary",
|
|
1917
1908
|
disabled: u,
|
|
1918
|
-
onClick: () => d(
|
|
1909
|
+
onClick: () => d(g, { sectionId: m || void 0 }),
|
|
1919
1910
|
children: c("seatListPanel.bestAvailable", "Best available")
|
|
1920
1911
|
}
|
|
1921
1912
|
)
|
|
1922
1913
|
] }),
|
|
1923
|
-
/* @__PURE__ */
|
|
1924
|
-
/* @__PURE__ */
|
|
1914
|
+
/* @__PURE__ */ s("div", { className: "nice-seating-chart__pickers", children: [
|
|
1915
|
+
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1925
1916
|
/* @__PURE__ */ e("span", { children: c("seatListPanel.section", "Section") }),
|
|
1926
1917
|
/* @__PURE__ */ e(
|
|
1927
|
-
|
|
1918
|
+
ze,
|
|
1928
1919
|
{
|
|
1929
1920
|
size: "sm",
|
|
1930
1921
|
value: m,
|
|
1931
1922
|
disabled: u,
|
|
1932
1923
|
onChange: (p) => {
|
|
1933
|
-
h(p),
|
|
1924
|
+
h(p), v(0);
|
|
1934
1925
|
},
|
|
1935
1926
|
options: l.map((p) => ({
|
|
1936
1927
|
value: p.section.id,
|
|
@@ -1939,15 +1930,15 @@ const gi = ({
|
|
|
1939
1930
|
}
|
|
1940
1931
|
)
|
|
1941
1932
|
] }),
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */ e("span", { children: "Row" }),
|
|
1933
|
+
/* @__PURE__ */ s("label", { className: "nice-seating-chart__field", children: [
|
|
1934
|
+
/* @__PURE__ */ e("span", { children: c("seatListPanel.row", "Row") }),
|
|
1944
1935
|
/* @__PURE__ */ e(
|
|
1945
|
-
|
|
1936
|
+
ze,
|
|
1946
1937
|
{
|
|
1947
1938
|
size: "sm",
|
|
1948
1939
|
value: String((T == null ? void 0 : T.rowIndex) ?? 0),
|
|
1949
1940
|
disabled: u || k.length === 0,
|
|
1950
|
-
onChange: (p) =>
|
|
1941
|
+
onChange: (p) => v(Number(p)),
|
|
1951
1942
|
options: k.map((p) => ({
|
|
1952
1943
|
value: String(p.rowIndex),
|
|
1953
1944
|
label: `${p.label} (${p.seats.length})`
|
|
@@ -1957,8 +1948,8 @@ const gi = ({
|
|
|
1957
1948
|
] })
|
|
1958
1949
|
] }),
|
|
1959
1950
|
T && /* @__PURE__ */ e("ul", { className: "nice-seating-chart__seat-list", children: T.seats.map((p) => {
|
|
1960
|
-
const A =
|
|
1961
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
1951
|
+
const A = Ae(p, r), y = hn(p), M = i.has(p.id);
|
|
1952
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ s(
|
|
1962
1953
|
U,
|
|
1963
1954
|
{
|
|
1964
1955
|
size: "sm",
|
|
@@ -1977,65 +1968,65 @@ const gi = ({
|
|
|
1977
1968
|
]
|
|
1978
1969
|
}
|
|
1979
1970
|
);
|
|
1980
|
-
},
|
|
1981
|
-
function
|
|
1971
|
+
}, _i = { zoom: 1, pan: { x: 0, y: 0 } };
|
|
1972
|
+
function yi(a = {}) {
|
|
1982
1973
|
const {
|
|
1983
1974
|
minZoom: i = 0.1,
|
|
1984
1975
|
maxZoom: r = 10,
|
|
1985
|
-
initial: n =
|
|
1976
|
+
initial: n = _i,
|
|
1986
1977
|
viewport: t,
|
|
1987
1978
|
onViewportChange: d,
|
|
1988
1979
|
disabled: o = !1
|
|
1989
|
-
} =
|
|
1980
|
+
} = a, [u, _] = D(n), c = t ?? u, [l, m] = D(!1), h = ye(/* @__PURE__ */ new Map()), z = ye(null), v = ye(null), g = H(
|
|
1990
1981
|
(N) => {
|
|
1991
1982
|
t === void 0 && _(N), d == null || d(N);
|
|
1992
1983
|
},
|
|
1993
1984
|
[t, d]
|
|
1994
|
-
), P =
|
|
1985
|
+
), P = H(
|
|
1995
1986
|
(N) => Math.min(r, Math.max(i, N)),
|
|
1996
1987
|
[i, r]
|
|
1997
|
-
), k =
|
|
1988
|
+
), k = H(
|
|
1998
1989
|
(N, x) => {
|
|
1999
|
-
const
|
|
2000
|
-
if (
|
|
1990
|
+
const B = P(c.zoom * N);
|
|
1991
|
+
if (B === c.zoom)
|
|
2001
1992
|
return;
|
|
2002
|
-
const X =
|
|
2003
|
-
|
|
2004
|
-
zoom:
|
|
1993
|
+
const X = B / c.zoom;
|
|
1994
|
+
g({
|
|
1995
|
+
zoom: B,
|
|
2005
1996
|
pan: {
|
|
2006
1997
|
x: x.x - (x.x - c.pan.x) * X,
|
|
2007
1998
|
y: x.y - (x.y - c.pan.y) * X
|
|
2008
1999
|
}
|
|
2009
2000
|
});
|
|
2010
2001
|
},
|
|
2011
|
-
[
|
|
2012
|
-
), T =
|
|
2013
|
-
(N, x,
|
|
2014
|
-
const X = x ?? (
|
|
2002
|
+
[g, P, c]
|
|
2003
|
+
), T = H(
|
|
2004
|
+
(N, x, B) => {
|
|
2005
|
+
const X = x ?? (B ? { x: B.width / 2, y: B.height / 2 } : { x: 0, y: 0 });
|
|
2015
2006
|
k(N, X);
|
|
2016
2007
|
},
|
|
2017
2008
|
[k]
|
|
2018
|
-
), f =
|
|
2019
|
-
(N, x,
|
|
2020
|
-
const X = Math.max(1, N.maxX - N.minX), E = Math.max(1, N.maxY - N.minY),
|
|
2021
|
-
Math.min((x.width -
|
|
2009
|
+
), f = H(
|
|
2010
|
+
(N, x, B = 24) => {
|
|
2011
|
+
const X = Math.max(1, N.maxX - N.minX), E = Math.max(1, N.maxY - N.minY), R = P(
|
|
2012
|
+
Math.min((x.width - B * 2) / X, (x.height - B * 2) / E)
|
|
2022
2013
|
);
|
|
2023
|
-
|
|
2024
|
-
zoom:
|
|
2014
|
+
g({
|
|
2015
|
+
zoom: R,
|
|
2025
2016
|
pan: {
|
|
2026
|
-
x: (x.width - X *
|
|
2027
|
-
y: (x.height - E *
|
|
2017
|
+
x: (x.width - X * R) / 2 - N.minX * R,
|
|
2018
|
+
y: (x.height - E * R) / 2 - N.minY * R
|
|
2028
2019
|
}
|
|
2029
2020
|
});
|
|
2030
2021
|
},
|
|
2031
|
-
[
|
|
2032
|
-
), p =
|
|
2022
|
+
[g, P]
|
|
2023
|
+
), p = H(() => g(n), [g, n]), A = H(
|
|
2033
2024
|
(N) => ({
|
|
2034
2025
|
x: (N.x - c.pan.x) / c.zoom,
|
|
2035
2026
|
y: (N.y - c.pan.y) / c.zoom
|
|
2036
2027
|
}),
|
|
2037
2028
|
[c]
|
|
2038
|
-
), y =
|
|
2029
|
+
), y = H(
|
|
2039
2030
|
(N) => ({
|
|
2040
2031
|
x: N.x * c.zoom + c.pan.x,
|
|
2041
2032
|
y: N.y * c.zoom + c.pan.y
|
|
@@ -2047,7 +2038,7 @@ function _i(s = {}) {
|
|
|
2047
2038
|
};
|
|
2048
2039
|
return {
|
|
2049
2040
|
viewport: c,
|
|
2050
|
-
setViewport:
|
|
2041
|
+
setViewport: g,
|
|
2051
2042
|
containerProps: o ? {} : {
|
|
2052
2043
|
onWheel: (N) => {
|
|
2053
2044
|
N.preventDefault();
|
|
@@ -2055,36 +2046,36 @@ function _i(s = {}) {
|
|
|
2055
2046
|
k(Math.min(2, Math.max(0.5, x)), M(N));
|
|
2056
2047
|
},
|
|
2057
2048
|
onPointerDown: (N) => {
|
|
2058
|
-
var
|
|
2049
|
+
var B, X;
|
|
2059
2050
|
const x = M(N);
|
|
2060
|
-
if (h.current.set(N.pointerId, x), (X = (
|
|
2061
|
-
const [E,
|
|
2051
|
+
if (h.current.set(N.pointerId, x), (X = (B = N.currentTarget).setPointerCapture) == null || X.call(B, N.pointerId), h.current.size === 2) {
|
|
2052
|
+
const [E, R] = [...h.current.values()];
|
|
2062
2053
|
z.current = {
|
|
2063
|
-
distance: Math.hypot(E.x -
|
|
2054
|
+
distance: Math.hypot(E.x - R.x, E.y - R.y) || 1,
|
|
2064
2055
|
zoom: c.zoom
|
|
2065
2056
|
};
|
|
2066
2057
|
} else
|
|
2067
|
-
|
|
2058
|
+
v.current = x, m(!0);
|
|
2068
2059
|
},
|
|
2069
2060
|
onPointerMove: (N) => {
|
|
2070
2061
|
if (!h.current.has(N.pointerId))
|
|
2071
2062
|
return;
|
|
2072
2063
|
const x = M(N);
|
|
2073
2064
|
if (h.current.set(N.pointerId, x), h.current.size === 2 && z.current) {
|
|
2074
|
-
const [E,
|
|
2075
|
-
|
|
2065
|
+
const [E, R] = [...h.current.values()], q = Math.hypot(E.x - R.x, E.y - R.y) || 1, C = P(z.current.zoom * (q / z.current.distance)), b = { x: (E.x + R.x) / 2, y: (E.y + R.y) / 2 };
|
|
2066
|
+
C !== c.zoom && k(C / c.zoom, b);
|
|
2076
2067
|
return;
|
|
2077
2068
|
}
|
|
2078
|
-
if (!
|
|
2069
|
+
if (!v.current)
|
|
2079
2070
|
return;
|
|
2080
|
-
const
|
|
2081
|
-
|
|
2071
|
+
const B = x.x - v.current.x, X = x.y - v.current.y;
|
|
2072
|
+
v.current = x, g({ zoom: c.zoom, pan: { x: c.pan.x + B, y: c.pan.y + X } });
|
|
2082
2073
|
},
|
|
2083
2074
|
onPointerUp: (N) => {
|
|
2084
|
-
h.current.delete(N.pointerId), h.current.size < 2 && (z.current = null), h.current.size === 0 && (
|
|
2075
|
+
h.current.delete(N.pointerId), h.current.size < 2 && (z.current = null), h.current.size === 0 && (v.current = null, m(!1));
|
|
2085
2076
|
},
|
|
2086
2077
|
onPointerCancel: (N) => {
|
|
2087
|
-
h.current.delete(N.pointerId), z.current = null,
|
|
2078
|
+
h.current.delete(N.pointerId), z.current = null, v.current = null, m(!1);
|
|
2088
2079
|
}
|
|
2089
2080
|
},
|
|
2090
2081
|
zoomBy: T,
|
|
@@ -2095,24 +2086,24 @@ function _i(s = {}) {
|
|
|
2095
2086
|
panning: l
|
|
2096
2087
|
};
|
|
2097
2088
|
}
|
|
2098
|
-
const
|
|
2089
|
+
const Ni = {
|
|
2099
2090
|
"orphan-seat": "That would leave a single empty seat. Pick a different seat.",
|
|
2100
2091
|
"not-adjacent": "Seats must be next to each other.",
|
|
2101
2092
|
"max-seats": "You have selected as many seats as this order allows.",
|
|
2102
2093
|
"category-not-allowed": "That seat is not part of the selected ticket type.",
|
|
2103
2094
|
unavailable: "That seat is not available."
|
|
2104
|
-
},
|
|
2095
|
+
}, bi = {
|
|
2105
2096
|
id: "empty",
|
|
2106
2097
|
name: "",
|
|
2107
2098
|
venueId: "",
|
|
2108
2099
|
sections: [],
|
|
2109
2100
|
priceCategories: [],
|
|
2110
2101
|
totalSeats: 0
|
|
2111
|
-
},
|
|
2102
|
+
}, ki = /* @__PURE__ */ te(
|
|
2112
2103
|
function(i, r) {
|
|
2113
|
-
var me,
|
|
2114
|
-
const { t: n } =
|
|
2115
|
-
chart: t =
|
|
2104
|
+
var me, Le, Ie;
|
|
2105
|
+
const { t: n } = ee(), {
|
|
2106
|
+
chart: t = bi,
|
|
2116
2107
|
mode: d = "select",
|
|
2117
2108
|
selection: o = {},
|
|
2118
2109
|
selectedSeatIds: u,
|
|
@@ -2122,8 +2113,8 @@ const yi = {
|
|
|
2122
2113
|
seatStatusOverrides: m,
|
|
2123
2114
|
onSeatClick: h,
|
|
2124
2115
|
onBestAvailable: z,
|
|
2125
|
-
lod:
|
|
2126
|
-
onLodChange:
|
|
2116
|
+
lod: v = "auto",
|
|
2117
|
+
onLodChange: g,
|
|
2127
2118
|
maxRenderedSeats: P = 2500,
|
|
2128
2119
|
containerSize: k,
|
|
2129
2120
|
showLegend: T = !0,
|
|
@@ -2134,160 +2125,166 @@ const yi = {
|
|
|
2134
2125
|
readOnly: M = !1,
|
|
2135
2126
|
className: w,
|
|
2136
2127
|
style: N
|
|
2137
|
-
} = i, x = ye(null), [
|
|
2128
|
+
} = i, x = ye(null), [B, X] = D({ width: 800, height: 500 }), [E, R] = D(!1), [q, C] = D(_), [b, L] = D(null), [j, W] = D(""), I = u ?? q, V = F(() => new Set(I), [I]), G = d === "select" && !y && !M && o.interactive !== !1, ne = o.maxSeats ?? 8, Y = F(() => si(t), [t]), ie = k ?? B, Z = !!k || E;
|
|
2138
2129
|
Fe(() => {
|
|
2139
2130
|
if (k || !x.current || typeof ResizeObserver > "u")
|
|
2140
2131
|
return;
|
|
2141
|
-
const
|
|
2142
|
-
const { width:
|
|
2143
|
-
|
|
2132
|
+
const $ = x.current, O = new ResizeObserver(([K]) => {
|
|
2133
|
+
const { width: Q, height: se } = K.contentRect;
|
|
2134
|
+
Q > 0 && se > 0 && (X({ width: Q, height: se }), R(!0));
|
|
2144
2135
|
});
|
|
2145
|
-
return O.observe(
|
|
2136
|
+
return O.observe($), () => O.disconnect();
|
|
2146
2137
|
}, [k]);
|
|
2147
|
-
const be =
|
|
2138
|
+
const be = yi({ disabled: !p || y }), { fitTo: oe, viewport: he } = be, ke = ye(!1);
|
|
2148
2139
|
Fe(() => {
|
|
2149
|
-
ke.current || !
|
|
2150
|
-
}, [oe,
|
|
2151
|
-
const Ee = F(() =>
|
|
2152
|
-
() =>
|
|
2153
|
-
[
|
|
2154
|
-
),
|
|
2140
|
+
ke.current || !Z || Y.totalSeats === 0 || ie.width <= 0 || (ke.current = !0, oe(Y.bounds, ie));
|
|
2141
|
+
}, [oe, Y, ie, Z]);
|
|
2142
|
+
const Ee = F(() => ai(he, ie, 40), [he, ie]), we = v !== "auto" ? v : b ? "seat" : void 0, ge = F(
|
|
2143
|
+
() => li(Y, Ee, P, we),
|
|
2144
|
+
[Y, Ee, P, we]
|
|
2145
|
+
), Se = ye(null);
|
|
2155
2146
|
Fe(() => {
|
|
2156
|
-
|
|
2157
|
-
}, [ge.tier,
|
|
2147
|
+
Se.current !== ge.tier && (Se.current = ge.tier, g == null || g(ge.tier));
|
|
2148
|
+
}, [ge.tier, g]);
|
|
2158
2149
|
const He = F(
|
|
2159
2150
|
() => {
|
|
2160
|
-
var
|
|
2161
|
-
return new Map(((
|
|
2151
|
+
var $;
|
|
2152
|
+
return new Map((($ = t.sections) == null ? void 0 : $.map((O) => [O.id, O.color])) ?? []);
|
|
2162
2153
|
},
|
|
2163
2154
|
[t.sections]
|
|
2164
2155
|
), ve = F(
|
|
2165
2156
|
() => {
|
|
2166
|
-
var
|
|
2167
|
-
return new Map(((
|
|
2157
|
+
var $;
|
|
2158
|
+
return new Map((($ = t.sections) == null ? void 0 : $.map((O) => [O.id, O])) ?? []);
|
|
2168
2159
|
},
|
|
2169
2160
|
[t.sections]
|
|
2170
|
-
), ue =
|
|
2171
|
-
(
|
|
2172
|
-
const O = ve.get(
|
|
2161
|
+
), ue = H(
|
|
2162
|
+
($) => {
|
|
2163
|
+
const O = ve.get($.sectorId), K = Ae($, m), Q = hn($), se = [
|
|
2173
2164
|
O ? O.name : "",
|
|
2174
|
-
n("seatingChart.rowN", "row {row}").replace("{row}", String(
|
|
2175
|
-
n("seatingChart.seatN", "seat {number}").replace("{number}", String(
|
|
2165
|
+
n("seatingChart.rowN", "row {row}").replace("{row}", String($.row)),
|
|
2166
|
+
n("seatingChart.seatN", "seat {number}").replace("{number}", String($.number))
|
|
2176
2167
|
].filter(Boolean);
|
|
2177
2168
|
if (O && o.showPrices !== !1) {
|
|
2178
|
-
const pe =
|
|
2179
|
-
|
|
2169
|
+
const pe = Pn($, t, O);
|
|
2170
|
+
se.push(ce(pe.amount, pe.currency, A));
|
|
2180
2171
|
}
|
|
2181
|
-
return
|
|
2172
|
+
return se.push(n(`seatingChart.status.${K}`, K)), Q === "wheelchair" && se.push(n("seatingChart.wheelchairAccessible", "wheelchair accessible")), Q === "companion" && se.push(n("seatingChart.companionSeat", "companion seat")), se.join(", ");
|
|
2182
2173
|
},
|
|
2183
2174
|
[t, ve, m, o.showPrices, A, n]
|
|
2184
|
-
), le =
|
|
2185
|
-
(
|
|
2186
|
-
u === void 0 &&
|
|
2175
|
+
), le = H(
|
|
2176
|
+
($) => {
|
|
2177
|
+
u === void 0 && C($), c == null || c($);
|
|
2187
2178
|
},
|
|
2188
2179
|
[u, c]
|
|
2189
|
-
),
|
|
2190
|
-
(
|
|
2191
|
-
if (h == null || h(
|
|
2180
|
+
), Te = H(
|
|
2181
|
+
($) => {
|
|
2182
|
+
if (h == null || h($), !G)
|
|
2192
2183
|
return;
|
|
2193
|
-
const O =
|
|
2184
|
+
const O = ui(I, $.id, Y, o, m);
|
|
2194
2185
|
if ("rejected" in O) {
|
|
2195
|
-
l == null || l({ reason: O.rejected, seatId:
|
|
2196
|
-
n(`seatingChart.rejection.${O.rejected}`,
|
|
2186
|
+
l == null || l({ reason: O.rejected, seatId: $.id }), W(
|
|
2187
|
+
n(`seatingChart.rejection.${O.rejected}`, Ni[O.rejected])
|
|
2197
2188
|
);
|
|
2198
2189
|
return;
|
|
2199
2190
|
}
|
|
2200
|
-
le(O.selected),
|
|
2201
|
-
n("seatingChart.seatSelected", "{seat}. {count} of {max} selected.").replace("{seat}", ue(
|
|
2191
|
+
le(O.selected), W(
|
|
2192
|
+
n("seatingChart.seatSelected", "{seat}. {count} of {max} selected.").replace("{seat}", ue($)).replace("{count}", String(O.selected.length)).replace("{max}", String(ne))
|
|
2202
2193
|
);
|
|
2203
2194
|
},
|
|
2204
2195
|
[
|
|
2205
2196
|
n,
|
|
2206
2197
|
le,
|
|
2207
2198
|
ue,
|
|
2208
|
-
|
|
2199
|
+
Y,
|
|
2209
2200
|
G,
|
|
2210
|
-
|
|
2201
|
+
ne,
|
|
2211
2202
|
h,
|
|
2212
2203
|
l,
|
|
2213
2204
|
m,
|
|
2214
2205
|
I,
|
|
2215
2206
|
o
|
|
2216
2207
|
]
|
|
2217
|
-
), fe =
|
|
2218
|
-
(
|
|
2208
|
+
), fe = H(
|
|
2209
|
+
($, O) => {
|
|
2219
2210
|
if (z) {
|
|
2220
|
-
z(
|
|
2211
|
+
z($, O);
|
|
2221
2212
|
return;
|
|
2222
2213
|
}
|
|
2223
|
-
const
|
|
2224
|
-
if (
|
|
2225
|
-
|
|
2214
|
+
const K = mi(Y, $, o, O, m);
|
|
2215
|
+
if (K.length === 0) {
|
|
2216
|
+
W(
|
|
2226
2217
|
n(
|
|
2227
2218
|
"seatingChart.noBlockAvailable",
|
|
2228
2219
|
"No block of {count} seats together is available."
|
|
2229
|
-
).replace("{count}", String(
|
|
2220
|
+
).replace("{count}", String($))
|
|
2230
2221
|
);
|
|
2231
2222
|
return;
|
|
2232
2223
|
}
|
|
2233
|
-
le(
|
|
2224
|
+
le(K), L(K[0]), W(
|
|
2234
2225
|
n("seatingChart.selectedTogether", "Selected {count} seats together.").replace(
|
|
2235
2226
|
"{count}",
|
|
2236
|
-
String(
|
|
2227
|
+
String(K.length)
|
|
2237
2228
|
)
|
|
2238
2229
|
);
|
|
2239
2230
|
},
|
|
2240
|
-
[le,
|
|
2241
|
-
),
|
|
2242
|
-
(
|
|
2243
|
-
const O =
|
|
2231
|
+
[le, Y, z, m, o, n]
|
|
2232
|
+
), Me = H(
|
|
2233
|
+
($) => {
|
|
2234
|
+
const O = Y.locationById.get($);
|
|
2244
2235
|
if (!O)
|
|
2245
2236
|
return;
|
|
2246
|
-
const
|
|
2247
|
-
(
|
|
2237
|
+
const K = Y.rows.find(
|
|
2238
|
+
(Q) => Q.sectionId === O.sectionId && Q.rowIndex === O.rowIndex
|
|
2248
2239
|
);
|
|
2249
|
-
|
|
2240
|
+
K && oe(K.bounds, ie, 80);
|
|
2250
2241
|
},
|
|
2251
|
-
[oe,
|
|
2252
|
-
), _e =
|
|
2253
|
-
(
|
|
2254
|
-
if (
|
|
2242
|
+
[oe, Y, ie]
|
|
2243
|
+
), _e = H(
|
|
2244
|
+
($) => {
|
|
2245
|
+
if (!$)
|
|
2255
2246
|
return;
|
|
2256
|
-
$
|
|
2257
|
-
const O =
|
|
2258
|
-
O &&
|
|
2247
|
+
L($), Me($);
|
|
2248
|
+
const O = Y.seatById.get($);
|
|
2249
|
+
O && W(ue(O)), requestAnimationFrame(() => {
|
|
2250
|
+
var Q;
|
|
2251
|
+
const K = [
|
|
2252
|
+
...((Q = x.current) == null ? void 0 : Q.querySelectorAll("[data-seat-id]")) ?? []
|
|
2253
|
+
].find((se) => se.getAttribute("data-seat-id") === $);
|
|
2254
|
+
K == null || K.focus({ preventScroll: !0 });
|
|
2255
|
+
});
|
|
2259
2256
|
},
|
|
2260
|
-
[ue,
|
|
2261
|
-
), Qe = (
|
|
2262
|
-
var
|
|
2263
|
-
const O = b ?? ((pe = (
|
|
2257
|
+
[ue, Y.seatById, Me]
|
|
2258
|
+
), Qe = ($) => {
|
|
2259
|
+
var se, pe;
|
|
2260
|
+
const O = b ?? ((pe = (se = Y.rows[0]) == null ? void 0 : se.seats[0]) == null ? void 0 : pe.id) ?? null;
|
|
2264
2261
|
if (!O)
|
|
2265
2262
|
return;
|
|
2266
|
-
const
|
|
2263
|
+
const Q = {
|
|
2267
2264
|
ArrowLeft: "left",
|
|
2268
2265
|
ArrowRight: "right",
|
|
2269
2266
|
ArrowUp: "up",
|
|
2270
2267
|
ArrowDown: "down",
|
|
2271
2268
|
Home: "row-start",
|
|
2272
2269
|
End: "row-end"
|
|
2273
|
-
}[
|
|
2274
|
-
if (
|
|
2275
|
-
|
|
2270
|
+
}[$.key];
|
|
2271
|
+
if (Q) {
|
|
2272
|
+
$.preventDefault(), _e(b ? pi(Y, O, Q) : O);
|
|
2276
2273
|
return;
|
|
2277
2274
|
}
|
|
2278
|
-
if (
|
|
2279
|
-
|
|
2275
|
+
if ($.key === "PageDown" || $.key === "PageUp") {
|
|
2276
|
+
$.preventDefault(), _e(hi(Y, b, $.key === "PageDown" ? "next" : "prev"));
|
|
2280
2277
|
return;
|
|
2281
2278
|
}
|
|
2282
|
-
if (
|
|
2283
|
-
|
|
2284
|
-
const Oe =
|
|
2285
|
-
Oe &&
|
|
2279
|
+
if ($.key === "Enter" || $.key === " ") {
|
|
2280
|
+
$.preventDefault();
|
|
2281
|
+
const Oe = Y.seatById.get(O);
|
|
2282
|
+
Oe && Te(Oe);
|
|
2286
2283
|
return;
|
|
2287
2284
|
}
|
|
2288
|
-
|
|
2285
|
+
$.key === "Escape" && I.length > 0 && ($.preventDefault(), le([]), W(n("seatingChart.selectionCleared", "Selection cleared.")));
|
|
2289
2286
|
};
|
|
2290
|
-
if (
|
|
2287
|
+
if (Y.totalSeats === 0)
|
|
2291
2288
|
return /* @__PURE__ */ e("div", { ref: r, className: `nice-seating-chart ${w ?? ""}`, style: N, children: /* @__PURE__ */ e(
|
|
2292
2289
|
Ne,
|
|
2293
2290
|
{
|
|
@@ -2298,18 +2295,18 @@ const yi = {
|
|
|
2298
2295
|
)
|
|
2299
2296
|
}
|
|
2300
2297
|
) });
|
|
2301
|
-
const
|
|
2302
|
-
const
|
|
2303
|
-
return !
|
|
2304
|
-
}, 0),
|
|
2305
|
-
return /* @__PURE__ */
|
|
2298
|
+
const Ce = I.reduce(($, O) => {
|
|
2299
|
+
const K = Y.seatById.get(O), Q = K ? ve.get(K.sectorId) : void 0;
|
|
2300
|
+
return !K || !Q ? $ : $ + Pn(K, t, Q).amount;
|
|
2301
|
+
}, 0), xe = ((Le = (me = t.sections) == null ? void 0 : me[0]) == null ? void 0 : Le.currency) ?? "PLN";
|
|
2302
|
+
return /* @__PURE__ */ s(
|
|
2306
2303
|
"div",
|
|
2307
2304
|
{
|
|
2308
2305
|
ref: r,
|
|
2309
2306
|
className: `nice-seating-chart nice-seating-chart--${d} ${w ?? ""}`,
|
|
2310
2307
|
style: N,
|
|
2311
2308
|
children: [
|
|
2312
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ s(
|
|
2313
2310
|
"div",
|
|
2314
2311
|
{
|
|
2315
2312
|
ref: x,
|
|
@@ -2319,13 +2316,13 @@ const yi = {
|
|
|
2319
2316
|
"{name}",
|
|
2320
2317
|
t.name
|
|
2321
2318
|
),
|
|
2322
|
-
"aria-rowcount":
|
|
2323
|
-
"aria-colcount":
|
|
2319
|
+
"aria-rowcount": Y.rows.length,
|
|
2320
|
+
"aria-colcount": Y.totalSeats,
|
|
2324
2321
|
tabIndex: b ? -1 : 0,
|
|
2325
2322
|
onKeyDown: Qe,
|
|
2326
2323
|
...be.containerProps,
|
|
2327
2324
|
children: [
|
|
2328
|
-
/* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ s(
|
|
2329
2326
|
"svg",
|
|
2330
2327
|
{
|
|
2331
2328
|
className: "nice-seating-chart__canvas",
|
|
@@ -2345,7 +2342,7 @@ const yi = {
|
|
|
2345
2342
|
}
|
|
2346
2343
|
) }),
|
|
2347
2344
|
/* @__PURE__ */ e("g", { transform: `translate(${he.pan.x} ${he.pan.y}) scale(${he.zoom})`, children: /* @__PURE__ */ e(
|
|
2348
|
-
|
|
2345
|
+
vi,
|
|
2349
2346
|
{
|
|
2350
2347
|
cull: ge,
|
|
2351
2348
|
selectedIds: V,
|
|
@@ -2353,10 +2350,10 @@ const yi = {
|
|
|
2353
2350
|
statusOverrides: m,
|
|
2354
2351
|
sectionColorById: He,
|
|
2355
2352
|
interactive: G,
|
|
2356
|
-
onSeatClick:
|
|
2357
|
-
onSectionClick: o.sectionSelect ? (
|
|
2358
|
-
var
|
|
2359
|
-
const O = (
|
|
2353
|
+
onSeatClick: Te,
|
|
2354
|
+
onSectionClick: o.sectionSelect ? ($) => {
|
|
2355
|
+
var K;
|
|
2356
|
+
const O = (K = Y.rows.find((Q) => Q.sectionId === $)) == null ? void 0 : K.seats[0];
|
|
2360
2357
|
O && _e(O.id);
|
|
2361
2358
|
} : void 0,
|
|
2362
2359
|
describeSeat: ue
|
|
@@ -2365,7 +2362,7 @@ const yi = {
|
|
|
2365
2362
|
]
|
|
2366
2363
|
}
|
|
2367
2364
|
),
|
|
2368
|
-
p && /* @__PURE__ */
|
|
2365
|
+
p && /* @__PURE__ */ s("div", { className: "nice-seating-chart__zoom", children: [
|
|
2369
2366
|
/* @__PURE__ */ e(
|
|
2370
2367
|
U,
|
|
2371
2368
|
{
|
|
@@ -2373,7 +2370,7 @@ const yi = {
|
|
|
2373
2370
|
variant: "ghost",
|
|
2374
2371
|
ariaLabel: n("seatingChart.zoomIn", "Zoom in"),
|
|
2375
2372
|
onClick: () => be.zoomBy(1.25, void 0, ie),
|
|
2376
|
-
children: /* @__PURE__ */ e(
|
|
2373
|
+
children: /* @__PURE__ */ e(wt, { size: 16 })
|
|
2377
2374
|
}
|
|
2378
2375
|
),
|
|
2379
2376
|
/* @__PURE__ */ e(
|
|
@@ -2383,7 +2380,7 @@ const yi = {
|
|
|
2383
2380
|
variant: "ghost",
|
|
2384
2381
|
ariaLabel: n("seatingChart.zoomOut", "Zoom out"),
|
|
2385
2382
|
onClick: () => be.zoomBy(0.8, void 0, ie),
|
|
2386
|
-
children: /* @__PURE__ */ e(
|
|
2383
|
+
children: /* @__PURE__ */ e(St, { size: 16 })
|
|
2387
2384
|
}
|
|
2388
2385
|
),
|
|
2389
2386
|
/* @__PURE__ */ e(
|
|
@@ -2392,7 +2389,7 @@ const yi = {
|
|
|
2392
2389
|
size: "sm",
|
|
2393
2390
|
variant: "ghost",
|
|
2394
2391
|
ariaLabel: n("seatingChart.fitToView", "Fit to view"),
|
|
2395
|
-
onClick: () => oe(
|
|
2392
|
+
onClick: () => oe(Y.bounds, ie),
|
|
2396
2393
|
children: /* @__PURE__ */ e(Ct, { size: 16 })
|
|
2397
2394
|
}
|
|
2398
2395
|
)
|
|
@@ -2400,43 +2397,36 @@ const yi = {
|
|
|
2400
2397
|
]
|
|
2401
2398
|
}
|
|
2402
2399
|
),
|
|
2403
|
-
/* @__PURE__ */ e("p", { className: "nice-seating-chart__status", role: "status", "aria-live": "polite", children:
|
|
2404
|
-
T && /* @__PURE__ */
|
|
2405
|
-
(
|
|
2400
|
+
/* @__PURE__ */ e("p", { className: "nice-seating-chart__status", role: "status", "aria-live": "polite", children: j }),
|
|
2401
|
+
T && /* @__PURE__ */ s("ul", { className: "nice-seating-chart__legend", children: [
|
|
2402
|
+
(Ie = t.priceCategories) == null ? void 0 : Ie.map(($) => /* @__PURE__ */ s("li", { className: "nice-seating-chart__legend-item", children: [
|
|
2406
2403
|
/* @__PURE__ */ e(
|
|
2407
2404
|
"span",
|
|
2408
2405
|
{
|
|
2409
2406
|
className: "nice-seating-chart__legend-swatch",
|
|
2410
|
-
style: { background:
|
|
2407
|
+
style: { background: $.color },
|
|
2411
2408
|
"aria-hidden": "true"
|
|
2412
2409
|
}
|
|
2413
2410
|
),
|
|
2414
|
-
|
|
2411
|
+
$.name,
|
|
2415
2412
|
" · ",
|
|
2416
|
-
ce(
|
|
2417
|
-
] },
|
|
2418
|
-
/* @__PURE__ */
|
|
2413
|
+
ce($.price, xe, A)
|
|
2414
|
+
] }, $.id)),
|
|
2415
|
+
/* @__PURE__ */ s("li", { className: "nice-seating-chart__legend-item nice-seating-chart__legend-item--sold", children: [
|
|
2419
2416
|
/* @__PURE__ */ e("span", { className: "nice-seating-chart__legend-swatch", "aria-hidden": "true" }),
|
|
2420
2417
|
" ",
|
|
2421
2418
|
n("seatingChart.sold", "Sold")
|
|
2422
2419
|
] })
|
|
2423
2420
|
] }),
|
|
2424
|
-
d === "select" && I.length > 0 && /* @__PURE__ */
|
|
2425
|
-
I.length,
|
|
2426
|
-
" seat",
|
|
2427
|
-
I.length === 1 ? "" : "s",
|
|
2428
|
-
" ·",
|
|
2429
|
-
" ",
|
|
2430
|
-
ce(Te, Me, A)
|
|
2431
|
-
] }),
|
|
2421
|
+
d === "select" && I.length > 0 && /* @__PURE__ */ e("p", { className: "nice-seating-chart__total", children: I.length === 1 ? n("seatingChart.seatsOne", "{selected} seat · {amount}").replace("{selected}", String(I.length)).replace("{amount}", String(ce(Ce, xe, A))) : n("seatingChart.seatsMany", "{selected} seats · {amount}").replace("{selected}", String(I.length)).replace("{amount}", String(ce(Ce, xe, A))) }),
|
|
2432
2422
|
f && /* @__PURE__ */ e(
|
|
2433
|
-
|
|
2423
|
+
fi,
|
|
2434
2424
|
{
|
|
2435
|
-
index:
|
|
2425
|
+
index: Y,
|
|
2436
2426
|
selectedIds: V,
|
|
2437
2427
|
statusOverrides: m,
|
|
2438
|
-
maxSeats:
|
|
2439
|
-
onSeatToggle:
|
|
2428
|
+
maxSeats: ne,
|
|
2429
|
+
onSeatToggle: Te,
|
|
2440
2430
|
onBestAvailable: fe,
|
|
2441
2431
|
describeSeat: ue,
|
|
2442
2432
|
disabled: !G,
|
|
@@ -2447,10 +2437,10 @@ const yi = {
|
|
|
2447
2437
|
}
|
|
2448
2438
|
);
|
|
2449
2439
|
}
|
|
2450
|
-
),
|
|
2440
|
+
), ca = /* @__PURE__ */ te(
|
|
2451
2441
|
function({ showList: i = !0, className: r, ...n }, t) {
|
|
2452
2442
|
return /* @__PURE__ */ e(
|
|
2453
|
-
|
|
2443
|
+
ki,
|
|
2454
2444
|
{
|
|
2455
2445
|
ref: t,
|
|
2456
2446
|
mode: "select",
|
|
@@ -2460,38 +2450,38 @@ const yi = {
|
|
|
2460
2450
|
}
|
|
2461
2451
|
);
|
|
2462
2452
|
}
|
|
2463
|
-
),
|
|
2453
|
+
), Gn = /\{\{\s*([\w.-]+)\s*\}\}/g, wi = {
|
|
2464
2454
|
"&": "&",
|
|
2465
2455
|
"<": "<",
|
|
2466
2456
|
">": ">",
|
|
2467
2457
|
'"': """,
|
|
2468
2458
|
"'": "'"
|
|
2469
2459
|
};
|
|
2470
|
-
function
|
|
2471
|
-
return
|
|
2460
|
+
function Si(a) {
|
|
2461
|
+
return a.replace(/[&<>"']/g, (i) => wi[i] ?? i);
|
|
2472
2462
|
}
|
|
2473
|
-
function Ci(
|
|
2463
|
+
function Ci(a) {
|
|
2474
2464
|
const i = [], r = /* @__PURE__ */ new Set();
|
|
2475
|
-
for (const n of
|
|
2465
|
+
for (const n of a.matchAll(Gn)) {
|
|
2476
2466
|
const t = n[1];
|
|
2477
2467
|
r.has(t) || (r.add(t), i.push(t));
|
|
2478
2468
|
}
|
|
2479
2469
|
return i;
|
|
2480
2470
|
}
|
|
2481
|
-
function xi(
|
|
2471
|
+
function xi(a, i = {}, r = {}) {
|
|
2482
2472
|
const { escape: n = !0, missing: t = "keep" } = r;
|
|
2483
|
-
return
|
|
2473
|
+
return a.replace(Gn, (d, o) => {
|
|
2484
2474
|
const u = i[o];
|
|
2485
|
-
return u == null ? t === "blank" ? "" : d : n ?
|
|
2475
|
+
return u == null ? t === "blank" ? "" : d : n ? Si(String(u)) : String(u);
|
|
2486
2476
|
});
|
|
2487
2477
|
}
|
|
2488
|
-
function
|
|
2489
|
-
return `{{${
|
|
2478
|
+
function zn(a) {
|
|
2479
|
+
return `{{${a}}}`;
|
|
2490
2480
|
}
|
|
2491
|
-
function
|
|
2492
|
-
return Ci(
|
|
2481
|
+
function Ii(a, i = {}) {
|
|
2482
|
+
return Ci(a).filter((r) => i[r] === void 0 || i[r] === null);
|
|
2493
2483
|
}
|
|
2494
|
-
const
|
|
2484
|
+
const Pi = { name: "", body: "" }, zi = [
|
|
2495
2485
|
"bold",
|
|
2496
2486
|
"italic",
|
|
2497
2487
|
"underline",
|
|
@@ -2505,8 +2495,8 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2505
2495
|
"alignCenter",
|
|
2506
2496
|
"undo",
|
|
2507
2497
|
"redo"
|
|
2508
|
-
],
|
|
2509
|
-
const { t: n } =
|
|
2498
|
+
], la = /* @__PURE__ */ te(function(i, r) {
|
|
2499
|
+
const { t: n } = ee(), {
|
|
2510
2500
|
template: t,
|
|
2511
2501
|
defaultTemplate: d,
|
|
2512
2502
|
onTemplateChange: o,
|
|
@@ -2516,46 +2506,46 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2516
2506
|
onRecipientsChange: l,
|
|
2517
2507
|
onSend: m,
|
|
2518
2508
|
sending: h = !1,
|
|
2519
|
-
toolbar: z =
|
|
2520
|
-
disabled:
|
|
2521
|
-
readOnly:
|
|
2509
|
+
toolbar: z = zi,
|
|
2510
|
+
disabled: v = !1,
|
|
2511
|
+
readOnly: g = !1,
|
|
2522
2512
|
size: P = "md",
|
|
2523
2513
|
className: k,
|
|
2524
2514
|
style: T
|
|
2525
|
-
} = i, [f, p] =
|
|
2515
|
+
} = i, [f, p] = Ft({
|
|
2526
2516
|
value: t,
|
|
2527
2517
|
defaultValue: d,
|
|
2528
|
-
fallbackValue:
|
|
2518
|
+
fallbackValue: Pi,
|
|
2529
2519
|
onChange: o,
|
|
2530
2520
|
componentName: "NiceInvitationDesigner"
|
|
2531
|
-
}), [A, y] =
|
|
2521
|
+
}), [A, y] = D(""), M = v || g || h, w = F(() => Xn(A), [A]), N = F(() => {
|
|
2532
2522
|
const b = {};
|
|
2533
|
-
for (const
|
|
2534
|
-
|
|
2523
|
+
for (const L of u)
|
|
2524
|
+
L.sample !== void 0 && (b[L.key] = L.sample);
|
|
2535
2525
|
return { ...b, ..._ };
|
|
2536
2526
|
}, [u, _]), x = F(
|
|
2537
2527
|
() => xi(f.body ?? "", N),
|
|
2538
2528
|
[f.body, N]
|
|
2539
|
-
),
|
|
2540
|
-
() =>
|
|
2529
|
+
), B = F(
|
|
2530
|
+
() => Ii(f.body ?? "", N),
|
|
2541
2531
|
[f.body, N]
|
|
2542
|
-
), X = c.map((b) => b.email), E = (b) => p({ ...f, ...b }),
|
|
2543
|
-
E({ body: `${f.body ?? ""}${
|
|
2544
|
-
},
|
|
2545
|
-
!l || w.valid.length === 0 || (l(
|
|
2546
|
-
},
|
|
2547
|
-
l == null || l(X.filter((
|
|
2532
|
+
), X = c.map((b) => b.email), E = (b) => p({ ...f, ...b }), R = (b) => {
|
|
2533
|
+
E({ body: `${f.body ?? ""}${zn(b)}` });
|
|
2534
|
+
}, q = () => {
|
|
2535
|
+
!l || w.valid.length === 0 || (l(Qt(X, w.valid)), y(""));
|
|
2536
|
+
}, C = (b) => {
|
|
2537
|
+
l == null || l(X.filter((L) => L !== b));
|
|
2548
2538
|
};
|
|
2549
|
-
return /* @__PURE__ */
|
|
2539
|
+
return /* @__PURE__ */ s(
|
|
2550
2540
|
"div",
|
|
2551
2541
|
{
|
|
2552
2542
|
ref: r,
|
|
2553
2543
|
className: `nice-invitation-designer nice-invitation-designer--${P} ${k ?? ""}`,
|
|
2554
2544
|
style: T,
|
|
2555
2545
|
children: [
|
|
2556
|
-
/* @__PURE__ */
|
|
2546
|
+
/* @__PURE__ */ s("section", { className: "nice-invitation-designer__editor", children: [
|
|
2557
2547
|
/* @__PURE__ */ e(
|
|
2558
|
-
|
|
2548
|
+
J,
|
|
2559
2549
|
{
|
|
2560
2550
|
label: n("invitationDesigner.templateName", "Template name"),
|
|
2561
2551
|
value: f.name,
|
|
@@ -2565,44 +2555,44 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2565
2555
|
size: P
|
|
2566
2556
|
}
|
|
2567
2557
|
),
|
|
2568
|
-
u.length > 0 && !
|
|
2569
|
-
/* @__PURE__ */ e("span", { className: "nice-invitation-designer__tokens-label", children: "Insert:" }),
|
|
2558
|
+
u.length > 0 && !g && /* @__PURE__ */ s("div", { className: "nice-invitation-designer__tokens", children: [
|
|
2559
|
+
/* @__PURE__ */ e("span", { className: "nice-invitation-designer__tokens-label", children: n("invitationDesigner.insert", "Insert:") }),
|
|
2570
2560
|
u.map((b) => /* @__PURE__ */ e(
|
|
2571
2561
|
U,
|
|
2572
2562
|
{
|
|
2573
2563
|
size: "sm",
|
|
2574
2564
|
variant: "outline",
|
|
2575
2565
|
disabled: M,
|
|
2576
|
-
onClick: () =>
|
|
2566
|
+
onClick: () => R(b.key),
|
|
2577
2567
|
children: b.label
|
|
2578
2568
|
},
|
|
2579
2569
|
b.key
|
|
2580
2570
|
))
|
|
2581
2571
|
] }),
|
|
2582
2572
|
/* @__PURE__ */ e(
|
|
2583
|
-
|
|
2573
|
+
Ut,
|
|
2584
2574
|
{
|
|
2585
2575
|
value: f.body ?? "",
|
|
2586
2576
|
onChange: (b) => E({ body: b }),
|
|
2587
2577
|
toolbar: z,
|
|
2588
2578
|
height: 280,
|
|
2589
|
-
readOnly:
|
|
2590
|
-
disabled:
|
|
2579
|
+
readOnly: g || h,
|
|
2580
|
+
disabled: v
|
|
2591
2581
|
}
|
|
2592
2582
|
)
|
|
2593
2583
|
] }),
|
|
2594
|
-
/* @__PURE__ */
|
|
2584
|
+
/* @__PURE__ */ s(
|
|
2595
2585
|
"section",
|
|
2596
2586
|
{
|
|
2597
2587
|
className: "nice-invitation-designer__preview",
|
|
2598
2588
|
"aria-label": n("invitationDesigner.invitationPreview", "Invitation preview"),
|
|
2599
2589
|
children: [
|
|
2600
|
-
/* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ s("header", { className: "nice-invitation-designer__preview-header", children: [
|
|
2601
2591
|
/* @__PURE__ */ e("h4", { children: n("invitationDesigner.preview", "Preview") }),
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2592
|
+
B.length > 0 && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "warning", children: n("invitationDesigner.unresolved", "{unresolved} unresolved").replace(
|
|
2593
|
+
"{unresolved}",
|
|
2594
|
+
String(B.length)
|
|
2595
|
+
) })
|
|
2606
2596
|
] }),
|
|
2607
2597
|
f.coverImageUrl && /* @__PURE__ */ e("img", { className: "nice-invitation-designer__cover", src: f.coverImageUrl, alt: "" }),
|
|
2608
2598
|
/* @__PURE__ */ e(
|
|
@@ -2612,24 +2602,24 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2612
2602
|
dangerouslySetInnerHTML: { __html: x }
|
|
2613
2603
|
}
|
|
2614
2604
|
),
|
|
2615
|
-
|
|
2616
|
-
"
|
|
2617
|
-
|
|
2618
|
-
|
|
2605
|
+
B.length > 0 && /* @__PURE__ */ e("p", { className: "nice-invitation-designer__unresolved", children: n(
|
|
2606
|
+
"invitationDesigner.noPreviewValueFor",
|
|
2607
|
+
"No preview value for: {unresolved}"
|
|
2608
|
+
).replace("{unresolved}", String(B.map((b) => zn(b)).join(", "))) })
|
|
2619
2609
|
]
|
|
2620
2610
|
}
|
|
2621
2611
|
),
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
/* @__PURE__ */ e("header", { className: "nice-invitation-designer__recipients-header", children: /* @__PURE__ */
|
|
2612
|
+
/* @__PURE__ */ s("section", { className: "nice-invitation-designer__recipients", children: [
|
|
2613
|
+
/* @__PURE__ */ e("header", { className: "nice-invitation-designer__recipients-header", children: /* @__PURE__ */ s("h4", { children: [
|
|
2624
2614
|
n("invitationDesigner.recipients", "Recipients"),
|
|
2625
2615
|
" ",
|
|
2626
|
-
/* @__PURE__ */
|
|
2616
|
+
/* @__PURE__ */ s("span", { children: [
|
|
2627
2617
|
"(",
|
|
2628
2618
|
c.length,
|
|
2629
2619
|
")"
|
|
2630
2620
|
] })
|
|
2631
2621
|
] }) }),
|
|
2632
|
-
l && !
|
|
2622
|
+
l && !g && /* @__PURE__ */ s(Ge, { children: [
|
|
2633
2623
|
/* @__PURE__ */ e(
|
|
2634
2624
|
on,
|
|
2635
2625
|
{
|
|
@@ -2645,22 +2635,22 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2645
2635
|
size: P
|
|
2646
2636
|
}
|
|
2647
2637
|
),
|
|
2648
|
-
/* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ s("div", { className: "nice-invitation-designer__paste-actions", children: [
|
|
2649
2639
|
/* @__PURE__ */ e(
|
|
2650
2640
|
U,
|
|
2651
2641
|
{
|
|
2652
2642
|
size: P,
|
|
2653
2643
|
variant: "outline",
|
|
2654
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2644
|
+
leftIcon: /* @__PURE__ */ e(Rn, { size: 15 }),
|
|
2655
2645
|
disabled: M || w.valid.length === 0,
|
|
2656
|
-
onClick:
|
|
2646
|
+
onClick: q,
|
|
2657
2647
|
children: w.valid.length > 0 ? n("invitationDesigner.addN", "Add ({count})").replace(
|
|
2658
2648
|
"{count}",
|
|
2659
2649
|
String(w.valid.length)
|
|
2660
2650
|
) : n("invitationDesigner.add", "Add")
|
|
2661
2651
|
}
|
|
2662
2652
|
),
|
|
2663
|
-
(w.invalid.length > 0 || w.duplicates > 0) && /* @__PURE__ */
|
|
2653
|
+
(w.invalid.length > 0 || w.duplicates > 0) && /* @__PURE__ */ s("span", { className: "nice-invitation-designer__paste-hint", children: [
|
|
2664
2654
|
w.duplicates > 0 && `${n("invitationDesigner.duplicates", "{count} duplicate(s).").replace(
|
|
2665
2655
|
"{count}",
|
|
2666
2656
|
String(w.duplicates)
|
|
@@ -2669,7 +2659,7 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2669
2659
|
] })
|
|
2670
2660
|
] })
|
|
2671
2661
|
] }),
|
|
2672
|
-
c.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-invitation-designer__recipient-list", children: c.map((b) => /* @__PURE__ */
|
|
2662
|
+
c.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-invitation-designer__recipient-list", children: c.map((b) => /* @__PURE__ */ s("li", { className: "nice-invitation-designer__recipient", children: [
|
|
2673
2663
|
/* @__PURE__ */ e("span", { children: b.name ? `${b.name} <${b.email}>` : b.email }),
|
|
2674
2664
|
b.status && b.status !== "pending" && /* @__PURE__ */ e(
|
|
2675
2665
|
ae,
|
|
@@ -2680,7 +2670,7 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2680
2670
|
children: n(`invitationDesigner.recipientStatus.${b.status}`, b.status)
|
|
2681
2671
|
}
|
|
2682
2672
|
),
|
|
2683
|
-
l && !
|
|
2673
|
+
l && !g && /* @__PURE__ */ e(
|
|
2684
2674
|
U,
|
|
2685
2675
|
{
|
|
2686
2676
|
size: "sm",
|
|
@@ -2690,12 +2680,12 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2690
2680
|
b.email
|
|
2691
2681
|
),
|
|
2692
2682
|
disabled: M,
|
|
2693
|
-
onClick: () =>
|
|
2694
|
-
children: /* @__PURE__ */ e(
|
|
2683
|
+
onClick: () => C(b.email),
|
|
2684
|
+
children: /* @__PURE__ */ e(De, { size: 13 })
|
|
2695
2685
|
}
|
|
2696
2686
|
)
|
|
2697
2687
|
] }, b.email)) }),
|
|
2698
|
-
m && !
|
|
2688
|
+
m && !g && /* @__PURE__ */ e(
|
|
2699
2689
|
U,
|
|
2700
2690
|
{
|
|
2701
2691
|
variant: "primary",
|
|
@@ -2703,7 +2693,7 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2703
2693
|
leftIcon: /* @__PURE__ */ e(xt, { size: 15 }),
|
|
2704
2694
|
loading: h,
|
|
2705
2695
|
ariaLabel: n("invitationDesigner.sendInvitations", "Send invitations"),
|
|
2706
|
-
disabled:
|
|
2696
|
+
disabled: v || h || c.length === 0,
|
|
2707
2697
|
onClick: () => m({ templateId: f.id, emails: X }),
|
|
2708
2698
|
children: h ? n("invitationDesigner.sending", "Sending…") : n("invitationDesigner.sendTo", "Send to {count}").replace(
|
|
2709
2699
|
"{count}",
|
|
@@ -2715,39 +2705,39 @@ const Ii = { name: "", body: "" }, Pi = [
|
|
|
2715
2705
|
]
|
|
2716
2706
|
}
|
|
2717
2707
|
);
|
|
2718
|
-
}),
|
|
2719
|
-
value:
|
|
2708
|
+
}), Ai = ({
|
|
2709
|
+
value: a,
|
|
2720
2710
|
max: i,
|
|
2721
2711
|
currency: r,
|
|
2722
2712
|
locale: n,
|
|
2723
2713
|
label: t,
|
|
2724
2714
|
className: d
|
|
2725
2715
|
}) => {
|
|
2726
|
-
const o = i > 0 ? i : 1, u =
|
|
2716
|
+
const o = i > 0 ? i : 1, u = a >= i && i > 0, _ = (c, l) => r ? `${ce(c, r, n)} / ${ce(l, r, n)}` : `${c} / ${l}`;
|
|
2727
2717
|
return /* @__PURE__ */ e(
|
|
2728
|
-
|
|
2718
|
+
Vt,
|
|
2729
2719
|
{
|
|
2730
2720
|
className: d,
|
|
2731
|
-
value: Math.min(
|
|
2721
|
+
value: Math.min(a, o),
|
|
2732
2722
|
max: o,
|
|
2733
2723
|
variant: u ? "success" : "primary",
|
|
2734
2724
|
size: "sm",
|
|
2735
2725
|
showValue: !0,
|
|
2736
|
-
formatValue: () => _(
|
|
2726
|
+
formatValue: () => _(a, i),
|
|
2737
2727
|
"aria-label": t
|
|
2738
2728
|
}
|
|
2739
2729
|
);
|
|
2740
|
-
},
|
|
2741
|
-
function
|
|
2730
|
+
}, Ti = [];
|
|
2731
|
+
function Mi(a, i) {
|
|
2742
2732
|
if (i === "wishlist")
|
|
2743
|
-
return { value:
|
|
2744
|
-
const r =
|
|
2733
|
+
return { value: a.isPurchased ? 1 : 0, max: 1, complete: !!a.isPurchased };
|
|
2734
|
+
const r = a.quantityNeeded ?? 1, n = a.quantityContributed ?? 0;
|
|
2745
2735
|
return { value: n, max: r, complete: r > 0 && n >= r };
|
|
2746
2736
|
}
|
|
2747
|
-
const
|
|
2737
|
+
const oa = /* @__PURE__ */ te(
|
|
2748
2738
|
function(i, r) {
|
|
2749
|
-
const { t: n } =
|
|
2750
|
-
items: t =
|
|
2739
|
+
const { t: n } = ee(), {
|
|
2740
|
+
items: t = Ti,
|
|
2751
2741
|
kind: d = "registry",
|
|
2752
2742
|
mode: o = "owner",
|
|
2753
2743
|
currency: u = "PLN",
|
|
@@ -2757,8 +2747,8 @@ const la = /* @__PURE__ */ te(
|
|
|
2757
2747
|
currentUserName: m,
|
|
2758
2748
|
onContribute: h,
|
|
2759
2749
|
onClaim: z,
|
|
2760
|
-
onUnclaim:
|
|
2761
|
-
onItemAdd:
|
|
2750
|
+
onUnclaim: v,
|
|
2751
|
+
onItemAdd: g,
|
|
2762
2752
|
onItemDelete: P,
|
|
2763
2753
|
onItemClick: k,
|
|
2764
2754
|
layout: T = "grid",
|
|
@@ -2767,50 +2757,50 @@ const la = /* @__PURE__ */ te(
|
|
|
2767
2757
|
size: A = "md",
|
|
2768
2758
|
className: y,
|
|
2769
2759
|
style: M
|
|
2770
|
-
} = i, w =
|
|
2760
|
+
} = i, w = qn({ currentUserId: l, currentUserName: m }), [N, x] = D(null), [B, X] = D(0), [E, R] = D(""), q = o === "owner", C = f || p, b = d === "wishlist", L = F(() => b ? [...t].sort(
|
|
2771
2761
|
(I, V) => Number(I.isPurchased ?? !1) - Number(V.isPurchased ?? !1) || (V.priority ?? 0) - (I.priority ?? 0)
|
|
2772
|
-
) : t, [t, b]),
|
|
2762
|
+
) : t, [t, b]), j = () => {
|
|
2773
2763
|
x(null), X(0);
|
|
2774
|
-
},
|
|
2764
|
+
}, W = (I) => {
|
|
2775
2765
|
!h || !w.canAct || (h(I.id, {
|
|
2776
|
-
amount:
|
|
2777
|
-
quantity:
|
|
2766
|
+
amount: B > 0 ? B : void 0,
|
|
2767
|
+
quantity: B > 0 ? void 0 : 1,
|
|
2778
2768
|
userName: w.actor.userName,
|
|
2779
2769
|
userId: w.actor.userId
|
|
2780
|
-
}),
|
|
2770
|
+
}), j());
|
|
2781
2771
|
};
|
|
2782
2772
|
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-gift-registry ${y ?? ""}`, style: M, children: /* @__PURE__ */ e(
|
|
2783
2773
|
Ne,
|
|
2784
2774
|
{
|
|
2785
|
-
icon: /* @__PURE__ */ e(
|
|
2775
|
+
icon: /* @__PURE__ */ e(It, { size: 28 }),
|
|
2786
2776
|
title: b ? n("giftRegistry.emptyWishlist", "Nothing on the wishlist yet") : n("giftRegistry.emptyRegistry", "No gifts on the registry yet"),
|
|
2787
|
-
description:
|
|
2777
|
+
description: q ? n("giftRegistry.emptyOwnerHint", "Add what you would like and share the link.") : n("giftRegistry.emptyGuestHint", "The host has not added anything yet.")
|
|
2788
2778
|
}
|
|
2789
|
-
) }) : /* @__PURE__ */
|
|
2779
|
+
) }) : /* @__PURE__ */ s(
|
|
2790
2780
|
"div",
|
|
2791
2781
|
{
|
|
2792
2782
|
ref: r,
|
|
2793
2783
|
className: `nice-gift-registry nice-gift-registry--${d} nice-gift-registry--${T} nice-gift-registry--${A} ${y ?? ""}`,
|
|
2794
2784
|
style: M,
|
|
2795
2785
|
children: [
|
|
2796
|
-
!
|
|
2797
|
-
|
|
2786
|
+
!q && w.isAnonymous && (h || z) && /* @__PURE__ */ e(
|
|
2787
|
+
J,
|
|
2798
2788
|
{
|
|
2799
2789
|
label: n("giftRegistry.yourName", "Your name"),
|
|
2800
2790
|
value: w.name,
|
|
2801
2791
|
onChange: w.setName,
|
|
2802
2792
|
placeholder: n("giftRegistry.soTheHostKnowsWho", "So the host knows who to thank"),
|
|
2803
2793
|
required: !0,
|
|
2804
|
-
disabled:
|
|
2794
|
+
disabled: C,
|
|
2805
2795
|
size: A
|
|
2806
2796
|
}
|
|
2807
2797
|
),
|
|
2808
|
-
/* @__PURE__ */ e(
|
|
2809
|
-
const { value: V, max: G, complete:
|
|
2810
|
-
return /* @__PURE__ */
|
|
2798
|
+
/* @__PURE__ */ e(Un, { columns: T === "list" ? 1 : void 0, minColumnWidth: 240, gap: 12, children: L.map((I) => {
|
|
2799
|
+
const { value: V, max: G, complete: ne } = Mi(I, d), Y = I.price, ie = I.contributions ?? [];
|
|
2800
|
+
return /* @__PURE__ */ s(
|
|
2811
2801
|
"div",
|
|
2812
2802
|
{
|
|
2813
|
-
className: `nice-gift-registry__item${
|
|
2803
|
+
className: `nice-gift-registry__item${ne ? " nice-gift-registry__item--complete" : ""}`,
|
|
2814
2804
|
children: [
|
|
2815
2805
|
I.imageUrl && /* @__PURE__ */ e(
|
|
2816
2806
|
"img",
|
|
@@ -2821,7 +2811,7 @@ const la = /* @__PURE__ */ te(
|
|
|
2821
2811
|
loading: "lazy"
|
|
2822
2812
|
}
|
|
2823
2813
|
),
|
|
2824
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ s("div", { className: "nice-gift-registry__body", children: [
|
|
2825
2815
|
/* @__PURE__ */ e(
|
|
2826
2816
|
"button",
|
|
2827
2817
|
{
|
|
@@ -2833,15 +2823,15 @@ const la = /* @__PURE__ */ te(
|
|
|
2833
2823
|
}
|
|
2834
2824
|
),
|
|
2835
2825
|
I.description && /* @__PURE__ */ e("p", { className: "nice-gift-registry__description", children: I.description }),
|
|
2836
|
-
/* @__PURE__ */
|
|
2837
|
-
|
|
2838
|
-
b && (I.priority ?? 0) > 0 && /* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */ e(
|
|
2826
|
+
/* @__PURE__ */ s("div", { className: "nice-gift-registry__facts", children: [
|
|
2827
|
+
Y && /* @__PURE__ */ e("span", { className: "nice-gift-registry__price", children: ce(Y.amount, Y.currency || u, _) }),
|
|
2828
|
+
b && (I.priority ?? 0) > 0 && /* @__PURE__ */ s(ae, { size: "xs", subtle: !0, variant: "warning", children: [
|
|
2829
|
+
/* @__PURE__ */ e(Pt, { size: 11 }),
|
|
2840
2830
|
" ",
|
|
2841
2831
|
I.priority
|
|
2842
2832
|
] }),
|
|
2843
|
-
|
|
2844
|
-
I.url && /* @__PURE__ */
|
|
2833
|
+
ne && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "success", children: b ? n("giftRegistry.bought", "bought") : n("giftRegistry.fullyCovered", "fully covered") }),
|
|
2834
|
+
I.url && /* @__PURE__ */ s(
|
|
2845
2835
|
"a",
|
|
2846
2836
|
{
|
|
2847
2837
|
className: "nice-gift-registry__link",
|
|
@@ -2849,7 +2839,7 @@ const la = /* @__PURE__ */ te(
|
|
|
2849
2839
|
target: "_blank",
|
|
2850
2840
|
rel: "noopener noreferrer",
|
|
2851
2841
|
children: [
|
|
2852
|
-
/* @__PURE__ */ e(
|
|
2842
|
+
/* @__PURE__ */ e(zt, { size: 13 }),
|
|
2853
2843
|
" ",
|
|
2854
2844
|
n("giftRegistry.shop", "Shop")
|
|
2855
2845
|
]
|
|
@@ -2857,56 +2847,56 @@ const la = /* @__PURE__ */ te(
|
|
|
2857
2847
|
)
|
|
2858
2848
|
] }),
|
|
2859
2849
|
!b && /* @__PURE__ */ e(
|
|
2860
|
-
|
|
2850
|
+
Ai,
|
|
2861
2851
|
{
|
|
2862
2852
|
value: V,
|
|
2863
2853
|
max: G,
|
|
2864
2854
|
label: n("giftRegistry.covered", "{name}: {value} of {max} covered").replace("{name}", I.title).replace("{value}", String(V)).replace("{max}", String(G))
|
|
2865
2855
|
}
|
|
2866
2856
|
),
|
|
2867
|
-
!c && ie.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-gift-registry__contributors", children: ie.map((
|
|
2868
|
-
/* @__PURE__ */ e("strong", { children:
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2857
|
+
!c && ie.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-gift-registry__contributors", children: ie.map((Z) => /* @__PURE__ */ s("li", { className: "nice-gift-registry__contributor", children: [
|
|
2858
|
+
/* @__PURE__ */ e("strong", { children: Z.contributorName }),
|
|
2859
|
+
Z.amount !== void 0 && ` — ${ce(Z.amount, (Y == null ? void 0 : Y.currency) || u, _)}`,
|
|
2860
|
+
Z.amount === void 0 && Z.quantity ? ` — ${Z.quantity}×` : "",
|
|
2861
|
+
Z.message && /* @__PURE__ */ s("em", { children: [
|
|
2872
2862
|
" “",
|
|
2873
|
-
|
|
2863
|
+
Z.message,
|
|
2874
2864
|
"”"
|
|
2875
2865
|
] })
|
|
2876
|
-
] },
|
|
2877
|
-
/* @__PURE__ */
|
|
2878
|
-
!
|
|
2866
|
+
] }, Z.id)) }),
|
|
2867
|
+
/* @__PURE__ */ s("div", { className: "nice-gift-registry__actions", children: [
|
|
2868
|
+
!q && !ne && z && /* @__PURE__ */ e(
|
|
2879
2869
|
U,
|
|
2880
2870
|
{
|
|
2881
2871
|
size: "sm",
|
|
2882
2872
|
variant: "primary",
|
|
2883
|
-
disabled:
|
|
2873
|
+
disabled: C || !w.canAct,
|
|
2884
2874
|
leftIcon: /* @__PURE__ */ e(je, { size: 14 }),
|
|
2885
2875
|
onClick: () => z(I.id, { ...w.actor, quantity: 1 }),
|
|
2886
|
-
children: "I'll take this"
|
|
2876
|
+
children: n("giftRegistry.illTakeThis", "I'll take this")
|
|
2887
2877
|
}
|
|
2888
2878
|
),
|
|
2889
|
-
!
|
|
2879
|
+
!q && ne && v && /* @__PURE__ */ e(
|
|
2890
2880
|
U,
|
|
2891
2881
|
{
|
|
2892
2882
|
size: "sm",
|
|
2893
2883
|
variant: "ghost",
|
|
2894
|
-
disabled:
|
|
2895
|
-
onClick: () =>
|
|
2884
|
+
disabled: C,
|
|
2885
|
+
onClick: () => v(I.id),
|
|
2896
2886
|
children: n("giftRegistry.release", "Release")
|
|
2897
2887
|
}
|
|
2898
2888
|
),
|
|
2899
|
-
!
|
|
2889
|
+
!q && !ne && !b && h && /* @__PURE__ */ e(
|
|
2900
2890
|
U,
|
|
2901
2891
|
{
|
|
2902
2892
|
size: "sm",
|
|
2903
2893
|
variant: "outline",
|
|
2904
|
-
disabled:
|
|
2894
|
+
disabled: C || !w.canAct,
|
|
2905
2895
|
onClick: () => x(N === I.id ? null : I.id),
|
|
2906
2896
|
children: n("giftRegistry.chipIn", "Chip in")
|
|
2907
2897
|
}
|
|
2908
2898
|
),
|
|
2909
|
-
|
|
2899
|
+
q && P && !p && /* @__PURE__ */ e(
|
|
2910
2900
|
U,
|
|
2911
2901
|
{
|
|
2912
2902
|
size: "sm",
|
|
@@ -2917,25 +2907,24 @@ const la = /* @__PURE__ */ te(
|
|
|
2917
2907
|
),
|
|
2918
2908
|
disabled: f,
|
|
2919
2909
|
onClick: () => P(I.id),
|
|
2920
|
-
children: /* @__PURE__ */ e(
|
|
2910
|
+
children: /* @__PURE__ */ e(De, { size: 14 })
|
|
2921
2911
|
}
|
|
2922
2912
|
)
|
|
2923
2913
|
] }),
|
|
2924
|
-
N === I.id && /* @__PURE__ */
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
"
|
|
2928
|
-
(
|
|
2929
|
-
|
|
2930
|
-
] }),
|
|
2914
|
+
N === I.id && /* @__PURE__ */ s("div", { className: "nice-gift-registry__pledge", children: [
|
|
2915
|
+
/* @__PURE__ */ s("label", { className: "nice-gift-registry__pledge-field", children: [
|
|
2916
|
+
/* @__PURE__ */ e("span", { children: n("giftRegistry.amount", "Amount ({currency})").replace(
|
|
2917
|
+
"{currency}",
|
|
2918
|
+
String((Y == null ? void 0 : Y.currency) || u)
|
|
2919
|
+
) }),
|
|
2931
2920
|
/* @__PURE__ */ e(
|
|
2932
2921
|
dn,
|
|
2933
2922
|
{
|
|
2934
|
-
value:
|
|
2935
|
-
onChange: (
|
|
2923
|
+
value: B,
|
|
2924
|
+
onChange: (Z) => X(Math.max(0, Z ?? 0)),
|
|
2936
2925
|
min: 0,
|
|
2937
2926
|
size: "xs",
|
|
2938
|
-
disabled:
|
|
2927
|
+
disabled: C
|
|
2939
2928
|
}
|
|
2940
2929
|
)
|
|
2941
2930
|
] }),
|
|
@@ -2944,12 +2933,12 @@ const la = /* @__PURE__ */ te(
|
|
|
2944
2933
|
{
|
|
2945
2934
|
size: "sm",
|
|
2946
2935
|
variant: "primary",
|
|
2947
|
-
disabled:
|
|
2948
|
-
onClick: () =>
|
|
2936
|
+
disabled: C || !w.canAct,
|
|
2937
|
+
onClick: () => W(I),
|
|
2949
2938
|
children: n("giftRegistry.confirm", "Confirm")
|
|
2950
2939
|
}
|
|
2951
2940
|
),
|
|
2952
|
-
/* @__PURE__ */ e(U, { size: "sm", variant: "ghost", onClick:
|
|
2941
|
+
/* @__PURE__ */ e(U, { size: "sm", variant: "ghost", onClick: j, children: n("giftRegistry.cancel", "Cancel") })
|
|
2953
2942
|
] })
|
|
2954
2943
|
] })
|
|
2955
2944
|
]
|
|
@@ -2957,13 +2946,13 @@ const la = /* @__PURE__ */ te(
|
|
|
2957
2946
|
I.id
|
|
2958
2947
|
);
|
|
2959
2948
|
}) }),
|
|
2960
|
-
|
|
2949
|
+
q && g && !p && /* @__PURE__ */ s("div", { className: "nice-gift-registry__add", children: [
|
|
2961
2950
|
/* @__PURE__ */ e(
|
|
2962
|
-
|
|
2951
|
+
J,
|
|
2963
2952
|
{
|
|
2964
2953
|
label: b ? n("giftRegistry.addAWish", "Add a wish") : n("giftRegistry.addAGift", "Add a gift"),
|
|
2965
2954
|
value: E,
|
|
2966
|
-
onChange:
|
|
2955
|
+
onChange: R,
|
|
2967
2956
|
placeholder: n("giftRegistry.whatWouldYouLike", "What would you like?"),
|
|
2968
2957
|
disabled: f,
|
|
2969
2958
|
size: A
|
|
@@ -2977,9 +2966,9 @@ const la = /* @__PURE__ */ te(
|
|
|
2977
2966
|
leftIcon: /* @__PURE__ */ e(an, { size: 15 }),
|
|
2978
2967
|
disabled: f || !E.trim(),
|
|
2979
2968
|
onClick: () => {
|
|
2980
|
-
|
|
2969
|
+
g({ title: E.trim(), quantityNeeded: 1 }), R("");
|
|
2981
2970
|
},
|
|
2982
|
-
children: "Add"
|
|
2971
|
+
children: n("giftRegistry.add", "Add")
|
|
2983
2972
|
}
|
|
2984
2973
|
)
|
|
2985
2974
|
] })
|
|
@@ -2988,25 +2977,25 @@ const la = /* @__PURE__ */ te(
|
|
|
2988
2977
|
);
|
|
2989
2978
|
}
|
|
2990
2979
|
);
|
|
2991
|
-
function
|
|
2980
|
+
function Li(a) {
|
|
2992
2981
|
const i = /* @__PURE__ */ new Map();
|
|
2993
|
-
for (const r of
|
|
2982
|
+
for (const r of a) {
|
|
2994
2983
|
const n = (r.currency || "").toUpperCase(), t = i.get(n);
|
|
2995
2984
|
t ? t.push(r) : i.set(n, [r]);
|
|
2996
2985
|
}
|
|
2997
2986
|
return i;
|
|
2998
2987
|
}
|
|
2999
|
-
function $i(
|
|
2988
|
+
function $i(a, i, r) {
|
|
3000
2989
|
var _;
|
|
3001
2990
|
const n = new Set(i.map((c) => c.id)), t = i.map((c) => c.id), d = new Map(t.map((c) => [c, 0])), o = [];
|
|
3002
2991
|
let u = 0;
|
|
3003
2992
|
if (t.length === 0)
|
|
3004
2993
|
return {
|
|
3005
2994
|
balances: d,
|
|
3006
|
-
issues:
|
|
2995
|
+
issues: a.map((c) => ({ itemId: c.id, reason: "no-participants" })),
|
|
3007
2996
|
totalMinor: 0
|
|
3008
2997
|
};
|
|
3009
|
-
for (const c of
|
|
2998
|
+
for (const c of a) {
|
|
3010
2999
|
const l = c.paidById;
|
|
3011
3000
|
if (!l) {
|
|
3012
3001
|
o.push({ itemId: c.id, reason: "no-payer" });
|
|
@@ -3018,15 +3007,15 @@ function $i(s, i, r) {
|
|
|
3018
3007
|
}
|
|
3019
3008
|
let m = (_ = c.splitAmong) != null && _.length ? c.splitAmong.filter((k) => n.has(k)) : t;
|
|
3020
3009
|
m.length === 0 && (m = t);
|
|
3021
|
-
const h =
|
|
3010
|
+
const h = pn(c.amount, r);
|
|
3022
3011
|
u += h;
|
|
3023
|
-
const z = m.length,
|
|
3024
|
-
if (
|
|
3012
|
+
const z = m.length, v = Math.floor(h / z), g = h - v * z, P = new Map(m.map((k) => [k, v]));
|
|
3013
|
+
if (g !== 0)
|
|
3025
3014
|
if (P.has(l))
|
|
3026
|
-
P.set(l, (P.get(l) ?? 0) +
|
|
3015
|
+
P.set(l, (P.get(l) ?? 0) + g);
|
|
3027
3016
|
else {
|
|
3028
|
-
const k = [...m].sort(
|
|
3029
|
-
for (let f = 0; f < Math.abs(
|
|
3017
|
+
const k = [...m].sort(We), T = g > 0 ? 1 : -1;
|
|
3018
|
+
for (let f = 0; f < Math.abs(g); f += 1) {
|
|
3030
3019
|
const p = k[f % k.length];
|
|
3031
3020
|
P.set(p, (P.get(p) ?? 0) + T);
|
|
3032
3021
|
}
|
|
@@ -3037,16 +3026,16 @@ function $i(s, i, r) {
|
|
|
3037
3026
|
}
|
|
3038
3027
|
return { balances: d, issues: o, totalMinor: u };
|
|
3039
3028
|
}
|
|
3040
|
-
function
|
|
3029
|
+
function Ri(a, i, r) {
|
|
3041
3030
|
for (const n of i) {
|
|
3042
|
-
if ((n.currency || "").toUpperCase() !== r || !
|
|
3031
|
+
if ((n.currency || "").toUpperCase() !== r || !a.has(n.fromId) || !a.has(n.toId))
|
|
3043
3032
|
continue;
|
|
3044
|
-
const t =
|
|
3045
|
-
|
|
3033
|
+
const t = pn(n.amount, r);
|
|
3034
|
+
a.set(n.fromId, (a.get(n.fromId) ?? 0) + t), a.set(n.toId, (a.get(n.toId) ?? 0) - t);
|
|
3046
3035
|
}
|
|
3047
3036
|
}
|
|
3048
|
-
function Di(
|
|
3049
|
-
const n = new Map(i.map((c) => [c.id, c.name])), t = [...
|
|
3037
|
+
function Di(a, i, r) {
|
|
3038
|
+
const n = new Map(i.map((c) => [c.id, c.name])), t = [...a.entries()].filter(([, c]) => c > 0).map(([c, l]) => ({ id: c, v: l })).sort((c, l) => l.v - c.v || We(c.id, l.id)), d = [...a.entries()].filter(([, c]) => c < 0).map(([c, l]) => ({ id: c, v: l })).sort((c, l) => c.v - l.v || We(c.id, l.id)), o = [];
|
|
3050
3039
|
let u = 0, _ = 0;
|
|
3051
3040
|
for (; u < d.length && _ < t.length; ) {
|
|
3052
3041
|
const c = Math.min(-d[u].v, t[_].v);
|
|
@@ -3055,23 +3044,23 @@ function Di(s, i, r) {
|
|
|
3055
3044
|
fromName: n.get(d[u].id) ?? d[u].id,
|
|
3056
3045
|
toId: t[_].id,
|
|
3057
3046
|
toName: n.get(t[_].id) ?? t[_].id,
|
|
3058
|
-
amount:
|
|
3047
|
+
amount: qe(c, r),
|
|
3059
3048
|
currency: r
|
|
3060
3049
|
}), d[u].v += c, t[_].v -= c, d[u].v === 0 && (u += 1), t[_].v === 0 && (_ += 1);
|
|
3061
3050
|
}
|
|
3062
3051
|
return o;
|
|
3063
3052
|
}
|
|
3064
|
-
function
|
|
3065
|
-
const n = [], t = [], d = [...
|
|
3053
|
+
function Ei(a, i, r = []) {
|
|
3054
|
+
const n = [], t = [], d = [...Li(a).entries()].sort(([o], [u]) => We(o, u));
|
|
3066
3055
|
for (const [o, u] of d) {
|
|
3067
3056
|
const _ = $i(u, i, o);
|
|
3068
|
-
t.push(..._.issues),
|
|
3057
|
+
t.push(..._.issues), Ri(_.balances, r, o), n.push({
|
|
3069
3058
|
currency: o,
|
|
3070
|
-
total:
|
|
3059
|
+
total: qe(_.totalMinor, o),
|
|
3071
3060
|
balances: i.map((c) => ({
|
|
3072
3061
|
participantId: c.id,
|
|
3073
3062
|
participantName: c.name,
|
|
3074
|
-
amount:
|
|
3063
|
+
amount: qe(_.balances.get(c.id) ?? 0, o),
|
|
3075
3064
|
currency: o
|
|
3076
3065
|
})),
|
|
3077
3066
|
transfers: Di(_.balances, i, o)
|
|
@@ -3079,14 +3068,14 @@ function Ri(s, i, r = []) {
|
|
|
3079
3068
|
}
|
|
3080
3069
|
return { groups: n, issues: t };
|
|
3081
3070
|
}
|
|
3082
|
-
function
|
|
3083
|
-
return
|
|
3071
|
+
function We(a, i) {
|
|
3072
|
+
return a < i ? -1 : a > i ? 1 : 0;
|
|
3084
3073
|
}
|
|
3085
|
-
const
|
|
3074
|
+
const Oi = [], Bi = [], da = /* @__PURE__ */ te(
|
|
3086
3075
|
function(i, r) {
|
|
3087
|
-
const { t: n } =
|
|
3088
|
-
items: t =
|
|
3089
|
-
participants: d =
|
|
3076
|
+
const { t: n } = ee(), {
|
|
3077
|
+
items: t = Oi,
|
|
3078
|
+
participants: d = Bi,
|
|
3090
3079
|
settlements: o = [],
|
|
3091
3080
|
view: u,
|
|
3092
3081
|
defaultView: _ = "expenses",
|
|
@@ -3095,45 +3084,45 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3095
3084
|
onItemDelete: m,
|
|
3096
3085
|
onItemClick: h,
|
|
3097
3086
|
onValidationChange: z,
|
|
3098
|
-
sortBy:
|
|
3099
|
-
locale:
|
|
3087
|
+
sortBy: v = "date",
|
|
3088
|
+
locale: g,
|
|
3100
3089
|
disabled: P = !1,
|
|
3101
3090
|
readOnly: k = !1,
|
|
3102
3091
|
size: T = "md",
|
|
3103
3092
|
className: f,
|
|
3104
3093
|
style: p
|
|
3105
|
-
} = i, [A, y] =
|
|
3106
|
-
() => d.map((
|
|
3094
|
+
} = i, [A, y] = D(_), M = u ?? A, w = P || k, N = F(
|
|
3095
|
+
() => d.map((C) => ({ id: C.id, name: C.name })),
|
|
3107
3096
|
[d]
|
|
3108
|
-
), x = F(() =>
|
|
3109
|
-
if (
|
|
3110
|
-
return b.item.amount -
|
|
3111
|
-
const
|
|
3112
|
-
return
|
|
3113
|
-
}).map((
|
|
3114
|
-
|
|
3097
|
+
), x = F(() => Ei(t, N, o), [t, N, o]), B = F(() => v === "none" ? t : t.map((C, b) => ({ item: C, index: b })).sort((C, b) => {
|
|
3098
|
+
if (v === "amount")
|
|
3099
|
+
return b.item.amount - C.item.amount || C.index - b.index;
|
|
3100
|
+
const L = C.item.incurredAt, j = b.item.incurredAt;
|
|
3101
|
+
return L && j ? L.localeCompare(j) || C.index - b.index : L ? -1 : j ? 1 : C.index - b.index;
|
|
3102
|
+
}).map((C) => C.item), [t, v]), X = x.issues.map((C) => `${C.itemId}:${C.reason}`).join("|");
|
|
3103
|
+
Re.useEffect(() => {
|
|
3115
3104
|
z == null || z(x.issues);
|
|
3116
3105
|
}, [X]);
|
|
3117
3106
|
const E = F(
|
|
3118
|
-
() => new Map(d.map((
|
|
3107
|
+
() => new Map(d.map((C) => [C.id, C.avatarUrl])),
|
|
3119
3108
|
[d]
|
|
3120
|
-
),
|
|
3121
|
-
() => new Map(x.issues.map((
|
|
3109
|
+
), R = F(
|
|
3110
|
+
() => new Map(x.issues.map((C) => [C.itemId, C.reason])),
|
|
3122
3111
|
[x.issues]
|
|
3123
|
-
),
|
|
3124
|
-
u === void 0 && y(
|
|
3112
|
+
), q = (C) => {
|
|
3113
|
+
u === void 0 && y(C), c == null || c(C);
|
|
3125
3114
|
};
|
|
3126
3115
|
return t.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-expense-split ${f ?? ""}`, style: p, children: /* @__PURE__ */ e(
|
|
3127
3116
|
Ne,
|
|
3128
3117
|
{
|
|
3129
|
-
icon: /* @__PURE__ */ e(
|
|
3118
|
+
icon: /* @__PURE__ */ e(At, { size: 28 }),
|
|
3130
3119
|
title: n("expenseSplit.noExpensesYet", "No expenses yet"),
|
|
3131
3120
|
description: n(
|
|
3132
3121
|
"expenseSplit.addWhatPeoplePaidFor",
|
|
3133
3122
|
"Add what people paid for and this will work out who owes whom."
|
|
3134
3123
|
)
|
|
3135
3124
|
}
|
|
3136
|
-
) }) : /* @__PURE__ */
|
|
3125
|
+
) }) : /* @__PURE__ */ s(
|
|
3137
3126
|
"div",
|
|
3138
3127
|
{
|
|
3139
3128
|
ref: r,
|
|
@@ -3141,11 +3130,11 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3141
3130
|
style: p,
|
|
3142
3131
|
children: [
|
|
3143
3132
|
/* @__PURE__ */ e(
|
|
3144
|
-
|
|
3133
|
+
Vn,
|
|
3145
3134
|
{
|
|
3146
3135
|
size: T,
|
|
3147
3136
|
value: M,
|
|
3148
|
-
onChange: (
|
|
3137
|
+
onChange: (C) => q(C),
|
|
3149
3138
|
options: [
|
|
3150
3139
|
{ value: "expenses", label: n("expenseSplit.expenses", "Expenses") },
|
|
3151
3140
|
{ value: "balances", label: n("expenseSplit.balances", "Balances") },
|
|
@@ -3153,32 +3142,32 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3153
3142
|
]
|
|
3154
3143
|
}
|
|
3155
3144
|
),
|
|
3156
|
-
M === "expenses" && /* @__PURE__ */ e("ul", { className: "nice-expense-split__items", children:
|
|
3157
|
-
const b =
|
|
3158
|
-
return /* @__PURE__ */
|
|
3145
|
+
M === "expenses" && /* @__PURE__ */ e("ul", { className: "nice-expense-split__items", children: B.map((C) => {
|
|
3146
|
+
const b = R.get(C.id);
|
|
3147
|
+
return /* @__PURE__ */ s(
|
|
3159
3148
|
"li",
|
|
3160
3149
|
{
|
|
3161
3150
|
className: `nice-expense-split__item${b ? " nice-expense-split__item--excluded" : ""}`,
|
|
3162
3151
|
children: [
|
|
3163
|
-
/* @__PURE__ */
|
|
3152
|
+
/* @__PURE__ */ s(
|
|
3164
3153
|
"button",
|
|
3165
3154
|
{
|
|
3166
3155
|
type: "button",
|
|
3167
3156
|
className: "nice-expense-split__item-main",
|
|
3168
|
-
onClick: () => h == null ? void 0 : h(
|
|
3157
|
+
onClick: () => h == null ? void 0 : h(C),
|
|
3169
3158
|
disabled: !h,
|
|
3170
3159
|
children: [
|
|
3171
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-label", children:
|
|
3172
|
-
/* @__PURE__ */
|
|
3173
|
-
|
|
3174
|
-
"
|
|
3175
|
-
|
|
3160
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-label", children: C.label }),
|
|
3161
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-payer", children: n("expenseSplit.paidBy", "{payer} paid").replace(
|
|
3162
|
+
"{payer}",
|
|
3163
|
+
C.paidByName ?? C.paidById ?? n("expenseSplit.nobody", "nobody")
|
|
3164
|
+
) })
|
|
3176
3165
|
]
|
|
3177
3166
|
}
|
|
3178
3167
|
),
|
|
3179
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-amount", children: ce(
|
|
3180
|
-
|
|
3181
|
-
b && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "warning", children: b === "no-payer" ? "no payer" : "unknown payer" }),
|
|
3168
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-amount", children: ce(C.amount, C.currency, g) }),
|
|
3169
|
+
C.isPaid && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "success", children: n("expenseSplit.paid", "paid") }),
|
|
3170
|
+
b && /* @__PURE__ */ e(ae, { size: "xs", subtle: !0, variant: "warning", children: b === "no-payer" ? n("expenseSplit.noPayer", "no payer") : n("expenseSplit.unknownPayer", "unknown payer") }),
|
|
3182
3171
|
m && !k && /* @__PURE__ */ e(
|
|
3183
3172
|
U,
|
|
3184
3173
|
{
|
|
@@ -3186,27 +3175,27 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3186
3175
|
variant: "ghost",
|
|
3187
3176
|
ariaLabel: n("expenseSplit.deleteItem", "Delete {name}").replace(
|
|
3188
3177
|
"{name}",
|
|
3189
|
-
|
|
3178
|
+
C.label
|
|
3190
3179
|
),
|
|
3191
3180
|
disabled: P,
|
|
3192
|
-
onClick: () => m(
|
|
3193
|
-
children: /* @__PURE__ */ e(
|
|
3181
|
+
onClick: () => m(C.id),
|
|
3182
|
+
children: /* @__PURE__ */ e(De, { size: 14 })
|
|
3194
3183
|
}
|
|
3195
3184
|
)
|
|
3196
3185
|
]
|
|
3197
3186
|
},
|
|
3198
|
-
|
|
3187
|
+
C.id
|
|
3199
3188
|
);
|
|
3200
3189
|
}) }),
|
|
3201
|
-
M === "balances" && x.groups.map((
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
|
|
3204
|
-
/* @__PURE__ */
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3190
|
+
M === "balances" && x.groups.map((C) => /* @__PURE__ */ s("section", { className: "nice-expense-split__group", children: [
|
|
3191
|
+
/* @__PURE__ */ s("h4", { className: "nice-expense-split__group-title", children: [
|
|
3192
|
+
C.currency,
|
|
3193
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__group-total", children: n("expenseSplit.total", "{amount} total").replace(
|
|
3194
|
+
"{amount}",
|
|
3195
|
+
String(ce(C.total, C.currency, g))
|
|
3196
|
+
) })
|
|
3208
3197
|
] }),
|
|
3209
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children:
|
|
3198
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: C.balances.map((b) => /* @__PURE__ */ e(
|
|
3210
3199
|
nn,
|
|
3211
3200
|
{
|
|
3212
3201
|
participant: {
|
|
@@ -3217,49 +3206,57 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3217
3206
|
showRole: !1,
|
|
3218
3207
|
showStatus: !1,
|
|
3219
3208
|
size: T,
|
|
3220
|
-
children: /* @__PURE__ */
|
|
3209
|
+
children: /* @__PURE__ */ s(
|
|
3221
3210
|
"span",
|
|
3222
3211
|
{
|
|
3223
3212
|
className: `nice-expense-split__balance nice-expense-split__balance--${b.amount > 0 ? "owed" : b.amount < 0 ? "owes" : "settled"}`,
|
|
3224
3213
|
children: [
|
|
3225
|
-
b.amount === 0 ? "settled up" : ce(Math.abs(b.amount), b.currency,
|
|
3226
|
-
b.amount > 0 && /* @__PURE__ */
|
|
3227
|
-
|
|
3214
|
+
b.amount === 0 ? n("expenseSplit.settledUp", "settled up") : ce(Math.abs(b.amount), b.currency, g),
|
|
3215
|
+
b.amount > 0 && /* @__PURE__ */ s("em", { children: [
|
|
3216
|
+
" ",
|
|
3217
|
+
n("expenseSplit.isOwed", "is owed")
|
|
3218
|
+
] }),
|
|
3219
|
+
b.amount < 0 && /* @__PURE__ */ s("em", { children: [
|
|
3220
|
+
" ",
|
|
3221
|
+
n("expenseSplit.owes", "owes")
|
|
3222
|
+
] })
|
|
3228
3223
|
]
|
|
3229
3224
|
}
|
|
3230
3225
|
)
|
|
3231
3226
|
},
|
|
3232
3227
|
b.participantId
|
|
3233
3228
|
)) })
|
|
3234
|
-
] },
|
|
3235
|
-
M === "settlement" && (x.groups.every((
|
|
3229
|
+
] }, C.currency)),
|
|
3230
|
+
M === "settlement" && (x.groups.every((C) => C.transfers.length === 0) ? /* @__PURE__ */ e(
|
|
3236
3231
|
Ne,
|
|
3237
3232
|
{
|
|
3238
|
-
icon: /* @__PURE__ */ e(
|
|
3233
|
+
icon: /* @__PURE__ */ e(Tt, { size: 28 }),
|
|
3239
3234
|
title: n("expenseSplit.allSettledUp", "All settled up"),
|
|
3240
3235
|
description: n(
|
|
3241
3236
|
"expenseSplit.nobodyOwesAnybodyAnything",
|
|
3242
3237
|
"Nobody owes anybody anything."
|
|
3243
3238
|
)
|
|
3244
3239
|
}
|
|
3245
|
-
) : x.groups.filter((
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
|
|
3248
|
-
/* @__PURE__ */
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3240
|
+
) : x.groups.filter((C) => C.transfers.length > 0).map((C) => /* @__PURE__ */ s("section", { className: "nice-expense-split__group", children: [
|
|
3241
|
+
/* @__PURE__ */ s("h4", { className: "nice-expense-split__group-title", children: [
|
|
3242
|
+
C.currency,
|
|
3243
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__group-total", children: C.transfers.length === 1 ? n("expenseSplit.transfersOne", "{transfers} transfer").replace(
|
|
3244
|
+
"{transfers}",
|
|
3245
|
+
String(C.transfers.length)
|
|
3246
|
+
) : n("expenseSplit.transfersMany", "{transfers} transfers").replace(
|
|
3247
|
+
"{transfers}",
|
|
3248
|
+
String(C.transfers.length)
|
|
3249
|
+
) })
|
|
3253
3250
|
] }),
|
|
3254
|
-
/* @__PURE__ */ e("ul", { className: "nice-expense-split__transfers", children:
|
|
3251
|
+
/* @__PURE__ */ e("ul", { className: "nice-expense-split__transfers", children: C.transfers.map((b) => /* @__PURE__ */ s(
|
|
3255
3252
|
"li",
|
|
3256
3253
|
{
|
|
3257
3254
|
className: "nice-expense-split__transfer",
|
|
3258
3255
|
children: [
|
|
3259
3256
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-from", children: b.fromName }),
|
|
3260
|
-
/* @__PURE__ */ e(
|
|
3257
|
+
/* @__PURE__ */ e(Mt, { size: 15 }),
|
|
3261
3258
|
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-to", children: b.toName }),
|
|
3262
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-amount", children: ce(b.amount, b.currency,
|
|
3259
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-amount", children: ce(b.amount, b.currency, g) }),
|
|
3263
3260
|
l && !k && /* @__PURE__ */ e(
|
|
3264
3261
|
U,
|
|
3265
3262
|
{
|
|
@@ -3274,28 +3271,28 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3274
3271
|
},
|
|
3275
3272
|
`${b.fromId}-${b.toId}-${b.amount}`
|
|
3276
3273
|
)) })
|
|
3277
|
-
] },
|
|
3274
|
+
] }, C.currency)))
|
|
3278
3275
|
]
|
|
3279
3276
|
}
|
|
3280
3277
|
);
|
|
3281
3278
|
}
|
|
3282
|
-
), Yi = [],
|
|
3283
|
-
upcoming:
|
|
3279
|
+
), Yi = [], Ui = {
|
|
3280
|
+
upcoming: En,
|
|
3284
3281
|
active: Ke,
|
|
3285
3282
|
voting: cn,
|
|
3286
|
-
scored:
|
|
3283
|
+
scored: Lt,
|
|
3287
3284
|
completed: je,
|
|
3288
3285
|
skipped: rn
|
|
3289
|
-
},
|
|
3286
|
+
}, Vi = {
|
|
3290
3287
|
upcoming: "#9ca3af",
|
|
3291
3288
|
active: "#22c55e",
|
|
3292
3289
|
voting: "#eab308",
|
|
3293
3290
|
scored: "#3b82f6",
|
|
3294
3291
|
completed: "#6b7280",
|
|
3295
3292
|
skipped: "#d1d5db"
|
|
3296
|
-
},
|
|
3293
|
+
}, ua = /* @__PURE__ */ te(
|
|
3297
3294
|
function(i, r) {
|
|
3298
|
-
const { t: n } =
|
|
3295
|
+
const { t: n } = ee(), {
|
|
3299
3296
|
rounds: t = Yi,
|
|
3300
3297
|
activeRoundId: d,
|
|
3301
3298
|
onSelect: o,
|
|
@@ -3305,78 +3302,83 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3305
3302
|
editable: l = !1,
|
|
3306
3303
|
className: m,
|
|
3307
3304
|
style: h
|
|
3308
|
-
} = i, z = [...t].sort((
|
|
3309
|
-
return /* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3312
|
-
"Rounds (",
|
|
3313
|
-
t.length,
|
|
3314
|
-
")"
|
|
3315
|
-
] }),
|
|
3305
|
+
} = i, z = [...t].sort((v, g) => v.order - g.order);
|
|
3306
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-round-list ${m ?? ""}`, style: h, children: [
|
|
3307
|
+
/* @__PURE__ */ s("div", { className: "nice-round-list__header", children: [
|
|
3308
|
+
/* @__PURE__ */ e("h3", { children: n("roundList.rounds", "Rounds ({rounds})").replace("{rounds}", String(t.length)) }),
|
|
3316
3309
|
l && c && /* @__PURE__ */ e("button", { onClick: c, children: n("roundList.addRound", "+ Add Round") })
|
|
3317
3310
|
] }),
|
|
3318
|
-
z.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: n("roundList.noRoundsYet", "No rounds yet.") }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: z.map((
|
|
3319
|
-
const
|
|
3320
|
-
return /* @__PURE__ */
|
|
3311
|
+
z.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: n("roundList.noRoundsYet", "No rounds yet.") }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: z.map((v) => {
|
|
3312
|
+
const g = v.id === d;
|
|
3313
|
+
return /* @__PURE__ */ s(
|
|
3321
3314
|
"div",
|
|
3322
3315
|
{
|
|
3323
|
-
|
|
3324
|
-
|
|
3316
|
+
onKeyDown: un,
|
|
3317
|
+
className: `nice-round-list__item ${g ? "nice-round-list__item--active" : ""}`,
|
|
3318
|
+
onClick: () => o == null ? void 0 : o(v),
|
|
3325
3319
|
role: o ? "button" : void 0,
|
|
3326
3320
|
tabIndex: o ? 0 : void 0,
|
|
3327
3321
|
children: [
|
|
3328
|
-
/* @__PURE__ */
|
|
3322
|
+
/* @__PURE__ */ s("span", { className: "nice-round-list__order", children: [
|
|
3329
3323
|
"#",
|
|
3330
|
-
|
|
3324
|
+
v.order
|
|
3331
3325
|
] }),
|
|
3332
3326
|
/* @__PURE__ */ e(
|
|
3333
3327
|
"span",
|
|
3334
3328
|
{
|
|
3335
3329
|
className: "nice-round-list__icon",
|
|
3336
|
-
title: n(`roundCard.status.${
|
|
3337
|
-
children:
|
|
3330
|
+
title: n(`roundCard.status.${v.status}`, v.status),
|
|
3331
|
+
children: Re.createElement(Ui[v.status], { size: 16 })
|
|
3338
3332
|
}
|
|
3339
3333
|
),
|
|
3340
|
-
/* @__PURE__ */
|
|
3341
|
-
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children:
|
|
3342
|
-
|
|
3343
|
-
|
|
3334
|
+
/* @__PURE__ */ s("div", { className: "nice-round-list__info", children: [
|
|
3335
|
+
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children: v.name }),
|
|
3336
|
+
v.description && /* @__PURE__ */ e("small", { children: v.description }),
|
|
3337
|
+
v.type && /* @__PURE__ */ e("span", { className: "nice-round-list__type", children: v.type })
|
|
3344
3338
|
] }),
|
|
3345
3339
|
/* @__PURE__ */ e(
|
|
3346
3340
|
"span",
|
|
3347
3341
|
{
|
|
3348
3342
|
className: "nice-round-list__status",
|
|
3349
|
-
style: { color:
|
|
3350
|
-
children: n(`roundCard.status.${
|
|
3343
|
+
style: { color: Vi[v.status] },
|
|
3344
|
+
children: n(`roundCard.status.${v.status}`, v.status)
|
|
3351
3345
|
}
|
|
3352
3346
|
),
|
|
3353
|
-
|
|
3354
|
-
|
|
3347
|
+
v.durationMinutes && /* @__PURE__ */ s("span", { className: "nice-round-list__duration", children: [
|
|
3348
|
+
v.durationMinutes,
|
|
3355
3349
|
"m"
|
|
3356
3350
|
] }),
|
|
3357
|
-
|
|
3351
|
+
v.winnerIds && v.winnerIds.length > 0 && /* @__PURE__ */ s("span", { className: "nice-round-list__winners", children: [
|
|
3358
3352
|
/* @__PURE__ */ e(ln, { size: 14 }),
|
|
3359
3353
|
" ",
|
|
3360
|
-
|
|
3354
|
+
v.winnerIds.length
|
|
3361
3355
|
] }),
|
|
3362
|
-
l && /* @__PURE__ */
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3356
|
+
l && /* @__PURE__ */ s(
|
|
3357
|
+
"div",
|
|
3358
|
+
{
|
|
3359
|
+
role: "presentation",
|
|
3360
|
+
className: "nice-round-list__actions",
|
|
3361
|
+
onClick: (P) => P.stopPropagation(),
|
|
3362
|
+
children: [
|
|
3363
|
+
v.status === "upcoming" && u && /* @__PURE__ */ e("button", { onClick: () => u(v.id), children: n("roundList.start", "Start") }),
|
|
3364
|
+
(v.status === "active" || v.status === "voting") && _ && /* @__PURE__ */ e("button", { onClick: () => _(v.id), children: n("roundList.end", "End") })
|
|
3365
|
+
]
|
|
3366
|
+
}
|
|
3367
|
+
)
|
|
3366
3368
|
]
|
|
3367
3369
|
},
|
|
3368
|
-
|
|
3370
|
+
v.id
|
|
3369
3371
|
);
|
|
3370
3372
|
}) })
|
|
3371
3373
|
] });
|
|
3372
3374
|
}
|
|
3373
|
-
),
|
|
3375
|
+
), Fi = [
|
|
3374
3376
|
"var(--nice-lb-gold, #facc15)",
|
|
3375
3377
|
"var(--nice-lb-silver, #cbd5e1)",
|
|
3376
3378
|
"var(--nice-lb-bronze, #d97706)"
|
|
3377
|
-
],
|
|
3379
|
+
], ma = /* @__PURE__ */ te(
|
|
3378
3380
|
function(i, r) {
|
|
3379
|
-
const { t: n } =
|
|
3381
|
+
const { t: n } = ee(), {
|
|
3380
3382
|
round: t,
|
|
3381
3383
|
timerRunning: d = !1,
|
|
3382
3384
|
remainingSeconds: o,
|
|
@@ -3387,63 +3389,63 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3387
3389
|
editable: m = !1,
|
|
3388
3390
|
footerActions: h,
|
|
3389
3391
|
className: z,
|
|
3390
|
-
style:
|
|
3391
|
-
} = i, [
|
|
3392
|
+
style: v
|
|
3393
|
+
} = i, [g, P] = D({}), k = H(
|
|
3392
3394
|
(p) => {
|
|
3393
|
-
const A = parseFloat(
|
|
3395
|
+
const A = parseFloat(g[p] ?? "");
|
|
3394
3396
|
isNaN(A) || !u || (u(p, A), P((y) => ({ ...y, [p]: "" })));
|
|
3395
3397
|
},
|
|
3396
|
-
[
|
|
3398
|
+
[g, u]
|
|
3397
3399
|
), T = (p) => {
|
|
3398
3400
|
const A = Math.floor(p / 60), y = p % 60;
|
|
3399
3401
|
return `${A}:${y.toString().padStart(2, "0")}`;
|
|
3400
3402
|
}, f = t.scores ? [...t.scores].sort((p, A) => A.score - p.score) : [];
|
|
3401
|
-
return /* @__PURE__ */
|
|
3403
|
+
return /* @__PURE__ */ s(
|
|
3402
3404
|
"div",
|
|
3403
3405
|
{
|
|
3404
3406
|
ref: r,
|
|
3405
3407
|
className: `nice-round-card nice-round-card--${t.status} ${z ?? ""}`,
|
|
3406
|
-
style:
|
|
3408
|
+
style: v,
|
|
3407
3409
|
children: [
|
|
3408
|
-
/* @__PURE__ */
|
|
3410
|
+
/* @__PURE__ */ s("div", { className: "nice-round-card__header", children: [
|
|
3409
3411
|
/* @__PURE__ */ e("span", { className: "nice-round-card__order", children: n("roundCard.roundN", "Round #{n}").replace("{n}", String(t.order)) }),
|
|
3410
3412
|
/* @__PURE__ */ e("h3", { className: "nice-round-card__name", children: t.name }),
|
|
3411
3413
|
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children: n(`roundCard.status.${t.status}`, t.status) })
|
|
3412
3414
|
] }),
|
|
3413
3415
|
t.description && /* @__PURE__ */ e("p", { className: "nice-round-card__description", children: t.description }),
|
|
3414
|
-
(d || o != null) && /* @__PURE__ */
|
|
3416
|
+
(d || o != null) && /* @__PURE__ */ s(
|
|
3415
3417
|
"div",
|
|
3416
3418
|
{
|
|
3417
3419
|
className: `nice-round-card__timer ${d ? "nice-round-card__timer--running" : ""}`,
|
|
3418
3420
|
children: [
|
|
3419
|
-
/* @__PURE__ */ e(
|
|
3421
|
+
/* @__PURE__ */ e(En, { size: 14 }),
|
|
3420
3422
|
" ",
|
|
3421
3423
|
o != null ? T(o) : "—"
|
|
3422
3424
|
]
|
|
3423
3425
|
}
|
|
3424
3426
|
),
|
|
3425
|
-
f.length > 0 && /* @__PURE__ */
|
|
3427
|
+
f.length > 0 && /* @__PURE__ */ s("div", { className: "nice-round-card__scoreboard", children: [
|
|
3426
3428
|
/* @__PURE__ */ e("h4", { children: n("roundCard.scoreboard", "Scoreboard") }),
|
|
3427
|
-
/* @__PURE__ */
|
|
3428
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ s("table", { className: "nice-round-card__scores-table", children: [
|
|
3430
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ s("tr", { children: [
|
|
3429
3431
|
/* @__PURE__ */ e("th", { children: n("roundCard.rank", "Rank") }),
|
|
3430
3432
|
/* @__PURE__ */ e("th", { children: n("roundCard.participant", "Participant") }),
|
|
3431
3433
|
/* @__PURE__ */ e("th", { children: n("roundCard.score", "Score") })
|
|
3432
3434
|
] }) }),
|
|
3433
|
-
/* @__PURE__ */ e("tbody", { children: f.map((p, A) => /* @__PURE__ */
|
|
3435
|
+
/* @__PURE__ */ e("tbody", { children: f.map((p, A) => /* @__PURE__ */ s(
|
|
3434
3436
|
"tr",
|
|
3435
3437
|
{
|
|
3436
3438
|
className: A < 3 ? `nice-round-card__top-${A + 1}` : "",
|
|
3437
3439
|
children: [
|
|
3438
|
-
/* @__PURE__ */
|
|
3440
|
+
/* @__PURE__ */ s("td", { children: [
|
|
3439
3441
|
p.rank ?? A + 1,
|
|
3440
|
-
A < 3 && /* @__PURE__ */
|
|
3442
|
+
A < 3 && /* @__PURE__ */ s(Ge, { children: [
|
|
3441
3443
|
" ",
|
|
3442
3444
|
/* @__PURE__ */ e(
|
|
3443
3445
|
Je,
|
|
3444
3446
|
{
|
|
3445
3447
|
size: 14,
|
|
3446
|
-
primaryColor:
|
|
3448
|
+
primaryColor: Fi[A],
|
|
3447
3449
|
"aria-label": n("roundCard.placeN", "Place {n}").replace(
|
|
3448
3450
|
"{n}",
|
|
3449
3451
|
String(A + 1)
|
|
@@ -3460,15 +3462,15 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3460
3462
|
)) })
|
|
3461
3463
|
] })
|
|
3462
3464
|
] }),
|
|
3463
|
-
u && (t.status === "active" || t.status === "voting") && f.length > 0 && /* @__PURE__ */
|
|
3465
|
+
u && (t.status === "active" || t.status === "voting") && f.length > 0 && /* @__PURE__ */ s("div", { className: "nice-round-card__score-input", children: [
|
|
3464
3466
|
/* @__PURE__ */ e("h4", { children: n("roundCard.submitScores", "Submit Scores") }),
|
|
3465
|
-
f.map((p) => /* @__PURE__ */
|
|
3467
|
+
f.map((p) => /* @__PURE__ */ s("div", { className: "nice-round-card__score-row", children: [
|
|
3466
3468
|
/* @__PURE__ */ e("span", { children: p.participantName }),
|
|
3467
3469
|
/* @__PURE__ */ e(
|
|
3468
3470
|
"input",
|
|
3469
3471
|
{
|
|
3470
3472
|
type: "number",
|
|
3471
|
-
value:
|
|
3473
|
+
value: g[p.participantId] ?? "",
|
|
3472
3474
|
onChange: (A) => P((y) => ({ ...y, [p.participantId]: A.target.value })),
|
|
3473
3475
|
min: 0,
|
|
3474
3476
|
step: 1,
|
|
@@ -3478,19 +3480,19 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3478
3480
|
/* @__PURE__ */ e("button", { onClick: () => k(p.participantId), children: n("roundCard.submit", "Submit") })
|
|
3479
3481
|
] }, p.participantId))
|
|
3480
3482
|
] }),
|
|
3481
|
-
/* @__PURE__ */
|
|
3482
|
-
m && /* @__PURE__ */
|
|
3483
|
-
t.status === "upcoming" && _ && /* @__PURE__ */
|
|
3483
|
+
/* @__PURE__ */ s("div", { className: "nice-round-card__footer", children: [
|
|
3484
|
+
m && /* @__PURE__ */ s("div", { className: "nice-round-card__actions", children: [
|
|
3485
|
+
t.status === "upcoming" && _ && /* @__PURE__ */ s("button", { onClick: _, children: [
|
|
3484
3486
|
/* @__PURE__ */ e(Ke, { size: 14 }),
|
|
3485
3487
|
" ",
|
|
3486
3488
|
n("roundCard.startRound", "Start Round")
|
|
3487
3489
|
] }),
|
|
3488
|
-
(t.status === "active" || t.status === "voting") && c && /* @__PURE__ */
|
|
3490
|
+
(t.status === "active" || t.status === "voting") && c && /* @__PURE__ */ s("button", { onClick: c, children: [
|
|
3489
3491
|
/* @__PURE__ */ e($t, { size: 14 }),
|
|
3490
3492
|
" ",
|
|
3491
3493
|
n("roundCard.endRound", "End Round")
|
|
3492
3494
|
] }),
|
|
3493
|
-
t.status === "upcoming" && l && /* @__PURE__ */
|
|
3495
|
+
t.status === "upcoming" && l && /* @__PURE__ */ s("button", { onClick: l, children: [
|
|
3494
3496
|
/* @__PURE__ */ e(rn, { size: 14 }),
|
|
3495
3497
|
" ",
|
|
3496
3498
|
n("roundCard.skip", "Skip")
|
|
@@ -3498,24 +3500,27 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3498
3500
|
] }),
|
|
3499
3501
|
h
|
|
3500
3502
|
] }),
|
|
3501
|
-
t.winnerIds && t.winnerIds.length > 0 && /* @__PURE__ */
|
|
3503
|
+
t.winnerIds && t.winnerIds.length > 0 && /* @__PURE__ */ s("div", { className: "nice-round-card__winners", children: [
|
|
3502
3504
|
/* @__PURE__ */ e(ln, { size: 14 }),
|
|
3503
|
-
"
|
|
3504
|
-
|
|
3505
|
+
" ",
|
|
3506
|
+
n("roundCard.winners", "Winners: {winnerIds}").replace(
|
|
3507
|
+
"{winnerIds}",
|
|
3508
|
+
String(t.winnerIds.length)
|
|
3509
|
+
)
|
|
3505
3510
|
] })
|
|
3506
3511
|
]
|
|
3507
3512
|
}
|
|
3508
3513
|
);
|
|
3509
3514
|
}
|
|
3510
|
-
),
|
|
3511
|
-
if (!
|
|
3515
|
+
), Xi = [], qi = (a) => {
|
|
3516
|
+
if (!a)
|
|
3512
3517
|
return "";
|
|
3513
|
-
const i = Math.floor(
|
|
3518
|
+
const i = Math.floor(a / 60), r = a % 60;
|
|
3514
3519
|
return `${i}:${r.toString().padStart(2, "0")}`;
|
|
3515
|
-
},
|
|
3520
|
+
}, pa = /* @__PURE__ */ te(
|
|
3516
3521
|
function(i, r) {
|
|
3517
3522
|
const {
|
|
3518
|
-
songs: n =
|
|
3523
|
+
songs: n = Xi,
|
|
3519
3524
|
onAdd: t,
|
|
3520
3525
|
onRemove: d,
|
|
3521
3526
|
onVote: o,
|
|
@@ -3524,7 +3529,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3524
3529
|
readOnly: c = !1,
|
|
3525
3530
|
className: l,
|
|
3526
3531
|
style: m
|
|
3527
|
-
} = i, { t: h } =
|
|
3532
|
+
} = i, { t: h } = ee(), [z, v] = D(""), g = F(() => {
|
|
3528
3533
|
if (!z.trim())
|
|
3529
3534
|
return n;
|
|
3530
3535
|
const f = z.toLowerCase();
|
|
@@ -3532,14 +3537,14 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3532
3537
|
(p) => p.title.toLowerCase().includes(f) || p.artist.toLowerCase().includes(f)
|
|
3533
3538
|
);
|
|
3534
3539
|
}, [n, z]), P = F(() => n.filter((f) => f.isQueued), [n]), k = n.find((f) => f.isPlaying), T = (f) => {
|
|
3535
|
-
|
|
3540
|
+
v(f), u == null || u(f);
|
|
3536
3541
|
};
|
|
3537
|
-
return /* @__PURE__ */
|
|
3538
|
-
k && /* @__PURE__ */
|
|
3542
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-song-picker ${l ?? ""}`, style: m, children: [
|
|
3543
|
+
k && /* @__PURE__ */ s("div", { className: "nice-song-picker__now-playing", children: [
|
|
3539
3544
|
k.albumArt && /* @__PURE__ */ e("img", { src: k.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
3540
|
-
/* @__PURE__ */
|
|
3541
|
-
/* @__PURE__ */
|
|
3542
|
-
/* @__PURE__ */ e(
|
|
3545
|
+
/* @__PURE__ */ s("div", { children: [
|
|
3546
|
+
/* @__PURE__ */ s("div", { className: "nice-song-picker__np-label", children: [
|
|
3547
|
+
/* @__PURE__ */ e(Pe, { size: 14 }),
|
|
3543
3548
|
" ",
|
|
3544
3549
|
h("songPicker.nowPlaying", "Now playing")
|
|
3545
3550
|
] }),
|
|
@@ -3549,7 +3554,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3549
3554
|
] })
|
|
3550
3555
|
] }),
|
|
3551
3556
|
/* @__PURE__ */ e("div", { className: "nice-song-picker__search", children: /* @__PURE__ */ e(
|
|
3552
|
-
|
|
3557
|
+
J,
|
|
3553
3558
|
{
|
|
3554
3559
|
size: "sm",
|
|
3555
3560
|
controlWidth: "100%",
|
|
@@ -3559,24 +3564,24 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3559
3564
|
"aria-label": h("songPicker.search", "Search songs or artists…")
|
|
3560
3565
|
}
|
|
3561
3566
|
) }),
|
|
3562
|
-
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children:
|
|
3567
|
+
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: g.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: h("songPicker.noMatch", "No songs found.") }) : g.map((f) => /* @__PURE__ */ s(
|
|
3563
3568
|
"div",
|
|
3564
3569
|
{
|
|
3565
3570
|
className: `nice-song-picker__item ${f.isPlaying ? "nice-song-picker__item--playing" : ""}`,
|
|
3566
3571
|
children: [
|
|
3567
3572
|
f.albumArt && /* @__PURE__ */ e("img", { src: f.albumArt, alt: "", className: "nice-song-picker__thumb" }),
|
|
3568
|
-
/* @__PURE__ */
|
|
3573
|
+
/* @__PURE__ */ s("div", { className: "nice-song-picker__info", children: [
|
|
3569
3574
|
/* @__PURE__ */ e("strong", { children: f.title }),
|
|
3570
3575
|
" — ",
|
|
3571
3576
|
/* @__PURE__ */ e("span", { children: f.artist }),
|
|
3572
|
-
f.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children:
|
|
3577
|
+
f.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children: qi(f.duration) }),
|
|
3573
3578
|
f.addedByName && /* @__PURE__ */ e("div", { className: "nice-song-picker__added-by", children: h("songPicker.addedBy", "Added by {name}").replace(
|
|
3574
3579
|
"{name}",
|
|
3575
3580
|
f.addedByName
|
|
3576
3581
|
) })
|
|
3577
3582
|
] }),
|
|
3578
|
-
!c && /* @__PURE__ */
|
|
3579
|
-
o && /* @__PURE__ */
|
|
3583
|
+
!c && /* @__PURE__ */ s("div", { className: "nice-song-picker__actions", children: [
|
|
3584
|
+
o && /* @__PURE__ */ s(
|
|
3580
3585
|
U,
|
|
3581
3586
|
{
|
|
3582
3587
|
variant: "ghost",
|
|
@@ -3593,7 +3598,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3593
3598
|
]
|
|
3594
3599
|
}
|
|
3595
3600
|
),
|
|
3596
|
-
t && !f.isQueued && /* @__PURE__ */
|
|
3601
|
+
t && !f.isQueued && /* @__PURE__ */ s(U, { variant: "primary", size: "sm", onClick: () => t(f.id), children: [
|
|
3597
3602
|
/* @__PURE__ */ e(an, { size: 14 }),
|
|
3598
3603
|
" ",
|
|
3599
3604
|
h("songPicker.addToQueue", "Queue")
|
|
@@ -3604,14 +3609,14 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3604
3609
|
},
|
|
3605
3610
|
f.id
|
|
3606
3611
|
)) }),
|
|
3607
|
-
_ && P.length > 0 && /* @__PURE__ */
|
|
3612
|
+
_ && P.length > 0 && /* @__PURE__ */ s("div", { className: "nice-song-picker__queue", children: [
|
|
3608
3613
|
/* @__PURE__ */ e("h4", { children: h("songPicker.queue", "Queue ({count})").replace("{count}", String(P.length)) }),
|
|
3609
|
-
P.map((f, p) => /* @__PURE__ */
|
|
3610
|
-
/* @__PURE__ */
|
|
3614
|
+
P.map((f, p) => /* @__PURE__ */ s("div", { className: "nice-song-picker__queue-item", children: [
|
|
3615
|
+
/* @__PURE__ */ s("span", { className: "nice-song-picker__queue-pos", children: [
|
|
3611
3616
|
p + 1,
|
|
3612
3617
|
"."
|
|
3613
3618
|
] }),
|
|
3614
|
-
/* @__PURE__ */
|
|
3619
|
+
/* @__PURE__ */ s("span", { children: [
|
|
3615
3620
|
f.title,
|
|
3616
3621
|
" — ",
|
|
3617
3622
|
f.artist
|
|
@@ -3620,17 +3625,17 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3620
3625
|
] })
|
|
3621
3626
|
] });
|
|
3622
3627
|
}
|
|
3623
|
-
), Wi = [],
|
|
3628
|
+
), Wi = [], An = {
|
|
3624
3629
|
easy: "Easy",
|
|
3625
3630
|
medium: "Medium",
|
|
3626
3631
|
hard: "Hard",
|
|
3627
3632
|
expert: "Expert"
|
|
3628
|
-
},
|
|
3633
|
+
}, Gi = {
|
|
3629
3634
|
easy: "var(--nice-color-success, #16a34a)",
|
|
3630
3635
|
medium: "var(--nice-color-warning, #d97706)",
|
|
3631
3636
|
hard: "var(--nice-color-error, #dc2626)",
|
|
3632
3637
|
expert: "var(--nice-color-accent, #7c3aed)"
|
|
3633
|
-
}, Ue = "all",
|
|
3638
|
+
}, Ue = "all", ha = /* @__PURE__ */ te(
|
|
3634
3639
|
function(i, r) {
|
|
3635
3640
|
const {
|
|
3636
3641
|
songs: n = Wi,
|
|
@@ -3642,54 +3647,54 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3642
3647
|
readOnly: c = !1,
|
|
3643
3648
|
className: l,
|
|
3644
3649
|
style: m
|
|
3645
|
-
} = i, { t: h } =
|
|
3650
|
+
} = i, { t: h } = ee(), z = (y) => y in An ? h(`karaokePicker.difficulty.${y}`, An[y]) : y, [v, g] = D(""), [P, k] = D(Ue), T = n.find((y) => y.id === _), f = F(() => {
|
|
3646
3651
|
let y = n;
|
|
3647
|
-
if (
|
|
3648
|
-
const M =
|
|
3652
|
+
if (v.trim()) {
|
|
3653
|
+
const M = v.toLowerCase();
|
|
3649
3654
|
y = y.filter(
|
|
3650
3655
|
(w) => w.title.toLowerCase().includes(M) || w.artist.toLowerCase().includes(M)
|
|
3651
3656
|
);
|
|
3652
3657
|
}
|
|
3653
3658
|
return P !== Ue && (y = y.filter((M) => M.difficulty === P)), y;
|
|
3654
|
-
}, [n,
|
|
3655
|
-
return /* @__PURE__ */
|
|
3656
|
-
T && /* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3659
|
+
}, [n, v, P]), p = F(() => new Set(t.map((y) => y.id)), [t]), A = ["easy", "medium", "hard", "expert"];
|
|
3660
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-karaoke-picker ${l ?? ""}`, style: m, children: [
|
|
3661
|
+
T && /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__now-singing", children: [
|
|
3662
|
+
/* @__PURE__ */ s("span", { className: "nice-karaoke-picker__label", children: [
|
|
3658
3663
|
/* @__PURE__ */ e(Xe, { size: 14 }),
|
|
3659
3664
|
" ",
|
|
3660
3665
|
h("karaokePicker.nowSinging", "Now Singing")
|
|
3661
3666
|
] }),
|
|
3662
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ s("div", { children: [
|
|
3663
3668
|
/* @__PURE__ */ e("strong", { children: T.title }),
|
|
3664
3669
|
" — ",
|
|
3665
3670
|
T.artist,
|
|
3666
|
-
T.performerName && /* @__PURE__ */
|
|
3671
|
+
T.performerName && /* @__PURE__ */ s("span", { children: [
|
|
3667
3672
|
" ",
|
|
3668
3673
|
"(",
|
|
3669
3674
|
h("karaokePicker.by", "by {name}").replace("{name}", T.performerName),
|
|
3670
3675
|
")"
|
|
3671
3676
|
] })
|
|
3672
3677
|
] }),
|
|
3673
|
-
!c && u && /* @__PURE__ */ e("div", { className: "nice-karaoke-picker__next", children: /* @__PURE__ */
|
|
3678
|
+
!c && u && /* @__PURE__ */ e("div", { className: "nice-karaoke-picker__next", children: /* @__PURE__ */ s(U, { variant: "secondary", size: "sm", onClick: u, children: [
|
|
3674
3679
|
h("karaokePicker.next", "Skip / Next"),
|
|
3675
3680
|
" ",
|
|
3676
3681
|
/* @__PURE__ */ e(rn, { size: 14 })
|
|
3677
3682
|
] }) })
|
|
3678
3683
|
] }),
|
|
3679
|
-
/* @__PURE__ */
|
|
3684
|
+
/* @__PURE__ */ s("div", { className: "nice-karaoke-picker__filters", children: [
|
|
3680
3685
|
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__search", children: /* @__PURE__ */ e(
|
|
3681
|
-
|
|
3686
|
+
J,
|
|
3682
3687
|
{
|
|
3683
3688
|
size: "sm",
|
|
3684
3689
|
controlWidth: "100%",
|
|
3685
|
-
value:
|
|
3686
|
-
onChange:
|
|
3690
|
+
value: v,
|
|
3691
|
+
onChange: g,
|
|
3687
3692
|
placeholder: h("karaokePicker.search", "Search songs or artists…"),
|
|
3688
3693
|
"aria-label": h("karaokePicker.search", "Search songs or artists…")
|
|
3689
3694
|
}
|
|
3690
3695
|
) }),
|
|
3691
3696
|
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__difficulty-filter", children: /* @__PURE__ */ e(
|
|
3692
|
-
|
|
3697
|
+
ze,
|
|
3693
3698
|
{
|
|
3694
3699
|
size: "sm",
|
|
3695
3700
|
"aria-label": h("karaokePicker.allDifficulties", "All Difficulties"),
|
|
@@ -3702,17 +3707,17 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3702
3707
|
}
|
|
3703
3708
|
) })
|
|
3704
3709
|
] }),
|
|
3705
|
-
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: f.length === 0 ? /* @__PURE__ */ e("p", { children: h("karaokePicker.noMatch", "No songs match your search.") }) : f.map((y) => /* @__PURE__ */
|
|
3706
|
-
/* @__PURE__ */
|
|
3710
|
+
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: f.length === 0 ? /* @__PURE__ */ e("p", { children: h("karaokePicker.noMatch", "No songs match your search.") }) : f.map((y) => /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__song", children: [
|
|
3711
|
+
/* @__PURE__ */ s("div", { children: [
|
|
3707
3712
|
/* @__PURE__ */ e("strong", { children: y.title }),
|
|
3708
3713
|
" — ",
|
|
3709
3714
|
y.artist,
|
|
3710
|
-
y.difficulty && /* @__PURE__ */
|
|
3715
|
+
y.difficulty && /* @__PURE__ */ s(
|
|
3711
3716
|
"span",
|
|
3712
3717
|
{
|
|
3713
3718
|
className: "nice-karaoke-picker__difficulty",
|
|
3714
3719
|
style: {
|
|
3715
|
-
color:
|
|
3720
|
+
color: Gi[y.difficulty] ?? "var(--nice-text-muted, #94a3b8)"
|
|
3716
3721
|
},
|
|
3717
3722
|
children: [
|
|
3718
3723
|
"[",
|
|
@@ -3727,30 +3732,30 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3727
3732
|
className: "nice-karaoke-picker__lyrics",
|
|
3728
3733
|
title: h("karaokePicker.lyrics", "Lyrics available"),
|
|
3729
3734
|
"aria-label": h("karaokePicker.lyrics", "Lyrics available"),
|
|
3730
|
-
children: /* @__PURE__ */ e(
|
|
3735
|
+
children: /* @__PURE__ */ e(Rt, { size: 12 })
|
|
3731
3736
|
}
|
|
3732
3737
|
),
|
|
3733
|
-
y.language && /* @__PURE__ */
|
|
3738
|
+
y.language && /* @__PURE__ */ s("span", { className: "nice-karaoke-picker__language", children: [
|
|
3734
3739
|
"(",
|
|
3735
3740
|
y.language,
|
|
3736
3741
|
")"
|
|
3737
3742
|
] })
|
|
3738
3743
|
] }),
|
|
3739
|
-
!c && /* @__PURE__ */ e("div", { children: p.has(y.id) ? /* @__PURE__ */ e(U, { variant: "outline", size: "sm", onClick: () => o == null ? void 0 : o(y.id), children: h("remove", "Remove") }) : /* @__PURE__ */
|
|
3744
|
+
!c && /* @__PURE__ */ e("div", { children: p.has(y.id) ? /* @__PURE__ */ e(U, { variant: "outline", size: "sm", onClick: () => o == null ? void 0 : o(y.id), children: h("remove", "Remove") }) : /* @__PURE__ */ s(U, { variant: "primary", size: "sm", onClick: () => d == null ? void 0 : d(y.id), children: [
|
|
3740
3745
|
/* @__PURE__ */ e(Xe, { size: 14 }),
|
|
3741
3746
|
" ",
|
|
3742
3747
|
h("karaokePicker.sing", "Sing")
|
|
3743
3748
|
] }) })
|
|
3744
3749
|
] }, y.id)) }),
|
|
3745
|
-
t.length > 0 && /* @__PURE__ */
|
|
3746
|
-
/* @__PURE__ */
|
|
3747
|
-
/* @__PURE__ */ e(
|
|
3750
|
+
t.length > 0 && /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__queue", children: [
|
|
3751
|
+
/* @__PURE__ */ s("h4", { children: [
|
|
3752
|
+
/* @__PURE__ */ e(Pe, { size: 14 }),
|
|
3748
3753
|
" ",
|
|
3749
3754
|
h("karaokePicker.queue", "Queue ({count})").replace("{count}", String(t.length))
|
|
3750
3755
|
] }),
|
|
3751
|
-
t.map((y, M) => /* @__PURE__ */
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
/* @__PURE__ */
|
|
3756
|
+
t.map((y, M) => /* @__PURE__ */ s("div", { className: "nice-karaoke-picker__queue-item", children: [
|
|
3757
|
+
/* @__PURE__ */ s("span", { children: [
|
|
3758
|
+
/* @__PURE__ */ s("strong", { children: [
|
|
3754
3759
|
M + 1,
|
|
3755
3760
|
"."
|
|
3756
3761
|
] }),
|
|
@@ -3758,7 +3763,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3758
3763
|
y.title,
|
|
3759
3764
|
" — ",
|
|
3760
3765
|
y.artist,
|
|
3761
|
-
y.performerName && /* @__PURE__ */
|
|
3766
|
+
y.performerName && /* @__PURE__ */ s("em", { children: [
|
|
3762
3767
|
" (",
|
|
3763
3768
|
y.performerName,
|
|
3764
3769
|
")"
|
|
@@ -3778,15 +3783,15 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3778
3783
|
] })
|
|
3779
3784
|
] });
|
|
3780
3785
|
}
|
|
3781
|
-
),
|
|
3786
|
+
), Ki = [], Tn = {
|
|
3782
3787
|
game: Yn,
|
|
3783
|
-
music:
|
|
3784
|
-
dance:
|
|
3788
|
+
music: Pe,
|
|
3789
|
+
dance: Pe,
|
|
3785
3790
|
quiz: sn,
|
|
3786
3791
|
karaoke: Xe,
|
|
3787
|
-
photo:
|
|
3788
|
-
custom:
|
|
3789
|
-
},
|
|
3792
|
+
photo: Bn,
|
|
3793
|
+
custom: On
|
|
3794
|
+
}, ji = {
|
|
3790
3795
|
game: "Games",
|
|
3791
3796
|
music: "Music",
|
|
3792
3797
|
dance: "Dance",
|
|
@@ -3794,9 +3799,9 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3794
3799
|
karaoke: "Karaoke",
|
|
3795
3800
|
photo: "Photo",
|
|
3796
3801
|
custom: "Custom"
|
|
3797
|
-
},
|
|
3798
|
-
const { t: n } =
|
|
3799
|
-
attractions: t =
|
|
3802
|
+
}, ga = /* @__PURE__ */ te(function(i, r) {
|
|
3803
|
+
const { t: n } = ee(), {
|
|
3804
|
+
attractions: t = Ki,
|
|
3800
3805
|
onSelect: d,
|
|
3801
3806
|
onDeselect: o,
|
|
3802
3807
|
onVote: u,
|
|
@@ -3806,36 +3811,31 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3806
3811
|
readOnly: m = !1,
|
|
3807
3812
|
layout: h = "grid",
|
|
3808
3813
|
className: z,
|
|
3809
|
-
style:
|
|
3810
|
-
} = i, [
|
|
3814
|
+
style: v
|
|
3815
|
+
} = i, [g, P] = D(""), [k, T] = D(""), f = F(() => new Set(_), [_]), p = F(() => {
|
|
3811
3816
|
const w = new Set(t.map((N) => N.category));
|
|
3812
3817
|
return Array.from(w);
|
|
3813
3818
|
}, [t]), A = F(() => {
|
|
3814
3819
|
let w = t;
|
|
3815
|
-
if (
|
|
3820
|
+
if (g && (w = w.filter((N) => N.category === g)), k.trim()) {
|
|
3816
3821
|
const N = k.toLowerCase();
|
|
3817
3822
|
w = w.filter(
|
|
3818
3823
|
(x) => {
|
|
3819
|
-
var
|
|
3820
|
-
return x.name.toLowerCase().includes(N) || ((
|
|
3824
|
+
var B;
|
|
3825
|
+
return x.name.toLowerCase().includes(N) || ((B = x.description) == null ? void 0 : B.toLowerCase().includes(N));
|
|
3821
3826
|
}
|
|
3822
3827
|
);
|
|
3823
3828
|
}
|
|
3824
3829
|
return w;
|
|
3825
|
-
}, [t,
|
|
3830
|
+
}, [t, g, k]), y = !c || f.size < c, M = (w) => {
|
|
3826
3831
|
m || (f.has(w) ? o == null || o(w) : y && (d == null || d(w)));
|
|
3827
3832
|
};
|
|
3828
|
-
return /* @__PURE__ */
|
|
3829
|
-
/* @__PURE__ */
|
|
3833
|
+
return /* @__PURE__ */ s("div", { ref: r, className: `nice-attraction-picker ${z ?? ""}`, style: v, children: [
|
|
3834
|
+
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__header", children: [
|
|
3830
3835
|
/* @__PURE__ */ e("h3", { className: "nice-attraction-picker__title", children: n("attractionPicker.attractions", "Attractions") }),
|
|
3831
|
-
c && /* @__PURE__ */
|
|
3832
|
-
f.size,
|
|
3833
|
-
"/",
|
|
3834
|
-
c,
|
|
3835
|
-
" selected"
|
|
3836
|
-
] })
|
|
3836
|
+
c && /* @__PURE__ */ e("span", { className: "nice-attraction-picker__count", children: n("attractionPicker.selected", "{size}/{maxSelections} selected").replace("{size}", String(f.size)).replace("{maxSelections}", String(c)) })
|
|
3837
3837
|
] }),
|
|
3838
|
-
/* @__PURE__ */
|
|
3838
|
+
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__filters", children: [
|
|
3839
3839
|
/* @__PURE__ */ e(
|
|
3840
3840
|
"input",
|
|
3841
3841
|
{
|
|
@@ -3851,20 +3851,20 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3851
3851
|
{
|
|
3852
3852
|
type: "button",
|
|
3853
3853
|
onClick: () => P(""),
|
|
3854
|
-
className: `nice-attraction-picker__category${
|
|
3855
|
-
children: "All"
|
|
3854
|
+
className: `nice-attraction-picker__category${g ? "" : " nice-attraction-picker__category--active"}`,
|
|
3855
|
+
children: n("attractionPicker.all", "All")
|
|
3856
3856
|
}
|
|
3857
3857
|
),
|
|
3858
|
-
p.map((w) => /* @__PURE__ */
|
|
3858
|
+
p.map((w) => /* @__PURE__ */ s(
|
|
3859
3859
|
"button",
|
|
3860
3860
|
{
|
|
3861
3861
|
type: "button",
|
|
3862
|
-
onClick: () => P(w ===
|
|
3863
|
-
className: `nice-attraction-picker__category${w ===
|
|
3862
|
+
onClick: () => P(w === g ? "" : w),
|
|
3863
|
+
className: `nice-attraction-picker__category${w === g ? " nice-attraction-picker__category--active" : ""}`,
|
|
3864
3864
|
children: [
|
|
3865
|
-
|
|
3865
|
+
Re.createElement(Tn[w], { size: 14 }),
|
|
3866
3866
|
" ",
|
|
3867
|
-
n(`attractionPicker.category.${w}`,
|
|
3867
|
+
n(`attractionPicker.category.${w}`, ji[w])
|
|
3868
3868
|
]
|
|
3869
3869
|
},
|
|
3870
3870
|
w
|
|
@@ -3872,20 +3872,24 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3872
3872
|
] }),
|
|
3873
3873
|
/* @__PURE__ */ e("div", { className: `nice-attraction-picker__items nice-attraction-picker__items--${h}`, children: A.length === 0 ? /* @__PURE__ */ e("p", { children: n("attractionPicker.noAttractionsFound", "No attractions found.") }) : A.map((w) => {
|
|
3874
3874
|
const N = f.has(w.id);
|
|
3875
|
-
return /* @__PURE__ */
|
|
3875
|
+
return /* @__PURE__ */ s(
|
|
3876
3876
|
"div",
|
|
3877
3877
|
{
|
|
3878
|
+
role: "button",
|
|
3879
|
+
tabIndex: 0,
|
|
3880
|
+
"aria-pressed": N,
|
|
3881
|
+
onKeyDown: un,
|
|
3878
3882
|
className: `nice-attraction-picker__card${N ? " nice-attraction-picker__card--selected" : ""}${m ? " nice-attraction-picker__card--readonly" : ""}`,
|
|
3879
3883
|
onClick: () => M(w.id),
|
|
3880
3884
|
children: [
|
|
3881
3885
|
w.imageUrl && /* @__PURE__ */ e("img", { src: w.imageUrl, alt: w.name, className: "nice-attraction-picker__image" }),
|
|
3882
|
-
/* @__PURE__ */
|
|
3883
|
-
/* @__PURE__ */ e("span", { className: "nice-attraction-picker__icon", children:
|
|
3886
|
+
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__name", children: [
|
|
3887
|
+
/* @__PURE__ */ e("span", { className: "nice-attraction-picker__icon", children: Re.createElement(Tn[w.category], { size: 16 }) }),
|
|
3884
3888
|
/* @__PURE__ */ e("strong", { children: w.name })
|
|
3885
3889
|
] }),
|
|
3886
3890
|
w.description && /* @__PURE__ */ e("p", { className: "nice-attraction-picker__description", children: w.description }),
|
|
3887
|
-
/* @__PURE__ */
|
|
3888
|
-
l && /* @__PURE__ */
|
|
3891
|
+
/* @__PURE__ */ s("div", { className: "nice-attraction-picker__card-footer", children: [
|
|
3892
|
+
l && /* @__PURE__ */ s("span", { className: "nice-attraction-picker__votes", children: [
|
|
3889
3893
|
/* @__PURE__ */ e(cn, { size: 14 }),
|
|
3890
3894
|
" ",
|
|
3891
3895
|
w.votes ?? 0
|
|
@@ -3908,17 +3912,17 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3908
3912
|
);
|
|
3909
3913
|
}) })
|
|
3910
3914
|
] });
|
|
3911
|
-
}),
|
|
3915
|
+
}), Hi = [], Qi = {
|
|
3912
3916
|
game: Yn,
|
|
3913
|
-
music:
|
|
3914
|
-
dance:
|
|
3917
|
+
music: Pe,
|
|
3918
|
+
dance: Pe,
|
|
3915
3919
|
quiz: sn,
|
|
3916
3920
|
karaoke: Xe,
|
|
3917
|
-
photo:
|
|
3918
|
-
custom:
|
|
3919
|
-
},
|
|
3920
|
-
const { t: n } =
|
|
3921
|
-
attractions: t =
|
|
3921
|
+
photo: Bn,
|
|
3922
|
+
custom: On
|
|
3923
|
+
}, va = /* @__PURE__ */ te(function(i, r) {
|
|
3924
|
+
const { t: n } = ee(), {
|
|
3925
|
+
attractions: t = Hi,
|
|
3922
3926
|
onVote: d,
|
|
3923
3927
|
onUnvote: o,
|
|
3924
3928
|
votedIds: u = [],
|
|
@@ -3928,7 +3932,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3928
3932
|
showResults: m = !0,
|
|
3929
3933
|
className: h,
|
|
3930
3934
|
style: z
|
|
3931
|
-
} = i,
|
|
3935
|
+
} = i, v = F(() => new Set(u), [u]), g = _ ? _ - v.size : void 0, P = F(() => {
|
|
3932
3936
|
const p = [...t];
|
|
3933
3937
|
switch (l) {
|
|
3934
3938
|
case "votes":
|
|
@@ -3946,7 +3950,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3946
3950
|
() => Math.max(...t.map((p) => p.votes ?? 0), 1),
|
|
3947
3951
|
[t]
|
|
3948
3952
|
), T = (p) => {
|
|
3949
|
-
c || (
|
|
3953
|
+
c || (v.has(p) ? o == null || o(p) : (!g || g > 0) && (d == null || d(p)));
|
|
3950
3954
|
}, f = (p) => {
|
|
3951
3955
|
switch (p) {
|
|
3952
3956
|
case 0:
|
|
@@ -3980,14 +3984,14 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3980
3984
|
return `${p + 1}.`;
|
|
3981
3985
|
}
|
|
3982
3986
|
};
|
|
3983
|
-
return /* @__PURE__ */
|
|
3987
|
+
return /* @__PURE__ */ s(
|
|
3984
3988
|
"div",
|
|
3985
3989
|
{
|
|
3986
3990
|
ref: r,
|
|
3987
3991
|
className: `nice-attraction-voting ${h ?? ""}`,
|
|
3988
3992
|
style: { color: "var(--nice-text-primary)", ...z },
|
|
3989
3993
|
children: [
|
|
3990
|
-
/* @__PURE__ */
|
|
3994
|
+
/* @__PURE__ */ s(
|
|
3991
3995
|
"div",
|
|
3992
3996
|
{
|
|
3993
3997
|
style: {
|
|
@@ -3997,34 +4001,40 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
3997
4001
|
marginBottom: 16
|
|
3998
4002
|
},
|
|
3999
4003
|
children: [
|
|
4000
|
-
/* @__PURE__ */
|
|
4004
|
+
/* @__PURE__ */ s("h3", { style: { margin: 0, display: "inline-flex", alignItems: "center", gap: 8 }, children: [
|
|
4001
4005
|
/* @__PURE__ */ e(Dt, { size: 20 }),
|
|
4002
4006
|
c ? n("attractionVoting.votingResults", "Voting Results") : n("attractionVoting.voteForAttractions", "Vote for Attractions")
|
|
4003
4007
|
] }),
|
|
4004
|
-
!c &&
|
|
4008
|
+
!c && g !== void 0 && /* @__PURE__ */ e(
|
|
4005
4009
|
"span",
|
|
4006
4010
|
{
|
|
4007
4011
|
style: {
|
|
4008
4012
|
fontSize: 14,
|
|
4009
|
-
color:
|
|
4013
|
+
color: g > 0 ? "var(--nice-color-primary, #6366f1)" : "var(--nice-color-error, #ef4444)"
|
|
4010
4014
|
},
|
|
4011
|
-
children:
|
|
4012
|
-
|
|
4013
|
-
"
|
|
4014
|
-
|
|
4015
|
-
"
|
|
4016
|
-
|
|
4015
|
+
children: g !== 1 ? n(
|
|
4016
|
+
"attractionVoting.votesRemainingMany",
|
|
4017
|
+
"{votesRemaining} votes remaining"
|
|
4018
|
+
).replace("{votesRemaining}", String(g)) : n("attractionVoting.votesRemainingOne", "{votesRemaining} vote remaining").replace(
|
|
4019
|
+
"{votesRemaining}",
|
|
4020
|
+
String(g)
|
|
4021
|
+
)
|
|
4017
4022
|
}
|
|
4018
4023
|
)
|
|
4019
4024
|
]
|
|
4020
4025
|
}
|
|
4021
4026
|
),
|
|
4022
|
-
c && /* @__PURE__ */ e("p", { style: { color: "var(--nice-text-secondary, #64748b)", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
4027
|
+
c && /* @__PURE__ */ e("p", { style: { color: "var(--nice-text-secondary, #64748b)", marginBottom: 12 }, children: n("attractionVoting.votingIsClosedFinalResults", "Voting is closed. Final results:") }),
|
|
4023
4028
|
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: P.map((p, A) => {
|
|
4024
|
-
const y =
|
|
4025
|
-
return /* @__PURE__ */
|
|
4029
|
+
const y = v.has(p.id), M = p.votes ?? 0, w = m ? `${Math.round(M / k * 100)}%` : "0%";
|
|
4030
|
+
return /* @__PURE__ */ s(
|
|
4026
4031
|
"div",
|
|
4027
4032
|
{
|
|
4033
|
+
role: "button",
|
|
4034
|
+
tabIndex: 0,
|
|
4035
|
+
"aria-pressed": y,
|
|
4036
|
+
"aria-disabled": c || void 0,
|
|
4037
|
+
onKeyDown: un,
|
|
4028
4038
|
style: {
|
|
4029
4039
|
display: "flex",
|
|
4030
4040
|
alignItems: "center",
|
|
@@ -4039,8 +4049,8 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
4039
4049
|
onClick: () => T(p.id),
|
|
4040
4050
|
children: [
|
|
4041
4051
|
m && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: f(A) }),
|
|
4042
|
-
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children:
|
|
4043
|
-
/* @__PURE__ */
|
|
4052
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: Re.createElement(Qi[p.category], { size: 20 }) }),
|
|
4053
|
+
/* @__PURE__ */ s("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4044
4054
|
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: p.name }),
|
|
4045
4055
|
p.description && /* @__PURE__ */ e(
|
|
4046
4056
|
"div",
|
|
@@ -4104,7 +4114,7 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
4104
4114
|
p.id
|
|
4105
4115
|
);
|
|
4106
4116
|
}) }),
|
|
4107
|
-
m && /* @__PURE__ */
|
|
4117
|
+
m && /* @__PURE__ */ e(
|
|
4108
4118
|
"div",
|
|
4109
4119
|
{
|
|
4110
4120
|
style: {
|
|
@@ -4113,10 +4123,10 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
4113
4123
|
fontSize: 13,
|
|
4114
4124
|
color: "var(--nice-text-secondary, #64748b)"
|
|
4115
4125
|
},
|
|
4116
|
-
children:
|
|
4117
|
-
"
|
|
4118
|
-
t.reduce((p, A) => p + (A.votes ?? 0), 0)
|
|
4119
|
-
|
|
4126
|
+
children: n("attractionVoting.totalVotes", "Total votes: {votes}").replace(
|
|
4127
|
+
"{votes}",
|
|
4128
|
+
String(t.reduce((p, A) => p + (A.votes ?? 0), 0))
|
|
4129
|
+
)
|
|
4120
4130
|
}
|
|
4121
4131
|
)
|
|
4122
4132
|
]
|
|
@@ -4124,20 +4134,20 @@ const Ei = [], Oi = [], oa = /* @__PURE__ */ te(
|
|
|
4124
4134
|
);
|
|
4125
4135
|
});
|
|
4126
4136
|
export {
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4137
|
+
ga as NiceAttractionPicker,
|
|
4138
|
+
va as NiceAttractionVoting,
|
|
4139
|
+
ia as NiceEventMedia,
|
|
4140
|
+
sa as NiceEventPlanning,
|
|
4141
|
+
da as NiceExpenseSplit,
|
|
4142
|
+
oa as NiceGiftRegistry,
|
|
4143
|
+
la as NiceInvitationDesigner,
|
|
4144
|
+
ha as NiceKaraokePicker,
|
|
4145
|
+
aa as NiceMediaCollage,
|
|
4146
|
+
ra as NiceParticipantList,
|
|
4147
|
+
ma as NiceRoundCard,
|
|
4148
|
+
ua as NiceRoundList,
|
|
4149
|
+
Sn as NiceRsvpControl,
|
|
4150
|
+
ca as NiceSeatPicker,
|
|
4151
|
+
ki as NiceSeatingChart,
|
|
4152
|
+
pa as NiceSongPicker
|
|
4143
4153
|
};
|