@vincentt-xr/sdk 2.0.0-alpha.7 → 2.0.0-alpha.8

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 (275) hide show
  1. package/GROUNDING.md +1109 -13
  2. package/dist/{DebuggerUI-BjOMr8q_.js → DebuggerUI-C-ldiozL.js} +1 -1
  3. package/dist/{DebuggerUI-B6bP6P9r.cjs → DebuggerUI-CWX5EtQv.cjs} +1 -1
  4. package/dist/FaceMeshRenderer-BEEXZwS6.cjs +158 -0
  5. package/dist/FaceMeshRenderer-UuH5sTXG.js +1322 -0
  6. package/dist/FaceRetouch-C7h7x9kd.js +683 -0
  7. package/dist/FaceRetouch-DqftT26Y.cjs +134 -0
  8. package/dist/GLTFLoader-C5q63sKO.js +1633 -0
  9. package/dist/GLTFLoader-Cb_CRwmG.cjs +1 -0
  10. package/dist/SegmentationOverlay-DQuW3dsc.js +133 -0
  11. package/dist/SegmentationOverlay-aWVod8Kl.cjs +1 -0
  12. package/dist/assets/cache.d.ts +99 -0
  13. package/dist/assets/estimate.d.ts +11 -0
  14. package/dist/assets/index.d.ts +7 -0
  15. package/dist/assets/loaders.d.ts +28 -0
  16. package/dist/assets/react.d.ts +33 -0
  17. package/dist/calibration/calibration.d.ts +70 -0
  18. package/dist/calibration/index.d.ts +6 -0
  19. package/dist/calibration/storage.d.ts +13 -0
  20. package/dist/calibration/types.d.ts +53 -0
  21. package/dist/calibration/useXRCalibration.d.ts +46 -0
  22. package/dist/camera/CameraPermissionGate.d.ts +26 -0
  23. package/dist/camera/devices.d.ts +26 -0
  24. package/dist/camera/index.d.ts +8 -0
  25. package/dist/camera/permission.d.ts +86 -0
  26. package/dist/camera/useCameraPermission.d.ts +35 -0
  27. package/dist/capabilities/detect.d.ts +45 -0
  28. package/dist/capabilities/index.d.ts +5 -0
  29. package/dist/capabilities/types.d.ts +120 -0
  30. package/dist/capabilities/useXRCapabilities.d.ts +18 -0
  31. package/dist/compat/environment.d.ts +5 -0
  32. package/dist/compat/index.d.ts +4 -0
  33. package/dist/compat/run.d.ts +18 -0
  34. package/dist/compat/scenarios.d.ts +10 -0
  35. package/dist/compat/types.d.ts +101 -0
  36. package/dist/components/BodyTracker/index.d.ts +9 -0
  37. package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +33 -3
  38. package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +12 -0
  39. package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
  40. package/dist/components/FaceMesh/index.d.ts +1 -1
  41. package/dist/components/GestureListener/index.d.ts +11 -0
  42. package/dist/components/HandTracker/index.d.ts +10 -0
  43. package/dist/components/HolisticTracker/index.d.ts +69 -0
  44. package/dist/components/HolisticTracker/settings.d.ts +58 -0
  45. package/dist/components/HolisticTracker/signals.d.ts +49 -0
  46. package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
  47. package/dist/components/IrisEffect/index.d.ts +51 -0
  48. package/dist/components/IrisEffect/settings.d.ts +117 -0
  49. package/dist/components/LipEffect/LipEffect.d.ts +7 -1
  50. package/dist/components/LipEffect/LipEffectMaterial.d.ts +43 -7
  51. package/dist/components/LipEffect/LipEffects.d.ts +9 -0
  52. package/dist/components/LipEffect/defaults.d.ts +27 -4
  53. package/dist/components/LipEffect/index.d.ts +11 -3
  54. package/dist/components/LipEffect/settings.d.ts +271 -0
  55. package/dist/components/LipEffect/types.d.ts +56 -9
  56. package/dist/components/LipEffect/useLipDesignTextures.d.ts +11 -0
  57. package/dist/components/LipEffect/uvGuide.d.ts +59 -0
  58. package/dist/components/PersonCutout/index.d.ts +50 -0
  59. package/dist/components/PersonCutout/personCutout.d.ts +16 -0
  60. package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +1 -1
  61. package/dist/components/ScreenImage/index.d.ts +3 -1
  62. package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
  63. package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
  64. package/dist/components/ScreenImage/source.d.ts +6 -0
  65. package/dist/components/ScreenImage/types.d.ts +18 -0
  66. package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
  67. package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
  68. package/dist/components/SegmentationOverlay/index.d.ts +9 -0
  69. package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
  70. package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
  71. package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
  72. package/dist/components/XRProvider/index.d.ts +16 -2
  73. package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
  74. package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
  75. package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
  76. package/dist/components/index.d.ts +3 -0
  77. package/dist/constants/index.d.ts +4 -1
  78. package/dist/contexts-CO0sd4JQ.cjs +1 -0
  79. package/dist/{contexts-ByhzppYl.js → contexts-FzlnnMYD.js} +252 -246
  80. package/dist/coordinates/feed.d.ts +52 -0
  81. package/dist/coordinates/index.d.ts +5 -0
  82. package/dist/coordinates/spaces.d.ts +49 -0
  83. package/dist/coordinates/viewport.d.ts +22 -0
  84. package/dist/coordinates/world.d.ts +15 -0
  85. package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
  86. package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
  87. package/dist/debug-ui/index.d.ts +14 -0
  88. package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
  89. package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
  90. package/dist/debug-ui/media-source.cjs +1 -1
  91. package/dist/debug-ui/media-source.js +1 -1
  92. package/dist/debug-ui/product-hotspots/index.d.ts +24 -0
  93. package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
  94. package/dist/debug-ui/xr-diagnostics/index.d.ts +25 -0
  95. package/dist/debug-ui.cjs +3 -3
  96. package/dist/debug-ui.js +2057 -1687
  97. package/dist/detector-K8aej4MB.js +59 -0
  98. package/dist/detector-ijypGtse.cjs +1 -0
  99. package/dist/entries/core.d.ts +18 -1
  100. package/dist/entries/face-effects.d.ts +11 -3
  101. package/dist/entries/low-level.d.ts +22 -3
  102. package/dist/entries/product.d.ts +11 -0
  103. package/dist/entries/tracking.d.ts +24 -1
  104. package/dist/face-effects.cjs +155 -1
  105. package/dist/face-effects.js +1134 -2197
  106. package/dist/gestures/definitions.d.ts +85 -0
  107. package/dist/gestures/detector.d.ts +87 -0
  108. package/dist/gestures/index.d.ts +8 -0
  109. package/dist/gestures/measures.d.ts +101 -0
  110. package/dist/gestures/settings.d.ts +49 -0
  111. package/dist/{getFaceInfo-C4QpCQIY.js → getFaceInfo-BkZfaQs-.js} +5 -5
  112. package/dist/{getFaceInfo-fA1bFBub.cjs → getFaceInfo-ahPxQFGu.cjs} +1 -1
  113. package/dist/hooks/selectors.d.ts +68 -1
  114. package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
  115. package/dist/hooks/useFaceInfo.d.ts +13 -1
  116. package/dist/hooks/useFaceInfos.d.ts +1 -1
  117. package/dist/hooks/useGesture.d.ts +32 -0
  118. package/dist/hooks/useIrisTracking.d.ts +45 -0
  119. package/dist/hooks/useXRDiagnostics.d.ts +81 -0
  120. package/dist/hooks/useXRModel.d.ts +7 -0
  121. package/dist/hooks/useXRSession/facade.d.ts +42 -2
  122. package/dist/hooks/useXRSession/index.d.ts +2 -2
  123. package/dist/hooks/useXRSession/reason.d.ts +3 -1
  124. package/dist/hooks/useXRSession/registry.d.ts +14 -0
  125. package/dist/hooks/useXRSession/store.d.ts +52 -3
  126. package/dist/index--RgGzZ6X.cjs +47 -0
  127. package/dist/{index-VJ0SJwmG.js → index-CHVbH0hz.js} +4 -4
  128. package/dist/index-CeVkgsag.cjs +1 -0
  129. package/dist/index-CnGox6Xr.js +3054 -0
  130. package/dist/{index-ByoNj0QP.js → index-CsUdQ-pn.js} +113 -111
  131. package/dist/{index-BjmTe9eM.cjs → index-DKBAh6hV.cjs} +1 -1
  132. package/dist/index-DsZwTfG0.cjs +1 -0
  133. package/dist/index-Dw6tj2Mi.js +144 -0
  134. package/dist/index-OCPjOaeP.cjs +1 -0
  135. package/dist/{index-DXT3WccE.js → index-s9pF4zkG.js} +1065 -1101
  136. package/dist/internal-BYza1h8_.cjs +1 -0
  137. package/dist/{internal-Dmk1cTXq.js → internal-vsfNQycj.js} +15 -16
  138. package/dist/internal.cjs +1 -1
  139. package/dist/internal.js +2 -2
  140. package/dist/iris/compute.d.ts +25 -0
  141. package/dist/iris/index.d.ts +4 -0
  142. package/dist/iris/lead.d.ts +19 -0
  143. package/dist/iris/types.d.ts +87 -0
  144. package/dist/landmarkMask-CbTFzBYG.js +224 -0
  145. package/dist/landmarkMask-u7es2k4X.cjs +1 -0
  146. package/dist/low-level.cjs +1 -1
  147. package/dist/low-level.js +1085 -634
  148. package/dist/main.cjs +1 -1
  149. package/dist/main.js +1519 -465
  150. package/dist/measures-9dQPdw96.js +154 -0
  151. package/dist/measures-KfJzpvod.cjs +1 -0
  152. package/dist/models/Base/index.d.ts +49 -0
  153. package/dist/models/Body/index.d.ts +1 -1
  154. package/dist/models/Face/index.d.ts +1 -1
  155. package/dist/models/Hand/GestureTracking.d.ts +1 -1
  156. package/dist/models/Hand/HandTracking.d.ts +1 -1
  157. package/dist/models/Holistic/index.d.ts +49 -0
  158. package/dist/models/Holistic/result.d.ts +68 -0
  159. package/dist/models/SemanticSegmentation/index.d.ts +31 -0
  160. package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
  161. package/dist/models/index.d.ts +2 -0
  162. package/dist/product/ProductDimensions.d.ts +16 -0
  163. package/dist/product/ProductHotspot.d.ts +16 -0
  164. package/dist/product/ProductViewer.d.ts +9 -0
  165. package/dist/product/details.d.ts +53 -0
  166. package/dist/product/index.d.ts +14 -0
  167. package/dist/product/loadModelViewer.d.ts +4 -0
  168. package/dist/product/types.d.ts +71 -0
  169. package/dist/product/useProductAr.d.ts +37 -0
  170. package/dist/product/useProductDetails.d.ts +60 -0
  171. package/dist/product.cjs +1 -0
  172. package/dist/product.js +414 -0
  173. package/dist/providers-C0Dlhh9Z.js +365 -0
  174. package/dist/providers-YNwkmNeK.cjs +62 -0
  175. package/dist/quality/XRQualityController.d.ts +25 -0
  176. package/dist/quality/controller.d.ts +33 -0
  177. package/dist/quality/index.d.ts +6 -0
  178. package/dist/quality/types.d.ts +100 -0
  179. package/dist/quality/useXRQuality.d.ts +28 -0
  180. package/dist/{renderGroups-KZk6eRiY.js → renderGroups-CN1cGFUo.js} +1 -1
  181. package/dist/{renderGroups-80H3DpTl.cjs → renderGroups-O4KmaMl9.cjs} +1 -1
  182. package/dist/renderPasses-Cg-zqmEz.cjs +21 -0
  183. package/dist/renderPasses-NnKZVfBy.js +1460 -0
  184. package/dist/scene-object.cjs +1 -1
  185. package/dist/scene-object.js +2 -2
  186. package/dist/screenTransform-BenfCtZt.js +44 -0
  187. package/dist/screenTransform-BiXdpVf0.cjs +1 -0
  188. package/dist/segmentation-9PhSvc-R.cjs +1 -0
  189. package/dist/segmentation-CeOTKemr.js +5 -0
  190. package/dist/segmentation2d/faceMemory.d.ts +28 -0
  191. package/dist/segmentation2d/faceRegions.d.ts +24 -0
  192. package/dist/segmentation2d/index.d.ts +9 -0
  193. package/dist/segmentation2d/maskUv.d.ts +23 -0
  194. package/dist/segmentation2d/rasterize.d.ts +14 -0
  195. package/dist/segmentation2d/types.d.ts +46 -0
  196. package/dist/selectors-C5G1PMYL.js +195 -0
  197. package/dist/selectors-Du_PsVnW.cjs +1 -0
  198. package/dist/{session-CpkiK5YA.cjs → session-BBr0yN8h.cjs} +7 -7
  199. package/dist/{session-DLFN_VII.js → session-Cy0m7l7-.js} +76 -76
  200. package/dist/settings-DRR7-snV.cjs +1 -0
  201. package/dist/settings-aQk845NJ.js +73 -0
  202. package/dist/subjects/index.d.ts +2 -0
  203. package/dist/subjects/select.d.ts +62 -0
  204. package/dist/subjects/types.d.ts +55 -0
  205. package/dist/tracking-config/apply.d.ts +57 -0
  206. package/dist/tracking-config/index.d.ts +7 -0
  207. package/dist/tracking-config/resolve.d.ts +25 -0
  208. package/dist/tracking-config/storage.d.ts +8 -0
  209. package/dist/tracking-config/types.d.ts +106 -0
  210. package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
  211. package/dist/tracking.cjs +1 -1
  212. package/dist/tracking.js +1056 -383
  213. package/dist/types/compositor.d.ts +21 -0
  214. package/dist/types/holistic.d.ts +121 -0
  215. package/dist/types/index.d.ts +1 -0
  216. package/dist/types/model.d.ts +22 -2
  217. package/dist/types/nodes.d.ts +27 -2
  218. package/dist/types/segmentation.d.ts +19 -0
  219. package/dist/types/session.d.ts +41 -3
  220. package/dist/useFaceInfo-Blf7FCu3.js +303 -0
  221. package/dist/useFaceInfo-C5mO8NQY.cjs +1 -0
  222. package/dist/useXRCapabilities-B1R2ghy-.cjs +1 -0
  223. package/dist/useXRCapabilities-C68v__wB.js +30 -0
  224. package/dist/utils/fns.d.ts +6 -3
  225. package/dist/utils/integrity.d.ts +4 -1
  226. package/dist/utils/updateThrottle.d.ts +2 -0
  227. package/dist/utils/useStableUniforms.d.ts +18 -0
  228. package/docs/api/adaptive-quality.mdx +104 -0
  229. package/docs/api/asset-lifecycle.mdx +78 -0
  230. package/docs/api/camera-permission.mdx +142 -0
  231. package/docs/api/coordinate-spaces.mdx +165 -0
  232. package/docs/api/cross-camera.mdx +88 -0
  233. package/docs/api/diagnostics-calibration.mdx +97 -0
  234. package/docs/api/face-effects.mdx +6 -0
  235. package/docs/api/face-mesh.mdx +4 -2
  236. package/docs/api/gestures.mdx +173 -0
  237. package/docs/api/holistic-tracker.mdx +159 -0
  238. package/docs/api/iris-tracking.mdx +242 -0
  239. package/docs/api/multi-subject.mdx +95 -0
  240. package/docs/api/person-cutout.mdx +136 -0
  241. package/docs/api/product-ar.mdx +111 -0
  242. package/docs/api/product-details.mdx +78 -0
  243. package/docs/api/screen-space-coordinates.mdx +4 -1
  244. package/docs/api/segmentation-overlay.mdx +301 -0
  245. package/docs/api/session-lifecycle.mdx +136 -0
  246. package/docs/api/trackers.mdx +5 -0
  247. package/docs/api/tracking-config.mdx +108 -0
  248. package/docs/docs.json +23 -1
  249. package/docs/examples/lip-shaders.mdx +224 -0
  250. package/docs/guides/lip-effect-textures.mdx +292 -0
  251. package/docs/guides/lip-uv-template.png +0 -0
  252. package/docs/guides/lip-uv-template.svg +1 -0
  253. package/package.json +13 -1
  254. package/dist/FaceMeshRenderer-C5l6VLdO.cjs +0 -155
  255. package/dist/FaceMeshRenderer-wjAHrJzP.js +0 -1270
  256. package/dist/FaceRetouch-BkJzoA79.cjs +0 -134
  257. package/dist/FaceRetouch-DwbKQJAN.js +0 -551
  258. package/dist/contexts-Dr62It_K.cjs +0 -1
  259. package/dist/index-9dlAQAhy.js +0 -1462
  260. package/dist/index-BpEf2BBb.cjs +0 -1
  261. package/dist/index-CyUUurQT.cjs +0 -1
  262. package/dist/index-DCiMbxC3.cjs +0 -1
  263. package/dist/index-DpI-qo5X.cjs +0 -17
  264. package/dist/index-DyVF4vEW.js +0 -111
  265. package/dist/internal-Cq-TEQ5Y.cjs +0 -1
  266. package/dist/renderLayers-lDtL0_43.cjs +0 -1
  267. package/dist/renderLayers-zrK2pv5O.js +0 -13
  268. package/dist/renderPasses-BOoBSr8z.cjs +0 -21
  269. package/dist/renderPasses-BcquyVtu.js +0 -1500
  270. package/dist/selectors-B8H97CKA.js +0 -59
  271. package/dist/selectors-CZLKT2Iv.cjs +0 -1
  272. package/dist/useFaceInfo-BJ8-_MOs.cjs +0 -1
  273. package/dist/useFaceInfo-Dk426LTu.js +0 -62
  274. package/dist/useFaceResults-CtetsO9M.js +0 -19
  275. package/dist/useFaceResults-wBJF3zyp.cjs +0 -1
