@vincentt-xr/sdk 2.0.0-alpha.21 → 2.0.0-alpha.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/GROUNDING.md +138 -2
  2. package/components.json +61 -1
  3. package/dist/{CanonicalHeadFrame-CQe2YX9a.js → CanonicalHeadFrame-ZSfpHH_w.js} +3 -3
  4. package/dist/{DebuggerUI-CKYrYmod.js → DebuggerUI-C_c1B-2p.js} +1 -1
  5. package/dist/{FaceRetouch-l7y4oZBu.js → FaceRetouch-4tV3RYa-.js} +4 -4
  6. package/dist/{TextLabel-C-AibH5A.cjs → TextLabel-DWBSNwRA.cjs} +2 -2
  7. package/dist/{TextLabel-fEF1o3wE.js → TextLabel-XSfkeWDJ.js} +172 -172
  8. package/dist/{bodyMaskMaterial-BOdSJUEM.js → bodyMaskMaterial-BF6Gm6hz.js} +1 -1
  9. package/dist/{cache-Mu-VO_6E.js → cache-CbX-0Rgn.js} +2 -2
  10. package/dist/components/Button/index.d.ts +1 -1
  11. package/dist/components/CaptureShareScreen/index.d.ts +27 -0
  12. package/dist/components/FaceSwap/settings.d.ts +1 -1
  13. package/dist/components/HtmlRegion/index.d.ts +1 -1
  14. package/dist/components/IntroScreen/index.d.ts +31 -0
  15. package/dist/components/Light/index.d.ts +1 -1
  16. package/dist/components/Model/index.d.ts +1 -1
  17. package/dist/components/Object3D/index.d.ts +1 -1
  18. package/dist/components/PaintedFace/index.d.ts +1 -1
  19. package/dist/components/ScreenShape/index.d.ts +8 -0
  20. package/dist/components/ScreenText/liveEditable.d.ts +1 -1
  21. package/dist/components/SplashScreen/index.d.ts +38 -0
  22. package/dist/components/TextLabel/TextLabel.d.ts +3 -0
  23. package/dist/components/index.d.ts +3 -0
  24. package/dist/contexts-awO81p6d.cjs +1 -0
  25. package/dist/contexts-hhxufDg2.js +714 -0
  26. package/dist/debug-ui/media-source.js +1 -1
  27. package/dist/debug-ui.cjs +1 -1
  28. package/dist/debug-ui.js +11 -11
  29. package/dist/{drawNormalizedCrop-D606u5-F.js → drawNormalizedCrop-8RzfrVNS.js} +5 -5
  30. package/dist/editor-defs/live.d.ts +28 -0
  31. package/dist/editor-defs/live.generated.d.ts +2 -0
  32. package/dist/editor-defs/types.d.ts +1 -1
  33. package/dist/editor-scenes.cjs +1 -1
  34. package/dist/editor-scenes.js +419 -40
  35. package/dist/entries/core.d.ts +10 -0
  36. package/dist/entries/editor-scenes.d.ts +1 -6
  37. package/dist/face-effects.cjs +67 -67
  38. package/dist/face-effects.js +1276 -1275
  39. package/dist/{getFaceInfo-Mt44zlej.js → getFaceInfo-B1pPvyh9.js} +1 -1
  40. package/dist/hooks/captureStore.d.ts +25 -0
  41. package/dist/hooks/useCapture.d.ts +28 -0
  42. package/dist/hooks/useShare.d.ts +37 -0
  43. package/dist/{index-CbBCl2ZU.js → index-BTVIMj8H.js} +2 -2
  44. package/dist/{index-BDxJWWyy.js → index-BmeB_V6I.js} +48 -48
  45. package/dist/{index-D5NbXaCn.js → index-CW4yk2jC.js} +272 -263
  46. package/dist/{index-B0EYdofX.js → index-Cw6HeUjE.js} +1 -1
  47. package/dist/{index-Bn72laBn.js → index-DSrRFuRp.js} +1 -1
  48. package/dist/{index-CM3jkleV.js → index-DTkbQ5OA.js} +27 -25
  49. package/dist/{index-CicO_Tnw.js → index-Dmhh2RjM.js} +1 -1
  50. package/dist/index-hEANh5cP.cjs +21 -0
  51. package/dist/{index-fDwL47CM.cjs → index-rCxTueDx.cjs} +2 -2
  52. package/dist/instructions.cjs +1 -1
  53. package/dist/instructions.js +8 -8
  54. package/dist/{internal-BoFDq5hC.js → internal-DDcTDvPS.js} +3 -3
  55. package/dist/internal.js +2 -2
  56. package/dist/{landmarks-C3LvDhMt.js → landmarks-BB8jyfJA.js} +1 -1
  57. package/dist/live.generated-Do4jgrUN.js +116 -0
  58. package/dist/live.generated-n5ZV_2Gt.cjs +1 -0
  59. package/dist/low-level.cjs +1 -1
  60. package/dist/low-level.js +17 -17
  61. package/dist/main.cjs +1 -1
  62. package/dist/main.js +1081 -884
  63. package/dist/overlay/consumer.d.ts +36 -0
  64. package/dist/overlay/grammar.d.ts +74 -0
  65. package/dist/overlay/region.d.ts +23 -0
  66. package/dist/particles.js +5 -5
  67. package/dist/product.js +2 -2
  68. package/dist/{providers-Bxt_MfPK.js → providers-Q4H0Ii-y.js} +3 -3
  69. package/dist/{renderGroups-uYPzUa66.js → renderGroups-LVQ0Af0t.js} +1 -1
  70. package/dist/{renderPasses-C0wu5Cwg.js → renderPasses-DYc2-EBT.js} +7 -7
  71. package/dist/scene-object.cjs +1 -1
  72. package/dist/scene-object.js +2 -2
  73. package/dist/{segmentation-DccvYBBO.js → segmentation-BWHRt2hE.js} +1 -1
  74. package/dist/{selectors-J06V0eDb.js → selectors-kj5g3uv2.js} +3 -3
  75. package/dist/{session-CYiWfcvz.js → session-CMz1ao3i.js} +1 -1
  76. package/dist/tracking.js +25 -25
  77. package/dist/{trigger-CQviD4xp.js → trigger-8fpI9g9S.js} +7 -7
  78. package/dist/{useBodies-DOuwRuew.js → useBodies-CH4ZUECn.js} +2 -2
  79. package/dist/useEditOverrides-BmvpLYPU.js +85 -0
  80. package/dist/useEditOverrides-DMAMGzlF.cjs +1 -0
  81. package/dist/{useFaceInfo-XUGYTdfN.js → useFaceInfo-BV77B-r4.js} +4 -4
  82. package/dist/{useFaceResultReader-D8wXbF1L.js → useFaceResultReader-DgOPK1Z6.js} +1 -1
  83. package/dist/{useIrisTracking-B0uLWgNE.js → useIrisTracking-D6mv7coz.js} +10 -10
  84. package/dist/useLiveProps-Bz9wifGN.cjs +1 -0
  85. package/dist/useLiveProps-CMkyV6Dt.js +28 -0
  86. package/dist/{useXRCapabilities-DPUOvpdf.js → useXRCapabilities-FAY2ve86.js} +1 -1
  87. package/dist/utils/useEditOverlay.d.ts +33 -0
  88. package/dist/utils/useEditOverrides.d.ts +10 -0
  89. package/dist/utils/useLiveProps.d.ts +8 -0
  90. package/package.json +1 -1
  91. package/settings.json +1 -1
  92. package/dist/contexts-CSz9stBV.cjs +0 -1
  93. package/dist/contexts-Cl-4dUOI.js +0 -667
  94. package/dist/index-BkjRuUdW.cjs +0 -21
  95. package/dist/useEditOverrides-BBkK8cN2.js +0 -41
  96. package/dist/useEditOverrides-CgapHJzA.cjs +0 -1
