UNPKG

ocearo-ui

Version:

Ocean Robot UI: 3D visualization dashboard for signalk

1 lines 35.2 kB
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52822,(e,t,r)=>{"use strict";var a=e.r(71645),n=e.r(2239),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,l=a.useRef,s=a.useEffect,u=a.useMemo,c=a.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,a,n){var d=l(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;var m=o(e,(d=u(function(){function e(e){if(!s){if(s=!0,o=e,e=a(e),void 0!==n&&p.hasValue){var t=p.value;if(n(t,e))return l=t}return l=e}if(t=l,i(o,e))return t;var r=a(e);return void 0!==n&&n(t,r)?(o=e,t):(o=e,l=r)}var o,l,s=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,a,n]))[0],d[1]);return s(function(){p.hasValue=!0,p.value=m},[m]),c(m),m}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},15080,e=>{"use strict";var t=e.i(40859);e.s(["useThree",()=>t.C])},35637,e=>{"use strict";e.s(["drawAttitudeInstrument",0,(e,t)=>{let{w:r,h:a,roll:n,pitch:i,yaw:o,nightMode:l=!1,showHeading:s=!0,showPitchScale:u=!0,showRollScale:c=!0,showBezel:d=!0,compact:p=!1,colors:m={}}=t,h=r/2,g=a/2,C=Math.min(r,a)/(p?80:200),f=e=>e*C,S=e=>Math.max(.5,e*C),M={sky:l?"#1a0000":m.sky||"#87CEEB",sea:l?"#000000":m.sea||m.oGray2||"#424242",horizon:l?m.oNight||"#ef4444":m.oYellow||"#ffbe00",bezel:l?"#330000":m.bezel||m.oGray2||"#424242",text:l?m.oNight||"#ef4444":m.text||"var(--hud-text-main)",boat:l?m.oNight||"#ef4444":m.boat||m.oYellow||"#ffbe00",rollScale:l?m.oNight||"#ef4444":m.rollScale||m.oRed||"#cc000c",headingMarks:l?m.oNight||"#ef4444":m.headingMarks||"var(--hud-text-main)",pitchMarks:l?"rgba(239, 68, 68, 0.6)":m.pitchMarks||"var(--hud-text-secondary)",...m};e.clearRect(0,0,r,a);let T=Math.min(h,g)-f(p?5:20);if(e.save(),e.beginPath(),e.arc(h,g,T,0,2*Math.PI),e.clip(),e.translate(h,g),e.rotate(n*Math.PI/180),e.translate(0,i/90*T*(p?1:1.5)),e.fillStyle=M.sky,e.fillRect(-r,-(2*a),2*r,2*a),e.fillStyle=M.sea,e.fillRect(-r,0,2*r,2*a),e.beginPath(),e.moveTo(-r,0),e.lineTo(r,0),e.strokeStyle=M.horizon,e.lineWidth=S(p?1.5:3),e.stroke(),u){e.strokeStyle=M.pitchMarks,e.fillStyle=M.pitchMarks,e.font=`${Math.round(f(p?8:12))}px sans-serif`,e.textAlign="center",e.textBaseline="middle";let t=p?60:30,r=p?20:10;for(let a=-t;a<=t;a+=r){if(0===a)continue;let t=-(a/90)*T*(p?1:1.5),r=f(Math.abs(a)%20!=0||p?p?15:30:50);e.beginPath(),e.moveTo(-r/2,t),e.lineTo(r/2,t),e.lineWidth=S(Math.abs(a)%20==0?2:1),e.stroke(),p&&Math.abs(a)%40!=0||(e.fillText(Math.abs(a)+"°",r/2+f(10),t),e.fillText(Math.abs(a)+"°",-r/2-f(10),t))}}if(e.restore(),d&&(e.beginPath(),e.arc(h,g,Math.min(h,g)-f(p?2:8),0,2*Math.PI),e.strokeStyle=M.bezel,e.lineWidth=S(p?2:12),e.stroke(),p||(e.beginPath(),e.arc(h,g,T,0,2*Math.PI),e.strokeStyle=M.bezel,e.lineWidth=S(2),e.stroke())),s){e.save(),e.translate(h,g),e.font=`bold ${Math.round(f(p?7:10))}px sans-serif`,e.textAlign="center";let t=p?15:10;for(let r=0;r<360;r+=t){let t=(r-o-90)*Math.PI/180,a=T+f(2*!!p),n=r%(p?90:30)==0,i=f(n?p?5:20:p?2:10),s=a*Math.cos(t),u=a*Math.sin(t),c=(a-i)*Math.cos(t),d=(a-i)*Math.sin(t);if(e.beginPath(),e.moveTo(s,u),e.lineTo(c,d),e.strokeStyle=n?M.headingMarks:l?"rgba(239, 68, 68, 0.4)":M.pitchMarks,e.lineWidth=S(n?1.5:p?.5:2),e.stroke(),n&&!p){let n=["N","E","S","W"];if(r%90==0){let i=(a-f(35))*Math.cos(t),o=(a-f(35))*Math.sin(t)+f(4);e.fillStyle=M.text,e.fillText(n[r/90],i,o)}}}e.restore()}if(e.save(),e.translate(h,g),p?(e.rotate(o*Math.PI/180),e.beginPath(),e.moveTo(0,-f(10)),e.lineTo(f(5),f(5)),e.lineTo(-f(5),f(5)),e.closePath(),e.fillStyle=M.boat,e.fill(),e.strokeStyle=l?M.boat:m.oGray||"#989898",e.lineWidth=S(1),e.stroke()):(e.beginPath(),e.moveTo(0,-f(25)),e.lineTo(f(12),f(12)),e.lineTo(0,f(8)),e.lineTo(-f(12),f(12)),e.closePath(),e.fillStyle=M.horizon,e.fill(),e.strokeStyle=M.text,e.lineWidth=S(2),e.stroke(),e.beginPath(),e.arc(0,0,f(3),0,2*Math.PI),e.fillStyle=M.text,e.fill()),e.restore(),c&&!p){e.save(),e.translate(h,g),e.rotate(n*Math.PI/180);for(let t=-60;t<=60;t+=30){if(0===t)continue;let r=t*Math.PI/180,a=Math.min(h,g)-f(30),n=a*Math.sin(r),i=-a*Math.cos(r),o=(a-f(15))*Math.sin(r),l=-(a-f(15))*Math.cos(r);e.beginPath(),e.moveTo(n,i),e.lineTo(o,l),e.strokeStyle=M.rollScale,e.lineWidth=S(3),e.stroke()}e.restore()}}])},32615,13035,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(31067),n=e.i(90072);function i(e,t){let n=e+"Geometry";return r.forwardRef(({args:e,children:i,...o},l)=>{let s=r.useRef(null);return r.useImperativeHandle(l,()=>s.current),r.useLayoutEffect(()=>void(null==t||t(s.current))),r.createElement("mesh",(0,a.default)({ref:s},o),r.createElement(n,{attach:"geometry",args:e}),i)})}let o=i("sphere"),l=i("ring");e.s(["Ring",()=>l,"Sphere",()=>o],13035);var s=e.i(16196),u=e.i(67561),c=e.i(85709),d=e.i(83402);let p=r.default.memo(({radius:e,isOuter:a,markerColorPrimary:i,markerColorGreen:l,markerColorRed:u})=>{let c=(0,r.useMemo)(()=>{let r=[];for(let c=0;c<360;c+=10){let d=n.MathUtils.degToRad(c-90),p=c%30==0,m=a?p?.35:.15:p?.25:.1,h=(e+.5*m+.2)*Math.cos(d),g=(e+.5*m+.2)*Math.sin(d),C=a&&c>0&&c<61,f=a&&c>=300&&c<360,S=C?l:f?u:i;if(!a&&p){let e;e=0===c?"N":90===c?"E":180===c?"S":270===c?"W":c.toString(),r.push((0,t.jsx)(s.Text,{characters:"NESW0123456789",position:[h,.02,g],color:i,fontSize:.6,rotation:[-Math.PI/2,0,Math.PI/2-d],font:"fonts/Roboto-Bold.ttf",anchorY:"middle",fillOpacity:.9,children:e},`text-${c}`))}else r.push((0,t.jsx)(o,{args:[m/2,16,16],position:[h,0,g],children:(0,t.jsx)("meshBasicMaterial",{color:S,transparent:!0,opacity:p?.8:.4})},`marker-${a?"outer":"inner"}-${c}`))}return r},[e,a,i,l,u]);return(0,t.jsx)(t.Fragment,{children:c})});p.displayName="StaticMarkers";let m=r.default.memo(({innerRadius:e,outerRadius:r,dialColor:a,opacity:i=1,transparent:o=!1})=>(0,t.jsx)(l,{args:[e,r,64],rotation:[Math.PI/2,0,0],children:(0,t.jsx)("meshBasicMaterial",{color:a,side:n.DoubleSide,transparent:o,opacity:i,depthWrite:!1})}));m.displayName="StaticRing";let h=({outerRadius:e,innerRadius:a})=>{let{nightMode:n}=(0,u.useOcearoContext)(),i=n?u.oNight:"#ffffff",o=u.oGreen,l=u.oRed,s=(0,r.useMemo)(()=>["navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic"],[]),h=(0,c.useSignalKPaths)(s),g=(0,r.useMemo)(()=>{let e=d.default.get("preferredHeadingPath")||"courseOverGroundTrue",t=h[`navigation.${e}`];if(null!=t)return t;let r=h["navigation.headingTrue"]||h["navigation.headingMagnetic"];return h["navigation.courseOverGroundTrue"]||h["navigation.courseOverGroundMagnetic"]||r||0},[h]),C=n?"#000000":"#0a0a0a",f=d.default.get("compassNorthUp"),S=(0,r.useMemo)(()=>({innerRadius:a,outerRadius:e,dialColor:C,markerColorPrimary:i,markerColorGreen:o,markerColorRed:l}),[a,e,C,i,o,l]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("group",{rotation:[0,g+(f?0:Math.PI),0],children:[(0,t.jsx)(m,{innerRadius:S.innerRadius,outerRadius:S.outerRadius,dialColor:S.dialColor,transparent:!0,opacity:.1}),(0,t.jsx)(p,{radius:S.innerRadius,isOuter:!1,markerColorPrimary:S.markerColorPrimary,markerColorGreen:S.markerColorGreen,markerColorRed:S.markerColorRed})]}),(0,t.jsxs)("group",{children:[(0,t.jsx)(m,{innerRadius:S.innerRadius+.8,outerRadius:S.outerRadius+.8,dialColor:S.dialColor,transparent:!0,opacity:.15}),(0,t.jsx)(p,{radius:S.innerRadius+.8,isOuter:!0,markerColorPrimary:S.markerColorPrimary,markerColorGreen:S.markerColorGreen,markerColorRed:S.markerColorRed})]})]})};h.displayName="CompassDial";var g=e.i(84226);e.s(["default",0,({visible:e=!0,position:r,scale:a})=>!e||d.default.get("hide3DCompass")?null:(0,t.jsxs)("group",{position:r,scale:a,children:[(0,t.jsx)(h,{outerRadius:5.6,innerRadius:5}),(0,t.jsx)(g.default,{outerRadius:5.6+1.1})]})],32615)},62588,e=>{"use strict";var t=e.i(43476),r=e.i(71645);e.i(49018);var a=e.i(83402),n=e.i(66799),i=e.i(67561),o=e.i(85709);let l=(0,r.createContext)(),s=(e,t,r,a)=>{let n=r.split(".").reduce((e,t)=>e?.[t],a);void 0!==n&&(e[t]=n)};e.s(["AISProvider",0,({children:e})=>{let[u,c]=(0,r.useState)({}),[d,p]=(0,r.useState)([]),m=(0,r.useRef)(null),h=(0,r.useRef)({}),g=(0,r.useRef)(null),{convertLatLonToXY:C}=(0,i.useOcearoContext)(),f=(0,o.useSignalKPath)("navigation.position"),S=(0,r.useRef)(),M=(0,r.useRef)(),T=(0,r.useCallback)(e=>{if(e.latitude&&e.longitude&&f&&f.latitude&&f.longitude&&e.latitude!=f.latitude&&e.longitude!=f.longitude){let t=a.default.get("aisLengthScalingFactor")||.7,{x:r,y:n}=C({lat:e.latitude,lon:e.longitude},{lat:f.latitude,lon:f.longitude});e.sceneX=r*t,e.sceneZ=-n*t,e.rotationAngleY=(e=>{if(!e)return 0;let t=e.heading||e.headingMagnetic;return e.cog||e.cogMagnetic||t||0})(e),e.distanceMeters=Math.sqrt(r**2+n**2);let i=e.visible;return e.visible=e.distanceMeters>10&&e.distanceMeters<=5e3,i!==e.visible}return!1},[f,C]),v=(0,r.useCallback)(()=>{g.current&&(clearTimeout(g.current),g.current=null);let e=Object.values(u).filter(e=>e.visible);((e,t)=>{if(e.length!==t.length)return!0;let r=new Set(e.map(e=>e.mmsi)),a=new Set(t.map(e=>e.mmsi));if(r.size!==a.size)return!0;for(let e of r)if(!a.has(e))return!0;return!1})(d,e)&&(console.log(`Updating visible vessels: ${e.length} vessels`),p(e))},[u,d]),G=(0,r.useCallback)(()=>{g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{v(),g.current=null},100)},[v]);return(0,r.useEffect)(()=>{S.current=T,M.current=G},[T,G]),(0,r.useEffect)(()=>{let e=setInterval(()=>{let e=Date.now();c(t=>{let r=!1,a={...t};return(Object.entries(a).forEach(([t,n])=>{e-n.lastUpdate>6e5&&(delete a[t],r=!0)}),r)?(G(),a):t})},6e4);return()=>clearInterval(e)},[G]),(0,r.useEffect)(()=>{let e=async e=>{console.log("Fetching static vessel info...");try{let t=await e.API().then(e=>e.vessels()),r=Object.entries(t).map(([e,t])=>{let r={mmsi:e};return s(r,"name","name",t),s(r,"latitude","navigation.position.value.latitude",t),s(r,"longitude","navigation.position.value.longitude",t),s(r,"sog","navigation.speedOverGround.value",t),s(r,"cog","navigation.courseOverGroundTrue.value",t),s(r,"cogMagnetic","navigation.courseOverGroundMagnetic.value",t),s(r,"heading","navigation.headingTrue.value",t),s(r,"headingMagnetic","navigation.headingMagnetic.value",t),s(r,"length","design.length.value.overall",t),s(r,"beam","design.beam.value",t),s(r,"callsign","communication.callsignVhf",t),s(r,"shipType","design.aisShipType.value.id",t),r.lastUpdate=Date.now(),r.distanceMeters=null,r.sceneX=null,r.sceneZ=null,r.rotationAngleY=null,r.visible=!1,r}),a={};if(r.forEach(e=>{e.mmsi&&"self"!=e.mmsi&&(null!==e.latitude||null!==e.longitude)&&(S.current(e),a[e.mmsi]=e)}),console.log(`Fetched ${r.length} vessels.`),Object.keys(a).length>0){console.log(`Initializing AIS data with ${Object.keys(a).length} vessels`),c(a);let e=Object.values(a).filter(e=>e.visible);p(e),console.log(`${e.length} vessels initially visible`)}}catch(e){console.error("Error fetching static info:",e)}},t=e=>{if(!e?.updates)return void console.warn("Missing delta or no updates:",e);let t=e.context.replace("vessels.","");t?(h.current[t]=Date.now(),c(r=>{let a=r[t]||{mmsi:t,name:"unknown",latitude:null,longitude:null,sog:null,cog:null,cogMagnetic:null,heading:null,headingMagnetic:null,distanceMeters:null,sceneX:null,sceneZ:null,rotationAngleY:null,visible:!1,length:null,beam:null,shipType:null};a.lastUpdate=h.current[t];let n=!1,i=!1;return e.updates.forEach(e=>{e.values&&e.values.forEach(e=>{switch(e.path){case"name":a.name=e.value;break;case"navigation.position":a.latitude=e.value.latitude,a.longitude=e.value.longitude,n=!0;break;case"navigation.speedOverGround":a.sog=e.value;break;case"navigation.courseOverGroundTrue":a.cog=e.value,i=!0;break;case"navigation.courseOverGroundMagnetic":a.cogMagnetic=e.value,i=!0;break;case"navigation.headingTrue":a.heading=e.value,i=!0;break;case"navigation.headingMagnetic":a.headingMagnetic=e.value,i=!0}})}),(S.current(a)||n||i)&&M.current(),{...r,[t]:a}})):console.warn("Update without MMSI context:",e)};return(async()=>{try{let{signalkUrl:r}=a.default.getAll();if(console.log("SignalK URL:",r),!r)throw Error("SignalK URL is undefined or invalid.");console.log(`Connecting to SignalK at: ${r}`);let i=n.default.createClient({subscriptions:[{context:"vessels.*",subscribe:[{path:"navigation.position"},{path:"navigation.speedOverGround"},{path:"navigation.courseOverGroundTrue"},{path:"navigation.courseOverGroundMagnetic"},{path:"navigation.headingTrue"},{path:"navigation.headingMagnetic"}]}]});m.current=i,await i.connect(),console.log("SignalK client connected."),await e(i),i.on("delta",t)}catch(e){console.warn("Error connecting to SignalK:",e)}})(),()=>{console.log("Disconnecting SignalK client..."),g.current&&clearTimeout(g.current),m.current?.disconnect()}},[]),(0,t.jsx)(l.Provider,{value:{aisData:u,vesselIds:d},children:e})},"useAIS",0,()=>(0,r.useContext)(l)])},75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),a=e.i(8560),n=e.i(90072);e.s(["ACESFilmicToneMapping",()=>n.ACESFilmicToneMapping,"AddEquation",()=>n.AddEquation,"AddOperation",()=>n.AddOperation,"AdditiveAnimationBlendMode",()=>n.AdditiveAnimationBlendMode,"AdditiveBlending",()=>n.AdditiveBlending,"AgXToneMapping",()=>n.AgXToneMapping,"AlphaFormat",()=>n.AlphaFormat,"AlwaysCompare",()=>n.AlwaysCompare,"AlwaysDepth",()=>n.AlwaysDepth,"AlwaysStencilFunc",()=>n.AlwaysStencilFunc,"AmbientLight",()=>n.AmbientLight,"AnimationAction",()=>n.AnimationAction,"AnimationClip",()=>n.AnimationClip,"AnimationLoader",()=>n.AnimationLoader,"AnimationMixer",()=>n.AnimationMixer,"AnimationObjectGroup",()=>n.AnimationObjectGroup,"AnimationUtils",()=>n.AnimationUtils,"ArcCurve",()=>n.ArcCurve,"ArrayCamera",()=>n.ArrayCamera,"ArrowHelper",()=>n.ArrowHelper,"AttachedBindMode",()=>n.AttachedBindMode,"Audio",()=>n.Audio,"AudioAnalyser",()=>n.AudioAnalyser,"AudioContext",()=>n.AudioContext,"AudioListener",()=>n.AudioListener,"AudioLoader",()=>n.AudioLoader,"AxesHelper",()=>n.AxesHelper,"BackSide",()=>n.BackSide,"BasicDepthPacking",()=>n.BasicDepthPacking,"BasicShadowMap",()=>n.BasicShadowMap,"BatchedMesh",()=>n.BatchedMesh,"Bone",()=>n.Bone,"BooleanKeyframeTrack",()=>n.BooleanKeyframeTrack,"Box2",()=>n.Box2,"Box3",()=>n.Box3,"Box3Helper",()=>n.Box3Helper,"BoxGeometry",()=>n.BoxGeometry,"BoxHelper",()=>n.BoxHelper,"BufferAttribute",()=>n.BufferAttribute,"BufferGeometry",()=>n.BufferGeometry,"BufferGeometryLoader",()=>n.BufferGeometryLoader,"ByteType",()=>n.ByteType,"Cache",()=>n.Cache,"Camera",()=>n.Camera,"CameraHelper",()=>n.CameraHelper,"CanvasTexture",()=>n.CanvasTexture,"CapsuleGeometry",()=>n.CapsuleGeometry,"CatmullRomCurve3",()=>n.CatmullRomCurve3,"CineonToneMapping",()=>n.CineonToneMapping,"CircleGeometry",()=>n.CircleGeometry,"ClampToEdgeWrapping",()=>n.ClampToEdgeWrapping,"Clock",()=>n.Clock,"Color",()=>n.Color,"ColorKeyframeTrack",()=>n.ColorKeyframeTrack,"ColorManagement",()=>n.ColorManagement,"CompressedArrayTexture",()=>n.CompressedArrayTexture,"CompressedCubeTexture",()=>n.CompressedCubeTexture,"CompressedTexture",()=>n.CompressedTexture,"CompressedTextureLoader",()=>n.CompressedTextureLoader,"ConeGeometry",()=>n.ConeGeometry,"ConstantAlphaFactor",()=>n.ConstantAlphaFactor,"ConstantColorFactor",()=>n.ConstantColorFactor,"Controls",()=>n.Controls,"CubeCamera",()=>n.CubeCamera,"CubeDepthTexture",()=>n.CubeDepthTexture,"CubeReflectionMapping",()=>n.CubeReflectionMapping,"CubeRefractionMapping",()=>n.CubeRefractionMapping,"CubeTexture",()=>n.CubeTexture,"CubeTextureLoader",()=>n.CubeTextureLoader,"CubeUVReflectionMapping",()=>n.CubeUVReflectionMapping,"CubicBezierCurve",()=>n.CubicBezierCurve,"CubicBezierCurve3",()=>n.CubicBezierCurve3,"CubicInterpolant",()=>n.CubicInterpolant,"CullFaceBack",()=>n.CullFaceBack,"CullFaceFront",()=>n.CullFaceFront,"CullFaceFrontBack",()=>n.CullFaceFrontBack,"CullFaceNone",()=>n.CullFaceNone,"Curve",()=>n.Curve,"CurvePath",()=>n.CurvePath,"CustomBlending",()=>n.CustomBlending,"CustomToneMapping",()=>n.CustomToneMapping,"CylinderGeometry",()=>n.CylinderGeometry,"Cylindrical",()=>n.Cylindrical,"Data3DTexture",()=>n.Data3DTexture,"DataArrayTexture",()=>n.DataArrayTexture,"DataTexture",()=>n.DataTexture,"DataTextureLoader",()=>n.DataTextureLoader,"DataUtils",()=>n.DataUtils,"DecrementStencilOp",()=>n.DecrementStencilOp,"DecrementWrapStencilOp",()=>n.DecrementWrapStencilOp,"DefaultLoadingManager",()=>n.DefaultLoadingManager,"DepthFormat",()=>n.DepthFormat,"DepthStencilFormat",()=>n.DepthStencilFormat,"DepthTexture",()=>n.DepthTexture,"DetachedBindMode",()=>n.DetachedBindMode,"DirectionalLight",()=>n.DirectionalLight,"DirectionalLightHelper",()=>n.DirectionalLightHelper,"DiscreteInterpolant",()=>n.DiscreteInterpolant,"DodecahedronGeometry",()=>n.DodecahedronGeometry,"DoubleSide",()=>n.DoubleSide,"DstAlphaFactor",()=>n.DstAlphaFactor,"DstColorFactor",()=>n.DstColorFactor,"DynamicCopyUsage",()=>n.DynamicCopyUsage,"DynamicDrawUsage",()=>n.DynamicDrawUsage,"DynamicReadUsage",()=>n.DynamicReadUsage,"EdgesGeometry",()=>n.EdgesGeometry,"EllipseCurve",()=>n.EllipseCurve,"EqualCompare",()=>n.EqualCompare,"EqualDepth",()=>n.EqualDepth,"EqualStencilFunc",()=>n.EqualStencilFunc,"EquirectangularReflectionMapping",()=>n.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>n.EquirectangularRefractionMapping,"Euler",()=>n.Euler,"EventDispatcher",()=>n.EventDispatcher,"ExternalTexture",()=>n.ExternalTexture,"ExtrudeGeometry",()=>n.ExtrudeGeometry,"FileLoader",()=>n.FileLoader,"Float16BufferAttribute",()=>n.Float16BufferAttribute,"Float32BufferAttribute",()=>n.Float32BufferAttribute,"FloatType",()=>n.FloatType,"Fog",()=>n.Fog,"FogExp2",()=>n.FogExp2,"FramebufferTexture",()=>n.FramebufferTexture,"FrontSide",()=>n.FrontSide,"Frustum",()=>n.Frustum,"FrustumArray",()=>n.FrustumArray,"GLBufferAttribute",()=>n.GLBufferAttribute,"GLSL1",()=>n.GLSL1,"GLSL3",()=>n.GLSL3,"GreaterCompare",()=>n.GreaterCompare,"GreaterDepth",()=>n.GreaterDepth,"GreaterEqualCompare",()=>n.GreaterEqualCompare,"GreaterEqualDepth",()=>n.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>n.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>n.GreaterStencilFunc,"GridHelper",()=>n.GridHelper,"Group",()=>n.Group,"HalfFloatType",()=>n.HalfFloatType,"HemisphereLight",()=>n.HemisphereLight,"HemisphereLightHelper",()=>n.HemisphereLightHelper,"IcosahedronGeometry",()=>n.IcosahedronGeometry,"ImageBitmapLoader",()=>n.ImageBitmapLoader,"ImageLoader",()=>n.ImageLoader,"ImageUtils",()=>n.ImageUtils,"IncrementStencilOp",()=>n.IncrementStencilOp,"IncrementWrapStencilOp",()=>n.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>n.InstancedBufferAttribute,"InstancedBufferGeometry",()=>n.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>n.InstancedInterleavedBuffer,"InstancedMesh",()=>n.InstancedMesh,"Int16BufferAttribute",()=>n.Int16BufferAttribute,"Int32BufferAttribute",()=>n.Int32BufferAttribute,"Int8BufferAttribute",()=>n.Int8BufferAttribute,"IntType",()=>n.IntType,"InterleavedBuffer",()=>n.InterleavedBuffer,"InterleavedBufferAttribute",()=>n.InterleavedBufferAttribute,"Interpolant",()=>n.Interpolant,"InterpolateDiscrete",()=>n.InterpolateDiscrete,"InterpolateLinear",()=>n.InterpolateLinear,"InterpolateSmooth",()=>n.InterpolateSmooth,"InterpolationSamplingMode",()=>n.InterpolationSamplingMode,"InterpolationSamplingType",()=>n.InterpolationSamplingType,"InvertStencilOp",()=>n.InvertStencilOp,"KeepStencilOp",()=>n.KeepStencilOp,"KeyframeTrack",()=>n.KeyframeTrack,"LOD",()=>n.LOD,"LatheGeometry",()=>n.LatheGeometry,"Layers",()=>n.Layers,"LessCompare",()=>n.LessCompare,"LessDepth",()=>n.LessDepth,"LessEqualCompare",()=>n.LessEqualCompare,"LessEqualDepth",()=>n.LessEqualDepth,"LessEqualStencilFunc",()=>n.LessEqualStencilFunc,"LessStencilFunc",()=>n.LessStencilFunc,"Light",()=>n.Light,"LightProbe",()=>n.LightProbe,"Line",()=>n.Line,"Line3",()=>n.Line3,"LineBasicMaterial",()=>n.LineBasicMaterial,"LineCurve",()=>n.LineCurve,"LineCurve3",()=>n.LineCurve3,"LineDashedMaterial",()=>n.LineDashedMaterial,"LineLoop",()=>n.LineLoop,"LineSegments",()=>n.LineSegments,"LinearFilter",()=>n.LinearFilter,"LinearInterpolant",()=>n.LinearInterpolant,"LinearMipMapLinearFilter",()=>n.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>n.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>n.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>n.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>n.LinearSRGBColorSpace,"LinearToneMapping",()=>n.LinearToneMapping,"LinearTransfer",()=>n.LinearTransfer,"Loader",()=>n.Loader,"LoaderUtils",()=>n.LoaderUtils,"LoadingManager",()=>n.LoadingManager,"LoopOnce",()=>n.LoopOnce,"LoopPingPong",()=>n.LoopPingPong,"LoopRepeat",()=>n.LoopRepeat,"MOUSE",()=>n.MOUSE,"Material",()=>n.Material,"MaterialLoader",()=>n.MaterialLoader,"MathUtils",()=>n.MathUtils,"Matrix2",()=>n.Matrix2,"Matrix3",()=>n.Matrix3,"Matrix4",()=>n.Matrix4,"MaxEquation",()=>n.MaxEquation,"Mesh",()=>n.Mesh,"MeshBasicMaterial",()=>n.MeshBasicMaterial,"MeshDepthMaterial",()=>n.MeshDepthMaterial,"MeshDistanceMaterial",()=>n.MeshDistanceMaterial,"MeshLambertMaterial",()=>n.MeshLambertMaterial,"MeshMatcapMaterial",()=>n.MeshMatcapMaterial,"MeshNormalMaterial",()=>n.MeshNormalMaterial,"MeshPhongMaterial",()=>n.MeshPhongMaterial,"MeshPhysicalMaterial",()=>n.MeshPhysicalMaterial,"MeshStandardMaterial",()=>n.MeshStandardMaterial,"MeshToonMaterial",()=>n.MeshToonMaterial,"MinEquation",()=>n.MinEquation,"MirroredRepeatWrapping",()=>n.MirroredRepeatWrapping,"MixOperation",()=>n.MixOperation,"MultiplyBlending",()=>n.MultiplyBlending,"MultiplyOperation",()=>n.MultiplyOperation,"NearestFilter",()=>n.NearestFilter,"NearestMipMapLinearFilter",()=>n.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>n.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>n.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>n.NearestMipmapNearestFilter,"NeutralToneMapping",()=>n.NeutralToneMapping,"NeverCompare",()=>n.NeverCompare,"NeverDepth",()=>n.NeverDepth,"NeverStencilFunc",()=>n.NeverStencilFunc,"NoBlending",()=>n.NoBlending,"NoColorSpace",()=>n.NoColorSpace,"NoNormalPacking",()=>n.NoNormalPacking,"NoToneMapping",()=>n.NoToneMapping,"NormalAnimationBlendMode",()=>n.NormalAnimationBlendMode,"NormalBlending",()=>n.NormalBlending,"NormalGAPacking",()=>n.NormalGAPacking,"NormalRGPacking",()=>n.NormalRGPacking,"NotEqualCompare",()=>n.NotEqualCompare,"NotEqualDepth",()=>n.NotEqualDepth,"NotEqualStencilFunc",()=>n.NotEqualStencilFunc,"NumberKeyframeTrack",()=>n.NumberKeyframeTrack,"Object3D",()=>n.Object3D,"ObjectLoader",()=>n.ObjectLoader,"ObjectSpaceNormalMap",()=>n.ObjectSpaceNormalMap,"OctahedronGeometry",()=>n.OctahedronGeometry,"OneFactor",()=>n.OneFactor,"OneMinusConstantAlphaFactor",()=>n.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>n.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>n.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>n.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>n.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>n.OneMinusSrcColorFactor,"OrthographicCamera",()=>n.OrthographicCamera,"PCFShadowMap",()=>n.PCFShadowMap,"PCFSoftShadowMap",()=>n.PCFSoftShadowMap,"PMREMGenerator",()=>a.PMREMGenerator,"Path",()=>n.Path,"PerspectiveCamera",()=>n.PerspectiveCamera,"Plane",()=>n.Plane,"PlaneGeometry",()=>n.PlaneGeometry,"PlaneHelper",()=>n.PlaneHelper,"PointLight",()=>n.PointLight,"PointLightHelper",()=>n.PointLightHelper,"Points",()=>n.Points,"PointsMaterial",()=>n.PointsMaterial,"PolarGridHelper",()=>n.PolarGridHelper,"PolyhedronGeometry",()=>n.PolyhedronGeometry,"PositionalAudio",()=>n.PositionalAudio,"PropertyBinding",()=>n.PropertyBinding,"PropertyMixer",()=>n.PropertyMixer,"QuadraticBezierCurve",()=>n.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>n.QuadraticBezierCurve3,"Quaternion",()=>n.Quaternion,"QuaternionKeyframeTrack",()=>n.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>n.QuaternionLinearInterpolant,"R11_EAC_Format",()=>n.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>n.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>n.RED_RGTC1_Format,"REVISION",()=>n.REVISION,"RG11_EAC_Format",()=>n.RG11_EAC_Format,"RGBADepthPacking",()=>n.RGBADepthPacking,"RGBAFormat",()=>n.RGBAFormat,"RGBAIntegerFormat",()=>n.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>n.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>n.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>n.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>n.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>n.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>n.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>n.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>n.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>n.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>n.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>n.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>n.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>n.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>n.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>n.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>n.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>n.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>n.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>n.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>n.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>n.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>n.RGBDepthPacking,"RGBFormat",()=>n.RGBFormat,"RGBIntegerFormat",()=>n.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>n.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>n.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>n.RGB_ETC1_Format,"RGB_ETC2_Format",()=>n.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>n.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>n.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>n.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>n.RGDepthPacking,"RGFormat",()=>n.RGFormat,"RGIntegerFormat",()=>n.RGIntegerFormat,"RawShaderMaterial",()=>n.RawShaderMaterial,"Ray",()=>n.Ray,"Raycaster",()=>n.Raycaster,"RectAreaLight",()=>n.RectAreaLight,"RedFormat",()=>n.RedFormat,"RedIntegerFormat",()=>n.RedIntegerFormat,"ReinhardToneMapping",()=>n.ReinhardToneMapping,"RenderTarget",()=>n.RenderTarget,"RenderTarget3D",()=>n.RenderTarget3D,"RepeatWrapping",()=>n.RepeatWrapping,"ReplaceStencilOp",()=>n.ReplaceStencilOp,"ReverseSubtractEquation",()=>n.ReverseSubtractEquation,"RingGeometry",()=>n.RingGeometry,"SIGNED_R11_EAC_Format",()=>n.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>n.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>n.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>n.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>n.SRGBColorSpace,"SRGBTransfer",()=>n.SRGBTransfer,"Scene",()=>n.Scene,"ShaderChunk",()=>a.ShaderChunk,"ShaderLib",()=>a.ShaderLib,"ShaderMaterial",()=>n.ShaderMaterial,"ShadowMaterial",()=>n.ShadowMaterial,"Shape",()=>n.Shape,"ShapeGeometry",()=>n.ShapeGeometry,"ShapePath",()=>n.ShapePath,"ShapeUtils",()=>n.ShapeUtils,"ShortType",()=>n.ShortType,"Skeleton",()=>n.Skeleton,"SkeletonHelper",()=>n.SkeletonHelper,"SkinnedMesh",()=>n.SkinnedMesh,"Source",()=>n.Source,"Sphere",()=>n.Sphere,"SphereGeometry",()=>n.SphereGeometry,"Spherical",()=>n.Spherical,"SphericalHarmonics3",()=>n.SphericalHarmonics3,"SplineCurve",()=>n.SplineCurve,"SpotLight",()=>n.SpotLight,"SpotLightHelper",()=>n.SpotLightHelper,"Sprite",()=>n.Sprite,"SpriteMaterial",()=>n.SpriteMaterial,"SrcAlphaFactor",()=>n.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>n.SrcAlphaSaturateFactor,"SrcColorFactor",()=>n.SrcColorFactor,"StaticCopyUsage",()=>n.StaticCopyUsage,"StaticDrawUsage",()=>n.StaticDrawUsage,"StaticReadUsage",()=>n.StaticReadUsage,"StereoCamera",()=>n.StereoCamera,"StreamCopyUsage",()=>n.StreamCopyUsage,"StreamDrawUsage",()=>n.StreamDrawUsage,"StreamReadUsage",()=>n.StreamReadUsage,"StringKeyframeTrack",()=>n.StringKeyframeTrack,"SubtractEquation",()=>n.SubtractEquation,"SubtractiveBlending",()=>n.SubtractiveBlending,"TOUCH",()=>n.TOUCH,"TangentSpaceNormalMap",()=>n.TangentSpaceNormalMap,"TetrahedronGeometry",()=>n.TetrahedronGeometry,"Texture",()=>n.Texture,"TextureLoader",()=>n.TextureLoader,"TextureUtils",()=>n.TextureUtils,"Timer",()=>n.Timer,"TimestampQuery",()=>n.TimestampQuery,"TorusGeometry",()=>n.TorusGeometry,"TorusKnotGeometry",()=>n.TorusKnotGeometry,"Triangle",()=>n.Triangle,"TriangleFanDrawMode",()=>n.TriangleFanDrawMode,"TriangleStripDrawMode",()=>n.TriangleStripDrawMode,"TrianglesDrawMode",()=>n.TrianglesDrawMode,"TubeGeometry",()=>n.TubeGeometry,"UVMapping",()=>n.UVMapping,"Uint16BufferAttribute",()=>n.Uint16BufferAttribute,"Uint32BufferAttribute",()=>n.Uint32BufferAttribute,"Uint8BufferAttribute",()=>n.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>n.Uint8ClampedBufferAttribute,"Uniform",()=>n.Uniform,"UniformsGroup",()=>n.UniformsGroup,"UniformsLib",()=>a.UniformsLib,"UniformsUtils",()=>n.UniformsUtils,"UnsignedByteType",()=>n.UnsignedByteType,"UnsignedInt101111Type",()=>n.UnsignedInt101111Type,"UnsignedInt248Type",()=>n.UnsignedInt248Type,"UnsignedInt5999Type",()=>n.UnsignedInt5999Type,"UnsignedIntType",()=>n.UnsignedIntType,"UnsignedShort4444Type",()=>n.UnsignedShort4444Type,"UnsignedShort5551Type",()=>n.UnsignedShort5551Type,"UnsignedShortType",()=>n.UnsignedShortType,"VSMShadowMap",()=>n.VSMShadowMap,"Vector2",()=>n.Vector2,"Vector3",()=>n.Vector3,"Vector4",()=>n.Vector4,"VectorKeyframeTrack",()=>n.VectorKeyframeTrack,"VideoFrameTexture",()=>n.VideoFrameTexture,"VideoTexture",()=>n.VideoTexture,"WebGL3DRenderTarget",()=>n.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>n.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>n.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>n.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>n.WebGLRenderTarget,"WebGLRenderer",()=>a.WebGLRenderer,"WebGLUtils",()=>a.WebGLUtils,"WebGPUCoordinateSystem",()=>n.WebGPUCoordinateSystem,"WebXRController",()=>n.WebXRController,"WireframeGeometry",()=>n.WireframeGeometry,"WrapAroundEnding",()=>n.WrapAroundEnding,"ZeroCurvatureEnding",()=>n.ZeroCurvatureEnding,"ZeroFactor",()=>n.ZeroFactor,"ZeroSlopeEnding",()=>n.ZeroSlopeEnding,"ZeroStencilOp",()=>n.ZeroStencilOp,"createCanvasElement",()=>n.createCanvasElement,"error",()=>n.error,"getConsoleFunction",()=>n.getConsoleFunction,"log",()=>n.log,"setConsoleFunction",()=>n.setConsoleFunction,"warn",()=>n.warn,"warnOnce",()=>n.warnOnce],32009);var i=e.i(32009);function o(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}let l=["x","y","top","bottom","left","right","width","height"];var s=e.i(46791),u=e.i(43476);function c({ref:e,children:a,fallback:n,resize:s,style:c,gl:d,events:p=t.f,eventSource:m,eventPrefix:h,shadows:g,linear:C,flat:f,legacy:S,orthographic:M,frameloop:T,dpr:v,performance:G,raycaster:R,camera:y,scene:A,onPointerMissed:F,onCreated:_,...B}){r.useMemo(()=>(0,t.e)(i),[]);let b=(0,t.u)(),[L,x]=function({debounce:e,scroll:t,polyfill:a,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var i,s,u;let c=a||("u"<typeof window?class{}:window.ResizeObserver);if(!c)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[d,p]=(0,r.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),m=(0,r.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:d,orientationHandler:null}),h=e?"number"==typeof e?e:e.scroll:null,g=e?"number"==typeof e?e:e.resize:null,C=(0,r.useRef)(!1);(0,r.useEffect)(()=>(C.current=!0,()=>void(C.current=!1)));let[f,S,M]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!m.current.element)return;let{left:r,top:a,width:i,height:o,bottom:s,right:u,x:c,y:d}=m.current.element.getBoundingClientRect(),h={left:r,top:a,width:i,height:o,bottom:s,right:u,x:c,y:d};m.current.element instanceof HTMLElement&&n&&(h.height=m.current.element.offsetHeight,h.width=m.current.element.offsetWidth),Object.freeze(h),C.current&&(e=m.current.lastBounds,t=h,!l.every(r=>e[r]===t[r]))&&p(m.current.lastBounds=h)};return[e,g?o(e,g):e,h?o(e,h):e]},[p,n,h,g]);function T(){m.current.scrollContainers&&(m.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",M,!0)),m.current.scrollContainers=null),m.current.resizeObserver&&(m.current.resizeObserver.disconnect(),m.current.resizeObserver=null),m.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",m.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",m.current.orientationHandler))}function v(){m.current.element&&(m.current.resizeObserver=new c(M),m.current.resizeObserver.observe(m.current.element),t&&m.current.scrollContainers&&m.current.scrollContainers.forEach(e=>e.addEventListener("scroll",M,{capture:!0,passive:!0})),m.current.orientationHandler=()=>{M()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",m.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",m.current.orientationHandler))}return i=M,s=!!t,(0,r.useEffect)(()=>{if(s)return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)},[i,s]),u=S,(0,r.useEffect)(()=>(window.addEventListener("resize",u),()=>void window.removeEventListener("resize",u)),[u]),(0,r.useEffect)(()=>{T(),v()},[t,M,S]),(0,r.useEffect)(()=>T,[]),[e=>{e&&e!==m.current.element&&(T(),m.current.element=e,m.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:a,overflowX:n,overflowY:i}=window.getComputedStyle(t);return[a,n,i].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),v())},d,f]}({scroll:!0,debounce:{scroll:50,resize:0},...s}),E=r.useRef(null),D=r.useRef(null);r.useImperativeHandle(e,()=>E.current);let P=(0,t.a)(F),[I,w]=r.useState(!1),[k,O]=r.useState(!1);if(I)throw I;if(k)throw k;let N=r.useRef(null);(0,t.b)(()=>{let e=E.current;x.width>0&&x.height>0&&e&&(N.current||(N.current=(0,t.c)(e)),async function(){await N.current.configure({gl:d,scene:A,events:p,shadows:g,linear:C,flat:f,legacy:S,orthographic:M,frameloop:T,dpr:v,performance:G,raycaster:R,camera:y,size:x,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(m?(0,t.i)(m)?m.current:m:D.current),h&&e.setEvents({compute:(e,t)=>{let r=e[h+"X"],a=e[h+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(a/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==_||_(e)}}),N.current.render((0,u.jsx)(b,{children:(0,u.jsx)(t.E,{set:O,children:(0,u.jsx)(r.Suspense,{fallback:(0,u.jsx)(t.B,{set:w}),children:null!=a?a:null})})}))}())}),r.useEffect(()=>{let e=E.current;if(e)return()=>(0,t.d)(e)},[]);let U=m?"none":"auto";return(0,u.jsx)("div",{ref:D,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:U,...c},...B,children:(0,u.jsx)("div",{ref:L,style:{width:"100%",height:"100%"},children:(0,u.jsx)("canvas",{ref:E,style:{display:"block"},children:n})})})}function d(e){return(0,u.jsx)(s.FiberProvider,{children:(0,u.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>d],75056)}]);