@vincentt-xr/sdk 2.0.0-alpha.8 → 2.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GROUNDING.md +4643 -170
- package/README.md +1 -0
- package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
- package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
- package/dist/DebuggerUI-7ngnJsBe.js +275 -0
- package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
- package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
- package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
- package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-XE0rQSDn.cjs +2 -0
- package/dist/TextLabel-c9BCucOI.js +961 -0
- package/dist/assets/gltfLoader.d.ts +16 -0
- package/dist/assets/loaders.d.ts +16 -1
- package/dist/body-pose/index.d.ts +521 -0
- package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
- package/dist/body-trigger/frame.d.ts +88 -0
- package/dist/body-trigger/index.d.ts +6 -0
- package/dist/body-trigger/moves.d.ts +235 -0
- package/dist/body-trigger/trigger.d.ts +75 -0
- package/dist/calibration/calibration.d.ts +11 -6
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +69 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
- package/dist/components/BodyTracker/index.d.ts +10 -2
- package/dist/components/BodyTrigger/index.d.ts +49 -0
- package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
- package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
- package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
- package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
- package/dist/components/FaceAtlas/constants.d.ts +8 -0
- package/dist/components/FaceAtlas/index.d.ts +7 -0
- package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
- package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
- package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
- package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
- package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
- package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
- package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
- package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
- package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
- package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
- package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
- package/dist/components/FaceCharacter/index.d.ts +18 -0
- package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
- package/dist/components/FaceInset/FaceInset.d.ts +68 -0
- package/dist/components/FaceInset/frame.d.ts +94 -0
- package/dist/components/FaceInset/index.d.ts +6 -0
- package/dist/components/FaceInset/material.d.ts +40 -0
- package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
- package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
- package/dist/components/FaceInstruction/index.d.ts +56 -0
- package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
- package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
- package/dist/components/FaceLiquify/debug.d.ts +37 -0
- package/dist/components/FaceLiquify/frame.d.ts +55 -0
- package/dist/components/FaceLiquify/index.d.ts +10 -0
- package/dist/components/FaceLiquify/material.d.ts +39 -0
- package/dist/components/FaceLiquify/pass.d.ts +49 -0
- package/dist/components/FaceLiquify/presence.d.ts +25 -0
- package/dist/components/FaceLiquify/presets.d.ts +82 -0
- package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
- package/dist/components/FaceLiquify/target.d.ts +85 -0
- package/dist/components/FaceLiquify/warp.d.ts +72 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +5 -3
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +9 -0
- package/dist/components/FaceMesh/index.d.ts +1 -1
- package/dist/components/FaceRetouch/Background.d.ts +3 -1
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
- package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
- package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
- package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
- package/dist/components/FaceSwap/index.d.ts +13 -0
- package/dist/components/FaceSwap/settings.d.ts +300 -0
- package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
- package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
- package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -3
- package/dist/components/Faceless/Faceless.d.ts +51 -0
- package/dist/components/Faceless/index.d.ts +2 -0
- package/dist/components/HairLock/HairLock.d.ts +39 -0
- package/dist/components/HairLock/index.d.ts +2 -0
- package/dist/components/HairLock/lockGeometry.d.ts +15 -0
- package/dist/components/HandCutout/index.d.ts +35 -0
- package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
- package/dist/components/HandInstruction/index.d.ts +74 -0
- package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandOccluder.d.ts +55 -0
- package/dist/components/HandRig/HandTattoo.d.ts +61 -0
- package/dist/components/HandRig/WristAttachment.d.ts +34 -0
- package/dist/components/HandRig/index.d.ts +101 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +69 -0
- package/dist/components/HandTouch/HandTouch.d.ts +62 -0
- package/dist/components/HandTouch/Touchable.d.ts +36 -0
- package/dist/components/HandTouch/index.d.ts +2 -0
- package/dist/components/HeadBinding/index.d.ts +14 -0
- package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
- package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
- package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
- package/dist/components/HeadOccluder/NeckOccluder.d.ts +64 -0
- package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
- package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
- package/dist/components/HeadOccluder/index.d.ts +57 -3
- package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
- package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
- package/dist/components/Instruction/HintStage.d.ts +29 -0
- package/dist/components/Instruction/InstructionCue.d.ts +126 -0
- package/dist/components/Instruction/gestureHold.d.ts +20 -0
- package/dist/components/Instruction/ghost.d.ts +129 -0
- package/dist/components/Instruction/hintBlend.d.ts +19 -0
- package/dist/components/Instruction/hintLook.d.ts +81 -0
- package/dist/components/Instruction/hintLoop.d.ts +36 -0
- package/dist/components/Instruction/index.d.ts +41 -0
- package/dist/components/Instruction/useGhostModel.d.ts +33 -0
- package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
- package/dist/components/LipEffect/LipEffect.d.ts +22 -2
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +62 -10
- package/dist/components/LipEffect/LipEffects.d.ts +5 -2
- package/dist/components/LipEffect/defaults.d.ts +21 -2
- package/dist/components/LipEffect/index.d.ts +1 -1
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +117 -13
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +82 -10
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +6 -0
- package/dist/components/LipEffect/uvGuide.d.ts +31 -16
- package/dist/components/Makeup/Blush.d.ts +18 -0
- package/dist/components/Makeup/Brows.d.ts +20 -0
- package/dist/components/Makeup/Contour.d.ts +17 -0
- package/dist/components/Makeup/Eyeliner.d.ts +20 -0
- package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
- package/dist/components/Makeup/Highlighter.d.ts +18 -0
- package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
- package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
- package/dist/components/Makeup/constants.d.ts +44 -0
- package/dist/components/Makeup/design.d.ts +106 -0
- package/dist/components/Makeup/designSamples.d.ts +42 -0
- package/dist/components/Makeup/eyes.d.ts +114 -0
- package/dist/components/Makeup/fields.d.ts +10 -0
- package/dist/components/Makeup/geometry.d.ts +106 -0
- package/dist/components/Makeup/index.d.ts +26 -0
- package/dist/components/Makeup/looks.d.ts +28 -0
- package/dist/components/Makeup/material.d.ts +239 -0
- package/dist/components/Makeup/settings.d.ts +54 -0
- package/dist/components/Makeup/shades.d.ts +143 -0
- package/dist/components/Makeup/shapes.d.ts +27 -0
- package/dist/components/Makeup/skinTone.d.ts +135 -0
- package/dist/components/Makeup/types.d.ts +110 -0
- package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
- package/dist/components/ParticleEmitter/index.d.ts +1 -0
- package/dist/components/ShoulderOccluder/index.d.ts +43 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/context-DTxSQvp4.js +13 -0
- package/dist/context-hA0Rb2Xa.cjs +1 -0
- package/dist/contexts-BH7PdKFS.cjs +1 -0
- package/dist/contexts-jak8-tND.js +667 -0
- package/dist/coordinates/index.d.ts +2 -0
- package/dist/coordinates/side.d.ts +40 -0
- package/dist/debug-ui/default-setting.cjs +2 -2
- package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/index.d.ts +4 -3
- package/dist/debug-ui/media-source/index.d.ts +1 -1
- package/dist/debug-ui/media-source/session.d.ts +30 -2
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
- package/dist/debug-ui/product-hotspots/index.d.ts +3 -2
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
- package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
- package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
- package/dist/debug-ui/settings-panel/index.d.ts +6 -1
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +3 -2
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2250 -2472
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +3 -2
- package/dist/entries/face-effects.d.ts +114 -8
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +2 -1
- package/dist/entries/low-level.d.ts +28 -1
- package/dist/entries/particles.d.ts +11 -0
- package/dist/entries/tracking.d.ts +37 -2
- package/dist/face-atlas/attributes.d.ts +30 -0
- package/dist/face-atlas/eyes.d.ts +272 -0
- package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
- package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
- package/dist/face-atlas/glsl/common.d.ts +55 -0
- package/dist/face-atlas/glsl/design.d.ts +49 -0
- package/dist/face-atlas/glsl/eyes.d.ts +73 -0
- package/dist/face-atlas/glsl/finish.d.ts +24 -0
- package/dist/face-atlas/glsl/format.d.ts +4 -0
- package/dist/face-atlas/glsl/index.d.ts +59 -0
- package/dist/face-atlas/glsl/shading.d.ts +15 -0
- package/dist/face-atlas/glsl/shapes.d.ts +66 -0
- package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
- package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
- package/dist/face-atlas/guide.d.ts +51 -0
- package/dist/face-atlas/index.d.ts +25 -0
- package/dist/face-atlas/lead.d.ts +117 -0
- package/dist/face-atlas/madeUpCamera.d.ts +125 -0
- package/dist/face-atlas/masks.d.ts +53 -0
- package/dist/face-atlas/obj.d.ts +69 -0
- package/dist/face-atlas/polylines.d.ts +63 -0
- package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
- package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
- package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
- package/dist/face-atlas/probe/constants.d.ts +137 -0
- package/dist/face-atlas/probe/glsl.d.ts +43 -0
- package/dist/face-atlas/probe/lightFit.d.ts +108 -0
- package/dist/face-atlas/probe/schedule.d.ts +44 -0
- package/dist/face-atlas/probe/selfTest.d.ts +87 -0
- package/dist/face-atlas/probe/stats.d.ts +143 -0
- package/dist/face-atlas/probe/targets.d.ts +70 -0
- package/dist/face-atlas/probe/unwrap.d.ts +76 -0
- package/dist/face-atlas/quality.d.ts +28 -0
- package/dist/face-atlas/regions.d.ts +31 -0
- package/dist/face-atlas/registry.d.ts +252 -0
- package/dist/face-atlas/renderState.d.ts +86 -0
- package/dist/face-atlas/selfOcclusion.d.ts +62 -0
- package/dist/face-atlas/shading.d.ts +406 -0
- package/dist/face-atlas/shapes.d.ts +86 -0
- package/dist/face-atlas/sides.d.ts +41 -0
- package/dist/face-atlas/skinMask.d.ts +35 -0
- package/dist/face-atlas/surface.d.ts +155 -0
- package/dist/face-atlas/topology.d.ts +44 -0
- package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
- package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
- package/dist/face-character/bindFaceModel.d.ts +106 -0
- package/dist/face-character/canonicalFace.d.ts +17 -0
- package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
- package/dist/face-character/canonicalFacePositions.d.ts +7 -0
- package/dist/face-character/driveFaceModel.d.ts +57 -0
- package/dist/face-character/expressionOutputs.d.ts +45 -0
- package/dist/face-character/faceExpressions.d.ts +104 -0
- package/dist/face-character/faceImageLandmarker.d.ts +93 -0
- package/dist/face-character/faceMeshBinding.d.ts +62 -0
- package/dist/face-character/faceMorph.d.ts +77 -0
- package/dist/face-character/faceMorphs.d.ts +46 -0
- package/dist/face-character/facePhoto.d.ts +138 -0
- package/dist/face-character/facePiercings.d.ts +116 -0
- package/dist/face-character/facePin.d.ts +131 -0
- package/dist/face-character/faceReprojection.d.ts +273 -0
- package/dist/face-character/faceReprojector.d.ts +171 -0
- package/dist/face-character/faceRig.d.ts +176 -0
- package/dist/face-character/faceSwapPresence.d.ts +85 -0
- package/dist/face-character/faceTexture.d.ts +169 -0
- package/dist/face-character/faceTextureBaker.d.ts +86 -0
- package/dist/face-character/faceTextureGuide.d.ts +106 -0
- package/dist/face-character/faceTextureStats.d.ts +298 -0
- package/dist/face-character/faceTransfer.d.ts +396 -0
- package/dist/face-character/faceTransferGeometry.d.ts +109 -0
- package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
- package/dist/face-character/faceWarp3D.d.ts +101 -0
- package/dist/face-character/faceless.d.ts +79 -0
- package/dist/face-character/featureWarp.d.ts +28 -0
- package/dist/face-character/liveFaceRegistry.d.ts +370 -0
- package/dist/face-character/liveValue.d.ts +12 -0
- package/dist/face-character/memo.d.ts +15 -0
- package/dist/face-effects.cjs +2252 -83
- package/dist/face-effects.js +14234 -1231
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/landmarks.d.ts +17 -3
- package/dist/face-info/types.d.ts +20 -3
- package/dist/gestures/definitions.d.ts +15 -2
- package/dist/gestures/index.d.ts +1 -1
- package/dist/gestures/measures.d.ts +21 -8
- package/dist/getFaceInfo-B1otSDMX.cjs +1 -0
- package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +178 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handPose.d.ts +98 -0
- package/dist/hand/handRigSolver.d.ts +159 -0
- package/dist/hand/handTattoo.d.ts +81 -0
- package/dist/hand/handTouch.d.ts +240 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/selectors.d.ts +8 -0
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useTrackerContext.d.ts +6 -0
- package/dist/index-B1_TzJaI.js +1104 -0
- package/dist/index-BavF06C6.js +190 -0
- package/dist/index-BfFmpddl.cjs +21 -0
- package/dist/index-BuBzneeW.cjs +46 -0
- package/dist/index-CGsQWodV.cjs +1 -0
- package/dist/index-CIe7eCMH.js +3200 -0
- package/dist/index-CfSF8LXa.cjs +1 -0
- package/dist/index-D5GTzOzD.cjs +1 -0
- package/dist/index-DBhQzvVa.js +314 -0
- package/dist/index-DE17y0ZI.cjs +1 -0
- package/dist/index-JII7huPk.js +442 -0
- package/dist/index-tpCr9CLj.cjs +1 -0
- package/dist/{renderPasses-NnKZVfBy.js → index-w1S7fI2B.js} +219 -247
- package/dist/index-zGaqrz_K.js +188 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1507 -0
- package/dist/{internal-vsfNQycj.js → internal-B90P-clC.js} +138 -118
- package/dist/internal-Cjinca64.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +15 -10
- package/dist/iris/compute.d.ts +7 -5
- package/dist/iris/types.d.ts +6 -4
- package/dist/{landmarkMask-CbTFzBYG.js → landmarkMask-BFDyBnKM.js} +6 -6
- package/dist/landmarks-BlUqf5MZ.cjs +1 -0
- package/dist/landmarks-bftdwq6Z.js +76 -0
- package/dist/loaders-BGAUACsd.js +363 -0
- package/dist/loaders-BJ1_QCHt.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +666 -602
- package/dist/main.cjs +1 -1
- package/dist/main.js +866 -1182
- package/dist/models/Body/index.d.ts +2 -0
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +3 -11
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/HandTracking.d.ts +17 -1
- package/dist/models/Segmentation/index.d.ts +2 -0
- package/dist/models/nodeSource.d.ts +9 -0
- package/dist/particles/emission.d.ts +24 -0
- package/dist/particles/eyes.d.ts +24 -0
- package/dist/particles/glsl.d.ts +14 -0
- package/dist/particles/index.d.ts +10 -0
- package/dist/particles/motion.d.ts +42 -0
- package/dist/particles/presets.d.ts +12 -0
- package/dist/particles/ring.d.ts +58 -0
- package/dist/particles/selfTest.d.ts +53 -0
- package/dist/particles/settings.d.ts +127 -0
- package/dist/particles/shapes.d.ts +29 -0
- package/dist/particles/spawner.d.ts +60 -0
- package/dist/particles/system.d.ts +64 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +774 -0
- package/dist/product.cjs +1 -1
- package/dist/product.js +29 -29
- package/dist/{providers-C0Dlhh9Z.js → providers-C8rE26Uf.js} +127 -126
- package/dist/providers-DHsrhDI2.cjs +62 -0
- package/dist/render/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-CN1cGFUo.js → renderGroups-B38pUaX2.js} +1 -1
- package/dist/{renderGroups-O4KmaMl9.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
- package/dist/renderPasses-B6l8IpJv.js +1290 -0
- package/dist/renderPasses-dqmkft4P.cjs +158 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/segmentation-Cb3ouK6Z.js +1758 -0
- package/dist/segmentation-D9pYO6aR.cjs +1 -0
- package/dist/segmentation2d/types.d.ts +6 -0
- package/dist/select-Ck5LGz-J.cjs +1 -0
- package/dist/select-pYRo_win.js +233 -0
- package/dist/selectors-C4X71aoD.cjs +1 -0
- package/dist/selectors-DmNaKIwE.js +196 -0
- package/dist/session-BrH8G7iJ.cjs +31 -0
- package/dist/session-DgA_z6O1.js +418 -0
- package/dist/{settings-aQk845NJ.js → settings-BJ7FMBsO.js} +53 -15
- package/dist/settings-C63FMBlF.cjs +1 -0
- package/dist/similarityFit-BFqHND2e.cjs +1 -0
- package/dist/similarityFit-Bbz-R8AY.js +91 -0
- package/dist/spring/index.d.ts +2 -0
- package/dist/spring/spring.d.ts +69 -0
- package/dist/spring/swing.d.ts +54 -0
- package/dist/tracking.cjs +10 -1
- package/dist/tracking.js +1002 -855
- package/dist/trigger-D0Pm9noT.cjs +49 -0
- package/dist/trigger-IQeys0oS.js +2128 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/hand-tracking.d.ts +9 -0
- package/dist/types/nodes.d.ts +20 -1
- package/dist/types/segmentation.d.ts +5 -0
- package/dist/updateThrottle-BseecYag.js +4 -0
- package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
- package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
- package/dist/useFaceInfo-J4x7LsqL.js +76 -0
- package/dist/useFaceResultReader-BvEo5REG.js +61 -0
- package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/{useXRCapabilities-B1R2ghy-.cjs → useXRCapabilities-Cr3RzuAW.cjs} +1 -1
- package/dist/{useXRCapabilities-C68v__wB.js → useXRCapabilities-Cxmlmpbd.js} +1 -1
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +17 -0
- package/dist/utils/resolveNumFaces.d.ts +13 -0
- package/dist/utils/shoulderOccluderFit.d.ts +38 -0
- package/dist/utils/similarityFit.d.ts +23 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-CsUdQ-pn.js → uv-DJU_XfmN.js} +15 -249
- package/docs/SDK_DOCUMENTATION.md +1 -2
- package/docs/api/adaptive-quality.mdx +1 -1
- package/docs/api/body-instructions.mdx +285 -0
- package/docs/api/body-triggers.mdx +234 -0
- package/docs/api/camera-permission.mdx +1 -1
- package/docs/api/coordinate-spaces.mdx +7 -4
- package/docs/api/cross-camera.mdx +3 -2
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +20 -16
- package/docs/api/face-attribute-expression.mdx +1 -1
- package/docs/api/face-binding-anchors.mdx +4 -2
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +3 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +17 -11
- package/docs/api/face-inset.mdx +204 -0
- package/docs/api/face-instructions.mdx +183 -0
- package/docs/api/face-liquify.mdx +196 -0
- package/docs/api/face-mesh.mdx +4 -7
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +7 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +18 -10
- package/docs/api/face-swap.mdx +350 -0
- package/docs/api/face-warp-3d.mdx +166 -0
- package/docs/api/faceless.mdx +143 -0
- package/docs/api/gestures.mdx +68 -32
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +535 -0
- package/docs/api/hand-touch.mdx +162 -0
- package/docs/api/head-occluder.mdx +563 -0
- package/docs/api/holistic-tracker.mdx +6 -1
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +24 -19
- package/docs/api/made-up-camera.mdx +131 -0
- package/docs/api/makeup-skin-tone.mdx +135 -0
- package/docs/api/makeup.mdx +353 -0
- package/docs/api/multi-subject.mdx +4 -1
- package/docs/api/particles.mdx +155 -0
- package/docs/api/person-cutout.mdx +1 -1
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +5 -2
- package/docs/api/segmentation-overlay.mdx +1 -1
- package/docs/docs.json +29 -1
- package/docs/examples/lip-shaders.mdx +82 -33
- package/docs/guides/face-atlas-template.svg +1 -0
- package/docs/guides/face-atlas-textures.mdx +186 -0
- package/docs/guides/face-texture-template.svg +1 -0
- package/docs/guides/harness-debug-ui.mdx +4 -4
- package/docs/guides/lip-effect-textures.mdx +178 -102
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -1
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/introduction.mdx +1 -2
- package/package.json +11 -1
- package/dist/DebuggerUI-C-ldiozL.js +0 -269
- package/dist/DebuggerUI-CWX5EtQv.cjs +0 -1
- package/dist/FaceMeshRenderer-BEEXZwS6.cjs +0 -158
- package/dist/FaceMeshRenderer-UuH5sTXG.js +0 -1322
- package/dist/FaceRetouch-C7h7x9kd.js +0 -683
- package/dist/FaceRetouch-DqftT26Y.cjs +0 -134
- package/dist/GLTFLoader-C5q63sKO.js +0 -1633
- package/dist/GLTFLoader-Cb_CRwmG.cjs +0 -1
- package/dist/SegmentationOverlay-DQuW3dsc.js +0 -133
- package/dist/SegmentationOverlay-aWVod8Kl.cjs +0 -1
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
- package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
- package/dist/components/FaceWarp3D/warp.d.ts +0 -13
- package/dist/contexts-CO0sd4JQ.cjs +0 -1
- package/dist/contexts-FzlnnMYD.js +0 -669
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/getFaceInfo-BkZfaQs-.js +0 -118
- package/dist/getFaceInfo-ahPxQFGu.cjs +0 -1
- package/dist/index--RgGzZ6X.cjs +0 -47
- package/dist/index-CHVbH0hz.js +0 -214
- package/dist/index-CeVkgsag.cjs +0 -1
- package/dist/index-CnGox6Xr.js +0 -3054
- package/dist/index-DKBAh6hV.cjs +0 -1
- package/dist/index-DsZwTfG0.cjs +0 -1
- package/dist/index-Dw6tj2Mi.js +0 -144
- package/dist/index-OCPjOaeP.cjs +0 -1
- package/dist/index-s9pF4zkG.js +0 -2053
- package/dist/internal-BYza1h8_.cjs +0 -1
- package/dist/measures-9dQPdw96.js +0 -154
- package/dist/measures-KfJzpvod.cjs +0 -1
- package/dist/providers-YNwkmNeK.cjs +0 -62
- package/dist/renderPasses-Cg-zqmEz.cjs +0 -21
- package/dist/screenTransform-BenfCtZt.js +0 -44
- package/dist/screenTransform-BiXdpVf0.cjs +0 -1
- package/dist/segmentation-9PhSvc-R.cjs +0 -1
- package/dist/segmentation-CeOTKemr.js +0 -5
- package/dist/selectors-C5G1PMYL.js +0 -195
- package/dist/selectors-Du_PsVnW.cjs +0 -1
- package/dist/session-BBr0yN8h.cjs +0 -31
- package/dist/session-Cy0m7l7-.js +0 -363
- package/dist/settings-DRR7-snV.cjs +0 -1
- package/dist/useFaceInfo-Blf7FCu3.js +0 -303
- package/dist/useFaceInfo-C5mO8NQY.cjs +0 -1
package/dist/low-level.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { u as ie, X as
|
|
2
|
-
import {
|
|
3
|
-
import { u as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { PerspectiveCamera as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { H as
|
|
15
|
-
import { h as
|
|
16
|
-
import { X as
|
|
17
|
-
import { B as Hr, M as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
|
|
1
|
+
import { u as ie, X as H, v as he, ab as P, m as ge, d as ye, a1 as be, s as we, z as ee } from "./index-CIe7eCMH.js";
|
|
2
|
+
import { E as kt, af as _t, ar as Lt, as as Ot, ad as Dt, ah as Xt, x as Ht, ap as Bt, at as Nt, ai as Pt, l as zt, ac as $t, ag as Vt, aj as Wt, g as Gt, ak as Ut, al as qt, am as jt, aq as Kt, e as Yt, an as Qt, ao as Jt, ae as Zt } from "./index-CIe7eCMH.js";
|
|
3
|
+
import { H as ta, u as aa } from "./index-BavF06C6.js";
|
|
4
|
+
import { u as Se } from "./landmarks-bftdwq6Z.js";
|
|
5
|
+
import { b as ve } from "./selectors-DmNaKIwE.js";
|
|
6
|
+
import { m as na, l as sa, c as ia, f as oa, g as la, p as da, h as ca, e as ua, i as ma, n as pa, q as fa, a as ha, u as ga, d as ya, o as ba, k as wa, j as Sa } from "./selectors-DmNaKIwE.js";
|
|
7
|
+
import { useEffect as k, useState as T, useRef as L, useCallback as xe, useLayoutEffect as Re, useMemo as U, Children as Ce, isValidElement as Ee } from "react";
|
|
8
|
+
import { c as Te } from "./getFaceInfo-Cu4xDWiL.js";
|
|
9
|
+
import { a as xa, b as Ra } from "./getFaceInfo-Cu4xDWiL.js";
|
|
10
|
+
import { jsx as w, jsxs as O, Fragment as $ } from "react/jsx-runtime";
|
|
11
|
+
import { PerspectiveCamera as Me } from "@react-three/drei";
|
|
12
|
+
import { g as Ea, b as Ta, c as Ma } from "./index-zGaqrz_K.js";
|
|
13
|
+
import { R as oe } from "./trigger-IQeys0oS.js";
|
|
14
|
+
import { ah as Fa, ad as Ia, ai as ka, Z as _a, S as La, ao as Oa, a2 as Da, a5 as Xa, H as Ha, ap as Ba, aq as Na, a as Pa, O as za, U as $a, _ as Va, au as Wa, as as Ga, at as Ua, ae as qa, l as ja, n as Ka, i as Ya, a3 as Qa, aa as Ja, av as Za, aj as er, ar as tr, V as ar, ak as rr, al as nr, a6 as sr, a7 as ir, a8 as or, a9 as lr, af as dr, b as cr, d as ur, g as mr, e as pr, f as fr, h as hr, m as gr, c as yr, a4 as br, $ as wr, a0 as Sr, am as vr, j as xr, ab as Rr, a1 as Cr, s as Er, k as Tr, X as Mr, Y as Ar, aw as Fr, ax as Ir, ag as kr, an as _r, ac as Lr } from "./trigger-IQeys0oS.js";
|
|
15
|
+
import { h as Dr } from "./hasFullUnitUVBounds-BGvcFsQM.js";
|
|
16
|
+
import { X as Ae, a as Fe, b as Ie } from "./contexts-jak8-tND.js";
|
|
17
|
+
import { B as Hr, M as Br, h as Nr, i as Pr, T as zr, c as $r, j as Vr, k as Wr, g as Gr, e as Ur, f as qr, r as jr, t as Kr, d as Yr, u as Qr } from "./contexts-jak8-tND.js";
|
|
18
|
+
import { H as Zr, v as en, w as tn, x as an, y as rn, o as nn, z as sn, b as on, t as ln, p as dn, l as cn, s as un, n as mn } from "./index-JII7huPk.js";
|
|
19
|
+
import { c as fn, g as hn, s as gn, a as yn } from "./detector-K8aej4MB.js";
|
|
20
|
+
import { F as wn, i as Sn, I as vn, M as xn, S as Rn, l as Cn, j as En, t as Tn, k as Mn, c as An, m as Fn, p as In, v as kn, r as _n, s as Ln, n as On, u as Dn, o as Xn, q as Hn, b as Bn, a as Nn } from "./providers-C8rE26Uf.js";
|
|
21
|
+
import { S as zn, u as $n } from "./context-DTxSQvp4.js";
|
|
22
|
+
import * as X from "three";
|
|
23
|
+
const z = ({
|
|
22
24
|
children: e,
|
|
23
25
|
config: t,
|
|
24
|
-
style:
|
|
25
|
-
}) => /* @__PURE__ */
|
|
26
|
+
style: r
|
|
27
|
+
}) => /* @__PURE__ */ w(
|
|
26
28
|
"div",
|
|
27
29
|
{
|
|
28
30
|
"data-render-target": t.name,
|
|
@@ -34,88 +36,88 @@ const B = ({
|
|
|
34
36
|
pointerEvents: t.pointerEvents ?? "none",
|
|
35
37
|
zIndex: t.zIndex,
|
|
36
38
|
opacity: t.hidden ? 0 : 1,
|
|
37
|
-
...
|
|
39
|
+
...r
|
|
38
40
|
},
|
|
39
41
|
children: e
|
|
40
42
|
}
|
|
41
|
-
),
|
|
43
|
+
), q = ({
|
|
42
44
|
canvas: e,
|
|
43
45
|
layout: t,
|
|
44
|
-
media:
|
|
45
|
-
mirrored:
|
|
46
|
+
media: r,
|
|
47
|
+
mirrored: a,
|
|
46
48
|
filter: n
|
|
47
49
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
e.width !==
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
const d = Math.round(t.destination.width), u = Math.round(t.destination.height);
|
|
51
|
+
e.width !== d && (e.width = d), e.height !== u && (e.height = u);
|
|
52
|
+
const c = e.getContext("2d");
|
|
53
|
+
c && (c.setTransform(1, 0, 0, 1, 0, 0), c.clearRect(0, 0, d, u), a && (c.translate(d, 0), c.scale(-1, 1)), n && (c.filter = n), c.drawImage(r, t.offsetX, t.offsetY, t.drawWidth, t.drawHeight), n && (c.filter = "none"), c.setTransform(1, 0, 0, 1, 0, 0));
|
|
52
54
|
}, le = ({
|
|
53
55
|
canvasRef: e,
|
|
54
56
|
enabled: t = !0,
|
|
55
|
-
fps:
|
|
56
|
-
imageRef:
|
|
57
|
+
fps: r = 30,
|
|
58
|
+
imageRef: a,
|
|
57
59
|
layout: n,
|
|
58
|
-
mirrored:
|
|
60
|
+
mirrored: d,
|
|
59
61
|
sourceKind: u,
|
|
60
|
-
videoRef:
|
|
62
|
+
videoRef: c
|
|
61
63
|
}) => {
|
|
62
|
-
|
|
64
|
+
k(() => {
|
|
63
65
|
if (!t) {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
+
const f = e.current, g = f == null ? void 0 : f.getContext("2d");
|
|
67
|
+
f && g && g.clearRect(0, 0, f.width, f.height);
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
68
|
-
let i = 0,
|
|
69
|
-
const h =
|
|
70
|
-
if (i = requestAnimationFrame(s), h > 0 &&
|
|
71
|
-
|
|
70
|
+
let i = 0, p = 0;
|
|
71
|
+
const h = r > 0 ? 1e3 / r : 0, s = (f) => {
|
|
72
|
+
if (i = requestAnimationFrame(s), h > 0 && f - p < h) return;
|
|
73
|
+
p = f;
|
|
72
74
|
const g = e.current;
|
|
73
75
|
if (!g || !n) return;
|
|
74
76
|
if (u === "image") {
|
|
75
|
-
const l =
|
|
77
|
+
const l = a.current;
|
|
76
78
|
if (!l || !l.complete || l.naturalWidth <= 0 || l.naturalHeight <= 0)
|
|
77
79
|
return;
|
|
78
|
-
|
|
80
|
+
q({
|
|
79
81
|
canvas: g,
|
|
80
82
|
layout: n,
|
|
81
83
|
media: l,
|
|
82
|
-
mirrored:
|
|
84
|
+
mirrored: d
|
|
83
85
|
});
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
86
|
-
const o =
|
|
87
|
-
!o || o.readyState < 2 || o.videoWidth <= 0 || o.videoHeight <= 0 ||
|
|
88
|
+
const o = c.current;
|
|
89
|
+
!o || o.readyState < 2 || o.videoWidth <= 0 || o.videoHeight <= 0 || q({
|
|
88
90
|
canvas: g,
|
|
89
91
|
layout: n,
|
|
90
92
|
media: o,
|
|
91
|
-
mirrored:
|
|
93
|
+
mirrored: d
|
|
92
94
|
});
|
|
93
95
|
};
|
|
94
96
|
return i = requestAnimationFrame(s), () => {
|
|
95
97
|
cancelAnimationFrame(i);
|
|
96
98
|
};
|
|
97
|
-
}, [e, t,
|
|
98
|
-
},
|
|
99
|
+
}, [e, t, r, a, n, d, u, c]);
|
|
100
|
+
}, ke = ({
|
|
99
101
|
canvasRef: e,
|
|
100
102
|
imageRef: t,
|
|
101
|
-
layer:
|
|
102
|
-
layout:
|
|
103
|
+
layer: r,
|
|
104
|
+
layout: a,
|
|
103
105
|
mirrored: n,
|
|
104
|
-
onCaptureTarget:
|
|
106
|
+
onCaptureTarget: d,
|
|
105
107
|
sourceKind: u,
|
|
106
|
-
videoRef:
|
|
108
|
+
videoRef: c
|
|
107
109
|
}) => (le({
|
|
108
110
|
canvasRef: e,
|
|
109
111
|
imageRef: t,
|
|
110
|
-
layout:
|
|
112
|
+
layout: a,
|
|
111
113
|
mirrored: n,
|
|
112
114
|
sourceKind: u,
|
|
113
|
-
videoRef:
|
|
114
|
-
}),
|
|
115
|
+
videoRef: c
|
|
116
|
+
}), k(() => {
|
|
115
117
|
const i = e.current;
|
|
116
118
|
if (i)
|
|
117
|
-
return
|
|
118
|
-
}, [e,
|
|
119
|
+
return d == null || d(i), () => d == null ? void 0 : d(void 0);
|
|
120
|
+
}, [e, d]), /* @__PURE__ */ w(z, { config: r, children: /* @__PURE__ */ w(
|
|
119
121
|
"canvas",
|
|
120
122
|
{
|
|
121
123
|
ref: e,
|
|
@@ -131,28 +133,28 @@ const B = ({
|
|
|
131
133
|
) })), St = ({
|
|
132
134
|
canvasRef: e,
|
|
133
135
|
controlInsetTop: t,
|
|
134
|
-
debugVisible:
|
|
135
|
-
fps:
|
|
136
|
+
debugVisible: r,
|
|
137
|
+
fps: a = 15,
|
|
136
138
|
imageRef: n,
|
|
137
|
-
layer:
|
|
139
|
+
layer: d,
|
|
138
140
|
layout: u,
|
|
139
|
-
mirrored:
|
|
141
|
+
mirrored: c,
|
|
140
142
|
sourceKind: i,
|
|
141
|
-
videoRef:
|
|
143
|
+
videoRef: p,
|
|
142
144
|
viewportSize: h
|
|
143
145
|
}) => {
|
|
144
146
|
le({
|
|
145
147
|
canvasRef: e,
|
|
146
|
-
enabled:
|
|
147
|
-
fps:
|
|
148
|
+
enabled: r,
|
|
149
|
+
fps: a,
|
|
148
150
|
imageRef: n,
|
|
149
151
|
layout: u,
|
|
150
|
-
mirrored:
|
|
152
|
+
mirrored: c,
|
|
151
153
|
sourceKind: i,
|
|
152
|
-
videoRef:
|
|
154
|
+
videoRef: p
|
|
153
155
|
});
|
|
154
|
-
const s = Math.min(220, Math.max(120, h.width * 0.22)),
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
+
const s = Math.min(220, Math.max(120, h.width * 0.22)), f = h.width > 0 && h.height > 0 ? h.width / h.height : 1, g = Math.min(h.height - 24, Math.max(t ?? 16, 16));
|
|
157
|
+
return /* @__PURE__ */ w(z, { config: d, children: /* @__PURE__ */ w(
|
|
156
158
|
"canvas",
|
|
157
159
|
{
|
|
158
160
|
ref: e,
|
|
@@ -160,52 +162,52 @@ const B = ({
|
|
|
160
162
|
position: "absolute",
|
|
161
163
|
left: 16,
|
|
162
164
|
top: g,
|
|
163
|
-
width:
|
|
164
|
-
height:
|
|
165
|
-
aspectRatio: `${
|
|
166
|
-
opacity:
|
|
165
|
+
width: r ? s : 1,
|
|
166
|
+
height: r ? "auto" : 1,
|
|
167
|
+
aspectRatio: `${f}`,
|
|
168
|
+
opacity: r ? 0.85 : 0,
|
|
167
169
|
borderRadius: 10,
|
|
168
|
-
border:
|
|
170
|
+
border: r ? "1px solid rgba(255,255,255,0.16)" : "none",
|
|
169
171
|
pointerEvents: "none",
|
|
170
172
|
objectFit: "contain",
|
|
171
173
|
background: "#000"
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
) });
|
|
175
|
-
},
|
|
177
|
+
}, _e = {
|
|
176
178
|
audio: !1,
|
|
177
179
|
video: {
|
|
178
180
|
facingMode: "user",
|
|
179
181
|
frameRate: { ideal: 30, max: 60 }
|
|
180
182
|
}
|
|
181
|
-
},
|
|
183
|
+
}, Le = {
|
|
182
184
|
name: "viewport-live",
|
|
183
185
|
clearColor: "#000000",
|
|
184
186
|
pointerEvents: "none",
|
|
185
187
|
zIndex: 0
|
|
186
|
-
},
|
|
188
|
+
}, Oe = {
|
|
187
189
|
name: "viewport-ui",
|
|
188
190
|
clearColor: "transparent",
|
|
189
191
|
pointerEvents: "auto",
|
|
190
192
|
zIndex: 5
|
|
191
|
-
},
|
|
193
|
+
}, De = {
|
|
192
194
|
name: "viewport-scene",
|
|
193
195
|
clearColor: "transparent",
|
|
194
196
|
pointerEvents: "auto",
|
|
195
197
|
zIndex: 1
|
|
196
|
-
},
|
|
198
|
+
}, D = {
|
|
197
199
|
webcam: { icon: "◉", label: "Webcam" },
|
|
198
200
|
image: { icon: "▣", label: "Images" },
|
|
199
201
|
video: { icon: "▶", label: "Videos" }
|
|
200
|
-
},
|
|
202
|
+
}, Xe = ({
|
|
201
203
|
imageRef: e,
|
|
202
204
|
selectedSource: t,
|
|
203
|
-
videoRef:
|
|
204
|
-
}) => /* @__PURE__ */
|
|
205
|
-
/* @__PURE__ */
|
|
205
|
+
videoRef: r
|
|
206
|
+
}) => /* @__PURE__ */ O($, { children: [
|
|
207
|
+
/* @__PURE__ */ w(
|
|
206
208
|
"video",
|
|
207
209
|
{
|
|
208
|
-
ref:
|
|
210
|
+
ref: r,
|
|
209
211
|
style: {
|
|
210
212
|
position: "absolute",
|
|
211
213
|
width: 1,
|
|
@@ -215,7 +217,7 @@ const B = ({
|
|
|
215
217
|
}
|
|
216
218
|
}
|
|
217
219
|
),
|
|
218
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ w(
|
|
219
221
|
"img",
|
|
220
222
|
{
|
|
221
223
|
ref: e,
|
|
@@ -232,10 +234,10 @@ const B = ({
|
|
|
232
234
|
] }), te = ({
|
|
233
235
|
dock: e,
|
|
234
236
|
label: t,
|
|
235
|
-
onChange:
|
|
236
|
-
options:
|
|
237
|
+
onChange: r,
|
|
238
|
+
options: a,
|
|
237
239
|
value: n
|
|
238
|
-
}) => /* @__PURE__ */
|
|
240
|
+
}) => /* @__PURE__ */ w(
|
|
239
241
|
"div",
|
|
240
242
|
{
|
|
241
243
|
style: {
|
|
@@ -252,7 +254,7 @@ const B = ({
|
|
|
252
254
|
boxShadow: "0 12px 30px rgba(0,0,0,0.18)",
|
|
253
255
|
backdropFilter: "blur(10px)"
|
|
254
256
|
},
|
|
255
|
-
children: /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ O(
|
|
256
258
|
"label",
|
|
257
259
|
{
|
|
258
260
|
style: {
|
|
@@ -263,12 +265,12 @@ const B = ({
|
|
|
263
265
|
fontWeight: 700
|
|
264
266
|
},
|
|
265
267
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ w("span", { children: t }),
|
|
269
|
+
/* @__PURE__ */ w(
|
|
268
270
|
"select",
|
|
269
271
|
{
|
|
270
272
|
value: n,
|
|
271
|
-
onChange: (
|
|
273
|
+
onChange: (d) => r(d.target.value),
|
|
272
274
|
style: {
|
|
273
275
|
minWidth: 180,
|
|
274
276
|
maxWidth: "calc(100vw - 52px)",
|
|
@@ -279,27 +281,27 @@ const B = ({
|
|
|
279
281
|
color: "#e5eefb",
|
|
280
282
|
padding: "0 10px"
|
|
281
283
|
},
|
|
282
|
-
children:
|
|
284
|
+
children: a.map((d) => /* @__PURE__ */ w("option", { value: d.id, style: { color: "#111827" }, children: d.label }, d.id))
|
|
283
285
|
}
|
|
284
286
|
)
|
|
285
287
|
]
|
|
286
288
|
}
|
|
287
289
|
)
|
|
288
290
|
}
|
|
289
|
-
),
|
|
291
|
+
), He = ({
|
|
290
292
|
dock: e,
|
|
291
293
|
imageOptions: t,
|
|
292
|
-
selectedImageId:
|
|
293
|
-
selectedSource:
|
|
294
|
+
selectedImageId: r,
|
|
295
|
+
selectedSource: a,
|
|
294
296
|
selectedVideoId: n,
|
|
295
|
-
setSelectedImageId:
|
|
297
|
+
setSelectedImageId: d,
|
|
296
298
|
setSelectedSource: u,
|
|
297
|
-
setSelectedVideoId:
|
|
299
|
+
setSelectedVideoId: c,
|
|
298
300
|
showMediaControls: i,
|
|
299
|
-
videoOptions:
|
|
301
|
+
videoOptions: p
|
|
300
302
|
}) => {
|
|
301
|
-
const [h, s] =
|
|
302
|
-
return i ? h ? /* @__PURE__ */
|
|
303
|
+
const [h, s] = T(!1), f = ["webcam", "image", "video"].filter((g) => g === "image" ? t.length > 0 : g === "video" ? p.length > 0 : !0);
|
|
304
|
+
return i ? h ? /* @__PURE__ */ w(
|
|
303
305
|
"button",
|
|
304
306
|
{
|
|
305
307
|
type: "button",
|
|
@@ -324,8 +326,8 @@ const B = ({
|
|
|
324
326
|
},
|
|
325
327
|
children: "≡"
|
|
326
328
|
}
|
|
327
|
-
) : /* @__PURE__ */
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
+
) : /* @__PURE__ */ O($, { children: [
|
|
330
|
+
/* @__PURE__ */ O(
|
|
329
331
|
"div",
|
|
330
332
|
{
|
|
331
333
|
style: {
|
|
@@ -340,7 +342,7 @@ const B = ({
|
|
|
340
342
|
maxWidth: "calc(100vw - 32px)"
|
|
341
343
|
},
|
|
342
344
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ w(
|
|
344
346
|
"div",
|
|
345
347
|
{
|
|
346
348
|
style: {
|
|
@@ -355,15 +357,15 @@ const B = ({
|
|
|
355
357
|
backdropFilter: "blur(10px)",
|
|
356
358
|
overflowX: "auto"
|
|
357
359
|
},
|
|
358
|
-
children:
|
|
359
|
-
const o = g ===
|
|
360
|
-
return /* @__PURE__ */
|
|
360
|
+
children: f.map((g) => {
|
|
361
|
+
const o = g === a;
|
|
362
|
+
return /* @__PURE__ */ O(
|
|
361
363
|
"button",
|
|
362
364
|
{
|
|
363
365
|
type: "button",
|
|
364
366
|
onClick: () => u(g),
|
|
365
367
|
"aria-pressed": o,
|
|
366
|
-
title:
|
|
368
|
+
title: D[g].label,
|
|
367
369
|
style: {
|
|
368
370
|
border: "none",
|
|
369
371
|
borderRadius: 999,
|
|
@@ -380,8 +382,8 @@ const B = ({
|
|
|
380
382
|
flex: "0 0 auto"
|
|
381
383
|
},
|
|
382
384
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ w("span", { style: { fontSize: 14, lineHeight: 1 }, children: D[g].icon }),
|
|
386
|
+
/* @__PURE__ */ w("span", { style: { fontSize: 12, fontWeight: 700, letterSpacing: "0.01em" }, children: D[g].label })
|
|
385
387
|
]
|
|
386
388
|
},
|
|
387
389
|
g
|
|
@@ -389,7 +391,7 @@ const B = ({
|
|
|
389
391
|
})
|
|
390
392
|
}
|
|
391
393
|
),
|
|
392
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ w(
|
|
393
395
|
"button",
|
|
394
396
|
{
|
|
395
397
|
type: "button",
|
|
@@ -414,46 +416,46 @@ const B = ({
|
|
|
414
416
|
]
|
|
415
417
|
}
|
|
416
418
|
),
|
|
417
|
-
|
|
419
|
+
a === "image" && t.length > 0 && /* @__PURE__ */ w(
|
|
418
420
|
te,
|
|
419
421
|
{
|
|
420
422
|
dock: e,
|
|
421
423
|
label: "Image Asset",
|
|
422
424
|
options: t,
|
|
423
|
-
value:
|
|
424
|
-
onChange:
|
|
425
|
+
value: r,
|
|
426
|
+
onChange: d
|
|
425
427
|
}
|
|
426
428
|
),
|
|
427
|
-
|
|
429
|
+
a === "video" && p.length > 0 && /* @__PURE__ */ w(
|
|
428
430
|
te,
|
|
429
431
|
{
|
|
430
432
|
dock: e,
|
|
431
433
|
label: "Video Asset",
|
|
432
|
-
options:
|
|
434
|
+
options: p,
|
|
433
435
|
value: n,
|
|
434
|
-
onChange:
|
|
436
|
+
onChange: c
|
|
435
437
|
}
|
|
436
438
|
)
|
|
437
439
|
] }) : null;
|
|
438
|
-
},
|
|
440
|
+
}, Be = ({
|
|
439
441
|
containerRef: e,
|
|
440
442
|
displayCanvasRef: t,
|
|
441
|
-
imageOptions:
|
|
442
|
-
imageRef:
|
|
443
|
+
imageOptions: r,
|
|
444
|
+
imageRef: a,
|
|
443
445
|
layout: n,
|
|
444
|
-
managesOwnMedia:
|
|
446
|
+
managesOwnMedia: d,
|
|
445
447
|
mediaDock: u,
|
|
446
|
-
mode:
|
|
448
|
+
mode: c,
|
|
447
449
|
overlayContent: i,
|
|
448
|
-
renderOutputs:
|
|
450
|
+
renderOutputs: p,
|
|
449
451
|
sceneContent: h,
|
|
450
452
|
selectedImageId: s,
|
|
451
|
-
selectedSource:
|
|
453
|
+
selectedSource: f,
|
|
452
454
|
selectedVideoId: g,
|
|
453
455
|
setSceneRenderOutputs: o,
|
|
454
456
|
setSelectedImageId: l,
|
|
455
457
|
setSelectedSource: m,
|
|
456
|
-
setSelectedVideoId:
|
|
458
|
+
setSelectedVideoId: b,
|
|
457
459
|
showMediaControls: S,
|
|
458
460
|
style: R,
|
|
459
461
|
videoOptions: x,
|
|
@@ -461,8 +463,8 @@ const B = ({
|
|
|
461
463
|
viewportSize: v,
|
|
462
464
|
mirrored: y
|
|
463
465
|
}) => {
|
|
464
|
-
const { session:
|
|
465
|
-
return /* @__PURE__ */
|
|
466
|
+
const { session: M } = ie();
|
|
467
|
+
return /* @__PURE__ */ O(
|
|
466
468
|
"div",
|
|
467
469
|
{
|
|
468
470
|
ref: e,
|
|
@@ -474,45 +476,45 @@ const B = ({
|
|
|
474
476
|
...R
|
|
475
477
|
},
|
|
476
478
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
479
|
-
|
|
479
|
+
/* @__PURE__ */ w(Xe, { imageRef: a, selectedSource: f, videoRef: E }),
|
|
480
|
+
c === "dom" && d && /* @__PURE__ */ w(
|
|
481
|
+
ke,
|
|
480
482
|
{
|
|
481
483
|
canvasRef: t,
|
|
482
|
-
imageRef:
|
|
484
|
+
imageRef: a,
|
|
483
485
|
videoRef: E,
|
|
484
|
-
layer:
|
|
486
|
+
layer: Le,
|
|
485
487
|
layout: n,
|
|
486
488
|
mirrored: y,
|
|
487
|
-
onCaptureTarget:
|
|
488
|
-
sourceKind:
|
|
489
|
+
onCaptureTarget: M._setCaptureTarget,
|
|
490
|
+
sourceKind: f === "image" ? "image" : "video"
|
|
489
491
|
}
|
|
490
492
|
),
|
|
491
|
-
(
|
|
492
|
-
|
|
493
|
+
(c === "r3f" || c === "hybrid") && /* @__PURE__ */ w(z, { config: De, children: /* @__PURE__ */ w(
|
|
494
|
+
Ae,
|
|
493
495
|
{
|
|
494
496
|
onRenderOutputs: o,
|
|
495
497
|
renderOutputs: {
|
|
496
|
-
sceneColor:
|
|
497
|
-
sceneDepth:
|
|
498
|
+
sceneColor: p.sceneColor || p.finalColor,
|
|
499
|
+
sceneDepth: p.sceneDepth
|
|
498
500
|
},
|
|
499
501
|
renderTargetSize: v,
|
|
500
502
|
style: { width: "100%", height: "100%" },
|
|
501
503
|
children: h
|
|
502
504
|
}
|
|
503
505
|
) }),
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
|
|
506
|
-
|
|
506
|
+
/* @__PURE__ */ O(z, { config: Oe, children: [
|
|
507
|
+
d && /* @__PURE__ */ w(
|
|
508
|
+
He,
|
|
507
509
|
{
|
|
508
510
|
dock: u,
|
|
509
|
-
imageOptions:
|
|
511
|
+
imageOptions: r,
|
|
510
512
|
selectedImageId: s,
|
|
511
|
-
selectedSource:
|
|
513
|
+
selectedSource: f,
|
|
512
514
|
selectedVideoId: g,
|
|
513
515
|
setSelectedImageId: l,
|
|
514
516
|
setSelectedSource: m,
|
|
515
|
-
setSelectedVideoId:
|
|
517
|
+
setSelectedVideoId: b,
|
|
516
518
|
showMediaControls: S,
|
|
517
519
|
videoOptions: x
|
|
518
520
|
}
|
|
@@ -522,46 +524,46 @@ const B = ({
|
|
|
522
524
|
]
|
|
523
525
|
}
|
|
524
526
|
);
|
|
525
|
-
},
|
|
527
|
+
}, Ne = 5, Pe = 1, ze = (e, t) => t, $e = "brightness(2.2) contrast(1.5) saturate(1.25)", Ve = ({
|
|
526
528
|
enabled: e,
|
|
527
529
|
displayMirrored: t,
|
|
528
|
-
imageRef:
|
|
529
|
-
layout:
|
|
530
|
+
imageRef: r,
|
|
531
|
+
layout: a,
|
|
530
532
|
mode: n,
|
|
531
|
-
numFaces:
|
|
533
|
+
numFaces: d,
|
|
532
534
|
selectedSource: u,
|
|
533
|
-
sourceStream:
|
|
535
|
+
sourceStream: c,
|
|
534
536
|
videoRef: i
|
|
535
537
|
}) => {
|
|
536
|
-
const { session:
|
|
538
|
+
const { session: p } = ie(), h = L(null), s = L(!1), f = L(document.createElement("canvas")), {
|
|
537
539
|
ready: g,
|
|
538
540
|
node: o,
|
|
539
541
|
error: l
|
|
540
|
-
} = Se(
|
|
541
|
-
numFaces:
|
|
542
|
-
}), [m,
|
|
542
|
+
} = Se(H.FACE_TRACKER, {
|
|
543
|
+
numFaces: d ?? (n === "head-binding" ? Pe : Ne)
|
|
544
|
+
}), [m, b] = T("idle"), [S, R] = T(null), x = e && g && !!o, E = oe({
|
|
543
545
|
node: x ? o : null,
|
|
544
546
|
enabled: x,
|
|
545
547
|
selectedSource: u,
|
|
546
548
|
onFrame: xe(() => {
|
|
547
|
-
R(null),
|
|
549
|
+
R(null), b("ready");
|
|
548
550
|
}, [])
|
|
549
551
|
});
|
|
550
|
-
return
|
|
551
|
-
if (!e || !
|
|
552
|
+
return k(() => {
|
|
553
|
+
if (!e || !a) return;
|
|
552
554
|
const v = () => {
|
|
553
|
-
const C = u === "image" ?
|
|
555
|
+
const C = u === "image" ? r.current : i.current;
|
|
554
556
|
if (C) {
|
|
555
557
|
if (C instanceof HTMLImageElement) {
|
|
556
558
|
if (!C.complete || C.naturalWidth <= 0 || C.naturalHeight <= 0) return;
|
|
557
559
|
} else if (C.readyState < 2 || C.videoWidth <= 0 || C.videoHeight <= 0)
|
|
558
560
|
return;
|
|
559
|
-
|
|
560
|
-
canvas:
|
|
561
|
-
layout:
|
|
561
|
+
q({
|
|
562
|
+
canvas: f.current,
|
|
563
|
+
layout: a,
|
|
562
564
|
media: C,
|
|
563
565
|
mirrored: t,
|
|
564
|
-
filter: u === "webcam" ?
|
|
566
|
+
filter: u === "webcam" ? $e : void 0
|
|
565
567
|
});
|
|
566
568
|
}
|
|
567
569
|
};
|
|
@@ -570,75 +572,75 @@ const B = ({
|
|
|
570
572
|
return;
|
|
571
573
|
}
|
|
572
574
|
let y = 0;
|
|
573
|
-
const
|
|
574
|
-
y = requestAnimationFrame(
|
|
575
|
+
const M = () => {
|
|
576
|
+
y = requestAnimationFrame(M), v();
|
|
575
577
|
};
|
|
576
|
-
return y = requestAnimationFrame(
|
|
577
|
-
}, [t, e,
|
|
578
|
-
var
|
|
578
|
+
return y = requestAnimationFrame(M), () => cancelAnimationFrame(y);
|
|
579
|
+
}, [t, e, r, a, u, i]), k(() => {
|
|
580
|
+
var B;
|
|
579
581
|
if (!e) {
|
|
580
|
-
|
|
582
|
+
b("idle"), R(null), s.current = !1, h.current = null;
|
|
581
583
|
return;
|
|
582
584
|
}
|
|
583
|
-
if (!
|
|
584
|
-
|
|
585
|
+
if (!a) {
|
|
586
|
+
b("initializing");
|
|
585
587
|
return;
|
|
586
588
|
}
|
|
587
|
-
const v = (
|
|
588
|
-
h.current !==
|
|
589
|
+
const v = (c == null ? void 0 : c.id) ?? (((B = i.current) == null ? void 0 : B.srcObject) instanceof MediaStream ? i.current.srcObject.id : "none"), M = u === "webcam" ? `webcam:${v}` : u;
|
|
590
|
+
h.current !== M && (s.current = !1, h.current = M);
|
|
589
591
|
let C = !1;
|
|
590
592
|
return (async () => {
|
|
591
593
|
try {
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
if (
|
|
595
|
-
canvas:
|
|
594
|
+
b("initializing");
|
|
595
|
+
const I = !s.current;
|
|
596
|
+
if (I && await p.setFrameSource({
|
|
597
|
+
canvas: f.current,
|
|
596
598
|
sourceKind: u
|
|
597
|
-
}), await
|
|
598
|
-
Math.round(
|
|
599
|
-
Math.round(
|
|
600
|
-
),
|
|
601
|
-
R(null),
|
|
602
|
-
} catch (
|
|
599
|
+
}), await p._setRenderSize(
|
|
600
|
+
Math.round(a.destination.width),
|
|
601
|
+
Math.round(a.destination.height)
|
|
602
|
+
), I && (await p.start(), s.current = !0), C) return;
|
|
603
|
+
R(null), b("initializing");
|
|
604
|
+
} catch (I) {
|
|
603
605
|
if (C) return;
|
|
604
|
-
|
|
606
|
+
b("error"), R(I instanceof Error ? I.message : "Failed to initialize SDK face tracking");
|
|
605
607
|
}
|
|
606
608
|
})(), () => {
|
|
607
609
|
C = !0;
|
|
608
610
|
};
|
|
609
|
-
}, [e,
|
|
610
|
-
!x && e && !l &&
|
|
611
|
-
}, [x, e, l]),
|
|
612
|
-
l && (
|
|
613
|
-
}, [l]),
|
|
614
|
-
s.current = !1,
|
|
615
|
-
}, [
|
|
611
|
+
}, [e, a, u, p, c, i]), k(() => {
|
|
612
|
+
!x && e && !l && b("initializing");
|
|
613
|
+
}, [x, e, l]), k(() => {
|
|
614
|
+
l && (b("error"), R(l.message));
|
|
615
|
+
}, [l]), k(() => () => {
|
|
616
|
+
s.current = !1, p.stop();
|
|
617
|
+
}, [p]), {
|
|
616
618
|
activeDelegate: "GPU",
|
|
617
619
|
faces: E,
|
|
618
620
|
status: m,
|
|
619
621
|
error: S
|
|
620
622
|
};
|
|
621
|
-
},
|
|
623
|
+
}, We = (e, t) => e === "auto" ? t === "webcam" ? "cover" : "contain" : e, Ge = ({
|
|
622
624
|
imageOptions: e,
|
|
623
625
|
initialImageId: t,
|
|
624
|
-
initialSource:
|
|
625
|
-
initialVideoId:
|
|
626
|
+
initialSource: r,
|
|
627
|
+
initialVideoId: a,
|
|
626
628
|
source: n,
|
|
627
|
-
videoOptions:
|
|
629
|
+
videoOptions: d
|
|
628
630
|
}) => {
|
|
629
|
-
var i,
|
|
630
|
-
const u = (n == null ? void 0 : n.kind) ??
|
|
631
|
+
var i, p, h, s;
|
|
632
|
+
const u = (n == null ? void 0 : n.kind) ?? r ?? "webcam";
|
|
631
633
|
return {
|
|
632
|
-
selectedSource: u === "image" && e.length === 0 || u === "video" &&
|
|
633
|
-
selectedImageId: (n == null ? void 0 : n.kind) === "image" ? n.assetId ?? ((i = e[0]) == null ? void 0 : i.id) ?? "" : t ?? ((
|
|
634
|
-
selectedVideoId: (n == null ? void 0 : n.kind) === "video" ? n.assetId ?? ((h =
|
|
634
|
+
selectedSource: u === "image" && e.length === 0 || u === "video" && d.length === 0 ? "webcam" : u,
|
|
635
|
+
selectedImageId: (n == null ? void 0 : n.kind) === "image" ? n.assetId ?? ((i = e[0]) == null ? void 0 : i.id) ?? "" : t ?? ((p = e[0]) == null ? void 0 : p.id) ?? "",
|
|
636
|
+
selectedVideoId: (n == null ? void 0 : n.kind) === "video" ? n.assetId ?? ((h = d[0]) == null ? void 0 : h.id) ?? "" : a ?? ((s = d[0]) == null ? void 0 : s.id) ?? ""
|
|
635
637
|
};
|
|
636
|
-
},
|
|
638
|
+
}, Ue = (e, t, r) => {
|
|
637
639
|
if (e.width <= 0 || e.height <= 0 || t.width <= 0 || t.height <= 0)
|
|
638
640
|
return null;
|
|
639
|
-
const
|
|
640
|
-
return
|
|
641
|
-
},
|
|
641
|
+
const a = he(e, t, r);
|
|
642
|
+
return a ? { source: e, destination: t, ...a } : null;
|
|
643
|
+
}, qe = (e) => {
|
|
642
644
|
if (!e) return { width: 0, height: 0 };
|
|
643
645
|
const t = e.getBoundingClientRect();
|
|
644
646
|
return {
|
|
@@ -646,161 +648,161 @@ const B = ({
|
|
|
646
648
|
height: t.height || e.clientHeight
|
|
647
649
|
};
|
|
648
650
|
}, je = (e) => {
|
|
649
|
-
const [t,
|
|
651
|
+
const [t, r] = T({ width: 0, height: 0 });
|
|
650
652
|
return Re(() => {
|
|
651
|
-
const
|
|
652
|
-
if (!
|
|
653
|
+
const a = e.current;
|
|
654
|
+
if (!a) return;
|
|
653
655
|
let n = 0;
|
|
654
|
-
const
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
(h) => h.width ===
|
|
656
|
+
const d = () => {
|
|
657
|
+
const p = qe(a);
|
|
658
|
+
r(
|
|
659
|
+
(h) => h.width === p.width && h.height === p.height ? h : p
|
|
658
660
|
);
|
|
659
661
|
}, u = () => {
|
|
660
|
-
|
|
662
|
+
d(), n && cancelAnimationFrame(n), n = requestAnimationFrame(d);
|
|
661
663
|
};
|
|
662
664
|
u();
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
+
const c = new ResizeObserver(u);
|
|
666
|
+
c.observe(a);
|
|
665
667
|
const i = window.visualViewport;
|
|
666
668
|
return window.addEventListener("resize", u), window.addEventListener("orientationchange", u), i == null || i.addEventListener("resize", u), i == null || i.addEventListener("scroll", u), () => {
|
|
667
|
-
n && cancelAnimationFrame(n),
|
|
669
|
+
n && cancelAnimationFrame(n), c.disconnect(), window.removeEventListener("resize", u), window.removeEventListener("orientationchange", u), i == null || i.removeEventListener("resize", u), i == null || i.removeEventListener("scroll", u);
|
|
668
670
|
};
|
|
669
671
|
}, [e]), t;
|
|
670
672
|
}, Ke = ({
|
|
671
673
|
enabled: e,
|
|
672
674
|
selectedSource: t
|
|
673
675
|
}) => {
|
|
674
|
-
const
|
|
676
|
+
const r = ve(H.FACE_TRACKER);
|
|
675
677
|
return {
|
|
676
|
-
faces: oe({ node:
|
|
677
|
-
trackerStatus:
|
|
678
|
+
faces: oe({ node: r, enabled: e, selectedSource: t }),
|
|
679
|
+
trackerStatus: r ? "ready" : "idle"
|
|
678
680
|
};
|
|
679
|
-
}, re = (e) => {
|
|
680
|
-
e && (e.pause(), e.removeAttribute("src"), e.srcObject = null, e.load());
|
|
681
681
|
}, ae = (e) => {
|
|
682
|
+
e && (e.pause(), e.removeAttribute("src"), e.srcObject = null, e.load());
|
|
683
|
+
}, re = (e) => {
|
|
682
684
|
e && e.removeAttribute("src");
|
|
683
|
-
},
|
|
685
|
+
}, Ye = ({
|
|
684
686
|
enabled: e,
|
|
685
687
|
imageAsset: t,
|
|
686
|
-
selectedSource:
|
|
687
|
-
videoAsset:
|
|
688
|
+
selectedSource: r,
|
|
689
|
+
videoAsset: a
|
|
688
690
|
}) => {
|
|
689
|
-
const n =
|
|
690
|
-
return
|
|
691
|
+
const n = L(null), d = L(null), [u, c] = T(null), [i, p] = T({ width: 0, height: 0 }), [h, s] = T("idle"), [f, g] = T(null);
|
|
692
|
+
return k(() => {
|
|
691
693
|
if (!e) {
|
|
692
|
-
|
|
694
|
+
ae(n.current), re(d.current), c(null), p({ width: 0, height: 0 }), s("idle"), g(null);
|
|
693
695
|
return;
|
|
694
696
|
}
|
|
695
697
|
let o = !1, l = null;
|
|
696
698
|
const m = (v, y) => {
|
|
697
|
-
o || (
|
|
698
|
-
},
|
|
699
|
-
|
|
699
|
+
o || (p({ width: v, height: y }), s("ready"), g(null));
|
|
700
|
+
}, b = () => {
|
|
701
|
+
ae(n.current), re(d.current), l == null || l.getTracks().forEach((v) => v.stop()), l = null, c(null);
|
|
700
702
|
}, S = async () => {
|
|
701
703
|
s("requesting");
|
|
702
|
-
const v = await navigator.mediaDevices.getUserMedia(
|
|
704
|
+
const v = await navigator.mediaDevices.getUserMedia(_e);
|
|
703
705
|
if (o) {
|
|
704
|
-
v.getTracks().forEach((
|
|
706
|
+
v.getTracks().forEach((M) => M.stop());
|
|
705
707
|
return;
|
|
706
708
|
}
|
|
707
|
-
l = v,
|
|
709
|
+
l = v, c(v);
|
|
708
710
|
const y = n.current;
|
|
709
711
|
y && (y.srcObject = v, y.muted = !0, y.playsInline = !0, y.autoplay = !0, await y.play(), m(y.videoWidth, y.videoHeight));
|
|
710
712
|
}, R = async (v) => {
|
|
711
|
-
s("requesting"),
|
|
713
|
+
s("requesting"), c(null);
|
|
712
714
|
const y = n.current;
|
|
713
715
|
y && (y.src = v, y.muted = !0, y.loop = !0, y.playsInline = !0, y.autoplay = !0, y.crossOrigin = "anonymous", await y.play(), m(y.videoWidth, y.videoHeight));
|
|
714
716
|
}, x = async (v) => {
|
|
715
|
-
s("requesting"),
|
|
716
|
-
const y =
|
|
717
|
-
y && (await new Promise((
|
|
718
|
-
y.onload = () =>
|
|
717
|
+
s("requesting"), c(null);
|
|
718
|
+
const y = d.current;
|
|
719
|
+
y && (await new Promise((M, C) => {
|
|
720
|
+
y.onload = () => M(), y.onerror = () => C(new Error("Unable to load image")), y.src = v;
|
|
719
721
|
}), m(y.naturalWidth, y.naturalHeight));
|
|
720
722
|
};
|
|
721
|
-
return
|
|
723
|
+
return b(), (async () => {
|
|
722
724
|
try {
|
|
723
|
-
if (
|
|
725
|
+
if (r === "webcam") {
|
|
724
726
|
await S();
|
|
725
727
|
return;
|
|
726
728
|
}
|
|
727
|
-
if (
|
|
728
|
-
if (!(
|
|
729
|
-
await R(
|
|
729
|
+
if (r === "video") {
|
|
730
|
+
if (!(a != null && a.src)) throw new Error("Missing video source");
|
|
731
|
+
await R(a.src);
|
|
730
732
|
return;
|
|
731
733
|
}
|
|
732
734
|
if (!(t != null && t.src)) throw new Error("Missing image source");
|
|
733
735
|
await x(t.src);
|
|
734
736
|
} catch (v) {
|
|
735
737
|
if (o) return;
|
|
736
|
-
s("error"), g(v instanceof Error ? v.message : `Unable to initialize ${
|
|
738
|
+
s("error"), g(v instanceof Error ? v.message : `Unable to initialize ${r}`);
|
|
737
739
|
}
|
|
738
740
|
})(), () => {
|
|
739
|
-
o = !0,
|
|
741
|
+
o = !0, b();
|
|
740
742
|
};
|
|
741
|
-
}, [e, t,
|
|
743
|
+
}, [e, t, r, a]), {
|
|
742
744
|
videoRef: n,
|
|
743
|
-
imageRef:
|
|
745
|
+
imageRef: d,
|
|
744
746
|
stream: u,
|
|
745
747
|
mediaSize: i,
|
|
746
748
|
status: h,
|
|
747
|
-
error:
|
|
749
|
+
error: f
|
|
748
750
|
};
|
|
749
|
-
},
|
|
751
|
+
}, Qe = ({
|
|
750
752
|
enabled: e,
|
|
751
753
|
imageRef: t,
|
|
752
|
-
selectedSource:
|
|
753
|
-
status:
|
|
754
|
+
selectedSource: r,
|
|
755
|
+
status: a,
|
|
754
756
|
videoRef: n
|
|
755
757
|
}) => {
|
|
756
|
-
const [
|
|
757
|
-
return
|
|
758
|
-
if (!e ||
|
|
759
|
-
u((
|
|
758
|
+
const [d, u] = T(null);
|
|
759
|
+
return k(() => {
|
|
760
|
+
if (!e || a !== "ready") {
|
|
761
|
+
u((p) => (p == null || p.dispose(), null));
|
|
760
762
|
return;
|
|
761
763
|
}
|
|
762
|
-
const
|
|
763
|
-
if (!
|
|
764
|
-
const i =
|
|
765
|
-
return i.colorSpace =
|
|
764
|
+
const c = r === "image" ? t.current : n.current;
|
|
765
|
+
if (!c) return;
|
|
766
|
+
const i = r === "image" ? new X.Texture(c) : new X.VideoTexture(c);
|
|
767
|
+
return i.colorSpace = X.SRGBColorSpace, i.minFilter = X.LinearFilter, i.magFilter = X.LinearFilter, i.generateMipmaps = !1, i.needsUpdate = !0, u((p) => (p == null || p.dispose(), i)), () => {
|
|
766
768
|
i.dispose();
|
|
767
769
|
};
|
|
768
|
-
}, [e, t,
|
|
770
|
+
}, [e, t, r, a, n]), d;
|
|
769
771
|
}, Je = ({
|
|
770
772
|
externalTracker: e,
|
|
771
773
|
imageOptions: t,
|
|
772
|
-
layout:
|
|
773
|
-
managesOwnMedia:
|
|
774
|
+
layout: r,
|
|
775
|
+
managesOwnMedia: a,
|
|
774
776
|
mediaError: n,
|
|
775
|
-
mediaFitMode:
|
|
777
|
+
mediaFitMode: d,
|
|
776
778
|
mediaSize: u,
|
|
777
|
-
mediaStatus:
|
|
779
|
+
mediaStatus: c,
|
|
778
780
|
mirrored: i,
|
|
779
|
-
selectedImage:
|
|
781
|
+
selectedImage: p,
|
|
780
782
|
selectedImageId: h,
|
|
781
783
|
selectedSource: s,
|
|
782
|
-
selectedVideo:
|
|
784
|
+
selectedVideo: f,
|
|
783
785
|
selectedVideoId: g,
|
|
784
786
|
setMirrored: o,
|
|
785
787
|
setSelectedImageId: l,
|
|
786
788
|
setSelectedSource: m,
|
|
787
|
-
setSelectedVideoId:
|
|
789
|
+
setSelectedVideoId: b,
|
|
788
790
|
setShowMediaControls: S,
|
|
789
791
|
showMediaControls: R,
|
|
790
792
|
tracker: x,
|
|
791
793
|
videoOptions: E,
|
|
792
794
|
viewportSize: v
|
|
793
795
|
}) => {
|
|
794
|
-
const y = s === "image" ? `${
|
|
796
|
+
const y = s === "image" ? `${D.image.label}: ${(p == null ? void 0 : p.label) ?? ""}` : s === "video" ? `${D.video.label}: ${(f == null ? void 0 : f.label) ?? ""}` : D.webcam.label;
|
|
795
797
|
return {
|
|
796
|
-
activeDelegate:
|
|
797
|
-
faces:
|
|
798
|
+
activeDelegate: a ? x.activeDelegate : null,
|
|
799
|
+
faces: a ? x.faces : e.faces,
|
|
798
800
|
imageOptions: t,
|
|
799
|
-
layout:
|
|
801
|
+
layout: r,
|
|
800
802
|
mediaError: n,
|
|
801
|
-
mediaFitMode:
|
|
803
|
+
mediaFitMode: d,
|
|
802
804
|
mediaLabel: y,
|
|
803
|
-
mediaStatus:
|
|
805
|
+
mediaStatus: c,
|
|
804
806
|
mirrored: i,
|
|
805
807
|
selectedImageId: h,
|
|
806
808
|
selectedSource: s,
|
|
@@ -808,11 +810,11 @@ const B = ({
|
|
|
808
810
|
setMirrored: o,
|
|
809
811
|
setSelectedImageId: l,
|
|
810
812
|
setSelectedSource: m,
|
|
811
|
-
setSelectedVideoId:
|
|
813
|
+
setSelectedVideoId: b,
|
|
812
814
|
setShowMediaControls: S,
|
|
813
815
|
showMediaControls: R,
|
|
814
|
-
trackerError:
|
|
815
|
-
trackerStatus:
|
|
816
|
+
trackerError: a ? x.error : null,
|
|
817
|
+
trackerStatus: a ? x.status : e.trackerStatus,
|
|
816
818
|
videoOptions: E,
|
|
817
819
|
viewportSize: v,
|
|
818
820
|
mediaSize: u
|
|
@@ -820,100 +822,100 @@ const B = ({
|
|
|
820
822
|
}, Ze = ({
|
|
821
823
|
mediaTexture: e,
|
|
822
824
|
previewMode: t,
|
|
823
|
-
renderOutputs:
|
|
824
|
-
sceneRenderOutputs:
|
|
825
|
-
}) =>
|
|
825
|
+
renderOutputs: r,
|
|
826
|
+
sceneRenderOutputs: a
|
|
827
|
+
}) => U(
|
|
826
828
|
() => ({
|
|
827
|
-
requested:
|
|
829
|
+
requested: r,
|
|
828
830
|
previewMode: t,
|
|
829
831
|
mediaColorTexture: e,
|
|
830
|
-
sceneColorTexture:
|
|
831
|
-
finalColorTexture:
|
|
832
|
-
sceneDepthTexture:
|
|
832
|
+
sceneColorTexture: a.sceneColorTexture,
|
|
833
|
+
finalColorTexture: r.finalColor ? a.sceneColorTexture : null,
|
|
834
|
+
sceneDepthTexture: a.sceneDepthTexture,
|
|
833
835
|
estimatedDepthTexture: null,
|
|
834
836
|
available: {
|
|
835
837
|
mediaColor: e !== null,
|
|
836
|
-
sceneColor:
|
|
837
|
-
finalColor: !!(
|
|
838
|
-
sceneDepth:
|
|
838
|
+
sceneColor: a.sceneColorTexture !== null,
|
|
839
|
+
finalColor: !!(r.finalColor && a.sceneColorTexture),
|
|
840
|
+
sceneDepth: a.sceneDepthTexture !== null,
|
|
839
841
|
estimatedDepth: !1
|
|
840
842
|
}
|
|
841
843
|
}),
|
|
842
|
-
[e, t,
|
|
844
|
+
[e, t, r, a]
|
|
843
845
|
), et = ({
|
|
844
846
|
fitMode: e,
|
|
845
847
|
imageOptions: t,
|
|
846
|
-
initialImageId:
|
|
847
|
-
initialMirrored:
|
|
848
|
+
initialImageId: r,
|
|
849
|
+
initialMirrored: a,
|
|
848
850
|
initialSource: n,
|
|
849
|
-
initialVideoId:
|
|
851
|
+
initialVideoId: d,
|
|
850
852
|
mediaStrategy: u,
|
|
851
|
-
previewMode:
|
|
853
|
+
previewMode: c,
|
|
852
854
|
renderOutputs: i,
|
|
853
|
-
showMediaControlsByDefault:
|
|
855
|
+
showMediaControlsByDefault: p,
|
|
854
856
|
source: h,
|
|
855
857
|
videoOptions: s
|
|
856
858
|
}) => {
|
|
857
|
-
const
|
|
858
|
-
() =>
|
|
859
|
+
const f = L(null), g = L(null), o = je(f), l = U(
|
|
860
|
+
() => Ge({
|
|
859
861
|
imageOptions: t,
|
|
860
|
-
initialImageId:
|
|
862
|
+
initialImageId: r,
|
|
861
863
|
initialSource: n,
|
|
862
|
-
initialVideoId:
|
|
864
|
+
initialVideoId: d,
|
|
863
865
|
source: h,
|
|
864
866
|
videoOptions: s
|
|
865
867
|
}),
|
|
866
|
-
[t,
|
|
867
|
-
), [m,
|
|
868
|
+
[t, r, n, d, h, s]
|
|
869
|
+
), [m, b] = T(a), [S, R] = T(p), [x, E] = T(
|
|
868
870
|
l.selectedSource
|
|
869
|
-
), [v, y] =
|
|
871
|
+
), [v, y] = T(l.selectedImageId), [M, C] = T(l.selectedVideoId), [Q, B] = T({
|
|
870
872
|
sceneColorTexture: null,
|
|
871
873
|
sceneDepthTexture: null
|
|
872
|
-
}),
|
|
873
|
-
|
|
874
|
+
}), I = u === "internal";
|
|
875
|
+
k(() => {
|
|
874
876
|
h && (E(l.selectedSource), y(l.selectedImageId), C(l.selectedVideoId));
|
|
875
877
|
}, [l, h]);
|
|
876
|
-
const J = t.find((
|
|
877
|
-
enabled:
|
|
878
|
+
const J = t.find((G) => G.id === v) ?? t[0], Z = s.find((G) => G.id === M) ?? s[0], A = Ye({
|
|
879
|
+
enabled: I,
|
|
878
880
|
imageAsset: J,
|
|
879
881
|
selectedSource: x,
|
|
880
882
|
videoAsset: Z
|
|
881
|
-
}),
|
|
882
|
-
() =>
|
|
883
|
-
[
|
|
884
|
-
),
|
|
883
|
+
}), V = We(e, x), N = U(
|
|
884
|
+
() => Ue(A.mediaSize, o, V),
|
|
885
|
+
[A.mediaSize, V, o]
|
|
886
|
+
), ce = Qe({
|
|
885
887
|
enabled: !!(i.mediaColor || i.finalColor),
|
|
886
|
-
imageRef:
|
|
888
|
+
imageRef: A.imageRef,
|
|
887
889
|
selectedSource: x,
|
|
888
|
-
status:
|
|
889
|
-
videoRef:
|
|
890
|
-
}),
|
|
891
|
-
displayMirrored:
|
|
892
|
-
enabled:
|
|
893
|
-
imageRef:
|
|
894
|
-
layout:
|
|
890
|
+
status: A.status,
|
|
891
|
+
videoRef: A.videoRef
|
|
892
|
+
}), W = ze(x, m), ue = Ve({
|
|
893
|
+
displayMirrored: W,
|
|
894
|
+
enabled: I && A.status === "ready" && N !== null,
|
|
895
|
+
imageRef: A.imageRef,
|
|
896
|
+
layout: N,
|
|
895
897
|
selectedSource: x,
|
|
896
|
-
sourceStream:
|
|
897
|
-
videoRef:
|
|
898
|
+
sourceStream: A.stream,
|
|
899
|
+
videoRef: A.videoRef
|
|
898
900
|
}), me = Ke({
|
|
899
|
-
enabled: !
|
|
901
|
+
enabled: !I,
|
|
900
902
|
selectedSource: x
|
|
901
|
-
}),
|
|
903
|
+
}), pe = Je({
|
|
902
904
|
externalTracker: me,
|
|
903
905
|
imageOptions: t,
|
|
904
|
-
layout:
|
|
905
|
-
managesOwnMedia:
|
|
906
|
-
mediaError:
|
|
907
|
-
mediaFitMode:
|
|
908
|
-
mediaSize:
|
|
909
|
-
mediaStatus:
|
|
910
|
-
mirrored:
|
|
906
|
+
layout: N,
|
|
907
|
+
managesOwnMedia: I,
|
|
908
|
+
mediaError: A.error,
|
|
909
|
+
mediaFitMode: V,
|
|
910
|
+
mediaSize: A.mediaSize,
|
|
911
|
+
mediaStatus: A.status,
|
|
912
|
+
mirrored: W,
|
|
911
913
|
selectedImage: J,
|
|
912
914
|
selectedImageId: v,
|
|
913
915
|
selectedSource: x,
|
|
914
916
|
selectedVideo: Z,
|
|
915
|
-
selectedVideoId:
|
|
916
|
-
setMirrored:
|
|
917
|
+
selectedVideoId: M,
|
|
918
|
+
setMirrored: b,
|
|
917
919
|
setSelectedImageId: y,
|
|
918
920
|
setSelectedSource: E,
|
|
919
921
|
setSelectedVideoId: C,
|
|
@@ -922,117 +924,117 @@ const B = ({
|
|
|
922
924
|
tracker: ue,
|
|
923
925
|
videoOptions: s,
|
|
924
926
|
viewportSize: o
|
|
925
|
-
}),
|
|
926
|
-
mediaTexture:
|
|
927
|
-
previewMode:
|
|
927
|
+
}), fe = Ze({
|
|
928
|
+
mediaTexture: ce,
|
|
929
|
+
previewMode: c,
|
|
928
930
|
renderOutputs: i,
|
|
929
|
-
sceneRenderOutputs:
|
|
931
|
+
sceneRenderOutputs: Q
|
|
930
932
|
});
|
|
931
933
|
return {
|
|
932
|
-
containerRef:
|
|
934
|
+
containerRef: f,
|
|
933
935
|
displayCanvasRef: g,
|
|
934
|
-
displayMirrored:
|
|
935
|
-
layout:
|
|
936
|
-
managesOwnMedia:
|
|
937
|
-
media:
|
|
938
|
-
renderOutputState:
|
|
939
|
-
renderState:
|
|
936
|
+
displayMirrored: W,
|
|
937
|
+
layout: N,
|
|
938
|
+
managesOwnMedia: I,
|
|
939
|
+
media: A,
|
|
940
|
+
renderOutputState: fe,
|
|
941
|
+
renderState: pe,
|
|
940
942
|
selectedImageId: v,
|
|
941
943
|
selectedSource: x,
|
|
942
|
-
selectedVideoId:
|
|
943
|
-
setSceneRenderOutputs:
|
|
944
|
+
selectedVideoId: M,
|
|
945
|
+
setSceneRenderOutputs: B,
|
|
944
946
|
setSelectedImageId: y,
|
|
945
947
|
setSelectedSource: E,
|
|
946
948
|
setSelectedVideoId: C,
|
|
947
949
|
showMediaControls: S,
|
|
948
950
|
viewportSize: o
|
|
949
951
|
};
|
|
950
|
-
}, K = ({ children: e }) => /* @__PURE__ */
|
|
952
|
+
}, K = ({ children: e }) => /* @__PURE__ */ w($, { children: e });
|
|
951
953
|
K.displayName = "XRViewport.Scene";
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
+
const Y = ({ children: e }) => /* @__PURE__ */ w($, { children: e });
|
|
955
|
+
Y.displayName = "XRViewport.Overlay";
|
|
954
956
|
const tt = (e, t) => {
|
|
955
957
|
if (e === "dom")
|
|
956
958
|
return {
|
|
957
959
|
sceneContent: null,
|
|
958
960
|
overlayContent: t
|
|
959
961
|
};
|
|
960
|
-
let
|
|
962
|
+
let r = null, a = null;
|
|
961
963
|
const n = [];
|
|
962
|
-
return Ce.forEach(t, (
|
|
963
|
-
var
|
|
964
|
-
if (!Ee(
|
|
965
|
-
|
|
964
|
+
return Ce.forEach(t, (d) => {
|
|
965
|
+
var c;
|
|
966
|
+
if (!Ee(d)) {
|
|
967
|
+
d != null && n.push(d);
|
|
966
968
|
return;
|
|
967
969
|
}
|
|
968
|
-
const u = (
|
|
970
|
+
const u = (c = d.type) == null ? void 0 : c.displayName;
|
|
969
971
|
if (u === K.displayName) {
|
|
970
|
-
|
|
972
|
+
r = d.props.children;
|
|
971
973
|
return;
|
|
972
974
|
}
|
|
973
|
-
if (u ===
|
|
974
|
-
|
|
975
|
+
if (u === Y.displayName) {
|
|
976
|
+
a = d.props.children;
|
|
975
977
|
return;
|
|
976
978
|
}
|
|
977
|
-
n.push(
|
|
978
|
-
}), !
|
|
979
|
-
sceneContent:
|
|
980
|
-
overlayContent:
|
|
979
|
+
n.push(d);
|
|
980
|
+
}), !a && n.length > 0 && (a = n), {
|
|
981
|
+
sceneContent: r,
|
|
982
|
+
overlayContent: a
|
|
981
983
|
};
|
|
982
984
|
}, ne = (e, t) => typeof e == "function" ? e(t) : e;
|
|
983
|
-
function
|
|
984
|
-
return e.Scene = K, e.Overlay =
|
|
985
|
+
function at(e) {
|
|
986
|
+
return e.Scene = K, e.Overlay = Y, e;
|
|
985
987
|
}
|
|
986
|
-
const vt =
|
|
988
|
+
const vt = at(({
|
|
987
989
|
children: e,
|
|
988
990
|
fitMode: t = "auto",
|
|
989
|
-
imageOptions:
|
|
990
|
-
initialImageId:
|
|
991
|
+
imageOptions: r = [],
|
|
992
|
+
initialImageId: a,
|
|
991
993
|
initialMirrored: n = !0,
|
|
992
|
-
initialSource:
|
|
994
|
+
initialSource: d = "webcam",
|
|
993
995
|
initialVideoId: u,
|
|
994
|
-
mediaStrategy:
|
|
996
|
+
mediaStrategy: c = "internal",
|
|
995
997
|
mediaDock: i = "bottom-left",
|
|
996
|
-
mode:
|
|
998
|
+
mode: p = "dom",
|
|
997
999
|
previewMode: h = "finalColor",
|
|
998
1000
|
renderOutputs: s = {},
|
|
999
|
-
showMediaControlsByDefault:
|
|
1001
|
+
showMediaControlsByDefault: f = !0,
|
|
1000
1002
|
source: g,
|
|
1001
1003
|
style: o,
|
|
1002
1004
|
videoOptions: l = []
|
|
1003
1005
|
}) => {
|
|
1004
1006
|
const m = et({
|
|
1005
1007
|
fitMode: t,
|
|
1006
|
-
imageOptions:
|
|
1007
|
-
initialImageId:
|
|
1008
|
+
imageOptions: r,
|
|
1009
|
+
initialImageId: a,
|
|
1008
1010
|
initialMirrored: n,
|
|
1009
|
-
initialSource:
|
|
1011
|
+
initialSource: d,
|
|
1010
1012
|
initialVideoId: u,
|
|
1011
|
-
mediaStrategy:
|
|
1013
|
+
mediaStrategy: c,
|
|
1012
1014
|
previewMode: h,
|
|
1013
1015
|
renderOutputs: s,
|
|
1014
|
-
showMediaControlsByDefault:
|
|
1016
|
+
showMediaControlsByDefault: f,
|
|
1015
1017
|
source: g,
|
|
1016
1018
|
videoOptions: l
|
|
1017
|
-
}),
|
|
1019
|
+
}), b = typeof e == "function" ? e(m.renderState) : e, { sceneContent: S, overlayContent: R } = tt(p, b), x = ne(
|
|
1018
1020
|
S,
|
|
1019
1021
|
m.renderState
|
|
1020
1022
|
), E = ne(
|
|
1021
1023
|
R,
|
|
1022
1024
|
m.renderState
|
|
1023
1025
|
);
|
|
1024
|
-
return /* @__PURE__ */
|
|
1025
|
-
|
|
1026
|
+
return /* @__PURE__ */ w(Fe.Provider, { value: m.renderState, children: /* @__PURE__ */ w(Ie.Provider, { value: m.renderOutputState, children: /* @__PURE__ */ w(
|
|
1027
|
+
Be,
|
|
1026
1028
|
{
|
|
1027
1029
|
containerRef: m.containerRef,
|
|
1028
1030
|
displayCanvasRef: m.displayCanvasRef,
|
|
1029
|
-
imageOptions:
|
|
1031
|
+
imageOptions: r,
|
|
1030
1032
|
imageRef: m.media.imageRef,
|
|
1031
1033
|
layout: m.layout,
|
|
1032
1034
|
managesOwnMedia: m.managesOwnMedia,
|
|
1033
1035
|
mediaDock: i,
|
|
1034
1036
|
mirrored: m.displayMirrored,
|
|
1035
|
-
mode:
|
|
1037
|
+
mode: p,
|
|
1036
1038
|
overlayContent: E,
|
|
1037
1039
|
renderOutputs: s,
|
|
1038
1040
|
sceneContent: x,
|
|
@@ -1050,7 +1052,7 @@ const vt = rt(({
|
|
|
1050
1052
|
viewportSize: m.viewportSize
|
|
1051
1053
|
}
|
|
1052
1054
|
) }) });
|
|
1053
|
-
}),
|
|
1055
|
+
}), rt = {
|
|
1054
1056
|
position: "absolute",
|
|
1055
1057
|
top: -28,
|
|
1056
1058
|
left: 0,
|
|
@@ -1064,10 +1066,10 @@ const vt = rt(({
|
|
|
1064
1066
|
}, xt = ({
|
|
1065
1067
|
boundingBox: e,
|
|
1066
1068
|
label: t = "face bounding box",
|
|
1067
|
-
color:
|
|
1068
|
-
style:
|
|
1069
|
+
color: r = "#22c55e",
|
|
1070
|
+
style: a,
|
|
1069
1071
|
labelStyle: n
|
|
1070
|
-
}) => /* @__PURE__ */
|
|
1072
|
+
}) => /* @__PURE__ */ w(
|
|
1071
1073
|
"div",
|
|
1072
1074
|
{
|
|
1073
1075
|
style: {
|
|
@@ -1076,13 +1078,13 @@ const vt = rt(({
|
|
|
1076
1078
|
top: `${e.top * 100}%`,
|
|
1077
1079
|
width: `${e.width * 100}%`,
|
|
1078
1080
|
height: `${e.height * 100}%`,
|
|
1079
|
-
border: `3px solid ${
|
|
1081
|
+
border: `3px solid ${r}`,
|
|
1080
1082
|
boxSizing: "border-box",
|
|
1081
1083
|
pointerEvents: "none",
|
|
1082
1084
|
zIndex: 20,
|
|
1083
|
-
...
|
|
1085
|
+
...a
|
|
1084
1086
|
},
|
|
1085
|
-
children: t !== null && /* @__PURE__ */
|
|
1087
|
+
children: t !== null && /* @__PURE__ */ w("div", { style: { ...rt, ...n }, children: t })
|
|
1086
1088
|
}
|
|
1087
1089
|
), j = [
|
|
1088
1090
|
{
|
|
@@ -1161,7 +1163,7 @@ const vt = rt(({
|
|
|
1161
1163
|
{
|
|
1162
1164
|
id: "rear-camera",
|
|
1163
1165
|
title: "Rear camera",
|
|
1164
|
-
steps: "Switch front → rear on /camera
|
|
1166
|
+
steps: "Switch front → rear on /camera.",
|
|
1165
1167
|
expect: "Rear feed is straight (text readable); tracking stays aligned.",
|
|
1166
1168
|
mode: "manual",
|
|
1167
1169
|
layer: "lifecycle"
|
|
@@ -1206,24 +1208,24 @@ const vt = rt(({
|
|
|
1206
1208
|
mode: "manual",
|
|
1207
1209
|
layer: "performance"
|
|
1208
1210
|
}
|
|
1209
|
-
], Rt = (e) => j.find((t) => t.id === e) ?? nt.find((t) => t.id === e),
|
|
1210
|
-
const
|
|
1211
|
-
return
|
|
1211
|
+
], Rt = (e) => j.find((t) => t.id === e) ?? nt.find((t) => t.id === e), F = (e, t) => {
|
|
1212
|
+
const r = e.match(t);
|
|
1213
|
+
return r ? r[1] : "";
|
|
1212
1214
|
}, st = (e) => {
|
|
1213
|
-
const t = /iPhone|iPad|iPod/.test(e) || /Macintosh/.test(e) && /Mobile/.test(e),
|
|
1214
|
-
let
|
|
1215
|
-
/Edg\//.test(e) ?
|
|
1215
|
+
const t = /iPhone|iPad|iPod/.test(e) || /Macintosh/.test(e) && /Mobile/.test(e), r = /Android/.test(e);
|
|
1216
|
+
let a = { name: "unknown", version: "" };
|
|
1217
|
+
/Edg\//.test(e) ? a = { name: "Edge", version: F(e, /Edg\/(\d+)/) } : /OPR\//.test(e) ? a = { name: "Opera", version: F(e, /OPR\/(\d+)/) } : /SamsungBrowser\//.test(e) ? a = { name: "Samsung Internet", version: F(e, /SamsungBrowser\/(\d+)/) } : /CriOS\//.test(e) ? a = { name: "Chrome iOS", version: F(e, /CriOS\/(\d+)/) } : /FxiOS\//.test(e) ? a = { name: "Firefox iOS", version: F(e, /FxiOS\/(\d+)/) } : /Firefox\//.test(e) ? a = { name: "Firefox", version: F(e, /Firefox\/(\d+)/) } : /Chrome\//.test(e) ? a = { name: "Chrome", version: F(e, /Chrome\/(\d+)/) } : /Safari\//.test(e) && (a = { name: "Safari", version: F(e, /Version\/(\d+)/) });
|
|
1216
1218
|
let n = { name: "unknown", version: "" };
|
|
1217
|
-
return t ? n = { name: "iOS", version:
|
|
1219
|
+
return t ? n = { name: "iOS", version: F(e, /OS (\d+[._]\d+)/).replace("_", ".") } : r ? n = { name: "Android", version: F(e, /Android (\d+(?:\.\d+)?)/) } : /Mac OS X/.test(e) ? n = { name: "macOS", version: F(e, /Mac OS X (\d+[._]\d+)/).replace("_", ".") } : /Windows NT/.test(e) ? n = { name: "Windows", version: F(e, /Windows NT (\d+\.\d+)/) } : /Linux/.test(e) && (n = { name: "Linux", version: "" }), { browser: a, os: n, mobile: t || r || /Mobile/.test(e) };
|
|
1218
1220
|
}, it = () => {
|
|
1219
|
-
var
|
|
1220
|
-
const e = typeof navigator < "u" ? navigator : void 0, t = (e == null ? void 0 : e.userAgent) ?? "",
|
|
1221
|
+
var a, n;
|
|
1222
|
+
const e = typeof navigator < "u" ? navigator : void 0, t = (e == null ? void 0 : e.userAgent) ?? "", r = st(t);
|
|
1221
1223
|
return {
|
|
1222
1224
|
userAgent: t,
|
|
1223
1225
|
platform: (e == null ? void 0 : e.platform) ?? "",
|
|
1224
|
-
...
|
|
1226
|
+
...r,
|
|
1225
1227
|
screen: typeof window < "u" ? {
|
|
1226
|
-
width: ((
|
|
1228
|
+
width: ((a = window.screen) == null ? void 0 : a.width) ?? 0,
|
|
1227
1229
|
height: ((n = window.screen) == null ? void 0 : n.height) ?? 0,
|
|
1228
1230
|
dpr: window.devicePixelRatio || 1
|
|
1229
1231
|
} : { width: 0, height: 0, dpr: 1 },
|
|
@@ -1233,51 +1235,51 @@ const vt = rt(({
|
|
|
1233
1235
|
videoCaptureStream: typeof HTMLVideoElement < "u" && ("captureStream" in HTMLVideoElement.prototype || "mozCaptureStream" in HTMLVideoElement.prototype),
|
|
1234
1236
|
touch: typeof navigator < "u" && (navigator.maxTouchPoints ?? 0) > 0
|
|
1235
1237
|
};
|
|
1236
|
-
}, ot = [
|
|
1237
|
-
const
|
|
1238
|
-
for (; Date.now() <
|
|
1238
|
+
}, ot = [H.FACE_TRACKER, H.HAND_TRACKER, H.BODY_TRACKER], se = "__xr_compat__", de = (e) => new Promise((t) => setTimeout(t, e)), _ = async (e, t, r = 50) => {
|
|
1239
|
+
const a = Date.now() + t;
|
|
1240
|
+
for (; Date.now() < a; ) {
|
|
1239
1241
|
if (e()) return !0;
|
|
1240
|
-
await
|
|
1242
|
+
await de(r);
|
|
1241
1243
|
}
|
|
1242
1244
|
return e();
|
|
1243
|
-
}, lt = (e, t) => e ? /^(camera-|no-camera|webgl-|offscreen-canvas-|wasm-)/.test(e) ? "capability" : /^model-/.test(e) ? "model" : /^(lifecycle|timeout:lifecycle|feed-stalled|start-)/.test(e) ? "lifecycle" : /^(fps|inference|frame)/.test(e) ? "performance" : t : t,
|
|
1245
|
+
}, lt = (e, t) => e ? /^(camera-|no-camera|webgl-|offscreen-canvas-|wasm-)/.test(e) ? "capability" : /^model-/.test(e) ? "model" : /^(lifecycle|timeout:lifecycle|feed-stalled|start-)/.test(e) ? "lifecycle" : /^(fps|inference|frame)/.test(e) ? "performance" : t : t, dt = (e) => {
|
|
1244
1246
|
const t = {
|
|
1245
1247
|
pass: 0,
|
|
1246
1248
|
fail: 0,
|
|
1247
1249
|
skip: 0,
|
|
1248
1250
|
causes: { capability: 0, model: 0, lifecycle: 0, performance: 0, unknown: 0 }
|
|
1249
1251
|
};
|
|
1250
|
-
for (const
|
|
1251
|
-
t[
|
|
1252
|
+
for (const r of e)
|
|
1253
|
+
t[r.status] += 1, r.status === "fail" && (t.causes[r.cause ?? "unknown"] += 1);
|
|
1252
1254
|
return t;
|
|
1253
|
-
},
|
|
1255
|
+
}, ct = (e, t, r = {}) => ({
|
|
1254
1256
|
version: 1,
|
|
1255
|
-
sdkVersion:
|
|
1257
|
+
sdkVersion: r.sdkVersion ?? "dev",
|
|
1256
1258
|
checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1257
|
-
label:
|
|
1259
|
+
label: r.label ?? "",
|
|
1258
1260
|
environment: it(),
|
|
1259
1261
|
capabilities: t,
|
|
1260
1262
|
results: e,
|
|
1261
|
-
summary:
|
|
1263
|
+
summary: dt(e)
|
|
1262
1264
|
}), Ct = async (e, t = {}) => {
|
|
1263
1265
|
var h;
|
|
1264
|
-
const
|
|
1266
|
+
const r = t.timeoutMs ?? 2e4, a = t.models ?? ot, n = new Set(
|
|
1265
1267
|
t.scenarios ?? j.map((s) => s.id)
|
|
1266
|
-
),
|
|
1267
|
-
let u = null,
|
|
1268
|
-
const i = (s,
|
|
1268
|
+
), d = [];
|
|
1269
|
+
let u = null, c = !1;
|
|
1270
|
+
const i = (s, f, g, o) => {
|
|
1269
1271
|
var m;
|
|
1270
1272
|
const l = {
|
|
1271
1273
|
id: s,
|
|
1272
1274
|
status: o.status,
|
|
1273
|
-
cause: o.status === "fail" ? lt(o.code ?? null,
|
|
1275
|
+
cause: o.status === "fail" ? lt(o.code ?? null, f) : null,
|
|
1274
1276
|
// Codes describe failures; a pass carries none.
|
|
1275
1277
|
code: o.status === "fail" ? o.code ?? null : null,
|
|
1276
1278
|
detail: o.detail,
|
|
1277
1279
|
durationMs: Math.round(performance.now() - g)
|
|
1278
1280
|
};
|
|
1279
|
-
|
|
1280
|
-
},
|
|
1281
|
+
d.push(l), (m = t.onResult) == null || m.call(t, l);
|
|
1282
|
+
}, p = async () => {
|
|
1281
1283
|
t.stream ? await e.setMediaSource({
|
|
1282
1284
|
source: ee.STREAM,
|
|
1283
1285
|
stream: t.stream,
|
|
@@ -1287,17 +1289,17 @@ const vt = rt(({
|
|
|
1287
1289
|
try {
|
|
1288
1290
|
for (const s of j) {
|
|
1289
1291
|
if (!n.has(s.id)) continue;
|
|
1290
|
-
const
|
|
1292
|
+
const f = performance.now();
|
|
1291
1293
|
try {
|
|
1292
1294
|
const g = s.id;
|
|
1293
1295
|
switch (g) {
|
|
1294
1296
|
case "capabilities": {
|
|
1295
1297
|
u = await ye({
|
|
1296
|
-
models:
|
|
1297
|
-
timeoutMs: Math.min(
|
|
1298
|
+
models: a,
|
|
1299
|
+
timeoutMs: Math.min(r, 8e3)
|
|
1298
1300
|
});
|
|
1299
|
-
const o =
|
|
1300
|
-
i(s.id, s.layer,
|
|
1301
|
+
const o = a.map((m) => be(u, m)).filter((m) => !m.supported && m.reason).map((m) => m.reason.code), l = Array.from(new Set(o));
|
|
1302
|
+
i(s.id, s.layer, f, {
|
|
1301
1303
|
status: l.length ? "fail" : "pass",
|
|
1302
1304
|
code: l[0] ?? null,
|
|
1303
1305
|
detail: l.length ? `blocked: ${l.join(", ")}` : `webgl${u.rendering.webglVersion}, camera ${u.camera.status}`
|
|
@@ -1305,23 +1307,23 @@ const vt = rt(({
|
|
|
1305
1307
|
break;
|
|
1306
1308
|
}
|
|
1307
1309
|
case "session-start": {
|
|
1308
|
-
await
|
|
1309
|
-
const o = await
|
|
1310
|
+
await p();
|
|
1311
|
+
const o = await _(
|
|
1310
1312
|
() => e.store.getSnapshot().lifecycle === "running",
|
|
1311
|
-
|
|
1312
|
-
), l = e.store.getSnapshot().feedFrames, m = o && await
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1315
|
-
i(s.id, s.layer,
|
|
1316
|
-
status:
|
|
1317
|
-
code:
|
|
1318
|
-
detail:
|
|
1313
|
+
r
|
|
1314
|
+
), l = e.store.getSnapshot().feedFrames, m = o && await _(() => e.store.getSnapshot().feedFrames > l, r);
|
|
1315
|
+
c = o && m;
|
|
1316
|
+
const b = e.store.getSnapshot().error;
|
|
1317
|
+
i(s.id, s.layer, f, {
|
|
1318
|
+
status: c ? "pass" : "fail",
|
|
1319
|
+
code: b ? b.reason : o ? "feed-stalled" : "timeout:lifecycle",
|
|
1320
|
+
detail: c ? `running on ${e.store.getSnapshot().sourceKind}` : b ? b.message : o ? "running but no feed frames advanced" : `lifecycle ${e.store.getSnapshot().lifecycle}`
|
|
1319
1321
|
});
|
|
1320
1322
|
break;
|
|
1321
1323
|
}
|
|
1322
1324
|
case "model-ready": {
|
|
1323
|
-
if (!
|
|
1324
|
-
i(s.id, s.layer,
|
|
1325
|
+
if (!c) {
|
|
1326
|
+
i(s.id, s.layer, f, {
|
|
1325
1327
|
status: "skip",
|
|
1326
1328
|
detail: "session did not start"
|
|
1327
1329
|
});
|
|
@@ -1329,48 +1331,48 @@ const vt = rt(({
|
|
|
1329
1331
|
}
|
|
1330
1332
|
const o = [];
|
|
1331
1333
|
await Promise.all(
|
|
1332
|
-
|
|
1334
|
+
a.map(async (l) => {
|
|
1333
1335
|
try {
|
|
1334
|
-
await e.registry.acquire(l, se), await
|
|
1336
|
+
await e.registry.acquire(l, se), await _(
|
|
1335
1337
|
() => e.store.getSnapshot().pipeline.has(l),
|
|
1336
|
-
|
|
1338
|
+
r
|
|
1337
1339
|
) || o.push(`${l}: timeout`);
|
|
1338
1340
|
} catch (m) {
|
|
1339
1341
|
o.push(`${l}: ${ge(m).code}`);
|
|
1340
1342
|
}
|
|
1341
1343
|
})
|
|
1342
|
-
), i(s.id, s.layer,
|
|
1344
|
+
), i(s.id, s.layer, f, {
|
|
1343
1345
|
status: o.length ? "fail" : "pass",
|
|
1344
1346
|
code: o.length ? o[0].split(": ")[1] === "timeout" ? "model-init-failed" : o[0].split(": ")[1] : null,
|
|
1345
|
-
detail: o.length ? o.join("; ") : `${
|
|
1347
|
+
detail: o.length ? o.join("; ") : `${a.length} models ready`
|
|
1346
1348
|
});
|
|
1347
1349
|
break;
|
|
1348
1350
|
}
|
|
1349
1351
|
case "model-detects": {
|
|
1350
|
-
if (!
|
|
1351
|
-
i(s.id, s.layer,
|
|
1352
|
+
if (!c) {
|
|
1353
|
+
i(s.id, s.layer, f, {
|
|
1352
1354
|
status: "skip",
|
|
1353
1355
|
detail: "session did not start"
|
|
1354
1356
|
});
|
|
1355
1357
|
break;
|
|
1356
1358
|
}
|
|
1357
|
-
const o = await
|
|
1358
|
-
() =>
|
|
1359
|
-
Math.min(
|
|
1360
|
-
), l =
|
|
1359
|
+
const o = await _(
|
|
1360
|
+
() => P(e, a, null).models.every((R) => R.state !== "ready" || R.inferences > 0),
|
|
1361
|
+
Math.min(r, 8e3)
|
|
1362
|
+
), l = P(e, a, null), m = l.models.filter((S) => S.state === "ready" && S.inferences === 0).map((S) => S.label), b = l.models.filter((S) => S.state === "error").map((S) => {
|
|
1361
1363
|
var R;
|
|
1362
1364
|
return `${S.label}: ${((R = S.error) == null ? void 0 : R.message) ?? "error"}`;
|
|
1363
1365
|
});
|
|
1364
|
-
i(s.id, s.layer,
|
|
1365
|
-
status: o && !
|
|
1366
|
-
code:
|
|
1367
|
-
detail:
|
|
1366
|
+
i(s.id, s.layer, f, {
|
|
1367
|
+
status: o && !b.length ? "pass" : "fail",
|
|
1368
|
+
code: b.length ? "model-init-failed" : m.length ? "model-idle" : null,
|
|
1369
|
+
detail: b.length ? b.join("; ") : m.length ? `no inference from ${m.join(", ")}` : l.models.map((S) => `${S.label} ${S.inferences} run · ${S.detections ?? "–"} det`).join(", ")
|
|
1368
1370
|
});
|
|
1369
1371
|
break;
|
|
1370
1372
|
}
|
|
1371
1373
|
case "pause-resume": {
|
|
1372
|
-
if (!
|
|
1373
|
-
i(s.id, s.layer,
|
|
1374
|
+
if (!c) {
|
|
1375
|
+
i(s.id, s.layer, f, {
|
|
1374
1376
|
status: "skip",
|
|
1375
1377
|
detail: "session did not start"
|
|
1376
1378
|
});
|
|
@@ -1379,20 +1381,20 @@ const vt = rt(({
|
|
|
1379
1381
|
e.pause();
|
|
1380
1382
|
const o = e.store.getSnapshot().lifecycle === "paused";
|
|
1381
1383
|
await e.resume();
|
|
1382
|
-
const l = await
|
|
1384
|
+
const l = await _(
|
|
1383
1385
|
() => e.store.getSnapshot().lifecycle === "running",
|
|
1384
|
-
|
|
1385
|
-
), m = e.store.getSnapshot().feedFrames,
|
|
1386
|
-
i(s.id, s.layer,
|
|
1387
|
-
status: o && l &&
|
|
1386
|
+
r
|
|
1387
|
+
), m = e.store.getSnapshot().feedFrames, b = l && await _(() => e.store.getSnapshot().feedFrames > m, r);
|
|
1388
|
+
i(s.id, s.layer, f, {
|
|
1389
|
+
status: o && l && b ? "pass" : "fail",
|
|
1388
1390
|
code: o ? l ? "feed-stalled" : "lifecycle:resume" : "lifecycle:pause",
|
|
1389
|
-
detail: o && l &&
|
|
1391
|
+
detail: o && l && b ? "paused → running, feed advanced" : `paused=${o} resumed=${l} advanced=${b}`
|
|
1390
1392
|
});
|
|
1391
1393
|
break;
|
|
1392
1394
|
}
|
|
1393
1395
|
case "stop-start": {
|
|
1394
|
-
if (!
|
|
1395
|
-
i(s.id, s.layer,
|
|
1396
|
+
if (!c) {
|
|
1397
|
+
i(s.id, s.layer, f, {
|
|
1396
1398
|
status: "skip",
|
|
1397
1399
|
detail: "session did not start"
|
|
1398
1400
|
});
|
|
@@ -1400,12 +1402,12 @@ const vt = rt(({
|
|
|
1400
1402
|
}
|
|
1401
1403
|
await e.stop();
|
|
1402
1404
|
const o = e.store.getSnapshot().lifecycle === "stopped";
|
|
1403
|
-
await
|
|
1404
|
-
const l = await
|
|
1405
|
+
await p();
|
|
1406
|
+
const l = await _(
|
|
1405
1407
|
() => e.store.getSnapshot().lifecycle === "running",
|
|
1406
|
-
|
|
1408
|
+
r
|
|
1407
1409
|
);
|
|
1408
|
-
i(s.id, s.layer,
|
|
1410
|
+
i(s.id, s.layer, f, {
|
|
1409
1411
|
status: o && l ? "pass" : "fail",
|
|
1410
1412
|
code: o ? "lifecycle:restart" : "lifecycle:stop",
|
|
1411
1413
|
detail: o && l ? "stopped → running" : `stopped=${o} running=${l}`
|
|
@@ -1413,8 +1415,8 @@ const vt = rt(({
|
|
|
1413
1415
|
break;
|
|
1414
1416
|
}
|
|
1415
1417
|
case "performance": {
|
|
1416
|
-
if (!
|
|
1417
|
-
i(s.id, s.layer,
|
|
1418
|
+
if (!c) {
|
|
1419
|
+
i(s.id, s.layer, f, {
|
|
1418
1420
|
status: "skip",
|
|
1419
1421
|
detail: "session did not start"
|
|
1420
1422
|
});
|
|
@@ -1422,17 +1424,17 @@ const vt = rt(({
|
|
|
1422
1424
|
}
|
|
1423
1425
|
const o = t.performanceWindowMs ?? 3e3;
|
|
1424
1426
|
let l = 0, m = 0;
|
|
1425
|
-
const
|
|
1426
|
-
l += 1, m = requestAnimationFrame(
|
|
1427
|
+
const b = () => {
|
|
1428
|
+
l += 1, m = requestAnimationFrame(b);
|
|
1427
1429
|
};
|
|
1428
|
-
m = requestAnimationFrame(
|
|
1429
|
-
const S =
|
|
1430
|
-
await
|
|
1431
|
-
const R =
|
|
1430
|
+
m = requestAnimationFrame(b);
|
|
1431
|
+
const S = P(e, a, null);
|
|
1432
|
+
await de(o), cancelAnimationFrame(m);
|
|
1433
|
+
const R = P(e, a, {
|
|
1432
1434
|
feedFrames: S.session.feedFrames,
|
|
1433
1435
|
sampledAt: S.sampledAt
|
|
1434
1436
|
}), x = l * 1e3 / o, E = R.inferenceMsTotal, v = x >= 20 && E <= 50;
|
|
1435
|
-
i(s.id, s.layer,
|
|
1437
|
+
i(s.id, s.layer, f, {
|
|
1436
1438
|
status: v ? "pass" : "fail",
|
|
1437
1439
|
code: x < 20 ? "fps-low" : E > 50 ? "inference-high" : null,
|
|
1438
1440
|
detail: `${x.toFixed(0)} fps · feed ${R.session.feedFps.toFixed(0)} fps · inference ${E.toFixed(1)} ms`
|
|
@@ -1440,52 +1442,52 @@ const vt = rt(({
|
|
|
1440
1442
|
break;
|
|
1441
1443
|
}
|
|
1442
1444
|
default:
|
|
1443
|
-
i(g, s.layer,
|
|
1445
|
+
i(g, s.layer, f, { status: "skip", detail: "no runner" });
|
|
1444
1446
|
}
|
|
1445
1447
|
} catch (g) {
|
|
1446
1448
|
const o = g instanceof Error ? g.message : String(g), l = (h = e.store.getSnapshot().error) == null ? void 0 : h.reason;
|
|
1447
|
-
i(s.id, s.layer,
|
|
1449
|
+
i(s.id, s.layer, f, {
|
|
1448
1450
|
status: "fail",
|
|
1449
|
-
code: l ?
|
|
1451
|
+
code: l ? we(l).code : null,
|
|
1450
1452
|
detail: l ? `${o} (${l})` : o
|
|
1451
1453
|
});
|
|
1452
1454
|
}
|
|
1453
1455
|
}
|
|
1454
1456
|
} finally {
|
|
1455
|
-
for (const s of
|
|
1457
|
+
for (const s of a) e.registry.release(s, se);
|
|
1456
1458
|
t.keepSessionRunning || await e.stop().catch(() => {
|
|
1457
1459
|
});
|
|
1458
1460
|
}
|
|
1459
|
-
return
|
|
1461
|
+
return ct(d, u, t);
|
|
1460
1462
|
}, Et = (e) => {
|
|
1461
|
-
const [t,
|
|
1462
|
-
return
|
|
1463
|
-
let
|
|
1463
|
+
const [t, r] = T(null);
|
|
1464
|
+
return k(() => {
|
|
1465
|
+
let a = 0;
|
|
1464
1466
|
const n = () => {
|
|
1465
|
-
var i,
|
|
1466
|
-
|
|
1467
|
-
const
|
|
1468
|
-
if (!
|
|
1469
|
-
|
|
1467
|
+
var i, p;
|
|
1468
|
+
a = requestAnimationFrame(n);
|
|
1469
|
+
const d = (p = (i = e == null ? void 0 : e.detectionResults) == null ? void 0 : i.faceLandmarks) == null ? void 0 : p[0];
|
|
1470
|
+
if (!d || d.length === 0) {
|
|
1471
|
+
r(null);
|
|
1470
1472
|
return;
|
|
1471
1473
|
}
|
|
1472
|
-
const u =
|
|
1474
|
+
const u = Te(d), c = {
|
|
1473
1475
|
left: u.minX,
|
|
1474
1476
|
top: u.minY,
|
|
1475
1477
|
width: u.width,
|
|
1476
1478
|
height: u.height
|
|
1477
1479
|
};
|
|
1478
|
-
|
|
1480
|
+
r((h) => h && h.left === c.left && h.top === c.top && h.width === c.width && h.height === c.height ? h : c);
|
|
1479
1481
|
};
|
|
1480
1482
|
return n(), () => {
|
|
1481
|
-
cancelAnimationFrame(
|
|
1483
|
+
cancelAnimationFrame(a);
|
|
1482
1484
|
};
|
|
1483
1485
|
}, [e]), t;
|
|
1484
|
-
},
|
|
1486
|
+
}, Tt = ({
|
|
1485
1487
|
background: e = "#000",
|
|
1486
1488
|
children: t,
|
|
1487
|
-
style:
|
|
1488
|
-
}) => /* @__PURE__ */
|
|
1489
|
+
style: r
|
|
1490
|
+
}) => /* @__PURE__ */ w(
|
|
1489
1491
|
"div",
|
|
1490
1492
|
{
|
|
1491
1493
|
style: {
|
|
@@ -1493,150 +1495,212 @@ const vt = rt(({
|
|
|
1493
1495
|
inset: 0,
|
|
1494
1496
|
overflow: "hidden",
|
|
1495
1497
|
background: e,
|
|
1496
|
-
...
|
|
1498
|
+
...r
|
|
1497
1499
|
},
|
|
1498
1500
|
children: t
|
|
1499
1501
|
}
|
|
1500
|
-
),
|
|
1501
|
-
const { makeDefault: t = !0, ...
|
|
1502
|
-
return /* @__PURE__ */
|
|
1503
|
-
|
|
1502
|
+
), Mt = (e) => {
|
|
1503
|
+
const { makeDefault: t = !0, ...r } = e;
|
|
1504
|
+
return /* @__PURE__ */ w(
|
|
1505
|
+
Me,
|
|
1504
1506
|
{
|
|
1505
1507
|
position: [0, 0, 40],
|
|
1506
1508
|
fov: 30,
|
|
1507
1509
|
near: 0.1,
|
|
1508
1510
|
far: 1e3,
|
|
1509
1511
|
makeDefault: t,
|
|
1510
|
-
...
|
|
1512
|
+
...r
|
|
1511
1513
|
}
|
|
1512
1514
|
);
|
|
1513
|
-
},
|
|
1515
|
+
}, At = ["fill", "contain"];
|
|
1514
1516
|
export {
|
|
1517
|
+
Fa as ARM_FIT_DEFAULTS,
|
|
1518
|
+
Ia as ARM_MASK_DEFAULTS,
|
|
1519
|
+
ka as ArmTracker,
|
|
1520
|
+
_a as BODY_POSE_TRIGGER_DEFAULTS,
|
|
1515
1521
|
Hr as BasicAnimatedTextureController,
|
|
1516
1522
|
xt as BoundingBoxOverlay,
|
|
1517
1523
|
j as COMPAT_SCENARIOS,
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
+
kt as EMPTY_QUALITY_SIGNALS,
|
|
1525
|
+
wn as FACE_REGION_POLYGONS,
|
|
1526
|
+
La as HAND_JOINTS,
|
|
1527
|
+
Zr as HAND_RIG_BONES,
|
|
1528
|
+
Oa as HAND_RIG_FOREARM,
|
|
1529
|
+
en as HAND_RIG_KNUCKLE_SHIFT,
|
|
1530
|
+
tn as HAND_RIG_LENGTH_RANGE,
|
|
1531
|
+
Da as HAND_RIG_MODEL_MESH,
|
|
1532
|
+
an as HAND_RIG_PALM_JOINTS,
|
|
1533
|
+
rn as HAND_RIG_SNAP_PALMS,
|
|
1534
|
+
Xa as HAND_TATTOO_FACING_FADE,
|
|
1535
|
+
Ha as HandRigContext,
|
|
1536
|
+
Ba as HandRigWrist,
|
|
1537
|
+
Na as HandRigWristContext,
|
|
1538
|
+
Pa as HandTouchContext,
|
|
1539
|
+
ta as HeadTracker,
|
|
1540
|
+
Sn as IRIS_FULL_OPENNESS,
|
|
1541
|
+
vn as IrisLead,
|
|
1524
1542
|
nt as MANUAL_COMPAT_SCENARIOS,
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1543
|
+
Br as MAX_GIF_BYTES,
|
|
1544
|
+
Nr as MAX_GIF_FRAMES,
|
|
1545
|
+
Pr as MAX_GIF_PIXELS,
|
|
1546
|
+
xn as MAX_OVERLAY_LABELS,
|
|
1547
|
+
za as OscillationTracker,
|
|
1548
|
+
$a as POSE_JOINTS,
|
|
1549
|
+
Mt as PerspectiveCamera,
|
|
1550
|
+
Rn as SEGMENTATION_OVERLAY_FRAGMENT_SHADER,
|
|
1551
|
+
Cn as SEGMENTATION_OVERLAY_VERTEX_SHADER,
|
|
1552
|
+
zn as ScreenRectAspectContext,
|
|
1553
|
+
At as TEXTURE_FITS,
|
|
1554
|
+
zr as TextureSourceLoadError,
|
|
1555
|
+
Va as TimedSeries,
|
|
1556
|
+
Wa as TouchWorld,
|
|
1557
|
+
Ga as WRIST_FILTER_DEFAULTS,
|
|
1558
|
+
Ua as WristRotationFilter,
|
|
1559
|
+
Tt as XRCompositor,
|
|
1560
|
+
z as XRLayer,
|
|
1561
|
+
ke as XRMediaSurface,
|
|
1540
1562
|
St as XRTrackingOverlay,
|
|
1541
1563
|
vt as XRViewport,
|
|
1542
|
-
|
|
1543
|
-
|
|
1564
|
+
_t as XR_MODEL_LABELS,
|
|
1565
|
+
Lt as anatomicalHandedness,
|
|
1566
|
+
nn as applyHandRigLengths,
|
|
1567
|
+
sn as applyHandRigSolution,
|
|
1568
|
+
qa as armQueryOf,
|
|
1569
|
+
Ot as assignHandPoses,
|
|
1570
|
+
on as bindHandRig,
|
|
1571
|
+
ja as bodyTriggerStatesEqual,
|
|
1572
|
+
Dt as classifyCameraFailure,
|
|
1544
1573
|
lt as classifyCompatCause,
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1574
|
+
En as computeIrisEye,
|
|
1575
|
+
Te as computeLandmarkBounds,
|
|
1576
|
+
Tn as computeMaskUvTransform,
|
|
1577
|
+
$r as computeScreenTransform,
|
|
1578
|
+
Ka as createBodyMoveFrame,
|
|
1579
|
+
Ya as createBodyTrigger,
|
|
1580
|
+
ct as createCompatReport,
|
|
1581
|
+
xa as createFaceInfoTarget,
|
|
1582
|
+
fn as createGestureDetectorState,
|
|
1583
|
+
Qa as createHandOccluderMaterial,
|
|
1584
|
+
Ja as createHandTattooMaterial,
|
|
1585
|
+
Mn as createIrisEye,
|
|
1586
|
+
An as createIrisResult,
|
|
1554
1587
|
Xt as createQualityState,
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1588
|
+
Fn as createSegmentationOverlayMaterial,
|
|
1589
|
+
In as createSemanticMaskTexture,
|
|
1590
|
+
Vr as createTextureSourceResolver,
|
|
1591
|
+
Za as createTouchHand,
|
|
1558
1592
|
it as describeCompatEnvironment,
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1593
|
+
Wr as disposeResolvedTextureSource,
|
|
1594
|
+
er as ellipseWidthOnScreen,
|
|
1595
|
+
tr as ensureForearmBone,
|
|
1596
|
+
Ht as fillLandmarkPolygon,
|
|
1597
|
+
Bt as fillPolygon,
|
|
1562
1598
|
Rt as findCompatScenario,
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1599
|
+
ar as fingerExtensions,
|
|
1600
|
+
rr as fitWristFrame,
|
|
1601
|
+
nr as frameUpOnScreen,
|
|
1602
|
+
hn as gestureStatesEqual,
|
|
1603
|
+
Ra as getFaceInfo,
|
|
1604
|
+
Gr as getPlaybackFrame,
|
|
1605
|
+
Ur as getSequenceFrame,
|
|
1606
|
+
Ea as getThreeBlending,
|
|
1607
|
+
Ta as getThreeDepthFunction,
|
|
1608
|
+
Ma as getThreeSide,
|
|
1609
|
+
qr as gifTextureSourceProvider,
|
|
1610
|
+
ln as handAttachmentLocal,
|
|
1611
|
+
sr as handGeometryToRoot,
|
|
1612
|
+
dn as handRigRootMatrix,
|
|
1613
|
+
cn as handRigSnapDistance,
|
|
1614
|
+
ir as handTattooFrame,
|
|
1615
|
+
or as handTattooMatrix,
|
|
1616
|
+
lr as handTattooUv,
|
|
1617
|
+
Nt as handWorldLandmarkToJoint,
|
|
1618
|
+
Dr as hasFullUnitUVBounds,
|
|
1619
|
+
Pt as judgeSample,
|
|
1620
|
+
zt as lockQuality,
|
|
1621
|
+
$t as mapDomExceptionToReason,
|
|
1576
1622
|
ge as mapModelErrorToReason,
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1623
|
+
dr as measureArm,
|
|
1624
|
+
cr as measureArmRaise,
|
|
1625
|
+
ur as measureFingerPattern,
|
|
1626
|
+
mr as measureGrab,
|
|
1627
|
+
pr as measureHandHeight,
|
|
1628
|
+
fr as measureOpenPalm,
|
|
1629
|
+
hr as measurePinch,
|
|
1630
|
+
gr as measureTPose,
|
|
1631
|
+
yr as measureThumb,
|
|
1585
1632
|
st as parseUserAgent,
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1633
|
+
br as patchHandOccluderInflate,
|
|
1634
|
+
Vt as permissionStateToStatus,
|
|
1635
|
+
kn as rasterizeFaceRegions,
|
|
1636
|
+
Wt as readDeviceSignals,
|
|
1637
|
+
Gt as resetQuality,
|
|
1638
|
+
_n as resolveActiveOverlayLabelIndices,
|
|
1639
|
+
wr as resolveBodyMoveLimits,
|
|
1640
|
+
Sr as resolveBodyTriggerOptions,
|
|
1641
|
+
ze as resolveCalibrationFaceDisplayMirrored,
|
|
1642
|
+
Ut as resolveInitialTierIndex,
|
|
1643
|
+
Ln as resolveMaskSize,
|
|
1644
|
+
On as resolveOverlayLabelIndices,
|
|
1645
|
+
qt as resolvePerformanceBudget,
|
|
1646
|
+
jt as resolveQualityTier,
|
|
1647
|
+
jr as resolveTextureSource,
|
|
1598
1648
|
Ct as runCompatChecks,
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1649
|
+
P as sampleXRDiagnostics,
|
|
1650
|
+
vr as screenAngle,
|
|
1651
|
+
un as screenChirality,
|
|
1652
|
+
Kt as semanticMaskLabelIndex,
|
|
1653
|
+
we as sessionReasonToFallback,
|
|
1654
|
+
xr as setBodyTriggerOptions,
|
|
1655
|
+
Rr as setHandTattooBlend,
|
|
1656
|
+
Yt as setQualityTier,
|
|
1657
|
+
Cr as sideJoint,
|
|
1658
|
+
Er as snapshotBodyTriggerState,
|
|
1659
|
+
gn as snapshotGestureState,
|
|
1660
|
+
mn as solveHandRig,
|
|
1661
|
+
Tr as stepBodyTrigger,
|
|
1662
|
+
yn as stepGestureDetector,
|
|
1663
|
+
Qt as stepQualityController,
|
|
1664
|
+
dt as summarizeCompatResults,
|
|
1665
|
+
Kr as throwIfAborted,
|
|
1666
|
+
Mr as thumbDirection,
|
|
1667
|
+
Ar as thumbExtension,
|
|
1668
|
+
Jt as tierToApply,
|
|
1669
|
+
Dn as updateIrisResult,
|
|
1670
|
+
Fr as updatePointerHand,
|
|
1671
|
+
Xn as updateSegmentationOverlayMaterial,
|
|
1672
|
+
Ir as updateTouchHand,
|
|
1673
|
+
Hn as uploadSemanticMask,
|
|
1674
|
+
kr as useArmMask,
|
|
1675
|
+
Ve as useCalibrationFaceTracker,
|
|
1615
1676
|
Et as useFaceBoundingBox,
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1677
|
+
$n as useScreenSpace,
|
|
1678
|
+
Bn as useSegmentationOverlayMaterial,
|
|
1679
|
+
Nn as useSemanticMaskTexture,
|
|
1680
|
+
aa as useTrackerContext,
|
|
1681
|
+
na as useXRCameraDeviceId,
|
|
1682
|
+
sa as useXRCameraFacing,
|
|
1683
|
+
ia as useXRCameraTexture,
|
|
1623
1684
|
ie as useXRContext,
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1685
|
+
Zt as useXRDiagnostics,
|
|
1686
|
+
oa as useXRError,
|
|
1687
|
+
la as useXRFeedAspect,
|
|
1688
|
+
da as useXRFeedCrop,
|
|
1689
|
+
ca as useXRLifecycle,
|
|
1690
|
+
ua as useXRMirrored,
|
|
1629
1691
|
Se as useXRModel,
|
|
1630
|
-
|
|
1692
|
+
ma as useXRModelErrors,
|
|
1631
1693
|
ve as useXRModelNode,
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1694
|
+
pa as useXROrientation,
|
|
1695
|
+
fa as useXRPipelineSnapshot,
|
|
1696
|
+
ha as useXRQualityConfig,
|
|
1697
|
+
ga as useXRQualityState,
|
|
1698
|
+
ya as useXRReady,
|
|
1699
|
+
ba as useXRRenderSize,
|
|
1700
|
+
wa as useXRSessionCameraPermission,
|
|
1701
|
+
Sa as useXRTrackerStatus,
|
|
1702
|
+
Yr as useXRViewportRenderOutputs,
|
|
1703
|
+
Qr as useXRViewportState,
|
|
1704
|
+
_r as worldToFeedUnits,
|
|
1705
|
+
Lr as wristFrameLocal
|
|
1642
1706
|
};
|