@nex125/seatmap-viewer 0.1.21 → 0.1.23
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/SeatmapViewer.d.ts +76 -0
- package/dist/index.cjs +762 -879
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -24
- package/dist/index.js +755 -874
- package/dist/index.js.map +1 -1
- package/dist/styleContract.d.ts +14 -0
- package/dist/theme/seatmapViewerTheme.d.ts +11 -0
- package/package.json +10 -10
- package/src/theme/seatmapViewerTheme.css +8 -2
- package/dist/_tsup-dts-rollup.d.cts +0 -173
- package/dist/_tsup-dts-rollup.d.ts +0 -173
- package/dist/index.d.cts +0 -24
package/dist/index.js
CHANGED
|
@@ -1,903 +1,784 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AVAILABLE_STATUS_ID } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { AVAILABLE_STATUS_ID } from "@nex125/seatmap-core";
|
|
3
|
+
import { SeatmapCanvas, SeatmapProvider, TooltipOverlay, useSeatStatus, useSelection } from "@nex125/seatmap-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
5
|
// src/SeatmapViewer.tsx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
6
|
+
const defaultSeatmapViewerMessages = {
|
|
7
|
+
uncategorizedCategoryName: "Uncategorized",
|
|
8
|
+
sectionFallbackLabel: "Section",
|
|
9
|
+
tableLabel: (tableLabel) => `Table ${tableLabel}`,
|
|
10
|
+
tooltipSeatLabel: (rowLabel, seatLabel) => `Row ${rowLabel}, Seat ${seatLabel}`,
|
|
11
|
+
tooltipStatusAvailable: "Available",
|
|
12
|
+
tooltipPriceLabel: (price) => `Price: ${price}`,
|
|
13
|
+
tooltipPriceUnavailable: "Price unavailable",
|
|
14
|
+
legendAriaLabel: "Seatmap legend",
|
|
15
|
+
legendStatusesTitle: "Seat statuses",
|
|
16
|
+
legendPricesTitle: "Prices",
|
|
17
|
+
cartChipLabel: (selectedCount) => `Cart (${selectedCount})`,
|
|
18
|
+
cartAriaLabel: "Selected seats cart",
|
|
19
|
+
cartHeaderTitle: "Selected seats cart",
|
|
20
|
+
cartCloseLabel: "Close cart",
|
|
21
|
+
cartEmptyState: "No seats selected yet.",
|
|
22
|
+
cartGroupMeta: (count, unitPrice) => `${count} tickets - ${unitPrice} each`,
|
|
23
|
+
cartGroupFee: (basePrice, serviceFee, serviceFeePercent) => serviceFeePercent ? `Base ${basePrice} + service fee ${serviceFee} (${serviceFeePercent})` : `Base ${basePrice} + service fee ${serviceFee}`,
|
|
24
|
+
cartRemoveOneAriaLabel: (categoryName) => `Remove one seat from ${categoryName}`,
|
|
25
|
+
cartAddOneAriaLabel: (categoryName) => `Add one seat to ${categoryName}`,
|
|
26
|
+
cartRemoveSeatTitle: "Remove seat",
|
|
27
|
+
cartRemoveSeatAriaLabel: (seatLabel) => `Remove seat ${seatLabel}`,
|
|
28
|
+
cartServiceFeeSummary: (serviceFeeTotal) => `Service fee included: ${serviceFeeTotal}`,
|
|
29
|
+
cartSummary: (count, totalCost) => `${count} seats - Total ${totalCost}`,
|
|
30
|
+
cartProceedButton: "Proceed"
|
|
33
31
|
};
|
|
34
32
|
function getCategoryPriceBreakdown(category) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
serviceFee
|
|
58
|
-
};
|
|
33
|
+
if (!category) return {
|
|
34
|
+
unitPrice: 0,
|
|
35
|
+
baseUnitPrice: 0,
|
|
36
|
+
serviceFee: 0
|
|
37
|
+
};
|
|
38
|
+
const baseUnitPrice = Number.isFinite(category.basePrice) ? category.basePrice : 0;
|
|
39
|
+
const serviceFee = Number.isFinite(category.serviceFee) ? category.serviceFee : 0;
|
|
40
|
+
if (category.isPriceOverridden && Number.isFinite(category.overriddenPrice)) return {
|
|
41
|
+
unitPrice: category.overriddenPrice ?? 0,
|
|
42
|
+
baseUnitPrice,
|
|
43
|
+
serviceFee
|
|
44
|
+
};
|
|
45
|
+
if (Number.isFinite(category.backendPrice)) return {
|
|
46
|
+
unitPrice: category.backendPrice,
|
|
47
|
+
baseUnitPrice,
|
|
48
|
+
serviceFee
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
unitPrice: baseUnitPrice + serviceFee,
|
|
52
|
+
baseUnitPrice,
|
|
53
|
+
serviceFee
|
|
54
|
+
};
|
|
59
55
|
}
|
|
60
56
|
function formatPercent(value, locale) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
return new Intl.NumberFormat(locale, {
|
|
58
|
+
style: "percent",
|
|
59
|
+
maximumFractionDigits: 2
|
|
60
|
+
}).format(value);
|
|
65
61
|
}
|
|
66
62
|
function formatMoney(value, locale, currency) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
return new Intl.NumberFormat(locale, {
|
|
64
|
+
style: "currency",
|
|
65
|
+
currency
|
|
66
|
+
}).format(value);
|
|
71
67
|
}
|
|
72
|
-
function DefaultSeatmapViewerTooltip({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
marginTop: 2
|
|
115
|
-
},
|
|
116
|
-
children: priceLabel
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
);
|
|
68
|
+
function DefaultSeatmapViewerTooltip({ data, locale, currency, messages }) {
|
|
69
|
+
const statusLabel = data.statusName ?? (data.seat.status === AVAILABLE_STATUS_ID ? messages.tooltipStatusAvailable : data.seat.status);
|
|
70
|
+
const priceLabel = typeof data.price === "number" ? messages.tooltipPriceLabel(formatMoney(data.price, locale, currency)) : messages.tooltipPriceUnavailable;
|
|
71
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
72
|
+
style: {
|
|
73
|
+
background: "var(--seatmap-tooltip-surface, color-mix(in srgb, var(--seatmap-surface-container-low, #181818) 94%, transparent))",
|
|
74
|
+
border: "1px solid var(--seatmap-tooltip-border, var(--seatmap-outline, #353331))",
|
|
75
|
+
borderRadius: 10,
|
|
76
|
+
padding: "8px 14px",
|
|
77
|
+
color: "var(--seatmap-tooltip-text, var(--seatmap-on-surface, #e5e2e1))",
|
|
78
|
+
fontSize: 13,
|
|
79
|
+
fontFamily: "system-ui",
|
|
80
|
+
pointerEvents: "none",
|
|
81
|
+
whiteSpace: "nowrap"
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ jsx("div", {
|
|
85
|
+
style: {
|
|
86
|
+
fontWeight: 600,
|
|
87
|
+
marginBottom: 2
|
|
88
|
+
},
|
|
89
|
+
children: data.section.label
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ jsx("div", { children: messages.tooltipSeatLabel(data.row.label, data.seat.label) }),
|
|
92
|
+
/* @__PURE__ */ jsx("div", {
|
|
93
|
+
style: {
|
|
94
|
+
color: "var(--seatmap-tooltip-muted-text, var(--seatmap-on-surface-variant, #9a9694))",
|
|
95
|
+
fontSize: 12,
|
|
96
|
+
marginTop: 2
|
|
97
|
+
},
|
|
98
|
+
children: statusLabel
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx("div", {
|
|
101
|
+
style: {
|
|
102
|
+
color: "var(--seatmap-tooltip-muted-text, var(--seatmap-on-surface-variant, #9a9694))",
|
|
103
|
+
fontSize: 12,
|
|
104
|
+
marginTop: 2
|
|
105
|
+
},
|
|
106
|
+
children: priceLabel
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
});
|
|
122
110
|
}
|
|
123
111
|
function TrashIcon() {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
112
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
113
|
+
width: "12",
|
|
114
|
+
height: "12",
|
|
115
|
+
viewBox: "0 0 24 24",
|
|
116
|
+
fill: "none",
|
|
117
|
+
"aria-hidden": "true",
|
|
118
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
119
|
+
d: "M9 3h6l1 2h4v2H4V5h4l1-2Zm1 7h2v8h-2v-8Zm4 0h2v8h-2v-8ZM7 10h2v8H7v-8Zm-1 12h12a2 2 0 0 0 2-2V8H4v12a2 2 0 0 0 2 2Z",
|
|
120
|
+
fill: "currentColor"
|
|
121
|
+
})
|
|
122
|
+
});
|
|
131
123
|
}
|
|
132
124
|
function mergeStyles(base, override) {
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
if (!override) return base;
|
|
126
|
+
return {
|
|
127
|
+
...base,
|
|
128
|
+
...override
|
|
129
|
+
};
|
|
135
130
|
}
|
|
136
131
|
function mergeClassNames(...classNames) {
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
const merged = classNames.filter(Boolean).join(" ").trim();
|
|
133
|
+
return merged.length > 0 ? merged : void 0;
|
|
139
134
|
}
|
|
140
|
-
function SeatmapViewerContent({
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
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
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
type: "button",
|
|
598
|
-
className: mergeClassNames("seatmap-viewer__cart-icon-button-base", classNames.cartIconButton),
|
|
599
|
-
style: styles.cartIconButton,
|
|
600
|
-
onClick: () => handleAddSeatInCategory(group.categoryId),
|
|
601
|
-
disabled: group.availableToAdd === 0,
|
|
602
|
-
"aria-label": messages.cartAddOneAriaLabel(group.categoryName),
|
|
603
|
-
children: "+"
|
|
604
|
-
}
|
|
605
|
-
)
|
|
606
|
-
] }),
|
|
607
|
-
/* @__PURE__ */ jsx(
|
|
608
|
-
"span",
|
|
609
|
-
{
|
|
610
|
-
className: mergeClassNames("seatmap-viewer__cart-group-total-base", classNames.cartGroupTotal),
|
|
611
|
-
style: styles.cartGroupTotal,
|
|
612
|
-
children: formatMoney(group.seats.reduce((sum, seat) => sum + seat.unitPrice, 0), locale, currency)
|
|
613
|
-
}
|
|
614
|
-
)
|
|
615
|
-
] }),
|
|
616
|
-
/* @__PURE__ */ jsx("div", { className: "seatmap-viewer__cart-seat-list", children: group.seats.map((seat) => /* @__PURE__ */ jsxs(
|
|
617
|
-
"div",
|
|
618
|
-
{
|
|
619
|
-
className: mergeClassNames("seatmap-viewer__cart-seat-row-base", classNames.cartSeatRow),
|
|
620
|
-
style: styles.cartSeatRow,
|
|
621
|
-
children: [
|
|
622
|
-
/* @__PURE__ */ jsxs(
|
|
623
|
-
"span",
|
|
624
|
-
{
|
|
625
|
-
className: mergeClassNames("seatmap-viewer__cart-seat-label-base", classNames.cartSeatLabel),
|
|
626
|
-
style: styles.cartSeatLabel,
|
|
627
|
-
children: [
|
|
628
|
-
seat.sectionLabel ?? messages.sectionFallbackLabel,
|
|
629
|
-
" ",
|
|
630
|
-
seat.rowLabel ? `- ${seat.rowLabel}${seat.seatLabel}` : `- ${seat.seatLabel}`
|
|
631
|
-
]
|
|
632
|
-
}
|
|
633
|
-
),
|
|
634
|
-
/* @__PURE__ */ jsx(
|
|
635
|
-
"button",
|
|
636
|
-
{
|
|
637
|
-
type: "button",
|
|
638
|
-
className: mergeClassNames("seatmap-viewer__cart-icon-button-base", classNames.cartIconButton),
|
|
639
|
-
style: styles.cartIconButton,
|
|
640
|
-
onClick: () => removeSeatFromSelection(seat.seatId),
|
|
641
|
-
title: messages.cartRemoveSeatTitle,
|
|
642
|
-
"aria-label": messages.cartRemoveSeatAriaLabel(seat.seatLabel),
|
|
643
|
-
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
644
|
-
}
|
|
645
|
-
)
|
|
646
|
-
]
|
|
647
|
-
},
|
|
648
|
-
seat.seatId
|
|
649
|
-
)) })
|
|
650
|
-
]
|
|
651
|
-
},
|
|
652
|
-
group.categoryId
|
|
653
|
-
))
|
|
654
|
-
}
|
|
655
|
-
),
|
|
656
|
-
/* @__PURE__ */ jsxs(
|
|
657
|
-
"div",
|
|
658
|
-
{
|
|
659
|
-
className: mergeClassNames("seatmap-viewer__cart-footer-base", classNames.cartFooter),
|
|
660
|
-
style: styles.cartFooter,
|
|
661
|
-
children: [
|
|
662
|
-
/* @__PURE__ */ jsxs(
|
|
663
|
-
"div",
|
|
664
|
-
{
|
|
665
|
-
className: mergeClassNames("seatmap-viewer__cart-summary-base", classNames.cartSummary),
|
|
666
|
-
style: styles.cartSummary,
|
|
667
|
-
children: [
|
|
668
|
-
totalServiceFee > 0 && /* @__PURE__ */ jsx("div", { children: messages.cartServiceFeeSummary(formatMoney(totalServiceFee, locale, currency)) }),
|
|
669
|
-
/* @__PURE__ */ jsx("div", { children: messages.cartSummary(totalSelectedSeats, formatMoney(totalCost, locale, currency)) })
|
|
670
|
-
]
|
|
671
|
-
}
|
|
672
|
-
),
|
|
673
|
-
/* @__PURE__ */ jsx(
|
|
674
|
-
"button",
|
|
675
|
-
{
|
|
676
|
-
type: "button",
|
|
677
|
-
disabled: cartSeats.length === 0,
|
|
678
|
-
onClick: handleProceed,
|
|
679
|
-
className: mergeClassNames("seatmap-viewer__cart-proceed-button-base", classNames.cartProceedButton),
|
|
680
|
-
style: styles.cartProceedButton,
|
|
681
|
-
children: messages.cartProceedButton
|
|
682
|
-
}
|
|
683
|
-
)
|
|
684
|
-
]
|
|
685
|
-
}
|
|
686
|
-
)
|
|
687
|
-
]
|
|
688
|
-
}
|
|
689
|
-
),
|
|
690
|
-
showLabels && /* @__PURE__ */ jsx(TooltipOverlay, { renderTooltip: effectiveTooltipRenderer })
|
|
691
|
-
]
|
|
692
|
-
}
|
|
693
|
-
);
|
|
135
|
+
function SeatmapViewerContent({ venue, onSeatClick, onSeatHover, onSelectionChange, renderTooltip, showLabels, onCartEvent, locale = "en-US", currency = "BYN", maxSelectedSeats, styles = {}, classNames = {}, messages: messagesOverride = {} }) {
|
|
136
|
+
const messages = useMemo(() => ({
|
|
137
|
+
...defaultSeatmapViewerMessages,
|
|
138
|
+
...messagesOverride
|
|
139
|
+
}), [messagesOverride]);
|
|
140
|
+
const { selectedSeatIds, setSelection } = useSelection();
|
|
141
|
+
const [isCartOpen, setIsCartOpen] = useState(false);
|
|
142
|
+
const [lastUserAnchorByCategory, setLastUserAnchorByCategory] = useState({});
|
|
143
|
+
const [viewportWidth, setViewportWidth] = useState(() => typeof window === "undefined" ? 1280 : window.innerWidth);
|
|
144
|
+
const previousSelectedRef = useRef([]);
|
|
145
|
+
const pendingSeatClickRef = useRef(null);
|
|
146
|
+
const showStatuses = venue.seatStatuses.length > 0;
|
|
147
|
+
const showCategories = venue.categories.length > 0;
|
|
148
|
+
const selectedSeatIdArray = useMemo(() => Array.from(selectedSeatIds), [selectedSeatIds]);
|
|
149
|
+
const seatDetailsById = useMemo(() => {
|
|
150
|
+
const categoryMap = new Map(venue.categories.map((category) => [category.id, category]));
|
|
151
|
+
const next = /* @__PURE__ */ new Map();
|
|
152
|
+
for (const section of venue.sections) {
|
|
153
|
+
const cos = Math.cos(section.rotation);
|
|
154
|
+
const sin = Math.sin(section.rotation);
|
|
155
|
+
for (const row of section.rows) for (const seat of row.seats) {
|
|
156
|
+
const category = categoryMap.get(seat.categoryId);
|
|
157
|
+
const priceBreakdown = getCategoryPriceBreakdown(category);
|
|
158
|
+
next.set(seat.id, {
|
|
159
|
+
seatId: seat.id,
|
|
160
|
+
seatLabel: seat.label,
|
|
161
|
+
rowLabel: row.label,
|
|
162
|
+
sectionId: section.id,
|
|
163
|
+
sectionLabel: section.label,
|
|
164
|
+
categoryId: seat.categoryId,
|
|
165
|
+
categoryName: category?.name ?? messages.uncategorizedCategoryName,
|
|
166
|
+
unitPrice: priceBreakdown.unitPrice,
|
|
167
|
+
baseUnitPrice: priceBreakdown.baseUnitPrice,
|
|
168
|
+
serviceFee: priceBreakdown.serviceFee,
|
|
169
|
+
status: seat.status,
|
|
170
|
+
x: section.position.x + seat.position.x * cos - seat.position.y * sin,
|
|
171
|
+
y: section.position.y + seat.position.x * sin + seat.position.y * cos
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
for (const table of venue.tables) for (const seat of table.seats) {
|
|
176
|
+
const category = categoryMap.get(seat.categoryId);
|
|
177
|
+
const priceBreakdown = getCategoryPriceBreakdown(category);
|
|
178
|
+
next.set(seat.id, {
|
|
179
|
+
seatId: seat.id,
|
|
180
|
+
seatLabel: seat.label,
|
|
181
|
+
rowLabel: null,
|
|
182
|
+
sectionId: table.id,
|
|
183
|
+
sectionLabel: messages.tableLabel(table.label),
|
|
184
|
+
categoryId: seat.categoryId,
|
|
185
|
+
categoryName: category?.name ?? messages.uncategorizedCategoryName,
|
|
186
|
+
unitPrice: priceBreakdown.unitPrice,
|
|
187
|
+
baseUnitPrice: priceBreakdown.baseUnitPrice,
|
|
188
|
+
serviceFee: priceBreakdown.serviceFee,
|
|
189
|
+
status: seat.status,
|
|
190
|
+
x: table.position.x + seat.position.x,
|
|
191
|
+
y: table.position.y + seat.position.y
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return next;
|
|
195
|
+
}, [venue, messages]);
|
|
196
|
+
const selectedSeats = useMemo(() => {
|
|
197
|
+
const ordered = [];
|
|
198
|
+
for (const selectedSeatId of selectedSeatIdArray) {
|
|
199
|
+
const seat = seatDetailsById.get(selectedSeatId);
|
|
200
|
+
if (seat) ordered.push(seat);
|
|
201
|
+
}
|
|
202
|
+
return ordered;
|
|
203
|
+
}, [seatDetailsById, selectedSeatIdArray]);
|
|
204
|
+
useEffect(() => {
|
|
205
|
+
onSelectionChange?.(selectedSeatIdArray);
|
|
206
|
+
}, [onSelectionChange, selectedSeatIdArray]);
|
|
207
|
+
useEffect(() => {
|
|
208
|
+
const previous = new Set(previousSelectedRef.current);
|
|
209
|
+
const added = selectedSeatIdArray.filter((seatId) => !previous.has(seatId));
|
|
210
|
+
const clickedSeatId = pendingSeatClickRef.current;
|
|
211
|
+
if (clickedSeatId && added.includes(clickedSeatId)) {
|
|
212
|
+
const clickedSeat = seatDetailsById.get(clickedSeatId);
|
|
213
|
+
if (clickedSeat) setLastUserAnchorByCategory((current) => ({
|
|
214
|
+
...current,
|
|
215
|
+
[clickedSeat.categoryId]: clickedSeatId
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
218
|
+
previousSelectedRef.current = selectedSeatIdArray;
|
|
219
|
+
pendingSeatClickRef.current = null;
|
|
220
|
+
}, [seatDetailsById, selectedSeatIdArray]);
|
|
221
|
+
useEffect(() => {
|
|
222
|
+
if (typeof window === "undefined") return;
|
|
223
|
+
const onResize = () => setViewportWidth(window.innerWidth);
|
|
224
|
+
window.addEventListener("resize", onResize);
|
|
225
|
+
return () => window.removeEventListener("resize", onResize);
|
|
226
|
+
}, []);
|
|
227
|
+
const cartSeats = useMemo(() => selectedSeats.map((seat) => ({
|
|
228
|
+
seatId: seat.seatId,
|
|
229
|
+
seatLabel: seat.seatLabel,
|
|
230
|
+
rowLabel: seat.rowLabel,
|
|
231
|
+
sectionId: seat.sectionId,
|
|
232
|
+
sectionLabel: seat.sectionLabel,
|
|
233
|
+
categoryId: seat.categoryId,
|
|
234
|
+
categoryName: seat.categoryName,
|
|
235
|
+
unitPrice: seat.unitPrice,
|
|
236
|
+
baseUnitPrice: seat.baseUnitPrice,
|
|
237
|
+
serviceFee: seat.serviceFee
|
|
238
|
+
})), [selectedSeats]);
|
|
239
|
+
const totalSelectedSeats = useMemo(() => cartSeats.length, [cartSeats]);
|
|
240
|
+
const isSelectionOverLimit = typeof maxSelectedSeats === "number" && totalSelectedSeats > maxSelectedSeats;
|
|
241
|
+
const totalCost = useMemo(() => cartSeats.reduce((sum, seat) => sum + seat.unitPrice, 0), [cartSeats]);
|
|
242
|
+
const totalServiceFee = useMemo(() => cartSeats.reduce((sum, seat) => sum + seat.serviceFee, 0), [cartSeats]);
|
|
243
|
+
const effectiveTooltipRenderer = useCallback((data) => {
|
|
244
|
+
if (renderTooltip) return renderTooltip(data);
|
|
245
|
+
return /* @__PURE__ */ jsx(DefaultSeatmapViewerTooltip, {
|
|
246
|
+
data,
|
|
247
|
+
locale,
|
|
248
|
+
currency,
|
|
249
|
+
messages
|
|
250
|
+
});
|
|
251
|
+
}, [
|
|
252
|
+
currency,
|
|
253
|
+
locale,
|
|
254
|
+
messages,
|
|
255
|
+
renderTooltip
|
|
256
|
+
]);
|
|
257
|
+
const groupedSeatsList = useMemo(() => {
|
|
258
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
259
|
+
for (const seat of cartSeats) {
|
|
260
|
+
const existing = grouped.get(seat.categoryId);
|
|
261
|
+
if (existing) existing.seats.push(seat);
|
|
262
|
+
else grouped.set(seat.categoryId, {
|
|
263
|
+
categoryName: seat.categoryName,
|
|
264
|
+
unitPrice: seat.unitPrice,
|
|
265
|
+
baseUnitPrice: seat.baseUnitPrice,
|
|
266
|
+
serviceFee: seat.serviceFee,
|
|
267
|
+
seats: [seat]
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
const ordered = [];
|
|
271
|
+
const selectedSet = new Set(selectedSeatIdArray);
|
|
272
|
+
const availableToAddByCategory = /* @__PURE__ */ new Map();
|
|
273
|
+
for (const seat of seatDetailsById.values()) {
|
|
274
|
+
if (seat.status !== AVAILABLE_STATUS_ID || selectedSet.has(seat.seatId)) continue;
|
|
275
|
+
availableToAddByCategory.set(seat.categoryId, (availableToAddByCategory.get(seat.categoryId) ?? 0) + 1);
|
|
276
|
+
}
|
|
277
|
+
for (const category of venue.categories) {
|
|
278
|
+
const group = grouped.get(category.id);
|
|
279
|
+
if (!group) continue;
|
|
280
|
+
ordered.push({
|
|
281
|
+
categoryId: category.id,
|
|
282
|
+
categoryName: group.categoryName,
|
|
283
|
+
unitPrice: group.unitPrice,
|
|
284
|
+
baseUnitPrice: group.baseUnitPrice,
|
|
285
|
+
serviceFee: group.serviceFee,
|
|
286
|
+
seats: group.seats,
|
|
287
|
+
availableToAdd: availableToAddByCategory.get(category.id) ?? 0
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
for (const [categoryId, group] of grouped.entries()) {
|
|
291
|
+
if (venue.categories.some((category) => category.id === categoryId)) continue;
|
|
292
|
+
ordered.push({
|
|
293
|
+
categoryId,
|
|
294
|
+
categoryName: group.categoryName,
|
|
295
|
+
unitPrice: group.unitPrice,
|
|
296
|
+
baseUnitPrice: group.baseUnitPrice,
|
|
297
|
+
serviceFee: group.serviceFee,
|
|
298
|
+
seats: group.seats,
|
|
299
|
+
availableToAdd: availableToAddByCategory.get(categoryId) ?? 0
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
return ordered;
|
|
303
|
+
}, [
|
|
304
|
+
cartSeats,
|
|
305
|
+
seatDetailsById,
|
|
306
|
+
selectedSeatIdArray,
|
|
307
|
+
venue.categories
|
|
308
|
+
]);
|
|
309
|
+
const cartPayload = useMemo(() => ({
|
|
310
|
+
venueId: venue.id,
|
|
311
|
+
venueName: venue.name,
|
|
312
|
+
seats: cartSeats,
|
|
313
|
+
totalSelectedSeats,
|
|
314
|
+
totalCost
|
|
315
|
+
}), [
|
|
316
|
+
venue.id,
|
|
317
|
+
venue.name,
|
|
318
|
+
cartSeats,
|
|
319
|
+
totalSelectedSeats,
|
|
320
|
+
totalCost
|
|
321
|
+
]);
|
|
322
|
+
const emitCartEvent = useCallback((event) => {
|
|
323
|
+
onCartEvent?.(event);
|
|
324
|
+
}, [onCartEvent]);
|
|
325
|
+
const removeSeatFromSelection = useCallback((seatId) => {
|
|
326
|
+
const seat = seatDetailsById.get(seatId);
|
|
327
|
+
if (seat?.sectionId) onSeatClick?.(seatId, seat.sectionId);
|
|
328
|
+
const next = selectedSeatIdArray.filter((id) => id !== seatId);
|
|
329
|
+
setSelection(next);
|
|
330
|
+
}, [
|
|
331
|
+
seatDetailsById,
|
|
332
|
+
onSeatClick,
|
|
333
|
+
selectedSeatIdArray,
|
|
334
|
+
setSelection
|
|
335
|
+
]);
|
|
336
|
+
const handleSeatCanvasClick = useCallback((seatId, sectionId) => {
|
|
337
|
+
pendingSeatClickRef.current = seatId;
|
|
338
|
+
onSeatClick?.(seatId, sectionId);
|
|
339
|
+
}, [onSeatClick]);
|
|
340
|
+
const handleAddSeatInCategory = useCallback((categoryId) => {
|
|
341
|
+
const selectedSet = new Set(selectedSeatIdArray);
|
|
342
|
+
const selectedInCategory = selectedSeatIdArray.filter((selectedSeatId) => seatDetailsById.get(selectedSeatId)?.categoryId === categoryId);
|
|
343
|
+
const anchorSeatId = (lastUserAnchorByCategory[categoryId] && seatDetailsById.has(lastUserAnchorByCategory[categoryId]) ? lastUserAnchorByCategory[categoryId] : null) ?? selectedInCategory[selectedInCategory.length - 1] ?? null;
|
|
344
|
+
const anchorSeat = anchorSeatId ? seatDetailsById.get(anchorSeatId) : null;
|
|
345
|
+
const candidates = Array.from(seatDetailsById.values()).filter((seat) => seat.categoryId === categoryId && seat.status === AVAILABLE_STATUS_ID && !selectedSet.has(seat.seatId));
|
|
346
|
+
if (candidates.length === 0) return;
|
|
347
|
+
let nextSeat = candidates[0];
|
|
348
|
+
if (anchorSeat) nextSeat = candidates.reduce((best, candidate) => {
|
|
349
|
+
const bestDistance = (best.x - anchorSeat.x) ** 2 + (best.y - anchorSeat.y) ** 2;
|
|
350
|
+
return (candidate.x - anchorSeat.x) ** 2 + (candidate.y - anchorSeat.y) ** 2 < bestDistance ? candidate : best;
|
|
351
|
+
}, candidates[0]);
|
|
352
|
+
setSelection([...selectedSeatIdArray, nextSeat.seatId]);
|
|
353
|
+
if (nextSeat.sectionId) onSeatClick?.(nextSeat.seatId, nextSeat.sectionId);
|
|
354
|
+
}, [
|
|
355
|
+
lastUserAnchorByCategory,
|
|
356
|
+
seatDetailsById,
|
|
357
|
+
selectedSeatIdArray,
|
|
358
|
+
setSelection,
|
|
359
|
+
onSeatClick
|
|
360
|
+
]);
|
|
361
|
+
const handleRemoveLastInCategory = useCallback((categoryId) => {
|
|
362
|
+
const selectedInCategory = selectedSeatIdArray.filter((selectedSeatId) => seatDetailsById.get(selectedSeatId)?.categoryId === categoryId);
|
|
363
|
+
const seatIdToRemove = selectedInCategory[selectedInCategory.length - 1];
|
|
364
|
+
if (!seatIdToRemove) return;
|
|
365
|
+
const seat = seatDetailsById.get(seatIdToRemove);
|
|
366
|
+
if (seat?.sectionId) onSeatClick?.(seatIdToRemove, seat.sectionId);
|
|
367
|
+
setSelection(selectedSeatIdArray.filter((selectedSeatId) => selectedSeatId !== seatIdToRemove));
|
|
368
|
+
}, [
|
|
369
|
+
seatDetailsById,
|
|
370
|
+
selectedSeatIdArray,
|
|
371
|
+
setSelection,
|
|
372
|
+
onSeatClick
|
|
373
|
+
]);
|
|
374
|
+
const handleProceed = useCallback(() => {
|
|
375
|
+
if (cartPayload.seats.length === 0 || isSelectionOverLimit) return;
|
|
376
|
+
emitCartEvent({
|
|
377
|
+
type: "cart-proceed-clicked",
|
|
378
|
+
payload: cartPayload
|
|
379
|
+
});
|
|
380
|
+
}, [
|
|
381
|
+
cartPayload,
|
|
382
|
+
emitCartEvent,
|
|
383
|
+
isSelectionOverLimit
|
|
384
|
+
]);
|
|
385
|
+
const cartWidth = viewportWidth > 1200 ? Math.floor(viewportWidth / 5) : viewportWidth;
|
|
386
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
387
|
+
className: classNames.root,
|
|
388
|
+
style: mergeStyles({
|
|
389
|
+
width: "100%",
|
|
390
|
+
height: "100%",
|
|
391
|
+
position: "relative"
|
|
392
|
+
}, styles.root),
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ jsx(SeatmapCanvas, {
|
|
395
|
+
onSeatClick: handleSeatCanvasClick,
|
|
396
|
+
onSeatHover,
|
|
397
|
+
showSectionLabels: showLabels,
|
|
398
|
+
enableSeatHover: showLabels
|
|
399
|
+
}),
|
|
400
|
+
(showStatuses || showCategories) && /* @__PURE__ */ jsxs("aside", {
|
|
401
|
+
"aria-label": messages.legendAriaLabel,
|
|
402
|
+
className: mergeClassNames("seatmap-viewer__legend", classNames.legendContainer),
|
|
403
|
+
style: styles.legendContainer,
|
|
404
|
+
children: [
|
|
405
|
+
showStatuses && /* @__PURE__ */ jsxs("section", {
|
|
406
|
+
className: "seatmap-viewer__legend-section",
|
|
407
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
408
|
+
className: mergeClassNames("seatmap-viewer__legend-heading-base", classNames.legendHeading),
|
|
409
|
+
style: styles.legendHeading,
|
|
410
|
+
children: messages.legendStatusesTitle
|
|
411
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
412
|
+
className: mergeClassNames("seatmap-viewer__legend-list-base", classNames.legendList),
|
|
413
|
+
style: styles.legendList,
|
|
414
|
+
children: venue.seatStatuses.map((status) => /* @__PURE__ */ jsxs("li", {
|
|
415
|
+
className: mergeClassNames("seatmap-viewer__legend-item-base", classNames.legendItem),
|
|
416
|
+
style: styles.legendItem,
|
|
417
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
418
|
+
className: mergeClassNames("seatmap-viewer__legend-swatch-base", classNames.legendSwatch),
|
|
419
|
+
style: mergeStyles({ background: status.color }, styles.legendSwatch)
|
|
420
|
+
}), /* @__PURE__ */ jsx("span", { children: status.name })]
|
|
421
|
+
}, status.id))
|
|
422
|
+
})]
|
|
423
|
+
}),
|
|
424
|
+
showStatuses && showCategories && /* @__PURE__ */ jsx("div", {
|
|
425
|
+
className: mergeClassNames("seatmap-viewer__legend-divider-base", classNames.legendDivider),
|
|
426
|
+
style: styles.legendDivider
|
|
427
|
+
}),
|
|
428
|
+
showCategories && /* @__PURE__ */ jsxs("section", {
|
|
429
|
+
className: "seatmap-viewer__legend-section",
|
|
430
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
431
|
+
className: mergeClassNames("seatmap-viewer__legend-heading-base", classNames.legendHeading),
|
|
432
|
+
style: styles.legendHeading,
|
|
433
|
+
children: messages.legendPricesTitle
|
|
434
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
435
|
+
className: mergeClassNames("seatmap-viewer__legend-list-base", classNames.legendList),
|
|
436
|
+
style: styles.legendList,
|
|
437
|
+
children: venue.categories.map((category) => /* @__PURE__ */ jsxs("li", {
|
|
438
|
+
className: mergeClassNames("seatmap-viewer__legend-item-base", classNames.legendItem),
|
|
439
|
+
style: styles.legendItem,
|
|
440
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
441
|
+
className: mergeClassNames("seatmap-viewer__legend-swatch-base", classNames.legendSwatch),
|
|
442
|
+
style: mergeStyles({ background: category.color }, styles.legendSwatch)
|
|
443
|
+
}), /* @__PURE__ */ jsx("span", { children: category.name })]
|
|
444
|
+
}, category.id))
|
|
445
|
+
})]
|
|
446
|
+
})
|
|
447
|
+
]
|
|
448
|
+
}),
|
|
449
|
+
!isCartOpen && /* @__PURE__ */ jsx("button", {
|
|
450
|
+
type: "button",
|
|
451
|
+
className: mergeClassNames("seatmap-viewer__cart-chip-base", classNames.cartChip),
|
|
452
|
+
onClick: () => setIsCartOpen(true),
|
|
453
|
+
disabled: isSelectionOverLimit,
|
|
454
|
+
style: styles.cartChip,
|
|
455
|
+
children: messages.cartChipLabel(totalSelectedSeats)
|
|
456
|
+
}),
|
|
457
|
+
isCartOpen && /* @__PURE__ */ jsxs("aside", {
|
|
458
|
+
"aria-label": messages.cartAriaLabel,
|
|
459
|
+
className: mergeClassNames("seatmap-viewer__cart-popup-base", classNames.cartPopup),
|
|
460
|
+
style: mergeStyles({
|
|
461
|
+
width: cartWidth,
|
|
462
|
+
maxWidth: "100%"
|
|
463
|
+
}, styles.cartPopup),
|
|
464
|
+
children: [
|
|
465
|
+
/* @__PURE__ */ jsxs("div", {
|
|
466
|
+
className: mergeClassNames("seatmap-viewer__cart-header-base", classNames.cartHeader),
|
|
467
|
+
style: styles.cartHeader,
|
|
468
|
+
children: [/* @__PURE__ */ jsx("strong", {
|
|
469
|
+
className: mergeClassNames("seatmap-viewer__cart-header-title-base", classNames.cartHeaderTitle),
|
|
470
|
+
style: styles.cartHeaderTitle,
|
|
471
|
+
children: messages.cartHeaderTitle
|
|
472
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
473
|
+
type: "button",
|
|
474
|
+
onClick: () => setIsCartOpen(false),
|
|
475
|
+
className: mergeClassNames("seatmap-viewer__cart-icon-button-base", classNames.cartIconButton),
|
|
476
|
+
style: styles.cartIconButton,
|
|
477
|
+
title: messages.cartCloseLabel,
|
|
478
|
+
"aria-label": messages.cartCloseLabel,
|
|
479
|
+
children: "x"
|
|
480
|
+
})]
|
|
481
|
+
}),
|
|
482
|
+
/* @__PURE__ */ jsx("div", {
|
|
483
|
+
className: mergeClassNames("seatmap-viewer__cart-body-base", classNames.cartBody),
|
|
484
|
+
style: styles.cartBody,
|
|
485
|
+
children: groupedSeatsList.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
486
|
+
className: mergeClassNames("seatmap-viewer__cart-empty-state-base", classNames.cartEmptyState),
|
|
487
|
+
style: styles.cartEmptyState,
|
|
488
|
+
children: messages.cartEmptyState
|
|
489
|
+
}) : groupedSeatsList.map((group) => /* @__PURE__ */ jsxs("article", {
|
|
490
|
+
className: mergeClassNames("seatmap-viewer__cart-group-base", classNames.cartGroup),
|
|
491
|
+
style: styles.cartGroup,
|
|
492
|
+
children: [
|
|
493
|
+
/* @__PURE__ */ jsx("div", {
|
|
494
|
+
className: mergeClassNames("seatmap-viewer__cart-group-title-base", classNames.cartGroupTitle),
|
|
495
|
+
style: styles.cartGroupTitle,
|
|
496
|
+
children: group.categoryName
|
|
497
|
+
}),
|
|
498
|
+
/* @__PURE__ */ jsx("div", {
|
|
499
|
+
className: mergeClassNames("seatmap-viewer__cart-group-meta-base", classNames.cartGroupMeta),
|
|
500
|
+
style: styles.cartGroupMeta,
|
|
501
|
+
children: messages.cartGroupMeta(group.seats.length, formatMoney(group.unitPrice, locale, currency))
|
|
502
|
+
}),
|
|
503
|
+
group.serviceFee > 0 && /* @__PURE__ */ jsx("div", {
|
|
504
|
+
className: mergeClassNames("seatmap-viewer__cart-group-meta-base", classNames.cartGroupMeta),
|
|
505
|
+
style: styles.cartGroupMeta,
|
|
506
|
+
children: messages.cartGroupFee(formatMoney(group.baseUnitPrice, locale, currency), formatMoney(group.serviceFee, locale, currency), group.baseUnitPrice > 0 ? formatPercent(group.serviceFee / group.baseUnitPrice, locale) : null)
|
|
507
|
+
}),
|
|
508
|
+
/* @__PURE__ */ jsxs("div", {
|
|
509
|
+
className: mergeClassNames("seatmap-viewer__cart-quantity-row-base", classNames.cartQuantityRow),
|
|
510
|
+
style: styles.cartQuantityRow,
|
|
511
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
512
|
+
className: "seatmap-viewer__cart-quantity-controls",
|
|
513
|
+
children: [
|
|
514
|
+
/* @__PURE__ */ jsx("button", {
|
|
515
|
+
type: "button",
|
|
516
|
+
className: mergeClassNames("seatmap-viewer__cart-icon-button-base", classNames.cartIconButton),
|
|
517
|
+
style: styles.cartIconButton,
|
|
518
|
+
onClick: () => handleRemoveLastInCategory(group.categoryId),
|
|
519
|
+
disabled: group.seats.length === 0,
|
|
520
|
+
"aria-label": messages.cartRemoveOneAriaLabel(group.categoryName),
|
|
521
|
+
children: "-"
|
|
522
|
+
}),
|
|
523
|
+
/* @__PURE__ */ jsx("span", {
|
|
524
|
+
className: mergeClassNames("seatmap-viewer__cart-quantity-value-base", classNames.cartQuantityValue),
|
|
525
|
+
style: styles.cartQuantityValue,
|
|
526
|
+
children: group.seats.length
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ jsx("button", {
|
|
529
|
+
type: "button",
|
|
530
|
+
className: mergeClassNames("seatmap-viewer__cart-icon-button-base", classNames.cartIconButton),
|
|
531
|
+
style: styles.cartIconButton,
|
|
532
|
+
onClick: () => handleAddSeatInCategory(group.categoryId),
|
|
533
|
+
disabled: group.availableToAdd === 0,
|
|
534
|
+
"aria-label": messages.cartAddOneAriaLabel(group.categoryName),
|
|
535
|
+
children: "+"
|
|
536
|
+
})
|
|
537
|
+
]
|
|
538
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
539
|
+
className: mergeClassNames("seatmap-viewer__cart-group-total-base", classNames.cartGroupTotal),
|
|
540
|
+
style: styles.cartGroupTotal,
|
|
541
|
+
children: formatMoney(group.seats.reduce((sum, seat) => sum + seat.unitPrice, 0), locale, currency)
|
|
542
|
+
})]
|
|
543
|
+
}),
|
|
544
|
+
/* @__PURE__ */ jsx("div", {
|
|
545
|
+
className: "seatmap-viewer__cart-seat-list",
|
|
546
|
+
children: group.seats.map((seat) => /* @__PURE__ */ jsxs("div", {
|
|
547
|
+
className: mergeClassNames("seatmap-viewer__cart-seat-row-base", classNames.cartSeatRow),
|
|
548
|
+
style: styles.cartSeatRow,
|
|
549
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
550
|
+
className: mergeClassNames("seatmap-viewer__cart-seat-label-base", classNames.cartSeatLabel),
|
|
551
|
+
style: styles.cartSeatLabel,
|
|
552
|
+
children: [
|
|
553
|
+
seat.sectionLabel ?? messages.sectionFallbackLabel,
|
|
554
|
+
" ",
|
|
555
|
+
seat.rowLabel ? `- ${seat.rowLabel}${seat.seatLabel}` : `- ${seat.seatLabel}`
|
|
556
|
+
]
|
|
557
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
558
|
+
type: "button",
|
|
559
|
+
className: mergeClassNames("seatmap-viewer__cart-icon-button-base", classNames.cartIconButton),
|
|
560
|
+
style: styles.cartIconButton,
|
|
561
|
+
onClick: () => removeSeatFromSelection(seat.seatId),
|
|
562
|
+
title: messages.cartRemoveSeatTitle,
|
|
563
|
+
"aria-label": messages.cartRemoveSeatAriaLabel(seat.seatLabel),
|
|
564
|
+
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
565
|
+
})]
|
|
566
|
+
}, seat.seatId))
|
|
567
|
+
})
|
|
568
|
+
]
|
|
569
|
+
}, group.categoryId))
|
|
570
|
+
}),
|
|
571
|
+
/* @__PURE__ */ jsxs("div", {
|
|
572
|
+
className: mergeClassNames("seatmap-viewer__cart-footer-base", classNames.cartFooter),
|
|
573
|
+
style: styles.cartFooter,
|
|
574
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
575
|
+
className: mergeClassNames("seatmap-viewer__cart-summary-base", classNames.cartSummary),
|
|
576
|
+
style: styles.cartSummary,
|
|
577
|
+
children: [/* @__PURE__ */ jsx("div", { children: messages.cartSummary(totalSelectedSeats, formatMoney(totalCost, locale, currency)) }), totalServiceFee > 0 && /* @__PURE__ */ jsx("div", { children: messages.cartServiceFeeSummary(formatMoney(totalServiceFee, locale, currency)) })]
|
|
578
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
579
|
+
type: "button",
|
|
580
|
+
disabled: cartSeats.length === 0 || isSelectionOverLimit,
|
|
581
|
+
onClick: handleProceed,
|
|
582
|
+
className: mergeClassNames("seatmap-viewer__cart-proceed-button-base", classNames.cartProceedButton),
|
|
583
|
+
style: styles.cartProceedButton,
|
|
584
|
+
children: messages.cartProceedButton
|
|
585
|
+
})]
|
|
586
|
+
})
|
|
587
|
+
]
|
|
588
|
+
}),
|
|
589
|
+
showLabels && /* @__PURE__ */ jsx(TooltipOverlay, { renderTooltip: effectiveTooltipRenderer })
|
|
590
|
+
]
|
|
591
|
+
});
|
|
694
592
|
}
|
|
695
|
-
function SeatmapViewer({
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
renderTooltip,
|
|
723
|
-
showLabels,
|
|
724
|
-
onCartEvent,
|
|
725
|
-
locale,
|
|
726
|
-
currency,
|
|
727
|
-
styles,
|
|
728
|
-
classNames,
|
|
729
|
-
messages
|
|
730
|
-
}
|
|
731
|
-
)
|
|
732
|
-
}
|
|
733
|
-
) });
|
|
593
|
+
function SeatmapViewer({ venue, onSeatClick, onSeatHover, onSelectionChange, renderTooltip, showLabels = true, className, onCartEvent, locale, currency, maxSelectedSeats, styles, classNames, messages }) {
|
|
594
|
+
return /* @__PURE__ */ jsx(SeatmapProvider, {
|
|
595
|
+
venue,
|
|
596
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
597
|
+
className: mergeClassNames(className, classNames?.root),
|
|
598
|
+
style: mergeStyles({
|
|
599
|
+
width: "100%",
|
|
600
|
+
height: "100%",
|
|
601
|
+
position: "relative"
|
|
602
|
+
}, styles?.root),
|
|
603
|
+
children: /* @__PURE__ */ jsx(SeatmapViewerContent, {
|
|
604
|
+
venue,
|
|
605
|
+
onSeatClick,
|
|
606
|
+
onSeatHover,
|
|
607
|
+
onSelectionChange,
|
|
608
|
+
renderTooltip,
|
|
609
|
+
showLabels,
|
|
610
|
+
onCartEvent,
|
|
611
|
+
locale,
|
|
612
|
+
currency,
|
|
613
|
+
maxSelectedSeats,
|
|
614
|
+
styles,
|
|
615
|
+
classNames,
|
|
616
|
+
messages
|
|
617
|
+
})
|
|
618
|
+
})
|
|
619
|
+
});
|
|
734
620
|
}
|
|
735
|
-
|
|
736
621
|
// src/styleContract.ts
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
622
|
+
const seatmapViewerStyleSlots = [
|
|
623
|
+
"root",
|
|
624
|
+
"legendContainer",
|
|
625
|
+
"legendHeading",
|
|
626
|
+
"legendList",
|
|
627
|
+
"legendItem",
|
|
628
|
+
"legendSwatch",
|
|
629
|
+
"legendDivider",
|
|
630
|
+
"cartChip",
|
|
631
|
+
"cartPopup",
|
|
632
|
+
"cartHeader",
|
|
633
|
+
"cartHeaderTitle",
|
|
634
|
+
"cartIconButton",
|
|
635
|
+
"cartBody",
|
|
636
|
+
"cartEmptyState",
|
|
637
|
+
"cartGroup",
|
|
638
|
+
"cartGroupTitle",
|
|
639
|
+
"cartGroupMeta",
|
|
640
|
+
"cartQuantityRow",
|
|
641
|
+
"cartQuantityValue",
|
|
642
|
+
"cartGroupTotal",
|
|
643
|
+
"cartSeatRow",
|
|
644
|
+
"cartSeatLabel",
|
|
645
|
+
"cartFooter",
|
|
646
|
+
"cartSummary",
|
|
647
|
+
"cartProceedButton"
|
|
763
648
|
];
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
649
|
+
const STYLE_CONTRACT_CLASS_PREFIX = "seatmap-viewer";
|
|
650
|
+
const seatmapViewerDefaultClassNames = {
|
|
651
|
+
root: `${STYLE_CONTRACT_CLASS_PREFIX}__root`,
|
|
652
|
+
legendContainer: `${STYLE_CONTRACT_CLASS_PREFIX}__legend-container`,
|
|
653
|
+
legendHeading: `${STYLE_CONTRACT_CLASS_PREFIX}__legend-heading`,
|
|
654
|
+
legendList: `${STYLE_CONTRACT_CLASS_PREFIX}__legend-list`,
|
|
655
|
+
legendItem: `${STYLE_CONTRACT_CLASS_PREFIX}__legend-item`,
|
|
656
|
+
legendSwatch: `${STYLE_CONTRACT_CLASS_PREFIX}__legend-swatch`,
|
|
657
|
+
legendDivider: `${STYLE_CONTRACT_CLASS_PREFIX}__legend-divider`,
|
|
658
|
+
cartChip: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-chip`,
|
|
659
|
+
cartPopup: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-popup`,
|
|
660
|
+
cartHeader: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-header`,
|
|
661
|
+
cartHeaderTitle: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-header-title`,
|
|
662
|
+
cartIconButton: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-icon-button`,
|
|
663
|
+
cartBody: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-body`,
|
|
664
|
+
cartEmptyState: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-empty-state`,
|
|
665
|
+
cartGroup: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-group`,
|
|
666
|
+
cartGroupTitle: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-group-title`,
|
|
667
|
+
cartGroupMeta: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-group-meta`,
|
|
668
|
+
cartQuantityRow: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-quantity-row`,
|
|
669
|
+
cartQuantityValue: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-quantity-value`,
|
|
670
|
+
cartGroupTotal: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-group-total`,
|
|
671
|
+
cartSeatRow: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-seat-row`,
|
|
672
|
+
cartSeatLabel: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-seat-label`,
|
|
673
|
+
cartFooter: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-footer`,
|
|
674
|
+
cartSummary: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-summary`,
|
|
675
|
+
cartProceedButton: `${STYLE_CONTRACT_CLASS_PREFIX}__cart-proceed-button`
|
|
791
676
|
};
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
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
|
-
|
|
677
|
+
const seatmapViewerCssVariables = [
|
|
678
|
+
"--seatmap-surface",
|
|
679
|
+
"--seatmap-surface-elevated",
|
|
680
|
+
"--seatmap-surface-muted",
|
|
681
|
+
"--seatmap-on-surface",
|
|
682
|
+
"--seatmap-on-surface-variant",
|
|
683
|
+
"--seatmap-outline",
|
|
684
|
+
"--seatmap-outline-variant",
|
|
685
|
+
"--seatmap-primary",
|
|
686
|
+
"--seatmap-on-primary",
|
|
687
|
+
"--seatmap-error",
|
|
688
|
+
"--seatmap-on-error",
|
|
689
|
+
"--seatmap-state-layer-hover",
|
|
690
|
+
"--seatmap-state-layer-pressed",
|
|
691
|
+
"--seatmap-focus-ring",
|
|
692
|
+
"--seatmap-radius-sm",
|
|
693
|
+
"--seatmap-radius-md",
|
|
694
|
+
"--seatmap-radius-lg",
|
|
695
|
+
"--seatmap-shadow-raised",
|
|
696
|
+
"--seatmap-shadow-elevated",
|
|
697
|
+
"--seatmap-shadow-floating",
|
|
698
|
+
"--seatmap-viewer-surface",
|
|
699
|
+
"--seatmap-viewer-surface-elevated",
|
|
700
|
+
"--seatmap-viewer-surface-muted",
|
|
701
|
+
"--seatmap-viewer-border",
|
|
702
|
+
"--seatmap-viewer-border-subtle",
|
|
703
|
+
"--seatmap-viewer-text",
|
|
704
|
+
"--seatmap-viewer-text-muted",
|
|
705
|
+
"--seatmap-viewer-accent",
|
|
706
|
+
"--seatmap-viewer-accent-disabled",
|
|
707
|
+
"--seatmap-viewer-accent-text",
|
|
708
|
+
"--seatmap-viewer-danger",
|
|
709
|
+
"--seatmap-viewer-danger-text",
|
|
710
|
+
"--seatmap-viewer-state-layer-hover",
|
|
711
|
+
"--seatmap-viewer-state-layer-pressed",
|
|
712
|
+
"--seatmap-viewer-focus-ring",
|
|
713
|
+
"--seatmap-viewer-radius-sm",
|
|
714
|
+
"--seatmap-viewer-radius-md",
|
|
715
|
+
"--seatmap-viewer-radius-lg",
|
|
716
|
+
"--seatmap-viewer-shadow-raised",
|
|
717
|
+
"--seatmap-viewer-shadow-elevated",
|
|
718
|
+
"--seatmap-viewer-shadow-floating"
|
|
834
719
|
];
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
720
|
+
const seatmapViewerStyleContract = {
|
|
721
|
+
slots: seatmapViewerStyleSlots,
|
|
722
|
+
defaultClassNames: seatmapViewerDefaultClassNames,
|
|
723
|
+
cssVariables: seatmapViewerCssVariables
|
|
839
724
|
};
|
|
840
|
-
|
|
841
725
|
// src/theme/seatmapViewerTheme.ts
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
var
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
"--seatmap-viewer-shadow-elevated": "var(--seatmap-shadow-elevated)",
|
|
887
|
-
"--seatmap-viewer-shadow-floating": "var(--seatmap-shadow-floating)"
|
|
726
|
+
const seatmapViewerSharedThemeRootClassName = "seatmap-viewer-theme";
|
|
727
|
+
const seatmapViewerSharedThemeClassNames = { ...seatmapViewerDefaultClassNames };
|
|
728
|
+
const seatmapViewerSharedThemeVariables = {
|
|
729
|
+
"--seatmap-surface": "var(--ds-surface-container-low, rgba(24, 24, 24, 0.94))",
|
|
730
|
+
"--seatmap-surface-elevated": "var(--ds-surface-container, rgba(28, 28, 28, 0.98))",
|
|
731
|
+
"--seatmap-surface-muted": "var(--ds-surface-container-high, rgba(33, 33, 33, 1))",
|
|
732
|
+
"--seatmap-on-surface": "var(--ds-on-surface, #e5e2e1)",
|
|
733
|
+
"--seatmap-on-surface-variant": "var(--ds-on-surface-variant, #9a9694)",
|
|
734
|
+
"--seatmap-outline": "var(--ds-input-border, rgba(92, 89, 87, 0.65))",
|
|
735
|
+
"--seatmap-outline-variant": "var(--ds-border-subtle, rgba(92, 89, 87, 0.45))",
|
|
736
|
+
"--seatmap-primary": "var(--ds-primary, #6f663a)",
|
|
737
|
+
"--seatmap-on-primary": "var(--ds-on-primary, #f5edc7)",
|
|
738
|
+
"--seatmap-error": "var(--ds-error, #ad3f3f)",
|
|
739
|
+
"--seatmap-on-error": "var(--ds-on-error, #ffffff)",
|
|
740
|
+
"--seatmap-state-layer-hover": "var(--ds-primary-wash, color-mix(in srgb, var(--ds-primary, #6f663a) 12%, transparent))",
|
|
741
|
+
"--seatmap-state-layer-pressed": "var(--ds-primary-wash-strong, color-mix(in srgb, var(--ds-primary, #6f663a) 16%, transparent))",
|
|
742
|
+
"--seatmap-focus-ring": "var(--ds-primary-ring, color-mix(in srgb, var(--ds-primary, #6f663a) 55%, transparent))",
|
|
743
|
+
"--seatmap-radius-sm": "var(--ds-radius-structural-sm, 8px)",
|
|
744
|
+
"--seatmap-radius-md": "var(--ds-radius-structural, 10px)",
|
|
745
|
+
"--seatmap-radius-lg": "calc(var(--ds-radius-structural, 10px) + 6px)",
|
|
746
|
+
"--seatmap-shadow-raised": "var(--ds-shadow-ambient-sm, 0 8px 20px rgba(0, 0, 0, 0.22))",
|
|
747
|
+
"--seatmap-shadow-elevated": "var(--ds-shadow-ambient, 0 10px 24px rgba(0, 0, 0, 0.28))",
|
|
748
|
+
"--seatmap-shadow-floating": "var(--ds-shadow-ambient-lg, 0 14px 34px rgba(0, 0, 0, 0.32))",
|
|
749
|
+
"--seatmap-viewer-surface": "var(--seatmap-surface)",
|
|
750
|
+
"--seatmap-viewer-surface-elevated": "var(--seatmap-surface-elevated)",
|
|
751
|
+
"--seatmap-viewer-surface-muted": "var(--seatmap-surface-muted)",
|
|
752
|
+
"--seatmap-viewer-border": "var(--seatmap-outline)",
|
|
753
|
+
"--seatmap-viewer-border-subtle": "var(--seatmap-outline-variant)",
|
|
754
|
+
"--seatmap-viewer-text": "var(--seatmap-on-surface)",
|
|
755
|
+
"--seatmap-viewer-text-muted": "var(--seatmap-on-surface-variant)",
|
|
756
|
+
"--seatmap-viewer-accent": "var(--seatmap-primary)",
|
|
757
|
+
"--seatmap-viewer-accent-disabled": "color-mix(in srgb, var(--seatmap-primary) 28%, var(--seatmap-surface-muted))",
|
|
758
|
+
"--seatmap-viewer-accent-text": "var(--seatmap-on-primary)",
|
|
759
|
+
"--seatmap-viewer-danger": "var(--seatmap-error)",
|
|
760
|
+
"--seatmap-viewer-danger-text": "var(--seatmap-on-error)",
|
|
761
|
+
"--seatmap-viewer-state-layer-hover": "var(--seatmap-state-layer-hover)",
|
|
762
|
+
"--seatmap-viewer-state-layer-pressed": "var(--seatmap-state-layer-pressed)",
|
|
763
|
+
"--seatmap-viewer-focus-ring": "var(--seatmap-focus-ring)",
|
|
764
|
+
"--seatmap-viewer-radius-sm": "var(--seatmap-radius-sm)",
|
|
765
|
+
"--seatmap-viewer-radius-md": "var(--seatmap-radius-md)",
|
|
766
|
+
"--seatmap-viewer-radius-lg": "var(--seatmap-radius-lg)",
|
|
767
|
+
"--seatmap-viewer-shadow-raised": "var(--seatmap-shadow-raised)",
|
|
768
|
+
"--seatmap-viewer-shadow-elevated": "var(--seatmap-shadow-elevated)",
|
|
769
|
+
"--seatmap-viewer-shadow-floating": "var(--seatmap-shadow-floating)"
|
|
888
770
|
};
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
771
|
+
const seatmapViewerSharedTheme = {
|
|
772
|
+
rootClassName: seatmapViewerSharedThemeRootClassName,
|
|
773
|
+
classNames: seatmapViewerSharedThemeClassNames,
|
|
774
|
+
variables: seatmapViewerSharedThemeVariables
|
|
893
775
|
};
|
|
894
776
|
function getSeatmapViewerSharedThemeRootStyle(overrides) {
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
777
|
+
return {
|
|
778
|
+
...seatmapViewerSharedThemeVariables,
|
|
779
|
+
...overrides ?? {}
|
|
780
|
+
};
|
|
899
781
|
}
|
|
782
|
+
export { SeatmapViewer, SeatmapViewerContent, defaultSeatmapViewerMessages, getSeatmapViewerSharedThemeRootStyle, seatmapViewerCssVariables, seatmapViewerDefaultClassNames, seatmapViewerSharedTheme, seatmapViewerSharedThemeClassNames, seatmapViewerSharedThemeRootClassName, seatmapViewerSharedThemeVariables, seatmapViewerStyleContract, seatmapViewerStyleSlots, useSeatStatus };
|
|
900
783
|
|
|
901
|
-
export { SeatmapViewer, SeatmapViewerContent, defaultSeatmapViewerMessages, getSeatmapViewerSharedThemeRootStyle, seatmapViewerCssVariables, seatmapViewerDefaultClassNames, seatmapViewerSharedTheme, seatmapViewerSharedThemeClassNames, seatmapViewerSharedThemeRootClassName, seatmapViewerSharedThemeVariables, seatmapViewerStyleContract, seatmapViewerStyleSlots };
|
|
902
|
-
//# sourceMappingURL=index.js.map
|
|
903
784
|
//# sourceMappingURL=index.js.map
|