@nice2dev/events 1.0.8 โ 1.0.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/dist/index.cjs +1 -1
- package/dist/index.mjs +1324 -934
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,83 +1,92 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e, Fragment as ue } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as P, useState as w, useRef as pe, useEffect as me, useCallback as E, useMemo as R } from "react";
|
|
3
|
-
const be = P(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */ t("div", { className:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
3
|
+
const be = P(
|
|
4
|
+
function(x, A) {
|
|
5
|
+
const {
|
|
6
|
+
messages: a,
|
|
7
|
+
currentUserId: y,
|
|
8
|
+
onSend: m,
|
|
9
|
+
onReact: v,
|
|
10
|
+
reactions: _ = ["๐", "โค๏ธ", "๐", "๐", "๐ฅ"],
|
|
11
|
+
readOnly: g = !1,
|
|
12
|
+
placeholder: S = "Type a messageโฆ",
|
|
13
|
+
autoScroll: N = !0,
|
|
14
|
+
className: f,
|
|
15
|
+
style: C
|
|
16
|
+
} = x, [s, u] = w(""), k = pe(null);
|
|
17
|
+
me(() => {
|
|
18
|
+
N && k.current && k.current.scrollIntoView({ behavior: "smooth" });
|
|
19
|
+
}, [a.length, N]);
|
|
20
|
+
const b = E(() => {
|
|
21
|
+
!s.trim() || !m || (m(s.trim(), "text"), u(""));
|
|
22
|
+
}, [s, m]), p = (c) => {
|
|
23
|
+
c.key === "Enter" && !c.shiftKey && (c.preventDefault(), b());
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-chat ${f ?? ""}`, style: C, children: [
|
|
26
|
+
/* @__PURE__ */ t("div", { className: "nice-event-chat__messages", children: [
|
|
27
|
+
a.length === 0 && /* @__PURE__ */ e("p", { className: "nice-event-chat__empty", children: "No messages yet. Start the conversation!" }),
|
|
28
|
+
a.map((c) => {
|
|
29
|
+
const n = c.senderId === y;
|
|
30
|
+
return c.type === "system" || c.type === "announcement" ? /* @__PURE__ */ t(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: `nice-event-chat__system nice-event-chat__${c.type}`,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ e("span", { children: c.content }),
|
|
36
|
+
/* @__PURE__ */ e("time", { children: c.timestamp })
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
c.id
|
|
40
|
+
) : /* @__PURE__ */ t(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: `nice-event-chat__bubble ${n ? "nice-event-chat__bubble--own" : ""}`,
|
|
44
|
+
children: [
|
|
45
|
+
!n && /* @__PURE__ */ t("div", { className: "nice-event-chat__sender", children: [
|
|
46
|
+
c.senderAvatarUrl && /* @__PURE__ */ e("img", { src: c.senderAvatarUrl, alt: "", className: "nice-event-chat__avatar" }),
|
|
47
|
+
/* @__PURE__ */ e("strong", { children: c.senderName })
|
|
48
|
+
] }),
|
|
49
|
+
c.type === "image" ? /* @__PURE__ */ e("img", { src: c.content, alt: "Shared image", className: "nice-event-chat__image" }) : /* @__PURE__ */ e("p", { className: "nice-event-chat__text", children: c.content }),
|
|
50
|
+
/* @__PURE__ */ t("div", { className: "nice-event-chat__meta", children: [
|
|
51
|
+
/* @__PURE__ */ e("time", { children: c.timestamp }),
|
|
52
|
+
c.reactions && Object.keys(c.reactions).length > 0 && /* @__PURE__ */ e("span", { className: "nice-event-chat__reactions", children: Object.entries(c.reactions).map(([i, h]) => /* @__PURE__ */ t(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
className: "nice-event-chat__reaction",
|
|
56
|
+
onClick: () => v == null ? void 0 : v(c.id, i),
|
|
57
|
+
children: [
|
|
58
|
+
i,
|
|
59
|
+
" ",
|
|
60
|
+
h
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
i
|
|
64
|
+
)) })
|
|
65
|
+
] }),
|
|
66
|
+
v && !g && /* @__PURE__ */ e("div", { className: "nice-event-chat__react-bar", children: _.map((i) => /* @__PURE__ */ e("button", { onClick: () => v(c.id, i), title: i, children: i }, i)) })
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
c.id
|
|
70
|
+
);
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ e("div", { ref: k })
|
|
73
|
+
] }),
|
|
74
|
+
!g && /* @__PURE__ */ t("div", { className: "nice-event-chat__input-bar", children: [
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
|
+
"textarea",
|
|
34
77
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
className: "nice-event-chat__reaction",
|
|
48
|
-
onClick: () => v == null ? void 0 : v(c.id, i),
|
|
49
|
-
children: [
|
|
50
|
-
i,
|
|
51
|
-
" ",
|
|
52
|
-
h
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
i
|
|
56
|
-
)) })
|
|
57
|
-
] }),
|
|
58
|
-
v && !g && /* @__PURE__ */ e("div", { className: "nice-event-chat__react-bar", children: _.map((i) => /* @__PURE__ */ e("button", { onClick: () => v(c.id, i), title: i, children: i }, i)) })
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
c.id
|
|
62
|
-
);
|
|
63
|
-
}),
|
|
64
|
-
/* @__PURE__ */ e("div", { ref: k })
|
|
65
|
-
] }),
|
|
66
|
-
!g && /* @__PURE__ */ t("div", { className: "nice-event-chat__input-bar", children: [
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
"textarea",
|
|
69
|
-
{
|
|
70
|
-
value: s,
|
|
71
|
-
onChange: (c) => u(c.target.value),
|
|
72
|
-
onKeyDown: p,
|
|
73
|
-
placeholder: S,
|
|
74
|
-
rows: 1
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ e("button", { onClick: b, disabled: !s.trim(), children: "Send" })
|
|
78
|
-
] })
|
|
79
|
-
] });
|
|
80
|
-
}), X = {
|
|
78
|
+
value: s,
|
|
79
|
+
onChange: (c) => u(c.target.value),
|
|
80
|
+
onKeyDown: p,
|
|
81
|
+
placeholder: S,
|
|
82
|
+
rows: 1
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ e("button", { onClick: b, disabled: !s.trim(), children: "Send" })
|
|
86
|
+
] })
|
|
87
|
+
] });
|
|
88
|
+
}
|
|
89
|
+
), X = {
|
|
81
90
|
invited: "#3b82f6",
|
|
82
91
|
confirmed: "#22c55e",
|
|
83
92
|
declined: "#ef4444",
|
|
@@ -90,352 +99,540 @@ const be = P(function(x, A) {
|
|
|
90
99
|
participant: "๐ค Participant",
|
|
91
100
|
spectator: "๐๏ธ Spectator",
|
|
92
101
|
vip: "โญ VIP"
|
|
93
|
-
}, ke = P(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
102
|
+
}, ke = P(
|
|
103
|
+
function(x, A) {
|
|
104
|
+
const {
|
|
105
|
+
participants: a,
|
|
106
|
+
currentParticipantId: y,
|
|
107
|
+
onInvite: m,
|
|
108
|
+
onRemove: v,
|
|
109
|
+
onRoleChange: _,
|
|
110
|
+
onCheckIn: g,
|
|
111
|
+
onParticipantClick: S,
|
|
112
|
+
showQR: N = !1,
|
|
113
|
+
editable: f = !1,
|
|
114
|
+
maxParticipants: C,
|
|
115
|
+
className: s,
|
|
116
|
+
style: u
|
|
117
|
+
} = x, [k, b] = w(""), [p, c] = w(""), n = R(() => {
|
|
118
|
+
let h = a;
|
|
119
|
+
if (p && (h = h.filter((l) => l.status === p)), k.trim()) {
|
|
120
|
+
const l = k.toLowerCase();
|
|
121
|
+
h = h.filter((o) => o.name.toLowerCase().includes(l));
|
|
122
|
+
}
|
|
123
|
+
return h;
|
|
124
|
+
}, [a, p, k]), d = R(() => {
|
|
125
|
+
const h = /* @__PURE__ */ new Map(), l = [
|
|
126
|
+
"host",
|
|
127
|
+
"co-host",
|
|
128
|
+
"moderator",
|
|
129
|
+
"vip",
|
|
130
|
+
"participant",
|
|
131
|
+
"spectator"
|
|
132
|
+
];
|
|
133
|
+
for (const o of l)
|
|
134
|
+
h.set(o, []);
|
|
135
|
+
for (const o of n)
|
|
136
|
+
h.has(o.role) || h.set(o.role, []), h.get(o.role).push(o);
|
|
137
|
+
return Array.from(h.entries()).filter(([, o]) => o.length > 0);
|
|
138
|
+
}, [n]), i = R(() => {
|
|
139
|
+
const h = {};
|
|
140
|
+
for (const l of a)
|
|
141
|
+
h[l.status] = (h[l.status] ?? 0) + 1;
|
|
142
|
+
return h;
|
|
143
|
+
}, [a]);
|
|
144
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-participants ${s ?? ""}`, style: u, children: [
|
|
145
|
+
/* @__PURE__ */ t("div", { className: "nice-event-participants__header", children: [
|
|
146
|
+
/* @__PURE__ */ t("h3", { children: [
|
|
147
|
+
"Participants (",
|
|
148
|
+
a.length,
|
|
149
|
+
C ? ` / ${C}` : "",
|
|
150
|
+
")"
|
|
151
|
+
] }),
|
|
152
|
+
f && m && /* @__PURE__ */ e(
|
|
153
|
+
"button",
|
|
154
|
+
{
|
|
155
|
+
onClick: m,
|
|
156
|
+
disabled: C ? a.length >= C : !1,
|
|
157
|
+
children: "+ Invite"
|
|
158
|
+
}
|
|
159
|
+
)
|
|
133
160
|
] }),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
/* @__PURE__ */ e("div", { className: "nice-event-participants__summary", children: Object.entries(i).map(([h, l]) => /* @__PURE__ */ t("span", { className: "nice-event-participants__stat", children: [
|
|
162
|
+
/* @__PURE__ */ e(
|
|
163
|
+
"span",
|
|
164
|
+
{
|
|
165
|
+
className: "nice-event-participants__dot",
|
|
166
|
+
style: { backgroundColor: X[h] }
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
h,
|
|
170
|
+
": ",
|
|
171
|
+
l
|
|
172
|
+
] }, h)) }),
|
|
173
|
+
/* @__PURE__ */ t("div", { className: "nice-event-participants__toolbar", children: [
|
|
174
|
+
/* @__PURE__ */ e(
|
|
175
|
+
"input",
|
|
176
|
+
{
|
|
177
|
+
type: "text",
|
|
178
|
+
value: k,
|
|
179
|
+
onChange: (h) => b(h.target.value),
|
|
180
|
+
placeholder: "Searchโฆ"
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ t(
|
|
184
|
+
"select",
|
|
185
|
+
{
|
|
186
|
+
value: p,
|
|
187
|
+
onChange: (h) => c(h.target.value),
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ e("option", { value: "", children: "All" }),
|
|
190
|
+
/* @__PURE__ */ e("option", { value: "invited", children: "Invited" }),
|
|
191
|
+
/* @__PURE__ */ e("option", { value: "confirmed", children: "Confirmed" }),
|
|
192
|
+
/* @__PURE__ */ e("option", { value: "declined", children: "Declined" }),
|
|
193
|
+
/* @__PURE__ */ e("option", { value: "checked-in", children: "Checked In" }),
|
|
194
|
+
/* @__PURE__ */ e("option", { value: "no-show", children: "No Show" })
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
)
|
|
167
198
|
] }),
|
|
168
|
-
|
|
169
|
-
"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
199
|
+
d.map(([h, l]) => /* @__PURE__ */ t("div", { className: "nice-event-participants__group", children: [
|
|
200
|
+
/* @__PURE__ */ t("h4", { className: "nice-event-participants__role-label", children: [
|
|
201
|
+
Z[h],
|
|
202
|
+
" (",
|
|
203
|
+
l.length,
|
|
204
|
+
")"
|
|
205
|
+
] }),
|
|
206
|
+
l.map((o) => /* @__PURE__ */ t(
|
|
207
|
+
"div",
|
|
208
|
+
{
|
|
209
|
+
className: `nice-event-participants__item ${o.id === y ? "nice-event-participants__item--self" : ""}`,
|
|
210
|
+
onClick: () => S == null ? void 0 : S(o),
|
|
211
|
+
children: [
|
|
212
|
+
o.avatarUrl ? /* @__PURE__ */ e("img", { src: o.avatarUrl, alt: "", className: "nice-event-participants__avatar" }) : /* @__PURE__ */ e("span", { className: "nice-event-participants__avatar-placeholder", children: o.name.charAt(0) }),
|
|
213
|
+
/* @__PURE__ */ t("div", { className: "nice-event-participants__info", children: [
|
|
214
|
+
/* @__PURE__ */ e("span", { className: "nice-event-participants__name", children: o.name }),
|
|
215
|
+
/* @__PURE__ */ e(
|
|
216
|
+
"span",
|
|
217
|
+
{
|
|
218
|
+
className: "nice-event-participants__status",
|
|
219
|
+
style: { color: X[o.status] },
|
|
220
|
+
children: o.status
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
o.score != null && /* @__PURE__ */ t("span", { className: "nice-event-participants__score", children: [
|
|
224
|
+
"Score: ",
|
|
225
|
+
o.score
|
|
226
|
+
] })
|
|
227
|
+
] }),
|
|
228
|
+
N && o.qrCode && /* @__PURE__ */ e("span", { className: "nice-event-participants__qr", title: "QR Code", children: "๐ฑ" }),
|
|
229
|
+
f && /* @__PURE__ */ t("div", { className: "nice-event-participants__actions", children: [
|
|
230
|
+
_ && /* @__PURE__ */ e(
|
|
231
|
+
"select",
|
|
232
|
+
{
|
|
233
|
+
value: o.role,
|
|
234
|
+
onChange: (I) => _(o.id, I.target.value),
|
|
235
|
+
onClick: (I) => I.stopPropagation(),
|
|
236
|
+
children: Object.entries(Z).map(([I, O]) => /* @__PURE__ */ e("option", { value: I, children: O }, I))
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
g && o.status === "confirmed" && /* @__PURE__ */ e(
|
|
240
|
+
"button",
|
|
241
|
+
{
|
|
242
|
+
onClick: (I) => {
|
|
243
|
+
I.stopPropagation(), g(o.id);
|
|
244
|
+
},
|
|
245
|
+
children: "Check In"
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
v && o.role !== "host" && /* @__PURE__ */ e(
|
|
249
|
+
"button",
|
|
250
|
+
{
|
|
251
|
+
onClick: (I) => {
|
|
252
|
+
I.stopPropagation(), v(o.id);
|
|
253
|
+
},
|
|
254
|
+
children: "Remove"
|
|
255
|
+
}
|
|
256
|
+
)
|
|
181
257
|
] })
|
|
182
|
-
]
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
)
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const {
|
|
209
|
-
items: a,
|
|
210
|
-
onUpload: y,
|
|
211
|
-
onDelete: m,
|
|
212
|
-
onLike: v,
|
|
213
|
-
onItemClick: _,
|
|
214
|
-
layout: g = "grid",
|
|
215
|
-
uploadEnabled: S = !0,
|
|
216
|
-
typeFilter: N = "all",
|
|
217
|
-
className: f,
|
|
218
|
-
style: C
|
|
219
|
-
} = x, [s, u] = w(""), k = R(() => N === "all" ? a : a.filter((p) => p.type === N), [a, N]), b = (p) => {
|
|
220
|
-
var n;
|
|
221
|
-
const c = (n = p.target.files) == null ? void 0 : n[0];
|
|
222
|
-
!c || !y || (y(c, s.trim() || void 0), u(""), p.target.value = "");
|
|
223
|
-
};
|
|
224
|
-
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-media nice-event-media--${g} ${f ?? ""}`, style: C, children: [
|
|
225
|
-
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ t("h3", { children: [
|
|
226
|
-
"Media (",
|
|
227
|
-
k.length,
|
|
228
|
-
")"
|
|
229
|
-
] }) }),
|
|
230
|
-
S && y && /* @__PURE__ */ t("div", { className: "nice-event-media__upload", children: [
|
|
231
|
-
/* @__PURE__ */ e("input", { type: "file", accept: "image/*,video/*", onChange: b }),
|
|
232
|
-
/* @__PURE__ */ e(
|
|
233
|
-
"input",
|
|
234
|
-
{
|
|
235
|
-
type: "text",
|
|
236
|
-
value: s,
|
|
237
|
-
onChange: (p) => u(p.target.value),
|
|
238
|
-
placeholder: "Add a captionโฆ",
|
|
239
|
-
className: "nice-event-media__caption-input"
|
|
240
|
-
}
|
|
241
|
-
)
|
|
242
|
-
] }),
|
|
243
|
-
k.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-media__empty", children: "No media yet." }) : /* @__PURE__ */ e("div", { className: `nice-event-media__gallery nice-event-media__gallery--${g}`, children: k.map((p) => /* @__PURE__ */ t(
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
|
+
o.id
|
|
261
|
+
))
|
|
262
|
+
] }, h))
|
|
263
|
+
] });
|
|
264
|
+
}
|
|
265
|
+
), Ce = P(
|
|
266
|
+
function(x, A) {
|
|
267
|
+
const {
|
|
268
|
+
items: a,
|
|
269
|
+
onUpload: y,
|
|
270
|
+
onDelete: m,
|
|
271
|
+
onLike: v,
|
|
272
|
+
onItemClick: _,
|
|
273
|
+
layout: g = "grid",
|
|
274
|
+
uploadEnabled: S = !0,
|
|
275
|
+
typeFilter: N = "all",
|
|
276
|
+
className: f,
|
|
277
|
+
style: C
|
|
278
|
+
} = x, [s, u] = w(""), k = R(() => N === "all" ? a : a.filter((p) => p.type === N), [a, N]), b = (p) => {
|
|
279
|
+
var n;
|
|
280
|
+
const c = (n = p.target.files) == null ? void 0 : n[0];
|
|
281
|
+
!c || !y || (y(c, s.trim() || void 0), u(""), p.target.value = "");
|
|
282
|
+
};
|
|
283
|
+
return /* @__PURE__ */ t(
|
|
244
284
|
"div",
|
|
245
285
|
{
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
286
|
+
ref: A,
|
|
287
|
+
className: `nice-event-media nice-event-media--${g} ${f ?? ""}`,
|
|
288
|
+
style: C,
|
|
249
289
|
children: [
|
|
250
|
-
|
|
251
|
-
"
|
|
290
|
+
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ t("h3", { children: [
|
|
291
|
+
"Media (",
|
|
292
|
+
k.length,
|
|
293
|
+
")"
|
|
294
|
+
] }) }),
|
|
295
|
+
S && y && /* @__PURE__ */ t("div", { className: "nice-event-media__upload", children: [
|
|
296
|
+
/* @__PURE__ */ e("input", { type: "file", accept: "image/*,video/*", onChange: b }),
|
|
297
|
+
/* @__PURE__ */ e(
|
|
298
|
+
"input",
|
|
299
|
+
{
|
|
300
|
+
type: "text",
|
|
301
|
+
value: s,
|
|
302
|
+
onChange: (p) => u(p.target.value),
|
|
303
|
+
placeholder: "Add a captionโฆ",
|
|
304
|
+
className: "nice-event-media__caption-input"
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] }),
|
|
308
|
+
k.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-media__empty", children: "No media yet." }) : /* @__PURE__ */ e("div", { className: `nice-event-media__gallery nice-event-media__gallery--${g}`, children: k.map((p) => /* @__PURE__ */ t(
|
|
309
|
+
"div",
|
|
252
310
|
{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
"
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
311
|
+
className: "nice-event-media__item",
|
|
312
|
+
onClick: () => _ == null ? void 0 : _(p),
|
|
313
|
+
role: _ ? "button" : void 0,
|
|
314
|
+
children: [
|
|
315
|
+
p.type === "photo" ? /* @__PURE__ */ e(
|
|
316
|
+
"img",
|
|
317
|
+
{
|
|
318
|
+
src: p.thumbnailUrl ?? p.url,
|
|
319
|
+
alt: p.caption ?? "",
|
|
320
|
+
className: "nice-event-media__thumb"
|
|
321
|
+
}
|
|
322
|
+
) : /* @__PURE__ */ e("div", { className: "nice-event-media__video-thumb", children: /* @__PURE__ */ e("span", { children: "โถ" }) }),
|
|
323
|
+
/* @__PURE__ */ t("div", { className: "nice-event-media__overlay", children: [
|
|
324
|
+
p.caption && /* @__PURE__ */ e("span", { className: "nice-event-media__item-caption", children: p.caption }),
|
|
325
|
+
/* @__PURE__ */ e("span", { className: "nice-event-media__uploader", children: p.uploadedByName }),
|
|
326
|
+
/* @__PURE__ */ t("div", { className: "nice-event-media__item-actions", children: [
|
|
327
|
+
v && /* @__PURE__ */ t(
|
|
328
|
+
"button",
|
|
329
|
+
{
|
|
330
|
+
onClick: (c) => {
|
|
331
|
+
c.stopPropagation(), v(p.id);
|
|
332
|
+
},
|
|
333
|
+
children: [
|
|
334
|
+
"โค๏ธ ",
|
|
335
|
+
p.likes ?? 0
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
m && /* @__PURE__ */ e(
|
|
340
|
+
"button",
|
|
341
|
+
{
|
|
342
|
+
onClick: (c) => {
|
|
343
|
+
c.stopPropagation(), m(p.id);
|
|
344
|
+
},
|
|
345
|
+
children: "๐๏ธ"
|
|
346
|
+
}
|
|
347
|
+
)
|
|
348
|
+
] })
|
|
349
|
+
] })
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
p.id
|
|
353
|
+
)) })
|
|
273
354
|
]
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
"
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
/* @__PURE__ */ t("
|
|
329
|
-
"
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
"
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
"
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
/* @__PURE__ */
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
), Se = P(
|
|
359
|
+
function(x, A) {
|
|
360
|
+
var G, K, H, Y, J;
|
|
361
|
+
const {
|
|
362
|
+
event: a,
|
|
363
|
+
surveys: y = [],
|
|
364
|
+
billing: m = [],
|
|
365
|
+
onUpdateEvent: v,
|
|
366
|
+
onUpdateLocation: _,
|
|
367
|
+
onAddSurvey: g,
|
|
368
|
+
onSurveyRespond: S,
|
|
369
|
+
onAddBilling: N,
|
|
370
|
+
editable: f = !1,
|
|
371
|
+
className: C,
|
|
372
|
+
style: s
|
|
373
|
+
} = x, [u, k] = w("details"), [b, p] = w(a.title), [c, n] = w(a.description ?? ""), [d, i] = w(a.startDate ?? ""), [h, l] = w(a.endDate ?? ""), [o, I] = w(((G = a.location) == null ? void 0 : G.name) ?? ""), [O, te] = w(((K = a.location) == null ? void 0 : K.address) ?? ""), [z, ne] = w(((H = a.location) == null ? void 0 : H.virtualUrl) ?? ""), [B, ie] = w(((Y = a.location) == null ? void 0 : Y.isVirtual) ?? !1), [T, F] = w(""), [D, ae] = w("single"), [U, Q] = w(""), [V, W] = w(""), [q, j] = w(""), [M, ce] = w("PLN"), le = E(() => {
|
|
374
|
+
v == null || v({
|
|
375
|
+
title: b,
|
|
376
|
+
description: c || void 0,
|
|
377
|
+
startDate: d || void 0,
|
|
378
|
+
endDate: h || void 0
|
|
379
|
+
});
|
|
380
|
+
}, [b, c, d, h, v]), re = E(() => {
|
|
381
|
+
_ == null || _({
|
|
382
|
+
name: o,
|
|
383
|
+
address: O || void 0,
|
|
384
|
+
virtualUrl: z || void 0,
|
|
385
|
+
isVirtual: B
|
|
386
|
+
});
|
|
387
|
+
}, [o, O, z, B, _]), se = E(() => {
|
|
388
|
+
if (!T.trim() || !g)
|
|
389
|
+
return;
|
|
390
|
+
const r = U.split(",").map(($) => $.trim()).filter(Boolean);
|
|
391
|
+
g(T.trim(), D, r.length > 0 ? r : void 0), F(""), Q("");
|
|
392
|
+
}, [T, D, U, g]), oe = E(() => {
|
|
393
|
+
!V.trim() || !N || (N({
|
|
394
|
+
label: V.trim(),
|
|
395
|
+
amount: parseFloat(q) || 0,
|
|
396
|
+
currency: M
|
|
397
|
+
}), W(""), j(""));
|
|
398
|
+
}, [V, q, M, N]), de = m.reduce((r, $) => r + $.amount, 0);
|
|
399
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-planning ${C ?? ""}`, style: s, children: [
|
|
400
|
+
/* @__PURE__ */ e("div", { className: "nice-event-planning__tabs", children: ["details", "location", "surveys", "billing"].map((r) => /* @__PURE__ */ e(
|
|
401
|
+
"button",
|
|
402
|
+
{
|
|
403
|
+
className: `nice-event-planning__tab ${u === r ? "nice-event-planning__tab--active" : ""}`,
|
|
404
|
+
onClick: () => k(r),
|
|
405
|
+
children: r.charAt(0).toUpperCase() + r.slice(1)
|
|
406
|
+
},
|
|
407
|
+
r
|
|
408
|
+
)) }),
|
|
409
|
+
u === "details" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
410
|
+
/* @__PURE__ */ t("label", { children: [
|
|
411
|
+
"Title",
|
|
412
|
+
/* @__PURE__ */ e(
|
|
413
|
+
"input",
|
|
414
|
+
{
|
|
415
|
+
type: "text",
|
|
416
|
+
value: b,
|
|
417
|
+
onChange: (r) => p(r.target.value),
|
|
418
|
+
readOnly: !f
|
|
419
|
+
}
|
|
420
|
+
)
|
|
421
|
+
] }),
|
|
422
|
+
/* @__PURE__ */ t("label", { children: [
|
|
423
|
+
"Description",
|
|
424
|
+
/* @__PURE__ */ e(
|
|
425
|
+
"textarea",
|
|
426
|
+
{
|
|
427
|
+
value: c,
|
|
428
|
+
onChange: (r) => n(r.target.value),
|
|
429
|
+
readOnly: !f,
|
|
430
|
+
rows: 3
|
|
431
|
+
}
|
|
432
|
+
)
|
|
433
|
+
] }),
|
|
434
|
+
/* @__PURE__ */ t("label", { children: [
|
|
435
|
+
"Start",
|
|
436
|
+
/* @__PURE__ */ e(
|
|
437
|
+
"input",
|
|
438
|
+
{
|
|
439
|
+
type: "datetime-local",
|
|
440
|
+
value: d,
|
|
441
|
+
onChange: (r) => i(r.target.value),
|
|
442
|
+
readOnly: !f
|
|
443
|
+
}
|
|
444
|
+
)
|
|
445
|
+
] }),
|
|
446
|
+
/* @__PURE__ */ t("label", { children: [
|
|
447
|
+
"End",
|
|
448
|
+
/* @__PURE__ */ e(
|
|
449
|
+
"input",
|
|
450
|
+
{
|
|
451
|
+
type: "datetime-local",
|
|
452
|
+
value: h,
|
|
453
|
+
onChange: (r) => l(r.target.value),
|
|
454
|
+
readOnly: !f
|
|
455
|
+
}
|
|
456
|
+
)
|
|
457
|
+
] }),
|
|
458
|
+
/* @__PURE__ */ t("div", { className: "nice-event-planning__status", children: [
|
|
459
|
+
"Status: ",
|
|
460
|
+
/* @__PURE__ */ e("strong", { children: a.status })
|
|
461
|
+
] }),
|
|
462
|
+
f && /* @__PURE__ */ e("button", { onClick: le, children: "Save Details" })
|
|
366
463
|
] }),
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
464
|
+
u === "location" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
465
|
+
/* @__PURE__ */ t("label", { children: [
|
|
466
|
+
/* @__PURE__ */ e(
|
|
467
|
+
"input",
|
|
468
|
+
{
|
|
469
|
+
type: "checkbox",
|
|
470
|
+
checked: B,
|
|
471
|
+
onChange: (r) => ie(r.target.checked),
|
|
472
|
+
disabled: !f
|
|
473
|
+
}
|
|
474
|
+
),
|
|
475
|
+
" ",
|
|
476
|
+
"Virtual event"
|
|
376
477
|
] }),
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
/* @__PURE__ */ e("option", { value: "multiple", children: "Multiple choice" }),
|
|
389
|
-
/* @__PURE__ */ e("option", { value: "text", children: "Free text" }),
|
|
390
|
-
/* @__PURE__ */ e("option", { value: "rating", children: "Rating" })
|
|
478
|
+
/* @__PURE__ */ t("label", { children: [
|
|
479
|
+
"Venue Name",
|
|
480
|
+
/* @__PURE__ */ e(
|
|
481
|
+
"input",
|
|
482
|
+
{
|
|
483
|
+
type: "text",
|
|
484
|
+
value: o,
|
|
485
|
+
onChange: (r) => I(r.target.value),
|
|
486
|
+
readOnly: !f
|
|
487
|
+
}
|
|
488
|
+
)
|
|
391
489
|
] }),
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
/* @__PURE__ */ e("th", { children: "Status" })
|
|
404
|
-
] }) }),
|
|
405
|
-
/* @__PURE__ */ e("tbody", { children: m.map((r) => /* @__PURE__ */ t("tr", { children: [
|
|
406
|
-
/* @__PURE__ */ e("td", { children: r.label }),
|
|
407
|
-
/* @__PURE__ */ t("td", { children: [
|
|
408
|
-
r.amount.toFixed(2),
|
|
409
|
-
" ",
|
|
410
|
-
r.currency
|
|
411
|
-
] }),
|
|
412
|
-
/* @__PURE__ */ e("td", { children: r.paidByName ?? "โ" }),
|
|
413
|
-
/* @__PURE__ */ e("td", { children: r.isPaid ? "โ
Paid" : "โณ Pending" })
|
|
414
|
-
] }, r.id)) })
|
|
490
|
+
!B && /* @__PURE__ */ t("label", { children: [
|
|
491
|
+
"Address",
|
|
492
|
+
/* @__PURE__ */ e(
|
|
493
|
+
"input",
|
|
494
|
+
{
|
|
495
|
+
type: "text",
|
|
496
|
+
value: O,
|
|
497
|
+
onChange: (r) => te(r.target.value),
|
|
498
|
+
readOnly: !f
|
|
499
|
+
}
|
|
500
|
+
)
|
|
415
501
|
] }),
|
|
416
|
-
/* @__PURE__ */ t("
|
|
417
|
-
"
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
502
|
+
B && /* @__PURE__ */ t("label", { children: [
|
|
503
|
+
"Virtual URL",
|
|
504
|
+
/* @__PURE__ */ e(
|
|
505
|
+
"input",
|
|
506
|
+
{
|
|
507
|
+
type: "url",
|
|
508
|
+
value: z,
|
|
509
|
+
onChange: (r) => ne(r.target.value),
|
|
510
|
+
readOnly: !f
|
|
511
|
+
}
|
|
512
|
+
)
|
|
513
|
+
] }),
|
|
514
|
+
f && /* @__PURE__ */ e("button", { onClick: re, children: "Save Location" })
|
|
515
|
+
] }),
|
|
516
|
+
u === "surveys" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
517
|
+
y.length === 0 ? /* @__PURE__ */ e("p", { children: "No surveys yet." }) : y.map((r) => /* @__PURE__ */ t("div", { className: "nice-event-planning__survey", children: [
|
|
518
|
+
/* @__PURE__ */ e("strong", { children: r.question }),
|
|
519
|
+
/* @__PURE__ */ t("span", { className: "nice-event-planning__survey-type", children: [
|
|
520
|
+
"(",
|
|
521
|
+
r.type,
|
|
522
|
+
")"
|
|
523
|
+
] }),
|
|
524
|
+
r.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: r.options.map(($, he) => /* @__PURE__ */ e("button", { onClick: () => S == null ? void 0 : S(r.id, $), children: $ }, he)) }),
|
|
525
|
+
r.responses && /* @__PURE__ */ t("span", { children: [
|
|
526
|
+
r.responses.length,
|
|
527
|
+
" responses"
|
|
422
528
|
] })
|
|
529
|
+
] }, r.id)),
|
|
530
|
+
f && g && /* @__PURE__ */ t("div", { className: "nice-event-planning__add-survey", children: [
|
|
531
|
+
/* @__PURE__ */ e("h4", { children: "Add Survey" }),
|
|
532
|
+
/* @__PURE__ */ e(
|
|
533
|
+
"input",
|
|
534
|
+
{
|
|
535
|
+
type: "text",
|
|
536
|
+
value: T,
|
|
537
|
+
onChange: (r) => F(r.target.value),
|
|
538
|
+
placeholder: "Question"
|
|
539
|
+
}
|
|
540
|
+
),
|
|
541
|
+
/* @__PURE__ */ t(
|
|
542
|
+
"select",
|
|
543
|
+
{
|
|
544
|
+
value: D,
|
|
545
|
+
onChange: (r) => ae(r.target.value),
|
|
546
|
+
children: [
|
|
547
|
+
/* @__PURE__ */ e("option", { value: "single", children: "Single choice" }),
|
|
548
|
+
/* @__PURE__ */ e("option", { value: "multiple", children: "Multiple choice" }),
|
|
549
|
+
/* @__PURE__ */ e("option", { value: "text", children: "Free text" }),
|
|
550
|
+
/* @__PURE__ */ e("option", { value: "rating", children: "Rating" })
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
/* @__PURE__ */ e(
|
|
555
|
+
"input",
|
|
556
|
+
{
|
|
557
|
+
type: "text",
|
|
558
|
+
value: U,
|
|
559
|
+
onChange: (r) => Q(r.target.value),
|
|
560
|
+
placeholder: "Options (comma-separated)"
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
/* @__PURE__ */ e("button", { onClick: se, disabled: !T.trim(), children: "Add" })
|
|
423
564
|
] })
|
|
424
565
|
] }),
|
|
425
|
-
|
|
426
|
-
/* @__PURE__ */ e("
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
566
|
+
u === "billing" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
567
|
+
m.length === 0 ? /* @__PURE__ */ e("p", { children: "No billing items yet." }) : /* @__PURE__ */ t(ue, { children: [
|
|
568
|
+
/* @__PURE__ */ t("table", { className: "nice-event-planning__billing-table", children: [
|
|
569
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
570
|
+
/* @__PURE__ */ e("th", { children: "Item" }),
|
|
571
|
+
/* @__PURE__ */ e("th", { children: "Amount" }),
|
|
572
|
+
/* @__PURE__ */ e("th", { children: "Paid by" }),
|
|
573
|
+
/* @__PURE__ */ e("th", { children: "Status" })
|
|
574
|
+
] }) }),
|
|
575
|
+
/* @__PURE__ */ e("tbody", { children: m.map((r) => /* @__PURE__ */ t("tr", { children: [
|
|
576
|
+
/* @__PURE__ */ e("td", { children: r.label }),
|
|
577
|
+
/* @__PURE__ */ t("td", { children: [
|
|
578
|
+
r.amount.toFixed(2),
|
|
579
|
+
" ",
|
|
580
|
+
r.currency
|
|
581
|
+
] }),
|
|
582
|
+
/* @__PURE__ */ e("td", { children: r.paidByName ?? "โ" }),
|
|
583
|
+
/* @__PURE__ */ e("td", { children: r.isPaid ? "โ
Paid" : "โณ Pending" })
|
|
584
|
+
] }, r.id)) })
|
|
585
|
+
] }),
|
|
586
|
+
/* @__PURE__ */ t("div", { className: "nice-event-planning__billing-total", children: [
|
|
587
|
+
"Total:",
|
|
588
|
+
" ",
|
|
589
|
+
/* @__PURE__ */ t("strong", { children: [
|
|
590
|
+
de.toFixed(2),
|
|
591
|
+
" ",
|
|
592
|
+
((J = m[0]) == null ? void 0 : J.currency) ?? ""
|
|
593
|
+
] })
|
|
594
|
+
] })
|
|
433
595
|
] }),
|
|
434
|
-
/* @__PURE__ */
|
|
596
|
+
f && N && /* @__PURE__ */ t("div", { className: "nice-event-planning__add-billing", children: [
|
|
597
|
+
/* @__PURE__ */ e(
|
|
598
|
+
"input",
|
|
599
|
+
{
|
|
600
|
+
type: "text",
|
|
601
|
+
value: V,
|
|
602
|
+
onChange: (r) => W(r.target.value),
|
|
603
|
+
placeholder: "Item"
|
|
604
|
+
}
|
|
605
|
+
),
|
|
606
|
+
/* @__PURE__ */ e(
|
|
607
|
+
"input",
|
|
608
|
+
{
|
|
609
|
+
type: "number",
|
|
610
|
+
value: q,
|
|
611
|
+
onChange: (r) => j(r.target.value),
|
|
612
|
+
placeholder: "Amount",
|
|
613
|
+
min: 0,
|
|
614
|
+
step: 0.01
|
|
615
|
+
}
|
|
616
|
+
),
|
|
617
|
+
/* @__PURE__ */ t(
|
|
618
|
+
"select",
|
|
619
|
+
{
|
|
620
|
+
value: M,
|
|
621
|
+
onChange: (r) => ce(r.target.value),
|
|
622
|
+
children: [
|
|
623
|
+
/* @__PURE__ */ e("option", { value: "PLN", children: "PLN" }),
|
|
624
|
+
/* @__PURE__ */ e("option", { value: "EUR", children: "EUR" }),
|
|
625
|
+
/* @__PURE__ */ e("option", { value: "USD", children: "USD" }),
|
|
626
|
+
/* @__PURE__ */ e("option", { value: "GBP", children: "GBP" })
|
|
627
|
+
]
|
|
628
|
+
}
|
|
629
|
+
),
|
|
630
|
+
/* @__PURE__ */ e("button", { onClick: oe, disabled: !V.trim(), children: "Add" })
|
|
631
|
+
] })
|
|
435
632
|
] })
|
|
436
|
-
] })
|
|
437
|
-
|
|
438
|
-
|
|
633
|
+
] });
|
|
634
|
+
}
|
|
635
|
+
), ve = {
|
|
439
636
|
upcoming: "โณ",
|
|
440
637
|
active: "โถ๏ธ",
|
|
441
638
|
voting: "๐ณ๏ธ",
|
|
@@ -449,340 +646,439 @@ const be = P(function(x, A) {
|
|
|
449
646
|
scored: "#3b82f6",
|
|
450
647
|
completed: "#6b7280",
|
|
451
648
|
skipped: "#d1d5db"
|
|
452
|
-
}, we = P(
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
/* @__PURE__ */ t("div", { className:
|
|
466
|
-
/* @__PURE__ */ t("
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
649
|
+
}, we = P(
|
|
650
|
+
function(x, A) {
|
|
651
|
+
const {
|
|
652
|
+
rounds: a,
|
|
653
|
+
activeRoundId: y,
|
|
654
|
+
onSelect: m,
|
|
655
|
+
onStart: v,
|
|
656
|
+
onEnd: _,
|
|
657
|
+
onCreate: g,
|
|
658
|
+
editable: S = !1,
|
|
659
|
+
className: N,
|
|
660
|
+
style: f
|
|
661
|
+
} = x, C = [...a].sort((s, u) => s.order - u.order);
|
|
662
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-round-list ${N ?? ""}`, style: f, children: [
|
|
663
|
+
/* @__PURE__ */ t("div", { className: "nice-round-list__header", children: [
|
|
664
|
+
/* @__PURE__ */ t("h3", { children: [
|
|
665
|
+
"Rounds (",
|
|
666
|
+
a.length,
|
|
667
|
+
")"
|
|
668
|
+
] }),
|
|
669
|
+
S && g && /* @__PURE__ */ e("button", { onClick: g, children: "+ Add Round" })
|
|
470
670
|
] }),
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
s.
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
"
|
|
500
|
-
|
|
671
|
+
C.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: "No rounds yet." }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: C.map((s) => {
|
|
672
|
+
const u = s.id === y;
|
|
673
|
+
return /* @__PURE__ */ t(
|
|
674
|
+
"div",
|
|
675
|
+
{
|
|
676
|
+
className: `nice-round-list__item ${u ? "nice-round-list__item--active" : ""}`,
|
|
677
|
+
onClick: () => m == null ? void 0 : m(s),
|
|
678
|
+
role: m ? "button" : void 0,
|
|
679
|
+
tabIndex: m ? 0 : void 0,
|
|
680
|
+
children: [
|
|
681
|
+
/* @__PURE__ */ t("span", { className: "nice-round-list__order", children: [
|
|
682
|
+
"#",
|
|
683
|
+
s.order
|
|
684
|
+
] }),
|
|
685
|
+
/* @__PURE__ */ e("span", { className: "nice-round-list__icon", children: ve[s.status] }),
|
|
686
|
+
/* @__PURE__ */ t("div", { className: "nice-round-list__info", children: [
|
|
687
|
+
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children: s.name }),
|
|
688
|
+
s.description && /* @__PURE__ */ e("small", { children: s.description }),
|
|
689
|
+
s.type && /* @__PURE__ */ e("span", { className: "nice-round-list__type", children: s.type })
|
|
690
|
+
] }),
|
|
691
|
+
/* @__PURE__ */ e(
|
|
692
|
+
"span",
|
|
693
|
+
{
|
|
694
|
+
className: "nice-round-list__status",
|
|
695
|
+
style: { color: ge[s.status] },
|
|
696
|
+
children: s.status
|
|
697
|
+
}
|
|
698
|
+
),
|
|
699
|
+
s.durationMinutes && /* @__PURE__ */ t("span", { className: "nice-round-list__duration", children: [
|
|
700
|
+
s.durationMinutes,
|
|
701
|
+
"m"
|
|
702
|
+
] }),
|
|
703
|
+
s.winnerIds && s.winnerIds.length > 0 && /* @__PURE__ */ t("span", { className: "nice-round-list__winners", children: [
|
|
704
|
+
"๐ ",
|
|
705
|
+
s.winnerIds.length
|
|
706
|
+
] }),
|
|
707
|
+
S && /* @__PURE__ */ t("div", { className: "nice-round-list__actions", onClick: (k) => k.stopPropagation(), children: [
|
|
708
|
+
s.status === "upcoming" && v && /* @__PURE__ */ e("button", { onClick: () => v(s.id), children: "Start" }),
|
|
709
|
+
(s.status === "active" || s.status === "voting") && _ && /* @__PURE__ */ e("button", { onClick: () => _(s.id), children: "End" })
|
|
710
|
+
] })
|
|
711
|
+
]
|
|
712
|
+
},
|
|
713
|
+
s.id
|
|
714
|
+
);
|
|
715
|
+
}) })
|
|
716
|
+
] });
|
|
717
|
+
}
|
|
718
|
+
), xe = P(
|
|
719
|
+
function(x, A) {
|
|
720
|
+
const {
|
|
721
|
+
round: a,
|
|
722
|
+
timerRunning: y = !1,
|
|
723
|
+
remainingSeconds: m,
|
|
724
|
+
onSubmitScore: v,
|
|
725
|
+
onStart: _,
|
|
726
|
+
onEnd: g,
|
|
727
|
+
onSkip: S,
|
|
728
|
+
editable: N = !1,
|
|
729
|
+
footerActions: f,
|
|
730
|
+
className: C,
|
|
731
|
+
style: s
|
|
732
|
+
} = x, [u, k] = w({}), b = E(
|
|
733
|
+
(n) => {
|
|
734
|
+
const d = parseFloat(u[n] ?? "");
|
|
735
|
+
isNaN(d) || !v || (v(n, d), k((i) => ({ ...i, [n]: "" })));
|
|
736
|
+
},
|
|
737
|
+
[u, v]
|
|
738
|
+
), p = (n) => {
|
|
739
|
+
const d = Math.floor(n / 60), i = n % 60;
|
|
740
|
+
return `${d}:${i.toString().padStart(2, "0")}`;
|
|
741
|
+
}, c = a.scores ? [...a.scores].sort((n, d) => d.score - n.score) : [];
|
|
742
|
+
return /* @__PURE__ */ t(
|
|
743
|
+
"div",
|
|
744
|
+
{
|
|
745
|
+
ref: A,
|
|
746
|
+
className: `nice-round-card nice-round-card--${a.status} ${C ?? ""}`,
|
|
747
|
+
style: s,
|
|
748
|
+
children: [
|
|
749
|
+
/* @__PURE__ */ t("div", { className: "nice-round-card__header", children: [
|
|
750
|
+
/* @__PURE__ */ t("span", { className: "nice-round-card__order", children: [
|
|
751
|
+
"Round #",
|
|
752
|
+
a.order
|
|
501
753
|
] }),
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
754
|
+
/* @__PURE__ */ e("h3", { className: "nice-round-card__name", children: a.name }),
|
|
755
|
+
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children: a.status })
|
|
756
|
+
] }),
|
|
757
|
+
a.description && /* @__PURE__ */ e("p", { className: "nice-round-card__description", children: a.description }),
|
|
758
|
+
(y || m != null) && /* @__PURE__ */ t(
|
|
759
|
+
"div",
|
|
760
|
+
{
|
|
761
|
+
className: `nice-round-card__timer ${y ? "nice-round-card__timer--running" : ""}`,
|
|
762
|
+
children: [
|
|
763
|
+
"โฑ๏ธ ",
|
|
764
|
+
m != null ? p(m) : "โ"
|
|
765
|
+
]
|
|
766
|
+
}
|
|
767
|
+
),
|
|
768
|
+
c.length > 0 && /* @__PURE__ */ t("div", { className: "nice-round-card__scoreboard", children: [
|
|
769
|
+
/* @__PURE__ */ e("h4", { children: "Scoreboard" }),
|
|
770
|
+
/* @__PURE__ */ t("table", { className: "nice-round-card__scores-table", children: [
|
|
771
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
772
|
+
/* @__PURE__ */ e("th", { children: "Rank" }),
|
|
773
|
+
/* @__PURE__ */ e("th", { children: "Participant" }),
|
|
774
|
+
/* @__PURE__ */ e("th", { children: "Score" })
|
|
775
|
+
] }) }),
|
|
776
|
+
/* @__PURE__ */ e("tbody", { children: c.map((n, d) => /* @__PURE__ */ t(
|
|
777
|
+
"tr",
|
|
778
|
+
{
|
|
779
|
+
className: d < 3 ? `nice-round-card__top-${d + 1}` : "",
|
|
780
|
+
children: [
|
|
781
|
+
/* @__PURE__ */ t("td", { children: [
|
|
782
|
+
n.rank ?? d + 1,
|
|
783
|
+
d === 0 ? " ๐ฅ" : d === 1 ? " ๐ฅ" : d === 2 ? " ๐ฅ" : ""
|
|
784
|
+
] }),
|
|
785
|
+
/* @__PURE__ */ e("td", { children: n.participantName }),
|
|
786
|
+
/* @__PURE__ */ e("td", { children: n.score })
|
|
787
|
+
]
|
|
788
|
+
},
|
|
789
|
+
n.participantId
|
|
790
|
+
)) })
|
|
505
791
|
] })
|
|
506
|
-
]
|
|
507
|
-
},
|
|
508
|
-
s.id
|
|
509
|
-
);
|
|
510
|
-
}) })
|
|
511
|
-
] });
|
|
512
|
-
}), xe = P(function(x, A) {
|
|
513
|
-
const {
|
|
514
|
-
round: a,
|
|
515
|
-
timerRunning: y = !1,
|
|
516
|
-
remainingSeconds: m,
|
|
517
|
-
onSubmitScore: v,
|
|
518
|
-
onStart: _,
|
|
519
|
-
onEnd: g,
|
|
520
|
-
onSkip: S,
|
|
521
|
-
editable: N = !1,
|
|
522
|
-
footerActions: f,
|
|
523
|
-
className: C,
|
|
524
|
-
style: s
|
|
525
|
-
} = x, [u, k] = w({}), b = E((n) => {
|
|
526
|
-
const d = parseFloat(u[n] ?? "");
|
|
527
|
-
isNaN(d) || !v || (v(n, d), k((i) => ({ ...i, [n]: "" })));
|
|
528
|
-
}, [u, v]), p = (n) => {
|
|
529
|
-
const d = Math.floor(n / 60), i = n % 60;
|
|
530
|
-
return `${d}:${i.toString().padStart(2, "0")}`;
|
|
531
|
-
}, c = a.scores ? [...a.scores].sort((n, d) => d.score - n.score) : [];
|
|
532
|
-
return /* @__PURE__ */ t("div", { ref: A, className: `nice-round-card nice-round-card--${a.status} ${C ?? ""}`, style: s, children: [
|
|
533
|
-
/* @__PURE__ */ t("div", { className: "nice-round-card__header", children: [
|
|
534
|
-
/* @__PURE__ */ t("span", { className: "nice-round-card__order", children: [
|
|
535
|
-
"Round #",
|
|
536
|
-
a.order
|
|
537
|
-
] }),
|
|
538
|
-
/* @__PURE__ */ e("h3", { className: "nice-round-card__name", children: a.name }),
|
|
539
|
-
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children: a.status })
|
|
540
|
-
] }),
|
|
541
|
-
a.description && /* @__PURE__ */ e("p", { className: "nice-round-card__description", children: a.description }),
|
|
542
|
-
(y || m != null) && /* @__PURE__ */ t("div", { className: `nice-round-card__timer ${y ? "nice-round-card__timer--running" : ""}`, children: [
|
|
543
|
-
"โฑ๏ธ ",
|
|
544
|
-
m != null ? p(m) : "โ"
|
|
545
|
-
] }),
|
|
546
|
-
c.length > 0 && /* @__PURE__ */ t("div", { className: "nice-round-card__scoreboard", children: [
|
|
547
|
-
/* @__PURE__ */ e("h4", { children: "Scoreboard" }),
|
|
548
|
-
/* @__PURE__ */ t("table", { className: "nice-round-card__scores-table", children: [
|
|
549
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
550
|
-
/* @__PURE__ */ e("th", { children: "Rank" }),
|
|
551
|
-
/* @__PURE__ */ e("th", { children: "Participant" }),
|
|
552
|
-
/* @__PURE__ */ e("th", { children: "Score" })
|
|
553
|
-
] }) }),
|
|
554
|
-
/* @__PURE__ */ e("tbody", { children: c.map((n, d) => /* @__PURE__ */ t("tr", { className: d < 3 ? `nice-round-card__top-${d + 1}` : "", children: [
|
|
555
|
-
/* @__PURE__ */ t("td", { children: [
|
|
556
|
-
n.rank ?? d + 1,
|
|
557
|
-
d === 0 ? " ๐ฅ" : d === 1 ? " ๐ฅ" : d === 2 ? " ๐ฅ" : ""
|
|
558
792
|
] }),
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
a.winnerIds && a.winnerIds.length > 0 && /* @__PURE__ */ t("div", { className: "nice-round-card__winners", children: [
|
|
591
|
-
"๐ Winners: ",
|
|
592
|
-
a.winnerIds.length
|
|
593
|
-
] })
|
|
594
|
-
] });
|
|
595
|
-
}), Ae = P(function(x, A) {
|
|
596
|
-
const {
|
|
597
|
-
songs: a,
|
|
598
|
-
onAdd: y,
|
|
599
|
-
onRemove: m,
|
|
600
|
-
onVote: v,
|
|
601
|
-
onSearch: _,
|
|
602
|
-
showQueue: g = !0,
|
|
603
|
-
readOnly: S = !1,
|
|
604
|
-
className: N,
|
|
605
|
-
style: f
|
|
606
|
-
} = x, [C, s] = w(""), u = R(() => {
|
|
607
|
-
if (!C.trim()) return a;
|
|
608
|
-
const n = C.toLowerCase();
|
|
609
|
-
return a.filter(
|
|
610
|
-
(d) => d.title.toLowerCase().includes(n) || d.artist.toLowerCase().includes(n)
|
|
611
|
-
);
|
|
612
|
-
}, [a, C]), k = R(() => a.filter((n) => n.isQueued), [a]), b = a.find((n) => n.isPlaying), p = (n) => {
|
|
613
|
-
s(n), _ == null || _(n);
|
|
614
|
-
}, c = (n) => {
|
|
615
|
-
if (!n) return "";
|
|
616
|
-
const d = Math.floor(n / 60), i = n % 60;
|
|
617
|
-
return `${d}:${i.toString().padStart(2, "0")}`;
|
|
618
|
-
};
|
|
619
|
-
return /* @__PURE__ */ t("div", { ref: A, className: `nice-song-picker ${N ?? ""}`, style: f, children: [
|
|
620
|
-
b && /* @__PURE__ */ t("div", { className: "nice-song-picker__now-playing", children: [
|
|
621
|
-
/* @__PURE__ */ e("span", { className: "nice-song-picker__np-label", children: "๐ต Now Playing" }),
|
|
622
|
-
b.albumArt && /* @__PURE__ */ e("img", { src: b.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
623
|
-
/* @__PURE__ */ e("strong", { children: b.title }),
|
|
624
|
-
/* @__PURE__ */ e("span", { children: b.artist })
|
|
625
|
-
] }),
|
|
626
|
-
/* @__PURE__ */ e(
|
|
627
|
-
"input",
|
|
628
|
-
{
|
|
629
|
-
type: "text",
|
|
630
|
-
value: C,
|
|
631
|
-
onChange: (n) => p(n.target.value),
|
|
632
|
-
placeholder: "Search songsโฆ",
|
|
633
|
-
className: "nice-song-picker__search"
|
|
793
|
+
v && (a.status === "active" || a.status === "voting") && c.length > 0 && /* @__PURE__ */ t("div", { className: "nice-round-card__score-input", children: [
|
|
794
|
+
/* @__PURE__ */ e("h4", { children: "Submit Scores" }),
|
|
795
|
+
c.map((n) => /* @__PURE__ */ t("div", { className: "nice-round-card__score-row", children: [
|
|
796
|
+
/* @__PURE__ */ e("span", { children: n.participantName }),
|
|
797
|
+
/* @__PURE__ */ e(
|
|
798
|
+
"input",
|
|
799
|
+
{
|
|
800
|
+
type: "number",
|
|
801
|
+
value: u[n.participantId] ?? "",
|
|
802
|
+
onChange: (d) => k((i) => ({ ...i, [n.participantId]: d.target.value })),
|
|
803
|
+
min: 0,
|
|
804
|
+
step: 1,
|
|
805
|
+
placeholder: "Score"
|
|
806
|
+
}
|
|
807
|
+
),
|
|
808
|
+
/* @__PURE__ */ e("button", { onClick: () => b(n.participantId), children: "Submit" })
|
|
809
|
+
] }, n.participantId))
|
|
810
|
+
] }),
|
|
811
|
+
/* @__PURE__ */ t("div", { className: "nice-round-card__footer", children: [
|
|
812
|
+
N && /* @__PURE__ */ t("div", { className: "nice-round-card__actions", children: [
|
|
813
|
+
a.status === "upcoming" && _ && /* @__PURE__ */ e("button", { onClick: _, children: "โถ Start Round" }),
|
|
814
|
+
(a.status === "active" || a.status === "voting") && g && /* @__PURE__ */ e("button", { onClick: g, children: "โน End Round" }),
|
|
815
|
+
a.status === "upcoming" && S && /* @__PURE__ */ e("button", { onClick: S, children: "โญ Skip" })
|
|
816
|
+
] }),
|
|
817
|
+
f
|
|
818
|
+
] }),
|
|
819
|
+
a.winnerIds && a.winnerIds.length > 0 && /* @__PURE__ */ t("div", { className: "nice-round-card__winners", children: [
|
|
820
|
+
"๐ Winners: ",
|
|
821
|
+
a.winnerIds.length
|
|
822
|
+
] })
|
|
823
|
+
]
|
|
634
824
|
}
|
|
635
|
-
)
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
] }, n.id)) }),
|
|
656
|
-
g && k.length > 0 && /* @__PURE__ */ t("div", { className: "nice-song-picker__queue", children: [
|
|
657
|
-
/* @__PURE__ */ t("h4", { children: [
|
|
658
|
-
"Queue (",
|
|
659
|
-
k.length,
|
|
660
|
-
")"
|
|
661
|
-
] }),
|
|
662
|
-
k.map((n, d) => /* @__PURE__ */ t("div", { className: "nice-song-picker__queue-item", children: [
|
|
663
|
-
/* @__PURE__ */ t("span", { className: "nice-song-picker__queue-pos", children: [
|
|
664
|
-
d + 1,
|
|
665
|
-
"."
|
|
666
|
-
] }),
|
|
667
|
-
/* @__PURE__ */ t("span", { children: [
|
|
668
|
-
n.title,
|
|
669
|
-
" โ ",
|
|
670
|
-
n.artist
|
|
671
|
-
] })
|
|
672
|
-
] }, n.id))
|
|
673
|
-
] })
|
|
674
|
-
] });
|
|
675
|
-
}), Ie = P(function(x, A) {
|
|
676
|
-
const {
|
|
677
|
-
songs: a,
|
|
678
|
-
queue: y = [],
|
|
679
|
-
onEnqueue: m,
|
|
680
|
-
onDequeue: v,
|
|
681
|
-
onNext: _,
|
|
682
|
-
nowPlayingId: g,
|
|
683
|
-
readOnly: S = !1,
|
|
684
|
-
className: N,
|
|
685
|
-
style: f
|
|
686
|
-
} = x, [C, s] = w(""), [u, k] = w(""), b = a.find((i) => i.id === g), p = R(() => {
|
|
687
|
-
let i = a;
|
|
688
|
-
if (C.trim()) {
|
|
689
|
-
const h = C.toLowerCase();
|
|
690
|
-
i = i.filter(
|
|
691
|
-
(l) => l.title.toLowerCase().includes(h) || l.artist.toLowerCase().includes(h)
|
|
825
|
+
);
|
|
826
|
+
}
|
|
827
|
+
), Ae = P(
|
|
828
|
+
function(x, A) {
|
|
829
|
+
const {
|
|
830
|
+
songs: a,
|
|
831
|
+
onAdd: y,
|
|
832
|
+
onRemove: m,
|
|
833
|
+
onVote: v,
|
|
834
|
+
onSearch: _,
|
|
835
|
+
showQueue: g = !0,
|
|
836
|
+
readOnly: S = !1,
|
|
837
|
+
className: N,
|
|
838
|
+
style: f
|
|
839
|
+
} = x, [C, s] = w(""), u = R(() => {
|
|
840
|
+
if (!C.trim())
|
|
841
|
+
return a;
|
|
842
|
+
const n = C.toLowerCase();
|
|
843
|
+
return a.filter(
|
|
844
|
+
(d) => d.title.toLowerCase().includes(n) || d.artist.toLowerCase().includes(n)
|
|
692
845
|
);
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
default:
|
|
706
|
-
return "#999";
|
|
707
|
-
}
|
|
708
|
-
};
|
|
709
|
-
return /* @__PURE__ */ t("div", { ref: A, className: `nice-karaoke-picker ${N ?? ""}`, style: f, children: [
|
|
710
|
-
b && /* @__PURE__ */ t("div", { className: "nice-karaoke-picker__now-singing", style: { borderLeft: "4px solid #e91e63", padding: "12px", marginBottom: 12, background: "#fce4ec" }, children: [
|
|
711
|
-
/* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "๐ค Now Singing" }),
|
|
712
|
-
/* @__PURE__ */ t("div", { children: [
|
|
846
|
+
}, [a, C]), k = R(() => a.filter((n) => n.isQueued), [a]), b = a.find((n) => n.isPlaying), p = (n) => {
|
|
847
|
+
s(n), _ == null || _(n);
|
|
848
|
+
}, c = (n) => {
|
|
849
|
+
if (!n)
|
|
850
|
+
return "";
|
|
851
|
+
const d = Math.floor(n / 60), i = n % 60;
|
|
852
|
+
return `${d}:${i.toString().padStart(2, "0")}`;
|
|
853
|
+
};
|
|
854
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-song-picker ${N ?? ""}`, style: f, children: [
|
|
855
|
+
b && /* @__PURE__ */ t("div", { className: "nice-song-picker__now-playing", children: [
|
|
856
|
+
/* @__PURE__ */ e("span", { className: "nice-song-picker__np-label", children: "๐ต Now Playing" }),
|
|
857
|
+
b.albumArt && /* @__PURE__ */ e("img", { src: b.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
713
858
|
/* @__PURE__ */ e("strong", { children: b.title }),
|
|
714
|
-
|
|
715
|
-
b.artist,
|
|
716
|
-
b.performerName && /* @__PURE__ */ t("span", { children: [
|
|
717
|
-
" (by ",
|
|
718
|
-
b.performerName,
|
|
719
|
-
")"
|
|
720
|
-
] })
|
|
859
|
+
/* @__PURE__ */ e("span", { children: b.artist })
|
|
721
860
|
] }),
|
|
722
|
-
!S && _ && /* @__PURE__ */ e("button", { onClick: _, style: { marginTop: 8 }, children: "Skip / Next โญ" })
|
|
723
|
-
] }),
|
|
724
|
-
/* @__PURE__ */ t("div", { className: "nice-karaoke-picker__filters", style: { display: "flex", gap: 8, marginBottom: 12 }, children: [
|
|
725
861
|
/* @__PURE__ */ e(
|
|
726
862
|
"input",
|
|
727
863
|
{
|
|
728
864
|
type: "text",
|
|
729
865
|
value: C,
|
|
730
|
-
onChange: (
|
|
731
|
-
placeholder: "Search songs
|
|
732
|
-
|
|
866
|
+
onChange: (n) => p(n.target.value),
|
|
867
|
+
placeholder: "Search songsโฆ",
|
|
868
|
+
className: "nice-song-picker__search"
|
|
733
869
|
}
|
|
734
870
|
),
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
871
|
+
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: "No songs found." }) : u.map((n) => /* @__PURE__ */ t(
|
|
872
|
+
"div",
|
|
873
|
+
{
|
|
874
|
+
className: `nice-song-picker__item ${n.isPlaying ? "nice-song-picker__item--playing" : ""}`,
|
|
875
|
+
children: [
|
|
876
|
+
n.albumArt && /* @__PURE__ */ e("img", { src: n.albumArt, alt: "", className: "nice-song-picker__thumb" }),
|
|
877
|
+
/* @__PURE__ */ t("div", { className: "nice-song-picker__info", children: [
|
|
878
|
+
/* @__PURE__ */ e("strong", { children: n.title }),
|
|
879
|
+
/* @__PURE__ */ e("span", { children: n.artist }),
|
|
880
|
+
n.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children: c(n.duration) }),
|
|
881
|
+
n.addedByName && /* @__PURE__ */ t("small", { children: [
|
|
882
|
+
"Added by ",
|
|
883
|
+
n.addedByName
|
|
884
|
+
] })
|
|
885
|
+
] }),
|
|
886
|
+
!S && /* @__PURE__ */ t("div", { className: "nice-song-picker__actions", children: [
|
|
887
|
+
v && /* @__PURE__ */ t("button", { onClick: () => v(n.id), children: [
|
|
888
|
+
"๐ ",
|
|
889
|
+
n.votes ?? 0
|
|
890
|
+
] }),
|
|
891
|
+
y && !n.isQueued && /* @__PURE__ */ e("button", { onClick: () => y(n.id), children: "+ Queue" }),
|
|
892
|
+
m && n.isQueued && /* @__PURE__ */ e("button", { onClick: () => m(n.id), children: "Remove" })
|
|
893
|
+
] })
|
|
894
|
+
]
|
|
895
|
+
},
|
|
896
|
+
n.id
|
|
897
|
+
)) }),
|
|
898
|
+
g && k.length > 0 && /* @__PURE__ */ t("div", { className: "nice-song-picker__queue", children: [
|
|
899
|
+
/* @__PURE__ */ t("h4", { children: [
|
|
900
|
+
"Queue (",
|
|
901
|
+
k.length,
|
|
754
902
|
")"
|
|
755
|
-
] })
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
y.length > 0 && /* @__PURE__ */ t("div", { className: "nice-karaoke-picker__queue", style: { marginTop: 16 }, children: [
|
|
760
|
-
/* @__PURE__ */ t("h4", { children: [
|
|
761
|
-
"๐ถ Queue (",
|
|
762
|
-
y.length,
|
|
763
|
-
")"
|
|
764
|
-
] }),
|
|
765
|
-
y.map((i, h) => /* @__PURE__ */ t("div", { style: { display: "flex", justifyContent: "space-between", padding: "4px 0" }, children: [
|
|
766
|
-
/* @__PURE__ */ t("span", { children: [
|
|
767
|
-
/* @__PURE__ */ t("strong", { children: [
|
|
768
|
-
h + 1,
|
|
903
|
+
] }),
|
|
904
|
+
k.map((n, d) => /* @__PURE__ */ t("div", { className: "nice-song-picker__queue-item", children: [
|
|
905
|
+
/* @__PURE__ */ t("span", { className: "nice-song-picker__queue-pos", children: [
|
|
906
|
+
d + 1,
|
|
769
907
|
"."
|
|
770
908
|
] }),
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
i.performerName && /* @__PURE__ */ t("em", { children: [
|
|
776
|
-
" (",
|
|
777
|
-
i.performerName,
|
|
778
|
-
")"
|
|
909
|
+
/* @__PURE__ */ t("span", { children: [
|
|
910
|
+
n.title,
|
|
911
|
+
" โ ",
|
|
912
|
+
n.artist
|
|
779
913
|
] })
|
|
914
|
+
] }, n.id))
|
|
915
|
+
] })
|
|
916
|
+
] });
|
|
917
|
+
}
|
|
918
|
+
), Ie = P(
|
|
919
|
+
function(x, A) {
|
|
920
|
+
const {
|
|
921
|
+
songs: a,
|
|
922
|
+
queue: y = [],
|
|
923
|
+
onEnqueue: m,
|
|
924
|
+
onDequeue: v,
|
|
925
|
+
onNext: _,
|
|
926
|
+
nowPlayingId: g,
|
|
927
|
+
readOnly: S = !1,
|
|
928
|
+
className: N,
|
|
929
|
+
style: f
|
|
930
|
+
} = x, [C, s] = w(""), [u, k] = w(""), b = a.find((i) => i.id === g), p = R(() => {
|
|
931
|
+
let i = a;
|
|
932
|
+
if (C.trim()) {
|
|
933
|
+
const h = C.toLowerCase();
|
|
934
|
+
i = i.filter(
|
|
935
|
+
(l) => l.title.toLowerCase().includes(h) || l.artist.toLowerCase().includes(h)
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
return u && (i = i.filter((h) => h.difficulty === u)), i;
|
|
939
|
+
}, [a, C, u]), c = R(() => new Set(y.map((i) => i.id)), [y]), n = ["easy", "medium", "hard", "expert"], d = (i) => {
|
|
940
|
+
switch (i) {
|
|
941
|
+
case "easy":
|
|
942
|
+
return "#4caf50";
|
|
943
|
+
case "medium":
|
|
944
|
+
return "#ff9800";
|
|
945
|
+
case "hard":
|
|
946
|
+
return "#f44336";
|
|
947
|
+
case "expert":
|
|
948
|
+
return "#9c27b0";
|
|
949
|
+
default:
|
|
950
|
+
return "#999";
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-karaoke-picker ${N ?? ""}`, style: f, children: [
|
|
954
|
+
b && /* @__PURE__ */ t(
|
|
955
|
+
"div",
|
|
956
|
+
{
|
|
957
|
+
className: "nice-karaoke-picker__now-singing",
|
|
958
|
+
style: {
|
|
959
|
+
borderLeft: "4px solid #e91e63",
|
|
960
|
+
padding: "12px",
|
|
961
|
+
marginBottom: 12,
|
|
962
|
+
background: "#fce4ec"
|
|
963
|
+
},
|
|
964
|
+
children: [
|
|
965
|
+
/* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "๐ค Now Singing" }),
|
|
966
|
+
/* @__PURE__ */ t("div", { children: [
|
|
967
|
+
/* @__PURE__ */ e("strong", { children: b.title }),
|
|
968
|
+
" โ ",
|
|
969
|
+
b.artist,
|
|
970
|
+
b.performerName && /* @__PURE__ */ t("span", { children: [
|
|
971
|
+
" (by ",
|
|
972
|
+
b.performerName,
|
|
973
|
+
")"
|
|
974
|
+
] })
|
|
975
|
+
] }),
|
|
976
|
+
!S && _ && /* @__PURE__ */ e("button", { onClick: _, style: { marginTop: 8 }, children: "Skip / Next โญ" })
|
|
977
|
+
]
|
|
978
|
+
}
|
|
979
|
+
),
|
|
980
|
+
/* @__PURE__ */ t(
|
|
981
|
+
"div",
|
|
982
|
+
{
|
|
983
|
+
className: "nice-karaoke-picker__filters",
|
|
984
|
+
style: { display: "flex", gap: 8, marginBottom: 12 },
|
|
985
|
+
children: [
|
|
986
|
+
/* @__PURE__ */ e(
|
|
987
|
+
"input",
|
|
988
|
+
{
|
|
989
|
+
type: "text",
|
|
990
|
+
value: C,
|
|
991
|
+
onChange: (i) => s(i.target.value),
|
|
992
|
+
placeholder: "Search songs or artistsโฆ",
|
|
993
|
+
style: { flex: 1 }
|
|
994
|
+
}
|
|
995
|
+
),
|
|
996
|
+
/* @__PURE__ */ t("select", { value: u, onChange: (i) => k(i.target.value), children: [
|
|
997
|
+
/* @__PURE__ */ e("option", { value: "", children: "All Difficulties" }),
|
|
998
|
+
n.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
|
|
999
|
+
] })
|
|
1000
|
+
]
|
|
1001
|
+
}
|
|
1002
|
+
),
|
|
1003
|
+
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: p.length === 0 ? /* @__PURE__ */ e("p", { children: "No songs match your search." }) : p.map((i) => /* @__PURE__ */ t(
|
|
1004
|
+
"div",
|
|
1005
|
+
{
|
|
1006
|
+
className: "nice-karaoke-picker__song",
|
|
1007
|
+
style: {
|
|
1008
|
+
display: "flex",
|
|
1009
|
+
justifyContent: "space-between",
|
|
1010
|
+
alignItems: "center",
|
|
1011
|
+
padding: "8px 0",
|
|
1012
|
+
borderBottom: "1px solid #eee"
|
|
1013
|
+
},
|
|
1014
|
+
children: [
|
|
1015
|
+
/* @__PURE__ */ t("div", { children: [
|
|
1016
|
+
/* @__PURE__ */ e("strong", { children: i.title }),
|
|
1017
|
+
" โ ",
|
|
1018
|
+
i.artist,
|
|
1019
|
+
i.difficulty && /* @__PURE__ */ t(
|
|
1020
|
+
"span",
|
|
1021
|
+
{
|
|
1022
|
+
style: {
|
|
1023
|
+
marginLeft: 8,
|
|
1024
|
+
fontSize: 12,
|
|
1025
|
+
color: d(i.difficulty),
|
|
1026
|
+
fontWeight: 600
|
|
1027
|
+
},
|
|
1028
|
+
children: [
|
|
1029
|
+
"[",
|
|
1030
|
+
i.difficulty,
|
|
1031
|
+
"]"
|
|
1032
|
+
]
|
|
1033
|
+
}
|
|
1034
|
+
),
|
|
1035
|
+
i.hasLyrics && /* @__PURE__ */ e("span", { style: { marginLeft: 6, fontSize: 12 }, title: "Lyrics available", children: "๐" }),
|
|
1036
|
+
i.language && /* @__PURE__ */ t("span", { style: { marginLeft: 6, fontSize: 12, color: "#666" }, children: [
|
|
1037
|
+
"(",
|
|
1038
|
+
i.language,
|
|
1039
|
+
")"
|
|
1040
|
+
] })
|
|
1041
|
+
] }),
|
|
1042
|
+
!S && /* @__PURE__ */ e("div", { children: c.has(i.id) ? /* @__PURE__ */ e("button", { onClick: () => v == null ? void 0 : v(i.id), style: { color: "#f44336" }, children: "Remove" }) : /* @__PURE__ */ e("button", { onClick: () => m == null ? void 0 : m(i.id), children: "๐ค Sing" }) })
|
|
1043
|
+
]
|
|
1044
|
+
},
|
|
1045
|
+
i.id
|
|
1046
|
+
)) }),
|
|
1047
|
+
y.length > 0 && /* @__PURE__ */ t("div", { className: "nice-karaoke-picker__queue", style: { marginTop: 16 }, children: [
|
|
1048
|
+
/* @__PURE__ */ t("h4", { children: [
|
|
1049
|
+
"๐ถ Queue (",
|
|
1050
|
+
y.length,
|
|
1051
|
+
")"
|
|
780
1052
|
] }),
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
1053
|
+
y.map((i, h) => /* @__PURE__ */ t(
|
|
1054
|
+
"div",
|
|
1055
|
+
{
|
|
1056
|
+
style: { display: "flex", justifyContent: "space-between", padding: "4px 0" },
|
|
1057
|
+
children: [
|
|
1058
|
+
/* @__PURE__ */ t("span", { children: [
|
|
1059
|
+
/* @__PURE__ */ t("strong", { children: [
|
|
1060
|
+
h + 1,
|
|
1061
|
+
"."
|
|
1062
|
+
] }),
|
|
1063
|
+
" ",
|
|
1064
|
+
i.title,
|
|
1065
|
+
" โ ",
|
|
1066
|
+
i.artist,
|
|
1067
|
+
i.performerName && /* @__PURE__ */ t("em", { children: [
|
|
1068
|
+
" (",
|
|
1069
|
+
i.performerName,
|
|
1070
|
+
")"
|
|
1071
|
+
] })
|
|
1072
|
+
] }),
|
|
1073
|
+
!S && v && /* @__PURE__ */ e("button", { onClick: () => v(i.id), style: { fontSize: 12 }, children: "โ" })
|
|
1074
|
+
]
|
|
1075
|
+
},
|
|
1076
|
+
i.id
|
|
1077
|
+
))
|
|
1078
|
+
] })
|
|
1079
|
+
] });
|
|
1080
|
+
}
|
|
1081
|
+
), ee = {
|
|
786
1082
|
game: "๐ฎ",
|
|
787
1083
|
music: "๐ต",
|
|
788
1084
|
dance: "๐",
|
|
@@ -798,130 +1094,173 @@ const be = P(function(x, A) {
|
|
|
798
1094
|
karaoke: "Karaoke",
|
|
799
1095
|
photo: "Photo",
|
|
800
1096
|
custom: "Custom"
|
|
801
|
-
}, Re = P(
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
/* @__PURE__ */ t("div", {
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
|
|
836
|
-
c.size,
|
|
837
|
-
"/",
|
|
838
|
-
g,
|
|
839
|
-
" selected"
|
|
840
|
-
] })
|
|
841
|
-
] }),
|
|
842
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 8, marginBottom: 12, flexWrap: "wrap" }, children: [
|
|
843
|
-
/* @__PURE__ */ e(
|
|
844
|
-
"input",
|
|
1097
|
+
}, Re = P(
|
|
1098
|
+
function(x, A) {
|
|
1099
|
+
const {
|
|
1100
|
+
attractions: a,
|
|
1101
|
+
onSelect: y,
|
|
1102
|
+
onDeselect: m,
|
|
1103
|
+
onVote: v,
|
|
1104
|
+
selectedIds: _ = [],
|
|
1105
|
+
maxSelections: g,
|
|
1106
|
+
showVotes: S = !0,
|
|
1107
|
+
readOnly: N = !1,
|
|
1108
|
+
layout: f = "grid",
|
|
1109
|
+
className: C,
|
|
1110
|
+
style: s
|
|
1111
|
+
} = x, [u, k] = w(""), [b, p] = w(""), c = R(() => new Set(_), [_]), n = R(() => {
|
|
1112
|
+
const l = new Set(a.map((o) => o.category));
|
|
1113
|
+
return Array.from(l);
|
|
1114
|
+
}, [a]), d = R(() => {
|
|
1115
|
+
let l = a;
|
|
1116
|
+
if (u && (l = l.filter((o) => o.category === u)), b.trim()) {
|
|
1117
|
+
const o = b.toLowerCase();
|
|
1118
|
+
l = l.filter(
|
|
1119
|
+
(I) => {
|
|
1120
|
+
var O;
|
|
1121
|
+
return I.name.toLowerCase().includes(o) || ((O = I.description) == null ? void 0 : O.toLowerCase().includes(o));
|
|
1122
|
+
}
|
|
1123
|
+
);
|
|
1124
|
+
}
|
|
1125
|
+
return l;
|
|
1126
|
+
}, [a, u, b]), i = !g || c.size < g, h = (l) => {
|
|
1127
|
+
N || (c.has(l) ? m == null || m(l) : i && (y == null || y(l)));
|
|
1128
|
+
};
|
|
1129
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-attraction-picker ${C ?? ""}`, style: s, children: [
|
|
1130
|
+
/* @__PURE__ */ t(
|
|
1131
|
+
"div",
|
|
845
1132
|
{
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1133
|
+
style: {
|
|
1134
|
+
display: "flex",
|
|
1135
|
+
justifyContent: "space-between",
|
|
1136
|
+
alignItems: "center",
|
|
1137
|
+
marginBottom: 12
|
|
1138
|
+
},
|
|
1139
|
+
children: [
|
|
1140
|
+
/* @__PURE__ */ e("h3", { style: { margin: 0 }, children: "Attractions" }),
|
|
1141
|
+
g && /* @__PURE__ */ t("span", { style: { color: "#666", fontSize: 14 }, children: [
|
|
1142
|
+
c.size,
|
|
1143
|
+
"/",
|
|
1144
|
+
g,
|
|
1145
|
+
" selected"
|
|
1146
|
+
] })
|
|
1147
|
+
]
|
|
851
1148
|
}
|
|
852
1149
|
),
|
|
1150
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 8, marginBottom: 12, flexWrap: "wrap" }, children: [
|
|
1151
|
+
/* @__PURE__ */ e(
|
|
1152
|
+
"input",
|
|
1153
|
+
{
|
|
1154
|
+
type: "text",
|
|
1155
|
+
value: b,
|
|
1156
|
+
onChange: (l) => p(l.target.value),
|
|
1157
|
+
placeholder: "Search attractionsโฆ",
|
|
1158
|
+
style: { flex: 1, minWidth: 150 }
|
|
1159
|
+
}
|
|
1160
|
+
),
|
|
1161
|
+
/* @__PURE__ */ e(
|
|
1162
|
+
"button",
|
|
1163
|
+
{
|
|
1164
|
+
onClick: () => k(""),
|
|
1165
|
+
style: { fontWeight: u ? 400 : 700 },
|
|
1166
|
+
children: "All"
|
|
1167
|
+
}
|
|
1168
|
+
),
|
|
1169
|
+
n.map((l) => /* @__PURE__ */ t(
|
|
1170
|
+
"button",
|
|
1171
|
+
{
|
|
1172
|
+
onClick: () => k(l === u ? "" : l),
|
|
1173
|
+
style: { fontWeight: l === u ? 700 : 400 },
|
|
1174
|
+
children: [
|
|
1175
|
+
ee[l],
|
|
1176
|
+
" ",
|
|
1177
|
+
_e[l]
|
|
1178
|
+
]
|
|
1179
|
+
},
|
|
1180
|
+
l
|
|
1181
|
+
))
|
|
1182
|
+
] }),
|
|
853
1183
|
/* @__PURE__ */ e(
|
|
854
|
-
"button",
|
|
855
|
-
{
|
|
856
|
-
onClick: () => k(""),
|
|
857
|
-
style: { fontWeight: u ? 400 : 700 },
|
|
858
|
-
children: "All"
|
|
859
|
-
}
|
|
860
|
-
),
|
|
861
|
-
n.map((l) => /* @__PURE__ */ t(
|
|
862
|
-
"button",
|
|
863
|
-
{
|
|
864
|
-
onClick: () => k(l === u ? "" : l),
|
|
865
|
-
style: { fontWeight: l === u ? 700 : 400 },
|
|
866
|
-
children: [
|
|
867
|
-
ee[l],
|
|
868
|
-
" ",
|
|
869
|
-
_e[l]
|
|
870
|
-
]
|
|
871
|
-
},
|
|
872
|
-
l
|
|
873
|
-
))
|
|
874
|
-
] }),
|
|
875
|
-
/* @__PURE__ */ e("div", { style: {
|
|
876
|
-
display: f === "grid" ? "grid" : "flex",
|
|
877
|
-
gridTemplateColumns: f === "grid" ? "repeat(auto-fill, minmax(200px, 1fr))" : void 0,
|
|
878
|
-
gap: 12,
|
|
879
|
-
flexDirection: f === "list" ? "column" : void 0
|
|
880
|
-
}, children: d.length === 0 ? /* @__PURE__ */ e("p", { children: "No attractions found." }) : d.map((l) => {
|
|
881
|
-
const o = c.has(l.id);
|
|
882
|
-
return /* @__PURE__ */ t(
|
|
883
1184
|
"div",
|
|
884
1185
|
{
|
|
885
|
-
className: "nice-attraction-picker__card",
|
|
886
1186
|
style: {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
background: o ? "#e3f2fd" : "#fff",
|
|
892
|
-
transition: "all 0.2s"
|
|
1187
|
+
display: f === "grid" ? "grid" : "flex",
|
|
1188
|
+
gridTemplateColumns: f === "grid" ? "repeat(auto-fill, minmax(200px, 1fr))" : void 0,
|
|
1189
|
+
gap: 12,
|
|
1190
|
+
flexDirection: f === "list" ? "column" : void 0
|
|
893
1191
|
},
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1192
|
+
children: d.length === 0 ? /* @__PURE__ */ e("p", { children: "No attractions found." }) : d.map((l) => {
|
|
1193
|
+
const o = c.has(l.id);
|
|
1194
|
+
return /* @__PURE__ */ t(
|
|
1195
|
+
"div",
|
|
1196
|
+
{
|
|
1197
|
+
className: "nice-attraction-picker__card",
|
|
1198
|
+
style: {
|
|
1199
|
+
border: o ? "2px solid #1976d2" : "1px solid #ddd",
|
|
1200
|
+
borderRadius: 8,
|
|
1201
|
+
padding: 12,
|
|
1202
|
+
cursor: N ? "default" : "pointer",
|
|
1203
|
+
background: o ? "#e3f2fd" : "#fff",
|
|
1204
|
+
transition: "all 0.2s"
|
|
1205
|
+
},
|
|
1206
|
+
onClick: () => h(l.id),
|
|
1207
|
+
children: [
|
|
1208
|
+
l.imageUrl && /* @__PURE__ */ e(
|
|
1209
|
+
"img",
|
|
1210
|
+
{
|
|
1211
|
+
src: l.imageUrl,
|
|
1212
|
+
alt: l.name,
|
|
1213
|
+
style: {
|
|
1214
|
+
width: "100%",
|
|
1215
|
+
borderRadius: 6,
|
|
1216
|
+
marginBottom: 8,
|
|
1217
|
+
objectFit: "cover",
|
|
1218
|
+
maxHeight: 120
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
),
|
|
1222
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
1223
|
+
/* @__PURE__ */ e("span", { children: ee[l.category] }),
|
|
1224
|
+
/* @__PURE__ */ e("strong", { children: l.name })
|
|
1225
|
+
] }),
|
|
1226
|
+
l.description && /* @__PURE__ */ e("p", { style: { fontSize: 13, color: "#666", margin: "6px 0" }, children: l.description }),
|
|
1227
|
+
/* @__PURE__ */ t(
|
|
1228
|
+
"div",
|
|
1229
|
+
{
|
|
1230
|
+
style: {
|
|
1231
|
+
display: "flex",
|
|
1232
|
+
justifyContent: "space-between",
|
|
1233
|
+
alignItems: "center",
|
|
1234
|
+
marginTop: 8
|
|
1235
|
+
},
|
|
1236
|
+
children: [
|
|
1237
|
+
S && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: [
|
|
1238
|
+
"๐ ",
|
|
1239
|
+
l.votes ?? 0
|
|
1240
|
+
] }),
|
|
1241
|
+
!N && v && /* @__PURE__ */ e(
|
|
1242
|
+
"button",
|
|
1243
|
+
{
|
|
1244
|
+
onClick: (I) => {
|
|
1245
|
+
I.stopPropagation(), v(l.id);
|
|
1246
|
+
},
|
|
1247
|
+
style: { fontSize: 12 },
|
|
1248
|
+
children: "Vote"
|
|
1249
|
+
}
|
|
1250
|
+
)
|
|
1251
|
+
]
|
|
1252
|
+
}
|
|
1253
|
+
)
|
|
1254
|
+
]
|
|
1255
|
+
},
|
|
1256
|
+
l.id
|
|
1257
|
+
);
|
|
1258
|
+
})
|
|
1259
|
+
}
|
|
1260
|
+
)
|
|
1261
|
+
] });
|
|
1262
|
+
}
|
|
1263
|
+
), fe = {
|
|
925
1264
|
game: "๐ฎ",
|
|
926
1265
|
music: "๐ต",
|
|
927
1266
|
dance: "๐",
|
|
@@ -929,112 +1268,163 @@ const be = P(function(x, A) {
|
|
|
929
1268
|
karaoke: "๐ค",
|
|
930
1269
|
photo: "๐ธ",
|
|
931
1270
|
custom: "โจ"
|
|
932
|
-
}, Pe = P(
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
u !== 1 ? "s" : "",
|
|
979
|
-
" remaining"
|
|
980
|
-
] })
|
|
981
|
-
] }),
|
|
982
|
-
g && /* @__PURE__ */ e("p", { style: { color: "#666", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
983
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: k.map((n, d) => {
|
|
984
|
-
const i = s.has(n.id), h = n.votes ?? 0, l = N ? `${Math.round(h / b * 100)}%` : "0%";
|
|
985
|
-
return /* @__PURE__ */ t(
|
|
1271
|
+
}, Pe = P(
|
|
1272
|
+
function(x, A) {
|
|
1273
|
+
const {
|
|
1274
|
+
attractions: a,
|
|
1275
|
+
onVote: y,
|
|
1276
|
+
onUnvote: m,
|
|
1277
|
+
votedIds: v = [],
|
|
1278
|
+
maxVotes: _,
|
|
1279
|
+
closed: g = !1,
|
|
1280
|
+
sortBy: S = "votes",
|
|
1281
|
+
showResults: N = !0,
|
|
1282
|
+
className: f,
|
|
1283
|
+
style: C
|
|
1284
|
+
} = x, s = R(() => new Set(v), [v]), u = _ ? _ - s.size : void 0, k = R(() => {
|
|
1285
|
+
const n = [...a];
|
|
1286
|
+
switch (S) {
|
|
1287
|
+
case "votes":
|
|
1288
|
+
n.sort((d, i) => (i.votes ?? 0) - (d.votes ?? 0));
|
|
1289
|
+
break;
|
|
1290
|
+
case "name":
|
|
1291
|
+
n.sort((d, i) => d.name.localeCompare(i.name));
|
|
1292
|
+
break;
|
|
1293
|
+
case "category":
|
|
1294
|
+
n.sort((d, i) => d.category.localeCompare(i.category));
|
|
1295
|
+
break;
|
|
1296
|
+
}
|
|
1297
|
+
return n;
|
|
1298
|
+
}, [a, S]), b = R(
|
|
1299
|
+
() => Math.max(...a.map((n) => n.votes ?? 0), 1),
|
|
1300
|
+
[a]
|
|
1301
|
+
), p = (n) => {
|
|
1302
|
+
g || (s.has(n) ? m == null || m(n) : (!u || u > 0) && (y == null || y(n)));
|
|
1303
|
+
}, c = (n) => {
|
|
1304
|
+
switch (n) {
|
|
1305
|
+
case 0:
|
|
1306
|
+
return "๐ฅ";
|
|
1307
|
+
case 1:
|
|
1308
|
+
return "๐ฅ";
|
|
1309
|
+
case 2:
|
|
1310
|
+
return "๐ฅ";
|
|
1311
|
+
default:
|
|
1312
|
+
return `${n + 1}.`;
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1315
|
+
return /* @__PURE__ */ t("div", { ref: A, className: `nice-attraction-voting ${f ?? ""}`, style: C, children: [
|
|
1316
|
+
/* @__PURE__ */ t(
|
|
986
1317
|
"div",
|
|
987
1318
|
{
|
|
988
1319
|
style: {
|
|
989
1320
|
display: "flex",
|
|
1321
|
+
justifyContent: "space-between",
|
|
990
1322
|
alignItems: "center",
|
|
991
|
-
|
|
992
|
-
padding: "10px 14px",
|
|
993
|
-
borderRadius: 8,
|
|
994
|
-
border: i ? "2px solid #1976d2" : "1px solid #e0e0e0",
|
|
995
|
-
background: i ? "#e3f2fd" : "#fff",
|
|
996
|
-
cursor: g ? "default" : "pointer",
|
|
997
|
-
transition: "all 0.2s"
|
|
1323
|
+
marginBottom: 16
|
|
998
1324
|
},
|
|
999
|
-
onClick: () => p(n.id),
|
|
1000
1325
|
children: [
|
|
1001
|
-
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
] })
|
|
1008
|
-
N && /* @__PURE__ */ e("span", { style: { fontWeight: 600, fontSize: 16, minWidth: 40, textAlign: "right" }, children: h }),
|
|
1009
|
-
!g && /* @__PURE__ */ e(
|
|
1010
|
-
"button",
|
|
1011
|
-
{
|
|
1012
|
-
onClick: (o) => {
|
|
1013
|
-
o.stopPropagation(), p(n.id);
|
|
1014
|
-
},
|
|
1015
|
-
style: {
|
|
1016
|
-
padding: "4px 12px",
|
|
1017
|
-
borderRadius: 4,
|
|
1018
|
-
border: "none",
|
|
1019
|
-
background: i ? "#f44336" : "#1976d2",
|
|
1020
|
-
color: "#fff",
|
|
1021
|
-
cursor: "pointer",
|
|
1022
|
-
fontSize: 13
|
|
1023
|
-
},
|
|
1024
|
-
children: i ? "Unvote" : "Vote"
|
|
1025
|
-
}
|
|
1026
|
-
)
|
|
1326
|
+
/* @__PURE__ */ e("h3", { style: { margin: 0 }, children: g ? "๐ณ๏ธ Voting Results" : "๐ณ๏ธ Vote for Attractions" }),
|
|
1327
|
+
!g && u !== void 0 && /* @__PURE__ */ t("span", { style: { fontSize: 14, color: u > 0 ? "#1976d2" : "#f44336" }, children: [
|
|
1328
|
+
u,
|
|
1329
|
+
" vote",
|
|
1330
|
+
u !== 1 ? "s" : "",
|
|
1331
|
+
" remaining"
|
|
1332
|
+
] })
|
|
1027
1333
|
]
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
)
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1334
|
+
}
|
|
1335
|
+
),
|
|
1336
|
+
g && /* @__PURE__ */ e("p", { style: { color: "#666", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
1337
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: k.map((n, d) => {
|
|
1338
|
+
const i = s.has(n.id), h = n.votes ?? 0, l = N ? `${Math.round(h / b * 100)}%` : "0%";
|
|
1339
|
+
return /* @__PURE__ */ t(
|
|
1340
|
+
"div",
|
|
1341
|
+
{
|
|
1342
|
+
style: {
|
|
1343
|
+
display: "flex",
|
|
1344
|
+
alignItems: "center",
|
|
1345
|
+
gap: 12,
|
|
1346
|
+
padding: "10px 14px",
|
|
1347
|
+
borderRadius: 8,
|
|
1348
|
+
border: i ? "2px solid #1976d2" : "1px solid #e0e0e0",
|
|
1349
|
+
background: i ? "#e3f2fd" : "#fff",
|
|
1350
|
+
cursor: g ? "default" : "pointer",
|
|
1351
|
+
transition: "all 0.2s"
|
|
1352
|
+
},
|
|
1353
|
+
onClick: () => p(n.id),
|
|
1354
|
+
children: [
|
|
1355
|
+
N && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: c(d) }),
|
|
1356
|
+
/* @__PURE__ */ e("span", { style: { fontSize: 20 }, children: fe[n.category] }),
|
|
1357
|
+
/* @__PURE__ */ t("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1358
|
+
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: n.name }),
|
|
1359
|
+
n.description && /* @__PURE__ */ e(
|
|
1360
|
+
"div",
|
|
1361
|
+
{
|
|
1362
|
+
style: {
|
|
1363
|
+
fontSize: 13,
|
|
1364
|
+
color: "#666",
|
|
1365
|
+
overflow: "hidden",
|
|
1366
|
+
textOverflow: "ellipsis",
|
|
1367
|
+
whiteSpace: "nowrap"
|
|
1368
|
+
},
|
|
1369
|
+
children: n.description
|
|
1370
|
+
}
|
|
1371
|
+
),
|
|
1372
|
+
N && /* @__PURE__ */ e(
|
|
1373
|
+
"div",
|
|
1374
|
+
{
|
|
1375
|
+
style: {
|
|
1376
|
+
marginTop: 4,
|
|
1377
|
+
height: 6,
|
|
1378
|
+
borderRadius: 3,
|
|
1379
|
+
background: "#e0e0e0",
|
|
1380
|
+
overflow: "hidden"
|
|
1381
|
+
},
|
|
1382
|
+
children: /* @__PURE__ */ e(
|
|
1383
|
+
"div",
|
|
1384
|
+
{
|
|
1385
|
+
style: {
|
|
1386
|
+
height: "100%",
|
|
1387
|
+
width: l,
|
|
1388
|
+
background: "#1976d2",
|
|
1389
|
+
borderRadius: 3,
|
|
1390
|
+
transition: "width 0.3s"
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
)
|
|
1394
|
+
}
|
|
1395
|
+
)
|
|
1396
|
+
] }),
|
|
1397
|
+
N && /* @__PURE__ */ e("span", { style: { fontWeight: 600, fontSize: 16, minWidth: 40, textAlign: "right" }, children: h }),
|
|
1398
|
+
!g && /* @__PURE__ */ e(
|
|
1399
|
+
"button",
|
|
1400
|
+
{
|
|
1401
|
+
onClick: (o) => {
|
|
1402
|
+
o.stopPropagation(), p(n.id);
|
|
1403
|
+
},
|
|
1404
|
+
style: {
|
|
1405
|
+
padding: "4px 12px",
|
|
1406
|
+
borderRadius: 4,
|
|
1407
|
+
border: "none",
|
|
1408
|
+
background: i ? "#f44336" : "#1976d2",
|
|
1409
|
+
color: "#fff",
|
|
1410
|
+
cursor: "pointer",
|
|
1411
|
+
fontSize: 13
|
|
1412
|
+
},
|
|
1413
|
+
children: i ? "Unvote" : "Vote"
|
|
1414
|
+
}
|
|
1415
|
+
)
|
|
1416
|
+
]
|
|
1417
|
+
},
|
|
1418
|
+
n.id
|
|
1419
|
+
);
|
|
1420
|
+
}) }),
|
|
1421
|
+
N && /* @__PURE__ */ t("div", { style: { marginTop: 12, textAlign: "right", fontSize: 13, color: "#666" }, children: [
|
|
1422
|
+
"Total votes: ",
|
|
1423
|
+
a.reduce((n, d) => n + (d.votes ?? 0), 0)
|
|
1424
|
+
] })
|
|
1425
|
+
] });
|
|
1426
|
+
}
|
|
1427
|
+
);
|
|
1038
1428
|
export {
|
|
1039
1429
|
Re as NiceAttractionPicker,
|
|
1040
1430
|
Pe as NiceAttractionVoting,
|