@car-cutter/react-webplayer 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2973 +1,127 @@
1
- import be, { createContext as Me, useContext as ze, useRef as Z, useState as $, useCallback as I, useEffect as O, useMemo as te, Fragment as Wt } from "react";
2
- import { createRoot as Yt } from "react-dom/client";
3
- var ct = { exports: {} }, ge = {};
4
- /**
5
- * @license React
6
- * react-jsx-runtime.production.min.js
7
- *
8
- * Copyright (c) Facebook, Inc. and its affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */
13
- var et;
14
- function Xt() {
15
- if (et) return ge;
16
- et = 1;
17
- var e = be, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function f(d, c, v) {
19
- var l, m = {}, w = null, C = null;
20
- v !== void 0 && (w = "" + v), c.key !== void 0 && (w = "" + c.key), c.ref !== void 0 && (C = c.ref);
21
- for (l in c) o.call(c, l) && !u.hasOwnProperty(l) && (m[l] = c[l]);
22
- if (d && d.defaultProps) for (l in c = d.defaultProps, c) m[l] === void 0 && (m[l] = c[l]);
23
- return { $$typeof: r, type: d, key: w, ref: C, props: m, _owner: s.current };
24
- }
25
- return ge.Fragment = n, ge.jsx = f, ge.jsxs = f, ge;
26
- }
27
- ct.exports = Xt();
28
- var Ue = ct.exports;
29
- const Ie = "cc-webplayer", We = "cc-webplayer-custom-media", Ye = "cc-webplayer-icon", dt = "composition-loading", ut = "composition-loaded", mt = "composition-load-error", pt = "item-change", ht = "extend-mode-on", ft = "extend-mode-off", gt = "hotspots-on", xt = "hotspots-off", wt = "gallery-open", vt = "gallery-close", Bt = !1, Gt = !1, Kt = !1, qt = "quality", Jt = 0, Qt = 1 / 0, er = 1, tr = !1, bt = "cc-webplayer:", rr = !1;
30
- function Hn(e, r) {
31
- return `https://cdn.car-cutter.com/gallery/${e}/${r}/composition_v3.json`;
32
- }
33
- function nr(e, r) {
34
- const n = e.split("/"), o = n.pop();
35
- return [n.join("/"), r, o].join("/");
36
- }
37
- var yt = { exports: {} }, xe = {};
38
- /**
39
- * @license React
40
- * react-jsx-runtime.production.min.js
41
- *
42
- * Copyright (c) Facebook, Inc. and its affiliates.
43
- *
44
- * This source code is licensed under the MIT license found in the
45
- * LICENSE file in the root directory of this source tree.
46
- */
47
- var tt;
48
- function or() {
49
- if (tt) return xe;
50
- tt = 1;
51
- var e = be, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
52
- function f(d, c, v) {
53
- var l, m = {}, w = null, C = null;
54
- v !== void 0 && (w = "" + v), c.key !== void 0 && (w = "" + c.key), c.ref !== void 0 && (C = c.ref);
55
- for (l in c) o.call(c, l) && !u.hasOwnProperty(l) && (m[l] = c[l]);
56
- if (d && d.defaultProps) for (l in c = d.defaultProps, c) m[l] === void 0 && (m[l] = c[l]);
57
- return { $$typeof: r, type: d, key: w, ref: C, props: m, _owner: s.current };
58
- }
59
- return xe.Fragment = n, xe.jsx = f, xe.jsxs = f, xe;
60
- }
61
- yt.exports = or();
62
- var t = yt.exports;
63
- async function sr(e) {
64
- const r = await fetch(e);
65
- if (!r.ok)
66
- throw new Error(`Failed to fetch composition: ${r.statusText}`);
67
- return await r.json();
68
- }
69
- const De = /* @__PURE__ */ new Map(), ar = (e) => {
70
- const [r, n] = $({
71
- status: "pending",
72
- isSuccess: !1
73
- });
74
- return O(() => {
75
- const o = (u) => n({ status: "success", data: u, isSuccess: !0 }), s = De.get(e);
76
- if (s && !(s instanceof Promise)) {
77
- o(s);
78
- return;
79
- }
80
- n({
81
- status: "fetching",
82
- isSuccess: !1
83
- }), async function() {
84
- try {
85
- let u;
86
- if (s)
87
- u = await s;
88
- else {
89
- const f = sr(e);
90
- De.set(e, f), u = await f, De.set(e, u);
91
- }
92
- o(u);
93
- } catch (u) {
94
- n({
95
- status: "error",
96
- isSuccess: !1,
97
- error: u
98
- });
99
- }
100
- }();
101
- }, [e]), r;
102
- }, jt = Me(null), re = () => {
103
- const e = ze(jt);
104
- if (!e)
105
- throw new Error(
106
- "useGlobalContext must be used within a GlobalContextProvider"
107
- );
108
- return e;
109
- }, ir = ({ children: e, ...r }) => /* @__PURE__ */ t.jsx(jt.Provider, { value: r, children: e }), kt = Me(null), oe = () => {
110
- const e = ze(kt);
111
- if (!e)
112
- throw new Error(
113
- "useCompositionContext must be used within a CompositionContextProvider"
114
- );
115
- return e;
116
- }, lr = ({ composition: e, children: r }) => {
117
- const {
118
- aspectRatio: n,
119
- categories: o,
120
- imageHdWidth: s,
121
- imageSubWidths: u
122
- } = e, { minMediaWidth: f, maxMediaWidth: d } = re(), c = te(
123
- () => o.flatMap(({ items: m }) => m),
124
- [o]
125
- ), v = {
126
- aspectRatio: n.replace(":", " / ")
127
- }, l = te(() => {
128
- const m = u.concat(s), w = m.sort((a, h) => a - h), C = w.filter(
129
- (a) => a >= f && a <= d
130
- );
131
- if (C.length === 0) {
132
- const a = (f + d) / 2, h = m.reduce(
133
- (x, j) => Math.abs(j - a) < Math.abs(x - a) ? j : x,
134
- s
135
- );
136
- return console.warn(
137
- `None of available media widths (${w.join("|")}) match the given constraints (${f > 0 ? `${f} ≤ ` : ""}width${d < 1 / 0 ? ` ≤ ${d}` : ""}).`,
138
- `Using the closest width instead (${h}).`
139
- ), [h];
140
- }
141
- return C;
142
- }, [u, s, f, d]);
143
- return /* @__PURE__ */ t.jsx(
144
- kt.Provider,
145
- {
146
- value: {
147
- ...e,
148
- items: c,
149
- aspectRatioStyle: v,
150
- usedMediaWidths: l
151
- },
152
- children: r
153
- }
154
- );
155
- }, Et = 500, Ze = 0.75, _e = 1 + Ze * 2;
156
- function le(e, r, n) {
157
- return Math.min(Math.max(e, r), n);
158
- }
159
- const Le = (e, r, n) => e + (r - e) * n, rt = (e, r) => (e % r + r) % r, Ct = Me(null), Xe = () => ze(Ct), ye = () => {
160
- const e = Xe();
161
- if (!e)
162
- throw new Error(
163
- "useCustomizationContext must be used within a CustomizationContextProvider"
164
- );
165
- return e;
166
- }, nt = "*:size-full", ot = "*:object-cover *:size-full", cr = ({ children: e }) => {
167
- const { compositionUrl: r } = re(), n = I(
168
- () => document.querySelector(
169
- `${Ie}[composition-url="${r}"]`
170
- ),
171
- [r]
172
- ), o = I((a) => {
173
- const h = a.querySelectorAll(Ye), x = /* @__PURE__ */ new Map();
174
- for (const j of h) {
175
- const k = j.getAttribute("name");
176
- if (!k) {
177
- console.warn("Icon element is missing a name attribute");
178
- continue;
179
- }
180
- const g = j.innerHTML, p = g ? /* @__PURE__ */ t.jsx(
181
- "div",
182
- {
183
- className: nt,
184
- dangerouslySetInnerHTML: { __html: g }
185
- }
186
- ) : void 0;
187
- if (!p) {
188
- console.warn(`Icon "${k}" customization is empty.`);
189
- continue;
190
- }
191
- x.set(k, { Icon: p });
192
- }
193
- return x;
194
- }, []), [s, u] = $(
195
- () => {
196
- const a = n();
197
- return a ? o(a) : /* @__PURE__ */ new Map();
198
- }
199
- );
200
- O(() => {
201
- const a = n();
202
- if (!a)
203
- return;
204
- const h = new MutationObserver(() => {
205
- u(o(a));
206
- });
207
- return h.observe(a, {
208
- childList: !0,
209
- subtree: !0
210
- }), () => h.disconnect();
211
- }, [o, n]);
212
- const f = I(
213
- (a) => s.get(a),
214
- [s]
215
- ), d = I(
216
- (a, h) => {
217
- u((x) => {
218
- const { Icon: j, ...k } = h;
219
- return new Map(
220
- x.set(a, {
221
- ...k,
222
- Icon: /* @__PURE__ */ t.jsx("div", { className: nt, children: j })
223
- })
224
- );
225
- });
226
- },
227
- []
228
- ), c = I((a) => {
229
- u((h) => (h.delete(a), new Map(h)));
230
- }, []), v = I((a) => {
231
- const h = a.querySelectorAll(
232
- We
233
- ), x = new Array();
234
- for (const j of h) {
235
- const k = j.innerHTML;
236
- if (!k) {
237
- console.warn("Custom media element is empty");
238
- continue;
239
- }
240
- const g = Number(j.getAttribute("index"));
241
- if (Number.isNaN(g)) {
242
- console.warn("Custom media element is missing the 'index' attribute");
243
- continue;
244
- }
245
- const p = j.getAttribute("thumbnail-src") ?? void 0, b = JSON.stringify({ index: g, thumbnailSrc: p });
246
- x.push({
247
- id: b,
248
- Media: /* @__PURE__ */ t.jsx(
249
- "div",
250
- {
251
- className: ot,
252
- dangerouslySetInnerHTML: { __html: k }
253
- }
254
- ),
255
- index: g,
256
- thumbnailSrc: p
257
- });
258
- }
259
- return x;
260
- }, []), [l, m] = $(() => {
261
- const a = n();
262
- return a ? v(a) : [];
263
- });
264
- O(() => {
265
- const a = n();
266
- if (!a)
267
- return;
268
- const h = new MutationObserver(() => {
269
- m(v(a));
270
- });
271
- return h.observe(a, {
272
- childList: !0,
273
- subtree: !0
274
- }), () => h.disconnect();
275
- }, [v, n]);
276
- const w = I((a) => {
277
- const { Media: h, ...x } = a, j = /* @__PURE__ */ t.jsx("div", { className: ot, children: h }), k = JSON.stringify(x);
278
- return m((g) => [
279
- ...g,
280
- {
281
- id: k,
282
- Media: j,
283
- ...x
284
- }
285
- ]), k;
286
- }, []), C = I((a) => {
287
- m(
288
- (h) => h.filter((x) => x.id !== a)
289
- );
290
- }, []);
291
- return /* @__PURE__ */ t.jsx(
292
- Ct.Provider,
293
- {
294
- value: {
295
- getIconConfig: f,
296
- registerIconConfig: d,
297
- unregisterIconConfig: c,
298
- customMediaList: l,
299
- registerCustomMedia: w,
300
- unregisterCustomMedia: C
301
- },
302
- children: e
303
- }
304
- );
305
- }, Nt = Me(null), J = () => {
306
- const e = ze(Nt);
307
- if (!e)
308
- throw new Error(
309
- "useControlsContext must be used within a ControlsContextProvider"
310
- );
311
- return e;
312
- }, dr = ({
313
- children: e
314
- }) => {
315
- const {
316
- infiniteCarrousel: r,
317
- preventFullScreen: n,
318
- emitEvent: o,
319
- isFullScreen: s,
320
- requestFullscreen: u,
321
- exitFullscreen: f
322
- } = re(), { customMediaList: d } = ye(), { categories: c, items: v } = oe(), l = te(() => {
323
- const P = new Array(
324
- ...v
325
- ), K = d.slice().sort((X, B) => X.index < 0 && B.index < 0 ? B.index - X.index : X.index < 0 ? 1 : B.index < 0 ? -1 : X.index - B.index);
326
- for (const X of K) {
327
- let B = X.index;
328
- B < 0 && (B = P.length + B + 1), P.splice(B, 0, {
329
- type: "custom",
330
- ...X
331
- });
332
- }
333
- return P;
334
- }, [v, d]), [m, w] = $(l.map(() => null));
335
- O(() => {
336
- w(l.map(() => null));
337
- }, [l]);
338
- const C = I(
339
- (P, K) => {
340
- w(
341
- (X) => X.map((B, Ut) => Ut === P ? K : B)
342
- );
343
- },
344
- []
345
- ), [a, h] = $(0), [x, j] = $(null), k = x ?? a, g = l[k], p = m[k], [b, E] = $(
346
- null
347
- ), L = !!b, D = I(() => E(null), []), T = I(() => {
348
- if (L || x !== null)
349
- return;
350
- const P = a - 1;
351
- P >= 0 ? j(P) : r && (E("first_to_last"), j(l.length - 1));
352
- }, [
353
- L,
354
- x,
355
- a,
356
- r,
357
- l.length
358
- ]), N = I(() => {
359
- if (L || x !== null)
360
- return;
361
- const P = a + 1;
362
- P < l.length ? j(P) : r && (E("last_to_first"), j(0));
363
- }, [
364
- L,
365
- x,
366
- a,
367
- l.length,
368
- r
369
- ]), z = I(
370
- (P) => {
371
- const K = Math.min(a, P), X = Math.max(a, P);
372
- m.slice(K, X + 1).filter((B) => B === null).length > 2 && E("instant"), j(P);
373
- },
374
- [a, m]
375
- );
376
- O(() => {
377
- o(pt, {
378
- index: k,
379
- item: g
380
- });
381
- }, [g, o, k]);
382
- const S = te(() => {
383
- let P;
384
- if (g.type === "custom") {
385
- const K = l.slice(0, k).reverse().find((X) => X.type !== "custom") ?? l.slice(k + 1).find((X) => X.type !== "custom");
386
- if (!K)
387
- throw new Error("No non-custom item found");
388
- P = K;
389
- } else
390
- P = g;
391
- for (const K of c)
392
- if (K.items.includes(P))
393
- return K.id;
394
- throw new Error("Current item not found in any category");
395
- }, [c, g, l, k]), V = I(
396
- (P) => {
397
- const K = c.find(({ id: B }) => B === P)?.items[0];
398
- if (K === void 0)
399
- throw new Error("Failed to find target category");
400
- const X = l.findIndex((B) => B === K);
401
- z(X);
402
- },
403
- [c, l, z]
404
- ), R = te(() => {
405
- switch (g.type) {
406
- case "image":
407
- return !!g.hotspots?.length;
408
- case "360":
409
- return p === "running";
410
- default:
411
- return !1;
412
- }
413
- }, [g, p]), [y, i] = $(!0), _ = I(() => {
414
- const P = !y;
415
- i(P), o(P ? gt : xt);
416
- }, [o, y]), M = te(() => {
417
- switch (g.type) {
418
- case "video":
419
- return p !== "running";
420
- default:
421
- return !0;
422
- }
423
- }, [g, p]), [A, F] = $(!1), U = I(() => {
424
- const P = !A;
425
- F(P), o(P ? wt : vt);
426
- }, [o, A]), [W, Y] = $(null), q = I(() => Y(null), []), ee = !!W, fe = te(() => {
427
- switch (g.type) {
428
- case "image":
429
- return !0;
430
- case "360":
431
- return p === "running";
432
- default:
433
- return !1;
434
- }
435
- }, [g.type, p]), [se, ae] = $(1), je = se !== 1, Se = se < _e, Ve = se > 1, ce = I((P) => {
436
- ae((K) => le(K + P, 1, _e));
437
- }, []), Te = I(() => ae(1), []), Dt = I(() => ce(Ze), [ce]), Ft = I(() => ce(-Ze), [ce]), He = I(() => {
438
- Te(), q();
439
- }, [Te, q]), [de, $t] = $(!1), [Re, Je] = $(), [Ae, Qe] = $(!1), ue = I(
440
- async (P) => {
441
- He(), $t(P), o(P ? ht : ft);
442
- },
443
- [o, He]
444
- ), me = I(() => {
445
- clearTimeout(Re);
446
- const P = setTimeout(() => {
447
- Je(void 0);
448
- }, Et);
449
- Je(P);
450
- }, [Re]), Pe = I(async () => {
451
- if (me(), !n) {
452
- const P = await u();
453
- if (Qe(!P), P)
454
- return;
455
- }
456
- ue(!0);
457
- }, [
458
- n,
459
- ue,
460
- u,
461
- me
462
- ]), Oe = I(async () => {
463
- me(), !(!n && (Qe(!1), await f())) && ue(!1);
464
- }, [
465
- n,
466
- ue,
467
- f,
468
- me
469
- ]), Zt = I(() => {
470
- de ? Oe() : Pe();
471
- }, [Oe, Pe, de]);
472
- return O(() => {
473
- n || Ae && de || s !== de && (me(), ue(s));
474
- }, [
475
- n,
476
- ue,
477
- de,
478
- Ae,
479
- s,
480
- me
481
- ]), /* @__PURE__ */ t.jsx(
482
- Nt.Provider,
483
- {
484
- value: {
485
- items: l,
486
- setItemInteraction: C,
487
- slidable: l.length > 1,
488
- carrouselItemIndex: a,
489
- setCarrouselItemIndex: h,
490
- itemIndexCommand: x,
491
- setItemIndexCommand: j,
492
- masterItemIndex: k,
493
- specialCommand: b,
494
- isRunningSpecialCommand: L,
495
- finishSpecialCommand: D,
496
- prevItem: T,
497
- nextItem: N,
498
- scrollToItemIndex: z,
499
- displayedCategoryId: S,
500
- changeCategory: V,
501
- enableHotspotsControl: R,
502
- showHotspots: y,
503
- toggleHotspots: _,
504
- showGalleryControls: M,
505
- showGallery: A,
506
- toggleGallery: U,
507
- shownDetails: W,
508
- isShowingDetails: ee,
509
- setShownDetails: Y,
510
- resetShownDetails: q,
511
- showZoomControls: fe,
512
- zoom: se,
513
- isZooming: je,
514
- setZoom: ae,
515
- resetZoom: Te,
516
- canZoomIn: Se,
517
- zoomIn: Dt,
518
- canZoomOut: Ve,
519
- zoomOut: Ft,
520
- resetView: He,
521
- extendMode: de,
522
- enableExtendMode: Pe,
523
- disableExtendMode: Oe,
524
- toggleExtendMode: Zt,
525
- extendTransition: !!Re,
526
- fakeFullScreen: Ae
527
- },
528
- children: e
529
- }
530
- );
531
- }, Lt = ["left", "center", "right", "fullW"], _t = ["top", "middle", "bottom", "fullH"], ur = [
532
- ...Lt,
533
- ..._t,
534
- "top-left",
535
- "top-center",
536
- "top-right",
537
- "top-fullW",
538
- "middle-left",
539
- "middle-center",
540
- "middle-right",
541
- "middle-fullW",
542
- "bottom-left",
543
- "bottom-center",
544
- "bottom-right",
545
- "bottom-fullW",
546
- "fullH-left",
547
- "fullH-center",
548
- "fullH-right",
549
- "fullW-fullW"
550
- ];
551
- function mr(e) {
552
- return Lt.includes(e);
553
- }
554
- function pr(e) {
555
- return _t.includes(e);
556
- }
557
- function hr(e) {
558
- return ur.includes(e);
559
- }
560
- function fr(e) {
561
- if (!hr(e))
562
- throw new Error(`Invalid position: ${e}`);
563
- return pr(e) ? [e, void 0] : mr(e) ? [void 0, e] : e.split("-");
564
- }
565
- function H(...e) {
566
- return e.filter((r) => !!r).map((r) => r.trim()).join(" ");
567
- }
568
- function gr(e) {
569
- switch (e) {
570
- case "left":
571
- return "left-1 small:left-2";
572
- case "right":
573
- return "right-1 small:right-2";
574
- case "center":
575
- return "left-1/2 -translate-x-1/2";
576
- case "fullW":
577
- return "inset-x-1 small:inset-x-2";
578
- }
579
- }
580
- function Mt(e) {
581
- switch (e) {
582
- case "top":
583
- return "top-1 small:top-2";
584
- case "bottom":
585
- return "bottom-1 small:bottom-2";
586
- case "middle":
587
- return "top-1/2 -translate-y-1/2";
588
- case "fullH":
589
- return "inset-y-1 small:inset-y-2";
590
- }
591
- }
592
- function xr({
593
- positionX: e,
594
- positionY: r
595
- }) {
596
- const n = new Array();
597
- return e && n.push(gr(e)), r && n.push(Mt(r)), n.join(" ");
598
- }
599
- function pe(e) {
600
- const [r, n] = fr(e);
601
- return xr({ positionX: n, positionY: r });
602
- }
603
- const G = ({
604
- customizationKey: e,
605
- className: r,
606
- children: n
607
- }) => {
608
- const { getIconConfig: o } = ye(), s = o(e)?.Icon;
609
- return s ? r ? /* @__PURE__ */ t.jsx("div", { className: r, children: s }) : s : n;
610
- }, wr = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_CLOSE", children: /* @__PURE__ */ t.jsx(
611
- "svg",
612
- {
613
- className: e,
614
- width: "24",
615
- height: "24",
616
- viewBox: "0 0 24 24",
617
- fill: "none",
618
- xmlns: "http://www.w3.org/2000/svg",
619
- children: /* @__PURE__ */ t.jsx(
620
- "path",
621
- {
622
- d: "M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",
623
- fill: "currentColor"
624
- }
625
- )
626
- }
627
- ) }), vr = {
628
- fill: {
629
- primary: "bg-primary text-primary-foreground hover:opacity-80",
630
- neutral: "bg-background text-neutral-foreground hover:opacity-80"
631
- },
632
- ghost: {
633
- primary: "bg-transparent text-foreground hover:bg-primary/25",
634
- neutral: "bg-transparent text-background hover:bg-foreground/25"
635
- }
636
- }, br = {
637
- button: "h-8 px-2",
638
- icon: "size-8 p-2"
639
- }, Q = ({
640
- variant: e = "fill",
641
- shape: r = "button",
642
- color: n = "primary",
643
- className: o,
644
- children: s,
645
- ...u
646
- }) => {
647
- const f = vr[e][n], d = br[r];
648
- return /* @__PURE__ */ t.jsx(
649
- "button",
650
- {
651
- className: H(
652
- "flex items-center justify-center rounded-ui text-sm transition-all disabled:opacity-60",
653
- f,
654
- d,
655
- o
656
- ),
657
- ...u,
658
- children: s
659
- }
660
- );
661
- }, zt = (e) => /* @__PURE__ */ t.jsx(Q, { color: "neutral", shape: "icon", ...e, children: /* @__PURE__ */ t.jsx(wr, { className: "size-full" }) }), It = ({ text: e, className: r }) => /* @__PURE__ */ t.jsxs(
662
- "div",
663
- {
664
- className: H(
665
- "flex size-full flex-col items-center justify-center gap-y-4",
666
- r
667
- ),
668
- children: [
669
- /* @__PURE__ */ t.jsx(
670
- "img",
671
- {
672
- className: "h-20 small:h-28",
673
- src: "https://cdn.car-cutter.com/libs/web-player/v3/assets/car_placeholder.png"
674
- }
675
- ),
676
- /* @__PURE__ */ t.jsx("div", { className: "text-2xl font-bold", children: e })
677
- ]
678
- }
679
- ), yr = {
680
- primary: "border-primary",
681
- foreground: "border-foreground",
682
- background: "border-background"
683
- }, jr = {
684
- sm: "size-4 border",
685
- md: "size-8 border-2",
686
- lg: "size-12 border-4"
687
- }, St = ({
688
- color: e = "foreground",
689
- size: r = "md"
690
- }) => {
691
- const n = yr[e], o = jr[r];
692
- return /* @__PURE__ */ t.jsx(
693
- "div",
694
- {
695
- className: H(
696
- "inline-block animate-rotation rounded-full border-b-transparent",
697
- o,
698
- n
699
- )
700
- }
701
- );
702
- }, he = ({
703
- src: e,
704
- className: r,
705
- onLoad: n,
706
- imgInPlayerWidthRatio: o = 1,
707
- onlyThumbnail: s,
708
- fadeIn: u,
709
- ...f
710
- }) => {
711
- const { mediaLoadStrategy: d, playerInViewportWidthRatio: c } = re(), { imageHdWidth: v, usedMediaWidths: l } = oe(), [m, w] = te(() => {
712
- const h = l.map((j) => `${j !== v ? nr(e, j) : e} ${j}w`);
713
- let x;
714
- if (s)
715
- x = [`${l[0]}px`];
716
- else {
717
- const j = 1 / (o * c);
718
- switch (d) {
719
- case "quality": {
720
- const k = [...l], g = k.pop();
721
- x = k.map(
722
- (p) => `(max-width: ${j * p}px) ${p}px`
723
- ), x.push(`${g}px`);
724
- break;
725
- }
726
- case "balanced": {
727
- x = [];
728
- for (let k = 0; k < l.length - 1; k++) {
729
- const g = l[k], p = l[k + 1], b = Math.round((g + p) / 2);
730
- x.push(
731
- `(max-width: ${j * b}px) ${g}px`
732
- );
733
- }
734
- x.push(`${l[l.length - 1]}px`);
735
- break;
736
- }
737
- case "speed": {
738
- const k = [...l], g = k.shift();
739
- x = k.reverse().map(
740
- (p) => `(min-width: ${j * p}px) ${p}px`
741
- ), x.push(`${g}px`);
742
- break;
743
- }
744
- }
745
- }
746
- return [h.join(", "), x.join(", ")];
747
- }, [
748
- v,
749
- o,
750
- d,
751
- s,
752
- c,
753
- e,
754
- l
755
- ]), [C, a] = $();
756
- return O(() => {
757
- if (C === !0)
758
- return;
759
- const h = setTimeout(() => {
760
- a((x) => x ?? !1);
761
- }, 30);
762
- return () => clearTimeout(h);
763
- }, [C]), /* @__PURE__ */ t.jsx(
764
- "img",
765
- {
766
- src: e,
767
- srcSet: m,
768
- sizes: w,
769
- className: H(
770
- r,
771
- u && H(
772
- C !== void 0 && "transition-opacity duration-200",
773
- C === !1 && "opacity-0",
774
- C === !0 && "opacity-100"
775
- )
776
- ),
777
- onLoad: (h) => {
778
- a(!0), n?.(h);
779
- },
780
- ...f
781
- }
782
- );
783
- }, Vt = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_IMAGE", children: /* @__PURE__ */ t.jsx("svg", { className: e, viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ t.jsx(
784
- "path",
785
- {
786
- d: "M9.5 2.5V9.5H2.5V2.5H9.5ZM9.5 1.5H2.5C1.95 1.5 1.5 1.95 1.5 2.5V9.5C1.5 10.05 1.95 10.5 2.5 10.5H9.5C10.05 10.5 10.5 10.05 10.5 9.5V2.5C10.5 1.95 10.05 1.5 9.5 1.5ZM7.07 5.93L5.57 7.865L4.5 6.57L3 8.5H9L7.07 5.93Z",
787
- fill: "currentColor"
788
- }
789
- ) }) }), Be = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_PLAY", children: /* @__PURE__ */ t.jsx(
790
- "svg",
791
- {
792
- className: e,
793
- viewBox: "0 0 24 24",
794
- fill: "none",
795
- stroke: "currentColor",
796
- strokeWidth: "1.5",
797
- strokeLinecap: "round",
798
- strokeLinejoin: "round",
799
- children: /* @__PURE__ */ t.jsx("polygon", { points: "6 3 20 12 6 21 6 3" })
800
- }
801
- ) }), Tt = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_360", children: /* @__PURE__ */ t.jsxs(
802
- "svg",
803
- {
804
- className: e,
805
- viewBox: "0 0 56 56",
806
- fill: "none",
807
- xmlns: "http://www.w3.org/2000/svg",
808
- children: [
809
- /* @__PURE__ */ t.jsxs("g", { clipPath: "url(#clip0_134_843)", children: [
810
- /* @__PURE__ */ t.jsx(
811
- "path",
812
- {
813
- d: "M35.2497 43.93C34.4358 43.93 33.7296 43.325 33.6241 42.4966C33.51 41.5977 34.1457 40.7765 35.0442 40.662C40.2284 40.0015 44.8709 38.5967 48.1162 36.7057C51.0843 34.9767 52.7185 32.9438 52.7185 30.9819C52.7185 28.8196 50.8062 27.0504 49.2014 25.9464C48.455 25.4329 48.2662 24.4117 48.7798 23.6649C49.2933 22.9185 50.3148 22.7297 51.0612 23.2432C54.2921 25.4657 55.9998 28.1416 55.9998 30.9823C55.9998 34.2063 53.8452 37.1659 49.7684 39.5409C46.0988 41.6789 41.1509 43.1922 35.4591 43.9172C35.3886 43.9257 35.3185 43.93 35.2497 43.93Z",
814
- fill: "currentColor"
815
- }
816
- ),
817
- /* @__PURE__ */ t.jsx(
818
- "path",
819
- {
820
- d: "M27.6 41.5797L23.225 37.2047C22.5842 36.5638 21.5455 36.5638 20.9047 37.2047C20.2642 37.8451 20.2642 38.8842 20.9047 39.5246L22.183 40.8029C17.2816 40.2966 12.8289 39.1555 9.38102 37.4973C5.50463 35.6333 3.28124 33.2582 3.28124 30.9818C3.28124 29.0511 4.87316 27.0443 7.76347 25.3311C8.5432 24.8692 8.8004 23.8626 8.33854 23.0833C7.87627 22.3036 6.86968 22.0464 6.09038 22.5083C1.05658 25.4922 0 28.7631 0 30.9818C0 34.622 2.82665 37.9861 7.95915 40.4547C11.9428 42.3701 17.0958 43.6531 22.7098 44.1495L20.9047 45.9546C20.2642 46.5951 20.2642 47.6341 20.9047 48.275C21.2251 48.595 21.6451 48.7552 22.0651 48.7552C22.4846 48.7552 22.9046 48.595 23.225 48.275L27.6 43.9C28.2405 43.2592 28.2405 42.2201 27.6 41.5797Z",
821
- fill: "currentColor"
822
- }
823
- ),
824
- /* @__PURE__ */ t.jsx(
825
- "path",
826
- {
827
- d: "M17.1827 27.6963V27.3016C17.1827 25.9092 16.3303 25.6391 15.1874 25.6391C14.4808 25.6391 14.2522 25.0158 14.2522 24.3924C14.2522 23.7687 14.4808 23.1453 15.1874 23.1453C15.977 23.1453 16.8084 23.0415 16.8084 21.3581C16.8084 20.1529 16.1227 19.8619 15.2703 19.8619C14.2522 19.8619 13.7327 20.1114 13.7327 20.9219C13.7327 21.6282 13.4208 22.1063 12.2155 22.1063C10.7193 22.1063 10.5326 21.7944 10.5326 20.7967C10.5326 19.1762 11.696 17.0771 15.2703 17.0771C17.9098 17.0771 19.9046 18.0329 19.9046 20.8386C19.9046 22.3553 19.3437 23.7687 18.3046 24.2468C19.5308 24.7039 20.4242 25.6182 20.4242 27.3016V27.6963C20.4242 31.1045 18.076 32.393 15.1665 32.393C11.5922 32.393 10.2207 30.2111 10.2207 28.4654C10.2207 27.5301 10.6155 27.2806 11.7584 27.2806C13.0884 27.2806 13.4208 27.5716 13.4208 28.3616C13.4208 29.3382 14.3355 29.5668 15.2703 29.5668C16.6836 29.5668 17.1827 29.0473 17.1827 27.6963Z",
828
- fill: "white"
829
- }
830
- ),
831
- /* @__PURE__ */ t.jsx(
832
- "path",
833
- {
834
- d: "M33.0384 27.3016V27.4887C33.0384 31.063 30.8146 32.393 27.9469 32.393C25.0792 32.393 22.8345 31.063 22.8345 27.4887V21.9815C22.8345 18.4072 25.1412 17.0771 28.134 17.0771C31.646 17.0771 33.0384 19.2591 33.0384 20.9839C33.0384 21.9815 32.5603 22.293 31.5212 22.293C30.6279 22.293 29.8379 22.0644 29.8379 21.1086C29.8379 20.3191 29.0069 19.9034 28.0302 19.9034C26.804 19.9034 26.0764 20.5477 26.0764 21.9815V23.8515C26.7416 23.1244 27.6769 22.9372 28.6745 22.9372C31.0431 22.9372 33.0384 23.9763 33.0384 27.3016ZM26.0764 27.7173C26.0764 29.1511 26.7831 29.7745 27.9469 29.7745C29.1107 29.7745 29.7964 29.1511 29.7964 27.7173V27.5301C29.7964 26.013 29.1107 25.4311 27.926 25.4311C26.804 25.4311 26.0764 25.9715 26.0764 27.343V27.7173Z",
835
- fill: "white"
836
- }
837
- ),
838
- /* @__PURE__ */ t.jsx(
839
- "path",
840
- {
841
- d: "M35.5527 27.4887V21.9815C35.5527 18.4072 37.7761 17.0771 40.6442 17.0771C43.5119 17.0771 45.7562 18.4072 45.7562 21.9815V27.4887C45.7562 31.063 43.5119 32.393 40.6442 32.393C37.7761 32.393 35.5527 31.063 35.5527 27.4887ZM42.5143 21.9815C42.5143 20.5477 41.808 19.9034 40.6442 19.9034C39.4804 19.9034 38.7947 20.5477 38.7947 21.9815V27.4887C38.7947 28.9225 39.4804 29.5668 40.6442 29.5668C41.808 29.5668 42.5143 28.9225 42.5143 27.4887V21.9815Z",
842
- fill: "white"
843
- }
844
- ),
845
- /* @__PURE__ */ t.jsx(
846
- "path",
847
- {
848
- d: "M49.6948 17.0625C46.9805 17.0625 44.7729 14.8545 44.7729 12.1406C44.7729 9.42675 46.9805 7.21875 49.6948 7.21875C52.4087 7.21875 54.6167 9.42675 54.6167 12.1406C54.6167 14.8545 52.4087 17.0625 49.6948 17.0625ZM49.6948 10.5C48.7899 10.5 48.0542 11.2361 48.0542 12.1406C48.0542 13.0455 48.7899 13.7812 49.6948 13.7812C50.5993 13.7812 51.3354 13.0455 51.3354 12.1406C51.3354 11.2361 50.5993 10.5 49.6948 10.5Z",
849
- fill: "white"
850
- }
851
- )
852
- ] }),
853
- /* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsx("clipPath", { id: "clip0_134_843", children: /* @__PURE__ */ t.jsx("rect", { width: "56", height: "56", fill: "white" }) }) })
854
- ]
855
- }
856
- ) }), kr = ({
857
- src: e,
858
- withCdn: r
859
- }) => {
860
- const { permanentGallery: n } = re();
861
- if (!e)
862
- return null;
863
- const o = "size-full object-cover";
864
- return r ? /* @__PURE__ */ t.jsx(
865
- he,
866
- {
867
- className: o,
868
- src: e,
869
- onlyThumbnail: !0,
870
- fadeIn: !n
871
- }
872
- ) : /* @__PURE__ */ t.jsx("img", { className: o, src: e });
873
- }, Fe = ({
874
- children: e
875
- }) => {
876
- const { extendMode: r } = J();
877
- return /* @__PURE__ */ t.jsx(
878
- "div",
879
- {
880
- className: H(
881
- "flex aspect-square h-3/4 items-center justify-center rounded-full bg-foreground/50 p-1",
882
- r && "large:h-3/5 large:p-2"
883
- ),
884
- children: e
885
- }
886
- );
887
- }, Er = ({ item: e }) => {
888
- const { aspectRatioStyle: r } = oe(), { type: n } = e;
889
- let o, s;
890
- switch (n) {
891
- case "360":
892
- o = e.images[0].src, s = !0;
893
- break;
894
- case "image":
895
- o = e.src, s = !0;
896
- break;
897
- case "video":
898
- o = e.poster, s = !0;
899
- break;
900
- case "custom":
901
- o = e.thumbnailSrc, s = !1;
902
- break;
903
- }
904
- const u = /* @__PURE__ */ t.jsx(kr, { src: o, withCdn: s });
905
- let f;
906
- switch (n) {
907
- case "360":
908
- f = /* @__PURE__ */ t.jsx(Fe, { children: /* @__PURE__ */ t.jsx(Tt, { className: "size-full text-primary-light" }) });
909
- break;
910
- case "video":
911
- f = /* @__PURE__ */ t.jsx(Fe, { children: /* @__PURE__ */ t.jsx(Be, { className: "size-full p-0.5 text-background" }) });
912
- break;
913
- case "custom":
914
- f = o ? null : /* @__PURE__ */ t.jsx(Fe, { children: /* @__PURE__ */ t.jsx(Vt, { className: "size-full p-0.5 text-background" }) });
915
- break;
916
- }
917
- return /* @__PURE__ */ t.jsxs("div", { className: "relative bg-foreground/30", style: r, children: [
918
- u,
919
- f && /* @__PURE__ */ t.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-foreground/25", children: f })
920
- ] });
921
- }, Cr = {
922
- primary: "bg-primary/50",
923
- neutral: "bg-neutral/50",
924
- background: "bg-background/50",
925
- foreground: "bg-foreground/50"
926
- }, Ht = ({
927
- color: e = "neutral",
928
- orientation: r = "horizontal"
929
- }) => {
930
- const n = Cr[e], o = r === "horizontal" ? "h-px w-full" : "w-px h-full";
931
- return /* @__PURE__ */ t.jsx("div", { className: H(n, o) });
932
- }, Rt = ({
933
- className: e = "",
934
- containerClassName: r = ""
935
- }) => {
936
- const { hideCategories: n, infiniteCarrousel: o, permanentGallery: s, isFullScreen: u } = re(), { categories: f, aspectRatioStyle: d } = oe(), {
937
- items: c,
938
- extendMode: v,
939
- extendTransition: l,
940
- masterItemIndex: m,
941
- prevItem: w,
942
- nextItem: C,
943
- scrollToItemIndex: a,
944
- resetView: h
945
- } = J(), x = te(() => {
946
- if (n)
947
- return [];
948
- const N = new Array();
949
- let z = f[0];
950
- const S = (V) => f.find(
951
- (R) => R.items.some((y) => y === V)
952
- );
953
- for (let V = 0; V < c.length; V++) {
954
- const R = c[V], y = S(R);
955
- y && y !== z && (N.push(V), z = y);
956
- }
957
- return N;
958
- }, [f, n, c]), j = Z(null), k = I(() => {
959
- if (!j.current)
960
- throw new Error("slider.current is null");
961
- return j.current;
962
- }, []), g = Z(!1), p = Z(
963
- null
964
- ), [b, E] = $(!1), L = I(
965
- (N, z) => {
966
- const S = k(), V = S.clientWidth, R = S.scrollWidth / c.length, y = (N + 1 / 2) * R - V / 2, i = S.scrollWidth - S.clientWidth;
967
- S.scrollTo({
968
- left: le(y, 0, i),
969
- behavior: z
970
- });
971
- },
972
- [c.length, k]
973
- );
974
- O(() => {
975
- const N = j.current;
976
- if (!N)
977
- return;
978
- const z = (R) => {
979
- R.preventDefault(), g.current = !0, p.current = {
980
- x: R.pageX - N.offsetLeft,
981
- scrollLeft: N.scrollLeft
982
- };
983
- }, S = (R) => {
984
- if (!g.current)
985
- return;
986
- if (p.current === null)
987
- throw new Error("[onMouseMove] scrollStart is null");
988
- const y = R.pageX - N.offsetLeft - p.current.x;
989
- if (!b && Math.abs(y) < 5)
990
- return;
991
- const i = p.current.scrollLeft - y;
992
- E(!0), requestAnimationFrame(() => {
993
- N.scrollLeft = i;
994
- });
995
- }, V = () => {
996
- g.current && (g.current = !1, requestAnimationFrame(() => {
997
- E(!1);
998
- }));
999
- };
1000
- return N.addEventListener("mousedown", z), document.addEventListener("mousemove", S), document.addEventListener("mouseleave", V), document.addEventListener("mouseup", V), document.addEventListener("contextmenu", V), () => {
1001
- N.removeEventListener("mousedown", z), document.removeEventListener("mousemove", S), document.removeEventListener("mouseleave", V), document.removeEventListener("mouseup", V), document.removeEventListener("contextmenu", V);
1002
- };
1003
- }, [b]);
1004
- const D = Z(m);
1005
- O(() => {
1006
- j.current && (L(m, "smooth"), D.current = m);
1007
- }, [m, L]), O(() => {
1008
- j.current && L(D.current, "instant");
1009
- }, [
1010
- L,
1011
- // - Run the effect when those values change
1012
- u,
1013
- v,
1014
- l
1015
- ]);
1016
- const T = (N) => {
1017
- b || (o && N === c.length - 1 && m === 0 ? w() : o && N === 0 && m === c.length - 1 ? C() : a(N), h());
1018
- };
1019
- return /* @__PURE__ */ t.jsx(
1020
- "div",
1021
- {
1022
- ref: j,
1023
- className: H(
1024
- "relative w-full overflow-x-auto no-scrollbar",
1025
- b ? "cursor-grab" : "cursor-grabbing",
1026
- e
1027
- ),
1028
- children: /* @__PURE__ */ t.jsx(
1029
- "div",
1030
- {
1031
- className: H(
1032
- "flex h-10 w-fit gap-1 small:h-12 small:gap-2",
1033
- v && "large:h-20 large:gap-4",
1034
- r
1035
- ),
1036
- children: c.map((N, z) => /* @__PURE__ */ t.jsxs(Wt, { children: [
1037
- x.includes(z) && /* @__PURE__ */ t.jsx("div", { className: "my-2", children: /* @__PURE__ */ t.jsx(
1038
- Ht,
1039
- {
1040
- color: s && !u ? "neutral" : "background",
1041
- orientation: "vertical"
1042
- }
1043
- ) }),
1044
- /* @__PURE__ */ t.jsx(
1045
- "div",
1046
- {
1047
- className: H(
1048
- "relative h-full overflow-hidden rounded-gallery transition-radius",
1049
- !b && "cursor-pointer",
1050
- "after:absolute after:inset-0 after:rounded-gallery after:border-2 after:border-primary after:transition-all",
1051
- z === m ? "after:opacity-100" : "after:opacity-0 hover:after:opacity-70"
1052
- ),
1053
- style: d,
1054
- onClick: () => T(z),
1055
- children: /* @__PURE__ */ t.jsx(Er, { item: N })
1056
- }
1057
- )
1058
- ] }, z))
1059
- }
1060
- )
1061
- }
1062
- );
1063
- }, At = (e) => 1 - Math.pow(1 - e, 2), Nr = ({
1064
- Media: e,
1065
- itemIndex: r
1066
- }) => {
1067
- const { setItemInteraction: n } = J();
1068
- return O(() => {
1069
- n(r, "ready");
1070
- }, [r, n]), e;
1071
- }, st = (e, r) => Math.sqrt(
1072
- (e.clientX - r.clientX) ** 2 + (e.clientY - r.clientY) ** 2
1073
- ), Lr = ({
1074
- onlyPreload: e,
1075
- ...r
1076
- }) => {
1077
- const { zoom: n, isZooming: o, setZoom: s } = J(), u = Z(null), f = Z(null), d = I((g) => {
1078
- if (!f.current)
1079
- throw new Error(
1080
- `[${g ?? "getTransformElementOrThrow"}] transformElementRef.current is null`
1081
- );
1082
- return f.current;
1083
- }, []), c = Z(!1), v = Z(null), l = Z(/* @__PURE__ */ new Map()), m = Z({ x: 0, y: 0, scale: 1 }), w = Z(null), C = I(
1084
- (g) => {
1085
- const p = d("setTransformStyle"), {
1086
- x: b,
1087
- y: E,
1088
- scale: L
1089
- } = {
1090
- ...m.current,
1091
- ...g
1092
- }, D = le(L, 1, _e), T = p.clientWidth, N = p.clientHeight, z = T * D, S = N * D, V = le(b, -(z - T), 0), R = le(E, -(S - N), 0);
1093
- m.current = { x: V, y: R, scale: D }, p.style.transform = `translate(${V}px, ${R}px) scale(${D})`;
1094
- },
1095
- [d]
1096
- ), a = I(
1097
- (g, p) => {
1098
- const {
1099
- x: b,
1100
- y: E,
1101
- scale: L
1102
- } = m.current, {
1103
- x: D,
1104
- y: T,
1105
- scale: N
1106
- } = {
1107
- ...m.current,
1108
- ...g
1109
- };
1110
- w.current && (cancelAnimationFrame(w.current), w.current = null);
1111
- const z = () => {
1112
- C({ x: D, y: T, scale: N }), s(N);
1113
- }, S = Math.abs(D - b) < 1 && Math.abs(T - E) < 1 && Math.abs(N - L) < 5e-3;
1114
- if (!p || S) {
1115
- z();
1116
- return;
1117
- }
1118
- const V = (/* @__PURE__ */ new Date()).getTime(), R = () => {
1119
- const y = () => {
1120
- const i = (/* @__PURE__ */ new Date()).getTime() - V;
1121
- if (i >= p) {
1122
- z(), w.current = null;
1123
- return;
1124
- }
1125
- const _ = Math.min(i / p, 1), M = At(_), A = Le(b, D, M), F = Le(E, T, M), U = Le(L, N, M);
1126
- C({ x: A, y: F, scale: U }), R();
1127
- };
1128
- w.current = requestAnimationFrame(y);
1129
- };
1130
- R();
1131
- },
1132
- [C, s]
1133
- ), h = I(
1134
- (g, p) => {
1135
- let { x: b, y: E } = m.current;
1136
- g.x && (b += g.x), g.y && (E += g.y), a(
1137
- {
1138
- x: b,
1139
- y: E
1140
- },
1141
- p
1142
- );
1143
- },
1144
- [a]
1145
- ), x = I(
1146
- (g, p, b) => {
1147
- const E = m.current.scale, L = le(g, 1, _e), D = L / E, { x: T, y: N } = m.current, { x: z, y: S } = p, V = -T + z, R = -N + S, y = V * D, i = R * D, _ = y - z, M = i - S, A = -_, F = -M;
1148
- a(
1149
- {
1150
- x: A,
1151
- y: F,
1152
- scale: L
1153
- },
1154
- b
1155
- );
1156
- },
1157
- [a]
1158
- ), j = I(
1159
- (g) => {
1160
- const p = d(
1161
- "shiftZoomFromButton"
1162
- ), b = p.clientWidth, E = p.clientHeight;
1163
- x(
1164
- g,
1165
- {
1166
- x: b / 2,
1167
- y: E / 2
1168
- },
1169
- 200
1170
- );
1171
- },
1172
- [d, x]
1173
- ), k = I(
1174
- (g, p, b) => {
1175
- const { scale: E } = m.current;
1176
- x(
1177
- E + g,
1178
- p,
1179
- b
1180
- );
1181
- },
1182
- [x]
1183
- );
1184
- return O(() => {
1185
- e || f.current && j(n);
1186
- }, [e, j, n]), O(() => {
1187
- if (e || !o)
1188
- return;
1189
- const g = f.current;
1190
- if (!g)
1191
- return;
1192
- const p = (L) => {
1193
- L.preventDefault(), L.stopPropagation(), c.current = !0, v.current = {
1194
- x: L.clientX,
1195
- y: L.clientY
1196
- };
1197
- }, b = (L) => {
1198
- if (!c.current)
1199
- return;
1200
- if (!v.current)
1201
- throw new Error("mouseStartXY.current is null");
1202
- L.stopPropagation();
1203
- const D = L.clientX - v.current.x, T = L.clientY - v.current.y;
1204
- h({
1205
- x: D,
1206
- y: T
1207
- }), v.current = {
1208
- x: L.clientX,
1209
- y: L.clientY
1210
- };
1211
- }, E = () => {
1212
- c.current = !1;
1213
- };
1214
- return g.addEventListener("mousedown", p), document.addEventListener("mousemove", b), document.addEventListener("mouseleave", E), document.addEventListener("mouseup", E), document.addEventListener("contextmenu", E), () => {
1215
- g.removeEventListener("mousedown", p), document.removeEventListener("mousemove", b), document.removeEventListener("mouseleave", E), document.removeEventListener("mouseup", E), document.removeEventListener("contextmenu", E);
1216
- };
1217
- }, [o, h, e]), O(() => {
1218
- if (e)
1219
- return;
1220
- const g = u.current;
1221
- if (!g)
1222
- return;
1223
- const p = (b) => {
1224
- const { ctrlKey: E, clientX: L, clientY: D, deltaX: T, deltaY: N } = b;
1225
- if (E) {
1226
- if (!o && N >= 0)
1227
- return;
1228
- const { left: z, top: S } = g.getBoundingClientRect(), V = L - z, R = D - S;
1229
- k(-0.01 * N, {
1230
- x: V,
1231
- y: R
1232
- });
1233
- } else {
1234
- if (!o)
1235
- return;
1236
- h({
1237
- x: -2 * T,
1238
- y: -2 * N
1239
- });
1240
- }
1241
- b.preventDefault();
1242
- };
1243
- return g.addEventListener("wheel", p), () => {
1244
- g.removeEventListener("wheel", p);
1245
- };
1246
- }, [o, h, k, e]), O(() => {
1247
- const g = u.current, p = f.current;
1248
- if (!g || !p)
1249
- return;
1250
- const b = l.current, E = (T) => {
1251
- for (let N = 0; N < T.changedTouches.length; N++) {
1252
- const z = T.changedTouches[N];
1253
- b.set(z.identifier, z);
1254
- }
1255
- }, L = (T) => {
1256
- for (let N = 0; N < T.changedTouches.length; N++) {
1257
- const z = T.changedTouches[N];
1258
- b.delete(z.identifier);
1259
- }
1260
- }, D = (T) => {
1261
- const N = T.touches.length;
1262
- if (N === 1) {
1263
- if (!o)
1264
- return;
1265
- T.preventDefault();
1266
- const z = T.touches[0], S = b.get(z.identifier);
1267
- if (!S)
1268
- throw new Error("touchStart is null");
1269
- const V = z.clientX - S.clientX, R = z.clientY - S.clientY;
1270
- h({
1271
- x: V,
1272
- y: R
1273
- }), b.set(z.identifier, z);
1274
- } else if (N === 2) {
1275
- T.preventDefault();
1276
- const [z, S] = T.touches, V = b.get(z.identifier), R = b.get(S.identifier);
1277
- if (!V || !R)
1278
- throw new Error("intialTouch1 or intialTouch2 is null");
1279
- const y = st(
1280
- V,
1281
- R
1282
- ), i = st(z, S) / y, { left: _, top: M } = g.getBoundingClientRect();
1283
- k(i - 1, {
1284
- x: (z.clientX + S.clientX) / 2 - _,
1285
- y: (z.clientY + S.clientY) / 2 - M
1286
- }), b.set(z.identifier, z), b.set(S.identifier, S);
1287
- }
1288
- };
1289
- return p.addEventListener("touchstart", E), p.addEventListener("touchmove", D), p.addEventListener("touchend", L), p.addEventListener("touchcancel", L), () => {
1290
- p.removeEventListener("touchstart", E), p.removeEventListener("touchmove", D), p.removeEventListener("touchend", L), p.removeEventListener("touchcancel", L);
1291
- };
1292
- }, [o, h, k]), /* @__PURE__ */ t.jsx(
1293
- "div",
1294
- {
1295
- ref: u,
1296
- className: `relative size-full overflow-hidden ${o ? "z-zoomed-image cursor-move" : ""}`,
1297
- children: /* @__PURE__ */ t.jsx(
1298
- "div",
1299
- {
1300
- ref: f,
1301
- className: "origin-top-left",
1302
- children: /* @__PURE__ */ t.jsx(
1303
- he,
1304
- {
1305
- ...r,
1306
- imgInPlayerWidthRatio: e ? 1 : n
1307
- }
1308
- )
1309
- }
1310
- )
1311
- }
1312
- );
1313
- }, _r = ({ hotspot: e }) => {
1314
- const { title: r, icon: n, description: o, position: s, detail: u } = e, { getIconConfig: f } = ye(), d = n ? f(n) : void 0, { extendMode: c, setShownDetails: v } = J(), l = !!u, m = u?.type === "image", w = !!r || !!o, C = m ? /* @__PURE__ */ t.jsx(Vt, { className: "size-4" }) : /* @__PURE__ */ t.jsx("div", { className: "size-1" }), a = () => {
1315
- m && v({
1316
- src: u.src,
1317
- title: r,
1318
- text: o
1319
- });
1320
- };
1321
- return /* @__PURE__ */ t.jsxs(
1322
- "div",
1323
- {
1324
- className: H(
1325
- "group absolute z-hotspot -translate-x-1/2 -translate-y-1/2 hover:z-hotspot-hover",
1326
- l ? "cursor-pointer" : "cursor-help"
1327
- ),
1328
- style: {
1329
- top: `${100 * e.position.y}%`,
1330
- left: `${100 * e.position.x}%`
1331
- },
1332
- onClick: a,
1333
- children: [
1334
- /* @__PURE__ */ t.jsxs(
1335
- "div",
1336
- {
1337
- className: "relative flex items-center justify-center rounded-full border-2 border-background bg-primary text-primary-foreground",
1338
- children: [
1339
- /* @__PURE__ */ t.jsx(
1340
- "div",
1341
- {
1342
- className: "pointer-events-none absolute -z-20 size-8 animate-hotspot-ping rounded-full border-2 border-background"
1343
- }
1344
- ),
1345
- /* @__PURE__ */ t.jsx("div", { className: "p-1", children: d?.Icon ? /* @__PURE__ */ t.jsx("div", { className: "size-4", children: d.Icon }) : C })
1346
- ]
1347
- }
1348
- ),
1349
- !m && w && /* @__PURE__ */ t.jsx(
1350
- "div",
1351
- {
1352
- className: H(
1353
- "absolute -z-10 w-max max-w-40 text-pretty rounded-ui bg-background p-2 small:max-w-48",
1354
- c && "large:max-w-56",
1355
- s.y < 0.55 ? "-top-1" : "-bottom-1",
1356
- s.x < 0.55 ? "-left-1 pl-6 small:pl-8" : "-right-1 pr-4 small:pr-6",
1357
- "pointer-events-none opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100"
1358
- ),
1359
- children: /* @__PURE__ */ t.jsxs("div", { className: "space-y-1 text-pretty", children: [
1360
- r && /* @__PURE__ */ t.jsx("div", { className: "text-sm font-semibold small:text-base small:font-bold", children: r }),
1361
- o && /* @__PURE__ */ t.jsx("div", { className: "text-xs text-foreground/65 small:text-sm", children: o })
1362
- ] })
1363
- }
1364
- )
1365
- ]
1366
- }
1367
- );
1368
- }, Mr = ({ hotspot: e }) => {
1369
- const { detail: r } = e, n = /* @__PURE__ */ t.jsx(_r, { hotspot: e });
1370
- switch (r?.type) {
1371
- case "link":
1372
- case "pdf":
1373
- return /* @__PURE__ */ t.jsx("a", { href: r.src, target: "_blank", rel: "noreferrer", children: n });
1374
- default:
1375
- return n;
1376
- }
1377
- }, Pt = ({
1378
- hotspots: e,
1379
- itemIndex: r,
1380
- className: n,
1381
- onLoad: o,
1382
- ...s
1383
- }) => {
1384
- const { isShowingDetails: u, showHotspots: f, setItemInteraction: d } = J();
1385
- return /* @__PURE__ */ t.jsx("div", { className: H("relative size-full overflow-hidden", n), children: /* @__PURE__ */ t.jsxs(
1386
- "div",
1387
- {
1388
- className: H(
1389
- "size-full duration-details",
1390
- u ? "scale-105" : "scale-100"
1391
- ),
1392
- children: [
1393
- /* @__PURE__ */ t.jsx(
1394
- Lr,
1395
- {
1396
- className: "size-full object-cover",
1397
- onLoad: (c) => {
1398
- r !== void 0 && d(r, "ready"), o?.(c);
1399
- },
1400
- ...s
1401
- }
1402
- ),
1403
- f && e?.map((c, v) => /* @__PURE__ */ t.jsx(Mr, { hotspot: c }, v))
1404
- ]
1405
- }
1406
- ) });
1407
- }, we = 10, zr = 15, Ir = ({
1408
- images: e,
1409
- onlyPreload: r
1410
- }) => {
1411
- const { reverse360: n } = re(), { isShowingDetails: o, isZooming: s } = J(), u = s || o, f = Z(null), d = Z(null), [c, v] = $(0), l = e.length, m = I(() => {
1412
- v((C) => (C - 1 + l) % l);
1413
- }, [l]), w = I(() => {
1414
- v((C) => (C + 1) % l);
1415
- }, [l]);
1416
- return O(() => {
1417
- if (u)
1418
- return;
1419
- const C = f.current, a = d.current;
1420
- if (!C || !a)
1421
- return;
1422
- let h = null, x = [], j = null;
1423
- const k = (i) => {
1424
- x.push(i), x.length > 20 && x.shift();
1425
- }, g = () => {
1426
- const i = Date.now(), _ = (() => {
1427
- const U = Date.now(), W = x.filter(
1428
- (ee) => U - ee.timestamp < 50
1429
- );
1430
- if (W.length < 2)
1431
- return 0;
1432
- const Y = W[0], q = W[W.length - 1];
1433
- return (q.value - Y.value) / (1e-3 * Math.max(q.timestamp - Y.timestamp, 1));
1434
- })();
1435
- let M = 0, A = i;
1436
- const F = () => {
1437
- j = requestAnimationFrame(() => {
1438
- const U = Date.now(), W = (U - i) / 1e3, Y = Math.pow(0.05, W), q = _ * Y, ee = (U - A) / 1e3;
1439
- if (M += q * ee, Math.abs(q) < 5 * we && Math.abs(M) < we) {
1440
- j = null;
1441
- return;
1442
- }
1443
- Math.abs(M) >= we && (M > 0 !== n ? w() : m(), M = 0), A = U, F();
1444
- });
1445
- };
1446
- F();
1447
- }, p = () => {
1448
- j && (cancelAnimationFrame(j), j = null);
1449
- }, b = (i) => {
1450
- if (i.button !== 0)
1451
- return;
1452
- i.preventDefault(), i.stopPropagation(), p();
1453
- const _ = i.clientX;
1454
- h = _, x = [{ timestamp: Date.now(), value: _ }];
1455
- }, E = (i) => {
1456
- if (h === null)
1457
- return;
1458
- i.stopPropagation();
1459
- const { clientX: _ } = i;
1460
- k({ timestamp: Date.now(), value: _ });
1461
- const M = _ - h;
1462
- Math.abs(M) < we || (M > 0 !== n ? w() : m(), h = _);
1463
- }, L = () => {
1464
- h !== null && (h = null, g());
1465
- };
1466
- C.addEventListener("mousedown", b), document.addEventListener("mousemove", E), document.addEventListener("mouseleave", L), document.addEventListener("mouseup", L), document.addEventListener("contextmenu", L);
1467
- const D = () => a.getBoundingClientRect().width, T = () => a.scrollWidth / 2 - D() / 2, N = () => {
1468
- const i = T();
1469
- a.scrollLeft = i;
1470
- };
1471
- N();
1472
- const z = () => {
1473
- const i = a.scrollLeft - T();
1474
- Math.abs(i) < zr || (i < 0 !== n ? w() : m(), N());
1475
- };
1476
- a.addEventListener("scroll", z);
1477
- let S = null;
1478
- const V = (i) => {
1479
- if (S !== null || i.changedTouches.length !== 1)
1480
- return;
1481
- p();
1482
- const { identifier: _, clientX: M } = i.changedTouches[0];
1483
- S = _, h = M, x = [{ timestamp: Date.now(), value: M }];
1484
- }, R = (i) => {
1485
- if (!h)
1486
- return;
1487
- const _ = Array.from(i.changedTouches).find(
1488
- ({ identifier: F }) => F === S
1489
- );
1490
- if (!_)
1491
- return;
1492
- i.preventDefault();
1493
- const { clientX: M } = _;
1494
- k({ timestamp: Date.now(), value: M });
1495
- const A = M - h;
1496
- Math.abs(A) < we || (A > 0 !== n ? w() : m(), h = M);
1497
- }, y = (i) => {
1498
- !h || !Array.from(i.changedTouches).some(
1499
- ({ identifier: _ }) => _ === S
1500
- ) || (S = null, h = null, g());
1501
- };
1502
- return a.addEventListener("touchstart", V), a.addEventListener("touchmove", R), a.addEventListener("touchend", y), a.addEventListener("touchcancel", y), () => {
1503
- C.removeEventListener("mousedown", b), document.removeEventListener("mousemove", E), document.removeEventListener("mouseleave", L), document.removeEventListener("mouseup", L), document.removeEventListener("contextmenu", L), a.removeEventListener("scroll", z), a.removeEventListener("touchstart", V), a.removeEventListener("touchmove", R), a.removeEventListener("touchend", y), a.removeEventListener("touchcancel", y);
1504
- };
1505
- }, [w, m, u, n]), /* @__PURE__ */ t.jsx("div", { ref: f, className: "cursor-ew-resize", children: /* @__PURE__ */ t.jsxs("div", { ref: d, className: "overflow-x-scroll no-scrollbar", children: [
1506
- /* @__PURE__ */ t.jsxs("div", { className: "sticky left-0 top-0", children: [
1507
- e.map((C) => /* @__PURE__ */ t.jsx(
1508
- he,
1509
- {
1510
- src: C.src,
1511
- className: "pointer-events-none !absolute left-0 top-0 -z-10"
1512
- },
1513
- C.src
1514
- )),
1515
- /* @__PURE__ */ t.jsx(Pt, { ...e[c], onlyPreload: r })
1516
- ] }),
1517
- /* @__PURE__ */ t.jsx("div", { className: "pointer-events-none -mt-px h-px w-[calc(100%+1024px)]" })
1518
- ] }) });
1519
- }, Sr = ({ images: e, onPlaceholderImageLoaded: r, onSpinImagesLoaded: n, onError: o }) => {
1520
- const s = te(() => e.map(({ src: l }) => l), [e]), [u, f] = $(null), d = u ? [...u.values()].filter((l) => l).length / e.length * 100 : null, c = I(() => {
1521
- d === null && f(new Map(s.map((l) => [l, !1])));
1522
- }, [s, d]), v = I((l) => {
1523
- f((m) => {
1524
- const w = new Map(m);
1525
- return w.set(l, !0), w;
1526
- });
1527
- }, []);
1528
- return O(() => {
1529
- d === 100 && n();
1530
- }, [d, n]), /* @__PURE__ */ t.jsxs("div", { className: "relative size-full", children: [
1531
- d !== null && d !== 100 && // Add images to DOM to preload them
1532
- /* @__PURE__ */ t.jsx("div", { className: "hidden", children: s.map((l) => /* @__PURE__ */ t.jsx(
1533
- he,
1534
- {
1535
- src: l,
1536
- onLoad: () => v(l),
1537
- onError: o
1538
- },
1539
- l
1540
- )) }),
1541
- /* @__PURE__ */ t.jsx(
1542
- he,
1543
- {
1544
- className: "size-full",
1545
- src: s[0],
1546
- onLoad: r
1547
- }
1548
- ),
1549
- /* @__PURE__ */ t.jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-y-4 bg-foreground/35", children: [
1550
- /* @__PURE__ */ t.jsx(Tt, { className: "size-20 text-primary-light" }),
1551
- /* @__PURE__ */ t.jsx(Q, { color: "neutral", shape: "icon", onClick: c, children: /* @__PURE__ */ t.jsx(Be, { className: "size-full" }) }),
1552
- /* @__PURE__ */ t.jsx(
1553
- "div",
1554
- {
1555
- className: H(
1556
- "relative h-1 w-3/5 overflow-hidden rounded-full bg-background",
1557
- d === null && "invisible"
1558
- ),
1559
- children: /* @__PURE__ */ t.jsx(
1560
- "div",
1561
- {
1562
- className: "h-full bg-primary transition-[width]",
1563
- style: { width: `${d ?? 0}%` }
1564
- }
1565
- )
1566
- }
1567
- )
1568
- ] })
1569
- ] });
1570
- }, Vr = (e) => {
1571
- const { itemIndex: r } = e, { setItemInteraction: n } = J(), [o, s] = $();
1572
- return O(() => {
1573
- o === null || o === "error" || n(r, o === "spin" ? "running" : "ready");
1574
- }, [r, n, o]), o === "error" ? /* @__PURE__ */ t.jsx(
1575
- It,
1576
- {
1577
- className: "text-background",
1578
- text: "Spin could not be loaded"
1579
- }
1580
- ) : o !== "spin" ? /* @__PURE__ */ t.jsx(
1581
- Sr,
1582
- {
1583
- ...e,
1584
- onPlaceholderImageLoaded: () => s("placeholder"),
1585
- onSpinImagesLoaded: () => s("spin"),
1586
- onError: () => s("error")
1587
- }
1588
- ) : /* @__PURE__ */ t.jsx(Ir, { ...e });
1589
- }, Tr = (e) => /* @__PURE__ */ t.jsx(Q, { color: "neutral", shape: "icon", ...e, children: /* @__PURE__ */ t.jsx(Be, { className: "size-full" }) }), Hr = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_PAUSE", children: /* @__PURE__ */ t.jsx(
1590
- "svg",
1591
- {
1592
- className: e,
1593
- width: "16",
1594
- height: "16",
1595
- viewBox: "0 0 16 16",
1596
- fill: "none",
1597
- xmlns: "http://www.w3.org/2000/svg",
1598
- children: /* @__PURE__ */ t.jsx(
1599
- "path",
1600
- {
1601
- d: "M4 12.6667H6.66667V3.33333H4V12.6667ZM9.33333 3.33333V12.6667H12V3.33333H9.33333Z",
1602
- fill: "currentColor"
1603
- }
1604
- )
1605
- }
1606
- ) }), Rr = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_VOLUME", children: /* @__PURE__ */ t.jsx(
1607
- "svg",
1608
- {
1609
- className: e,
1610
- width: "16",
1611
- height: "16",
1612
- viewBox: "0 0 16 16",
1613
- fill: "none",
1614
- xmlns: "http://www.w3.org/2000/svg",
1615
- children: /* @__PURE__ */ t.jsx(
1616
- "path",
1617
- {
1618
- d: "M2 6V10H4.66667L8 13.3333V2.66667L4.66667 6H2ZM11 8C11 6.82 10.32 5.80667 9.33333 5.31334V10.68C10.32 10.1933 11 9.18 11 8ZM9.33333 2.15334V3.52667C11.26 4.1 12.6667 5.88667 12.6667 8C12.6667 10.1133 11.26 11.9 9.33333 12.4733V13.8467C12.0067 13.24 14 10.8533 14 8C14 5.14667 12.0067 2.76 9.33333 2.15334Z",
1619
- fill: "currentColor"
1620
- }
1621
- )
1622
- }
1623
- ) }), Ar = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_VOLUME_OFF", children: /* @__PURE__ */ t.jsx(
1624
- "svg",
1625
- {
1626
- className: e,
1627
- width: "16",
1628
- height: "16",
1629
- viewBox: "0 0 16 16",
1630
- fill: "none",
1631
- xmlns: "http://www.w3.org/2000/svg",
1632
- children: /* @__PURE__ */ t.jsx(
1633
- "path",
1634
- {
1635
- d: "M11 8C11 6.82 10.32 5.80667 9.33333 5.31333V6.78667L10.9667 8.42C10.9867 8.28667 11 8.14667 11 8ZM12.6667 8C12.6667 8.62667 12.5333 9.21333 12.3067 9.76L13.3133 10.7667C13.7533 9.94 14 9 14 8C14 5.14667 12.0067 2.76 9.33333 2.15333V3.52667C11.26 4.1 12.6667 5.88667 12.6667 8ZM2.84667 2L2 2.84667L5.15333 6H2V10H4.66667L8 13.3333V8.84667L10.8333 11.68C10.3867 12.0267 9.88667 12.3 9.33333 12.4667V13.84C10.2533 13.6333 11.0867 13.2067 11.7933 12.6333L13.1533 14L14 13.1533L2.84667 2ZM8 2.66667L6.60667 4.06L8 5.45333V2.66667Z",
1636
- fill: "currentColor"
1637
- }
1638
- )
1639
- }
1640
- ) }), at = ({ progress: e }) => /* @__PURE__ */ t.jsx("div", { className: "h-1 w-full overflow-hidden rounded-ui-sm bg-background/25", children: /* @__PURE__ */ t.jsx(
1641
- "div",
1642
- {
1643
- className: "size-full rounded-ui-sm bg-background transition-transform",
1644
- style: { transform: `translateX(-${100 * (1 - e)}%)` }
1645
- }
1646
- ) }), Pr = 3e3, Or = ({ src: e, poster: r, itemIndex: n }) => {
1647
- const { carrouselItemIndex: o, setItemInteraction: s } = J(), u = Z(null), f = Z(null), d = I(() => {
1648
- if (!f.current)
1649
- throw new Error("videoRef.current is null");
1650
- return f.current;
1651
- }, []);
1652
- O(() => {
1653
- s(n, "ready");
1654
- }, [n, s]);
1655
- const c = I(() => {
1656
- d().play();
1657
- }, [d]), v = I(() => {
1658
- d().pause();
1659
- }, [d]);
1660
- O(() => {
1661
- o === n || v();
1662
- }, [o, n, v]);
1663
- const [l, m] = $(!1), [w, C] = $(!0), a = () => {
1664
- m(!0), s(n, "running");
1665
- }, h = () => {
1666
- m(!1), s(n, "ready");
1667
- }, x = () => {
1668
- C(!1);
1669
- }, j = () => {
1670
- C(!0);
1671
- }, [k, g] = $(null), p = (i) => {
1672
- const _ = d(), M = i.currentTarget.getBoundingClientRect(), A = (i.clientX - M.left) / M.width, F = Math.min(1, Math.max(0, A));
1673
- _.volume = F, _.muted = !1;
1674
- }, b = (i) => {
1675
- const _ = d();
1676
- _.muted = i;
1677
- };
1678
- O(() => {
1679
- const i = f.current;
1680
- if (!i)
1681
- return;
1682
- const _ = () => {
1683
- g({
1684
- volume: i.volume,
1685
- isMuted: i.muted
1686
- });
1687
- };
1688
- return _(), i.addEventListener("volumechange", _), () => {
1689
- i.removeEventListener("volumechange", _);
1690
- };
1691
- }, []);
1692
- const [E, L] = $(null), D = E ? E.currentTime / E.duration : 0;
1693
- O(() => {
1694
- const i = f.current;
1695
- if (!i) return;
1696
- const _ = () => {
1697
- const M = i.currentTime, A = i.duration;
1698
- isNaN(M) || isNaN(A) || L({
1699
- currentTime: M,
1700
- duration: A
1701
- });
1702
- };
1703
- return _(), i.addEventListener("timeupdate", _), () => {
1704
- i.removeEventListener("timeupdate", _);
1705
- };
1706
- }, []);
1707
- const T = (i) => {
1708
- const _ = d(), M = i.currentTarget.getBoundingClientRect(), A = (i.clientX - M.left) / M.width, F = _.duration * A;
1709
- _.currentTime = F;
1710
- }, N = (i) => {
1711
- const _ = Math.floor(i % 3600 / 60), M = Math.floor(i % 60);
1712
- return `${_}:${M.toString().padStart(2, "0")}`;
1713
- }, [z, S] = $(!1), V = Z(void 0), R = I(
1714
- () => clearTimeout(V.current),
1715
- []
1716
- ), y = I(() => {
1717
- R(), V.current = setTimeout(() => {
1718
- S(!1);
1719
- }, Pr);
1720
- }, [R]);
1721
- return O(() => {
1722
- const i = u.current, _ = f.current;
1723
- if (!i || !_)
1724
- return;
1725
- const M = () => {
1726
- y(), S(!0);
1727
- }, A = () => {
1728
- R(), S(!1);
1729
- };
1730
- let F = !1;
1731
- const U = () => {
1732
- F = !0;
1733
- }, W = () => {
1734
- F && (F = !1, v());
1735
- }, Y = () => {
1736
- F = !1, M();
1737
- }, q = (ee) => {
1738
- ee.preventDefault(), ee.touches.length === 1 && (y(), S((fe) => !fe));
1739
- };
1740
- return i.addEventListener("mousedown", U), i.addEventListener("mouseup", W), i.addEventListener("mouseenter", M), i.addEventListener("mousemove", Y), i.addEventListener("mouseleave", A), _.addEventListener("touchstart", q), () => {
1741
- i.removeEventListener("mousedown", U), i.removeEventListener("mouseup", W), i.removeEventListener("mouseenter", M), i.removeEventListener("mousemove", M), i.removeEventListener("mouseleave", A), _.removeEventListener("touchstart", q);
1742
- };
1743
- }, [R, v, y]), /* @__PURE__ */ t.jsxs("div", { ref: u, className: "relative size-full", children: [
1744
- /* @__PURE__ */ t.jsx(
1745
- "video",
1746
- {
1747
- ref: f,
1748
- className: "size-full",
1749
- src: e,
1750
- poster: r,
1751
- disablePictureInPicture: !0,
1752
- playsInline: !0,
1753
- onPlay: a,
1754
- onPause: h,
1755
- onEnded: h,
1756
- onCanPlay: x,
1757
- onWaiting: j
1758
- }
1759
- ),
1760
- l ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1761
- /* @__PURE__ */ t.jsxs(
1762
- "div",
1763
- {
1764
- className: H(
1765
- "absolute inset-x-0 bottom-0 cursor-auto space-y-2 bg-gradient-to-t from-foreground to-transparent p-4 pr-12 pt-8 transition-opacity duration-300",
1766
- z ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0"
1767
- ),
1768
- onMouseDownCapture: (i) => i.stopPropagation(),
1769
- children: [
1770
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between text-background", children: [
1771
- /* @__PURE__ */ t.jsxs(
1772
- "div",
1773
- {
1774
- className: "flex items-center gap-x-4",
1775
- children: [
1776
- /* @__PURE__ */ t.jsx(
1777
- Q,
1778
- {
1779
- shape: "icon",
1780
- variant: "ghost",
1781
- color: "neutral",
1782
- onClick: v,
1783
- children: /* @__PURE__ */ t.jsx(Hr, { className: "size-full" })
1784
- }
1785
- ),
1786
- E && /* @__PURE__ */ t.jsxs("span", { className: "text-sm", children: [
1787
- N(E.currentTime),
1788
- " /",
1789
- " ",
1790
- N(E.duration)
1791
- ] })
1792
- ]
1793
- }
1794
- ),
1795
- k && /* @__PURE__ */ t.jsxs(
1796
- "div",
1797
- {
1798
- className: "group/volume flex items-center gap-x-4 rounded-ui-md p-2 transition-colors hover:bg-foreground/25",
1799
- children: [
1800
- /* @__PURE__ */ t.jsx(
1801
- "div",
1802
- {
1803
- className: `w-12 cursor-pointer py-1 opacity-0 transition-opacity ${k.isMuted ? "group-hover/volume:opacity-50" : "group-hover/volume:opacity-100"}`,
1804
- onClick: p,
1805
- children: /* @__PURE__ */ t.jsx(at, { progress: k.volume })
1806
- }
1807
- ),
1808
- /* @__PURE__ */ t.jsx(
1809
- "div",
1810
- {
1811
- className: "size-5 cursor-pointer",
1812
- onClick: () => b(!k.isMuted),
1813
- children: k.isMuted ? /* @__PURE__ */ t.jsx(Ar, { className: "size-full" }) : /* @__PURE__ */ t.jsx(Rr, { className: "size-full" })
1814
- }
1815
- )
1816
- ]
1817
- }
1818
- )
1819
- ] }),
1820
- /* @__PURE__ */ t.jsx(
1821
- "div",
1822
- {
1823
- className: "cursor-pointer py-1",
1824
- onClick: T,
1825
- children: /* @__PURE__ */ t.jsx(at, { progress: D })
1826
- }
1827
- )
1828
- ]
1829
- }
1830
- ),
1831
- w && /* @__PURE__ */ t.jsx(
1832
- "div",
1833
- {
1834
- className: "pointer-events-none absolute inset-0 flex items-center justify-center bg-foreground/25",
1835
- children: /* @__PURE__ */ t.jsx(St, { size: "lg", color: "background" })
1836
- }
1837
- )
1838
- ] }) : /* @__PURE__ */ t.jsx(
1839
- "div",
1840
- {
1841
- className: "absolute inset-0 flex items-center justify-center bg-foreground/25",
1842
- children: /* @__PURE__ */ t.jsx(Tr, { onClick: c })
1843
- }
1844
- )
1845
- ] });
1846
- }, Dr = ({ index: e, item: r, isShown: n }) => {
1847
- const { type: o } = r;
1848
- let s;
1849
- switch (o) {
1850
- case "image":
1851
- s = /* @__PURE__ */ t.jsx(Pt, { itemIndex: e, onlyPreload: !n, ...r });
1852
- break;
1853
- case "video":
1854
- s = /* @__PURE__ */ t.jsx(Or, { itemIndex: e, ...r });
1855
- break;
1856
- case "360":
1857
- s = /* @__PURE__ */ t.jsx(Vr, { itemIndex: e, onlyPreload: !n, ...r });
1858
- break;
1859
- case "custom":
1860
- s = /* @__PURE__ */ t.jsx(Nr, { itemIndex: e, ...r });
1861
- }
1862
- return s = /* @__PURE__ */ t.jsx("div", { className: "-ml-px h-full w-[calc(100%+2px)]", children: s }), s;
1863
- }, Fr = (e) => {
1864
- O(() => {
1865
- const r = (n) => {
1866
- n.key === "Escape" && e();
1867
- };
1868
- return addEventListener("keydown", r), () => {
1869
- removeEventListener("keydown", r);
1870
- };
1871
- }, [e]);
1872
- };
1873
- function $r(e) {
1874
- return e.target === e.currentTarget;
1875
- }
1876
- const Zr = ({ currentIndex: e, maxIndex: r }) => /* @__PURE__ */ t.jsxs("div", { className: "space-x-0.5 rounded-ui bg-foreground/40 px-1.5 py-0.5 text-xs text-background/75 transition-radius small:space-x-1 small:px-2 small:py-1 small:text-sm", children: [
1877
- /* @__PURE__ */ t.jsx("span", { children: e + 1 }),
1878
- /* @__PURE__ */ t.jsx("span", { children: "/" }),
1879
- /* @__PURE__ */ t.jsx("span", { children: r + 1 })
1880
- ] }), it = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_ARROW_RIGHT", children: /* @__PURE__ */ t.jsx("svg", { className: e, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t.jsx(
1881
- "path",
1882
- {
1883
- d: "M4.07666 13.4868L5.25666 14.6668L11.9233 8.00016L5.25666 1.3335L4.07666 2.5135L9.56333 8.00016L4.07666 13.4868Z",
1884
- fill: "currentColor"
1885
- }
1886
- ) }) }), Ur = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_EXTEND", children: /* @__PURE__ */ t.jsx("svg", { className: e, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t.jsx(
1887
- "path",
1888
- {
1889
- d: "M4.66683 9.3335H3.3335V12.6668H6.66683V11.3335H4.66683V9.3335ZM3.3335 6.66683H4.66683V4.66683H6.66683V3.3335H3.3335V6.66683ZM11.3335 11.3335H9.3335V12.6668H12.6668V9.3335H11.3335V11.3335ZM9.3335 3.3335V4.66683H11.3335V6.66683H12.6668V3.3335H9.3335Z",
1890
- fill: "currentColor"
1891
- }
1892
- ) }) }), Wr = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_GALLERY", children: /* @__PURE__ */ t.jsx("svg", { className: e, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t.jsx(
1893
- "path",
1894
- {
1895
- d: "M13.3334 2.66683V10.6668H5.33337V2.66683H13.3334ZM13.3334 1.3335H5.33337C4.60004 1.3335 4.00004 1.9335 4.00004 2.66683V10.6668C4.00004 11.4002 4.60004 12.0002 5.33337 12.0002H13.3334C14.0667 12.0002 14.6667 11.4002 14.6667 10.6668V2.66683C14.6667 1.9335 14.0667 1.3335 13.3334 1.3335ZM7.66671 7.78016L8.79337 9.28683L10.4467 7.22016L12.6667 10.0002H6.00004L7.66671 7.78016ZM1.33337 4.00016V13.3335C1.33337 14.0668 1.93337 14.6668 2.66671 14.6668H12V13.3335H2.66671V4.00016H1.33337Z",
1896
- fill: "currentColor"
1897
- }
1898
- ) }) }), Yr = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_HOTSPOTS", children: /* @__PURE__ */ t.jsxs(
1899
- "svg",
1900
- {
1901
- className: e,
1902
- width: "12",
1903
- height: "12",
1904
- viewBox: "0 0 12 12",
1905
- fill: "none",
1906
- xmlns: "http://www.w3.org/2000/svg",
1907
- children: [
1908
- /* @__PURE__ */ t.jsx("g", { clipPath: "url(#clip0_418_982)", children: /* @__PURE__ */ t.jsx(
1909
- "path",
1910
- {
1911
- d: "M6 4C4.895 4 4 4.895 4 6C4 7.105 4.895 8 6 8C7.105 8 8 7.105 8 6C8 4.895 7.105 4 6 4ZM10.47 5.5C10.24 3.415 8.585 1.76 6.5 1.53V0.5H5.5V1.53C3.415 1.76 1.76 3.415 1.53 5.5H0.5V6.5H1.53C1.76 8.585 3.415 10.24 5.5 10.47V11.5H6.5V10.47C8.585 10.24 10.24 8.585 10.47 6.5H11.5V5.5H10.47ZM6 9.5C4.065 9.5 2.5 7.935 2.5 6C2.5 4.065 4.065 2.5 6 2.5C7.935 2.5 9.5 4.065 9.5 6C9.5 7.935 7.935 9.5 6 9.5Z",
1912
- fill: "currentColor"
1913
- }
1914
- ) }),
1915
- /* @__PURE__ */ t.jsx("defs", { children: /* @__PURE__ */ t.jsx("clipPath", { id: "clip0_418_982", children: /* @__PURE__ */ t.jsx("rect", { width: "12", height: "12", fill: "white" }) }) })
1916
- ]
1917
- }
1918
- ) }), Xr = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_MINUS", children: /* @__PURE__ */ t.jsx(
1919
- "svg",
1920
- {
1921
- className: e,
1922
- width: "16",
1923
- height: "16",
1924
- viewBox: "0 0 16 16",
1925
- fill: "none",
1926
- xmlns: "http://www.w3.org/2000/svg",
1927
- children: /* @__PURE__ */ t.jsx(
1928
- "path",
1929
- {
1930
- d: "M12.6666 8.66634H3.33325V7.33301H12.6666V8.66634Z",
1931
- fill: "currentColor"
1932
- }
1933
- )
1934
- }
1935
- ) }), Br = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_PLUS", children: /* @__PURE__ */ t.jsx(
1936
- "svg",
1937
- {
1938
- className: e,
1939
- width: "16",
1940
- height: "16",
1941
- viewBox: "0 0 16 16",
1942
- fill: "none",
1943
- xmlns: "http://www.w3.org/2000/svg",
1944
- children: /* @__PURE__ */ t.jsx(
1945
- "path",
1946
- {
1947
- d: "M12.6666 8.66634H8.66659V12.6663H7.33325V8.66634H3.33325V7.33301H7.33325V3.33301H8.66659V7.33301H12.6666V8.66634Z",
1948
- fill: "currentColor"
1949
- }
1950
- )
1951
- }
1952
- ) }), Gr = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_REDUCE", children: /* @__PURE__ */ t.jsx("svg", { className: e, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ t.jsx(
1953
- "path",
1954
- {
1955
- d: "M3.33325 10.6668H5.33325V12.6668H6.66659V9.3335H3.33325V10.6668ZM5.33325 5.3335H3.33325V6.66683H6.66659V3.3335H5.33325V5.3335ZM9.33325 12.6668H10.6666V10.6668H12.6666V9.3335H9.33325V12.6668ZM10.6666 5.3335V3.3335H9.33325V6.66683H12.6666V5.3335H10.6666Z",
1956
- fill: "currentColor"
1957
- }
1958
- ) }) }), Kr = ({
1959
- enabled: e,
1960
- onToggle: r,
1961
- label: n,
1962
- className: o,
1963
- children: s
1964
- }) => /* @__PURE__ */ t.jsxs(
1965
- "label",
1966
- {
1967
- className: H(
1968
- "flex cursor-pointer items-center justify-center gap-x-2",
1969
- o
1970
- ),
1971
- children: [
1972
- /* @__PURE__ */ t.jsx(
1973
- "input",
1974
- {
1975
- type: "checkbox",
1976
- className: "sr-only",
1977
- checked: e,
1978
- onChange: r
1979
- }
1980
- ),
1981
- n && /* @__PURE__ */ t.jsx("div", { className: "text-xs text-background", children: n }),
1982
- /* @__PURE__ */ t.jsx(
1983
- "div",
1984
- {
1985
- className: H(
1986
- "flex h-5 w-8 items-center justify-center rounded-full transition-colors",
1987
- e ? "bg-primary" : "bg-background/60"
1988
- ),
1989
- children: /* @__PURE__ */ t.jsx(
1990
- "div",
1991
- {
1992
- className: H(
1993
- "flex size-4 items-center justify-center rounded-full p-0.5 transition",
1994
- e ? "translate-x-1.5 bg-primary-foreground text-primary" : "-translate-x-1.5 bg-background text-foreground"
1995
- ),
1996
- children: s
1997
- }
1998
- )
1999
- }
2000
- )
2001
- ]
2002
- }
2003
- ), qr = ({ className: e }) => /* @__PURE__ */ t.jsx(G, { className: e, customizationKey: "UI_BURGER", children: /* @__PURE__ */ t.jsx(
2004
- "svg",
2005
- {
2006
- className: e,
2007
- width: "16",
2008
- height: "16",
2009
- viewBox: "0 0 16 16",
2010
- fill: "none",
2011
- xmlns: "http://www.w3.org/2000/svg",
2012
- children: /* @__PURE__ */ t.jsx(
2013
- "path",
2014
- {
2015
- d: "M2 12H14V10.6667H2V12ZM2 8.66667H14V7.33333H2V8.66667ZM2 4V5.33333H14V4H2Z",
2016
- fill: "currentColor"
2017
- }
2018
- )
2019
- }
2020
- ) }), Jr = ({ sharedClassName: e }) => {
2021
- const { categories: r } = oe(), { displayedCategoryId: n, changeCategory: o } = J(), [s, u] = $(!1), f = () => {
2022
- u(!s);
2023
- }, d = () => {
2024
- u(!1);
2025
- };
2026
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2027
- s && /* @__PURE__ */ t.jsx(
2028
- "div",
2029
- {
2030
- className: H(e, "inset-0 small:hidden"),
2031
- onClick: d
2032
- }
2033
- ),
2034
- /* @__PURE__ */ t.jsxs(
2035
- "div",
2036
- {
2037
- className: H(
2038
- e,
2039
- pe("top-left"),
2040
- "flex gap-x-2 small:hidden"
2041
- ),
2042
- children: [
2043
- /* @__PURE__ */ t.jsx(
2044
- Q,
2045
- {
2046
- shape: "icon",
2047
- color: s ? "primary" : "neutral",
2048
- onClick: f,
2049
- children: /* @__PURE__ */ t.jsx(qr, {})
2050
- }
2051
- ),
2052
- s && /* @__PURE__ */ t.jsx("div", { className: "rounded-ui-md bg-background transition-radius", children: /* @__PURE__ */ t.jsx("ul", { className: "space-y-0.5 p-1", children: r.map(({ id: c, title: v }) => /* @__PURE__ */ t.jsx(
2053
- "li",
2054
- {
2055
- className: H(
2056
- "cursor-pointer rounded-ui px-2 py-1 text-sm font-bold transition-all hover:bg-primary/30",
2057
- c === n && "bg-primary/50"
2058
- ),
2059
- onClick: () => {
2060
- o(c), u(!1);
2061
- },
2062
- children: v
2063
- },
2064
- c
2065
- )) }) })
2066
- ]
2067
- }
2068
- ),
2069
- /* @__PURE__ */ t.jsx(
2070
- "div",
2071
- {
2072
- className: H(
2073
- e,
2074
- Mt("top"),
2075
- "w-full overflow-x-auto max-small:hidden"
2076
- ),
2077
- children: /* @__PURE__ */ t.jsx("div", { className: "mx-auto flex w-fit gap-x-1 rounded-ui-md bg-background p-1 shadow", children: r.map(({ id: c, title: v }) => /* @__PURE__ */ t.jsx(
2078
- Q,
2079
- {
2080
- variant: c === n ? "fill" : "ghost",
2081
- onClick: () => o(c),
2082
- children: v
2083
- },
2084
- c
2085
- )) })
2086
- }
2087
- )
2088
- ] });
2089
- }, Qr = () => {
2090
- const { hideCategories: e, infiniteCarrousel: r, permanentGallery: n } = re(), { aspectRatioStyle: o } = oe(), {
2091
- items: { length: s },
2092
- slidable: u,
2093
- carrouselItemIndex: f,
2094
- masterItemIndex: d,
2095
- prevItem: c,
2096
- nextItem: v,
2097
- showGalleryControls: l,
2098
- enableHotspotsControl: m,
2099
- showHotspots: w,
2100
- toggleHotspots: C,
2101
- showGallery: a,
2102
- toggleGallery: h,
2103
- extendMode: x,
2104
- toggleExtendMode: j,
2105
- shownDetails: k,
2106
- isShowingDetails: g,
2107
- resetShownDetails: p,
2108
- showZoomControls: b,
2109
- isZooming: E,
2110
- canZoomIn: L,
2111
- zoomIn: D,
2112
- canZoomOut: T,
2113
- zoomOut: N,
2114
- resetView: z
2115
- } = J(), S = I(
2116
- (R) => {
2117
- $r(R) && p();
2118
- },
2119
- [p]
2120
- );
2121
- Fr(p);
2122
- const V = "absolute z-overlay";
2123
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2124
- !e && /* @__PURE__ */ t.jsx(
2125
- Jr,
2126
- {
2127
- sharedClassName: H(
2128
- V,
2129
- "transition-opacity",
2130
- E ? "!pointer-events-none opacity-0" : "opacity-100"
2131
- )
2132
- }
2133
- ),
2134
- u && !E && /* @__PURE__ */ t.jsx("div", { className: H(V, pe("top-right")), children: /* @__PURE__ */ t.jsx(
2135
- Zr,
2136
- {
2137
- currentIndex: f,
2138
- maxIndex: s - 1
2139
- }
2140
- ) }),
2141
- u && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2142
- /* @__PURE__ */ t.jsx(
2143
- Q,
2144
- {
2145
- shape: "icon",
2146
- color: "neutral",
2147
- className: H(
2148
- V,
2149
- pe("middle-left"),
2150
- E ? "!pointer-events-none opacity-0" : "opacity-100"
2151
- ),
2152
- onClick: c,
2153
- disabled: !r && d <= 0,
2154
- children: /* @__PURE__ */ t.jsx(G, { customizationKey: "CONTROLS_PREV", children: /* @__PURE__ */ t.jsx(it, { className: "size-full -scale-x-100" }) })
2155
- }
2156
- ),
2157
- /* @__PURE__ */ t.jsx(
2158
- Q,
2159
- {
2160
- shape: "icon",
2161
- color: "neutral",
2162
- className: H(
2163
- V,
2164
- pe("middle-right"),
2165
- E ? "!pointer-events-none opacity-0" : "opacity-100"
2166
- ),
2167
- onClick: v,
2168
- disabled: !r && d >= s - 1,
2169
- children: /* @__PURE__ */ t.jsx(G, { customizationKey: "CONTROLS_NEXT", children: /* @__PURE__ */ t.jsx(it, { className: "size-full" }) })
2170
- }
2171
- )
2172
- ] }),
2173
- /* @__PURE__ */ t.jsxs(
2174
- "div",
2175
- {
2176
- className: H(
2177
- V,
2178
- pe("bottom-fullW"),
2179
- "pointer-events-none grid grid-cols-[auto,1fr,auto] items-end *:pointer-events-auto small:gap-x-2"
2180
- ),
2181
- children: [
2182
- !n && u && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2183
- /* @__PURE__ */ t.jsx(
2184
- Q,
2185
- {
2186
- className: l && !E ? "opacity-100" : "!pointer-events-none opacity-0",
2187
- variant: "fill",
2188
- color: a ? "primary" : "neutral",
2189
- shape: "icon",
2190
- onClick: h,
2191
- children: /* @__PURE__ */ t.jsx(Wr, { className: "size-full" })
2192
- }
2193
- ),
2194
- a && /* @__PURE__ */ t.jsx(
2195
- Rt,
2196
- {
2197
- className: H(
2198
- "transition-opacity",
2199
- l && !E ? "opacity-100" : "!pointer-events-none opacity-0",
2200
- // Left & Right gradient mask to fade the gallery
2201
- "[mask-image:linear-gradient(to_left,transparent_0px,black_4px,black_calc(100%-4px),transparent_100%)]"
2202
- ),
2203
- containerClassName: "mx-1"
2204
- }
2205
- )
2206
- ] }),
2207
- /* @__PURE__ */ t.jsxs("div", { className: "col-start-3 flex flex-col items-end gap-y-1 small:gap-y-2", children: [
2208
- m && /* @__PURE__ */ t.jsx(
2209
- Kr,
2210
- {
2211
- className: H(
2212
- "transition-opacity",
2213
- E ? "!pointer-events-none opacity-0" : "opacity-100"
2214
- ),
2215
- enabled: w,
2216
- onToggle: C,
2217
- children: /* @__PURE__ */ t.jsx(Yr, { className: "size-full" })
2218
- }
2219
- ),
2220
- b && /* @__PURE__ */ t.jsxs("div", { className: "max-small:hidden", children: [
2221
- /* @__PURE__ */ t.jsx(
2222
- Q,
2223
- {
2224
- className: "rounded-b-none",
2225
- color: "neutral",
2226
- shape: "icon",
2227
- disabled: !L,
2228
- onClick: D,
2229
- children: /* @__PURE__ */ t.jsx(Br, { className: "size-full" })
2230
- }
2231
- ),
2232
- /* @__PURE__ */ t.jsx(Ht, { color: "background" }),
2233
- /* @__PURE__ */ t.jsx(
2234
- Q,
2235
- {
2236
- className: "rounded-t-none",
2237
- color: "neutral",
2238
- shape: "icon",
2239
- disabled: !T,
2240
- onClick: N,
2241
- children: /* @__PURE__ */ t.jsx(Xr, { className: "size-full" })
2242
- }
2243
- )
2244
- ] }),
2245
- /* @__PURE__ */ t.jsx(
2246
- Q,
2247
- {
2248
- variant: "fill",
2249
- color: x ? "primary" : "neutral",
2250
- shape: "icon",
2251
- onClick: j,
2252
- children: x ? /* @__PURE__ */ t.jsx(Gr, { className: "size-full" }) : /* @__PURE__ */ t.jsx(Ur, { className: "size-full" })
2253
- }
2254
- )
2255
- ] })
2256
- ]
2257
- }
2258
- ),
2259
- /* @__PURE__ */ t.jsx(
2260
- "div",
2261
- {
2262
- className: H(
2263
- V,
2264
- "inset-0 flex justify-end overflow-hidden bg-foreground/60 transition-opacity duration-details",
2265
- g ? "opacity-100" : "pointer-events-none opacity-0"
2266
- ),
2267
- onClick: S,
2268
- children: /* @__PURE__ */ t.jsx(
2269
- "div",
2270
- {
2271
- className: H(
2272
- "h-full w-3/5 bg-background transition-transform duration-details",
2273
- g ? "translate-x-0" : "translate-x-full"
2274
- ),
2275
- children: !!k && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2276
- /* @__PURE__ */ t.jsx(
2277
- he,
2278
- {
2279
- className: "w-full bg-foreground/65",
2280
- style: o,
2281
- src: k.src,
2282
- imgInPlayerWidthRatio: 0.6
2283
- }
2284
- ),
2285
- /* @__PURE__ */ t.jsxs(
2286
- "div",
2287
- {
2288
- className: H(
2289
- "space-y-1 px-2 py-1 small:p-3",
2290
- x && "large:p-4"
2291
- ),
2292
- children: [
2293
- k.title && /* @__PURE__ */ t.jsx(
2294
- "span",
2295
- {
2296
- className: H(
2297
- "text-sm font-semibold small:text-base small:font-bold",
2298
- x && "large:text-lg"
2299
- ),
2300
- children: k.title
2301
- }
2302
- ),
2303
- k.text && /* @__PURE__ */ t.jsx(
2304
- "p",
2305
- {
2306
- className: H(
2307
- "text-xs text-foreground/65 small:text-sm",
2308
- x && "large:text-base"
2309
- ),
2310
- children: k.text
2311
- }
2312
- )
2313
- ]
2314
- }
2315
- )
2316
- ] })
2317
- }
2318
- )
2319
- }
2320
- ),
2321
- (E || g) && /* @__PURE__ */ t.jsx(
2322
- zt,
2323
- {
2324
- className: H(V, pe("top-right")),
2325
- onClick: z
2326
- }
2327
- )
2328
- ] });
2329
- }, en = ({ className: e = "" }) => {
2330
- const { infiniteCarrousel: r, preloadRange: n, isFullScreen: o } = re(), { aspectRatioStyle: s } = oe(), {
2331
- items: u,
2332
- slidable: f,
2333
- carrouselItemIndex: d,
2334
- setCarrouselItemIndex: c,
2335
- itemIndexCommand: v,
2336
- setItemIndexCommand: l,
2337
- specialCommand: m,
2338
- isRunningSpecialCommand: w,
2339
- finishSpecialCommand: C,
2340
- extendMode: a,
2341
- extendTransition: h
2342
- } = J(), x = Z(null), j = I((y) => {
2343
- if (!x.current)
2344
- throw new Error(`[${y ?? "sliderOrThrow"}] slider.current is null`);
2345
- return x.current;
2346
- }, []), k = Z(!1), g = Z(null), p = Z(null), b = Z(null), E = I(() => {
2347
- b.current && cancelAnimationFrame(b.current);
2348
- }, []), L = I(() => {
2349
- const y = j("computeClosestSnapIndex"), i = Array.from(y.children), _ = y.scrollLeft, M = i.reduce(
2350
- (A, F, U) => {
2351
- const W = F.offsetLeft;
2352
- return Math.abs(W - _) < Math.abs(i[A].offsetLeft - _) ? U : A;
2353
- },
2354
- 0
2355
- );
2356
- return m === "first_to_last" ? rt(M, u.length) : m === "last_to_first" ? rt(M - 1, u.length) : M;
2357
- }, [m, j, u.length]), D = I(
2358
- (y) => {
2359
- const i = j("setStyleCursor");
2360
- i.style.cursor = y;
2361
- },
2362
- [j]
2363
- ), T = I(
2364
- (y) => {
2365
- const i = j("setStyleSnapState");
2366
- y === "mandatory" ? i.style.scrollSnapType = "x mandatory" : i.style.scrollSnapType = "none";
2367
- },
2368
- [j]
2369
- ), N = I(
2370
- (y, i, _) => {
2371
- E();
2372
- const M = j("scrollToIndex"), A = Array.from(M.children), F = M.scrollLeft, U = A[y].offsetLeft, W = (ae) => {
2373
- M.scrollTo({
2374
- left: ae,
2375
- behavior: "instant"
2376
- });
2377
- }, Y = () => {
2378
- W(U), T("mandatory"), _?.();
2379
- }, q = Math.abs(F - U);
2380
- if (q < 1 || i === "instant") {
2381
- Y();
2382
- return;
2383
- }
2384
- const ee = le(q / 2.5, 300, 1e3), fe = (/* @__PURE__ */ new Date()).getTime();
2385
- T("none");
2386
- const se = () => {
2387
- const ae = () => {
2388
- const je = (/* @__PURE__ */ new Date()).getTime() - fe;
2389
- if (je >= ee) {
2390
- Y();
2391
- return;
2392
- }
2393
- const Se = Math.min(je / ee, 1), Ve = At(Se), ce = Le(F, U, Ve);
2394
- W(ce), se();
2395
- };
2396
- b.current = requestAnimationFrame(ae);
2397
- };
2398
- se();
2399
- },
2400
- [E, j, T]
2401
- ), [z, S] = $(), V = !!z;
2402
- O(() => {
2403
- const y = () => {
2404
- clearTimeout(z);
2405
- const i = setTimeout(() => {
2406
- S(void 0);
2407
- }, Et);
2408
- S(i);
2409
- };
2410
- return addEventListener("resize", y), document.addEventListener("fullscreenchange", y), () => {
2411
- removeEventListener("resize", y), document.removeEventListener("fullscreenchange", y);
2412
- };
2413
- }, [z]), O(() => {
2414
- const y = L();
2415
- Number.isNaN(y) || y !== d && N(d, "instant");
2416
- }, [
2417
- d,
2418
- N,
2419
- L,
2420
- // - Run the effect when those values change
2421
- u,
2422
- z,
2423
- o,
2424
- a,
2425
- h
2426
- ]), O(() => {
2427
- if (!f || w) {
2428
- D("auto");
2429
- return;
2430
- }
2431
- const y = x.current;
2432
- if (!y)
2433
- return;
2434
- D("grab"), T("mandatory");
2435
- const i = (A) => {
2436
- A.button === 0 && (A.preventDefault(), A.stopPropagation(), E(), k.current = !0, g.current = A.pageX - y.offsetLeft, p.current = y.scrollLeft, D("grabbing"));
2437
- }, _ = (A) => {
2438
- if (!k.current)
2439
- return;
2440
- if (g.current === null)
2441
- throw new Error("[onMouseMove] startX is null");
2442
- T("none");
2443
- const F = A.pageX - y.offsetLeft - g.current;
2444
- requestAnimationFrame(() => {
2445
- if (p.current === null)
2446
- throw new Error("[onMouseMove] scrollLeft is null");
2447
- y.scrollLeft = p.current - F;
2448
- });
2449
- }, M = () => {
2450
- if (!k.current)
2451
- return;
2452
- k.current = !1, D("grab");
2453
- const A = L();
2454
- N(A, "smooth");
2455
- };
2456
- return y.addEventListener("mousedown", i), document.addEventListener("mousemove", _), document.addEventListener("mouseleave", M), document.addEventListener("mouseup", M), document.addEventListener("contextmenu", M), () => {
2457
- y.removeEventListener("mousedown", i), document.removeEventListener("mousemove", _), document.removeEventListener("mouseleave", M), document.removeEventListener("mouseup", M), document.removeEventListener("contextmenu", M);
2458
- };
2459
- }, [
2460
- E,
2461
- L,
2462
- w,
2463
- N,
2464
- D,
2465
- T,
2466
- f
2467
- ]), O(() => {
2468
- if (h || V)
2469
- return;
2470
- const y = x.current;
2471
- if (!y)
2472
- return;
2473
- const i = () => {
2474
- const _ = L();
2475
- Number.isNaN(_) || (c(_), _ === v && l(null));
2476
- };
2477
- return y.addEventListener("scroll", i), () => {
2478
- y.removeEventListener("scroll", i);
2479
- };
2480
- }, [
2481
- L,
2482
- h,
2483
- w,
2484
- V,
2485
- v,
2486
- u.length,
2487
- c,
2488
- l
2489
- ]), O(() => {
2490
- if (v === null)
2491
- return;
2492
- const y = () => C();
2493
- switch (m) {
2494
- case "first_to_last":
2495
- N(u.length, "instant"), N(u.length - 1, "smooth", y);
2496
- break;
2497
- case "last_to_first":
2498
- N(0, "instant"), N(1, "smooth", y);
2499
- break;
2500
- case "instant":
2501
- N(v, "instant", y);
2502
- break;
2503
- default:
2504
- N(v, "smooth");
2505
- break;
2506
- }
2507
- }, [
2508
- m,
2509
- C,
2510
- v,
2511
- u.length,
2512
- N
2513
- ]);
2514
- const R = () => /* @__PURE__ */ t.jsx("div", { className: "h-full", style: s });
2515
- return /* @__PURE__ */ t.jsxs(
2516
- "div",
2517
- {
2518
- className: H(
2519
- "relative overflow-hidden rounded-carrousel transition-radius",
2520
- e
2521
- ),
2522
- style: s,
2523
- children: [
2524
- /* @__PURE__ */ t.jsxs(
2525
- "div",
2526
- {
2527
- ref: x,
2528
- className: `flex size-full ${f ? "overflow-x-auto no-scrollbar *:snap-start *:snap-always" : "justify-center"}`,
2529
- children: [
2530
- m === "last_to_first" && /* @__PURE__ */ t.jsx(R, {}),
2531
- u.map((y, i) => {
2532
- const _ = i === d, M = i === 0, A = i === u.length - 1, F = (() => {
2533
- if (m === "first_to_last" && M)
2534
- return {
2535
- transform: `translateX(${100 * u.length}%)`
2536
- };
2537
- if (m === "last_to_first" && A)
2538
- return {
2539
- transform: `translateX(-${100 * u.length}%)`
2540
- };
2541
- })();
2542
- let U = Math.abs(i - d) <= n;
2543
- U ||= i === v, r && (U ||= d < n && u.length - i <= n - d, U ||= d >= u.length - n && i <= n - (u.length - d));
2544
- const W = (() => {
2545
- let Y;
2546
- switch (y.type) {
2547
- case "360":
2548
- Y = y.images[0].src;
2549
- break;
2550
- case "image":
2551
- Y = y.src;
2552
- break;
2553
- case "video":
2554
- Y = y.poster ?? "video";
2555
- break;
2556
- case "custom":
2557
- Y = "custom";
2558
- break;
2559
- }
2560
- return `${i}_${Y}`;
2561
- })();
2562
- return /* @__PURE__ */ t.jsx(
2563
- "div",
2564
- {
2565
- className: H(
2566
- "h-full bg-foreground/35",
2567
- d === i && "z-1"
2568
- // Give high-ground to the shown item (to avoid 1px vertical line)
2569
- ),
2570
- style: { ...s, ...F },
2571
- children: U && /* @__PURE__ */ t.jsx(Dr, { index: i, item: y, isShown: _ })
2572
- },
2573
- W
2574
- );
2575
- }),
2576
- m === "first_to_last" && /* @__PURE__ */ t.jsx(R, {})
2577
- ]
2578
- }
2579
- ),
2580
- /* @__PURE__ */ t.jsx(Qr, {})
2581
- ]
2582
- }
2583
- );
2584
- }, tn = () => {
2585
- const { permanentGallery: e } = re(), { aspectRatioStyle: r } = oe(), {
2586
- prevItem: n,
2587
- nextItem: o,
2588
- isShowingDetails: s,
2589
- resetShownDetails: u,
2590
- extendMode: f,
2591
- disableExtendMode: d,
2592
- isZooming: c,
2593
- resetZoom: v,
2594
- fakeFullScreen: l
2595
- } = J(), m = Z(null), w = Z(null), C = Z(null);
2596
- return O(() => {
2597
- if (!f)
2598
- return;
2599
- const a = m.current, h = w.current, x = C.current;
2600
- if (!a || !h || !x)
2601
- return;
2602
- let j = !1;
2603
- const k = (b) => [a, h, x].includes(b.target), g = (b) => {
2604
- j = k(b);
2605
- }, p = (b) => {
2606
- j && (k(b) && d(), j = !1);
2607
- };
2608
- return a.addEventListener("mousedown", g), a.addEventListener("mouseup", p), () => {
2609
- a.removeEventListener("mousedown", g), a.removeEventListener("mouseup", p);
2610
- };
2611
- }, [d, f]), O(() => {
2612
- const a = (h) => {
2613
- h.key === "Escape" && (c ? v() : s ? u() : d());
2614
- };
2615
- return addEventListener("keydown", a), () => {
2616
- removeEventListener("keydown", a);
2617
- };
2618
- }, [
2619
- d,
2620
- s,
2621
- c,
2622
- o,
2623
- n,
2624
- u,
2625
- v
2626
- ]), /* @__PURE__ */ t.jsxs(
2627
- "div",
2628
- {
2629
- ref: m,
2630
- className: H(
2631
- l ? "fixed inset-0 z-overlay" : "relative",
2632
- f && "flex size-full items-center justify-center bg-foreground/75"
2633
- ),
2634
- children: [
2635
- /* @__PURE__ */ t.jsxs(
2636
- "div",
2637
- {
2638
- ref: w,
2639
- className: f ? "flex size-full flex-col justify-center gap-y-2 small:gap-y-4" : "space-y-2",
2640
- children: [
2641
- /* @__PURE__ */ t.jsx(
2642
- "div",
2643
- {
2644
- ref: C,
2645
- className: H(
2646
- f && "mx-auto flex min-h-0 w-full max-w-[1600px] justify-center"
2647
- ),
2648
- style: r,
2649
- children: /* @__PURE__ */ t.jsx(en, { className: H(f && "h-full min-w-0") })
2650
- }
2651
- ),
2652
- e && /* @__PURE__ */ t.jsx(Rt, { className: H(f && "my-2 shrink-0 small:my-4") })
2653
- ]
2654
- }
2655
- ),
2656
- f && /* @__PURE__ */ t.jsx(
2657
- zt,
2658
- {
2659
- className: "absolute right-2 top-2 small:right-4 small:top-4",
2660
- onClick: d
2661
- }
2662
- )
2663
- ]
2664
- }
2665
- );
2666
- }, rn = () => {
2667
- const { emitEvent: e, compositionUrl: r } = re(), {
2668
- data: n,
2669
- status: o,
2670
- isSuccess: s,
2671
- error: u
2672
- } = ar(r);
2673
- return O(() => {
2674
- u ? e(mt, u) : o === "fetching" ? e(dt, r) : s && e(ut, n);
2675
- }, [n, r, e, u, s, o]), u ? /* @__PURE__ */ t.jsx(
2676
- It,
2677
- {
2678
- className: "aspect-square text-foreground/70",
2679
- text: "Player could not be loaded"
2680
- }
2681
- ) : s ? /* @__PURE__ */ t.jsx(lr, { composition: n, children: /* @__PURE__ */ t.jsx(dr, { children: /* @__PURE__ */ t.jsx(tn, {}) }) }) : /* @__PURE__ */ t.jsxs("div", { className: "flex aspect-square size-full flex-col items-center justify-center gap-y-4", children: [
2682
- /* @__PURE__ */ t.jsx("div", { className: "animate-pulse text-xl", children: "Loading Player" }),
2683
- /* @__PURE__ */ t.jsx(St, { color: "foreground" })
2684
- ] });
2685
- }, nn = ({
2686
- compositionUrl: e,
2687
- hideCategories: r = Bt,
2688
- infiniteCarrousel: n = Gt,
2689
- permanentGallery: o = Kt,
2690
- mediaLoadStrategy: s = qt,
2691
- minMediaWidth: u = Jt,
2692
- maxMediaWidth: f = Qt,
2693
- preloadRange: d = er,
2694
- preventFullScreen: c = tr,
2695
- eventPrefix: v = bt,
2696
- reverse360: l = rr,
2697
- children: m
2698
- // NOTE: use to customize the player, not to display the content
2699
- }) => {
2700
- const w = Z(null), [C, a] = $(0.5), [h, x] = $(!1), j = I(
2701
- (p, b) => {
2702
- const E = v + p, L = new CustomEvent(E, { detail: b });
2703
- document.dispatchEvent(L);
2704
- },
2705
- [v]
2706
- );
2707
- O(() => {
2708
- if (h) {
2709
- a(1);
2710
- return;
2711
- }
2712
- if (!w.current)
2713
- return;
2714
- const p = w.current, b = () => {
2715
- const E = window.innerWidth, L = p.clientWidth;
2716
- a(L / E);
2717
- };
2718
- return b(), addEventListener("resize", b), () => {
2719
- removeEventListener("resize", b);
2720
- };
2721
- }, [h]), O(() => {
2722
- if (c)
2723
- return;
2724
- const p = w.current;
2725
- if (!p)
2726
- throw new Error("Wrapper not found");
2727
- const b = () => {
2728
- const { fullscreenElement: E } = document;
2729
- x(
2730
- E === p || // NOTE: For custom element, the web browser is making the whole custom element full-screen and not only the wrapper
2731
- E?.localName === Ie
2732
- );
2733
- };
2734
- return document.addEventListener("fullscreenchange", b), () => {
2735
- document.removeEventListener("fullscreenchange", b);
2736
- };
2737
- }, [c]);
2738
- const k = I(async () => {
2739
- const p = w.current;
2740
- if (!p)
2741
- throw new Error("Wrapper not found");
2742
- try {
2743
- return await p.requestFullscreen(), !0;
2744
- } catch {
2745
- return !1;
2746
- }
2747
- }, []), g = I(async () => {
2748
- try {
2749
- return await document.exitFullscreen(), !0;
2750
- } catch {
2751
- return !1;
2752
- }
2753
- }, []);
2754
- return /* @__PURE__ */ t.jsx(
2755
- ir,
2756
- {
2757
- compositionUrl: e,
2758
- hideCategories: r,
2759
- infiniteCarrousel: n,
2760
- permanentGallery: o,
2761
- mediaLoadStrategy: s,
2762
- minMediaWidth: u,
2763
- maxMediaWidth: f,
2764
- preloadRange: d,
2765
- preventFullScreen: c,
2766
- reverse360: l,
2767
- emitEvent: j,
2768
- playerInViewportWidthRatio: C,
2769
- isFullScreen: h,
2770
- requestFullscreen: k,
2771
- exitFullscreen: g,
2772
- children: /* @__PURE__ */ t.jsxs(cr, { children: [
2773
- /* @__PURE__ */ t.jsx(
2774
- "div",
2775
- {
2776
- id: "cc-webplayer-wrapper",
2777
- ref: w,
2778
- className: "select-none text-foreground",
2779
- children: /* @__PURE__ */ t.jsx(rn, {})
2780
- }
2781
- ),
2782
- m
2783
- ] })
2784
- }
2785
- );
2786
- }, on = ({ children: e, index: r, thumbnailSrc: n }) => {
2787
- const { registerCustomMedia: o, unregisterCustomMedia: s } = ye();
2788
- return O(() => {
2789
- if (!e)
2790
- return;
2791
- const u = o({
2792
- Media: e,
2793
- index: r,
2794
- thumbnailSrc: n
2795
- });
2796
- return () => {
2797
- s(u);
2798
- };
2799
- }, [e, s, r, o, n]), null;
2800
- }, sn = (e) => Xe() ? /* @__PURE__ */ t.jsx(on, { ...e }) : /* @__PURE__ */ t.jsx("slot", {}), an = ({ name: e, children: r }) => {
2801
- const { registerIconConfig: n, unregisterIconConfig: o } = ye();
2802
- return O(() => {
2803
- if (r)
2804
- return n(e, {
2805
- Icon: r
2806
- }), () => {
2807
- o(e);
2808
- };
2809
- }, [r, e, n, o]), null;
2810
- }, ln = (e) => Xe() ? /* @__PURE__ */ t.jsx(an, { ...e }) : /* @__PURE__ */ t.jsx("slot", {}), cn = '*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}#cc-webplayer-wrapper{--background: var(--cc-webplayer-background, 0 0% 100%);--foreground: var(--cc-webplayer-foreground, 240 10% 3.9%);--primary: var(--cc-webplayer-primary, 216 100% 52%);--primary-foreground: var( --cc-webplayer-primary-foreground, var(--background) );--primary-light: var(--cc-webplayer-primary-light, var(--primary));--neutral: var(--cc-webplayer-neutral, 0 0% 39%);--neutral-foreground: var( --cc-webplayer-neutral-foreground, var(--foreground) );--radius-ui: var(--cc-webplayer-radius-ui, 1rem);--radius-carrousel: var(--cc-webplayer-radius-carrousel, 0);--radius-gallery: var(--cc-webplayer-radius-gallery, 0)}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.\\!container{width:100%!important}.container{width:100%}@media (min-width: 1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.\\!pointer-events-none{pointer-events:none!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.invisible{visibility:hidden}.fixed{position:fixed}.\\!absolute{position:absolute!important}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-x-1{left:.25rem;right:.25rem}.inset-y-1{top:.25rem;bottom:.25rem}.-bottom-1{bottom:-.25rem}.-left-1{left:-.25rem}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.left-0{left:0}.left-1{left:.25rem}.left-1\\/2{left:50%}.right-1{right:.25rem}.right-2{right:.5rem}.top-0{top:0}.top-1{top:.25rem}.top-1\\/2{top:50%}.top-2{top:.5rem}.-z-10{z-index:-10}.-z-20{z-index:-20}.z-1{z-index:1}.z-hotspot{z-index:10}.z-overlay{z-index:30}.z-zoomed-image{z-index:20}.col-start-3{grid-column-start:3}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.-ml-px{margin-left:-1px}.-mt-px{margin-top:-1px}.inline-block{display:inline-block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-1{width:.25rem;height:.25rem}.size-12{width:3rem;height:3rem}.size-20{width:5rem;height:5rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-8{width:2rem;height:2rem}.size-full{width:100%;height:100%}.h-1{height:.25rem}.h-10{height:2.5rem}.h-20{height:5rem}.h-3\\/4{height:75%}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0px}.w-12{width:3rem}.w-3\\/5{width:60%}.w-8{width:2rem}.w-\\[calc\\(100\\%\\+1024px\\)\\]{width:calc(100% + 1024px)}.w-\\[calc\\(100\\%\\+2px\\)\\]{width:calc(100% + 2px)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-0{min-width:0px}.max-w-40{max-width:10rem}.max-w-\\[1600px\\]{max-width:1600px}.shrink-0{flex-shrink:0}.origin-top-left{transform-origin:top left}.-translate-x-1\\.5{--tw-translate-x: -.375rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\\.5{--tw-translate-x: .375rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-scale-x-100{--tw-scale-x: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes hotspot-ping{0%{transform:scale(0)}25%{opacity:1}75%,to{transform:scale(1.5);opacity:0}}.animate-hotspot-ping{animation:hotspot-ping 3s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:1}0%,to{opacity:0}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-rotation{animation:rotation 1s linear infinite}.cursor-auto{cursor:auto}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-\\[auto\\,1fr\\,auto\\]{grid-template-columns:auto 1fr auto}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.gap-y-4{row-gap:1rem}.space-x-0\\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.125rem * var(--tw-space-x-reverse));margin-left:calc(.125rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-scroll{overflow-x:scroll}.text-pretty{text-wrap:pretty}.rounded-carrousel{border-radius:var(--radius-carrousel)}.rounded-full{border-radius:9999px}.rounded-gallery{border-radius:var(--radius-gallery)}.rounded-ui{border-radius:var(--radius-ui)}.rounded-ui-md{border-radius:calc(var(--radius-ui) + .125rem)}.rounded-ui-sm{border-radius:calc(var(--radius-ui) - .125rem)}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-background{border-color:hsl(var(--background))}.border-foreground{border-color:hsl(var(--foreground))}.border-primary{border-color:hsl(var(--primary))}.border-b-transparent{border-bottom-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-background\\/25{background-color:hsl(var(--background) / .25)}.bg-background\\/50{background-color:hsl(var(--background) / .5)}.bg-background\\/60{background-color:hsl(var(--background) / .6)}.bg-foreground\\/25{background-color:hsl(var(--foreground) / .25)}.bg-foreground\\/30{background-color:hsl(var(--foreground) / .3)}.bg-foreground\\/35{background-color:hsl(var(--foreground) / .35)}.bg-foreground\\/40{background-color:hsl(var(--foreground) / .4)}.bg-foreground\\/50{background-color:hsl(var(--foreground) / .5)}.bg-foreground\\/60{background-color:hsl(var(--foreground) / .6)}.bg-foreground\\/65{background-color:hsl(var(--foreground) / .65)}.bg-foreground\\/75{background-color:hsl(var(--foreground) / .75)}.bg-neutral\\/50{background-color:hsl(var(--neutral) / .5)}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-foreground{background-color:hsl(var(--primary-foreground))}.bg-primary\\/50{background-color:hsl(var(--primary) / .5)}.bg-transparent{background-color:transparent}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-foreground{--tw-gradient-from: hsl(var(--foreground)) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--foreground) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.pl-6{padding-left:1.5rem}.pr-12{padding-right:3rem}.pr-4{padding-right:1rem}.pt-8{padding-top:2rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-background{color:hsl(var(--background))}.text-background\\/75{color:hsl(var(--background) / .75)}.text-foreground{color:hsl(var(--foreground))}.text-foreground\\/65{color:hsl(var(--foreground) / .65)}.text-foreground\\/70{color:hsl(var(--foreground) / .7)}.text-neutral-foreground{color:hsl(var(--neutral-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary-light{color:hsl(var(--primary-light))}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[width\\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-radius{transition-property:border-radius;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-details{transition-duration:.35s}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{display:none}.\\[mask-image\\:linear-gradient\\(to_left\\,transparent_0px\\,black_4px\\,black_calc\\(100\\%-4px\\)\\,transparent_100\\%\\)\\]{-webkit-mask-image:linear-gradient(to left,transparent 0px,black 4px,black calc(100% - 4px),transparent 100%);mask-image:linear-gradient(to left,transparent 0px,black 4px,black calc(100% - 4px),transparent 100%)}.\\*\\:pointer-events-auto>*{pointer-events:auto}.\\*\\:size-full>*{width:100%;height:100%}.\\*\\:snap-start>*{scroll-snap-align:start}.\\*\\:snap-always>*{scroll-snap-stop:always}.\\*\\:object-cover>*{-o-object-fit:cover;object-fit:cover}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:inset-0:after{content:var(--tw-content);inset:0}.after\\:rounded-gallery:after{content:var(--tw-content);border-radius:var(--radius-gallery)}.after\\:border-2:after{content:var(--tw-content);border-width:2px}.after\\:border-primary:after{content:var(--tw-content);border-color:hsl(var(--primary))}.after\\:opacity-0:after{content:var(--tw-content);opacity:0}.after\\:opacity-100:after{content:var(--tw-content);opacity:1}.after\\:transition-all:after{content:var(--tw-content);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\\:z-hotspot-hover:hover{z-index:11}.hover\\:bg-foreground\\/25:hover{background-color:hsl(var(--foreground) / .25)}.hover\\:bg-primary\\/25:hover{background-color:hsl(var(--primary) / .25)}.hover\\:bg-primary\\/30:hover{background-color:hsl(var(--primary) / .3)}.hover\\:opacity-80:hover{opacity:.8}.hover\\:after\\:opacity-70:hover:after{content:var(--tw-content);opacity:.7}.disabled\\:opacity-60:disabled{opacity:.6}.group:hover .group-hover\\:pointer-events-auto{pointer-events:auto}.group\\/volume:hover .group-hover\\/volume\\:opacity-100{opacity:1}.group\\/volume:hover .group-hover\\/volume\\:opacity-50{opacity:.5}.group:hover .group-hover\\:opacity-100{opacity:1}@media ((orientation: portrait) and (max-width: 767px)) or ((orientation: landscape) and (max-width: 1023px)){.max-small\\:hidden{display:none}}@media ((orientation: portrait) and (min-width: 768px)) or ((orientation: landscape) and (min-width: 1024px)){.small\\:inset-x-2{left:.5rem;right:.5rem}.small\\:inset-y-2{top:.5rem;bottom:.5rem}.small\\:bottom-2{bottom:.5rem}.small\\:left-2{left:.5rem}.small\\:right-2{right:.5rem}.small\\:right-4{right:1rem}.small\\:top-2{top:.5rem}.small\\:top-4{top:1rem}.small\\:my-4{margin-top:1rem;margin-bottom:1rem}.small\\:hidden{display:none}.small\\:h-12{height:3rem}.small\\:h-28{height:7rem}.small\\:max-w-48{max-width:12rem}.small\\:gap-2{gap:.5rem}.small\\:gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.small\\:gap-y-2{row-gap:.5rem}.small\\:gap-y-4{row-gap:1rem}.small\\:space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.small\\:p-3{padding:.75rem}.small\\:px-2{padding-left:.5rem;padding-right:.5rem}.small\\:py-1{padding-top:.25rem;padding-bottom:.25rem}.small\\:pl-8{padding-left:2rem}.small\\:pr-6{padding-right:1.5rem}.small\\:text-base{font-size:1rem;line-height:1.5rem}.small\\:text-sm{font-size:.875rem;line-height:1.25rem}.small\\:font-bold{font-weight:700}}@media (min-width: 1280px){.large\\:h-20{height:5rem}.large\\:h-3\\/5{height:60%}.large\\:max-w-56{max-width:14rem}.large\\:gap-4{gap:1rem}.large\\:p-2{padding:.5rem}.large\\:p-4{padding:1rem}.large\\:text-base{font-size:1rem;line-height:1.5rem}.large\\:text-lg{font-size:1.125rem;line-height:1.75rem}}';
2811
- var Ot = { exports: {} }, ve = {};
2812
- /**
2813
- * @license React
2814
- * react-jsx-runtime.production.min.js
2815
- *
2816
- * Copyright (c) Facebook, Inc. and its affiliates.
2817
- *
2818
- * This source code is licensed under the MIT license found in the
2819
- * LICENSE file in the root directory of this source tree.
2820
- */
2821
- var lt;
2822
- function dn() {
2823
- if (lt) return ve;
2824
- lt = 1;
2825
- var e = be, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
2826
- function f(d, c, v) {
2827
- var l, m = {}, w = null, C = null;
2828
- v !== void 0 && (w = "" + v), c.key !== void 0 && (w = "" + c.key), c.ref !== void 0 && (C = c.ref);
2829
- for (l in c) o.call(c, l) && !u.hasOwnProperty(l) && (m[l] = c[l]);
2830
- if (d && d.defaultProps) for (l in c = d.defaultProps, c) m[l] === void 0 && (m[l] = c[l]);
2831
- return { $$typeof: r, type: d, key: w, ref: C, props: m, _owner: s.current };
2832
- }
2833
- return ve.Fragment = n, ve.jsx = f, ve.jsxs = f, ve;
2834
- }
2835
- Ot.exports = dn();
2836
- var ke = Ot.exports, un = Object.defineProperty, mn = (e, r, n) => r in e ? un(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, Ee = (e, r, n) => (mn(e, typeof r != "symbol" ? r + "" : r, n), n);
2837
- const pn = {
1
+ import { W as P, a as W, b as S, c as w, d as I, e as L, f as M } from "./shared-Bn2By-os.js";
2
+ import { D as oe, j as se, E as re, k as ie, n as ae, m as ce, r as le, q as ue, p as pe, o as me, l as fe, g as Ee, h as be, i as he, s as de } from "./shared-Bn2By-os.js";
3
+ import "react/jsx-runtime";
4
+ import A from "react";
5
+ import { createRoot as D } from "react-dom/client";
6
+ var R = Object.defineProperty, V = (e, t, n) => t in e ? R(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, E = (e, t, n) => (V(e, typeof t != "symbol" ? t + "" : t, n), n);
7
+ const v = {
2838
8
  stringify: (e) => e,
2839
9
  parse: (e) => e
2840
- }, hn = {
10
+ }, j = {
2841
11
  stringify: (e) => `${e}`,
2842
12
  parse: (e) => parseFloat(e)
2843
- }, fn = {
13
+ }, k = {
2844
14
  stringify: (e) => e ? "true" : "false",
2845
15
  parse: (e) => /^[ty1-9]/i.test(e)
2846
- }, gn = {
16
+ }, x = {
2847
17
  stringify: (e) => e.name,
2848
- parse: (e, r, n) => {
2849
- const o = (() => {
18
+ parse: (e, t, n) => {
19
+ const s = (() => {
2850
20
  if (typeof window < "u" && e in window)
2851
21
  return window[e];
2852
22
  if (typeof global < "u" && e in global)
2853
23
  return global[e];
2854
24
  })();
2855
- return typeof o == "function" ? o.bind(n) : void 0;
25
+ return typeof s == "function" ? s.bind(n) : void 0;
2856
26
  }
2857
- }, xn = {
27
+ }, F = {
2858
28
  stringify: (e) => JSON.stringify(e),
2859
29
  parse: (e) => JSON.parse(e)
2860
- }, $e = {
2861
- string: pn,
2862
- number: hn,
2863
- boolean: fn,
2864
- function: gn,
2865
- json: xn
30
+ }, g = {
31
+ string: v,
32
+ number: j,
33
+ boolean: k,
34
+ function: x,
35
+ json: F
2866
36
  };
2867
- function wn(e) {
37
+ function G(e) {
2868
38
  return e.replace(
2869
39
  /([a-z0-9])([A-Z])/g,
2870
- (r, n, o) => `${n}-${o.toLowerCase()}`
40
+ (t, n, s) => `${n}-${s.toLowerCase()}`
2871
41
  );
2872
42
  }
2873
- const Ce = Symbol.for("r2wc.render"), Ne = Symbol.for("r2wc.connected"), ie = Symbol.for("r2wc.context"), ne = Symbol.for("r2wc.props");
2874
- function vn(e, r, n) {
2875
- var o, s, u;
2876
- r.props || (r.props = e.propTypes ? Object.keys(e.propTypes) : []);
2877
- const f = Array.isArray(r.props) ? r.props.slice() : Object.keys(r.props), d = {}, c = {}, v = {};
2878
- for (const m of f) {
2879
- d[m] = Array.isArray(r.props) ? "string" : r.props[m];
2880
- const w = wn(m);
2881
- c[m] = w, v[w] = m;
43
+ const b = Symbol.for("r2wc.render"), h = Symbol.for("r2wc.connected"), u = Symbol.for("r2wc.context"), l = Symbol.for("r2wc.props");
44
+ function Y(e, t, n) {
45
+ var s, f, C;
46
+ t.props || (t.props = e.propTypes ? Object.keys(e.propTypes) : []);
47
+ const d = Array.isArray(t.props) ? t.props.slice() : Object.keys(t.props), m = {}, y = {}, _ = {};
48
+ for (const r of d) {
49
+ m[r] = Array.isArray(t.props) ? "string" : t.props[r];
50
+ const o = G(r);
51
+ y[r] = o, _[o] = r;
2882
52
  }
2883
- class l extends HTMLElement {
53
+ class N extends HTMLElement {
2884
54
  constructor() {
2885
- super(), Ee(this, o, !0), Ee(this, s), Ee(this, u, {}), Ee(this, "container"), r.shadow ? this.container = this.attachShadow({
2886
- mode: r.shadow
2887
- }) : this.container = this, this[ne].container = this.container;
2888
- for (const w of f) {
2889
- const C = c[w], a = this.getAttribute(C), h = d[w], x = h ? $e[h] : null;
2890
- x != null && x.parse && a && (this[ne][w] = x.parse(a, C, this));
55
+ super(), E(this, s, !0), E(this, f), E(this, C, {}), E(this, "container"), t.shadow ? this.container = this.attachShadow({
56
+ mode: t.shadow
57
+ }) : this.container = this, this[l].container = this.container;
58
+ for (const o of d) {
59
+ const p = y[o], c = this.getAttribute(p), i = m[o], a = i ? g[i] : null;
60
+ a != null && a.parse && c && (this[l][o] = a.parse(c, p, this));
2891
61
  }
2892
62
  }
2893
63
  static get observedAttributes() {
2894
- return Object.keys(v);
64
+ return Object.keys(_);
2895
65
  }
2896
66
  connectedCallback() {
2897
- this[Ne] = !0, this[Ce]();
67
+ this[h] = !0, this[b]();
2898
68
  }
2899
69
  disconnectedCallback() {
2900
- this[Ne] = !1, this[ie] && n.unmount(this[ie]), delete this[ie];
70
+ this[h] = !1, this[u] && n.unmount(this[u]), delete this[u];
2901
71
  }
2902
- attributeChangedCallback(w, C, a) {
2903
- const h = v[w], x = d[h], j = x ? $e[x] : null;
2904
- h in d && j != null && j.parse && a && (this[ne][h] = j.parse(a, w, this), this[Ce]());
72
+ attributeChangedCallback(o, p, c) {
73
+ const i = _[o], a = m[i], O = a ? g[a] : null;
74
+ i in m && O != null && O.parse && c && (this[l][i] = O.parse(c, o, this), this[b]());
2905
75
  }
2906
- [(o = Ne, s = ie, u = ne, Ce)]() {
2907
- this[Ne] && (this[ie] ? n.update(this[ie], this[ne]) : this[ie] = n.mount(
76
+ [(s = h, f = u, C = l, b)]() {
77
+ this[h] && (this[u] ? n.update(this[u], this[l]) : this[u] = n.mount(
2908
78
  this.container,
2909
79
  e,
2910
- this[ne]
80
+ this[l]
2911
81
  ));
2912
82
  }
2913
83
  }
2914
- for (const m of f) {
2915
- const w = c[m], C = d[m];
2916
- Object.defineProperty(l.prototype, m, {
84
+ for (const r of d) {
85
+ const o = y[r], p = m[r];
86
+ Object.defineProperty(N.prototype, r, {
2917
87
  enumerable: !0,
2918
88
  configurable: !0,
2919
89
  get() {
2920
- return this[ne][m];
90
+ return this[l][r];
2921
91
  },
2922
- set(a) {
2923
- this[ne][m] = a;
2924
- const h = C ? $e[C] : null;
2925
- if (h != null && h.stringify) {
2926
- const x = h.stringify(a, w, this);
2927
- this.getAttribute(w) !== x && this.setAttribute(w, x);
92
+ set(c) {
93
+ this[l][r] = c;
94
+ const i = p ? g[p] : null;
95
+ if (i != null && i.stringify) {
96
+ const a = i.stringify(c, o, this);
97
+ this.getAttribute(o) !== a && this.setAttribute(o, a);
2928
98
  } else
2929
- this[Ce]();
99
+ this[b]();
2930
100
  }
2931
101
  });
2932
102
  }
2933
- return l;
103
+ return N;
2934
104
  }
2935
- function bn(e, r, n) {
2936
- const o = Yt(e), s = be.createElement(r, n);
2937
- return o.render(s), {
2938
- root: o,
2939
- ReactComponent: r
105
+ function H(e, t, n) {
106
+ const s = D(e), f = A.createElement(t, n);
107
+ return s.render(f), {
108
+ root: s,
109
+ ReactComponent: t
2940
110
  };
2941
111
  }
2942
- function yn({ root: e, ReactComponent: r }, n) {
2943
- const o = be.createElement(r, n);
2944
- e.render(o);
2945
- }
2946
- function jn({ root: e }) {
2947
- e.unmount();
112
+ function U({ root: e, ReactComponent: t }, n) {
113
+ const s = A.createElement(t, n);
114
+ e.render(s);
2948
115
  }
2949
- function Ge(e, r = {}) {
2950
- return vn(e, r, { mount: bn, update: yn, unmount: jn });
116
+ function $({ root: e }) {
117
+ setTimeout(() => {
118
+ e.unmount();
119
+ }, 0);
2951
120
  }
2952
- function kn(e) {
2953
- return e.replace(
2954
- /([a-z0-9])([A-Z])/g,
2955
- (r, n, o) => `${n}-${o.toLowerCase()}`
2956
- );
2957
- }
2958
- function Ke(e) {
2959
- return Object.entries(e).reduce((r, [n, o]) => {
2960
- if (o !== void 0) {
2961
- const s = kn(n);
2962
- r[s] = o.toString();
2963
- }
2964
- return r;
2965
- }, {});
121
+ function T(e, t = {}) {
122
+ return Y(e, t, { mount: H, update: U, unmount: $ });
2966
123
  }
2967
- const En = (e) => /* @__PURE__ */ ke.jsxs(ke.Fragment, { children: [
2968
- /* @__PURE__ */ ke.jsx("style", { children: cn }),
2969
- /* @__PURE__ */ ke.jsx(nn, { ...e })
2970
- ] }), Cn = Ge(En, {
124
+ const B = T(P, {
2971
125
  shadow: "open",
2972
126
  props: {
2973
127
  compositionUrl: "string",
@@ -2981,117 +135,44 @@ const En = (e) => /* @__PURE__ */ ke.jsxs(ke.Fragment, { children: [
2981
135
  eventPrefix: "string",
2982
136
  reverse360: "boolean"
2983
137
  }
2984
- }), Nn = (e) => Ke(e), Ln = Ge(sn, {
138
+ }), J = T(W, {
2985
139
  shadow: "closed",
2986
140
  props: {
2987
141
  index: "number",
2988
142
  thumbnailSrc: "string"
2989
143
  }
2990
- }), _n = (e) => Ke(e), Mn = Ge(ln, {
144
+ }), X = T(S, {
2991
145
  shadow: "closed",
2992
146
  props: {
2993
147
  name: "string"
2994
148
  }
2995
- }), zn = (e) => Ke(e);
2996
- function In() {
2997
- return !!customElements.get(Ie) && !!customElements.get(We) && !!customElements.get(Ye);
2998
- }
2999
- function Sn() {
3000
- customElements.define(Ie, Cn), customElements.define(
3001
- We,
3002
- Ln
3003
- ), customElements.define(Ye, Mn);
149
+ });
150
+ function q() {
151
+ customElements.define(I, B), customElements.define(
152
+ L,
153
+ J
154
+ ), customElements.define(M, X);
3004
155
  }
3005
- function qe() {
3006
- In() || Sn();
156
+ function z() {
157
+ w() || q();
3007
158
  }
3008
- qe();
3009
- const Rn = ({
3010
- onCompositionLoading: e,
3011
- onCompositionLoaded: r,
3012
- onCompositionLoadError: n,
3013
- onItemChange: o,
3014
- onExtendModeOn: s,
3015
- onExtendModeOff: u,
3016
- onHotspotsOn: f,
3017
- onHotspotsOff: d,
3018
- onGalleryOpen: c,
3019
- onGalleryClose: v,
3020
- className: l,
3021
- style: m = {},
3022
- children: w,
3023
- ...C
3024
- }) => {
3025
- const a = te(() => {
3026
- const h = Nn(C);
3027
- return l && Object.assign(h, { class: l }), h;
3028
- }, [l, C]);
3029
- return O(() => {
3030
- const h = C.eventPrefix ?? bt, x = (g) => `${h}${g}`, j = {
3031
- [dt]: e,
3032
- [ut]: r,
3033
- [mt]: n,
3034
- [pt]: o,
3035
- [ht]: s,
3036
- [ft]: u,
3037
- [gt]: f,
3038
- [xt]: d,
3039
- [wt]: c,
3040
- [vt]: v
3041
- }, k = /* @__PURE__ */ new Map();
3042
- return Object.entries(j).forEach(([g, p]) => {
3043
- if (!p)
3044
- return;
3045
- const b = x(g), E = (L) => p(L.detail);
3046
- k.set(b, E), document.addEventListener(b, E);
3047
- }), () => {
3048
- k.forEach((g, p) => {
3049
- document.removeEventListener(p, g);
3050
- });
3051
- };
3052
- }, [
3053
- C.eventPrefix,
3054
- e,
3055
- r,
3056
- n,
3057
- o,
3058
- s,
3059
- u,
3060
- f,
3061
- d,
3062
- c,
3063
- v
3064
- ]), /* @__PURE__ */ Ue.jsx("cc-webplayer", { style: { display: "block", ...m }, ...a, children: w });
3065
- };
3066
- qe();
3067
- const An = ({ children: e, ...r }) => {
3068
- const n = _n(r);
3069
- return /* @__PURE__ */ Ue.jsx("cc-webplayer-custom-media", { ...n, children: e });
3070
- };
3071
- qe();
3072
- const Pn = ({
3073
- children: e,
3074
- ...r
3075
- }) => {
3076
- const n = zn(r);
3077
- return /* @__PURE__ */ Ue.jsx("cc-webplayer-icon", { ...n, children: e });
3078
- };
159
+ z();
3079
160
  export {
3080
- bt as DEFAULT_EVENT_PREFIX,
3081
- ut as EVENT_COMPOSITION_LOADED,
3082
- dt as EVENT_COMPOSITION_LOADING,
3083
- mt as EVENT_COMPOSITION_LOAD_ERROR,
3084
- ft as EVENT_EXTEND_MODE_OFF,
3085
- ht as EVENT_EXTEND_MODE_ON,
3086
- vt as EVENT_GALLERY_CLOSE,
3087
- wt as EVENT_GALLERY_OPEN,
3088
- xt as EVENT_HOTSPOTS_OFF,
3089
- gt as EVENT_HOTSPOTS_ON,
3090
- pt as EVENT_ITEM_CHANGE,
3091
- Ye as WEB_PLAYER_ICON_WC_TAG,
3092
- Ie as WEB_PLAYER_WC_TAG,
3093
- Rn as WebPlayer,
3094
- An as WebPlayerCustomMedia,
3095
- Pn as WebPlayerIcon,
3096
- Hn as generateCompositionUrl
161
+ oe as DEFAULT_EVENT_PREFIX,
162
+ se as EVENT_COMPOSITION_LOADED,
163
+ re as EVENT_COMPOSITION_LOADING,
164
+ ie as EVENT_COMPOSITION_LOAD_ERROR,
165
+ ae as EVENT_EXTEND_MODE_OFF,
166
+ ce as EVENT_EXTEND_MODE_ON,
167
+ le as EVENT_GALLERY_CLOSE,
168
+ ue as EVENT_GALLERY_OPEN,
169
+ pe as EVENT_HOTSPOTS_OFF,
170
+ me as EVENT_HOTSPOTS_ON,
171
+ fe as EVENT_ITEM_CHANGE,
172
+ M as WEB_PLAYER_ICON_WC_TAG,
173
+ I as WEB_PLAYER_WC_TAG,
174
+ Ee as WebPlayer,
175
+ be as WebPlayerCustomMedia,
176
+ he as WebPlayerIcon,
177
+ de as generateCompositionUrl
3097
178
  };