package/dist/main.js CHANGED
@@ -1,165 +1,170 @@
1
- var re = Object.defineProperty;
2
- var ae = (t, e, s) => e in t ? re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
- var A = (t, e, s) => ae(t, typeof e != "symbol" ? e + "" : e, s);
4
- import { X as ne, u as oe } from "./index-9dlAQAhy.js";
5
- import { c as yt, d as gt } from "./index-9dlAQAhy.js";
6
- import { S as ie } from "./contexts-ByhzppYl.js";
7
- import { X as xt } from "./contexts-ByhzppYl.js";
8
- import { c as ce } from "./index-DXT3WccE.js";
9
- import { L as _t, d as vt, R as Ct, e as Pt, a as Lt, S as Ut, b as Dt, f as Nt, T as Ft, g as bt, m as Ot, n as It, h as Gt, i as kt, j as zt, k as Wt, s as Xt, l as Vt, o as Ht, p as Bt, t as jt, w as qt } from "./index-DXT3WccE.js";
10
- import { jsxs as N, jsx as f, Fragment as q } from "react/jsx-runtime";
11
- import { useRef as x, useMemo as J, useEffect as U, useState as F, Suspense as ue, useCallback as w, forwardRef as le, useImperativeHandle as de } from "react";
12
- import * as me from "three";
13
- import { MathUtils as pe, Vector2 as he, Vector3 as fe, DoubleSide as k, RepeatWrapping as Y, LinearFilter as Z } from "three";
14
- import { T as Zt, U as Kt, D as $t, K as Jt, J as Qt, F as es, N as ts, O as ss, V as rs, W as as, H as ns, M as os, P as is, S as cs, E as us, B as ls, L as ds, Q as ms, R as ps, G as hs, X as fs, C as Es, I as Ss, Y as Ts } from "./renderPasses-BcquyVtu.js";
15
- import { useThree as Ee, useFrame as Se } from "@react-three/fiber";
16
- import { R as Te } from "./renderLayers-zrK2pv5O.js";
17
- import { u as Me, c as Re } from "./selectors-B8H97CKA.js";
18
- import { useTexture as ye } from "@react-three/drei";
19
- import { a as ge } from "./index-VJ0SJwmG.js";
20
- import { D as Rs, b as ys, M as gs, n as ws } from "./index-VJ0SJwmG.js";
21
- import { A as As, x as _s, E as vs, M as Cs, S as Ps, z as Ls, B as Us, y as Ds } from "./FaceMeshRenderer-wjAHrJzP.js";
22
- import { d as Fs, r as bs } from "./drawNormalizedCrop-CRdIDyl1.js";
23
- import { M as Is } from "./index-ByoNj0QP.js";
24
- const I = (t, e, s, r) => pe.damp(t, e, Math.max(0, s), Math.max(0, r)), Je = (t, e, s, r, a = new he()) => a.set(
25
- I(t.x, e.x, s, r),
26
- I(t.y, e.y, s, r)
27
- ), Qe = (t, e, s, r, a = new fe()) => a.set(
28
- I(t.x, e.x, s, r),
29
- I(t.y, e.y, s, r),
30
- I(t.z, e.z, s, r)
31
- ), we = "rgba(20,40,110,0.88)", xe = 24, Ae = 512;
32
- function et({
33
- color: t = we,
1
+ var Ke = Object.defineProperty;
2
+ var We = (s, e, t) => e in s ? Ke(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var T = (s, e, t) => We(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import { X as C, u as xe, Y as He, Z as Ve, _ as je, $ as Ye, a0 as Qe, a1 as Ze, a2 as Ee, R as Je, L as et, N as tt, I as st, a3 as rt, p as at } from "./index-CnGox6Xr.js";
5
+ import { ag as dr, ah as mr, g as fr, a4 as hr, ai as pr, ad as gr, ae as yr, c as Sr, a as Mr, j as Er, d as br, a5 as Tr, o as Ar, a6 as Rr, i as vr, a7 as wr, a8 as Fr, a9 as Cr, af as kr, A as _r, aa as xr, r as Ur, ab as Pr, ac as Nr } from "./index-CnGox6Xr.js";
6
+ import { S as nt } from "./contexts-FzlnnMYD.js";
7
+ import { X as Ir } from "./contexts-FzlnnMYD.js";
8
+ import { S as it, c as ot } from "./index-s9pF4zkG.js";
9
+ import { L as Or, e as Gr, R as qr, b as Br, f as $r, a as zr, d as Xr, g as Kr, T as Wr } from "./index-s9pF4zkG.js";
10
+ import { jsxs as L, jsx as M, Fragment as ae } from "react/jsx-runtime";
11
+ import { useRef as w, useMemo as K, useEffect as x, useState as k, Suspense as ct, useCallback as E, forwardRef as lt, useImperativeHandle as ut, useContext as dt, createContext as mt, useId as ft, useSyncExternalStore as ht } from "react";
12
+ import * as $ from "three";
13
+ import { MathUtils as pt, Vector2 as gt, Vector3 as yt, DoubleSide as se, RepeatWrapping as be, LinearFilter as Te } from "three";
14
+ import { D as Vr, K as jr, J as Yr, F as Qr, N as Zr, O as Jr, H as ea, M as ta, P as sa, S as ra, E as aa, B as na, L as ia, Q as oa, R as ca, G as la, C as ua, I as da } from "./renderPasses-NnKZVfBy.js";
15
+ import { useThree as St, useFrame as Ue } from "@react-three/fiber";
16
+ import { u as Pe, a as Ne, R as Mt, d as Et, e as bt } from "./selectors-C5G1PMYL.js";
17
+ import { u as Tt } from "./index-CsUdQ-pn.js";
18
+ import { M as fa } from "./index-CsUdQ-pn.js";
19
+ import { useTexture as At } from "@react-three/drei";
20
+ import { a as Rt } from "./index-CHVbH0hz.js";
21
+ import { D as pa, d as ga, M as ya, n as Sa } from "./index-CHVbH0hz.js";
22
+ import { G as Ea, A as ba, E as Ta, M as Aa, S as Ra, T as va, H as wa, B as Fa } from "./FaceMeshRenderer-UuH5sTXG.js";
23
+ import { d as ka, r as _a } from "./drawNormalizedCrop-CRdIDyl1.js";
24
+ import { c as Ua, a as Pa, b as Na, D as Da, m as Ia, r as La } from "./screenTransform-BenfCtZt.js";
25
+ import { d as Ga, q as qa, r as Ba, v as $a, m as za, n as Xa, g as Ka, x as Wa, h as Ha, i as Va, k as ja, e as Ya, l as Qa, o as Za, p as Ja, t as en, y as tn, z as sn, w as rn } from "./useFaceInfo-Blf7FCu3.js";
26
+ import { u as nn } from "./useXRCapabilities-C68v__wB.js";
27
+ import { G as vt } from "./GLTFLoader-C5q63sKO.js";
28
+ import { S as wt } from "./segmentation-CeOTKemr.js";
29
+ const Q = (s, e, t, r) => pt.damp(s, e, Math.max(0, t), Math.max(0, r)), ks = (s, e, t, r, n = new gt()) => n.set(
30
+ Q(s.x, e.x, t, r),
31
+ Q(s.y, e.y, t, r)
32
+ ), _s = (s, e, t, r, n = new yt()) => n.set(
33
+ Q(s.x, e.x, t, r),
34
+ Q(s.y, e.y, t, r),
35
+ Q(s.z, e.z, t, r)
36
+ ), Ft = "rgba(20,40,110,0.88)", Ct = 24, kt = 512;
37
+ function xs({
38
+ color: s = Ft,
34
39
  borderColor: e,
35
- borderWidth: s = 0,
36
- borderRadius: r = xe,
37
- resolution: a = Ae,
38
- aspect: i = 1,
39
- opacity: o = 1,
40
- name: c,
41
- overlay: n = !0,
42
- position: u,
43
- rotation: S,
44
- scale: d,
40
+ borderWidth: t = 0,
41
+ borderRadius: r = Ct,
42
+ resolution: n = kt,
43
+ aspect: a = 1,
44
+ opacity: i = 1,
45
+ name: o,
46
+ overlay: c = !0,
47
+ position: l,
48
+ rotation: p,
49
+ scale: u,
45
50
  visible: m
46
51
  }) {
47
- const h = x(null), l = x(null), T = J(() => _e({
48
- width: Math.round(a * Math.max(i, 0.05)),
49
- height: Math.round(a),
50
- color: t,
52
+ const d = w(null), f = w(null), y = K(() => _t({
53
+ width: Math.round(n * Math.max(a, 0.05)),
54
+ height: Math.round(n),
55
+ color: s,
51
56
  borderColor: e,
52
- borderWidth: s,
57
+ borderWidth: t,
53
58
  borderRadius: r
54
- }), [t, e, s, r, a, i]);
55
- U(() => () => {
56
- T.dispose();
57
- }, [T]);
58
- const g = x(null), E = x(o);
59
- return E.current !== o && (E.current = o, g.current = null, l.current && (l.current.opacity = o)), U(() => {
60
- const _ = h.current;
61
- if (_)
62
- return _.userData.setOpacity = (P) => {
63
- g.current = P, l.current && (l.current.opacity = P);
59
+ }), [s, e, t, r, n, a]);
60
+ x(() => () => {
61
+ y.dispose();
62
+ }, [y]);
63
+ const A = w(null), h = w(i);
64
+ return h.current !== i && (h.current = i, A.current = null, f.current && (f.current.opacity = i)), x(() => {
65
+ const g = d.current;
66
+ if (g)
67
+ return g.userData.setOpacity = (R) => {
68
+ A.current = R, f.current && (f.current.opacity = R);
64
69
  }, () => {
65
- delete _.userData.setOpacity;
70
+ delete g.userData.setOpacity;
66
71
  };
67
- }, []), /* @__PURE__ */ N(
72
+ }, []), /* @__PURE__ */ L(
68
73
  "mesh",
69
74
  {
70
- ref: h,
71
- name: c,
72
- position: u,
73
- rotation: S,
74
- scale: d,
75
+ ref: d,
76
+ name: o,
77
+ position: l,
78
+ rotation: p,
79
+ scale: u,
75
80
  visible: m,
76
81
  children: [
77
- /* @__PURE__ */ f("planeGeometry", { args: [1, 1] }),
78
- /* @__PURE__ */ f(
82
+ /* @__PURE__ */ M("planeGeometry", { args: [1, 1] }),
83
+ /* @__PURE__ */ M(
79
84
  "meshBasicMaterial",
80
85
  {
81
- ref: l,
82
- map: T,
86
+ ref: f,
87
+ map: y,
83
88
  transparent: !0,
84
- opacity: o,
85
- depthTest: !n,
86
- depthWrite: !n
89
+ opacity: i,
90
+ depthTest: !c,
91
+ depthWrite: !c
87
92
  }
88
93
  )
89
94
  ]
90
95
  }
91
96
  );
92
97
  }
93
- function _e(t) {
94
- const { width: e, height: s, color: r, borderColor: a, borderWidth: i, borderRadius: o } = t, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e, s) : (() => {
95
- const d = document.createElement("canvas");
96
- return d.width = e, d.height = s, d;
97
- })(), n = c.getContext("2d");
98
- n.clearRect(0, 0, e, s);
99
- const u = Math.min(o, Math.min(e, s) / 2);
100
- n.beginPath(), n.moveTo(u, 0), n.lineTo(e - u, 0), n.quadraticCurveTo(e, 0, e, u), n.lineTo(e, s - u), n.quadraticCurveTo(e, s, e - u, s), n.lineTo(u, s), n.quadraticCurveTo(0, s, 0, s - u), n.lineTo(0, u), n.quadraticCurveTo(0, 0, u, 0), n.closePath(), n.fillStyle = r, n.fill(), a && i > 0 && (n.lineWidth = i, n.strokeStyle = a, n.stroke());
101
- const S = new me.CanvasTexture(c);
102
- return S.needsUpdate = !0, S;
98
+ function _t(s) {
99
+ const { width: e, height: t, color: r, borderColor: n, borderWidth: a, borderRadius: i } = s, o = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e, t) : (() => {
100
+ const u = document.createElement("canvas");
101
+ return u.width = e, u.height = t, u;
102
+ })(), c = o.getContext("2d");
103
+ c.clearRect(0, 0, e, t);
104
+ const l = Math.min(i, Math.min(e, t) / 2);
105
+ c.beginPath(), c.moveTo(l, 0), c.lineTo(e - l, 0), c.quadraticCurveTo(e, 0, e, l), c.lineTo(e, t - l), c.quadraticCurveTo(e, t, e - l, t), c.lineTo(l, t), c.quadraticCurveTo(0, t, 0, t - l), c.lineTo(0, l), c.quadraticCurveTo(0, 0, l, 0), c.closePath(), c.fillStyle = r, c.fill(), n && a > 0 && (c.lineWidth = a, c.strokeStyle = n, c.stroke());
106
+ const p = new $.CanvasTexture(o);
107
+ return p.needsUpdate = !0, p;
103
108
  }
104
- const tt = ({
105
- segmentationMask: t,
109
+ const Us = ({
110
+ segmentationMask: s,
106
111
  segmentation: e,
107
- invert: s = !1,
112
+ invert: t = !1,
108
113
  customBackground: r,
109
- renderOrder: a = Te.BACKGROUND
114
+ renderOrder: n = Mt.BACKGROUND
110
115
  }) => {
111
- const { camera: i, size: o } = Ee(), c = Me(), n = Re(ne.BACKGROUND_SEGMENTATION), u = e ? n == null ? void 0 : n.backgroundSegmentationMask : void 0, S = x(!1);
112
- U(() => {
116
+ const { camera: a, size: i } = St(), o = Pe(), c = Ne(C.BACKGROUND_SEGMENTATION), l = e ? c == null ? void 0 : c.backgroundSegmentationMask : void 0, p = w(!1);
117
+ x(() => {
113
118
  if (!e) {
114
- S.current = !1;
119
+ p.current = !1;
115
120
  return;
116
121
  }
117
- n === null && !S.current && (console.warn(
122
+ c === null && !p.current && (console.warn(
118
123
  `[VideoBackground] segmentation="${e}" set but no matching <Segmentation> component is mounted; rendering unmasked.`
119
- ), S.current = !0);
120
- }, [e, n]);
121
- const d = e ? u : t, m = J(() => {
122
- if (!i.isPerspectiveCamera)
124
+ ), p.current = !0);
125
+ }, [e, c]);
126
+ const u = e ? l : s, m = K(() => {
127
+ if (!a.isPerspectiveCamera)
123
128
  return [10, 10];
124
- const h = i, g = (h.position.z || 5) - -1, E = h.fov * Math.PI / 180, _ = 2 * Math.tan(E / 2) * g;
125
- return [_ * (o.width / o.height), _];
126
- }, [i, o]);
127
- return c ? /* @__PURE__ */ f("group", { position: [0, 0, -1], children: s ? /* @__PURE__ */ N(q, { children: [
128
- /* @__PURE__ */ N("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
129
- /* @__PURE__ */ f("planeGeometry", { args: m }),
130
- /* @__PURE__ */ f(
129
+ const d = a, A = (d.position.z || 5) - -1, h = d.fov * Math.PI / 180, g = 2 * Math.tan(h / 2) * A;
130
+ return [g * (i.width / i.height), g];
131
+ }, [a, i]);
132
+ return o ? /* @__PURE__ */ M("group", { position: [0, 0, -1], children: t ? /* @__PURE__ */ L(ae, { children: [
133
+ /* @__PURE__ */ L("mesh", { position: [0, 0, -0.01], renderOrder: n - 1, children: [
134
+ /* @__PURE__ */ M("planeGeometry", { args: m }),
135
+ /* @__PURE__ */ M(
131
136
  "meshBasicMaterial",
132
137
  {
133
- map: c,
138
+ map: o,
134
139
  depthTest: !1,
135
140
  depthWrite: !1,
136
141
  toneMapped: !1,
137
- side: k
142
+ side: se
138
143
  }
139
144
  )
140
145
  ] }),
141
- r && d && /* @__PURE__ */ N("mesh", { position: [0, 0, 0], renderOrder: a, children: [
142
- /* @__PURE__ */ f("planeGeometry", { args: m }),
143
- /* @__PURE__ */ f(
146
+ r && u && /* @__PURE__ */ L("mesh", { position: [0, 0, 0], renderOrder: n, children: [
147
+ /* @__PURE__ */ M("planeGeometry", { args: m }),
148
+ /* @__PURE__ */ M(
144
149
  "meshBasicMaterial",
145
150
  {
146
151
  map: typeof r == "string" ? void 0 : r,
147
152
  color: typeof r == "string" ? r : void 0,
148
- alphaMap: d,
153
+ alphaMap: u,
149
154
  transparent: !1,
150
155
  alphaTest: 0.5,
151
156
  depthTest: !1,
152
157
  depthWrite: !1,
153
158
  toneMapped: !1,
154
- side: k
159
+ side: se
155
160
  },
156
161
  "inverted-mask"
157
162
  )
158
163
  ] })
159
- ] }) : /* @__PURE__ */ N(q, { children: [
160
- r && d && /* @__PURE__ */ N("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
161
- /* @__PURE__ */ f("planeGeometry", { args: m }),
162
- /* @__PURE__ */ f(
164
+ ] }) : /* @__PURE__ */ L(ae, { children: [
165
+ r && u && /* @__PURE__ */ L("mesh", { position: [0, 0, -0.01], renderOrder: n - 1, children: [
166
+ /* @__PURE__ */ M("planeGeometry", { args: m }),
167
+ /* @__PURE__ */ M(
163
168
  "meshBasicMaterial",
164
169
  {
165
170
  map: typeof r == "string" ? void 0 : r,
@@ -167,38 +172,90 @@ const tt = ({
167
172
  depthTest: !1,
168
173
  depthWrite: !1,
169
174
  toneMapped: !1,
170
- side: k
175
+ side: se
171
176
  }
172
177
  )
173
178
  ] }),
174
- /* @__PURE__ */ N("mesh", { position: [0, 0, 0], renderOrder: a, children: [
175
- /* @__PURE__ */ f("planeGeometry", { args: m }),
176
- /* @__PURE__ */ f(
179
+ /* @__PURE__ */ L("mesh", { position: [0, 0, 0], renderOrder: n, children: [
180
+ /* @__PURE__ */ M("planeGeometry", { args: m }),
181
+ /* @__PURE__ */ M(
177
182
  "meshBasicMaterial",
178
183
  {
179
- map: c,
180
- alphaMap: d,
184
+ map: o,
185
+ alphaMap: u,
181
186
  transparent: !1,
182
- alphaTest: d ? 0.5 : void 0,
187
+ alphaTest: u ? 0.5 : void 0,
183
188
  depthTest: !1,
184
189
  depthWrite: !1,
185
190
  toneMapped: !1,
186
- side: k
191
+ side: se
187
192
  },
188
- d ? "with-mask" : "no-mask"
193
+ u ? "with-mask" : "no-mask"
189
194
  )
190
195
  ] })
191
196
  ] }) }) : null;
192
- }, V = 9, H = 16, st = ({ children: t }) => {
193
- const [e, s] = F({ width: 0, height: 0 });
194
- return U(() => {
197
+ }, xt = { left: -1, right: 1, top: 1, bottom: -1 }, Ut = ({
198
+ ready: s,
199
+ error: e,
200
+ hasMask: t
201
+ }) => e ? "error" : s && t ? "ready" : "loading", Pt = (s, e) => s === "ready" || e === "camera", Nt = (s = !0) => {
202
+ const { ready: e, error: t } = Tt(
203
+ C.BACKGROUND_SEGMENTATION,
204
+ { type: "portrait" },
205
+ s
206
+ ), r = Ne(C.BACKGROUND_SEGMENTATION), [n, a] = k(null);
207
+ return Ue(() => {
208
+ const i = (r == null ? void 0 : r.backgroundSegmentationMask) ?? null;
209
+ i !== n && a(i);
210
+ }), {
211
+ texture: n,
212
+ status: Ut({ ready: e, error: t, hasMask: !!n }),
213
+ error: t
214
+ };
215
+ }, Ps = ({
216
+ invert: s = !1,
217
+ fallback: e = "camera",
218
+ active: t = !0,
219
+ onStatusChange: r,
220
+ fit: n = "cover",
221
+ anchors: a = xt,
222
+ renderOrder: i = 100,
223
+ visible: o = !0,
224
+ maskFeather: c = 4,
225
+ maskErode: l = 0.7,
226
+ ...p
227
+ }) => {
228
+ const u = Pe(), { texture: m, status: d, error: f } = Nt(t);
229
+ if (x(() => {
230
+ r == null || r(d, f);
231
+ }, [d, f, r]), !u) return null;
232
+ const y = d === "ready" && m;
233
+ return !y && !Pt(d, e) ? null : /* @__PURE__ */ M(
234
+ it,
235
+ {
236
+ ...p,
237
+ source: { kind: "texture", texture: u },
238
+ fit: n,
239
+ anchors: a,
240
+ renderOrder: i,
241
+ visible: o,
242
+ maskTexture: y ? m : null,
243
+ maskChannel: "green",
244
+ maskInvert: s,
245
+ maskFeather: c,
246
+ maskErode: l
247
+ }
248
+ );
249
+ }, oe = 9, ce = 16, Ns = ({ children: s }) => {
250
+ const [e, t] = k({ width: 0, height: 0 });
251
+ return x(() => {
195
252
  const r = () => {
196
- const a = document.documentElement.clientWidth, i = document.documentElement.clientHeight, o = a / i, c = V / H;
197
- let n, u;
198
- o > c ? (u = i, n = u * V / H) : (n = a, u = n * H / V), s({ width: n, height: u });
253
+ const n = document.documentElement.clientWidth, a = document.documentElement.clientHeight, i = n / a, o = oe / ce;
254
+ let c, l;
255
+ i > o ? (l = a, c = l * oe / ce) : (c = n, l = c * ce / oe), t({ width: c, height: l });
199
256
  };
200
257
  return r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
201
- }, []), /* @__PURE__ */ f(
258
+ }, []), /* @__PURE__ */ M(
202
259
  "div",
203
260
  {
204
261
  style: {
@@ -209,38 +266,38 @@ const tt = ({
209
266
  justifyContent: "center",
210
267
  backgroundColor: "#0d0d0d"
211
268
  },
212
- children: /* @__PURE__ */ f("div", { style: { width: e.width, height: e.height, position: "relative" }, children: t })
269
+ children: /* @__PURE__ */ M("div", { style: { width: e.width, height: e.height, position: "relative" }, children: s })
213
270
  }
214
271
  );
215
- }, rt = ({ size: t = 0.25, ...e }) => /* @__PURE__ */ f("axesHelper", { args: [t], ...e }), ve = { left: -1, right: 1, top: 1, bottom: -1 }, Ce = (t, e, s) => {
216
- const r = t % e, a = Math.floor(t / e);
217
- return { x: r / e, y: (s - 1 - a) / s };
218
- }, Pe = ({
219
- sheet: t,
272
+ }, Ds = ({ size: s = 0.25, ...e }) => /* @__PURE__ */ M("axesHelper", { args: [s], ...e }), Dt = { left: -1, right: 1, top: 1, bottom: -1 }, It = (s, e, t) => {
273
+ const r = s % e, n = Math.floor(s / e);
274
+ return { x: r / e, y: (t - 1 - n) / t };
275
+ }, Lt = ({
276
+ sheet: s,
220
277
  contentAspect: e,
221
- renderOrder: s,
278
+ renderOrder: t,
222
279
  name: r
223
280
  }) => {
224
- const a = ye(t.url), i = x(0), o = x(-1), c = ge(), [n, u] = e != null ? ce(c, e) : [1, 1];
225
- return Se((S, d) => {
226
- a.wrapS = Y, a.wrapT = Y, a.magFilter = Z, a.minFilter = Z, a.generateMipmaps = !1, a.repeat.set(1 / t.cols, 1 / t.rows), i.current += d;
227
- const m = Math.floor(i.current * t.fps) % t.frames;
228
- if (m === o.current) return;
229
- o.current = m;
230
- const { x: h, y: l } = Ce(m, t.cols, t.rows);
231
- a.offset.set(h, l);
232
- }), /* @__PURE__ */ N("mesh", { name: r, renderOrder: s, scale: [n, u, 1], children: [
233
- /* @__PURE__ */ f("planeGeometry", { args: [1, 1] }),
234
- /* @__PURE__ */ f("meshBasicMaterial", { map: a, transparent: !0, toneMapped: !1, depthWrite: !1 })
281
+ const n = At(s.url), a = w(0), i = w(-1), o = Rt(), [c, l] = e != null ? ot(o, e) : [1, 1];
282
+ return Ue((p, u) => {
283
+ n.wrapS = be, n.wrapT = be, n.magFilter = Te, n.minFilter = Te, n.generateMipmaps = !1, n.repeat.set(1 / s.cols, 1 / s.rows), a.current += u;
284
+ const m = Math.floor(a.current * s.fps) % s.frames;
285
+ if (m === i.current) return;
286
+ i.current = m;
287
+ const { x: d, y: f } = It(m, s.cols, s.rows);
288
+ n.offset.set(d, f);
289
+ }), /* @__PURE__ */ L("mesh", { name: r, renderOrder: t, scale: [c, l, 1], children: [
290
+ /* @__PURE__ */ M("planeGeometry", { args: [1, 1] }),
291
+ /* @__PURE__ */ M("meshBasicMaterial", { map: n, transparent: !0, toneMapped: !1, depthWrite: !1 })
235
292
  ] });
236
- }, at = ({
237
- sheet: t,
238
- anchors: e = ve,
239
- contentAspect: s,
293
+ }, Is = ({
294
+ sheet: s,
295
+ anchors: e = Dt,
296
+ contentAspect: t,
240
297
  renderOrder: r = 10,
241
- name: a = "spriteAnimation"
242
- }) => /* @__PURE__ */ f(ue, { fallback: null, children: /* @__PURE__ */ f(ie, { anchors: e, children: /* @__PURE__ */ f(Pe, { sheet: t, contentAspect: s, renderOrder: r, name: a }) }) }), D = (t) => {
243
- switch (t) {
298
+ name: n = "spriteAnimation"
299
+ }) => /* @__PURE__ */ M(ct, { fallback: null, children: /* @__PURE__ */ M(nt, { anchors: e, children: /* @__PURE__ */ M(Lt, { sheet: s, contentAspect: t, renderOrder: r, name: n }) }) }), q = (s) => {
300
+ switch (s) {
244
301
  case "start":
245
302
  return "starting";
246
303
  case "started":
@@ -257,227 +314,227 @@ const tt = ({
257
314
  case "clear":
258
315
  return "idle";
259
316
  }
260
- }, Le = [
317
+ }, Ot = [
261
318
  "video/mp4",
262
319
  "video/webm;codecs=vp9",
263
320
  "video/webm;codecs=vp8",
264
321
  "video/webm"
265
322
  ];
266
- function nt(t = {}) {
323
+ function Ls(s = {}) {
267
324
  const {
268
325
  audio: e = !1,
269
- mimeType: s,
326
+ mimeType: t,
270
327
  bitsPerSecond: r,
271
- onData: a,
272
- onStop: i,
273
- onRecordingStart: o,
274
- onRecordingPause: c,
275
- onRecordingResume: n,
276
- onRecordingStop: u,
277
- onRecordingComplete: S,
278
- onError: d,
328
+ onData: n,
329
+ onStop: a,
330
+ onRecordingStart: i,
331
+ onRecordingPause: o,
332
+ onRecordingResume: c,
333
+ onRecordingStop: l,
334
+ onRecordingComplete: p,
335
+ onError: u,
279
336
  passThroughStream: m
280
- } = t, h = x(null), l = x(null), T = x([]), [g, E] = F("idle"), [_, P] = F(null), [W, R] = F(null), L = w(() => {
281
- var y;
282
- const p = [s, ...Le].filter(Boolean);
283
- for (const M of p)
284
- if ((y = MediaRecorder.isTypeSupported) != null && y.call(MediaRecorder, M)) return M;
285
- }, [s]), O = w(
286
- async (p) => {
287
- const y = new MediaStream();
288
- if (p.getTracks().forEach((M) => y.addTrack(M)), e) {
289
- let M;
337
+ } = s, d = w(null), f = w(null), y = w([]), [A, h] = k("idle"), [g, R] = k(null), [W, v] = k(null), U = E(() => {
338
+ var F;
339
+ const S = [t, ...Ot].filter(Boolean);
340
+ for (const b of S)
341
+ if ((F = MediaRecorder.isTypeSupported) != null && F.call(MediaRecorder, b)) return b;
342
+ }, [t]), G = E(
343
+ async (S) => {
344
+ const F = new MediaStream();
345
+ if (S.getTracks().forEach((b) => F.addTrack(b)), e) {
346
+ let b;
290
347
  if (e instanceof MediaStream)
291
- M = e;
348
+ b = e;
292
349
  else {
293
- const v = typeof e == "object" ? { audio: e } : { audio: !0, video: !1 };
294
- M = await navigator.mediaDevices.getUserMedia(v);
350
+ const _ = typeof e == "object" ? { audio: e } : { audio: !0, video: !1 };
351
+ b = await navigator.mediaDevices.getUserMedia(_);
295
352
  }
296
- M.getAudioTracks().forEach((v) => y.addTrack(v));
353
+ b.getAudioTracks().forEach((_) => F.addTrack(_));
297
354
  }
298
- if (!y.getTracks().length)
355
+ if (!F.getTracks().length)
299
356
  throw new Error("No tracks available in combined stream.");
300
- return l.current = y, y;
357
+ return f.current = F, F;
301
358
  },
302
359
  [e]
303
- ), Q = w(
304
- async (p, y) => {
305
- E(D("start")), R(null), P(null);
360
+ ), Z = E(
361
+ async (S, F) => {
362
+ h(q("start")), v(null), R(null);
306
363
  try {
307
- let M;
364
+ let b;
308
365
  if (m)
309
- M = m, l.current = M;
366
+ b = m, f.current = b;
310
367
  else {
311
- if (!p) throw new Error("start(stream) requires a MediaStream.");
312
- M = await O(p);
368
+ if (!S) throw new Error("start(stream) requires a MediaStream.");
369
+ b = await G(S);
313
370
  }
314
- const v = L(), X = {};
315
- v && (X.mimeType = v), r && (X.bitsPerSecond = r);
316
- const G = new MediaRecorder(M, X);
317
- G.ondataavailable = (b) => {
371
+ const _ = U(), H = {};
372
+ _ && (H.mimeType = _), r && (H.bitsPerSecond = r);
373
+ const X = new MediaRecorder(b, H);
374
+ X.ondataavailable = (D) => {
318
375
  var j;
319
- ((j = b.data) == null ? void 0 : j.size) > 0 && (T.current.push(b.data), a == null || a(b.data));
320
- }, G.onstop = () => {
321
- const b = new Blob(T.current, {
322
- type: v ?? "video/webm"
376
+ ((j = D.data) == null ? void 0 : j.size) > 0 && (y.current.push(D.data), n == null || n(D.data));
377
+ }, X.onstop = () => {
378
+ const D = new Blob(y.current, {
379
+ type: _ ?? "video/webm"
323
380
  });
324
- P(b), i == null || i(b), S == null || S(b), T.current = [], E(D("complete"));
325
- }, h.current = G, G.start(y), E(D("started")), o == null || o();
326
- } catch (M) {
327
- const v = M instanceof Error ? M : new Error(String(M));
328
- console.error("start(stream) failed", v), R(v), E(D("fail")), d == null || d(v);
381
+ R(D), a == null || a(D), p == null || p(D), y.current = [], h(q("complete"));
382
+ }, d.current = X, X.start(F), h(q("started")), i == null || i();
383
+ } catch (b) {
384
+ const _ = b instanceof Error ? b : new Error(String(b));
385
+ console.error("start(stream) failed", _), v(_), h(q("fail")), u == null || u(_);
329
386
  }
330
387
  },
331
388
  [
332
- O,
333
- L,
389
+ G,
390
+ U,
334
391
  r,
392
+ n,
335
393
  a,
394
+ p,
336
395
  i,
337
- S,
338
- o,
339
- d,
396
+ u,
340
397
  m
341
398
  ]
342
- ), ee = w(() => {
343
- const p = h.current;
344
- !p || p.state === "inactive" || (E(D("stop")), p.stop(), u == null || u());
345
- }, [u]), te = w(() => {
346
- const p = h.current;
347
- (p == null ? void 0 : p.state) === "recording" && (p.pause(), E(D("pause")), c == null || c());
348
- }, [c]), se = w(() => {
349
- const p = h.current;
350
- (p == null ? void 0 : p.state) === "paused" && (p.resume(), E(D("resume")), n == null || n());
351
- }, [n]), B = w(() => {
352
- var p;
399
+ ), J = E(() => {
400
+ const S = d.current;
401
+ !S || S.state === "inactive" || (h(q("stop")), S.stop(), l == null || l());
402
+ }, [l]), ee = E(() => {
403
+ const S = d.current;
404
+ (S == null ? void 0 : S.state) === "recording" && (S.pause(), h(q("pause")), o == null || o());
405
+ }, [o]), te = E(() => {
406
+ const S = d.current;
407
+ (S == null ? void 0 : S.state) === "paused" && (S.resume(), h(q("resume")), c == null || c());
408
+ }, [c]), V = E(() => {
409
+ var S;
353
410
  try {
354
- h.current && (h.current.onstop = null, h.current.state !== "inactive" && h.current.stop()), h.current = null, (p = l.current) == null || p.getTracks().forEach((y) => y.stop()), l.current = null, P(null), E(D("clear")), T.current = [], R(null);
355
- } catch (y) {
356
- console.error("clear failed", y);
411
+ d.current && (d.current.onstop = null, d.current.state !== "inactive" && d.current.stop()), d.current = null, (S = f.current) == null || S.getTracks().forEach((F) => F.stop()), f.current = null, R(null), h(q("clear")), y.current = [], v(null);
412
+ } catch (F) {
413
+ console.error("clear failed", F);
357
414
  }
358
415
  }, []);
359
- return U(() => () => B(), []), {
360
- status: g,
361
- start: Q,
362
- stop: ee,
363
- pause: te,
364
- resume: se,
365
- clear: B,
366
- isRecording: g === "recording" || g === "paused",
367
- isPaused: g === "paused",
368
- recordedBlob: _,
416
+ return x(() => () => V(), []), {
417
+ status: A,
418
+ start: Z,
419
+ stop: J,
420
+ pause: ee,
421
+ resume: te,
422
+ clear: V,
423
+ isRecording: A === "recording" || A === "paused",
424
+ isPaused: A === "paused",
425
+ recordedBlob: g,
369
426
  error: W,
370
- getActiveStream: () => l.current
427
+ getActiveStream: () => f.current
371
428
  };
372
429
  }
373
- const Ue = async (t, e = {}) => {
374
- var s, r, a;
375
- (s = e.onCaptureStart) == null || s.call(e), await Promise.resolve();
430
+ const Gt = async (s, e = {}) => {
431
+ var t, r, n;
432
+ (t = e.onCaptureStart) == null || t.call(e), await Promise.resolve();
376
433
  try {
377
- const i = t();
378
- return (r = e.onCaptureComplete) == null || r.call(e, i), i;
379
- } catch (i) {
380
- const o = i instanceof Error ? i : new Error(String(i));
381
- throw (a = e.onError) == null || a.call(e, o), o;
382
- }
383
- }, ot = (t = {}) => {
384
- const { session: e } = oe(), {
385
- captureFrame: s = e.captureFrame,
434
+ const a = s();
435
+ return (r = e.onCaptureComplete) == null || r.call(e, a), a;
436
+ } catch (a) {
437
+ const i = a instanceof Error ? a : new Error(String(a));
438
+ throw (n = e.onError) == null || n.call(e, i), i;
439
+ }
440
+ }, Os = (s = {}) => {
441
+ const { session: e } = xe(), {
442
+ captureFrame: t = e.captureFrame,
386
443
  onCaptureStart: r,
387
- onCaptureComplete: a,
388
- onError: i
389
- } = t, [o, c] = F("idle"), [n, u] = F(null), [S, d] = F(null), m = w(async () => {
390
- c("capturing"), u(null), d(null);
444
+ onCaptureComplete: n,
445
+ onError: a
446
+ } = s, [i, o] = k("idle"), [c, l] = k(null), [p, u] = k(null), m = E(async () => {
447
+ o("capturing"), l(null), u(null);
391
448
  try {
392
- const l = await Ue(s, {
449
+ const f = await Gt(t, {
393
450
  onCaptureStart: r,
394
- onCaptureComplete: a,
395
- onError: i
451
+ onCaptureComplete: n,
452
+ onError: a
396
453
  });
397
- return u(l), c("completed"), l;
398
- } catch (l) {
399
- const T = l instanceof Error ? l : new Error(String(l));
400
- return d(T), c("error"), null;
454
+ return l(f), o("completed"), f;
455
+ } catch (f) {
456
+ const y = f instanceof Error ? f : new Error(String(f));
457
+ return u(y), o("error"), null;
401
458
  }
402
- }, [s, r, a, i]), h = w(() => {
403
- c("idle"), u(null), d(null);
459
+ }, [t, r, n, a]), d = E(() => {
460
+ o("idle"), l(null), u(null);
404
461
  }, []);
405
- return { status: o, capturePhoto: m, clear: h, dataUrl: n, error: S };
406
- }, it = (t, e) => {
407
- const s = t.split(","), r = s[0].match(/:(.*?);/), a = r ? r[1] : "application/octet-stream", i = atob(s[s.length - 1]);
408
- let o = i.length;
409
- const c = new Uint8Array(o);
410
- for (; o--; )
411
- c[o] = i.charCodeAt(o);
412
- return new File([c], e, { type: a });
413
- }, De = 4, Ne = 50, Fe = 5e3, z = (t) => Math.min(1, Math.max(0, t)), K = (t) => new Promise((e) => {
414
- if (t.readyState >= 4) {
462
+ return { status: i, capturePhoto: m, clear: d, dataUrl: c, error: p };
463
+ }, Gs = (s, e) => {
464
+ const t = s.split(","), r = t[0].match(/:(.*?);/), n = r ? r[1] : "application/octet-stream", a = atob(t[t.length - 1]);
465
+ let i = a.length;
466
+ const o = new Uint8Array(i);
467
+ for (; i--; )
468
+ o[i] = a.charCodeAt(i);
469
+ return new File([o], e, { type: n });
470
+ }, qt = 4, Bt = 50, $t = 5e3, re = (s) => Math.min(1, Math.max(0, s)), Ae = (s) => new Promise((e) => {
471
+ if (s.readyState >= 4) {
415
472
  e();
416
473
  return;
417
474
  }
418
- let s = !1;
475
+ let t = !1;
419
476
  const r = () => {
420
- s || (s = !0, e());
477
+ t || (t = !0, e());
421
478
  };
422
- t.addEventListener("canplaythrough", r, { once: !0 }), t.addEventListener("error", r, { once: !0 }), setTimeout(r, Fe);
423
- }), $ = (t, e) => {
424
- const s = document.createElement("audio");
425
- return s.src = t, s.loop = e, s.preload = "auto", s.setAttribute("playsinline", ""), s.setAttribute("webkit-playsinline", ""), s.load(), s;
426
- }, be = (t) => {
427
- t.muted = !0, t.play().then(() => {
428
- t.pause(), t.currentTime = 0, t.muted = !1;
479
+ s.addEventListener("canplaythrough", r, { once: !0 }), s.addEventListener("error", r, { once: !0 }), setTimeout(r, $t);
480
+ }), Re = (s, e) => {
481
+ const t = document.createElement("audio");
482
+ return t.src = s, t.loop = e, t.preload = "auto", t.setAttribute("playsinline", ""), t.setAttribute("webkit-playsinline", ""), t.load(), t;
483
+ }, zt = (s) => {
484
+ s.muted = !0, s.play().then(() => {
485
+ s.pause(), s.currentTime = 0, s.muted = !1;
429
486
  }).catch(() => {
430
- t.muted = !1;
487
+ s.muted = !1;
431
488
  });
432
489
  };
433
- class Oe {
490
+ class Xt {
434
491
  constructor(e = {}) {
435
- A(this, "sfxPoolSize");
436
- A(this, "coalesceMs");
437
- A(this, "muted", !0);
438
- A(this, "listeners", /* @__PURE__ */ new Set());
439
- A(this, "music", null);
440
- A(this, "musicUrl", null);
441
- A(this, "musicReady", null);
442
- A(this, "musicWanted", null);
443
- A(this, "pools", /* @__PURE__ */ new Map());
492
+ T(this, "sfxPoolSize");
493
+ T(this, "coalesceMs");
494
+ T(this, "muted", !0);
495
+ T(this, "listeners", /* @__PURE__ */ new Set());
496
+ T(this, "music", null);
497
+ T(this, "musicUrl", null);
498
+ T(this, "musicReady", null);
499
+ T(this, "musicWanted", null);
500
+ T(this, "pools", /* @__PURE__ */ new Map());
444
501
  /** Last play time per SFX URL, for the coalesce window. */
445
- A(this, "lastPlayed", /* @__PURE__ */ new Map());
502
+ T(this, "lastPlayed", /* @__PURE__ */ new Map());
446
503
  /** Readiness promises so a loading gate can await decode/buffer. */
447
- A(this, "ready", /* @__PURE__ */ new Map());
448
- this.sfxPoolSize = e.sfxPoolSize ?? De, this.coalesceMs = e.coalesceMs ?? Ne;
504
+ T(this, "ready", /* @__PURE__ */ new Map());
505
+ this.sfxPoolSize = e.sfxPoolSize ?? qt, this.coalesceMs = e.coalesceMs ?? Bt;
449
506
  }
450
507
  /**
451
508
  * Create + buffer the looping music element. Await in the loading gate so the
452
509
  * unmute tap is instant. Idempotent per URL (re-requesting the same track is
453
510
  * a no-op that returns the in-flight promise).
454
511
  */
455
- prefetchMusic(e, s = 0.4) {
456
- const r = z(s);
512
+ prefetchMusic(e, t = 0.4) {
513
+ const r = re(t);
457
514
  if (this.musicWanted = { url: e, volume: r }, this.musicUrl === e && this.musicReady)
458
515
  return this.music && (this.music.volume = r), this.musicReady;
459
- this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = $(e, !0), this.musicUrl = e, this.music.volume = r;
460
- const a = K(this.music);
461
- return this.musicReady = a, a;
516
+ this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = Re(e, !0), this.musicUrl = e, this.music.volume = r;
517
+ const n = Ae(this.music);
518
+ return this.musicReady = n, n;
462
519
  }
463
520
  /**
464
521
  * Create + buffer an SFX voice pool (round-robin so overlapping plays don't
465
522
  * cut each other off). Returns a promise that resolves when the first element
466
523
  * buffers. Idempotent per URL.
467
524
  */
468
- registerSound(e, s = 1) {
525
+ registerSound(e, t = 1) {
469
526
  const r = this.ready.get(e);
470
527
  if (r) return r;
471
- const a = z(s), i = [];
472
- for (let c = 0; c < this.sfxPoolSize; c += 1) {
473
- const n = $(e, !1);
474
- n.volume = a, n.addEventListener("ended", () => {
475
- n.currentTime = 0;
476
- }), i.push(n);
528
+ const n = re(t), a = [];
529
+ for (let o = 0; o < this.sfxPoolSize; o += 1) {
530
+ const c = Re(e, !1);
531
+ c.volume = n, c.addEventListener("ended", () => {
532
+ c.currentTime = 0;
533
+ }), a.push(c);
477
534
  }
478
- this.pools.set(e, { els: i, next: 0, volume: a });
479
- const o = K(i[0]);
480
- return this.ready.set(e, o), o;
535
+ this.pools.set(e, { els: a, next: 0, volume: n });
536
+ const i = Ae(a[0]);
537
+ return this.ready.set(e, i), i;
481
538
  }
482
539
  /** Subscribe to mute-state changes (for a toggle UI). Fires immediately with
483
540
  * the current state. Returns an unsubscribe. */
@@ -494,7 +551,7 @@ class Oe {
494
551
  * then start the music. All elements are already buffered, so this is instant.
495
552
  */
496
553
  setMuted(e) {
497
- e !== this.muted && (this.muted = e, this.muted || this.pools.forEach((s) => s.els.forEach(be)), this.applyMusic(), this.listeners.forEach((s) => s(this.muted)));
554
+ e !== this.muted && (this.muted = e, this.muted || this.pools.forEach((t) => t.els.forEach(zt)), this.applyMusic(), this.listeners.forEach((t) => t(this.muted)));
498
555
  }
499
556
  toggleMuted() {
500
557
  this.setMuted(!this.muted);
@@ -505,29 +562,29 @@ class Oe {
505
562
  * same sound into one play, and does NO synchronous `currentTime` seek on a
506
563
  * ready element (the pool rewinds on `ended`, off the hot path).
507
564
  */
508
- playOneShot(e, s) {
565
+ playOneShot(e, t) {
509
566
  if (this.muted) return;
510
567
  const r = this.pools.get(e);
511
568
  if (!r) return;
512
- const a = performance.now();
513
- if (a - (this.lastPlayed.get(e) ?? -1 / 0) < this.coalesceMs) return;
514
- this.lastPlayed.set(e, a);
515
- const i = r.els.length;
516
- let o;
517
- for (let c = 0; c < i; c += 1) {
518
- const n = r.els[(r.next + c) % i];
519
- if (n.paused) {
520
- o = n, r.next = (r.next + c + 1) % i;
569
+ const n = performance.now();
570
+ if (n - (this.lastPlayed.get(e) ?? -1 / 0) < this.coalesceMs) return;
571
+ this.lastPlayed.set(e, n);
572
+ const a = r.els.length;
573
+ let i;
574
+ for (let o = 0; o < a; o += 1) {
575
+ const c = r.els[(r.next + o) % a];
576
+ if (c.paused) {
577
+ i = c, r.next = (r.next + o + 1) % a;
521
578
  break;
522
579
  }
523
580
  }
524
- o || (o = r.els[r.next], r.next = (r.next + 1) % i), o.muted = !1, o.volume = z(s ?? r.volume), o.currentTime !== 0 && (o.currentTime = 0), o.play().catch(() => {
581
+ i || (i = r.els[r.next], r.next = (r.next + 1) % a), i.muted = !1, i.volume = re(t ?? r.volume), i.currentTime !== 0 && (i.currentTime = 0), i.play().catch(() => {
525
582
  });
526
583
  }
527
584
  /** Request the looping background track (buffer it with prefetchMusic, which
528
585
  * a loading gate awaits). Remembered while muted; starts on unmute. */
529
- startMusic(e, s = 0.4) {
530
- const r = z(s);
586
+ startMusic(e, t = 0.4) {
587
+ const r = re(t);
531
588
  this.musicUrl !== e && this.prefetchMusic(e, r), this.musicWanted = { url: e, volume: r }, this.applyMusic();
532
589
  }
533
590
  stopMusic() {
@@ -538,179 +595,1176 @@ class Oe {
538
595
  }), this.muted && !this.music.paused && this.music.pause());
539
596
  }
540
597
  }
541
- const Ie = (t, e, s) => t === "infinite" || t === "loop" && e < Math.max(1, Math.floor(s)) ? "replay" : "ended", Ge = (t, e, s) => t && e !== s, ke = (t) => Math.min(100, Math.max(0, t)) / 100, ct = le(function({
598
+ const Kt = (s, e, t) => s === "infinite" || s === "loop" && e < Math.max(1, Math.floor(t)) ? "replay" : "ended", Wt = (s, e, t) => s && e !== t, Ht = (s) => Math.min(100, Math.max(0, s)) / 100, qs = lt(function({
542
599
  src: e,
543
- playMode: s = "once",
600
+ playMode: t = "once",
544
601
  loopCount: r = 1,
545
- autoplay: a = !1,
546
- muted: i = !1,
547
- volume: o = 100,
548
- preload: c = "auto",
549
- onReady: n,
550
- onPlay: u,
551
- onPause: S,
552
- onEnded: d,
602
+ autoplay: n = !1,
603
+ muted: a = !1,
604
+ volume: i = 100,
605
+ preload: o = "auto",
606
+ onReady: c,
607
+ onPlay: l,
608
+ onPause: p,
609
+ onEnded: u,
553
610
  onError: m
554
- }, h) {
555
- const l = x(null), T = x(0), g = x(null), E = w(async () => {
556
- const R = l.current;
557
- if (R)
611
+ }, d) {
612
+ const f = w(null), y = w(0), A = w(null), h = E(async () => {
613
+ const v = f.current;
614
+ if (v)
558
615
  try {
559
- await R.play();
560
- } catch (L) {
561
- const O = L instanceof Error ? L : new Error(String(L));
562
- throw m == null || m(O), O;
616
+ await v.play();
617
+ } catch (U) {
618
+ const G = U instanceof Error ? U : new Error(String(U));
619
+ throw m == null || m(G), G;
563
620
  }
564
- }, [m]), _ = w(() => {
565
- var R;
566
- return (R = l.current) == null ? void 0 : R.pause();
567
- }, []), P = w(() => {
568
- const R = l.current;
569
- R && (R.pause(), R.currentTime = 0, T.current = 0);
621
+ }, [m]), g = E(() => {
622
+ var v;
623
+ return (v = f.current) == null ? void 0 : v.pause();
624
+ }, []), R = E(() => {
625
+ const v = f.current;
626
+ v && (v.pause(), v.currentTime = 0, y.current = 0);
570
627
  }, []);
571
- de(
572
- h,
628
+ ut(
629
+ d,
573
630
  () => ({
574
- play: E,
575
- pause: _,
576
- stop: P,
631
+ play: h,
632
+ pause: g,
633
+ stop: R,
577
634
  get current() {
578
- return l.current;
635
+ return f.current;
579
636
  }
580
637
  }),
581
- [_, E, P]
582
- ), U(() => {
583
- T.current = 0, g.current = null;
584
- }, [e]), U(() => {
585
- l.current && (l.current.volume = ke(o));
586
- }, [o]), U(() => {
587
- Ge(a, g.current, e) && (g.current = e, E().catch(() => {
638
+ [g, h, R]
639
+ ), x(() => {
640
+ y.current = 0, A.current = null;
641
+ }, [e]), x(() => {
642
+ f.current && (f.current.volume = Ht(i));
643
+ }, [i]), x(() => {
644
+ Wt(n, A.current, e) && (A.current = e, h().catch(() => {
588
645
  }));
589
- }, [a, e]);
590
- const W = w(() => {
591
- T.current += 1;
592
- const R = Math.max(1, Math.floor(r));
593
- if (Ie(s, T.current, R) === "replay") {
594
- const L = l.current;
595
- L && (L.currentTime = 0, E().catch(() => {
646
+ }, [n, e]);
647
+ const W = E(() => {
648
+ y.current += 1;
649
+ const v = Math.max(1, Math.floor(r));
650
+ if (Kt(t, y.current, v) === "replay") {
651
+ const U = f.current;
652
+ U && (U.currentTime = 0, h().catch(() => {
596
653
  }));
597
654
  return;
598
655
  }
599
- T.current = 0, d == null || d();
600
- }, [r, d, E, s]);
601
- return /* @__PURE__ */ f(
656
+ y.current = 0, u == null || u();
657
+ }, [r, u, h, t]);
658
+ return /* @__PURE__ */ M(
602
659
  "audio",
603
660
  {
604
- ref: l,
661
+ ref: f,
605
662
  src: e,
606
- preload: c,
663
+ preload: o,
607
664
  autoPlay: !1,
608
- muted: i,
665
+ muted: a,
609
666
  loop: !1,
610
667
  playsInline: !0,
611
668
  style: { display: "none" },
612
- onCanPlayThrough: n,
613
- onPlay: u,
614
- onPause: S,
669
+ onCanPlayThrough: c,
670
+ onPlay: l,
671
+ onPause: p,
615
672
  onEnded: W,
616
673
  onError: () => m == null ? void 0 : m(new Error(`Unable to load audio: ${e}`))
617
674
  }
618
675
  );
619
- }), C = new Oe(), ut = (t, e) => C.prefetchMusic(t, e), lt = (t, e) => C.registerSound(t, e), dt = (t, e) => C.startMusic(t, e), mt = () => C.stopMusic(), pt = (t, e) => C.playOneShot(t, e), ht = (t) => C.setMuted(t), ft = () => C.toggleMuted(), Et = () => C.isMuted(), St = (t) => C.onMuteChange(t), Tt = () => {
620
- const [t, e] = F(C.isMuted());
621
- return U(() => C.onMuteChange(e), []), t;
676
+ }), N = new Xt(), Bs = (s, e) => N.prefetchMusic(s, e), $s = (s, e) => N.registerSound(s, e), zs = (s, e) => N.startMusic(s, e), Xs = () => N.stopMusic(), Ks = (s, e) => N.playOneShot(s, e), Ws = (s) => N.setMuted(s), Hs = () => N.toggleMuted(), Vs = () => N.isMuted(), js = (s) => N.onMuteChange(s), Ys = () => {
677
+ const [s, e] = k(N.isMuted());
678
+ return x(() => N.onMuteChange(e), []), s;
679
+ }, Vt = (s = {}) => {
680
+ const { auto: e = !1 } = s, t = w(s.env ?? He()), r = w(s.constraints);
681
+ r.current = s.constraints;
682
+ const [n, a] = k("unknown"), [i, o] = k(null), c = w(0), l = E(async () => {
683
+ const u = ++c.current, m = await Ve(t.current);
684
+ if (u !== c.current) return n;
685
+ const d = m.state === "unknown" ? "unknown" : m.state;
686
+ return a((f) => f === "requesting" ? f : d), d !== "blocked" && o(null), d;
687
+ }, []), p = E(
688
+ async (u) => {
689
+ const m = ++c.current;
690
+ a("requesting"), o(null);
691
+ const d = await je(
692
+ { constraints: (u == null ? void 0 : u.constraints) ?? r.current, keepStream: !1 },
693
+ t.current
694
+ );
695
+ return m !== c.current || (a(d.state), o(d.reason)), d.state;
696
+ },
697
+ []
698
+ );
699
+ return x(() => {
700
+ let u = () => {
701
+ }, m = !0;
702
+ return e ? p() : l(), Ye((d) => {
703
+ m && (a((f) => f === "requesting" ? f : d.state === "unknown" ? "unknown" : d.state), d.state !== "blocked" && o(null));
704
+ }, t.current).then((d) => {
705
+ m ? u = d : d();
706
+ }), () => {
707
+ m = !1, c.current += 1, u();
708
+ };
709
+ }, [e, l, p]), K(
710
+ () => ({
711
+ state: n,
712
+ reason: i,
713
+ canPrompt: Qe(n),
714
+ usable: n === "granted",
715
+ request: p,
716
+ refresh: l
717
+ }),
718
+ [n, i, p, l]
719
+ );
720
+ }, jt = {
721
+ display: "flex",
722
+ flexDirection: "column",
723
+ alignItems: "center",
724
+ justifyContent: "center",
725
+ gap: 12,
726
+ height: "100%",
727
+ minHeight: 160,
728
+ padding: 24,
729
+ textAlign: "center",
730
+ background: "#111827",
731
+ color: "#f9fafb",
732
+ fontFamily: "system-ui, sans-serif"
733
+ }, Yt = {
734
+ font: "inherit",
735
+ padding: "10px 18px",
736
+ borderRadius: 8,
737
+ border: "1px solid rgba(255,255,255,0.3)",
738
+ background: "#2563eb",
739
+ color: "#fff",
740
+ cursor: "pointer"
741
+ }, Qs = ({
742
+ children: s,
743
+ fallback: e,
744
+ auto: t = !1,
745
+ constraints: r,
746
+ requestLabel: n = "Allow camera"
747
+ }) => {
748
+ const a = Vt({ auto: t, constraints: r });
749
+ if (a.usable) return /* @__PURE__ */ M(ae, { children: s });
750
+ if (e) return /* @__PURE__ */ M(ae, { children: e(a) });
751
+ const { state: i, reason: o, canPrompt: c, request: l } = a;
752
+ return /* @__PURE__ */ L("div", { style: jt, role: "region", "aria-label": "Camera access", children: [
753
+ /* @__PURE__ */ M("p", { "aria-live": "polite", style: { margin: 0 }, children: (o == null ? void 0 : o.message) ?? Ze[i] }),
754
+ /* @__PURE__ */ M(
755
+ "button",
756
+ {
757
+ type: "button",
758
+ onClick: () => void l(),
759
+ disabled: !c || i === "requesting",
760
+ "aria-disabled": !c || i === "requesting",
761
+ style: { ...Yt, opacity: c && i !== "requesting" ? 1 : 0.5 },
762
+ children: i === "requesting" ? "Waiting…" : i === "denied" ? "Try again" : n
763
+ }
764
+ )
765
+ ] });
766
+ }, Qt = () => {
767
+ var s;
768
+ return {
769
+ enumerateDevices: typeof navigator < "u" && ((s = navigator.mediaDevices) != null && s.enumerateDevices) ? () => navigator.mediaDevices.enumerateDevices() : void 0
770
+ };
771
+ }, Zt = /\b(back|rear|environment|world)\b/i, Jt = /\b(front|user|facetime|selfie)\b/i, es = (s) => Zt.test(s) ? "environment" : Jt.test(s) ? "user" : null, Zs = async (s = Qt()) => {
772
+ if (!s.enumerateDevices) return [];
773
+ try {
774
+ return (await s.enumerateDevices()).filter((t) => t.kind === "videoinput").map((t) => ({
775
+ deviceId: t.deviceId,
776
+ label: t.label,
777
+ facing: es(t.label)
778
+ }));
779
+ } catch {
780
+ return [];
781
+ }
782
+ }, Js = (s, e) => s.find((t) => t.facing === e) ?? null, er = (s) => {
783
+ const { session: e } = xe(), t = Et(), r = bt(), n = JSON.stringify(s ?? null), a = K(
784
+ () => s ? Ee(s) : r ?? Ee(),
785
+ [n, r]
786
+ // eslint-disable-line react-hooks/exhaustive-deps
787
+ ), i = a.tiers, o = E(
788
+ (p) => {
789
+ const u = e.store.getSnapshot().quality;
790
+ u && e._setQuality(Je(u, a, p, performance.now()));
791
+ },
792
+ [e, a]
793
+ ), c = E(
794
+ (p) => {
795
+ const u = e.store.getSnapshot().quality;
796
+ u && e._setQuality(et(u, a, p, performance.now()));
797
+ },
798
+ [e, a]
799
+ ), l = E(() => {
800
+ const p = e.store.getSnapshot().quality;
801
+ e._setQuality(
802
+ tt(a, (p == null ? void 0 : p.signals) ?? st, performance.now())
803
+ );
804
+ }, [e, a]);
805
+ return K(
806
+ () => ({
807
+ tier: (t == null ? void 0 : t.decision.tier) ?? null,
808
+ index: (t == null ? void 0 : t.index) ?? -1,
809
+ tiers: i,
810
+ decision: (t == null ? void 0 : t.decision) ?? null,
811
+ history: (t == null ? void 0 : t.history) ?? [],
812
+ signals: (t == null ? void 0 : t.signals) ?? null,
813
+ locked: (t == null ? void 0 : t.locked) ?? !1,
814
+ setTier: o,
815
+ lock: () => c(!0),
816
+ unlock: () => c(!1),
817
+ reset: l,
818
+ state: t
819
+ }),
820
+ [t, i, o, c, l]
821
+ );
822
+ }, ts = 256 * 1024 * 1024;
823
+ class ss {
824
+ constructor(e = {}) {
825
+ T(this, "entries", /* @__PURE__ */ new Map());
826
+ T(this, "listeners", /* @__PURE__ */ new Set());
827
+ T(this, "budget");
828
+ T(this, "now");
829
+ T(this, "evictions", 0);
830
+ T(this, "hits", 0);
831
+ T(this, "misses", 0);
832
+ /** Memoised `getStats()` result; cleared on every change so `useSyncExternalStore` sees a stable snapshot. */
833
+ T(this, "statsSnapshot", null);
834
+ this.budget = e.budgetBytes ?? ts, this.now = e.now ?? (() => typeof performance < "u" ? performance.now() : Date.now());
835
+ }
836
+ /** Acquire `asset` on behalf of `ownerId`; shares an in-flight or loaded value. */
837
+ acquire(e, t) {
838
+ let r = this.entries.get(e.key);
839
+ if (r && r.status === "error" && (this.entries.delete(e.key), r = void 0), !r) {
840
+ this.misses += 1;
841
+ const n = typeof AbortController < "u" ? new AbortController() : null, a = {
842
+ definition: e,
843
+ status: "loading",
844
+ value: void 0,
845
+ bytes: 0,
846
+ owners: /* @__PURE__ */ new Set([t]),
847
+ promise: null,
848
+ controller: n,
849
+ error: null,
850
+ lastUsed: this.now(),
851
+ disposed: !1
852
+ };
853
+ return a.promise = e.load((n == null ? void 0 : n.signal) ?? new AbortController().signal).then((i) => {
854
+ var o, c;
855
+ if (a.disposed || this.entries.get(e.key) !== a)
856
+ throw (o = e.dispose) == null || o.call(e, i), new Error(`Asset "${e.key}" was released before it loaded`);
857
+ return a.value = i, a.bytes = Math.max(0, Math.round(((c = e.bytes) == null ? void 0 : c.call(e, i)) ?? 0)), a.status = "ready", a.promise = null, this.notify(), this.enforceBudget(), i;
858
+ }).catch((i) => {
859
+ const o = i instanceof Error ? i : new Error(String(i));
860
+ throw this.entries.get(e.key) === a && !a.disposed && (a.status = "error", a.error = o, a.promise = null, this.notify()), o;
861
+ }), this.entries.set(e.key, a), this.notify(), a.promise;
862
+ }
863
+ return this.hits += 1, r.owners.add(t), r.lastUsed = this.now(), this.notify(), r.status === "ready" ? Promise.resolve(r.value) : r.promise;
864
+ }
865
+ /** Start loading without holding a reference (warm the cache). */
866
+ preload(e) {
867
+ const t = "__preload__";
868
+ return this.acquire(e, t).finally(() => this.release(e.key, t));
869
+ }
870
+ /** Drop `ownerId`'s reference. The value stays cached until evicted or disposed. */
871
+ release(e, t) {
872
+ var n;
873
+ const r = this.entries.get(e);
874
+ !r || !r.owners.delete(t) || (r.lastUsed = this.now(), r.owners.size === 0 && r.status === "loading" && ((n = r.controller) == null || n.abort(), r.disposed = !0, this.entries.delete(e)), this.notify(), this.enforceBudget());
875
+ }
876
+ /** Synchronous read of a loaded value (or `undefined`). Does not take a reference. */
877
+ get(e) {
878
+ const t = this.entries.get(e);
879
+ return (t == null ? void 0 : t.status) === "ready" ? t.value : void 0;
880
+ }
881
+ has(e) {
882
+ return this.entries.has(e);
883
+ }
884
+ entry(e) {
885
+ const t = this.entries.get(e);
886
+ return t ? ve(e, t) : void 0;
887
+ }
888
+ list() {
889
+ return Array.from(this.entries, ([e, t]) => ve(e, t));
890
+ }
891
+ setBudget(e) {
892
+ this.budget = e, this.enforceBudget(), this.notify();
893
+ }
894
+ /**
895
+ * Dispose unreferenced values, least recently used first, until usage is
896
+ * within the budget (or `bytesToFree` is reclaimed). Referenced values are
897
+ * never touched. Returns the bytes reclaimed.
898
+ */
899
+ evict(e) {
900
+ const t = e ?? Math.max(0, this.usage() - (Number.isFinite(this.budget) ? this.budget : 1 / 0));
901
+ if (t <= 0) return 0;
902
+ const r = Array.from(this.entries).filter(([, a]) => a.owners.size === 0 && a.status === "ready").sort((a, i) => a[1].lastUsed - i[1].lastUsed);
903
+ let n = 0;
904
+ for (const [a, i] of r) {
905
+ if (n >= t) break;
906
+ n += i.bytes, this.disposeEntry(a, i), this.evictions += 1;
907
+ }
908
+ return n > 0 && this.notify(), n;
909
+ }
910
+ /** Dispose every unreferenced value (route change, scene teardown). Returns the bytes freed. */
911
+ disposeUnreferenced() {
912
+ let e = 0;
913
+ for (const [t, r] of Array.from(this.entries))
914
+ r.owners.size === 0 && (e += r.bytes, this.disposeEntry(t, r));
915
+ return e > 0 && this.notify(), e;
916
+ }
917
+ /** Dispose everything, referenced or not (app / session shutdown). Owners are forgotten. */
918
+ disposeAll() {
919
+ for (const [e, t] of Array.from(this.entries)) this.disposeEntry(e, t);
920
+ this.notify();
921
+ }
922
+ /** Current statistics. The object is reused until the cache changes, so it is safe as a store snapshot. */
923
+ getStats() {
924
+ if (this.statsSnapshot) return this.statsSnapshot;
925
+ let e = 0, t = 0, r = 0, n = 0, a = 0;
926
+ for (const i of this.entries.values())
927
+ i.owners.size > 0 && (e += 1), i.status === "loading" && (t += 1), i.status === "error" && (r += 1), i.status === "ready" && (n += i.bytes, i.owners.size === 0 && (a += i.bytes));
928
+ return this.statsSnapshot = {
929
+ assets: this.entries.size,
930
+ referencedAssets: e,
931
+ loadingAssets: t,
932
+ erroredAssets: r,
933
+ usageBytes: n,
934
+ reclaimableBytes: a,
935
+ budgetBytes: this.budget,
936
+ overBudget: n > this.budget,
937
+ evictions: this.evictions,
938
+ hits: this.hits,
939
+ misses: this.misses
940
+ }, this.statsSnapshot;
941
+ }
942
+ subscribe(e) {
943
+ return this.listeners.add(e), () => {
944
+ this.listeners.delete(e);
945
+ };
946
+ }
947
+ usage() {
948
+ let e = 0;
949
+ for (const t of this.entries.values()) t.status === "ready" && (e += t.bytes);
950
+ return e;
951
+ }
952
+ enforceBudget() {
953
+ Number.isFinite(this.budget) && this.usage() > this.budget && this.evict();
954
+ }
955
+ disposeEntry(e, t) {
956
+ var r, n, a;
957
+ if (!t.disposed) {
958
+ if (t.disposed = !0, (r = t.controller) == null || r.abort(), t.status === "ready" && t.value !== void 0)
959
+ try {
960
+ (a = (n = t.definition).dispose) == null || a.call(n, t.value);
961
+ } catch (i) {
962
+ console.warn(`[xr-sdk assets] dispose threw for ${e}`, i);
963
+ }
964
+ this.entries.delete(e);
965
+ }
966
+ }
967
+ notify() {
968
+ this.statsSnapshot = null, this.listeners.forEach((e) => e());
969
+ }
970
+ }
971
+ const ve = (s, e) => ({
972
+ key: s,
973
+ status: e.status,
974
+ bytes: e.bytes,
975
+ owners: e.owners.size,
976
+ lastUsed: e.lastUsed,
977
+ error: e.error
978
+ }), rs = (s) => new ss(s);
979
+ let le;
980
+ const De = () => (le || (le = rs()), le), ue = (s) => {
981
+ if (!s) return 0;
982
+ const e = s.image;
983
+ if (!e) return 0;
984
+ const t = e.videoWidth || e.width || 0, r = e.videoHeight || e.height || 0;
985
+ if (!t || !r) return 0;
986
+ const n = s.isCompressedTexture, a = n ? 0.5 : s.type === $.FloatType ? 16 : 4, i = t * r * a;
987
+ return Math.round(s.generateMipmaps && !n ? i * 1.3334 : i);
988
+ }, as = (s) => {
989
+ if (!s) return 0;
990
+ let e = 0;
991
+ for (const t of Object.values(s.attributes)) {
992
+ const r = t.array;
993
+ r && (e += r.byteLength);
994
+ }
995
+ return s.index && (e += s.index.array.byteLength), e;
996
+ }, ns = [
997
+ "map",
998
+ "alphaMap",
999
+ "aoMap",
1000
+ "bumpMap",
1001
+ "displacementMap",
1002
+ "emissiveMap",
1003
+ "envMap",
1004
+ "lightMap",
1005
+ "metalnessMap",
1006
+ "normalMap",
1007
+ "roughnessMap",
1008
+ "specularMap"
1009
+ ], Ie = (s) => {
1010
+ const e = [], t = s;
1011
+ for (const n of ns) {
1012
+ const a = t[n];
1013
+ a && a.isTexture && e.push(a);
1014
+ }
1015
+ const r = s.uniforms;
1016
+ if (r)
1017
+ for (const n of Object.values(r)) {
1018
+ const a = n == null ? void 0 : n.value;
1019
+ a && a.isTexture && e.push(a);
1020
+ }
1021
+ return e;
1022
+ }, is = (s) => {
1023
+ if (!s) return 0;
1024
+ const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
1025
+ s.traverse((n) => {
1026
+ const a = n;
1027
+ a.geometry && e.add(a.geometry);
1028
+ const i = Array.isArray(a.material) ? a.material : a.material ? [a.material] : [];
1029
+ for (const o of i) Ie(o).forEach((c) => t.add(c));
1030
+ });
1031
+ let r = 0;
1032
+ return e.forEach((n) => {
1033
+ r += as(n);
1034
+ }), t.forEach((n) => {
1035
+ r += ue(n);
1036
+ }), r;
1037
+ }, we = (s) => {
1038
+ if (!s) return;
1039
+ const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
1040
+ s.traverse((n) => {
1041
+ const a = n;
1042
+ a.geometry && e.add(a.geometry);
1043
+ const i = Array.isArray(a.material) ? a.material : a.material ? [a.material] : [];
1044
+ for (const o of i)
1045
+ t.add(o), Ie(o).forEach((c) => r.add(c));
1046
+ }), r.forEach((n) => n.dispose()), t.forEach((n) => n.dispose()), e.forEach((n) => n.dispose()), s.removeFromParent();
1047
+ }, Le = async (s, e) => {
1048
+ if (rt(s)) return at(s, { signal: e });
1049
+ const t = await fetch(s, { signal: e });
1050
+ if (!t.ok) throw new Error(`Asset fetch failed (${t.status}): ${s}`);
1051
+ return t.arrayBuffer();
1052
+ }, Oe = (s) => new Promise((e, t) => {
1053
+ const r = () => t(new DOMException("Asset load aborted", "AbortError"));
1054
+ s.aborted ? r() : s.addEventListener("abort", r, { once: !0 });
1055
+ }), tr = (s, e = {}) => ({
1056
+ key: `texture:${s}${e.variant ? `#${e.variant}` : ""}`,
1057
+ load: async (t) => {
1058
+ const r = await Le(s, t), n = new Blob([r]), a = createImageBitmap(n, {
1059
+ imageOrientation: e.flipY === !1 ? "none" : "flipY"
1060
+ }), i = await Promise.race([a, Oe(t)]).catch((c) => {
1061
+ throw a.then((l) => l.close()).catch(() => {
1062
+ }), c;
1063
+ }), o = new $.Texture(i);
1064
+ return o.flipY = !1, o.colorSpace = e.colorSpace ?? $.SRGBColorSpace, o.generateMipmaps = e.generateMipmaps ?? !0, o.minFilter = o.generateMipmaps ? $.LinearMipmapLinearFilter : $.LinearFilter, o.needsUpdate = !0, o;
1065
+ },
1066
+ dispose: (t) => {
1067
+ var n;
1068
+ const r = t.image;
1069
+ t.dispose(), (n = r == null ? void 0 : r.close) == null || n.call(r);
1070
+ },
1071
+ bytes: ue
1072
+ }), sr = (s) => ({
1073
+ key: `gltf:${s}`,
1074
+ load: async (e) => {
1075
+ const t = await Le(s, e), r = new vt(), n = s.slice(0, s.lastIndexOf("/") + 1), a = r.parseAsync(t, n);
1076
+ return Promise.race([a, Oe(e)]).catch((i) => {
1077
+ throw a.then((o) => we(o.scene)).catch(() => {
1078
+ }), i;
1079
+ });
1080
+ },
1081
+ dispose: (e) => we(e.scene),
1082
+ bytes: (e) => is(e.scene)
1083
+ }), rr = (s, e = {}) => ({
1084
+ key: `video:${s}`,
1085
+ load: (t) => new Promise((r, n) => {
1086
+ const a = document.createElement("video");
1087
+ a.src = s, a.loop = e.loop ?? !0, a.muted = e.muted ?? !0, a.playsInline = !0, a.crossOrigin = e.crossOrigin ?? "anonymous", a.preload = "auto";
1088
+ const i = (o) => {
1089
+ a.removeAttribute("src"), a.load(), n(o instanceof Error ? o : new Error(`Video failed to load: ${s}`));
1090
+ };
1091
+ t.addEventListener(
1092
+ "abort",
1093
+ () => i(new DOMException("Asset load aborted", "AbortError")),
1094
+ {
1095
+ once: !0
1096
+ }
1097
+ ), a.onerror = () => i(a.error), a.onloadeddata = () => {
1098
+ const o = new $.VideoTexture(a);
1099
+ o.colorSpace = $.SRGBColorSpace, r({ video: a, texture: o });
1100
+ }, a.load();
1101
+ }),
1102
+ dispose: ({ video: t, texture: r }) => {
1103
+ r.dispose(), t.pause(), t.removeAttribute("src"), t.load();
1104
+ },
1105
+ bytes: ({ texture: t }) => ue(t)
1106
+ }), Ge = mt(null), ar = ({
1107
+ cache: s,
1108
+ disposeUnreferencedOnUnmount: e = !0,
1109
+ children: t
1110
+ }) => {
1111
+ const r = s ?? De();
1112
+ return x(() => () => {
1113
+ e && r.disposeUnreferenced();
1114
+ }, [r, e]), /* @__PURE__ */ M(Ge.Provider, { value: r, children: t });
1115
+ }, qe = () => dt(Ge) ?? De(), nr = (s, e = {}) => {
1116
+ const { enabled: t = !0 } = e, r = qe(), n = ft(), a = (s == null ? void 0 : s.key) ?? null, [i, o] = k({
1117
+ value: null,
1118
+ status: "idle",
1119
+ error: null
1120
+ });
1121
+ return x(() => {
1122
+ if (!s || !t) {
1123
+ o({ value: null, status: "idle", error: null });
1124
+ return;
1125
+ }
1126
+ let c = !0;
1127
+ const l = r.get(s.key);
1128
+ return o({ value: l ?? null, status: l ? "ready" : "loading", error: null }), r.acquire(s, n).then((p) => {
1129
+ c && o({ value: p, status: "ready", error: null });
1130
+ }).catch((p) => {
1131
+ c && o({ value: null, status: "error", error: p });
1132
+ }), () => {
1133
+ c = !1, r.release(s.key, n);
1134
+ };
1135
+ }, [r, a, t, n]), i;
1136
+ }, ir = (s) => {
1137
+ const e = qe(), t = s ?? e;
1138
+ return ht(
1139
+ (r) => t.subscribe(r),
1140
+ () => t.getStats(),
1141
+ () => t.getStats()
1142
+ );
1143
+ }, ne = 1, Be = Object.freeze({
1144
+ version: ne,
1145
+ trackers: {
1146
+ face: { enabled: !0, numFaces: 1, targetFps: null, holdMs: 250, predictMs: 0, smoothing: 0 },
1147
+ hand: { enabled: !1, targetFps: null },
1148
+ gesture: { enabled: !1, targetFps: null },
1149
+ body: { enabled: !1, targetFps: null },
1150
+ holistic: {
1151
+ enabled: !1,
1152
+ targetFps: null,
1153
+ hands: "both",
1154
+ holdMs: 250,
1155
+ predictMs: 0,
1156
+ analysisMaxDimension: 768,
1157
+ outputFaceBlendshapes: !0,
1158
+ confidence: 0.5,
1159
+ delegate: "auto"
1160
+ },
1161
+ segmentation: { enabled: !1, quality: "low" },
1162
+ semanticSegmentation: { enabled: !1, preset: "multiclass", quality: "medium" }
1163
+ },
1164
+ perf: { targetFps: 24, camRes: 720, cameraZoom: 1.2, analysisScale: 1 },
1165
+ lifecycle: { pauseWhenHidden: !1 },
1166
+ quality: {},
1167
+ camera: { facingMode: "user", deviceId: null, mirrored: "auto" },
1168
+ fallbacks: { onUnsupported: "degrade", delegate: "auto" },
1169
+ assets: { holisticModelUrl: null, semanticSegmentationModelUrl: null },
1170
+ updatedAt: 0
1171
+ }), P = (s, e, t, r, n, a) => {
1172
+ if (s === void 0) return e;
1173
+ if (typeof s != "number" || !Number.isFinite(s))
1174
+ return a(`${n}: not a number, kept ${e}`), e;
1175
+ const i = Math.min(r, Math.max(t, s));
1176
+ return i !== s && a(`${n}: ${s} clamped to ${i}`), i;
1177
+ }, Y = (s, e, t, r) => s === void 0 ? e : s === null ? null : typeof s != "number" || !Number.isFinite(s) || s <= 0 ? (r(`${t}: invalid fps, kept ${e}`), e) : (s > 120 && r(`${t}: ${s} clamped to 120`), Math.min(120, s)), os = [
1178
+ "tiers",
1179
+ "budget",
1180
+ "initialTier",
1181
+ "minTier",
1182
+ "maxTier",
1183
+ "adaptive",
1184
+ "historySize"
1185
+ ], Fe = (s) => {
1186
+ const e = {};
1187
+ for (const t of os) s[t] !== void 0 && (e[t] = s[t]);
1188
+ return e;
1189
+ }, I = (s, e, t, r) => s === void 0 ? e : typeof s != "boolean" ? (r(`${t}: not a boolean, kept ${e}`), e) : s, B = (s, e, t, r, n) => s === void 0 ? t : e.includes(s) ? s : (n(`${r}: "${String(s)}" is not one of ${e.join(" | ")}, kept ${t}`), t), Ce = (s, e, t, r) => s === void 0 ? e : s === null ? null : typeof s != "string" || !/^https?:\/\//.test(s) ? (r(`${t}: not an http(s) URL, kept ${e === null ? "the SDK default" : e}`), e) : s, z = (s = {}, e = Be, t = []) => {
1190
+ var o, c, l, p, u, m, d, f, y, A, h, g, R, W, v, U, G, Z, J, ee, te, V, S, F, b, _, H, X, D, j, me, fe, he, pe, ge, ye, Se, Me;
1191
+ const r = (Xe) => t.push(Xe), n = s.trackers ?? {}, a = e.trackers, i = s.quality === void 0 ? e.quality === !1 ? !1 : Fe(e.quality) : s.quality === !1 ? !1 : typeof s.quality == "object" && s.quality !== null ? Fe(s.quality) : (r("quality: must be an object or false, kept base"), e.quality);
1192
+ return {
1193
+ version: ne,
1194
+ trackers: {
1195
+ face: {
1196
+ enabled: I((o = n.face) == null ? void 0 : o.enabled, a.face.enabled, "trackers.face.enabled", r),
1197
+ numFaces: Math.round(
1198
+ P((c = n.face) == null ? void 0 : c.numFaces, a.face.numFaces, 1, 10, "trackers.face.numFaces", r)
1199
+ ),
1200
+ targetFps: Y((l = n.face) == null ? void 0 : l.targetFps, a.face.targetFps, "trackers.face.targetFps", r),
1201
+ holdMs: P((p = n.face) == null ? void 0 : p.holdMs, a.face.holdMs, 0, 5e3, "trackers.face.holdMs", r),
1202
+ predictMs: P(
1203
+ (u = n.face) == null ? void 0 : u.predictMs,
1204
+ a.face.predictMs,
1205
+ 0,
1206
+ 1e3,
1207
+ "trackers.face.predictMs",
1208
+ r
1209
+ ),
1210
+ smoothing: P(
1211
+ (m = n.face) == null ? void 0 : m.smoothing,
1212
+ a.face.smoothing,
1213
+ 0,
1214
+ 100,
1215
+ "trackers.face.smoothing",
1216
+ r
1217
+ )
1218
+ },
1219
+ hand: {
1220
+ enabled: I((d = n.hand) == null ? void 0 : d.enabled, a.hand.enabled, "trackers.hand.enabled", r),
1221
+ targetFps: Y((f = n.hand) == null ? void 0 : f.targetFps, a.hand.targetFps, "trackers.hand.targetFps", r)
1222
+ },
1223
+ gesture: {
1224
+ enabled: I((y = n.gesture) == null ? void 0 : y.enabled, a.gesture.enabled, "trackers.gesture.enabled", r),
1225
+ targetFps: Y(
1226
+ (A = n.gesture) == null ? void 0 : A.targetFps,
1227
+ a.gesture.targetFps,
1228
+ "trackers.gesture.targetFps",
1229
+ r
1230
+ )
1231
+ },
1232
+ body: {
1233
+ enabled: I((h = n.body) == null ? void 0 : h.enabled, a.body.enabled, "trackers.body.enabled", r),
1234
+ targetFps: Y((g = n.body) == null ? void 0 : g.targetFps, a.body.targetFps, "trackers.body.targetFps", r)
1235
+ },
1236
+ holistic: {
1237
+ enabled: I((R = n.holistic) == null ? void 0 : R.enabled, a.holistic.enabled, "trackers.holistic.enabled", r),
1238
+ targetFps: Y(
1239
+ (W = n.holistic) == null ? void 0 : W.targetFps,
1240
+ a.holistic.targetFps,
1241
+ "trackers.holistic.targetFps",
1242
+ r
1243
+ ),
1244
+ hands: B(
1245
+ (v = n.holistic) == null ? void 0 : v.hands,
1246
+ ["both", "left", "right", "none"],
1247
+ a.holistic.hands,
1248
+ "trackers.holistic.hands",
1249
+ r
1250
+ ),
1251
+ holdMs: P(
1252
+ (U = n.holistic) == null ? void 0 : U.holdMs,
1253
+ a.holistic.holdMs,
1254
+ 0,
1255
+ 5e3,
1256
+ "trackers.holistic.holdMs",
1257
+ r
1258
+ ),
1259
+ predictMs: P(
1260
+ (G = n.holistic) == null ? void 0 : G.predictMs,
1261
+ a.holistic.predictMs,
1262
+ 0,
1263
+ 1e3,
1264
+ "trackers.holistic.predictMs",
1265
+ r
1266
+ ),
1267
+ analysisMaxDimension: Math.round(
1268
+ P(
1269
+ (Z = n.holistic) == null ? void 0 : Z.analysisMaxDimension,
1270
+ a.holistic.analysisMaxDimension,
1271
+ 128,
1272
+ 2048,
1273
+ "trackers.holistic.analysisMaxDimension",
1274
+ r
1275
+ )
1276
+ ),
1277
+ outputFaceBlendshapes: I(
1278
+ (J = n.holistic) == null ? void 0 : J.outputFaceBlendshapes,
1279
+ a.holistic.outputFaceBlendshapes,
1280
+ "trackers.holistic.outputFaceBlendshapes",
1281
+ r
1282
+ ),
1283
+ confidence: P(
1284
+ (ee = n.holistic) == null ? void 0 : ee.confidence,
1285
+ a.holistic.confidence,
1286
+ 0,
1287
+ 1,
1288
+ "trackers.holistic.confidence",
1289
+ r
1290
+ ),
1291
+ delegate: B(
1292
+ (te = n.holistic) == null ? void 0 : te.delegate,
1293
+ ["auto", "GPU", "CPU"],
1294
+ a.holistic.delegate,
1295
+ "trackers.holistic.delegate",
1296
+ r
1297
+ )
1298
+ },
1299
+ segmentation: {
1300
+ enabled: I(
1301
+ (V = n.segmentation) == null ? void 0 : V.enabled,
1302
+ a.segmentation.enabled,
1303
+ "trackers.segmentation.enabled",
1304
+ r
1305
+ ),
1306
+ quality: B(
1307
+ (S = n.segmentation) == null ? void 0 : S.quality,
1308
+ ["low", "medium", "high"],
1309
+ a.segmentation.quality,
1310
+ "trackers.segmentation.quality",
1311
+ r
1312
+ )
1313
+ },
1314
+ semanticSegmentation: {
1315
+ enabled: I(
1316
+ (F = n.semanticSegmentation) == null ? void 0 : F.enabled,
1317
+ a.semanticSegmentation.enabled,
1318
+ "trackers.semanticSegmentation.enabled",
1319
+ r
1320
+ ),
1321
+ preset: B(
1322
+ (b = n.semanticSegmentation) == null ? void 0 : b.preset,
1323
+ wt,
1324
+ a.semanticSegmentation.preset,
1325
+ "trackers.semanticSegmentation.preset",
1326
+ r
1327
+ ),
1328
+ quality: B(
1329
+ (_ = n.semanticSegmentation) == null ? void 0 : _.quality,
1330
+ ["low", "medium", "high"],
1331
+ a.semanticSegmentation.quality,
1332
+ "trackers.semanticSegmentation.quality",
1333
+ r
1334
+ )
1335
+ }
1336
+ },
1337
+ perf: {
1338
+ targetFps: P((H = s.perf) == null ? void 0 : H.targetFps, e.perf.targetFps, 0, 120, "perf.targetFps", r),
1339
+ camRes: Math.round(P((X = s.perf) == null ? void 0 : X.camRes, e.perf.camRes, 160, 3840, "perf.camRes", r)),
1340
+ cameraZoom: P((D = s.perf) == null ? void 0 : D.cameraZoom, e.perf.cameraZoom, 1, 3, "perf.cameraZoom", r),
1341
+ analysisScale: P(
1342
+ (j = s.perf) == null ? void 0 : j.analysisScale,
1343
+ e.perf.analysisScale,
1344
+ 0.25,
1345
+ 1,
1346
+ "perf.analysisScale",
1347
+ r
1348
+ )
1349
+ },
1350
+ lifecycle: {
1351
+ pauseWhenHidden: I(
1352
+ (me = s.lifecycle) == null ? void 0 : me.pauseWhenHidden,
1353
+ e.lifecycle.pauseWhenHidden,
1354
+ "lifecycle.pauseWhenHidden",
1355
+ r
1356
+ )
1357
+ },
1358
+ quality: i,
1359
+ camera: {
1360
+ facingMode: B(
1361
+ (fe = s.camera) == null ? void 0 : fe.facingMode,
1362
+ ["user", "environment"],
1363
+ e.camera.facingMode,
1364
+ "camera.facingMode",
1365
+ r
1366
+ ),
1367
+ deviceId: ((he = s.camera) == null ? void 0 : he.deviceId) === void 0 ? e.camera.deviceId : typeof s.camera.deviceId == "string" || s.camera.deviceId === null ? s.camera.deviceId : (r("camera.deviceId: not a string, kept base"), e.camera.deviceId),
1368
+ mirrored: ((pe = s.camera) == null ? void 0 : pe.mirrored) === void 0 ? e.camera.mirrored : s.camera.mirrored === "auto" || typeof s.camera.mirrored == "boolean" ? s.camera.mirrored : (r('camera.mirrored: must be boolean or "auto", kept base'), e.camera.mirrored)
1369
+ },
1370
+ fallbacks: {
1371
+ onUnsupported: B(
1372
+ (ge = s.fallbacks) == null ? void 0 : ge.onUnsupported,
1373
+ ["block", "degrade"],
1374
+ e.fallbacks.onUnsupported,
1375
+ "fallbacks.onUnsupported",
1376
+ r
1377
+ ),
1378
+ delegate: B(
1379
+ (ye = s.fallbacks) == null ? void 0 : ye.delegate,
1380
+ ["auto", "GPU", "CPU"],
1381
+ e.fallbacks.delegate,
1382
+ "fallbacks.delegate",
1383
+ r
1384
+ )
1385
+ },
1386
+ assets: {
1387
+ holisticModelUrl: Ce(
1388
+ (Se = s.assets) == null ? void 0 : Se.holisticModelUrl,
1389
+ e.assets.holisticModelUrl,
1390
+ "assets.holisticModelUrl",
1391
+ r
1392
+ ),
1393
+ semanticSegmentationModelUrl: Ce(
1394
+ (Me = s.assets) == null ? void 0 : Me.semanticSegmentationModelUrl,
1395
+ e.assets.semanticSegmentationModelUrl,
1396
+ "assets.semanticSegmentationModelUrl",
1397
+ r
1398
+ )
1399
+ },
1400
+ updatedAt: typeof s.updatedAt == "number" && Number.isFinite(s.updatedAt) ? s.updatedAt : e.updatedAt
1401
+ };
1402
+ }, ke = (s, e, t = Date.now()) => z({ ...e, updatedAt: t }, s), $e = (s) => JSON.stringify(z({}, s)), ze = (s) => {
1403
+ const e = [];
1404
+ let t = s;
1405
+ if (typeof s == "string")
1406
+ try {
1407
+ t = JSON.parse(s);
1408
+ } catch {
1409
+ return {
1410
+ config: z(),
1411
+ migrated: !0,
1412
+ warnings: ["not valid JSON; defaults used"]
1413
+ };
1414
+ }
1415
+ if (!t || typeof t != "object")
1416
+ return {
1417
+ config: z(),
1418
+ migrated: !0,
1419
+ warnings: ["not an object; defaults used"]
1420
+ };
1421
+ const r = t, n = r.version !== ne;
1422
+ return n && e.push(
1423
+ `migrated from version ${String(r.version ?? "none")} to ${ne}`
1424
+ ), { config: z(r, Be, e), migrated: n, warnings: e };
1425
+ }, or = [
1426
+ "face",
1427
+ "hand",
1428
+ "gesture",
1429
+ "body",
1430
+ "holistic",
1431
+ "segmentation",
1432
+ "semanticSegmentation"
1433
+ ], cs = (s) => ({
1434
+ perf: {
1435
+ targetFps: s.perf.targetFps > 0 ? s.perf.targetFps : void 0,
1436
+ camRes: s.perf.camRes,
1437
+ cameraZoom: s.perf.cameraZoom,
1438
+ analysisScale: s.perf.analysisScale
1439
+ },
1440
+ lifecycle: { pauseWhenHidden: s.lifecycle.pauseWhenHidden },
1441
+ quality: s.quality
1442
+ }), ls = (s) => ({
1443
+ facingMode: s.camera.facingMode,
1444
+ ...s.camera.deviceId ? { deviceId: s.camera.deviceId } : {},
1445
+ ...s.camera.mirrored === "auto" ? {} : { mirrored: s.camera.mirrored }
1446
+ }), O = (s) => s === null ? {} : { targetFps: s }, us = (s, e) => {
1447
+ const t = s.trackers;
1448
+ return {
1449
+ face: {
1450
+ numFaces: t.face.numFaces,
1451
+ ...O(t.face.targetFps),
1452
+ holdMs: t.face.holdMs,
1453
+ predictMs: t.face.predictMs,
1454
+ active: t.face.enabled
1455
+ },
1456
+ hand: { ...O(t.hand.targetFps), active: t.hand.enabled },
1457
+ gesture: { ...O(t.gesture.targetFps), active: t.gesture.enabled },
1458
+ body: { active: t.body.enabled },
1459
+ holistic: {
1460
+ ...O(t.holistic.targetFps),
1461
+ hands: t.holistic.hands,
1462
+ holdMs: t.holistic.holdMs,
1463
+ predictMs: t.holistic.predictMs,
1464
+ analysisMaxDimension: t.holistic.analysisMaxDimension,
1465
+ outputFaceBlendshapes: t.holistic.outputFaceBlendshapes,
1466
+ delegate: t.holistic.delegate === "auto" ? s.fallbacks.delegate : t.holistic.delegate,
1467
+ ...s.assets.holisticModelUrl ? { modelUrl: s.assets.holisticModelUrl } : {},
1468
+ active: t.holistic.enabled
1469
+ },
1470
+ segmentation: { quality: t.segmentation.quality, active: t.segmentation.enabled },
1471
+ semanticSegmentation: {
1472
+ preset: t.semanticSegmentation.preset,
1473
+ quality: t.semanticSegmentation.quality,
1474
+ ...s.assets.semanticSegmentationModelUrl ? { modelUrl: s.assets.semanticSegmentationModelUrl } : {},
1475
+ active: t.semanticSegmentation.enabled
1476
+ }
1477
+ }[e];
1478
+ }, ds = (s, e) => {
1479
+ const t = s.trackers;
1480
+ switch (e) {
1481
+ case C.FACE_TRACKER:
1482
+ return { numFaces: t.face.numFaces, ...O(t.face.targetFps) };
1483
+ case C.HAND_TRACKER:
1484
+ return { ...O(t.hand.targetFps) };
1485
+ case C.GESTURE_TRACKER:
1486
+ return { ...O(t.gesture.targetFps) };
1487
+ case C.BODY_TRACKER:
1488
+ return { ...O(t.body.targetFps) };
1489
+ case C.HOLISTIC_TRACKER: {
1490
+ const r = t.holistic;
1491
+ return {
1492
+ ...O(r.targetFps),
1493
+ hands: r.hands,
1494
+ holdMs: r.holdMs,
1495
+ predictMs: r.predictMs,
1496
+ analysisMaxDimension: r.analysisMaxDimension,
1497
+ outputFaceBlendshapes: r.outputFaceBlendshapes,
1498
+ minFaceDetectionConfidence: r.confidence,
1499
+ minFacePresenceConfidence: r.confidence,
1500
+ minPoseDetectionConfidence: r.confidence,
1501
+ minPosePresenceConfidence: r.confidence,
1502
+ minHandLandmarksConfidence: r.confidence,
1503
+ delegate: r.delegate === "auto" ? s.fallbacks.delegate : r.delegate,
1504
+ ...s.assets.holisticModelUrl ? { modelUrl: s.assets.holisticModelUrl } : {}
1505
+ };
1506
+ }
1507
+ case C.BACKGROUND_SEGMENTATION:
1508
+ return { quality: t.segmentation.quality };
1509
+ case C.SEMANTIC_SEGMENTATION:
1510
+ return {
1511
+ preset: t.semanticSegmentation.preset,
1512
+ quality: t.semanticSegmentation.quality,
1513
+ ...s.assets.semanticSegmentationModelUrl ? { modelUrl: s.assets.semanticSegmentationModelUrl } : {}
1514
+ };
1515
+ default:
1516
+ return {};
1517
+ }
1518
+ }, ms = (s) => {
1519
+ const e = s.trackers, t = [];
1520
+ return e.face.enabled && t.push(C.FACE_TRACKER), e.hand.enabled && t.push(C.HAND_TRACKER), e.gesture.enabled && t.push(C.GESTURE_TRACKER), e.body.enabled && t.push(C.BODY_TRACKER), e.holistic.enabled && t.push(C.HOLISTIC_TRACKER), e.segmentation.enabled && t.push(C.BACKGROUND_SEGMENTATION), e.semanticSegmentation.enabled && t.push(C.SEMANTIC_SEGMENTATION), t;
1521
+ }, ie = "vincentt.xr.tracking-config", de = () => {
1522
+ try {
1523
+ return typeof localStorage < "u" ? localStorage : null;
1524
+ } catch {
1525
+ return null;
1526
+ }
1527
+ }, fs = (s = ie, e = de()) => {
1528
+ if (!e) return null;
1529
+ try {
1530
+ const t = e.getItem(s);
1531
+ return t ? ze(t) : null;
1532
+ } catch {
1533
+ return null;
1534
+ }
1535
+ }, _e = (s, e = ie, t = de()) => {
1536
+ if (!t) return !1;
1537
+ try {
1538
+ return t.setItem(e, $e(s)), !0;
1539
+ } catch {
1540
+ return !1;
1541
+ }
1542
+ }, hs = (s = ie, e = de()) => {
1543
+ if (e)
1544
+ try {
1545
+ e.removeItem(s);
1546
+ } catch {
1547
+ }
1548
+ }, cr = (s = {}) => {
1549
+ const { storageKey: e = ie, persist: t = !0 } = s, r = s.storage, n = w(s.initial), a = K(() => z(n.current ?? {}), []), [i, o] = k(a), [c, l] = k([]), [p, u] = k(!t), m = w(i);
1550
+ m.current = i, x(() => {
1551
+ if (!t) {
1552
+ u(!0);
1553
+ return;
1554
+ }
1555
+ const h = fs(e, r);
1556
+ if (h) {
1557
+ const g = z(h.config, a);
1558
+ m.current = g, o(g), l(h.warnings), h.migrated && _e(g, e, r);
1559
+ }
1560
+ u(!0);
1561
+ }, [t, e, r, a]);
1562
+ const d = E(
1563
+ (h, g) => (m.current = h, o(h), l(g), t && _e(h, e, r), h),
1564
+ [t, e, r]
1565
+ ), f = E(
1566
+ (h) => {
1567
+ const g = [], R = z({ ...h, updatedAt: Date.now() }, m.current, g);
1568
+ return d(R, g);
1569
+ },
1570
+ [d]
1571
+ ), y = E(() => {
1572
+ const h = ke(a, {}, 0);
1573
+ return m.current = h, o(h), l([]), t && hs(e, r), h;
1574
+ }, [a, t, e, r]), A = E(
1575
+ (h) => {
1576
+ const g = ze(h);
1577
+ return g.warnings.some((R) => R.startsWith("not valid JSON") || R.startsWith("not an object")) ? (l([`import: ${g.warnings[0]}; config unchanged`]), m.current) : d(ke(g.config, {}, Date.now()), g.warnings);
1578
+ },
1579
+ [d]
1580
+ );
1581
+ return K(
1582
+ () => ({
1583
+ config: i,
1584
+ hydrated: p,
1585
+ warnings: c,
1586
+ update: f,
1587
+ reset: y,
1588
+ importJson: A,
1589
+ json: $e(i),
1590
+ providerProps: cs(i),
1591
+ cameraRequest: ls(i),
1592
+ trackerProps: (h) => us(i, h),
1593
+ modelOptions: (h) => ds(i, h),
1594
+ enabledModels: ms(i)
1595
+ }),
1596
+ [i, p, c, f, y, A]
1597
+ );
622
1598
  };
623
1599
  export {
624
- st as AspectRatioContainer,
625
- Oe as AudioEngine,
626
- ct as AudioPlayer,
627
- rt as Axes,
628
- As as DEFAULT_MATERIAL_FILL,
629
- Rs as DEFAULT_MESH_RENDERER,
630
- ys as DEFAULT_MESH_RENDERER_RENDER_STATE,
631
- Zt as DEFAULT_PIXEL_SNAP_INCREMENT,
632
- Kt as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
633
- $t as DEFAULT_SCREEN_GLASS,
634
- _s as DEFAULT_SCREEN_GRADIENT,
635
- Jt as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
636
- Qt as DEFAULT_SCREEN_IMAGE_SETTINGS,
637
- es as DEFAULT_SCREEN_SHAPE_SETTINGS,
638
- ts as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
639
- ss as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
640
- rs as DEFAULT_SCREEN_TRANSFORM_2D,
641
- as as DEFAULT_SCREEN_TRANSFORM_ROOT,
642
- vs as DEFAULT_TRANSFORM_3D,
643
- ns as EXTERNAL_BACKGROUND_RENDER_LAYER,
644
- _t as LightObject,
645
- vt as LookAt,
646
- os as MAX_RENDER_GROUP_PASSES,
647
- Cs as MaterialFill,
648
- Is as MeshMaterial,
649
- gs as MeshRenderer,
650
- et as Panel,
651
- is as PinToMesh,
652
- Ct as RenderGroupLayer,
653
- Pt as SceneObjectRenderer,
654
- cs as ScreenGlassMaterial,
655
- Ps as ScreenGradientMaterial,
656
- Lt as ScreenImage,
657
- us as ScreenShape,
658
- Ut as ScreenSpaceUI,
659
- Dt as ScreenText,
660
- ie as ScreenTransform,
661
- Nt as SequentialRenderPasses,
662
- at as SpriteAnimation,
663
- Ft as TextLabel,
664
- Ls as Transform3D,
665
- tt as VideoBackground,
666
- yt as XRMediaSource,
667
- ne as XRModel,
668
- gt as XRProvider,
669
- xt as XRScene,
670
- C as audio,
671
- bt as clientToScreenPixels,
672
- ce as computeContainScale,
673
- Us as createTwoStopGradient,
674
- it as dataURLtoFile,
675
- Fs as drawNormalizedCrop,
676
- ls as getRenderGroupLayer,
677
- Et as isMuted,
678
- ds as mapScreenImageSettingsToProps,
679
- ms as mapScreenTextInnerShadowToProps,
680
- ps as mapScreenTextSettingsToProps,
681
- Ot as mediaToScreenPixels,
682
- hs as mergeScreenShapeSettings,
683
- fs as mergeScreenTransform2D,
684
- ws as normalizeMeshRendererRenderState,
685
- Es as normalizeScreenGlass,
686
- Ds as normalizeScreenGradient,
687
- It as normalizedToScreenPixels,
688
- St as onMuteChange,
689
- pt as playOneShot,
690
- ut as prefetchMusic,
691
- lt as registerSound,
692
- Ss as renderSequentialPasses,
693
- bs as resolveNormalizedCrop,
694
- Ts as resolveScreenTransform2D,
695
- Gt as screenPixelsToClient,
696
- kt as screenPixelsToMedia,
697
- zt as screenPixelsToNormalized,
698
- Wt as screenPixelsToScreenSpace,
699
- Xt as screenPixelsToUnits,
700
- Vt as screenPointToRay,
701
- Ht as screenSpaceToScreenPixels,
702
- Bt as screenUnitsToPixels,
703
- ht as setMuted,
704
- I as smoothNumber,
705
- Je as smoothVector2,
706
- Qe as smoothVector3,
707
- dt as startMusic,
708
- mt as stopMusic,
709
- ft as toggleMuted,
710
- jt as trackerPointToScreenPixels,
711
- ot as useFrameCapture,
712
- nt as useMediaRecorder,
713
- Tt as useMuted,
714
- ge as useScreenRectAspect,
715
- qt as worldToScreenPixels
1600
+ Ns as AspectRatioContainer,
1601
+ Xt as AudioEngine,
1602
+ qs as AudioPlayer,
1603
+ Ds as Axes,
1604
+ Ze as CAMERA_PERMISSION_MESSAGES,
1605
+ Qs as CameraPermissionGate,
1606
+ ts as DEFAULT_ASSET_BUDGET_BYTES,
1607
+ Ea as DEFAULT_MATERIAL_FILL,
1608
+ pa as DEFAULT_MESH_RENDERER,
1609
+ ga as DEFAULT_MESH_RENDERER_RENDER_STATE,
1610
+ dr as DEFAULT_PERFORMANCE_BUDGET,
1611
+ Ua as DEFAULT_PIXEL_SNAP_INCREMENT,
1612
+ mr as DEFAULT_QUALITY_TIERS,
1613
+ Pa as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
1614
+ Vr as DEFAULT_SCREEN_GLASS,
1615
+ ba as DEFAULT_SCREEN_GRADIENT,
1616
+ jr as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
1617
+ Yr as DEFAULT_SCREEN_IMAGE_SETTINGS,
1618
+ Qr as DEFAULT_SCREEN_SHAPE_SETTINGS,
1619
+ Zr as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
1620
+ Jr as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
1621
+ Na as DEFAULT_SCREEN_TRANSFORM_2D,
1622
+ Da as DEFAULT_SCREEN_TRANSFORM_ROOT,
1623
+ Be as DEFAULT_TRACKING_CONFIG,
1624
+ Ta as DEFAULT_TRANSFORM_3D,
1625
+ ea as EXTERNAL_BACKGROUND_RENDER_LAYER,
1626
+ xt as FULL_SCREEN_ANCHORS,
1627
+ Or as LightObject,
1628
+ Gr as LookAt,
1629
+ ta as MAX_RENDER_GROUP_PASSES,
1630
+ Aa as MaterialFill,
1631
+ fa as MeshMaterial,
1632
+ ya as MeshRenderer,
1633
+ xs as Panel,
1634
+ Ps as PersonCutout,
1635
+ sa as PinToMesh,
1636
+ qr as RenderGroupLayer,
1637
+ Br as SCREEN_IMAGE_MASK_CHANNELS,
1638
+ $r as SceneObjectRenderer,
1639
+ ra as ScreenGlassMaterial,
1640
+ Ra as ScreenGradientMaterial,
1641
+ it as ScreenImage,
1642
+ aa as ScreenShape,
1643
+ zr as ScreenSpaceUI,
1644
+ Xr as ScreenText,
1645
+ nt as ScreenTransform,
1646
+ Kr as SequentialRenderPasses,
1647
+ Is as SpriteAnimation,
1648
+ or as TRACKER_KINDS,
1649
+ ie as TRACKING_CONFIG_STORAGE_KEY,
1650
+ ne as TRACKING_CONFIG_VERSION,
1651
+ Wr as TextLabel,
1652
+ va as Transform3D,
1653
+ Us as VideoBackground,
1654
+ ss as XRAssetCache,
1655
+ ar as XRAssetCacheProvider,
1656
+ fr as XRMediaSource,
1657
+ C as XRModel,
1658
+ hr as XRProvider,
1659
+ pr as XRQualityController,
1660
+ Ir as XRScene,
1661
+ gr as XR_FALLBACK_MESSAGES,
1662
+ yr as XR_MODEL_ASSET_URLS,
1663
+ N as audio,
1664
+ Qe as canPromptForCamera,
1665
+ hs as clearTrackingConfig,
1666
+ Ga as clientToScreenPixels,
1667
+ ot as computeContainScale,
1668
+ Sr as computeFeedCrop,
1669
+ Mr as computeFitLayout,
1670
+ rs as createAssetCache,
1671
+ Er as createFallbackReason,
1672
+ wa as createTwoStopGradient,
1673
+ Gs as dataURLtoFile,
1674
+ sr as defineGltfAsset,
1675
+ tr as defineTextureAsset,
1676
+ rr as defineVideoAsset,
1677
+ br as detectXRCapabilities,
1678
+ we as disposeObject3D,
1679
+ ka as drawNormalizedCrop,
1680
+ ms as enabledModels,
1681
+ as as estimateGeometryBytes,
1682
+ is as estimateObjectBytes,
1683
+ ue as estimateTextureBytes,
1684
+ qa as feedToScreenPixels,
1685
+ Tr as feedToSource,
1686
+ Ba as feedToTracker,
1687
+ $a as feedToViewport,
1688
+ Ar as feedToWorld,
1689
+ Js as findCameraByFacing,
1690
+ De as getDefaultAssetCache,
1691
+ na as getRenderGroupLayer,
1692
+ Rr as isFeedPointInSource,
1693
+ vr as isMirroredSourceKind,
1694
+ Vs as isMuted,
1695
+ Zs as listCameras,
1696
+ fs as loadTrackingConfig,
1697
+ ia as mapScreenImageSettingsToProps,
1698
+ oa as mapScreenTextInnerShadowToProps,
1699
+ ca as mapScreenTextSettingsToProps,
1700
+ za as mediaToScreenPixels,
1701
+ la as mergeScreenShapeSettings,
1702
+ Ia as mergeScreenTransform2D,
1703
+ ke as mergeTrackingConfig,
1704
+ wr as mirrorFeedX,
1705
+ Sa as normalizeMeshRendererRenderState,
1706
+ ua as normalizeScreenGlass,
1707
+ Fa as normalizeScreenGradient,
1708
+ Xa as normalizedToScreenPixels,
1709
+ js as onMuteChange,
1710
+ Fr as orientSourcePoint,
1711
+ Cr as orientedSize,
1712
+ ze as parseTrackingConfig,
1713
+ Ks as playOneShot,
1714
+ Bs as prefetchMusic,
1715
+ Ve as queryCameraPermission,
1716
+ $s as registerSound,
1717
+ da as renderSequentialPasses,
1718
+ je as requestCameraAccess,
1719
+ kr as resolveModelAssetUrl,
1720
+ _a as resolveNormalizedCrop,
1721
+ Ut as resolvePersonCutoutStatus,
1722
+ Ee as resolveQualityConfig,
1723
+ La as resolveScreenTransform2D,
1724
+ _r as resolveTrackerSupport,
1725
+ z as resolveTrackingConfig,
1726
+ _e as saveTrackingConfig,
1727
+ Ka as screenPixelsToClient,
1728
+ Wa as screenPixelsToFeed,
1729
+ Ha as screenPixelsToMedia,
1730
+ Va as screenPixelsToNormalized,
1731
+ ja as screenPixelsToScreenSpace,
1732
+ Ya as screenPixelsToUnits,
1733
+ Qa as screenPointToRay,
1734
+ Za as screenSpaceToScreenPixels,
1735
+ Ja as screenUnitsToPixels,
1736
+ $e as serializeTrackingConfig,
1737
+ Ws as setMuted,
1738
+ Pt as shouldDrawFallback,
1739
+ Q as smoothNumber,
1740
+ ks as smoothVector2,
1741
+ _s as smoothVector3,
1742
+ xr as sourceToFeed,
1743
+ zs as startMusic,
1744
+ Xs as stopMusic,
1745
+ Ye as subscribeCameraPermission,
1746
+ ls as toCameraRequest,
1747
+ ds as toModelOptions,
1748
+ cs as toProviderProps,
1749
+ us as toTrackerProps,
1750
+ Hs as toggleMuted,
1751
+ en as trackerPointToScreenPixels,
1752
+ tn as trackerToFeed,
1753
+ Ur as trackerToWorld,
1754
+ Vt as useCameraPermission,
1755
+ Os as useFrameCapture,
1756
+ Ls as useMediaRecorder,
1757
+ Ys as useMuted,
1758
+ Nt as usePersonMaskTexture,
1759
+ Rt as useScreenRectAspect,
1760
+ nr as useXRAsset,
1761
+ qe as useXRAssetCache,
1762
+ ir as useXRAssetStats,
1763
+ nn as useXRCapabilities,
1764
+ er as useXRQuality,
1765
+ cr as useXRTrackingConfig,
1766
+ sn as viewportToFeed,
1767
+ Pr as worldToFeed,
1768
+ rn as worldToScreenPixels,
1769
+ Nr as worldToTracker
716
1770
  };