@nice2dev/events 1.1.9 → 1.1.10
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 +69 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +21 -74
- package/dist/index.mjs +1207 -1193
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { jsxs as i, jsx as e, Fragment as
|
|
2
|
-
import { NtdMove as
|
|
3
|
-
import { NiceUpload as Qe, NiceTextInput as J, NiceCardGroup as Ln, NiceEmpty as $t, NiceButton as
|
|
4
|
-
import Me, { useState as
|
|
5
|
-
import { NiceIcon as ie } from "@nice2dev/ui-core";
|
|
6
|
-
function
|
|
7
|
-
return s.map((t,
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as Fe } from "react/jsx-runtime";
|
|
2
|
+
import { NtdMove as Cn, NtdHeart as gt, NtdTrash as Ee, NtdPlay as We, NtdImage as Sn, NtdPlus as zn, NtdCheck as qe, NtdHelp as en, NtdClose as $n, NtdSearch as ft, NtdQrCode as vt, NtdMail as Pn, NtdWheelchair as An, NtdSend as yt, NtdGiftCard as _t, NtdStar as Nt, NtdLink as bt, NtdReceipt as wt, NtdCoins as xt, NtdArrowRight as kt, NtdSkipForward as nn, NtdBarChart as It, NtdThumbsUp as tn, NtdClock as Tn, NtdTrophy as an, NtdMedal as He, NtdStop as Ct, NtdMusic as ke, NtdMicrophone as Ye, NtdFileText as St, NtdSparkle as Mn, NtdCamera as En, NtdGamepad as Dn, NtdClipboardCheck as zt } from "@nice2dev/icons";
|
|
3
|
+
import { NiceUpload as Qe, NiceTextInput as J, NiceCardGroup as Ln, NiceEmpty as $t, NiceButton as F, NiceSegmentedControl as Bn, NiceAvatarGroup as fn, NiceAvatar as Oe, NiceBadge as te, NiceSelect as Te, NiceAmountBreakdown as Pt, NiceToggle as Ke, NiceTabs as At, NiceTextArea as sn, NiceNumericInput as rn, NiceCollapse as Tt, NiceHtmlEditor as Mt, NiceProgress as Et } from "@nice2dev/ui";
|
|
4
|
+
import Me, { useState as L, useRef as ve, useCallback as G, forwardRef as ee, useMemo as V, useEffect as Ue } from "react";
|
|
5
|
+
import { NiceIcon as ie, useControllableState as Dt } from "@nice2dev/ui-core";
|
|
6
|
+
function Lt(s) {
|
|
7
|
+
return s.map((t, r) => ({ item: t, index: r, key: t.order ?? r })).sort((t, r) => t.key - r.key || t.index - r.index).map((t) => t.item);
|
|
8
8
|
}
|
|
9
|
-
function vn(s, t,
|
|
10
|
-
if (t ===
|
|
9
|
+
function vn(s, t, r) {
|
|
10
|
+
if (t === r)
|
|
11
11
|
return [...s];
|
|
12
12
|
if (t < 0 || t >= s.length)
|
|
13
13
|
return [...s];
|
|
14
|
-
if (
|
|
14
|
+
if (r < 0 || r >= s.length)
|
|
15
15
|
return [...s];
|
|
16
16
|
const n = [...s], [l] = n.splice(t, 1);
|
|
17
|
-
return n.splice(
|
|
17
|
+
return n.splice(r, 0, l), n;
|
|
18
18
|
}
|
|
19
19
|
function Rn(s) {
|
|
20
|
-
const { items: t, onReorder:
|
|
21
|
-
(
|
|
22
|
-
const
|
|
23
|
-
|
|
20
|
+
const { items: t, onReorder: r, disabled: n = !1 } = s, [l, o] = L(null), [d, m] = L(null), [h, a] = L(!1), u = ve(null), p = G((_) => t.findIndex((C) => C.id === _), [t]), k = G(
|
|
21
|
+
(_, C) => {
|
|
22
|
+
const N = p(_), $ = p(C);
|
|
23
|
+
N < 0 || $ < 0 || N === $ || r == null || r(vn([...t], N, $).map((c) => c.id));
|
|
24
24
|
},
|
|
25
|
-
[t, p,
|
|
25
|
+
[t, p, r]
|
|
26
26
|
), f = G(() => {
|
|
27
27
|
o(null), m(null), a(!1), u.current = null;
|
|
28
28
|
}, []), g = G(
|
|
29
|
-
(
|
|
29
|
+
(_, C) => ({
|
|
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": l ===
|
|
36
|
-
onPointerDown: (
|
|
37
|
-
var
|
|
38
|
-
if (n ||
|
|
35
|
+
"aria-grabbed": l === _,
|
|
36
|
+
onPointerDown: (N) => {
|
|
37
|
+
var x, v;
|
|
38
|
+
if (n || N.button !== 0 && N.pointerType === "mouse")
|
|
39
39
|
return;
|
|
40
|
-
(v = (
|
|
40
|
+
(v = (x = N.currentTarget).setPointerCapture) == null || v.call(x, N.pointerId), o(_), a(!0), u.current = t.map((P) => P.id);
|
|
41
41
|
const $ = () => {
|
|
42
|
-
window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel",
|
|
43
|
-
},
|
|
44
|
-
window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel",
|
|
42
|
+
window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", c), a(!1), o(null), m(null);
|
|
43
|
+
}, c = () => {
|
|
44
|
+
window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", c), u.current && (r == null || r(u.current)), f();
|
|
45
45
|
};
|
|
46
|
-
window.addEventListener("pointerup", $), window.addEventListener("pointercancel",
|
|
46
|
+
window.addEventListener("pointerup", $), window.addEventListener("pointercancel", c);
|
|
47
47
|
},
|
|
48
48
|
onPointerEnter: () => {
|
|
49
|
-
n || !l || l ===
|
|
49
|
+
n || !l || l === _ || (m(_), k(l, _));
|
|
50
50
|
},
|
|
51
|
-
onKeyDown: (
|
|
51
|
+
onKeyDown: (N) => {
|
|
52
52
|
if (n)
|
|
53
53
|
return;
|
|
54
|
-
if (
|
|
55
|
-
|
|
54
|
+
if (N.key === " " || N.key === "Enter") {
|
|
55
|
+
N.preventDefault(), l === _ ? f() : (o(_), u.current = t.map((P) => P.id));
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
59
|
-
|
|
58
|
+
if (N.key === "Escape" && l === _) {
|
|
59
|
+
N.preventDefault(), u.current && (r == null || r(u.current)), f();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if (l !==
|
|
62
|
+
if (l !== _)
|
|
63
63
|
return;
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
64
|
+
const c = N.key === "ArrowLeft" || N.key === "ArrowUp" ? -1 : N.key === "ArrowRight" || N.key === "ArrowDown" ? 1 : 0;
|
|
65
|
+
if (c === 0)
|
|
66
66
|
return;
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
v < 0 || v >= t.length ||
|
|
67
|
+
N.preventDefault();
|
|
68
|
+
const x = p(_), v = x + c;
|
|
69
|
+
v < 0 || v >= t.length || r == null || r(vn([...t], x, v).map((P) => P.id));
|
|
70
70
|
},
|
|
71
|
-
...
|
|
71
|
+
...C ? { "aria-label": C } : {}
|
|
72
72
|
}),
|
|
73
|
-
[l,
|
|
73
|
+
[l, k, n, f, p, t, r]
|
|
74
74
|
);
|
|
75
75
|
return { activeId: l, overId: d, getHandleProps: g, dragging: h };
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
const [t,
|
|
77
|
+
const Bt = ({ item: s }) => {
|
|
78
|
+
const [t, r] = L(!1), n = s.thumbnailUrl ?? s.url;
|
|
79
79
|
return s.type === "video" ? /* @__PURE__ */ e("div", { className: "nice-event-media__video-thumb", children: /* @__PURE__ */ e(We, { size: 26 }) }) : t || !n ? /* @__PURE__ */ e("div", { className: "nice-event-media__broken", title: "Image unavailable", children: /* @__PURE__ */ e(Sn, { size: 24 }) }) : /* @__PURE__ */ e(
|
|
80
80
|
"img",
|
|
81
81
|
{
|
|
@@ -83,13 +83,13 @@ const Lt = ({ item: s }) => {
|
|
|
83
83
|
alt: s.caption ?? "",
|
|
84
84
|
className: "nice-event-media__thumb",
|
|
85
85
|
loading: "lazy",
|
|
86
|
-
onError: () =>
|
|
86
|
+
onError: () => r(!0)
|
|
87
87
|
}
|
|
88
88
|
);
|
|
89
|
-
},
|
|
90
|
-
function(t,
|
|
89
|
+
}, Rt = [], Xi = ee(
|
|
90
|
+
function(t, r) {
|
|
91
91
|
const {
|
|
92
|
-
items: n,
|
|
92
|
+
items: n = Rt,
|
|
93
93
|
onUpload: l,
|
|
94
94
|
onDelete: o,
|
|
95
95
|
onLike: d,
|
|
@@ -98,22 +98,22 @@ const Lt = ({ item: s }) => {
|
|
|
98
98
|
uploadEnabled: a = !0,
|
|
99
99
|
typeFilter: u = "all",
|
|
100
100
|
onReorder: p,
|
|
101
|
-
className:
|
|
101
|
+
className: k,
|
|
102
102
|
style: f
|
|
103
|
-
} = t, [g,
|
|
104
|
-
const
|
|
105
|
-
!
|
|
103
|
+
} = t, [g, _] = L(""), C = V(() => Lt(n), [n]), N = V(() => u === "all" ? C : C.filter((P) => P.type === u), [C, u]), $ = !!p && u === "all", c = Rn({ items: C, onReorder: p, disabled: !$ }), x = (P) => {
|
|
104
|
+
const w = P[0];
|
|
105
|
+
!w || !l || (l(w, g.trim() || void 0), _(""));
|
|
106
106
|
}, v = h === "list";
|
|
107
107
|
return /* @__PURE__ */ i(
|
|
108
108
|
"div",
|
|
109
109
|
{
|
|
110
|
-
ref:
|
|
111
|
-
className: `nice-event-media nice-event-media--${h} ${
|
|
110
|
+
ref: r,
|
|
111
|
+
className: `nice-event-media nice-event-media--${h} ${k ?? ""}`,
|
|
112
112
|
style: f,
|
|
113
113
|
children: [
|
|
114
114
|
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ i("h3", { children: [
|
|
115
115
|
"Media (",
|
|
116
|
-
|
|
116
|
+
N.length,
|
|
117
117
|
")"
|
|
118
118
|
] }) }),
|
|
119
119
|
a && l && /* @__PURE__ */ i("div", { className: "nice-event-media__upload", children: [
|
|
@@ -123,62 +123,62 @@ const Lt = ({ item: s }) => {
|
|
|
123
123
|
accept: "image/*,video/*",
|
|
124
124
|
multiple: !1,
|
|
125
125
|
imagePreview: !1,
|
|
126
|
-
onFilesSelected:
|
|
126
|
+
onFilesSelected: x
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
|
-
/* @__PURE__ */ e(J, { value: g, onChange:
|
|
129
|
+
/* @__PURE__ */ e(J, { value: g, onChange: _, placeholder: "Add a caption…" })
|
|
130
130
|
] }),
|
|
131
|
-
|
|
131
|
+
N.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-media__empty", children: "No media yet." }) : /* @__PURE__ */ e(
|
|
132
132
|
Ln,
|
|
133
133
|
{
|
|
134
134
|
columns: v ? 1 : void 0,
|
|
135
135
|
minColumnWidth: 200,
|
|
136
136
|
gap: 12,
|
|
137
137
|
align: "stretch",
|
|
138
|
-
children:
|
|
139
|
-
const
|
|
138
|
+
children: N.map((P, w) => {
|
|
139
|
+
const E = $ ? c.getHandleProps(P.id, `Move ${P.caption ?? `item ${w + 1}`}`) : null;
|
|
140
140
|
return /* @__PURE__ */ i(
|
|
141
141
|
"div",
|
|
142
142
|
{
|
|
143
|
-
className: `nice-event-media__card${v ? " nice-event-media__card--row" : ""}${
|
|
144
|
-
onClick: () => m == null ? void 0 : m(
|
|
145
|
-
onPointerEnter:
|
|
143
|
+
className: `nice-event-media__card${v ? " nice-event-media__card--row" : ""}${c.activeId === P.id ? " nice-event-media__card--dragging" : ""}`,
|
|
144
|
+
onClick: () => m == null ? void 0 : m(P),
|
|
145
|
+
onPointerEnter: E == null ? void 0 : E.onPointerEnter,
|
|
146
146
|
role: m ? "button" : void 0,
|
|
147
147
|
tabIndex: m ? 0 : void 0,
|
|
148
148
|
children: [
|
|
149
|
-
|
|
149
|
+
E && /* @__PURE__ */ e(
|
|
150
150
|
"span",
|
|
151
151
|
{
|
|
152
152
|
className: "nice-event-media__grip",
|
|
153
|
-
role:
|
|
154
|
-
tabIndex:
|
|
155
|
-
"aria-grabbed":
|
|
156
|
-
"aria-label":
|
|
157
|
-
draggable:
|
|
158
|
-
onPointerDown:
|
|
159
|
-
onKeyDown:
|
|
160
|
-
onClick: (
|
|
161
|
-
children: /* @__PURE__ */ e(
|
|
153
|
+
role: E.role,
|
|
154
|
+
tabIndex: E.tabIndex,
|
|
155
|
+
"aria-grabbed": E["aria-grabbed"],
|
|
156
|
+
"aria-label": E["aria-label"],
|
|
157
|
+
draggable: E.draggable,
|
|
158
|
+
onPointerDown: E.onPointerDown,
|
|
159
|
+
onKeyDown: E.onKeyDown,
|
|
160
|
+
onClick: (b) => b.stopPropagation(),
|
|
161
|
+
children: /* @__PURE__ */ e(Cn, { size: 14 })
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
|
-
/* @__PURE__ */ e(
|
|
164
|
+
/* @__PURE__ */ e(Bt, { item: P }),
|
|
165
165
|
/* @__PURE__ */ i("div", { className: "nice-event-media__body", children: [
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
P.caption && /* @__PURE__ */ e("span", { className: "nice-event-media__caption", children: P.caption }),
|
|
167
|
+
P.uploadedByName && /* @__PURE__ */ e("span", { className: "nice-event-media__uploader", children: P.uploadedByName }),
|
|
168
168
|
/* @__PURE__ */ i("div", { className: "nice-event-media__actions", children: [
|
|
169
169
|
d && /* @__PURE__ */ i(
|
|
170
170
|
"button",
|
|
171
171
|
{
|
|
172
172
|
type: "button",
|
|
173
173
|
className: "nice-event-media__action",
|
|
174
|
-
onClick: (
|
|
175
|
-
|
|
174
|
+
onClick: (b) => {
|
|
175
|
+
b.stopPropagation(), d(P.id);
|
|
176
176
|
},
|
|
177
177
|
"aria-label": "Like",
|
|
178
178
|
children: [
|
|
179
179
|
/* @__PURE__ */ e(gt, { size: 15 }),
|
|
180
180
|
" ",
|
|
181
|
-
|
|
181
|
+
P.likes ?? 0
|
|
182
182
|
]
|
|
183
183
|
}
|
|
184
184
|
),
|
|
@@ -187,18 +187,18 @@ const Lt = ({ item: s }) => {
|
|
|
187
187
|
{
|
|
188
188
|
type: "button",
|
|
189
189
|
className: "nice-event-media__action nice-event-media__action--danger",
|
|
190
|
-
onClick: (
|
|
191
|
-
|
|
190
|
+
onClick: (b) => {
|
|
191
|
+
b.stopPropagation(), o(P.id);
|
|
192
192
|
},
|
|
193
193
|
"aria-label": "Delete",
|
|
194
|
-
children: /* @__PURE__ */ e(
|
|
194
|
+
children: /* @__PURE__ */ e(Ee, { size: 15 })
|
|
195
195
|
}
|
|
196
196
|
)
|
|
197
197
|
] })
|
|
198
198
|
] })
|
|
199
199
|
]
|
|
200
200
|
},
|
|
201
|
-
|
|
201
|
+
P.id
|
|
202
202
|
);
|
|
203
203
|
})
|
|
204
204
|
}
|
|
@@ -210,7 +210,7 @@ const Lt = ({ item: s }) => {
|
|
|
210
210
|
), ye = ({
|
|
211
211
|
title: s,
|
|
212
212
|
description: t,
|
|
213
|
-
icon:
|
|
213
|
+
icon: r,
|
|
214
214
|
action: n,
|
|
215
215
|
className: l
|
|
216
216
|
}) => /* @__PURE__ */ e(
|
|
@@ -219,14 +219,14 @@ const Lt = ({ item: s }) => {
|
|
|
219
219
|
size: "sm",
|
|
220
220
|
title: s,
|
|
221
221
|
description: t,
|
|
222
|
-
icon:
|
|
222
|
+
icon: r,
|
|
223
223
|
action: n,
|
|
224
224
|
className: l
|
|
225
225
|
}
|
|
226
|
-
),
|
|
227
|
-
function(t,
|
|
226
|
+
), Ot = [], Vi = ee(
|
|
227
|
+
function(t, r) {
|
|
228
228
|
const {
|
|
229
|
-
items: n,
|
|
229
|
+
items: n = Ot,
|
|
230
230
|
layout: l = "grid",
|
|
231
231
|
onReorder: o,
|
|
232
232
|
onItemAdd: d,
|
|
@@ -235,71 +235,71 @@ const Lt = ({ item: s }) => {
|
|
|
235
235
|
onItemClick: a,
|
|
236
236
|
previewMode: u = !1,
|
|
237
237
|
transition: p = "fade",
|
|
238
|
-
defaultDurationMs:
|
|
238
|
+
defaultDurationMs: k = 3e3,
|
|
239
239
|
autoPlay: f = !0,
|
|
240
240
|
disabled: g = !1,
|
|
241
|
-
readOnly:
|
|
242
|
-
size:
|
|
243
|
-
className:
|
|
241
|
+
readOnly: _ = !1,
|
|
242
|
+
size: C = "md",
|
|
243
|
+
className: N,
|
|
244
244
|
style: $
|
|
245
|
-
} = t, [
|
|
245
|
+
} = t, [c, x] = L(0), [v, P] = L(null), [w, E] = L(""), b = g || _, M = !!o && !b, X = Rn({ items: n, onReorder: o, disabled: !M }), B = n.length > 0 ? Math.min(c, n.length - 1) : 0, D = n[B], U = (D == null ? void 0 : D.durationMs) ?? k;
|
|
246
246
|
Ue(() => {
|
|
247
247
|
if (!u || !f || n.length < 2)
|
|
248
248
|
return;
|
|
249
|
-
const
|
|
250
|
-
() =>
|
|
251
|
-
Math.max(250,
|
|
249
|
+
const A = window.setTimeout(
|
|
250
|
+
() => x((j) => (j + 1) % n.length),
|
|
251
|
+
Math.max(250, U)
|
|
252
252
|
);
|
|
253
|
-
return () => window.clearTimeout(
|
|
254
|
-
}, [u, f, n.length, B,
|
|
255
|
-
const
|
|
256
|
-
() => n.reduce((
|
|
257
|
-
[n,
|
|
258
|
-
),
|
|
259
|
-
h == null || h(
|
|
253
|
+
return () => window.clearTimeout(A);
|
|
254
|
+
}, [u, f, n.length, B, U]);
|
|
255
|
+
const S = V(
|
|
256
|
+
() => n.reduce((A, j) => A + (j.durationMs ?? k), 0),
|
|
257
|
+
[n, k]
|
|
258
|
+
), y = (A) => {
|
|
259
|
+
h == null || h(A, w), P(null), E("");
|
|
260
260
|
};
|
|
261
|
-
return n.length === 0 ? /* @__PURE__ */ e("div", { ref:
|
|
261
|
+
return n.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-media-collage ${N ?? ""}`, style: $, children: /* @__PURE__ */ e(
|
|
262
262
|
ye,
|
|
263
263
|
{
|
|
264
264
|
icon: /* @__PURE__ */ e(Sn, { size: 28 }),
|
|
265
265
|
title: "Nothing in the collage yet",
|
|
266
266
|
description: "Add photos or video to start arranging them.",
|
|
267
|
-
action: d && !
|
|
267
|
+
action: d && !b ? /* @__PURE__ */ e(Qe, { accept: "image/*,video/*", multiple: !0, onFilesSelected: d }) : void 0
|
|
268
268
|
}
|
|
269
269
|
) }) : u ? /* @__PURE__ */ i(
|
|
270
270
|
"div",
|
|
271
271
|
{
|
|
272
|
-
ref:
|
|
273
|
-
className: `nice-media-collage nice-media-collage--preview nice-media-collage--${p} ${
|
|
272
|
+
ref: r,
|
|
273
|
+
className: `nice-media-collage nice-media-collage--preview nice-media-collage--${p} ${N ?? ""}`,
|
|
274
274
|
style: $,
|
|
275
275
|
children: [
|
|
276
276
|
/* @__PURE__ */ i("div", { className: "nice-media-collage__stage", "aria-live": "polite", children: [
|
|
277
|
-
(
|
|
277
|
+
(D == null ? void 0 : D.type) === "video" ? /* @__PURE__ */ e(
|
|
278
278
|
"video",
|
|
279
279
|
{
|
|
280
280
|
className: "nice-media-collage__slide",
|
|
281
|
-
src:
|
|
281
|
+
src: D.mediaUrl,
|
|
282
282
|
controls: !0
|
|
283
283
|
},
|
|
284
|
-
|
|
284
|
+
D.id
|
|
285
285
|
) : /* @__PURE__ */ e(
|
|
286
286
|
"img",
|
|
287
287
|
{
|
|
288
288
|
className: "nice-media-collage__slide",
|
|
289
|
-
src:
|
|
290
|
-
alt: (
|
|
289
|
+
src: D == null ? void 0 : D.mediaUrl,
|
|
290
|
+
alt: (D == null ? void 0 : D.caption) ?? ""
|
|
291
291
|
},
|
|
292
|
-
|
|
292
|
+
D == null ? void 0 : D.id
|
|
293
293
|
),
|
|
294
|
-
(
|
|
294
|
+
(D == null ? void 0 : D.caption) && /* @__PURE__ */ e("p", { className: "nice-media-collage__slide-caption", children: D.caption })
|
|
295
295
|
] }),
|
|
296
296
|
/* @__PURE__ */ i("div", { className: "nice-media-collage__playbar", children: [
|
|
297
297
|
/* @__PURE__ */ e(
|
|
298
|
-
|
|
298
|
+
F,
|
|
299
299
|
{
|
|
300
300
|
size: "sm",
|
|
301
301
|
variant: "ghost",
|
|
302
|
-
onClick: () =>
|
|
302
|
+
onClick: () => x((A) => (A - 1 + n.length) % n.length),
|
|
303
303
|
children: "Previous"
|
|
304
304
|
}
|
|
305
305
|
),
|
|
@@ -309,11 +309,11 @@ const Lt = ({ item: s }) => {
|
|
|
309
309
|
n.length
|
|
310
310
|
] }),
|
|
311
311
|
/* @__PURE__ */ e(
|
|
312
|
-
|
|
312
|
+
F,
|
|
313
313
|
{
|
|
314
314
|
size: "sm",
|
|
315
315
|
variant: "ghost",
|
|
316
|
-
onClick: () =>
|
|
316
|
+
onClick: () => x((A) => (A + 1) % n.length),
|
|
317
317
|
children: "Next"
|
|
318
318
|
}
|
|
319
319
|
)
|
|
@@ -323,8 +323,8 @@ const Lt = ({ item: s }) => {
|
|
|
323
323
|
) : /* @__PURE__ */ i(
|
|
324
324
|
"div",
|
|
325
325
|
{
|
|
326
|
-
ref:
|
|
327
|
-
className: `nice-media-collage nice-media-collage--${l} nice-media-collage--${
|
|
326
|
+
ref: r,
|
|
327
|
+
className: `nice-media-collage nice-media-collage--${l} nice-media-collage--${C} ${N ?? ""}`,
|
|
328
328
|
style: $,
|
|
329
329
|
children: [
|
|
330
330
|
/* @__PURE__ */ i("div", { className: "nice-media-collage__toolbar", children: [
|
|
@@ -346,10 +346,10 @@ const Lt = ({ item: s }) => {
|
|
|
346
346
|
" item",
|
|
347
347
|
n.length === 1 ? "" : "s",
|
|
348
348
|
" · ",
|
|
349
|
-
Math.round(
|
|
349
|
+
Math.round(S / 1e3),
|
|
350
350
|
"s"
|
|
351
351
|
] }),
|
|
352
|
-
d && !
|
|
352
|
+
d && !b && /* @__PURE__ */ e(
|
|
353
353
|
Qe,
|
|
354
354
|
{
|
|
355
355
|
accept: "image/*,video/*",
|
|
@@ -364,13 +364,13 @@ const Lt = ({ item: s }) => {
|
|
|
364
364
|
{
|
|
365
365
|
className: "nice-media-collage__tiles",
|
|
366
366
|
"aria-label": "Collage order",
|
|
367
|
-
"aria-busy":
|
|
368
|
-
children: n.map((
|
|
369
|
-
const W =
|
|
367
|
+
"aria-busy": X.dragging,
|
|
368
|
+
children: n.map((A, j) => {
|
|
369
|
+
const W = M ? X.getHandleProps(A.id, `Move ${A.caption ?? `item ${j + 1}`}`) : null;
|
|
370
370
|
return /* @__PURE__ */ i(
|
|
371
371
|
"li",
|
|
372
372
|
{
|
|
373
|
-
className: `nice-media-collage__tile${
|
|
373
|
+
className: `nice-media-collage__tile${X.activeId === A.id ? " nice-media-collage__tile--active" : ""}${X.overId === A.id ? " nice-media-collage__tile--over" : ""}`,
|
|
374
374
|
onPointerEnter: W == null ? void 0 : W.onPointerEnter,
|
|
375
375
|
children: [
|
|
376
376
|
/* @__PURE__ */ e("span", { className: "nice-media-collage__index", "aria-hidden": "true", children: j + 1 }),
|
|
@@ -379,30 +379,30 @@ const Lt = ({ item: s }) => {
|
|
|
379
379
|
{
|
|
380
380
|
type: "button",
|
|
381
381
|
className: "nice-media-collage__thumb-button",
|
|
382
|
-
onClick: () => a == null ? void 0 : a(
|
|
382
|
+
onClick: () => a == null ? void 0 : a(A),
|
|
383
383
|
disabled: !a,
|
|
384
|
-
children:
|
|
384
|
+
children: A.type === "video" ? /* @__PURE__ */ e("span", { className: "nice-media-collage__video-thumb", children: /* @__PURE__ */ e(We, { size: 22 }) }) : /* @__PURE__ */ e(
|
|
385
385
|
"img",
|
|
386
386
|
{
|
|
387
387
|
className: "nice-media-collage__thumb",
|
|
388
|
-
src:
|
|
389
|
-
alt:
|
|
388
|
+
src: A.mediaUrl,
|
|
389
|
+
alt: A.caption ?? "",
|
|
390
390
|
loading: "lazy"
|
|
391
391
|
}
|
|
392
392
|
)
|
|
393
393
|
}
|
|
394
394
|
),
|
|
395
|
-
v ===
|
|
395
|
+
v === A.id ? /* @__PURE__ */ e(
|
|
396
396
|
J,
|
|
397
397
|
{
|
|
398
|
-
value:
|
|
399
|
-
onChange:
|
|
398
|
+
value: w,
|
|
399
|
+
onChange: E,
|
|
400
400
|
placeholder: "Caption",
|
|
401
401
|
autoFocus: !0,
|
|
402
402
|
size: "sm",
|
|
403
|
-
onBlur: () =>
|
|
404
|
-
onKeyDown: (
|
|
405
|
-
|
|
403
|
+
onBlur: () => y(A.id),
|
|
404
|
+
onKeyDown: (z) => {
|
|
405
|
+
z.key === "Enter" && y(A.id), z.key === "Escape" && P(null);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
) : /* @__PURE__ */ e(
|
|
@@ -410,11 +410,11 @@ const Lt = ({ item: s }) => {
|
|
|
410
410
|
{
|
|
411
411
|
type: "button",
|
|
412
412
|
className: "nice-media-collage__caption",
|
|
413
|
-
disabled: !h ||
|
|
413
|
+
disabled: !h || b,
|
|
414
414
|
onClick: () => {
|
|
415
|
-
A
|
|
415
|
+
P(A.id), E(A.caption ?? "");
|
|
416
416
|
},
|
|
417
|
-
children:
|
|
417
|
+
children: A.caption || /* @__PURE__ */ e("em", { children: "Add a caption" })
|
|
418
418
|
}
|
|
419
419
|
),
|
|
420
420
|
/* @__PURE__ */ i("div", { className: "nice-media-collage__tile-actions", children: [
|
|
@@ -429,29 +429,29 @@ const Lt = ({ item: s }) => {
|
|
|
429
429
|
draggable: W.draggable,
|
|
430
430
|
onPointerDown: W.onPointerDown,
|
|
431
431
|
onKeyDown: W.onKeyDown,
|
|
432
|
-
children: /* @__PURE__ */ e(
|
|
432
|
+
children: /* @__PURE__ */ e(Cn, { size: 14 })
|
|
433
433
|
}
|
|
434
434
|
),
|
|
435
|
-
m && !
|
|
436
|
-
|
|
435
|
+
m && !_ && /* @__PURE__ */ e(
|
|
436
|
+
F,
|
|
437
437
|
{
|
|
438
438
|
size: "sm",
|
|
439
439
|
variant: "ghost",
|
|
440
|
-
ariaLabel: `Remove ${
|
|
440
|
+
ariaLabel: `Remove ${A.caption ?? `item ${j + 1}`}`,
|
|
441
441
|
disabled: g,
|
|
442
|
-
onClick: () => m(
|
|
443
|
-
children: /* @__PURE__ */ e(
|
|
442
|
+
onClick: () => m(A.id),
|
|
443
|
+
children: /* @__PURE__ */ e(Ee, { size: 14 })
|
|
444
444
|
}
|
|
445
445
|
)
|
|
446
446
|
] })
|
|
447
447
|
]
|
|
448
448
|
},
|
|
449
|
-
|
|
449
|
+
A.id
|
|
450
450
|
);
|
|
451
451
|
})
|
|
452
452
|
}
|
|
453
453
|
),
|
|
454
|
-
d && !
|
|
454
|
+
d && !b && n.length > 0 && /* @__PURE__ */ i("p", { className: "nice-media-collage__hint", children: [
|
|
455
455
|
/* @__PURE__ */ e(zn, { size: 12 }),
|
|
456
456
|
" Drag a tile, or focus one and press Space then the arrow keys."
|
|
457
457
|
] })
|
|
@@ -464,7 +464,7 @@ function Be(s) {
|
|
|
464
464
|
const t = s.toLowerCase();
|
|
465
465
|
return ["active", "live", "published", "completed", "confirmed"].includes(t) ? "success" : ["cancelled", "canceled", "rejected", "failed"].includes(t) ? "error" : ["scheduled", "pending", "planning"].includes(t) ? "info" : ["draft", "archived"].includes(t) ? "secondary" : "warning";
|
|
466
466
|
}
|
|
467
|
-
const
|
|
467
|
+
const Ut = {
|
|
468
468
|
micro: [],
|
|
469
469
|
compact: ["details", "location", "budget"],
|
|
470
470
|
normal: ["details", "location", "schedule", "participants", "tasks", "surveys", "budget"],
|
|
@@ -480,8 +480,8 @@ const Bt = {
|
|
|
480
480
|
"documents",
|
|
481
481
|
"settings"
|
|
482
482
|
]
|
|
483
|
-
},
|
|
484
|
-
function(t,
|
|
483
|
+
}, Fi = ee(
|
|
484
|
+
function(t, r) {
|
|
485
485
|
var dn, un, mn, hn, pn, gn;
|
|
486
486
|
const {
|
|
487
487
|
event: n,
|
|
@@ -493,59 +493,59 @@ const Bt = {
|
|
|
493
493
|
vendors: a = [],
|
|
494
494
|
documents: u = [],
|
|
495
495
|
displayMode: p = "normal",
|
|
496
|
-
tabs:
|
|
496
|
+
tabs: k,
|
|
497
497
|
activeTab: f,
|
|
498
498
|
onTabChange: g,
|
|
499
|
-
tabsIconOnly:
|
|
500
|
-
tabsCentered:
|
|
501
|
-
countLocation:
|
|
499
|
+
tabsIconOnly: _ = !0,
|
|
500
|
+
tabsCentered: C = "auto",
|
|
501
|
+
countLocation: N = "bottom",
|
|
502
502
|
showDetails: $ = !0,
|
|
503
|
-
showLocation:
|
|
504
|
-
showSchedule:
|
|
503
|
+
showLocation: c = !0,
|
|
504
|
+
showSchedule: x = !0,
|
|
505
505
|
showParticipants: v = !0,
|
|
506
|
-
showTasks:
|
|
507
|
-
showSurveys:
|
|
508
|
-
showVendors:
|
|
509
|
-
showBudget:
|
|
510
|
-
showDocuments:
|
|
511
|
-
showSettings:
|
|
506
|
+
showTasks: P = !0,
|
|
507
|
+
showSurveys: w = !0,
|
|
508
|
+
showVendors: E = !0,
|
|
509
|
+
showBudget: b = !0,
|
|
510
|
+
showDocuments: M = !0,
|
|
511
|
+
showSettings: X = !0,
|
|
512
512
|
editable: B = !1,
|
|
513
|
-
onSave:
|
|
514
|
-
onPublish:
|
|
515
|
-
onShare:
|
|
516
|
-
onExport:
|
|
517
|
-
onUpdateEvent:
|
|
513
|
+
onSave: D,
|
|
514
|
+
onPublish: U,
|
|
515
|
+
onShare: S,
|
|
516
|
+
onExport: y,
|
|
517
|
+
onUpdateEvent: A,
|
|
518
518
|
onUpdateLocation: j,
|
|
519
519
|
onAddSurvey: W,
|
|
520
|
-
onSurveyRespond:
|
|
520
|
+
onSurveyRespond: z,
|
|
521
521
|
onAddBilling: Y,
|
|
522
522
|
className: q,
|
|
523
523
|
style: Q
|
|
524
|
-
} = t, [
|
|
524
|
+
} = t, [R, ne] = L(n.title), [H, _e] = L(n.description ?? ""), [ce, me] = L(n.startDate ?? ""), [Ne, De] = L(n.endDate ?? ""), [be, he] = L(((dn = n.location) == null ? void 0 : dn.name) ?? ""), [we, je] = L(((un = n.location) == null ? void 0 : un.address) ?? ""), [pe, oe] = L(((mn = n.location) == null ? void 0 : mn.virtualUrl) ?? ""), [re, Ce] = L(((hn = n.location) == null ? void 0 : hn.isVirtual) ?? !1), [ge, Se] = L(""), [fe, Ge] = L("single"), [ze, $e] = L(""), [de, Pe] = L(""), [xe, T] = L(""), [O, K] = L("PLN"), Z = {
|
|
525
525
|
details: $,
|
|
526
|
-
location:
|
|
527
|
-
schedule:
|
|
526
|
+
location: c,
|
|
527
|
+
schedule: x,
|
|
528
528
|
participants: v,
|
|
529
|
-
tasks:
|
|
530
|
-
surveys:
|
|
531
|
-
vendors:
|
|
532
|
-
budget:
|
|
533
|
-
documents:
|
|
534
|
-
settings:
|
|
535
|
-
}, ue = (
|
|
536
|
-
(
|
|
537
|
-
const le =
|
|
538
|
-
f === void 0 &&
|
|
529
|
+
tasks: P,
|
|
530
|
+
surveys: w,
|
|
531
|
+
vendors: E,
|
|
532
|
+
budget: b,
|
|
533
|
+
documents: M,
|
|
534
|
+
settings: X
|
|
535
|
+
}, ue = (k ?? Ut[p]).filter((I) => Z[I] !== !1), [Le, Vn] = L(ue[0] ?? "details"), Fn = f ?? Le, Wn = G(
|
|
536
|
+
(I) => {
|
|
537
|
+
const le = I;
|
|
538
|
+
f === void 0 && Vn(le), g == null || g(le);
|
|
539
539
|
},
|
|
540
540
|
[f, g]
|
|
541
541
|
), qn = G(() => {
|
|
542
|
-
|
|
543
|
-
title:
|
|
542
|
+
A == null || A({
|
|
543
|
+
title: R,
|
|
544
544
|
description: H || void 0,
|
|
545
545
|
startDate: ce || void 0,
|
|
546
546
|
endDate: Ne || void 0
|
|
547
547
|
});
|
|
548
|
-
}, [
|
|
548
|
+
}, [R, H, ce, Ne, A]), jn = G(() => {
|
|
549
549
|
j == null || j({
|
|
550
550
|
name: be,
|
|
551
551
|
address: we || void 0,
|
|
@@ -555,26 +555,26 @@ const Bt = {
|
|
|
555
555
|
}, [be, we, pe, re, j]), Gn = G(() => {
|
|
556
556
|
if (!ge.trim() || !W)
|
|
557
557
|
return;
|
|
558
|
-
const
|
|
559
|
-
W(ge.trim(), fe,
|
|
558
|
+
const I = ze.split(",").map((le) => le.trim()).filter(Boolean);
|
|
559
|
+
W(ge.trim(), fe, I.length > 0 ? I : void 0), Se(""), $e("");
|
|
560
560
|
}, [ge, fe, ze, W]), Kn = G(() => {
|
|
561
561
|
!de.trim() || !Y || (Y({
|
|
562
562
|
label: de.trim(),
|
|
563
563
|
amount: parseFloat(xe) || 0,
|
|
564
|
-
currency:
|
|
565
|
-
}),
|
|
566
|
-
}, [de, xe,
|
|
567
|
-
() => d.map((
|
|
568
|
-
label:
|
|
569
|
-
amount:
|
|
564
|
+
currency: O
|
|
565
|
+
}), Pe(""), T(""));
|
|
566
|
+
}, [de, xe, O, Y]), Hn = V(
|
|
567
|
+
() => d.map((I) => ({
|
|
568
|
+
label: I.label,
|
|
569
|
+
amount: I.amount
|
|
570
570
|
})),
|
|
571
571
|
[d]
|
|
572
|
-
), Qn =
|
|
572
|
+
), Qn = V(() => d.reduce((I, le) => I + le.amount, 0), [d]), Zn = ((pn = d[0]) == null ? void 0 : pn.currency) ?? "PLN", Jn = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
573
573
|
/* @__PURE__ */ e(
|
|
574
574
|
J,
|
|
575
575
|
{
|
|
576
576
|
label: "Title",
|
|
577
|
-
value:
|
|
577
|
+
value: R,
|
|
578
578
|
onChange: ne,
|
|
579
579
|
readOnly: !B
|
|
580
580
|
}
|
|
@@ -598,7 +598,7 @@ const Bt = {
|
|
|
598
598
|
className: "nice-input",
|
|
599
599
|
type: "datetime-local",
|
|
600
600
|
value: ce,
|
|
601
|
-
onChange: (
|
|
601
|
+
onChange: (I) => me(I.target.value),
|
|
602
602
|
readOnly: !B
|
|
603
603
|
}
|
|
604
604
|
)
|
|
@@ -611,14 +611,14 @@ const Bt = {
|
|
|
611
611
|
className: "nice-input",
|
|
612
612
|
type: "datetime-local",
|
|
613
613
|
value: Ne,
|
|
614
|
-
onChange: (
|
|
614
|
+
onChange: (I) => De(I.target.value),
|
|
615
615
|
readOnly: !B
|
|
616
616
|
}
|
|
617
617
|
)
|
|
618
618
|
] })
|
|
619
619
|
] }),
|
|
620
620
|
B && /* @__PURE__ */ e(
|
|
621
|
-
|
|
621
|
+
F,
|
|
622
622
|
{
|
|
623
623
|
variant: "primary",
|
|
624
624
|
leftIcon: /* @__PURE__ */ e(ie, { name: "check", size: "sm" }),
|
|
@@ -632,7 +632,7 @@ const Bt = {
|
|
|
632
632
|
{
|
|
633
633
|
label: "Virtual event",
|
|
634
634
|
checked: re,
|
|
635
|
-
onChange:
|
|
635
|
+
onChange: Ce,
|
|
636
636
|
disabled: !B
|
|
637
637
|
}
|
|
638
638
|
),
|
|
@@ -663,7 +663,7 @@ const Bt = {
|
|
|
663
663
|
}
|
|
664
664
|
),
|
|
665
665
|
B && /* @__PURE__ */ e(
|
|
666
|
-
|
|
666
|
+
F,
|
|
667
667
|
{
|
|
668
668
|
variant: "primary",
|
|
669
669
|
leftIcon: /* @__PURE__ */ e(ie, { name: "check", size: "sm" }),
|
|
@@ -671,33 +671,33 @@ const Bt = {
|
|
|
671
671
|
children: "Save location"
|
|
672
672
|
}
|
|
673
673
|
)
|
|
674
|
-
] }), nt = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children: l.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No participants yet." }) : /* @__PURE__ */ i(
|
|
675
|
-
/* @__PURE__ */ e(fn, { max: 8, children: l.map((
|
|
676
|
-
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: l.map((
|
|
677
|
-
/* @__PURE__ */ e(Oe, { name:
|
|
678
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children:
|
|
679
|
-
/* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: Be(
|
|
680
|
-
] },
|
|
674
|
+
] }), nt = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children: l.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No participants yet." }) : /* @__PURE__ */ i(Fe, { children: [
|
|
675
|
+
/* @__PURE__ */ e(fn, { max: 8, children: l.map((I) => /* @__PURE__ */ e(Oe, { name: I.name, src: I.avatarUrl }, I.id)) }),
|
|
676
|
+
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: l.map((I) => /* @__PURE__ */ i("li", { className: "nice-event-planning__participant", children: [
|
|
677
|
+
/* @__PURE__ */ e(Oe, { name: I.name, src: I.avatarUrl, size: "sm" }),
|
|
678
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children: I.name }),
|
|
679
|
+
/* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: Be(I.status), children: I.status })
|
|
680
|
+
] }, I.id)) })
|
|
681
681
|
] }) }), tt = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
682
|
-
o.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No surveys yet." }) : o.map((
|
|
683
|
-
/* @__PURE__ */ e("strong", { children:
|
|
682
|
+
o.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No surveys yet." }) : o.map((I) => /* @__PURE__ */ i("div", { className: "nice-event-planning__survey", children: [
|
|
683
|
+
/* @__PURE__ */ e("strong", { children: I.question }),
|
|
684
684
|
" ",
|
|
685
|
-
/* @__PURE__ */ e(te, { size: "xs", outline: !0, variant: "info", children:
|
|
686
|
-
|
|
687
|
-
|
|
685
|
+
/* @__PURE__ */ e(te, { size: "xs", outline: !0, variant: "info", children: I.type }),
|
|
686
|
+
I.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: I.options.map((le, pt) => /* @__PURE__ */ e(
|
|
687
|
+
F,
|
|
688
688
|
{
|
|
689
689
|
size: "sm",
|
|
690
690
|
variant: "outline",
|
|
691
|
-
onClick: () =>
|
|
691
|
+
onClick: () => z == null ? void 0 : z(I.id, le),
|
|
692
692
|
children: le
|
|
693
693
|
},
|
|
694
694
|
pt
|
|
695
695
|
)) }),
|
|
696
|
-
|
|
697
|
-
|
|
696
|
+
I.responses && /* @__PURE__ */ i("span", { className: "nice-event-planning__muted", children: [
|
|
697
|
+
I.responses.length,
|
|
698
698
|
" responses"
|
|
699
699
|
] })
|
|
700
|
-
] },
|
|
700
|
+
] }, I.id)),
|
|
701
701
|
B && W && /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
702
702
|
/* @__PURE__ */ e(
|
|
703
703
|
J,
|
|
@@ -713,7 +713,7 @@ const Bt = {
|
|
|
713
713
|
{
|
|
714
714
|
label: "Type",
|
|
715
715
|
value: fe,
|
|
716
|
-
onChange: (
|
|
716
|
+
onChange: (I) => Ge(I),
|
|
717
717
|
options: [
|
|
718
718
|
{ value: "single", label: "Single choice" },
|
|
719
719
|
{ value: "multiple", label: "Multiple choice" },
|
|
@@ -732,7 +732,7 @@ const Bt = {
|
|
|
732
732
|
}
|
|
733
733
|
),
|
|
734
734
|
/* @__PURE__ */ e(
|
|
735
|
-
|
|
735
|
+
F,
|
|
736
736
|
{
|
|
737
737
|
variant: "primary",
|
|
738
738
|
leftIcon: /* @__PURE__ */ e(ie, { name: "plus", size: "sm" }),
|
|
@@ -744,7 +744,7 @@ const Bt = {
|
|
|
744
744
|
] })
|
|
745
745
|
] }), it = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
746
746
|
d.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No billing items yet." }) : /* @__PURE__ */ e(
|
|
747
|
-
|
|
747
|
+
Pt,
|
|
748
748
|
{
|
|
749
749
|
lines: [...Hn, { label: "Total", amount: Qn, isSummary: !0 }],
|
|
750
750
|
currency: Zn
|
|
@@ -756,7 +756,7 @@ const Bt = {
|
|
|
756
756
|
{
|
|
757
757
|
label: "Item",
|
|
758
758
|
value: de,
|
|
759
|
-
onChange:
|
|
759
|
+
onChange: Pe,
|
|
760
760
|
placeholder: "Catering"
|
|
761
761
|
}
|
|
762
762
|
),
|
|
@@ -773,13 +773,13 @@ const Bt = {
|
|
|
773
773
|
Te,
|
|
774
774
|
{
|
|
775
775
|
label: "Currency",
|
|
776
|
-
value:
|
|
777
|
-
onChange: (
|
|
776
|
+
value: O,
|
|
777
|
+
onChange: (I) => K(I),
|
|
778
778
|
options: ["PLN", "EUR", "USD", "GBP"]
|
|
779
779
|
}
|
|
780
780
|
),
|
|
781
781
|
/* @__PURE__ */ e(
|
|
782
|
-
|
|
782
|
+
F,
|
|
783
783
|
{
|
|
784
784
|
variant: "primary",
|
|
785
785
|
leftIcon: /* @__PURE__ */ e(ie, { name: "plus", size: "sm" }),
|
|
@@ -807,37 +807,37 @@ const Bt = {
|
|
|
807
807
|
" · Created ",
|
|
808
808
|
new Date(n.createdAt).toLocaleDateString()
|
|
809
809
|
] })
|
|
810
|
-
] }), st = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: m.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No agenda items yet." }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__schedule", children: m.map((
|
|
810
|
+
] }), st = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: m.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No agenda items yet." }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__schedule", children: m.map((I) => /* @__PURE__ */ i("li", { className: "nice-event-planning__schedule-item", children: [
|
|
811
811
|
/* @__PURE__ */ i("span", { className: "nice-event-planning__schedule-time", children: [
|
|
812
812
|
/* @__PURE__ */ e(ie, { name: "clock", size: "sm" }),
|
|
813
|
-
|
|
814
|
-
|
|
813
|
+
I.startTime ?? "",
|
|
814
|
+
I.endTime ? `–${I.endTime}` : ""
|
|
815
815
|
] }),
|
|
816
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__schedule-title", children:
|
|
817
|
-
|
|
818
|
-
] },
|
|
819
|
-
/* @__PURE__ */ e(Ke, { label:
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
] },
|
|
816
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__schedule-title", children: I.title }),
|
|
817
|
+
I.location && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: I.location })
|
|
818
|
+
] }, I.id)) }) }), rt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: h.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No tasks yet." }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__tasks", children: h.map((I) => /* @__PURE__ */ i("li", { className: "nice-event-planning__task", children: [
|
|
819
|
+
/* @__PURE__ */ e(Ke, { label: I.title, checked: I.done ?? !1, disabled: !B }),
|
|
820
|
+
I.assigneeName && /* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: "info", children: I.assigneeName }),
|
|
821
|
+
I.dueDate && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: I.dueDate })
|
|
822
|
+
] }, I.id)) }) }), ct = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: a.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No vendors yet." }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__vendors", children: a.map((I) => /* @__PURE__ */ i("li", { className: "nice-event-planning__vendor", children: [
|
|
823
823
|
/* @__PURE__ */ e(ie, { name: "briefcase", size: "sm" }),
|
|
824
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__vendor-name", children:
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
824
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__vendor-name", children: I.name }),
|
|
825
|
+
I.category && /* @__PURE__ */ e("span", { className: "nice-event-planning__muted", children: I.category }),
|
|
826
|
+
I.status && /* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: Be(I.status), children: I.status }),
|
|
827
|
+
I.cost != null && /* @__PURE__ */ i("span", { className: "nice-event-planning__vendor-cost", children: [
|
|
828
|
+
I.cost,
|
|
829
829
|
" ",
|
|
830
|
-
|
|
830
|
+
I.currency ?? ""
|
|
831
831
|
] })
|
|
832
|
-
] },
|
|
832
|
+
] }, I.id)) }) }), lt = /* @__PURE__ */ e("div", { className: "nice-event-planning__list", children: u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No documents yet." }) : /* @__PURE__ */ e("ul", { className: "nice-event-planning__documents", children: u.map((I) => /* @__PURE__ */ i("li", { className: "nice-event-planning__document", children: [
|
|
833
833
|
/* @__PURE__ */ e(ie, { name: "file", size: "sm" }),
|
|
834
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__document-name", children:
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
834
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__document-name", children: I.name }),
|
|
835
|
+
I.fileType && /* @__PURE__ */ e(te, { size: "xs", outline: !0, variant: "secondary", children: I.fileType }),
|
|
836
|
+
I.sizeKb != null && /* @__PURE__ */ i("span", { className: "nice-event-planning__muted", children: [
|
|
837
|
+
I.sizeKb,
|
|
838
838
|
" KB"
|
|
839
839
|
] })
|
|
840
|
-
] },
|
|
840
|
+
] }, I.id)) }) }), ot = {
|
|
841
841
|
details: Jn,
|
|
842
842
|
location: et,
|
|
843
843
|
schedule: st,
|
|
@@ -867,12 +867,12 @@ const Bt = {
|
|
|
867
867
|
vendors: a.length || void 0,
|
|
868
868
|
budget: d.length || void 0,
|
|
869
869
|
documents: u.length || void 0
|
|
870
|
-
}, mt = ue.map((
|
|
871
|
-
id:
|
|
872
|
-
label:
|
|
873
|
-
icon: /* @__PURE__ */ e(ie, { name: dt[
|
|
874
|
-
badge: ut[
|
|
875
|
-
content: ot[
|
|
870
|
+
}, mt = ue.map((I) => ({
|
|
871
|
+
id: I,
|
|
872
|
+
label: I.charAt(0).toUpperCase() + I.slice(1),
|
|
873
|
+
icon: /* @__PURE__ */ e(ie, { name: dt[I], size: "sm" }),
|
|
874
|
+
badge: ut[I],
|
|
875
|
+
content: ot[I]
|
|
876
876
|
})), ht = /* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar", children: [
|
|
877
877
|
/* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar-title", children: [
|
|
878
878
|
/* @__PURE__ */ e(ie, { name: "calendar", size: "md" }),
|
|
@@ -881,43 +881,43 @@ const Bt = {
|
|
|
881
881
|
] }),
|
|
882
882
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__toolbar-spacer" }),
|
|
883
883
|
/* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar-actions", children: [
|
|
884
|
-
|
|
885
|
-
|
|
884
|
+
D && /* @__PURE__ */ e(
|
|
885
|
+
F,
|
|
886
886
|
{
|
|
887
887
|
size: "sm",
|
|
888
888
|
variant: "primary",
|
|
889
889
|
leftIcon: /* @__PURE__ */ e(ie, { name: "check", size: "sm" }),
|
|
890
|
-
onClick: () =>
|
|
890
|
+
onClick: () => D({ title: R, description: H }),
|
|
891
891
|
children: "Save"
|
|
892
892
|
}
|
|
893
893
|
),
|
|
894
|
-
|
|
895
|
-
|
|
894
|
+
U && /* @__PURE__ */ e(
|
|
895
|
+
F,
|
|
896
896
|
{
|
|
897
897
|
size: "sm",
|
|
898
898
|
variant: "success",
|
|
899
899
|
leftIcon: /* @__PURE__ */ e(ie, { name: "upload", size: "sm" }),
|
|
900
|
-
onClick:
|
|
900
|
+
onClick: U,
|
|
901
901
|
children: "Publish"
|
|
902
902
|
}
|
|
903
903
|
),
|
|
904
|
-
|
|
905
|
-
|
|
904
|
+
S && /* @__PURE__ */ e(
|
|
905
|
+
F,
|
|
906
906
|
{
|
|
907
907
|
size: "sm",
|
|
908
908
|
variant: "ghost",
|
|
909
909
|
leftIcon: /* @__PURE__ */ e(ie, { name: "link", size: "sm" }),
|
|
910
|
-
onClick:
|
|
910
|
+
onClick: S,
|
|
911
911
|
children: "Share"
|
|
912
912
|
}
|
|
913
913
|
),
|
|
914
|
-
|
|
915
|
-
|
|
914
|
+
y && /* @__PURE__ */ e(
|
|
915
|
+
F,
|
|
916
916
|
{
|
|
917
917
|
size: "sm",
|
|
918
918
|
variant: "ghost",
|
|
919
919
|
leftIcon: /* @__PURE__ */ e(ie, { name: "download", size: "sm" }),
|
|
920
|
-
onClick:
|
|
920
|
+
onClick: y,
|
|
921
921
|
children: "Export"
|
|
922
922
|
}
|
|
923
923
|
)
|
|
@@ -926,7 +926,7 @@ const Bt = {
|
|
|
926
926
|
return p === "micro" ? /* @__PURE__ */ e(
|
|
927
927
|
"div",
|
|
928
928
|
{
|
|
929
|
-
ref:
|
|
929
|
+
ref: r,
|
|
930
930
|
className: `nice-event-planning nice-event-planning--micro ${q ?? ""}`,
|
|
931
931
|
style: Q,
|
|
932
932
|
children: /* @__PURE__ */ i("div", { className: "nice-event-planning__micro", children: [
|
|
@@ -939,26 +939,26 @@ const Bt = {
|
|
|
939
939
|
] })
|
|
940
940
|
] }),
|
|
941
941
|
/* @__PURE__ */ e(te, { size: "sm", variant: Be(n.status), children: n.status }),
|
|
942
|
-
l.length > 0 && /* @__PURE__ */ e(fn, { max: 4, size: "sm", children: l.map((
|
|
942
|
+
l.length > 0 && /* @__PURE__ */ e(fn, { max: 4, size: "sm", children: l.map((I) => /* @__PURE__ */ e(Oe, { name: I.name, src: I.avatarUrl, size: "sm" }, I.id)) })
|
|
943
943
|
] })
|
|
944
944
|
}
|
|
945
945
|
) : /* @__PURE__ */ i(
|
|
946
946
|
"div",
|
|
947
947
|
{
|
|
948
|
-
ref:
|
|
948
|
+
ref: r,
|
|
949
949
|
className: `nice-event-planning nice-event-planning--${p} ${q ?? ""}`,
|
|
950
950
|
style: Q,
|
|
951
951
|
children: [
|
|
952
952
|
ht,
|
|
953
953
|
/* @__PURE__ */ e(
|
|
954
|
-
|
|
954
|
+
At,
|
|
955
955
|
{
|
|
956
956
|
tabs: mt,
|
|
957
|
-
activeTab:
|
|
957
|
+
activeTab: Fn,
|
|
958
958
|
onChange: Wn,
|
|
959
|
-
iconOnly:
|
|
960
|
-
centered:
|
|
961
|
-
countLocation:
|
|
959
|
+
iconOnly: _,
|
|
960
|
+
centered: C,
|
|
961
|
+
countLocation: N
|
|
962
962
|
}
|
|
963
963
|
)
|
|
964
964
|
]
|
|
@@ -966,7 +966,7 @@ const Bt = {
|
|
|
966
966
|
);
|
|
967
967
|
}
|
|
968
968
|
);
|
|
969
|
-
function
|
|
969
|
+
function Yt(s) {
|
|
970
970
|
switch (s) {
|
|
971
971
|
case "confirmed":
|
|
972
972
|
return "success";
|
|
@@ -983,7 +983,7 @@ function Rt(s) {
|
|
|
983
983
|
const Ze = ({
|
|
984
984
|
participant: s,
|
|
985
985
|
showRole: t = !0,
|
|
986
|
-
showStatus:
|
|
986
|
+
showStatus: r = !0,
|
|
987
987
|
meta: n,
|
|
988
988
|
children: l,
|
|
989
989
|
size: o = "md",
|
|
@@ -992,16 +992,16 @@ const Ze = ({
|
|
|
992
992
|
/* @__PURE__ */ e(Oe, { name: s.name, src: s.avatarUrl, size: o }),
|
|
993
993
|
/* @__PURE__ */ e("span", { className: "nice-participant-row__name", children: s.name }),
|
|
994
994
|
t && s.role && /* @__PURE__ */ e(te, { size: "xs", outline: !0, variant: "info", children: s.role }),
|
|
995
|
-
|
|
995
|
+
r && s.status && /* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: Yt(s.status), children: s.status }),
|
|
996
996
|
n && /* @__PURE__ */ e("span", { className: "nice-participant-row__meta", children: n }),
|
|
997
997
|
l && /* @__PURE__ */ e("span", { className: "nice-participant-row__trailing", children: l })
|
|
998
|
-
] }),
|
|
998
|
+
] }), Xt = /^[^\s@,;]+@[^\s@,;]+\.[^\s@,;]{2,}$/, yn = /^.*<\s*([^<>\s]+)\s*>$/;
|
|
999
999
|
function On(s) {
|
|
1000
1000
|
var o, d;
|
|
1001
|
-
const t = [],
|
|
1001
|
+
const t = [], r = [], n = /* @__PURE__ */ new Set();
|
|
1002
1002
|
let l = 0;
|
|
1003
1003
|
if (!s)
|
|
1004
|
-
return { valid: t, invalid:
|
|
1004
|
+
return { valid: t, invalid: r, duplicates: l };
|
|
1005
1005
|
for (const m of s.split(/[,;\r\n\t]+/)) {
|
|
1006
1006
|
const h = m.trim();
|
|
1007
1007
|
if (!h)
|
|
@@ -1010,30 +1010,30 @@ function On(s) {
|
|
|
1010
1010
|
for (const p of u) {
|
|
1011
1011
|
if (!p)
|
|
1012
1012
|
continue;
|
|
1013
|
-
if (!
|
|
1014
|
-
|
|
1013
|
+
if (!Xt.test(p)) {
|
|
1014
|
+
r.push(p);
|
|
1015
1015
|
continue;
|
|
1016
1016
|
}
|
|
1017
|
-
const
|
|
1018
|
-
if (n.has(
|
|
1017
|
+
const k = p.toLowerCase();
|
|
1018
|
+
if (n.has(k)) {
|
|
1019
1019
|
l += 1;
|
|
1020
1020
|
continue;
|
|
1021
1021
|
}
|
|
1022
|
-
n.add(
|
|
1022
|
+
n.add(k), t.push(p);
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
return { valid: t, invalid:
|
|
1025
|
+
return { valid: t, invalid: r, duplicates: l };
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const
|
|
1027
|
+
function Vt(s, t) {
|
|
1028
|
+
const r = new Set(s.map((l) => l.toLowerCase())), n = [...s];
|
|
1029
1029
|
for (const l of t) {
|
|
1030
1030
|
const o = l.toLowerCase();
|
|
1031
|
-
|
|
1031
|
+
r.has(o) || (r.add(o), n.push(l));
|
|
1032
1032
|
}
|
|
1033
1033
|
return n;
|
|
1034
1034
|
}
|
|
1035
1035
|
function Un(s = {}) {
|
|
1036
|
-
const { currentUserId: t, currentUserName:
|
|
1036
|
+
const { currentUserId: t, currentUserName: r, requireIdentity: n = !0 } = s, [l, o] = L(""), d = !t, m = r ?? l, h = !n || m.trim().length > 0;
|
|
1037
1037
|
return {
|
|
1038
1038
|
isAnonymous: d,
|
|
1039
1039
|
name: m,
|
|
@@ -1042,12 +1042,12 @@ function Un(s = {}) {
|
|
|
1042
1042
|
actor: { userId: t, userName: m.trim() }
|
|
1043
1043
|
};
|
|
1044
1044
|
}
|
|
1045
|
-
const
|
|
1045
|
+
const Ft = [
|
|
1046
1046
|
{ answer: "yes", label: "Yes", variant: "success", Icon: qe },
|
|
1047
1047
|
{ answer: "maybe", label: "Maybe", variant: "warning", Icon: en },
|
|
1048
1048
|
{ answer: "no", label: "No", variant: "error", Icon: $n }
|
|
1049
1049
|
], _n = ee(
|
|
1050
|
-
function(t,
|
|
1050
|
+
function(t, r) {
|
|
1051
1051
|
const {
|
|
1052
1052
|
value: n,
|
|
1053
1053
|
onRespond: l,
|
|
@@ -1058,51 +1058,51 @@ const Yt = [
|
|
|
1058
1058
|
currentUserId: a,
|
|
1059
1059
|
currentUserName: u,
|
|
1060
1060
|
compact: p = !1,
|
|
1061
|
-
disabled:
|
|
1061
|
+
disabled: k = !1,
|
|
1062
1062
|
readOnly: f = !1,
|
|
1063
1063
|
size: g = "md",
|
|
1064
|
-
className:
|
|
1065
|
-
style:
|
|
1066
|
-
} = t,
|
|
1067
|
-
|
|
1068
|
-
answer:
|
|
1069
|
-
plusOnes: o &&
|
|
1070
|
-
note: h &&
|
|
1071
|
-
userId:
|
|
1072
|
-
userName:
|
|
1064
|
+
className: _,
|
|
1065
|
+
style: C
|
|
1066
|
+
} = t, N = Un({ currentUserId: a, currentUserName: u }), [$, c] = L(m), [x, v] = L(""), P = !p && N.isAnonymous && !N.canAct, w = k || f, E = (b) => {
|
|
1067
|
+
w || !l || l({
|
|
1068
|
+
answer: b,
|
|
1069
|
+
plusOnes: o && b !== "no" ? $ : void 0,
|
|
1070
|
+
note: h && x.trim() ? x.trim() : void 0,
|
|
1071
|
+
userId: N.actor.userId,
|
|
1072
|
+
userName: N.actor.userName || void 0
|
|
1073
1073
|
});
|
|
1074
1074
|
};
|
|
1075
1075
|
return /* @__PURE__ */ i(
|
|
1076
1076
|
"div",
|
|
1077
1077
|
{
|
|
1078
|
-
ref:
|
|
1079
|
-
className: `nice-rsvp-control nice-rsvp-control--${g}${p ? " nice-rsvp-control--compact" : ""} ${
|
|
1080
|
-
style:
|
|
1078
|
+
ref: r,
|
|
1079
|
+
className: `nice-rsvp-control nice-rsvp-control--${g}${p ? " nice-rsvp-control--compact" : ""} ${_ ?? ""}`,
|
|
1080
|
+
style: C,
|
|
1081
1081
|
children: [
|
|
1082
|
-
!p &&
|
|
1082
|
+
!p && N.isAnonymous && /* @__PURE__ */ e(
|
|
1083
1083
|
J,
|
|
1084
1084
|
{
|
|
1085
1085
|
label: "Your name",
|
|
1086
|
-
value:
|
|
1087
|
-
onChange:
|
|
1086
|
+
value: N.name,
|
|
1087
|
+
onChange: N.setName,
|
|
1088
1088
|
placeholder: "Who is replying?",
|
|
1089
1089
|
required: !0,
|
|
1090
|
-
disabled:
|
|
1090
|
+
disabled: w,
|
|
1091
1091
|
size: g
|
|
1092
1092
|
}
|
|
1093
1093
|
),
|
|
1094
|
-
/* @__PURE__ */ e("div", { className: "nice-rsvp-control__answers", role: "group", "aria-label": "Your reply", children:
|
|
1095
|
-
|
|
1094
|
+
/* @__PURE__ */ e("div", { className: "nice-rsvp-control__answers", role: "group", "aria-label": "Your reply", children: Ft.map(({ answer: b, label: M, variant: X, Icon: B }) => /* @__PURE__ */ e(
|
|
1095
|
+
F,
|
|
1096
1096
|
{
|
|
1097
1097
|
size: g,
|
|
1098
|
-
variant: n ===
|
|
1098
|
+
variant: n === b ? X : "outline",
|
|
1099
1099
|
leftIcon: /* @__PURE__ */ e(B, { size: 16 }),
|
|
1100
|
-
disabled:
|
|
1101
|
-
"aria-pressed": n ===
|
|
1102
|
-
onClick: () =>
|
|
1103
|
-
children:
|
|
1100
|
+
disabled: w || P,
|
|
1101
|
+
"aria-pressed": n === b,
|
|
1102
|
+
onClick: () => E(b),
|
|
1103
|
+
children: M
|
|
1104
1104
|
},
|
|
1105
|
-
|
|
1105
|
+
b
|
|
1106
1106
|
)) }),
|
|
1107
1107
|
!p && o && n !== "no" && /* @__PURE__ */ i("label", { className: "nice-rsvp-control__field", children: [
|
|
1108
1108
|
/* @__PURE__ */ e("span", { className: "nice-rsvp-control__field-label", children: "Additional guests" }),
|
|
@@ -1110,12 +1110,12 @@ const Yt = [
|
|
|
1110
1110
|
rn,
|
|
1111
1111
|
{
|
|
1112
1112
|
value: $,
|
|
1113
|
-
onChange: (
|
|
1113
|
+
onChange: (b) => c(Math.max(0, Math.min(d, b ?? 0))),
|
|
1114
1114
|
min: 0,
|
|
1115
1115
|
max: d,
|
|
1116
1116
|
step: 1,
|
|
1117
1117
|
size: "xs",
|
|
1118
|
-
disabled:
|
|
1118
|
+
disabled: w
|
|
1119
1119
|
}
|
|
1120
1120
|
)
|
|
1121
1121
|
] }),
|
|
@@ -1123,19 +1123,19 @@ const Yt = [
|
|
|
1123
1123
|
J,
|
|
1124
1124
|
{
|
|
1125
1125
|
label: "Note",
|
|
1126
|
-
value:
|
|
1126
|
+
value: x,
|
|
1127
1127
|
onChange: v,
|
|
1128
1128
|
placeholder: "Anything we should know?",
|
|
1129
|
-
disabled:
|
|
1129
|
+
disabled: w,
|
|
1130
1130
|
size: g
|
|
1131
1131
|
}
|
|
1132
1132
|
),
|
|
1133
|
-
|
|
1133
|
+
P && /* @__PURE__ */ e("p", { className: "nice-rsvp-control__hint", children: "Enter your name to reply." })
|
|
1134
1134
|
]
|
|
1135
1135
|
}
|
|
1136
1136
|
);
|
|
1137
1137
|
}
|
|
1138
|
-
),
|
|
1138
|
+
), Wt = {
|
|
1139
1139
|
yes: "confirmed",
|
|
1140
1140
|
maybe: "invited",
|
|
1141
1141
|
no: "declined"
|
|
@@ -1149,10 +1149,10 @@ const Yt = [
|
|
|
1149
1149
|
"invited",
|
|
1150
1150
|
"declined",
|
|
1151
1151
|
"no-show"
|
|
1152
|
-
],
|
|
1153
|
-
function(t,
|
|
1152
|
+
], qt = [], Wi = ee(
|
|
1153
|
+
function(t, r) {
|
|
1154
1154
|
const {
|
|
1155
|
-
participants: n,
|
|
1155
|
+
participants: n = qt,
|
|
1156
1156
|
mode: l = "organizer",
|
|
1157
1157
|
currentUserId: o,
|
|
1158
1158
|
currentUserName: d,
|
|
@@ -1161,68 +1161,68 @@ const Yt = [
|
|
|
1161
1161
|
onScan: a,
|
|
1162
1162
|
checkInSlot: u,
|
|
1163
1163
|
onInvite: p,
|
|
1164
|
-
extraFields:
|
|
1164
|
+
extraFields: k,
|
|
1165
1165
|
groupBy: f = "none",
|
|
1166
1166
|
showSummary: g = !0,
|
|
1167
|
-
showSearch:
|
|
1168
|
-
allowPlusOnes:
|
|
1169
|
-
disabled:
|
|
1167
|
+
showSearch: _ = !0,
|
|
1168
|
+
allowPlusOnes: C = !1,
|
|
1169
|
+
disabled: N = !1,
|
|
1170
1170
|
readOnly: $ = !1,
|
|
1171
|
-
size:
|
|
1172
|
-
className:
|
|
1171
|
+
size: c = "md",
|
|
1172
|
+
className: x,
|
|
1173
1173
|
style: v
|
|
1174
|
-
} = t, [
|
|
1175
|
-
const
|
|
1174
|
+
} = t, [P, w] = L(""), [E, b] = L("all"), [M, X] = L(""), B = N || $, D = l === "guest", U = V(() => {
|
|
1175
|
+
const z = { total: n.length };
|
|
1176
1176
|
for (const Y of Re)
|
|
1177
|
-
|
|
1177
|
+
z[Y] = 0;
|
|
1178
1178
|
for (const Y of n)
|
|
1179
|
-
|
|
1180
|
-
return
|
|
1181
|
-
}, [n]),
|
|
1182
|
-
if (
|
|
1179
|
+
z[Y.status] = (z[Y.status] ?? 0) + 1;
|
|
1180
|
+
return z;
|
|
1181
|
+
}, [n]), S = V(() => {
|
|
1182
|
+
if (D)
|
|
1183
1183
|
return n.filter((Y) => Y.userId === o || Y.id === o);
|
|
1184
|
-
const
|
|
1185
|
-
return n.filter((Y) =>
|
|
1186
|
-
}, [n,
|
|
1187
|
-
if (f === "none" ||
|
|
1188
|
-
return [{ key: "all", label: "", items:
|
|
1189
|
-
const
|
|
1190
|
-
for (const q of
|
|
1191
|
-
const Q = f === "status" ? q.status : q.role,
|
|
1192
|
-
|
|
1184
|
+
const z = P.trim().toLowerCase();
|
|
1185
|
+
return n.filter((Y) => E !== "all" && Y.status !== E ? !1 : !z || Y.name.toLowerCase().includes(z));
|
|
1186
|
+
}, [n, D, o, P, E]), y = V(() => {
|
|
1187
|
+
if (f === "none" || D)
|
|
1188
|
+
return [{ key: "all", label: "", items: S }];
|
|
1189
|
+
const z = /* @__PURE__ */ new Map();
|
|
1190
|
+
for (const q of S) {
|
|
1191
|
+
const Q = f === "status" ? q.status : q.role, R = z.get(Q);
|
|
1192
|
+
R ? R.push(q) : z.set(Q, [q]);
|
|
1193
1193
|
}
|
|
1194
|
-
return [...
|
|
1195
|
-
}, [
|
|
1196
|
-
m == null || m(
|
|
1194
|
+
return [...z.keys()].sort((q, Q) => f !== "status" ? q.localeCompare(Q) : Re.indexOf(q) - Re.indexOf(Q)).map((q) => ({ key: q, label: q, items: z.get(q) ?? [] }));
|
|
1195
|
+
}, [S, f, D]), A = V(() => On(M), [M]), j = (z) => (Y) => {
|
|
1196
|
+
m == null || m(z, Wt[Y.answer], Y);
|
|
1197
1197
|
}, W = () => {
|
|
1198
|
-
!p ||
|
|
1198
|
+
!p || A.valid.length === 0 || (p(A.valid), X(""));
|
|
1199
1199
|
};
|
|
1200
|
-
if (
|
|
1201
|
-
const
|
|
1202
|
-
return
|
|
1200
|
+
if (D) {
|
|
1201
|
+
const z = S[0];
|
|
1202
|
+
return z ? /* @__PURE__ */ i(
|
|
1203
1203
|
"div",
|
|
1204
1204
|
{
|
|
1205
|
-
ref:
|
|
1206
|
-
className: `nice-participant-list nice-participant-list--guest ${
|
|
1205
|
+
ref: r,
|
|
1206
|
+
className: `nice-participant-list nice-participant-list--guest ${x ?? ""}`,
|
|
1207
1207
|
style: v,
|
|
1208
1208
|
children: [
|
|
1209
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(Ze, { participant:
|
|
1209
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: /* @__PURE__ */ e(Ze, { participant: z, size: c }) }),
|
|
1210
1210
|
/* @__PURE__ */ e(
|
|
1211
1211
|
_n,
|
|
1212
1212
|
{
|
|
1213
|
-
value: Nn[
|
|
1214
|
-
onRespond: j(
|
|
1215
|
-
allowPlusOnes:
|
|
1216
|
-
currentUserId: o ??
|
|
1217
|
-
currentUserName: d ??
|
|
1218
|
-
disabled:
|
|
1213
|
+
value: Nn[z.status],
|
|
1214
|
+
onRespond: j(z.id),
|
|
1215
|
+
allowPlusOnes: C,
|
|
1216
|
+
currentUserId: o ?? z.userId,
|
|
1217
|
+
currentUserName: d ?? z.name,
|
|
1218
|
+
disabled: N,
|
|
1219
1219
|
readOnly: $,
|
|
1220
|
-
size:
|
|
1220
|
+
size: c
|
|
1221
1221
|
}
|
|
1222
1222
|
)
|
|
1223
1223
|
]
|
|
1224
1224
|
}
|
|
1225
|
-
) : /* @__PURE__ */ e("div", { ref:
|
|
1225
|
+
) : /* @__PURE__ */ e("div", { ref: r, className: `nice-participant-list ${x ?? ""}`, style: v, children: /* @__PURE__ */ e(
|
|
1226
1226
|
ye,
|
|
1227
1227
|
{
|
|
1228
1228
|
title: "You are not on this guest list",
|
|
@@ -1230,50 +1230,50 @@ const Yt = [
|
|
|
1230
1230
|
}
|
|
1231
1231
|
) });
|
|
1232
1232
|
}
|
|
1233
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
1233
|
+
return /* @__PURE__ */ i("div", { ref: r, className: `nice-participant-list ${x ?? ""}`, style: v, children: [
|
|
1234
1234
|
g && /* @__PURE__ */ i("div", { className: "nice-participant-list__summary", children: [
|
|
1235
1235
|
/* @__PURE__ */ i("span", { className: "nice-participant-list__stat", children: [
|
|
1236
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1236
|
+
/* @__PURE__ */ e("strong", { children: U.confirmed }),
|
|
1237
1237
|
" confirmed"
|
|
1238
1238
|
] }),
|
|
1239
1239
|
/* @__PURE__ */ i("span", { className: "nice-participant-list__stat", children: [
|
|
1240
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1240
|
+
/* @__PURE__ */ e("strong", { children: U.invited }),
|
|
1241
1241
|
" awaiting reply"
|
|
1242
1242
|
] }),
|
|
1243
1243
|
/* @__PURE__ */ i("span", { className: "nice-participant-list__stat", children: [
|
|
1244
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1244
|
+
/* @__PURE__ */ e("strong", { children: U.declined }),
|
|
1245
1245
|
" declined"
|
|
1246
1246
|
] }),
|
|
1247
1247
|
/* @__PURE__ */ i("span", { className: "nice-participant-list__stat", children: [
|
|
1248
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1248
|
+
/* @__PURE__ */ e("strong", { children: U["checked-in"] }),
|
|
1249
1249
|
" checked in"
|
|
1250
1250
|
] }),
|
|
1251
1251
|
/* @__PURE__ */ i("span", { className: "nice-participant-list__stat nice-participant-list__stat--total", children: [
|
|
1252
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1252
|
+
/* @__PURE__ */ e("strong", { children: U.total }),
|
|
1253
1253
|
" total"
|
|
1254
1254
|
] })
|
|
1255
1255
|
] }),
|
|
1256
|
-
(
|
|
1257
|
-
|
|
1256
|
+
(_ || u || a) && /* @__PURE__ */ i("div", { className: "nice-participant-list__toolbar", children: [
|
|
1257
|
+
_ && /* @__PURE__ */ i(Fe, { children: [
|
|
1258
1258
|
/* @__PURE__ */ e(
|
|
1259
1259
|
J,
|
|
1260
1260
|
{
|
|
1261
|
-
value:
|
|
1262
|
-
onChange:
|
|
1261
|
+
value: P,
|
|
1262
|
+
onChange: w,
|
|
1263
1263
|
placeholder: "Search guests…",
|
|
1264
1264
|
prefix: /* @__PURE__ */ e(ft, { size: 15 }),
|
|
1265
|
-
size:
|
|
1265
|
+
size: c
|
|
1266
1266
|
}
|
|
1267
1267
|
),
|
|
1268
1268
|
/* @__PURE__ */ e(
|
|
1269
1269
|
Te,
|
|
1270
1270
|
{
|
|
1271
|
-
value:
|
|
1272
|
-
onChange: (
|
|
1273
|
-
size:
|
|
1271
|
+
value: E,
|
|
1272
|
+
onChange: (z) => b(z),
|
|
1273
|
+
size: c,
|
|
1274
1274
|
options: [
|
|
1275
1275
|
{ value: "all", label: "All statuses" },
|
|
1276
|
-
...Re.map((
|
|
1276
|
+
...Re.map((z) => ({ value: z, label: z }))
|
|
1277
1277
|
]
|
|
1278
1278
|
}
|
|
1279
1279
|
)
|
|
@@ -1284,28 +1284,28 @@ const Yt = [
|
|
|
1284
1284
|
" Scanner ready"
|
|
1285
1285
|
] })
|
|
1286
1286
|
] }),
|
|
1287
|
-
|
|
1287
|
+
S.length === 0 ? /* @__PURE__ */ e(
|
|
1288
1288
|
ye,
|
|
1289
1289
|
{
|
|
1290
1290
|
title: "No guests yet",
|
|
1291
1291
|
description: n.length > 0 ? "No one matches the current filter." : "Invite people to see them here."
|
|
1292
1292
|
}
|
|
1293
|
-
) :
|
|
1294
|
-
|
|
1295
|
-
|
|
1293
|
+
) : y.map((z) => /* @__PURE__ */ i("section", { className: "nice-participant-list__group", children: [
|
|
1294
|
+
z.label && /* @__PURE__ */ i("h4", { className: "nice-participant-list__group-title", children: [
|
|
1295
|
+
z.label,
|
|
1296
1296
|
" ",
|
|
1297
1297
|
/* @__PURE__ */ i("span", { children: [
|
|
1298
1298
|
"(",
|
|
1299
|
-
|
|
1299
|
+
z.items.length,
|
|
1300
1300
|
")"
|
|
1301
1301
|
] })
|
|
1302
1302
|
] }),
|
|
1303
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children:
|
|
1303
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: z.items.map((Y) => /* @__PURE__ */ i(
|
|
1304
1304
|
Ze,
|
|
1305
1305
|
{
|
|
1306
1306
|
participant: Y,
|
|
1307
|
-
size:
|
|
1308
|
-
meta:
|
|
1307
|
+
size: c,
|
|
1308
|
+
meta: k == null ? void 0 : k.map((q) => /* @__PURE__ */ e("span", { className: "nice-participant-list__extra", children: q.render ? q.render(Y) : String(
|
|
1309
1309
|
Y[q.key] ?? ""
|
|
1310
1310
|
) }, q.key)),
|
|
1311
1311
|
children: [
|
|
@@ -1322,7 +1322,7 @@ const Yt = [
|
|
|
1322
1322
|
}
|
|
1323
1323
|
),
|
|
1324
1324
|
h && Y.status !== "checked-in" && /* @__PURE__ */ e(
|
|
1325
|
-
|
|
1325
|
+
F,
|
|
1326
1326
|
{
|
|
1327
1327
|
size: "sm",
|
|
1328
1328
|
variant: "outline",
|
|
@@ -1336,42 +1336,42 @@ const Yt = [
|
|
|
1336
1336
|
},
|
|
1337
1337
|
Y.id
|
|
1338
1338
|
)) })
|
|
1339
|
-
] },
|
|
1339
|
+
] }, z.key)),
|
|
1340
1340
|
p && !$ && /* @__PURE__ */ i("div", { className: "nice-participant-list__invite", children: [
|
|
1341
1341
|
/* @__PURE__ */ e(
|
|
1342
1342
|
sn,
|
|
1343
1343
|
{
|
|
1344
1344
|
label: "Invite by email",
|
|
1345
|
-
value:
|
|
1346
|
-
onChange:
|
|
1345
|
+
value: M,
|
|
1346
|
+
onChange: X,
|
|
1347
1347
|
placeholder: "Paste addresses — commas, semicolons or new lines",
|
|
1348
1348
|
rows: 3,
|
|
1349
|
-
disabled:
|
|
1350
|
-
size:
|
|
1349
|
+
disabled: N,
|
|
1350
|
+
size: c
|
|
1351
1351
|
}
|
|
1352
1352
|
),
|
|
1353
1353
|
/* @__PURE__ */ i(
|
|
1354
|
-
|
|
1354
|
+
F,
|
|
1355
1355
|
{
|
|
1356
1356
|
variant: "primary",
|
|
1357
|
-
size:
|
|
1358
|
-
leftIcon: /* @__PURE__ */ e(
|
|
1359
|
-
disabled:
|
|
1357
|
+
size: c,
|
|
1358
|
+
leftIcon: /* @__PURE__ */ e(Pn, { size: 15 }),
|
|
1359
|
+
disabled: N || A.valid.length === 0,
|
|
1360
1360
|
onClick: W,
|
|
1361
1361
|
children: [
|
|
1362
1362
|
"Invite ",
|
|
1363
|
-
|
|
1363
|
+
A.valid.length > 0 ? `(${A.valid.length})` : ""
|
|
1364
1364
|
]
|
|
1365
1365
|
}
|
|
1366
1366
|
),
|
|
1367
|
-
(
|
|
1368
|
-
|
|
1369
|
-
|
|
1367
|
+
(A.invalid.length > 0 || A.duplicates > 0) && /* @__PURE__ */ i("p", { className: "nice-participant-list__invite-hint", children: [
|
|
1368
|
+
A.duplicates > 0 && `${A.duplicates} duplicate(s) removed. `,
|
|
1369
|
+
A.invalid.length > 0 && `${A.invalid.length} entry(ies) not recognised.`
|
|
1370
1370
|
] })
|
|
1371
1371
|
] })
|
|
1372
1372
|
] });
|
|
1373
1373
|
}
|
|
1374
|
-
),
|
|
1374
|
+
), jt = {
|
|
1375
1375
|
// No minor unit at all.
|
|
1376
1376
|
BIF: 0,
|
|
1377
1377
|
CLP: 0,
|
|
@@ -1400,19 +1400,19 @@ const Yt = [
|
|
|
1400
1400
|
TND: 3
|
|
1401
1401
|
};
|
|
1402
1402
|
function cn(s) {
|
|
1403
|
-
return
|
|
1403
|
+
return jt[s == null ? void 0 : s.toUpperCase()] ?? 2;
|
|
1404
1404
|
}
|
|
1405
1405
|
function ln(s, t) {
|
|
1406
1406
|
return Number.isFinite(s) ? Math.round(s * 10 ** cn(t)) : 0;
|
|
1407
1407
|
}
|
|
1408
1408
|
function Xe(s, t) {
|
|
1409
|
-
const
|
|
1410
|
-
return
|
|
1409
|
+
const r = cn(t);
|
|
1410
|
+
return r === 0 ? s : s / 10 ** r;
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function Gt(s, t, r) {
|
|
1413
1413
|
const n = cn(t), l = Xe(s, t);
|
|
1414
1414
|
try {
|
|
1415
|
-
return new Intl.NumberFormat(
|
|
1415
|
+
return new Intl.NumberFormat(r, {
|
|
1416
1416
|
style: "currency",
|
|
1417
1417
|
currency: t.toUpperCase(),
|
|
1418
1418
|
minimumFractionDigits: n,
|
|
@@ -1422,17 +1422,17 @@ function Vt(s, t, c) {
|
|
|
1422
1422
|
return `${l.toFixed(n)} ${t}`;
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
|
-
function se(s, t,
|
|
1426
|
-
return
|
|
1425
|
+
function se(s, t, r) {
|
|
1426
|
+
return Gt(ln(s, t), t, r);
|
|
1427
1427
|
}
|
|
1428
1428
|
const Je = { minX: 0, minY: 0, maxX: 0, maxY: 0 };
|
|
1429
|
-
function
|
|
1429
|
+
function Kt(s, t = 0) {
|
|
1430
1430
|
if (s.length === 0)
|
|
1431
1431
|
return { ...Je };
|
|
1432
|
-
let
|
|
1432
|
+
let r = 1 / 0, n = 1 / 0, l = -1 / 0, o = -1 / 0;
|
|
1433
1433
|
for (const d of s)
|
|
1434
|
-
d.x <
|
|
1435
|
-
return { minX:
|
|
1434
|
+
d.x < r && (r = d.x), d.y < n && (n = d.y), d.x > l && (l = d.x), d.y > o && (o = d.y);
|
|
1435
|
+
return { minX: r - t, minY: n - t, maxX: l + t, maxY: o + t };
|
|
1436
1436
|
}
|
|
1437
1437
|
function bn(s, t) {
|
|
1438
1438
|
return {
|
|
@@ -1445,34 +1445,34 @@ function bn(s, t) {
|
|
|
1445
1445
|
function wn(s, t) {
|
|
1446
1446
|
return s.minX <= t.maxX && s.maxX >= t.minX && s.minY <= t.maxY && s.maxY >= t.minY;
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1449
|
-
const n = s.zoom || 1, l = -s.pan.x / n -
|
|
1448
|
+
function Ht(s, t, r = 0) {
|
|
1449
|
+
const n = s.zoom || 1, l = -s.pan.x / n - r, o = -s.pan.y / n - r;
|
|
1450
1450
|
return {
|
|
1451
1451
|
minX: l,
|
|
1452
1452
|
minY: o,
|
|
1453
|
-
maxX: l + t.width / n +
|
|
1454
|
-
maxY: o + t.height / n +
|
|
1453
|
+
maxX: l + t.width / n + r * 2,
|
|
1454
|
+
maxY: o + t.height / n + r * 2
|
|
1455
1455
|
};
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1458
|
-
const
|
|
1457
|
+
function Qt(s, t = 12) {
|
|
1458
|
+
const r = [], n = [], l = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1459
1459
|
let d = null, m = 0;
|
|
1460
1460
|
for (const h of s.sections ?? []) {
|
|
1461
1461
|
let a = null, u = 0;
|
|
1462
|
-
(h.rows ?? []).forEach((
|
|
1463
|
-
const g =
|
|
1462
|
+
(h.rows ?? []).forEach((k, f) => {
|
|
1463
|
+
const g = Zt(k.seats ?? []);
|
|
1464
1464
|
if (g.length === 0)
|
|
1465
1465
|
return;
|
|
1466
|
-
const
|
|
1467
|
-
n.push({ sectionId: h.id, rowIndex: f, label:
|
|
1468
|
-
l.set(
|
|
1469
|
-
}), u += g.length, a = a ? bn(a,
|
|
1466
|
+
const _ = Kt(g, t);
|
|
1467
|
+
n.push({ sectionId: h.id, rowIndex: f, label: k.label, seats: g, bounds: _ }), g.forEach((C, N) => {
|
|
1468
|
+
l.set(C.id, C), o.set(C.id, { sectionId: h.id, rowIndex: f, seatIndex: N });
|
|
1469
|
+
}), u += g.length, a = a ? bn(a, _) : _;
|
|
1470
1470
|
});
|
|
1471
1471
|
const p = a ?? { ...Je };
|
|
1472
|
-
|
|
1472
|
+
r.push({ section: h, bounds: p, seatCount: u }), m += u, u > 0 && (d = d ? bn(d, p) : p);
|
|
1473
1473
|
}
|
|
1474
1474
|
return {
|
|
1475
|
-
sections:
|
|
1475
|
+
sections: r,
|
|
1476
1476
|
rows: n,
|
|
1477
1477
|
bounds: d ?? { ...Je },
|
|
1478
1478
|
totalSeats: m,
|
|
@@ -1480,13 +1480,13 @@ function jt(s, t = 12) {
|
|
|
1480
1480
|
locationById: o
|
|
1481
1481
|
};
|
|
1482
1482
|
}
|
|
1483
|
-
function
|
|
1484
|
-
return [...s].sort((t,
|
|
1483
|
+
function Zt(s) {
|
|
1484
|
+
return [...s].sort((t, r) => t.number - r.number || t.x - r.x);
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function Jt(s, t) {
|
|
1487
1487
|
return s > t * 4 ? "section" : s > t ? "row" : "seat";
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function ei(s, t, r = 2500, n) {
|
|
1490
1490
|
const l = s.sections.filter((u) => wn(u.bounds, t)), o = new Set(l.map((u) => u.section.id)), d = s.rows.filter(
|
|
1491
1491
|
(u) => o.has(u.sectionId) && wn(u.bounds, t)
|
|
1492
1492
|
);
|
|
@@ -1494,7 +1494,7 @@ function Ht(s, t, c = 2500, n) {
|
|
|
1494
1494
|
for (const u of d)
|
|
1495
1495
|
for (const p of u.seats)
|
|
1496
1496
|
p.x >= t.minX && p.x <= t.maxX && p.y >= t.minY && p.y <= t.maxY && (m += 1);
|
|
1497
|
-
const h = n ??
|
|
1497
|
+
const h = n ?? Jt(m, r);
|
|
1498
1498
|
let a = [];
|
|
1499
1499
|
if (h === "seat") {
|
|
1500
1500
|
a = [];
|
|
@@ -1510,42 +1510,42 @@ function on(s) {
|
|
|
1510
1510
|
if (s.status === "wheelchair" || s.status === "companion")
|
|
1511
1511
|
return s.status;
|
|
1512
1512
|
}
|
|
1513
|
-
function
|
|
1514
|
-
const
|
|
1515
|
-
return
|
|
1513
|
+
function Ie(s, t) {
|
|
1514
|
+
const r = (t == null ? void 0 : t[s.id]) ?? s.status;
|
|
1515
|
+
return r === "wheelchair" || r === "companion" ? "available" : r;
|
|
1516
1516
|
}
|
|
1517
|
-
function xn(s, t,
|
|
1517
|
+
function xn(s, t, r) {
|
|
1518
1518
|
var l;
|
|
1519
1519
|
const n = (l = t.priceCategories) == null ? void 0 : l.find((o) => o.id === s.priceCategoryId);
|
|
1520
1520
|
return {
|
|
1521
|
-
amount: (n == null ? void 0 : n.price) ??
|
|
1522
|
-
currency:
|
|
1521
|
+
amount: (n == null ? void 0 : n.price) ?? r.basePrice,
|
|
1522
|
+
currency: r.currency
|
|
1523
1523
|
};
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1526
|
-
return !(
|
|
1525
|
+
function ni(s, t = {}, r) {
|
|
1526
|
+
return !(Ie(s, r) !== "available" || t.allowedCategories && !t.allowedCategories.includes(s.priceCategoryId));
|
|
1527
1527
|
}
|
|
1528
|
-
function Yn(s, t = {},
|
|
1528
|
+
function Yn(s, t = {}, r) {
|
|
1529
1529
|
const n = [];
|
|
1530
1530
|
let l = null;
|
|
1531
1531
|
return s.forEach((o, d) => {
|
|
1532
|
-
|
|
1532
|
+
ni(o, t, r) ? l ? l.seats.push(o) : l = { start: d, seats: [o] } : l && (n.push(l), l = null);
|
|
1533
1533
|
}), l && n.push(l), n;
|
|
1534
1534
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const l =
|
|
1535
|
+
function ti(s, t, r = {}, n) {
|
|
1536
|
+
const l = r.maxSeats ?? 8;
|
|
1537
1537
|
if (s.length > l)
|
|
1538
1538
|
return { ok: !1, reason: "max-seats" };
|
|
1539
1539
|
for (const d of s) {
|
|
1540
1540
|
const m = t.seatById.get(d);
|
|
1541
1541
|
if (m) {
|
|
1542
|
-
if (
|
|
1542
|
+
if (Ie(m, n) !== "available")
|
|
1543
1543
|
return { ok: !1, reason: "unavailable", seatId: d };
|
|
1544
|
-
if (
|
|
1544
|
+
if (r.allowedCategories && !r.allowedCategories.includes(m.priceCategoryId))
|
|
1545
1545
|
return { ok: !1, reason: "category-not-allowed", seatId: d };
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
1548
|
-
if (!
|
|
1548
|
+
if (!r.adjacentOnly || s.length === 0)
|
|
1549
1549
|
return { ok: !0 };
|
|
1550
1550
|
const o = /* @__PURE__ */ new Map();
|
|
1551
1551
|
for (const d of s) {
|
|
@@ -1556,41 +1556,41 @@ function Zt(s, t, c = {}, n) {
|
|
|
1556
1556
|
a ? a.push(d) : o.set(h, [d]);
|
|
1557
1557
|
}
|
|
1558
1558
|
for (const [d, m] of o) {
|
|
1559
|
-
const [h, a] = d.split("::"), u = Number(a), p = t.rows.find((
|
|
1559
|
+
const [h, a] = d.split("::"), u = Number(a), p = t.rows.find((c) => c.sectionId === h && c.rowIndex === u);
|
|
1560
1560
|
if (!p)
|
|
1561
1561
|
continue;
|
|
1562
|
-
const
|
|
1562
|
+
const k = Yn(p.seats, r, n), f = new Set(m);
|
|
1563
1563
|
let g = null;
|
|
1564
|
-
for (const
|
|
1565
|
-
if (
|
|
1564
|
+
for (const c of k)
|
|
1565
|
+
if (c.seats.some((x) => f.has(x.id))) {
|
|
1566
1566
|
if (g)
|
|
1567
1567
|
return { ok: !1, reason: "not-adjacent", seatId: m[0] };
|
|
1568
|
-
g =
|
|
1568
|
+
g = c;
|
|
1569
1569
|
}
|
|
1570
1570
|
if (!g)
|
|
1571
1571
|
continue;
|
|
1572
|
-
const
|
|
1573
|
-
if (
|
|
1572
|
+
const _ = g.seats.map((c, x) => f.has(c.id) ? x : -1).filter((c) => c >= 0);
|
|
1573
|
+
if (_.length === 0)
|
|
1574
1574
|
continue;
|
|
1575
|
-
const
|
|
1576
|
-
if (
|
|
1575
|
+
const C = _[0], N = _[_.length - 1];
|
|
1576
|
+
if (N - C + 1 !== _.length)
|
|
1577
1577
|
return { ok: !1, reason: "not-adjacent", seatId: m[0] };
|
|
1578
1578
|
const $ = g.seats.length;
|
|
1579
|
-
if ($ > 1 && (
|
|
1579
|
+
if ($ > 1 && (C === 1 || $ - 1 - N === 1))
|
|
1580
1580
|
return { ok: !1, reason: "orphan-seat", seatId: m[0] };
|
|
1581
1581
|
}
|
|
1582
1582
|
return { ok: !0 };
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function ii(s, t, r, n = {}, l) {
|
|
1585
1585
|
if (s.includes(t))
|
|
1586
1586
|
return { selected: s.filter((m) => m !== t) };
|
|
1587
|
-
const o = [...s, t], d =
|
|
1587
|
+
const o = [...s, t], d = ti(o, r, n, l);
|
|
1588
1588
|
return d.ok ? { selected: o } : { rejected: d.reason ?? "not-adjacent" };
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1590
|
+
function ai(s, t, r = {}, n = {}, l) {
|
|
1591
1591
|
if (t <= 0)
|
|
1592
1592
|
return [];
|
|
1593
|
-
const o = n.categoryId ? { ...
|
|
1593
|
+
const o = n.categoryId ? { ...r, allowedCategories: [n.categoryId] } : r;
|
|
1594
1594
|
let d = null;
|
|
1595
1595
|
for (const m of s.rows)
|
|
1596
1596
|
if (!(n.sectionId && m.sectionId !== n.sectionId))
|
|
@@ -1601,14 +1601,14 @@ function ei(s, t, c = {}, n = {}, l) {
|
|
|
1601
1601
|
const p = u + t - 1;
|
|
1602
1602
|
if (a > t && (u === 1 || a - 1 - p === 1))
|
|
1603
1603
|
continue;
|
|
1604
|
-
const
|
|
1605
|
-
(!d || f > d.score) && (d = { ids:
|
|
1604
|
+
const k = h.seats.slice(u, p + 1), f = k.reduce((g, _) => g + (_.viewScore ?? 50), 0) / t;
|
|
1605
|
+
(!d || f > d.score) && (d = { ids: k.map((g) => g.id), score: f });
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
1608
|
return (d == null ? void 0 : d.ids) ?? [];
|
|
1609
1609
|
}
|
|
1610
|
-
function
|
|
1611
|
-
var u, p,
|
|
1610
|
+
function si(s, t, r) {
|
|
1611
|
+
var u, p, k, f;
|
|
1612
1612
|
const n = s.locationById.get(t);
|
|
1613
1613
|
if (!n)
|
|
1614
1614
|
return null;
|
|
@@ -1618,41 +1618,41 @@ function ni(s, t, c) {
|
|
|
1618
1618
|
if (l < 0)
|
|
1619
1619
|
return null;
|
|
1620
1620
|
const o = s.rows[l];
|
|
1621
|
-
if (
|
|
1621
|
+
if (r === "left")
|
|
1622
1622
|
return ((u = o.seats[n.seatIndex - 1]) == null ? void 0 : u.id) ?? null;
|
|
1623
|
-
if (
|
|
1623
|
+
if (r === "right")
|
|
1624
1624
|
return ((p = o.seats[n.seatIndex + 1]) == null ? void 0 : p.id) ?? null;
|
|
1625
|
-
if (
|
|
1626
|
-
return ((
|
|
1627
|
-
if (
|
|
1625
|
+
if (r === "row-start")
|
|
1626
|
+
return ((k = o.seats[0]) == null ? void 0 : k.id) ?? null;
|
|
1627
|
+
if (r === "row-end")
|
|
1628
1628
|
return ((f = o.seats[o.seats.length - 1]) == null ? void 0 : f.id) ?? null;
|
|
1629
|
-
const d = s.rows[
|
|
1629
|
+
const d = s.rows[r === "up" ? l - 1 : l + 1];
|
|
1630
1630
|
if (!d)
|
|
1631
1631
|
return null;
|
|
1632
1632
|
const m = o.seats[n.seatIndex].x;
|
|
1633
1633
|
let h = null, a = 1 / 0;
|
|
1634
1634
|
for (const g of d.seats) {
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1635
|
+
const _ = Math.abs(g.x - m);
|
|
1636
|
+
_ < a && (a = _, h = g);
|
|
1637
1637
|
}
|
|
1638
1638
|
return (h == null ? void 0 : h.id) ?? null;
|
|
1639
1639
|
}
|
|
1640
|
-
function
|
|
1640
|
+
function ri(s, t, r) {
|
|
1641
1641
|
var h, a, u;
|
|
1642
1642
|
const n = s.sections.filter((p) => p.seatCount > 0);
|
|
1643
1643
|
if (n.length === 0)
|
|
1644
1644
|
return null;
|
|
1645
|
-
const l = t ? (h = s.locationById.get(t)) == null ? void 0 : h.sectionId : void 0, o = n.findIndex((p) => p.section.id === l), d = o < 0 ? 0 :
|
|
1645
|
+
const l = t ? (h = s.locationById.get(t)) == null ? void 0 : h.sectionId : void 0, o = n.findIndex((p) => p.section.id === l), d = o < 0 ? 0 : r === "next" ? o + 1 : o - 1, m = n[d];
|
|
1646
1646
|
return m ? ((u = (a = s.rows.find((p) => p.sectionId === m.section.id)) == null ? void 0 : a.seats[0]) == null ? void 0 : u.id) ?? null : null;
|
|
1647
1647
|
}
|
|
1648
|
-
const
|
|
1649
|
-
function
|
|
1650
|
-
return s.seats.length === 0 ? 0 : s.seats.filter((n) =>
|
|
1648
|
+
const Ae = 8;
|
|
1649
|
+
function ci(s, t) {
|
|
1650
|
+
return s.seats.length === 0 ? 0 : s.seats.filter((n) => Ie(n, t) === "available").length / s.seats.length;
|
|
1651
1651
|
}
|
|
1652
|
-
const
|
|
1652
|
+
const li = ({
|
|
1653
1653
|
cull: s,
|
|
1654
1654
|
selectedIds: t,
|
|
1655
|
-
cursorId:
|
|
1655
|
+
cursorId: r,
|
|
1656
1656
|
statusOverrides: n,
|
|
1657
1657
|
sectionColorById: l,
|
|
1658
1658
|
interactive: o,
|
|
@@ -1689,7 +1689,7 @@ const ai = ({
|
|
|
1689
1689
|
}
|
|
1690
1690
|
)
|
|
1691
1691
|
] }, a.id)) }) : s.tier === "row" ? /* @__PURE__ */ e("g", { className: "nice-seating-chart__rows", children: s.rows.map((a) => {
|
|
1692
|
-
const u =
|
|
1692
|
+
const u = ci(a, n);
|
|
1693
1693
|
return /* @__PURE__ */ i("g", { children: [
|
|
1694
1694
|
/* @__PURE__ */ e(
|
|
1695
1695
|
"rect",
|
|
@@ -1724,20 +1724,20 @@ const ai = ({
|
|
|
1724
1724
|
)
|
|
1725
1725
|
] }, `${a.sectionId}-${a.rowIndex}`);
|
|
1726
1726
|
}) }) : /* @__PURE__ */ e("g", { className: "nice-seating-chart__seats", children: s.seats.map((a) => {
|
|
1727
|
-
const u =
|
|
1727
|
+
const u = Ie(a, n), p = on(a), k = t.has(a.id), f = r === a.id, g = { row: a.row, number: a.number }, _ = [
|
|
1728
1728
|
"nice-seating-chart__seat",
|
|
1729
1729
|
`nice-seating-chart__seat--${u}`,
|
|
1730
|
-
|
|
1730
|
+
k ? "nice-seating-chart__seat--selected" : "",
|
|
1731
1731
|
p ? `nice-seating-chart__seat--${p}` : "",
|
|
1732
1732
|
f ? "nice-seating-chart__seat--cursor" : ""
|
|
1733
1733
|
].filter(Boolean).join(" ");
|
|
1734
1734
|
return /* @__PURE__ */ i(
|
|
1735
1735
|
"g",
|
|
1736
1736
|
{
|
|
1737
|
-
className:
|
|
1737
|
+
className: _,
|
|
1738
1738
|
"data-seat-id": a.id,
|
|
1739
1739
|
role: "gridcell",
|
|
1740
|
-
"aria-selected":
|
|
1740
|
+
"aria-selected": k,
|
|
1741
1741
|
"aria-disabled": u !== "available",
|
|
1742
1742
|
"aria-label": h(a),
|
|
1743
1743
|
tabIndex: f ? 0 : -1,
|
|
@@ -1746,10 +1746,10 @@ const ai = ({
|
|
|
1746
1746
|
p ? /* @__PURE__ */ e(
|
|
1747
1747
|
"rect",
|
|
1748
1748
|
{
|
|
1749
|
-
x: a.x -
|
|
1750
|
-
y: a.y -
|
|
1751
|
-
width:
|
|
1752
|
-
height:
|
|
1749
|
+
x: a.x - Ae,
|
|
1750
|
+
y: a.y - Ae,
|
|
1751
|
+
width: Ae * 2,
|
|
1752
|
+
height: Ae * 2,
|
|
1753
1753
|
rx: 3,
|
|
1754
1754
|
className: "nice-seating-chart__seat-shape",
|
|
1755
1755
|
fill: p === "companion" ? "url(#nice-seat-companion-hatch)" : void 0
|
|
@@ -1759,12 +1759,12 @@ const ai = ({
|
|
|
1759
1759
|
{
|
|
1760
1760
|
cx: a.x,
|
|
1761
1761
|
cy: a.y,
|
|
1762
|
-
r:
|
|
1762
|
+
r: Ae,
|
|
1763
1763
|
className: "nice-seating-chart__seat-shape"
|
|
1764
1764
|
}
|
|
1765
1765
|
),
|
|
1766
1766
|
p === "wheelchair" && /* @__PURE__ */ e(
|
|
1767
|
-
|
|
1767
|
+
An,
|
|
1768
1768
|
{
|
|
1769
1769
|
size: 10,
|
|
1770
1770
|
x: a.x - 5,
|
|
@@ -1789,10 +1789,10 @@ const ai = ({
|
|
|
1789
1789
|
},
|
|
1790
1790
|
a.id
|
|
1791
1791
|
);
|
|
1792
|
-
}) }),
|
|
1792
|
+
}) }), oi = ({
|
|
1793
1793
|
index: s,
|
|
1794
1794
|
selectedIds: t,
|
|
1795
|
-
statusOverrides:
|
|
1795
|
+
statusOverrides: r,
|
|
1796
1796
|
maxSeats: n,
|
|
1797
1797
|
onSeatToggle: l,
|
|
1798
1798
|
onBestAvailable: o,
|
|
@@ -1801,13 +1801,13 @@ const ai = ({
|
|
|
1801
1801
|
defaultOpen: h = !1
|
|
1802
1802
|
}) => {
|
|
1803
1803
|
var $;
|
|
1804
|
-
const a =
|
|
1805
|
-
() => s.sections.filter((
|
|
1804
|
+
const a = V(
|
|
1805
|
+
() => s.sections.filter((c) => c.seatCount > 0),
|
|
1806
1806
|
[s.sections]
|
|
1807
|
-
), [u, p] =
|
|
1808
|
-
() => s.rows.filter((
|
|
1807
|
+
), [u, p] = L((($ = a[0]) == null ? void 0 : $.section.id) ?? ""), [k, f] = L(0), [g, _] = L(2), C = V(
|
|
1808
|
+
() => s.rows.filter((c) => c.sectionId === u),
|
|
1809
1809
|
[s.rows, u]
|
|
1810
|
-
),
|
|
1810
|
+
), N = C.find((c) => c.rowIndex === k) ?? C[0];
|
|
1811
1811
|
return /* @__PURE__ */ i(
|
|
1812
1812
|
Tt,
|
|
1813
1813
|
{
|
|
@@ -1822,7 +1822,7 @@ const ai = ({
|
|
|
1822
1822
|
rn,
|
|
1823
1823
|
{
|
|
1824
1824
|
value: g,
|
|
1825
|
-
onChange: (
|
|
1825
|
+
onChange: (c) => _(Math.max(1, Math.min(n, c ?? 1))),
|
|
1826
1826
|
min: 1,
|
|
1827
1827
|
max: n,
|
|
1828
1828
|
size: "xs",
|
|
@@ -1831,7 +1831,7 @@ const ai = ({
|
|
|
1831
1831
|
)
|
|
1832
1832
|
] }),
|
|
1833
1833
|
/* @__PURE__ */ e(
|
|
1834
|
-
|
|
1834
|
+
F,
|
|
1835
1835
|
{
|
|
1836
1836
|
size: "sm",
|
|
1837
1837
|
variant: "primary",
|
|
@@ -1850,12 +1850,12 @@ const ai = ({
|
|
|
1850
1850
|
size: "sm",
|
|
1851
1851
|
value: u,
|
|
1852
1852
|
disabled: m,
|
|
1853
|
-
onChange: (
|
|
1854
|
-
p(
|
|
1853
|
+
onChange: (c) => {
|
|
1854
|
+
p(c), f(0);
|
|
1855
1855
|
},
|
|
1856
|
-
options: a.map((
|
|
1857
|
-
value:
|
|
1858
|
-
label: `${
|
|
1856
|
+
options: a.map((c) => ({
|
|
1857
|
+
value: c.section.id,
|
|
1858
|
+
label: `${c.section.name} (${c.seatCount})`
|
|
1859
1859
|
}))
|
|
1860
1860
|
}
|
|
1861
1861
|
)
|
|
@@ -1866,167 +1866,174 @@ const ai = ({
|
|
|
1866
1866
|
Te,
|
|
1867
1867
|
{
|
|
1868
1868
|
size: "sm",
|
|
1869
|
-
value: String((
|
|
1870
|
-
disabled: m ||
|
|
1871
|
-
onChange: (
|
|
1872
|
-
options:
|
|
1873
|
-
value: String(
|
|
1874
|
-
label: `${
|
|
1869
|
+
value: String((N == null ? void 0 : N.rowIndex) ?? 0),
|
|
1870
|
+
disabled: m || C.length === 0,
|
|
1871
|
+
onChange: (c) => f(Number(c)),
|
|
1872
|
+
options: C.map((c) => ({
|
|
1873
|
+
value: String(c.rowIndex),
|
|
1874
|
+
label: `${c.label} (${c.seats.length})`
|
|
1875
1875
|
}))
|
|
1876
1876
|
}
|
|
1877
1877
|
)
|
|
1878
1878
|
] })
|
|
1879
1879
|
] }),
|
|
1880
|
-
|
|
1881
|
-
const
|
|
1880
|
+
N && /* @__PURE__ */ e("ul", { className: "nice-seating-chart__seat-list", children: N.seats.map((c) => {
|
|
1881
|
+
const x = Ie(c, r), v = on(c), P = t.has(c.id);
|
|
1882
1882
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1883
|
-
|
|
1883
|
+
F,
|
|
1884
1884
|
{
|
|
1885
1885
|
size: "sm",
|
|
1886
|
-
variant:
|
|
1887
|
-
disabled: m ||
|
|
1888
|
-
ariaLabel: d(
|
|
1889
|
-
"aria-pressed":
|
|
1890
|
-
onClick: () => l(
|
|
1886
|
+
variant: P ? "primary" : "outline",
|
|
1887
|
+
disabled: m || x !== "available",
|
|
1888
|
+
ariaLabel: d(c),
|
|
1889
|
+
"aria-pressed": P,
|
|
1890
|
+
onClick: () => l(c),
|
|
1891
1891
|
children: [
|
|
1892
|
-
|
|
1893
|
-
v && /* @__PURE__ */ e(
|
|
1892
|
+
c.number,
|
|
1893
|
+
v && /* @__PURE__ */ e(An, { size: 11 })
|
|
1894
1894
|
]
|
|
1895
1895
|
}
|
|
1896
|
-
) },
|
|
1896
|
+
) }, c.id);
|
|
1897
1897
|
}) })
|
|
1898
1898
|
]
|
|
1899
1899
|
}
|
|
1900
1900
|
);
|
|
1901
|
-
},
|
|
1902
|
-
function
|
|
1901
|
+
}, di = { zoom: 1, pan: { x: 0, y: 0 } };
|
|
1902
|
+
function ui(s = {}) {
|
|
1903
1903
|
const {
|
|
1904
1904
|
minZoom: t = 0.1,
|
|
1905
|
-
maxZoom:
|
|
1906
|
-
initial: n =
|
|
1905
|
+
maxZoom: r = 10,
|
|
1906
|
+
initial: n = di,
|
|
1907
1907
|
viewport: l,
|
|
1908
1908
|
onViewportChange: o,
|
|
1909
1909
|
disabled: d = !1
|
|
1910
|
-
} = s, [m, h] =
|
|
1911
|
-
(
|
|
1912
|
-
l === void 0 && h(
|
|
1910
|
+
} = s, [m, h] = L(n), a = l ?? m, [u, p] = L(!1), k = ve(/* @__PURE__ */ new Map()), f = ve(null), g = ve(null), _ = G(
|
|
1911
|
+
(b) => {
|
|
1912
|
+
l === void 0 && h(b), o == null || o(b);
|
|
1913
1913
|
},
|
|
1914
1914
|
[l, o]
|
|
1915
|
-
),
|
|
1916
|
-
(
|
|
1917
|
-
[t,
|
|
1918
|
-
),
|
|
1919
|
-
(
|
|
1920
|
-
const
|
|
1921
|
-
if (
|
|
1915
|
+
), C = G(
|
|
1916
|
+
(b) => Math.min(r, Math.max(t, b)),
|
|
1917
|
+
[t, r]
|
|
1918
|
+
), N = G(
|
|
1919
|
+
(b, M) => {
|
|
1920
|
+
const X = C(a.zoom * b);
|
|
1921
|
+
if (X === a.zoom)
|
|
1922
1922
|
return;
|
|
1923
|
-
const B =
|
|
1924
|
-
|
|
1925
|
-
zoom:
|
|
1923
|
+
const B = X / a.zoom;
|
|
1924
|
+
_({
|
|
1925
|
+
zoom: X,
|
|
1926
1926
|
pan: {
|
|
1927
|
-
x:
|
|
1928
|
-
y:
|
|
1927
|
+
x: M.x - (M.x - a.pan.x) * B,
|
|
1928
|
+
y: M.y - (M.y - a.pan.y) * B
|
|
1929
1929
|
}
|
|
1930
1930
|
});
|
|
1931
1931
|
},
|
|
1932
|
-
[
|
|
1932
|
+
[_, C, a]
|
|
1933
1933
|
), $ = G(
|
|
1934
|
-
(
|
|
1935
|
-
const B =
|
|
1936
|
-
|
|
1934
|
+
(b, M, X) => {
|
|
1935
|
+
const B = M ?? (X ? { x: X.width / 2, y: X.height / 2 } : { x: 0, y: 0 });
|
|
1936
|
+
N(b, B);
|
|
1937
1937
|
},
|
|
1938
|
-
[
|
|
1939
|
-
),
|
|
1940
|
-
(
|
|
1941
|
-
const B = Math.max(1,
|
|
1942
|
-
Math.min((
|
|
1938
|
+
[N]
|
|
1939
|
+
), c = G(
|
|
1940
|
+
(b, M, X = 24) => {
|
|
1941
|
+
const B = Math.max(1, b.maxX - b.minX), D = Math.max(1, b.maxY - b.minY), U = C(
|
|
1942
|
+
Math.min((M.width - X * 2) / B, (M.height - X * 2) / D)
|
|
1943
1943
|
);
|
|
1944
|
-
|
|
1945
|
-
zoom:
|
|
1944
|
+
_({
|
|
1945
|
+
zoom: U,
|
|
1946
1946
|
pan: {
|
|
1947
|
-
x: (
|
|
1948
|
-
y: (
|
|
1947
|
+
x: (M.width - B * U) / 2 - b.minX * U,
|
|
1948
|
+
y: (M.height - D * U) / 2 - b.minY * U
|
|
1949
1949
|
}
|
|
1950
1950
|
});
|
|
1951
1951
|
},
|
|
1952
|
-
[
|
|
1953
|
-
),
|
|
1954
|
-
(
|
|
1955
|
-
x: (
|
|
1956
|
-
y: (
|
|
1952
|
+
[_, C]
|
|
1953
|
+
), x = G(() => _(n), [_, n]), v = G(
|
|
1954
|
+
(b) => ({
|
|
1955
|
+
x: (b.x - a.pan.x) / a.zoom,
|
|
1956
|
+
y: (b.y - a.pan.y) / a.zoom
|
|
1957
1957
|
}),
|
|
1958
1958
|
[a]
|
|
1959
|
-
),
|
|
1960
|
-
(
|
|
1961
|
-
x:
|
|
1962
|
-
y:
|
|
1959
|
+
), P = G(
|
|
1960
|
+
(b) => ({
|
|
1961
|
+
x: b.x * a.zoom + a.pan.x,
|
|
1962
|
+
y: b.y * a.zoom + a.pan.y
|
|
1963
1963
|
}),
|
|
1964
1964
|
[a]
|
|
1965
|
-
),
|
|
1966
|
-
const
|
|
1967
|
-
return { x:
|
|
1965
|
+
), w = (b) => {
|
|
1966
|
+
const M = b.currentTarget.getBoundingClientRect();
|
|
1967
|
+
return { x: b.clientX - M.left, y: b.clientY - M.top };
|
|
1968
1968
|
};
|
|
1969
1969
|
return {
|
|
1970
1970
|
viewport: a,
|
|
1971
|
-
setViewport:
|
|
1971
|
+
setViewport: _,
|
|
1972
1972
|
containerProps: d ? {} : {
|
|
1973
|
-
onWheel: (
|
|
1974
|
-
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1973
|
+
onWheel: (b) => {
|
|
1974
|
+
b.preventDefault();
|
|
1975
|
+
const M = Math.exp(-b.deltaY * 2e-3);
|
|
1976
|
+
N(Math.min(2, Math.max(0.5, M)), w(b));
|
|
1977
1977
|
},
|
|
1978
|
-
onPointerDown: (
|
|
1979
|
-
var
|
|
1980
|
-
const
|
|
1981
|
-
if (
|
|
1982
|
-
const [
|
|
1978
|
+
onPointerDown: (b) => {
|
|
1979
|
+
var X, B;
|
|
1980
|
+
const M = w(b);
|
|
1981
|
+
if (k.current.set(b.pointerId, M), (B = (X = b.currentTarget).setPointerCapture) == null || B.call(X, b.pointerId), k.current.size === 2) {
|
|
1982
|
+
const [D, U] = [...k.current.values()];
|
|
1983
1983
|
f.current = {
|
|
1984
|
-
distance: Math.hypot(
|
|
1984
|
+
distance: Math.hypot(D.x - U.x, D.y - U.y) || 1,
|
|
1985
1985
|
zoom: a.zoom
|
|
1986
1986
|
};
|
|
1987
1987
|
} else
|
|
1988
|
-
g.current =
|
|
1988
|
+
g.current = M, p(!0);
|
|
1989
1989
|
},
|
|
1990
|
-
onPointerMove: (
|
|
1991
|
-
if (!
|
|
1990
|
+
onPointerMove: (b) => {
|
|
1991
|
+
if (!k.current.has(b.pointerId))
|
|
1992
1992
|
return;
|
|
1993
|
-
const
|
|
1994
|
-
if (
|
|
1995
|
-
const [
|
|
1996
|
-
|
|
1993
|
+
const M = w(b);
|
|
1994
|
+
if (k.current.set(b.pointerId, M), k.current.size === 2 && f.current) {
|
|
1995
|
+
const [D, U] = [...k.current.values()], S = Math.hypot(D.x - U.x, D.y - U.y) || 1, y = C(f.current.zoom * (S / f.current.distance)), A = { x: (D.x + U.x) / 2, y: (D.y + U.y) / 2 };
|
|
1996
|
+
y !== a.zoom && N(y / a.zoom, A);
|
|
1997
1997
|
return;
|
|
1998
1998
|
}
|
|
1999
1999
|
if (!g.current)
|
|
2000
2000
|
return;
|
|
2001
|
-
const
|
|
2002
|
-
g.current =
|
|
2001
|
+
const X = M.x - g.current.x, B = M.y - g.current.y;
|
|
2002
|
+
g.current = M, _({ zoom: a.zoom, pan: { x: a.pan.x + X, y: a.pan.y + B } });
|
|
2003
2003
|
},
|
|
2004
|
-
onPointerUp: (
|
|
2005
|
-
|
|
2004
|
+
onPointerUp: (b) => {
|
|
2005
|
+
k.current.delete(b.pointerId), k.current.size < 2 && (f.current = null), k.current.size === 0 && (g.current = null, p(!1));
|
|
2006
2006
|
},
|
|
2007
|
-
onPointerCancel: (
|
|
2008
|
-
|
|
2007
|
+
onPointerCancel: (b) => {
|
|
2008
|
+
k.current.delete(b.pointerId), f.current = null, g.current = null, p(!1);
|
|
2009
2009
|
}
|
|
2010
2010
|
},
|
|
2011
2011
|
zoomBy: $,
|
|
2012
|
-
fitTo:
|
|
2013
|
-
reset:
|
|
2012
|
+
fitTo: c,
|
|
2013
|
+
reset: x,
|
|
2014
2014
|
screenToWorld: v,
|
|
2015
|
-
worldToScreen:
|
|
2015
|
+
worldToScreen: P,
|
|
2016
2016
|
panning: u
|
|
2017
2017
|
};
|
|
2018
2018
|
}
|
|
2019
|
-
const
|
|
2019
|
+
const mi = {
|
|
2020
2020
|
"orphan-seat": "That would leave a single empty seat. Pick a different seat.",
|
|
2021
2021
|
"not-adjacent": "Seats must be next to each other.",
|
|
2022
2022
|
"max-seats": "You have selected as many seats as this order allows.",
|
|
2023
2023
|
"category-not-allowed": "That seat is not part of the selected ticket type.",
|
|
2024
2024
|
unavailable: "That seat is not available."
|
|
2025
|
-
},
|
|
2026
|
-
|
|
2027
|
-
|
|
2025
|
+
}, hi = {
|
|
2026
|
+
id: "empty",
|
|
2027
|
+
name: "",
|
|
2028
|
+
venueId: "",
|
|
2029
|
+
sections: [],
|
|
2030
|
+
priceCategories: [],
|
|
2031
|
+
totalSeats: 0
|
|
2032
|
+
}, pi = ee(
|
|
2033
|
+
function(t, r) {
|
|
2034
|
+
var de, Pe, xe;
|
|
2028
2035
|
const {
|
|
2029
|
-
chart: n,
|
|
2036
|
+
chart: n = hi,
|
|
2030
2037
|
mode: l = "select",
|
|
2031
2038
|
selection: o = {},
|
|
2032
2039
|
selectedSeatIds: d,
|
|
@@ -2035,132 +2042,132 @@ const li = {
|
|
|
2035
2042
|
onSelectionRejected: a,
|
|
2036
2043
|
seatStatusOverrides: u,
|
|
2037
2044
|
onSeatClick: p,
|
|
2038
|
-
onBestAvailable:
|
|
2045
|
+
onBestAvailable: k,
|
|
2039
2046
|
lod: f = "auto",
|
|
2040
2047
|
onLodChange: g,
|
|
2041
|
-
maxRenderedSeats:
|
|
2042
|
-
containerSize:
|
|
2043
|
-
showLegend:
|
|
2048
|
+
maxRenderedSeats: _ = 2500,
|
|
2049
|
+
containerSize: C,
|
|
2050
|
+
showLegend: N = !0,
|
|
2044
2051
|
showList: $ = !1,
|
|
2045
|
-
zoomable:
|
|
2046
|
-
locale:
|
|
2052
|
+
zoomable: c = !0,
|
|
2053
|
+
locale: x,
|
|
2047
2054
|
disabled: v = !1,
|
|
2048
|
-
readOnly:
|
|
2049
|
-
className:
|
|
2050
|
-
style:
|
|
2051
|
-
} = t,
|
|
2055
|
+
readOnly: P = !1,
|
|
2056
|
+
className: w,
|
|
2057
|
+
style: E
|
|
2058
|
+
} = t, b = ve(null), [M, X] = L({ width: 800, height: 500 }), [B, D] = L(!1), [U, S] = L(m), [y, A] = L(null), [j, W] = L(""), z = d ?? U, Y = V(() => new Set(z), [z]), q = l === "select" && !v && !P && o.interactive !== !1, Q = o.maxSeats ?? 8, R = V(() => Qt(n), [n]), ne = C ?? M, H = !!C || B;
|
|
2052
2059
|
Ue(() => {
|
|
2053
|
-
if (
|
|
2060
|
+
if (C || !b.current || typeof ResizeObserver > "u")
|
|
2054
2061
|
return;
|
|
2055
|
-
const T =
|
|
2062
|
+
const T = b.current, O = new ResizeObserver(([K]) => {
|
|
2056
2063
|
const { width: Z, height: ae } = K.contentRect;
|
|
2057
|
-
Z > 0 && ae > 0 && (
|
|
2064
|
+
Z > 0 && ae > 0 && (X({ width: Z, height: ae }), D(!0));
|
|
2058
2065
|
});
|
|
2059
|
-
return
|
|
2060
|
-
}, [
|
|
2061
|
-
const _e =
|
|
2066
|
+
return O.observe(T), () => O.disconnect();
|
|
2067
|
+
}, [C]);
|
|
2068
|
+
const _e = ui({ disabled: !c || v }), { fitTo: ce, viewport: me } = _e, Ne = ve(!1);
|
|
2062
2069
|
Ue(() => {
|
|
2063
|
-
Ne.current || !H ||
|
|
2064
|
-
}, [ce,
|
|
2065
|
-
const
|
|
2066
|
-
() =>
|
|
2067
|
-
[
|
|
2070
|
+
Ne.current || !H || R.totalSeats === 0 || ne.width <= 0 || (Ne.current = !0, ce(R.bounds, ne));
|
|
2071
|
+
}, [ce, R, ne, H]);
|
|
2072
|
+
const De = V(() => Ht(me, ne, 40), [me, ne]), be = f !== "auto" ? f : y ? "seat" : void 0, he = V(
|
|
2073
|
+
() => ei(R, De, _, be),
|
|
2074
|
+
[R, De, _, be]
|
|
2068
2075
|
), we = ve(null);
|
|
2069
2076
|
Ue(() => {
|
|
2070
2077
|
we.current !== he.tier && (we.current = he.tier, g == null || g(he.tier));
|
|
2071
2078
|
}, [he.tier, g]);
|
|
2072
|
-
const je =
|
|
2079
|
+
const je = V(
|
|
2073
2080
|
() => {
|
|
2074
2081
|
var T;
|
|
2075
|
-
return new Map(((T = n.sections) == null ? void 0 : T.map((
|
|
2082
|
+
return new Map(((T = n.sections) == null ? void 0 : T.map((O) => [O.id, O.color])) ?? []);
|
|
2076
2083
|
},
|
|
2077
2084
|
[n.sections]
|
|
2078
|
-
), pe =
|
|
2085
|
+
), pe = V(
|
|
2079
2086
|
() => {
|
|
2080
2087
|
var T;
|
|
2081
|
-
return new Map(((T = n.sections) == null ? void 0 : T.map((
|
|
2088
|
+
return new Map(((T = n.sections) == null ? void 0 : T.map((O) => [O.id, O])) ?? []);
|
|
2082
2089
|
},
|
|
2083
2090
|
[n.sections]
|
|
2084
2091
|
), oe = G(
|
|
2085
2092
|
(T) => {
|
|
2086
|
-
const
|
|
2087
|
-
|
|
2093
|
+
const O = pe.get(T.sectorId), K = Ie(T, u), Z = on(T), ae = [
|
|
2094
|
+
O ? O.name : "",
|
|
2088
2095
|
`row ${T.row}`,
|
|
2089
2096
|
`seat ${T.number}`
|
|
2090
2097
|
].filter(Boolean);
|
|
2091
|
-
if (
|
|
2092
|
-
const ue = xn(T, n,
|
|
2093
|
-
ae.push(se(ue.amount, ue.currency,
|
|
2098
|
+
if (O && o.showPrices !== !1) {
|
|
2099
|
+
const ue = xn(T, n, O);
|
|
2100
|
+
ae.push(se(ue.amount, ue.currency, x));
|
|
2094
2101
|
}
|
|
2095
2102
|
return ae.push(K), Z === "wheelchair" && ae.push("wheelchair accessible"), Z === "companion" && ae.push("companion seat"), ae.join(", ");
|
|
2096
2103
|
},
|
|
2097
|
-
[n, pe, u, o.showPrices,
|
|
2104
|
+
[n, pe, u, o.showPrices, x]
|
|
2098
2105
|
), re = G(
|
|
2099
2106
|
(T) => {
|
|
2100
|
-
d === void 0 &&
|
|
2107
|
+
d === void 0 && S(T), h == null || h(T);
|
|
2101
2108
|
},
|
|
2102
2109
|
[d, h]
|
|
2103
|
-
),
|
|
2110
|
+
), Ce = G(
|
|
2104
2111
|
(T) => {
|
|
2105
2112
|
if (p == null || p(T), !q)
|
|
2106
2113
|
return;
|
|
2107
|
-
const
|
|
2108
|
-
if ("rejected" in
|
|
2109
|
-
a == null || a({ reason:
|
|
2114
|
+
const O = ii(z, T.id, R, o, u);
|
|
2115
|
+
if ("rejected" in O) {
|
|
2116
|
+
a == null || a({ reason: O.rejected, seatId: T.id }), W(mi[O.rejected]);
|
|
2110
2117
|
return;
|
|
2111
2118
|
}
|
|
2112
|
-
re(
|
|
2119
|
+
re(O.selected), W(`${oe(T)}. ${O.selected.length} of ${Q} selected.`);
|
|
2113
2120
|
},
|
|
2114
2121
|
[
|
|
2115
2122
|
re,
|
|
2116
2123
|
oe,
|
|
2117
|
-
|
|
2124
|
+
R,
|
|
2118
2125
|
q,
|
|
2119
2126
|
Q,
|
|
2120
2127
|
p,
|
|
2121
2128
|
a,
|
|
2122
2129
|
u,
|
|
2123
|
-
|
|
2130
|
+
z,
|
|
2124
2131
|
o
|
|
2125
2132
|
]
|
|
2126
2133
|
), ge = G(
|
|
2127
|
-
(T,
|
|
2128
|
-
if (
|
|
2129
|
-
|
|
2134
|
+
(T, O) => {
|
|
2135
|
+
if (k) {
|
|
2136
|
+
k(T, O);
|
|
2130
2137
|
return;
|
|
2131
2138
|
}
|
|
2132
|
-
const K =
|
|
2139
|
+
const K = ai(R, T, o, O, u);
|
|
2133
2140
|
if (K.length === 0) {
|
|
2134
2141
|
W(`No block of ${T} seats together is available.`);
|
|
2135
2142
|
return;
|
|
2136
2143
|
}
|
|
2137
|
-
re(K),
|
|
2144
|
+
re(K), A(K[0]), W(`Selected ${K.length} seats together.`);
|
|
2138
2145
|
},
|
|
2139
|
-
[re,
|
|
2146
|
+
[re, R, k, u, o]
|
|
2140
2147
|
), Se = G(
|
|
2141
2148
|
(T) => {
|
|
2142
|
-
const
|
|
2143
|
-
if (!
|
|
2149
|
+
const O = R.locationById.get(T);
|
|
2150
|
+
if (!O)
|
|
2144
2151
|
return;
|
|
2145
|
-
const K =
|
|
2146
|
-
(Z) => Z.sectionId ===
|
|
2152
|
+
const K = R.rows.find(
|
|
2153
|
+
(Z) => Z.sectionId === O.sectionId && Z.rowIndex === O.rowIndex
|
|
2147
2154
|
);
|
|
2148
2155
|
K && ce(K.bounds, ne, 80);
|
|
2149
2156
|
},
|
|
2150
|
-
[ce,
|
|
2157
|
+
[ce, R, ne]
|
|
2151
2158
|
), fe = G(
|
|
2152
2159
|
(T) => {
|
|
2153
2160
|
if (!T)
|
|
2154
2161
|
return;
|
|
2155
|
-
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2162
|
+
A(T), Se(T);
|
|
2163
|
+
const O = R.seatById.get(T);
|
|
2164
|
+
O && W(oe(O));
|
|
2158
2165
|
},
|
|
2159
|
-
[oe,
|
|
2166
|
+
[oe, R.seatById, Se]
|
|
2160
2167
|
), Ge = (T) => {
|
|
2161
2168
|
var ae, ue;
|
|
2162
|
-
const
|
|
2163
|
-
if (!
|
|
2169
|
+
const O = y ?? ((ue = (ae = R.rows[0]) == null ? void 0 : ae.seats[0]) == null ? void 0 : ue.id) ?? null;
|
|
2170
|
+
if (!O)
|
|
2164
2171
|
return;
|
|
2165
2172
|
const Z = {
|
|
2166
2173
|
ArrowLeft: "left",
|
|
@@ -2171,50 +2178,50 @@ const li = {
|
|
|
2171
2178
|
End: "row-end"
|
|
2172
2179
|
}[T.key];
|
|
2173
2180
|
if (Z) {
|
|
2174
|
-
T.preventDefault(), fe(
|
|
2181
|
+
T.preventDefault(), fe(y ? si(R, O, Z) : O);
|
|
2175
2182
|
return;
|
|
2176
2183
|
}
|
|
2177
2184
|
if (T.key === "PageDown" || T.key === "PageUp") {
|
|
2178
|
-
T.preventDefault(), fe(
|
|
2185
|
+
T.preventDefault(), fe(ri(R, y, T.key === "PageDown" ? "next" : "prev"));
|
|
2179
2186
|
return;
|
|
2180
2187
|
}
|
|
2181
2188
|
if (T.key === "Enter" || T.key === " ") {
|
|
2182
2189
|
T.preventDefault();
|
|
2183
|
-
const Le =
|
|
2184
|
-
Le &&
|
|
2190
|
+
const Le = R.seatById.get(O);
|
|
2191
|
+
Le && Ce(Le);
|
|
2185
2192
|
return;
|
|
2186
2193
|
}
|
|
2187
|
-
T.key === "Escape" &&
|
|
2194
|
+
T.key === "Escape" && z.length > 0 && (T.preventDefault(), re([]), W("Selection cleared."));
|
|
2188
2195
|
};
|
|
2189
|
-
if (
|
|
2190
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
2196
|
+
if (R.totalSeats === 0)
|
|
2197
|
+
return /* @__PURE__ */ e("div", { ref: r, className: `nice-seating-chart ${w ?? ""}`, style: E, children: /* @__PURE__ */ e(
|
|
2191
2198
|
ye,
|
|
2192
2199
|
{
|
|
2193
2200
|
title: "This chart has no seats",
|
|
2194
2201
|
description: "Add sections and rows to the seating chart to see it here."
|
|
2195
2202
|
}
|
|
2196
2203
|
) });
|
|
2197
|
-
const ze =
|
|
2198
|
-
const K =
|
|
2204
|
+
const ze = z.reduce((T, O) => {
|
|
2205
|
+
const K = R.seatById.get(O), Z = K ? pe.get(K.sectorId) : void 0;
|
|
2199
2206
|
return !K || !Z ? T : T + xn(K, n, Z).amount;
|
|
2200
|
-
}, 0), $e = ((
|
|
2207
|
+
}, 0), $e = ((Pe = (de = n.sections) == null ? void 0 : de[0]) == null ? void 0 : Pe.currency) ?? "PLN";
|
|
2201
2208
|
return /* @__PURE__ */ i(
|
|
2202
2209
|
"div",
|
|
2203
2210
|
{
|
|
2204
|
-
ref:
|
|
2205
|
-
className: `nice-seating-chart nice-seating-chart--${l} ${
|
|
2206
|
-
style:
|
|
2211
|
+
ref: r,
|
|
2212
|
+
className: `nice-seating-chart nice-seating-chart--${l} ${w ?? ""}`,
|
|
2213
|
+
style: E,
|
|
2207
2214
|
children: [
|
|
2208
2215
|
/* @__PURE__ */ i(
|
|
2209
2216
|
"div",
|
|
2210
2217
|
{
|
|
2211
|
-
ref:
|
|
2218
|
+
ref: b,
|
|
2212
2219
|
className: "nice-seating-chart__canvas-host",
|
|
2213
2220
|
role: "grid",
|
|
2214
2221
|
"aria-label": `${n.name} seating chart`,
|
|
2215
|
-
"aria-rowcount":
|
|
2216
|
-
"aria-colcount":
|
|
2217
|
-
tabIndex:
|
|
2222
|
+
"aria-rowcount": R.rows.length,
|
|
2223
|
+
"aria-colcount": R.totalSeats,
|
|
2224
|
+
tabIndex: y ? -1 : 0,
|
|
2218
2225
|
onKeyDown: Ge,
|
|
2219
2226
|
..._e.containerProps,
|
|
2220
2227
|
children: [
|
|
@@ -2238,19 +2245,19 @@ const li = {
|
|
|
2238
2245
|
}
|
|
2239
2246
|
) }),
|
|
2240
2247
|
/* @__PURE__ */ e("g", { transform: `translate(${me.pan.x} ${me.pan.y}) scale(${me.zoom})`, children: /* @__PURE__ */ e(
|
|
2241
|
-
|
|
2248
|
+
li,
|
|
2242
2249
|
{
|
|
2243
2250
|
cull: he,
|
|
2244
2251
|
selectedIds: Y,
|
|
2245
|
-
cursorId:
|
|
2252
|
+
cursorId: y,
|
|
2246
2253
|
statusOverrides: u,
|
|
2247
2254
|
sectionColorById: je,
|
|
2248
2255
|
interactive: q,
|
|
2249
|
-
onSeatClick:
|
|
2256
|
+
onSeatClick: Ce,
|
|
2250
2257
|
onSectionClick: o.sectionSelect ? (T) => {
|
|
2251
2258
|
var K;
|
|
2252
|
-
const
|
|
2253
|
-
|
|
2259
|
+
const O = (K = R.rows.find((Z) => Z.sectionId === T)) == null ? void 0 : K.seats[0];
|
|
2260
|
+
O && fe(O.id);
|
|
2254
2261
|
} : void 0,
|
|
2255
2262
|
describeSeat: oe
|
|
2256
2263
|
}
|
|
@@ -2258,9 +2265,9 @@ const li = {
|
|
|
2258
2265
|
]
|
|
2259
2266
|
}
|
|
2260
2267
|
),
|
|
2261
|
-
|
|
2268
|
+
c && /* @__PURE__ */ i("div", { className: "nice-seating-chart__zoom", children: [
|
|
2262
2269
|
/* @__PURE__ */ e(
|
|
2263
|
-
|
|
2270
|
+
F,
|
|
2264
2271
|
{
|
|
2265
2272
|
size: "sm",
|
|
2266
2273
|
variant: "ghost",
|
|
@@ -2270,7 +2277,7 @@ const li = {
|
|
|
2270
2277
|
}
|
|
2271
2278
|
),
|
|
2272
2279
|
/* @__PURE__ */ e(
|
|
2273
|
-
|
|
2280
|
+
F,
|
|
2274
2281
|
{
|
|
2275
2282
|
size: "sm",
|
|
2276
2283
|
variant: "ghost",
|
|
@@ -2280,12 +2287,12 @@ const li = {
|
|
|
2280
2287
|
}
|
|
2281
2288
|
),
|
|
2282
2289
|
/* @__PURE__ */ e(
|
|
2283
|
-
|
|
2290
|
+
F,
|
|
2284
2291
|
{
|
|
2285
2292
|
size: "sm",
|
|
2286
2293
|
variant: "ghost",
|
|
2287
2294
|
ariaLabel: "Fit to view",
|
|
2288
|
-
onClick: () => ce(
|
|
2295
|
+
onClick: () => ce(R.bounds, ne),
|
|
2289
2296
|
children: "Fit"
|
|
2290
2297
|
}
|
|
2291
2298
|
)
|
|
@@ -2294,7 +2301,7 @@ const li = {
|
|
|
2294
2301
|
}
|
|
2295
2302
|
),
|
|
2296
2303
|
/* @__PURE__ */ e("p", { className: "nice-seating-chart__status", role: "status", "aria-live": "polite", children: j }),
|
|
2297
|
-
|
|
2304
|
+
N && /* @__PURE__ */ i("ul", { className: "nice-seating-chart__legend", children: [
|
|
2298
2305
|
(xe = n.priceCategories) == null ? void 0 : xe.map((T) => /* @__PURE__ */ i("li", { className: "nice-seating-chart__legend-item", children: [
|
|
2299
2306
|
/* @__PURE__ */ e(
|
|
2300
2307
|
"span",
|
|
@@ -2306,29 +2313,29 @@ const li = {
|
|
|
2306
2313
|
),
|
|
2307
2314
|
T.name,
|
|
2308
2315
|
" · ",
|
|
2309
|
-
se(T.price, $e,
|
|
2316
|
+
se(T.price, $e, x)
|
|
2310
2317
|
] }, T.id)),
|
|
2311
2318
|
/* @__PURE__ */ i("li", { className: "nice-seating-chart__legend-item nice-seating-chart__legend-item--sold", children: [
|
|
2312
2319
|
/* @__PURE__ */ e("span", { className: "nice-seating-chart__legend-swatch", "aria-hidden": "true" }),
|
|
2313
2320
|
" Sold"
|
|
2314
2321
|
] })
|
|
2315
2322
|
] }),
|
|
2316
|
-
l === "select" &&
|
|
2317
|
-
|
|
2323
|
+
l === "select" && z.length > 0 && /* @__PURE__ */ i("p", { className: "nice-seating-chart__total", children: [
|
|
2324
|
+
z.length,
|
|
2318
2325
|
" seat",
|
|
2319
|
-
|
|
2326
|
+
z.length === 1 ? "" : "s",
|
|
2320
2327
|
" ·",
|
|
2321
2328
|
" ",
|
|
2322
|
-
se(ze, $e,
|
|
2329
|
+
se(ze, $e, x)
|
|
2323
2330
|
] }),
|
|
2324
2331
|
$ && /* @__PURE__ */ e(
|
|
2325
|
-
|
|
2332
|
+
oi,
|
|
2326
2333
|
{
|
|
2327
|
-
index:
|
|
2334
|
+
index: R,
|
|
2328
2335
|
selectedIds: Y,
|
|
2329
2336
|
statusOverrides: u,
|
|
2330
2337
|
maxSeats: Q,
|
|
2331
|
-
onSeatToggle:
|
|
2338
|
+
onSeatToggle: Ce,
|
|
2332
2339
|
onBestAvailable: ge,
|
|
2333
2340
|
describeSeat: oe,
|
|
2334
2341
|
disabled: !q,
|
|
@@ -2339,51 +2346,51 @@ const li = {
|
|
|
2339
2346
|
}
|
|
2340
2347
|
);
|
|
2341
2348
|
}
|
|
2342
|
-
),
|
|
2343
|
-
function({ showList: t = !0, className:
|
|
2349
|
+
), qi = ee(
|
|
2350
|
+
function({ showList: t = !0, className: r, ...n }, l) {
|
|
2344
2351
|
return /* @__PURE__ */ e(
|
|
2345
|
-
|
|
2352
|
+
pi,
|
|
2346
2353
|
{
|
|
2347
2354
|
ref: l,
|
|
2348
2355
|
mode: "select",
|
|
2349
2356
|
showList: t,
|
|
2350
|
-
className: `nice-seat-picker ${
|
|
2357
|
+
className: `nice-seat-picker ${r ?? ""}`,
|
|
2351
2358
|
...n
|
|
2352
2359
|
}
|
|
2353
2360
|
);
|
|
2354
2361
|
}
|
|
2355
|
-
), Xn = /\{\{\s*([\w.-]+)\s*\}\}/g,
|
|
2362
|
+
), Xn = /\{\{\s*([\w.-]+)\s*\}\}/g, gi = {
|
|
2356
2363
|
"&": "&",
|
|
2357
2364
|
"<": "<",
|
|
2358
2365
|
">": ">",
|
|
2359
2366
|
'"': """,
|
|
2360
2367
|
"'": "'"
|
|
2361
2368
|
};
|
|
2362
|
-
function
|
|
2363
|
-
return s.replace(/[&<>"']/g, (t) =>
|
|
2369
|
+
function fi(s) {
|
|
2370
|
+
return s.replace(/[&<>"']/g, (t) => gi[t] ?? t);
|
|
2364
2371
|
}
|
|
2365
|
-
function
|
|
2366
|
-
const t = [],
|
|
2372
|
+
function vi(s) {
|
|
2373
|
+
const t = [], r = /* @__PURE__ */ new Set();
|
|
2367
2374
|
for (const n of s.matchAll(Xn)) {
|
|
2368
2375
|
const l = n[1];
|
|
2369
|
-
|
|
2376
|
+
r.has(l) || (r.add(l), t.push(l));
|
|
2370
2377
|
}
|
|
2371
2378
|
return t;
|
|
2372
2379
|
}
|
|
2373
|
-
function
|
|
2374
|
-
const { escape: n = !0, missing: l = "keep" } =
|
|
2380
|
+
function yi(s, t = {}, r = {}) {
|
|
2381
|
+
const { escape: n = !0, missing: l = "keep" } = r;
|
|
2375
2382
|
return s.replace(Xn, (o, d) => {
|
|
2376
2383
|
const m = t[d];
|
|
2377
|
-
return m == null ? l === "blank" ? "" : o : n ?
|
|
2384
|
+
return m == null ? l === "blank" ? "" : o : n ? fi(String(m)) : String(m);
|
|
2378
2385
|
});
|
|
2379
2386
|
}
|
|
2380
2387
|
function kn(s) {
|
|
2381
2388
|
return `{{${s}}}`;
|
|
2382
2389
|
}
|
|
2383
|
-
function
|
|
2384
|
-
return
|
|
2390
|
+
function _i(s, t = {}) {
|
|
2391
|
+
return vi(s).filter((r) => t[r] === void 0 || t[r] === null);
|
|
2385
2392
|
}
|
|
2386
|
-
const
|
|
2393
|
+
const Ni = { name: "", body: "" }, bi = [
|
|
2387
2394
|
"bold",
|
|
2388
2395
|
"italic",
|
|
2389
2396
|
"underline",
|
|
@@ -2397,105 +2404,112 @@ const gi = [
|
|
|
2397
2404
|
"alignCenter",
|
|
2398
2405
|
"undo",
|
|
2399
2406
|
"redo"
|
|
2400
|
-
],
|
|
2401
|
-
function(t,
|
|
2407
|
+
], ji = ee(
|
|
2408
|
+
function(t, r) {
|
|
2402
2409
|
const {
|
|
2403
2410
|
template: n,
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2411
|
+
defaultTemplate: l,
|
|
2412
|
+
onTemplateChange: o,
|
|
2413
|
+
tokens: d = [],
|
|
2414
|
+
previewData: m = {},
|
|
2415
|
+
recipients: h = [],
|
|
2416
|
+
onRecipientsChange: a,
|
|
2417
|
+
onSend: u,
|
|
2418
|
+
sending: p = !1,
|
|
2419
|
+
toolbar: k = bi,
|
|
2420
|
+
disabled: f = !1,
|
|
2421
|
+
readOnly: g = !1,
|
|
2422
|
+
size: _ = "md",
|
|
2423
|
+
className: C,
|
|
2424
|
+
style: N
|
|
2425
|
+
} = t, [$, c] = Dt({
|
|
2426
|
+
value: n,
|
|
2427
|
+
defaultValue: l,
|
|
2428
|
+
fallbackValue: Ni,
|
|
2429
|
+
onChange: o,
|
|
2430
|
+
componentName: "NiceInvitationDesigner"
|
|
2431
|
+
}), [x, v] = L(""), P = f || g || p, w = V(() => On(x), [x]), E = V(() => {
|
|
2432
|
+
const y = {};
|
|
2433
|
+
for (const A of d)
|
|
2434
|
+
A.sample !== void 0 && (y[A.key] = A.sample);
|
|
2435
|
+
return { ...y, ...m };
|
|
2436
|
+
}, [d, m]), b = V(
|
|
2437
|
+
() => yi($.body ?? "", E),
|
|
2438
|
+
[$.body, E]
|
|
2439
|
+
), M = V(
|
|
2440
|
+
() => _i($.body ?? "", E),
|
|
2441
|
+
[$.body, E]
|
|
2442
|
+
), X = h.map((y) => y.email), B = (y) => c({ ...$, ...y }), D = (y) => {
|
|
2443
|
+
B({ body: `${$.body ?? ""}${kn(y)}` });
|
|
2444
|
+
}, U = () => {
|
|
2445
|
+
!a || w.valid.length === 0 || (a(Vt(X, w.valid)), v(""));
|
|
2446
|
+
}, S = (y) => {
|
|
2447
|
+
a == null || a(X.filter((A) => A !== y));
|
|
2434
2448
|
};
|
|
2435
2449
|
return /* @__PURE__ */ i(
|
|
2436
2450
|
"div",
|
|
2437
2451
|
{
|
|
2438
|
-
ref:
|
|
2439
|
-
className: `nice-invitation-designer nice-invitation-designer--${
|
|
2440
|
-
style:
|
|
2452
|
+
ref: r,
|
|
2453
|
+
className: `nice-invitation-designer nice-invitation-designer--${_} ${C ?? ""}`,
|
|
2454
|
+
style: N,
|
|
2441
2455
|
children: [
|
|
2442
2456
|
/* @__PURE__ */ i("section", { className: "nice-invitation-designer__editor", children: [
|
|
2443
2457
|
/* @__PURE__ */ e(
|
|
2444
2458
|
J,
|
|
2445
2459
|
{
|
|
2446
2460
|
label: "Template name",
|
|
2447
|
-
value:
|
|
2448
|
-
onChange: (
|
|
2461
|
+
value: $.name,
|
|
2462
|
+
onChange: (y) => B({ name: y }),
|
|
2449
2463
|
placeholder: "Birthday invitation",
|
|
2450
|
-
disabled:
|
|
2451
|
-
size:
|
|
2464
|
+
disabled: P,
|
|
2465
|
+
size: _
|
|
2452
2466
|
}
|
|
2453
2467
|
),
|
|
2454
|
-
|
|
2468
|
+
d.length > 0 && !g && /* @__PURE__ */ i("div", { className: "nice-invitation-designer__tokens", children: [
|
|
2455
2469
|
/* @__PURE__ */ e("span", { className: "nice-invitation-designer__tokens-label", children: "Insert:" }),
|
|
2456
|
-
|
|
2457
|
-
|
|
2470
|
+
d.map((y) => /* @__PURE__ */ e(
|
|
2471
|
+
F,
|
|
2458
2472
|
{
|
|
2459
2473
|
size: "sm",
|
|
2460
2474
|
variant: "outline",
|
|
2461
|
-
disabled:
|
|
2462
|
-
onClick: () =>
|
|
2463
|
-
children:
|
|
2475
|
+
disabled: P,
|
|
2476
|
+
onClick: () => D(y.key),
|
|
2477
|
+
children: y.label
|
|
2464
2478
|
},
|
|
2465
|
-
|
|
2479
|
+
y.key
|
|
2466
2480
|
))
|
|
2467
2481
|
] }),
|
|
2468
2482
|
/* @__PURE__ */ e(
|
|
2469
2483
|
Mt,
|
|
2470
2484
|
{
|
|
2471
|
-
value:
|
|
2472
|
-
onChange: (
|
|
2473
|
-
toolbar:
|
|
2485
|
+
value: $.body ?? "",
|
|
2486
|
+
onChange: (y) => B({ body: y }),
|
|
2487
|
+
toolbar: k,
|
|
2474
2488
|
height: 280,
|
|
2475
|
-
readOnly:
|
|
2476
|
-
disabled:
|
|
2489
|
+
readOnly: g || p,
|
|
2490
|
+
disabled: f
|
|
2477
2491
|
}
|
|
2478
2492
|
)
|
|
2479
2493
|
] }),
|
|
2480
2494
|
/* @__PURE__ */ i("section", { className: "nice-invitation-designer__preview", "aria-label": "Invitation preview", children: [
|
|
2481
2495
|
/* @__PURE__ */ i("header", { className: "nice-invitation-designer__preview-header", children: [
|
|
2482
2496
|
/* @__PURE__ */ e("h4", { children: "Preview" }),
|
|
2483
|
-
|
|
2484
|
-
|
|
2497
|
+
M.length > 0 && /* @__PURE__ */ i(te, { size: "xs", subtle: !0, variant: "warning", children: [
|
|
2498
|
+
M.length,
|
|
2485
2499
|
" unresolved"
|
|
2486
2500
|
] })
|
|
2487
2501
|
] }),
|
|
2488
|
-
|
|
2502
|
+
$.coverImageUrl && /* @__PURE__ */ e("img", { className: "nice-invitation-designer__cover", src: $.coverImageUrl, alt: "" }),
|
|
2489
2503
|
/* @__PURE__ */ e(
|
|
2490
2504
|
"div",
|
|
2491
2505
|
{
|
|
2492
2506
|
className: "nice-invitation-designer__preview-body",
|
|
2493
|
-
dangerouslySetInnerHTML: { __html:
|
|
2507
|
+
dangerouslySetInnerHTML: { __html: b }
|
|
2494
2508
|
}
|
|
2495
2509
|
),
|
|
2496
|
-
|
|
2510
|
+
M.length > 0 && /* @__PURE__ */ i("p", { className: "nice-invitation-designer__unresolved", children: [
|
|
2497
2511
|
"No preview value for: ",
|
|
2498
|
-
|
|
2512
|
+
M.map((y) => kn(y)).join(", ")
|
|
2499
2513
|
] })
|
|
2500
2514
|
] }),
|
|
2501
2515
|
/* @__PURE__ */ i("section", { className: "nice-invitation-designer__recipients", children: [
|
|
@@ -2503,78 +2517,78 @@ const gi = [
|
|
|
2503
2517
|
"Recipients ",
|
|
2504
2518
|
/* @__PURE__ */ i("span", { children: [
|
|
2505
2519
|
"(",
|
|
2506
|
-
|
|
2520
|
+
h.length,
|
|
2507
2521
|
")"
|
|
2508
2522
|
] })
|
|
2509
2523
|
] }) }),
|
|
2510
|
-
|
|
2524
|
+
a && !g && /* @__PURE__ */ i(Fe, { children: [
|
|
2511
2525
|
/* @__PURE__ */ e(
|
|
2512
2526
|
sn,
|
|
2513
2527
|
{
|
|
2514
2528
|
label: "Add addresses",
|
|
2515
|
-
value:
|
|
2516
|
-
onChange:
|
|
2529
|
+
value: x,
|
|
2530
|
+
onChange: v,
|
|
2517
2531
|
placeholder: "Paste a list — commas, semicolons or new lines",
|
|
2518
2532
|
rows: 3,
|
|
2519
|
-
disabled:
|
|
2520
|
-
size:
|
|
2533
|
+
disabled: P,
|
|
2534
|
+
size: _
|
|
2521
2535
|
}
|
|
2522
2536
|
),
|
|
2523
2537
|
/* @__PURE__ */ i("div", { className: "nice-invitation-designer__paste-actions", children: [
|
|
2524
2538
|
/* @__PURE__ */ i(
|
|
2525
|
-
|
|
2539
|
+
F,
|
|
2526
2540
|
{
|
|
2527
|
-
size:
|
|
2541
|
+
size: _,
|
|
2528
2542
|
variant: "outline",
|
|
2529
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2530
|
-
disabled:
|
|
2531
|
-
onClick:
|
|
2543
|
+
leftIcon: /* @__PURE__ */ e(Pn, { size: 15 }),
|
|
2544
|
+
disabled: P || w.valid.length === 0,
|
|
2545
|
+
onClick: U,
|
|
2532
2546
|
children: [
|
|
2533
2547
|
"Add ",
|
|
2534
|
-
|
|
2548
|
+
w.valid.length > 0 ? `(${w.valid.length})` : ""
|
|
2535
2549
|
]
|
|
2536
2550
|
}
|
|
2537
2551
|
),
|
|
2538
|
-
(
|
|
2539
|
-
|
|
2540
|
-
|
|
2552
|
+
(w.invalid.length > 0 || w.duplicates > 0) && /* @__PURE__ */ i("span", { className: "nice-invitation-designer__paste-hint", children: [
|
|
2553
|
+
w.duplicates > 0 && `${w.duplicates} duplicate(s). `,
|
|
2554
|
+
w.invalid.length > 0 && `${w.invalid.length} not recognised: ${w.invalid.slice(0, 3).join(", ")}`
|
|
2541
2555
|
] })
|
|
2542
2556
|
] })
|
|
2543
2557
|
] }),
|
|
2544
|
-
|
|
2545
|
-
/* @__PURE__ */ e("span", { children:
|
|
2546
|
-
|
|
2558
|
+
h.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-invitation-designer__recipient-list", children: h.map((y) => /* @__PURE__ */ i("li", { className: "nice-invitation-designer__recipient", children: [
|
|
2559
|
+
/* @__PURE__ */ e("span", { children: y.name ? `${y.name} <${y.email}>` : y.email }),
|
|
2560
|
+
y.status && y.status !== "pending" && /* @__PURE__ */ e(
|
|
2547
2561
|
te,
|
|
2548
2562
|
{
|
|
2549
2563
|
size: "xs",
|
|
2550
2564
|
subtle: !0,
|
|
2551
|
-
variant:
|
|
2552
|
-
children:
|
|
2565
|
+
variant: y.status === "sent" ? "success" : "error",
|
|
2566
|
+
children: y.status
|
|
2553
2567
|
}
|
|
2554
2568
|
),
|
|
2555
|
-
|
|
2556
|
-
|
|
2569
|
+
a && !g && /* @__PURE__ */ e(
|
|
2570
|
+
F,
|
|
2557
2571
|
{
|
|
2558
2572
|
size: "sm",
|
|
2559
2573
|
variant: "ghost",
|
|
2560
|
-
ariaLabel: `Remove ${
|
|
2561
|
-
disabled:
|
|
2562
|
-
onClick: () =>
|
|
2563
|
-
children: /* @__PURE__ */ e(
|
|
2574
|
+
ariaLabel: `Remove ${y.email}`,
|
|
2575
|
+
disabled: P,
|
|
2576
|
+
onClick: () => S(y.email),
|
|
2577
|
+
children: /* @__PURE__ */ e(Ee, { size: 13 })
|
|
2564
2578
|
}
|
|
2565
2579
|
)
|
|
2566
|
-
] },
|
|
2567
|
-
|
|
2568
|
-
|
|
2580
|
+
] }, y.email)) }),
|
|
2581
|
+
u && !g && /* @__PURE__ */ e(
|
|
2582
|
+
F,
|
|
2569
2583
|
{
|
|
2570
2584
|
variant: "primary",
|
|
2571
|
-
size:
|
|
2585
|
+
size: _,
|
|
2572
2586
|
leftIcon: /* @__PURE__ */ e(yt, { size: 15 }),
|
|
2573
|
-
loading:
|
|
2587
|
+
loading: p,
|
|
2574
2588
|
ariaLabel: "Send invitations",
|
|
2575
|
-
disabled:
|
|
2576
|
-
onClick: () =>
|
|
2577
|
-
children:
|
|
2589
|
+
disabled: f || p || h.length === 0,
|
|
2590
|
+
onClick: () => u({ templateId: $.id, emails: X }),
|
|
2591
|
+
children: p ? "Sending…" : `Send to ${h.length}`
|
|
2578
2592
|
}
|
|
2579
2593
|
)
|
|
2580
2594
|
] })
|
|
@@ -2582,17 +2596,17 @@ const gi = [
|
|
|
2582
2596
|
}
|
|
2583
2597
|
);
|
|
2584
2598
|
}
|
|
2585
|
-
),
|
|
2599
|
+
), wi = ({
|
|
2586
2600
|
value: s,
|
|
2587
2601
|
max: t,
|
|
2588
|
-
currency:
|
|
2602
|
+
currency: r,
|
|
2589
2603
|
locale: n,
|
|
2590
2604
|
label: l,
|
|
2591
2605
|
className: o
|
|
2592
2606
|
}) => {
|
|
2593
|
-
const d = t > 0 ? t : 1, m = s >= t && t > 0, h = (a, u) =>
|
|
2607
|
+
const d = t > 0 ? t : 1, m = s >= t && t > 0, h = (a, u) => r ? `${se(a, r, n)} / ${se(u, r, n)}` : `${a} / ${u}`;
|
|
2594
2608
|
return /* @__PURE__ */ e(
|
|
2595
|
-
|
|
2609
|
+
Et,
|
|
2596
2610
|
{
|
|
2597
2611
|
className: o,
|
|
2598
2612
|
value: Math.min(s, d),
|
|
@@ -2604,17 +2618,17 @@ const gi = [
|
|
|
2604
2618
|
"aria-label": l
|
|
2605
2619
|
}
|
|
2606
2620
|
);
|
|
2607
|
-
};
|
|
2608
|
-
function
|
|
2621
|
+
}, xi = [];
|
|
2622
|
+
function ki(s, t) {
|
|
2609
2623
|
if (t === "wishlist")
|
|
2610
2624
|
return { value: s.isPurchased ? 1 : 0, max: 1, complete: !!s.isPurchased };
|
|
2611
|
-
const
|
|
2612
|
-
return { value: n, max:
|
|
2625
|
+
const r = s.quantityNeeded ?? 1, n = s.quantityContributed ?? 0;
|
|
2626
|
+
return { value: n, max: r, complete: r > 0 && n >= r };
|
|
2613
2627
|
}
|
|
2614
|
-
const
|
|
2615
|
-
function(t,
|
|
2628
|
+
const Gi = ee(
|
|
2629
|
+
function(t, r) {
|
|
2616
2630
|
const {
|
|
2617
|
-
items: n,
|
|
2631
|
+
items: n = xi,
|
|
2618
2632
|
kind: l = "registry",
|
|
2619
2633
|
mode: o = "owner",
|
|
2620
2634
|
currency: d = "PLN",
|
|
@@ -2623,66 +2637,66 @@ const Oi = ee(
|
|
|
2623
2637
|
currentUserId: a,
|
|
2624
2638
|
currentUserName: u,
|
|
2625
2639
|
onContribute: p,
|
|
2626
|
-
onClaim:
|
|
2640
|
+
onClaim: k,
|
|
2627
2641
|
onUnclaim: f,
|
|
2628
2642
|
onItemAdd: g,
|
|
2629
|
-
onItemDelete:
|
|
2630
|
-
onItemClick:
|
|
2631
|
-
layout:
|
|
2643
|
+
onItemDelete: _,
|
|
2644
|
+
onItemClick: C,
|
|
2645
|
+
layout: N = "grid",
|
|
2632
2646
|
disabled: $ = !1,
|
|
2633
|
-
readOnly:
|
|
2634
|
-
size:
|
|
2647
|
+
readOnly: c = !1,
|
|
2648
|
+
size: x = "md",
|
|
2635
2649
|
className: v,
|
|
2636
|
-
style:
|
|
2637
|
-
} = t,
|
|
2638
|
-
(
|
|
2639
|
-
) : n, [n,
|
|
2640
|
-
|
|
2641
|
-
}, W = (
|
|
2642
|
-
!p || !
|
|
2643
|
-
amount:
|
|
2644
|
-
quantity:
|
|
2645
|
-
userName:
|
|
2646
|
-
userId:
|
|
2650
|
+
style: P
|
|
2651
|
+
} = t, w = Un({ currentUserId: a, currentUserName: u }), [E, b] = L(null), [M, X] = L(0), [B, D] = L(""), U = o === "owner", S = $ || c, y = l === "wishlist", A = V(() => y ? [...n].sort(
|
|
2652
|
+
(z, Y) => Number(z.isPurchased ?? !1) - Number(Y.isPurchased ?? !1) || (Y.priority ?? 0) - (z.priority ?? 0)
|
|
2653
|
+
) : n, [n, y]), j = () => {
|
|
2654
|
+
b(null), X(0);
|
|
2655
|
+
}, W = (z) => {
|
|
2656
|
+
!p || !w.canAct || (p(z.id, {
|
|
2657
|
+
amount: M > 0 ? M : void 0,
|
|
2658
|
+
quantity: M > 0 ? void 0 : 1,
|
|
2659
|
+
userName: w.actor.userName,
|
|
2660
|
+
userId: w.actor.userId
|
|
2647
2661
|
}), j());
|
|
2648
2662
|
};
|
|
2649
|
-
return n.length === 0 ? /* @__PURE__ */ e("div", { ref:
|
|
2663
|
+
return n.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-gift-registry ${v ?? ""}`, style: P, children: /* @__PURE__ */ e(
|
|
2650
2664
|
ye,
|
|
2651
2665
|
{
|
|
2652
2666
|
icon: /* @__PURE__ */ e(_t, { size: 28 }),
|
|
2653
|
-
title:
|
|
2654
|
-
description:
|
|
2667
|
+
title: y ? "Nothing on the wishlist yet" : "No gifts on the registry yet",
|
|
2668
|
+
description: U ? "Add what you would like and share the link." : "The host has not added anything yet."
|
|
2655
2669
|
}
|
|
2656
2670
|
) }) : /* @__PURE__ */ i(
|
|
2657
2671
|
"div",
|
|
2658
2672
|
{
|
|
2659
|
-
ref:
|
|
2660
|
-
className: `nice-gift-registry nice-gift-registry--${l} nice-gift-registry--${
|
|
2661
|
-
style:
|
|
2673
|
+
ref: r,
|
|
2674
|
+
className: `nice-gift-registry nice-gift-registry--${l} nice-gift-registry--${N} nice-gift-registry--${x} ${v ?? ""}`,
|
|
2675
|
+
style: P,
|
|
2662
2676
|
children: [
|
|
2663
|
-
!
|
|
2677
|
+
!U && w.isAnonymous && (p || k) && /* @__PURE__ */ e(
|
|
2664
2678
|
J,
|
|
2665
2679
|
{
|
|
2666
2680
|
label: "Your name",
|
|
2667
|
-
value:
|
|
2668
|
-
onChange:
|
|
2681
|
+
value: w.name,
|
|
2682
|
+
onChange: w.setName,
|
|
2669
2683
|
placeholder: "So the host knows who to thank",
|
|
2670
2684
|
required: !0,
|
|
2671
|
-
disabled:
|
|
2672
|
-
size:
|
|
2685
|
+
disabled: S,
|
|
2686
|
+
size: x
|
|
2673
2687
|
}
|
|
2674
2688
|
),
|
|
2675
|
-
/* @__PURE__ */ e(Ln, { columns:
|
|
2676
|
-
const { value: Y, max: q, complete: Q } =
|
|
2689
|
+
/* @__PURE__ */ e(Ln, { columns: N === "list" ? 1 : void 0, minColumnWidth: 240, gap: 12, children: A.map((z) => {
|
|
2690
|
+
const { value: Y, max: q, complete: Q } = ki(z, l), R = z.price, ne = z.contributions ?? [];
|
|
2677
2691
|
return /* @__PURE__ */ i(
|
|
2678
2692
|
"div",
|
|
2679
2693
|
{
|
|
2680
2694
|
className: `nice-gift-registry__item${Q ? " nice-gift-registry__item--complete" : ""}`,
|
|
2681
2695
|
children: [
|
|
2682
|
-
|
|
2696
|
+
z.imageUrl && /* @__PURE__ */ e(
|
|
2683
2697
|
"img",
|
|
2684
2698
|
{
|
|
2685
|
-
src:
|
|
2699
|
+
src: z.imageUrl,
|
|
2686
2700
|
alt: "",
|
|
2687
2701
|
className: "nice-gift-registry__image",
|
|
2688
2702
|
loading: "lazy"
|
|
@@ -2694,25 +2708,25 @@ const Oi = ee(
|
|
|
2694
2708
|
{
|
|
2695
2709
|
type: "button",
|
|
2696
2710
|
className: "nice-gift-registry__title",
|
|
2697
|
-
onClick: () =>
|
|
2698
|
-
disabled: !
|
|
2699
|
-
children:
|
|
2711
|
+
onClick: () => C == null ? void 0 : C(z),
|
|
2712
|
+
disabled: !C,
|
|
2713
|
+
children: z.title
|
|
2700
2714
|
}
|
|
2701
2715
|
),
|
|
2702
|
-
|
|
2716
|
+
z.description && /* @__PURE__ */ e("p", { className: "nice-gift-registry__description", children: z.description }),
|
|
2703
2717
|
/* @__PURE__ */ i("div", { className: "nice-gift-registry__facts", children: [
|
|
2704
|
-
|
|
2705
|
-
|
|
2718
|
+
R && /* @__PURE__ */ e("span", { className: "nice-gift-registry__price", children: se(R.amount, R.currency || d, m) }),
|
|
2719
|
+
y && (z.priority ?? 0) > 0 && /* @__PURE__ */ i(te, { size: "xs", subtle: !0, variant: "warning", children: [
|
|
2706
2720
|
/* @__PURE__ */ e(Nt, { size: 11 }),
|
|
2707
2721
|
" ",
|
|
2708
|
-
|
|
2722
|
+
z.priority
|
|
2709
2723
|
] }),
|
|
2710
|
-
Q && /* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: "success", children:
|
|
2711
|
-
|
|
2724
|
+
Q && /* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: "success", children: y ? "bought" : "fully covered" }),
|
|
2725
|
+
z.url && /* @__PURE__ */ i(
|
|
2712
2726
|
"a",
|
|
2713
2727
|
{
|
|
2714
2728
|
className: "nice-gift-registry__link",
|
|
2715
|
-
href:
|
|
2729
|
+
href: z.url,
|
|
2716
2730
|
target: "_blank",
|
|
2717
2731
|
rel: "noopener noreferrer",
|
|
2718
2732
|
children: [
|
|
@@ -2722,17 +2736,17 @@ const Oi = ee(
|
|
|
2722
2736
|
}
|
|
2723
2737
|
)
|
|
2724
2738
|
] }),
|
|
2725
|
-
!
|
|
2726
|
-
|
|
2739
|
+
!y && /* @__PURE__ */ e(
|
|
2740
|
+
wi,
|
|
2727
2741
|
{
|
|
2728
2742
|
value: Y,
|
|
2729
2743
|
max: q,
|
|
2730
|
-
label: `${
|
|
2744
|
+
label: `${z.title}: ${Y} of ${q} covered`
|
|
2731
2745
|
}
|
|
2732
2746
|
),
|
|
2733
2747
|
!h && ne.length > 0 && /* @__PURE__ */ e("ul", { className: "nice-gift-registry__contributors", children: ne.map((H) => /* @__PURE__ */ i("li", { className: "nice-gift-registry__contributor", children: [
|
|
2734
2748
|
/* @__PURE__ */ e("strong", { children: H.contributorName }),
|
|
2735
|
-
H.amount !== void 0 && ` — ${se(H.amount, (
|
|
2749
|
+
H.amount !== void 0 && ` — ${se(H.amount, (R == null ? void 0 : R.currency) || d, m)}`,
|
|
2736
2750
|
H.amount === void 0 && H.quantity ? ` — ${H.quantity}×` : "",
|
|
2737
2751
|
H.message && /* @__PURE__ */ i("em", { children: [
|
|
2738
2752
|
" “",
|
|
@@ -2741,106 +2755,106 @@ const Oi = ee(
|
|
|
2741
2755
|
] })
|
|
2742
2756
|
] }, H.id)) }),
|
|
2743
2757
|
/* @__PURE__ */ i("div", { className: "nice-gift-registry__actions", children: [
|
|
2744
|
-
!
|
|
2745
|
-
|
|
2758
|
+
!U && !Q && k && /* @__PURE__ */ e(
|
|
2759
|
+
F,
|
|
2746
2760
|
{
|
|
2747
2761
|
size: "sm",
|
|
2748
2762
|
variant: "primary",
|
|
2749
|
-
disabled:
|
|
2763
|
+
disabled: S || !w.canAct,
|
|
2750
2764
|
leftIcon: /* @__PURE__ */ e(qe, { size: 14 }),
|
|
2751
|
-
onClick: () =>
|
|
2765
|
+
onClick: () => k(z.id, { ...w.actor, quantity: 1 }),
|
|
2752
2766
|
children: "I'll take this"
|
|
2753
2767
|
}
|
|
2754
2768
|
),
|
|
2755
|
-
!
|
|
2756
|
-
|
|
2769
|
+
!U && Q && f && /* @__PURE__ */ e(
|
|
2770
|
+
F,
|
|
2757
2771
|
{
|
|
2758
2772
|
size: "sm",
|
|
2759
2773
|
variant: "ghost",
|
|
2760
|
-
disabled:
|
|
2761
|
-
onClick: () => f(
|
|
2774
|
+
disabled: S,
|
|
2775
|
+
onClick: () => f(z.id),
|
|
2762
2776
|
children: "Release"
|
|
2763
2777
|
}
|
|
2764
2778
|
),
|
|
2765
|
-
!
|
|
2766
|
-
|
|
2779
|
+
!U && !Q && !y && p && /* @__PURE__ */ e(
|
|
2780
|
+
F,
|
|
2767
2781
|
{
|
|
2768
2782
|
size: "sm",
|
|
2769
2783
|
variant: "outline",
|
|
2770
|
-
disabled:
|
|
2771
|
-
onClick: () =>
|
|
2784
|
+
disabled: S || !w.canAct,
|
|
2785
|
+
onClick: () => b(E === z.id ? null : z.id),
|
|
2772
2786
|
children: "Chip in"
|
|
2773
2787
|
}
|
|
2774
2788
|
),
|
|
2775
|
-
|
|
2776
|
-
|
|
2789
|
+
U && _ && !c && /* @__PURE__ */ e(
|
|
2790
|
+
F,
|
|
2777
2791
|
{
|
|
2778
2792
|
size: "sm",
|
|
2779
2793
|
variant: "ghost",
|
|
2780
|
-
ariaLabel: `Delete ${
|
|
2794
|
+
ariaLabel: `Delete ${z.title}`,
|
|
2781
2795
|
disabled: $,
|
|
2782
|
-
onClick: () =>
|
|
2783
|
-
children: /* @__PURE__ */ e(
|
|
2796
|
+
onClick: () => _(z.id),
|
|
2797
|
+
children: /* @__PURE__ */ e(Ee, { size: 14 })
|
|
2784
2798
|
}
|
|
2785
2799
|
)
|
|
2786
2800
|
] }),
|
|
2787
|
-
|
|
2801
|
+
E === z.id && /* @__PURE__ */ i("div", { className: "nice-gift-registry__pledge", children: [
|
|
2788
2802
|
/* @__PURE__ */ i("label", { className: "nice-gift-registry__pledge-field", children: [
|
|
2789
2803
|
/* @__PURE__ */ i("span", { children: [
|
|
2790
2804
|
"Amount (",
|
|
2791
|
-
(
|
|
2805
|
+
(R == null ? void 0 : R.currency) || d,
|
|
2792
2806
|
")"
|
|
2793
2807
|
] }),
|
|
2794
2808
|
/* @__PURE__ */ e(
|
|
2795
2809
|
rn,
|
|
2796
2810
|
{
|
|
2797
|
-
value:
|
|
2798
|
-
onChange: (H) =>
|
|
2811
|
+
value: M,
|
|
2812
|
+
onChange: (H) => X(Math.max(0, H ?? 0)),
|
|
2799
2813
|
min: 0,
|
|
2800
2814
|
size: "xs",
|
|
2801
|
-
disabled:
|
|
2815
|
+
disabled: S
|
|
2802
2816
|
}
|
|
2803
2817
|
)
|
|
2804
2818
|
] }),
|
|
2805
2819
|
/* @__PURE__ */ e(
|
|
2806
|
-
|
|
2820
|
+
F,
|
|
2807
2821
|
{
|
|
2808
2822
|
size: "sm",
|
|
2809
2823
|
variant: "primary",
|
|
2810
|
-
disabled:
|
|
2811
|
-
onClick: () => W(
|
|
2824
|
+
disabled: S || !w.canAct,
|
|
2825
|
+
onClick: () => W(z),
|
|
2812
2826
|
children: "Confirm"
|
|
2813
2827
|
}
|
|
2814
2828
|
),
|
|
2815
|
-
/* @__PURE__ */ e(
|
|
2829
|
+
/* @__PURE__ */ e(F, { size: "sm", variant: "ghost", onClick: j, children: "Cancel" })
|
|
2816
2830
|
] })
|
|
2817
2831
|
] })
|
|
2818
2832
|
]
|
|
2819
2833
|
},
|
|
2820
|
-
|
|
2834
|
+
z.id
|
|
2821
2835
|
);
|
|
2822
2836
|
}) }),
|
|
2823
|
-
|
|
2837
|
+
U && g && !c && /* @__PURE__ */ i("div", { className: "nice-gift-registry__add", children: [
|
|
2824
2838
|
/* @__PURE__ */ e(
|
|
2825
2839
|
J,
|
|
2826
2840
|
{
|
|
2827
|
-
label:
|
|
2841
|
+
label: y ? "Add a wish" : "Add a gift",
|
|
2828
2842
|
value: B,
|
|
2829
|
-
onChange:
|
|
2843
|
+
onChange: D,
|
|
2830
2844
|
placeholder: "What would you like?",
|
|
2831
2845
|
disabled: $,
|
|
2832
|
-
size:
|
|
2846
|
+
size: x
|
|
2833
2847
|
}
|
|
2834
2848
|
),
|
|
2835
2849
|
/* @__PURE__ */ e(
|
|
2836
|
-
|
|
2850
|
+
F,
|
|
2837
2851
|
{
|
|
2838
2852
|
variant: "primary",
|
|
2839
|
-
size:
|
|
2853
|
+
size: x,
|
|
2840
2854
|
leftIcon: /* @__PURE__ */ e(zn, { size: 15 }),
|
|
2841
2855
|
disabled: $ || !B.trim(),
|
|
2842
2856
|
onClick: () => {
|
|
2843
|
-
g({ title: B.trim(), quantityNeeded: 1 }),
|
|
2857
|
+
g({ title: B.trim(), quantityNeeded: 1 }), D("");
|
|
2844
2858
|
},
|
|
2845
2859
|
children: "Add"
|
|
2846
2860
|
}
|
|
@@ -2851,15 +2865,15 @@ const Oi = ee(
|
|
|
2851
2865
|
);
|
|
2852
2866
|
}
|
|
2853
2867
|
);
|
|
2854
|
-
function
|
|
2868
|
+
function Ii(s) {
|
|
2855
2869
|
const t = /* @__PURE__ */ new Map();
|
|
2856
|
-
for (const
|
|
2857
|
-
const n = (
|
|
2858
|
-
l ? l.push(
|
|
2870
|
+
for (const r of s) {
|
|
2871
|
+
const n = (r.currency || "").toUpperCase(), l = t.get(n);
|
|
2872
|
+
l ? l.push(r) : t.set(n, [r]);
|
|
2859
2873
|
}
|
|
2860
2874
|
return t;
|
|
2861
2875
|
}
|
|
2862
|
-
function
|
|
2876
|
+
function Ci(s, t, r) {
|
|
2863
2877
|
var h;
|
|
2864
2878
|
const n = new Set(t.map((a) => a.id)), l = t.map((a) => a.id), o = new Map(l.map((a) => [a, 0])), d = [];
|
|
2865
2879
|
let m = 0;
|
|
@@ -2879,37 +2893,37 @@ function _i(s, t, c) {
|
|
|
2879
2893
|
d.push({ itemId: a.id, reason: "unknown-payer" });
|
|
2880
2894
|
continue;
|
|
2881
2895
|
}
|
|
2882
|
-
let p = (h = a.splitAmong) != null && h.length ? a.splitAmong.filter((
|
|
2896
|
+
let p = (h = a.splitAmong) != null && h.length ? a.splitAmong.filter((N) => n.has(N)) : l;
|
|
2883
2897
|
p.length === 0 && (p = l);
|
|
2884
|
-
const
|
|
2885
|
-
m +=
|
|
2886
|
-
const f = p.length, g = Math.floor(
|
|
2887
|
-
if (
|
|
2888
|
-
if (
|
|
2889
|
-
|
|
2898
|
+
const k = ln(a.amount, r);
|
|
2899
|
+
m += k;
|
|
2900
|
+
const f = p.length, g = Math.floor(k / f), _ = k - g * f, C = new Map(p.map((N) => [N, g]));
|
|
2901
|
+
if (_ !== 0)
|
|
2902
|
+
if (C.has(u))
|
|
2903
|
+
C.set(u, (C.get(u) ?? 0) + _);
|
|
2890
2904
|
else {
|
|
2891
|
-
const
|
|
2892
|
-
for (let
|
|
2893
|
-
const
|
|
2894
|
-
|
|
2905
|
+
const N = [...p].sort(Ve), $ = _ > 0 ? 1 : -1;
|
|
2906
|
+
for (let c = 0; c < Math.abs(_); c += 1) {
|
|
2907
|
+
const x = N[c % N.length];
|
|
2908
|
+
C.set(x, (C.get(x) ?? 0) + $);
|
|
2895
2909
|
}
|
|
2896
2910
|
}
|
|
2897
|
-
o.set(u, (o.get(u) ?? 0) +
|
|
2898
|
-
for (const [
|
|
2899
|
-
o.set(
|
|
2911
|
+
o.set(u, (o.get(u) ?? 0) + k);
|
|
2912
|
+
for (const [N, $] of C)
|
|
2913
|
+
o.set(N, (o.get(N) ?? 0) - $);
|
|
2900
2914
|
}
|
|
2901
2915
|
return { balances: o, issues: d, totalMinor: m };
|
|
2902
2916
|
}
|
|
2903
|
-
function
|
|
2917
|
+
function Si(s, t, r) {
|
|
2904
2918
|
for (const n of t) {
|
|
2905
|
-
if ((n.currency || "").toUpperCase() !==
|
|
2919
|
+
if ((n.currency || "").toUpperCase() !== r || !s.has(n.fromId) || !s.has(n.toId))
|
|
2906
2920
|
continue;
|
|
2907
|
-
const l = ln(n.amount,
|
|
2921
|
+
const l = ln(n.amount, r);
|
|
2908
2922
|
s.set(n.fromId, (s.get(n.fromId) ?? 0) + l), s.set(n.toId, (s.get(n.toId) ?? 0) - l);
|
|
2909
2923
|
}
|
|
2910
2924
|
}
|
|
2911
|
-
function
|
|
2912
|
-
const n = new Map(t.map((a) => [a.id, a.name])), l = [...s.entries()].filter(([, a]) => a > 0).map(([a, u]) => ({ id: a, v: u })).sort((a, u) => u.v - a.v ||
|
|
2925
|
+
function zi(s, t, r) {
|
|
2926
|
+
const n = new Map(t.map((a) => [a.id, a.name])), l = [...s.entries()].filter(([, a]) => a > 0).map(([a, u]) => ({ id: a, v: u })).sort((a, u) => u.v - a.v || Ve(a.id, u.id)), o = [...s.entries()].filter(([, a]) => a < 0).map(([a, u]) => ({ id: a, v: u })).sort((a, u) => a.v - u.v || Ve(a.id, u.id)), d = [];
|
|
2913
2927
|
let m = 0, h = 0;
|
|
2914
2928
|
for (; m < o.length && h < l.length; ) {
|
|
2915
2929
|
const a = Math.min(-o[m].v, l[h].v);
|
|
@@ -2918,17 +2932,17 @@ function bi(s, t, c) {
|
|
|
2918
2932
|
fromName: n.get(o[m].id) ?? o[m].id,
|
|
2919
2933
|
toId: l[h].id,
|
|
2920
2934
|
toName: n.get(l[h].id) ?? l[h].id,
|
|
2921
|
-
amount: Xe(a,
|
|
2922
|
-
currency:
|
|
2935
|
+
amount: Xe(a, r),
|
|
2936
|
+
currency: r
|
|
2923
2937
|
}), o[m].v += a, l[h].v -= a, o[m].v === 0 && (m += 1), l[h].v === 0 && (h += 1);
|
|
2924
2938
|
}
|
|
2925
2939
|
return d;
|
|
2926
2940
|
}
|
|
2927
|
-
function
|
|
2928
|
-
const n = [], l = [], o = [...
|
|
2941
|
+
function $i(s, t, r = []) {
|
|
2942
|
+
const n = [], l = [], o = [...Ii(s).entries()].sort(([d], [m]) => Ve(d, m));
|
|
2929
2943
|
for (const [d, m] of o) {
|
|
2930
|
-
const h =
|
|
2931
|
-
l.push(...h.issues),
|
|
2944
|
+
const h = Ci(m, t, d);
|
|
2945
|
+
l.push(...h.issues), Si(h.balances, r, d), n.push({
|
|
2932
2946
|
currency: d,
|
|
2933
2947
|
total: Xe(h.totalMinor, d),
|
|
2934
2948
|
balances: t.map((a) => ({
|
|
@@ -2937,19 +2951,19 @@ function wi(s, t, c = []) {
|
|
|
2937
2951
|
amount: Xe(h.balances.get(a.id) ?? 0, d),
|
|
2938
2952
|
currency: d
|
|
2939
2953
|
})),
|
|
2940
|
-
transfers:
|
|
2954
|
+
transfers: zi(h.balances, t, d)
|
|
2941
2955
|
});
|
|
2942
2956
|
}
|
|
2943
2957
|
return { groups: n, issues: l };
|
|
2944
2958
|
}
|
|
2945
|
-
function
|
|
2959
|
+
function Ve(s, t) {
|
|
2946
2960
|
return s < t ? -1 : s > t ? 1 : 0;
|
|
2947
2961
|
}
|
|
2948
|
-
const
|
|
2949
|
-
function(t,
|
|
2962
|
+
const Pi = [], Ai = [], Ki = ee(
|
|
2963
|
+
function(t, r) {
|
|
2950
2964
|
const {
|
|
2951
|
-
items: n,
|
|
2952
|
-
participants: l,
|
|
2965
|
+
items: n = Pi,
|
|
2966
|
+
participants: l = Ai,
|
|
2953
2967
|
settlements: o = [],
|
|
2954
2968
|
view: d,
|
|
2955
2969
|
defaultView: m = "expenses",
|
|
@@ -2957,36 +2971,36 @@ const Ui = ee(
|
|
|
2957
2971
|
onSettle: a,
|
|
2958
2972
|
onItemDelete: u,
|
|
2959
2973
|
onItemClick: p,
|
|
2960
|
-
onValidationChange:
|
|
2974
|
+
onValidationChange: k,
|
|
2961
2975
|
sortBy: f = "date",
|
|
2962
2976
|
locale: g,
|
|
2963
|
-
disabled:
|
|
2964
|
-
readOnly:
|
|
2965
|
-
size:
|
|
2977
|
+
disabled: _ = !1,
|
|
2978
|
+
readOnly: C = !1,
|
|
2979
|
+
size: N = "md",
|
|
2966
2980
|
className: $,
|
|
2967
|
-
style:
|
|
2968
|
-
} = t, [
|
|
2969
|
-
() => l.map((
|
|
2981
|
+
style: c
|
|
2982
|
+
} = t, [x, v] = L(m), P = d ?? x, w = _ || C, E = V(
|
|
2983
|
+
() => l.map((S) => ({ id: S.id, name: S.name })),
|
|
2970
2984
|
[l]
|
|
2971
|
-
),
|
|
2985
|
+
), b = V(() => $i(n, E, o), [n, E, o]), M = V(() => f === "none" ? n : n.map((S, y) => ({ item: S, index: y })).sort((S, y) => {
|
|
2972
2986
|
if (f === "amount")
|
|
2973
|
-
return
|
|
2974
|
-
const
|
|
2975
|
-
return
|
|
2976
|
-
}).map((
|
|
2987
|
+
return y.item.amount - S.item.amount || S.index - y.index;
|
|
2988
|
+
const A = S.item.incurredAt, j = y.item.incurredAt;
|
|
2989
|
+
return A && j ? A.localeCompare(j) || S.index - y.index : A ? -1 : j ? 1 : S.index - y.index;
|
|
2990
|
+
}).map((S) => S.item), [n, f]), X = b.issues.map((S) => `${S.itemId}:${S.reason}`).join("|");
|
|
2977
2991
|
Me.useEffect(() => {
|
|
2978
|
-
|
|
2979
|
-
}, [
|
|
2980
|
-
const B =
|
|
2981
|
-
() => new Map(l.map((
|
|
2992
|
+
k == null || k(b.issues);
|
|
2993
|
+
}, [X]);
|
|
2994
|
+
const B = V(
|
|
2995
|
+
() => new Map(l.map((S) => [S.id, S.avatarUrl])),
|
|
2982
2996
|
[l]
|
|
2983
|
-
),
|
|
2984
|
-
() => new Map(
|
|
2985
|
-
[
|
|
2986
|
-
),
|
|
2987
|
-
d === void 0 && v(
|
|
2997
|
+
), D = V(
|
|
2998
|
+
() => new Map(b.issues.map((S) => [S.itemId, S.reason])),
|
|
2999
|
+
[b.issues]
|
|
3000
|
+
), U = (S) => {
|
|
3001
|
+
d === void 0 && v(S), h == null || h(S);
|
|
2988
3002
|
};
|
|
2989
|
-
return n.length === 0 ? /* @__PURE__ */ e("div", { ref:
|
|
3003
|
+
return n.length === 0 ? /* @__PURE__ */ e("div", { ref: r, className: `nice-expense-split ${$ ?? ""}`, style: c, children: /* @__PURE__ */ e(
|
|
2990
3004
|
ye,
|
|
2991
3005
|
{
|
|
2992
3006
|
icon: /* @__PURE__ */ e(wt, { size: 28 }),
|
|
@@ -2996,16 +3010,16 @@ const Ui = ee(
|
|
|
2996
3010
|
) }) : /* @__PURE__ */ i(
|
|
2997
3011
|
"div",
|
|
2998
3012
|
{
|
|
2999
|
-
ref:
|
|
3000
|
-
className: `nice-expense-split nice-expense-split--${
|
|
3001
|
-
style:
|
|
3013
|
+
ref: r,
|
|
3014
|
+
className: `nice-expense-split nice-expense-split--${N} ${$ ?? ""}`,
|
|
3015
|
+
style: c,
|
|
3002
3016
|
children: [
|
|
3003
3017
|
/* @__PURE__ */ e(
|
|
3004
3018
|
Bn,
|
|
3005
3019
|
{
|
|
3006
|
-
size:
|
|
3007
|
-
value:
|
|
3008
|
-
onChange: (
|
|
3020
|
+
size: N,
|
|
3021
|
+
value: P,
|
|
3022
|
+
onChange: (S) => U(S),
|
|
3009
3023
|
options: [
|
|
3010
3024
|
{ value: "expenses", label: "Expenses" },
|
|
3011
3025
|
{ value: "balances", label: "Balances" },
|
|
@@ -3013,142 +3027,142 @@ const Ui = ee(
|
|
|
3013
3027
|
]
|
|
3014
3028
|
}
|
|
3015
3029
|
),
|
|
3016
|
-
|
|
3017
|
-
const
|
|
3030
|
+
P === "expenses" && /* @__PURE__ */ e("ul", { className: "nice-expense-split__items", children: M.map((S) => {
|
|
3031
|
+
const y = D.get(S.id);
|
|
3018
3032
|
return /* @__PURE__ */ i(
|
|
3019
3033
|
"li",
|
|
3020
3034
|
{
|
|
3021
|
-
className: `nice-expense-split__item${
|
|
3035
|
+
className: `nice-expense-split__item${y ? " nice-expense-split__item--excluded" : ""}`,
|
|
3022
3036
|
children: [
|
|
3023
3037
|
/* @__PURE__ */ i(
|
|
3024
3038
|
"button",
|
|
3025
3039
|
{
|
|
3026
3040
|
type: "button",
|
|
3027
3041
|
className: "nice-expense-split__item-main",
|
|
3028
|
-
onClick: () => p == null ? void 0 : p(
|
|
3042
|
+
onClick: () => p == null ? void 0 : p(S),
|
|
3029
3043
|
disabled: !p,
|
|
3030
3044
|
children: [
|
|
3031
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-label", children:
|
|
3045
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-label", children: S.label }),
|
|
3032
3046
|
/* @__PURE__ */ i("span", { className: "nice-expense-split__item-payer", children: [
|
|
3033
|
-
|
|
3047
|
+
S.paidByName ?? S.paidById ?? "nobody",
|
|
3034
3048
|
" paid"
|
|
3035
3049
|
] })
|
|
3036
3050
|
]
|
|
3037
3051
|
}
|
|
3038
3052
|
),
|
|
3039
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-amount", children: se(
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
u && !
|
|
3043
|
-
|
|
3053
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__item-amount", children: se(S.amount, S.currency, g) }),
|
|
3054
|
+
S.isPaid && /* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: "success", children: "paid" }),
|
|
3055
|
+
y && /* @__PURE__ */ e(te, { size: "xs", subtle: !0, variant: "warning", children: y === "no-payer" ? "no payer" : "unknown payer" }),
|
|
3056
|
+
u && !C && /* @__PURE__ */ e(
|
|
3057
|
+
F,
|
|
3044
3058
|
{
|
|
3045
3059
|
size: "sm",
|
|
3046
3060
|
variant: "ghost",
|
|
3047
|
-
ariaLabel: `Delete ${
|
|
3048
|
-
disabled:
|
|
3049
|
-
onClick: () => u(
|
|
3050
|
-
children: /* @__PURE__ */ e(
|
|
3061
|
+
ariaLabel: `Delete ${S.label}`,
|
|
3062
|
+
disabled: _,
|
|
3063
|
+
onClick: () => u(S.id),
|
|
3064
|
+
children: /* @__PURE__ */ e(Ee, { size: 14 })
|
|
3051
3065
|
}
|
|
3052
3066
|
)
|
|
3053
3067
|
]
|
|
3054
3068
|
},
|
|
3055
|
-
|
|
3069
|
+
S.id
|
|
3056
3070
|
);
|
|
3057
3071
|
}) }),
|
|
3058
|
-
|
|
3072
|
+
P === "balances" && b.groups.map((S) => /* @__PURE__ */ i("section", { className: "nice-expense-split__group", children: [
|
|
3059
3073
|
/* @__PURE__ */ i("h4", { className: "nice-expense-split__group-title", children: [
|
|
3060
|
-
|
|
3074
|
+
S.currency,
|
|
3061
3075
|
/* @__PURE__ */ i("span", { className: "nice-expense-split__group-total", children: [
|
|
3062
|
-
se(
|
|
3076
|
+
se(S.total, S.currency, g),
|
|
3063
3077
|
" total"
|
|
3064
3078
|
] })
|
|
3065
3079
|
] }),
|
|
3066
|
-
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children:
|
|
3080
|
+
/* @__PURE__ */ e("ul", { className: "nice-participant-list__rows", children: S.balances.map((y) => /* @__PURE__ */ e(
|
|
3067
3081
|
Ze,
|
|
3068
3082
|
{
|
|
3069
3083
|
participant: {
|
|
3070
|
-
id:
|
|
3071
|
-
name:
|
|
3072
|
-
avatarUrl: B.get(
|
|
3084
|
+
id: y.participantId,
|
|
3085
|
+
name: y.participantName,
|
|
3086
|
+
avatarUrl: B.get(y.participantId)
|
|
3073
3087
|
},
|
|
3074
3088
|
showRole: !1,
|
|
3075
3089
|
showStatus: !1,
|
|
3076
|
-
size:
|
|
3090
|
+
size: N,
|
|
3077
3091
|
children: /* @__PURE__ */ i(
|
|
3078
3092
|
"span",
|
|
3079
3093
|
{
|
|
3080
|
-
className: `nice-expense-split__balance nice-expense-split__balance--${
|
|
3094
|
+
className: `nice-expense-split__balance nice-expense-split__balance--${y.amount > 0 ? "owed" : y.amount < 0 ? "owes" : "settled"}`,
|
|
3081
3095
|
children: [
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3096
|
+
y.amount === 0 ? "settled up" : se(Math.abs(y.amount), y.currency, g),
|
|
3097
|
+
y.amount > 0 && /* @__PURE__ */ e("em", { children: " is owed" }),
|
|
3098
|
+
y.amount < 0 && /* @__PURE__ */ e("em", { children: " owes" })
|
|
3085
3099
|
]
|
|
3086
3100
|
}
|
|
3087
3101
|
)
|
|
3088
3102
|
},
|
|
3089
|
-
|
|
3103
|
+
y.participantId
|
|
3090
3104
|
)) })
|
|
3091
|
-
] },
|
|
3092
|
-
|
|
3105
|
+
] }, S.currency)),
|
|
3106
|
+
P === "settlement" && (b.groups.every((S) => S.transfers.length === 0) ? /* @__PURE__ */ e(
|
|
3093
3107
|
ye,
|
|
3094
3108
|
{
|
|
3095
3109
|
icon: /* @__PURE__ */ e(xt, { size: 28 }),
|
|
3096
3110
|
title: "All settled up",
|
|
3097
3111
|
description: "Nobody owes anybody anything."
|
|
3098
3112
|
}
|
|
3099
|
-
) :
|
|
3113
|
+
) : b.groups.filter((S) => S.transfers.length > 0).map((S) => /* @__PURE__ */ i("section", { className: "nice-expense-split__group", children: [
|
|
3100
3114
|
/* @__PURE__ */ i("h4", { className: "nice-expense-split__group-title", children: [
|
|
3101
|
-
|
|
3115
|
+
S.currency,
|
|
3102
3116
|
/* @__PURE__ */ i("span", { className: "nice-expense-split__group-total", children: [
|
|
3103
|
-
|
|
3117
|
+
S.transfers.length,
|
|
3104
3118
|
" transfer",
|
|
3105
|
-
|
|
3119
|
+
S.transfers.length === 1 ? "" : "s"
|
|
3106
3120
|
] })
|
|
3107
3121
|
] }),
|
|
3108
|
-
/* @__PURE__ */ e("ul", { className: "nice-expense-split__transfers", children:
|
|
3122
|
+
/* @__PURE__ */ e("ul", { className: "nice-expense-split__transfers", children: S.transfers.map((y) => /* @__PURE__ */ i(
|
|
3109
3123
|
"li",
|
|
3110
3124
|
{
|
|
3111
3125
|
className: "nice-expense-split__transfer",
|
|
3112
3126
|
children: [
|
|
3113
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-from", children:
|
|
3127
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-from", children: y.fromName }),
|
|
3114
3128
|
/* @__PURE__ */ e(kt, { size: 15 }),
|
|
3115
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-to", children:
|
|
3116
|
-
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-amount", children: se(
|
|
3117
|
-
a && !
|
|
3118
|
-
|
|
3129
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-to", children: y.toName }),
|
|
3130
|
+
/* @__PURE__ */ e("span", { className: "nice-expense-split__transfer-amount", children: se(y.amount, y.currency, g) }),
|
|
3131
|
+
a && !C && /* @__PURE__ */ e(
|
|
3132
|
+
F,
|
|
3119
3133
|
{
|
|
3120
3134
|
size: "sm",
|
|
3121
3135
|
variant: "outline",
|
|
3122
|
-
disabled:
|
|
3123
|
-
onClick: () => a(
|
|
3136
|
+
disabled: w,
|
|
3137
|
+
onClick: () => a(y),
|
|
3124
3138
|
children: "Mark paid"
|
|
3125
3139
|
}
|
|
3126
3140
|
)
|
|
3127
3141
|
]
|
|
3128
3142
|
},
|
|
3129
|
-
`${
|
|
3143
|
+
`${y.fromId}-${y.toId}-${y.amount}`
|
|
3130
3144
|
)) })
|
|
3131
|
-
] },
|
|
3145
|
+
] }, S.currency)))
|
|
3132
3146
|
]
|
|
3133
3147
|
}
|
|
3134
3148
|
);
|
|
3135
3149
|
}
|
|
3136
|
-
),
|
|
3150
|
+
), Ti = {
|
|
3137
3151
|
upcoming: Tn,
|
|
3138
3152
|
active: We,
|
|
3139
3153
|
voting: tn,
|
|
3140
|
-
scored:
|
|
3154
|
+
scored: It,
|
|
3141
3155
|
completed: qe,
|
|
3142
3156
|
skipped: nn
|
|
3143
|
-
},
|
|
3157
|
+
}, Mi = {
|
|
3144
3158
|
upcoming: "#9ca3af",
|
|
3145
3159
|
active: "#22c55e",
|
|
3146
3160
|
voting: "#eab308",
|
|
3147
3161
|
scored: "#3b82f6",
|
|
3148
3162
|
completed: "#6b7280",
|
|
3149
3163
|
skipped: "#d1d5db"
|
|
3150
|
-
},
|
|
3151
|
-
function(t,
|
|
3164
|
+
}, Hi = ee(
|
|
3165
|
+
function(t, r) {
|
|
3152
3166
|
const {
|
|
3153
3167
|
rounds: n,
|
|
3154
3168
|
activeRoundId: l,
|
|
@@ -3159,8 +3173,8 @@ const Ui = ee(
|
|
|
3159
3173
|
editable: a = !1,
|
|
3160
3174
|
className: u,
|
|
3161
3175
|
style: p
|
|
3162
|
-
} = t,
|
|
3163
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
3176
|
+
} = t, k = [...n].sort((f, g) => f.order - g.order);
|
|
3177
|
+
return /* @__PURE__ */ i("div", { ref: r, className: `nice-round-list ${u ?? ""}`, style: p, children: [
|
|
3164
3178
|
/* @__PURE__ */ i("div", { className: "nice-round-list__header", children: [
|
|
3165
3179
|
/* @__PURE__ */ i("h3", { children: [
|
|
3166
3180
|
"Rounds (",
|
|
@@ -3169,7 +3183,7 @@ const Ui = ee(
|
|
|
3169
3183
|
] }),
|
|
3170
3184
|
a && h && /* @__PURE__ */ e("button", { onClick: h, children: "+ Add Round" })
|
|
3171
3185
|
] }),
|
|
3172
|
-
|
|
3186
|
+
k.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: "No rounds yet." }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: k.map((f) => {
|
|
3173
3187
|
const g = f.id === l;
|
|
3174
3188
|
return /* @__PURE__ */ i(
|
|
3175
3189
|
"div",
|
|
@@ -3183,7 +3197,7 @@ const Ui = ee(
|
|
|
3183
3197
|
"#",
|
|
3184
3198
|
f.order
|
|
3185
3199
|
] }),
|
|
3186
|
-
/* @__PURE__ */ e("span", { className: "nice-round-list__icon", title: f.status, children: Me.createElement(
|
|
3200
|
+
/* @__PURE__ */ e("span", { className: "nice-round-list__icon", title: f.status, children: Me.createElement(Ti[f.status], { size: 16 }) }),
|
|
3187
3201
|
/* @__PURE__ */ i("div", { className: "nice-round-list__info", children: [
|
|
3188
3202
|
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children: f.name }),
|
|
3189
3203
|
f.description && /* @__PURE__ */ e("small", { children: f.description }),
|
|
@@ -3193,7 +3207,7 @@ const Ui = ee(
|
|
|
3193
3207
|
"span",
|
|
3194
3208
|
{
|
|
3195
3209
|
className: "nice-round-list__status",
|
|
3196
|
-
style: { color:
|
|
3210
|
+
style: { color: Mi[f.status] },
|
|
3197
3211
|
children: f.status
|
|
3198
3212
|
}
|
|
3199
3213
|
),
|
|
@@ -3206,7 +3220,7 @@ const Ui = ee(
|
|
|
3206
3220
|
" ",
|
|
3207
3221
|
f.winnerIds.length
|
|
3208
3222
|
] }),
|
|
3209
|
-
a && /* @__PURE__ */ i("div", { className: "nice-round-list__actions", onClick: (
|
|
3223
|
+
a && /* @__PURE__ */ i("div", { className: "nice-round-list__actions", onClick: (_) => _.stopPropagation(), children: [
|
|
3210
3224
|
f.status === "upcoming" && d && /* @__PURE__ */ e("button", { onClick: () => d(f.id), children: "Start" }),
|
|
3211
3225
|
(f.status === "active" || f.status === "voting") && m && /* @__PURE__ */ e("button", { onClick: () => m(f.id), children: "End" })
|
|
3212
3226
|
] })
|
|
@@ -3217,12 +3231,12 @@ const Ui = ee(
|
|
|
3217
3231
|
}) })
|
|
3218
3232
|
] });
|
|
3219
3233
|
}
|
|
3220
|
-
),
|
|
3234
|
+
), Ei = [
|
|
3221
3235
|
"var(--nice-lb-gold, #facc15)",
|
|
3222
3236
|
"var(--nice-lb-silver, #cbd5e1)",
|
|
3223
3237
|
"var(--nice-lb-bronze, #d97706)"
|
|
3224
|
-
],
|
|
3225
|
-
function(t,
|
|
3238
|
+
], Qi = ee(
|
|
3239
|
+
function(t, r) {
|
|
3226
3240
|
const {
|
|
3227
3241
|
round: n,
|
|
3228
3242
|
timerRunning: l = !1,
|
|
@@ -3233,23 +3247,23 @@ const Ui = ee(
|
|
|
3233
3247
|
onSkip: a,
|
|
3234
3248
|
editable: u = !1,
|
|
3235
3249
|
footerActions: p,
|
|
3236
|
-
className:
|
|
3250
|
+
className: k,
|
|
3237
3251
|
style: f
|
|
3238
|
-
} = t, [g,
|
|
3239
|
-
(
|
|
3240
|
-
const
|
|
3241
|
-
isNaN(
|
|
3252
|
+
} = t, [g, _] = L({}), C = G(
|
|
3253
|
+
(c) => {
|
|
3254
|
+
const x = parseFloat(g[c] ?? "");
|
|
3255
|
+
isNaN(x) || !d || (d(c, x), _((v) => ({ ...v, [c]: "" })));
|
|
3242
3256
|
},
|
|
3243
3257
|
[g, d]
|
|
3244
|
-
),
|
|
3245
|
-
const
|
|
3246
|
-
return `${
|
|
3247
|
-
}, $ = n.scores ? [...n.scores].sort((
|
|
3258
|
+
), N = (c) => {
|
|
3259
|
+
const x = Math.floor(c / 60), v = c % 60;
|
|
3260
|
+
return `${x}:${v.toString().padStart(2, "0")}`;
|
|
3261
|
+
}, $ = n.scores ? [...n.scores].sort((c, x) => x.score - c.score) : [];
|
|
3248
3262
|
return /* @__PURE__ */ i(
|
|
3249
3263
|
"div",
|
|
3250
3264
|
{
|
|
3251
|
-
ref:
|
|
3252
|
-
className: `nice-round-card nice-round-card--${n.status} ${
|
|
3265
|
+
ref: r,
|
|
3266
|
+
className: `nice-round-card nice-round-card--${n.status} ${k ?? ""}`,
|
|
3253
3267
|
style: f,
|
|
3254
3268
|
children: [
|
|
3255
3269
|
/* @__PURE__ */ i("div", { className: "nice-round-card__header", children: [
|
|
@@ -3268,7 +3282,7 @@ const Ui = ee(
|
|
|
3268
3282
|
children: [
|
|
3269
3283
|
/* @__PURE__ */ e(Tn, { size: 14 }),
|
|
3270
3284
|
" ",
|
|
3271
|
-
o != null ?
|
|
3285
|
+
o != null ? N(o) : "—"
|
|
3272
3286
|
]
|
|
3273
3287
|
}
|
|
3274
3288
|
),
|
|
@@ -3280,50 +3294,50 @@ const Ui = ee(
|
|
|
3280
3294
|
/* @__PURE__ */ e("th", { children: "Participant" }),
|
|
3281
3295
|
/* @__PURE__ */ e("th", { children: "Score" })
|
|
3282
3296
|
] }) }),
|
|
3283
|
-
/* @__PURE__ */ e("tbody", { children: $.map((
|
|
3297
|
+
/* @__PURE__ */ e("tbody", { children: $.map((c, x) => /* @__PURE__ */ i(
|
|
3284
3298
|
"tr",
|
|
3285
3299
|
{
|
|
3286
|
-
className:
|
|
3300
|
+
className: x < 3 ? `nice-round-card__top-${x + 1}` : "",
|
|
3287
3301
|
children: [
|
|
3288
3302
|
/* @__PURE__ */ i("td", { children: [
|
|
3289
|
-
|
|
3290
|
-
|
|
3303
|
+
c.rank ?? x + 1,
|
|
3304
|
+
x < 3 && /* @__PURE__ */ i(Fe, { children: [
|
|
3291
3305
|
" ",
|
|
3292
3306
|
/* @__PURE__ */ e(
|
|
3293
3307
|
He,
|
|
3294
3308
|
{
|
|
3295
3309
|
size: 14,
|
|
3296
|
-
primaryColor:
|
|
3297
|
-
"aria-label": `Place ${
|
|
3310
|
+
primaryColor: Ei[x],
|
|
3311
|
+
"aria-label": `Place ${x + 1}`
|
|
3298
3312
|
}
|
|
3299
3313
|
)
|
|
3300
3314
|
] })
|
|
3301
3315
|
] }),
|
|
3302
|
-
/* @__PURE__ */ e("td", { children:
|
|
3303
|
-
/* @__PURE__ */ e("td", { children:
|
|
3316
|
+
/* @__PURE__ */ e("td", { children: c.participantName }),
|
|
3317
|
+
/* @__PURE__ */ e("td", { children: c.score })
|
|
3304
3318
|
]
|
|
3305
3319
|
},
|
|
3306
|
-
|
|
3320
|
+
c.participantId
|
|
3307
3321
|
)) })
|
|
3308
3322
|
] })
|
|
3309
3323
|
] }),
|
|
3310
3324
|
d && (n.status === "active" || n.status === "voting") && $.length > 0 && /* @__PURE__ */ i("div", { className: "nice-round-card__score-input", children: [
|
|
3311
3325
|
/* @__PURE__ */ e("h4", { children: "Submit Scores" }),
|
|
3312
|
-
$.map((
|
|
3313
|
-
/* @__PURE__ */ e("span", { children:
|
|
3326
|
+
$.map((c) => /* @__PURE__ */ i("div", { className: "nice-round-card__score-row", children: [
|
|
3327
|
+
/* @__PURE__ */ e("span", { children: c.participantName }),
|
|
3314
3328
|
/* @__PURE__ */ e(
|
|
3315
3329
|
"input",
|
|
3316
3330
|
{
|
|
3317
3331
|
type: "number",
|
|
3318
|
-
value: g[
|
|
3319
|
-
onChange: (
|
|
3332
|
+
value: g[c.participantId] ?? "",
|
|
3333
|
+
onChange: (x) => _((v) => ({ ...v, [c.participantId]: x.target.value })),
|
|
3320
3334
|
min: 0,
|
|
3321
3335
|
step: 1,
|
|
3322
3336
|
placeholder: "Score"
|
|
3323
3337
|
}
|
|
3324
3338
|
),
|
|
3325
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
3326
|
-
] },
|
|
3339
|
+
/* @__PURE__ */ e("button", { onClick: () => C(c.participantId), children: "Submit" })
|
|
3340
|
+
] }, c.participantId))
|
|
3327
3341
|
] }),
|
|
3328
3342
|
/* @__PURE__ */ i("div", { className: "nice-round-card__footer", children: [
|
|
3329
3343
|
u && /* @__PURE__ */ i("div", { className: "nice-round-card__actions", children: [
|
|
@@ -3332,7 +3346,7 @@ const Ui = ee(
|
|
|
3332
3346
|
" Start Round"
|
|
3333
3347
|
] }),
|
|
3334
3348
|
(n.status === "active" || n.status === "voting") && h && /* @__PURE__ */ i("button", { onClick: h, children: [
|
|
3335
|
-
/* @__PURE__ */ e(
|
|
3349
|
+
/* @__PURE__ */ e(Ct, { size: 14 }),
|
|
3336
3350
|
" End Round"
|
|
3337
3351
|
] }),
|
|
3338
3352
|
n.status === "upcoming" && a && /* @__PURE__ */ i("button", { onClick: a, children: [
|
|
@@ -3351,8 +3365,8 @@ const Ui = ee(
|
|
|
3351
3365
|
}
|
|
3352
3366
|
);
|
|
3353
3367
|
}
|
|
3354
|
-
),
|
|
3355
|
-
function(t,
|
|
3368
|
+
), Zi = ee(
|
|
3369
|
+
function(t, r) {
|
|
3356
3370
|
const {
|
|
3357
3371
|
songs: n,
|
|
3358
3372
|
onAdd: l,
|
|
@@ -3363,91 +3377,91 @@ const Ui = ee(
|
|
|
3363
3377
|
readOnly: a = !1,
|
|
3364
3378
|
className: u,
|
|
3365
3379
|
style: p
|
|
3366
|
-
} = t, [
|
|
3367
|
-
if (!
|
|
3380
|
+
} = t, [k, f] = L(""), g = V(() => {
|
|
3381
|
+
if (!k.trim())
|
|
3368
3382
|
return n;
|
|
3369
|
-
const
|
|
3383
|
+
const c = k.toLowerCase();
|
|
3370
3384
|
return n.filter(
|
|
3371
|
-
(
|
|
3385
|
+
(x) => x.title.toLowerCase().includes(c) || x.artist.toLowerCase().includes(c)
|
|
3372
3386
|
);
|
|
3373
|
-
}, [n,
|
|
3374
|
-
f(
|
|
3375
|
-
}, $ = (
|
|
3376
|
-
if (!
|
|
3387
|
+
}, [n, k]), _ = V(() => n.filter((c) => c.isQueued), [n]), C = n.find((c) => c.isPlaying), N = (c) => {
|
|
3388
|
+
f(c), m == null || m(c);
|
|
3389
|
+
}, $ = (c) => {
|
|
3390
|
+
if (!c)
|
|
3377
3391
|
return "";
|
|
3378
|
-
const
|
|
3379
|
-
return `${
|
|
3392
|
+
const x = Math.floor(c / 60), v = c % 60;
|
|
3393
|
+
return `${x}:${v.toString().padStart(2, "0")}`;
|
|
3380
3394
|
};
|
|
3381
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
3382
|
-
|
|
3395
|
+
return /* @__PURE__ */ i("div", { ref: r, className: `nice-song-picker ${u ?? ""}`, style: p, children: [
|
|
3396
|
+
C && /* @__PURE__ */ i("div", { className: "nice-song-picker__now-playing", children: [
|
|
3383
3397
|
/* @__PURE__ */ i("span", { className: "nice-song-picker__np-label", children: [
|
|
3384
3398
|
/* @__PURE__ */ e(ke, { size: 14 }),
|
|
3385
3399
|
" Now Playing"
|
|
3386
3400
|
] }),
|
|
3387
|
-
|
|
3388
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3389
|
-
/* @__PURE__ */ e("span", { children:
|
|
3401
|
+
C.albumArt && /* @__PURE__ */ e("img", { src: C.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
3402
|
+
/* @__PURE__ */ e("strong", { children: C.title }),
|
|
3403
|
+
/* @__PURE__ */ e("span", { children: C.artist })
|
|
3390
3404
|
] }),
|
|
3391
3405
|
/* @__PURE__ */ e(
|
|
3392
3406
|
"input",
|
|
3393
3407
|
{
|
|
3394
3408
|
type: "text",
|
|
3395
|
-
value:
|
|
3396
|
-
onChange: (
|
|
3409
|
+
value: k,
|
|
3410
|
+
onChange: (c) => N(c.target.value),
|
|
3397
3411
|
placeholder: "Search songs…",
|
|
3398
3412
|
className: "nice-song-picker__search"
|
|
3399
3413
|
}
|
|
3400
3414
|
),
|
|
3401
|
-
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: g.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: "No songs found." }) : g.map((
|
|
3415
|
+
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: g.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: "No songs found." }) : g.map((c) => /* @__PURE__ */ i(
|
|
3402
3416
|
"div",
|
|
3403
3417
|
{
|
|
3404
|
-
className: `nice-song-picker__item ${
|
|
3418
|
+
className: `nice-song-picker__item ${c.isPlaying ? "nice-song-picker__item--playing" : ""}`,
|
|
3405
3419
|
children: [
|
|
3406
|
-
|
|
3420
|
+
c.albumArt && /* @__PURE__ */ e("img", { src: c.albumArt, alt: "", className: "nice-song-picker__thumb" }),
|
|
3407
3421
|
/* @__PURE__ */ i("div", { className: "nice-song-picker__info", children: [
|
|
3408
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3409
|
-
/* @__PURE__ */ e("span", { children:
|
|
3410
|
-
|
|
3411
|
-
|
|
3422
|
+
/* @__PURE__ */ e("strong", { children: c.title }),
|
|
3423
|
+
/* @__PURE__ */ e("span", { children: c.artist }),
|
|
3424
|
+
c.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children: $(c.duration) }),
|
|
3425
|
+
c.addedByName && /* @__PURE__ */ i("small", { children: [
|
|
3412
3426
|
"Added by ",
|
|
3413
|
-
|
|
3427
|
+
c.addedByName
|
|
3414
3428
|
] })
|
|
3415
3429
|
] }),
|
|
3416
3430
|
!a && /* @__PURE__ */ i("div", { className: "nice-song-picker__actions", children: [
|
|
3417
|
-
d && /* @__PURE__ */ i("button", { onClick: () => d(
|
|
3431
|
+
d && /* @__PURE__ */ i("button", { onClick: () => d(c.id), "aria-label": `Vote for ${c.title}`, children: [
|
|
3418
3432
|
/* @__PURE__ */ e(tn, { size: 14 }),
|
|
3419
3433
|
" ",
|
|
3420
|
-
|
|
3434
|
+
c.votes ?? 0
|
|
3421
3435
|
] }),
|
|
3422
|
-
l && !
|
|
3423
|
-
o &&
|
|
3436
|
+
l && !c.isQueued && /* @__PURE__ */ e("button", { onClick: () => l(c.id), children: "+ Queue" }),
|
|
3437
|
+
o && c.isQueued && /* @__PURE__ */ e("button", { onClick: () => o(c.id), children: "Remove" })
|
|
3424
3438
|
] })
|
|
3425
3439
|
]
|
|
3426
3440
|
},
|
|
3427
|
-
|
|
3441
|
+
c.id
|
|
3428
3442
|
)) }),
|
|
3429
|
-
h &&
|
|
3443
|
+
h && _.length > 0 && /* @__PURE__ */ i("div", { className: "nice-song-picker__queue", children: [
|
|
3430
3444
|
/* @__PURE__ */ i("h4", { children: [
|
|
3431
3445
|
"Queue (",
|
|
3432
|
-
|
|
3446
|
+
_.length,
|
|
3433
3447
|
")"
|
|
3434
3448
|
] }),
|
|
3435
|
-
|
|
3449
|
+
_.map((c, x) => /* @__PURE__ */ i("div", { className: "nice-song-picker__queue-item", children: [
|
|
3436
3450
|
/* @__PURE__ */ i("span", { className: "nice-song-picker__queue-pos", children: [
|
|
3437
|
-
|
|
3451
|
+
x + 1,
|
|
3438
3452
|
"."
|
|
3439
3453
|
] }),
|
|
3440
3454
|
/* @__PURE__ */ i("span", { children: [
|
|
3441
|
-
|
|
3455
|
+
c.title,
|
|
3442
3456
|
" — ",
|
|
3443
|
-
|
|
3457
|
+
c.artist
|
|
3444
3458
|
] })
|
|
3445
|
-
] },
|
|
3459
|
+
] }, c.id))
|
|
3446
3460
|
] })
|
|
3447
3461
|
] });
|
|
3448
3462
|
}
|
|
3449
|
-
),
|
|
3450
|
-
function(t,
|
|
3463
|
+
), Ji = ee(
|
|
3464
|
+
function(t, r) {
|
|
3451
3465
|
const {
|
|
3452
3466
|
songs: n,
|
|
3453
3467
|
queue: l = [],
|
|
@@ -3458,16 +3472,16 @@ const Ui = ee(
|
|
|
3458
3472
|
readOnly: a = !1,
|
|
3459
3473
|
className: u,
|
|
3460
3474
|
style: p
|
|
3461
|
-
} = t, [
|
|
3475
|
+
} = t, [k, f] = L(""), [g, _] = L(""), C = n.find((v) => v.id === h), N = V(() => {
|
|
3462
3476
|
let v = n;
|
|
3463
|
-
if (
|
|
3464
|
-
const
|
|
3477
|
+
if (k.trim()) {
|
|
3478
|
+
const P = k.toLowerCase();
|
|
3465
3479
|
v = v.filter(
|
|
3466
|
-
(
|
|
3480
|
+
(w) => w.title.toLowerCase().includes(P) || w.artist.toLowerCase().includes(P)
|
|
3467
3481
|
);
|
|
3468
3482
|
}
|
|
3469
|
-
return g && (v = v.filter((
|
|
3470
|
-
}, [n,
|
|
3483
|
+
return g && (v = v.filter((P) => P.difficulty === g)), v;
|
|
3484
|
+
}, [n, k, g]), $ = V(() => new Set(l.map((v) => v.id)), [l]), c = ["easy", "medium", "hard", "expert"], x = (v) => {
|
|
3471
3485
|
switch (v) {
|
|
3472
3486
|
case "easy":
|
|
3473
3487
|
return "#4caf50";
|
|
@@ -3481,8 +3495,8 @@ const Ui = ee(
|
|
|
3481
3495
|
return "#999";
|
|
3482
3496
|
}
|
|
3483
3497
|
};
|
|
3484
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
3485
|
-
|
|
3498
|
+
return /* @__PURE__ */ i("div", { ref: r, className: `nice-karaoke-picker ${u ?? ""}`, style: p, children: [
|
|
3499
|
+
C && /* @__PURE__ */ i(
|
|
3486
3500
|
"div",
|
|
3487
3501
|
{
|
|
3488
3502
|
className: "nice-karaoke-picker__now-singing",
|
|
@@ -3500,12 +3514,12 @@ const Ui = ee(
|
|
|
3500
3514
|
" Now Singing"
|
|
3501
3515
|
] }),
|
|
3502
3516
|
/* @__PURE__ */ i("div", { children: [
|
|
3503
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3517
|
+
/* @__PURE__ */ e("strong", { children: C.title }),
|
|
3504
3518
|
" — ",
|
|
3505
|
-
|
|
3506
|
-
|
|
3519
|
+
C.artist,
|
|
3520
|
+
C.performerName && /* @__PURE__ */ i("span", { children: [
|
|
3507
3521
|
" (by ",
|
|
3508
|
-
|
|
3522
|
+
C.performerName,
|
|
3509
3523
|
")"
|
|
3510
3524
|
] })
|
|
3511
3525
|
] }),
|
|
@@ -3526,20 +3540,20 @@ const Ui = ee(
|
|
|
3526
3540
|
"input",
|
|
3527
3541
|
{
|
|
3528
3542
|
type: "text",
|
|
3529
|
-
value:
|
|
3543
|
+
value: k,
|
|
3530
3544
|
onChange: (v) => f(v.target.value),
|
|
3531
3545
|
placeholder: "Search songs or artists…",
|
|
3532
3546
|
style: { flex: 1 }
|
|
3533
3547
|
}
|
|
3534
3548
|
),
|
|
3535
|
-
/* @__PURE__ */ i("select", { value: g, onChange: (v) =>
|
|
3549
|
+
/* @__PURE__ */ i("select", { value: g, onChange: (v) => _(v.target.value), children: [
|
|
3536
3550
|
/* @__PURE__ */ e("option", { value: "", children: "All Difficulties" }),
|
|
3537
|
-
|
|
3551
|
+
c.map((v) => /* @__PURE__ */ e("option", { value: v, children: v }, v))
|
|
3538
3552
|
] })
|
|
3539
3553
|
]
|
|
3540
3554
|
}
|
|
3541
3555
|
),
|
|
3542
|
-
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children:
|
|
3556
|
+
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: N.length === 0 ? /* @__PURE__ */ e("p", { children: "No songs match your search." }) : N.map((v) => /* @__PURE__ */ i(
|
|
3543
3557
|
"div",
|
|
3544
3558
|
{
|
|
3545
3559
|
className: "nice-karaoke-picker__song",
|
|
@@ -3561,7 +3575,7 @@ const Ui = ee(
|
|
|
3561
3575
|
style: {
|
|
3562
3576
|
marginLeft: 8,
|
|
3563
3577
|
fontSize: 12,
|
|
3564
|
-
color:
|
|
3578
|
+
color: x(v.difficulty),
|
|
3565
3579
|
fontWeight: 600
|
|
3566
3580
|
},
|
|
3567
3581
|
children: [
|
|
@@ -3613,14 +3627,14 @@ const Ui = ee(
|
|
|
3613
3627
|
l.length,
|
|
3614
3628
|
")"
|
|
3615
3629
|
] }),
|
|
3616
|
-
l.map((v,
|
|
3630
|
+
l.map((v, P) => /* @__PURE__ */ i(
|
|
3617
3631
|
"div",
|
|
3618
3632
|
{
|
|
3619
3633
|
style: { display: "flex", justifyContent: "space-between", padding: "4px 0" },
|
|
3620
3634
|
children: [
|
|
3621
3635
|
/* @__PURE__ */ i("span", { children: [
|
|
3622
3636
|
/* @__PURE__ */ i("strong", { children: [
|
|
3623
|
-
|
|
3637
|
+
P + 1,
|
|
3624
3638
|
"."
|
|
3625
3639
|
] }),
|
|
3626
3640
|
" ",
|
|
@@ -3649,15 +3663,15 @@ const Ui = ee(
|
|
|
3649
3663
|
] })
|
|
3650
3664
|
] });
|
|
3651
3665
|
}
|
|
3652
|
-
),
|
|
3653
|
-
game:
|
|
3666
|
+
), In = {
|
|
3667
|
+
game: Dn,
|
|
3654
3668
|
music: ke,
|
|
3655
3669
|
dance: ke,
|
|
3656
3670
|
quiz: en,
|
|
3657
3671
|
karaoke: Ye,
|
|
3658
|
-
photo:
|
|
3672
|
+
photo: En,
|
|
3659
3673
|
custom: Mn
|
|
3660
|
-
},
|
|
3674
|
+
}, Di = {
|
|
3661
3675
|
game: "Games",
|
|
3662
3676
|
music: "Music",
|
|
3663
3677
|
dance: "Dance",
|
|
@@ -3665,8 +3679,8 @@ const Ui = ee(
|
|
|
3665
3679
|
karaoke: "Karaoke",
|
|
3666
3680
|
photo: "Photo",
|
|
3667
3681
|
custom: "Custom"
|
|
3668
|
-
},
|
|
3669
|
-
function(t,
|
|
3682
|
+
}, ea = ee(
|
|
3683
|
+
function(t, r) {
|
|
3670
3684
|
const {
|
|
3671
3685
|
attractions: n,
|
|
3672
3686
|
onSelect: l,
|
|
@@ -3677,31 +3691,31 @@ const Ui = ee(
|
|
|
3677
3691
|
showVotes: a = !0,
|
|
3678
3692
|
readOnly: u = !1,
|
|
3679
3693
|
layout: p = "grid",
|
|
3680
|
-
className:
|
|
3694
|
+
className: k,
|
|
3681
3695
|
style: f
|
|
3682
|
-
} = t, [g,
|
|
3683
|
-
const
|
|
3684
|
-
return Array.from(
|
|
3685
|
-
}, [n]),
|
|
3686
|
-
let
|
|
3687
|
-
if (g && (
|
|
3688
|
-
const
|
|
3689
|
-
|
|
3690
|
-
(
|
|
3691
|
-
var
|
|
3692
|
-
return
|
|
3696
|
+
} = t, [g, _] = L(""), [C, N] = L(""), $ = V(() => new Set(m), [m]), c = V(() => {
|
|
3697
|
+
const w = new Set(n.map((E) => E.category));
|
|
3698
|
+
return Array.from(w);
|
|
3699
|
+
}, [n]), x = V(() => {
|
|
3700
|
+
let w = n;
|
|
3701
|
+
if (g && (w = w.filter((E) => E.category === g)), C.trim()) {
|
|
3702
|
+
const E = C.toLowerCase();
|
|
3703
|
+
w = w.filter(
|
|
3704
|
+
(b) => {
|
|
3705
|
+
var M;
|
|
3706
|
+
return b.name.toLowerCase().includes(E) || ((M = b.description) == null ? void 0 : M.toLowerCase().includes(E));
|
|
3693
3707
|
}
|
|
3694
3708
|
);
|
|
3695
3709
|
}
|
|
3696
|
-
return
|
|
3697
|
-
}, [n, g,
|
|
3698
|
-
u || ($.has(
|
|
3710
|
+
return w;
|
|
3711
|
+
}, [n, g, C]), v = !h || $.size < h, P = (w) => {
|
|
3712
|
+
u || ($.has(w) ? o == null || o(w) : v && (l == null || l(w)));
|
|
3699
3713
|
};
|
|
3700
3714
|
return /* @__PURE__ */ i(
|
|
3701
3715
|
"div",
|
|
3702
3716
|
{
|
|
3703
|
-
ref:
|
|
3704
|
-
className: `nice-attraction-picker ${
|
|
3717
|
+
ref: r,
|
|
3718
|
+
className: `nice-attraction-picker ${k ?? ""}`,
|
|
3705
3719
|
style: { color: "var(--nice-text-primary)", ...f },
|
|
3706
3720
|
children: [
|
|
3707
3721
|
/* @__PURE__ */ i(
|
|
@@ -3729,8 +3743,8 @@ const Ui = ee(
|
|
|
3729
3743
|
"input",
|
|
3730
3744
|
{
|
|
3731
3745
|
type: "text",
|
|
3732
|
-
value:
|
|
3733
|
-
onChange: (
|
|
3746
|
+
value: C,
|
|
3747
|
+
onChange: (w) => N(w.target.value),
|
|
3734
3748
|
placeholder: "Search attractions…",
|
|
3735
3749
|
style: { flex: 1, minWidth: 150 }
|
|
3736
3750
|
}
|
|
@@ -3738,28 +3752,28 @@ const Ui = ee(
|
|
|
3738
3752
|
/* @__PURE__ */ e(
|
|
3739
3753
|
"button",
|
|
3740
3754
|
{
|
|
3741
|
-
onClick: () =>
|
|
3755
|
+
onClick: () => _(""),
|
|
3742
3756
|
style: { fontWeight: g ? 400 : 700 },
|
|
3743
3757
|
children: "All"
|
|
3744
3758
|
}
|
|
3745
3759
|
),
|
|
3746
|
-
|
|
3760
|
+
c.map((w) => /* @__PURE__ */ i(
|
|
3747
3761
|
"button",
|
|
3748
3762
|
{
|
|
3749
|
-
onClick: () => w
|
|
3763
|
+
onClick: () => _(w === g ? "" : w),
|
|
3750
3764
|
style: {
|
|
3751
|
-
fontWeight:
|
|
3765
|
+
fontWeight: w === g ? 700 : 400,
|
|
3752
3766
|
display: "inline-flex",
|
|
3753
3767
|
alignItems: "center",
|
|
3754
3768
|
gap: 4
|
|
3755
3769
|
},
|
|
3756
3770
|
children: [
|
|
3757
|
-
Me.createElement(
|
|
3771
|
+
Me.createElement(In[w], { size: 14 }),
|
|
3758
3772
|
" ",
|
|
3759
|
-
|
|
3773
|
+
Di[w]
|
|
3760
3774
|
]
|
|
3761
3775
|
},
|
|
3762
|
-
|
|
3776
|
+
w
|
|
3763
3777
|
))
|
|
3764
3778
|
] }),
|
|
3765
3779
|
/* @__PURE__ */ e(
|
|
@@ -3771,27 +3785,27 @@ const Ui = ee(
|
|
|
3771
3785
|
gap: 12,
|
|
3772
3786
|
flexDirection: p === "list" ? "column" : void 0
|
|
3773
3787
|
},
|
|
3774
|
-
children:
|
|
3775
|
-
const
|
|
3788
|
+
children: x.length === 0 ? /* @__PURE__ */ e("p", { children: "No attractions found." }) : x.map((w) => {
|
|
3789
|
+
const E = $.has(w.id);
|
|
3776
3790
|
return /* @__PURE__ */ i(
|
|
3777
3791
|
"div",
|
|
3778
3792
|
{
|
|
3779
3793
|
className: "nice-attraction-picker__card",
|
|
3780
3794
|
style: {
|
|
3781
|
-
border:
|
|
3795
|
+
border: E ? "2px solid var(--nice-color-primary, #6366f1)" : "1px solid var(--nice-border-color, #cbd5e1)",
|
|
3782
3796
|
borderRadius: 8,
|
|
3783
3797
|
padding: 12,
|
|
3784
3798
|
cursor: u ? "default" : "pointer",
|
|
3785
|
-
background:
|
|
3799
|
+
background: E ? "color-mix(in srgb, var(--nice-color-primary) 12%, transparent)" : "var(--nice-bg-elevated, var(--nice-bg-primary))",
|
|
3786
3800
|
transition: "all 0.2s"
|
|
3787
3801
|
},
|
|
3788
|
-
onClick: () =>
|
|
3802
|
+
onClick: () => P(w.id),
|
|
3789
3803
|
children: [
|
|
3790
|
-
|
|
3804
|
+
w.imageUrl && /* @__PURE__ */ e(
|
|
3791
3805
|
"img",
|
|
3792
3806
|
{
|
|
3793
|
-
src:
|
|
3794
|
-
alt:
|
|
3807
|
+
src: w.imageUrl,
|
|
3808
|
+
alt: w.name,
|
|
3795
3809
|
style: {
|
|
3796
3810
|
width: "100%",
|
|
3797
3811
|
borderRadius: 6,
|
|
@@ -3802,10 +3816,10 @@ const Ui = ee(
|
|
|
3802
3816
|
}
|
|
3803
3817
|
),
|
|
3804
3818
|
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
3805
|
-
/* @__PURE__ */ e("span", { style: { display: "inline-flex" }, children: Me.createElement(
|
|
3806
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3819
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex" }, children: Me.createElement(In[w.category], { size: 16 }) }),
|
|
3820
|
+
/* @__PURE__ */ e("strong", { children: w.name })
|
|
3807
3821
|
] }),
|
|
3808
|
-
|
|
3822
|
+
w.description && /* @__PURE__ */ e(
|
|
3809
3823
|
"p",
|
|
3810
3824
|
{
|
|
3811
3825
|
style: {
|
|
@@ -3813,7 +3827,7 @@ const Ui = ee(
|
|
|
3813
3827
|
color: "var(--nice-text-secondary, #64748b)",
|
|
3814
3828
|
margin: "6px 0"
|
|
3815
3829
|
},
|
|
3816
|
-
children:
|
|
3830
|
+
children: w.description
|
|
3817
3831
|
}
|
|
3818
3832
|
),
|
|
3819
3833
|
/* @__PURE__ */ i(
|
|
@@ -3838,15 +3852,15 @@ const Ui = ee(
|
|
|
3838
3852
|
children: [
|
|
3839
3853
|
/* @__PURE__ */ e(tn, { size: 14 }),
|
|
3840
3854
|
" ",
|
|
3841
|
-
|
|
3855
|
+
w.votes ?? 0
|
|
3842
3856
|
]
|
|
3843
3857
|
}
|
|
3844
3858
|
),
|
|
3845
3859
|
!u && d && /* @__PURE__ */ e(
|
|
3846
3860
|
"button",
|
|
3847
3861
|
{
|
|
3848
|
-
onClick: (
|
|
3849
|
-
|
|
3862
|
+
onClick: (b) => {
|
|
3863
|
+
b.stopPropagation(), d(w.id);
|
|
3850
3864
|
},
|
|
3851
3865
|
style: { fontSize: 12 },
|
|
3852
3866
|
children: "Vote"
|
|
@@ -3857,7 +3871,7 @@ const Ui = ee(
|
|
|
3857
3871
|
)
|
|
3858
3872
|
]
|
|
3859
3873
|
},
|
|
3860
|
-
|
|
3874
|
+
w.id
|
|
3861
3875
|
);
|
|
3862
3876
|
})
|
|
3863
3877
|
}
|
|
@@ -3866,16 +3880,16 @@ const Ui = ee(
|
|
|
3866
3880
|
}
|
|
3867
3881
|
);
|
|
3868
3882
|
}
|
|
3869
|
-
),
|
|
3870
|
-
game:
|
|
3883
|
+
), Li = {
|
|
3884
|
+
game: Dn,
|
|
3871
3885
|
music: ke,
|
|
3872
3886
|
dance: ke,
|
|
3873
3887
|
quiz: en,
|
|
3874
3888
|
karaoke: Ye,
|
|
3875
|
-
photo:
|
|
3889
|
+
photo: En,
|
|
3876
3890
|
custom: Mn
|
|
3877
|
-
},
|
|
3878
|
-
function(t,
|
|
3891
|
+
}, na = ee(
|
|
3892
|
+
function(t, r) {
|
|
3879
3893
|
const {
|
|
3880
3894
|
attractions: n,
|
|
3881
3895
|
onVote: l,
|
|
@@ -3886,28 +3900,28 @@ const Ui = ee(
|
|
|
3886
3900
|
sortBy: a = "votes",
|
|
3887
3901
|
showResults: u = !0,
|
|
3888
3902
|
className: p,
|
|
3889
|
-
style:
|
|
3890
|
-
} = t, f =
|
|
3891
|
-
const
|
|
3903
|
+
style: k
|
|
3904
|
+
} = t, f = V(() => new Set(d), [d]), g = m ? m - f.size : void 0, _ = V(() => {
|
|
3905
|
+
const c = [...n];
|
|
3892
3906
|
switch (a) {
|
|
3893
3907
|
case "votes":
|
|
3894
|
-
|
|
3908
|
+
c.sort((x, v) => (v.votes ?? 0) - (x.votes ?? 0));
|
|
3895
3909
|
break;
|
|
3896
3910
|
case "name":
|
|
3897
|
-
|
|
3911
|
+
c.sort((x, v) => x.name.localeCompare(v.name));
|
|
3898
3912
|
break;
|
|
3899
3913
|
case "category":
|
|
3900
|
-
|
|
3914
|
+
c.sort((x, v) => x.category.localeCompare(v.category));
|
|
3901
3915
|
break;
|
|
3902
3916
|
}
|
|
3903
|
-
return
|
|
3904
|
-
}, [n, a]),
|
|
3905
|
-
() => Math.max(...n.map((
|
|
3917
|
+
return c;
|
|
3918
|
+
}, [n, a]), C = V(
|
|
3919
|
+
() => Math.max(...n.map((c) => c.votes ?? 0), 1),
|
|
3906
3920
|
[n]
|
|
3907
|
-
),
|
|
3908
|
-
h || (f.has(
|
|
3909
|
-
}, $ = (
|
|
3910
|
-
switch (
|
|
3921
|
+
), N = (c) => {
|
|
3922
|
+
h || (f.has(c) ? o == null || o(c) : (!g || g > 0) && (l == null || l(c)));
|
|
3923
|
+
}, $ = (c) => {
|
|
3924
|
+
switch (c) {
|
|
3911
3925
|
case 0:
|
|
3912
3926
|
return /* @__PURE__ */ e(an, { size: 18, primaryColor: "#f59e0b", title: "1st place" });
|
|
3913
3927
|
case 1:
|
|
@@ -3915,15 +3929,15 @@ const Ui = ee(
|
|
|
3915
3929
|
case 2:
|
|
3916
3930
|
return /* @__PURE__ */ e(He, { size: 18, primaryColor: "#b45309", title: "3rd place" });
|
|
3917
3931
|
default:
|
|
3918
|
-
return `${
|
|
3932
|
+
return `${c + 1}.`;
|
|
3919
3933
|
}
|
|
3920
3934
|
};
|
|
3921
3935
|
return /* @__PURE__ */ i(
|
|
3922
3936
|
"div",
|
|
3923
3937
|
{
|
|
3924
|
-
ref:
|
|
3938
|
+
ref: r,
|
|
3925
3939
|
className: `nice-attraction-voting ${p ?? ""}`,
|
|
3926
|
-
style: { color: "var(--nice-text-primary)", ...
|
|
3940
|
+
style: { color: "var(--nice-text-primary)", ...k },
|
|
3927
3941
|
children: [
|
|
3928
3942
|
/* @__PURE__ */ i(
|
|
3929
3943
|
"div",
|
|
@@ -3958,8 +3972,8 @@ const Ui = ee(
|
|
|
3958
3972
|
}
|
|
3959
3973
|
),
|
|
3960
3974
|
h && /* @__PURE__ */ e("p", { style: { color: "var(--nice-text-secondary, #64748b)", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
3961
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children:
|
|
3962
|
-
const v = f.has(
|
|
3975
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: _.map((c, x) => {
|
|
3976
|
+
const v = f.has(c.id), P = c.votes ?? 0, w = u ? `${Math.round(P / C * 100)}%` : "0%";
|
|
3963
3977
|
return /* @__PURE__ */ i(
|
|
3964
3978
|
"div",
|
|
3965
3979
|
{
|
|
@@ -3974,13 +3988,13 @@ const Ui = ee(
|
|
|
3974
3988
|
cursor: h ? "default" : "pointer",
|
|
3975
3989
|
transition: "all 0.2s"
|
|
3976
3990
|
},
|
|
3977
|
-
onClick: () =>
|
|
3991
|
+
onClick: () => N(c.id),
|
|
3978
3992
|
children: [
|
|
3979
|
-
u && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: $(
|
|
3980
|
-
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: Me.createElement(
|
|
3993
|
+
u && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: $(x) }),
|
|
3994
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: Me.createElement(Li[c.category], { size: 20 }) }),
|
|
3981
3995
|
/* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3982
|
-
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children:
|
|
3983
|
-
|
|
3996
|
+
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: c.name }),
|
|
3997
|
+
c.description && /* @__PURE__ */ e(
|
|
3984
3998
|
"div",
|
|
3985
3999
|
{
|
|
3986
4000
|
style: {
|
|
@@ -3990,7 +4004,7 @@ const Ui = ee(
|
|
|
3990
4004
|
textOverflow: "ellipsis",
|
|
3991
4005
|
whiteSpace: "nowrap"
|
|
3992
4006
|
},
|
|
3993
|
-
children:
|
|
4007
|
+
children: c.description
|
|
3994
4008
|
}
|
|
3995
4009
|
),
|
|
3996
4010
|
u && /* @__PURE__ */ e(
|
|
@@ -4008,7 +4022,7 @@ const Ui = ee(
|
|
|
4008
4022
|
{
|
|
4009
4023
|
style: {
|
|
4010
4024
|
height: "100%",
|
|
4011
|
-
width:
|
|
4025
|
+
width: w,
|
|
4012
4026
|
background: "var(--nice-color-primary, #6366f1)",
|
|
4013
4027
|
borderRadius: 3,
|
|
4014
4028
|
transition: "width 0.3s"
|
|
@@ -4018,12 +4032,12 @@ const Ui = ee(
|
|
|
4018
4032
|
}
|
|
4019
4033
|
)
|
|
4020
4034
|
] }),
|
|
4021
|
-
u && /* @__PURE__ */ e("span", { style: { fontWeight: 600, fontSize: 16, minWidth: 40, textAlign: "right" }, children:
|
|
4035
|
+
u && /* @__PURE__ */ e("span", { style: { fontWeight: 600, fontSize: 16, minWidth: 40, textAlign: "right" }, children: P }),
|
|
4022
4036
|
!h && /* @__PURE__ */ e(
|
|
4023
4037
|
"button",
|
|
4024
4038
|
{
|
|
4025
|
-
onClick: (
|
|
4026
|
-
|
|
4039
|
+
onClick: (E) => {
|
|
4040
|
+
E.stopPropagation(), N(c.id);
|
|
4027
4041
|
},
|
|
4028
4042
|
style: {
|
|
4029
4043
|
padding: "4px 12px",
|
|
@@ -4039,7 +4053,7 @@ const Ui = ee(
|
|
|
4039
4053
|
)
|
|
4040
4054
|
]
|
|
4041
4055
|
},
|
|
4042
|
-
|
|
4056
|
+
c.id
|
|
4043
4057
|
);
|
|
4044
4058
|
}) }),
|
|
4045
4059
|
u && /* @__PURE__ */ i(
|
|
@@ -4053,7 +4067,7 @@ const Ui = ee(
|
|
|
4053
4067
|
},
|
|
4054
4068
|
children: [
|
|
4055
4069
|
"Total votes: ",
|
|
4056
|
-
n.reduce((
|
|
4070
|
+
n.reduce((c, x) => c + (x.votes ?? 0), 0)
|
|
4057
4071
|
]
|
|
4058
4072
|
}
|
|
4059
4073
|
)
|
|
@@ -4063,20 +4077,20 @@ const Ui = ee(
|
|
|
4063
4077
|
}
|
|
4064
4078
|
);
|
|
4065
4079
|
export {
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4080
|
+
ea as NiceAttractionPicker,
|
|
4081
|
+
na as NiceAttractionVoting,
|
|
4082
|
+
Xi as NiceEventMedia,
|
|
4083
|
+
Fi as NiceEventPlanning,
|
|
4084
|
+
Ki as NiceExpenseSplit,
|
|
4085
|
+
Gi as NiceGiftRegistry,
|
|
4086
|
+
ji as NiceInvitationDesigner,
|
|
4087
|
+
Ji as NiceKaraokePicker,
|
|
4088
|
+
Vi as NiceMediaCollage,
|
|
4089
|
+
Wi as NiceParticipantList,
|
|
4090
|
+
Qi as NiceRoundCard,
|
|
4091
|
+
Hi as NiceRoundList,
|
|
4078
4092
|
_n as NiceRsvpControl,
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4093
|
+
qi as NiceSeatPicker,
|
|
4094
|
+
pi as NiceSeatingChart,
|
|
4095
|
+
Zi as NiceSongPicker
|
|
4082
4096
|
};
|