package/dist/main.js CHANGED
@@ -1,96 +1,98 @@
1
- var Be = Object.defineProperty;
2
- var $e = (e, t, r) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var D = (e, t, r) => $e(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { j as _, J as Xe, u as He, as as Ke, at as je, au as Ve, av as Ze, aw as Ye, ax as Je } from "./index-BDxJWWyy.js";
5
- import { b8 as bs, az as As, b9 as Rs, M as Fs, P as xs, L as Cs, w as _s, ay as ks, ba as vs, b5 as ws, b6 as Ds, aA as Us, c as Ns, z as Ps, y as Ls, d as Is, k as Os, aR as Gs, aS as zs, aT as qs, aU as Ws, n as Bs, aV as $s, i as Xs, aB as Hs, O as Ks, aW as js, aC as Vs, aD as Zs, aX as Ys, aY as Js, b3 as Qs, p as ea, A as ta, b7 as ra, r as sa, K as aa, a3 as na, aI as oa, aZ as ia, aJ as ca, aK as la, aL as ua, aH as da, aM as ma, aN as fa, aE as pa, aO as ha, a_ as ga, b4 as ya, aP as Sa, a$ as Ta, t as Ma, aF as Ea, aG as ba, b0 as Aa, b1 as Ra, aQ as Fa, b2 as xa } from "./index-BDxJWWyy.js";
6
- import { S as Qe } from "./contexts-Cl-4dUOI.js";
7
- import { X as _a } from "./contexts-Cl-4dUOI.js";
8
- import { S as va, T as wa } from "./TextLabel-fEF1o3wE.js";
9
- import { jsxs as z, jsx as y, Fragment as ne } from "react/jsx-runtime";
10
- import { useRef as R, useMemo as W, useEffect as x, useState as k, Suspense as et, useCallback as F, forwardRef as tt, useImperativeHandle as rt, useContext as st, createContext as at, useId as nt, useSyncExternalStore as ot } from "react";
11
- import * as de from "three";
12
- import { MathUtils as it, Vector2 as ct, Vector3 as lt, DoubleSide as se, RepeatWrapping as Ee, LinearFilter as be } from "three";
13
- import { D as Ua, H as Na, G as Pa, E as La, J as Ia, K as Oa, P as Ga, S as za, C as qa, I as Wa, L as Ba, M as $a, F as Xa, B as Ha } from "./index-D5NbXaCn.js";
14
- import { useThree as ut, useFrame as Ue } from "@react-three/fiber";
15
- import { R as dt } from "./uv-DJU_XfmN.js";
16
- import { c as Ne, b as mt } from "./selectors-J06V0eDb.js";
17
- import { u as ft, a as pt, s as ht, F as gt } from "./drawNormalizedCrop-D606u5-F.js";
18
- import { d as ja, b as Va, r as Za } from "./drawNormalizedCrop-D606u5-F.js";
19
- import { S as yt, c as St, D as O, L as Tt } from "./index-CM3jkleV.js";
20
- import { d as Ja, R as Qa, a as en, e as tn, b as rn, f as sn } from "./index-CM3jkleV.js";
21
- import { g as Mt } from "./Scenes-icIQpHtV.js";
22
- import { a as nn, b as on, u as cn } from "./Scenes-icIQpHtV.js";
23
- import { useTexture as Et } from "@react-three/drei";
24
- import { a as bt } from "./context-DTxSQvp4.js";
25
- import { j as V, T as At } from "./renderPasses-C0wu5Cwg.js";
26
- import { k as un, D as dn, E as mn, M as fn, h as pn, S as hn, l as gn, g as yn, n as Sn, r as Tn } from "./renderPasses-C0wu5Cwg.js";
27
- import { D as Ae, M as Rt } from "./index-Bn72laBn.js";
28
- import { c as En, n as bn } from "./index-Bn72laBn.js";
29
- import { M as Rn } from "./index-CbBCl2ZU.js";
30
- import { u as xn } from "./useXRCapabilities-DPUOvpdf.js";
31
- import { g as Pe } from "./cache-Mu-VO_6E.js";
32
- import { D as _n, X as kn, c as vn, u as wn } from "./cache-Mu-VO_6E.js";
33
- import { a as Ft } from "./segmentation-DccvYBBO.js";
34
- import { d as Un, b as Nn, e as Pn, f as Ln, g as In, h as On, i as Gn } from "./segmentation-DccvYBBO.js";
35
- const ee = (e, t, r, s) => it.damp(e, t, Math.max(0, r), Math.max(0, s)), Or = (e, t, r, s, a = new ct()) => a.set(
36
- ee(e.x, t.x, r, s),
37
- ee(e.y, t.y, r, s)
38
- ), Gr = (e, t, r, s, a = new lt()) => a.set(
39
- ee(e.x, t.x, r, s),
40
- ee(e.y, t.y, r, s),
41
- ee(e.z, t.z, r, s)
42
- ), xt = "rgba(20,40,110,0.88)", Ct = 24, _t = 512;
43
- function zr({
44
- color: e = xt,
1
+ var it = Object.defineProperty;
2
+ var ct = (e, t, r) => t in e ? it(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var L = (e, t, r) => ct(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { j as w, J as lt, u as $e, au as ut, av as dt, aw as mt, ax as ft, ay as pt, az as ht } from "./index-BmeB_V6I.js";
5
+ import { b9 as Qs, aB as en, ba as tn, M as rn, P as sn, L as nn, w as an, aA as on, bb as cn, b6 as ln, b7 as un, aC as dn, c as mn, z as fn, y as pn, d as hn, k as gn, aS as yn, aT as Sn, aU as bn, aV as Tn, n as Mn, aW as En, i as Rn, aD as An, O as xn, aX as Cn, aE as vn, at as Fn, aY as kn, aZ as wn, b4 as _n, p as Ln, A as Un, b8 as Dn, r as Nn, K as Pn, a3 as In, aJ as On, a_ as zn, aK as Gn, aL as qn, aM as Xn, aI as Wn, aN as $n, aO as jn, aF as Bn, aP as Hn, a$ as Kn, b5 as Vn, aQ as Zn, b0 as Yn, t as Jn, aG as Qn, aH as ea, b1 as ta, b2 as ra, aR as sa, b3 as na } from "./index-BmeB_V6I.js";
6
+ import { S as gt, l as we, m as yt } from "./contexts-hhxufDg2.js";
7
+ import { n as oa, X as ia } from "./contexts-hhxufDg2.js";
8
+ import { S as la, T as ua } from "./TextLabel-XSfkeWDJ.js";
9
+ import { jsxs as D, jsx as y, Fragment as ue } from "react/jsx-runtime";
10
+ import { useRef as A, useMemo as W, useEffect as C, useState as F, Suspense as St, useCallback as R, useSyncExternalStore as Te, forwardRef as bt, useImperativeHandle as Tt, useContext as Mt, createContext as Et, useId as Rt } from "react";
11
+ import * as be from "three";
12
+ import { MathUtils as At, Vector2 as xt, Vector3 as Ct, DoubleSide as ie, RepeatWrapping as _e, LinearFilter as Le } from "three";
13
+ import { E as ma, K as fa, J as pa, H as ha, L as ga, M as ya, P as Sa, G as ba, D as Ta, B as Ma, N as Ea, C as Ra, I as Aa, F as xa } from "./index-CW4yk2jC.js";
14
+ import { useThree as vt, useFrame as je } from "@react-three/fiber";
15
+ import { R as Ft } from "./uv-DJU_XfmN.js";
16
+ import { c as Be, b as kt } from "./selectors-kj5g3uv2.js";
17
+ import { u as wt, a as _t, s as Lt, F as Ut } from "./drawNormalizedCrop-8RzfrVNS.js";
18
+ import { d as va, b as Fa, r as ka } from "./drawNormalizedCrop-8RzfrVNS.js";
19
+ import { S as Dt, c as Nt, D as G, L as Pt } from "./index-DTkbQ5OA.js";
20
+ import { d as _a, R as La, a as Ua, e as Da, b as Na, f as Pa } from "./index-DTkbQ5OA.js";
21
+ import { g as It } from "./Scenes-icIQpHtV.js";
22
+ import { a as Oa, b as za, u as Ga } from "./Scenes-icIQpHtV.js";
23
+ import { useTexture as Ot } from "@react-three/drei";
24
+ import { a as zt } from "./context-DTxSQvp4.js";
25
+ import { j as Y, T as Gt } from "./renderPasses-DYc2-EBT.js";
26
+ import { l as Xa, D as Wa, E as $a, M as ja, h as Ba, S as Ha, m as Ka, g as Va, n as Za, r as Ya } from "./renderPasses-DYc2-EBT.js";
27
+ import { D as Ue, M as qt } from "./index-DSrRFuRp.js";
28
+ import { c as Qa, n as eo } from "./index-DSrRFuRp.js";
29
+ import { u as Q } from "./useLiveProps-CMkyV6Dt.js";
30
+ import { d as Xt, i as De, e as He } from "./useEditOverrides-BmvpLYPU.js";
31
+ import { M as ro } from "./index-BTVIMj8H.js";
32
+ import { u as no } from "./useXRCapabilities-FAY2ve86.js";
33
+ import { g as Ke } from "./cache-CbX-0Rgn.js";
34
+ import { D as oo, X as io, c as co, u as lo } from "./cache-CbX-0Rgn.js";
35
+ import { a as Wt } from "./segmentation-BWHRt2hE.js";
36
+ import { d as mo, b as fo, e as po, f as ho, g as go, h as yo, i as So } from "./segmentation-BWHRt2hE.js";
37
+ const ne = (e, t, r, s) => At.damp(e, t, Math.max(0, r), Math.max(0, s)), ps = (e, t, r, s, n = new xt()) => n.set(
38
+ ne(e.x, t.x, r, s),
39
+ ne(e.y, t.y, r, s)
40
+ ), hs = (e, t, r, s, n = new Ct()) => n.set(
41
+ ne(e.x, t.x, r, s),
42
+ ne(e.y, t.y, r, s),
43
+ ne(e.z, t.z, r, s)
44
+ ), $t = "rgba(20,40,110,0.88)", jt = 24, Bt = 512;
45
+ function gs({
46
+ color: e = $t,
45
47
  borderColor: t,
46
48
  borderWidth: r = 0,
47
- borderRadius: s = Ct,
48
- resolution: a = _t,
49
- aspect: n = 1,
49
+ borderRadius: s = jt,
50
+ resolution: n = Bt,
51
+ aspect: a = 1,
50
52
  opacity: i = 1,
51
53
  name: c,
52
54
  overlay: o = !0,
53
55
  position: l,
54
56
  rotation: p,
55
- scale: m,
56
- visible: f
57
+ scale: d,
58
+ visible: u
57
59
  }) {
58
- const u = R(null), d = R(null), g = W(() => kt({
59
- width: Math.round(a * Math.max(n, 0.05)),
60
- height: Math.round(a),
60
+ const f = A(null), m = A(null), S = W(() => Ht({
61
+ width: Math.round(n * Math.max(a, 0.05)),
62
+ height: Math.round(n),
61
63
  color: e,
62
64
  borderColor: t,
63
65
  borderWidth: r,
64
66
  borderRadius: s
65
- }), [e, t, r, s, a, n]);
66
- x(() => () => {
67
- g.dispose();
68
- }, [g]);
69
- const M = R(null), h = R(i);
70
- return h.current !== i && (h.current = i, M.current = null, d.current && (d.current.opacity = i)), x(() => {
71
- const S = u.current;
72
- if (S)
73
- return S.userData.setOpacity = (b) => {
74
- M.current = b, d.current && (d.current.opacity = b);
67
+ }), [e, t, r, s, n, a]);
68
+ C(() => () => {
69
+ S.dispose();
70
+ }, [S]);
71
+ const b = A(null), h = A(i);
72
+ return h.current !== i && (h.current = i, b.current = null, m.current && (m.current.opacity = i)), C(() => {
73
+ const g = f.current;
74
+ if (g)
75
+ return g.userData.setOpacity = (M) => {
76
+ b.current = M, m.current && (m.current.opacity = M);
75
77
  }, () => {
76
- delete S.userData.setOpacity;
78
+ delete g.userData.setOpacity;
77
79
  };
78
- }, []), /* @__PURE__ */ z(
80
+ }, []), /* @__PURE__ */ D(
79
81
  "mesh",
80
82
  {
81
- ref: u,
83
+ ref: f,
82
84
  name: c,
83
85
  position: l,
84
86
  rotation: p,
85
- scale: m,
86
- visible: f,
87
+ scale: d,
88
+ visible: u,
87
89
  children: [
88
90
  /* @__PURE__ */ y("planeGeometry", { args: [1, 1] }),
89
91
  /* @__PURE__ */ y(
90
92
  "meshBasicMaterial",
91
93
  {
92
- ref: d,
93
- map: g,
94
+ ref: m,
95
+ map: S,
94
96
  transparent: !0,
95
97
  opacity: i,
96
98
  depthTest: !o,
@@ -101,26 +103,26 @@ function zr({
101
103
  }
102
104
  );
103
105
  }
104
- function kt(e) {
105
- const { width: t, height: r, color: s, borderColor: a, borderWidth: n, borderRadius: i } = e, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, r) : (() => {
106
- const m = document.createElement("canvas");
107
- return m.width = t, m.height = r, m;
106
+ function Ht(e) {
107
+ const { width: t, height: r, color: s, borderColor: n, borderWidth: a, borderRadius: i } = e, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, r) : (() => {
108
+ const d = document.createElement("canvas");
109
+ return d.width = t, d.height = r, d;
108
110
  })(), o = c.getContext("2d");
109
111
  o.clearRect(0, 0, t, r);
110
112
  const l = Math.min(i, Math.min(t, r) / 2);
111
- o.beginPath(), o.moveTo(l, 0), o.lineTo(t - l, 0), o.quadraticCurveTo(t, 0, t, l), o.lineTo(t, r - l), o.quadraticCurveTo(t, r, t - l, r), o.lineTo(l, r), o.quadraticCurveTo(0, r, 0, r - l), o.lineTo(0, l), o.quadraticCurveTo(0, 0, l, 0), o.closePath(), o.fillStyle = s, o.fill(), a && n > 0 && (o.lineWidth = n, o.strokeStyle = a, o.stroke());
112
- const p = new de.CanvasTexture(c);
113
+ o.beginPath(), o.moveTo(l, 0), o.lineTo(t - l, 0), o.quadraticCurveTo(t, 0, t, l), o.lineTo(t, r - l), o.quadraticCurveTo(t, r, t - l, r), o.lineTo(l, r), o.quadraticCurveTo(0, r, 0, r - l), o.lineTo(0, l), o.quadraticCurveTo(0, 0, l, 0), o.closePath(), o.fillStyle = s, o.fill(), n && a > 0 && (o.lineWidth = a, o.strokeStyle = n, o.stroke());
114
+ const p = new be.CanvasTexture(c);
113
115
  return p.needsUpdate = !0, p;
114
116
  }
115
- const qr = ({
117
+ const ys = ({
116
118
  segmentationMask: e,
117
119
  segmentation: t,
118
120
  invert: r = !1,
119
121
  customBackground: s,
120
- renderOrder: a = dt.BACKGROUND
122
+ renderOrder: n = Ft.BACKGROUND
121
123
  }) => {
122
- const { camera: n, size: i } = ut(), c = Ne(), o = mt(_.BACKGROUND_SEGMENTATION), l = t ? o == null ? void 0 : o.backgroundSegmentationMask : void 0, p = R(!1);
123
- x(() => {
124
+ const { camera: a, size: i } = vt(), c = Be(), o = kt(w.BACKGROUND_SEGMENTATION), l = t ? o == null ? void 0 : o.backgroundSegmentationMask : void 0, p = A(!1);
125
+ C(() => {
124
126
  if (!t) {
125
127
  p.current = !1;
126
128
  return;
@@ -129,15 +131,15 @@ const qr = ({
129
131
  `[VideoBackground] segmentation="${t}" set but no matching <Segmentation> component is mounted; rendering unmasked.`
130
132
  ), p.current = !0);
131
133
  }, [t, o]);
132
- const m = t ? l : e, f = W(() => {
133
- if (!n.isPerspectiveCamera)
134
+ const d = t ? l : e, u = W(() => {
135
+ if (!a.isPerspectiveCamera)
134
136
  return [10, 10];
135
- const u = n, M = (u.position.z || 5) - -1, h = u.fov * Math.PI / 180, S = 2 * Math.tan(h / 2) * M;
136
- return [S * (i.width / i.height), S];
137
- }, [n, i]);
138
- return c ? /* @__PURE__ */ y("group", { position: [0, 0, -1], children: r ? /* @__PURE__ */ z(ne, { children: [
139
- /* @__PURE__ */ z("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
140
- /* @__PURE__ */ y("planeGeometry", { args: f }),
137
+ const f = a, b = (f.position.z || 5) - -1, h = f.fov * Math.PI / 180, g = 2 * Math.tan(h / 2) * b;
138
+ return [g * (i.width / i.height), g];
139
+ }, [a, i]);
140
+ return c ? /* @__PURE__ */ y("group", { position: [0, 0, -1], children: r ? /* @__PURE__ */ D(ue, { children: [
141
+ /* @__PURE__ */ D("mesh", { position: [0, 0, -0.01], renderOrder: n - 1, children: [
142
+ /* @__PURE__ */ y("planeGeometry", { args: u }),
141
143
  /* @__PURE__ */ y(
142
144
  "meshBasicMaterial",
143
145
  {
@@ -145,31 +147,31 @@ const qr = ({
145
147
  depthTest: !1,
146
148
  depthWrite: !1,
147
149
  toneMapped: !1,
148
- side: se
150
+ side: ie
149
151
  }
150
152
  )
151
153
  ] }),
152
- s && m && /* @__PURE__ */ z("mesh", { position: [0, 0, 0], renderOrder: a, children: [
153
- /* @__PURE__ */ y("planeGeometry", { args: f }),
154
+ s && d && /* @__PURE__ */ D("mesh", { position: [0, 0, 0], renderOrder: n, children: [
155
+ /* @__PURE__ */ y("planeGeometry", { args: u }),
154
156
  /* @__PURE__ */ y(
155
157
  "meshBasicMaterial",
156
158
  {
157
159
  map: typeof s == "string" ? void 0 : s,
158
160
  color: typeof s == "string" ? s : void 0,
159
- alphaMap: m,
161
+ alphaMap: d,
160
162
  transparent: !1,
161
163
  alphaTest: 0.5,
162
164
  depthTest: !1,
163
165
  depthWrite: !1,
164
166
  toneMapped: !1,
165
- side: se
167
+ side: ie
166
168
  },
167
169
  "inverted-mask"
168
170
  )
169
171
  ] })
170
- ] }) : /* @__PURE__ */ z(ne, { children: [
171
- s && m && /* @__PURE__ */ z("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
172
- /* @__PURE__ */ y("planeGeometry", { args: f }),
172
+ ] }) : /* @__PURE__ */ D(ue, { children: [
173
+ s && d && /* @__PURE__ */ D("mesh", { position: [0, 0, -0.01], renderOrder: n - 1, children: [
174
+ /* @__PURE__ */ y("planeGeometry", { args: u }),
173
175
  /* @__PURE__ */ y(
174
176
  "meshBasicMaterial",
175
177
  {
@@ -178,77 +180,77 @@ const qr = ({
178
180
  depthTest: !1,
179
181
  depthWrite: !1,
180
182
  toneMapped: !1,
181
- side: se
183
+ side: ie
182
184
  }
183
185
  )
184
186
  ] }),
185
- /* @__PURE__ */ z("mesh", { position: [0, 0, 0], renderOrder: a, children: [
186
- /* @__PURE__ */ y("planeGeometry", { args: f }),
187
+ /* @__PURE__ */ D("mesh", { position: [0, 0, 0], renderOrder: n, children: [
188
+ /* @__PURE__ */ y("planeGeometry", { args: u }),
187
189
  /* @__PURE__ */ y(
188
190
  "meshBasicMaterial",
189
191
  {
190
192
  map: c,
191
- alphaMap: m,
193
+ alphaMap: d,
192
194
  transparent: !1,
193
- alphaTest: m ? 0.5 : void 0,
195
+ alphaTest: d ? 0.5 : void 0,
194
196
  depthTest: !1,
195
197
  depthWrite: !1,
196
198
  toneMapped: !1,
197
- side: se
199
+ side: ie
198
200
  },
199
- m ? "with-mask" : "no-mask"
201
+ d ? "with-mask" : "no-mask"
200
202
  )
201
203
  ] })
202
204
  ] }) }) : null;
203
- }, Le = ({
205
+ }, Ve = ({
204
206
  mask: e,
205
207
  status: t,
206
208
  error: r,
207
209
  invert: s = !1,
208
- fallback: a = "camera",
209
- onStatusChange: n,
210
+ fallback: n = "camera",
211
+ onStatusChange: a,
210
212
  fit: i = "cover",
211
- anchors: c = gt,
213
+ anchors: c = Ut,
212
214
  renderOrder: o = 100,
213
215
  visible: l = !0,
214
216
  maskFeather: p = 4,
215
- maskErode: m = 0.7,
216
- ...f
217
+ maskErode: d = 0.7,
218
+ ...u
217
219
  }) => {
218
- const u = Ne();
219
- if (x(() => {
220
- n == null || n(t, r);
221
- }, [t, r, n]), !u) return null;
222
- const d = t === "ready" && e;
223
- return !d && !ht(t, a) ? null : /* @__PURE__ */ y(
224
- yt,
220
+ const f = Be();
221
+ if (C(() => {
222
+ a == null || a(t, r);
223
+ }, [t, r, a]), !f) return null;
224
+ const m = t === "ready" && e;
225
+ return !m && !Lt(t, n) ? null : /* @__PURE__ */ y(
226
+ Dt,
225
227
  {
226
- ...f,
227
- source: { kind: "texture", texture: u },
228
+ ...u,
229
+ source: { kind: "texture", texture: f },
228
230
  fit: i,
229
231
  anchors: c,
230
232
  renderOrder: o,
231
233
  visible: l,
232
- maskTexture: d ? e : null,
234
+ maskTexture: m ? e : null,
233
235
  maskChannel: "green",
234
236
  maskInvert: s,
235
237
  maskFeather: p,
236
- maskErode: m
238
+ maskErode: d
237
239
  }
238
240
  );
239
- }, vt = ({ active: e = !0, ...t }) => {
240
- const { texture: r, status: s, error: a } = pt(e);
241
- return /* @__PURE__ */ y(Le, { ...t, mask: r, status: s, error: a });
242
- }, wt = ({ bodyId: e, subject: t, numBodies: r, active: s = !0, ...a }) => {
243
- const { texture: n, status: i, error: c } = ft({ bodyId: e, subject: t, numBodies: r, active: s });
244
- return /* @__PURE__ */ y(Le, { ...a, mask: n, status: i, error: c });
245
- }, Wr = ({ bodyId: e, subject: t, numBodies: r, ...s }) => e !== void 0 || t ? /* @__PURE__ */ y(wt, { ...s, bodyId: e, subject: t, numBodies: r }) : /* @__PURE__ */ y(vt, { ...s }), ce = 9, le = 16, Br = ({ children: e }) => {
246
- const [t, r] = k({ width: 0, height: 0 });
247
- return x(() => {
241
+ }, Kt = ({ active: e = !0, ...t }) => {
242
+ const { texture: r, status: s, error: n } = _t(e);
243
+ return /* @__PURE__ */ y(Ve, { ...t, mask: r, status: s, error: n });
244
+ }, Vt = ({ bodyId: e, subject: t, numBodies: r, active: s = !0, ...n }) => {
245
+ const { texture: a, status: i, error: c } = wt({ bodyId: e, subject: t, numBodies: r, active: s });
246
+ return /* @__PURE__ */ y(Ve, { ...n, mask: a, status: i, error: c });
247
+ }, Ss = ({ bodyId: e, subject: t, numBodies: r, ...s }) => e !== void 0 || t ? /* @__PURE__ */ y(Vt, { ...s, bodyId: e, subject: t, numBodies: r }) : /* @__PURE__ */ y(Kt, { ...s }), pe = 9, he = 16, bs = ({ children: e }) => {
248
+ const [t, r] = F({ width: 0, height: 0 });
249
+ return C(() => {
248
250
  const s = () => {
249
- const a = document.documentElement.clientWidth, n = document.documentElement.clientHeight, i = a / n, c = ce / le;
251
+ const n = document.documentElement.clientWidth, a = document.documentElement.clientHeight, i = n / a, c = pe / he;
250
252
  let o, l;
251
- i > c ? (l = n, o = l * ce / le) : (o = a, l = o * le / ce), r({ width: o, height: l });
253
+ i > c ? (l = a, o = l * pe / he) : (o = n, l = o * he / pe), r({ width: o, height: l });
252
254
  };
253
255
  return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
254
256
  }, []), /* @__PURE__ */ y(
@@ -265,166 +267,159 @@ const qr = ({
265
267
  children: /* @__PURE__ */ y("div", { style: { width: t.width, height: t.height, position: "relative" }, children: e })
266
268
  }
267
269
  );
268
- }, $r = ({ size: e = 0.25, ...t }) => /* @__PURE__ */ y("axesHelper", { args: [e], ...t }), Dt = { left: -1, right: 1, top: 1, bottom: -1 }, Ut = (e, t, r) => {
269
- const s = e % t, a = Math.floor(e / t);
270
- return { x: s / t, y: (r - 1 - a) / r };
271
- }, Nt = ({
270
+ }, Ts = ({ size: e = 0.25, ...t }) => /* @__PURE__ */ y("axesHelper", { args: [e], ...t }), Zt = { left: -1, right: 1, top: 1, bottom: -1 }, Yt = (e, t, r) => {
271
+ const s = e % t, n = Math.floor(e / t);
272
+ return { x: s / t, y: (r - 1 - n) / r };
273
+ }, Jt = ({
272
274
  sheet: e,
273
275
  contentAspect: t,
274
276
  renderOrder: r,
275
277
  name: s
276
278
  }) => {
277
- const a = Et(e.url), n = R(0), i = R(-1), c = bt(), [o, l] = t != null ? St(c, t) : [1, 1];
278
- return Ue((p, m) => {
279
- a.wrapS = Ee, a.wrapT = Ee, a.magFilter = be, a.minFilter = be, a.generateMipmaps = !1, a.repeat.set(1 / e.cols, 1 / e.rows), n.current += m;
280
- const f = Math.floor(n.current * e.fps) % e.frames;
281
- if (f === i.current) return;
282
- i.current = f;
283
- const { x: u, y: d } = Ut(f, e.cols, e.rows);
284
- a.offset.set(u, d);
285
- }), /* @__PURE__ */ z("mesh", { name: s, renderOrder: r, scale: [o, l, 1], children: [
279
+ const n = Ot(e.url), a = A(0), i = A(-1), c = zt(), [o, l] = t != null ? Nt(c, t) : [1, 1];
280
+ return je((p, d) => {
281
+ n.wrapS = _e, n.wrapT = _e, n.magFilter = Le, n.minFilter = Le, n.generateMipmaps = !1, n.repeat.set(1 / e.cols, 1 / e.rows), a.current += d;
282
+ const u = Math.floor(a.current * e.fps) % e.frames;
283
+ if (u === i.current) return;
284
+ i.current = u;
285
+ const { x: f, y: m } = Yt(u, e.cols, e.rows);
286
+ n.offset.set(f, m);
287
+ }), /* @__PURE__ */ D("mesh", { name: s, renderOrder: r, scale: [o, l, 1], children: [
286
288
  /* @__PURE__ */ y("planeGeometry", { args: [1, 1] }),
287
- /* @__PURE__ */ y("meshBasicMaterial", { map: a, transparent: !0, toneMapped: !1, depthWrite: !1 })
289
+ /* @__PURE__ */ y("meshBasicMaterial", { map: n, transparent: !0, toneMapped: !1, depthWrite: !1 })
288
290
  ] });
289
- }, Xr = ({
291
+ }, Ms = ({
290
292
  sheet: e,
291
- anchors: t = Dt,
293
+ anchors: t = Zt,
292
294
  contentAspect: r,
293
295
  renderOrder: s = 10,
294
- name: a = "spriteAnimation"
295
- }) => /* @__PURE__ */ y(et, { fallback: null, children: /* @__PURE__ */ y(Qe, { anchors: t, children: /* @__PURE__ */ y(Nt, { sheet: e, contentAspect: r, renderOrder: s, name: a }) }) }), Pt = 64, Lt = 3, It = /^[A-Za-z][A-Za-z0-9]{0,39}$/, Ot = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, Gt = /^(?:rgb|rgba|hsl|hsla)\([0-9a-z.,%\s/+-]{1,60}\)$/i, zt = /^-?[0-9]{1,4}(?:\.[0-9]{1,4})?(?:px|em|rem|%)?$/, qt = /^[A-Za-z0-9 ,'"_-]{1,120}$/;
296
- function Wt(e) {
297
- return Ot.test(e) || Gt.test(e) || zt.test(e) || qt.test(e);
296
+ name: n = "spriteAnimation"
297
+ }) => /* @__PURE__ */ y(St, { fallback: null, children: /* @__PURE__ */ y(gt, { anchors: t, children: /* @__PURE__ */ y(Jt, { sheet: e, contentAspect: r, renderOrder: s, name: n }) }) }), Qt = 64, er = 3, tr = /^[A-Za-z][A-Za-z0-9]{0,39}$/, rr = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, sr = /^(?:rgb|rgba|hsl|hsla)\([0-9a-z.,%\s/+-]{1,60}\)$/i, nr = /^-?[0-9]{1,4}(?:\.[0-9]{1,4})?(?:px|em|rem|%)?$/, ar = /^[A-Za-z0-9 ,'"_-]{1,120}$/;
298
+ function or(e) {
299
+ return rr.test(e) || sr.test(e) || nr.test(e) || ar.test(e);
298
300
  }
299
- const Re = (e) => e.map((t) => t.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`)).join("-");
300
- function Bt(e) {
301
+ const Ne = (e) => e.map((t) => t.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`)).join("-");
302
+ function ir(e) {
301
303
  const t = {};
302
304
  let r = 0;
303
- const s = (a, n) => {
304
- for (const i of Object.keys(a)) {
305
- if (r >= Pt) return;
306
- if (!It.test(i)) continue;
307
- const c = a[i], o = [...n, i];
308
- typeof c == "number" ? Number.isFinite(c) && (t[`--vincentt-${Re(o)}`] = String(c), r++) : typeof c == "string" ? Wt(c) && (t[`--vincentt-${Re(o)}`] = c, r++) : c && typeof c == "object" && !Array.isArray(c) && o.length < Lt && s(c, o);
305
+ const s = (n, a) => {
306
+ for (const i of Object.keys(n)) {
307
+ if (r >= Qt) return;
308
+ if (!tr.test(i)) continue;
309
+ const c = n[i], o = [...a, i];
310
+ typeof c == "number" ? Number.isFinite(c) && (t[`--vincentt-${Ne(o)}`] = String(c), r++) : typeof c == "string" ? or(c) && (t[`--vincentt-${Ne(o)}`] = c, r++) : c && typeof c == "object" && !Array.isArray(c) && o.length < er && s(c, o);
309
311
  }
310
312
  };
311
313
  return e && typeof e == "object" && s(e, []), t;
312
314
  }
313
- function Hr({ theme: e, className: t, children: r }) {
314
- const s = { display: "contents", ...Bt(e) };
315
+ function Es({ theme: e, className: t, children: r }) {
316
+ const s = { display: "contents", ...ir(e) };
315
317
  return /* @__PURE__ */ y("div", { className: t, style: s, children: r });
316
318
  }
317
- const ue = (e, t) => ({
319
+ const ge = (e, t) => ({
318
320
  x: (t == null ? void 0 : t.x) ?? e.x,
319
321
  y: (t == null ? void 0 : t.y) ?? e.y,
320
322
  z: (t == null ? void 0 : t.z) ?? e.z
321
323
  });
322
- function Kr({
323
- src: e,
324
- position: t,
325
- rotation: r,
326
- scale: s,
327
- visible: a = !0,
328
- material: n,
329
- // `name` and `locked` are editor metadata; neither changes rendering.
330
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
331
- name: i,
332
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
333
- locked: c
334
- }) {
335
- const [o, l, p] = [t == null ? void 0 : t.x, t == null ? void 0 : t.y, t == null ? void 0 : t.z], [m, f, u] = [r == null ? void 0 : r.x, r == null ? void 0 : r.y, r == null ? void 0 : r.z], [d, g, M] = [s == null ? void 0 : s.x, s == null ? void 0 : s.y, s == null ? void 0 : s.z], h = W(
324
+ function Rs(e) {
325
+ const {
326
+ src: t,
327
+ position: r,
328
+ rotation: s,
329
+ scale: n,
330
+ visible: a = !0,
331
+ material: i,
332
+ // `name` and `locked` are editor metadata; neither changes rendering.
333
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
334
+ name: c,
335
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
336
+ locked: o
337
+ } = Q("Model", e), [l, p, d] = [r == null ? void 0 : r.x, r == null ? void 0 : r.y, r == null ? void 0 : r.z], [u, f, m] = [s == null ? void 0 : s.x, s == null ? void 0 : s.y, s == null ? void 0 : s.z], [S, b, h] = [n == null ? void 0 : n.x, n == null ? void 0 : n.y, n == null ? void 0 : n.z], g = W(
336
338
  () => ({
337
- ...V,
338
- position: ue(V.position, { x: o, y: l, z: p }),
339
- rotation: ue(V.rotation, { x: m, y: f, z: u }),
340
- scale: ue(V.scale, { x: d, y: g, z: M }),
339
+ ...Y,
340
+ position: ge(Y.position, { x: l, y: p, z: d }),
341
+ rotation: ge(Y.rotation, { x: u, y: f, z: m }),
342
+ scale: ge(Y.scale, { x: S, y: b, z: h }),
341
343
  visible: a
342
344
  }),
343
- [o, l, p, m, f, u, d, g, M, a]
344
- ), S = W(
345
+ [l, p, d, u, f, m, S, b, h, a]
346
+ ), M = W(
345
347
  () => ({
346
- ...Ae,
347
- assetUrl: e,
348
- material: { ...Ae.material, ...n }
348
+ ...Ue,
349
+ assetUrl: t,
350
+ material: { ...Ue.material, ...i }
349
351
  }),
350
- [e, n]
352
+ [t, i]
351
353
  );
352
- return /* @__PURE__ */ y(At, { value: h, children: /* @__PURE__ */ y(Rt, { value: S }) });
354
+ return /* @__PURE__ */ y(Gt, { value: g, children: /* @__PURE__ */ y(qt, { value: M }) });
353
355
  }
354
- const $t = (e) => Array.isArray(e) ? e : [e], Xt = (e) => {
355
- const [t, r] = k(null);
356
- return x(() => {
356
+ const cr = (e) => Array.isArray(e) ? e : [e], lr = (e) => {
357
+ const [t, r] = F(null);
358
+ return C(() => {
357
359
  if (!e) return;
358
- let s = !0, a = null;
359
- return new de.TextureLoader().load(
360
+ let s = !0, n = null;
361
+ return new be.TextureLoader().load(
360
362
  e,
361
- (n) => {
362
- if (a = n, !s) {
363
- n.dispose();
363
+ (a) => {
364
+ if (n = a, !s) {
365
+ a.dispose();
364
366
  return;
365
367
  }
366
- n.colorSpace = de.SRGBColorSpace, n.flipY = !1, r({ url: e, texture: n });
368
+ a.colorSpace = be.SRGBColorSpace, a.flipY = !1, r({ url: e, texture: a });
367
369
  },
368
370
  void 0,
369
- () => console.warn(`${Xe.loggerPrefix} Object3D could not load ${e}`)
371
+ () => console.warn(`${lt.loggerPrefix} Object3D could not load ${e}`)
370
372
  ), () => {
371
- s = !1, a == null || a.dispose();
373
+ s = !1, n == null || n.dispose();
372
374
  };
373
375
  }, [e]), e && (t == null ? void 0 : t.url) === e ? t.texture : null;
374
376
  };
375
- function jr({
376
- colour: e,
377
- texture: t,
378
- size: r = 1,
379
- visible: s = !0,
380
- children: a,
381
- // `name` and `locked` are editor metadata; neither changes rendering.
382
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
383
- name: n,
384
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
385
- locked: i
386
- }) {
387
- const c = R(null), o = R(/* @__PURE__ */ new Map()), l = Xt(t), p = e !== void 0 || l !== null, m = () => {
388
- for (const [f, { original: u, own: d }] of o.current)
389
- f.material = u, d.forEach((g) => g.dispose());
390
- o.current.clear();
377
+ function As(e) {
378
+ const {
379
+ colour: t,
380
+ texture: r,
381
+ size: s = 1,
382
+ visible: n = !0,
383
+ children: a,
384
+ // `name` and `locked` are editor metadata; neither changes rendering.
385
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
386
+ name: i,
387
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
388
+ locked: c
389
+ } = Q("Object3D", e), o = A(null), l = A(/* @__PURE__ */ new Map()), p = lr(r), d = t !== void 0 || p !== null, u = () => {
390
+ for (const [f, { original: m, own: S }] of l.current)
391
+ f.material = m, S.forEach((b) => b.dispose());
392
+ l.current.clear();
391
393
  };
392
- return Ue(() => {
393
- !p || !c.current || c.current.traverse((f) => {
394
- const u = f;
395
- if (!u.isMesh || o.current.has(u)) return;
396
- const d = u.material, g = $t(d).map((M) => {
397
- var S;
398
- const h = M.clone();
399
- return e !== void 0 && ((S = h.color) == null || S.set(e)), l && (h.map = l, h.needsUpdate = !0), h;
394
+ return je(() => {
395
+ !d || !o.current || o.current.traverse((f) => {
396
+ const m = f;
397
+ if (!m.isMesh || l.current.has(m)) return;
398
+ const S = m.material, b = cr(S).map((h) => {
399
+ var M;
400
+ const g = h.clone();
401
+ return t !== void 0 && ((M = g.color) == null || M.set(t)), p && (g.map = p, g.needsUpdate = !0), g;
400
402
  });
401
- u.material = Array.isArray(d) ? g : g[0], o.current.set(u, { original: d, own: g });
403
+ m.material = Array.isArray(S) ? b : b[0], l.current.set(m, { original: S, own: b });
402
404
  });
403
- }), x(() => (m(), m), [e, l]), /* @__PURE__ */ y("group", { ref: c, visible: s, scale: r, children: a });
405
+ }), C(() => (u(), u), [t, p]), /* @__PURE__ */ y("group", { ref: o, visible: n, scale: s, children: a });
404
406
  }
405
- function Vr({
406
- className: e,
407
- children: t,
408
- // `name` and `locked` are editor metadata; neither changes rendering.
409
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
410
- name: r,
411
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
412
- locked: s
413
- }) {
414
- return /* @__PURE__ */ y("div", { className: e, children: t });
407
+ function xs(e) {
408
+ const { className: t, children: r } = e, s = Xt(e, r);
409
+ return /* @__PURE__ */ y("div", { className: t, children: s ?? r });
415
410
  }
416
- const Ht = 2048;
417
- function Kt(e) {
411
+ const ur = 2048;
412
+ function dr(e) {
418
413
  return e <= 32 || e >= 127 && e <= 160 || e === 173 || e === 92 || e === 1564 || e === 6158 || e >= 8192 && e <= 8207 || e >= 8232 && e <= 8238 || e >= 8288 && e <= 8303 || e === 12288 || e === 65279 || e >= 917504 && e <= 917631;
419
414
  }
420
- function jt(e) {
421
- if (typeof e != "string" || e.length === 0 || e.length > Ht) return;
415
+ function Ze(e) {
416
+ if (typeof e != "string" || e.length === 0 || e.length > ur) return;
422
417
  for (const s of e)
423
- if (Kt(s.codePointAt(0) ?? 0)) return;
418
+ if (dr(s.codePointAt(0) ?? 0)) return;
424
419
  const t = e.toLowerCase();
425
420
  return t.startsWith("https://") || t.startsWith("http://") || t.startsWith("mailto:") || t.startsWith("#") || t.startsWith("/") && !t.startsWith("//") ? e : void 0;
426
421
  }
427
- const Fe = {
422
+ const Pe = {
428
423
  display: "inline-block",
429
424
  padding: "0.6em 1.2em",
430
425
  border: "none",
@@ -435,89 +430,252 @@ const Fe = {
435
430
  textDecoration: "none",
436
431
  cursor: "pointer"
437
432
  };
438
- function Zr({
439
- label: e,
440
- action: t,
441
- target: r,
442
- link: s,
443
- onTap: a,
444
- color: n,
445
- visible: i = !0,
446
- className: c,
447
- children: o,
448
- // `name` and `locked` are editor metadata; neither changes rendering.
449
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
450
- name: l,
451
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
452
- locked: p
453
- }) {
454
- if (!i) return null;
455
- const m = n ? { ...Fe, background: n } : Fe, f = t === "scene" && !a && typeof r == "string" && r ? r : void 0, u = t === "scene" ? void 0 : jt(s), d = f ? () => Mt(f) : a, g = o ?? e;
456
- if (u) {
457
- const M = /^https?:/i.test(u);
433
+ function Cs(e) {
434
+ const {
435
+ label: t,
436
+ action: r,
437
+ target: s,
438
+ link: n,
439
+ onTap: a,
440
+ color: i,
441
+ visible: c = !0,
442
+ className: o,
443
+ children: l,
444
+ // `name` and `locked` are editor metadata; neither changes rendering.
445
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
446
+ name: p,
447
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
448
+ locked: d
449
+ } = Q("Button", e);
450
+ if (!c) return null;
451
+ const u = i ? { ...Pe, background: i } : Pe, f = r === "scene" && !a && typeof s == "string" && s ? s : void 0, m = r === "scene" ? void 0 : Ze(n), S = f ? () => It(f) : a, b = l ?? t;
452
+ if (m) {
453
+ const h = /^https?:/i.test(m);
458
454
  return /* @__PURE__ */ y(
459
455
  "a",
460
456
  {
461
- href: u,
462
- className: c,
463
- style: m,
464
- onClick: d,
465
- ...M ? { target: "_blank", rel: "noopener noreferrer" } : {},
466
- children: g
457
+ href: m,
458
+ className: o,
459
+ style: u,
460
+ onClick: S,
461
+ ...h ? { target: "_blank", rel: "noopener noreferrer" } : {},
462
+ children: b
467
463
  }
468
464
  );
469
465
  }
470
- return /* @__PURE__ */ y("button", { type: "button", className: c, style: m, onClick: d, children: g });
466
+ return /* @__PURE__ */ y("button", { type: "button", className: o, style: u, onClick: S, children: b });
467
+ }
468
+ let B = null;
469
+ const ce = /* @__PURE__ */ new Set(), z = {
470
+ get: () => B,
471
+ subscribe(e) {
472
+ return ce.add(e), () => {
473
+ ce.delete(e);
474
+ };
475
+ },
476
+ set(e, t) {
477
+ return B && URL.revokeObjectURL(B.url), B = { kind: e, blob: t, url: URL.createObjectURL(t) }, ce.forEach((r) => r()), B;
478
+ },
479
+ clear() {
480
+ B && (URL.revokeObjectURL(B.url), B = null, ce.forEach((e) => e()));
481
+ }
482
+ };
483
+ function de(e = navigator) {
484
+ const t = e.userActivation;
485
+ return t === void 0 ? !0 : t.isActive;
486
+ }
487
+ const mr = 280, Ye = (e) => e.includes("png") ? "png" : e.includes("jpeg") ? "jpg" : e.includes("mp4") ? "mp4" : e.includes("webm") ? "webm" : "bin";
488
+ function Je(e) {
489
+ const t = Ze(e);
490
+ return t && /^https:\/\//i.test(t) ? t : void 0;
491
+ }
492
+ function Qe(e, t = navigator) {
493
+ return typeof window < "u" && window.isSecureContext !== !1 && typeof t.share == "function" && typeof t.canShare == "function" && t.canShare({ files: [e] });
494
+ }
495
+ function et(e) {
496
+ const t = URL.createObjectURL(e), r = document.createElement("a");
497
+ r.href = t, r.download = e.name, document.body.appendChild(r), r.click(), r.remove(), URL.revokeObjectURL(t);
498
+ }
499
+ async function fr(e, t = {}) {
500
+ var c, o;
501
+ if (!de()) return "blocked";
502
+ const r = t.filename ?? `capture.${Ye(e.blob.type)}`, s = new File([e.blob], r, { type: e.blob.type }), n = navigator, a = Je(t.url), i = { files: [s] };
503
+ if (t.title && (i.title = t.title), t.text && (i.text = [...t.text].slice(0, mr).join("")), a && (i.url = a), Qe(s, n) && (((c = n.canShare) == null ? void 0 : c.call(n, i)) ?? !1))
504
+ try {
505
+ return await ((o = n.share) == null ? void 0 : o.call(n, i)), "shared";
506
+ } catch (l) {
507
+ if (l.name === "AbortError") return "dismissed";
508
+ }
509
+ return et(s), "downloaded";
510
+ }
511
+ function pr() {
512
+ const e = R(
513
+ (r, s) => fr(r, s),
514
+ []
515
+ ), t = R((r, s) => de() ? (et(
516
+ new File([r.blob], s ?? `capture.${Ye(r.blob.type)}`, {
517
+ type: r.blob.type
518
+ })
519
+ ), !0) : !1, []);
520
+ return { share: e, save: t, canShareFile: Qe };
521
+ }
522
+ const ye = 40, hr = 120, gr = 280, yr = "data:image/svg+xml;utf8," + encodeURIComponent(
523
+ '<svg xmlns="http://www.w3.org/2000/svg" width="480" height="640" viewBox="0 0 480 640"><rect width="480" height="640" fill="#4b5563"/><circle cx="240" cy="270" r="70" fill="#9ca3af"/><path d="M90 560c0-90 70-150 150-150s150 60 150 150z" fill="#9ca3af"/></svg>'
524
+ ), re = (e, t, r = "") => typeof e == "string" ? [...e].slice(0, t).join("") : r;
525
+ function vs(e) {
526
+ const t = Q("CaptureShareScreen", e), { className: r } = t, s = re(t.saveLabel, ye, "Save"), n = re(t.shareLabel, ye, "Share"), a = re(t.retakeLabel, ye, "Retake"), i = re(t.shareText, gr), c = re(t.caption, hr), o = Je(t.shareLink), l = De(t.background) ? t.background : "#111827", p = De(t.color) ? t.color : "#ffffff", d = Te(z.subscribe, z.get, z.get), { share: u, save: f } = pr(), m = He() !== void 0;
527
+ if (!d && !m) return null;
528
+ const S = {
529
+ position: "absolute",
530
+ inset: 0,
531
+ zIndex: 10,
532
+ display: "flex",
533
+ flexDirection: "column",
534
+ alignItems: "center",
535
+ justifyContent: "center",
536
+ gap: "1em",
537
+ padding: "1em",
538
+ background: l,
539
+ color: p
540
+ }, b = {
541
+ padding: "0.6em 1.2em",
542
+ border: `1px solid ${p}`,
543
+ borderRadius: "var(--vincentt-radius, 0.5em)",
544
+ background: "transparent",
545
+ color: p,
546
+ font: "inherit",
547
+ cursor: "pointer"
548
+ }, h = { maxWidth: "100%", maxHeight: "65%", objectFit: "contain" }, g = d;
549
+ return /* @__PURE__ */ D("div", { className: r, style: S, children: [
550
+ (g == null ? void 0 : g.kind) === "video" ? /* @__PURE__ */ y("video", { src: g.url, style: h, controls: !0, playsInline: !0, muted: !0 }) : /* @__PURE__ */ y("img", { src: (g == null ? void 0 : g.url) ?? yr, alt: "", style: h }),
551
+ c ? /* @__PURE__ */ y("p", { style: { margin: 0 }, children: c }) : null,
552
+ /* @__PURE__ */ D("div", { style: { display: "flex", gap: "0.75em", flexWrap: "wrap", justifyContent: "center" }, children: [
553
+ /* @__PURE__ */ y(
554
+ "button",
555
+ {
556
+ type: "button",
557
+ style: b,
558
+ onClick: () => {
559
+ g && f(g);
560
+ },
561
+ children: s
562
+ }
563
+ ),
564
+ /* @__PURE__ */ y(
565
+ "button",
566
+ {
567
+ type: "button",
568
+ style: b,
569
+ onClick: () => {
570
+ g && u(g, { text: i, url: o });
571
+ },
572
+ children: n
573
+ }
574
+ ),
575
+ /* @__PURE__ */ y("button", { type: "button", style: b, onClick: () => z.clear(), children: a })
576
+ ] })
577
+ ] });
578
+ }
579
+ const Sr = 80, br = 500, Tr = 40, Se = (e, t, r = "") => typeof e == "string" && e ? [...e].slice(0, t).join("") : r;
580
+ function Fs(e) {
581
+ const t = Q("IntroScreen", e), [r, s] = F(!1), n = He() !== void 0;
582
+ if (n ? t.pinVisible !== !0 : r) return null;
583
+ const a = we(t.background) ? t.background : "#111827", i = we(t.color) ? t.color : "#ffffff", c = yt(t.image) ? t.image : void 0, o = Se(t.title, Sr), l = Se(t.body, br), p = Se(t.buttonLabel, Tr, "Continue"), d = typeof e.onContinue == "function" ? e.onContinue : void 0, u = {
584
+ position: "absolute",
585
+ inset: 0,
586
+ display: "flex",
587
+ flexDirection: "column",
588
+ alignItems: "center",
589
+ justifyContent: "center",
590
+ gap: "0.75em",
591
+ padding: "1.5em",
592
+ boxSizing: "border-box",
593
+ textAlign: "center",
594
+ background: a,
595
+ color: i
596
+ }, f = () => {
597
+ d && (d(), n || s(!0));
598
+ };
599
+ return /* @__PURE__ */ D("div", { className: t.className, style: u, children: [
600
+ c ? /* @__PURE__ */ y(
601
+ "img",
602
+ {
603
+ src: c,
604
+ alt: "",
605
+ style: { maxWidth: "70%", maxHeight: "35%", objectFit: "contain" }
606
+ }
607
+ ) : null,
608
+ o ? /* @__PURE__ */ y("div", { style: { fontSize: "1.25em", fontWeight: 600 }, children: o }) : null,
609
+ l ? /* @__PURE__ */ y("div", { style: { opacity: 0.85, whiteSpace: "pre-line" }, children: l }) : null,
610
+ /* @__PURE__ */ y(
611
+ "button",
612
+ {
613
+ type: "button",
614
+ onClick: f,
615
+ style: {
616
+ marginTop: "0.5em",
617
+ padding: "0.6em 1.2em",
618
+ border: "none",
619
+ borderRadius: "var(--vincentt-radius, 0.5em)",
620
+ background: i,
621
+ color: a,
622
+ font: "inherit",
623
+ cursor: "pointer"
624
+ },
625
+ children: p
626
+ }
627
+ )
628
+ ] });
471
629
  }
472
- const xe = (e, t) => ({
630
+ const Ie = (e, t) => ({
473
631
  x: (t == null ? void 0 : t.x) ?? e.x,
474
632
  y: (t == null ? void 0 : t.y) ?? e.y,
475
633
  z: (t == null ? void 0 : t.z) ?? e.z
476
634
  });
477
- function Yr({
478
- type: e = O.type,
479
- color: t = O.color,
480
- intensity: r = O.intensity,
481
- enabled: s = O.enabled,
482
- castShadow: a = !1,
483
- distance: n = O.distance,
484
- decay: i = O.decay,
485
- angle: c = O.angle,
486
- penumbra: o = O.penumbra,
487
- position: l,
488
- rotation: p,
489
- showHelper: m = O.showHelper,
490
- // `name` and `locked` are editor metadata; neither changes rendering.
491
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
492
- name: f,
493
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
494
- locked: u
495
- }) {
496
- const [d, g, M] = [l == null ? void 0 : l.x, l == null ? void 0 : l.y, l == null ? void 0 : l.z], [h, S, b] = [p == null ? void 0 : p.x, p == null ? void 0 : p.y, p == null ? void 0 : p.z], I = W(
635
+ function ks(e) {
636
+ const {
637
+ type: t = G.type,
638
+ color: r = G.color,
639
+ intensity: s = G.intensity,
640
+ enabled: n = G.enabled,
641
+ castShadow: a = !1,
642
+ distance: i = G.distance,
643
+ decay: c = G.decay,
644
+ angle: o = G.angle,
645
+ penumbra: l = G.penumbra,
646
+ position: p,
647
+ rotation: d,
648
+ showHelper: u = G.showHelper,
649
+ // `name` and `locked` are editor metadata; neither changes rendering.
650
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
651
+ name: f,
652
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
653
+ locked: m
654
+ } = Q("Light", e), [S, b, h] = [p == null ? void 0 : p.x, p == null ? void 0 : p.y, p == null ? void 0 : p.z], [g, M, I] = [d == null ? void 0 : d.x, d == null ? void 0 : d.y, d == null ? void 0 : d.z], T = W(
497
655
  () => ({
498
- ...V,
499
- position: xe(V.position, { x: d, y: g, z: M }),
500
- rotation: xe(V.rotation, { x: h, y: S, z: b })
656
+ ...Y,
657
+ position: Ie(Y.position, { x: S, y: b, z: h }),
658
+ rotation: Ie(Y.rotation, { x: g, y: M, z: I })
501
659
  }),
502
- [d, g, M, h, S, b]
503
- ), T = W(
660
+ [S, b, h, g, M, I]
661
+ ), k = W(
504
662
  () => ({
505
- enabled: s,
506
- type: e,
507
- color: t,
508
- intensity: r,
663
+ enabled: n,
664
+ type: t,
665
+ color: r,
666
+ intensity: s,
509
667
  castShadow: a,
510
- distance: n,
511
- angle: c,
512
- penumbra: o,
513
- decay: i,
514
- showHelper: m
668
+ distance: i,
669
+ angle: o,
670
+ penumbra: l,
671
+ decay: c,
672
+ showHelper: u
515
673
  }),
516
- [s, e, t, r, a, n, c, o, i, m]
674
+ [n, t, r, s, a, i, o, l, c, u]
517
675
  );
518
- return /* @__PURE__ */ y(Tt, { settings: T, transform: I });
676
+ return /* @__PURE__ */ y(Pt, { settings: k, transform: T });
519
677
  }
520
- const X = (e) => {
678
+ const H = (e) => {
521
679
  switch (e) {
522
680
  case "start":
523
681
  return "starting";
@@ -535,160 +693,194 @@ const X = (e) => {
535
693
  case "clear":
536
694
  return "idle";
537
695
  }
538
- }, Vt = [
696
+ }, Mr = [
539
697
  "video/mp4",
540
698
  "video/webm;codecs=vp9",
541
699
  "video/webm;codecs=vp8",
542
700
  "video/webm"
543
701
  ];
544
- function Jr(e = {}) {
702
+ function Er(e = {}) {
545
703
  const {
546
704
  audio: t = !1,
547
705
  mimeType: r,
548
706
  bitsPerSecond: s,
549
- onData: a,
550
- onStop: n,
707
+ onData: n,
708
+ onStop: a,
551
709
  onRecordingStart: i,
552
710
  onRecordingPause: c,
553
711
  onRecordingResume: o,
554
712
  onRecordingStop: l,
555
713
  onRecordingComplete: p,
556
- onError: m,
557
- passThroughStream: f
558
- } = e, u = R(null), d = R(null), g = R([]), [M, h] = k("idle"), [S, b] = k(null), [I, T] = k(null), w = F(() => {
559
- var C;
560
- const E = [r, ...Vt].filter(Boolean);
561
- for (const A of E)
562
- if ((C = MediaRecorder.isTypeSupported) != null && C.call(MediaRecorder, A)) return A;
563
- }, [r]), N = F(
714
+ onError: d,
715
+ passThroughStream: u
716
+ } = e, f = A(null), m = A(null), S = A([]), [b, h] = F("idle"), [g, M] = F(null), [I, T] = F(null), k = R(() => {
717
+ var v;
718
+ const E = [r, ...Mr].filter(Boolean);
719
+ for (const x of E)
720
+ if ((v = MediaRecorder.isTypeSupported) != null && v.call(MediaRecorder, x)) return x;
721
+ }, [r]), N = R(
564
722
  async (E) => {
565
- const C = new MediaStream();
566
- if (E.getTracks().forEach((A) => C.addTrack(A)), t) {
567
- let A;
723
+ const v = new MediaStream();
724
+ if (E.getTracks().forEach((x) => v.addTrack(x)), t) {
725
+ let x;
568
726
  if (t instanceof MediaStream)
569
- A = t;
727
+ x = t;
570
728
  else {
571
- const v = typeof t == "object" ? { audio: t } : { audio: !0, video: !1 };
572
- A = await navigator.mediaDevices.getUserMedia(v);
729
+ const _ = typeof t == "object" ? { audio: t } : { audio: !0, video: !1 };
730
+ x = await navigator.mediaDevices.getUserMedia(_);
573
731
  }
574
- A.getAudioTracks().forEach((v) => C.addTrack(v));
732
+ x.getAudioTracks().forEach((_) => v.addTrack(_));
575
733
  }
576
- if (!C.getTracks().length)
734
+ if (!v.getTracks().length)
577
735
  throw new Error("No tracks available in combined stream.");
578
- return d.current = C, C;
736
+ return m.current = v, v;
579
737
  },
580
738
  [t]
581
- ), B = F(
582
- async (E, C) => {
583
- h(X("start")), T(null), b(null);
739
+ ), $ = R(
740
+ async (E, v) => {
741
+ h(H("start")), T(null), M(null);
584
742
  try {
585
- let A;
586
- if (f)
587
- A = f, d.current = A;
743
+ let x;
744
+ if (u)
745
+ x = u, m.current = x;
588
746
  else {
589
747
  if (!E) throw new Error("start(stream) requires a MediaStream.");
590
- A = await N(E);
748
+ x = await N(E);
591
749
  }
592
- const v = w(), Z = {};
593
- v && (Z.mimeType = v), s && (Z.bitsPerSecond = s);
594
- const j = new MediaRecorder(A, Z);
595
- j.ondataavailable = (L) => {
596
- var J;
597
- ((J = L.data) == null ? void 0 : J.size) > 0 && (g.current.push(L.data), a == null || a(L.data));
598
- }, j.onstop = () => {
599
- const L = new Blob(g.current, {
600
- type: v ?? "video/webm"
750
+ const _ = k(), J = {};
751
+ _ && (J.mimeType = _), s && (J.bitsPerSecond = s);
752
+ const Z = new MediaRecorder(x, J);
753
+ Z.ondataavailable = (O) => {
754
+ var te;
755
+ ((te = O.data) == null ? void 0 : te.size) > 0 && (S.current.push(O.data), n == null || n(O.data));
756
+ }, Z.onstop = () => {
757
+ const O = new Blob(S.current, {
758
+ type: _ ?? "video/webm"
601
759
  });
602
- b(L), n == null || n(L), p == null || p(L), g.current = [], h(X("complete"));
603
- }, u.current = j, j.start(C), h(X("started")), i == null || i();
604
- } catch (A) {
605
- const v = A instanceof Error ? A : new Error(String(A));
606
- console.error("start(stream) failed", v), T(v), h(X("fail")), m == null || m(v);
760
+ M(O), a == null || a(O), p == null || p(O), S.current = [], h(H("complete"));
761
+ }, f.current = Z, Z.start(v), h(H("started")), i == null || i();
762
+ } catch (x) {
763
+ const _ = x instanceof Error ? x : new Error(String(x));
764
+ console.error("start(stream) failed", _), T(_), h(H("fail")), d == null || d(_);
607
765
  }
608
766
  },
609
767
  [
610
768
  N,
611
- w,
769
+ k,
612
770
  s,
613
- a,
614
771
  n,
772
+ a,
615
773
  p,
616
774
  i,
617
- m,
618
- f
775
+ d,
776
+ u
619
777
  ]
620
- ), $ = F(() => {
621
- const E = u.current;
622
- !E || E.state === "inactive" || (h(X("stop")), E.stop(), l == null || l());
623
- }, [l]), te = F(() => {
624
- const E = u.current;
625
- (E == null ? void 0 : E.state) === "recording" && (E.pause(), h(X("pause")), c == null || c());
626
- }, [c]), re = F(() => {
627
- const E = u.current;
628
- (E == null ? void 0 : E.state) === "paused" && (E.resume(), h(X("resume")), o == null || o());
629
- }, [o]), Y = F(() => {
778
+ ), j = R(() => {
779
+ const E = f.current;
780
+ !E || E.state === "inactive" || (h(H("stop")), E.stop(), l == null || l());
781
+ }, [l]), ae = R(() => {
782
+ const E = f.current;
783
+ (E == null ? void 0 : E.state) === "recording" && (E.pause(), h(H("pause")), c == null || c());
784
+ }, [c]), oe = R(() => {
785
+ const E = f.current;
786
+ (E == null ? void 0 : E.state) === "paused" && (E.resume(), h(H("resume")), o == null || o());
787
+ }, [o]), ee = R(() => {
630
788
  var E;
631
789
  try {
632
- u.current && (u.current.onstop = null, u.current.state !== "inactive" && u.current.stop()), u.current = null, (E = d.current) == null || E.getTracks().forEach((C) => C.stop()), d.current = null, b(null), h(X("clear")), g.current = [], T(null);
633
- } catch (C) {
634
- console.error("clear failed", C);
790
+ f.current && (f.current.onstop = null, f.current.state !== "inactive" && f.current.stop()), f.current = null, (E = m.current) == null || E.getTracks().forEach((v) => v.stop()), m.current = null, M(null), h(H("clear")), S.current = [], T(null);
791
+ } catch (v) {
792
+ console.error("clear failed", v);
635
793
  }
636
794
  }, []);
637
- return x(() => () => Y(), []), {
638
- status: M,
639
- start: B,
640
- stop: $,
641
- pause: te,
642
- resume: re,
643
- clear: Y,
644
- isRecording: M === "recording" || M === "paused",
645
- isPaused: M === "paused",
646
- recordedBlob: S,
795
+ return C(() => () => ee(), []), {
796
+ status: b,
797
+ start: $,
798
+ stop: j,
799
+ pause: ae,
800
+ resume: oe,
801
+ clear: ee,
802
+ isRecording: b === "recording" || b === "paused",
803
+ isPaused: b === "paused",
804
+ recordedBlob: g,
647
805
  error: I,
648
- getActiveStream: () => d.current
806
+ getActiveStream: () => m.current
649
807
  };
650
808
  }
651
- const Zt = async (e, t = {}) => {
652
- var r, s, a;
809
+ const Rr = async (e, t = {}) => {
810
+ var r, s, n;
653
811
  (r = t.onCaptureStart) == null || r.call(t), await Promise.resolve();
654
812
  try {
655
- const n = e();
656
- return (s = t.onCaptureComplete) == null || s.call(t, n), n;
657
- } catch (n) {
658
- const i = n instanceof Error ? n : new Error(String(n));
659
- throw (a = t.onError) == null || a.call(t, i), i;
813
+ const a = e();
814
+ return (s = t.onCaptureComplete) == null || s.call(t, a), a;
815
+ } catch (a) {
816
+ const i = a instanceof Error ? a : new Error(String(a));
817
+ throw (n = t.onError) == null || n.call(t, i), i;
660
818
  }
661
- }, Qr = (e = {}) => {
662
- const { session: t } = He(), {
819
+ }, ws = (e = {}) => {
820
+ const { session: t } = $e(), {
663
821
  captureFrame: r = t.captureFrame,
664
822
  onCaptureStart: s,
665
- onCaptureComplete: a,
666
- onError: n
667
- } = e, [i, c] = k("idle"), [o, l] = k(null), [p, m] = k(null), f = F(async () => {
668
- c("capturing"), l(null), m(null);
823
+ onCaptureComplete: n,
824
+ onError: a
825
+ } = e, [i, c] = F("idle"), [o, l] = F(null), [p, d] = F(null), u = R(async () => {
826
+ c("capturing"), l(null), d(null);
669
827
  try {
670
- const d = await Zt(r, {
828
+ const m = await Rr(r, {
671
829
  onCaptureStart: s,
672
- onCaptureComplete: a,
673
- onError: n
830
+ onCaptureComplete: n,
831
+ onError: a
674
832
  });
675
- return l(d), c("completed"), d;
676
- } catch (d) {
677
- const g = d instanceof Error ? d : new Error(String(d));
678
- return m(g), c("error"), null;
833
+ return l(m), c("completed"), m;
834
+ } catch (m) {
835
+ const S = m instanceof Error ? m : new Error(String(m));
836
+ return d(S), c("error"), null;
679
837
  }
680
- }, [r, s, a, n]), u = F(() => {
681
- c("idle"), l(null), m(null);
838
+ }, [r, s, n, a]), f = R(() => {
839
+ c("idle"), l(null), d(null);
682
840
  }, []);
683
- return { status: i, capturePhoto: f, clear: u, dataUrl: o, error: p };
684
- }, es = (e, t) => {
685
- const r = e.split(","), s = r[0].match(/:(.*?);/), a = s ? s[1] : "application/octet-stream", n = atob(r[r.length - 1]);
686
- let i = n.length;
841
+ return { status: i, capturePhoto: u, clear: f, dataUrl: o, error: p };
842
+ }, Ar = (e, t) => {
843
+ const r = e.split(","), s = r[0].match(/:(.*?);/), n = s ? s[1] : "application/octet-stream", a = atob(r[r.length - 1]);
844
+ let i = a.length;
687
845
  const c = new Uint8Array(i);
688
846
  for (; i--; )
689
- c[i] = n.charCodeAt(i);
690
- return new File([c], t, { type: a });
691
- }, Yt = 4, Jt = 50, Qt = 5e3, ae = (e) => Math.min(1, Math.max(0, e)), Ce = (e) => new Promise((t) => {
847
+ c[i] = a.charCodeAt(i);
848
+ return new File([c], t, { type: n });
849
+ };
850
+ function _s(e = {}) {
851
+ const { session: t } = $e(), { audio: r = !1, onError: s } = e, n = e.captureFrame ?? t.captureFrame, a = e.captureStream ?? t.captureStream, i = Te(z.subscribe, z.get, z.get), c = A(null), o = Er({
852
+ audio: r,
853
+ onRecordingComplete: (u) => {
854
+ z.set("video", u);
855
+ },
856
+ onError: (u) => {
857
+ c.current = u, s == null || s(u);
858
+ }
859
+ }), l = R(async () => {
860
+ if (!de()) return null;
861
+ try {
862
+ const u = Ar(n(), "photo");
863
+ return z.set("photo", u);
864
+ } catch (u) {
865
+ const f = u instanceof Error ? u : new Error(String(u));
866
+ return c.current = f, s == null || s(f), null;
867
+ }
868
+ }, [n, s]), p = R(async () => {
869
+ !de() || o.isRecording || await o.start(a(30));
870
+ }, [o, a]), d = R(() => o.stop(), [o]);
871
+ return {
872
+ takePhoto: l,
873
+ startVideo: p,
874
+ stopVideo: d,
875
+ isRecording: o.isRecording,
876
+ /** The newest capture on the page, or null. */
877
+ latest: i,
878
+ /** Drops the capture (the viewer's retake). */
879
+ clear: z.clear,
880
+ error: o.error ?? c.current
881
+ };
882
+ }
883
+ const xr = 4, Cr = 50, vr = 5e3, le = (e) => Math.min(1, Math.max(0, e)), Oe = (e) => new Promise((t) => {
692
884
  if (e.readyState >= 4) {
693
885
  t();
694
886
  return;
@@ -697,33 +889,33 @@ const Zt = async (e, t = {}) => {
697
889
  const s = () => {
698
890
  r || (r = !0, t());
699
891
  };
700
- e.addEventListener("canplaythrough", s, { once: !0 }), e.addEventListener("error", s, { once: !0 }), setTimeout(s, Qt);
701
- }), _e = (e, t) => {
892
+ e.addEventListener("canplaythrough", s, { once: !0 }), e.addEventListener("error", s, { once: !0 }), setTimeout(s, vr);
893
+ }), ze = (e, t) => {
702
894
  const r = document.createElement("audio");
703
895
  return r.src = e, r.loop = t, r.preload = "auto", r.setAttribute("playsinline", ""), r.setAttribute("webkit-playsinline", ""), r.load(), r;
704
- }, er = (e) => {
896
+ }, Fr = (e) => {
705
897
  e.muted = !0, e.play().then(() => {
706
898
  e.pause(), e.currentTime = 0, e.muted = !1;
707
899
  }).catch(() => {
708
900
  e.muted = !1;
709
901
  });
710
902
  };
711
- class tr {
903
+ class kr {
712
904
  constructor(t = {}) {
713
- D(this, "sfxPoolSize");
714
- D(this, "coalesceMs");
715
- D(this, "muted", !0);
716
- D(this, "listeners", /* @__PURE__ */ new Set());
717
- D(this, "music", null);
718
- D(this, "musicUrl", null);
719
- D(this, "musicReady", null);
720
- D(this, "musicWanted", null);
721
- D(this, "pools", /* @__PURE__ */ new Map());
905
+ L(this, "sfxPoolSize");
906
+ L(this, "coalesceMs");
907
+ L(this, "muted", !0);
908
+ L(this, "listeners", /* @__PURE__ */ new Set());
909
+ L(this, "music", null);
910
+ L(this, "musicUrl", null);
911
+ L(this, "musicReady", null);
912
+ L(this, "musicWanted", null);
913
+ L(this, "pools", /* @__PURE__ */ new Map());
722
914
  /** Last play time per SFX URL, for the coalesce window. */
723
- D(this, "lastPlayed", /* @__PURE__ */ new Map());
915
+ L(this, "lastPlayed", /* @__PURE__ */ new Map());
724
916
  /** Readiness promises so a loading gate can await decode/buffer. */
725
- D(this, "ready", /* @__PURE__ */ new Map());
726
- this.sfxPoolSize = t.sfxPoolSize ?? Yt, this.coalesceMs = t.coalesceMs ?? Jt;
917
+ L(this, "ready", /* @__PURE__ */ new Map());
918
+ this.sfxPoolSize = t.sfxPoolSize ?? xr, this.coalesceMs = t.coalesceMs ?? Cr;
727
919
  }
728
920
  /**
729
921
  * Create + buffer the looping music element. Await in the loading gate so the
@@ -731,12 +923,12 @@ class tr {
731
923
  * a no-op that returns the in-flight promise).
732
924
  */
733
925
  prefetchMusic(t, r = 0.4) {
734
- const s = ae(r);
926
+ const s = le(r);
735
927
  if (this.musicWanted = { url: t, volume: s }, this.musicUrl === t && this.musicReady)
736
928
  return this.music && (this.music.volume = s), this.musicReady;
737
- this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = _e(t, !0), this.musicUrl = t, this.music.volume = s;
738
- const a = Ce(this.music);
739
- return this.musicReady = a, a;
929
+ this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = ze(t, !0), this.musicUrl = t, this.music.volume = s;
930
+ const n = Oe(this.music);
931
+ return this.musicReady = n, n;
740
932
  }
741
933
  /**
742
934
  * Create + buffer an SFX voice pool (round-robin so overlapping plays don't
@@ -746,15 +938,15 @@ class tr {
746
938
  registerSound(t, r = 1) {
747
939
  const s = this.ready.get(t);
748
940
  if (s) return s;
749
- const a = ae(r), n = [];
941
+ const n = le(r), a = [];
750
942
  for (let c = 0; c < this.sfxPoolSize; c += 1) {
751
- const o = _e(t, !1);
752
- o.volume = a, o.addEventListener("ended", () => {
943
+ const o = ze(t, !1);
944
+ o.volume = n, o.addEventListener("ended", () => {
753
945
  o.currentTime = 0;
754
- }), n.push(o);
946
+ }), a.push(o);
755
947
  }
756
- this.pools.set(t, { els: n, next: 0, volume: a });
757
- const i = Ce(n[0]);
948
+ this.pools.set(t, { els: a, next: 0, volume: n });
949
+ const i = Oe(a[0]);
758
950
  return this.ready.set(t, i), i;
759
951
  }
760
952
  /** Subscribe to mute-state changes (for a toggle UI). Fires immediately with
@@ -772,7 +964,7 @@ class tr {
772
964
  * then start the music. All elements are already buffered, so this is instant.
773
965
  */
774
966
  setMuted(t) {
775
- t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((r) => r.els.forEach(er)), this.applyMusic(), this.listeners.forEach((r) => r(this.muted)));
967
+ t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((r) => r.els.forEach(Fr)), this.applyMusic(), this.listeners.forEach((r) => r(this.muted)));
776
968
  }
777
969
  toggleMuted() {
778
970
  this.setMuted(!this.muted);
@@ -787,25 +979,25 @@ class tr {
787
979
  if (this.muted) return;
788
980
  const s = this.pools.get(t);
789
981
  if (!s) return;
790
- const a = performance.now();
791
- if (a - (this.lastPlayed.get(t) ?? -1 / 0) < this.coalesceMs) return;
792
- this.lastPlayed.set(t, a);
793
- const n = s.els.length;
982
+ const n = performance.now();
983
+ if (n - (this.lastPlayed.get(t) ?? -1 / 0) < this.coalesceMs) return;
984
+ this.lastPlayed.set(t, n);
985
+ const a = s.els.length;
794
986
  let i;
795
- for (let c = 0; c < n; c += 1) {
796
- const o = s.els[(s.next + c) % n];
987
+ for (let c = 0; c < a; c += 1) {
988
+ const o = s.els[(s.next + c) % a];
797
989
  if (o.paused) {
798
- i = o, s.next = (s.next + c + 1) % n;
990
+ i = o, s.next = (s.next + c + 1) % a;
799
991
  break;
800
992
  }
801
993
  }
802
- i || (i = s.els[s.next], s.next = (s.next + 1) % n), i.muted = !1, i.volume = ae(r ?? s.volume), i.currentTime !== 0 && (i.currentTime = 0), i.play().catch(() => {
994
+ i || (i = s.els[s.next], s.next = (s.next + 1) % a), i.muted = !1, i.volume = le(r ?? s.volume), i.currentTime !== 0 && (i.currentTime = 0), i.play().catch(() => {
803
995
  });
804
996
  }
805
997
  /** Request the looping background track (buffer it with prefetchMusic, which
806
998
  * a loading gate awaits). Remembered while muted; starts on unmute. */
807
999
  startMusic(t, r = 0.4) {
808
- const s = ae(r);
1000
+ const s = le(r);
809
1001
  this.musicUrl !== t && this.prefetchMusic(t, s), this.musicWanted = { url: t, volume: s }, this.applyMusic();
810
1002
  }
811
1003
  stopMusic() {
@@ -816,136 +1008,136 @@ class tr {
816
1008
  }), this.muted && !this.music.paused && this.music.pause());
817
1009
  }
818
1010
  }
819
- const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math.floor(r)) ? "replay" : "ended", sr = (e, t, r) => e && t !== r, ar = (e) => Math.min(100, Math.max(0, e)) / 100, ts = tt(function({
1011
+ const wr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math.floor(r)) ? "replay" : "ended", _r = (e, t, r) => e && t !== r, Lr = (e) => Math.min(100, Math.max(0, e)) / 100, Ls = bt(function({
820
1012
  src: t,
821
1013
  playMode: r = "once",
822
1014
  loopCount: s = 1,
823
- autoplay: a = !1,
824
- muted: n = !1,
1015
+ autoplay: n = !1,
1016
+ muted: a = !1,
825
1017
  volume: i = 100,
826
1018
  preload: c = "auto",
827
1019
  onReady: o,
828
1020
  onPlay: l,
829
1021
  onPause: p,
830
- onEnded: m,
831
- onError: f
832
- }, u) {
833
- const d = R(null);
834
- d.current === null && typeof Audio < "u" && (d.current = new Audio());
835
- const g = R(0), M = R(null), h = F(async () => {
836
- const T = d.current;
1022
+ onEnded: d,
1023
+ onError: u
1024
+ }, f) {
1025
+ const m = A(null);
1026
+ m.current === null && typeof Audio < "u" && (m.current = new Audio());
1027
+ const S = A(0), b = A(null), h = R(async () => {
1028
+ const T = m.current;
837
1029
  if (T)
838
1030
  try {
839
1031
  await T.play();
840
- } catch (w) {
841
- const N = w instanceof Error ? w : new Error(String(w));
842
- throw f == null || f(N), N;
1032
+ } catch (k) {
1033
+ const N = k instanceof Error ? k : new Error(String(k));
1034
+ throw u == null || u(N), N;
843
1035
  }
844
- }, [f]), S = F(() => {
1036
+ }, [u]), g = R(() => {
845
1037
  var T;
846
- return (T = d.current) == null ? void 0 : T.pause();
847
- }, []), b = F(() => {
848
- const T = d.current;
849
- T && (T.pause(), T.currentTime = 0, g.current = 0);
1038
+ return (T = m.current) == null ? void 0 : T.pause();
1039
+ }, []), M = R(() => {
1040
+ const T = m.current;
1041
+ T && (T.pause(), T.currentTime = 0, S.current = 0);
850
1042
  }, []);
851
- rt(
852
- u,
1043
+ Tt(
1044
+ f,
853
1045
  () => ({
854
1046
  play: h,
855
- pause: S,
856
- stop: b,
1047
+ pause: g,
1048
+ stop: M,
857
1049
  get current() {
858
- return d.current;
1050
+ return m.current;
859
1051
  }
860
1052
  }),
861
- [S, h, b]
862
- ), x(() => {
863
- g.current = 0, M.current = null;
864
- }, [t]), x(() => {
865
- const T = d.current;
866
- T && (T.preload = c, T.muted = n, T.loop = !1, T.getAttribute("src") !== t && (T.src = t));
867
- }, [t, c, n]), x(() => {
868
- const T = d.current;
1053
+ [g, h, M]
1054
+ ), C(() => {
1055
+ S.current = 0, b.current = null;
1056
+ }, [t]), C(() => {
1057
+ const T = m.current;
1058
+ T && (T.preload = c, T.muted = a, T.loop = !1, T.getAttribute("src") !== t && (T.src = t));
1059
+ }, [t, c, a]), C(() => {
1060
+ const T = m.current;
869
1061
  return () => {
870
1062
  T && (T.pause(), T.removeAttribute("src"), T.load());
871
1063
  };
872
- }, []), x(() => {
873
- d.current && (d.current.volume = ar(i));
874
- }, [i]), x(() => {
875
- sr(a, M.current, t) && (M.current = t, h().catch(() => {
1064
+ }, []), C(() => {
1065
+ m.current && (m.current.volume = Lr(i));
1066
+ }, [i]), C(() => {
1067
+ _r(n, b.current, t) && (b.current = t, h().catch(() => {
876
1068
  }));
877
- }, [a, t]);
878
- const I = F(() => {
879
- g.current += 1;
1069
+ }, [n, t]);
1070
+ const I = R(() => {
1071
+ S.current += 1;
880
1072
  const T = Math.max(1, Math.floor(s));
881
- if (rr(r, g.current, T) === "replay") {
882
- const w = d.current;
883
- w && (w.currentTime = 0, h().catch(() => {
1073
+ if (wr(r, S.current, T) === "replay") {
1074
+ const k = m.current;
1075
+ k && (k.currentTime = 0, h().catch(() => {
884
1076
  }));
885
1077
  return;
886
1078
  }
887
- g.current = 0, m == null || m();
888
- }, [s, m, h, r]);
889
- return x(() => {
890
- const T = d.current;
1079
+ S.current = 0, d == null || d();
1080
+ }, [s, d, h, r]);
1081
+ return C(() => {
1082
+ const T = m.current;
891
1083
  if (!T) return;
892
1084
  const N = [
893
1085
  ["canplaythrough", () => o == null ? void 0 : o()],
894
1086
  ["play", () => l == null ? void 0 : l()],
895
1087
  ["pause", () => p == null ? void 0 : p()],
896
1088
  ["ended", I],
897
- ["error", () => f == null ? void 0 : f(new Error(`Unable to load audio: ${t}`))]
1089
+ ["error", () => u == null ? void 0 : u(new Error(`Unable to load audio: ${t}`))]
898
1090
  ];
899
- for (const [B, $] of N) T.addEventListener(B, $);
1091
+ for (const [$, j] of N) T.addEventListener($, j);
900
1092
  return () => {
901
- for (const [B, $] of N) T.removeEventListener(B, $);
1093
+ for (const [$, j] of N) T.removeEventListener($, j);
902
1094
  };
903
- }, [t, o, l, p, f, I]), null;
904
- }), P = new tr(), rs = (e, t) => P.prefetchMusic(e, t), ss = (e, t) => P.registerSound(e, t), as = (e, t) => P.startMusic(e, t), ns = () => P.stopMusic(), os = (e, t) => P.playOneShot(e, t), is = (e) => P.setMuted(e), cs = () => P.toggleMuted(), ls = () => P.isMuted(), us = (e) => P.onMuteChange(e), ds = () => {
905
- const [e, t] = k(P.isMuted());
906
- return x(() => P.onMuteChange(t), []), e;
907
- }, nr = (e = {}) => {
908
- const { auto: t = !1 } = e, r = R(e.env ?? Ke()), s = R(e.constraints);
1095
+ }, [t, o, l, p, u, I]), null;
1096
+ }), P = new kr(), Us = (e, t) => P.prefetchMusic(e, t), Ds = (e, t) => P.registerSound(e, t), Ns = (e, t) => P.startMusic(e, t), Ps = () => P.stopMusic(), Is = (e, t) => P.playOneShot(e, t), Os = (e) => P.setMuted(e), zs = () => P.toggleMuted(), Gs = () => P.isMuted(), qs = (e) => P.onMuteChange(e), Xs = () => {
1097
+ const [e, t] = F(P.isMuted());
1098
+ return C(() => P.onMuteChange(t), []), e;
1099
+ }, Ur = (e = {}) => {
1100
+ const { auto: t = !1 } = e, r = A(e.env ?? ut()), s = A(e.constraints);
909
1101
  s.current = e.constraints;
910
- const [a, n] = k("unknown"), [i, c] = k(null), o = R(0), l = F(async () => {
911
- const m = ++o.current, f = await je(r.current);
912
- if (m !== o.current) return a;
913
- const u = f.state === "unknown" ? "unknown" : f.state;
914
- return n((d) => d === "requesting" ? d : u), u !== "blocked" && c(null), u;
915
- }, []), p = F(
916
- async (m) => {
917
- const f = ++o.current;
918
- n("requesting"), c(null);
919
- const u = await Ve(
920
- { constraints: (m == null ? void 0 : m.constraints) ?? s.current, keepStream: !1 },
1102
+ const [n, a] = F("unknown"), [i, c] = F(null), o = A(0), l = R(async () => {
1103
+ const d = ++o.current, u = await dt(r.current);
1104
+ if (d !== o.current) return n;
1105
+ const f = u.state === "unknown" ? "unknown" : u.state;
1106
+ return a((m) => m === "requesting" ? m : f), f !== "blocked" && c(null), f;
1107
+ }, []), p = R(
1108
+ async (d) => {
1109
+ const u = ++o.current;
1110
+ a("requesting"), c(null);
1111
+ const f = await mt(
1112
+ { constraints: (d == null ? void 0 : d.constraints) ?? s.current, keepStream: !1 },
921
1113
  r.current
922
1114
  );
923
- return f !== o.current || (n(u.state), c(u.reason)), u.state;
1115
+ return u !== o.current || (a(f.state), c(f.reason)), f.state;
924
1116
  },
925
1117
  []
926
1118
  );
927
- return x(() => {
928
- let m = () => {
929
- }, f = !0;
930
- return t ? p() : l(), Ze((u) => {
931
- f && (n((d) => d === "requesting" ? d : u.state === "unknown" ? "unknown" : u.state), u.state !== "blocked" && c(null));
932
- }, r.current).then((u) => {
933
- f ? m = u : u();
1119
+ return C(() => {
1120
+ let d = () => {
1121
+ }, u = !0;
1122
+ return t ? p() : l(), ft((f) => {
1123
+ u && (a((m) => m === "requesting" ? m : f.state === "unknown" ? "unknown" : f.state), f.state !== "blocked" && c(null));
1124
+ }, r.current).then((f) => {
1125
+ u ? d = f : f();
934
1126
  }), () => {
935
- f = !1, o.current += 1, m();
1127
+ u = !1, o.current += 1, d();
936
1128
  };
937
1129
  }, [t, l, p]), W(
938
1130
  () => ({
939
- state: a,
1131
+ state: n,
940
1132
  reason: i,
941
- canPrompt: Ye(a),
942
- usable: a === "granted",
1133
+ canPrompt: pt(n),
1134
+ usable: n === "granted",
943
1135
  request: p,
944
1136
  refresh: l
945
1137
  }),
946
- [a, i, p, l]
1138
+ [n, i, p, l]
947
1139
  );
948
- }, or = {
1140
+ }, Dr = {
949
1141
  display: "flex",
950
1142
  flexDirection: "column",
951
1143
  alignItems: "center",
@@ -958,7 +1150,7 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
958
1150
  background: "#111827",
959
1151
  color: "#f9fafb",
960
1152
  fontFamily: "system-ui, sans-serif"
961
- }, ir = {
1153
+ }, Nr = {
962
1154
  font: "inherit",
963
1155
  padding: "10px 18px",
964
1156
  borderRadius: 8,
@@ -966,19 +1158,19 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
966
1158
  background: "#2563eb",
967
1159
  color: "#fff",
968
1160
  cursor: "pointer"
969
- }, ms = ({
1161
+ }, Ws = ({
970
1162
  children: e,
971
1163
  fallback: t,
972
1164
  auto: r = !1,
973
1165
  constraints: s,
974
- requestLabel: a = "Allow camera"
1166
+ requestLabel: n = "Allow camera"
975
1167
  }) => {
976
- const n = nr({ auto: r, constraints: s });
977
- if (n.usable) return /* @__PURE__ */ y(ne, { children: e });
978
- if (t) return /* @__PURE__ */ y(ne, { children: t(n) });
979
- const { state: i, reason: c, canPrompt: o, request: l } = n;
980
- return /* @__PURE__ */ z("div", { style: or, role: "region", "aria-label": "Camera access", children: [
981
- /* @__PURE__ */ y("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ?? Je[i] }),
1168
+ const a = Ur({ auto: r, constraints: s });
1169
+ if (a.usable) return /* @__PURE__ */ y(ue, { children: e });
1170
+ if (t) return /* @__PURE__ */ y(ue, { children: t(a) });
1171
+ const { state: i, reason: c, canPrompt: o, request: l } = a;
1172
+ return /* @__PURE__ */ D("div", { style: Dr, role: "region", "aria-label": "Camera access", children: [
1173
+ /* @__PURE__ */ y("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ?? ht[i] }),
982
1174
  /* @__PURE__ */ y(
983
1175
  "button",
984
1176
  {
@@ -986,66 +1178,66 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
986
1178
  onClick: () => void l(),
987
1179
  disabled: !o || i === "requesting",
988
1180
  "aria-disabled": !o || i === "requesting",
989
- style: { ...ir, opacity: o && i !== "requesting" ? 1 : 0.5 },
990
- children: i === "requesting" ? "Waiting…" : i === "denied" ? "Try again" : a
1181
+ style: { ...Nr, opacity: o && i !== "requesting" ? 1 : 0.5 },
1182
+ children: i === "requesting" ? "Waiting…" : i === "denied" ? "Try again" : n
991
1183
  }
992
1184
  )
993
1185
  ] });
994
- }, cr = () => {
1186
+ }, Pr = () => {
995
1187
  var e;
996
1188
  return {
997
1189
  enumerateDevices: typeof navigator < "u" && ((e = navigator.mediaDevices) != null && e.enumerateDevices) ? () => navigator.mediaDevices.enumerateDevices() : void 0
998
1190
  };
999
- }, lr = /\b(back|rear|environment|world)\b/i, ur = /\b(front|user|facetime|selfie)\b/i, dr = (e) => lr.test(e) ? "environment" : ur.test(e) ? "user" : null, fs = async (e = cr()) => {
1191
+ }, Ir = /\b(back|rear|environment|world)\b/i, Or = /\b(front|user|facetime|selfie)\b/i, zr = (e) => Ir.test(e) ? "environment" : Or.test(e) ? "user" : null, $s = async (e = Pr()) => {
1000
1192
  if (!e.enumerateDevices) return [];
1001
1193
  try {
1002
1194
  return (await e.enumerateDevices()).filter((r) => r.kind === "videoinput").map((r) => ({
1003
1195
  deviceId: r.deviceId,
1004
1196
  label: r.label,
1005
- facing: dr(r.label)
1197
+ facing: zr(r.label)
1006
1198
  }));
1007
1199
  } catch {
1008
1200
  return [];
1009
1201
  }
1010
- }, ps = (e, t) => e.find((r) => r.facing === t) ?? null, Ie = at(null), hs = ({
1202
+ }, js = (e, t) => e.find((r) => r.facing === t) ?? null, tt = Et(null), Bs = ({
1011
1203
  cache: e,
1012
1204
  disposeUnreferencedOnUnmount: t = !0,
1013
1205
  children: r
1014
1206
  }) => {
1015
- const s = e ?? Pe();
1016
- return x(() => () => {
1207
+ const s = e ?? Ke();
1208
+ return C(() => () => {
1017
1209
  t && s.disposeUnreferenced();
1018
- }, [s, t]), /* @__PURE__ */ y(Ie.Provider, { value: s, children: r });
1019
- }, Oe = () => st(Ie) ?? Pe(), gs = (e, t = {}) => {
1020
- const { enabled: r = !0 } = t, s = Oe(), a = nt(), n = (e == null ? void 0 : e.key) ?? null, [i, c] = k({
1210
+ }, [s, t]), /* @__PURE__ */ y(tt.Provider, { value: s, children: r });
1211
+ }, rt = () => Mt(tt) ?? Ke(), Hs = (e, t = {}) => {
1212
+ const { enabled: r = !0 } = t, s = rt(), n = Rt(), a = (e == null ? void 0 : e.key) ?? null, [i, c] = F({
1021
1213
  value: null,
1022
1214
  status: "idle",
1023
1215
  error: null
1024
1216
  });
1025
- return x(() => {
1217
+ return C(() => {
1026
1218
  if (!e || !r) {
1027
1219
  c({ value: null, status: "idle", error: null });
1028
1220
  return;
1029
1221
  }
1030
1222
  let o = !0;
1031
1223
  const l = s.get(e.key);
1032
- return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }), s.acquire(e, a).then((p) => {
1224
+ return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }), s.acquire(e, n).then((p) => {
1033
1225
  o && c({ value: p, status: "ready", error: null });
1034
1226
  }).catch((p) => {
1035
1227
  o && c({ value: null, status: "error", error: p });
1036
1228
  }), () => {
1037
- o = !1, s.release(e.key, a);
1229
+ o = !1, s.release(e.key, n);
1038
1230
  };
1039
- }, [s, n, r, a]), i;
1040
- }, ys = (e) => {
1041
- const t = Oe(), r = e ?? t;
1042
- return ot(
1231
+ }, [s, a, r, n]), i;
1232
+ }, Ks = (e) => {
1233
+ const t = rt(), r = e ?? t;
1234
+ return Te(
1043
1235
  (s) => r.subscribe(s),
1044
1236
  () => r.getStats(),
1045
1237
  () => r.getStats()
1046
1238
  );
1047
- }, oe = 1, Ge = Object.freeze({
1048
- version: oe,
1239
+ }, me = 1, st = Object.freeze({
1240
+ version: me,
1049
1241
  trackers: {
1050
1242
  face: { enabled: !0, numFaces: 1, targetFps: null, holdMs: 250, predictMs: 0, smoothing: 0 },
1051
1243
  hand: { enabled: !1, targetFps: null },
@@ -1072,13 +1264,13 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1072
1264
  fallbacks: { onUnsupported: "degrade", delegate: "auto" },
1073
1265
  assets: { holisticModelUrl: null, semanticSegmentationModelUrl: null },
1074
1266
  updatedAt: 0
1075
- }), U = (e, t, r, s, a, n) => {
1267
+ }), U = (e, t, r, s, n, a) => {
1076
1268
  if (e === void 0) return t;
1077
1269
  if (typeof e != "number" || !Number.isFinite(e))
1078
- return n(`${a}: not a number, kept ${t}`), t;
1270
+ return a(`${n}: not a number, kept ${t}`), t;
1079
1271
  const i = Math.min(s, Math.max(r, e));
1080
- return i !== e && n(`${a}: ${e} clamped to ${i}`), i;
1081
- }, Q = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "number" || !Number.isFinite(e) || e <= 0 ? (s(`${r}: invalid fps, kept ${t}`), t) : (e > 120 && s(`${r}: ${e} clamped to 120`), Math.min(120, e)), mr = [
1272
+ return i !== e && a(`${n}: ${e} clamped to ${i}`), i;
1273
+ }, se = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "number" || !Number.isFinite(e) || e <= 0 ? (s(`${r}: invalid fps, kept ${t}`), t) : (e > 120 && s(`${r}: ${e} clamped to 120`), Math.min(120, e)), Gr = [
1082
1274
  "tiers",
1083
1275
  "budget",
1084
1276
  "initialTier",
@@ -1086,34 +1278,34 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1086
1278
  "maxTier",
1087
1279
  "adaptive",
1088
1280
  "historySize"
1089
- ], ke = (e) => {
1281
+ ], Ge = (e) => {
1090
1282
  const t = {};
1091
- for (const r of mr) e[r] !== void 0 && (t[r] = e[r]);
1283
+ for (const r of Gr) e[r] !== void 0 && (t[r] = e[r]);
1092
1284
  return t;
1093
- }, G = (e, t, r, s) => e === void 0 ? t : typeof e != "boolean" ? (s(`${r}: not a boolean, kept ${t}`), t) : e, H = (e, t, r, s, a) => e === void 0 ? r : t.includes(e) ? e : (a(`${s}: "${String(e)}" is not one of ${t.join(" | ")}, kept ${r}`), r), ve = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "string" || !/^https?:\/\//.test(e) ? (s(`${r}: not an http(s) URL, kept ${t === null ? "the SDK default" : t}`), t) : e, K = (e = {}, t = Ge, r = []) => {
1094
- var c, o, l, p, m, f, u, d, g, M, h, S, b, I, T, w, N, B, $, te, re, Y, E, C, A, v, Z, j, L, J, fe, pe, he, ge, ye, Se, Te, Me;
1095
- const s = (We) => r.push(We), a = e.trackers ?? {}, n = t.trackers, i = e.quality === void 0 ? t.quality === !1 ? !1 : ke(t.quality) : e.quality === !1 ? !1 : typeof e.quality == "object" && e.quality !== null ? ke(e.quality) : (s("quality: must be an object or false, kept base"), t.quality);
1285
+ }, q = (e, t, r, s) => e === void 0 ? t : typeof e != "boolean" ? (s(`${r}: not a boolean, kept ${t}`), t) : e, K = (e, t, r, s, n) => e === void 0 ? r : t.includes(e) ? e : (n(`${s}: "${String(e)}" is not one of ${t.join(" | ")}, kept ${r}`), r), qe = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "string" || !/^https?:\/\//.test(e) ? (s(`${r}: not an http(s) URL, kept ${t === null ? "the SDK default" : t}`), t) : e, V = (e = {}, t = st, r = []) => {
1286
+ var c, o, l, p, d, u, f, m, S, b, h, g, M, I, T, k, N, $, j, ae, oe, ee, E, v, x, _, J, Z, O, te, Ee, Re, Ae, xe, Ce, ve, Fe, ke;
1287
+ const s = (ot) => r.push(ot), n = e.trackers ?? {}, a = t.trackers, i = e.quality === void 0 ? t.quality === !1 ? !1 : Ge(t.quality) : e.quality === !1 ? !1 : typeof e.quality == "object" && e.quality !== null ? Ge(e.quality) : (s("quality: must be an object or false, kept base"), t.quality);
1096
1288
  return {
1097
- version: oe,
1289
+ version: me,
1098
1290
  trackers: {
1099
1291
  face: {
1100
- enabled: G((c = a.face) == null ? void 0 : c.enabled, n.face.enabled, "trackers.face.enabled", s),
1292
+ enabled: q((c = n.face) == null ? void 0 : c.enabled, a.face.enabled, "trackers.face.enabled", s),
1101
1293
  numFaces: Math.round(
1102
- U((o = a.face) == null ? void 0 : o.numFaces, n.face.numFaces, 1, 10, "trackers.face.numFaces", s)
1294
+ U((o = n.face) == null ? void 0 : o.numFaces, a.face.numFaces, 1, 10, "trackers.face.numFaces", s)
1103
1295
  ),
1104
- targetFps: Q((l = a.face) == null ? void 0 : l.targetFps, n.face.targetFps, "trackers.face.targetFps", s),
1105
- holdMs: U((p = a.face) == null ? void 0 : p.holdMs, n.face.holdMs, 0, 5e3, "trackers.face.holdMs", s),
1296
+ targetFps: se((l = n.face) == null ? void 0 : l.targetFps, a.face.targetFps, "trackers.face.targetFps", s),
1297
+ holdMs: U((p = n.face) == null ? void 0 : p.holdMs, a.face.holdMs, 0, 5e3, "trackers.face.holdMs", s),
1106
1298
  predictMs: U(
1107
- (m = a.face) == null ? void 0 : m.predictMs,
1108
- n.face.predictMs,
1299
+ (d = n.face) == null ? void 0 : d.predictMs,
1300
+ a.face.predictMs,
1109
1301
  0,
1110
1302
  1e3,
1111
1303
  "trackers.face.predictMs",
1112
1304
  s
1113
1305
  ),
1114
1306
  smoothing: U(
1115
- (f = a.face) == null ? void 0 : f.smoothing,
1116
- n.face.smoothing,
1307
+ (u = n.face) == null ? void 0 : u.smoothing,
1308
+ a.face.smoothing,
1117
1309
  0,
1118
1310
  100,
1119
1311
  "trackers.face.smoothing",
@@ -1121,48 +1313,48 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1121
1313
  )
1122
1314
  },
1123
1315
  hand: {
1124
- enabled: G((u = a.hand) == null ? void 0 : u.enabled, n.hand.enabled, "trackers.hand.enabled", s),
1125
- targetFps: Q((d = a.hand) == null ? void 0 : d.targetFps, n.hand.targetFps, "trackers.hand.targetFps", s)
1316
+ enabled: q((f = n.hand) == null ? void 0 : f.enabled, a.hand.enabled, "trackers.hand.enabled", s),
1317
+ targetFps: se((m = n.hand) == null ? void 0 : m.targetFps, a.hand.targetFps, "trackers.hand.targetFps", s)
1126
1318
  },
1127
1319
  gesture: {
1128
- enabled: G((g = a.gesture) == null ? void 0 : g.enabled, n.gesture.enabled, "trackers.gesture.enabled", s),
1129
- targetFps: Q(
1130
- (M = a.gesture) == null ? void 0 : M.targetFps,
1131
- n.gesture.targetFps,
1320
+ enabled: q((S = n.gesture) == null ? void 0 : S.enabled, a.gesture.enabled, "trackers.gesture.enabled", s),
1321
+ targetFps: se(
1322
+ (b = n.gesture) == null ? void 0 : b.targetFps,
1323
+ a.gesture.targetFps,
1132
1324
  "trackers.gesture.targetFps",
1133
1325
  s
1134
1326
  )
1135
1327
  },
1136
1328
  body: {
1137
- enabled: G((h = a.body) == null ? void 0 : h.enabled, n.body.enabled, "trackers.body.enabled", s),
1138
- targetFps: Q((S = a.body) == null ? void 0 : S.targetFps, n.body.targetFps, "trackers.body.targetFps", s)
1329
+ enabled: q((h = n.body) == null ? void 0 : h.enabled, a.body.enabled, "trackers.body.enabled", s),
1330
+ targetFps: se((g = n.body) == null ? void 0 : g.targetFps, a.body.targetFps, "trackers.body.targetFps", s)
1139
1331
  },
1140
1332
  holistic: {
1141
- enabled: G((b = a.holistic) == null ? void 0 : b.enabled, n.holistic.enabled, "trackers.holistic.enabled", s),
1142
- targetFps: Q(
1143
- (I = a.holistic) == null ? void 0 : I.targetFps,
1144
- n.holistic.targetFps,
1333
+ enabled: q((M = n.holistic) == null ? void 0 : M.enabled, a.holistic.enabled, "trackers.holistic.enabled", s),
1334
+ targetFps: se(
1335
+ (I = n.holistic) == null ? void 0 : I.targetFps,
1336
+ a.holistic.targetFps,
1145
1337
  "trackers.holistic.targetFps",
1146
1338
  s
1147
1339
  ),
1148
- hands: H(
1149
- (T = a.holistic) == null ? void 0 : T.hands,
1340
+ hands: K(
1341
+ (T = n.holistic) == null ? void 0 : T.hands,
1150
1342
  ["both", "left", "right", "none"],
1151
- n.holistic.hands,
1343
+ a.holistic.hands,
1152
1344
  "trackers.holistic.hands",
1153
1345
  s
1154
1346
  ),
1155
1347
  holdMs: U(
1156
- (w = a.holistic) == null ? void 0 : w.holdMs,
1157
- n.holistic.holdMs,
1348
+ (k = n.holistic) == null ? void 0 : k.holdMs,
1349
+ a.holistic.holdMs,
1158
1350
  0,
1159
1351
  5e3,
1160
1352
  "trackers.holistic.holdMs",
1161
1353
  s
1162
1354
  ),
1163
1355
  predictMs: U(
1164
- (N = a.holistic) == null ? void 0 : N.predictMs,
1165
- n.holistic.predictMs,
1356
+ (N = n.holistic) == null ? void 0 : N.predictMs,
1357
+ a.holistic.predictMs,
1166
1358
  0,
1167
1359
  1e3,
1168
1360
  "trackers.holistic.predictMs",
@@ -1170,80 +1362,80 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1170
1362
  ),
1171
1363
  analysisMaxDimension: Math.round(
1172
1364
  U(
1173
- (B = a.holistic) == null ? void 0 : B.analysisMaxDimension,
1174
- n.holistic.analysisMaxDimension,
1365
+ ($ = n.holistic) == null ? void 0 : $.analysisMaxDimension,
1366
+ a.holistic.analysisMaxDimension,
1175
1367
  128,
1176
1368
  2048,
1177
1369
  "trackers.holistic.analysisMaxDimension",
1178
1370
  s
1179
1371
  )
1180
1372
  ),
1181
- outputFaceBlendshapes: G(
1182
- ($ = a.holistic) == null ? void 0 : $.outputFaceBlendshapes,
1183
- n.holistic.outputFaceBlendshapes,
1373
+ outputFaceBlendshapes: q(
1374
+ (j = n.holistic) == null ? void 0 : j.outputFaceBlendshapes,
1375
+ a.holistic.outputFaceBlendshapes,
1184
1376
  "trackers.holistic.outputFaceBlendshapes",
1185
1377
  s
1186
1378
  ),
1187
1379
  confidence: U(
1188
- (te = a.holistic) == null ? void 0 : te.confidence,
1189
- n.holistic.confidence,
1380
+ (ae = n.holistic) == null ? void 0 : ae.confidence,
1381
+ a.holistic.confidence,
1190
1382
  0,
1191
1383
  1,
1192
1384
  "trackers.holistic.confidence",
1193
1385
  s
1194
1386
  ),
1195
- delegate: H(
1196
- (re = a.holistic) == null ? void 0 : re.delegate,
1387
+ delegate: K(
1388
+ (oe = n.holistic) == null ? void 0 : oe.delegate,
1197
1389
  ["auto", "GPU", "CPU"],
1198
- n.holistic.delegate,
1390
+ a.holistic.delegate,
1199
1391
  "trackers.holistic.delegate",
1200
1392
  s
1201
1393
  )
1202
1394
  },
1203
1395
  segmentation: {
1204
- enabled: G(
1205
- (Y = a.segmentation) == null ? void 0 : Y.enabled,
1206
- n.segmentation.enabled,
1396
+ enabled: q(
1397
+ (ee = n.segmentation) == null ? void 0 : ee.enabled,
1398
+ a.segmentation.enabled,
1207
1399
  "trackers.segmentation.enabled",
1208
1400
  s
1209
1401
  ),
1210
- quality: H(
1211
- (E = a.segmentation) == null ? void 0 : E.quality,
1402
+ quality: K(
1403
+ (E = n.segmentation) == null ? void 0 : E.quality,
1212
1404
  ["low", "medium", "high"],
1213
- n.segmentation.quality,
1405
+ a.segmentation.quality,
1214
1406
  "trackers.segmentation.quality",
1215
1407
  s
1216
1408
  )
1217
1409
  },
1218
1410
  semanticSegmentation: {
1219
- enabled: G(
1220
- (C = a.semanticSegmentation) == null ? void 0 : C.enabled,
1221
- n.semanticSegmentation.enabled,
1411
+ enabled: q(
1412
+ (v = n.semanticSegmentation) == null ? void 0 : v.enabled,
1413
+ a.semanticSegmentation.enabled,
1222
1414
  "trackers.semanticSegmentation.enabled",
1223
1415
  s
1224
1416
  ),
1225
- preset: H(
1226
- (A = a.semanticSegmentation) == null ? void 0 : A.preset,
1227
- Ft,
1228
- n.semanticSegmentation.preset,
1417
+ preset: K(
1418
+ (x = n.semanticSegmentation) == null ? void 0 : x.preset,
1419
+ Wt,
1420
+ a.semanticSegmentation.preset,
1229
1421
  "trackers.semanticSegmentation.preset",
1230
1422
  s
1231
1423
  ),
1232
- quality: H(
1233
- (v = a.semanticSegmentation) == null ? void 0 : v.quality,
1424
+ quality: K(
1425
+ (_ = n.semanticSegmentation) == null ? void 0 : _.quality,
1234
1426
  ["low", "medium", "high"],
1235
- n.semanticSegmentation.quality,
1427
+ a.semanticSegmentation.quality,
1236
1428
  "trackers.semanticSegmentation.quality",
1237
1429
  s
1238
1430
  )
1239
1431
  }
1240
1432
  },
1241
1433
  perf: {
1242
- targetFps: U((Z = e.perf) == null ? void 0 : Z.targetFps, t.perf.targetFps, 0, 120, "perf.targetFps", s),
1243
- camRes: Math.round(U((j = e.perf) == null ? void 0 : j.camRes, t.perf.camRes, 160, 3840, "perf.camRes", s)),
1244
- cameraZoom: U((L = e.perf) == null ? void 0 : L.cameraZoom, t.perf.cameraZoom, 1, 3, "perf.cameraZoom", s),
1434
+ targetFps: U((J = e.perf) == null ? void 0 : J.targetFps, t.perf.targetFps, 0, 120, "perf.targetFps", s),
1435
+ camRes: Math.round(U((Z = e.perf) == null ? void 0 : Z.camRes, t.perf.camRes, 160, 3840, "perf.camRes", s)),
1436
+ cameraZoom: U((O = e.perf) == null ? void 0 : O.cameraZoom, t.perf.cameraZoom, 1, 3, "perf.cameraZoom", s),
1245
1437
  analysisScale: U(
1246
- (J = e.perf) == null ? void 0 : J.analysisScale,
1438
+ (te = e.perf) == null ? void 0 : te.analysisScale,
1247
1439
  t.perf.analysisScale,
1248
1440
  0.25,
1249
1441
  1,
@@ -1252,8 +1444,8 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1252
1444
  )
1253
1445
  },
1254
1446
  lifecycle: {
1255
- pauseWhenHidden: G(
1256
- (fe = e.lifecycle) == null ? void 0 : fe.pauseWhenHidden,
1447
+ pauseWhenHidden: q(
1448
+ (Ee = e.lifecycle) == null ? void 0 : Ee.pauseWhenHidden,
1257
1449
  t.lifecycle.pauseWhenHidden,
1258
1450
  "lifecycle.pauseWhenHidden",
1259
1451
  s
@@ -1261,26 +1453,26 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1261
1453
  },
1262
1454
  quality: i,
1263
1455
  camera: {
1264
- facingMode: H(
1265
- (pe = e.camera) == null ? void 0 : pe.facingMode,
1456
+ facingMode: K(
1457
+ (Re = e.camera) == null ? void 0 : Re.facingMode,
1266
1458
  ["user", "environment"],
1267
1459
  t.camera.facingMode,
1268
1460
  "camera.facingMode",
1269
1461
  s
1270
1462
  ),
1271
- deviceId: ((he = e.camera) == null ? void 0 : he.deviceId) === void 0 ? t.camera.deviceId : typeof e.camera.deviceId == "string" || e.camera.deviceId === null ? e.camera.deviceId : (s("camera.deviceId: not a string, kept base"), t.camera.deviceId),
1272
- mirrored: ((ge = e.camera) == null ? void 0 : ge.mirrored) === void 0 ? t.camera.mirrored : e.camera.mirrored === "auto" || typeof e.camera.mirrored == "boolean" ? e.camera.mirrored : (s('camera.mirrored: must be boolean or "auto", kept base'), t.camera.mirrored)
1463
+ deviceId: ((Ae = e.camera) == null ? void 0 : Ae.deviceId) === void 0 ? t.camera.deviceId : typeof e.camera.deviceId == "string" || e.camera.deviceId === null ? e.camera.deviceId : (s("camera.deviceId: not a string, kept base"), t.camera.deviceId),
1464
+ mirrored: ((xe = e.camera) == null ? void 0 : xe.mirrored) === void 0 ? t.camera.mirrored : e.camera.mirrored === "auto" || typeof e.camera.mirrored == "boolean" ? e.camera.mirrored : (s('camera.mirrored: must be boolean or "auto", kept base'), t.camera.mirrored)
1273
1465
  },
1274
1466
  fallbacks: {
1275
- onUnsupported: H(
1276
- (ye = e.fallbacks) == null ? void 0 : ye.onUnsupported,
1467
+ onUnsupported: K(
1468
+ (Ce = e.fallbacks) == null ? void 0 : Ce.onUnsupported,
1277
1469
  ["block", "degrade"],
1278
1470
  t.fallbacks.onUnsupported,
1279
1471
  "fallbacks.onUnsupported",
1280
1472
  s
1281
1473
  ),
1282
- delegate: H(
1283
- (Se = e.fallbacks) == null ? void 0 : Se.delegate,
1474
+ delegate: K(
1475
+ (ve = e.fallbacks) == null ? void 0 : ve.delegate,
1284
1476
  ["auto", "GPU", "CPU"],
1285
1477
  t.fallbacks.delegate,
1286
1478
  "fallbacks.delegate",
@@ -1288,14 +1480,14 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1288
1480
  )
1289
1481
  },
1290
1482
  assets: {
1291
- holisticModelUrl: ve(
1292
- (Te = e.assets) == null ? void 0 : Te.holisticModelUrl,
1483
+ holisticModelUrl: qe(
1484
+ (Fe = e.assets) == null ? void 0 : Fe.holisticModelUrl,
1293
1485
  t.assets.holisticModelUrl,
1294
1486
  "assets.holisticModelUrl",
1295
1487
  s
1296
1488
  ),
1297
- semanticSegmentationModelUrl: ve(
1298
- (Me = e.assets) == null ? void 0 : Me.semanticSegmentationModelUrl,
1489
+ semanticSegmentationModelUrl: qe(
1490
+ (ke = e.assets) == null ? void 0 : ke.semanticSegmentationModelUrl,
1299
1491
  t.assets.semanticSegmentationModelUrl,
1300
1492
  "assets.semanticSegmentationModelUrl",
1301
1493
  s
@@ -1303,7 +1495,7 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1303
1495
  },
1304
1496
  updatedAt: typeof e.updatedAt == "number" && Number.isFinite(e.updatedAt) ? e.updatedAt : t.updatedAt
1305
1497
  };
1306
- }, we = (e, t, r = Date.now()) => K({ ...t, updatedAt: r }, e), ze = (e) => JSON.stringify(K({}, e)), qe = (e) => {
1498
+ }, Xe = (e, t, r = Date.now()) => V({ ...t, updatedAt: r }, e), nt = (e) => JSON.stringify(V({}, e)), at = (e) => {
1307
1499
  const t = [];
1308
1500
  let r = e;
1309
1501
  if (typeof e == "string")
@@ -1311,22 +1503,22 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1311
1503
  r = JSON.parse(e);
1312
1504
  } catch {
1313
1505
  return {
1314
- config: K(),
1506
+ config: V(),
1315
1507
  migrated: !0,
1316
1508
  warnings: ["not valid JSON; defaults used"]
1317
1509
  };
1318
1510
  }
1319
1511
  if (!r || typeof r != "object")
1320
1512
  return {
1321
- config: K(),
1513
+ config: V(),
1322
1514
  migrated: !0,
1323
1515
  warnings: ["not an object; defaults used"]
1324
1516
  };
1325
- const s = r, a = s.version !== oe;
1326
- return a && t.push(
1327
- `migrated from version ${String(s.version ?? "none")} to ${oe}`
1328
- ), { config: K(s, Ge, t), migrated: a, warnings: t };
1329
- }, Ss = [
1517
+ const s = r, n = s.version !== me;
1518
+ return n && t.push(
1519
+ `migrated from version ${String(s.version ?? "none")} to ${me}`
1520
+ ), { config: V(s, st, t), migrated: n, warnings: t };
1521
+ }, Vs = [
1330
1522
  "face",
1331
1523
  "hand",
1332
1524
  "gesture",
@@ -1334,7 +1526,7 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1334
1526
  "holistic",
1335
1527
  "segmentation",
1336
1528
  "semanticSegmentation"
1337
- ], fr = (e) => ({
1529
+ ], qr = (e) => ({
1338
1530
  perf: {
1339
1531
  targetFps: e.perf.targetFps > 0 ? e.perf.targetFps : void 0,
1340
1532
  camRes: e.perf.camRes,
@@ -1343,25 +1535,25 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1343
1535
  },
1344
1536
  lifecycle: { pauseWhenHidden: e.lifecycle.pauseWhenHidden },
1345
1537
  quality: e.quality
1346
- }), pr = (e) => ({
1538
+ }), Xr = (e) => ({
1347
1539
  facingMode: e.camera.facingMode,
1348
1540
  ...e.camera.deviceId ? { deviceId: e.camera.deviceId } : {},
1349
1541
  ...e.camera.mirrored === "auto" ? {} : { mirrored: e.camera.mirrored }
1350
- }), q = (e) => e === null ? {} : { targetFps: e }, hr = (e, t) => {
1542
+ }), X = (e) => e === null ? {} : { targetFps: e }, Wr = (e, t) => {
1351
1543
  const r = e.trackers;
1352
1544
  return {
1353
1545
  face: {
1354
1546
  numFaces: r.face.numFaces,
1355
- ...q(r.face.targetFps),
1547
+ ...X(r.face.targetFps),
1356
1548
  holdMs: r.face.holdMs,
1357
1549
  predictMs: r.face.predictMs,
1358
1550
  active: r.face.enabled
1359
1551
  },
1360
- hand: { ...q(r.hand.targetFps), active: r.hand.enabled },
1361
- gesture: { ...q(r.gesture.targetFps), active: r.gesture.enabled },
1552
+ hand: { ...X(r.hand.targetFps), active: r.hand.enabled },
1553
+ gesture: { ...X(r.gesture.targetFps), active: r.gesture.enabled },
1362
1554
  body: { active: r.body.enabled },
1363
1555
  holistic: {
1364
- ...q(r.holistic.targetFps),
1556
+ ...X(r.holistic.targetFps),
1365
1557
  hands: r.holistic.hands,
1366
1558
  holdMs: r.holistic.holdMs,
1367
1559
  predictMs: r.holistic.predictMs,
@@ -1379,21 +1571,21 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1379
1571
  active: r.semanticSegmentation.enabled
1380
1572
  }
1381
1573
  }[t];
1382
- }, gr = (e, t) => {
1574
+ }, $r = (e, t) => {
1383
1575
  const r = e.trackers;
1384
1576
  switch (t) {
1385
- case _.FACE_TRACKER:
1386
- return { numFaces: r.face.numFaces, ...q(r.face.targetFps) };
1387
- case _.HAND_TRACKER:
1388
- return { ...q(r.hand.targetFps) };
1389
- case _.GESTURE_TRACKER:
1390
- return { ...q(r.gesture.targetFps) };
1391
- case _.BODY_TRACKER:
1392
- return { ...q(r.body.targetFps) };
1393
- case _.HOLISTIC_TRACKER: {
1577
+ case w.FACE_TRACKER:
1578
+ return { numFaces: r.face.numFaces, ...X(r.face.targetFps) };
1579
+ case w.HAND_TRACKER:
1580
+ return { ...X(r.hand.targetFps) };
1581
+ case w.GESTURE_TRACKER:
1582
+ return { ...X(r.gesture.targetFps) };
1583
+ case w.BODY_TRACKER:
1584
+ return { ...X(r.body.targetFps) };
1585
+ case w.HOLISTIC_TRACKER: {
1394
1586
  const s = r.holistic;
1395
1587
  return {
1396
- ...q(s.targetFps),
1588
+ ...X(s.targetFps),
1397
1589
  hands: s.hands,
1398
1590
  holdMs: s.holdMs,
1399
1591
  predictMs: s.predictMs,
@@ -1408,9 +1600,9 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1408
1600
  ...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {}
1409
1601
  };
1410
1602
  }
1411
- case _.BACKGROUND_SEGMENTATION:
1603
+ case w.BACKGROUND_SEGMENTATION:
1412
1604
  return { quality: r.segmentation.quality };
1413
- case _.SEMANTIC_SEGMENTATION:
1605
+ case w.SEMANTIC_SEGMENTATION:
1414
1606
  return {
1415
1607
  preset: r.semanticSegmentation.preset,
1416
1608
  quality: r.semanticSegmentation.quality,
@@ -1419,275 +1611,280 @@ const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math
1419
1611
  default:
1420
1612
  return {};
1421
1613
  }
1422
- }, yr = (e) => {
1614
+ }, jr = (e) => {
1423
1615
  const t = e.trackers, r = [];
1424
- return t.face.enabled && r.push(_.FACE_TRACKER), t.hand.enabled && r.push(_.HAND_TRACKER), t.gesture.enabled && r.push(_.GESTURE_TRACKER), t.body.enabled && r.push(_.BODY_TRACKER), t.holistic.enabled && r.push(_.HOLISTIC_TRACKER), t.segmentation.enabled && r.push(_.BACKGROUND_SEGMENTATION), t.semanticSegmentation.enabled && r.push(_.SEMANTIC_SEGMENTATION), r;
1425
- }, ie = "vincentt.xr.tracking-config", me = () => {
1616
+ return t.face.enabled && r.push(w.FACE_TRACKER), t.hand.enabled && r.push(w.HAND_TRACKER), t.gesture.enabled && r.push(w.GESTURE_TRACKER), t.body.enabled && r.push(w.BODY_TRACKER), t.holistic.enabled && r.push(w.HOLISTIC_TRACKER), t.segmentation.enabled && r.push(w.BACKGROUND_SEGMENTATION), t.semanticSegmentation.enabled && r.push(w.SEMANTIC_SEGMENTATION), r;
1617
+ }, fe = "vincentt.xr.tracking-config", Me = () => {
1426
1618
  try {
1427
1619
  return typeof localStorage < "u" ? localStorage : null;
1428
1620
  } catch {
1429
1621
  return null;
1430
1622
  }
1431
- }, Sr = (e = ie, t = me()) => {
1623
+ }, Br = (e = fe, t = Me()) => {
1432
1624
  if (!t) return null;
1433
1625
  try {
1434
1626
  const r = t.getItem(e);
1435
- return r ? qe(r) : null;
1627
+ return r ? at(r) : null;
1436
1628
  } catch {
1437
1629
  return null;
1438
1630
  }
1439
- }, De = (e, t = ie, r = me()) => {
1631
+ }, We = (e, t = fe, r = Me()) => {
1440
1632
  if (!r) return !1;
1441
1633
  try {
1442
- return r.setItem(t, ze(e)), !0;
1634
+ return r.setItem(t, nt(e)), !0;
1443
1635
  } catch {
1444
1636
  return !1;
1445
1637
  }
1446
- }, Tr = (e = ie, t = me()) => {
1638
+ }, Hr = (e = fe, t = Me()) => {
1447
1639
  if (t)
1448
1640
  try {
1449
1641
  t.removeItem(e);
1450
1642
  } catch {
1451
1643
  }
1452
- }, Ts = (e = {}) => {
1453
- const { storageKey: t = ie, persist: r = !0 } = e, s = e.storage, a = R(e.initial), n = W(() => K(a.current ?? {}), []), [i, c] = k(n), [o, l] = k([]), [p, m] = k(!r), f = R(i);
1454
- f.current = i, x(() => {
1644
+ }, Zs = (e = {}) => {
1645
+ const { storageKey: t = fe, persist: r = !0 } = e, s = e.storage, n = A(e.initial), a = W(() => V(n.current ?? {}), []), [i, c] = F(a), [o, l] = F([]), [p, d] = F(!r), u = A(i);
1646
+ u.current = i, C(() => {
1455
1647
  if (!r) {
1456
- m(!0);
1648
+ d(!0);
1457
1649
  return;
1458
1650
  }
1459
- const h = Sr(t, s);
1651
+ const h = Br(t, s);
1460
1652
  if (h) {
1461
- const S = K(h.config, n);
1462
- f.current = S, c(S), l(h.warnings), h.migrated && De(S, t, s);
1653
+ const g = V(h.config, a);
1654
+ u.current = g, c(g), l(h.warnings), h.migrated && We(g, t, s);
1463
1655
  }
1464
- m(!0);
1465
- }, [r, t, s, n]);
1466
- const u = F(
1467
- (h, S) => (f.current = h, c(h), l(S), r && De(h, t, s), h),
1656
+ d(!0);
1657
+ }, [r, t, s, a]);
1658
+ const f = R(
1659
+ (h, g) => (u.current = h, c(h), l(g), r && We(h, t, s), h),
1468
1660
  [r, t, s]
1469
- ), d = F(
1661
+ ), m = R(
1470
1662
  (h) => {
1471
- const S = [], b = K({ ...h, updatedAt: Date.now() }, f.current, S);
1472
- return u(b, S);
1663
+ const g = [], M = V({ ...h, updatedAt: Date.now() }, u.current, g);
1664
+ return f(M, g);
1473
1665
  },
1474
- [u]
1475
- ), g = F(() => {
1476
- const h = we(n, {}, 0);
1477
- return f.current = h, c(h), l([]), r && Tr(t, s), h;
1478
- }, [n, r, t, s]), M = F(
1666
+ [f]
1667
+ ), S = R(() => {
1668
+ const h = Xe(a, {}, 0);
1669
+ return u.current = h, c(h), l([]), r && Hr(t, s), h;
1670
+ }, [a, r, t, s]), b = R(
1479
1671
  (h) => {
1480
- const S = qe(h);
1481
- return S.warnings.some((b) => b.startsWith("not valid JSON") || b.startsWith("not an object")) ? (l([`import: ${S.warnings[0]}; config unchanged`]), f.current) : u(we(S.config, {}, Date.now()), S.warnings);
1672
+ const g = at(h);
1673
+ return g.warnings.some((M) => M.startsWith("not valid JSON") || M.startsWith("not an object")) ? (l([`import: ${g.warnings[0]}; config unchanged`]), u.current) : f(Xe(g.config, {}, Date.now()), g.warnings);
1482
1674
  },
1483
- [u]
1675
+ [f]
1484
1676
  );
1485
1677
  return W(
1486
1678
  () => ({
1487
1679
  config: i,
1488
1680
  hydrated: p,
1489
1681
  warnings: o,
1490
- update: d,
1491
- reset: g,
1492
- importJson: M,
1493
- json: ze(i),
1494
- providerProps: fr(i),
1495
- cameraRequest: pr(i),
1496
- trackerProps: (h) => hr(i, h),
1497
- modelOptions: (h) => gr(i, h),
1498
- enabledModels: yr(i)
1682
+ update: m,
1683
+ reset: S,
1684
+ importJson: b,
1685
+ json: nt(i),
1686
+ providerProps: qr(i),
1687
+ cameraRequest: Xr(i),
1688
+ trackerProps: (h) => Wr(i, h),
1689
+ modelOptions: (h) => $r(i, h),
1690
+ enabledModels: jr(i)
1499
1691
  }),
1500
- [i, p, o, d, g, M]
1692
+ [i, p, o, m, S, b]
1501
1693
  );
1502
1694
  };
1503
1695
  export {
1504
- Br as AspectRatioContainer,
1505
- tr as AudioEngine,
1506
- ts as AudioPlayer,
1507
- $r as Axes,
1508
- Zr as Button,
1509
- Je as CAMERA_PERMISSION_MESSAGES,
1510
- ms as CameraPermissionGate,
1511
- _n as DEFAULT_ASSET_BUDGET_BYTES,
1512
- un as DEFAULT_MATERIAL_FILL,
1513
- Ae as DEFAULT_MESH_RENDERER,
1514
- En as DEFAULT_MESH_RENDERER_RENDER_STATE,
1515
- bs as DEFAULT_PERFORMANCE_BUDGET,
1516
- As as DEFAULT_PIXEL_SNAP_INCREMENT,
1517
- Rs as DEFAULT_QUALITY_TIERS,
1518
- Fs as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
1519
- Ua as DEFAULT_SCREEN_GLASS,
1520
- dn as DEFAULT_SCREEN_GRADIENT,
1521
- Na as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
1522
- Pa as DEFAULT_SCREEN_IMAGE_SETTINGS,
1523
- La as DEFAULT_SCREEN_SHAPE_SETTINGS,
1524
- Ia as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
1525
- Oa as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
1526
- xs as DEFAULT_SCREEN_TRANSFORM_2D,
1527
- Cs as DEFAULT_SCREEN_TRANSFORM_ROOT,
1528
- Ge as DEFAULT_TRACKING_CONFIG,
1529
- V as DEFAULT_TRANSFORM_3D,
1530
- mn as EXTERNAL_BACKGROUND_RENDER_LAYER,
1531
- gt as FULL_SCREEN_ANCHORS,
1532
- Vr as HtmlRegion,
1533
- Yr as Light,
1534
- Tt as LightObject,
1535
- Ja as LookAt,
1536
- fn as MAX_RENDER_GROUP_PASSES,
1537
- pn as MaterialFill,
1538
- Rn as MeshMaterial,
1539
- Rt as MeshRenderer,
1540
- Kr as Model,
1541
- jr as Object3D,
1542
- zr as Panel,
1543
- Wr as PersonCutout,
1544
- Ga as PinToMesh,
1545
- Qa as RenderGroupLayer,
1546
- en as SCREEN_IMAGE_MASK_CHANNELS,
1547
- nn as Scene,
1548
- tn as SceneObjectRenderer,
1549
- on as Scenes,
1550
- za as ScreenGlassMaterial,
1551
- hn as ScreenGradientMaterial,
1552
- yt as ScreenImage,
1553
- qa as ScreenShape,
1554
- va as ScreenSpaceUI,
1555
- rn as ScreenText,
1556
- Qe as ScreenTransform,
1557
- sn as SequentialRenderPasses,
1558
- Xr as SpriteAnimation,
1559
- Ss as TRACKER_KINDS,
1560
- ie as TRACKING_CONFIG_STORAGE_KEY,
1561
- oe as TRACKING_CONFIG_VERSION,
1562
- wa as TextLabel,
1563
- Hr as ThemeProvider,
1564
- At as Transform3D,
1565
- qr as VideoBackground,
1566
- kn as XRAssetCache,
1567
- hs as XRAssetCacheProvider,
1568
- _s as XRMediaSource,
1569
- _ as XRModel,
1570
- ks as XRProvider,
1571
- vs as XRQualityController,
1572
- _a as XRScene,
1573
- ws as XR_FALLBACK_MESSAGES,
1574
- Ds as XR_MODEL_ASSET_URLS,
1696
+ bs as AspectRatioContainer,
1697
+ kr as AudioEngine,
1698
+ Ls as AudioPlayer,
1699
+ Ts as Axes,
1700
+ Cs as Button,
1701
+ ht as CAMERA_PERMISSION_MESSAGES,
1702
+ Ws as CameraPermissionGate,
1703
+ vs as CaptureShareScreen,
1704
+ oo as DEFAULT_ASSET_BUDGET_BYTES,
1705
+ Xa as DEFAULT_MATERIAL_FILL,
1706
+ Ue as DEFAULT_MESH_RENDERER,
1707
+ Qa as DEFAULT_MESH_RENDERER_RENDER_STATE,
1708
+ Qs as DEFAULT_PERFORMANCE_BUDGET,
1709
+ en as DEFAULT_PIXEL_SNAP_INCREMENT,
1710
+ tn as DEFAULT_QUALITY_TIERS,
1711
+ rn as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
1712
+ ma as DEFAULT_SCREEN_GLASS,
1713
+ Wa as DEFAULT_SCREEN_GRADIENT,
1714
+ fa as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
1715
+ pa as DEFAULT_SCREEN_IMAGE_SETTINGS,
1716
+ ha as DEFAULT_SCREEN_SHAPE_SETTINGS,
1717
+ ga as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
1718
+ ya as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
1719
+ sn as DEFAULT_SCREEN_TRANSFORM_2D,
1720
+ nn as DEFAULT_SCREEN_TRANSFORM_ROOT,
1721
+ st as DEFAULT_TRACKING_CONFIG,
1722
+ Y as DEFAULT_TRANSFORM_3D,
1723
+ $a as EXTERNAL_BACKGROUND_RENDER_LAYER,
1724
+ Ut as FULL_SCREEN_ANCHORS,
1725
+ xs as HtmlRegion,
1726
+ Fs as IntroScreen,
1727
+ ks as Light,
1728
+ Pt as LightObject,
1729
+ _a as LookAt,
1730
+ ja as MAX_RENDER_GROUP_PASSES,
1731
+ Ba as MaterialFill,
1732
+ ro as MeshMaterial,
1733
+ qt as MeshRenderer,
1734
+ Rs as Model,
1735
+ As as Object3D,
1736
+ gs as Panel,
1737
+ Ss as PersonCutout,
1738
+ Sa as PinToMesh,
1739
+ La as RenderGroupLayer,
1740
+ Ua as SCREEN_IMAGE_MASK_CHANNELS,
1741
+ Oa as Scene,
1742
+ Da as SceneObjectRenderer,
1743
+ za as Scenes,
1744
+ ba as ScreenGlassMaterial,
1745
+ Ha as ScreenGradientMaterial,
1746
+ Dt as ScreenImage,
1747
+ Ta as ScreenShape,
1748
+ la as ScreenSpaceUI,
1749
+ Na as ScreenText,
1750
+ gt as ScreenTransform,
1751
+ Pa as SequentialRenderPasses,
1752
+ oa as SplashScreen,
1753
+ Ms as SpriteAnimation,
1754
+ Vs as TRACKER_KINDS,
1755
+ fe as TRACKING_CONFIG_STORAGE_KEY,
1756
+ me as TRACKING_CONFIG_VERSION,
1757
+ ua as TextLabel,
1758
+ Es as ThemeProvider,
1759
+ Gt as Transform3D,
1760
+ ys as VideoBackground,
1761
+ io as XRAssetCache,
1762
+ Bs as XRAssetCacheProvider,
1763
+ an as XRMediaSource,
1764
+ w as XRModel,
1765
+ on as XRProvider,
1766
+ cn as XRQualityController,
1767
+ ia as XRScene,
1768
+ ln as XR_FALLBACK_MESSAGES,
1769
+ un as XR_MODEL_ASSET_URLS,
1575
1770
  P as audio,
1576
- Ye as canPromptForCamera,
1577
- Tr as clearTrackingConfig,
1578
- Us as clientToScreenPixels,
1579
- St as computeContainScale,
1580
- Ns as computeFeedCrop,
1581
- Ps as computeFitLayout,
1582
- vn as createAssetCache,
1583
- Ls as createFallbackReason,
1584
- gn as createTwoStopGradient,
1585
- es as dataURLtoFile,
1586
- Un as defineGltfAsset,
1587
- Nn as defineTextureAsset,
1588
- Pn as defineVideoAsset,
1589
- Is as detectXRCapabilities,
1590
- Ln as disposeObject3D,
1591
- ja as drawNormalizedCrop,
1592
- yr as enabledModels,
1593
- In as estimateGeometryBytes,
1594
- On as estimateObjectBytes,
1595
- Gn as estimateTextureBytes,
1596
- Os as feedSidedName,
1597
- Gs as feedToScreenPixels,
1598
- zs as feedToSource,
1599
- qs as feedToTracker,
1600
- Ws as feedToViewport,
1601
- Bs as feedToWorld,
1602
- ps as findCameraByFacing,
1603
- Pe as getDefaultAssetCache,
1604
- yn as getRenderGroupLayer,
1605
- Mt as goToScene,
1606
- $s as isFeedPointInSource,
1607
- Xs as isMirroredSourceKind,
1608
- ls as isMuted,
1609
- fs as listCameras,
1610
- Sr as loadTrackingConfig,
1611
- Wa as mapScreenImageSettingsToProps,
1612
- Ba as mapScreenTextInnerShadowToProps,
1613
- $a as mapScreenTextSettingsToProps,
1614
- Hs as mediaToScreenPixels,
1615
- Xa as mergeScreenShapeSettings,
1616
- Ks as mergeScreenTransform2D,
1617
- we as mergeTrackingConfig,
1618
- js as mirrorFeedX,
1619
- bn as normalizeMeshRendererRenderState,
1620
- Ha as normalizeScreenGlass,
1621
- Sn as normalizeScreenGradient,
1622
- Vs as normalizedToScreenPixels,
1623
- Zs as normalizedToTransform2DPixels,
1624
- us as onMuteChange,
1625
- Ys as orientSourcePoint,
1626
- Js as orientedSize,
1627
- Qs as otherSide,
1628
- qe as parseTrackingConfig,
1629
- ea as personLeftSign,
1630
- ta as personSide,
1631
- os as playOneShot,
1632
- rs as prefetchMusic,
1633
- je as queryCameraPermission,
1634
- ss as registerSound,
1635
- Tn as renderSequentialPasses,
1636
- Ve as requestCameraAccess,
1637
- ra as resolveModelAssetUrl,
1638
- Va as resolveNormalizedCrop,
1639
- Za as resolvePersonCutoutStatus,
1640
- sa as resolveQualityConfig,
1641
- aa as resolveScreenTransform2D,
1642
- na as resolveTrackerSupport,
1643
- K as resolveTrackingConfig,
1644
- De as saveTrackingConfig,
1645
- oa as screenPixelsToClient,
1646
- ia as screenPixelsToFeed,
1647
- ca as screenPixelsToMedia,
1648
- la as screenPixelsToNormalized,
1649
- ua as screenPixelsToScreenSpace,
1650
- da as screenPixelsToUnits,
1651
- ma as screenPointToRay,
1652
- fa as screenSpaceToScreenPixels,
1653
- pa as screenTransform2DScale,
1654
- ha as screenUnitsToPixels,
1655
- ze as serializeTrackingConfig,
1656
- is as setMuted,
1657
- ht as shouldDrawFallback,
1658
- ee as smoothNumber,
1659
- Or as smoothVector2,
1660
- Gr as smoothVector3,
1661
- ga as sourceToFeed,
1662
- as as startMusic,
1663
- ns as stopMusic,
1664
- Ze as subscribeCameraPermission,
1665
- ya as swapSidedName,
1666
- pr as toCameraRequest,
1667
- gr as toModelOptions,
1668
- fr as toProviderProps,
1669
- hr as toTrackerProps,
1670
- cs as toggleMuted,
1671
- Sa as trackerPointToScreenPixels,
1672
- Ta as trackerToFeed,
1673
- Ma as trackerToWorld,
1674
- Ea as transform2DPixelsToNormalized,
1675
- nr as useCameraPermission,
1676
- Qr as useFrameCapture,
1677
- Jr as useMediaRecorder,
1678
- ds as useMuted,
1679
- pt as usePersonMaskTexture,
1680
- cn as useSceneSample,
1681
- bt as useScreenRectAspect,
1682
- gs as useXRAsset,
1683
- Oe as useXRAssetCache,
1684
- ys as useXRAssetStats,
1685
- xn as useXRCapabilities,
1686
- wn as useXRQuality,
1687
- Ts as useXRTrackingConfig,
1688
- ba as viewportSizeToTransform2DPixels,
1689
- Aa as viewportToFeed,
1690
- Ra as worldToFeed,
1691
- Fa as worldToScreenPixels,
1692
- xa as worldToTracker
1771
+ pt as canPromptForCamera,
1772
+ Hr as clearTrackingConfig,
1773
+ dn as clientToScreenPixels,
1774
+ Nt as computeContainScale,
1775
+ mn as computeFeedCrop,
1776
+ fn as computeFitLayout,
1777
+ co as createAssetCache,
1778
+ pn as createFallbackReason,
1779
+ Ka as createTwoStopGradient,
1780
+ Ar as dataURLtoFile,
1781
+ mo as defineGltfAsset,
1782
+ fo as defineTextureAsset,
1783
+ po as defineVideoAsset,
1784
+ hn as detectXRCapabilities,
1785
+ ho as disposeObject3D,
1786
+ va as drawNormalizedCrop,
1787
+ jr as enabledModels,
1788
+ go as estimateGeometryBytes,
1789
+ yo as estimateObjectBytes,
1790
+ So as estimateTextureBytes,
1791
+ gn as feedSidedName,
1792
+ yn as feedToScreenPixels,
1793
+ Sn as feedToSource,
1794
+ bn as feedToTracker,
1795
+ Tn as feedToViewport,
1796
+ Mn as feedToWorld,
1797
+ js as findCameraByFacing,
1798
+ Ke as getDefaultAssetCache,
1799
+ Va as getRenderGroupLayer,
1800
+ It as goToScene,
1801
+ En as isFeedPointInSource,
1802
+ Rn as isMirroredSourceKind,
1803
+ Gs as isMuted,
1804
+ $s as listCameras,
1805
+ Br as loadTrackingConfig,
1806
+ Ma as mapScreenImageSettingsToProps,
1807
+ Ea as mapScreenTextInnerShadowToProps,
1808
+ Ra as mapScreenTextSettingsToProps,
1809
+ An as mediaToScreenPixels,
1810
+ Aa as mergeScreenShapeSettings,
1811
+ xn as mergeScreenTransform2D,
1812
+ Xe as mergeTrackingConfig,
1813
+ Cn as mirrorFeedX,
1814
+ eo as normalizeMeshRendererRenderState,
1815
+ xa as normalizeScreenGlass,
1816
+ Za as normalizeScreenGradient,
1817
+ vn as normalizedToScreenPixels,
1818
+ Fn as normalizedToTransform2DPixels,
1819
+ qs as onMuteChange,
1820
+ kn as orientSourcePoint,
1821
+ wn as orientedSize,
1822
+ _n as otherSide,
1823
+ at as parseTrackingConfig,
1824
+ Ln as personLeftSign,
1825
+ Un as personSide,
1826
+ Is as playOneShot,
1827
+ Us as prefetchMusic,
1828
+ dt as queryCameraPermission,
1829
+ Ds as registerSound,
1830
+ Ya as renderSequentialPasses,
1831
+ mt as requestCameraAccess,
1832
+ Dn as resolveModelAssetUrl,
1833
+ Fa as resolveNormalizedCrop,
1834
+ ka as resolvePersonCutoutStatus,
1835
+ Nn as resolveQualityConfig,
1836
+ Pn as resolveScreenTransform2D,
1837
+ In as resolveTrackerSupport,
1838
+ V as resolveTrackingConfig,
1839
+ We as saveTrackingConfig,
1840
+ On as screenPixelsToClient,
1841
+ zn as screenPixelsToFeed,
1842
+ Gn as screenPixelsToMedia,
1843
+ qn as screenPixelsToNormalized,
1844
+ Xn as screenPixelsToScreenSpace,
1845
+ Wn as screenPixelsToUnits,
1846
+ $n as screenPointToRay,
1847
+ jn as screenSpaceToScreenPixels,
1848
+ Bn as screenTransform2DScale,
1849
+ Hn as screenUnitsToPixels,
1850
+ nt as serializeTrackingConfig,
1851
+ Os as setMuted,
1852
+ Lt as shouldDrawFallback,
1853
+ ne as smoothNumber,
1854
+ ps as smoothVector2,
1855
+ hs as smoothVector3,
1856
+ Kn as sourceToFeed,
1857
+ Ns as startMusic,
1858
+ Ps as stopMusic,
1859
+ ft as subscribeCameraPermission,
1860
+ Vn as swapSidedName,
1861
+ Xr as toCameraRequest,
1862
+ $r as toModelOptions,
1863
+ qr as toProviderProps,
1864
+ Wr as toTrackerProps,
1865
+ zs as toggleMuted,
1866
+ Zn as trackerPointToScreenPixels,
1867
+ Yn as trackerToFeed,
1868
+ Jn as trackerToWorld,
1869
+ Qn as transform2DPixelsToNormalized,
1870
+ Ur as useCameraPermission,
1871
+ _s as useCapture,
1872
+ ws as useFrameCapture,
1873
+ Er as useMediaRecorder,
1874
+ Xs as useMuted,
1875
+ _t as usePersonMaskTexture,
1876
+ Ga as useSceneSample,
1877
+ zt as useScreenRectAspect,
1878
+ pr as useShare,
1879
+ Hs as useXRAsset,
1880
+ rt as useXRAssetCache,
1881
+ Ks as useXRAssetStats,
1882
+ no as useXRCapabilities,
1883
+ lo as useXRQuality,
1884
+ Zs as useXRTrackingConfig,
1885
+ ea as viewportSizeToTransform2DPixels,
1886
+ ta as viewportToFeed,
1887
+ ra as worldToFeed,
1888
+ sa as worldToScreenPixels,
1889
+ na as worldToTracker
1693
1890
  };