@nice2dev/events 1.0.29 → 1.0.30
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 +52 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +450 -439
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { jsxs as i, jsx as e, Fragment as
|
|
2
|
-
import { NtdHeart as
|
|
3
|
-
import { NiceUpload as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as nn } from "react/jsx-runtime";
|
|
2
|
+
import { NtdHeart as tn, NtdTrash as an, NtdPlay as ln, NtdImage as rn, NtdSparkle as fe, NtdCamera as Ne, NtdMicrophone as _e, NtdHelp as be, NtdMusic as q, NtdGamepad as ke, NtdThumbsUp as cn, NtdClipboardCheck as sn, NtdMedal as ue, NtdTrophy as on } from "@nice2dev/icons";
|
|
3
|
+
import { NiceUpload as dn, NiceTextInput as T, NiceCardGroup as mn, NiceAvatarGroup as he, NiceAvatar as Z, NiceBadge as W, NiceButton as B, NiceSelect as ve, NiceAmountBreakdown as pn, NiceToggle as ge, NiceTabs as un, NiceTextArea as hn } from "@nice2dev/ui";
|
|
4
|
+
import ne, { forwardRef as E, useState as f, useMemo as I, useCallback as O } from "react";
|
|
5
5
|
import { NiceIcon as L } from "@nice2dev/ui-core";
|
|
6
|
-
const
|
|
7
|
-
const [
|
|
8
|
-
return
|
|
6
|
+
const vn = ({ item: z }) => {
|
|
7
|
+
const [N, C] = f(!1), t = z.thumbnailUrl ?? z.url;
|
|
8
|
+
return z.type === "video" ? /* @__PURE__ */ e("div", { className: "nice-event-media__video-thumb", children: /* @__PURE__ */ e(ln, { size: 26 }) }) : N || !t ? /* @__PURE__ */ e("div", { className: "nice-event-media__broken", title: "Image unavailable", children: /* @__PURE__ */ e(rn, { size: 24 }) }) : /* @__PURE__ */ e(
|
|
9
9
|
"img",
|
|
10
10
|
{
|
|
11
11
|
src: t,
|
|
12
|
-
alt:
|
|
12
|
+
alt: z.caption ?? "",
|
|
13
13
|
className: "nice-event-media__thumb",
|
|
14
14
|
loading: "lazy",
|
|
15
|
-
onError: () =>
|
|
15
|
+
onError: () => C(!0)
|
|
16
16
|
}
|
|
17
17
|
);
|
|
18
|
-
},
|
|
19
|
-
function(
|
|
18
|
+
}, wn = E(
|
|
19
|
+
function(N, C) {
|
|
20
20
|
const {
|
|
21
21
|
items: t,
|
|
22
22
|
onUpload: p,
|
|
23
23
|
onDelete: u,
|
|
24
24
|
onLike: m,
|
|
25
|
-
onItemClick:
|
|
26
|
-
layout:
|
|
27
|
-
uploadEnabled:
|
|
28
|
-
typeFilter:
|
|
29
|
-
className:
|
|
30
|
-
style:
|
|
31
|
-
} =
|
|
25
|
+
onItemClick: h,
|
|
26
|
+
layout: v = "grid",
|
|
27
|
+
uploadEnabled: _ = !0,
|
|
28
|
+
typeFilter: g = "all",
|
|
29
|
+
className: S,
|
|
30
|
+
style: b
|
|
31
|
+
} = N, [l, o] = f(""), k = I(() => g === "all" ? t : t.filter((d) => d.type === g), [t, g]), y = (d) => {
|
|
32
32
|
const n = d[0];
|
|
33
|
-
!n || !p || (p(n,
|
|
34
|
-
},
|
|
33
|
+
!n || !p || (p(n, l.trim() || void 0), o(""));
|
|
34
|
+
}, x = v === "list";
|
|
35
35
|
return /* @__PURE__ */ i(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
|
-
ref:
|
|
39
|
-
className: `nice-event-media nice-event-media--${
|
|
40
|
-
style:
|
|
38
|
+
ref: C,
|
|
39
|
+
className: `nice-event-media nice-event-media--${v} ${S ?? ""}`,
|
|
40
|
+
style: b,
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ i("h3", { children: [
|
|
43
43
|
"Media (",
|
|
44
|
-
|
|
44
|
+
k.length,
|
|
45
45
|
")"
|
|
46
46
|
] }) }),
|
|
47
|
-
|
|
47
|
+
_ && p && /* @__PURE__ */ i("div", { className: "nice-event-media__upload", children: [
|
|
48
48
|
/* @__PURE__ */ e(
|
|
49
|
-
|
|
49
|
+
dn,
|
|
50
50
|
{
|
|
51
51
|
accept: "image/*,video/*",
|
|
52
52
|
multiple: !1,
|
|
53
53
|
imagePreview: !1,
|
|
54
|
-
onFilesSelected:
|
|
54
|
+
onFilesSelected: y
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
|
-
/* @__PURE__ */ e(T, { value:
|
|
57
|
+
/* @__PURE__ */ e(T, { value: l, onChange: o, placeholder: "Add a caption…" })
|
|
58
58
|
] }),
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
k.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-media__empty", children: "No media yet." }) : /* @__PURE__ */ e(
|
|
60
|
+
mn,
|
|
61
61
|
{
|
|
62
|
-
columns:
|
|
62
|
+
columns: x ? 1 : void 0,
|
|
63
63
|
minColumnWidth: 200,
|
|
64
64
|
gap: 12,
|
|
65
65
|
align: "stretch",
|
|
66
|
-
children:
|
|
66
|
+
children: k.map((d) => /* @__PURE__ */ i(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
|
-
className: `nice-event-media__card${
|
|
70
|
-
onClick: () =>
|
|
71
|
-
role:
|
|
72
|
-
tabIndex:
|
|
69
|
+
className: `nice-event-media__card${x ? " nice-event-media__card--row" : ""}`,
|
|
70
|
+
onClick: () => h == null ? void 0 : h(d),
|
|
71
|
+
role: h ? "button" : void 0,
|
|
72
|
+
tabIndex: h ? 0 : void 0,
|
|
73
73
|
children: [
|
|
74
|
-
/* @__PURE__ */ e(
|
|
74
|
+
/* @__PURE__ */ e(vn, { item: d }),
|
|
75
75
|
/* @__PURE__ */ i("div", { className: "nice-event-media__body", children: [
|
|
76
76
|
d.caption && /* @__PURE__ */ e("span", { className: "nice-event-media__caption", children: d.caption }),
|
|
77
77
|
d.uploadedByName && /* @__PURE__ */ e("span", { className: "nice-event-media__uploader", children: d.uploadedByName }),
|
|
@@ -86,7 +86,7 @@ const un = ({ item: w }) => {
|
|
|
86
86
|
},
|
|
87
87
|
"aria-label": "Like",
|
|
88
88
|
children: [
|
|
89
|
-
/* @__PURE__ */ e(
|
|
89
|
+
/* @__PURE__ */ e(tn, { size: 15 }),
|
|
90
90
|
" ",
|
|
91
91
|
d.likes ?? 0
|
|
92
92
|
]
|
|
@@ -101,7 +101,7 @@ const un = ({ item: w }) => {
|
|
|
101
101
|
n.stopPropagation(), u(d.id);
|
|
102
102
|
},
|
|
103
103
|
"aria-label": "Delete",
|
|
104
|
-
children: /* @__PURE__ */ e(
|
|
104
|
+
children: /* @__PURE__ */ e(an, { size: 15 })
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
] })
|
|
@@ -117,93 +117,95 @@ const un = ({ item: w }) => {
|
|
|
117
117
|
);
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
return ["active", "live", "published", "completed", "confirmed"].includes(
|
|
120
|
+
function ee(z) {
|
|
121
|
+
const N = z.toLowerCase();
|
|
122
|
+
return ["active", "live", "published", "completed", "confirmed"].includes(N) ? "success" : ["cancelled", "canceled", "rejected", "failed"].includes(N) ? "error" : ["scheduled", "pending", "planning"].includes(N) ? "info" : ["draft", "archived"].includes(N) ? "secondary" : "warning";
|
|
123
123
|
}
|
|
124
|
-
const
|
|
124
|
+
const gn = {
|
|
125
125
|
micro: [],
|
|
126
126
|
compact: ["details", "location", "budget"],
|
|
127
127
|
normal: ["details", "location", "participants", "surveys", "budget"],
|
|
128
128
|
full: ["details", "location", "participants", "surveys", "budget", "settings"]
|
|
129
|
-
},
|
|
130
|
-
function(
|
|
131
|
-
var
|
|
129
|
+
}, zn = E(
|
|
130
|
+
function(N, C) {
|
|
131
|
+
var ce, se, oe, de, me, pe;
|
|
132
132
|
const {
|
|
133
133
|
event: t,
|
|
134
134
|
participants: p = [],
|
|
135
135
|
surveys: u = [],
|
|
136
136
|
billing: m = [],
|
|
137
|
-
displayMode:
|
|
138
|
-
tabs:
|
|
139
|
-
activeTab:
|
|
140
|
-
onTabChange:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
137
|
+
displayMode: h = "normal",
|
|
138
|
+
tabs: v,
|
|
139
|
+
activeTab: _,
|
|
140
|
+
onTabChange: g,
|
|
141
|
+
tabsIconOnly: S = !0,
|
|
142
|
+
tabsCentered: b = "auto",
|
|
143
|
+
editable: l = !1,
|
|
144
|
+
onSave: o,
|
|
145
|
+
onPublish: k,
|
|
146
|
+
onShare: y,
|
|
147
|
+
onExport: x,
|
|
148
|
+
onUpdateEvent: d,
|
|
149
|
+
onUpdateLocation: n,
|
|
150
|
+
onAddSurvey: c,
|
|
151
|
+
onSurveyRespond: a,
|
|
152
|
+
onAddBilling: w,
|
|
153
|
+
className: s,
|
|
154
|
+
style: A
|
|
155
|
+
} = N, [P, V] = f(t.title), [M, Ce] = f(t.description ?? ""), [F, Se] = f(t.startDate ?? ""), [Q, xe] = f(t.endDate ?? ""), [j, we] = f(((ce = t.location) == null ? void 0 : ce.name) ?? ""), [G, ze] = f(((se = t.location) == null ? void 0 : se.address) ?? ""), [H, Ae] = f(((oe = t.location) == null ? void 0 : oe.virtualUrl) ?? ""), [U, Ie] = f(((de = t.location) == null ? void 0 : de.isVirtual) ?? !1), [$, ie] = f(""), [Y, Le] = f("single"), [K, te] = f(""), [D, ae] = f(""), [J, le] = f(""), [X, Te] = f("PLN"), re = v ?? gn[h], [Pe, Re] = f(re[0] ?? "details"), Be = _ ?? Pe, Ee = O(
|
|
156
|
+
(r) => {
|
|
157
|
+
const R = r;
|
|
158
|
+
_ === void 0 && Re(R), g == null || g(R);
|
|
157
159
|
},
|
|
158
|
-
[
|
|
159
|
-
),
|
|
160
|
-
|
|
161
|
-
title:
|
|
162
|
-
description:
|
|
163
|
-
startDate:
|
|
164
|
-
endDate:
|
|
160
|
+
[_, g]
|
|
161
|
+
), Oe = O(() => {
|
|
162
|
+
d == null || d({
|
|
163
|
+
title: P,
|
|
164
|
+
description: M || void 0,
|
|
165
|
+
startDate: F || void 0,
|
|
166
|
+
endDate: Q || void 0
|
|
165
167
|
});
|
|
166
|
-
}, [
|
|
167
|
-
|
|
168
|
-
name:
|
|
169
|
-
address:
|
|
170
|
-
virtualUrl:
|
|
171
|
-
isVirtual:
|
|
168
|
+
}, [P, M, F, Q, d]), $e = O(() => {
|
|
169
|
+
n == null || n({
|
|
170
|
+
name: j,
|
|
171
|
+
address: G || void 0,
|
|
172
|
+
virtualUrl: H || void 0,
|
|
173
|
+
isVirtual: U
|
|
172
174
|
});
|
|
173
|
-
}, [
|
|
174
|
-
if (
|
|
175
|
+
}, [j, G, H, U, n]), De = O(() => {
|
|
176
|
+
if (!$.trim() || !c)
|
|
175
177
|
return;
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
}, [
|
|
179
|
-
!D.trim() || !
|
|
178
|
+
const r = K.split(",").map((R) => R.trim()).filter(Boolean);
|
|
179
|
+
c($.trim(), Y, r.length > 0 ? r : void 0), ie(""), te("");
|
|
180
|
+
}, [$, Y, K, c]), Ve = O(() => {
|
|
181
|
+
!D.trim() || !w || (w({
|
|
180
182
|
label: D.trim(),
|
|
181
|
-
amount: parseFloat(
|
|
182
|
-
currency:
|
|
183
|
-
}),
|
|
184
|
-
}, [D,
|
|
185
|
-
() => m.map((
|
|
186
|
-
label:
|
|
187
|
-
amount:
|
|
183
|
+
amount: parseFloat(J) || 0,
|
|
184
|
+
currency: X
|
|
185
|
+
}), ae(""), le(""));
|
|
186
|
+
}, [D, J, X, w]), Me = I(
|
|
187
|
+
() => m.map((r) => ({
|
|
188
|
+
label: r.label,
|
|
189
|
+
amount: r.amount
|
|
188
190
|
})),
|
|
189
191
|
[m]
|
|
190
|
-
),
|
|
192
|
+
), Ue = I(() => m.reduce((r, R) => r + R.amount, 0), [m]), We = ((me = m[0]) == null ? void 0 : me.currency) ?? "PLN", qe = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
191
193
|
/* @__PURE__ */ e(
|
|
192
194
|
T,
|
|
193
195
|
{
|
|
194
196
|
label: "Title",
|
|
195
|
-
value:
|
|
196
|
-
onChange:
|
|
197
|
-
readOnly: !
|
|
197
|
+
value: P,
|
|
198
|
+
onChange: V,
|
|
199
|
+
readOnly: !l
|
|
198
200
|
}
|
|
199
201
|
),
|
|
200
202
|
/* @__PURE__ */ e(
|
|
201
|
-
|
|
203
|
+
hn,
|
|
202
204
|
{
|
|
203
205
|
label: "Description",
|
|
204
|
-
value:
|
|
205
|
-
onChange:
|
|
206
|
-
readOnly: !
|
|
206
|
+
value: M,
|
|
207
|
+
onChange: Ce,
|
|
208
|
+
readOnly: !l,
|
|
207
209
|
rows: 3
|
|
208
210
|
}
|
|
209
211
|
),
|
|
@@ -215,9 +217,9 @@ const hn = {
|
|
|
215
217
|
{
|
|
216
218
|
className: "nice-input",
|
|
217
219
|
type: "datetime-local",
|
|
218
|
-
value:
|
|
219
|
-
onChange: (
|
|
220
|
-
readOnly: !
|
|
220
|
+
value: F,
|
|
221
|
+
onChange: (r) => Se(r.target.value),
|
|
222
|
+
readOnly: !l
|
|
221
223
|
}
|
|
222
224
|
)
|
|
223
225
|
] }),
|
|
@@ -228,110 +230,110 @@ const hn = {
|
|
|
228
230
|
{
|
|
229
231
|
className: "nice-input",
|
|
230
232
|
type: "datetime-local",
|
|
231
|
-
value:
|
|
232
|
-
onChange: (
|
|
233
|
-
readOnly: !
|
|
233
|
+
value: Q,
|
|
234
|
+
onChange: (r) => xe(r.target.value),
|
|
235
|
+
readOnly: !l
|
|
234
236
|
}
|
|
235
237
|
)
|
|
236
238
|
] })
|
|
237
239
|
] }),
|
|
238
|
-
|
|
240
|
+
l && /* @__PURE__ */ e(
|
|
239
241
|
B,
|
|
240
242
|
{
|
|
241
243
|
variant: "primary",
|
|
242
244
|
leftIcon: /* @__PURE__ */ e(L, { name: "check", size: "sm" }),
|
|
243
|
-
onClick:
|
|
245
|
+
onClick: Oe,
|
|
244
246
|
children: "Save details"
|
|
245
247
|
}
|
|
246
248
|
)
|
|
247
|
-
] }),
|
|
249
|
+
] }), Fe = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
248
250
|
/* @__PURE__ */ e(
|
|
249
|
-
|
|
251
|
+
ge,
|
|
250
252
|
{
|
|
251
253
|
label: "Virtual event",
|
|
252
|
-
checked:
|
|
253
|
-
onChange:
|
|
254
|
-
disabled: !
|
|
254
|
+
checked: U,
|
|
255
|
+
onChange: Ie,
|
|
256
|
+
disabled: !l
|
|
255
257
|
}
|
|
256
258
|
),
|
|
257
259
|
/* @__PURE__ */ e(
|
|
258
260
|
T,
|
|
259
261
|
{
|
|
260
262
|
label: "Venue name",
|
|
261
|
-
value:
|
|
262
|
-
onChange:
|
|
263
|
-
readOnly: !
|
|
263
|
+
value: j,
|
|
264
|
+
onChange: we,
|
|
265
|
+
readOnly: !l
|
|
264
266
|
}
|
|
265
267
|
),
|
|
266
|
-
|
|
268
|
+
U ? /* @__PURE__ */ e(
|
|
267
269
|
T,
|
|
268
270
|
{
|
|
269
271
|
label: "Virtual URL",
|
|
270
|
-
value:
|
|
271
|
-
onChange:
|
|
272
|
-
readOnly: !
|
|
272
|
+
value: H,
|
|
273
|
+
onChange: Ae,
|
|
274
|
+
readOnly: !l
|
|
273
275
|
}
|
|
274
276
|
) : /* @__PURE__ */ e(
|
|
275
277
|
T,
|
|
276
278
|
{
|
|
277
279
|
label: "Address",
|
|
278
|
-
value:
|
|
279
|
-
onChange:
|
|
280
|
-
readOnly: !
|
|
280
|
+
value: G,
|
|
281
|
+
onChange: ze,
|
|
282
|
+
readOnly: !l
|
|
281
283
|
}
|
|
282
284
|
),
|
|
283
|
-
|
|
285
|
+
l && /* @__PURE__ */ e(
|
|
284
286
|
B,
|
|
285
287
|
{
|
|
286
288
|
variant: "primary",
|
|
287
289
|
leftIcon: /* @__PURE__ */ e(L, { name: "check", size: "sm" }),
|
|
288
|
-
onClick:
|
|
290
|
+
onClick: $e,
|
|
289
291
|
children: "Save location"
|
|
290
292
|
}
|
|
291
293
|
)
|
|
292
|
-
] }),
|
|
293
|
-
/* @__PURE__ */ e(
|
|
294
|
-
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: p.map((
|
|
295
|
-
/* @__PURE__ */ e(
|
|
296
|
-
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children:
|
|
297
|
-
/* @__PURE__ */ e(
|
|
298
|
-
] },
|
|
299
|
-
] }) }),
|
|
300
|
-
u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No surveys yet." }) : u.map((
|
|
301
|
-
/* @__PURE__ */ e("strong", { children:
|
|
294
|
+
] }), Qe = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children: p.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No participants yet." }) : /* @__PURE__ */ i(nn, { children: [
|
|
295
|
+
/* @__PURE__ */ e(he, { max: 8, children: p.map((r) => /* @__PURE__ */ e(Z, { name: r.name, src: r.avatarUrl }, r.id)) }),
|
|
296
|
+
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: p.map((r) => /* @__PURE__ */ i("li", { className: "nice-event-planning__participant", children: [
|
|
297
|
+
/* @__PURE__ */ e(Z, { name: r.name, src: r.avatarUrl, size: "sm" }),
|
|
298
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children: r.name }),
|
|
299
|
+
/* @__PURE__ */ e(W, { size: "xs", subtle: !0, variant: ee(r.status), children: r.status })
|
|
300
|
+
] }, r.id)) })
|
|
301
|
+
] }) }), je = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
302
|
+
u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No surveys yet." }) : u.map((r) => /* @__PURE__ */ i("div", { className: "nice-event-planning__survey", children: [
|
|
303
|
+
/* @__PURE__ */ e("strong", { children: r.question }),
|
|
302
304
|
" ",
|
|
303
|
-
/* @__PURE__ */ e(
|
|
304
|
-
|
|
305
|
+
/* @__PURE__ */ e(W, { size: "xs", outline: !0, variant: "info", children: r.type }),
|
|
306
|
+
r.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: r.options.map((R, en) => /* @__PURE__ */ e(
|
|
305
307
|
B,
|
|
306
308
|
{
|
|
307
309
|
size: "sm",
|
|
308
310
|
variant: "outline",
|
|
309
|
-
onClick: () =>
|
|
311
|
+
onClick: () => a == null ? void 0 : a(r.id, R),
|
|
310
312
|
children: R
|
|
311
313
|
},
|
|
312
|
-
|
|
314
|
+
en
|
|
313
315
|
)) }),
|
|
314
|
-
|
|
315
|
-
|
|
316
|
+
r.responses && /* @__PURE__ */ i("span", { className: "nice-event-planning__muted", children: [
|
|
317
|
+
r.responses.length,
|
|
316
318
|
" responses"
|
|
317
319
|
] })
|
|
318
|
-
] },
|
|
319
|
-
|
|
320
|
+
] }, r.id)),
|
|
321
|
+
l && c && /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
320
322
|
/* @__PURE__ */ e(
|
|
321
323
|
T,
|
|
322
324
|
{
|
|
323
325
|
label: "New survey question",
|
|
324
|
-
value:
|
|
325
|
-
onChange:
|
|
326
|
+
value: $,
|
|
327
|
+
onChange: ie,
|
|
326
328
|
placeholder: "Question"
|
|
327
329
|
}
|
|
328
330
|
),
|
|
329
331
|
/* @__PURE__ */ e(
|
|
330
|
-
|
|
332
|
+
ve,
|
|
331
333
|
{
|
|
332
334
|
label: "Type",
|
|
333
|
-
value:
|
|
334
|
-
onChange: (
|
|
335
|
+
value: Y,
|
|
336
|
+
onChange: (r) => Le(r),
|
|
335
337
|
options: [
|
|
336
338
|
{ value: "single", label: "Single choice" },
|
|
337
339
|
{ value: "multiple", label: "Multiple choice" },
|
|
@@ -344,8 +346,8 @@ const hn = {
|
|
|
344
346
|
T,
|
|
345
347
|
{
|
|
346
348
|
label: "Options (comma-separated)",
|
|
347
|
-
value:
|
|
348
|
-
onChange:
|
|
349
|
+
value: K,
|
|
350
|
+
onChange: te,
|
|
349
351
|
placeholder: "Yes, No, Maybe"
|
|
350
352
|
}
|
|
351
353
|
),
|
|
@@ -354,27 +356,27 @@ const hn = {
|
|
|
354
356
|
{
|
|
355
357
|
variant: "primary",
|
|
356
358
|
leftIcon: /* @__PURE__ */ e(L, { name: "plus", size: "sm" }),
|
|
357
|
-
onClick:
|
|
358
|
-
disabled:
|
|
359
|
+
onClick: De,
|
|
360
|
+
disabled: !$.trim(),
|
|
359
361
|
children: "Add survey"
|
|
360
362
|
}
|
|
361
363
|
)
|
|
362
364
|
] })
|
|
363
|
-
] }),
|
|
365
|
+
] }), Ge = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
364
366
|
m.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No billing items yet." }) : /* @__PURE__ */ e(
|
|
365
|
-
|
|
367
|
+
pn,
|
|
366
368
|
{
|
|
367
|
-
lines: [...
|
|
368
|
-
currency:
|
|
369
|
+
lines: [...Me, { label: "Total", amount: Ue, isSummary: !0 }],
|
|
370
|
+
currency: We
|
|
369
371
|
}
|
|
370
372
|
),
|
|
371
|
-
|
|
373
|
+
l && w && /* @__PURE__ */ i("div", { className: "nice-event-planning__row", children: [
|
|
372
374
|
/* @__PURE__ */ e(
|
|
373
375
|
T,
|
|
374
376
|
{
|
|
375
377
|
label: "Item",
|
|
376
378
|
value: D,
|
|
377
|
-
onChange:
|
|
379
|
+
onChange: ae,
|
|
378
380
|
placeholder: "Catering"
|
|
379
381
|
}
|
|
380
382
|
),
|
|
@@ -382,17 +384,17 @@ const hn = {
|
|
|
382
384
|
T,
|
|
383
385
|
{
|
|
384
386
|
label: "Amount",
|
|
385
|
-
value:
|
|
386
|
-
onChange:
|
|
387
|
+
value: J,
|
|
388
|
+
onChange: le,
|
|
387
389
|
placeholder: "0.00"
|
|
388
390
|
}
|
|
389
391
|
),
|
|
390
392
|
/* @__PURE__ */ e(
|
|
391
|
-
|
|
393
|
+
ve,
|
|
392
394
|
{
|
|
393
395
|
label: "Currency",
|
|
394
|
-
value:
|
|
395
|
-
onChange: (
|
|
396
|
+
value: X,
|
|
397
|
+
onChange: (r) => Te(r),
|
|
396
398
|
options: ["PLN", "EUR", "USD", "GBP"]
|
|
397
399
|
}
|
|
398
400
|
),
|
|
@@ -401,14 +403,14 @@ const hn = {
|
|
|
401
403
|
{
|
|
402
404
|
variant: "primary",
|
|
403
405
|
leftIcon: /* @__PURE__ */ e(L, { name: "plus", size: "sm" }),
|
|
404
|
-
onClick:
|
|
406
|
+
onClick: Ve,
|
|
405
407
|
disabled: !D.trim(),
|
|
406
408
|
children: "Add"
|
|
407
409
|
}
|
|
408
410
|
)
|
|
409
411
|
] })
|
|
410
|
-
] }),
|
|
411
|
-
/* @__PURE__ */ e(
|
|
412
|
+
] }), He = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
413
|
+
/* @__PURE__ */ e(ge, { label: "Public event", checked: t.isPublic ?? !1, disabled: !l }),
|
|
412
414
|
/* @__PURE__ */ e(
|
|
413
415
|
T,
|
|
414
416
|
{
|
|
@@ -416,7 +418,7 @@ const hn = {
|
|
|
416
418
|
value: t.maxParticipants != null ? String(t.maxParticipants) : "",
|
|
417
419
|
onChange: () => {
|
|
418
420
|
},
|
|
419
|
-
readOnly: !
|
|
421
|
+
readOnly: !l
|
|
420
422
|
}
|
|
421
423
|
),
|
|
422
424
|
/* @__PURE__ */ i("div", { className: "nice-event-planning__muted", children: [
|
|
@@ -425,225 +427,234 @@ const hn = {
|
|
|
425
427
|
" · Created ",
|
|
426
428
|
new Date(t.createdAt).toLocaleDateString()
|
|
427
429
|
] })
|
|
428
|
-
] }),
|
|
429
|
-
details:
|
|
430
|
-
location:
|
|
431
|
-
participants:
|
|
432
|
-
surveys:
|
|
433
|
-
budget:
|
|
434
|
-
settings:
|
|
435
|
-
},
|
|
430
|
+
] }), Ye = {
|
|
431
|
+
details: qe,
|
|
432
|
+
location: Fe,
|
|
433
|
+
participants: Qe,
|
|
434
|
+
surveys: je,
|
|
435
|
+
budget: Ge,
|
|
436
|
+
settings: He
|
|
437
|
+
}, Ke = {
|
|
436
438
|
details: "file",
|
|
437
439
|
location: "home",
|
|
438
440
|
participants: "users",
|
|
439
441
|
surveys: "clipboard",
|
|
440
442
|
budget: "file",
|
|
441
443
|
settings: "settings"
|
|
442
|
-
},
|
|
444
|
+
}, Je = {
|
|
443
445
|
participants: p.length || void 0,
|
|
444
446
|
surveys: u.length || void 0,
|
|
445
447
|
budget: m.length || void 0
|
|
446
|
-
},
|
|
447
|
-
id:
|
|
448
|
-
label:
|
|
449
|
-
icon: /* @__PURE__ */ e(L, { name:
|
|
450
|
-
badge:
|
|
451
|
-
content:
|
|
452
|
-
})),
|
|
448
|
+
}, Xe = re.map((r) => ({
|
|
449
|
+
id: r,
|
|
450
|
+
label: r.charAt(0).toUpperCase() + r.slice(1),
|
|
451
|
+
icon: /* @__PURE__ */ e(L, { name: Ke[r], size: "sm" }),
|
|
452
|
+
badge: Je[r],
|
|
453
|
+
content: Ye[r]
|
|
454
|
+
})), Ze = /* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar", children: [
|
|
453
455
|
/* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar-title", children: [
|
|
454
456
|
/* @__PURE__ */ e(L, { name: "calendar", size: "md" }),
|
|
455
457
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: t.title }),
|
|
456
|
-
/* @__PURE__ */ e(
|
|
458
|
+
/* @__PURE__ */ e(W, { size: "sm", variant: ee(t.status), children: t.status })
|
|
457
459
|
] }),
|
|
458
460
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__toolbar-spacer" }),
|
|
459
461
|
/* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar-actions", children: [
|
|
460
|
-
|
|
462
|
+
o && /* @__PURE__ */ e(
|
|
461
463
|
B,
|
|
462
464
|
{
|
|
463
465
|
size: "sm",
|
|
464
466
|
variant: "primary",
|
|
465
467
|
leftIcon: /* @__PURE__ */ e(L, { name: "check", size: "sm" }),
|
|
466
|
-
onClick: () =>
|
|
468
|
+
onClick: () => o({ title: P, description: M }),
|
|
467
469
|
children: "Save"
|
|
468
470
|
}
|
|
469
471
|
),
|
|
470
|
-
|
|
472
|
+
k && /* @__PURE__ */ e(
|
|
471
473
|
B,
|
|
472
474
|
{
|
|
473
475
|
size: "sm",
|
|
474
476
|
variant: "success",
|
|
475
477
|
leftIcon: /* @__PURE__ */ e(L, { name: "upload", size: "sm" }),
|
|
476
|
-
onClick:
|
|
478
|
+
onClick: k,
|
|
477
479
|
children: "Publish"
|
|
478
480
|
}
|
|
479
481
|
),
|
|
480
|
-
|
|
482
|
+
y && /* @__PURE__ */ e(
|
|
481
483
|
B,
|
|
482
484
|
{
|
|
483
485
|
size: "sm",
|
|
484
486
|
variant: "ghost",
|
|
485
487
|
leftIcon: /* @__PURE__ */ e(L, { name: "link", size: "sm" }),
|
|
486
|
-
onClick:
|
|
488
|
+
onClick: y,
|
|
487
489
|
children: "Share"
|
|
488
490
|
}
|
|
489
491
|
),
|
|
490
|
-
|
|
492
|
+
x && /* @__PURE__ */ e(
|
|
491
493
|
B,
|
|
492
494
|
{
|
|
493
495
|
size: "sm",
|
|
494
496
|
variant: "ghost",
|
|
495
497
|
leftIcon: /* @__PURE__ */ e(L, { name: "download", size: "sm" }),
|
|
496
|
-
onClick:
|
|
498
|
+
onClick: x,
|
|
497
499
|
children: "Export"
|
|
498
500
|
}
|
|
499
501
|
)
|
|
500
502
|
] })
|
|
501
503
|
] });
|
|
502
|
-
return
|
|
504
|
+
return h === "micro" ? /* @__PURE__ */ e(
|
|
503
505
|
"div",
|
|
504
506
|
{
|
|
505
|
-
ref:
|
|
506
|
-
className: `nice-event-planning nice-event-planning--micro ${
|
|
507
|
-
style:
|
|
507
|
+
ref: C,
|
|
508
|
+
className: `nice-event-planning nice-event-planning--micro ${s ?? ""}`,
|
|
509
|
+
style: A,
|
|
508
510
|
children: /* @__PURE__ */ i("div", { className: "nice-event-planning__micro", children: [
|
|
509
511
|
/* @__PURE__ */ e(L, { name: "calendar", size: "md" }),
|
|
510
512
|
/* @__PURE__ */ i("div", { className: "nice-event-planning__micro-body", children: [
|
|
511
513
|
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: t.title }),
|
|
512
514
|
/* @__PURE__ */ i("span", { className: "nice-event-planning__muted", children: [
|
|
513
515
|
t.startDate ? new Date(t.startDate).toLocaleString() : "No date",
|
|
514
|
-
(
|
|
516
|
+
(pe = t.location) != null && pe.name ? ` · ${t.location.name}` : ""
|
|
515
517
|
] })
|
|
516
518
|
] }),
|
|
517
|
-
/* @__PURE__ */ e(
|
|
518
|
-
p.length > 0 && /* @__PURE__ */ e(
|
|
519
|
+
/* @__PURE__ */ e(W, { size: "sm", variant: ee(t.status), children: t.status }),
|
|
520
|
+
p.length > 0 && /* @__PURE__ */ e(he, { max: 4, size: "sm", children: p.map((r) => /* @__PURE__ */ e(Z, { name: r.name, src: r.avatarUrl, size: "sm" }, r.id)) })
|
|
519
521
|
] })
|
|
520
522
|
}
|
|
521
523
|
) : /* @__PURE__ */ i(
|
|
522
524
|
"div",
|
|
523
525
|
{
|
|
524
|
-
ref:
|
|
525
|
-
className: `nice-event-planning nice-event-planning--${
|
|
526
|
-
style:
|
|
526
|
+
ref: C,
|
|
527
|
+
className: `nice-event-planning nice-event-planning--${h} ${s ?? ""}`,
|
|
528
|
+
style: A,
|
|
527
529
|
children: [
|
|
528
|
-
|
|
529
|
-
/* @__PURE__ */ e(
|
|
530
|
+
Ze,
|
|
531
|
+
/* @__PURE__ */ e(
|
|
532
|
+
un,
|
|
533
|
+
{
|
|
534
|
+
tabs: Xe,
|
|
535
|
+
activeTab: Be,
|
|
536
|
+
onChange: Ee,
|
|
537
|
+
iconOnly: S,
|
|
538
|
+
centered: b
|
|
539
|
+
}
|
|
540
|
+
)
|
|
530
541
|
]
|
|
531
542
|
}
|
|
532
543
|
);
|
|
533
544
|
}
|
|
534
|
-
),
|
|
545
|
+
), yn = {
|
|
535
546
|
upcoming: "⏳",
|
|
536
547
|
active: "▶️",
|
|
537
548
|
voting: "🗳️",
|
|
538
549
|
scored: "📊",
|
|
539
550
|
completed: "✅",
|
|
540
551
|
skipped: "⏭️"
|
|
541
|
-
},
|
|
552
|
+
}, fn = {
|
|
542
553
|
upcoming: "#9ca3af",
|
|
543
554
|
active: "#22c55e",
|
|
544
555
|
voting: "#eab308",
|
|
545
556
|
scored: "#3b82f6",
|
|
546
557
|
completed: "#6b7280",
|
|
547
558
|
skipped: "#d1d5db"
|
|
548
|
-
},
|
|
549
|
-
function(
|
|
559
|
+
}, An = E(
|
|
560
|
+
function(N, C) {
|
|
550
561
|
const {
|
|
551
562
|
rounds: t,
|
|
552
563
|
activeRoundId: p,
|
|
553
564
|
onSelect: u,
|
|
554
565
|
onStart: m,
|
|
555
|
-
onEnd:
|
|
556
|
-
onCreate:
|
|
557
|
-
editable:
|
|
558
|
-
className:
|
|
559
|
-
style:
|
|
560
|
-
} =
|
|
561
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
566
|
+
onEnd: h,
|
|
567
|
+
onCreate: v,
|
|
568
|
+
editable: _ = !1,
|
|
569
|
+
className: g,
|
|
570
|
+
style: S
|
|
571
|
+
} = N, b = [...t].sort((l, o) => l.order - o.order);
|
|
572
|
+
return /* @__PURE__ */ i("div", { ref: C, className: `nice-round-list ${g ?? ""}`, style: S, children: [
|
|
562
573
|
/* @__PURE__ */ i("div", { className: "nice-round-list__header", children: [
|
|
563
574
|
/* @__PURE__ */ i("h3", { children: [
|
|
564
575
|
"Rounds (",
|
|
565
576
|
t.length,
|
|
566
577
|
")"
|
|
567
578
|
] }),
|
|
568
|
-
|
|
579
|
+
_ && v && /* @__PURE__ */ e("button", { onClick: v, children: "+ Add Round" })
|
|
569
580
|
] }),
|
|
570
|
-
|
|
571
|
-
const o =
|
|
581
|
+
b.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: "No rounds yet." }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: b.map((l) => {
|
|
582
|
+
const o = l.id === p;
|
|
572
583
|
return /* @__PURE__ */ i(
|
|
573
584
|
"div",
|
|
574
585
|
{
|
|
575
586
|
className: `nice-round-list__item ${o ? "nice-round-list__item--active" : ""}`,
|
|
576
|
-
onClick: () => u == null ? void 0 : u(
|
|
587
|
+
onClick: () => u == null ? void 0 : u(l),
|
|
577
588
|
role: u ? "button" : void 0,
|
|
578
589
|
tabIndex: u ? 0 : void 0,
|
|
579
590
|
children: [
|
|
580
591
|
/* @__PURE__ */ i("span", { className: "nice-round-list__order", children: [
|
|
581
592
|
"#",
|
|
582
|
-
|
|
593
|
+
l.order
|
|
583
594
|
] }),
|
|
584
|
-
/* @__PURE__ */ e("span", { className: "nice-round-list__icon", children:
|
|
595
|
+
/* @__PURE__ */ e("span", { className: "nice-round-list__icon", children: yn[l.status] }),
|
|
585
596
|
/* @__PURE__ */ i("div", { className: "nice-round-list__info", children: [
|
|
586
|
-
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children:
|
|
587
|
-
|
|
588
|
-
|
|
597
|
+
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children: l.name }),
|
|
598
|
+
l.description && /* @__PURE__ */ e("small", { children: l.description }),
|
|
599
|
+
l.type && /* @__PURE__ */ e("span", { className: "nice-round-list__type", children: l.type })
|
|
589
600
|
] }),
|
|
590
601
|
/* @__PURE__ */ e(
|
|
591
602
|
"span",
|
|
592
603
|
{
|
|
593
604
|
className: "nice-round-list__status",
|
|
594
|
-
style: { color:
|
|
595
|
-
children:
|
|
605
|
+
style: { color: fn[l.status] },
|
|
606
|
+
children: l.status
|
|
596
607
|
}
|
|
597
608
|
),
|
|
598
|
-
|
|
599
|
-
|
|
609
|
+
l.durationMinutes && /* @__PURE__ */ i("span", { className: "nice-round-list__duration", children: [
|
|
610
|
+
l.durationMinutes,
|
|
600
611
|
"m"
|
|
601
612
|
] }),
|
|
602
|
-
|
|
613
|
+
l.winnerIds && l.winnerIds.length > 0 && /* @__PURE__ */ i("span", { className: "nice-round-list__winners", children: [
|
|
603
614
|
"🏆 ",
|
|
604
|
-
|
|
615
|
+
l.winnerIds.length
|
|
605
616
|
] }),
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
(
|
|
617
|
+
_ && /* @__PURE__ */ i("div", { className: "nice-round-list__actions", onClick: (k) => k.stopPropagation(), children: [
|
|
618
|
+
l.status === "upcoming" && m && /* @__PURE__ */ e("button", { onClick: () => m(l.id), children: "Start" }),
|
|
619
|
+
(l.status === "active" || l.status === "voting") && h && /* @__PURE__ */ e("button", { onClick: () => h(l.id), children: "End" })
|
|
609
620
|
] })
|
|
610
621
|
]
|
|
611
622
|
},
|
|
612
|
-
|
|
623
|
+
l.id
|
|
613
624
|
);
|
|
614
625
|
}) })
|
|
615
626
|
] });
|
|
616
627
|
}
|
|
617
|
-
),
|
|
618
|
-
function(
|
|
628
|
+
), In = E(
|
|
629
|
+
function(N, C) {
|
|
619
630
|
const {
|
|
620
631
|
round: t,
|
|
621
632
|
timerRunning: p = !1,
|
|
622
633
|
remainingSeconds: u,
|
|
623
634
|
onSubmitScore: m,
|
|
624
|
-
onStart:
|
|
625
|
-
onEnd:
|
|
626
|
-
onSkip:
|
|
627
|
-
editable:
|
|
628
|
-
footerActions:
|
|
629
|
-
className:
|
|
630
|
-
style:
|
|
631
|
-
} =
|
|
635
|
+
onStart: h,
|
|
636
|
+
onEnd: v,
|
|
637
|
+
onSkip: _,
|
|
638
|
+
editable: g = !1,
|
|
639
|
+
footerActions: S,
|
|
640
|
+
className: b,
|
|
641
|
+
style: l
|
|
642
|
+
} = N, [o, k] = f({}), y = O(
|
|
632
643
|
(n) => {
|
|
633
|
-
const
|
|
634
|
-
isNaN(
|
|
644
|
+
const c = parseFloat(o[n] ?? "");
|
|
645
|
+
isNaN(c) || !m || (m(n, c), k((a) => ({ ...a, [n]: "" })));
|
|
635
646
|
},
|
|
636
647
|
[o, m]
|
|
637
|
-
),
|
|
638
|
-
const
|
|
639
|
-
return `${
|
|
640
|
-
}, d = t.scores ? [...t.scores].sort((n,
|
|
648
|
+
), x = (n) => {
|
|
649
|
+
const c = Math.floor(n / 60), a = n % 60;
|
|
650
|
+
return `${c}:${a.toString().padStart(2, "0")}`;
|
|
651
|
+
}, d = t.scores ? [...t.scores].sort((n, c) => c.score - n.score) : [];
|
|
641
652
|
return /* @__PURE__ */ i(
|
|
642
653
|
"div",
|
|
643
654
|
{
|
|
644
|
-
ref:
|
|
645
|
-
className: `nice-round-card nice-round-card--${t.status} ${
|
|
646
|
-
style:
|
|
655
|
+
ref: C,
|
|
656
|
+
className: `nice-round-card nice-round-card--${t.status} ${b ?? ""}`,
|
|
657
|
+
style: l,
|
|
647
658
|
children: [
|
|
648
659
|
/* @__PURE__ */ i("div", { className: "nice-round-card__header", children: [
|
|
649
660
|
/* @__PURE__ */ i("span", { className: "nice-round-card__order", children: [
|
|
@@ -660,7 +671,7 @@ const hn = {
|
|
|
660
671
|
className: `nice-round-card__timer ${p ? "nice-round-card__timer--running" : ""}`,
|
|
661
672
|
children: [
|
|
662
673
|
"⏱️ ",
|
|
663
|
-
u != null ?
|
|
674
|
+
u != null ? x(u) : "—"
|
|
664
675
|
]
|
|
665
676
|
}
|
|
666
677
|
),
|
|
@@ -672,14 +683,14 @@ const hn = {
|
|
|
672
683
|
/* @__PURE__ */ e("th", { children: "Participant" }),
|
|
673
684
|
/* @__PURE__ */ e("th", { children: "Score" })
|
|
674
685
|
] }) }),
|
|
675
|
-
/* @__PURE__ */ e("tbody", { children: d.map((n,
|
|
686
|
+
/* @__PURE__ */ e("tbody", { children: d.map((n, c) => /* @__PURE__ */ i(
|
|
676
687
|
"tr",
|
|
677
688
|
{
|
|
678
|
-
className:
|
|
689
|
+
className: c < 3 ? `nice-round-card__top-${c + 1}` : "",
|
|
679
690
|
children: [
|
|
680
691
|
/* @__PURE__ */ i("td", { children: [
|
|
681
|
-
n.rank ??
|
|
682
|
-
|
|
692
|
+
n.rank ?? c + 1,
|
|
693
|
+
c === 0 ? " 🥇" : c === 1 ? " 🥈" : c === 2 ? " 🥉" : ""
|
|
683
694
|
] }),
|
|
684
695
|
/* @__PURE__ */ e("td", { children: n.participantName }),
|
|
685
696
|
/* @__PURE__ */ e("td", { children: n.score })
|
|
@@ -698,22 +709,22 @@ const hn = {
|
|
|
698
709
|
{
|
|
699
710
|
type: "number",
|
|
700
711
|
value: o[n.participantId] ?? "",
|
|
701
|
-
onChange: (
|
|
712
|
+
onChange: (c) => k((a) => ({ ...a, [n.participantId]: c.target.value })),
|
|
702
713
|
min: 0,
|
|
703
714
|
step: 1,
|
|
704
715
|
placeholder: "Score"
|
|
705
716
|
}
|
|
706
717
|
),
|
|
707
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
718
|
+
/* @__PURE__ */ e("button", { onClick: () => y(n.participantId), children: "Submit" })
|
|
708
719
|
] }, n.participantId))
|
|
709
720
|
] }),
|
|
710
721
|
/* @__PURE__ */ i("div", { className: "nice-round-card__footer", children: [
|
|
711
|
-
|
|
712
|
-
t.status === "upcoming" &&
|
|
713
|
-
(t.status === "active" || t.status === "voting") &&
|
|
714
|
-
t.status === "upcoming" &&
|
|
722
|
+
g && /* @__PURE__ */ i("div", { className: "nice-round-card__actions", children: [
|
|
723
|
+
t.status === "upcoming" && h && /* @__PURE__ */ e("button", { onClick: h, children: "▶ Start Round" }),
|
|
724
|
+
(t.status === "active" || t.status === "voting") && v && /* @__PURE__ */ e("button", { onClick: v, children: "⏹ End Round" }),
|
|
725
|
+
t.status === "upcoming" && _ && /* @__PURE__ */ e("button", { onClick: _, children: "⏭ Skip" })
|
|
715
726
|
] }),
|
|
716
|
-
|
|
727
|
+
S
|
|
717
728
|
] }),
|
|
718
729
|
t.winnerIds && t.winnerIds.length > 0 && /* @__PURE__ */ i("div", { className: "nice-round-card__winners", children: [
|
|
719
730
|
"🏆 Winners: ",
|
|
@@ -723,46 +734,46 @@ const hn = {
|
|
|
723
734
|
}
|
|
724
735
|
);
|
|
725
736
|
}
|
|
726
|
-
),
|
|
727
|
-
function(
|
|
737
|
+
), Ln = E(
|
|
738
|
+
function(N, C) {
|
|
728
739
|
const {
|
|
729
740
|
songs: t,
|
|
730
741
|
onAdd: p,
|
|
731
742
|
onRemove: u,
|
|
732
743
|
onVote: m,
|
|
733
|
-
onSearch:
|
|
734
|
-
showQueue:
|
|
735
|
-
readOnly:
|
|
736
|
-
className:
|
|
737
|
-
style:
|
|
738
|
-
} =
|
|
739
|
-
if (!
|
|
744
|
+
onSearch: h,
|
|
745
|
+
showQueue: v = !0,
|
|
746
|
+
readOnly: _ = !1,
|
|
747
|
+
className: g,
|
|
748
|
+
style: S
|
|
749
|
+
} = N, [b, l] = f(""), o = I(() => {
|
|
750
|
+
if (!b.trim())
|
|
740
751
|
return t;
|
|
741
|
-
const n =
|
|
752
|
+
const n = b.toLowerCase();
|
|
742
753
|
return t.filter(
|
|
743
|
-
(
|
|
754
|
+
(c) => c.title.toLowerCase().includes(n) || c.artist.toLowerCase().includes(n)
|
|
744
755
|
);
|
|
745
|
-
}, [t,
|
|
746
|
-
|
|
756
|
+
}, [t, b]), k = I(() => t.filter((n) => n.isQueued), [t]), y = t.find((n) => n.isPlaying), x = (n) => {
|
|
757
|
+
l(n), h == null || h(n);
|
|
747
758
|
}, d = (n) => {
|
|
748
759
|
if (!n)
|
|
749
760
|
return "";
|
|
750
|
-
const
|
|
751
|
-
return `${
|
|
761
|
+
const c = Math.floor(n / 60), a = n % 60;
|
|
762
|
+
return `${c}:${a.toString().padStart(2, "0")}`;
|
|
752
763
|
};
|
|
753
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
754
|
-
|
|
764
|
+
return /* @__PURE__ */ i("div", { ref: C, className: `nice-song-picker ${g ?? ""}`, style: S, children: [
|
|
765
|
+
y && /* @__PURE__ */ i("div", { className: "nice-song-picker__now-playing", children: [
|
|
755
766
|
/* @__PURE__ */ e("span", { className: "nice-song-picker__np-label", children: "🎵 Now Playing" }),
|
|
756
|
-
|
|
757
|
-
/* @__PURE__ */ e("strong", { children:
|
|
758
|
-
/* @__PURE__ */ e("span", { children:
|
|
767
|
+
y.albumArt && /* @__PURE__ */ e("img", { src: y.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
768
|
+
/* @__PURE__ */ e("strong", { children: y.title }),
|
|
769
|
+
/* @__PURE__ */ e("span", { children: y.artist })
|
|
759
770
|
] }),
|
|
760
771
|
/* @__PURE__ */ e(
|
|
761
772
|
"input",
|
|
762
773
|
{
|
|
763
774
|
type: "text",
|
|
764
|
-
value:
|
|
765
|
-
onChange: (n) =>
|
|
775
|
+
value: b,
|
|
776
|
+
onChange: (n) => x(n.target.value),
|
|
766
777
|
placeholder: "Search songs…",
|
|
767
778
|
className: "nice-song-picker__search"
|
|
768
779
|
}
|
|
@@ -782,7 +793,7 @@ const hn = {
|
|
|
782
793
|
n.addedByName
|
|
783
794
|
] })
|
|
784
795
|
] }),
|
|
785
|
-
!
|
|
796
|
+
!_ && /* @__PURE__ */ i("div", { className: "nice-song-picker__actions", children: [
|
|
786
797
|
m && /* @__PURE__ */ i("button", { onClick: () => m(n.id), children: [
|
|
787
798
|
"👍 ",
|
|
788
799
|
n.votes ?? 0
|
|
@@ -794,15 +805,15 @@ const hn = {
|
|
|
794
805
|
},
|
|
795
806
|
n.id
|
|
796
807
|
)) }),
|
|
797
|
-
|
|
808
|
+
v && k.length > 0 && /* @__PURE__ */ i("div", { className: "nice-song-picker__queue", children: [
|
|
798
809
|
/* @__PURE__ */ i("h4", { children: [
|
|
799
810
|
"Queue (",
|
|
800
|
-
|
|
811
|
+
k.length,
|
|
801
812
|
")"
|
|
802
813
|
] }),
|
|
803
|
-
|
|
814
|
+
k.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-song-picker__queue-item", children: [
|
|
804
815
|
/* @__PURE__ */ i("span", { className: "nice-song-picker__queue-pos", children: [
|
|
805
|
-
|
|
816
|
+
c + 1,
|
|
806
817
|
"."
|
|
807
818
|
] }),
|
|
808
819
|
/* @__PURE__ */ i("span", { children: [
|
|
@@ -814,28 +825,28 @@ const hn = {
|
|
|
814
825
|
] })
|
|
815
826
|
] });
|
|
816
827
|
}
|
|
817
|
-
),
|
|
818
|
-
function(
|
|
828
|
+
), Tn = E(
|
|
829
|
+
function(N, C) {
|
|
819
830
|
const {
|
|
820
831
|
songs: t,
|
|
821
832
|
queue: p = [],
|
|
822
833
|
onEnqueue: u,
|
|
823
834
|
onDequeue: m,
|
|
824
|
-
onNext:
|
|
825
|
-
nowPlayingId:
|
|
826
|
-
readOnly:
|
|
827
|
-
className:
|
|
828
|
-
style:
|
|
829
|
-
} =
|
|
835
|
+
onNext: h,
|
|
836
|
+
nowPlayingId: v,
|
|
837
|
+
readOnly: _ = !1,
|
|
838
|
+
className: g,
|
|
839
|
+
style: S
|
|
840
|
+
} = N, [b, l] = f(""), [o, k] = f(""), y = t.find((a) => a.id === v), x = I(() => {
|
|
830
841
|
let a = t;
|
|
831
|
-
if (
|
|
832
|
-
const
|
|
842
|
+
if (b.trim()) {
|
|
843
|
+
const w = b.toLowerCase();
|
|
833
844
|
a = a.filter(
|
|
834
|
-
(
|
|
845
|
+
(s) => s.title.toLowerCase().includes(w) || s.artist.toLowerCase().includes(w)
|
|
835
846
|
);
|
|
836
847
|
}
|
|
837
|
-
return o && (a = a.filter((
|
|
838
|
-
}, [t,
|
|
848
|
+
return o && (a = a.filter((w) => w.difficulty === o)), a;
|
|
849
|
+
}, [t, b, o]), d = I(() => new Set(p.map((a) => a.id)), [p]), n = ["easy", "medium", "hard", "expert"], c = (a) => {
|
|
839
850
|
switch (a) {
|
|
840
851
|
case "easy":
|
|
841
852
|
return "#4caf50";
|
|
@@ -849,8 +860,8 @@ const hn = {
|
|
|
849
860
|
return "#999";
|
|
850
861
|
}
|
|
851
862
|
};
|
|
852
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
853
|
-
|
|
863
|
+
return /* @__PURE__ */ i("div", { ref: C, className: `nice-karaoke-picker ${g ?? ""}`, style: S, children: [
|
|
864
|
+
y && /* @__PURE__ */ i(
|
|
854
865
|
"div",
|
|
855
866
|
{
|
|
856
867
|
className: "nice-karaoke-picker__now-singing",
|
|
@@ -863,16 +874,16 @@ const hn = {
|
|
|
863
874
|
children: [
|
|
864
875
|
/* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "🎤 Now Singing" }),
|
|
865
876
|
/* @__PURE__ */ i("div", { children: [
|
|
866
|
-
/* @__PURE__ */ e("strong", { children:
|
|
877
|
+
/* @__PURE__ */ e("strong", { children: y.title }),
|
|
867
878
|
" — ",
|
|
868
|
-
|
|
869
|
-
|
|
879
|
+
y.artist,
|
|
880
|
+
y.performerName && /* @__PURE__ */ i("span", { children: [
|
|
870
881
|
" (by ",
|
|
871
|
-
|
|
882
|
+
y.performerName,
|
|
872
883
|
")"
|
|
873
884
|
] })
|
|
874
885
|
] }),
|
|
875
|
-
!
|
|
886
|
+
!_ && h && /* @__PURE__ */ e("button", { onClick: h, style: { marginTop: 8 }, children: "Skip / Next ⏭" })
|
|
876
887
|
]
|
|
877
888
|
}
|
|
878
889
|
),
|
|
@@ -886,20 +897,20 @@ const hn = {
|
|
|
886
897
|
"input",
|
|
887
898
|
{
|
|
888
899
|
type: "text",
|
|
889
|
-
value:
|
|
890
|
-
onChange: (a) =>
|
|
900
|
+
value: b,
|
|
901
|
+
onChange: (a) => l(a.target.value),
|
|
891
902
|
placeholder: "Search songs or artists…",
|
|
892
903
|
style: { flex: 1 }
|
|
893
904
|
}
|
|
894
905
|
),
|
|
895
|
-
/* @__PURE__ */ i("select", { value: o, onChange: (a) =>
|
|
906
|
+
/* @__PURE__ */ i("select", { value: o, onChange: (a) => k(a.target.value), children: [
|
|
896
907
|
/* @__PURE__ */ e("option", { value: "", children: "All Difficulties" }),
|
|
897
908
|
n.map((a) => /* @__PURE__ */ e("option", { value: a, children: a }, a))
|
|
898
909
|
] })
|
|
899
910
|
]
|
|
900
911
|
}
|
|
901
912
|
),
|
|
902
|
-
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children:
|
|
913
|
+
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: x.length === 0 ? /* @__PURE__ */ e("p", { children: "No songs match your search." }) : x.map((a) => /* @__PURE__ */ i(
|
|
903
914
|
"div",
|
|
904
915
|
{
|
|
905
916
|
className: "nice-karaoke-picker__song",
|
|
@@ -921,7 +932,7 @@ const hn = {
|
|
|
921
932
|
style: {
|
|
922
933
|
marginLeft: 8,
|
|
923
934
|
fontSize: 12,
|
|
924
|
-
color:
|
|
935
|
+
color: c(a.difficulty),
|
|
925
936
|
fontWeight: 600
|
|
926
937
|
},
|
|
927
938
|
children: [
|
|
@@ -938,7 +949,7 @@ const hn = {
|
|
|
938
949
|
")"
|
|
939
950
|
] })
|
|
940
951
|
] }),
|
|
941
|
-
!
|
|
952
|
+
!_ && /* @__PURE__ */ e("div", { children: d.has(a.id) ? /* @__PURE__ */ e("button", { onClick: () => m == null ? void 0 : m(a.id), style: { color: "#f44336" }, children: "Remove" }) : /* @__PURE__ */ e("button", { onClick: () => u == null ? void 0 : u(a.id), children: "🎤 Sing" }) })
|
|
942
953
|
]
|
|
943
954
|
},
|
|
944
955
|
a.id
|
|
@@ -949,14 +960,14 @@ const hn = {
|
|
|
949
960
|
p.length,
|
|
950
961
|
")"
|
|
951
962
|
] }),
|
|
952
|
-
p.map((a,
|
|
963
|
+
p.map((a, w) => /* @__PURE__ */ i(
|
|
953
964
|
"div",
|
|
954
965
|
{
|
|
955
966
|
style: { display: "flex", justifyContent: "space-between", padding: "4px 0" },
|
|
956
967
|
children: [
|
|
957
968
|
/* @__PURE__ */ i("span", { children: [
|
|
958
969
|
/* @__PURE__ */ i("strong", { children: [
|
|
959
|
-
|
|
970
|
+
w + 1,
|
|
960
971
|
"."
|
|
961
972
|
] }),
|
|
962
973
|
" ",
|
|
@@ -969,7 +980,7 @@ const hn = {
|
|
|
969
980
|
")"
|
|
970
981
|
] })
|
|
971
982
|
] }),
|
|
972
|
-
!
|
|
983
|
+
!_ && m && /* @__PURE__ */ e("button", { onClick: () => m(a.id), style: { fontSize: 12 }, children: "✕" })
|
|
973
984
|
]
|
|
974
985
|
},
|
|
975
986
|
a.id
|
|
@@ -977,15 +988,15 @@ const hn = {
|
|
|
977
988
|
] })
|
|
978
989
|
] });
|
|
979
990
|
}
|
|
980
|
-
),
|
|
981
|
-
game:
|
|
982
|
-
music:
|
|
983
|
-
dance:
|
|
984
|
-
quiz:
|
|
985
|
-
karaoke:
|
|
986
|
-
photo:
|
|
987
|
-
custom:
|
|
988
|
-
},
|
|
991
|
+
), ye = {
|
|
992
|
+
game: ke,
|
|
993
|
+
music: q,
|
|
994
|
+
dance: q,
|
|
995
|
+
quiz: be,
|
|
996
|
+
karaoke: _e,
|
|
997
|
+
photo: Ne,
|
|
998
|
+
custom: fe
|
|
999
|
+
}, Nn = {
|
|
989
1000
|
game: "Games",
|
|
990
1001
|
music: "Music",
|
|
991
1002
|
dance: "Dance",
|
|
@@ -993,44 +1004,44 @@ const hn = {
|
|
|
993
1004
|
karaoke: "Karaoke",
|
|
994
1005
|
photo: "Photo",
|
|
995
1006
|
custom: "Custom"
|
|
996
|
-
},
|
|
997
|
-
function(
|
|
1007
|
+
}, Pn = E(
|
|
1008
|
+
function(N, C) {
|
|
998
1009
|
const {
|
|
999
1010
|
attractions: t,
|
|
1000
1011
|
onSelect: p,
|
|
1001
1012
|
onDeselect: u,
|
|
1002
1013
|
onVote: m,
|
|
1003
|
-
selectedIds:
|
|
1004
|
-
maxSelections:
|
|
1005
|
-
showVotes:
|
|
1006
|
-
readOnly:
|
|
1007
|
-
layout:
|
|
1008
|
-
className:
|
|
1009
|
-
style:
|
|
1010
|
-
} =
|
|
1011
|
-
const
|
|
1012
|
-
return Array.from(
|
|
1013
|
-
}, [t]),
|
|
1014
|
-
let
|
|
1015
|
-
if (o && (
|
|
1016
|
-
const A =
|
|
1017
|
-
|
|
1014
|
+
selectedIds: h = [],
|
|
1015
|
+
maxSelections: v,
|
|
1016
|
+
showVotes: _ = !0,
|
|
1017
|
+
readOnly: g = !1,
|
|
1018
|
+
layout: S = "grid",
|
|
1019
|
+
className: b,
|
|
1020
|
+
style: l
|
|
1021
|
+
} = N, [o, k] = f(""), [y, x] = f(""), d = I(() => new Set(h), [h]), n = I(() => {
|
|
1022
|
+
const s = new Set(t.map((A) => A.category));
|
|
1023
|
+
return Array.from(s);
|
|
1024
|
+
}, [t]), c = I(() => {
|
|
1025
|
+
let s = t;
|
|
1026
|
+
if (o && (s = s.filter((A) => A.category === o)), y.trim()) {
|
|
1027
|
+
const A = y.toLowerCase();
|
|
1028
|
+
s = s.filter(
|
|
1018
1029
|
(P) => {
|
|
1019
1030
|
var V;
|
|
1020
1031
|
return P.name.toLowerCase().includes(A) || ((V = P.description) == null ? void 0 : V.toLowerCase().includes(A));
|
|
1021
1032
|
}
|
|
1022
1033
|
);
|
|
1023
1034
|
}
|
|
1024
|
-
return
|
|
1025
|
-
}, [t, o,
|
|
1026
|
-
|
|
1035
|
+
return s;
|
|
1036
|
+
}, [t, o, y]), a = !v || d.size < v, w = (s) => {
|
|
1037
|
+
g || (d.has(s) ? u == null || u(s) : a && (p == null || p(s)));
|
|
1027
1038
|
};
|
|
1028
1039
|
return /* @__PURE__ */ i(
|
|
1029
1040
|
"div",
|
|
1030
1041
|
{
|
|
1031
|
-
ref:
|
|
1032
|
-
className: `nice-attraction-picker ${
|
|
1033
|
-
style: { color: "var(--text-primary)", ...
|
|
1042
|
+
ref: C,
|
|
1043
|
+
className: `nice-attraction-picker ${b ?? ""}`,
|
|
1044
|
+
style: { color: "var(--text-primary)", ...l },
|
|
1034
1045
|
children: [
|
|
1035
1046
|
/* @__PURE__ */ i(
|
|
1036
1047
|
"div",
|
|
@@ -1043,10 +1054,10 @@ const hn = {
|
|
|
1043
1054
|
},
|
|
1044
1055
|
children: [
|
|
1045
1056
|
/* @__PURE__ */ e("h3", { style: { margin: 0 }, children: "Attractions" }),
|
|
1046
|
-
|
|
1057
|
+
v && /* @__PURE__ */ i("span", { style: { color: "var(--text-secondary, #64748b)", fontSize: 14 }, children: [
|
|
1047
1058
|
d.size,
|
|
1048
1059
|
"/",
|
|
1049
|
-
|
|
1060
|
+
v,
|
|
1050
1061
|
" selected"
|
|
1051
1062
|
] })
|
|
1052
1063
|
]
|
|
@@ -1057,8 +1068,8 @@ const hn = {
|
|
|
1057
1068
|
"input",
|
|
1058
1069
|
{
|
|
1059
1070
|
type: "text",
|
|
1060
|
-
value:
|
|
1061
|
-
onChange: (
|
|
1071
|
+
value: y,
|
|
1072
|
+
onChange: (s) => x(s.target.value),
|
|
1062
1073
|
placeholder: "Search attractions…",
|
|
1063
1074
|
style: { flex: 1, minWidth: 150 }
|
|
1064
1075
|
}
|
|
@@ -1066,41 +1077,41 @@ const hn = {
|
|
|
1066
1077
|
/* @__PURE__ */ e(
|
|
1067
1078
|
"button",
|
|
1068
1079
|
{
|
|
1069
|
-
onClick: () =>
|
|
1080
|
+
onClick: () => k(""),
|
|
1070
1081
|
style: { fontWeight: o ? 400 : 700 },
|
|
1071
1082
|
children: "All"
|
|
1072
1083
|
}
|
|
1073
1084
|
),
|
|
1074
|
-
n.map((
|
|
1085
|
+
n.map((s) => /* @__PURE__ */ i(
|
|
1075
1086
|
"button",
|
|
1076
1087
|
{
|
|
1077
|
-
onClick: () =>
|
|
1088
|
+
onClick: () => k(s === o ? "" : s),
|
|
1078
1089
|
style: {
|
|
1079
|
-
fontWeight:
|
|
1090
|
+
fontWeight: s === o ? 700 : 400,
|
|
1080
1091
|
display: "inline-flex",
|
|
1081
1092
|
alignItems: "center",
|
|
1082
1093
|
gap: 4
|
|
1083
1094
|
},
|
|
1084
1095
|
children: [
|
|
1085
|
-
|
|
1096
|
+
ne.createElement(ye[s], { size: 14 }),
|
|
1086
1097
|
" ",
|
|
1087
|
-
|
|
1098
|
+
Nn[s]
|
|
1088
1099
|
]
|
|
1089
1100
|
},
|
|
1090
|
-
|
|
1101
|
+
s
|
|
1091
1102
|
))
|
|
1092
1103
|
] }),
|
|
1093
1104
|
/* @__PURE__ */ e(
|
|
1094
1105
|
"div",
|
|
1095
1106
|
{
|
|
1096
1107
|
style: {
|
|
1097
|
-
display:
|
|
1098
|
-
gridTemplateColumns:
|
|
1108
|
+
display: S === "grid" ? "grid" : "flex",
|
|
1109
|
+
gridTemplateColumns: S === "grid" ? "repeat(auto-fill, minmax(200px, 1fr))" : void 0,
|
|
1099
1110
|
gap: 12,
|
|
1100
|
-
flexDirection:
|
|
1111
|
+
flexDirection: S === "list" ? "column" : void 0
|
|
1101
1112
|
},
|
|
1102
|
-
children:
|
|
1103
|
-
const A = d.has(
|
|
1113
|
+
children: c.length === 0 ? /* @__PURE__ */ e("p", { children: "No attractions found." }) : c.map((s) => {
|
|
1114
|
+
const A = d.has(s.id);
|
|
1104
1115
|
return /* @__PURE__ */ i(
|
|
1105
1116
|
"div",
|
|
1106
1117
|
{
|
|
@@ -1109,17 +1120,17 @@ const hn = {
|
|
|
1109
1120
|
border: A ? "2px solid var(--color-primary, #6366f1)" : "1px solid var(--border-color, #cbd5e1)",
|
|
1110
1121
|
borderRadius: 8,
|
|
1111
1122
|
padding: 12,
|
|
1112
|
-
cursor:
|
|
1123
|
+
cursor: g ? "default" : "pointer",
|
|
1113
1124
|
background: A ? "color-mix(in srgb, var(--color-primary) 12%, transparent)" : "var(--bg-elevated, var(--bg-primary))",
|
|
1114
1125
|
transition: "all 0.2s"
|
|
1115
1126
|
},
|
|
1116
|
-
onClick: () =>
|
|
1127
|
+
onClick: () => w(s.id),
|
|
1117
1128
|
children: [
|
|
1118
|
-
|
|
1129
|
+
s.imageUrl && /* @__PURE__ */ e(
|
|
1119
1130
|
"img",
|
|
1120
1131
|
{
|
|
1121
|
-
src:
|
|
1122
|
-
alt:
|
|
1132
|
+
src: s.imageUrl,
|
|
1133
|
+
alt: s.name,
|
|
1123
1134
|
style: {
|
|
1124
1135
|
width: "100%",
|
|
1125
1136
|
borderRadius: 6,
|
|
@@ -1130,10 +1141,10 @@ const hn = {
|
|
|
1130
1141
|
}
|
|
1131
1142
|
),
|
|
1132
1143
|
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
1133
|
-
/* @__PURE__ */ e("span", { style: { display: "inline-flex" }, children:
|
|
1134
|
-
/* @__PURE__ */ e("strong", { children:
|
|
1144
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex" }, children: ne.createElement(ye[s.category], { size: 16 }) }),
|
|
1145
|
+
/* @__PURE__ */ e("strong", { children: s.name })
|
|
1135
1146
|
] }),
|
|
1136
|
-
|
|
1147
|
+
s.description && /* @__PURE__ */ e(
|
|
1137
1148
|
"p",
|
|
1138
1149
|
{
|
|
1139
1150
|
style: {
|
|
@@ -1141,7 +1152,7 @@ const hn = {
|
|
|
1141
1152
|
color: "var(--text-secondary, #64748b)",
|
|
1142
1153
|
margin: "6px 0"
|
|
1143
1154
|
},
|
|
1144
|
-
children:
|
|
1155
|
+
children: s.description
|
|
1145
1156
|
}
|
|
1146
1157
|
),
|
|
1147
1158
|
/* @__PURE__ */ i(
|
|
@@ -1154,7 +1165,7 @@ const hn = {
|
|
|
1154
1165
|
marginTop: 8
|
|
1155
1166
|
},
|
|
1156
1167
|
children: [
|
|
1157
|
-
|
|
1168
|
+
_ && /* @__PURE__ */ i(
|
|
1158
1169
|
"span",
|
|
1159
1170
|
{
|
|
1160
1171
|
style: {
|
|
@@ -1164,17 +1175,17 @@ const hn = {
|
|
|
1164
1175
|
gap: 4
|
|
1165
1176
|
},
|
|
1166
1177
|
children: [
|
|
1167
|
-
/* @__PURE__ */ e(
|
|
1178
|
+
/* @__PURE__ */ e(cn, { size: 14 }),
|
|
1168
1179
|
" ",
|
|
1169
|
-
|
|
1180
|
+
s.votes ?? 0
|
|
1170
1181
|
]
|
|
1171
1182
|
}
|
|
1172
1183
|
),
|
|
1173
|
-
!
|
|
1184
|
+
!g && m && /* @__PURE__ */ e(
|
|
1174
1185
|
"button",
|
|
1175
1186
|
{
|
|
1176
1187
|
onClick: (P) => {
|
|
1177
|
-
P.stopPropagation(), m(
|
|
1188
|
+
P.stopPropagation(), m(s.id);
|
|
1178
1189
|
},
|
|
1179
1190
|
style: { fontSize: 12 },
|
|
1180
1191
|
children: "Vote"
|
|
@@ -1185,7 +1196,7 @@ const hn = {
|
|
|
1185
1196
|
)
|
|
1186
1197
|
]
|
|
1187
1198
|
},
|
|
1188
|
-
|
|
1199
|
+
s.id
|
|
1189
1200
|
);
|
|
1190
1201
|
})
|
|
1191
1202
|
}
|
|
@@ -1194,54 +1205,54 @@ const hn = {
|
|
|
1194
1205
|
}
|
|
1195
1206
|
);
|
|
1196
1207
|
}
|
|
1197
|
-
),
|
|
1198
|
-
game:
|
|
1199
|
-
music:
|
|
1200
|
-
dance:
|
|
1201
|
-
quiz:
|
|
1202
|
-
karaoke:
|
|
1203
|
-
photo:
|
|
1204
|
-
custom:
|
|
1205
|
-
},
|
|
1206
|
-
function(
|
|
1208
|
+
), _n = {
|
|
1209
|
+
game: ke,
|
|
1210
|
+
music: q,
|
|
1211
|
+
dance: q,
|
|
1212
|
+
quiz: be,
|
|
1213
|
+
karaoke: _e,
|
|
1214
|
+
photo: Ne,
|
|
1215
|
+
custom: fe
|
|
1216
|
+
}, Rn = E(
|
|
1217
|
+
function(N, C) {
|
|
1207
1218
|
const {
|
|
1208
1219
|
attractions: t,
|
|
1209
1220
|
onVote: p,
|
|
1210
1221
|
onUnvote: u,
|
|
1211
1222
|
votedIds: m = [],
|
|
1212
|
-
maxVotes:
|
|
1213
|
-
closed:
|
|
1214
|
-
sortBy:
|
|
1215
|
-
showResults:
|
|
1216
|
-
className:
|
|
1217
|
-
style:
|
|
1218
|
-
} =
|
|
1223
|
+
maxVotes: h,
|
|
1224
|
+
closed: v = !1,
|
|
1225
|
+
sortBy: _ = "votes",
|
|
1226
|
+
showResults: g = !0,
|
|
1227
|
+
className: S,
|
|
1228
|
+
style: b
|
|
1229
|
+
} = N, l = I(() => new Set(m), [m]), o = h ? h - l.size : void 0, k = I(() => {
|
|
1219
1230
|
const n = [...t];
|
|
1220
|
-
switch (
|
|
1231
|
+
switch (_) {
|
|
1221
1232
|
case "votes":
|
|
1222
|
-
n.sort((
|
|
1233
|
+
n.sort((c, a) => (a.votes ?? 0) - (c.votes ?? 0));
|
|
1223
1234
|
break;
|
|
1224
1235
|
case "name":
|
|
1225
|
-
n.sort((
|
|
1236
|
+
n.sort((c, a) => c.name.localeCompare(a.name));
|
|
1226
1237
|
break;
|
|
1227
1238
|
case "category":
|
|
1228
|
-
n.sort((
|
|
1239
|
+
n.sort((c, a) => c.category.localeCompare(a.category));
|
|
1229
1240
|
break;
|
|
1230
1241
|
}
|
|
1231
1242
|
return n;
|
|
1232
|
-
}, [t,
|
|
1243
|
+
}, [t, _]), y = I(
|
|
1233
1244
|
() => Math.max(...t.map((n) => n.votes ?? 0), 1),
|
|
1234
1245
|
[t]
|
|
1235
|
-
),
|
|
1236
|
-
|
|
1246
|
+
), x = (n) => {
|
|
1247
|
+
v || (l.has(n) ? u == null || u(n) : (!o || o > 0) && (p == null || p(n)));
|
|
1237
1248
|
}, d = (n) => {
|
|
1238
1249
|
switch (n) {
|
|
1239
1250
|
case 0:
|
|
1240
|
-
return /* @__PURE__ */ e(
|
|
1251
|
+
return /* @__PURE__ */ e(on, { size: 18, primaryColor: "#f59e0b", title: "1st place" });
|
|
1241
1252
|
case 1:
|
|
1242
|
-
return /* @__PURE__ */ e(
|
|
1253
|
+
return /* @__PURE__ */ e(ue, { size: 18, primaryColor: "#94a3b8", title: "2nd place" });
|
|
1243
1254
|
case 2:
|
|
1244
|
-
return /* @__PURE__ */ e(
|
|
1255
|
+
return /* @__PURE__ */ e(ue, { size: 18, primaryColor: "#b45309", title: "3rd place" });
|
|
1245
1256
|
default:
|
|
1246
1257
|
return `${n + 1}.`;
|
|
1247
1258
|
}
|
|
@@ -1249,9 +1260,9 @@ const hn = {
|
|
|
1249
1260
|
return /* @__PURE__ */ i(
|
|
1250
1261
|
"div",
|
|
1251
1262
|
{
|
|
1252
|
-
ref:
|
|
1253
|
-
className: `nice-attraction-voting ${
|
|
1254
|
-
style: { color: "var(--text-primary)", ...
|
|
1263
|
+
ref: C,
|
|
1264
|
+
className: `nice-attraction-voting ${S ?? ""}`,
|
|
1265
|
+
style: { color: "var(--text-primary)", ...b },
|
|
1255
1266
|
children: [
|
|
1256
1267
|
/* @__PURE__ */ i(
|
|
1257
1268
|
"div",
|
|
@@ -1264,10 +1275,10 @@ const hn = {
|
|
|
1264
1275
|
},
|
|
1265
1276
|
children: [
|
|
1266
1277
|
/* @__PURE__ */ i("h3", { style: { margin: 0, display: "inline-flex", alignItems: "center", gap: 8 }, children: [
|
|
1267
|
-
/* @__PURE__ */ e(
|
|
1268
|
-
|
|
1278
|
+
/* @__PURE__ */ e(sn, { size: 20 }),
|
|
1279
|
+
v ? "Voting Results" : "Vote for Attractions"
|
|
1269
1280
|
] }),
|
|
1270
|
-
!
|
|
1281
|
+
!v && o !== void 0 && /* @__PURE__ */ i(
|
|
1271
1282
|
"span",
|
|
1272
1283
|
{
|
|
1273
1284
|
style: {
|
|
@@ -1285,9 +1296,9 @@ const hn = {
|
|
|
1285
1296
|
]
|
|
1286
1297
|
}
|
|
1287
1298
|
),
|
|
1288
|
-
|
|
1289
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children:
|
|
1290
|
-
const a =
|
|
1299
|
+
v && /* @__PURE__ */ e("p", { style: { color: "var(--text-secondary, #64748b)", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
1300
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: k.map((n, c) => {
|
|
1301
|
+
const a = l.has(n.id), w = n.votes ?? 0, s = g ? `${Math.round(w / y * 100)}%` : "0%";
|
|
1291
1302
|
return /* @__PURE__ */ i(
|
|
1292
1303
|
"div",
|
|
1293
1304
|
{
|
|
@@ -1299,13 +1310,13 @@ const hn = {
|
|
|
1299
1310
|
borderRadius: 8,
|
|
1300
1311
|
border: a ? "2px solid var(--color-primary, #6366f1)" : "1px solid var(--border-color, #cbd5e1)",
|
|
1301
1312
|
background: a ? "color-mix(in srgb, var(--color-primary) 12%, transparent)" : "var(--bg-elevated, var(--bg-primary))",
|
|
1302
|
-
cursor:
|
|
1313
|
+
cursor: v ? "default" : "pointer",
|
|
1303
1314
|
transition: "all 0.2s"
|
|
1304
1315
|
},
|
|
1305
|
-
onClick: () =>
|
|
1316
|
+
onClick: () => x(n.id),
|
|
1306
1317
|
children: [
|
|
1307
|
-
|
|
1308
|
-
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children:
|
|
1318
|
+
g && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: d(c) }),
|
|
1319
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: ne.createElement(_n[n.category], { size: 20 }) }),
|
|
1309
1320
|
/* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1310
1321
|
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: n.name }),
|
|
1311
1322
|
n.description && /* @__PURE__ */ e(
|
|
@@ -1321,7 +1332,7 @@ const hn = {
|
|
|
1321
1332
|
children: n.description
|
|
1322
1333
|
}
|
|
1323
1334
|
),
|
|
1324
|
-
|
|
1335
|
+
g && /* @__PURE__ */ e(
|
|
1325
1336
|
"div",
|
|
1326
1337
|
{
|
|
1327
1338
|
style: {
|
|
@@ -1336,7 +1347,7 @@ const hn = {
|
|
|
1336
1347
|
{
|
|
1337
1348
|
style: {
|
|
1338
1349
|
height: "100%",
|
|
1339
|
-
width:
|
|
1350
|
+
width: s,
|
|
1340
1351
|
background: "var(--color-primary, #6366f1)",
|
|
1341
1352
|
borderRadius: 3,
|
|
1342
1353
|
transition: "width 0.3s"
|
|
@@ -1346,12 +1357,12 @@ const hn = {
|
|
|
1346
1357
|
}
|
|
1347
1358
|
)
|
|
1348
1359
|
] }),
|
|
1349
|
-
|
|
1350
|
-
!
|
|
1360
|
+
g && /* @__PURE__ */ e("span", { style: { fontWeight: 600, fontSize: 16, minWidth: 40, textAlign: "right" }, children: w }),
|
|
1361
|
+
!v && /* @__PURE__ */ e(
|
|
1351
1362
|
"button",
|
|
1352
1363
|
{
|
|
1353
1364
|
onClick: (A) => {
|
|
1354
|
-
A.stopPropagation(),
|
|
1365
|
+
A.stopPropagation(), x(n.id);
|
|
1355
1366
|
},
|
|
1356
1367
|
style: {
|
|
1357
1368
|
padding: "4px 12px",
|
|
@@ -1370,7 +1381,7 @@ const hn = {
|
|
|
1370
1381
|
n.id
|
|
1371
1382
|
);
|
|
1372
1383
|
}) }),
|
|
1373
|
-
|
|
1384
|
+
g && /* @__PURE__ */ i(
|
|
1374
1385
|
"div",
|
|
1375
1386
|
{
|
|
1376
1387
|
style: {
|
|
@@ -1381,7 +1392,7 @@ const hn = {
|
|
|
1381
1392
|
},
|
|
1382
1393
|
children: [
|
|
1383
1394
|
"Total votes: ",
|
|
1384
|
-
t.reduce((n,
|
|
1395
|
+
t.reduce((n, c) => n + (c.votes ?? 0), 0)
|
|
1385
1396
|
]
|
|
1386
1397
|
}
|
|
1387
1398
|
)
|
|
@@ -1391,12 +1402,12 @@ const hn = {
|
|
|
1391
1402
|
}
|
|
1392
1403
|
);
|
|
1393
1404
|
export {
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1405
|
+
Pn as NiceAttractionPicker,
|
|
1406
|
+
Rn as NiceAttractionVoting,
|
|
1407
|
+
wn as NiceEventMedia,
|
|
1408
|
+
zn as NiceEventPlanning,
|
|
1409
|
+
Tn as NiceKaraokePicker,
|
|
1410
|
+
In as NiceRoundCard,
|
|
1411
|
+
An as NiceRoundList,
|
|
1412
|
+
Ln as NiceSongPicker
|
|
1402
1413
|
};
|