t2-mapper/docs/assets/JoystickContext-YJ6eVLFP.js
2026-03-22 21:11:02 -07:00

1 line
No EOL
1.1 KiB
JavaScript

import{r as e}from"./chunk-DECur_0Z.js";import{n as t,r as n,t as r}from"./jsx-runtime-BpGWiA-R.js";var i=t(),a=e(n(),1),o=r(),s=(0,a.createContext)(null);function c(){let e=(0,a.useContext)(s);if(!e)throw Error(`No JoystickContext found. Did you forget to add a <JoystickProvider>?`);return e}function l(e){let t=(0,i.c)(7),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={angle:0,force:0},t[0]=r):r=t[0];let c=(0,a.useRef)(r),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={angle:0,force:0},t[1]=l):l=t[1];let u=(0,a.useRef)(l),d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>{let{angle:t,force:n}=e;t!=null&&(c.current.angle=t),n!=null&&(c.current.force=n)},t[2]=d):d=t[2];let f=d,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{let{angle:t,force:n}=e;t!=null&&(u.current.angle=t),n!=null&&(u.current.force=n)},t[3]=p):p=t[3];let m=p,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h={moveState:c,lookState:u,setMoveState:f,setLookState:m},t[4]=h):h=t[4];let g=h,_;return t[5]===n?_=t[6]:(_=(0,o.jsx)(s,{value:g,children:n}),t[5]=n,t[6]=_),_}export{c as n,l as t};