1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[466],{79:(e,t,n)=>{n.d(t,{N:()=>r});let r=e=>"/"+(e.split("/").filter(Boolean)[0]||"")},108:(e,t,n)=>{n.d(t,{am:()=>o,cY:()=>r,gm:()=>u,hk:()=>s,qp:()=>a,rM:()=>i,uL:()=>l});let r=["isSketchCurtainWallRendererReady","isSketchAnnotationRendererReady","isSketchContourMapRendererReady","isSketchContourMapAnnotationRendererReady","isSketchElasticGridRendererReady","isSketchElasticGridAnnotationRendererReady","isSketchPatternSelectorRendererReady","isSketchHeaderRendererReady"],a=[{id:0,uuid:"39151314",key:"contourmap",rendererReadyNames:["isSketchContourMapRendererReady","isSketchContourMapAnnotationRendererReady"]},{id:1,uuid:"cbecba2f",key:"elasticgrid",rendererReadyNames:["isSketchElasticGridRendererReady","isSketchElasticGridAnnotationRendererReady"]},{id:2,uuid:"fef132fc",key:"curtainwall",rendererReadyNames:["isSketchCurtainWallRendererReady","isSketchAnnotationRendererReady"]}],o=0,i=a[0].uuid,s=["isSketchPatternSelectorRendererReady","isSketchHeaderRendererReady"],l=a.flatMap(e=>e.rendererReadyNames),u=e=>a.find(t=>t.uuid===e)},261:(e,t,n)=>{n.r(t),n.d(t,{default:()=>eT});var r=n(7973),a=n(6065),o=n(8075),i=n(3267),s=n(4695),l=n(5874),u=n(2310),c=n(2466),f=n(4188),d=n(4866),m=n(4357);let p=(0,a.forwardRef)((e,t)=>{let{layers:n,name:o,children:s}=e,l=(0,a.useRef)(null),u=(0,a.useRef)(null),p=(0,i.C)(e=>e.gl),h=(0,i.C)(e=>e.size);return(0,c._B)("blue"),(0,a.useEffect)(()=>{u.current&&(u.current.aspect=h.width/h.height),u.current&&u.current.updateProjectionMatrix()},[h]),(0,a.useImperativeHandle)(t,()=>({children:s,camera:u.current,renderer:p}),[]),(0,r.jsxs)(f.Yi,{ref:l,renderPriority:1e4,children:[(0,r.jsx)(d.u,{ref:u,layers:n,name:o,makeDefault:!0,position:m.Yv,fov:m.XF,far:1e4}),(0,r.jsx)("ambientLight",{intensity:1}),s]})}),h=(0,a.forwardRef)((e,t)=>{let{layers:n,name:o,children:s}=e,l=(0,a.useRef)(null),u=(0,a.useRef)(null),p=(0,i.C)(e=>e.gl),h=(0,i.C)(e=>e.size);return(0,c._B)("blue"),(0,a.useEffect)(()=>{u.current&&(u.current.aspect=h.width/h.height),u.current&&u.current.updateProjectionMatrix()},[h]),(0,a.useImperativeHandle)(t,()=>({children:s,camera:u.current,renderer:p}),[]),(0,r.jsxs)(f.Yi,{ref:l,renderPriority:1e4,children:[(0,r.jsx)(d.u,{ref:u,layers:n,name:o,makeDefault:!0,position:m.Yv,fov:m.XF,far:1e4}),(0,r.jsx)("ambientLight",{intensity:1}),s]})});var g=n(9618),v=n(6987);let x=(0,a.forwardRef)((e,t)=>{let{children:n,layers:o,name:s}=e,{setPrimaryTexture:l}=(0,a.useContext)(u.Oo),c=(0,i.C)(e=>e.gl),p=(0,i.C)(e=>e.size),h=(0,a.useRef)(c).current,x=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null),R=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=new g.Pem(p.width,p.height);return e.minFilter=g.k6q,e.magFilter=g.k6q,R.current=e,l(e),()=>{l(null),e.dispose(),R.current=null}},[p.width,p.height]),(0,a.useEffect)(()=>{y.current&&(y.current.aspect=p.width/p.height),y.current&&y.current.updateProjectionMatrix()},[p]),(0,i.D)(()=>{if(!x.current||!y.current)return;let e=x.current.hudScene,t=y.current,n=h.autoClear;h.autoClear=!1,h.clearDepth(),h.render(e,t),h.autoClear=n,R.current&&h.copyFramebufferToTexture(R.current)},2),(0,a.useImperativeHandle)(t,()=>({children:n,camera:y.current,ambientLight:w.current,setFocus:()=>{}})),(0,r.jsxs)(f.Yi,{ref:x,renderPriority:2,renderEnabled:!1,backgroundColor:v.i.main.bgColor,children:[(0,r.jsx)(d.u,{ref:y,layers:o,name:s,makeDefault:!0,position:m.o8,fov:m.$2,near:.01,far:2e4}),(0,r.jsx)("ambientLight",{ref:w,layers:o,name:s,intensity:1}),n]})});var y=n(6382);let w=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{errorHeaderScene:o,setIsErrorHeaderRendererReady:d}=(0,a.useContext)(u.Ir),m=(0,a.useRef)(o).current,{fonts:h}=(0,a.useContext)(u.DM),{layoutMargins:g,headerScale:v}=(0,a.useContext)(u.MQ),x=(0,a.useRef)(g);x.current=g;let w=(0,a.useRef)(v);w.current=v;let R=(0,a.useRef)(null),C=(0,a.useRef)(null),b=(0,a.useRef)(null);(0,i.C)(e=>e.size);let S=(0,i.C)(e=>e.pointer),T=(0,a.useRef)(null),P=(0,a.useRef)({x:0*y.V$,y:2*y.V$}),M=(0,a.useRef)({x:-(0*y.V$),y:-(.2*y.V$)}),A=(0,s.zh)(()=>({from:{rx:R.current?.rotation.x??0,ry:R.current?.rotation.y??0},onChange:e=>{R.current.rotation.x=e.value.rx,R.current.rotation.y=e.value.ry}}),[])[1],D=e=>{I(),b.current?.present(e)},_=()=>{b.current?.dismiss()},I=()=>
1{if(!b.current||!T.current?.camera||!C.current||!R.current)return;C.current.scale.set(w.current,w.current,1);let e=T.current.camera,t=2*Math.tan(e.fov*(Math.PI/180)/2)*e.position.z,n=t*e.aspect,r=b.current.getBoundingBoxSize();C.current.position.x=-r.x/2,R.current.position.x=e.position.x-n/2+n*x.current.left+r.x/2,R.current.position.y=e.position.y+t/2-t*x.current.top+r.y/2},E=e=>{let t=P.current.x+S.y*M.current.x+M.current.x,n=P.current.y+-S.x*M.current.y+M.current.y;A.stop(!0),A.start({to:{rx:t,ry:n},config:{duration:400,easing:s.le.easeOutCubic}})};return(0,c._B)("deeppink"),(0,a.useEffect)(()=>{m.current=T.current,h.USansRgBd||d(!0)},[]),(0,a.useEffect)(()=>(window.addEventListener("mousemove",E),()=>window.removeEventListener("mousemove",E)),[]),(0,a.useLayoutEffect)(()=>{I()},[v,g]),(0,a.useImperativeHandle)(t,()=>({present:D,dismiss:_})),(0,r.jsx)(p,{ref:T,layers:n,name:f.eU.ERROR_HEADER,children:(0,r.jsx)("group",{ref:R,layers:n,children:(0,r.jsx)("group",{ref:C,layers:n,children:(0,r.jsx)(l.g,{ref:b,layers:n,position:[0,0,0],withAudio:!1,onInitialized:()=>{I(),d(!0)}})})})})});var R=n(6133);let C=256,b=2048,S=4,T=240,P=280,M=1,A=.9,D=.55,_=.06,I=.15,E=4e3,U=1200,O=.8,F=.3,N=5,L=3,z=1.5,V=600,k=-.3,G=.02,B=1024,j=256,$="BOTH",W=0xcccccc,H=.3,Y=0xcccccc,X=4,q=1,Z=240,Q=280,K=1,J=.9,ee=3,et=24,en=.03,er=3,ea=.02,eo=.5,ei=24;var es=n(2488),el=n(5844);let eu=(0,a.forwardRef)((e,t)=>{let{layers:n,label:o,onClick:i}=e,{play:l,stop:c}=(0,a.useContext)(u.nE),{primaryTexture:f}=(0,a.useContext)(u.Oo),{fonts:d}=(0,a.useContext)(u.DM),m=(0,a.useRef)(null),p=(0,a.useRef)(null),h=(0,a.useRef)(null),x=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null),[C,b]=(0,a.useState)(!1),[S,T]=(0,a.useState)(!1),[P,M]=(0,a.useState)(new g.I9Y(0,0)),A=(0,a.useMemo)(()=>new g.I9Y(P.x+24+24,P.y+24+24),[P]),[D,_]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>w.current?.setOpacity(e.value.progress)}),[]),[I,E]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>x.current?.setOpacityRatio(e.value.progress)}),[]),[U,O]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>y.current?.setOpacityRatio(e.value.progress)}),[]),[F,N]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>{y.current?.hover(e.value.progress),p.current?.setPositionZ(4+20*e.value.progress),h.current?.hover(e.value.progress)}}),[]),L=(e,t)=>{p.current&&w.current&&h.current&&(p.current.present(e,t),w.current.present(e,t),_.stop(!0),_.start({from:{progress:D.progress},to:{progress:1},delay:t,config:{duration:.2*e}}),E.stop(!0),E.start({from:{progress:I.progress},to:{progress:1},delay:t,config:{duration:.2*e}}),O.stop(!0),O.start({from:{progress:U.progress},to:{progress:1},delay:t,config:{duration:.2*e}}),h.current.setEnabled(!0))},z=(e,t)=>{p.current&&w.current&&h.current&&(p.current.dismiss(e,t),w.current.dismiss(e,t),_.stop(!0),_.start({from:{progress:D.progress},to:{progress:0},delay:t,config:{duration:e}}),E.stop(!0),E.start({from:{progress:I.progress},to:{progress:0},delay:t,config:{duration:e}}),O.stop(!0),O.start({from:{progress:U.progress},to:{progress:0},delay:t,config:{duration:e}}),N.stop(!0),N.start({from:{progress:F.progress},to:{progress:0},config:{duration:.1*e,easing:s.le.linear},onRest:()=>{h.current?.setHovered(!1),h.current?.setEnabled(!1),b(!1)}}))};return(0,a.useEffect)(()=>{f&&d.USansRgBd&&w.current&&w.current.setDiffuseTexture(f)},[f,d.USansRgBd]),(0,a.useEffect)(()=>{!C||h.current&&p.current&&(h.current.setHovered(S),S?(N.stop(!0),p.current.hover(600,0),N.start({from:{progress:F.progress},to:{progress:1},config:{duration:100,easing:s.le.linear}})):(N.stop(!0),N.start({from:{progress:F.progress},to:{progress:0},config:{duration:100,easing:s.le.linear}})))},[S]),(0,a.useImperativeHandle)(t,()=>({present:L,dismiss:z,getBoundingBoxSize:()=>A}),[]),d.USansRgBd&&(0,r.jsxs)("mesh",{ref:m,layers:n,children:[(0,r.jsxs)("mesh",{layers:n,onClick:e=>{C&&(e.stopPropagation(),b(!1),T(!1),document.body.style.cursor="auto",c(el.uc.SFX_NAVIGATION_MAIN_CLICK),l(el.uc.SFX_NAVIGATION_MAIN_CLICK,es.z.sfx.navigation.mainClick,!1),i?.())},onPointerOver:e=>{C&&(e.stopPropagation(),T(!0),document.body.style.cursor="pointer",l(el.uc.SFX_NAVIGATION_MAIN_HOVER_1,es.z.sfx.navigation.mainHover1,!1))},onPointerOut:e=>{C&&(e.stopPropagation(),T(!1),document.body.style.cursor="auto")},children:[(0,r.jsx)("planeGeometry",{args:[A.x,A.y]}),(0,r.jsx)("meshBasicMaterial",{opacity:0,transparent:!0,side:g.hB5,depthTest:!1})]}),(0,r.jsx)(R.oQ,{ref:p,layers:n,text:o,fontFile:d.USansRgBd.fontFile,fontTexture:d.USansRgBd.fontTexture,fontSize:64,colorMultiplier:1.5,onInitialized:()=>{let e=p.current?.getBoundingBoxSize();e&&(p.current?.setPositionXYZ(-e.x/2,e.y/2,4),M(new g.I9Y(e.x,e.y)))},onPresentStart:()=>b(!1),onPresentEnd:()=>b(!0),onDismissStart:()=>b(!1),onDismissEnd:()=>b(!1)}),(0,r.jsx)(R.Yi,{ref:h,layers:n,width:A.x,height:A.y,fillColor:v.i.label.hoverColor,fillOpacity:v.i.label.hoverOpacity}),(0,r.jsx)(R.dr,{ref:y,layers:n,width:A.x,height:A.y,length:8,color:v.i.label.bracketColor,opacity:v.i.label.bracketOpacity}),(0,r.jsx)(R.Ml,{ref:x,layers:n,width:A.x,height:A.y,enableLine:!0,enableFill:!1,lineColor:v.i.label.outlineColor,lineOpacity:v.i.label.outlineOpacity}),(0,r.jsx)(R.pi,{ref:w,layers:n,width:A.x,height:A.y,blur:.3,opacity:.7,transparent:!0})]})});eu.displayName="ErrorReturnButton";let ec=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{errorCode:o,errorMessage:l,errorMessageScene:d,setIsErrorMessageRendererReady:m}=(0,a.useContext)(u.Ir),p=(0,a.useRef)(d).current,{fonts:x}=(0,a.useContext)(u.DM),{setNavigationPath:y}=(0,a.useContext)(u._3),w=(0,a.useRef)(null),C=(0,a.useRef)(null),b=(0,a.useRef)(null),S=(0,a.useRef)(null),T=(0,a.useRef)(null),P=(0,i.C)(e=>e.pointer),M=(0,a.useRef)(!1),A=(0,a.useRef)(0),D=(0,s.zh)(()=>({from:{rx:0,ry:0}}),[])[1],_=e=>
1{E(),b.current?.present({min:400,max:800},{min:e,max:e+800}),S.current?.present(1500,e+600)},I=()=>{b.current?.dismiss({min:200,max:400},{min:0,max:200}),S.current?.dismiss(100,0)},E=()=>{if(!b.current||!T.current?.camera||!C.current||!w.current)return;let e=b.current.getBoundingBoxSize(),t=T.current.camera,n=2*Math.tan(t.fov*(Math.PI/180)/2)*t.position.z;w.current.position.x=0,w.current.position.y=.04*n,C.current.position.x=-e.x/2,C.current.position.y=e.y/2,A.current=-(e.y+64)},U=e=>{w.current&&(D.stop(!0),D.start({to:{rx:0,ry:-P.x*k},config:{duration:1600,easing:s.le.easeOutCubic},onChange:e=>{w.current&&w.current.rotation.set(e.value.rx,-e.value.ry,0)}}))};(0,c._B)("deeppink"),(0,a.useEffect)(()=>{p.current=T.current,x.USansRgBd||m(!0)},[]),(0,a.useEffect)(()=>(window.addEventListener("mousemove",U),()=>window.removeEventListener("mousemove",U)),[]),(0,a.useLayoutEffect)(()=>{E()},[]),(0,a.useImperativeHandle)(t,()=>({present:_,dismiss:I}));let O=`${o} ${l}`;return(0,r.jsx)(h,{ref:T,layers:n,name:f.eU.ERROR_MESSAGE,children:(0,r.jsxs)("group",{ref:w,layers:n,children:[(0,r.jsx)("group",{ref:C,layers:n,children:x.USansRgBd&&(0,r.jsx)(R.PD,{ref:b,layers:n,position:[0,0,0],text:O,fontFile:x.USansRgBd.fontFile,fontTexture:x.USansRgBd.fontTexture,fontSize:128,fontColor:new g.Q1f(v.i.label.fontColor),dithering:!1,onInitialized:()=>{M.current=!0,E(),m(!0)}})}),(0,r.jsx)("group",{position:[0,A.current,0],layers:n,children:(0,r.jsx)(eu,{ref:S,layers:n,label:"Return Home",onClick:()=>{y("/")}})})]})})});var ef=n(3882),ed=n(7197);function em(e,t,n,r,a){let o=Math.random();return e.setHSL((t+(n-t)*o)/360,r,a),e}let ep=e=>{let{ringBufferTexture:t,materialRef:n,layers:o}=e,i=(0,a.useRef)(n).current,s=(0,a.useMemo)(()=>{let e=C*b,t=new g.LoY,n=new Float32Array(e),r=new Float32Array(e);for(let e=0;e<C;e++)for(let t=0;t<b;t++){let a=e*b+t;n[a]=e,r[a]=t}t.setAttribute("aCurveId",new g.THS(n,1)),t.setAttribute("aSlotIndex",new g.THS(r,1));let a=new Uint32Array(C*(b-1)*2),o=0;for(let e=0;e<C;e++){let t=e*b;for(let e=0;e<b-1;e++)a[o++]=t+e,a[o++]=t+e+1}return t.setIndex(new g.THS(a,1)),t},[]),l=(0,a.useMemo)(()=>{let e=new Uint8Array(4*C),t=new g.Q1f;for(let n=0;n<C;n++)em(t,T,P,M,A),e[4*n]=Math.round(255*t.r),e[4*n+1]=Math.round(255*t.g),e[4*n+2]=Math.round(255*t.b),e[4*n+3]=255;let n=new g.GYF(e,C,1,g.GWd);return n.minFilter=g.hxR,n.magFilter=g.hxR,n.needsUpdate=!0,n},[]),u=(0,a.useMemo)(()=>{let e=new g.BKk({vertexShader:ed.Pn,fragmentShader:ed.Rh,uniforms:{uRingBuffer:{value:null},uWriteIndex:{value:0},uHistoryLength:{value:b},uRingBufferWidth:{value:b},uRingBufferHeight:{value:C},uFadeStart:{value:_},uColorMap:{value:l},uOpacity:{value:0},uLineAlpha:{value:D}},transparent:!0,depthTest:!1,depthWrite:!1,blending:g.EZo});return i.current=e,e},[i,l]);return(0,a.useEffect)(()=>{u&&t&&(u.uniforms.uRingBuffer.value=t)},[u,t]),(0,a.useEffect)(()=>()=>{s.dispose(),u.dispose(),l.dispose()},[s,u,l]),(0,r.jsx)("lineSegments",{geometry:s,material:u,layers:o,frustumCulled:!1})},eh=e=>{let{glyphData:t,opacity:n,layers:o}=e,{lineGeometry:i,pointGeometry:s}=(0,a.useMemo)(()=>(function(e){let{transformedContours:t,extrudeDepth:n}=e,r=[],a=[],o=[],i=[];for(let e of t){let t=e.vertices,s=t.length/2;if(!(s<2))for(let e=0;e<s;e++){let l=(e+1)%s,u=t[2*e],c=t[2*e+1],f=t[2*l],d=t[2*l+1];r.push(u,c,0,f,d,0),a.push(1,1),r.push(u,c,n,f,d,n),a.push(1,1),r.push(u,c,0,u,c,n),a.push(1,1),o.push(u,c,0),i.push(1),o.push(u,c,n),i.push(1)}}let s=new g.LoY;s.setAttribute("position",new g.qtW(r,3)),s.setAttribute("aAlpha",new g.qtW(a,1));let l=new g.LoY;return l.setAttribute("position",new g.qtW(o,3)),l.setAttribute("aAlpha",new g.qtW(i,1)),{lineGeometry:s,pointGeometry:l}})(t),[t]),l=(0,a.useMemo)(()=>new g.BKk({vertexShader:ed.QY,fragmentShader:ed.eI,uniforms:{uColor:{value:new g.Q1f(W)},uOpacity:{value:0},uLineAlpha:{value:H}},transparent:!0,depthTest:!1,depthWrite:!1,blending:g.EZo}),[]),u=(0,a.useMemo)(()=>new g.BKk({vertexShader:ed.RJ,fragmentShader:ed.vH,uniforms:{uColor:{value:new g.Q1f(Y)},uOpacity:{value:0},uDotAlpha:{value:q},uPointSize:{value:X}},transparent:!0,depthTest:!1,depthWrite:!1,blending:g.EZo}),[]);return(0,c.Ql)(()=>{l.uniforms.uOpacity.value=n.current,u.uniforms.uOpacity.value=n.current}),(0,a.useEffect)(()=>()=>{i.dispose(),s.dispose(),l.dispose(),u.dispose()},[i,s,l,u]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("lineSegments",{geometry:i,material:l,layers:o,frustumCulled:!1}),(0,r.jsx)("points",{geometry:s,material:u,layers:o,frustumCulled:!1})]})},eg=e=>{let{glyphData:t,opacity:n,layers:o}=e,i=(0,a.useMemo)(()=>(function(e){let{transformedContours:t,extrudeDepth:n}=e,r=[];for(let e of t){let t=e.vertices,a=t.length/2;if(a<2)continue;let o=[];for(let e=0;e<a;e++){let n=(e+1)%a,r=t[2*n]-t[2*e],i=t[2*n+1]-t[2*e+1],s=Math.sqrt(r*r+i*i);o.push(s>
10?{nx:-i/s,ny:r/s}:{nx:1,ny:0})}for(let e=0;e<a;e++){let i=(e+1)%a,s=t[2*e],l=t[2*e+1],u=t[2*i],c=t[2*i+1],f=u-s,d=c-l,m=Math.sqrt(f*f+d*d),p=m>0?-d/m:0,h=m>0?f/m:0;r.push({sx:s,sy:l,sz:0,ex:u,ey:c,ez:0,length:m,nx:p,ny:h,nz:0}),r.push({sx:s,sy:l,sz:n,ex:u,ey:c,ez:n,length:m,nx:p,ny:h,nz:0});let g=o[(e-1+a)%a],v=o[e],x=g.nx+v.nx,y=g.ny+v.ny,w=Math.sqrt(x*x+y*y);r.push({sx:s,sy:l,sz:0,ex:s,ey:l,ez:n,length:n,nx:w>0?x/w:1,ny:w>0?y/w:0,nz:0})}}return r})(t),[t]),s=(0,a.useMemo)(()=>(function(e){let t=et+1,n=e.length*ee,r=n*t,a=new Float32Array(3*r),o=new Float32Array(3*r),i=new Float32Array(3*r),s=new Float32Array(r),l=new Float32Array(3*r),u=new g.Q1f,c=0;for(let t=0;t<e.length;t++){let n=e[t],r=n.ex-n.sx,f=n.ey-n.sy,d=n.ez-n.sz;for(let e=0;e<ee;e++){let m=31*t+7*e,p=50*Math.sin(.1*m)+30*Math.cos(.3*m),h=.3+(.5*Math.sin(1.7*m)+.5)*.7,g=en*(.5+(.5*Math.sin(2.1*m)+.5)),v=en*(.5+(.5*Math.sin(3.3*m)+.5));em(u,Z,Q,K,J);let x=u.r,y=u.g,w=u.b;for(let e=0;e<=et;e++){let t=-g+e/et*(1+g+v);a[3*c]=n.sx+r*t,a[3*c+1]=n.sy+f*t,a[3*c+2]=n.sz+d*t,o[3*c]=n.nx,o[3*c+1]=n.ny,o[3*c+2]=n.nz,i[3*c]=n.length*t*ea,i[3*c+1]=p,i[3*c+2]=h,l[3*c]=x,l[3*c+1]=y,l[3*c+2]=w,s[c]=1,c++}}}let f=new g.LoY;f.setAttribute("position",new g.qtW(a,3)),f.setAttribute("aNormal",new g.qtW(o,3)),f.setAttribute("aNoiseParams",new g.qtW(i,3)),f.setAttribute("aColor",new g.qtW(l,3)),f.setAttribute("aAlpha",new g.qtW(s,1));let d=new Uint32Array(n*et*2),m=0;for(let e=0;e<n;e++){let n=e*t;for(let e=0;e<et;e++)d[m++]=n+e,d[m++]=n+e+1}return f.setIndex(new g.THS(d,1)),f})(i),[i]),l=(0,a.useMemo)(()=>new g.BKk({vertexShader:ed.Wx,fragmentShader:ed.lh,uniforms:{uOpacity:{value:0},uLineAlpha:{value:eo},uTime:{value:0},uNoiseAmp:{value:er},uAnimSpeed:{value:ei}},transparent:!0,depthTest:!1,depthWrite:!1,blending:g.EZo}),[]);return(0,c.Ql)((e,t)=>{l.uniforms.uOpacity.value=n.current,l.uniforms.uTime.value+=t}),(0,a.useEffect)(()=>()=>{s.dispose(),l.dispose()},[s,l]),(0,r.jsx)("lineSegments",{geometry:s,material:l,layers:o,frustumCulled:!1})};var ev=n(3545),ex=n(1916),ey=n(637);let ew=` 2varying vec2 vUv; 3void main() { 4 vUv = uv; 5 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 6} 7`,eR=Math.ceil(Math.sqrt(C)),eC=` 8varying vec2 vUv; 9void main() { 10 vUv = uv; 11 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 12} 13`;function eb(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new g.nWS(e,t,{minFilter:g.hxR,magFilter:g.hxR,format:g.GWd,type:g.RQf,depthBuffer:n,stencilBuffer:n})}let eS=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{errorCode:o,errorMessage:l,setIsErrorRendererReady:d}=(0,a.useContext)(u.Ir),p=(0,i.C)(e=>e.gl),h=function(e,t){let[n,r]=(0,a.useState)(null),o=(0,a.useRef)(`${e} ${t}`);return o.current=`${e} ${t}`,(0,a.useEffect)(()=>{let e=!1;return(async()=>{let{buffer:t}=await (0,ev.G)("/assets/font/error-glyphs.bin");if(e)return;let{glyphs:n,kerning:a,unitsPerEm:i,ascender:s,descender:l}=function(e){let t=new DataView(e),n=0;if("GLYF"!==String.fromCharCode(t.getUint8(0),t.getUint8(1),t.getUint8(2),t.getUint8(3)))throw Error("Invalid glyph binary: bad magic");n=6;let r=t.getUint16(n,!0);n+=2;let a=t.getUint16(n,!0);n+=2;let o=t.getInt16(n,!0);n+=2;let i=t.getInt16(n,!0);n+=2;let s=new Map;for(let e=0;e<r;e++){let e=t.getUint16(n,!0);n+=2;let r=t.getFloat32(n,!0);n+=4;let a=t.getUint16(n,!0);n+=2;let o=[];for(let e=0;e<a;e++){let e=t.getUint16(n,!0);n+=2;let r=new Float32Array(2*e);for(let a=0;a<2*e;a++)r[a]=t.getFloat32(n,!0),n+=4;o.push({vertices:r})}s.set(e,{charCode:e,advanceWidth:r,contours:o})}let l=new Map,u=t.getUint16(n,!0);n+=2;for(let e=0;e<u;e++){let e=t.getUint16(n,!0);n+=2;let r=t.getUint16(n,!0);n+=2;let a=t.getFloat32(n,!0);n+=4,l.set(`${e},${r}`,a)}return{glyphs:s,kerning:l,unitsPerEm:a,ascender:o,descender:i}}(t);r(function(e,t,n,r,a,o){let i=a-o,s=i*I,l=.5*s,u=Array.from(e).map(e=>e.charCodeAt(0)),c=[],f=0;for(let e=0;e<u.length;e++){let r=u[e];c.push(f);let a=t.get(r);if(a){f+=a.advanceWidth;let t=u[e+1];if(void 0!==t){let e=n.get(`${r},${t}`);e&&(f+=e)}}}let d=[],p=1/0,h=1/0,v=-1/0,x=-1/0;for(let e=0;e<u.length;e++){let n=t.get(u[e]);if(!n)continue;let r=c[e];for(let e of n.contours){let t=new Float32Array(e.vertices.length);for(let n=0;n<e.vertices.length;n+=2){let a=e.vertices[n]+r,o=-e.vertices[n+1];t[n]=a,t[n+1]=o,a<p&&(p=a),o<h&&(h=o),a>v&&(v=a),o>x&&(x=o)}d.push({vertices:t})}}let y=(p+v)*.5,w=(h+x)*.5,R=[],C=1/0,b=1/0,S=-1/0,T=-1/0;for(let e of d){let t=new Float32Array(e.vertices.length);for(let n=0;n<e.vertices.length;n+=2){let r=e.vertices[n]-y,a=e.vertices[n+1]-w;t[n]=r,t[n+1]=a,r<C&&(C=r),a<b&&(b=a),r>S&&(S=r),a>T&&(T=a)}R.push({vertices:t})}let P=m.o8.z,M=2*Math.tan(m.$2*Math.PI/180/2)*P,A=S-C,D=A>0?16/9*M*.8/A:1,_=[],E=1/0,U=1/0,O=-1/0,F=-1/0;for(let e of R){let t=new Float32Array(e.vertices.length);for(let n=0;n<e.vertices.length;n+=2){let r=e.vertices[n]*D,a=e.vertices[n+1]*D;t[n]=r,t[n+1]=a,r<E&&(E=r),a<U&&(U=a),r>O&&(O=r),a>F&&(F=a)}_.push({vertices:t})}return s*=D,l=.5*s,R.length=0,R.push(..._),p=E,h=U,v=O,x=F,{transformedContours:R,bboxMin:new g.I9Y(p,h),bboxMax:new g.I9Y(v,x),charHeight:i,extrudeDepth:s,extrudeCenter:l,unitsPerEm:r}}(o.current,n,a,i,s,l))})(),()=>{e=!0}},[e,t]),n}(o,l),{sdfTexture:v}=function(e,t){let[n,r]=(0,a.useState)(null),o=(0,a.useRef)(null),i=(0,a.useRef)(t).current;return(0,a.useEffect)(()=>
13{if(!e||!i)return;let{transformedContours:t,bboxMin:n,bboxMax:a}=e,s=i.getRenderTarget(),l=i.autoClear;i.autoClear=!0;let u=eb(B,j),c=new g.Z58,f=n.x-2,d=a.x+2,m=n.y-2,p=a.y+2,h=new g.qUd(f,d,p,m,-1,1),v=function(e){let t=[],n=new g.mrM({color:0xffffff});for(let r of e){let e=r.vertices,a=e.length/2;if(a<2)continue;let o=new Float32Array(3*a);for(let t=0;t<a;t++)o[3*t]=e[2*t],o[3*t+1]=e[2*t+1],o[3*t+2]=0;let i=new g.LoY;i.setAttribute("position",new g.THS(o,3)),t.push(new g.FCc(i,n))}return t}(t);for(let e of v)c.add(e);i.setRenderTarget(u),i.setClearColor(0,1),i.clear(),i.render(c,h);let x=eb(B,j,!0),y=new g.Z58,w=new g.qUd(f,d,p,m,-1,1),R=function(e){let t=[],n=new g.V9B({colorWrite:!1,depthWrite:!1,depthTest:!1,stencilWrite:!0,stencilFunc:g.sKt,stencilRef:0,stencilZPass:g.oVO,stencilZFail:g.VVr,stencilFail:g.VVr,side:g.$EB});for(let r of e){let e=r.vertices,a=e.length/2;if(a<3)continue;let o=0,i=0;for(let t=0;t<a;t++)o+=e[2*t],i+=e[2*t+1];o/=a,i/=a;let s=new Float32Array(3*a*3);for(let t=0;t<a;t++){let n=(t+1)%a,r=9*t;s[r]=o,s[r+1]=i,s[r+2]=0,s[r+3]=e[2*t],s[r+4]=e[2*t+1],s[r+5]=0,s[r+6]=e[2*n],s[r+7]=e[2*n+1],s[r+8]=0}let l=new g.LoY;l.setAttribute("position",new g.THS(s,3)),t.push(new g.eaF(l,n))}return t}(t);for(let e of R)y.add(e);i.setRenderTarget(x),i.setClearColor(0,1),i.state.buffers.stencil.setClear(0),i.clear(!0,!0,!0),i.render(y,w);let C=new g.Z58,b=new g.V9B({color:0xffffff,depthTest:!1,depthWrite:!1,stencilWrite:!0,stencilFunc:g.klZ,stencilRef:0,stencilZPass:g.VVr,stencilZFail:g.VVr,stencilFail:g.VVr}),S=new g.bdM(d-f,p-m),T=new g.eaF(S,b);T.position.set((f+d)*.5,(m+p)*.5,0),C.add(T),i.autoClear=!1,i.render(C,w),i.autoClear=!0;let P=new g.Z58,M=new g.qUd(-1,1,1,-1,0,1),A=new g.bdM(2,2),D=eb(B,j),_=new g.BKk({vertexShader:eC,fragmentShader:ed.U$,uniforms:{uOutlineTexture:{value:u.texture},uResolution:{value:new g.I9Y(B,j)}},depthTest:!1,depthWrite:!1}),I=new g.eaF(A,_);P.add(I),i.setRenderTarget(D),i.clear(),i.render(P,M);let E=eb(B,j),U=eb(B,j),O=new g.BKk({vertexShader:eC,fragmentShader:ed.N3,uniforms:{uStepSize:{value:0},uResolution:{value:new g.I9Y(B,j)},uPrevPass:{value:null}},depthTest:!1,depthWrite:!1});I.visible=!1;let F=new g.eaF(A,O);P.add(F);let N=D,L=E;for(let e=0;e<10;e++){let t=Math.pow(2,9-e);if(O.uniforms.uStepSize.value=t,O.uniforms.uPrevPass.value=N.texture,i.setRenderTarget(L),i.clear(),i.render(P,M),0===e)N=E,L=U;else{let e=N;N=L,L=e}}let z=new g.nWS(B,j,{minFilter:g.k6q,magFilter:g.k6q,format:g.GWd,type:g.RQf,depthBuffer:!1,stencilBuffer:!1}),V=a.x-n.x+4,k=a.y-n.y+4,G=new g.BKk({vertexShader:eC,fragmentShader:ed.kC,uniforms:{uJFATexture:{value:N.texture},uWindingMask:{value:x.texture},uResolution:{value:new g.I9Y(B,j)},uWorldSize:{value:new g.I9Y(V,k)}},depthTest:!1,depthWrite:!1});F.visible=!1;let $=new g.eaF(A,G);for(let e of(P.add($),i.setRenderTarget(z),i.clear(),i.render(P,M),i.setRenderTarget(s),i.autoClear=l,u.dispose(),x.dispose(),D.dispose(),E.dispose(),U.dispose(),v))e.geometry.dispose(),e.material.dispose();for(let e of R)e.geometry.dispose(),e.material.dispose();return S.dispose(),b.dispose(),A.dispose(),_.dispose(),O.dispose(),G.dispose(),o.current=z.texture,r(z.texture),()=>{z.dispose(),o.current=null}},[e,i]),{sdfTexture:n}}(h,p),{isReady:w,ringBufferTexture:R,writeIndex:T,compute:P,dispose:M}=function(e){let{gl:t,sdfTexture:n,glyphData:r}=e,[o,i]=(0,a.useState)(!1),s=(0,a.useRef)(null),l=(0,a.useRef)(!1),u=(0,a.useRef)(null),c=(0,a.useRef)(null),f=(0,a.useRef)(null),d=(0,a.useRef)(null),m=(0,a.useRef)(null),p=(0,a.useRef)(null),h=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(0),R=(0,a.useRef)(0),T=(0,a.useRef)(0),P=(0,a.useRef)(null),M=(0,a.useRef)(null);n&&r&&!l.current&&n!==P.current&&r!==M.current&&(P.current=n,M.current=r,function(e,t,n){(0,ef.Rm)("crimson","\uD83D\uDEE0ï¸","useErrorScribbleGPUCompute.setup");let{bboxMin:r,bboxMax:a,extrudeCenter:o,extrudeDepth:S}=n,P=new ex.d(eR,eR,e);(0,ey.n)()&&P.setDataType(g.ix0);let M=P.createTexture(),A=P.createTexture(),D=P.createTexture(),_=M.image.data,I=A.image.data,V=D.image.data,k=n.transformedContours,G=
13a.x-r.x,$=a.y-r.y,W=[],H=50*C;for(let e=0;e<H&&W.length<C;e++){let e=r.x+Math.random()*G,t=r.y+Math.random()*$;(function(e,t){let n=0;for(let r of k){let a=r.vertices,o=a.length/2;for(let r=0;r<o;r++){let i=(r+1)%o,s=a[2*r+1],l=a[2*i+1];if(s<=t&&l>t||l<=t&&s>t){let o=a[2*r];e<o+(t-s)/(l-s)*(a[2*i]-o)&&n++}}}return(1&n)==1})(e,t)&&W.push({x:e,y:t})}for(let e=0;e<eR*eR;e++){let t=4*e;if(e<C){let n=W[e%W.length];_[t]=n.x,_[t+1]=n.y,_[t+2]=Math.random()*S,_[t+3]=1;let r=Math.random()*Math.PI*2,a=Math.acos(2*Math.random()-1),o=.5*E;I[t]=Math.sin(a)*Math.cos(r)*o,I[t+1]=Math.sin(a)*Math.sin(r)*o,I[t+2]=Math.cos(a)*o,I[t+3]=0,V[t]=+(Math.random()>.5),V[t+1]=1,V[t+2]=Math.random()*N,V[t+3]=1}else _[t]=0,_[t+1]=0,_[t+2]=0,_[t+3]=0,I[t]=0,I[t+1]=0,I[t+2]=0,I[t+3]=0,V[t]=0,V[t+1]=1,V[t+2]=0,V[t+3]=0}let Y=P.addVariable("tCurvePosition",ed.Cg,M),X=P.addVariable("tCurveVelocity",ed.Yb,A),q=P.addVariable("tCurveRole",ed.Bg,D);P.setVariableDependencies(Y,[Y,X]),P.setVariableDependencies(X,[Y,X,q]),P.setVariableDependencies(q,[q]),Y.material.uniforms.uDelta={value:0},Y.material.uniforms.uBBoxMin={value:new g.I9Y(r.x,r.y)},Y.material.uniforms.uBBoxMax={value:new g.I9Y(a.x,a.y)},Y.material.uniforms.uExtrudeCenter={value:o},Y.material.uniforms.uExtrudeDepth={value:S},X.material.uniforms.uDelta={value:0},X.material.uniforms.uTime={value:0},X.material.uniforms.uSdf2D={value:t},X.material.uniforms.uBBoxMin={value:new g.I9Y(r.x,r.y)},X.material.uniforms.uBBoxMax={value:new g.I9Y(a.x,a.y)},X.material.uniforms.uExtrudeCenter={value:o},X.material.uniforms.uExtrudeDepth={value:S},X.material.uniforms.uInteriorSpeed={value:E},X.material.uniforms.uSurfaceSpeed={value:U},X.material.uniforms.uNoiseInfluence={value:O},X.material.uniforms.uSurfaceNoise={value:F},X.material.uniforms.uSdfResolution={value:new g.I9Y(B,j)},X.material.uniforms.uSdfPad={value:2},q.material.uniforms.uDelta={value:0},q.material.uniforms.uTime={value:0},q.material.uniforms.uBasePeriod={value:N},q.material.uniforms.uPeriodVariance={value:L},q.material.uniforms.uTransitionDuration={value:z};let Z=P.init();null!==Z&&(0,ef.Rm)("crimson","â","gpuCompute init error",Z),M.dispose(),A.dispose(),D.dispose(),u.current=P,c.current=Y,f.current=X,d.current=q;let Q={type:g.RQf,format:g.GWd,minFilter:g.hxR,magFilter:g.hxR,depthBuffer:!1,stencilBuffer:!1};m.current=new g.nWS(b,C,Q),p.current=new g.nWS(b,C,Q);let K=new g.Z58,J=new g.qUd(-1,1,1,-1,0,1),ee=new g.BKk({vertexShader:ew,fragmentShader:ed.Pv,uniforms:{tCurvePosition:{value:null},tRingBuffer:{value:null},uWriteIndex:{value:0},uHistoryLength:{value:b},uCurveCount:{value:C},uGpuDim:{value:eR},uResolution:{value:new g.I9Y(b,C)}},depthTest:!1,depthWrite:!1}),et=new g.eaF(new g.bdM(2,2),ee);K.add(et),h.current=K,v.current=J,x.current=ee,y.current=et,w.current=0,R.current=0,T.current=0,l.current=!0,s.current=m.current.texture,i(!0)}(t,n,r));let A=(0,a.useCallback)(e=>{if(!l.current)return;let n=Math.min(e,1/30)/S,r=t.getRenderTarget();for(let e=0;e<S;e++){T.current+=n,c.current.material.uniforms.uDelta.value=n,f.current.material.uniforms.uDelta.value=n,f.current.material.uniforms.uTime.value=T.current,d.current.material.uniforms.uDelta.value=n,d.current.material.uniforms.uTime.value=T.current,u.current.compute();let e=u.current.getCurrentRenderTarget(c.current).texture,r=R.current%2==0,a=r?m.current:p.current,o=r?p.current:m.current;x.current.uniforms.tCurvePosition.value=e,x.current.uniforms.tRingBuffer.value=o.texture,x.current.uniforms.uWriteIndex.value=w.current,t.setRenderTarget(a),t.render(h.current,v.current),w.current=(w.current+1)%b,R.current+=1,s.current=a.texture}t.setRenderTarget(r)},[t]),D=(0,a.useCallback)(()=>{l.current&&(u.current?.dispose(),u.current=null,m.current?.dispose(),m.current=null,p.current?.dispose(),p.current=null,y.current&&(y.current.geometry.dispose(),y.current.material.dispose(),y.current=null),l.current=!1,i(!1),s.current=null)},[]);return{isReady:o,ringBufferTexture:s,writeIndex:w,compute:A,dispose:D}}({gl:p,sdfTexture:v,glyphData:h}),A=(0,a.useRef)(null),D=(0,a.useRef)(null),_=(0,a.useRef)(0),W=(0,a.useRef)(0),H=(0,a.useRef)(0),Y=(0,a.useRef)(0),X=(0,a.useRef)(0),q=(0,a.useRef)(0),Z=(0,a.useRef)(0),Q=(0,a.useRef)(!1),K=(0,a.useRef)(0),[J,ee]=(0,s.zh)(()=>({from:{alpha:0},onChange:e=>{K.current=e.value.alpha}}),[]);(0,a.useEffect)(()=>{let e=e=>{W.current=(e.clientX/window.innerWidth-.5)*k*2,X.current=(e.clientX/window.innerWidth-.5)*2};return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}},[]),(0,a.useEffect)(()=>{h&&(Z.current=h.bboxMax.x-h.bboxMin.x)}
13,[h]),(0,a.useEffect)(()=>{w&&d(!0)},[w,d]),(0,a.useEffect)(()=>()=>{M()},[M]);let et=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,ef.Rm)("mediumvioletred","â¶ï¸","present"),Q.current=!0,ee.stop(!0),ee.start({to:{alpha:1},config:{duration:12e3,easing:s.le.easeOutSine},delay:e})},en=()=>{(0,ef.Rm)("mediumvioletred","â¶ï¸","dismiss"),ee.stop(!0),ee.start({to:{alpha:0},config:{duration:300,easing:s.le.easeOutSine},onRest:()=>{Q.current=!1}})};return(0,c._B)("mediumvioletred"),(0,c.Ql)((e,t)=>{let n=(0,y.xx)(G,t);H.current+=(_.current-H.current)*n,Y.current+=(W.current-Y.current)*n;let r=(0,y.xx)(.1*G,t);q.current+=(X.current-q.current)*r;let a=A.current?.camera;if(a){let e=V,t=2*Math.tan(a.fov*(Math.PI/180)/2)*e*a.aspect,n=Math.max(0,(1.1*Z.current-t)/2+e*Math.tan(Math.abs(k)));a.position.set(q.current*n,0,e),a.rotation.set(H.current,-Y.current,0,"YXZ"),a.updateProjectionMatrix()}Q.current&&P(t);let o=D.current;o&&(o.uniforms.uRingBuffer.value=R.current,o.uniforms.uWriteIndex.value=T.current,o.uniforms.uOpacity.value=K.current)}),(0,a.useImperativeHandle)(t,()=>({present:et,dismiss:en,onRouteDismissStart:()=>{},onRouteDismissUpdate:()=>{},onRouteDismissEnd:()=>{}})),(0,r.jsxs)(x,{ref:A,layers:n,name:f.eU.ERROR,children:[w&&R.current&&(0,r.jsx)(ep,{ringBufferTexture:R.current,writeIndex:T,opacity:K,materialRef:D,layers:n}),h&&("A"===$||"BOTH"===$)&&(0,r.jsx)(eh,{glyphData:h,opacity:K,layers:n}),h&&("B"===$||"BOTH"===$)&&(0,r.jsx)(eg,{glyphData:h,opacity:K,layers:n})]})}),eT=(0,a.forwardRef)((e,t)=>{let{fade:n}=(0,a.useContext)(u.nE),{setIsNavigationVisible:i,setFooterVisible:s}=(0,a.useContext)(u._3),{shouldPresentContent:l,isAllRendererReady:f,setError:d}=(0,a.useContext)(u.Ir),m=(0,a.useRef)(null),p=(0,a.useRef)(null),h=(0,a.useRef)(null),[g]=(0,o.ok)();(0,a.useEffect)(()=>{d(parseInt(g.get("code")??"404",10),g.get("message")??"NOT FOUND")},[g]);let v=e=>{},x=e=>{m.current.dismiss(),p.current.dismiss(),h.current.dismiss(),i(!1)};return(0,c._B)("green"),(0,a.useEffect)(()=>{f&&((0,ef.Rm)("green","â¶ï¸","onRenderersReady"),n(el.uc.BGM_ERROR_DRONE,es.z.bgm.error.drone,0,3e3,!0),p.current.present(400),h.current.present(400),m.current.present(),i(!1),s(!0))},[f]),(0,a.useImperativeHandle)(t,()=>({onRoutePresentStart:v,onRouteDismissStart:x})),l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eS,{ref:m,layers:void 0}),(0,r.jsx)(w,{ref:p,layers:void 0}),(0,r.jsx)(ec,{ref:h,layers:void 0})]})})},340:(e,t,n)=>{n.r(t),n.d(t,{default:()=>el});var r,a,o=n(7973),i=n(6065),s=n(3267),l=n(9618),u=n(367),c=n(4695),f=n(2310),d=n(2466),m=n(6987),p=n(1902);n(8498);let h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,!?:;'\"()[]{}@#$%&*+-/\\|<>=~^â¬\xa3\xa5\xa2\xb1\xd7\xf7â â¤â¥ââ\xbd\xbc\xbe\xa9\xaeâ¢\xa7\xb6â¢\xb7ââââ ",g=e=>h.indexOf(e),v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{min:.004,max:.008},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{min:-Math.PI,max:Math.PI},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{min:0,max:1};return(0,p.sT)(e,t,n,r,a)},x=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{min:0,max:.5},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{min:0,max:.5},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{min:.1,max:.4},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.1;return(0,p.ff)(e,t,n,r,a,o)},y=(0,i.forwardRef)((e,t)=>{let{numTotalInstances:n,domeCenter:r,numTextureColumns:a=10,numTextureRows:s=12,fillColor:u=new l.Q1f(m.i.portrait.symbolColor),side:c=l.hB5,transparent:d=!0,depthWrite:p=!0,stencil:h={}}=e,{textures:g}=(0,i.useContext)(f.DM),y=(0,i.useRef)(null),w=(0,i.useRef)(null);return null===w.current&&(w.current={delta:new l.nc$(0),time:new l.nc$(0),numTotalInstances:new l.nc$(n),numTextureRows:new l.nc$(0),domeCenter:new l.nc$(r),tGPUData:new l.nc$(null),tDiffuse:new l.nc$(g.Backgroun
13dEffect||null),diffuseResolution:new l.nc$(new l.I9Y(0,0)),diffuseTextureColumns:new l.nc$(a),diffuseTextureRows:new l.nc$(s),tDisplace:new l.nc$(v(6,6,{min:.004,max:.008},{min:-Math.PI,max:Math.PI},{min:0,max:1})),displaceResolution:new l.nc$(new l.I9Y(6,6)),tMosaic:new l.nc$(x(8,8,{min:0,max:.5},{min:0,max:.5},{min:.1,max:.3},.1)),mosaicResolution:new l.nc$(new l.I9Y(8,8)),opacity:new l.nc$(0),fillColor:new l.nc$(new l.Pq0(u.r,u.g,u.b)),fillColorMultiplier:new l.nc$(1.5),rgbShift:new l.nc$(new l.Pq0(-.003,0,.003))}),(0,i.useEffect)(()=>{if(!g.BackgroundEffect)return;y.current.uniforms.tDiffuse.value=g.BackgroundEffect;let e=g.BackgroundEffect.image;y.current.uniforms.diffuseResolution.value=new l.I9Y(e.width,e.height)},[g.BackgroundEffect]),(0,i.useEffect)(()=>{w.current.numTotalInstances.value=n},[n]),(0,i.useEffect)(()=>{w.current.domeCenter.value=r},[r]),(0,i.useEffect)(()=>{w.current.diffuseTextureColumns.value=a},[a]),(0,i.useEffect)(()=>{w.current.diffuseTextureRows.value=s},[s]),(0,i.useEffect)(()=>{w.current.fillColor.value.set(u.r,u.g,u.b)},[u]),(0,i.useImperativeHandle)(t,()=>({material:y.current})),(0,o.jsx)("shaderMaterial",{ref:y,vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\nuniform float delta;\nuniform float time;\nuniform float numTotalInstances;\nuniform float numTextureRows;\nuniform vec3 domeCenter;\n\nattribute vec3 offset;\nattribute float speed;\nattribute float instanceIndex;\nattribute float characterIndex;\n\nvarying float vInstanceIndex;\nvarying float vCharacterIndex;\n\n/**\n * The UV coordinates of the instance\n */\nvarying vec2 vUv;\n/**\n * The UV coordinates of the mode on the GPU texture\n */\nvarying vec2 vModeUV;\n/**\n * The UV coordinates of the shuffle effect on the GPU texture\n */\nvarying vec2 vShuffleEffectUV;\n/**\n * The UV coordinates of the shuffle animation on the GPU texture\n */\nvarying vec2 vShuffleAnimationUV;\n/**\n * The UV coordinates of the displace effect on the GPU texture\n */\nvarying vec2 vDisplaceEffectUV;\n/**\n * The UV coordinates of the displace animation on the GPU texture\n */\nvarying vec2 vDisplaceAnimationUV;\n/**\n * The UV coordinates of the noise effect on the GPU texture\n */\nvarying vec2 vNoiseEffectUV;\n/**\n * The UV coordinates of the noise animation on the GPU texture\n */\nvarying vec2 vNoiseAnimationUV;\n/**\n * The UV coordinates of the mosaic effect on the GPU texture\n */\nvarying vec2 vMosaicEffectUV;\n/**\n * The UV coordinates of the mosaic animation on the GPU texture\n */\nvarying vec2 vMosaicAnimationUV;\n/**\n * The UV coordinates of the animation status on the GPU texture\n */\nvarying vec2 vAnimationStatusUV;\n\n/**\n * The clip position of the vertex\n */\nvarying vec4 vClipPosition;\nconst vec3 up = vec3(0.0, 1.0, 0.0);\n\nvoid main() {\n /**\n * Calculate the world position of the instance.\n */\n float angle = time * speed;\n vec4 instanceWorldPosition = vec4(offset, 1.0);\n // vec4 instanceWorldPosition = instanceMatrix * vec4(offset, 1.0);\n // vec4 instanceWorldPosition = instanceMatrix * vec4(position, 1.0);\n // vec4 instanceRotatedWorldPosition = vec4(rotateAroundY(instanceWorldPosition.xyz, domeCenter, angle), 1.0);\n vec4 instanceRotatedWorldPosition = vec4(rotate(instanceWorldPosition.xyz, 0.0, angle), 1.0);\n\n /**\n * * The look at matrix.\n * *\n * * Reason for inverting lookAtMatrix:\n * *\n * * The `lookAt` function generates the camera's view matrix based on the camera's position,\n * * the target position, and the up vector. This matrix creates the coordinate system for the\n * * scene as viewed from the camera.\n * *\n * * When calculating the position of objects within the shader, it is typically necessary to\n * * transform from world space to view space. Therefore, inverting the matrix obtained from\n * * `lookAt` allows for the correct transformation of the object's position, ensuring that it\n * * is rendered correctly based on the camera's perspective.\n */\n mat4 lookAtMatrix = inverse(lookAt(domeCenter, instanceRotatedWorldPosition.xyz, up));\n\n /**\n * Calculate the world position of the vertex.\n */\n vec4 vertexLocalPosition = vec4(position, 1.0
13);\n vec4 vertexWorldPosition = lookAtMatrix * vertexLocalPosition;\n // vec4 vertexWorldPosition = instanceMatrix * lookAtMatrix * vertexLocalPosition;\n\n /**\n * Combine the instance and vertex positions.\n */\n vec4 worldPosition = instanceRotatedWorldPosition + vertexWorldPosition;\n\n /**\n * The final position of the vertex.\n */\n vec4 viewPosition = viewMatrix * worldPosition;\n gl_Position = projectionMatrix * viewPosition;\n\n /**\n * * Varying variables.\n */\n vInstanceIndex = instanceIndex;\n vCharacterIndex = characterIndex;\n\n vUv = uv;\n\n vModeUV = vec2(instanceIndex / numTotalInstances, 0.5 / numTextureRows);\n vShuffleEffectUV = vec2(instanceIndex / numTotalInstances, 2.5 / numTextureRows);\n vShuffleAnimationUV = vec2(instanceIndex / numTotalInstances, 3.5 / numTextureRows);\n vDisplaceEffectUV = vec2(instanceIndex / numTotalInstances, 4.5 / numTextureRows);\n vDisplaceAnimationUV = vec2(instanceIndex / numTotalInstances, 5.5 / numTextureRows);\n vNoiseEffectUV = vec2(instanceIndex / numTotalInstances, 6.5 / numTextureRows);\n vNoiseAnimationUV = vec2(instanceIndex / numTotalInstances, 7.5 / numTextureRows);\n vMosaicEffectUV = vec2(instanceIndex / numTotalInstances, 8.5 / numTextureRows);\n vMosaicAnimationUV = vec2(instanceIndex / numTotalInstances, 9.5 / numTextureRows);\n vAnimationStatusUV = vec2(instanceIndex / numTotalInstances, 10.5 / numTextureRows);\n\n vClipPosition = gl_Position;\n}\n",fragmentShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n#include <ftmr_snoise>\n#include <ftmr_math>\n\n/**\n * The diffuse textures that contains the text symbols\n */\nuniform sampler2D tDiffuse;\nuniform sampler2D tGPUData;\nuniform sampler2D tDisplace;\nuniform sampler2D tMosaic;\n\n/**\n * The total number of instances\n */\nuniform float numTotalInstances;\n\n/**\n * The number of columns of the diffuse texture\n */\nuniform float diffuseTextureColumns;\n/**\n * The number of rows of the diffuse texture\n */\nuniform float diffuseTextureRows;\n\n/**\n * The resolution of the displacement texture\n */\nuniform vec2 displaceResolution;\n/**\n * The resolution of the mosaic texture\n */\nuniform vec2 mosaicResolution;\n\n/**\n * The opacity of the symbol\n */\nuniform float opacity;\n/**\n * The RGB shift value of the symbol\n */\nuniform vec3 rgbShift;\n/**\n * The fill color of the symbol\n */\nuniform vec4 fillColor;\n\n/**\n * The index of the instance on the GPU texture\n */\nvarying float vInstanceIndex;\n/**\n * The index of the character on the diffuse texture\n */\nvarying float vCharacterIndex;\n\n/**\n * The UV coordinates of the symbol\n */\nvarying vec2 vUv;\n/**\n * The UV coordinates of the mode on the GPU texture\n */\nvarying vec2 vModeUV;\n/**\n * The UV coordinates of the shuffle effect on the GPU texture\n */\nvarying vec2 vShuffleEffectUV;\n/**\n * The UV coordinates of the shuffle animation on the GPU texture\n */\nvarying vec2 vShuffleAnimationUV;\n/**\n * The UV coordinates of the displace effect on the GPU texture\n */\nvarying vec2 vDisplaceEffectUV;\n/**\n * The UV coordinates of the displace animation on the GPU texture\n */\nvarying vec2 vDisplaceAnimationUV;\n/**\n * The UV coordinates of the noise effect on the GPU texture\n */\nvarying vec2 vNoiseEffectUV;\n/**\n * The UV coordinates of the noise animation on the GPU texture\n */\nvarying vec2 vNoiseAnimationUV;\n/**\n * The UV coordinates of the mosaic effect on the GPU texture\n */\nvarying vec2 vMosaicEffectUV;\n/**\n * The UV coordinates of the mosaic animation on the GPU texture\n */\nvarying vec2 vMosaicAnimationUV;\n/**\n * The UV coordinates of the animation status on the GPU texture\n */\nvarying vec2 vAnimationStatusUV;\n\n/**\n * The clip position of the vertex\n */\nvarying vec4 vClipPosition;\n/**\n * The mode of the instance\n */\nconst int NONE = 0;\nconst int PRESENT = 1;\nconst int PRESENT_LOOP = 2;\nconst int DISMISS = 3;\nconst int DISMISS_END = 4;\n\n/**\n * ************************************\n * Utility functions\n * *************************************\n */\n\n/**\n * Function to get the UV coordinates\n *\n * This function calculates the UV coordinates based on the texture index.\n * When calculating the row index, the direction of the Y-axis is different, so the row index needs to be reversed.\n *\n * @param uv - Input UV coordinates\n * @param texIndex - Texture index\n * @param numGridX - Number of grids in the X direction\n * @param numGridY - Number of grids in the Y direction\n * @return - Calculated UV coordinates\n */\nvec2 getUV(vec2 uv, float texIndex, float numGridX, float numGridY) {\n /**\n * Calculate the unit size of the grid\n */\n float unitX = 1.0 / numGridX;\n float unitY = 1.0 / numGridY;\n\n /**\n * Calculate the column index\n */\n float col = mod(texIndex, numGridX);\n\n /**\n * Calculate the row index\n */\n float row = floor(texIndex / numGridX);\n\n /**\n * Reverse the row index to make the top of the texture correspond to the 0 of the UV coordinates and the bottom to 1\n */\n row = numGridY - 1.0 - row;\n\n /**\n * Calculate the texture UV coordinates\n */\n vec2 texUV = vec2(col * unitX, row * unitY);\n vec2 offsetUV = vec2(uv.x, uv.y) * vec2(unitX, unitY);\n\n return offsetUV + texUV;\n}\n\n/**\n * ************************************\n * Effect functions\n * *************************************\n */\n\n/**\n * Description : Get the RGB shift color\n */\nvec4 getRGBShiftColor(vec2 uv, float amountR, float amountG, float amountB) {\n vec2 uvR = uv + vec2(amountR, 0.0);\n vec2 uvG = uv + vec2(amountG, 0.0);\n vec2 uvB = uv + vec2(amountB, 0.0);\n\n vec4 r = texture2D(tDiffuse, uvR) * vec4(1.0, 0.0, 0.0, 1.0);\n vec4 g = texture2D(tDiffuse, uvG) * vec4(0.0, 1.0, 0.0, 1.0);\n vec4 b = texture2D(tDiffuse, uvB) * vec4(0.0, 0.0, 1.0, 1.0);\n vec4 color = r + g + b;\n\n return color;\n}\n\n/**\n * Description : Get the mixed RGB shift color\n */\nvec4 getMixedRGBShiftColor(vec2 uv, float amountR, float amountG, float amountB, vec4 mixColor) {\n vec2 uvR = uv + vec2(amountR, 0.0);\n vec2 uvG = uv + vec2(amountG, 0.0);\n vec2 uvB = uv + vec2(amountB, 0.0);\n\n vec4 r = mix(texture2D(tDiffuse, uvR), mixColor, 0.5) * vec4(1.0, 0.0, 0.0, 1.0);\n vec4 g = mix(texture2D(tDiffuse, uvG), mixColor, 0.5) * vec4(0.0, 1.0, 0.0, 1.0);\n vec4 b = mix(texture2D(tDiffuse, uvB), mixColor, 0.5) * vec4(0.0, 0.0, 1.0, 1.0);\n vec4 color = r + g + b;\n\n return color;\n}\n\n/**\n * Description : Glitch Effect\n */\nvec2 getGlitchUV(vec2 diffuseUV, float displaceProgress, float displaceRotation, float noiseProgress, float noiseReduction) {\n /**\n * Get the diffuse color\n */\n vec4 diffuseColor = texture2D(tDiffuse, diffuseUV);\n\n /**\n * Get the displacement color\n */\n vec4 displaceColor = texture2D(tDisplace, vUv);\n\n /**\n * Retrieve the values from the displacement map texture\n */\n float amplitude = displaceColor.x;
13\n float startRotation = displaceColor.y;\n float seed = displaceColor.z;\n\n /**\n * * Displacement effect\n */\n /**\n * Calculate the current strength\n */\n float displaceStrength = 1.0 - displaceProgress;\n /**\n * Calculate the current amplitude\n */\n float displaceLength = amplitude * displaceStrength;\n /**\n * Calculate the current rotation angle\n */\n float displaceAngle = startRotation + displaceRotation;\n /**\n * Calculate the displacement offset of the glitch effect\n */\n vec2 displaceOffset = vec2(displaceLength * cos(displaceAngle), displaceLength * sin(displaceAngle));\n\n /**\n * * Simplex noise effect\n */\n /**\n * Calculate the current strength\n */\n float noiseStrength = 1.0 - noiseProgress;\n /**\n * Calculate the noise of the glitch effect\n */\n vec2 noise = vec2(\n snoise3(vec3(0.0, vUv.x * 8.0, seed)) * noiseStrength * noiseReduction,\n snoise3(vec3(0.0, vUv.y * 8.0, seed)) * noiseStrength * noiseReduction\n );\n\n return diffuseUV + quantize(noise, 0.01) + quantize(displaceOffset, 0.01);\n}\n\n/**\n * Description : Get the mosaic alpha\n */\nfloat getMosaicAlpha(float mosaicProgress) {\n /**\n * Get the mosaic color\n */\n vec4 mosaicColor = texture2D(tMosaic, vUv);\n\n /**\n * Retrieve the values from the displacement map texture\n */\n float initial = mosaicColor.x;\n float delay = mosaicColor.y;\n float speed = mosaicColor.z;\n float quantum = mosaicColor.w;\n\n /**\n * Calculate the progress of the effect excluding the delay. The value is in the range of 0.0 to 1.0.\n */\n float strength = max(mosaicProgress - delay, 0.0) / (1.0 - delay);\n\n float alpha = linearstep(initial, 1.0, strength);\n return clamp(quantize(alpha, quantum), 0.0, 1.0);\n}\n\n/**\n * ************************************\n * Main\n * *************************************\n */\n\nvoid main() {\n vec3 ndc = vClipPosition.xyz / vClipPosition.w;\n\n if (abs(ndc.x) > 1.0 || abs(ndc.y) > 1.0 || abs(ndc.z) > 1.0) {\n discard;\n }\n\n /**\n * * Get the variables from GPU shaders\n */\n /**\n * Mode\n */\n vec4 modeColor = texture2D(tGPUData, vModeUV);\n /**\n * Shuffle effect\n */\n vec4 shuffleEffectColor = texture2D(tGPUData, vShuffleEffectUV);\n float shuffleSymbolIndex = shuffleEffectColor.y;\n /**\n * Displace effect\n */\n vec4 displaceEffectColor = texture2D(tGPUData, vDisplaceEffectUV);\n float displaceStrength = displaceEffectColor.x;\n float displaceRotation = displaceEffectColor.y;\n vec4 displaceAnimationColor = texture2D(tGPUData, vDisplaceAnimationUV);\n float displaceProgress = displaceAnimationColor.x;\n /**\n * Noise effect\n */\n vec4 noiseEffectColor = texture2D(tGPUData, vNoiseEffectUV);\n float noiseStrength = noiseEffectColor.x;\n float noiseReduction = noiseEffectColor.y;\n vec4 noiseAnimationColor = texture2D(tGPUData, vNoiseAnimationUV);\n float noiseProgress = noiseAnimationColor.x;\n /**\n * Mosaic effect\n */\n vec4 mosaicEffectColor = texture2D(tGPUData, vMosaicEffectUV);\n float mosaicStrength = mosaicEffectColor.x;\n vec4 mosaicAnimationColor = texture2D(tGPUData, vMosaicAnimationUV);\n float mosaicProgress = mosaicAnimationColor.x;\n /**\n * Animation status\n */\n vec4 animationStatusColor = texture2D(tGPUData, vAnimationStatusUV);\n\n /**\n * Get the diffuse texture UV coordinates\n */\n vec2 diffuseUV = getUV(vUv, shuffleSymbolIndex, diffuseTextureColumns, diffuseTextureRows);\n\n /**\n * * Glitch effect\n */\n vec2 glitchUV = getGlitchUV(diffuseUV, displaceStrength, displaceRotation, noiseStrength, noiseReduction);\n\n /**\n * * RGB shift effect\n */\n vec4 rgbShiftColor = getRGBShiftColor(glitchUV, rgbShift.r, rgbShift.g, rgbShift.b) * vec4(fillColor.rgb, 1.0);\n\n /**\n * * Mosaic effect\n */\n float mosaicAlpha = getMosaicAlpha(mosaicStrength);\n\n /**\n * * Apply the maximum alpha.\n */\n gl_FragColor = vec4(rgbShiftColor.rgb, rgbShiftColor.a * mosaicAlpha * opacity);\n}\n",uniforms:w.current,side:c,transparent:d,depthWrite:p,...h})});var w=n(6382),R=n(1916),C=n(637),b=n(8528),S=((r=S||{})[r.NONE=0]="NONE",r[r.PRESENT=1]="PRESENT",r[r.PRESENT_LOOP=2]="PRESENT_LOOP",r[r.DISMISS=3]="DISMISS",r[r.DISMISS_END=4]="DISMISS_END",r);let T=(0,i.forwardRef)((e,t)=>{let{layers:n}=e,{routeState:r}=(0,i.useContext)(f.Pl),{portraitDataset:a,portraitDatasetHolder:m,portraitBokehScene:p,setIsBackgroun
13dRendererReady:v,isTransitioningToNextDataset:x}=(0,i.useContext)(f.lq),[T,P]=(0,i.useState)(null),[M,A]=(0,i.useState)([]),D=(0,i.useRef)(null),_=(0,i.useRef)(null),I=(0,i.useRef)(null),E=(0,i.useRef)(null),U=(0,s.C)(e=>e.gl),O=(0,s.C)(e=>e.clock),F=new l.Pq0(0,-2600,0),N=16e3*w.Gf/96,L=(0,u.k)(1,!0),{isRendererReady:z,gpuDataUniforms:V,setupGPUComputationRenderer:k,render:G,dispose:B}=(e=>{let{gl:t,clock:n,instanceAttributes:r,instanceMeshRef:a,instanceMatRef:o,instanceGeomRef:s,setIsBackgroundRendererReady:u}=e,c=(0,i.useRef)(o).current,f=(0,i.useRef)(s).current,d=(0,i.useRef)(a).current,m=(0,i.useRef)(!1),p=(0,i.useRef)(null),g=(0,i.useRef)({width:0,height:0}),v=(0,i.useRef)(null),x=(0,i.useRef)({}),y=(0,i.useRef)(0),w=1/60,S=(0,i.useRef)(1e7),T=async function(e,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;if(m.current){if(S.current<r){S.current+=n;return}await new Promise(n=>{let r=new Float32Array(g.current.width*g.current.height*4),a=p.current.getCurrentRenderTarget(e);t.readRenderTargetPixels(a,0,0,g.current.width,g.current.height,r);let o=0;console.log("\n\n\n"),console.log("mode","currentMode:",r.slice(o+0,o+1)[0]?.toFixed(2),"previousMode:",r.slice(o+1,o+2)[0]?.toFixed(2),"modeChanged:",r.slice(o+2,o+3)[0]?.toFixed(2)),o=12112,console.log("shuffleEffect","defaultIndex:",r.slice(o+0,o+1)[0]?.toFixed(2),"currentIndex:",r.slice(o+1,o+2)[0]?.toFixed(2),"currentTime:",r.slice(o+2,o+3)[0]?.toFixed(2),"shuffleEnabled:",r.slice(o+3,o+4)[0]?.toFixed(2)),o=18168,console.log("shuffleAnimation","progress:",r.slice(o+0,o+1)[0]?.toFixed(2),"current:",r.slice(o+1,o+2)[0]?.toFixed(2),"wait:",r.slice(o+2,o+3)[0]?.toFixed(2),"duration:",r.slice(o+3,o+4)[0]?.toFixed(2)),o=24224,console.log("displaceEffect","strength:",r.slice(o+0,o+1)[0]?.toFixed(2),"startRotation:",r.slice(o+1,o+2)[0]?.toFixed(2)),o=30280,console.log("displaceAnimation","progress:",r.slice(o+0,o+1)[0]?.toFixed(2),"current:",r.slice(o+1,o+2)[0]?.toFixed(2),"wait:",r.slice(o+2,o+3)[0]?.toFixed(2),"duration:",r.slice(o+3,o+4)[0]?.toFixed(2)),o=36336,console.log("noiseEffect","waveRepeat:",r.slice(o+0,o+1)[0]?.toFixed(2),"waveTarget:",r.slice(o+1,o+2)[0]?.toFixed(2),"waveReduction:",r.slice(o+2,o+3)[0]?.toFixed(2)),o=42392,console.log("noiseAnimation","progress:",r.slice(o+0,o+1)[0]?.toFixed(2),"current:",r.slice(o+1,o+2)[0]?.toFixed(2),"wait:",r.slice(o+2,o+3)[0]?.toFixed(2),"duration:",r.slice(o+3,o+4)[0]?.toFixed(2)),o=48448,console.log("mosaicEffect","strength:",r.slice(o+0,o+1)[0]?.toFixed(2),"reduction:",r.slice(o+1,o+2)[0]?.toFixed(2)),o=54504,console.log("mosaicAnimation","progress:",r.slice(o+0,o+1)[0]?.toFixed(2),"current:",r.slice(o+1,o+2)[0]?.toFixed(2),"wait:",r.slice(o+2,o+3)[0]?.toFixed(2),"duration:",r.slice(o+3,o+4)[0]?.toFixed(2)),o=60560,console.log("animationStatus","mosaicProgress:",r.slice(o+0,o+1)[0]?.toFixed(2),"mosaicStrength:",r.slice(o+1,o+2)[0]?.toFixed(2),"none:",r.slice(o+2,o+3)[0]?.toFixed(2),"modeChanged:",r.slice(o+3,o+4)[0]?.toFixed(2)),console.log("\n\n\n"),n()}),S.current=0}};return{isRendererReady:m,gpuRenderer:p,gpuDataUniforms:x,setupGPUComputationRenderer:()=>{if(p.current||0===r.length)return;g.current=(0,b.Q0)(r.length),g.current.height=12,p.current=new R.d(g.current.width,g.current.height,t),(0,C.n)()&&p.current.setDataType(l.ix0);let e=p.current.createTexture(),a=r.length;for(let t=0,n=0;t<a;t++,n+=4){let o=r[t].characterIndex,i=+!!r[t].character.match(/[^ '"-.,]/),s=n+0*a*4;e.image.data.set([0,0,0,0],s),s=n+2*a*4,e.image.data.set([o,o,0,i],s),s=n+3*a*4,e.image.data.set([0,0,l.cj9.randFloat(4,8),l.cj9.randFloat(.8,1.2)
13],s),s=n+4*a*4,e.image.data.set([0,l.cj9.randFloat(-Math.PI,Math.PI),0,0],s),s=n+5*a*4,e.image.data.set([0,0,l.cj9.randFloat(2,4),l.cj9.randFloat(2,3)],s),s=n+6*a*4,e.image.data.set([0,0,0,0],s),s=n+7*a*4,e.image.data.set([0,0,l.cj9.randFloat(2,4),l.cj9.randFloat(1,1)],s),s=n+8*a*4,e.image.data.set([0,.01,0,0],s),s=n+9*a*4,e.image.data.set([0,0,l.cj9.randFloat(0,1),l.cj9.randFloat(1,1)],s),s=n+10*a*4,e.image.data.set([0,0,0,0],s)}e.needsUpdate=!0,v.current=p.current.addVariable("tGPUData","/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n#include <ftmr_math>\n\nuniform float delta;\nuniform float time;\n\nuniform float numTotalInstances;\nuniform float numTextureRows;\n\n/**\n * Root mode\n */\nuniform int selectedMode;\n\n/**\n * Shuffle indices\n */\nuniform float shuffleIndices[36];\nuniform float shuffleLength;\n\n/**\n * Shuffle animation\n */\nuniform float shuffleAnimationLoopDelay;\nuniform float shuffleAnimationLoopDurationMultiplier;\n\n/**\n * Displace effect\n */\nuniform float displaceEffectWaveRepeat;\nuniform float displaceEffectWaveTarget;\nuniform float displaceEffectWaveReduction;\n\n/**\n * Displace animation\n */\nuniform float displaceAnimationLoopDelay;\nuniform float displaceAnimationLoopDurationMultiplier;\n\n/**\n * Noise effect\n */\nuniform float noiseEffectWaveRepeat;\nuniform float noiseEffectWaveTarget;\nuniform float noiseEffectWaveReduction;\n\n/**\n * Noise animation\n */\nuniform float noiseAnimationLoopDelay;\nuniform float noiseAnimationLoopDurationMultiplier;\n\n/**\n * Mosaic effect\n */\nuniform float mosaicEffectWaveRepeat;\nuniform float mosaicEffectWaveTarget;\nuniform float mosaicEffectWaveReduction;\n\n/**\n * Mosaic animation\n */\nuniform float mosaicAnimationLoopDelay;\nuniform float mosaicAnimationLoopDurationMultiplier;\n\n/**\n * Shuffle interval\n */\nfloat shuffleInterval = 0.01;\n\nint NONE = 0;\nint PRESENT = 1;\nint PRESENT_LOOP = 2;\nint DISMISS = 3;\nint DISMISS_END = 4;\n\n/**\n * **********************************************************\n * Effect functions\n * ***********************************************************\n */\n\nvec4 calculateEffectColor(vec2 modeUV, vec2 effectUV, vec2 animationUV, float waveRepeat, float waveTarget, float waveReduction) {\n /**\n * Get the mode color\n */\n vec4 modeColor = texture2D(tGPUData, modeUV);\n int currentMode = int(modeColor.r);\n int previousMode = int(modeColor.g);\n int isModeChanged = int(modeColor.b);\n if (currentMode == 0) {\n return texture2D(tGPUData, effectUV);\n }\n\n /**\n * Get the color of the effect\n */\n vec4 effectColor = texture2D(tGPUData, effectUV);\n float effectStrength = effectColor.x;\n\n /**\n * Get the color of the animation\n */\n vec4 animationColor = texture2D(tGPUData, animationUV);\n float animationProgress = animationColor.x;\n\n if (currentMode == NONE) {\n /**\n * No effect\n */\n return texture2D(tGPUData, effectUV);\n } else if (currentMode == PRESENT) {\n /**\n * Present\n */\n effectStrength = animationProgress;\n } else if (currentMode == PRESENT_LOOP) {\n /**\n * Shuffle\n */\n effectStrength = wave(animationProgress, waveRepeat, waveTarget, waveReduction);\n } else if (currentMode == DISMISS) {\n /**\n * Dismiss\n */\n effectStrength = 1.0 - animationProgress;\n } else if (currentMode == DISMISS_END) {\n /**\n * Dismiss End\n */\n effectStrength = animationProgress;\n }\n\n return vec4(effectStrength, effectColor.yzw);\n}\n\n/**\n * **********************************************************\n * Animation functions\n * ***********************************************************\n */\n\n/**\n * Get the animation color\n *\n * @param {vec2} modeUV - The UV coordinates for the mode texture\n * @param {vec2} animationUV - The UV coordinates for the animation texture\n * @param {float} loopDelay - The loop delay\n * @param {float} loopDurationMultiplier - The loop duration multiplier\n * @returns {vec4} The animation color\n */\nvec4 calculateAnimationColor(vec2 modeUV, vec2 animationUV, float loopDelay, float loopDurationMultiplier) {\n /**\n * Get the mode color\n */\n vec4 modeColor = texture2D(tGPUData, modeUV);\n int currentMode = int(modeColor.r);\n int previousMode = int(modeColor.g);\n int isModeChanged = int(modeColor.b);\n if (currentMode == NONE) {\n return texture2D(tGPUData, animationUV);\n }\n\n /**\n * * Get the color of the texture\n * * \n * * x: Progress\n * * y: Current time\n * * z: Animation wait duration\n * * w: Animation running duration\n */\n vec4 animationColor = texture2D(tGPUData, animationUV);\n\n /**\n * Set the progress of the animation\n */\n float animationProgress = animationColor.x;\n\n /**\n * Set the current time of the animation\n */\n float animationCurrentTime = animationColor.y;\n\n /**\n * Set the wait duration and duration of the animation\n */\n float animationWait;\n float animationDuration;\n if (currentMode == PRESENT) {\n animationWait = animationColor.z;\n animationDuration = 1.0;\n } else if (currentMode == PRESENT_LOOP) {\n /**\n * If the mode is PRESENT_LOOP, add an additional delay and multiply the wait time by 4\n */\n animationWait = loopDelay + animationColor.z * loopDurationMultiplier;\n animationDuration = animationColor.w;\n } else if (currentMode == DISMISS) {\n animationWait = 0.0;\n animationDuration = 0.3;\n // animationDuration = 1.0; /** For debugging */\n } else if (currentMode == DISMISS_END) {\n // animationWait = animationColor.z;\n // animationDuration = animationColor.w;\n animationWait = 0.0;\n animationDuration = 1.0;\n }\n float totalAnimationDuration = animationWait + animationDuration;\n\n /**\n * Reset the animation when the mode is changed\n */\n if (isModeChanged == 1) {\n if (currentMode == PRESENT) {\n animationCurrentTime = 0.0;\n animationProgress = 0.0;\n } else if (currentMode == PRESENT_LOOP) {\n animationCurrentTime = 0.0;\n animationProgress = 0.0;\n } else if (currentMode == DISMISS) {\n // if(animationCurrentTime >= totalAnimationDuration) {\n // animationCurrentTime = 0.0;\n // } else {\n // animationCurrentTime -= animationWait;\n // }\n animationCurrentTime = 0.0;\n animationProgress = 0.0;\n } else if (currentMode == DISMISS_END) {\n animationCurrentTime = 0.0;\n animationProgress = 0.0;\n }\n } else {\n /**\n * Update the progress of the animation\n */\n if (animationCurrentTime >= animationWait) {\n animationProgress = clamp((animationCurrentTime - animationWait) / animationDuration, 0.0, 1.0);\n }\n\n ;\n\n /**\n * Update the current time of the animation\n */\n animationCurrentTime += currentMode != NONE && currentMode != DISMISS_END ? delta : 0.0;\n\n }\n\n /**\n * Test if the animation is finished\n */\n if (animationCurrentTime >= totalAnimationDuration) {\n // animationProgress = 1.0;\n if (currentMode == PRESENT) {\n // animationCurrentTime = totalAnimationDuration;\n }\n else if (currentMode == PRESENT_LOOP) {\n animationCurrentTime = 0.0;\n animationProgress = 0.0;\n } else if (currentMode == DISMISS) {\n // animationCurrentTime = totalAnimationDuration;// animationCurrentTime = 0.0;\n }\n else if (currentMode == DISMISS_END) {\n animationProgress = 0.0;\n animationCurrentTime = 0.0;\n }\n }\n return vec4(animationProgress, animationCurrentTime, animationColor.zw);\n}\n\n/**\n * **********************************************************\n * Mode functions\n * ***********************************************************\n */\n\n/**\n * Calculate the mode\n *\n * @param {vec2} modeUV - The UV coordinates for the mode texture\n * @param {vec2} animationStatusUV - The UV coordinates for the animation status texture\n * @returns {vec4} The mode color\n */\nvec4 calculateMode(vec2 modeUV, vec2 animationStatusUV) {\
13n /**\n * * Get the animation status color\n * *\n * * x: shuffle animation progress\n * * y: displace animation progress\n * * z: noise animation progress\n * * w: mosaic animation progress\n */\n vec4 animationStatusColor = texture2D(tGPUData, animationStatusUV);\n int animationNextMode = int(animationStatusColor.w);\n\n /**\n * * Get the mode color\n * *\n * * x: current mode\n * * y: previous mode\n * * z: is mode changed\n */\n vec4 modeColor = texture2D(tGPUData, modeUV);\n int currentMode = int(modeColor.r);\n int previousMode = int(modeColor.r);\n int isModeChanged = 0;\n\n /**\n * Update the mode\n */\n if (currentMode == NONE) {\n if (selectedMode == PRESENT) {\n currentMode = selectedMode;\n isModeChanged = 1;\n } else if (selectedMode == DISMISS) {\n currentMode = selectedMode;\n isModeChanged = 1;\n }\n } else if (currentMode == PRESENT) {\n if (selectedMode == DISMISS) {\n currentMode = selectedMode;\n isModeChanged = 1;\n } else if (animationNextMode == PRESENT_LOOP) {\n currentMode = animationNextMode;\n isModeChanged = 1;\n }\n } else if (currentMode == PRESENT_LOOP) {\n if (selectedMode == DISMISS) {\n currentMode = selectedMode;\n isModeChanged = 1;\n }\n } else if (currentMode == DISMISS) {\n if (selectedMode == PRESENT) {\n currentMode = selectedMode;\n isModeChanged = 1;\n } else if (animationNextMode == DISMISS_END) {\n currentMode = animationNextMode;\n isModeChanged = 1;\n }\n } else if (currentMode == DISMISS_END) {\n if (selectedMode == PRESENT) {\n currentMode = selectedMode;\n isModeChanged = 1;\n }\n }\n\n /**\n * Set the mode color\n */\n return vec4(float(currentMode), float(previousMode), float(isModeChanged), 777.0);\n}\n\n/**\n * **********************************************************\n * Shuffle effect functions\n * ***********************************************************\n */\n\n/**\n * Calculate the shuffle effect\n *\n * @param {vec2} modeUV - The UV coordinates for the mode texture\n * @param {vec2} shuffleEffectUV - The UV coordinates for the shuffle effect texture\n * @param {vec2} shuffleAnimationUV - The UV coordinates for the shuffle animation texture\n * @returns {vec4} The shuffle effect color\n */\nvec4 calculateShuffleEffect(vec2 modeUV, vec2 effectUV, vec2 animationUV) {\n /**\n * Get the mode color\n */\n vec4 modeColor = texture2D(tGPUData, modeUV);\n int currentMode = int(modeColor.r);\n int previousMode = int(modeColor.g);\n int isModeChanged = int(modeColor.b);\n if (currentMode == 0) {\n return texture2D(tGPUData, effectUV);\n }\n\n /**\n * Get the color of the effect\n */\n vec4 shuffleColor = texture2D(tGPUData, effectUV);\n float defaultIndex = shuffleColor.x;\n float currentIndex = shuffleColor.y;\n float currentTime = shuffleColor.z;\n int isShuffleEnabled = int(shuffleColor.w);\n\n /**\n * Get the color of the animation\n */\n vec4 animationColor = texture2D(tGPUData, animationUV);\n float animationProgress = animationColor.x;\n\n if (isShuffleEnabled == 0) {\n currentIndex = defaultIndex;\n } else if (currentMode == NONE) {\n currentIndex = defaultIndex;\n } else if (currentMode == PRESENT) {\n currentIndex = defaultIndex;\n } else if (currentMode == PRESENT_LOOP) {\n if (animationProgress >= 1.0 || animationProgress <= 0.0) {\n currentIndex = defaultIndex;\n } else {\n currentTime += delta;\n if (currentTime >= shuffleInterval) {\n currentIndex = shuffleIndices[int(round(shuffleLength * random(gl_FragCoord.xy * currentTime)))];\n currentTime = 0.0;\n }\n }\n } else if (currentMode == DISMISS) {\n currentIndex = currentIndex;\n } else if (currentMode == DISMISS_END) {\n currentIndex = defaultIndex;\n }\n\n return vec4(shuffleColor.x, currentIndex, currentTime, shuffleColor.w);\n}\n\n/**\n * **********************************************************\n * Animation status functions\n * ***********************************************************\n */\n\n/**\n * Calculate the animation status\n *\n * @returns {vec4} The animation status color\n */\nvec4 calculateAnimationStatus(vec2 modeUV, vec2 animationStatusUV, vec2 mosaicAnimationUV, vec2 mosaicEffectUV) {\n /**\n * Get the animation color\n */\n vec4 modeColor = texture2D(tGPUData, modeUV);\n int currentMode = int(modeColor.x);\n\n /**\n * Get the animation status color\n */\n vec4 animationStatusColor = texture2D(tGPUData, animationStatusUV);\n int animationNextMode = int(animationStatusColor.y);\n\n /**\n * Get the mosaic animation color\n */\n vec4 mosaicAnimationColor = texture2D(tGPUData, mosaicAnimationUV);\n float mosaicAnimationProgress = mosaicAnimationColor.x;\n\n /**\n * Get the mosaic effect color\n */\n vec4 mosaicEffectColor = texture2D(tGPUData, mosaicEffectUV);\n float mosaicEffectStrength = mosaicEffectColor.x;\n\n if (currentMode == NONE) {} else if (currentMode == PRESENT) {\n if (mosaicAnimationProgress == 1.0) {\n animationNextMode = PRESENT_LOOP;\n }\n } else if (currentMode == PRESENT_LOOP) {\n animationNextMode = NONE;\n } else if (currentMode == DISMISS) {\n if (mosaicAnimationProgress == 1.0) {\n animationNextMode = DISMISS_END;\n }\n } else if (currentMode == DISMISS_END) {\n animationNextMode = NONE;\n }\n\n /**\n * Set the animation status color\n */\n return vec4(mosaicAnimationProgress, mosaicEffectStrength, 0.0, float(animationNextMode));\n}\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n /**\n * Row indices\n */\n float MODE_ROW = 0.5;\n float SHUFFLE_EFFECT_ROW = 2.5;\n float SHUFFLE_ANIMATION_ROW = 3.5;\n float DISPLACE_EFFECT_ROW = 4.5;\n float DISPLACE_ANIMATION_ROW = 5.5;\n float NOISE_EFFECT_ROW = 6.5;\n float NOISE_ANIMATION_ROW = 7.5;\n float MOSAIC_EFFECT_ROW = 8.5;\n float MOSAIC_ANIMATION_ROW = 9.5;
13\n float ANIMATION_STATUS_ROW = 10.5;\n\n /**\n * Row UV offsets\n */\n float modeUVOffset = MODE_ROW / numTextureRows;\n float shuffleEffectUVOffset = SHUFFLE_EFFECT_ROW / numTextureRows;\n float shuffleAnimationUVOffset = SHUFFLE_ANIMATION_ROW / numTextureRows;\n float displaceEffectUVOffset = DISPLACE_EFFECT_ROW / numTextureRows;\n float displaceAnimationUVOffset = DISPLACE_ANIMATION_ROW / numTextureRows;\n float noiseEffectUVOffset = NOISE_EFFECT_ROW / numTextureRows;\n float noiseAnimationUVOffset = NOISE_ANIMATION_ROW / numTextureRows;\n float mosaicEffectUVOffset = MOSAIC_EFFECT_ROW / numTextureRows;\n float mosaicAnimationUVOffset = MOSAIC_ANIMATION_ROW / numTextureRows;\n float animationStatusUVOffset = ANIMATION_STATUS_ROW / numTextureRows;\n\n /**\n * Current UV coordinates on the GPU data texture\n */\n float uvU = gl_FragCoord.x / resolution.x;\n\n /**\n * UV coordinates for each row\n */\n vec2 modeUV = vec2(uvU, modeUVOffset);\n vec2 shuffleEffectUV = vec2(uvU, shuffleEffectUVOffset);\n vec2 shuffleAnimationUV = vec2(uvU, shuffleAnimationUVOffset);\n vec2 displaceEffectUV = vec2(uvU, displaceEffectUVOffset);\n vec2 displaceAnimationUV = vec2(uvU, displaceAnimationUVOffset);\n vec2 noiseEffectUV = vec2(uvU, noiseEffectUVOffset);\n vec2 noiseAnimationUV = vec2(uvU, noiseAnimationUVOffset);\n vec2 mosaicEffectUV = vec2(uvU, mosaicEffectUVOffset);\n vec2 mosaicAnimationUV = vec2(uvU, mosaicAnimationUVOffset);\n vec2 animationStatusUV = vec2(uvU, animationStatusUVOffset);\n\n float fragV = gl_FragCoord.y;\n if (fragV == MODE_ROW) {\n gl_FragColor = calculateMode(modeUV, animationStatusUV);\n } else if (fragV == SHUFFLE_EFFECT_ROW) {\n gl_FragColor = calculateShuffleEffect(modeUV, shuffleEffectUV, shuffleAnimationUV);\n } else if (fragV == SHUFFLE_ANIMATION_ROW) {\n gl_FragColor = calculateAnimationColor(modeUV, shuffleAnimationUV, shuffleAnimationLoopDelay, shuffleAnimationLoopDurationMultiplier);\n } else if (fragV == DISPLACE_EFFECT_ROW) {\n gl_FragColor = calculateEffectColor(\n modeUV,\n displaceEffectUV,\n displaceAnimationUV,\n displaceEffectWaveRepeat,\n displaceEffectWaveTarget,\n displaceEffectWaveReduction\n );\n } else if (fragV == DISPLACE_ANIMATION_ROW) {\n gl_FragColor = calculateAnimationColor(modeUV, displaceAnimationUV, displaceAnimationLoopDelay, displaceAnimationLoopDurationMultiplier);\n } else if (fragV == NOISE_EFFECT_ROW) {\n gl_FragColor = calculateEffectColor(modeUV, noiseEffectUV, noiseAnimationUV, noiseEffectWaveRepeat, noiseEffectWaveTarget, noiseEffectWaveReduction);\n } else if (fragV == NOISE_ANIMATION_ROW) {\n gl_FragColor = calculateAnimationColor(modeUV, noiseAnimationUV, noiseAnimationLoopDelay, noiseAnimationLoopDurationMultiplier);\n } else if (fragV == MOSAIC_EFFECT_ROW) {\n gl_FragColor = calculateEffectColor(modeUV, mosaicEffectUV, mosaicAnimationUV, mosaicEffectWaveRepeat, mosaicEffectWaveTarget, mosaicEffectWaveReduction);\n } else if (fragV == MOSAIC_ANIMATION_ROW) {\n gl_FragColor = calculateAnimationColor(modeUV, mosaicAnimationUV, mosaicAnimationLoopDelay, mosaicAnimationLoopDurationMultiplier);\n } else if (fragV == ANIMATION_STATUS_ROW) {\n gl_FragColor = calculateAnimationStatus(modeUV, animationStatusUV, mosaicAnimationUV, mosaicEffectUV);\n } else {\n gl_FragColor = vec4(fragV, float(selectedMode), 10000, 10000.0);\n }\n}\n",e),v.current.material.needsUpdate=!0,p.current.setVariableDependencies(v.current,[v.current]);let o=n.getDelta();x.current=v.current.material.uniforms,x.current.delta=new l.nc$(o),x.current.time=new l.nc$(0),x.current.numTotalInstances=new l.nc$(r.length),x.current.numTextureRows=new l.nc$(g.current.height),x.current.selectedMode=new l.nc$(0);let i="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("").map(e=>h.indexOf(e));x.current.shuffleIndices=new l.nc$(i),x.current.shuffleLength=new l.nc$(i.length),x.current.shuffleAnimationLoopDelay=new l.nc$(0),x.current.shuffleAnimationLoopDurationMultiplier=new l.nc$(1),x.current.displaceEffectWaveRepeat=new l.nc$(1),x.current.displaceEffectWaveTarget=new l.nc$(0),x.current.displaceEffectWaveReduction=new l.nc$(0),x.current.displaceAnimationLoopDelay=new l.nc$(2),x.current.displaceAnimationLoopDurationMultiplier=new l.nc$(2),x.current.noiseEffectWaveRepeat=new l.nc$(1),x.current.noiseEffectWaveTarget=new l.nc$(.2),x.current.noiseEffectWaveReduction=new l.nc$(.2),x.current.noiseAnimationLoopDelay=new l.nc$(2),x.current.noiseAnimationLoopDurationMultiplier=new l.nc$(2),x.current.mosaicEffectWaveRepeat=new l.nc$(1),x.current.mosaicEffectWaveTarget=new l.nc$(.5),x.current.mosaicEffectWaveReduction=new l.nc$(0),x.current.mosaicAnimationLoopDelay=new l.nc$(4),x.current.mosaicAnimationLoopDurationMultiplier=new l.nc$(4);let s=p.current.init();null!==s&&console.error(s),e.dispose(),c.current.material.uniforms.numTextureRows.value=g.current.height,c.current.material.needsUpdate=!0,f.current.attributes.position.needsUpdate=!0,f.current.attributes.speed.needsUpdate=!0,f.current.attributes.instanceIndex.needsUpdate=!0,f.current.attributes.characterIndex.needsUpdate=!0;for(let e=0;e<r.length;e++){let t=new l.kn4;
13t.setPosition(r[e].offset),d.current.setMatrixAt(e,t)}d.current.instanceMatrix.needsUpdate=!0,m.current=!0,u(!0)},render:(e,t)=>{!m.current||(c.current.material.uniforms.delta.value=t,c.current.material.uniforms.time.value+=t,y.current+=t,y.current<w||(x.current.delta.value=y.current,x.current.time.value+=y.current,y.current=0,p.current.compute(),c.current.material.uniforms.tGPUData.value=p.current.getCurrentRenderTarget(v.current).texture))},dispose:()=>{p.current?.dispose(),p.current=null,m.current=!1,u(!1)},_debugReadRenderTargetPixelsAsynchronously:T}})({gl:U,clock:O,instanceAttributes:M,instanceMeshRef:_,instanceMatRef:I,instanceGeomRef:E,setIsBackgroundRendererReady:v}),j=(0,i.useRef)(V).current,$=(0,i.useRef)(0),W=e=>{$.current=e},[H,Y]=(0,c.zh)(()=>({from:{alpha:0}}),[]),X=()=>{if(!m.current||m.current.isEmpty||!D.current)return;let e=m.current.currentMaskMeshList,t=e.length,n=new Float32Array(3*t*3);for(let r=0;r<t;r++){let t=e[r].vertices,a=t[0],o=t[1],i=t[2];n.set([a.x,a.y,a.z,o.x,o.y,o.z,i.x,i.y,i.z],3*r*3)}D.current.geometry.setAttribute("position",new l.qtW(n,3))},q=()=>{X(),D.current&&(D.current.material.depthWrite=!1)},Z=()=>{Y.stop(!0),Y.start({from:{alpha:H.alpha},to:{alpha:1},delay:r.state===f.bC.NONE?1e3:2e3,config:{duration:200,easing:c.le.easeInCubic},onStart:()=>{j.current.selectedMode.value=S.PRESENT,D.current&&(D.current.material.depthWrite=!0)},onChange:e=>{I.current.material.uniforms.opacity.value=e.value.alpha},onRest:()=>{}})},Q=()=>{j.current.selectedMode.value=S.DISMISS,Y.stop(!0),Y.start({from:{alpha:H.alpha},to:{alpha:0},config:{duration:300,easing:c.le.easeOutCubic},onStart:()=>{},onChange:e=>{I.current.material.uniforms.opacity.value=e.value.alpha},onRest:()=>{}})};return(0,d._B)("yellowgreen"),(0,i.useEffect)(()=>((()=>{let e="KOJIRO FUTAMURA IS A SOFTWARE DESIGNER SPECIALIZING IN DIGITAL TECHNOLOGY AND NETWORK ENVIRONMENT SEEKING TO CREATE BEAUTIFUL THINGS WITH PROGRAM CODES. HE STUDIED ARCHITECTURAL DESIGN AND COMPLETED MASTER'S DEGREE WITH TOP HONOR IN 2004. AFTER THAT HE STARTED HIS CAREER AT INTERACTIVE DESIGN STUDIOS AND JOINED PROJECTS FOR VARIOUS COMPANIES SUCH AS TOYOTA, ADOBE, UNIQLO, SONY, PANASONIC, FUJIFILM, SUBARU, AND RECRUIT. IN RECENT YEARS, HE IS FOCUSING ON DEVELOPING MOBILE PRODUCTS. ",t=0,n=0,r=1,a=[];for(let o=w.ss,i=0;o>=-w.ss;o-=N/16e3,i++){let i=16e3*Math.cos(o),s=Math.round(w.Gf*i/N),u=w.Gf/s;for(let i=0,s=0;i<w.Gf-u/2;i+=u,s++){let s=16e3*Math.cos(o)*Math.cos(i),u=16e3*Math.sin(o),c=16e3*Math.cos(o)*Math.sin(i);if(u>=0){let o=.02*r,i=e[t],f={offset:new l.Pq0(s+F.x,u+F.y,c+F.z),speed:o,instanceIndex:n,character:i,characterIndex:g(i)};a.push(f),n++,++t>=e.length&&(t=0)}}r*=-1}A(a)})(),()=>void B()),[]),(0,i.useEffect)(()=>{(()=>{if(0===M.length)return;let e=new Float32Array(3*M.length),t=new Float32Array(M.length),r=new Float32Array(M.length),a=new Float32Array(M.length);for(let n=0,o=M.length;n<o;n++){let o=M[n];e[3*n+0]=o.offset.x,e[3*n+1]=o.offset.y,e[3*n+2]=o.offset.z,t[n]=o.speed,r[n]=o.instanceIndex,a[n]=o.characterIndex}P((0,o.jsxs)("instancedMesh",{ref:_,layers:n,args:[void 0,void 0,M.length],children:[(0,o.jsxs)("planeGeometry",{ref:E,args:[1024,1024],children:[(0,o.jsx)("instancedBufferAttribute",{attach:"attributes-offset",args:[e,3]}),(0,o.jsx)("instancedBufferAttribute",{attach:"attributes-speed",args:[t,1]}),(0,o.jsx)("instancedBufferAttribute",{attach:"attributes-instanceIndex",args:[r,1]}),(0,o.jsx)("instancedBufferAttribute",{attach:"attributes-characterIndex",args:[a,1]})]}),(0,o.jsx)(y,{ref:I,domeCenter:F,numTotalInstances:M.length,stencil:L})]}))})()},[M]),(0,i.useEffect)(()=>{k()},[T]),(0,i.useEffect)(()=>{X()},[a]),(0,i.useEffect)(()=>{z.current&&(x?Q():Z())},[x]),(0,d.Ql)((e,t)=>{G(e,t)}),(0,i.useImperativeHandle)(t,()=>({present:Z,dismiss:Q,setIsMouseDown:W,nextDataset:q})),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.n,{ref:D,layers:n,position:[0,0,0],id:1,depthWrite:!0,children:(0,o.jsx)("bufferGeometry",{attach:"geometry"})}),T]})});var P=n(4188),M=n(4866),A=n(4357),D=n(9753);let _=(0,i.forwardRef)((e,t)=>{let{children:n,layers:r,name:a}=e,{setPrimaryTexture:u}=(0,i.useContext)(f.Oo),c=(0,s.C)(e=>e.gl),d=(0,s.C)(e=>e.size),p=(0,i.useRef)(c).current,h=(0,i.useRef)(null),g=(0,i.useRef)(null),v=(0,i.useRef)(null),x=(0,i.useRef)(null),y=(0,i.useRef)(new l.Pq0(0,0,-3e3)),R=(0,i.useRef)(new l.Pq0(0,0,-3e3)),C=(0,i.useRef)(0),b=(0,i.useRef)(0),S=(0,i.useRef)(null),T=(0,i.useRef)(null),_=(0,i.useRef)(null),I=(0,i.useRef)(null),E=(e,t,n,r)=>{g.current&&(y.current.lerp(e,(0,w.xx)(.5,r)),C.current+=(n-C.current)*(0,w.xx)(.1,r),b.current+=(t-b.current)*(0,w.xx)(.1,r),g.current.focus=-y.current.z,R.current.copy(y.current))};return(0,i.useEffect)(()=>{let e=c.getPixelRatio(),t=Math.floor(d.width*e),n=Math.floor(d.height*e),r=new l.Pem(t,n);r.minFilter=l.k6q,r.magFilter=l.k6q,x.current=r,u(r);S.current&&(S.current.depthTexture?.dispose(),S.current.dispose());let a=new l.VCu(t,n);a.type=l.V3x,a.format=l.dcC;let o=new l.nWS(t,n,{minFilter:l.k6q,magFilter:l.k6q,type:l.OUM,depthTexture:a});if(S.current=o,I.current?(I.current.uniforms.tColor.value=o.texture,I.current.uniforms.tDepth.value=a,I.current.uniforms.resolution.value.set(t,n)):I.current=ne
13w l.BKk({vertexShader:D.N,fragmentShader:D.n,uniforms:{tColor:new l.nc$(o.texture),tDepth:new l.nc$(a),cameraNear:new l.nc$(.01),cameraFar:new l.nc$(2e4),logDepthFar:new l.nc$(2e4),dofFocusViewPos:new l.nc$(new l.Pq0(0,0,-3e3)),viewTanHalfFov:new l.nc$(new l.I9Y(1,1)),dofAperture:new l.nc$(0),dofMaxBlur:new l.nc$(0),dofCocThreshold:new l.nc$(A.iM),resolution:new l.nc$(new l.I9Y(t,n))},depthTest:!1,depthWrite:!1}),!T.current){T.current=new l.Z58,_.current=new l.qUd(-1,1,1,-1,0,1);let e=new l.eaF(new l.bdM(2,2),I.current);e.frustumCulled=!1,T.current.add(e)}return()=>{u(null),r.dispose(),x.current=null,S.current&&(S.current.depthTexture?.dispose(),S.current.dispose(),S.current=null),I.current&&(I.current.dispose(),I.current=null),T.current&&(T.current.traverse(e=>{e.isMesh&&e.geometry.dispose()}),T.current=null),_.current=null}},[d.width,d.height]),(0,i.useEffect)(()=>{g.current&&(g.current.aspect=d.width/d.height),g.current&&g.current.updateProjectionMatrix()},[d]),(0,s.D)(()=>{if(!h.current||!g.current||!S.current||!I.current)return;let e=h.current.hudScene,t=g.current;I.current.uniforms.dofFocusViewPos.value.copy(R.current);let n=Math.tan(.5*l.cj9.degToRad(t.fov));I.current.uniforms.viewTanHalfFov.value.set(n*t.aspect,n),I.current.uniforms.dofAperture.value=C.current,I.current.uniforms.dofMaxBlur.value=b.current,I.current.uniforms.cameraNear.value=100,I.current.uniforms.cameraFar.value=t.far,I.current.uniforms.logDepthFar.value=t.far;let r=p.autoClear,a=t.near;p.autoClear=!1,t.near=100,t.updateProjectionMatrix(),p.setRenderTarget(S.current),p.clearColor(),p.clearDepth(),p.clearStencil(),p.render(e,t),p.setRenderTarget(null),t.near=a,t.updateProjectionMatrix(),p.clearDepth(),p.render(T.current,_.current),p.autoClear=r,x.current&&p.copyFramebufferToTexture(x.current)},2),(0,i.useImperativeHandle)(t,()=>({children:n,camera:g.current,ambientLight:v.current,renderer:c,setFocus:E,dofFocusViewPos:R,dofAperture:C,dofMaxBlur:b}
13)),(0,o.jsxs)(P.Yi,{ref:h,renderPriority:2,renderEnabled:!1,backgroundColor:m.i.main.bgColor,children:[(0,o.jsx)(M.u,{ref:g,layers:r,name:a,makeDefault:!0,position:A.Lh,fov:A.ym,near:.01,far:2e4}),n]})}),I=(0,i.forwardRef)((e,t)=>{let{children:n,layers:r,name:a}=e,l=(0,s.C)(e=>e.size),u=(0,i.useRef)(null),c=(0,i.useRef)(null);return(0,i.useEffect)(()=>{c.current&&(c.current.aspect=l.width/l.height),c.current&&c.current.updateProjectionMatrix()},[l]),(0,i.useImperativeHandle)(t,()=>({children:n,hud:u.current,camera:c.current})),(0,o.jsxs)(P.Yi,{ref:u,renderPriority:3,children:[(0,o.jsx)(M.u,{ref:c,layers:r,name:a,makeDefault:!0,position:A.Lh,fov:A.ym,near:.01,far:1e4}),n]})}),E=(0,i.forwardRef)((e,t)=>{let{children:n,layers:r,name:a}=e,l=(0,i.useRef)(null),u=(0,i.useRef)(null),c=(0,s.C)(e=>e.gl),f=(0,s.C)(e=>e.size);return(0,i.useEffect)(()=>{u.current&&(u.current.aspect=f.width/f.height),u.current&&u.current.updateProjectionMatrix()},[f]),(0,i.useImperativeHandle)(t,()=>({children:n,camera:u.current,renderer:c})),(0,o.jsxs)(P.Yi,{ref:l,renderPriority:11,children:[(0,o.jsx)(M.u,{ref:u,layers:r,name:a,makeDefault:!0,position:A.Q7,fov:A.pq,far:1e4}),n]})});var U=n(9913);let O=(0,i.forwardRef)((e,t)=>{let{texture:n}=e,r=(0,i.useRef)(null);return(0,i.useImperativeHandle)(t,()=>({material:r.current})),(0,o.jsx)("shaderMaterial",{ref:r,vertexShader:"/* Logarithmic depth buffer support (renderer logarithmicDepthBuffer:true).\n * <common> provides isPerspectiveMatrix used by the logdepthbuf vertex chunk. */\n#include <common>\n#include <logdepthbuf_pars_vertex>\n\nuniform sampler2D tGPUPosition;\nuniform sampler2D tGPUSize;\n\nuniform float time;\nuniform float delta;\nuniform int isMouseDown;\n\nattribute vec2 dataTextureUV;\n\nvarying vec2 vDataTextureUV;\nvarying float vReduce;\n\n/**\n * Main function for particle position calculation.\n */\nvoid main() {\n vDataTextureUV = dataTextureUV;\n /**\n * The position read from DataTexture\n */\n vec3 pos = texture2D(tGPUPosition, dataTextureUV).xyz;\n\n /**\n * Particle position transformed to view space using the model view matrix\n */\n vec4 mvPosition = modelViewMatrix * vec4(pos, 1.0);\n /**\n * Transform particle position to clip space\n */\n gl_Position = projectionMatrix * mvPosition;\n\n /* Write logarithmic depth so the DOF pass reads the real particle depth. */\n #include <logdepthbuf_vertex>\n\n /**\n * The base size of the particle read from DataTexture\n */\n float pointSize = texture2D(tGPUSize, dataTextureUV).x;\n gl_PointSize = pointSize;\n\n /**\n * * vReduce is a value that controls the visual attenuation effect of the particle.\n * * '2000.0 / len' calculates the attenuation effect based on the length of the particle's position vector.\n * * This calculation reduces the particle's influence as the distance from the camera increases.\n * * 'clamp(..., 0., 1.)' restricts the calculated value to a range between 0 and 1, preventing extreme values.\n */\n float len = length(mvPosition.xyz);\n vReduce = clamp(1000.0 / len, 0.0, 1.0);\n}\n",fragmentShader:"uniform sampler2D tPoint;\nuniform sampler2D tGPUColor;\nuniform sampler2D tGPUDummy;\n\nvarying vec2 vDataTextureUV;\nvarying float vReduce;\n\n#include <logdepthbuf_pars_fragment>\n\nvoid main() {\n vec4 fillColor = texture2D(tGPUColor, vDataTextureUV);\n vec4 pointColor = texture2D(tPoint, gl_PointCoord);\n vec4 outgoingColor = fillColor * pointColor * vReduce;\n\n /* AdditiveBlending contribution is rgb x alpha, so fragments whose alpha is\n * (near) zero add no light. Discard them so invisible particles (dummy /\n * faded-out blob states) and the transparent corners of the point sprite\n * quad do not write depth into the DOF depth buffer. Fading particles stay\n * above the threshold until fully faded, so transitions are unaffected. */\n if (outgoingColor.a < 1.0 / 255.0) discard;\n\n gl_FragColor = outgoingColor;\n\n /* Write the real logarithmic depth so the screen-space DOF pass derives a\n * per-fragment circle of confusion from the actual particle distance\n * (physically-based DOF), instead of forcing every fragment to the far\n * plane. Requires depthWrite=true on the material. */\n #include <logdepthbuf_fragment>\n}\n",uniforms:l.LlO.merge([{tPoint:new l.nc$(n),tGPUPosition:new l.nc$(new l.GYF),tGPUSize:new l.nc$(new l.GYF),tGPUColor:new l.nc$(new l.GYF),tGPUDummy:new l.nc$(new l.GYF),time:new l.nc$(0),delta:new l.nc$(0),isMouseDown:new l.nc$(0),pointer:new l.nc$(new l.I9Y)}]),blending:l.EZo,transparent:!1,alphaTest:.5,vertexColors:!1,depthTest:!0,depthFunc:l.lGu,depthWrite:!0})});var F=n(9319),N=n(2237),L=n(5844),z=n(3882);let V=(0,i.forwardRef)((e,t)=>{let{layers:n}=e,{statusMarkerScreenPositions:r,navigationMarkerScreenPosition:a,statusMarkerColors:u,trajectoryTriangleScreenPositions:m,trajectoryCrossScreenPositions:p}=(0,i.useContext)(f._3),{setIsParticleRendererReady:h,portraitDataset:g,portraitDatasetHolder:v,portraitBokehScene:x}=(0,i.useContext)(f.lq),y=(0,i.useRef)(x).current,S=(0,i.useRef)(a).current,T=(0,i.useRef)(r).current,P=(0,i.useRef)(u).current,M=(0,i.useRef)(m).current,D=(0,i.useRef)(p).current,{getFrequency:_}=(0,i.useContext)(f.nE),I=(0,i.useRef)(null),E=(0,i.useRef)(null),V=(0,i.useRef)(null),k=(0,i.useRef)(null),[G,B]=(0,i.useState)(!1),j=(0,i.useRef)(null),$=(0,s.C)(e=>e.gl),W=(0,s.C)(e=>e.size),H=(0,s.C)(e=>e.pointer),Y=(e=>{let{gl:t,clock:n,portraitDataset:r,shaderRef:a,setIsParticleRendererReady:o,getFrequency:s}=e,u=(0,i.useRef)(a).current,c=(0,i.useRef)(!1),f=(0,i.useRef)({width:0,height:0}),d=(0,i.useRef)(0),m=(0,i.useRef)(null),p=(0,i.useRef)(null),h=(0,i.useRef)(null),g=(0,i.useRef)(null),v=(0,i.useRef)(null),x=(0,i.useRef)(null),y=(0,i.useRef)(null),S=(0,i.useRef)(null),T=(0,i.useRef)(null),P=(0,i.useRef)({}),M=(0,i.useRef)({}),A=(0,i.useRef)({}),D=(0,i.useRef)(1),_=(0,i.useRef)(-1/0),I=(0,i.useRef)(1/0),E=(0,i.useRef)(0),U=(0,i.useRef)(0),O=1/60;return{isRendererReady:c,dim:f,gpuRenderer:m,gpuPositionVariable:p,setupGPUComputationRenderer:()=>{if(!r.current||r.current.isEmpty||m.current)return;(0,z.Rm)("crimson","\uD83D\uDEE0ï¸","setupGPUComputationRenderer"),f.current=(0,b.Q0)(r.current.currentPointList.length),m.current=ne
13w R.d(f.current.width,f.current.height,t),(0,C.n)()&&m.current.setDataType(l.ix0);let e=m.current.createTexture(),a=m.current.createTexture(),i=m.current.createTexture(),s=m.current.createTexture(),u=m.current.createTexture(),d=m.current.createTexture(),w=m.current.createTexture(),_=m.current.createTexture(),I=r.current.currentPointList;for(let t=0,n=I.length;t<n;t++){let n=4*t,r=I[t];e.image.data.set([r.portraitPosition.x,r.portraitPosition.y,r.portraitPosition.z,t],n),a.image.data.set([r.portraitPosition.x,r.portraitPosition.y,r.portraitPosition.z,t],n),i.image.data.set([r.blobPosition.x,r.blobPosition.y,r.blobPosition.z,t],n),s.image.data.set([r.portraitColor.r,r.portraitColor.g,r.portraitColor.b,0],n),u.image.data.set([r.portraitColor.r,r.portraitColor.g,r.portraitColor.b,t],n),d.image.data.set([r.blobColor.r,r.blobColor.g,r.blobColor.b,t],n),_.image.data.set([4,0,0,t],n),w.image.data.set([+!!r.isDummy,+!!r.isBlob,0,t],n)}p.current=m.current.addVariable("tGPUPosition","/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * Custom shader chunks\n */\n#include <ftmr_perlin_noise>\n#include <ftmr_matrix>\n\nuniform float delta;\nuniform float time;\nuniform int isMouseDown;\nuniform float phi;\nuniform float theta;\nuniform float frequencyFactor;\n\nfloat fac = 10.0;\nfloat turbulence(vec3 p) {\n float t = -0.5;\n for (float f = 1.0; f <= 1.0; f++) {\n float power = pow(2.0, f);\n t += abs(pnoise(vec3(power * p), vec3(fac, fac, fac)) / power);\n }\n return t;\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n /**\n * Retrieve the index from the tGPUDummy texture at the given UV coordinates\n */\n vec4 posColor = texture2D(tGPUPosition, uv);\n vec3 pos = posColor.xyz;\n vec3 posPortrait = texture2D(tGPUPositionPortrait, uv).xyz;\n vec3 posBlob = texture2D(tGPUPositionBlob, uv).xyz;\n\n /**\n * * If the mouse is down, calculate the new position with rotation\n */\n /**\n * Calculate the target position\n */\n vec3 posTo;\n if (isMouseDown == 1) {\n /**\n * * Blob animation with Perlin noise\n * * DEMO: https://codepen.io/kjrf/pen/zxOdNVa?editors=1010\n */\n /**\n * Rotate the blob position\n */\n posBlob = rotate(posBlob, phi, theta);\n /**\n * Get a turbulent 3d noise using the normal, normal to high freq\n */\n float noise0 = turbulence(normalize(posBlob) * 0.5 + time * 0.5) * 1000.0 * frequencyFactor;\n /**\n * Get a 3d noise using the position, low frequency\n */\n float multiplier = 357.0;\n float noise1 = pnoise(posBlob / multiplier + time, vec3(10.0)) * multiplier * 0.3;\n /**\n * Move the position along the normal and transform it\n */\n posTo = posBlob + normalize(posBlob) * (noise0 + noise1);\n } else {\n posTo = posPortrait;\n }\n /**\n * Calculate the movement towards the target position\n */\n float animationDuration = isMouseDown == 1 ? 0.05 : 0.075;\n /**\n * Calculate the progress of the interpolation using delta\n */\n float lerpFactor = max(min(delta / animationDuration, 1.0), 0.001);\n pos.x += (posTo.x - pos.x) * lerpFactor;\n pos.y += (posTo.y - pos.y) * lerpFactor;\n pos.z += (posTo.z - pos.z) * lerpFactor;\n\n /**\n * Set the fragment color to the new position and the original index\n */\n gl_FragColor = vec4(pos, posColor.w);\n}\n",e),h.current=m.current.addVariable("tGPUPositionPortrait","void main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n gl_FragColor = texture2D(tGPUPositionPortrait, uv);\n}\n",a),g.current=m.current.addVariable("tGPUPositionBlob","void main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n gl_FragColor = texture2D(tGPUPositionBlob, uv);\n}\n",i),v.current=m.current.addVariable("tGPUColor","uniform float delta;\nuniform float time;\nuniform int isMouseDown;\nuniform float maxAlpha;\n\n/*\n * Main function for particle currentColor calculation.\n *\n * @param {vec2} uv - The UV coordinates of the fragment.\n * @param {vec4} currentColor - The currentColor of the particle.\n * @param {int} isMouseDown - A flag indicating if the mouse is currently pressed.\n */\nvoid main() {\n /**\n * Calculate the UV coordinates by normalizing the fragment coordinates with the resolution\n */\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n\n /**\n * Retrieve the currentColor from the tGPUColor texture at the given UV coordinates\n */\n vec4 currentColor = texture2D(tGPUColor, uv);\n vec4 portraitColor = texture2D(tGPUColorPortrait, uv);\n vec4 blobColor = texture2D(tGPUColorBlob, uv);\n\n /**\n * Retrieve the dummy value from the tGPUDummy texture at the given UV coordinates\n */\n int isDummy = int(texture2D(tGPUDummy, uv).x);\n /**\n * Retrieve the blob value from the tGPUDummy texture at the given UV coordinates\n */\n int isBlob = int(texture2D(tGPUDummy, uv).y);\n\n float toAlpha = isMouseDown == 1 ? isBlob == 1 ? 1.0 : 0.0 : isDummy == 1 ? 0.0 : maxAlpha;\n vec3 toRGB = isMouseDown == 1 ? blobColor.rgb : portraitColor.rgb;\n\n /**\n * Animation duration\n */\n float animationDuration = 0.05;\n /**\n * Calculate the progress of the interpolation using delta\n */\n float lerpFactor = max(min(delta / animationDuration, 1.0
13), 0.0001);\n currentColor.rgb += (toRGB - currentColor.rgb) * lerpFactor;\n currentColor.a += (toAlpha - currentColor.a) * lerpFactor;\n\n /**\n * Set the final currentColor of the fragment\n */\n gl_FragColor = currentColor;\n}\n",s),x.current=m.current.addVariable("tGPUColorPortrait","void main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n gl_FragColor = texture2D(tGPUColorPortrait, uv);\n}\n",u),y.current=m.current.addVariable("tGPUColorBlob","void main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n gl_FragColor = texture2D(tGPUColorBlob, uv);\n}\n",d),T.current=m.current.addVariable("tGPUSize","uniform float delta;\nuniform int isMouseDown;\nuniform float scaleFactor;\nuniform float baseParticleSize;\n\n/*\n * Main function for particle size calculation.\n *\n * @param {vec2} uv - The UV coordinates of the fragment.\n * @param {float} size - The size of the particle.\n * @param {int} isMouseDown - A flag indicating if the mouse is currently pressed.\n */\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n int isDummy = int(texture2D(tGPUDummy, uv).x);\n int isBlob = int(texture2D(tGPUDummy, uv).y);\n vec4 sizeColor = texture2D(tGPUSize, uv);\n float currentSize = sizeColor.x;\n\n float targetSize = isMouseDown == 1 && isBlob == 0 ? 0.0 : baseParticleSize * scaleFactor;\n /**\n * Animation duration\n */\n float animationDuration = 0.5;\n /**\n * Calculate the progress of the interpolation using delta\n */\n float lerpFactor = max(min(delta / animationDuration, 1.0), 0.001);\n currentSize += (targetSize - currentSize) * lerpFactor;\n gl_FragColor = vec4(currentSize, 0.0, 0.0, sizeColor.w);\n}\n",_),S.current=m.current.addVariable("tGPUDummy","void main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n gl_FragColor = texture2D(tGPUDummy, uv);\n}\n",w),p.current.material.needsUpdate=!0,h.current.material.needsUpdate=!0,g.current.material.needsUpdate=!0,v.current.material.needsUpdate=!0,x.current.material.needsUpdate=!0,y.current.material.needsUpdate=!0,T.current.material.needsUpdate=!0,S.current.material.needsUpdate=!0,m.current.setVariableDependencies(h.current,[h.current,S.current]),m.current.setVariableDependencies(g.current,[g.current,S.current]),m.current.setVariableDependencies(p.current,[p.current,h.current,g.current,S.current]),m.current.setVariableDependencies(x.current,[x.current,S.current]),m.current.setVariableDependencies(y.current,[y.current,S.current]),m.current.setVariableDependencies(v.current,[v.current,x.current,y.current,S.current]),m.current.setVariableDependencies(T.current,[T.current,S.current]),m.current.setVariableDependencies(S.current,[S.current]),M.current=v.current.material.uniforms,M.current.delta=new l.nc$(n.getDelta()),M.current.time=new l.nc$(0),M.current.isMouseDown=new l.nc$(0),M.current.maxAlpha=new l.nc$(0),P.current=p.current.material.uniforms,P.current.delta=new l.nc$(n.getDelta()),P.current.time=new l.nc$(0),P.current.isMouseDown=new l.nc$(0),P.current.phi=new l.nc$(0),P.current.theta=new l.nc$(0),P.current.frequencyFactor=new l.nc$(0),A.current=T.current.material.uniforms,A.current.delta=new l.nc$(n.getDelta()),A.current.time=new l.nc$(0),A.current.isMouseDown=new l.nc$(0),A.current.baseParticleSize=new l.nc$(4),A.current.scaleFactor=new l.nc$(D.current);let E=m.current.init();null!==E&&(0,z.Rm)("crimson","â","gpuRenderer init error",E),s.dispose(),u.dispose(),d.dispose(),e.dispose(),i.dispose(),a.dispose(),_.dispose(),w.dispose(),c.current=!0,o(!0)},render:(e,t)=>{if(!c.current||(u.current.material.uniforms.delta.value=t,u.current.material.uniforms.time.value+=t,u.current.material.uniforms.isMouseDown.value=E.current,U.current+=t,!E.current&&U.current<O))return;let n=U.current;if(U.current=0,M.current.delta.value=n,M.current.time.value+=n,M.current.isMouseDown.value=E.current,M.current.maxAlpha.value=d.current,P.current.delta.value=n,P.current.time.value+=n,P.current.isMouseDown.value=E.current,P.current.theta.value+=n,P.current.phi.value+=1.3*n,P.current.frequencyFactor.value=1,E.current){let e=s(L.uc.SFX_HOME_TRANSITION_PORTRAIT_LOOP_SUB).slice(0,4).reduce((e,t)=>
13e+t,0)/4;if(e>128&&(_.current=Math.max(e,_.current),I.current=Math.min(e,I.current)),I.current>0&&_.current>I.current){let t=1+(0,N.qE)((e-I.current)/(_.current-I.current),0,1);isNaN(t=Math.pow(3,t))||(P.current.frequencyFactor.value+=(t-P.current.frequencyFactor.value)*(0,w.xx)(.05,n))}}A.current.delta.value=n,A.current.time.value+=n,A.current.isMouseDown.value=E.current,A.current.scaleFactor.value=D.current,A.current.baseParticleSize.value=4,m.current.compute(),u.current.material.uniforms.tGPUPosition.value=m.current.getCurrentRenderTarget(p.current).texture,u.current.material.uniforms.tGPUColor.value=m.current.getCurrentRenderTarget(v.current).texture,u.current.material.uniforms.tGPUSize.value=m.current.getCurrentRenderTarget(T.current).texture,u.current.material.uniforms.tGPUDummy.value=m.current.getCurrentRenderTarget(S.current).texture},nextDataset:()=>{if(!c.current||!r.current)return;(0,z.Rm)("crimson","â¶ï¸","nextDataset");let e=r.current.currentPointList,t=m.current.createTexture(),n=m.current.createTexture(),a=m.current.createTexture(),o=m.current.createTexture(),i=m.current.createTexture();for(let r=0,s=0,l=e.length;r<l;r++,s+=4){let l=e[r];t.image.data.set([l.portraitPosition.x,l.portraitPosition.y,l.portraitPosition.z,r],s),n.image.data.set([l.blobPosition.x,l.blobPosition.y,l.blobPosition.z,r],s),a.image.data.set([l.portraitColor.r,l.portraitColor.g,l.portraitColor.b,r],s),o.image.data.set([l.blobColor.r,l.blobColor.g,l.blobColor.b,r],s),i.image.data.set([+!!l.isDummy,+!!l.isBlob,0,r],s)}h.current.material.uniforms.tGPUPositionPortrait.value?.dispose(),h.current.material.uniforms.tGPUPositionPortrait.value=t,g.current.material.uniforms.tGPUPositionBlob.value?.dispose(),g.current.material.uniforms.tGPUPositionBlob.value=n,x.current.material.uniforms.tGPUColorPortrait.value?.dispose(),x.current.material.uniforms.tGPUColorPortrait.value=a,y.current.material.uniforms.tGPUColorBlob.value?.dispose(),y.current.material.uniforms.tGPUColorBlob.value=o,S.current.material.uniforms.tGPUDummy.value?.dispose(),S.current.material.uniforms.tGPUDummy.value=i,h.current.material.uniforms.tGPUPositionPortrait.value.needsUpdate=!0,g.current.material.uniforms.tGPUPositionBlob.value.needsUpdate=!0,p.current.material.uniforms.tGPUPosition.value&&(p.current.material.uniforms.tGPUPosition.value.needsUpdate=!0),x.current.material.uniforms.tGPUColorPortrait.value.needsUpdate=!0,y.current.material.uniforms.tGPUColorBlob.value.needsUpdate=!0,v.current.material.uniforms.tGPUColor.value&&(v.current.material.uniforms.tGPUColor.value.needsUpdate=!0),S.current.material.uniforms.tGPUDummy.value&&(S.current.material.uniforms.tGPUDummy.value.needsUpdate=!0),h.current.material.needsUpdate=!0,g.current.material.needsUpdate=!0,p.current.material.needsUpdate=!0,x.current.material.needsUpdate=!0,y.current.material.needsUpdate=!0,v.current.material.needsUpdate=!0,S.current.material.needsUpdate=!0,T.current.material.needsUpdate=!0,m.current.doRenderTarget(h.current.material,m.current.getCurrentRenderTarget(h.current)),m.current.doRenderTarget(g.current.material,m.current.getCurrentRenderTarget(g.current)),m.current.doRenderTarget(v.current.material,m.current.getCurrentRenderTarget(v.current)),m.current.doRenderTarget(x.current.material,m.current.getCurrentRenderTarget(x.current)),m.current.doRenderTarget(S.current.material,m.current.getCurrentRenderTarget(S.current)),a.dispose(),o.dispose(),t.dispose(),n.dispose(),i.dispose()},dispose:()=>{m.current?.dispose(),m.current=null,c.current=!1,o(!1)},isMouseDown:E,maxAlpha:d,scaleFactor:D,baseParticleSize:4,maxFrequency:_,minFrequency:I}})({gl:$,clock:(0,s.C)(e=>e.clock),portraitDataset:v,shaderRef:V,setIsParticleRendererReady:h,getFrequency:_}),X=(0,i.useRef)(Y).current,q=new l.Pq0(1,0,0),Z=new l.Pq0(0,1,0),Q=(0,c.zh)(()=>({from:{alpha:0}}),[])[1],K=(0,c.zh)(()=>({from:{x:0}}),[])[1],J=(0,c.zh)(()=>({from:{y:0}}),[])[1],ee=(0,c.zh)(()=>({from:{z:0}}),[])[1],et=(0,i.useRef)(new l.Pq0),en=()=>{Q.stop(!0),Q.start({to:{alpha:2},config:{duration:2e3,easing:c.le.easeOutCubic},onChange:e=>{X.maxAlpha.current=e.value.alpha}})},er=()=>{Q.stop(!0),Q.start({to:{alpha:0},config:{duration:300,easing:c.le.easeOutCubic},onChange:e=>{X.maxAlpha.current=e.value.alpha}})};(0,d._B)("crimson"),(0,i.useEffect)(()=>()=>Y.dispose(),[]),(0,i.useEffect)(()=>()=>{k.current?.dispose(),k.current=null},[]),(0,i.useEffect)(()=>{Y.setupGPUComputationRenderer()},[g]),(0,i.useEffect)(()=>{let e;e=W.height,X.scaleFactor.current=Math.max(e/1340,1/X.baseParticleSize)},[W]),(0,d.Ql)((e,t)=>{((e,t)=>
13{if(!Y.isRendererReady.current||!x.current)return;let n=A.Lh.clone();n.applyAxisAngle(q,-t),n.applyAxisAngle(Z,e),K.stop(!0),K.start({to:{x:n.x},onChange:e=>{y.current.camera&&(y.current.camera.position.x=e.value.x,y.current.camera.lookAt(A.HG))},config:{duration:400,easing:c.le.easeOutCubic}}),J.stop(!0),J.start({to:{y:n.y},onChange:e=>{y.current.camera&&(y.current.camera.position.y=e.value.y,y.current.camera.lookAt(A.HG))},config:{duration:400,easing:c.le.easeOutCubic}}),ee.stop(!0),ee.start({to:{z:n.z},onChange:e=>{y.current.camera&&(y.current.camera.position.z=e.value.z,y.current.camera.lookAt(A.HG))},config:{duration:400,easing:c.le.easeOutSine}})})(H.x>0?H.x*Math.PI/6:H.x*Math.PI/3,H.y*Math.PI/8),(()=>{if(!Y.isRendererReady.current||!x.current||!v.current)return;S.current=v.current.currentNavigationMarker.getScreenCoordinate(x.current.camera);let e=v.current.currentStatusMarker;T.current=[],P.current=[];for(let t=0,n=e.length;t<n;t++)T.current.push(e[t].getScreenCoordinate(x.current.camera)),P.current.push(e[t].portraitColor);let t=v.current.currentTrajectoryTriangleMarker;if(!t)return;M.current=[];for(let e=0,n=t.length;e<n;e++){let n=t[e].getScreenCoordinate(x.current.camera);M.current.push(n)}let n=v.current.currentTrajectoryCrossMarker;if(n){D.current=[];for(let e=0,t=n.length;e<t;e++){let t=n[e].getScreenCoordinate(x.current.camera);D.current.push(t)}}})(),Y.render(e,t),(e=>{if(!Y.isRendererReady.current||!x.current||!v.current)return;let t=v.current.cameraFocusMarker.portraitPosition;j.current.position.set(t.x,t.y,t.z);let n=x.current.camera;n.updateMatrixWorld(),et.current.set(t.x,t.y,t.z),et.current.applyMatrix4(n.matrixWorldInverse),x.current?.setFocus(et.current,(Y.isMouseDown.current?A.SM:A.yD)*Y.scaleFactor.current,Y.isMouseDown.current?A.HX:A.d9,e)})(t)}),(0,i.useImperativeHandle)(t,()=>({present:en,dismiss:er,setIsMouseDown:e=>{X.isMouseDown.current=e},nextDataset:X.nextDataset}));let ea=(0,i.useMemo)(()=>{if(!v.current||v.current.isEmpty)return null;k.current?.dispose();let e=(0,F.cD)();k.current=e,({tPoint:new l.nc$(new l.gPd),tPosition:new l.nc$(new l.Pq0),tSize:new l.nc$(new l.I9Y),tColor:new l.nc$(new l.Pq0),time:new l.nc$(0),delta:new l.nc$(0),isMouseDown:new l.nc$(0),pointer:new l.nc$(new l.I9Y)}).tPoint.value=e;let t=v.current.currentPointList,r=[],a=[],i=[],s=(0,b.Q0)(t.length);for(let e=0,n=t.length;e<n;e++){let n=t[e];r.push((e%s.width+.5)/s.width,(Math.floor(e/s.width)+.5)/s.height),a.push(e),i.push(n.portraitPosition.x,n.portraitPosition.y,n.portraitPosition.z)}let u=new l.LoY;return u.setAttribute("dataTextureUV",new l.qtW(r,2)),u.setAttribute("position",new l.qtW(i,3)),u.setAttribute("index",new l.vmz(a,1)),(0,o.jsx)("points",{ref:E,layers:n,args:[u],renderOrder:999,children:(0,o.jsx)(O,{ref:V,texture:e})})},[g]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(U.jl,{ref:j,layers:n,args:[10,32],children:(0,o.jsx)("meshBasicMaterial",{color:0xff0000,opacity:.5*!!G,transparent:!0,depthTest:!1})}),(0,o.jsx)("group",{ref:I,layers:n,children:ea})]})}),k=(0,i.forwardRef)((e,t)=>{let{layers:n}=e,{portraitBokehScene:r}=(0,i.useContext)(f.lq),a=(0,i.useRef)(r).current,s=(0,i.useRef)(null),l=(0,i.useRef)(null),u=(0,i.useRef)(null),c=e=>{s.current.setIsMouseDown(e),l.current.setIsMouseDown(e)},m=()=>{s.current.nextDataset(),l.current.nextDataset()},p=()=>{s.current.present(),l.current.present()},h=()=>{s.current.dismiss(),l.current.dismiss()};return(0,d._B)("deeppink"),(0,i.useEffect)(()=>{a.current=u.current},[]),(0,i.useImperativeHandle)(t,()=>({present:p,dismiss:h,setIsMouseDown:c,nextDataset:m,onRouteTransitionStart:()=>{},onRouteTransitionUpdate:()=>{},onRouteTransitionEnd:()=>{},onRouteDismissStart:()=>{},onRouteDismissUpdate:()=>{},onRouteDismissEnd:()=>{}})),(0,o.jsxs)(_,{ref:u,layers:n,name:P.eU.HOME_PORTRAIT_PARTICLE,children:[(0,o.jsx)(T,{ref:s,layers:n}),(0,o.jsx)(V,{ref:l,layers:n})]})}),G=(0,i.forwardRef)((e,t)=>{let n=(0,i.useRef)(null);return(0,i.useImperativeHandle)(t,()=>({material:n.current})),(0,o.jsx)("shaderMaterial",{ref:n,vertexShader:"uniform sampler2D tPosition; /* Data Texture */\nuniform sampler2D tSize; /* Data Texture */\n\nuniform int index; /* A geometry index */\n\nuniform int isMouseDown;\n\nuniform float time;\nuniform float delta;\nuniform vec2 pointer;\nuniform vec2 resolution;\nattribute vec2 referenceUV; /**\n * The UV coordinates of the fragment of the data texture.\n */\n\nvarying vec2 vReferenceUV;\nvarying vec2 vUv;\n\n/**\n * About DataTexture\n * - https://stackoverflow.com/a/31283988/17095649\n * - https://stackoverflow.com/a/29054853/17095649\n */\n/**\n * Main function for particle position calculation.\n *\n * @param {vec2} uv - The UV coordinates of the fragment of the shader material.\n * @param {vec2} referenceUV - The UV coordinates of the fragment of the data texture.\n * @param {vec3} pos - The current position of the particle.\n * @param {vec3} posOrig - The original position of the particle.\n * @param {vec3} rot - The rotation of the particle.\n * @param {vec3} rad - The radius of the particle.\n * @param {float} index - The index of the particle.\n */\nvoid main() {\n /**\n * Calculate the pointer position in screen space by multiplying the pointer coordinates with the resolution.\n */\n vec2 pt = pointer * resolution;\n /**\n * The position read from DataTexture\n */\n vec3 pos = texture2D(tPosition, referenceUV).xyz;\n /**\n * Particle position transformed to view space using the model view matrix\n */\n vec4 modelViewPosition = modelViewMatrix * vec4(pos, 1.0
13);\n vec4 projectedPosition = projectionMatrix * modelViewPosition;\n /**\n * Transform particle position to clip space\n */\n gl_Position = projectedPosition;\n\n /**\n * Passes the referenceUV to vReferenceUV for further processing in the fragment shader.\n */\n vReferenceUV = referenceUV;\n vUv = uv;\n}\n",fragmentShader:"uniform sampler2D tColor; /**\n * Computed color\n */\nuniform int isMouseDown;\nvarying vec2 vReferenceUV;\nvarying vec2 vUv;\n/*\n * Main function for particle color calculation.\n *\n * @param {vec2} uv - The UV coordinates of the fragment.\n * @param {vec4} gpuDataTextureColor - The base color of the particle.\n * @param {vec2} referenceUV - The UV coordinates for a data texture that generated by the GPUComputationRenderer.\n */\nvoid main() {\n /**\n * * `gpuDataTextureColor` is the color obtained from the `tColor` sampler using the `vReferenceUV` coordinates.\n * * This represents the base color of the particle.\n */\n vec4 gpuDataTextureColor = texture2D(tColor, vReferenceUV).xyzw;\n gl_FragColor = gpuDataTextureColor;\n}\n",uniforms:l.LlO.merge([{tPosition:new l.nc$(new l.GYF),tSize:new l.nc$(new l.GYF),tColor:new l.nc$(new l.GYF),tDummy:new l.nc$(new l.GYF),time:new l.nc$(0),delta:new l.nc$(0),isMouseDown:new l.nc$(0),pointer:new l.nc$(new l.I9Y),resolution:new l.nc$(new l.I9Y)}]),blending:l.NTi,transparent:!0,vertexColors:!0,depthTest:!1,depthWrite:!1,wireframe:!0})});var B=n(2103);let j=(0,i.forwardRef)((e,t)=>{let{layers:n}=e,{portraitDataset:r,portraitDatasetHolder:a,portraitMeshScene:u}=(0,i.useContext)(f.lq),{setIsMeshRendererReady:m}=(0,i.useContext)(f.lq),p=(0,i.useRef)(u).current,h=(0,i.useRef)(null),g=(0,i.useRef)(null),v=(0,i.useRef)(null),x=(0,i.useRef)(null),y=(0,i.useRef)(!1),w=(0,s.C)(e=>e.gl),S=(0,s.C)(e=>e.size),T=(0,s.C)(e=>e.pointer),M=(0,s.C)(e=>e.clock),D=(0,i.useRef)({width:0,height:0}),_=(0,i.useRef)(0),E=(0,i.useRef)(null),U=(0,i.useRef)(null),O=(0,i.useRef)(null),F=(0,i.useRef)(null),N=(0,i.useRef)(null),L=(0,i.useRef)(null),V=(0,i.useRef)(null),k=(0,i.useRef)(null),j=(0,i.useRef)(null),$=(0,i.useRef)({}),W=(0,i.useRef)({}),H=(0,i.useRef)({}),Y=(0,i.useRef)({}),X=new l.Pq0(1,0,0),q=new l.Pq0(0,1,0),Z=(0,i.useRef)(0),Q=e=>{Z.current=e},K=(0,c.zh)(()=>({from:{alpha:0},onChange:e=>{_.current=e.value.alpha}}),[])[1],J=(0,c.zh)(()=>({from:{x:0}}),[])[1],ee=(0,c.zh)(()=>({from:{y:0}}),[])[1],et=(0,c.zh)(()=>({from:{z:0}}),[])[1],en=(0,i.useRef)(0),er=1/60,ea=()=>{if(!y.current||!a.current)return;let e=a.current.currentTriangleMeshList,t=E.current.createTexture(),n=E.current.createTexture(),r=E.current.createTexture(),o=E.current.createTexture(),i=E.current.createTexture(),s=E.current.createTexture(),l=E.current.createTexture();for(let a=0,u=e.length;a<u;a++){let u=4*a*3,c=e[a],f=c.vertices,d=f[0],m=f[1],p=f[2],h=c.colors,g=h[0],v=h[1],x=h[2],y=c.radius,w=c.rotation,R=c.angleVelocity,C=+!!c.isDummy;t.image.data.set([g.r,g.g,g.b,0,v.r,v.g,v.b,0,x.r,x.g,x.b,0],u),n.image.data.set([d.x,d.y,d.z,a,m.x,m.y,m.z,a,p.x,p.y,p.z,a],u),r.image.data.set([y.x,y.y,y.z,a,y.x,y.y,y.z,a,y.x,y.y,y.z,a],u),o.image.data.set([w.x,w.y,w.z,0,w.x,w.y,w.z,0,w.x,w.y,w.z,1],u),i.image.data.set([R.x,R.y,R.z,a,R.x,R.y,R.z,a,R.x,R.y,R.z,a],u),s.image.data.set([0,0,1,a,0,0,1,a,0,0,1,a],u),l.image.data.set([C,0,0,a,C,0,0,a,C,0,0,a],u)}V.current.material.uniforms.tColor.value?.dispose(),V.current.material.uniforms.tColor.value=t,O.current.material.uniforms.tPositionOrigin.value?.dispose(),O.current.material.uniforms.tPositionOrigin.value=n,L.current.material.uniforms.tRadius.value?.dispose(),L.current.material.uniforms.tRadius.value=r,F.current.material.uniforms.tRotation.value?.dispose(),F.current.material.uniforms.tRotation.value=o,F.current.material.uniforms.tVelocity.value?.dispose(),F.current.material.uniforms.tVelocity.value=i,N.current.material.uniforms.tVelocity.value?.dispose(),N.current.material.uniforms.tVelocity.value=i,k.current.material.uniforms.tHitTest.value?.dispose(),k.current.material.uniforms.tHitTest.value=s,j.current.material.uniforms.tDummy.value?.dispose(),j.current.material.uniforms.tDummy.value=l,V.current.material.needsUpdate=!0,O.current.material.needsUpdate=!0,L.current.material.needsUpdate=!0,F.current.material.needsUpdate=!0,N.current.material.needsUpdate=!0,k.current.material.needsUpdate=!0,j.current.material.needsUpdate=!0,E.current.doRenderTarget(V.current.material,E.current.getCurrentRenderTarget(V.current)),E.current.doRenderTarget(O.current.material,E.current.getCurrentRenderTarget(O.current)),E.current.doRenderTarget(L.current.material,E.current.getCurrentRenderTarget(L.current)),E.current.doRenderTarget(F.current.material,E.current.getCurrentRenderTarget(F.current)),E.current.doRenderTarget(N.current.material,E.current.getCurrentRenderTarget(N.current)),E.current.doRenderTarget(k.current.material,E.current.getCurrentRenderTarget(k.current)),E.current.doRenderTarget(j.current.material,E.current.getCurrentRenderTarget(j.current)),t.dispose(),n.dispose(),r.dispose(),o.dispose(),i.dispose(),s.dispose(),l.dispose()},eo=e=>{((e,t)=>
13{if(!y.current||!h.current?.camera)return;let n=A.Lh.clone();n.applyAxisAngle(X,-t),n.applyAxisAngle(q,e),J.stop(!0),J.start({to:{x:n.x},onChange:e=>{h.current?.camera&&(h.current.camera.position.x=e.value.x,h.current.camera.lookAt(A.HG))},config:{duration:400,easing:c.le.easeOutCubic}}),ee.stop(!0),ee.start({to:{y:n.y},onChange:e=>{h.current?.camera&&(h.current.camera.position.y=e.value.y,h.current.camera.lookAt(A.HG))},config:{duration:400,easing:c.le.easeOutCubic}}),et.stop(!0),et.start({to:{z:n.z},onChange:e=>{h.current?.camera&&(h.current.camera.position.z=e.value.z,h.current.camera.lookAt(A.HG))},config:{duration:400,easing:c.le.easeOutSine}})})(T.x>0?T.x*Math.PI/6:T.x*Math.PI/3,T.y*Math.PI/8)},ei=()=>{K.stop(!0),K.start({to:{alpha:.8},config:{duration:2e3,easing:c.le.easeInOutCubic}})},es=()=>{K.stop(!0),K.start({to:{alpha:0},config:{duration:300,easing:c.le.easeInOutCubic}})};(0,d._B)("mediumvioletred"),(0,i.useEffect)(()=>(p.current=h.current,()=>void(E.current?.dispose(),E.current=null,y.current=!1,m(!1))),[]),(0,i.useEffect)(()=>(window.addEventListener("mousemove",eo),()=>window.removeEventListener("mousemove",eo)),[]),(0,i.useEffect)(()=>{(()=>{if(!a.current||a.current.isEmpty||E.current)return;D.current=(0,b.Q0)(3*B.q.MAX_TRIANGLE_DATA_LENGTH),E.current=new R.d(D.current.width,D.current.height,w),(0,C.n)()&&E.current.setDataType(l.ix0);let e=E.current.createTexture(),t=E.current.createTexture(),n=E.current.createTexture(),r=E.current.createTexture(),o=E.current.createTexture(),i=E.current.createTexture(),s=E.current.createTexture(),u=E.current.createTexture(),c=a.current.currentTriangleMeshList;for(let a=0,l=c.length;a<l;a++){let l=4*a*3,f=c[a],d=f.vertices,m=d[0],p=d[1],h=d[2],g=f.colors,v=g[0],x=g[1],y=g[2],w=f.radius,R=f.rotation,C=f.angleVelocity,b=+!!f.isDummy;t.image.data.set([m.x,m.y,m.z,a,p.x,p.y,p.z,a,h.x,h.y,h.z,a],l),e.image.data.set([v.r,v.g,v.b,0,x.r,x.g,x.b,0,y.r,y.g,y.b,0],l),n.image.data.set([m.x,m.y,m.z,a,p.x,p.y,p.z,a,h.x,h.y,h.z,a],l),r.image.data.set([w.x,w.y,w.z,a,w.x,w.y,w.z,a,w.x,w.y,w.z,a],l),o.image.data.set([R.x,R.y,R.z,a,R.x,R.y,R.z,a,R.x,R.y,R.z,a],l),i.image.data.set([C.x,C.y,C.z,a,C.x,C.y,C.z,a,C.x,C.y,C.z,a],l),s.image.data.set([0,0,1,a,0,0,1,a,0,0,1,a],l),u.image.data.set([b,0,0,a,b,0,0,a,b,0,0,a],l)}V.current=E.current.addVariable("tColor","uniform int isMouseDown;\nuniform float maxAlpha;\n\nuniform mat4 modelMatrix;\n// uniform mat4 viewMatrix;\n// uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform vec2 pointer;\nuniform vec2 screenResolution;\n/*\n * Main function for particle color calculation.\n *\n * @param {vec2} uv - The UV coordinates of the fragment.\n * @param {vec4} color - The color of the particle.\n * @param {int} isMouseDown - A flag indicating if the mouse is currently pressed.\n */\nvoid main() {\n /**\n * Calculate the UV coordinates by normalizing the fragment coordinates with the data texture resolution\n */\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n /**\n * Retrieve the index from the tPosition texture at the given UV coordinates\n */\n float index = texture2D(tPosition, uv).w;\n /**\n * Retrieve the position from the tPosition texture at the given UV coordinates\n */\n vec3 pos = texture2D(tPosition, uv).xyz;\n /**\n * Retrieve the color from the tColor texture at the given UV coordinates\n */\n vec4 color = texture2D(tColor, uv).xyzw;\n /**\n * Retrieve the dummy value from the tDummy texture at the given UV coordinates\n */\n int isDummy = int(texture2D(tDummy, uv).x);\n\n /**\n * Discard the fragment if the dummy value is 1\n */\n if (int(isDummy) >= 1) {\n discard;\n }\n\n /**\n * Retrieve the hit test value from the tHitTest texture at the given UV coordinates\n */\n float hitTestOpacity = texture2D(tHitTest, uv).y;\n color.w = maxAlpha * hitTestOpacity;\n\n /**\n * Set the final color of the fragment\n */\n gl_FragColor = vec4(color.xyz, color.w);\n}\n",e),O.current=E.current.addVariable("tPositionOrigin","void main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n gl_FragColor = texture2D(tPositionOrigin, uv).xyzw;\n}\n",n),U.current=E.current.addVariable("tPosition","uniform float delta;\nuniform int isMouseDown;\n\n#ifndef FNC_ROTATE3D\n#define FNC_ROTATE3D\n/**\n * Rotate around an arbitrary axis in 3D space.\n *\n * @param {vec3} axis - The axis of rotation.\n * @param {float} radians - The angle of rotation in radians.\n * @returns {mat3} - The rotation matrix.\n */\nmat3 rotate3d(vec3 axis, float radians) {\n axis = normalize(axis);\n float s = sin(radians);\n float c = cos(radians);\n float oc = 1.0 - c;\n return mat3(\n oc * axis.x * axis.x + c,\n oc * axis.x * axis.y - axis.z * s,\n oc * axis.z * axis.x + axis.y * s,\
13n oc * axis.x * axis.y + axis.z * s,\n oc * axis.y * axis.y + c,\n oc * axis.y * axis.z - axis.x * s,\n oc * axis.z * axis.x - axis.y * s,\n oc * axis.y * axis.z + axis.x * s,\n oc * axis.z * axis.z + c\n );\n}\n#endif\n\nvec3 rotate(vec3 position, vec3 rotation, vec3 radians) {\n return position + radians * rotate3d(vec3(1.0, 0.0, 0.0), rotation.x) * rotate3d(vec3(0.0, 1.0, 0.0), rotation.y);\n}\n\n/*\n * Main function for particle position calculation.\n *\n * @param {vec2} uv - The UV coordinates of the fragment.\n * @param {vec3} pos - The current position of the particle.\n * @param {vec3} posOrig - The original position of the particle.\n * @param {vec3} rot - The rotation of the particle.\n * @param {vec3} rad - The radius of the particle.\n * @param {float} index - The index of the particle.\n */\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec3 pos = texture2D(tPosition, uv).xyz;\n vec3 posOrig = texture2D(tPositionOrigin, uv).xyz;\n vec3 rot = texture2D(tRotation, uv).xyz;\n vec3 rad = texture2D(tRadius, uv).xyz;\n float index = texture2D(tPosition, uv).w;\n\n /**\n * * If the mouse is down, calculate the new position with rotation\n */\n /**\n * Calculate the target position\n */\n vec3 to = isMouseDown == 1 ? rotate(posOrig, rot, rad) : posOrig;\n /**\n * Calculate the movement towards the target position\n */\n float animationDuration = isMouseDown == 1 ? 2.0 : 0.2;\n /**\n * Calculate the progress of the interpolation using delta\n */\n float lerpFactor = max(min(delta / animationDuration, 1.0), 0.001);\n pos.x += (to.x - pos.x) * lerpFactor;\n pos.y += (to.y - pos.y) * lerpFactor;\n pos.z += (to.z - pos.z) * lerpFactor;\n\n /**\n * Set the fragment color to the new position and the original index\n */\n gl_FragColor = vec4(pos, index);\n}\n",t),L.current=E.current.addVariable("tRadius","/*\n * Main function for particle radius calculation.\n *\n * @param {vec2} uv - The UV coordinates of the fragment.\n * @param {vec4} radius - The radius of the particle.\n */\nvoid main() {\n /**\n * Get the UV coordinates by normalizing the fragment coordinates with the resolution\n */\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n /**\n * * Sample the texture at the UV coordinates and set the fragment color\n * * The texture2D function fetches the texel value from the texture 'tRadius' at the given UV coordinates\n * * The .xyzw swizzle operator ensures that all four components (RGBA) are assigned to gl_FragColor\n */\n gl_FragColor = texture2D(tRadius, uv).xyzw;\n}\n",r),F.current=E.current.addVariable("tRotation","uniform float time;\nuniform float delta;\nuniform int isMouseDown;\n\n#define M_PI 3.1415926535897932384626433832795\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec3 rot = texture2D(tRotation, uv).xyz;\n vec3 vel = texture2D(tVelocity, uv).xyz;\n\n float index = texture2D(tRotation, uv).w;\n\n /**\n * Temporary output\n */\n gl_FragColor = vec4(rot, index);\n return;\n\n if (isMouseDown == 1) {\n rot.x += vel.x;\n rot.y += vel.y;\n rot.z += vel.z;\n rot = mod(rot, M_PI * 2.0);\n }\n gl_FragColor = vec4(rot, index);\n}\n",o),N.current=E.current.addVariable("tVelocity","/*\n * Main function for particle velocity calculation.\n *\n * @param {vec2} uv - The UV coordinates of the fragment.\n * @param {vec3} velocity - The velocity of the particle.\n */\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n gl_FragColor = texture2D(tVelocity, uv).xyzw;\n}\n",i),k.current=E.current.addVariable("tHitTest","/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n\nuniform float delta;\nuniform int isMouseDown;\nuniform float maxAlpha;\n\n/*\n * NOTE: `viewMatrix` and `cameraPosition` are auto-prepended by three.js'\n * ShaderMaterial fragment prefix and refer to the GPUComputationRenderer's\n * internal orthographic camera (identity), so we must NOT redeclare them.\n * Use a distinct name (`cameraViewMatrix`) to pass the scene camera's view matrix.\n * `modelMatrix` and `projectionMatrix` are NOT auto-prepended for fragment\n * shaders, so they can be declared here normally.\n */\nuniform mat4 modelMatrix;\nuniform mat4 cameraViewMatrix;\nuniform mat4 projectionMatrix;\nuniform vec2 pointer;\nuniform vec2 screenResolution;\n\n/**\n * Easing function\n *\n * @param {float} t - The progress value.\n * @returns {float} The eased value.\n */\nfloat easeOutCubic(float t) {\n return 1.0 - pow(1.0 - t, 3.0);\n}\n\n/*\n * Hit test calculation in screen-space (pixel) distance, unified across triangle.\n *\n * The data texture layout stores each triangle's 3 vertices in 3 consecutive texels\n * along the x axis (triangle N occupies texels 3N, 3N+1, 3N+2). For every fragment\n * (vertex) we read the 3 sibling vertex positions, project all of them to NDC and\n * then to pixel-space offsets from screen centre, and take the minimum distance to\n * the pointer. All 3 vertices of the same triangle therefore yield the same hit\n * result, eliminating mid-edge alpha fade on the wireframe rendering. Using pixel\n * space (not view-space units) makes the hit radius invariant to window resize.\n */\nvoid main() {\n /* Current texel uv and state */\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 hitTest = texture2D(tHitTest, uv).xyzw;\n\n /* Dummy guard (per-vertex but identical within a triangle by data layout) */\n int isDummy = int(texture2D(tDummy, uv).x);\n if (isDummy >= 1) {\n discard;\n }\n\n float duration = 1.5;\n\n if (isMouseDown == 1) {\n duration = 0.5;\n hitTest.x = 0.0;\n } else {\n /* Identify the 3 sibling vertex uvs for the triangle this fragment belongs to */\n float triBaseX = floor(gl_FragCoord.x / 3.0) * 3.0;\n vec2 triUV0 = vec2((triBaseX + 0.5) / resolution.x, uv.y);\n vec2 triUV1 = vec2((triBaseX + 1.5) / resolution.x, uv.y);\n vec2 triUV2 = vec2((triBaseX + 2.5) / resolution.x, uv.y);\n\n /* Sample all 3 vertex world-space positions */\n vec3 p0 = texture2D(tPosition, triUV0).xyz;\n vec3 p1 = texture2D(tPosition, triUV1).xyz;\n vec3 p2 = texture2D(tPosition, triUV2).xyz;\n\n /* Project each vertex to clip / NDC / pixel offset from screen centre */\n mat4 mvp = projectionMatrix * cameraViewMatrix * modelMatrix;\n vec4 c0 = mvp * vec4(p0, 1.0);\n vec4 c1 = mvp * vec4(p1, 1.0);\n vec4 c2 = mvp * vec4(p2, 1.0);\n\n /* Guard against behind-camera (w <= 0) to avoid flipped NDC */\n bool visible = c0.w > 0.0 && c1.w > 0.0 && c2.w > 0.0;\n\n vec2 halfRes = 0.5 * screenResolution;\n vec2 px0 = c0.xy / c0.w * halfRes;\n vec2 px1 = c1.xy / c1.w * halfRes;\n vec2 px2 = c2.xy / c2.w * halfRes;\n vec2 pxPtr = pointer * halfRes;\n\n float d0 = distance(pxPtr, px0);\n float d1 = distance(pxPtr, px1);\n float d2 = distance(pxPtr, px2);\n float dist = visible ? min(d0, min(d1, d2)) : 1e9;\n\n /* Hit radius in pixels (tunable) */\n float maxDistance = 80.0;\n\n if (dist < maxDistance) {\n if (hitTest.x == 0.0) {\n /* Pointer out -> Pointer in */\n hitTest.x = 0.5;\n hitTest.y = 1.0;\n hitTest.z = 0.0;\n } else if (hitTest.x == 0.5) {\n /* Pointer in -> Pointer hovering */\n hitTest.x = 1.0;\n }\n } else {\n /* Out of range */\n hitTest.x = 0.0;\n }\n }\n\n /* Advance progress and compute opacity multiplier */\n float limitDelta = delta / duration;\n hitTest.z = min(hitTest.z + limitDelta, 1.0);\n hitTest.y = 1.0 - easeOutCubic(hitTest.z);\n\n gl_FragColor = hitTest;\n}\n",s),j.current=E.current.addVariable("tDummy","void main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n float isDummy = texture2D(tDummy, uv).x;\n float index = texture2D(tDummy, uv).w;\n gl_FragColor = vec4(isDummy, 0.0, 0.0, index);\n}\n",u),V.current.material.needsUpdate=!0,O.current.material.needsUpdate=!0,U.current.material.needsUpdate=!0,L.current.material.needsUpdate=!0,F.current.material.needsUpdate=!0,k.current.material.needsUpdate=!0,N.current.material.needsUpdate=!0,k.current.material.needsUpdate=!0,j.current.material.needsUpdate=!0,E.current.setVariableDependencies(F.current,[F.current,N.current]),E.current.setVariableDependencies(U.current,[U.current,O.current,L.current,F.current]),E.current.setVariableDependencies(O.current,[O.current]),E.current.setVariableDependencies(N.current,[N.current]),E.current.setVariableDependencies(L.current,[L.current]),E.current.setVariableDependencies(V.current,[V.current,j.current,k.current,U.current]),E.current.setVariableDependencies(k.current,[k.current,V.current,j.current,U.current]),E.current.setVariableDependencies(j.current,[j.current]),H.current=V.current.material.uniforms,H.current.isMouseDown=new l.nc$(0),H.current.maxAlpha=new l.nc$(0),H.current.pointer=new l.nc$(new l.I9Y),H.current.screenResolution=new l.nc$(new l.I9Y),H.current.modelMatrix=new l.nc$(new l.kn4),H.current.cameraViewMatrix=new l.nc$(new l.kn4),H.current.projectionMatrix=new l.nc$(new l.kn4),$.current=U.current.material.uniforms,$.current.center=new l.nc$(new l.Pq0),$.current.delta=new l.nc$(M.getDelta()),$.current.isMouseDown=new l.nc$(0),$.current.time=new l.nc$(0),W.current=F.current.material.uniforms,W.current.delta=new l.nc$(M.getDelta()),W.current.isMouseDown=new l.nc$(0),W.current.time=new l.nc$(0),Y.current=k.current.material.uniforms,Y.current.delta=new l.nc$(M.getDelta()),Y.current.isMouseDown=new l.nc$(0),Y.current.maxAlpha=new l.nc$(0),Y.current.pointer=new l.nc$(new l.I9Y),Y.current.screenResolution=new l.nc$(new l.I9Y),Y.current.modelMatrix=new l.nc$(new l.kn4),Y.current.cameraViewMatrix=new l.nc$(new l.kn4),Y.current.projectionMatrix=new l.nc$(new l.kn4);let f=E.current.init();null!==f&&(0,z.Rm)("mediumvioletred","â","gpuRenderer init error",f),e.dispose(),t.dis
13pose(),n.dispose(),r.dispose(),o.dispose(),i.dispose(),s.dispose(),u.dispose(),y.current=!0,m(!0)})()},[r]),(0,d.Ql)((e,t)=>{((e,t)=>{if(!y.current)return;let n=e.clock.getElapsedTime();if(x.current.material.uniforms.time.value=n,x.current.material.uniforms.delta.value=t,x.current.material.uniforms.isMouseDown.value=Z.current,x.current.material.uniforms.pointer.value=T,x.current.material.uniforms.resolution.value.set(S.width,S.height),en.current+=t,en.current<er)return;let r=en.current;en.current=0,H.current.isMouseDown.value=Z.current,H.current.maxAlpha.value=_.current,H.current.pointer.value=T,H.current.screenResolution.value.x=S.width,H.current.screenResolution.value.y=S.height,H.current.modelMatrix.value=v.current?.matrixWorld??H.current.modelMatrix.value,H.current.cameraViewMatrix.value=h.current.camera.matrixWorldInverse,H.current.projectionMatrix.value=h.current.camera.projectionMatrix,Y.current.delta.value=r,Y.current.isMouseDown.value=Z.current,Y.current.maxAlpha.value=_.current,Y.current.pointer.value=T,Y.current.screenResolution.value.x=S.width,Y.current.screenResolution.value.y=S.height,Y.current.modelMatrix.value=v.current?.matrixWorld??Y.current.modelMatrix.value,Y.current.cameraViewMatrix.value=h.current.camera.matrixWorldInverse,Y.current.projectionMatrix.value=h.current.camera.projectionMatrix,$.current.delta.value=r,$.current.isMouseDown.value=Z.current,$.current.time.value=n,W.current.delta.value=r,W.current.isMouseDown.value=Z.current,W.current.time.value=n,E.current.compute(),x.current.material.uniforms.tPosition.value=E.current.getCurrentRenderTarget(U.current).texture,x.current.material.uniforms.tColor.value=E.current.getCurrentRenderTarget(V.current).texture})(e,t)}),(0,i.useImperativeHandle)(t,()=>({present:ei,dismiss:es,setIsMouseDown:Q,nextDataset:ea,onRouteDismissStart:()=>{},onRouteDismissUpdate:()=>{},onRouteDismissEnd:()=>{}}));let el=(0,i.useMemo)(()=>{if(!a.current||a.current.isEmpty)return null;let e=a.current.currentTriangleMeshList,t=e.length,r=new Float32Array(3*t*3),i=new Float32Array(3*t*3),s=new Float32Array(3*t*3),u=new Float32Array(3*t*1),c=new Float32Array(3*t*2);for(let n=0;n<t;n++){let t=e[n],a=t.vertices,o=a[0],l=a[1],f=a[2];r.set([o.x,o.y,o.z,l.x,l.y,l.z,f.x,f.y,f.z],3*n*3);let d=t.normals,m=d[0],p=d[1],h=d[2];i.set([m.x,m.y,m.z,p.x,p.y,p.z,h.x,h.y,h.z],3*n*3);let g=t.colors,v=g[0],x=g[1],y=g[2];s.set([v.r,v.g,v.b,x.r,x.g,x.b,y.r,y.g,y.b],3*n*3),u.set([n,n,n],3*n);let w=2*n*3,R=(w+1)%c.length/c.length,C=(w+3)%c.length/c.length,b=(w+5)%c.length/c.length;c.set([R,0,C,0,b,0],w)}let f=new l.LoY;return f.setAttribute("position",new l.qtW(r,3)),f.setAttribute("normal",new l.qtW(i,3)),f.setAttribute("color",new l.qtW(s,3)),f.setAttribute("index",new l.vmz(u,1)),f.setAttribute("referenceUV",new l.qtW(c,2)),f.computeBoundingSphere(),f.computeBoundingBox(),f.computeVertexNormals(),(0,o.jsx)("mesh",{ref:v,layers:n,args:[f],children:(0,o.jsx)(G,{ref:x})})},[r]);return(0,o.jsx)(I,{ref:h,layers:n,name:P.eU.HOME_PORTRAIT_MESH,children:(0,o.jsx)("group",{ref:g,layers:n,children:el})})});var $=n(1681),W=n(6133),H=n(3361);let Y=e=>{let{index:t,connectorRefs:n,statusMarkerRefs:r,connectorProgressRef:a,onRegisterConnectorProgressSpring:o,onRegisterConnectorOpacitySpring:s,onRegisterMarkerOpacitySpring:l}=e,u=(0,i.useRef)(a);u.current=a;let f=(0,c.zh)(()=>({from:{progress:0},onChange:e=>{let n=u.current.current;n&&(n[t]=e.value.progress)}}),[])[1],d=(0,c.zh)(()=>({from:{progress:0},onChange:e=>n.current?.[t]?.setOpacityRatio(e.value.progress)}),[])[1],m=(0,c.zh)(()=>({from:{progress:0},onChange:e=>r.current?.[t]?.setOpacityRatio(e.value.progress)}),[])[1];return(0,i.useEffect)(()=>{o(t,f),s(t,d),l(t,m)},[]),null},X=(0,i.forwardRef)((e,t)=>{let{layers:n}=e,{fonts:r}=(0,i.useContext)(f.DM),a=(0,i.useRef)(null),s=(0,i.useRef)([,,]),u=(0,i.useCallback)(e=>t=>{s.current[e]=t},[]),d=(0,i.useRef)(null),p=(0,i.useRef)(null),h=(0,i.useRef)(null),[g,v]=(0,i.useState)({width:0,height:0}),x=(0,i.useRef)(1),y=(0,i.useRef)(0),w=(0,i.useRef)(0),R=(0,i.useRef)(0),C=(0,c.zh)(()=>({from:{opacity:0}
13,onChange:e=>{y.current=e.value.opacity,d.current.setOpacityRatio(e.value.opacity*x.current)}}),[])[1],b=(0,c.zh)(()=>({from:{opacity:0},onChange:e=>{w.current=e.value.opacity,p.current.setOpacityRatio(e.value.opacity*x.current)}}),[])[1],S=(0,c.zh)(()=>({from:{opacity:0},onChange:e=>{R.current=e.value.opacity,h.current.setOpacityRatio(e.value.opacity*x.current)}}),[])[1],T=(0,i.useRef)(0),P=()=>{T.current++,T.current===s.current.length&&M()},M=()=>{let e=0,t=0;for(let n=0;n<s.current.length;n++){let r=s.current[n].getBoundingBoxSize();e<r.x&&(e=r.x),t<r.y&&(t=r.y)}let n=-.5+t,r=.5-e/2;for(let e=0;e<s.current.length;e++)s.current[e].setPositionXYZ(r,n,4),n-=t;v({width:e+2,height:2*t+2})},A=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1;a.current.position.x+=(e.x-a.current.position.x)*n,a.current.position.y+=(e.y-a.current.position.y)*n,a.current.position.z+=(e.z-a.current.position.z)*n,a.current.lookAt(t.position.x,t.position.y,t.position.z)},D=(e,t)=>{L.current=!0;for(let n=0;n<s.current.length;n++)s.current[n].present(e,t);C.stop(!0),C.start({from:{opacity:0}
13,to:{opacity:1},delay:t,config:{duration:200,easing:c.le.linear}}),b.stop(!0),b.start({from:{opacity:0},to:{opacity:1},delay:t,config:{duration:200,easing:c.le.linear}}),S.stop(!0),S.start({from:{opacity:0},to:{opacity:1},delay:t,config:{duration:200,easing:c.le.linear}})},_=(e,t)=>{L.current=!1;for(let n=0;n<s.current.length;n++)s.current[n].dismiss(e,t);C.stop(!0),C.start({from:{opacity:1},to:{opacity:0},delay:t,config:{duration:e,easing:c.le.linear}}),b.stop(!0),b.start({from:{opacity:1},to:{opacity:0},delay:t,config:{duration:e,easing:c.le.linear}}),S.stop(!0),S.start({from:{opacity:1},to:{opacity:0},delay:t,config:{duration:e,easing:c.le.linear}})},I=()=>d.current.getSegments(),E=(0,i.useRef)(new l.Pq0),U=(0,i.useRef)(new l.Q1f),O=(0,i.useRef)(0),F=(e,t,n)=>{if(O.current+=n,O.current<.1)return;if(O.current=0,!e.equals(E.current)){let t=e.x>=0?"+"+e.x.toFixed(0).padStart(4,"0"):"-"+Math.abs(e.x).toFixed(0).padStart(4,"0"),n=e.y>=0?"+"+e.y.toFixed(0).padStart(4,"0"):"-"+Math.abs(e.y).toFixed(0).padStart(4,"0"),r=e.z>=0?"+"+e.z.toFixed(0).padStart(4,"0"):"-"+Math.abs(e.z).toFixed(0).padStart(4,"0");s.current[0].setText("CRD: "+t+","+n+","+r),E.current=e.clone()}let r=(255*t.r).toFixed(0).padStart(3,"0"),a=(255*t.g).toFixed(0).padStart(3,"0"),o=(255*t.b).toFixed(0).padStart(3,"0");s.current[1].setText("RGB: "+r+","+a+","+o),U.current=t.clone()},N=(e,t)=>{s.current[e]?.setText(t)},L=(0,i.useRef)(!1),z=e=>{x.current=e,d.current?.setOpacityRatio(y.current*e),p.current?.setOpacityRatio(w.current*e),h.current?.setOpacityRatio(R.current*e);let t=L.current;if(!t&&e>.2){L.current=!0,a.current&&(a.current.visible=!0);for(let e=0;e<s.current.length;e++)s.current[e]?.present(200,0)}else if(t&&e<.05){L.current=!1;for(let e=0;e<s.current.length;e++)s.current[e]?.dismiss(150,0)}};return(0,i.useImperativeHandle)(t,()=>({present:D,dismiss:_,updatePosition:A,getSegments:I,updateStatus:F,setText:N,setOpacityRatio:z}),[]),r.USansRgBd&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("mesh",{ref:a,layers:n,children:[(0,o.jsx)(W.dr,{ref:h,layers:n,width:g.width,height:g.height,length:1,color:m.i.label.bracketColor,opacity:m.i.label.bracketOpacity}),(0,o.jsx)(W.oQ,{layers:n,ref:u(0),text:"CRD: +0000,+0000,+0000",fontFile:r.USansRgBd.fontFile,fontTexture:r.USansRgBd.fontTexture,fontSize:3,letterSpacing:0,onInitialized:P}),(0,o.jsx)(W.oQ,{layers:n,ref:u(1),text:"RGB: 000,000,000",fontFile:r.USansRgBd.fontFile,fontTexture:r.USansRgBd.fontTexture,fontSize:3,letterSpacing:0,onInitialized:P}),(0,o.jsx)(W.Ml,{ref:p,layers:n,width:g.width,height:g.height,enableLine:!0,enableFill:!1,lineColor:m.i.label.outlineColor,lineOpacity:m.i.label.outlineOpacity}),(0,o.jsx)(W.Ml,{ref:d,layers:n,width:g.width,height:g.height,enableLine:!1,enableFill:!0,fillColor:m.i.label.bgColor,fillOpacity:m.i.label.bgOpacity})]})})});var q=((a=q||{}).INITIAL="INITIAL",a.PRESENT="PRESENT",a.PRESENT_STAY="PRESENT_STAY",a.DISMISS="DISMISS",a.DISM
13ISS_STAY="DISMISS_STAY",a);let Z=(0,i.forwardRef)((e,t)=>{let{layers:n,index:r,type:a,lineColor:s=new l.Q1f(1,1,1),debug:u=!1}=e,f=(0,i.useRef)(null),d=(0,i.useRef)(null),p=(0,i.useRef)("PRESENT"),h=(0,i.useRef)(0),g=(0,c.zh)({from:{progress:h.current}},[])[1],v=(0,c.zh)({from:{progress:h.current}},[])[1],x=(e,t)=>{d.current.updatePosition(t);let n=new l.Pq0;switch(p.current){case"PRESENT":n.lerpVectors(e,t,h.current),f.current?.connect(e,n);break;case"PRESENT_STAY":f.current?.connect(e,t);break;case"DISMISS":n.lerpVectors(e,t,1-h.current),f.current?.connect(n,t);break;case"DISMISS_STAY":f.current?.connect(t,t)}},y=(e,t,n)=>{p.current="PRESENT",f.current?.setColor(s,s,1,1),f.current?.setLineOpacityRatio(1),f.current?.setEndCapOpacityRatio(1),v.stop(!0),g.stop(!0),g.start({from:{progress:h.current},to:{progress:1},delay:t,config:{duration:e,easing:c.le.easeInOutQuad},onChange:e=>{h.current=e.value.progress},onRest:()=>{d.current?.blink(),f.current?.setEndCapOpacityRatio(0),n?.(r)}})},w=()=>{p.current="PRESENT_STAY",h.current=1,f.current?.setColor(s,s,1,1),f.current?.setLineOpacityRatio(1),f.current?.setEndCapOpacityRatio(0)},R=(e,t,n)=>{p.current="DISMISS",f.current?.setColor(s,s,1,1),g.stop(!0),v.stop(!0),v.start({from:{progress:1},to:{progress:0},delay:t,config:{duration:e,easing:c.le.easeInOutQuad},onChange:e=>{h.current=e.value.progress},onRest:()=>n?.(r)})},C=()=>{p.current="DISMISS_STAY",h.current=0,f.current?.setColor(s,s,0,0),f.current?.setLineOpacityRatio(0),f.current?.setEndCapOpacityRatio(0)},b=()=>{h.current=0,g.stop(!0),v.stop(!0)};return(0,i.useImperativeHandle)(t,()=>({updatePosition:x,present:y,stayPresent:w,dismiss:R,stayDismiss:C,cancel:b})),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(W.Wi,{ref:f,layers:n,enableStartCap:!1,enableEndCap:!0,endCapColor:new l.Q1f(m.i.trajectory.capColor),endCapOpacity:m.i.trajectory.capOpacity}),(0,o.jsx)(W.q1,{ref:d,layers:n,type:a,radius:a===W.u$.CROSS?2:3,crossThickness:1,enableOutline:!1,enableBackground:!0,enableDot:!1,fillColor:m.i.trajectory.markerColor,fillOpacity:m.i.trajectory.markerOpacity})]})}),Q=new l.Pq0,K=new l.Pq0,J=new l.Pq0,ee=new l.I9Y,et=new l.Q1f(m.i.connector.lineColor),en=new l.Q1f(m.i.connector.capColor),er=(0,i.forwardRef)((e,t)=>{let{layers:n}=e,{routeState:r}=(0,i.useContext)(f.Pl),{statusMarkerScreenPositions:a,statusMarkerColors:u,trajectoryTriangleScreenPositions:p,trajectoryCrossScreenPositions:h}=(0,i.useContext)(f._3),g=(0,i.useRef)(r);g.current=r;let{isTransitioningToNextDataset:v}=(0,i.useContext)(f.lq),x=(0,i.useRef)(v);x.current=v;let{portraitOverlayScene:y,portraitDatasetHolder:R,setIsOverlayRendererReady:C}=(0,i.useContext)(f.lq),S=(0,i.useRef)(y).current,T=(0,i.useRef)(null),M=(0,i.useRef)(null),A=(0,i.useRef)([,,,].fill(null)),D=(0,i.useCallback)(e=>t=>{A.current[e]=t},[]),_=(0,i.useRef)([,,,].fill(null)),I=(0,i.useCallback)(e=>t=>{_.current[e]=t},[]),U=(0,i.useRef)([,,,].fill(null)),O=(0,i.useCallback)(e=>t=>{U.current[e]=t},[]),F=(0,i.useRef)(null),N=(0,i.useRef)(null),L=(0,i.useRef)([,,,,].fill(null)),z=(0,i.useCallback)(e=>t=>{L.current[e]=t},[]),V=(0,i.useRef)([,,,,].fill(null)),k=(0,i.useCallback)(e=>t=>{V.current[e]=t},[]),G=(0,s.C)(e=>e.size),B=(0,i.useRef)(!1),j=(0,i.useRef)(null),q=(0,i.useRef)(null),er=(0,i.useRef)([,,,].fill(0)),ea=(0,i.useRef)([,,,].fill(null)),eo=(0,i.useRef)([,,,].fill(null)),ei=(0,i.useRef)([,,,].fill(null)),es=(0,i.useCallback)((e,t)=>{ea.current[e]=t},[]),el=(0,i.useCallback)((e,t)=>{eo.current[e]=t},[]),eu=(0,i.useCallback)((e,t)=>{ei.current[e]=t},[]),ec=()=>{if(!B.current||x.current||g.current.state===f.bC.DISMISSING||!R.current)return;R.current.nextTriangleTrajectory(),L.current.push(L.current.shift());let e=new WeakRef(ec),t=+l.cj9.randFloat(100,500);for(let n=0,r=L.current.length;n<r;n++){let a=L.current[n];a.cancel(),0===n?a.stayDismiss():1===n?a.dismiss(t,0):n===r-1?a.present(t,0,t=>e.deref()?.()):a.stayPresent()}},ef=()=>{},ed=()=>{},em=()=>{if(!B.current||x.current||g.current.state===f.bC.DISMISSING||!R.current)return;R.current.nextCrossTrajectory(),V.current.push(V.current.shift());let e=new WeakRef(em),t=+l.cj9.randFloat(100,500);for(let n=0,r=V.current.length;n<r;n++){let a=V.current[n];
13a.cancel(),0===n?a.stayDismiss():1===n?a.dismiss(t,0):n===r-1?a.present(t,0,t=>e.deref()?.()):a.stayPresent()}},ep=()=>{for(let e=0;e<3;e++)A.current[e].present(1e3,1200),ea.current[e].stop(!0),ea.current[e].start({to:{progress:1},delay:1400,config:{duration:160,easing:c.le.linear}}),eo.current[e].stop(!0),eo.current[e].start({to:{progress:1},delay:1400,config:{duration:20,easing:c.le.linear}}),ei.current[e].stop(!0),ei.current[e].start({to:{progress:1},delay:1200,config:{duration:500,easing:c.le.linear}});j.current&&clearTimeout(j.current);let e=new WeakRef(ec);j.current=setTimeout(()=>e.deref()?.(),2400),q.current&&clearTimeout(q.current);let t=new WeakRef(em);q.current=setTimeout(()=>t.deref()?.(),2400)},eh=()=>{for(let e=0;e<3;e++)A.current[e].dismiss(200,0),ea.current[e].stop(!0),ea.current[e].start({to:{progress:0},config:{duration:200,easing:c.le.linear}}),eo.current[e].stop(!0),eo.current[e].start({to:{progress:0},config:{duration:200,easing:c.le.linear}}),ei.current[e].stop(!0),ei.current[e].start({to:{progress:0},config:{duration:200,easing:c.le.linear}});j.current&&clearTimeout(j.current);for(let e=0;e<L.current.length;e++){let t=L.current[e];t.cancel(),t.dismiss(10,0)}q.current&&clearTimeout(q.current);for(let e=0;e<V.current.length;e++){let t=V.current[e];t.cancel(),t.dismiss(10,0)}},eg=e=>{},ev=e=>{},ex=e=>{};(0,d._B)("tomato"),(0,i.useEffect)(()=>(S.current=T.current,B.current=!0,C(!0),()=>void(B.current=!1,C(!1))),[]),(0,i.useEffect)(()=>{switch(r.state){case f.bC.PRESENTING:ep();break;case f.bC.DISMISSING:eh();case f.bC.NONE:}},[r]),(0,i.useEffect)(()=>{B.current&&(v?eh():ep())},[v]),(0,i.useEffect)(()=>{T.current?.camera&&(M.current=T.current?.camera)},[T.current?.camera]),(0,d.Ql)((e,t)=>{(e=>{if(!B.current||!a.current||a.current.length<=0)return;ee.set(0,0);for(let e=0;e<a.current.length;e++)ee.add(a.current[e]);let t=ee.divideScalar(a.current.length),n=(0,b.UT)(t,M.current,G,1500);for(let t=0,r=a.current.length;t<r;t++){let r=a.current[t],o=(0,b.UT)(r,M.current,G,1500),i=_.current[t];(0,w.xx)(.2,e),i.position.x=o.x,i.position.y=o.y,i.position.z=o.z,Q.subVectors(o,n).normalize(),K.copy(i.position).add(Q.multiplyScalar(50)).setZ(1500);let s=A.current[t];s.updatePosition(K,M.current,.08);let l=s.getSegments(),c=(0,b._K)(i.position,l);J.lerpVectors(i.position,c,er.current[t]),U.current[t].connect(i.position,J),A.current[t].updateStatus(i.position,u.current[t],e)}if(p.current&&!(p.current.length<=0)){for(let e=0;e<L.current.length;e++){let t=(0,b.UT)(p.current[e],M.current,G,1500),n=(0,b.UT)(p.current[e+1],M.current,G,1500);L.current[e].updatePosition(t,n)}if(h.current&&!(h.current.length<=0))for(let e=0;e<V.current.length;e++){let t=(0,b.UT)(h.current[e],M.current,G,1500),n=(0,b.UT)(h.current[e+1],M.current,G,1500);V.current[e].updatePosition(t,n)}}})(t)}),(0,i.useImperativeHandle)(t,()=>({present:ef,dismiss:ed,onRouteDismissStart:eg,onRouteDismissUpdate:ev,onRouteDismissEnd:ex}));let ey=(0,i.useMemo)(()=>Array(H.i.MAX_RENDER_TRAJECTORY_LENGTH-1).fill(null).map((e,t)=>(0,o.jsx)(Z,{ref:z(t),layers:n,index:t,type:W.u$.TRIANGLE},(0,$.A)())),[]),ew=(0,i.useMemo)(()=>Array(H.i.MAX_RENDER_TRAJECTORY_LENGTH-1).fill(null).map((e,t)=>(0,o.jsx)(Z,{ref:k(t),layers:n,index:t,type:W.u$.CROSS,debug:0===t},(0,$.A)())),[]),eR=(0,i.useMemo)(()=>Array.from({length:3},(e,t)=>(0,o.jsx)(W.q1,{ref:I(t),layers:n,type:W.u$.SQUARE,enableOutline:!0,enableBackground:!1,enableDot:!0,lineColor:m.i.marker.color,lineOpacity:m.i.marker.opacity,dotColor:m.i.marker.color,dotOpacity:m.i.marker.opacity},`status-marker-${t}`)),[]),eC=(0,i.useMemo)(()=>Array.from({length:3},(e,t)=>(0,o.jsx)(W.Wi,{ref:O(t),layers:n,style:W.Sc.LINE,enableStartCap:!1,enableEndCap:!0,lineStartColor:et,lineEndColor:et,lineOpacity:m.i.connector.lineOpacity,startCapColor:en,startCapOpacity:m.i.connector.capOpacity,endCapColor:en,endCapOpacity:m.i.connector.capOpacity},`status-connector-${t}`)),[]),eb=(0,i.useMemo)(()=>Array.from({length:3},(e,t)=>(0,o.jsx)(X,{ref:D(t),layers:n},`status-label-${t}`)),[]);return(0,o.jsxs)(E,{ref:T,layers:n,name:P.eU.HOME_PORTRAIT_OVERLAY,children:[eR,eC,(0,o.jsx)("group",{ref:F,children:ey}),(0,o.jsx)("group",{ref:N,children:ew}),eb,Array.from({length:3},(e,t)=>(0,o.jsx)(Y,{index:t,connectorRefs:U,statusMarkerRefs:_,connectorProgressRef:er,onRegisterConnectorProgressSpring:es,onRegisterConnectorOpacitySpring:el,onRegisterMarkerOpacitySpring:eu},`portrait-overlay-status-spring-${t}`))]})}),ea=(0,i.forwardRef)((e,t)=>{let{layers:n,order:r,type:a,content:s,onSectionInitialized:u}=e,{fonts:c}=(0,i.useContext)(f.DM),d=(0,i.useRef)(null),p=(0,i.useRef)([]),h=(0,i.useCallback)(e=>t=>{p.current[e]=t},[]),g=(0,i.useMemo)(()=>{let e,t,n,r;return c.USansRgBd&&c.USansRgBd&&c.USansRgMd?("head"===a?(e=c.USansRgBd.fontFile,t=c.USansRgBd.fontTexture,n=28,r=56):"title"===a?(e=c.USansRgBd.fontFile,t=c.USansRgBd.fontTexture,n=16,r=32):(e=c.USansRgMd.fontFile,t=c.USansRgMd.fontTexture,n=10,r=66),{fontFile:e,fontTexture:t,fontSize:n,lineHeight:r}):null},[a,c.USansRgBd,c.USansRgBd,c.USansRgMd]),[v,x]=(0,i.useState)(new l.I9Y(0,0)),[y,w]=(0,i.useState)(0),R=e=>{let t=0;for(let n=0;n<p.current.length;n++){let r=p.current[n],a=0;"GlitchTextV1"===r.displayName?a=r.present(1e3,e):"ShuffleText"===r.displayName&&(a=r.present({min:4
1300,max:800},{min:e,max:e+800})),a>t&&(t=a)}return t},C=(e,t)=>{let n=0;for(let r=0;r<p.current.length;r++){let a=p.current[r],o=0;"GlitchTextV1"===a.displayName?o=a.dismiss(e,t):"ShuffleText"===a.displayName&&(o=a.dismiss(e,t)),o>n&&(n=o)}return n},b=()=>{for(let e=0;e<p.current.length;e++)p.current[e].abort()},S=()=>a,T=()=>d.current,P=()=>p.current[p.current.length-1],M=()=>s.join(": ")??"",A=()=>d.current.children,D=()=>d.current.position,_=()=>v,I=()=>g?g.fontSize/m.i.label.fontBaseLineHeight:0,E=()=>{let e=0,t=0,n=0,r=0;for(let a=0;a<p.current.length;a++){let o=p.current[a],i=o.getBoundingBoxSize(),s=o.getPosition();e>s.x&&(e=s.x),t>s.y&&(t=s.y),n<s.x+i.x&&(n=s.x+i.x),r<s.y+i.y&&(r=s.y+i.y)}x(new l.I9Y(n-e,r-t))};return(0,i.useEffect)(()=>()=>void(d.current?.geometry.dispose(),Array.isArray(d.current?.material)?d.current?.material.forEach(e=>e.dispose()):d.current?.material&&d.current?.material.dispose(),d.current?.children.forEach(e=>e.remove()),d.current?.remove()),[]),(0,i.useEffect)(()=>{0!==v.y&&u()},[v]),(0,i.useImperativeHandle)(t,()=>({...e,getLayoutType:S,getMesh:T,getText:P,getTextContent:M,getChildren:A,getPosition:D,getSize:_,getScale:I,setPositionY:w,present:R,dismiss:C,abort:b})),g&&(0,o.jsx)(o.Fragment,{children:"head"===a?(0,o.jsx)(W.PD,{ref:h(0),layers:n,position:new l.Pq0(0,y,0),text:s[0],fontFile:g.fontFile,fontTexture:g.fontTexture,fontSize:g.fontSize,labelWidth:1340,lineHeight:g.lineHeight,onInitialized:E}):"body"===a?(0,o.jsx)(W.oQ,{ref:h(0),layers:n,position:new l.Pq0(0,y,0),text:s[0],fontFile:g.fontFile,fontTexture:g.fontTexture,fontSize:g.fontSize,labelWidth:1340,lineHeight:g.lineHeight,colorMultiplier:.8,onInitialized:E}):"title"===a?(0,o.jsx)(W.PD,{ref:h(0),layers:n,position:new l.Pq0(0,y,0),text:s[0],fontFile:g.fontFile,fontTexture:g.fontTexture,fontSize:g.fontSize,labelWidth:1340,lineHeight:g.lineHeight,onInitialized:E}):"list"===a?(0,o.jsxs)("mesh",{ref:d,layers:n,position:new l.Pq0(0,y,0),children:[(0,o.jsx)(W.oQ,{ref:h(0),layers:n,position:new l.Pq0(0,0,0),text:s[0],fontFile:g.fontFile,fontTexture:g.fontTexture,fontSize:g.fontSize,labelWidth:900,lineHeight:g.lineHeight,onInitialized:()=>{}}),(0,o.jsx)(W.oQ,{ref:h(1),layers:n,position:new l.Pq0(75,0,0),text:s[1],fontFile:g.fontFile,fontTexture:g.fontTexture,fontSize:g.fontSize,labelWidth:1180,lineHeight:g.lineHeight,colorMultiplier:.8,onInitialized:E})]}):(0,o.jsx)(o.Fragment,{})})}),eo=(0,i.forwardRef)((e,t)=>{let{layers:n}=e,{routeTransitionConfig:r}=(0,i.useContext)(f.Pl),{primaryTexture:a}=(0,i.useContext)(f.Oo),{profileDataset:u,profileDatasetHolder:m,setIsProfileRendererReady:p,isTransitioningToNextDataset:h}=(0,i.useContext)(f.lq),{profileScene:g}=(0,i.useContext)(f.lq),{layoutMargins:v,layoutScale:x}=(0,i.useContext)(f.MQ),y=(0,i.useRef)(v);y.current=v;let R=(0,i.useRef)(x);R.current=x;let C=(0,i.useRef)(null),b=(0,i.useRef)(null),S=(0,i.useRef)(null),T=(0,i.useRef)([]),M=(0,i.useCallback)(e=>t=>{T.current[e]=t},[]),A=(0,i.useRef)(null),D=(0,s.C)(e=>e.pointer);(0,s.C)(e=>e.size);let[_,I]=(0,i.useState)(!1),E=(0,i.useRef)(!1),[U,O]=(0,i.useState)(new l.Pq0(0,0,0)),F=(0,i.useRef)({x:0*w.V$,y:6*w.V$}),N=(0,i.useRef)({x:0*w.V$,y:6*w.V$}),[L,z]=(0,i.useState)(),V=(0,c.zh)(()=>({from:{rx:b.current?.rotation.x??0,ry:b.current?.rotation.y??0},onChange:e=>{b.current?.rotation.set(e.value.rx,e.value.ry,0)}}),[])[1],k=()=>{if(!_||!C.current?.camera)return;S.current.scale.set(R.current,R.current,1);S.current.position.set(-U.x/2+0,-0,0),A.current.position.set(U.x/2+0,-U.y/2-0,-20);let e=C.current.camera,t=2*Math.tan(e.fov*(Math.PI/180)/2)*e.position.z,n=t*e.aspect,r=e.position.x-n/2+n*(y.current.left+20/(16/9*1280))+U.x/2,a=e.position.y+t/2-t*(y.current.top+20/1280),o=U.z/2;b.current.position.set(r,a,o)},G=()=>{if(!E.current)return 0;let e=0;for(let t=0;t<T.current.length;t++){let n=T.current[t];if(!n)return 0;n.abort();let r=n.present(100*t);r>e&&(e=r)}return A.current.present(e,0,c.le.easeInCubic),e},B=()=>{if(!E.current)return 0;let e=T.current.length,t=.9*r.current.dismissDuration,n=t/2,a=(t-n)/(e-1),o=0;for(let t=0;t<e;t++){let r=T.current[t];if(!r)return 0;let i=r.dismiss(n,(e-t-1)*a);i>o&&(o=i)}return A.current.dismiss(o,0,c.le.easeInCubic),o},j=e=>{if(!E.current)return;let t=F.current.x+D.y*N.current.x+N.current.x,n=F.current.y+-D.x*N.current.y+N.current.y;V.stop(!0),V.start({to:{rx:t,ry:n},config:{duration:400,easing:c.le.easeOutCubic}})};return(0,d._B)("magenta"),(0,i.useEffect)(()=>(g.current=C.current,()=>void(E.current=!1,p(!1))),[]),(0,i.useEffect)(()=>(window.addEventListener("mousemove",j),()=>window.removeEventListener("mousemove",j)),[]),(0,i.useEffect)(()=>{(()=>{if(!m.current)return;let e=0;z(m.current.sections.map((t,r)=>{let a="list"===t.type?t.content:[t.content];return(0,o.jsx)(ea,{layers:n,type:t.type,ref:M(e++),order:e,position:new l.Pq0(0,0,0),content:a,onSectionInitialized:()=>(()=>
13{if(!m.current)return;let e=0;for(let t=1;t<T.current.length;t++){let n=T.current[t-1],r=T.current[t];if(!n||!r)return;let a=n.getSize().y;if(0===a)return;let o=n.getLayoutType(),i=r.getLayoutType();e=e-a-("body"===i||"title"===i?16:"title"===o&&"list"===i?10:"list"===o&&"list"===i?5:10),r.setPositionY(e)}I(!0)})()},(0,$.A)())}))})()},[u]),(0,i.useEffect)(()=>{(()=>{if(!_)return;let e=b.current.rotation.clone();b.current.rotation.set(0,0,0),b.current.updateMatrixWorld(!0);let t=new l.NRn().setFromObject(b.current).getSize(new l.Pq0);b.current.rotation.copy(e),b.current.updateMatrixWorld(!0),A.current.setSize(t.x+20+20,t.y+20+20),O(t)})(),E.current=!0,p(!0)},[_]),(0,i.useEffect)(()=>{k()},[U]),(0,i.useLayoutEffect)(()=>{k()},[x,v]),(0,i.useEffect)(()=>{h?A.current.dismiss():A.current.present()},[h]),(0,i.useEffect)(()=>{a&&A.current.setDiffuseTexture(a)},[a]),(0,i.useImperativeHandle)(t,()=>({present:G,dismiss:B,sectionNodes:L||[]})),(0,o.jsx)(P.RG,{ref:C,layers:n,name:P.eU.HOME_PROFILE_CARD,children:(0,o.jsx)("group",{ref:b,layers:n,children:(0,o.jsxs)("group",{ref:S,layers:n,children:[L,(0,o.jsx)(W.pi,{ref:A,layers:n,blur:.25,cornerRadius:12,transparent:!0})]})})})});var ei=n(2488),es=n(4120);let el=(0,i.forwardRef)((e,t)=>{let{play:n,stop:r,fade:a,getNextSFXHomeTransitionsInKey:l,getNextSFXHomeTransitionsOutKey:u}=(0,i.useContext)(f.nE),{setIsNavigationVisible:c,setFooterVisible:m,configureNavigationAnimation:p,configureNavigationCamera:h,isIntersectingWithNavigation:g}=(0,i.useContext)(f._3),v=(0,i.useRef)(g);v.current=g;let{portraitDatasetHolder:x,shouldPresentContent:y,setIsTransitioningToNextDataset:w,isAllRendererReady:R}=(0,i.useContext)(f.lq),C=(0,i.useRef)(R);C.current=R;let b=(0,i.useRef)(null),S=(0,i.useRef)(null),T=(0,i.useRef)(null),P=(0,i.useRef)(null),{size:M}=(0,s.C)(),D=(0,i.useRef)(0),_=(0,i.useRef)(!1),I=(0,i.useRef)(null),E=(0,i.useRef)(null),U=(0,i.useRef)(null),O=(0,i.useRef)(null),F=()=>{let e=M.height/es.P;return{minX:M.width/2+70*e,maxX:M.width-70*e,minY:200*e,maxY:M.height}},N=e=>{!_.current||(e.stopPropagation(),v.current||(document.body.style.cursor="grabbing",D.current=1,S.current?.setIsMouseDown(1),T.current?.setIsMouseDown(1),c(!1),w(!0),n(l(),ei.z.sfx.home.transitionPortraitIn1,!1),a(L.uc.SFX_HOME_TRANSITION_PORTRAIT_LOOP_SUB,ei.z.sfx.home.transitionPortraitLoopSub,0,1e3,!0),a(L.uc.BGM_HOME_DRONE,0,0,200,!0),a(L.uc.BGM_HOME_CHORUS,0,0,200,!0)))},z=e=>{v.current||(_.current?D.current&&(document.body.style.cursor=1===D.current?"grabbing":"grab"):document.body.style.cursor="auto")},V=e=>{_.current&&0!==D.current&&(document.body.style.cursor="grab",D.current=0,S.current?.setIsMouseDown(0),T.current?.setIsMouseDown(0),I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{I.current=null,c(!0),w(!1)},300),C.current&&(x.current?.nextDataset(),S.current?.nextDataset(),T.current?.nextDataset()),n(u(),ei.z.sfx.home.transitionPortraitOut1,!1),a(L.uc.SFX_HOME_TRANSITION_PORTRAIT_LOOP_SUB,0,0,200,!0),a(L.uc.BGM_HOME_DRONE,ei.z.bgm.home.drone,0,2e3,!0),a(L.uc.BGM_HOME_CHORUS,ei.z.bgm.home.chorus,0,2e3,!0))},G=e=>{let t;_.current=!1,document.body.style.cursor="auto",t=b.current?.dismiss(),S.current?.dismiss(),T.current?.dismiss(),P.current?.dismiss(),c(!1),n(L.uc.SFX_TEXT_TRANSITION_1,ei.z.sfx.text.transition1,!0),O.current=setTimeout(()=>{O.current=null,r(L.uc.SFX_TEXT_TRANSITION_1)},t),a(L.uc.BGM_HOME_DRONE,0,0,4e3,!0),a(L.uc.BGM_HOME_CHORUS,0,0,4e3,!0)};return(0,d._B)("red"),(0,i.useEffect)(()=>{p(F())},[M]),(0,i.useEffect)(()=>{if(C.current){let e;e=b.current?.present(),S.current?.present(),T.current?.present(),P.current?.present(),n(L.uc.SFX_TEXT_TRANSITION_1,ei.z.sfx.text.transition1,!0),U.current=setTimeout(()=>{U.current=null,r(L.uc.SFX_TEXT_TRANSITION_1)},e),a(L.uc.BGM_HOME_DRONE,ei.z.bgm.home.drone,0,3e3,!0),a(L.uc.BGM_HOME_CHORUS,ei.z.bgm.home.chorus,0,2e3,!0),m(!0),h({eye:A.Sy.clone(),fov:A.pG}),p({animate:!0,showMarker:!0,parentLerpX:.04,parentLerpY:.04,parentLerpZ:.04,childLerpX:.08,childLerpY:.08,childLerpZ:.08,angleStart:30,angleStep:30,...F()}),E.current=setTimeout(()=>{E.current=null,c(!0),_.current=!0,document.body.style.cursor="grab"},2e3)}},[R]),(0,i.useEffect)(()=>(window.addEventListener("mousemove",z),window.addEventListener("mousedown",N),window.addEventListener("mouseup",V),()=>{window.removeEventListener("mousemove",z),window.removeEventListener("mousedown",N),window.removeEventListener("mouseup",V)}),[]),(0,i.useEffect)(()=>()=>{I.current&&clearTimeout(I.current),E.current&&clearTimeout(E.current);let e=null!==U.current||null!==O.current;U.current&&clearTimeout(U.current),O.current&&clearTimeout(O.current),e&&r(L.uc.SFX_TEXT_TRANSITION_1)},[]),(0,i.useImperativeHandle)(t,()=>
13({onRouteDismissStart:G})),y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(eo,{ref:b,layers:100}),(0,o.jsx)(k,{ref:S,layers:110}),(0,o.jsx)(j,{ref:T,layers:120}),(0,o.jsx)(er,{ref:P,layers:130})]})})},433:(e,t,n)=>{n.d(t,{Ch:()=>a,Pj:()=>s,V4:()=>l,eh:()=>c,nC:()=>o});let r={idle:"SEND",sending:"SENDING",success:"COMPLETE!",error:"FAILED!"},a=3e3,o=2e3,i=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function s(e){return r[e]}function l(e){let t={name:e.name.trim(),email:e.email.trim(),message:e.message.trim()},n={};if(t.name||(n.name="NAME IS REQUIRED"),t.email){var r;r=t.email,i.test(r)||(n.email="INVALID EMAIL FORMAT")}else n.email="EMAIL IS REQUIRED";return t.message||(n.message="MESSAGE IS REQUIRED"),{values:t,errors:n}}function u(e,t){return"success"===e?{state:"success",statusText:"",holdResultState:!0}:"network"===e?{state:"error",statusText:"NETWORK ERROR",holdResultState:!0}:{state:"error",statusText:t||"FAILED TO SEND",holdResultState:!0}}function c(e){return e.networkError?{completion:u("network"),analyticsStep:"submit_failure",errorType:"network"}:e.ok&&e.result?.success?{completion:u("success"),analyticsStep:"submit_success"}:{completion:u("failure",e.result?.message),analyticsStep:"submit_failure",errorType:429===e.status?"rate_limit":"http_error"}}},637:(e,t,n)=>{n.d(t,{n:()=>r});let r=()=>!!navigator.userAgent.match(/Safari/i)&&!navigator.userAgent.match(/Chrome/i)},904:(e,t,n)=>{n.d(t,{$Z:()=>c,bQ:()=>d,el:()=>f,yF:()=>u});var r,a,o=n(7973),i=n(6065),s=n(2466),l=n(3882),u=((r=u||{}).DEFAULT="DEFAULT",r.START="START",r.PROGRESS="PROGRESS",r.COMPLETE="COMPLETE",r.FAILED="FAILED",r),c=((a=c||{}).DEFAULT="DEFAULT",a.PRESENT="PRESENT",a.PROGRESS="PROGRESS",a.DISMISSING="DISMISSING",a.DISMISSED="DISMISSED",a.CANCELLING="CANCELLING",a.CANCELLED="CANCELLED",a);let f=(0,i.createContext)({shouldPerformLoading:!1,setShouldPerformLoading:()=>{},loadingFetcherState:{current:{state:"DEFAULT",progress:0,bytesTotal:0,bytesLoaded:0}},loadingAnimationState:{current:{state:"DEFAULT",progress:0}},registerLoadingFetcherEvent:e=>{},unregisterLoadingFetcherEvent:e=>{},registerLoadingAnimationEvent:e=>{},unregisterLoadingAnimationEvent:e=>{},notifyLoadingFetcherEvent:(e,t,n,r)=>{},notifyLoadingAnimationEvent:(e,t)=>{}}),d=e=>{let{children:t}=e,[n,r]=(0,i.useState)(!1),a=(0,i.useRef)({state:"DEFAULT",progress:0,bytesTotal:0,bytesLoaded:0}),u=(0,i.useRef)({state:"DEFAULT",progress:0}),c=(0,s.ml)(),d=(0,s.ml)(),m=c.register,p=c.unregister,h=d.register,g=d.unregister,v=(0,i.useCallback)((e,t)=>{(u.current.state!==e||u.current.progress!==t)&&(u.current={state:e,progress:t},c.emit(e,t))},[c]),x=(0,i.useCallback)((e,t,n,r)=>{(a.current.state!==e||a.current.progress!==t)&&(a.current={state:e,progress:t,bytesLoaded:n,bytesTotal:r},d.emit(e,t,n,r))},[d]),y=(0,i.useRef)(null);y.current=(e,t)=>{switch(e){case"DEFAULT":case"PRESENT":case"PROGRESS":case"DISMISSING":break;case"DISMISSED":case"CANCELLED":v("DEFAULT",0)}};let w=(0,i.useRef)(null);w.current=(e,t,n,r)=>{switch(e){case"DEFAULT":case"START":case"PROGRESS":case"FAILED":break;case"COMPLETE":x("DEFAULT",0,0,0)}};let R=(0,i.useRef)((e,t)=>{y.current(e,t)}).current,C=(0,i.useRef)((e,t,n,r)=>{w.current(e,t,n,r)}).current;(0,i.useEffect)(()=>((0,l.Rm)("purple","â","mounted"),m(R),h(C),()=>{(0,l.Rm)("purple","â","unmounted"),p(R),g(C)}),[]);let b=(0,i.useMemo)(()=>({shouldPerformLoading:n,setShouldPerformLoading:r,loadingFetcherState:a,loadingAnimationState:u,registerLoadingFetcherEvent:h,unregisterLoadingFetcherEvent:g,registerLoadingAnimationEvent:m,unregisterLoadingAnimationEvent:p,notifyLoadingFetcherEvent:x,notifyLoadingAnimationEvent:v}),[n,h,g,m,p,x,v]);return(0,o.jsx)(f.Provider,{value:b,children:t})}},1074:(e,t,n)=>{n.d(t,{u:()=>a});var r,a=((r=a||{}).BGM_AWARD_CHORUS="bgm_award_chorus",r.BGM_AWARD_DRONE="bgm_award_drone",r.BGM_CONTACT_CHORUS="bgm_contact_chorus",r.BGM_CONTACT_SIGNAL="bgm_contact_signal",r.BGM_ERROR_DRONE="bgm_error_drone",r.BGM_HOME_CHORUS="bgm_home_chorus",r.BGM_HOME_DRONE="bgm_home_drone",r.BGM_PRODUCT="bgm_product",r.BGM_SKETCH="bgm_sketch",r.SFX_AWARD_GLOBE_DRAG_C1="sfx_award_globe_drag_c1",r.SFX_AWARD_GLOBE_DRAG_D1="sfx_award_globe_drag_d1",r.SFX_AWARD_GLOBE_DRAG_E1="sfx_award_globe_drag_e1",r.SFX_AWARD_GLOBE_HOVER="sfx_award_globe_hover",r.SFX_AWARD_GLOBE_ROTATE_C1="sfx_award_globe_rotate_c1",r.SFX_AWARD_GLOBE_ROTATE_D1="sfx_award_globe_rotate_d1",r.SFX_AWARD_GLOBE_ROTATE_E1="sfx_award_globe_rotate_e1",r.SFX_CONTENT_MENU_CLICK="sfx_content_menu_click",r.SFX_CONTENT_MENU_HOVER="sfx_content_menu_hover",r.SFX_HOME_TRANSITION_PORTRAIT_IN_1="sfx_home_transition_portrait_in_1",r.SFX_HOME_TRANSITION_PORTRAIT_IN_2="sfx_home_transition_portrait_in_2",r.SFX_HOME_TRANSITION_PORTRAIT_IN_3="sfx_home_transition_portrait_in_3",r.SFX_HOME_TRANSITION_PORTRAIT_IN_MAIN="sfx_home_transition_portrait_in_main",r.SFX_HOME_TRANSITION_PORTRAIT_LOOP_MAIN="sfx_home_transition_portrait_loop_main",r.SFX_HOME_TRANSITION_PORTRAIT_LOOP_SUB="sfx_home_transition_portrait_loop_sub",r.SFX_HOME_TRANSITION_PORTRAIT_OUT_1="sfx_home_transition_portrait_out_1",r.SFX_HOME_TRANSITION_PORTRAIT_OUT_2="sfx_home_transition_portrait_out_2",r.SFX_HOME_TRANSITION_PORTRAIT_OUT_3="sfx_home_transition_portrait_out_3",r.SFX_HOME_TRANSITION_PORTRAIT_OUT_MAIN="sfx_home_transition_portrait_out_main",r.SFX_LOADING_DATA_PROCESS="sfx_loading_data_process",r.SFX_NAVIGATION_MAIN_CLICK="sfx_navigation_main_click",r.SFX_NAVIGATION_MAIN_HOVER_1="sfx_navigation_main_hover_1",r.SFX_NAVIGATION_MAIN_HOVER_2="sfx_navigation_main_hover_2",r.SFX_NAVIGATION_MAIN_HOVER_3="sfx_navigation_main_hover_3",r.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_1="sfx_navigation_main_transition_connector_1",r.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_2="sfx_navigation_main_transition_connector_2",r.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_3="sfx_navigation_main_transition_connector_3",r.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_4="sfx_navigation_main_transition_connector_4",r.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_5="sfx_navigation_main_transition_connector_5",r.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_6="sfx_navigation_main_transition_connector_6",r.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_7="sfx_navigation_main_transition_connector_7",r.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_8="sfx_navigation_main_transition_connector_8",r.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_1="sfx_navigation_main_transition_text_1",r.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_2="sfx_navigation_main_transition_text_2",r.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_3="sfx_navigation_main_transition_text_3",r.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_4="sfx_navigation_main_transition_text_4",r.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_5="sfx_navigation_main_transition_text_5",r.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_6="sfx_navigation_main_transition_text_6",r.SFX_NAVIGATION_SUB_CLICK="sfx_navigation_sub_click",r.SFX_NAVIGATION_SUB_HOVER="sfx_navigation_sub_hover",r.SFX_PRODUCT_FLOAT_CLOSE="sfx_product_float_close",r.SFX_PRODUCT_FLOAT_OPEN="sfx_product_float_open",r.SFX_PRODUCT_ITEM_CLICK="sfx_product_item_click",r.SFX_PRODUCT_ITEM_HOVER="sfx_product_item_hover",r.SFX_PRODUCT_PULSE="sfx_product_pulse",r.SFX_PRODUCT_IMAGE_TRANSITION_1="sfx_product_image_transition_1",r.SFX_PRODUCT_IMAGE_TRANSITION_2="sfx_product_image_transition_2",r.SFX_PRODUCT_IMAGE_TRANSITION_3="sfx_product_image_transition_3",r.SFX_TEXT_TRANSITION_1="sfx_text_transition_1",r.SFX_TEXT_TRANSITION_2="sfx_text_transition_2",r)}
13,1712:(e,t,n)=>{n.r(t),n.d(t,{default:()=>eY});var r=n(7973),a=n(6065),o=n(9618),i=n(3267),s=n(9841),l=n(4695),u=n(3698),c=n(2466);let f=512/192*100,d=100+512/192*100/2,m=[[0,21],[21,0],[0,-21],[-21,0]],p=new o.kn4,h=new o.kn4().makeScale(0,0,0),g=(e,t)=>{if(!e)return"";switch(t){case"pars_v":return"#include <common>\n#include <logdepthbuf_pars_vertex>\n";case"v":return"#include <logdepthbuf_vertex>\n";case"pars_f":return"#include <logdepthbuf_pars_fragment>\n";case"f":return"#include <logdepthbuf_fragment>\n"}},v=e=>({vert:`${g(e,"pars_v")}attribute float aOpacity; 14attribute vec3 aColorRGB; 15varying float vOpacity; 16varying vec3 vColorRGB; 17void main() { 18 vOpacity = aOpacity; 19 vColorRGB = aColorRGB; 20 gl_Position = projectionMatrix * modelViewMatrix * instanceMatrix * vec4(position, 1.0); 21 ${g(e,"v")}}`,frag:`${g(e,"pars_f")}varying float vOpacity; 22varying vec3 vColorRGB; 23void main() { 24 if (vOpacity < 0.005) discard; 25 gl_FragColor = vec4(vColorRGB, vOpacity); 26 ${g(e,"f")}}`}),x=e=>{let{maxAnnotations:t,vertsPerAnn:n,atlasCols:r,atlasRows:a,depthTest:i,logDepth:s}=e,l=t*n,u=3*t,c=new Float32Array(3*l),d=new Float32Array(4*l),m=new o.LoY;m.setAttribute("position",new o.THS(c,3).setUsage(o.Vnu)),m.setAttribute("aColor",new o.THS(d,4).setUsage(o.Vnu));let p={vert:`${g(s,"pars_v")}attribute vec4 aColor; 27varying vec4 vColor; 28void main() { 29 vColor = aColor; 30 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 31 ${g(s,"v")}}`,frag:`${g(s,"pars_f")}varying vec4 vColor; 32void main() { 33 if (vColor.a < 0.005) discard; 34 gl_FragColor = vColor; 35 ${g(s,"f")}}`},x=new o.BKk({vertexShader:p.vert,fragmentShader:p.frag,transparent:!0,depthTest:i,depthWrite:!1}),y=new o.DXC(m,x);y.frustumCulled=!1,y.renderOrder=2;let w=new o.tcD(5,24),R=new Float32Array(u),C=new Float32Array(3*u).fill(1),b=v(s),S=new o.BKk({vertexShader:b.vert,fragmentShader:b.frag,transparent:!0,depthTest:i,depthWrite:!1}),T=new o.ZLX(w,S,u);T.frustumCulled=!1,T.renderOrder=2,T.instanceMatrix.setUsage(o.Vnu),w.setAttribute("aOpacity",new o.uWO(R,1).setUsage(o.Vnu)),w.setAttribute("aColorRGB",new o.uWO(C,3).setUsage(o.Vnu));for(let e=0;e<u;e++)T.setMatrixAt(e,h);T.instanceMatrix.needsUpdate=!0;let P=document.createElement("canvas");P.width=512*r,P.height=192*a;let M=P.getContext("2d"),A=new o.GOR(P);A.minFilter=o.k6q,A.magFilter=o.k6q;let D=new o.bdM(f,100),_=new Float32Array(t),I=new Float32Array(2*t);for(let e=0;e<t;e++){let t=Math.floor(e/r);I[2*e]=e%r/r,I[2*e+1]=(a-1-t)/a}let E={vert:`${g(s,"pars_v")}attribute float aOpacity; 36attribute vec2 aUVOffset; 37varying float vOpacity; 38varying vec2 vAtlasUV; 39void main() { 40 vOpacity = aOpacity; 41 float uScale = ${(1/r).toFixed(8)}; 42 float vScale = ${(1/a).toFixed(8)}; 43 vAtlasUV = uv * vec2(uScale, vScale) + aUVOffset; 44 gl_Position = projectionMatrix * modelViewMatrix * instanceMatrix * vec4(position, 1.0); 45 ${g(s,"v")}}`,frag:`${g(s,"pars_f")}uniform sampler2D tAtlas; 46varying float vOpacity; 47varying vec2 vAtlasUV; 48void main() { 49 vec4 texel = texture2D(tAtlas, vAtlasUV); 50 float a = texel.a * vOpacity; 51 if (a < 0.005) discard; 52 gl_FragColor = vec4(texel.rgb, a); 53 ${g(s,"f")}}`},U=new o.BKk({vertexShader:E.vert,fragmentShader:E.frag,transparent:!0,depthTest:i,depthWrite:!1,side:o.$EB,uniforms:{tAtlas:new o.nc$(A)}}),O=new o.ZLX(D,U,t);O.frustumCulled=!1,O.renderOrder=2,O.instanceMatrix.setUsage(o.Vnu),D.setAttribute("aOpacity",new o.uWO(_,1).setUsage(o.Vnu)),D.setAttribute("aUVOffset",new o.uWO(I,2));for(let e=0;e<t;e++)O.setMatrixAt(e,h);return O.instanceMatrix.needsUpdate=!0,{lineGeo:m,linePositions:c,lineColors:d,lineMesh:y,circleGeo:w,circleMesh:T,circleOpacities:R,circleColors:C,labelGeo:D,labelMesh:O,labelOpacities:_,atlasCanvas:P,atlasCtx:M,atlasTexture:A,labelKeys:Array(t).fill(""),lineMat:x,circleMat:S,labelMat:U}},y=e=>{e.lineGeo.dispose(),e.lineMat.dispose(),e.circleGeo.dispose(),e.circleMat.dispose(),e.labelGeo.dispose(),e.labelMat.dispose(),e.atlasTexture.dispose()},w=function(e,t,n,r,a,o,i){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,u=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1;for(let c=0;c<4;c++){let f=n+0+2*c,d=f+1,p=m[c],h=m[(c+1)%4];e[3*f]=r+p[0],e[3*f+1]=a+p[1],e[3*f+2]=o,e[3*d]=r+h[0],e[3*d+1]=a+h[1],e[3*d+2]=o,t[4*f]=s,t[4*f+1]=l,t[4*f+2]=u,t[4*f+3]=i,t[4*d]=s,t[4*d+1]=l,t[4*d+2]=u,t[4*d+3]=i}},R=(e,t,n,r,a,o,i,s,l,u,c)=>{let f=n+r,d=f+1;e[3*f]=a,e[3*f+1]=o,e[3*f+2]=i,e[3*d]=a+s,e[3*d+1]=o+l,e[3*d+2]=i+u,t[4*f]=1,t[4*f+1]=1,t[4*f+2]=1,t[4*f+3]=c,t[4*d]=1,t[4*d+1]=1,t[4*d+2]=1,t[4*d+3]=c},C=(e,t,n,r,a,o)=>{let i=Math.floor(n/t),s=n%t*512,l=192*i;e.clearRect(s,l,512,192),e.fillStyle="white",e.textBaseline="top",e.textAlign="left";let u=Math.floor(53.760000000000005);e.font=`${u}px USansRgBd`,e.fillText(r,s+4,l+4);let c=Math.floor(38.400000000000006);e.font=`${c}px USansRgBd`,e.fillText(a,s+4,l+4+u+4),e.fillText(o,s+4,l+4+u+4+c+4)},b=[6e3,0,2e3],S=Math.ceil(11/6),T=(e,t)=>
53{let n=e-b[0],r=t-b[1],a=0-b[2];return Math.max(0,Math.min(1,1-(Math.sqrt(n*n+r*r+a*a)-7e3)/2e3))},P=0,M=new Map,A=new Set,D=(0,a.forwardRef)((e,t)=>{let{setIsSketchContourMapAnnotationRendererReady:n,holeManagerRef:o}=(0,a.useContext)(u.C),i=(0,a.useRef)([]),s=(0,a.useRef)(!1),f=(0,a.useRef)(null),m=(0,a.useRef)(null),h=(0,a.useRef)(0),[,g]=(0,l.zh)(()=>({from:{opacity:0},onChange:e=>{h.current=e.value.opacity}}));(0,a.useEffect)(()=>{let e=x({maxAnnotations:11,vertsPerAnn:10,atlasCols:6,atlasRows:S,depthTest:!1,logDepth:!1});return f.current.add(e.lineMesh,e.circleMesh,e.labelMesh),m.current=e,n(!0),()=>y(e)},[]),(0,c.Ql)((e,t)=>{if(!s.current)return;let n=o.current,r=m.current;if(!n||!r)return;let a=i.current,l=h.current;M.clear();for(let e=0;e<n.length;e++)M.set(n[e].id,n[e]);A.clear();for(let e=0;e<a.length;e++)A.add(a[e].holeId);for(let e=0;e<n.length;e++){let t=n[e];!A.has(t.id)&&a.length<11&&a.push({holeId:t.id,worldX:0,worldY:0,worldZ:0,nodeId:`H-${String(P++).padStart(3,"0")}`,labelKey:"",opacity:0,state:"entering"})}for(let e=a.length-1;e>=0;e--){let n=a[e],r=M.get(n.holeId);if(r){n.worldX=r.position.x,n.worldY=r.position.y,n.worldZ=340;let e=r.position.x>=-9e3&&r.position.x<=3e3&&r.position.y>=-2e3&&r.position.y<=2e3;e||"exiting"===n.state?e&&"exiting"===n.state&&(n.state="entering"):n.state="exiting"}"entering"===n.state?(n.opacity+=1.2*t,n.opacity>=1&&(n.opacity=1,n.state="alive")):"exiting"===n.state&&(n.opacity=Math.max(0,n.opacity-1.8*t))}let u=r.linePositions,c=r.lineColors;for(let e=0;e<11;e++){let t=10*e;if(e>=a.length){for(let e=0;e<10;e++)c[(t+e)*4+3]=0;continue}let n=a[e],r=T(n.worldX,n.worldY),o=n.opacity*l*r,i=n.worldZ+2;w(u,c,t,n.worldX,n.worldY,i,.6*o),R(u,c,t,8,n.worldX,n.worldY,n.worldZ,90,90,200,.4*o)}r.lineGeo.attributes.position.needsUpdate=!0,r.lineGeo.attributes.aColor.needsUpdate=!0;let f=r.circleOpacities;for(let e=0;e<11;e++){let t=3*e;if(e>=a.length){f[t+0]=0,f[t+1]=0,f[t+2]=0;continue}let n=a[e],o=T(n.worldX,n.worldY),i=.5*(n.opacity*l*o);p.makeTranslation(n.worldX,n.worldY,n.worldZ),r.circleMesh.setMatrixAt(t+0,p),r.circleMesh.setMatrixAt(t+1,p),f[t+0]=i,f[t+1]=i,p.makeTranslation(n.worldX+90,n.worldY+90,n.worldZ+200),r.circleMesh.setMatrixAt(t+2,p),f[t+2]=i}r.circleMesh.instanceMatrix.needsUpdate=!0,r.circleGeo.attributes.aOpacity.needsUpdate=!0;let g=r.labelOpacities,v=!1;for(let e=0;e<11;e++){if(e>=a.length){g[e]=0;continue}let t=a[e],n=T(t.worldX,t.worldY),o=t.opacity*l*n;p.makeTranslation(t.worldX+d,t.worldY+80,t.worldZ+200),r.labelMesh.setMatrixAt(e,p),g[e]=o;let i=M.get(t.holeId);if(i){let n=`${t.nodeId}|${i.currentRadius.toFixed(0)}|${i.distortion.amplitude.toFixed(2)}|${Math.round(t.worldX)}|${Math.round(t.worldY)}`;r.labelKeys[e]!==n&&(C(r.atlasCtx,6,e,t.nodeId,`R:${i.currentRadius.toFixed(0)} D:${i.distortion.amplitude.toFixed(2)}`,`X:${t.worldX.toFixed(0)} Y:${t.worldY.toFixed(0)}`),r.labelKeys[e]=n,v=!0)}}r.labelMesh.instanceMatrix.needsUpdate=!0,r.labelGeo.attributes.aOpacity.needsUpdate=!0,v&&(r.atlasTexture.needsUpdate=!0)});let v=()=>{s.current=!0,g.start({opacity:1,config:{duration:1500}})},b=()=>{g.start({opacity:0,config:{duration:300},onRest:()=>{s.current=!1,i.current=[]}})};return(0,a.useImperativeHandle)(t,()=>({present:v,dismiss:b})),(0,r.jsx)("group",{ref:f})});D.displayName="SketchContourMapAnnotationRenderer";var _=n(4188),I=n(4866),E=n(4357);let U=(0,a.forwardRef)((e,t)=>{let{layers:n,name:o,children:s}=e,l=(0,a.useRef)(null),u=(0,a.useRef)(null),f=(0,i.C)(e=>e.gl),d=(0,i.C)(e=>e.size);return(0,c._B)("blue"),(0,a.useEffect)(()=>{u.current&&(u.current.aspect=d.width/d.height),u.current&&u.current.updateProjectionMatrix()},[d]),(0,a.useImperativeHandle)(t,()=>({children:s,camera:u.current,renderer:f}),[]),(0,r.jsxs)(_.Yi,{ref:l,renderPriority:1e4,children:[(0,r.jsx)(I.u,{ref:u,layers:n,name:o,makeDefault:!0,position:E.Yv,fov:E.XF,far:1e4}),(0,r.jsx)("ambientLight",{intensity:1}),s]})}),O=new o.Pq0,F=new o.Pq0,N=(e,t)=>({azimuth:e.defaultAzimuth+-t.x*e.maxAzimuth,polar:e.defaultPolar+t.y*e.maxPolar}),L=(e,t,n,r,a,o,i)=>{let s=r+o,l=a+i;
53O.set(n*Math.cos(l)*Math.sin(s),n*Math.sin(l),n*Math.cos(l)*Math.cos(s)),O.add(t),e.position.copy(O),F.copy(t),e.lookAt(F)};var z=n(6987),V=n(2310),k=n(9753);let G=(0,a.forwardRef)((e,t)=>{let{children:n,layers:s,name:l,cameraFollowConfig:u,dofConfig:f}=e,{setPrimaryTexture:d}=(0,a.useContext)(V.Oo),m=(0,i.C)(e=>e.gl),p=(0,i.C)(e=>e.size),h=(0,a.useRef)(m).current,g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(!0),R=(0,a.useRef)(null),C=(0,a.useRef)(null),b=(0,a.useRef)(null),S=(0,a.useRef)(null),T=(0,a.useRef)(f.focus),P=(0,a.useRef)(f.aperture),M=(0,a.useRef)(f.maxBlur),A=(0,a.useRef)(f.rgbSplit.amount),D=(0,a.useRef)(f.rgbSplit.onsetMin),U=(0,a.useRef)(f.rgbSplit.onsetMax),O=(0,a.useRef)(f.rgbSplit.fringeMix);(e=>{let{camera:t,enabledRef:n,config:r}=e,i=(0,a.useRef)(new o.I9Y),s=(0,a.useRef)(0),l=(0,a.useRef)(0),u=(0,a.useRef)(0),f=(0,a.useRef)(0),d=(0,a.useRef)(0),m=(0,a.useRef)(new o.Pq0),p=(0,a.useRef)(r);p.current=r,(0,a.useLayoutEffect)(()=>{let e=p.current,n=e.lookAt;m.current.copy(n);let r=e.basePosition.x-n.x,a=e.basePosition.y-n.y,o=e.basePosition.z-n.z;u.current=Math.sqrt(r*r+a*a+o*o),f.current=Math.atan2(r,o),d.current=Math.asin(a/u.current);let c=N(e,i.current);s.current=c.azimuth,l.current=c.polar;let h=t.current;h&&L(h,m.current,u.current,f.current,d.current,s.current,l.current)},[t,r]);let h=(0,a.useCallback)(e=>{i.current.set(e.clientX/window.innerWidth*2-1,-(e.clientY/window.innerHeight*2-1))},[]);(0,a.useEffect)(()=>(window.addEventListener("mousemove",h),()=>{window.removeEventListener("mousemove",h)}),[h]),(0,c.Ql)(()=>{if(!n.current)return;let e=t.current;if(!e)return;let r=p.current,a=N(r,i.current);s.current+=(a.azimuth-s.current)*r.followSpeed,l.current+=(a.polar-l.current)*r.followSpeed,L(e,m.current,u.current,f.current,d.current,s.current,l.current)})})({camera:v,enabledRef:w,config:u}),(0,a.useEffect)(()=>{T.current=f.focus,P.current=f.aperture,M.current=f.maxBlur,A.current=f.rgbSplit.amount,D.current=f.rgbSplit.onsetMin,U.current=f.rgbSplit.onsetMax,O.current=f.rgbSplit.fringeMix},[f]);let F=(e,t,n,r)=>{};return(0,a.useEffect)(()=>{let e=Math.floor(p.width),t=Math.floor(p.height),n=new o.Pem(e,t);n.minFilter=o.k6q,n.magFilter=o.k6q,y.current=n,d(n);let r=Math.min(m.getPixelRatio(),1),a=Math.floor(p.width*r),i=Math.floor(p.height*r);R.current&&(R.current.depthTexture?.dispose(),R.current.dispose());let s=new o.VCu(a,i);s.type=o.bkx,s.format=o.zdS;let l=new o.nWS(a,i,{minFilter:o.k6q,magFilter:o.k6q,type:o.OUM,depthTexture:s});if(R.current=l,S.current?(S.current.uniforms.tColor.value=l.texture,S.current.uniforms.tDepth.value=s,S.current.uniforms.resolution.value.set(a,i)):S.current=new o.BKk({vertexShader:k.N,fragmentShader:"/**\n * Screen-space depth-of-field + chromatic aberration for Contact scene.\n *\n * Log depth linearization: pow(far + 1, stored) - 1\n * RGB shift: single-loop DOF with per-channel UV offset.\n * Shift amount scales with CoC so sharp regions stay clean.\n *\n * Optimised: merged 3 channel passes into single 3-tap loop.\n * Sharp zone early return skips blur for in-focus pixels.\n */\nprecision highp float;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform sampler2D tDepth;\n\nuniform float cameraNear;\nuniform float cameraFar;\nuniform float dofFocus;\nuniform float dofAperture;\nuniform float dofMaxBlur;\nuniform float rgbShiftAmount;\nuniform float rgbShiftOnsetMin;\nuniform float rgbShiftOnsetMax;\nuniform float rgbFringeMix;\nuniform vec2 resolution;\n\nvarying vec2 vUv;\n\nfloat linearizeLogDepth(float depth) {\n return pow(cameraFar + 1.0, depth) - 1.0;\n}\n\nfloat computeCoC(float linearDepth) {\n return clamp(abs(linearDepth - dofFocus) * dofAperture, 0.0, dofMaxBlur);\n}\n\nbool isBackground(float depth) {\n return depth > 0.999;\n}\n\nfloat rgbSplitLuma(vec3 color) {\n return dot(color, vec3(0.299, 0.587, 0.114));\n}\n\nfloat computeShiftRatio(float coc) {\n float cocRatio = coc / max(dofMaxBlur, 0.001);\n float onsetMax = max(rgbShiftOnsetMax, rgbShiftOnsetMin + 0.0001);\n return smoothstep(rgbShiftOnsetMin, onsetMax, cocRatio);\n}\n\nvec3 sampleDirectRgbSplit(vec2 uv, vec2 shiftVec) {\n vec2 rightUv = clamp(uv + shiftVec, 0.0, 1.0);\n vec2 leftUv = clamp(uv - shiftVec, 0.0, 1.0);\n\n vec3 center = texture2D(tColor, uv).rgb;\n vec3 right = texture2D(tColor, rightUv).rgb;\n vec3 left = texture2D(tColor, leftUv).rgb;\n\n return vec3(right.r, center.g, left.b);\n}\n\nvec3 sampleDofColor(vec2 uv) {\n vec2 texelSize = 1.0 / resolution;\n\n float centerDepth = texture2D(tDepth, uv).x;
53\n\n if (isBackground(centerDepth)) {\n return texture2D(tColor, uv).rgb;\n }\n\n float centerLinearDepth = linearizeLogDepth(centerDepth);\n float centerCoC = computeCoC(centerLinearDepth);\n\n /* Sharp zone early return: skip blur entirely for in-focus pixels */\n if (centerCoC < 0.0005) {\n return texture2D(tColor, uv).rgb;\n }\n\n float blurRadius = min(centerCoC * resolution.y, 16.0);\n\n vec3 colorSum = texture2D(tColor, uv).rgb;\n float weightSum = 1.0;\n\n /* 3-tap Poisson disc â single loop for all 3 channels */\n vec2 offsets[3];\n offsets[0] = vec2(-0.613, 0.617);\n offsets[1] = vec2(0.614, -0.293);\n offsets[2] = vec2(-0.541, -0.059);\n\n for (int i = 0; i < 3; i++) {\n vec2 tapOffset = offsets[i] * blurRadius * texelSize;\n vec2 tapUV = clamp(uv + tapOffset, 0.0, 1.0);\n\n float tapDepth = texture2D(tDepth, tapUV).x;\n if (!isBackground(tapDepth)) {\n float tapCoC = computeCoC(linearizeLogDepth(tapDepth));\n float weight = smoothstep(0.0, 1.0, tapCoC / max(centerCoC, 0.001));\n\n colorSum += texture2D(tColor, tapUV).rgb * weight;\n weightSum += weight;\n }\n }\n\n return colorSum / weightSum;\n}\n\nvec3 sampleDofDirectRgbSplit(vec2 uv, vec2 shiftVec) {\n vec2 texelSize = 1.0 / resolution;\n\n float centerDepth = texture2D(tDepth, uv).x;\n\n if (isBackground(centerDepth)) {\n return texture2D(tColor, uv).rgb;\n }\n\n float centerLinearDepth = linearizeLogDepth(centerDepth);\n float centerCoC = computeCoC(centerLinearDepth);\n\n if (centerCoC < 0.0005) {\n return texture2D(tColor, uv).rgb;\n }\n\n float blurRadius = min(centerCoC * resolution.y, 16.0);\n\n vec3 colorSum = sampleDirectRgbSplit(uv, shiftVec);\n float weightSum = 1.0;\n\n vec2 offsets[3];\n offsets[0] = vec2(-0.613, 0.617);\n offsets[1] = vec2(0.614, -0.293);\n offsets[2] = vec2(-0.541, -0.059);\n\n for (int i = 0; i < 3; i++) {\n vec2 tapOffset = offsets[i] * blurRadius * texelSize;\n vec2 tapUV = clamp(uv + tapOffset, 0.0, 1.0);\n\n float tapDepth = texture2D(tDepth, tapUV).x;\n if (!isBackground(tapDepth)) {\n float tapCoC = computeCoC(linearizeLogDepth(tapDepth));\n float weight = smoothstep(0.0, 1.0, tapCoC / max(centerCoC, 0.001));\n\n colorSum += sampleDirectRgbSplit(tapUV, shiftVec) * weight;\n weightSum += weight;\n }\n }\n\n return colorSum / weightSum;\n}\n\nvec3 applyAdditiveRgbFringe(vec2 uv, vec3 baseColor, vec2 shiftVec, float shiftRatio) {\n vec3 rightColor = sampleDofColor(clamp(uv + shiftVec, 0.0, 1.0));\n vec3 leftColor = sampleDofColor(clamp(uv - shiftVec, 0.0, 1.0));\n float baseLum = rgbSplitLuma(baseColor);\n float rightLum = rgbSplitLuma(rightColor);\n float leftLum = rgbSplitLuma(leftColor);\n float redFringe = max(rightLum - max(baseLum, leftLum), 0.0);\n float blueFringe = max(leftLum - max(baseLum, rightLum), 0.0);\n vec3 fringe = vec3(redFringe, 0.0, blueFringe) * shiftRatio;\n return min(baseColor + fringe, vec3(1.0));\n}\n\nvoid main() {\n float centerDepth = texture2D(tDepth, vUv).x;\n\n if (isBackground(centerDepth)) {\n gl_FragColor = texture2D(tColor, vUv);\n return;\n }\n\n float centerLinearDepth = linearizeLogDepth(centerDepth);\n float centerCoC = computeCoC(centerLinearDepth);\n float shiftRatio = computeShiftRatio(centerCoC);\n float shift = rgbShiftAmount * shiftRatio;\n vec2 shiftVec = vec2(shift, 0.0);\n\n if (shift < 0.000001) {\n gl_FragColor = vec4(sampleDofColor(vUv), 1.0);\n return;\n }\n\n if (rgbFringeMix < 0.0001) {\n gl_FragColor = vec4(sampleDofDirectRgbSplit(vUv, shiftVec), 1.0);\n return;\n }\n\n vec3 baseColor = sampleDofColor(vUv);\n vec3 fringeColor = applyAdditiveRgbFringe(vUv, baseColor, shiftVec, shiftRatio);\n\n if (rgbFringeMix > 0.9999) {\n gl_FragColor = vec4(fringeColor, 1.0);\n return;\n }\n\n vec3 directColor = sampleDofDirectRgbSplit(vUv, shiftVec);\n gl_FragColor = vec4(mix(directColor, fringeColor, rgbFringeMix), 1.0);\n}\n",uniforms:{tColor:new o.nc$(l.texture),tDepth:new o.nc$(s),cameraNear:new o.nc$(500),cameraFar:new o.nc$(2e4),dofFocus:new o.nc$(T.current),dofAperture:new o.nc$(P.current),dofMaxBlur:new o.nc$(M.current),resolution:new o.nc$(new o.I9Y(a,i)),rgbShiftAmount:new o.nc$(A.current),rgbShiftOnsetMin:new o.nc$(D.current),rgbShiftOnsetMax:new o.nc$(U.current),rgbFringeMix:new o.nc$(O.current)},depthTest:!1,depthWrite:!1}
53),!C.current){C.current=new o.Z58,b.current=new o.qUd(-1,1,1,-1,0,1);let e=new o.eaF(new o.bdM(2,2),S.current);e.frustumCulled=!1,C.current.add(e)}return()=>{d(null),n.dispose(),y.current=null,R.current&&(R.current.depthTexture?.dispose(),R.current.dispose(),R.current=null),S.current&&(S.current.dispose(),S.current=null),C.current&&(C.current.traverse(e=>{e.isMesh&&e.geometry.dispose()}),C.current=null),b.current=null}},[p.width,p.height]),(0,a.useEffect)(()=>{v.current&&(v.current.aspect=p.width/p.height),v.current&&v.current.updateProjectionMatrix()},[p]),(0,i.D)(()=>{if(!g.current||!v.current||!R.current||!S.current)return;let e=g.current.hudScene,t=v.current;S.current.uniforms.dofFocus.value=T.current,S.current.uniforms.dofAperture.value=P.current,S.current.uniforms.dofMaxBlur.value=M.current,S.current.uniforms.cameraNear.value=t.near,S.current.uniforms.cameraFar.value=t.far,S.current.uniforms.rgbShiftAmount.value=A.current,S.current.uniforms.rgbShiftOnsetMin.value=D.current,S.current.uniforms.rgbShiftOnsetMax.value=U.current,S.current.uniforms.rgbFringeMix.value=O.current;let n=h.autoClear;h.autoClear=!1,h.setRenderTarget(R.current),h.clearColor(),h.clearDepth(),h.render(e,t),h.setRenderTarget(null),h.clearDepth(),h.render(C.current,b.current),h.autoClear=n,y.current&&h.copyFramebufferToTexture(y.current)},2),(0,a.useImperativeHandle)(t,()=>({children:n,camera:v.current,ambientLight:x.current,setFocus:F})),(0,r.jsxs)(_.Yi,{ref:g,renderPriority:2,renderEnabled:!1,backgroundColor:z.i.main.bgColor,children:[(0,r.jsx)(I.u,{ref:v,layers:s,name:l,makeDefault:!0,position:u.basePosition,fov:E.J1,near:500,far:2e4}),(0,r.jsx)("ambientLight",{ref:x,layers:s,name:l,intensity:1}),(0,r.jsx)("directionalLight",{layers:s,position:[-1,1,.5],intensity:1}),n]})});var B=n(7861);let j=e=>{let t=(0,a.useContext)(u.C),n=(0,a.useRef)(t.sceneCamera).current;(0,a.useEffect)(()=>{let t=e.current?.camera??null;if(t)return n.current=t,()=>{n.current===t&&(n.current=null)}},[n,e])},$=(0,a.forwardRef)((e,t)=>{let n=(0,a.useRef)(null),i=(0,a.useMemo)(()=>({uTime:{value:0},uNoiseScale:{value:4e-4},uNoiseAmplitude:{value:400},uContourCount:{value:20},uLineHalfWidth:{value:1},uHoleCount:{value:0},uHolePositions:{value:Array.from({length:11},()=>new o.I9Y)},uHoleRadii:{value:new Float32Array(11)},uHoleHeights:{value:new Float32Array(11)},uHoleDistortions:{value:Array.from({length:11},()=>new o.Pq0)},uLineWidthPeakMultiplier:{value:4},uHillSigmaFactor:{value:1.5},uBaseNoiseWeight:{value:.25},uHoleCutoffHeight:{value:.85},uFadeCenter:{value:new o.Pq0(...b)},uDepthMin:{value:0},uDepthMax:{value:14e3},uOpacity:{value:1}}),[]);return(0,a.useImperativeHandle)(t,()=>({material:n.current})),(0,r.jsx)("shaderMaterial",{ref:n,vertexShader:"/* ââ Contact Contour Map Vertex Shader ââ */\n\n#define MAX_HOLES 11\n\nuniform float uTime;\nuniform float uNoiseScale;\nuniform float uNoiseAmplitude;\nuniform int uHoleCount;\nuniform vec2 uHolePositions[MAX_HOLES];\nuniform float uHoleRadii[MAX_HOLES];\nuniform float uHoleHeights[MAX_HOLES];\nuniform vec3 uHoleDistortions[MAX_HOLES]; /* x=amplitude, y=frequency, z=phase */\nuniform float uHillSigmaFactor;\nuniform float uBaseNoiseWeight;\n\nvarying vec3 vWorldPos;\nvarying float vRawHeight;\n\n#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/* ââ Simplex 3D Noise (Ashima Arts) ââ */\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289((x * 34.0 + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v) {\n const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n vec3 i = floor(v + dot(v, C.yyy));\n vec3 x0 = v - i + dot(i, C.xxx);\n\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min(g.xyz, l.zxy);\n vec3 i2 = max(g.xyz, l.zxy);\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy;\n vec3 x3 = x0 - D.yyy;\n\n i = mod289(i);\n vec4 p = permute(permute(permute(i.z + vec4(0.0, i1.z, i2.z, 1.0)) + i.y + vec4(0.0, i1.y, i2.y, 1.0)) + i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\n float n_ = 0.142857142857;\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z);\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_);\n\n vec4 x = x_ * ns.x + ns.yyyy;\n vec4 y = y_ * ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4(x.xy, y.xy);\n vec4 b1 = vec4(x.zw, y.zw);\n\n vec4 s0 = floor(b0) * 2.0 + 1.0;\n vec4 s1 = floor(b1) * 2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3(a0.xy, h.x);\n vec3 p1 = vec3(a0.zw, h.y);\n vec3 p2 = vec3(a1.xy, h.z);\n vec3 p3 = vec3(a1.zw, h.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n m = m * m;\n return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n\n/* ââ FBM (Fractional Brownian Motion) ââ */\nfloat fbm(vec3 p, int octaves) {\n float value = 0.0;\n float amplitude = 1.0;\n float frequency = 1.0;\n float totalAmplitude = 0.0;\n for (int i = 0; i < 3;
53 i++) {\n if (i >= octaves) break;\n value += amplitude * snoise(p * frequency);\n totalAmplitude += amplitude;\n amplitude *= 0.5;\n frequency *= 2.0;\n }\n return value / totalAmplitude;\n}\n\nvoid main() {\n vec3 pos = position;\n\n /* Use world-space XY for noise (matching fragment shader's vWorldPos.xy) */\n vec3 worldXY = (modelMatrix * vec4(pos, 1.0)).xyz;\n\n float t = uTime * 0.05;\n vec3 noiseCoord = vec3(worldXY.x * uNoiseScale, worldXY.y * uNoiseScale, t);\n float baseNoise = fbm(noiseCoord, 3) * 0.5 + 0.5;\n\n /* Gaussian hills from holes â same computation as fragment shader */\n float hillHeight = 0.0;\n for (int i = 0; i < MAX_HOLES; i++) {\n if (i >= uHoleCount) break;\n vec2 d = worldXY.xy - uHolePositions[i];\n float angle = atan(d.y, d.x);\n float baseSigma = uHoleRadii[i] * uHillSigmaFactor;\n /* Soft blob distortion: 2 low-frequency harmonics with slow morphing */\n float seed = uHoleDistortions[i].z;\n float morphT = uTime * 0.3;\n float distort = uHoleDistortions[i].x * (0.6 * sin(angle * 2.0 + seed + morphT) + 0.4 * sin(angle * 3.0 + seed * 2.4 + morphT * 0.6));\n float sigma = baseSigma * (1.0 + distort);\n float dist2 = dot(d, d);\n float g = dist2 / (2.0 * sigma * sigma);\n hillHeight += uHoleHeights[i] * exp(-pow(g, 1.5));\n }\n\n /* Suppress base noise near peaks to keep holes nearly circular */\n float noiseSuppress = 1.0 - smoothstep(0.2, 0.6, hillHeight);\n float rawHeight = baseNoise * uBaseNoiseWeight * noiseSuppress + hillHeight;\n\n /* Apply Z displacement from full height field */\n pos.z += rawHeight * uNoiseAmplitude;\n\n vRawHeight = rawHeight;\n vWorldPos = (modelMatrix * vec4(pos, 1.0)).xyz;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/* ââ Contact Contour Map Fragment Shader ââ */\n\n#include <logdepthbuf_pars_fragment>\n\nuniform float uContourCount;\nuniform float uLineHalfWidth;\nuniform float uLineWidthPeakMultiplier;\nuniform float uHoleCutoffHeight;\nuniform vec3 uFadeCenter;\nuniform float uDepthMin;\nuniform float uDepthMax;\nuniform float uOpacity;\n\nvarying vec3 vWorldPos;\nvarying float vRawHeight; /* interpolated height field from vertex shader */\n\nvoid main() {\n /* ââ Screen-space anti-aliased hole edge ââ\n fwidth gives per-pixel height change, so the fade is always 1-2px wide\n regardless of mesh density â no triangle-edge jaggies. */\n float distToCutoff = uHoleCutoffHeight - vRawHeight;\n float edgeAA = fwidth(vRawHeight) * 1.5;\n float edgeFade = smoothstep(0.0, edgeAA, distToCutoff);\n if (edgeFade < 0.01) discard;\n\n /* ââ Redistribute contour density: pow(0.3) strongly compresses peaks, expands valleys ââ */\n float fragHeight = pow(vRawHeight / uHoleCutoffHeight, 0.3) * uHoleCutoffHeight;\n\n /* ââ Contour lines (pixel-normalized, only the top contour is thicker) ââ */\n float scaledHeight = fragHeight * uContourCount;\n float topContour = floor(uHoleCutoffHeight * uContourCount);\n float nearestContour = floor(scaledHeight + 0.5);\n bool isPeakLine = abs(nearestContour - topContour) < 0.5;\n float lineHalfW = isPeakLine ? uLineHalfWidth * uLineWidthPeakMultiplier : uLineHalfWidth;\n float fw = length(vec2(dFdx(scaledHeight), dFdy(scaledHeight)));\n float contour = fract(scaledHeight);\n float distToLine = min(contour, 1.0 - contour) / max(fw, 0.0001);\n float line = 1.0 - smoothstep(lineHalfW - 0.5, lineHalfW + 0.5, distToLine);\n\n /* Suppress regular contour lines near the peak to prevent dense clustering */\n if (!isPeakLine) {\n float distToTopContour = abs(scaledHeight - topContour);\n line *= smoothstep(0.3, 0.9, distToTopContour);\n }\n\n /* ââ Height gradient (subtle â depth fade handles main dimming) ââ */\n float brightness = mix(0.8, 1.4, fragHeight);\n\n /* ââ Depth fade ââ */\n vec3 diff = vWorldPos - uFadeCenter;\n float depth = length(diff);\n float depthNorm = clamp((depth - uDepthMin) / (uDepthMax - uDepthMin), 0.0, 1.0);\n float fade = 1.0 - depthNorm;\n\n /* ââ Final color ââ */\n float alpha = line * brightness * fade * uOpacity * edgeFade;\n if (alpha < 0.01) discard;\n\n gl_FragColor = vec4(vec3(brightness * fade), alpha);\n\n #include <logdepthbuf_fragment>\n}\n",uniforms:i,transparent:!0,depthTest:!0,depthWrite:!1,depthFunc:o.xSv,side:o.hB5})});$.displayName="SketchContourMapMaterial";let W=0,H=(e,t)=>
53e+Math.random()*(t-e),Y=(e,t,n)=>e+(t-e)*n,X=()=>{let e=H(150,400);return{id:W++,position:{x:H(-8600,2600),y:H(-1600,1600)},velocity:{x:0,y:0},targetRadius:e,currentRadius:e,distortion:{amplitude:H(.15,.25),frequency:Math.round(H(2,3)),phase:Math.random()*Math.PI*2},peakHeight:H(.9,1),state:"alive",opacity:1,heading:Math.random()*Math.PI*2,headingSeed:1e3*Math.random(),breathingPhase:Math.random()*Math.PI*2}},q=new o.Pq0,Z=(e,t)=>{e.uHoleCount.value=t.length;for(let n=0;n<t.length&&n<11;n++){let r=t[n];e.uHolePositions.value[n].set(r.position.x,r.position.y),e.uHoleRadii.value[n]=r.currentRadius,e.uHoleHeights.value[n]=r.peakHeight,e.uHoleDistortions.value[n].set(r.distortion.amplitude,r.distortion.frequency,r.distortion.phase)}},Q=2/3,K=1/3,J=(0,a.forwardRef)((e,t)=>{let{setIsSketchContourMapRendererReady:n,sceneCamera:i,holeManagerRef:s}=(0,a.useContext)(u.C),f=(0,a.useRef)(s).current,d=(0,a.useRef)(null),m=(0,a.useRef)(null),p=(0,a.useRef)(!1),h=(0,a.useRef)(0),g=(0,a.useRef)(!1),v=(0,a.useMemo)(()=>new o.bdM(12e3,4e3,512,256),[]),x=(0,a.useMemo)(()=>({uTime:{value:0},uNoiseScale:{value:4e-4},uNoiseAmplitude:{value:400},uHoleCount:{value:0},uHolePositions:{value:Array.from({length:11},()=>new o.I9Y)},uHoleRadii:{value:new Float32Array(11)},uHoleHeights:{value:new Float32Array(11)},uHoleDistortions:{value:Array.from({length:11},()=>new o.Pq0)},uHillSigmaFactor:{value:1.5},uBaseNoiseWeight:{value:.25}}),[]),{holesRef:y,update:w}=(()=>{let e=(0,a.useRef)([]);if(0===e.current.length)for(let t=0;t<11;t++)e.current.push(X());let t=(0,a.useCallback)((t,n)=>{let r=e.current;for(let e of r){e.heading=Math.sin(e.headingSeed+.037*n)*Math.PI+Math.sin(2.71*e.headingSeed+.023*n)*Math.PI*.7+Math.sin(.41*e.headingSeed+.013*n)*Math.PI*.5;let r=150*Math.cos(e.heading),a=150*Math.sin(e.heading),o=1-Math.exp(-5*t);e.velocity.x=Y(e.velocity.x,r,o),e.velocity.y=Y(e.velocity.y,a,o)}for(let e=0;e<r.length;e++){let n=r[e],a=1.5*n.currentRadius;for(let o=e+1;o<r.length;o++){let e=r[o],i=(a+1.5*e.currentRadius)*1.5,s=n.position.x-e.position.x,l=n.position.y-e.position.y,u=Math.sqrt(s*s+l*l);if(u<3e3&&u>.01){let r=Math.max(0,1-(u-i)/(3e3-i)),a=400*r*r*r,o=s/u,c=l/u;n.velocity.x+=o*a*t,n.velocity.y+=c*a*t,e.velocity.x-=o*a*t,e.velocity.y-=c*a*t}}}for(let e of r){let n=e.position.x- -9e3,r=3e3-e.position.x,a=e.position.y+2e3,o=2e3-e.position.y;if(n<1200){let r=1-n/1200;e.velocity.x+=2e3*r*r*t}if(r<1200){let n=1-r/1200;e.velocity.x-=2e3*n*n*t}if(a<1200){let n=1-a/1200;e.velocity.y+=2e3*n*n*t}if(o<1200){let n=1-o/1200;e.velocity.y-=2e3*n*n*t}}let a=Math.exp(-1.2*t);for(let e of r)e.velocity.x*=a,e.velocity.y*=a;for(let e of r){e.position.x+=e.velocity.x*t,e.position.y+=e.velocity.y*t;let n=.5*e.currentRadius;e.position.x=Math.max(-9e3+n,Math.min(3e3-n,e.position.x)),e.position.y=Math.max(-2e3+n,Math.min(2e3-n,e.position.y))}for(let e=0;e<r.length;e++){let n=r[e],a=1.5*n.currentRadius;for(let o=e+1;o<r.length;o++){let e=r[o],i=(a+1.5*e.currentRadius)*1.5,s=n.position.x-e.position.x,l=n.position.y-e.position.y,u=Math.sqrt(s*s+l*l);if(u<i&&u>.01){let r=(i-u)*(1-Math.exp(-5*t)),a=s/u,o=l/u;n.position.x+=a*r,n.position.y+=o*r,e.position.x-=a*r,e.position.y-=o*r}}}for(let e of r)if("entering"===e.state&&(e.currentRadius=Y(e.currentRadius,e.targetRadius,.02),e.opacity=Y(e.opacity,1,.02),e.currentRadius>.98*e.targetRadius&&(e.state="alive",e.opacity=1)),"alive"===e.state){let t=1+.08*Math.sin(n+e.breathingPhase);e.currentRadius=e.targetRadius*t}for(;r.length<11;)r.push(X())},[]);return{holesRef:e,update:t}})(),R=(0,a.useRef)(y).current,[,C]=(0,l.zh)(()=>({from:{opacity:0}
53,onChange:e=>{h.current=e.value.opacity}}));(0,a.useEffect)(()=>(n(!0),()=>{v.dispose()}),[]),(0,c.Ql)((e,t)=>{let n=performance.now()/1e3;if(w(t,n),R.current.length>0&&i.current){let e=R.current[0],t=i.current;q.set(2*Q-1,-(2*K-1),.5).unproject(t);let r=q.sub(t.position).normalize(),a=-t.position.z/r.z,o=t.position.x+a*r.x,s=t.position.y+a*r.y,l=30*(Math.sin(.7*n+1.3)+.6*Math.sin(.31*n)),u=30*(Math.sin(.53*n+2.7)+.6*Math.sin(.23*n));g.current?(e.position.x+=(o+l-e.position.x)*.03,e.position.y+=(s+u-e.position.y)*.03):(e.position.x=o+l,e.position.y=s+u,g.current=!0),e.velocity.x=0,e.velocity.y=0}f.current=R.current;let r=R.current,a=d.current;if(a){let e=a.material.uniforms;e.uTime.value=n,e.uOpacity.value=h.current,Z(e,r)}let o=m.current;o&&(o.uniforms.uTime.value=n,Z(o.uniforms,r))});let b=()=>{p.current=!0,C.start({from:{opacity:0},to:{opacity:1},config:{duration:2e3}})},S=()=>{C.start({opacity:0,config:{duration:300},onRest:()=>{p.current=!1}})};return(0,a.useImperativeHandle)(t,()=>({present:b,dismiss:S})),(0,r.jsxs)("group",{position:[-3e3,0,0],children:[(0,r.jsx)("mesh",{geometry:v,renderOrder:0,children:(0,r.jsx)("shaderMaterial",{ref:m,vertexShader:"/* ââ Contact Contour Map Depth Vertex Shader ââ */\n\n#define MAX_HOLES 11\n\nuniform float uTime;\nuniform float uNoiseScale;\nuniform float uNoiseAmplitude;\nuniform int uHoleCount;\nuniform vec2 uHolePositions[MAX_HOLES];\nuniform float uHoleRadii[MAX_HOLES];\nuniform float uHoleHeights[MAX_HOLES];\nuniform vec3 uHoleDistortions[MAX_HOLES]; /* x=amplitude, y=frequency, z=phase */\nuniform float uHillSigmaFactor;\nuniform float uBaseNoiseWeight;\n\n#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/* ââ Simplex 3D Noise (Ashima Arts) ââ */\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289((x * 34.0 + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v) {\n const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n vec3 i = floor(v + dot(v, C.yyy));\n vec3 x0 = v - i + dot(i, C.xxx);\n\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min(g.xyz, l.zxy);\n vec3 i2 = max(g.xyz, l.zxy);\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy;\n vec3 x3 = x0 - D.yyy;\n\n i = mod289(i);\n vec4 p = permute(permute(permute(i.z + vec4(0.0, i1.z, i2.z, 1.0)) + i.y + vec4(0.0, i1.y, i2.y, 1.0)) + i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\n float n_ = 0.142857142857;\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z);\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_);\n\n vec4 x = x_ * ns.x + ns.yyyy;\n vec4 y = y_ * ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4(x.xy, y.xy);\n vec4 b1 = vec4(x.zw, y.zw);\n\n vec4 s0 = floor(b0) * 2.0 + 1.0;\n vec4 s1 = floor(b1) * 2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3(a0.xy, h.x);\n vec3 p1 = vec3(a0.zw, h.y);\n vec3 p2 = vec3(a1.xy, h.z);\n vec3 p3 = vec3(a1.zw, h.w);\n\n vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n m = m * m;\n return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n\n/* ââ FBM (Fractional Brownian Motion) ââ */\nfloat fbm(vec3 p, int octaves) {\n float value = 0.0;\n float amplitude = 1.0;\n float frequency = 1.0;\n float totalAmplitude = 0.0;\n for (int i = 0; i < 3; i++) {\n if (i >= octaves) break;\n value += amplitude * snoise(p * frequency);\n totalAmplitude += amplitude;\n amplitude *= 0.5;\n frequency *= 2.0;\n }\n return value / totalAmplitude;\n}\n\nvoid main() {\n vec3 pos = position;\n\n /* Use world-space XY for noise (matching fragment shader's vWorldPos.xy) */\n vec3 worldXY = (modelMatrix * vec4(pos, 1.0
53)).xyz;\n\n float t = uTime * 0.05;\n vec3 noiseCoord = vec3(worldXY.x * uNoiseScale, worldXY.y * uNoiseScale, t);\n float baseNoise = fbm(noiseCoord, 3) * 0.5 + 0.5;\n\n /* Gaussian hills from holes â same computation as main vertex shader */\n float hillHeight = 0.0;\n for (int i = 0; i < MAX_HOLES; i++) {\n if (i >= uHoleCount) break;\n vec2 d = worldXY.xy - uHolePositions[i];\n float angle = atan(d.y, d.x);\n float baseSigma = uHoleRadii[i] * uHillSigmaFactor;\n /* Soft blob distortion: 2 low-frequency harmonics with slow morphing */\n float seed = uHoleDistortions[i].z;\n float morphT = uTime * 0.3;\n float distort = uHoleDistortions[i].x * (0.6 * sin(angle * 2.0 + seed + morphT) + 0.4 * sin(angle * 3.0 + seed * 2.4 + morphT * 0.6));\n float sigma = baseSigma * (1.0 + distort);\n float dist2 = dot(d, d);\n float g = dist2 / (2.0 * sigma * sigma);\n hillHeight += uHoleHeights[i] * exp(-pow(g, 1.5));\n }\n\n /* Suppress base noise near peaks */\n float noiseSuppress = 1.0 - smoothstep(0.2, 0.6, hillHeight);\n float rawHeight = baseNoise * uBaseNoiseWeight * noiseSuppress + hillHeight;\n\n /* Apply Z displacement from full height field */\n pos.z += rawHeight * uNoiseAmplitude;\n\n /* Small offset behind surface to avoid z-fighting with contour surface */\n pos.z -= 0.5;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/* ââ Contact Contour Map Depth Fragment Shader ââ */\n\n#include <logdepthbuf_pars_fragment>\n\nvoid main() {\n #include <logdepthbuf_fragment>\n}\n",uniforms:x,colorWrite:!1,depthWrite:!0,depthTest:!0,side:o.hB5})}),(0,r.jsx)("mesh",{geometry:v,renderOrder:1,children:(0,r.jsx)($,{ref:d})})]})});J.displayName="SketchContourMapRenderer";let ee=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,o=(0,a.useRef)(null),i=(0,a.useRef)(null),s=(0,a.useRef)(null),l=(0,a.useRef)(null);j(o);let u=(0,a.useCallback)(()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]),c=(0,a.useCallback)(e=>{let{annotationDelay:t}=e;u(),i.current?.present(),l.current=setTimeout(()=>{l.current=null,s.current?.present()},t)},[u]),f=(0,a.useCallback)(()=>{u(),s.current?.dismiss(),i.current?.dismiss()},[u]);return(0,a.useEffect)(()=>()=>{u()},[u]),(0,a.useImperativeHandle)(t,()=>({present:c,dismiss:f}),[c,f]),(0,r.jsxs)(G,{ref:o,layers:n,name:_.eU.SKETCH_BACKGROUND,cameraFollowConfig:B._h.contourmap,dofConfig:B.HD.contourmap,children:[(0,r.jsx)(J,{ref:i}),(0,r.jsx)(D,{ref:s})]})});ee.displayName="SketchContourMapExperience";let et=[{a:30,kx:25e-5,ky:4e-4,omega:.37,phi:0},{a:40,kx:8e-4,ky:.0012,omega:.83,phi:2.1},{a:20,kx:.002,ky:.003,omega:1.97,phi:4.7}],en=Math.fround,er=e=>{let t=en(e);return en(t-Math.floor(t))},ea=e=>{let t=er(en(en(e)*en(.1031)));return t=er(en(t*en(t+en(.7653)))),er(t=en(t+en(t*en(t+en(1.3456)))))},eo=(e,t,n)=>{let r=en(Math.max(0,Math.min(1,en(en(en(n)-en(e))/en(en(t)-en(e))))));return en(en(r*r)*en(en(3)-en(en(2)*r)))},ei=(e,t,n)=>{let r=en(0);for(let a=0;a<et.length;a++){let o=et[a],i=en(en(en(o.kx)*en(e))+en(en(o.ky)*en(t))+en(en(o.omega)*en(n))+en(o.phi));r=en(r+en(en(o.a)*en(Math.sin(i))))}return r},es=(e,t,n,r,a,o)=>{let i=((e,t,n,r,a)=>{let o=en(en(16e3)*en(.5)),i=en(en(16e3)/en(30)),s=en(i*en(.45)),l=en(Math.max(0,Math.min(1,en(en(en(n)-en(-3e3))/en(en(3e3)-en(-3e3)))))),u=en(en(1)-l),c=en(en(.08)+en(en(.92)*en(u*en(Math.sqrt(u))))),f=en(0);for(let t=0;t<30;t++){let n=en(en(en(en(t)*en(3.71))+en(en(a)*en(7.13)))+en(1)),l=en(en(-o)+en(i*en(en(t)+en(.5)))),u=en(en(Math.sin(en(en(en(r)*en(en(.3)+en(ea(n)*en(.15))))+n)))*en(i*en(.5))),c=en(en(Math.sin(en(en(en(r)*en(en(.15)+en(ea(en(n*en(1.3)))*en(.08))))+en(n*en(2.1)))))*en(i*en(.3))),d=en(en(l)+en(u+c)),m=en(e
53n(1)-eo(0,s,en(Math.abs(en(en(e)-d))))),p=en(en(.6)+en(en(.4)*ea(en(n*en(.51))))),h=en(en(.5)+en(en(.5)*en(en(.5)+en(en(.5)*en(Math.sin(en(en(en(r)*en(.55))+en(en(en(t)*en(.04))+en(en(a)*en(.06))))))))));f=en(f+en(en(m*p)*h))}return en(en(f*en(t))*c)})(e,n,t,r,a);return en(i+ei(e,t,r))},el=(e,t)=>{let n=e- -2e3,r=t-0;return Math.max(0,1-Math.sqrt(n*n+r*r)/1e4)},eu=0,ec=(e,t)=>{let n=(e=>{let t=52;if(0!==e){let n=Math.floor((e-1)/2);t=(e-1)%2==0?52-(n+1)*2+ +n:52-(n+1)*2+(n+1)*1}return Math.max(0,Math.min(99,t+-6))})(t);return{surfaceId:e.id,lineIndex:n,gridX:n/100,worldX:0,worldY:0,worldZ:0,nodeId:`N-${String(eu++).padStart(4,"0")}`,labelKey:"",opacity:0,state:"entering"}},ef=(0,a.forwardRef)((e,t)=>{let{setIsSketchAnnotationRendererReady:n,surfaceManagerRef:o,curtainWallTimeRef:i}=(0,a.useContext)(u.C),s=(0,a.useRef)([]),f=(0,a.useRef)(!1),m=(0,a.useRef)(null),h=(0,a.useRef)(null),g=(0,a.useRef)(0),[,v]=(0,l.zh)(()=>({from:{opacity:0},onChange:e=>{g.current=e.value.opacity}})),b=(0,a.useRef)([]),S=(0,a.useRef)(new Map);(0,a.useEffect)(()=>{let e=x({maxAnnotations:10,vertsPerAnn:10,atlasCols:5,atlasRows:2,depthTest:!0,logDepth:!0});return m.current.add(e.lineMesh,e.circleMesh,e.labelMesh),h.current=e,n(!0),()=>y(e)},[]),(0,c.Ql)((e,t)=>{if(!f.current)return;let n=o.current,r=h.current;if(!n||!r)return;let a=b.current;a.length=0;for(let e=0;e<n.surfaces.length;e++)a.push(n.surfaces[e]);a.sort((e,t)=>e.currentY-t.currentY);let l=S.current;l.clear();for(let e=0;e<a.length;e++)l.set(a[e].id,{surface:a[e],sortedIdx:e});let u=a.length>0?a[a.length-1].id:null,c=s.current,m=g.current;for(let e=c.length-1;e>=0;e--){let t=c[e];if(!l.get(t.surfaceId)||t.surfaceId===u){c.splice(e,1);continue}}for(let e=0;e<a.length;e++){let t=a[e];t.id!==u&&!c.some(e=>e.surfaceId===t.id)&&c.length<10&&c.push(ec(t,e))}let v=i?.current??0,x=a.length;for(let e=c.length-1;e>=0;e--){let n=c[e],r=l.get(n.surfaceId);if(!r)continue;let a=16e3*n.gridX-8e3,o=r.surface.currentY,i=es(a,o,r.surface.m,v,r.sortedIdx,x);n.worldX=a,n.worldY=o,n.worldZ=i,"entering"===n.state?(n.opacity+=1.2*t,n.opacity>=1&&(n.opacity=1,n.state="alive")):"exiting"===n.state&&(n.opacity-=1.8*t,n.opacity<=0&&c.splice(e,1))}let y=(e,t)=>{let n=e.worldZ;for(let r=-2;r<=2;r++){let a=e.lineIndex+r;if(a<0||a>=100)continue;let o=es(a/99*16e3-8e3,t.surface.currentY,t.surface.m,v,t.sortedIdx,x);o>n&&(n=o)}return n-e.worldZ+200},T=r.linePositions,P=r.lineColors;for(let e=0;e<10;e++){let t=10*e;if(e>=c.length){for(let e=0;e<10;e++)P[(t+e)*4+3]=0;continue}let n=c[e],r=l.get(n.surfaceId);if(!r)continue;let a=y(n,r),o=el(n.worldX,n.worldZ),i=n.opacity*m*o,s=n.worldZ+5;w(T,P,t,n.worldX,n.worldY,s,.6*i),R(T,P,t,8,n.worldX,n.worldY,n.worldZ,90,90,a,.4*i)}r.lineGeo.attributes.position.needsUpdate=!0,r.lineGeo.attributes.aColor.needsUpdate=!0;let M=r.circleOpacities;for(let e=0;e<10;e++){let t=3*e;if(e>=c.length){M[t+0]=0,M[t+1]=0,M[t+2]=0;continue}let n=c[e],a=l.get(n.surfaceId);if(!a)continue;let o=y(n,a),i=el(n.worldX,n.worldZ),s=.5*(n.opacity*m*i);p.makeTranslation(n.worldX,n.worldY,n.worldZ),r.circleMesh.setMatrixAt(t+0,p),r.circleMesh.setMatrixAt(t+1,p),M[t+0]=s,M[t+1]=s,p.makeTranslation(n.worldX+90,n.worldY+90,n.worldZ+o),r.circleMesh.setMatrixAt(t+2,p),M[t+2]=s}r.circleMesh.instanceMatrix.needsUpdate=!0,r.circleGeo.attributes.aOpacity.needsUpdate=!0;let A=r.labelOpacities,D=!1;for(let e=0;e<10;e++){if(e>=c.length){A[e]=0;continue}let t=c[e],n=l.get(t.surfaceId);if(!n){A[e]=0;continue}let a=y(t,n),o=el(t.worldX,t.worldZ),i=t.opacity*m*o;p.makeTranslation(t.worldX+d,t.worldY+80,t.worldZ+a),r.labelMesh.setMatrixAt(e,p),A[e]=i;let s=ei(t.worldX,t.worldY,v),u=`${t.nodeId}|${n.surface.m.toFixed(0)}|${Math.round(s)}|${Math.round(t.worldX)}|${Math.round(t.worldY)}|${Math.round(t.worldZ)}`;r.labelKeys[e]!==u&&(C(r.atlasCtx,5,e,t.nodeId,`M:${n.surface.m.toFixed(0)} W:${s.toFixed(0)}`,`X:${t.worldX.toFixed(0)} Y:${t.worldY.toFixed(0)} Z:${t.worldZ.toFixed(0)}`),r.labelKeys[e]=u,D=!0)}r.labelMesh.instanceMatrix.needsUpdate=!0,r.labelGeo.attributes.aOpacity.needsUpdate=!0,D&&(r.atlasTexture.needsUpdate=!0)});let T=()=>{f.current=!0,v.start({opacity:1,config:{duration:1500}})},P=()=>{v.start({opacity:0,config:{duration:300},onRest:()=>{f.current=!1,s.current=[]}})};return(0,a.useImperativeHandle)(t,()=>({present:T,dismiss:P})),(0,r.jsx)("group",{ref:m})});
53ef.displayName="SketchCurtainWallAnnotationRenderer";let ed=(0,a.forwardRef)((e,t)=>{let n=(0,a.useRef)(null),i=(0,a.useMemo)(()=>({uSurfaceCount:{value:0},uSurfacePositionsY:{value:new Float32Array(10)},uSurfaceOpacity:{value:new Float32Array(10)},uSurfaceM:{value:new Float32Array(10)},uSurfaceWidth:{value:16e3},uTime:{value:0},uWindA:{value:new Float32Array(et.map(e=>e.a))},uWindKx:{value:new Float32Array(et.map(e=>e.kx))},uWindKy:{value:new Float32Array(et.map(e=>e.ky))},uWindOmega:{value:new Float32Array(et.map(e=>e.omega))},uWindPhi:{value:new Float32Array(et.map(e=>e.phi))},uXYWindScale:{value:.08},uClothStiffnessTop:{value:8},uClothStiffnessBottom:{value:2},uClothDamping:{value:.15},uClothPhaseSpeed:{value:1.3},uVisibleYRange:{value:new o.I9Y(-3e3,3e3)},uGridSpacingX:{value:160},uLineHalfWidthX:{value:1},uLineHalfWidthY:{value:3},uSurfaceGridY:{value:new Float32Array(10)},uFadeCenter:{value:new o.I9Y(-2e3,0)},uDepthMin:{value:0},uDepthMax:{value:1e4},uOpacity:{value:1}}),[]);return(0,a.useImperativeHandle)(t,()=>({material:n.current})),(0,r.jsx)("shaderMaterial",{ref:n,vertexShader:"/* ââ Contact Curtain Wall Vertex Shader ââ\n PlaneGeometry input with 3-layer deformation:\n Layer 1: Local wind vents â drifting Gaussian bumps along each surface\n Layer 2: Global wind force â multi-scale sin composite\n Layer 3: Cloth response â spring-damper analytical approximation */\n\n#define MAX_SURFACES 10\n#define WIND_WAVE_COUNT 3\n#define VENT_COUNT 30\n\n/* ââ Surface uniforms ââ */\nuniform int uSurfaceCount;\nuniform float uSurfacePositionsY[MAX_SURFACES];\nuniform float uSurfaceOpacity[MAX_SURFACES];\nuniform float uSurfaceM[MAX_SURFACES];\n\n/* ââ Geometry ââ */\nuniform float uSurfaceWidth;\nuniform float uTime;\n\n/* ââ Wind parameters (shared with CPU mirror) ââ */\nuniform float uWindA[WIND_WAVE_COUNT];\nuniform float uWindKx[WIND_WAVE_COUNT];\nuniform float uWindKy[WIND_WAVE_COUNT];\nuniform float uWindOmega[WIND_WAVE_COUNT];\nuniform float uWindPhi[WIND_WAVE_COUNT];\nuniform float uXYWindScale;\n\n/* ââ Cloth response ââ */\nuniform float uClothStiffnessTop;\nuniform float uClothStiffnessBottom;\nuniform float uClothDamping;\nuniform float uClothPhaseSpeed;\nuniform vec2 uVisibleYRange;\n\n/* ââ Fade ââ */\nuniform vec2 uFadeCenter;\n\n#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/* ââ Varyings ââ */\nvarying vec2 vGridXY;\nvarying float vDepth;\n\n/* ââ Hash (sin-free, matches CPU mirror) ââ */\nfloat hash(float x) {\n float p = fract(x * 0.1031);\n p = fract(p * (p + 0.7653));\n p += p * (p + 1.3456);\n return fract(p);\n}\n\n/* ââ Layer 1: Local wind vents ââ\n Drifting Gaussian-like bumps along each surface line.\n Alternating positive/negative creates peaks and valleys.\n Wind intensity increases from top to bottom. */\nfloat computeLocalWindZ(float wx, float m, float worldY, float time, int surfIdx, int surfCount) {\n float halfW = uSurfaceWidth * 0.5;\n float spacing = uSurfaceWidth / float(VENT_COUNT);\n float radius = spacing * 0.45;\n\n /* Wind stronger at bottom of curtain */\n float yNorm = (worldY - uVisibleYRange.x) / (uVisibleYRange.y - uVisibleYRange.x);\n /* Exponential: topâ0.05, midâ0.17, bottom=1.0 */\n float bottomness = 1.0 - clamp(yNorm, 0.0, 1.0);\n float yFactor = 0.08 + 0.92 * bottomness * sqrt(bottomness);\n\n float z = 0.0;\n for (int v = 0; v < VENT_COUNT; v++) {\n float seed = float(v) * 3.71 + float(surfIdx) * 7.13 + 1.0;\n\n /* Vent position: fast drift so each gust hits a different spot */\n float baseX = -halfW + spacing * (float(v) + 0.5);\n float driftA = sin(time * (0.3 + hash(seed) * 0.15) + seed) * spacing * 0.5;\n float driftB = sin(time * (0.15 + hash(seed * 1.3) * 0.08) + seed * 2.1) * spacing * 0.3;\n float ventX = baseX + driftA + driftB;\n\n /* Smooth influence falloff */\n float influence = 1.0 - smoothstep(0.0, radius, abs(wx - ventX));\n\n /* Per-vent amplitude variation */\n float ampVar = 0.6 + 0.4 * hash(seed * 0.51);\n\n /* Gust: always substantially inflated, oscillates 0.5â1.0 */\n float breathe = 0.5 + 0.5 * (0.5 + 0.5 * sin(time * 0.55 + float(v) * 0.04 + float(surfIdx) * 0.06));\n z += influence * ampVar * breathe;\n }\n\n return z * m * yFactor;\n}\n\n/* ââ Layer 2: Wind Z + XY displacement ââ */\nfloat c
53omputeWindZ(vec2 worldXY, float time) {\n float z = 0.0;\n for (int i = 0; i < WIND_WAVE_COUNT; i++) {\n float phase = uWindKx[i] * worldXY.x + uWindKy[i] * worldXY.y + uWindOmega[i] * time + uWindPhi[i];\n z += uWindA[i] * sin(phase);\n }\n return z;\n}\n\nvec2 computeWindXY(vec2 worldXY, float time) {\n /* XY displacement = spatial gradient of windZ \xd7 scale */\n vec2 disp = vec2(0.0);\n for (int i = 0; i < WIND_WAVE_COUNT; i++) {\n float phase = uWindKx[i] * worldXY.x + uWindKy[i] * worldXY.y + uWindOmega[i] * time + uWindPhi[i];\n float c = uWindA[i] * cos(phase);\n disp.x += c * uWindKx[i];\n disp.y += c * uWindKy[i];\n }\n return disp * uXYWindScale;\n}\n\n/* ââ Layer 3: Cloth response (analytical spring-damper) ââ */\nfloat clothResponse(float targetZ, float worldY, float time, float surfSeed) {\n /* Stiffness interpolated by Y position: top=stiff, bottom=loose */\n float yNorm = (worldY - uVisibleYRange.x) / (uVisibleYRange.y - uVisibleYRange.x);\n yNorm = clamp(yNorm, 0.0, 1.0);\n float stiffness = mix(uClothStiffnessBottom, uClothStiffnessTop, yNorm);\n\n /* Damped oscillation around target: lag = damping * sin(phase) / stiffness */\n float lag = uClothDamping * sin(uClothPhaseSpeed * time + surfSeed * 6.2831) / stiffness;\n return targetZ * (1.0 + lag);\n}\n\nvoid main() {\n /* ââ Map mesh UV to world coordinates ââ */\n float meshV = position.y * 0.5 + 0.5;\n float worldX = position.x;\n\n /* ââ Y-warp: map meshV to interpolated surface positions ââ */\n float surfFloat = meshV * max(float(uSurfaceCount) - 1.0, 0.0);\n int surfIdx0 = int(floor(surfFloat));\n int surfIdx1 = min(surfIdx0 + 1, uSurfaceCount - 1);\n surfIdx0 = min(surfIdx0, uSurfaceCount - 1);\n float surfFrac = fract(surfFloat);\n\n float worldY = mix(uSurfacePositionsY[surfIdx0], uSurfacePositionsY[surfIdx1], surfFrac);\n\n /* Store pre-deformation grid coordinates for fragment shader grid detection */\n vGridXY = vec2(worldX, worldY);\n\n /* ââ Layer 1: Local wind vents ââ */\n float localZ0 = computeLocalWindZ(worldX, uSurfaceM[surfIdx0], worldY, uTime, surfIdx0, uSurfaceCount);\n float localZ1 = computeLocalWindZ(worldX, uSurfaceM[surfIdx1], worldY, uTime, surfIdx1, uSurfaceCount);\n float localZ = mix(localZ0, localZ1, smoothstep(0.0, 1.0, surfFrac));\n\n /* ââ Layer 2: Global wind force ââ */\n vec2 worldXY = vec2(worldX, worldY);\n float windZ = computeWindZ(worldXY, uTime);\n vec2 windXY = computeWindXY(worldXY, uTime);\n\n /* ââ Layer 3: Cloth response ââ */\n float targetZ = localZ + windZ;\n float clothBlend = smoothstep(0.0, 1.0, surfFrac);\n float finalZ = mix(\n clothResponse(targetZ, worldY, uTime, hash(float(surfIdx0) * 7.31)),\n clothResponse(targetZ, worldY, uTime, hash(float(surfIdx1) * 7.31)),\n clothBlend\n );\n\n /* ââ Apply deformation ââ */\n vec3 pos = vec3(worldX + windXY.x, worldY + windXY.y, finalZ);\n\n /* ââ Fade distance (XZ plane from fade center) ââ */\n vDepth = distance(vec2(pos.x, pos.z), uFadeCenter);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/* ââ Contact Curtain Wall Fragment Shader ââ\n Grid line detection via mod() + fwidth() anti-aliasing.\n Vertical lines: uniform spacing (mod).\n Horizontal lines: non-uniform spacing (uniform array loop). */\n\n#define MAX_SURFACES 10\n\n#include <logdepthbuf_pars_fragment>\n\n/* Grid parameters */\nuniform float uGridSpacingX;\nuniform float uLineHalfWidthX;\nuniform float uLineHalfWidthY;\n\n/* Surface Y positions for horizontal lines (pre-deformation coordinates) */\nuniform int uSurfaceCount;\nuniform float uSurfaceGridY[MAX_SURFACES];\n\n/* Fade */\nuniform float uDepthMin;\nuniform float uDepthMax;\n\n/* Overall opacity */\nuniform float uOpacity;\n\n/* Varyings */\nvarying vec2 vGridXY; /* pre-deformation coordinates */\nvarying float vDepth; /* distance from fade center in XZ */\n\nvoid main() {\n float halfSpacingX = uGridSpacingX * 0.5;\n\n /* ââ Vertical lines: uniform spacing via mod ââ */\n float distToVertical = abs(mod(vGridXY.x + halfSpacingX, uGridSpacingX) - halfSpacingX);\n float fwX = fwidth(vGridXY.x);\n float lineV = 1.0 - smoothstep(uLineHalfWidthX - fwX, uLineHalfWidthX + fwX, distToVertical);\n\n /* ââ Horizontal lines: loop over surface Y positions ââ */\n float distToHorizontal = 1e6;\n for (int i = 0; i < MAX_SURFACES;
53 i++) {\n if (i >= uSurfaceCount) break;\n float d = abs(vGridXY.y - uSurfaceGridY[i]);\n distToHorizontal = min(distToHorizontal, d);\n }\n float fwY = fwidth(vGridXY.y);\n float lineH = 1.0 - smoothstep(uLineHalfWidthY - fwY, uLineHalfWidthY + fwY, distToHorizontal);\n\n /* ââ Combine: max of vertical and horizontal ââ */\n float line = max(lineV, lineH);\n\n /* ââ Depth-based fade ââ */\n float depthNorm = clamp((vDepth - uDepthMin) / (uDepthMax - uDepthMin), 0.0, 1.0);\n float fade = 1.0 - depthNorm;\n\n float alpha = line * fade * uOpacity;\n if (alpha < 0.01) discard;\n\n gl_FragColor = vec4(vec3(fade), alpha);\n\n #include <logdepthbuf_fragment>\n}\n",uniforms:i,transparent:!0,depthTest:!0,depthWrite:!1,depthFunc:o.xSv,side:o.hB5})});ed.displayName="SketchCurtainWallMaterial";var em=n(1343);let ep=(e,t)=>e+Math.random()*(t-e),eh=(e,t,n)=>e+(t-e)*n,eg=(e,t,n)=>Math.max(t,Math.min(n,e)),ev=(0,a.forwardRef)((e,t)=>{let n,i,s,f,d,m,p,h,g,v,{setIsSketchCurtainWallRendererReady:x,surfaceManagerRef:y,curtainWallTimeRef:w}=(0,a.useContext)(u.C),R=(0,a.useRef)(y).current,C=(0,a.useRef)(w).current,b=(0,a.useRef)(null),S=(0,a.useRef)(null),T=(0,a.useRef)(!1),P=(0,a.useRef)(0),M=(0,a.useMemo)(()=>new o.bdM(16e3,2,512,128),[]),A=(0,a.useMemo)(()=>({uSurfaceCount:{value:0},uSurfacePositionsY:{value:new Float32Array(10)},uSurfaceM:{value:new Float32Array(10)},uSurfaceWidth:{value:16e3},uTime:{value:0},uWindA:{value:new Float32Array(et.map(e=>e.a))},uWindKx:{value:new Float32Array(et.map(e=>e.kx))},uWindKy:{value:new Float32Array(et.map(e=>e.ky))},uWindOmega:{value:new Float32Array(et.map(e=>e.omega))},uWindPhi:{value:new Float32Array(et.map(e=>e.phi))},uXYWindScale:{value:.08},uClothStiffnessTop:{value:8},uClothStiffnessBottom:{value:2},uClothDamping:{value:.15},uClothPhaseSpeed:{value:1.3},uVisibleYRange:{value:new o.I9Y(-3e3,3e3)}}),[]),{stateRef:D}=((m=(0,em.c)(7))[0]!==T?(n=void 0===T?{current:!1}:T,m[0]=T,m[1]=n):n=m[1],p=n,m[2]===Symbol.for("react.memo_cache_sentinel")?(i={surfaces:[]},m[2]=i):i=m[2],h=(0,a.useRef)(i),g=(0,a.useRef)(!1),m[3]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{if(g.current)return;g.current=!0;let e=[];for(let t=0;t<7;t++){let n=-3e3+750*(t+1),r=ep(300,500);e.push({id:t,m:r,targetM:r,targetY:n,currentY:n,opacity:1})}h.current.surfaces=e},m[3]=s):s=m[3],v=s,m[4]!==p.current?(f=(e,t)=>{if(!p.current)return;if(!g.current)return void v();let{surfaces:n}=h.current,r=1-Math.exp(-1.8*t),a=1-Math.exp(-3*t),o=1-Math.exp(-1.2*t),i=60*t;for(let e=0;e<n.length;e++){let t=n[e];t.currentY=eh(t.currentY,t.targetY,r),t.opacity=eh(t.opacity,1,a),t.targetM=eg(t.targetM+(Math.random()-.5)*4*i,300,500),t.m=eh(t.m,t.targetM,o)}},m[4]=p.current,m[5]=f):f=m[5],(0,c.Ql)(f),m[6]===Symbol.for("react.memo_cache_sentinel")?(d={stateRef:h},m[6]=d):d=m[6],d),[,_]=(0,l.zh)(()=>({from:{opacity:0}
53,onChange:e=>{P.current=e.value.opacity}}));(0,a.useEffect)(()=>(x(!0),()=>{M.dispose()}),[]);let I=(0,a.useRef)([]),E=(e,t,n,r)=>{e.uSurfaceCount.value=t.length,e.uTime.value=n;for(let n=0;n<t.length&&n<10;n++){let a=t[n];e.uSurfacePositionsY.value[n]=a.currentY,e.uSurfaceM.value[n]=a.m,e.uSurfaceOpacity&&(e.uSurfaceOpacity.value[n]=a.opacity*r),e.uSurfaceGridY&&(e.uSurfaceGridY.value[n]=a.currentY)}},U=(0,a.useRef)(0);(0,c.Ql)(()=>{D.current&&(R.current=D.current);let e=D.current?.surfaces;if(!e)return;let t=I.current;if(e.length!==U.current){U.current=e.length,t.length=0;for(let n=0;n<e.length;n++)t.push(e[n]);t.sort((e,t)=>e.currentY-t.currentY)}else{let e=!1;for(let n=1;n<t.length;n++)if(t[n].currentY<t[n-1].currentY){e=!0;break}e&&t.sort((e,t)=>e.currentY-t.currentY)}let n=performance.now()/1e3;C&&(C.current=n);let r=P.current;if(b.current){let e=b.current.material.uniforms;E(e,t,n,r),e.uOpacity.value=r}S.current&&E(S.current.uniforms,t,n,r)});let O=()=>{T.current=!0,P.current=.01,_.start({opacity:1,config:{duration:2e3}})},F=()=>{_.start({opacity:0,config:{duration:300},onRest:()=>{T.current=!1}})};return(0,a.useImperativeHandle)(t,()=>({present:O,dismiss:F})),(0,r.jsxs)("group",{children:[(0,r.jsx)("mesh",{geometry:M,renderOrder:0,children:(0,r.jsx)("shaderMaterial",{ref:S,vertexShader:"/* ââ Contact Curtain Wall Depth Vertex Shader ââ\n Same 3-layer deformation as the color vertex shader.\n Writes to depth buffer only (colorWrite=false in material).\n Small offset away from camera prevents z-fighting with grid lines. */\n\n#define MAX_SURFACES 10\n#define WIND_WAVE_COUNT 3\n#define VENT_COUNT 30\n\nuniform int uSurfaceCount;\nuniform float uSurfacePositionsY[MAX_SURFACES];\nuniform float uSurfaceM[MAX_SURFACES];\nuniform float uSurfaceWidth;\nuniform float uTime;\n\nuniform float uWindA[WIND_WAVE_COUNT];\nuniform float uWindKx[WIND_WAVE_COUNT];\nuniform float uWindKy[WIND_WAVE_COUNT];\nuniform float uWindOmega[WIND_WAVE_COUNT];\nuniform float uWindPhi[WIND_WAVE_COUNT];\nuniform float uXYWindScale;\n\nuniform float uClothStiffnessTop;\nuniform float uClothStiffnessBottom;\nuniform float uClothDamping;\nuniform float uClothPhaseSpeed;\nuniform vec2 uVisibleYRange;\n\n#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/* ââ Hash ââ */\nfloat hash(float x) {\n float p = fract(x * 0.1031);\n p = fract(p * (p + 0.7653));\n p += p * (p + 1.3456);\n return fract(p);\n}\n\n/* ââ Layer 1: Local wind vents ââ */\nfloat computeLocalWindZ(float wx, float m, float worldY, float time, int surfIdx, int surfCount) {\n float halfW = uSurfaceWidth * 0.5;\n float spacing = uSurfaceWidth / float(VENT_COUNT);\n float radius = spacing * 0.45;\n\n float yNorm = (worldY - uVisibleYRange.x) / (uVisibleYRange.y - uVisibleYRange.x);\n float bottomness = 1.0 - clamp(yNorm, 0.0, 1.0);\n float yFactor = 0.08 + 0.92 * bottomness * sqrt(bottomness);\n\n float z = 0.0;\n for (int v = 0; v < VENT_COUNT; v++) {\n float seed = float(v) * 3.71 + float(surfIdx) * 7.13 + 1.0;\n float baseX = -halfW + spacing * (float(v) + 0.5);\n float driftA = sin(time * (0.3 + hash(seed) * 0.15) + seed) * spacing * 0.5;\n float driftB = sin(time * (0.15 + hash(seed * 1.3) * 0.08) + seed * 2.1) * spacing * 0.3;\n float ventX = baseX + driftA + driftB;\n float influence = 1.0 - smoothstep(0.0, radius, abs(wx - ventX));\n float ampVar = 0.6 + 0.4 * hash(seed * 0.51);\n float breathe = 0.5 + 0.5 * (0.5 + 0.5 * sin(time * 0.55 + float(v) * 0.04 + float(surfIdx) * 0.06));\n z += influence * ampVar * breathe;\n }\n\n return z * m * yFactor;\n}\n\n/* ââ Layer 2 ââ */\nfloat computeWindZ(vec2 worldXY, float time) {\n float z = 0.0;\n for (int i = 0; i < WIND_WAVE_COUNT;
53 i++) {\n float phase = uWindKx[i] * worldXY.x + uWindKy[i] * worldXY.y + uWindOmega[i] * time + uWindPhi[i];\n z += uWindA[i] * sin(phase);\n }\n return z;\n}\n\nvec2 computeWindXY(vec2 worldXY, float time) {\n vec2 disp = vec2(0.0);\n for (int i = 0; i < WIND_WAVE_COUNT; i++) {\n float phase = uWindKx[i] * worldXY.x + uWindKy[i] * worldXY.y + uWindOmega[i] * time + uWindPhi[i];\n float c = uWindA[i] * cos(phase);\n disp.x += c * uWindKx[i];\n disp.y += c * uWindKy[i];\n }\n return disp * uXYWindScale;\n}\n\n/* ââ Layer 3 ââ */\nfloat clothResponse(float targetZ, float worldY, float time, float surfSeed) {\n float yNorm = (worldY - uVisibleYRange.x) / (uVisibleYRange.y - uVisibleYRange.x);\n yNorm = clamp(yNorm, 0.0, 1.0);\n float stiffness = mix(uClothStiffnessBottom, uClothStiffnessTop, yNorm);\n float lag = uClothDamping * sin(uClothPhaseSpeed * time + surfSeed * 6.2831) / stiffness;\n return targetZ * (1.0 + lag);\n}\n\nvoid main() {\n float meshV = position.y * 0.5 + 0.5;\n float worldX = position.x;\n\n float surfFloat = meshV * max(float(uSurfaceCount) - 1.0, 0.0);\n int surfIdx0 = int(floor(surfFloat));\n int surfIdx1 = min(surfIdx0 + 1, uSurfaceCount - 1);\n surfIdx0 = min(surfIdx0, uSurfaceCount - 1);\n float surfFrac = fract(surfFloat);\n\n float worldY = mix(uSurfacePositionsY[surfIdx0], uSurfacePositionsY[surfIdx1], surfFrac);\n\n /* Layer 1: Local wind vents */\n float localZ0 = computeLocalWindZ(worldX, uSurfaceM[surfIdx0], worldY, uTime, surfIdx0, uSurfaceCount);\n float localZ1 = computeLocalWindZ(worldX, uSurfaceM[surfIdx1], worldY, uTime, surfIdx1, uSurfaceCount);\n float localZ = mix(localZ0, localZ1, smoothstep(0.0, 1.0, surfFrac));\n\n vec2 worldXY = vec2(worldX, worldY);\n float windZ = computeWindZ(worldXY, uTime);\n vec2 windXY = computeWindXY(worldXY, uTime);\n\n float targetZ = localZ + windZ;\n float clothBlend = smoothstep(0.0, 1.0, surfFrac);\n float finalZ = mix(\n clothResponse(targetZ, worldY, uTime, hash(float(surfIdx0) * 7.31)),\n clothResponse(targetZ, worldY, uTime, hash(float(surfIdx1) * 7.31)),\n clothBlend\n );\n\n vec3 pos = vec3(worldX + windXY.x, worldY + windXY.y, finalZ);\n\n /* Offset slightly away from camera so grid lines (at exact surface) pass depth test */\n vec3 toCamera = normalize(cameraPosition - pos);\n pos -= toCamera * 28.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/* ââ Contact Curtain Wall Depth Fragment Shader ââ\n Minimal shader for depth-only pass (colorWrite is false). */\n\n#include <logdepthbuf_pars_fragment>\n\nvoid main() {\n gl_FragColor = vec4(0.0);\n\n #include <logdepthbuf_fragment>\n}\n",uniforms:A,colorWrite:!1,depthWrite:!0,depthTest:!0,side:o.$EB})}),(0,r.jsx)("mesh",{geometry:M,renderOrder:1,children:(0,r.jsx)(ed,{ref:b})})]})});ev.displayName="SketchCurtainWallRenderer";let ex=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,o=(0,a.useRef)(null),i=(0,a.useRef)(null),s=(0,a.useRef)(null),l=(0,a.useRef)(null);j(o);let u=(0,a.useCallback)(()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]),c=(0,a.useCallback)(e=>{let{annotationDelay:t}=e;u(),i.current?.present(),l.current=setTimeout(()=>{l.current=null,s.current?.present()},t)},[u]),f=(0,a.useCallback)(()=>{u(),s.current?.dismiss(),i.current?.dismiss()},[u]);return(0,a.useEffect)(()=>()=>{u()},[u]),(0,a.useImperativeHandle)(t,()=>({present:c,dismiss:f}),[c,f]),(0,r.jsxs)(G,{ref:o,layers:n,name:_.eU.SKETCH_BACKGROUND,cameraFollowConfig:B._h.curtainwall,dofConfig:B.HD.curtainwall,children:[(0,r.jsx)(ev,{ref:i}),(0,r.jsx)(ef,{ref:s})]})});ex.displayName="SketchCurtainWallExperience";let ey=[6e3,0,2e3],ew=[[0,21],[21*Math.sqrt(3)*.5,-10.5],[-21*Math.sqrt(3)*.5,-10.5]],eR=(e,t)=>{let n=e-ey[0],r=t-ey[1],a=0-ey[2];return Math.max(0,Math.min(1,1-(Math.sqrt(n*n+r*r+a*a)-7e3)/2e3))},eC=0,eb=new Map,eS=new Set,eT=(0,a.forwardRef)((e,t)=>{let{setIsSketchElasticGridAnnotationRendererReady:n,sphereManagerRef:i}=(0,a.useContext)(u.C),s=(0,a.useRef)([]),f=(0,a.useRef)(!1),m=(0,a.useRef)(null),g=(0,a.useRef)(null),b=(0,a.useRef)(0),[,S]=(0,l.zh)(()=>({from:{opacity:0}
53,onChange:e=>{b.current=e.value.opacity}}));(0,a.useEffect)(()=>{let e=x({maxAnnotations:30,vertsPerAnn:16,atlasCols:6,atlasRows:5,depthTest:!1,logDepth:!1}),t=new o.LoY;t.setAttribute("position",new o.THS(new Float32Array([ew[0][0],ew[0][1],0,ew[1][0],ew[1][1],0,ew[2][0],ew[2][1],0]),3));let r=new Float32Array(30),a=new Float32Array(90);for(let e=0;e<30;e++)a[3*e]=1,a[3*e+1]=.2,a[3*e+2]=.2;let i=v(!1),s=new o.BKk({vertexShader:i.vert,fragmentShader:i.frag,transparent:!0,depthTest:!1,depthWrite:!1,side:o.$EB}),l=new o.ZLX(t,s,30);l.frustumCulled=!1,l.renderOrder=2,l.instanceMatrix.setUsage(o.Vnu),t.setAttribute("aOpacity",new o.uWO(r,1).setUsage(o.Vnu)),t.setAttribute("aColorRGB",new o.uWO(a,3));for(let e=0;e<30;e++)l.setMatrixAt(e,h);l.instanceMatrix.needsUpdate=!0;let u={...e,triFillGeo:t,triFillMesh:l,triFillOpacities:r,triFillMat:s};return m.current.add(e.lineMesh,e.circleMesh,l,e.labelMesh),g.current=u,n(!0),()=>{y(e),t.dispose(),s.dispose()}},[]),(0,c.Ql)((e,t)=>{if(!f.current)return;let n=i.current,r=g.current;if(!n||!r)return;let a=s.current,o=b.current;eb.clear();for(let e=0;e<n.length;e++)eb.set(n[e].id,n[e]);eS.clear();for(let e=0;e<a.length;e++)eS.add(a[e].sphereId);for(let e=0;e<n.length;e++){let t=n[e];!eS.has(t.id)&&a.length<30&&a.push({sphereId:t.id,worldX:0,worldY:0,worldZ:0,nodeId:`S-${String(eC++).padStart(3,"0")}`,labelKey:"",opacity:0,state:"entering"})}for(let e=a.length-1;e>=0;e--){let n=a[e],r=eb.get(n.sphereId);if(r){n.worldX=r.position.x,n.worldY=r.position.y,n.worldZ=600*r.strength;let e=r.position.x>=-9e3&&r.position.x<=3e3&&r.position.y>=-2e3&&r.position.y<=2e3;e||"exiting"===n.state?e&&"exiting"===n.state&&(n.state="entering"):n.state="exiting"}"entering"===n.state?(n.opacity+=1.2*t,n.opacity>=1&&(n.opacity=1,n.state="alive")):"exiting"===n.state&&(n.opacity=Math.max(0,n.opacity-1.8*t))}let l=r.linePositions,u=r.lineColors;for(let e=0;e<30;e++){let t=16*e;if(e>=a.length){for(let e=0;e<16;e++)u[(t+e)*4+3]=0;continue}let n=a[e],r=n.worldX,i=n.worldY,s=n.worldZ,c=eR(r,i),f=n.opacity*o*c,d=eb.get(n.sphereId),m=d?.agitatorBlend??0,p=s+2;w(l,u,t,r,i,p,.6*f*(1-m));let h=.8*f*m;for(let e=0;e<3;e++){let n=t+8+2*e,a=n+1,o=ew[e],s=ew[(e+1)%3];l[3*n]=r+o[0],l[3*n+1]=i+o[1],l[3*n+2]=p,l[3*a]=r+s[0],l[3*a+1]=i+s[1],l[3*a+2]=p,u[4*n]=1,u[4*n+1]=.2,u[4*n+2]=.2,u[4*n+3]=h,u[4*a]=1,u[4*a+1]=.2,u[4*a+2]=.2,u[4*a+3]=h}R(l,u,t,14,r,i,s,90,90,200,.4*f)}r.lineGeo.attributes.position.needsUpdate=!0,r.lineGeo.attributes.aColor.needsUpdate=!0;let c=r.circleOpacities,m=r.circleColors;for(let e=0;e<30;e++){let t=3*e;if(e>=a.length){c[t+0]=0,c[t+1]=0,c[t+2]=0;continue}let n=a[e],i=eR(n.worldX,n.worldY),s=n.opacity*o*i,l=eb.get(n.sphereId),u=l?.agitatorBlend??0,f=1-.8*u,d=1-.8*u,h=.5*s,g=t+0;p.makeTranslation(n.worldX,n.worldY,n.worldZ),r.circleMesh.setMatrixAt(g,p),c[g]=h,m[3*g]=1,m[3*g+1]=f,m[3*g+2]=d;let v=t+1;r.circleMesh.setMatrixAt(v,p),c[v]=h,m[3*v]=1,m[3*v+1]=f,m[3*v+2]=d;let x=t+2;p.makeTranslation(n.worldX+90,n.worldY+90,n.worldZ+200),r.circleMesh.setMatrixAt(x,p),c[x]=h,m[3*x]=1,m[3*x+1]=1,m[3*x+2]=1}r.circleMesh.instanceMatrix.needsUpdate=!0,r.circleGeo.attributes.aOpacity.needsUpdate=!0,r.circleGeo.attributes.aColorRGB.needsUpdate=!0;let h=r.triFillOpacities;for(let e=0;e<30;e++){if(e>=a.length){h[e]=0;continue}
53let t=a[e],n=eR(t.worldX,t.worldY),i=t.opacity*o*n,s=eb.get(t.sphereId),l=s?.agitatorBlend??0;p.makeTranslation(t.worldX,t.worldY,t.worldZ+1),r.triFillMesh.setMatrixAt(e,p),h[e]=.2*i*l}r.triFillMesh.instanceMatrix.needsUpdate=!0,r.triFillGeo.attributes.aOpacity.needsUpdate=!0;let v=r.labelOpacities,x=!1;for(let e=0;e<30;e++){if(e>=a.length){v[e]=0;continue}let t=a[e],n=eR(t.worldX,t.worldY),i=t.opacity*o*n;p.makeTranslation(t.worldX+d,t.worldY+80,t.worldZ+200),r.labelMesh.setMatrixAt(e,p),v[e]=i;let s=eb.get(t.sphereId);if(s){let n=`${t.nodeId}|${s.radius.toFixed(0)}|${s.strength.toFixed(2)}|${Math.round(t.worldX)}|${Math.round(t.worldY)}`;r.labelKeys[e]!==n&&(C(r.atlasCtx,6,e,t.nodeId,`R:${s.radius.toFixed(0)} S:${s.strength.toFixed(2)}`,`X:${t.worldX.toFixed(0)} Y:${t.worldY.toFixed(0)}`),r.labelKeys[e]=n,x=!0)}}r.labelMesh.instanceMatrix.needsUpdate=!0,r.labelGeo.attributes.aOpacity.needsUpdate=!0,x&&(r.atlasTexture.needsUpdate=!0)});let T=()=>{f.current=!0,S.start({opacity:1,config:{duration:1500}})},P=()=>{S.start({opacity:0,config:{duration:300},onRest:()=>{f.current=!1,s.current=[]}})};return(0,a.useImperativeHandle)(t,()=>({present:T,dismiss:P})),(0,r.jsx)("group",{ref:m})});eT.displayName="SketchElasticGridAnnotationRenderer";let eP=(0,a.forwardRef)((e,t)=>{let n=(0,a.useRef)(null),i=(0,a.useMemo)(()=>({uTime:{value:0},uSpherePositions:{value:Array.from({length:30},()=>new o.I9Y)},uSphereRadii:{value:new Float32Array(30)},uSphereStrengths:{value:new Float32Array(30)},uActiveSphereCount:{value:0},uMaxDisplacement:{value:600},uXYStretchScale:{value:.15},uGridSpacingX:{value:200},uGridSpacingY:{value:4e3/30},uLineHalfWidth:{value:1},uFadeCenter:{value:new o.Pq0(...ey)},uDepthMin:{value:0},uDepthMax:{value:14e3},uOpacity:{value:1}}),[]);return(0,a.useImperativeHandle)(t,()=>({material:n.current})),(0,r.jsx)("shaderMaterial",{ref:n,vertexShader:"/* ââ Contact Elastic Grid Vertex Shader ââ */\n\n#define MAX_SPHERES 30\n\nuniform float uTime;\nuniform vec2 uSpherePositions[MAX_SPHERES];\nuniform float uSphereRadii[MAX_SPHERES];\nuniform float uSphereStrengths[MAX_SPHERES];\nuniform int uActiveSphereCount;\nuniform float uMaxDisplacement;\nuniform float uXYStretchScale;\n\nvarying vec3 vWorldPos;\nvarying vec2 vGridXY;\nvarying float vHeight;\n\n#include <common>\n#include <logdepthbuf_pars_vertex>\n\nvoid main() {\n vec3 pos = position;\n\n /* World-space XY for sphere distance calculation */\n vec3 worldXY = (modelMatrix * vec4(pos, 1.0)).xyz;\n\n /* Save original world XY for grid line pattern (before XY displacement) */\n vGridXY = worldXY.xy;\n\n /* Accumulate sphere influence â firm latex-sheet profile:\n flat top near center, steep rolloff at the radius boundary */\n float totalInfluence = 0.0;\n vec2 totalXYDisp = vec2(0.0);\n\n for (int i = 0; i < MAX_SPHERES; i++) {\n if (i >= uActiveSphereCount) break;\n vec2 d = worldXY.xy - uSpherePositions[i];\n float r = uSphereRadii[i];\n\n /* Early exit: skip spheres whose center is beyond influence radius.\n Uses squared distance to avoid sqrt for out-of-range spheres (~90% of iterations). */\n float dist2 = dot(d, d);\n if (dist2 > r * r) continue;\n\n float dist = sqrt(dist2);\n float t = dist / r;\n float g = 1.0 - t * t;\n g = g * g * g; /* smooth profile: flat top, steep edge */\n totalInfluence += g * uSphereStrengths[i];\n\n /* XY stretch: push vertices radially outward along the bump gradient */\n if (dist > 0.001) {\n float slope = 6.0 * t * (1.0 - t * t) * (1.0 - t * t);\n totalXYDisp += d / dist * slope * uSphereStrengths[i];\n }\n }\n\n /* Apply XY stretch (rubber-band spreading) */\n pos.xy += totalXYDisp * uMaxDisplacement * uXYStretchScale;\n\n /* Z displacement */\n pos.z += totalInfluence * uMaxDisplacement;\n\n vHeight = totalInfluence;\n vWorldPos = (modelMatrix * vec4(pos, 1.0)).xyz;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/* ââ Contact Elastic Grid Fragment Shader ââ */\n\n#include <logdepthbuf_pars_fragment>\n\nuniform float uGridSpacingX;\nuniform float uGridSpacingY;\nuniform float uLineHalfWidth;\nuniform vec3 uFadeCenter;\nuniform float uDepthMin;\nuniform float uDepthMax;\nuniform float uOpacity;\n\nvarying vec3 vWorldPos;\nvarying vec2 vGridXY;\nvarying float vHeight;\n\nvoid main() {\n /* Grid line detection using original (undisplaced) XY â\n on the stretched mesh this makes lines curve and spread like rubber bands */\n float halfSpacingX = uGridSpacingX * 0.5;\n float halfSpacingY = uGridSpacingY * 0.5;\n\n float distToVertical = abs(mod(vGridXY.x + halfSpacingX, uGridSpacingX) - halfSpacingX);\n float distToHorizontal = abs(mod(vGridXY.y + halfSpacingY, uGridSpacingY) - halfSpacingY);
53\n\n /* Anti-aliased lines â compute fwidth per axis on original coordinates */\n float fwX = fwidth(vGridXY.x);\n float fwY = fwidth(vGridXY.y);\n float lineV = 1.0 - smoothstep(uLineHalfWidth - fwX, uLineHalfWidth + fwX, distToVertical);\n float lineH = 1.0 - smoothstep(uLineHalfWidth - fwY, uLineHalfWidth + fwY, distToHorizontal);\n float line = max(lineV, lineH);\n\n if (line < 0.01) discard;\n\n /* Depth fade */\n vec3 diff = vWorldPos - uFadeCenter;\n float depth = length(diff);\n float depthNorm = clamp((depth - uDepthMin) / (uDepthMax - uDepthMin), 0.0, 1.0);\n float fade = 1.0 - depthNorm;\n\n /* Final color */\n float alpha = line * fade * uOpacity;\n if (alpha < 0.01) discard;\n\n gl_FragColor = vec4(vec3(fade), alpha);\n\n #include <logdepthbuf_fragment>\n}\n",uniforms:i,transparent:!0,depthTest:!0,depthWrite:!1,depthFunc:o.xSv,side:o.hB5})});eP.displayName="SketchElasticGridMaterial";let eM=0,eA=(e,t)=>e+Math.random()*(t-e),eD=(e,t,n)=>e+(t-e)*n,e_=(e,t)=>{let n=e/600;return n*n*n*n*n*eD(1,30,t)},eI=()=>{let e=eA(600,1e3);return{id:eM++,position:{x:eA(-8e3,2e3),y:eA(-1e3,1e3)},velocity:{x:0,y:0},baseRadius:e,radius:e,strength:0,targetStrength:eA(.4,1),state:"entering",heading:Math.random()*Math.PI*2,headingSeed:1e3*Math.random(),breathingPhase:Math.random()*Math.PI*2,strengthVariationPeriod:eA(10,20),agitator:!1,agitatorBlend:0}},eE=(e,t)=>{e.uActiveSphereCount.value=t.length;for(let n=0;n<t.length&&n<30;n++){let r=t[n];e.uSpherePositions.value[n].set(r.position.x,r.position.y),e.uSphereRadii.value[n]=r.radius,e.uSphereStrengths.value[n]=r.strength}},eU=(0,a.forwardRef)((e,t)=>{let{setIsSketchElasticGridRendererReady:n,sphereManagerRef:i}=(0,a.useContext)(u.C),s=(0,a.useRef)(i).current,f=(0,a.useRef)(null),d=(0,a.useRef)(null),m=(0,a.useRef)(!1),p=(0,a.useRef)(0),h=(0,a.useMemo)(()=>new o.bdM(12e3,4e3,256,128),[]),g=(0,a.useMemo)(()=>({uTime:{value:0},uSpherePositions:{value:Array.from({length:30},()=>new o.I9Y)},uSphereRadii:{value:new Float32Array(30)},uSphereStrengths:{value:new Float32Array(30)},uActiveSphereCount:{value:0},uMaxDisplacement:{value:600},uXYStretchScale:{value:.15}}),[]),{spheresRef:v,update:x}=(()=>{let e=(0,a.useRef)([]),t=(0,a.useRef)(20);if(0===e.current.length)for(let t=0;t<30;t++){let n=eI();n.breathingPhase=t/30*Math.PI*2,t<3&&(n.agitator=!0),e.current.push(n)}let n=(0,a.useCallback)((n,r)=>{let a=e.current;for(((e,t,n)=>{for(let r of e){let e=+!!r.agitator,a=1-Math.exp(-5*t);r.agitatorBlend=eD(r.agitatorBlend,e,a);let o=r.agitatorBlend,i=eD(1,1.2,o),s=.8*Math.sin(r.headingSeed+.037*n)+.5*Math.sin(2.71*r.headingSeed+.023*n)+.3*Math.sin(.41*r.headingSeed+.013*n);if(r.heading+=s*i*t,Math.sqrt(r.velocity.x*r.velocity.x+r.velocity.y*r.velocity.y)>10){let e=Math.atan2(r.velocity.y,r.velocity.x)-r.heading;for(;e>Math.PI;)e-=2*Math.PI;for(;e<-Math.PI;)e+=2*Math.PI;let n=eD(1.5,.22499999999999998,o);r.heading+=e*n*t}let l=250*(.7+.6*((r.baseRadius-600)/400))*eD(1,4,o),u=Math.cos(r.heading)*l,c=Math.sin(r.heading)*l;r.velocity.x+=(u-r.velocity.x)*2*t,r.velocity.y+=(c-r.velocity.y)*2*t;let f=r.position.x- -9e3,d=3e3-r.position.x,m=r.position.y+2e3,p=2e3-r.position.y;if(f<1e3){let e=1-f/1e3;r.velocity.x+=800*e*e*t}if(d<1e3){let e=1-d/1e3;r.velocity.x-=800*e*e*t}if(m<1e3){let e=1-m/1e3;r.velocity.y+=800*e*e*t}if(p<1e3){let e=1-p/1e3;r.velocity.y-=800*e*e*t}r.velocity.x*=.98,r.velocity.y*=.98;let h=Math.sqrt(r.velocity.x*r.velocity.x+r.velocity.y*r.velocity.y);if(h>750){let e=750/h;r.velocity.x*=e,r.velocity.y*=e}}})(a,n,r),((e,t)=>{for(let n=0;n<e.length;n++){let r=e[n],a=600*r.strength,o=e_(r.radius,r.agitatorBlend);for(let i=n+1;i<e.length;i++){let n=e[i],s=600*n.strength,l=e_(n.radius,n.agitatorBlend),u=r.position.x-n.position.x,c=r.position.y-n.position.y,f=a-s,d=Math.sqrt(u*u+c*c+f*f),m=(r.radius+n.radius)*1;if(d<2500&&d>.01){let e=Math.max(0,1-(d-m)/(2500-m)),a=400*e*e*e,i=o+l,s=Math.sqrt(u*u+c*c);if(s>.01){let e=u/s,f=c/s;r.velocity.x+=e*a*(l/i)*t,r.velocity.y+=f*a*(l/i)*t,n.velocity.x-=e*a*(o/i)*t,n.velocity.y-=f*a*(o/i)*t}}}}})(a,n),((e,t,n)=>{for(let n of e){n.position.x+=n.velocity.x*t,n.position.y+=n.velocity.y*t;let e=.5*n.radius,r=Math.max(-9e3+e,Math.min(3e3-e,n.position.x)),a=Math.max(-2e3+e,Math.min(2e3-e,n.position.y));r!==n.position.x&&(n.velocity.x*=-.5),a!==n.position.y&&(n.velocity.y*=-.5),n.position.x=r,n.position.y=a}for(let t=0;t<e.length;t++){let n=e[t],r=600*n.strength,a=e_(n.radius,n.agitatorBlend);for(let o=t+1;o<e.length;o++){let t=e[o],i=600*t.strength,s=e_(t.radius,t.agitatorBlend),l=n.position.x-t.position.x,u=n.position.y-t.position.y,c=r-i,f=Math.sqrt(l*l+u*u+c*c),d=(n.radius+t.radius)*1;if(f<d&&f>.01){let e=(d-f)*.08,r=Math.sqrt(l*l+u*u);if(r>.01){let o=l/r,i=u/r,c=a+s;n.position.x+=o*e*(s/c),n.position.y+=i*e*(s/c),t.position.x-=o*e*(a/c),t.position.y-=i*e*(a/c)}}}}for(let r of e){let e=1+.06*Math.sin(n+r.breathingPhase);
53r.radius=r.baseRadius*e;let a=1-Math.exp(-.8*t);if(r.strength=eD(r.strength,r.targetStrength,a),"entering"===r.state)r.strength>.9*r.targetStrength&&(r.state="alive");else if("alive"===r.state){let e=.5*Math.sin(n/r.strengthVariationPeriod+r.breathingPhase)+.5;r.targetStrength=.4+.6*e}}})(a,n,r);a.length<30;)a.push(eI());if(r>=t.current){t.current=r+20;for(let e of a)e.agitator=!1;let e=Array.from({length:a.length},(e,t)=>t);e.sort((e,t)=>{let n=a[e],r=a[t];return(n.position.x-3e3)*(n.position.x-3e3)+n.position.y*n.position.y-((r.position.x-3e3)*(r.position.x-3e3)+r.position.y*r.position.y)}),a[e[0]].agitator=!0;for(let t=1;t<3&&t<e.length;t++){let n=t+Math.floor(Math.random()*(e.length-t)),r=e[t];e[t]=e[n],e[n]=r,a[e[t]].agitator=!0}}},[]);return{spheresRef:e,update:n}})(),[,y]=(0,l.zh)(()=>({from:{opacity:0},onChange:e=>{p.current=e.value.opacity}}));(0,a.useEffect)(()=>(n(!0),()=>{h.dispose()}),[]),(0,c.Ql)((e,t)=>{let n=performance.now()/1e3;x(t,n),s.current=v.current;let r=v.current,a=f.current;if(a){let e=a.material.uniforms;e.uTime.value=n,e.uOpacity.value=p.current,eE(e,r)}let o=d.current;o&&(o.uniforms.uTime.value=n,eE(o.uniforms,r))});let w=()=>{m.current=!0,y.start({from:{opacity:0}
53,to:{opacity:1},config:{duration:2e3}})},R=()=>{y.start({opacity:0,config:{duration:300},onRest:()=>{m.current=!1}})};return(0,a.useImperativeHandle)(t,()=>({present:w,dismiss:R})),(0,r.jsxs)("group",{position:[-3e3,0,0],children:[(0,r.jsx)("mesh",{geometry:h,renderOrder:0,children:(0,r.jsx)("shaderMaterial",{ref:d,vertexShader:"/* ââ Contact Elastic Grid Depth Vertex Shader ââ */\n\n#define MAX_SPHERES 30\n\nuniform float uTime;\nuniform vec2 uSpherePositions[MAX_SPHERES];\nuniform float uSphereRadii[MAX_SPHERES];\nuniform float uSphereStrengths[MAX_SPHERES];\nuniform int uActiveSphereCount;\nuniform float uMaxDisplacement;\nuniform float uXYStretchScale;\n\n#include <common>\n#include <logdepthbuf_pars_vertex>\n\nvoid main() {\n vec3 pos = position;\n\n vec3 worldXY = (modelMatrix * vec4(pos, 1.0)).xyz;\n\n float totalInfluence = 0.0;\n vec2 totalXYDisp = vec2(0.0);\n\n for (int i = 0; i < MAX_SPHERES; i++) {\n if (i >= uActiveSphereCount) break;\n vec2 d = worldXY.xy - uSpherePositions[i];\n float r = uSphereRadii[i];\n\n /* Early exit: skip out-of-range spheres via squared distance */\n float dist2 = dot(d, d);\n if (dist2 > r * r) continue;\n\n float dist = sqrt(dist2);\n float t = dist / r;\n float g = 1.0 - t * t;\n g = g * g * g;\n totalInfluence += g * uSphereStrengths[i];\n\n /* XY stretch: same as main shader */\n if (dist > 0.001) {\n float slope = 6.0 * t * (1.0 - t * t) * (1.0 - t * t);\n totalXYDisp += d / dist * slope * uSphereStrengths[i];\n }\n }\n\n /* Apply XY stretch */\n pos.xy += totalXYDisp * uMaxDisplacement * uXYStretchScale;\n\n pos.z += totalInfluence * uMaxDisplacement;\n\n /* Small offset behind surface to avoid z-fighting with grid surface */\n pos.z -= 0.5;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/* ââ Contact Elastic Grid Depth Fragment Shader ââ */\n\n#include <logdepthbuf_pars_fragment>\n\nvoid main() {\n #include <logdepthbuf_fragment>\n}\n",uniforms:g,colorWrite:!1,depthWrite:!0,depthTest:!0,side:o.hB5})}),(0,r.jsx)("mesh",{geometry:h,renderOrder:1,children:(0,r.jsx)(eP,{ref:f})})]})});eU.displayName="SketchElasticGridRenderer";let eO=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,o=(0,a.useRef)(null),i=(0,a.useRef)(null),s=(0,a.useRef)(null),l=(0,a.useRef)(null);j(o);let u=(0,a.useCallback)(()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]),c=(0,a.useCallback)(e=>{let{annotationDelay:t}=e;u(),i.current?.present(),l.current=setTimeout(()=>{l.current=null,s.current?.present()},t)},[u]),f=(0,a.useCallback)(()=>{u(),s.current?.dismiss(),i.current?.dismiss()},[u]);return(0,a.useEffect)(()=>()=>{u()},[u]),(0,a.useImperativeHandle)(t,()=>({present:c,dismiss:f}),[c,f]),(0,r.jsxs)(G,{ref:o,layers:n,name:_.eU.SKETCH_BACKGROUND,cameraFollowConfig:B._h.elasticgrid,dofConfig:B.HD.elasticgrid,children:[(0,r.jsx)(eU,{ref:i}),(0,r.jsx)(eT,{ref:s})]})});eO.displayName="SketchElasticGridExperience";let eF={contourmap:ee,elasticgrid:eO,curtainwall:ex},eN=(0,a.forwardRef)((e,t)=>{let{activePattern:n,layers:a}=e,o=eF[n];return(0,r.jsx)(o,{ref:t,layers:a},n)});eN.displayName="SketchExperienceHost";var eL=n(5874),ez=n(6382);let eV=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{sketchHeaderScene:o,setIsSketchHeaderRendererReady:s}=(0,a.useContext)(V.CM),u=(0,a.useRef)(o).current,{layoutMargins:f,headerScale:d}=(0,a.useContext)(V.MQ),m=(0,a.useRef)(f);m.current=f;let p=(0,a.useRef)(d);p.current=d;let h=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null);(0,i.C)(e=>e.size);let x=(0,i.C)(e=>e.pointer),y=(0,a.useRef)(null),w=(0,a.useRef)({x:0*ez.V$,y:2*ez.V$}),R=(0,a.useRef)({x:-(0*ez.V$),y:-(.2*ez.V$)}),C=(0,l.zh)(()=>({from:{rx:h.current?.rotation.x??0,ry:h.current?.rotation.y??0},onChange:e=>{h.current.rotation.x=e.value.rx,h.current.rotation.y=e.value.ry}}),[])[1],b=e=>{T(),v.current?.present(e)},S=()=>{v.current?.dismiss()},T=()=>{if(!v.current||!y.current?.camera||!g.current||!h.current)return;g.current.scale.set(p.current,p.current,1);let e=y.current.camera,t=2*Math.tan(e.fov*(Math.PI/180)/2)*e.position.z,n=t*e.aspect,r=v.current.getBoundingBoxSize();g.current.position.x=-r.x/2,h.current.position.x=e.position.x-n/2+n*m.current.left+r.x/2,h.current.position.y=e.position.y+t/2-t*m.current.top+r.y/2},P=e=>{let t=w.current.x+x.y*R.current.x+R.current.x,n=w.current.y+-x.x*R.current.y+R.current.y;C.stop(!0),C.start({to:{rx:t,ry:n},config:{duration:400,easing:l.le.easeOutCubic}})};return(0,c._B)("deeppink"),(0,a.useEffect)(()=>{u.current=y.current},[]),(0,a.useEffect)(()=>(window.addEventListener("mousemove",P),()=>window.removeEventListener("mousemove",P)),[]),(0,a.useLayoutEffect)(()=>{T()},[d,f]),(0,a.useImperativeHandle)(t,()=>({present:b,dismiss:S})),(0,r.jsx)(U,{ref:y,layers:n,name:_.eU.SKETCH_HEADER,children:(0,r.jsx)("group",{ref:h,layers:n,children:(0,r.jsx)("group",{ref:g,layers:n,children:(0,r.jsx)(eL.g,{ref:v,layers:n,position:[0,0,0],onInitialized:()=>{T(),s(!0)}})})})})});var ek=n(6133),eG=n(2488),eB=n(5844),ej=n(108);let e$=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{play:o,stop:s}=(0,a.useContext)(V.nE),{activePattern:u,pendingPattern:c,switchPattern:f,setIsSketchPatternSelectorRendererReady:d}=(0,a.useContext)(V.CM),{layoutMargins:m}=(0,a.useContext)(V.MQ),{primaryTexture:p}=(0,a.useContext)(V.Oo),h=(0,a.useRef)(m);h.current=m;let g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null),R=(0,a.useRef)(null),C=(0,a.useRef)([]),b=(0,a.useRef)(!1),S=(0,a.useRef)(u),T=(0,i.C)(e=>e.size),P=B.BX.selector.buttonSize,M=ej.qp.length,A=P*M,D=A/2,U=e=>-D+P*e+P/2,O=e=>ej.qp.findIndex(t=>t.key===e),[F,N]=(0,l.zh)(()=>({from:{progress:0},onChange:e=>y.current?.setOpacityRatio(e.value.progress)}),[]),[L,z]=(0,l.zh)(()=>({from:{progress:0},onChange:e=>R.current?.setOpacityRatio(e.value.progress)}),[]),[k,G]=(0,l.zh)(()=>({from:{progress:0},onChange:e=>R.current?.hover(e.value.progress)}),[]),j=()=>{b.current=!0;let e=B.BX.selector.presentDuration;w.current?.present(300,0),N.start({from:{progress:F.progress},to:{progress:1},config:{duration:300}}),C.current.forEach((t,n)=>{t?.present(e,B.BX.selector.presentStagger*n)});let t=B.BX.selector.presentStagger*(M-1)+300;z.start({from:{progress:L.progress},to:{progress:1},delay:t,config:{duration:300}});let n=O(u);R.current?.slideToImmediate(U(n)),S.current=u},$=()=>{let e=B.BX.selector.dismissDuration;w.current?.dismiss(e,0),N.start({from:{progress:F.progress},to:{progress:0},config:{duration:e}}),z.start({from:{progress:L.progress},to:{progress:0},config:{duration:e}}
53),C.current.forEach(t=>t?.dismiss(e,0)),G.start({from:{progress:k.progress},to:{progress:0},config:{duration:.1*e,easing:l.le.linear},onRest:()=>{b.current=!1}})},W=(0,a.useCallback)(e=>{if(!b.current||null!==c)return;s(eB.uc.SFX_CONTENT_MENU_HOVER),o(eB.uc.SFX_CONTENT_MENU_HOVER,eG.z.sfx.content.menuHover,!1);let t=ej.qp[e];t&&t.key===S.current&&(G.stop(!0),G.start({from:{progress:k.progress},to:{progress:1},config:{duration:B.BX.selector.bracketExpandDuration,easing:l.le.linear}}))},[c,s,o,G,k.progress]),H=(0,a.useCallback)(e=>{let t=ej.qp[e];t&&t.key===S.current&&(G.stop(!0),G.start({from:{progress:k.progress},to:{progress:0},config:{duration:B.BX.selector.bracketExpandDuration,easing:l.le.linear}}))},[G,k.progress]),Y=(0,a.useCallback)(e=>{if(null!==c)return;let t=ej.qp[e];if(!t||t.key===S.current)return;s(eB.uc.SFX_CONTENT_MENU_CLICK),o(eB.uc.SFX_CONTENT_MENU_CLICK,eG.z.sfx.content.menuClick,!1);let n=-(B.BX.selector.buttonSize*ej.qp.length/2)+B.BX.selector.buttonSize*e+B.BX.selector.buttonSize/2;R.current?.slideTo(n),S.current=t.key,G.stop(!0),G.start({to:{progress:0},immediate:!0}),f(t.key)},[c,s,o,G,f]);(0,a.useEffect)(()=>{if(!v.current||!x.current)return;let e=v.current,t=2*Math.tan(e.fov*(Math.PI/180)/2)*e.position.z;x.current.position.x=e.position.x,x.current.position.y=e.position.y-t/2+t*h.current.bottom+t*B.BX.selector.marginBottom},[T]),(0,a.useEffect)(()=>{p&&w.current&&w.current.setDiffuseTexture(p)},[p]),(0,a.useEffect)(()=>{d(!0)},[]),(0,a.useImperativeHandle)(t,()=>({present:j,dismiss:$}));let X=O(u);return(0,r.jsxs)(_.Yi,{ref:g,renderPriority:9e3,children:[(0,r.jsx)(I.u,{ref:v,layers:n,name:_.eU.SKETCH_OVERLAY,makeDefault:!0,position:E.Q7,fov:E.pq,far:1e4}),(0,r.jsxs)("group",{ref:x,children:[(0,r.jsx)(ek.pi,{ref:w,layers:n,renderOrder:401,width:A,height:P,blur:.3,opacity:.7,transparent:!0}),(0,r.jsx)(ek.Vx,{ref:y,layers:n,renderOrder:402,cellWidth:P,cellHeight:P,columnCount:M}),ej.qp.map((e,t)=>(0,r.jsx)("group",{position:[U(t),0,0],children:(0,r.jsx)(ek.KE,{ref:e=>{C.current[t]=e},layers:n,renderOrder:402,label:String(e.id+1).padStart(2,"0"),buttonWidth:P,buttonHeight:P,fontSize:B.BX.selector.fontSize,hoverGlitchDuration:B.BX.selector.hoverGlitchDuration,hoverWipeDuration:B.BX.selector.hoverWipeDuration,isActive:e.key===u,idleGlitch:e.key===u,onHoverStart:()=>W(t),onHoverEnd:()=>H(t),onClick:()=>Y(t)})},e.id)),(0,r.jsx)(ek.YY,{ref:R,layers:n,renderOrder:403,bracketWidth:P,bracketHeight:P,bracketLength:B.BX.selector.bracketLength,slideDuration:B.BX.selector.bracketSlideDuration,initialX:U(X)})]})]})});var eW=n(4120),eH=n(3882);let eY=(0,a.forwardRef)((e,t)=>{let{fade:n}=(0,a.useContext)(V.nE),{setIsNavigationVisible:l,setFooterVisible:u,configureNavigationAnimation:f,configureNavigationCamera:d}=(0,a.useContext)(V._3),{shouldPresentContent:m,isAllRendererReady:p,activePattern:h,pendingPattern:g,onDismissComplete:v}=(0,a.useContext)(V.CM),x=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null),R=(0,a.useRef)(null),C=(0,a.useRef)(null),b=(0,a.useRef)(null),S=(0,a.useRef)(null),{size:T}=(0,i.C)(),P=()=>{let e=T.height/eW.P;return{minX:T.width/2+70*e,maxX:T.width-40*e,minY:Math.min(150*e,T.height/4),maxY:T.height/2-70*e}},M=e=>{},A=e=>{w.current?.dismiss(),x.current.dismiss(),l(!1),y.current.dismiss(),R.current?.dismiss(),n(eB.uc.BGM_SKETCH,0,0,4e3,!0)};(0,c._B)("green"),(0,a.useEffect)(()=>{f(P())},[T]);let D=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{p&&(D.current?x.current.present({annotationDelay:500}):(D.current=!0,(0,eH.Rm)("green","â¶ï¸","onRenderersReady"),n(eB.uc.BGM_SKETCH,eG.z.bgm.sketch.main,0,6e3,!0),w.current?.present(0),x.current.present({annotationDelay:1e3}),C.current=setTimeout(()=>{C.current=null,y.current?.present()},1e3),d({eye:E.Sy.clone().add(new o.Pq0(0,0,400)),fov:36}),f({animate:!1,showMarker:!0,parentLerpX:.04,parentLerpY:.04,parentLerpZ:.04,childLerpX:.08,childLerpY:.08,childLerpZ:.08,angleStart:30,angleStep:30,...P()}),R.current?.present(1500),b.current=setTimeout(()=>{b.current=null,l(!0)},2e3),u(!0)))},[p]),(0,a.useEffect)(()=>{if(null!==g)return x.current.dismiss(),S.current=setTimeout(()=>{S.current=null,v()},B.BX.switchDismissDuration),()=>{S.current&&clearTimeout(S.current)}},[g]),(0,a.useEffect)(()=>()=>{C.current&&clearTimeout(C.current),b.current&&clearTimeout(b.current),S.current&&clearTimeout(S.current)},[]),(0,a.useImperativeHandle)(t,()=>
53({onRoutePresentStart:M,onRouteDismissStart:A})),m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.DA,{ref:R,config:B.BX.snapSymbol}),(0,r.jsx)(eN,{ref:x,activePattern:h,layers:void 0}),(0,r.jsx)(e$,{ref:y,layers:void 0}),(0,r.jsx)(eV,{ref:w,layers:void 0})]})})},1780:(e,t,n)=>{n.d(t,{u:()=>r});let r={layout:{margin:1400,imageWidth:1e3},focusIn:{cameraDuration:1e3,autoDetailThreshold:.75,unfocusDuration:800},float:{margins:{top:140,right:50,bottom:80,left:50},maxSize:{portrait:{width:768,height:1280}},portraitMinContentScale:1.1,landscapeScale:{base:{width:1280,height:800,viewportHeight:1440},ceiling:{width:1920,height:1200,viewportHeight:2160}}},indicator:{buttonSize:32,fontSize:16,outlineColor:8487297,outlineOpacity:.5,bracketColor:8487297,bracketOpacity:1,bracketLength:4,offsetY:30,presentDuration:600,presentStagger:100,dismissDuration:400,bracketSlideDuration:200,bracketExpandDuration:100,hoverGlitchDuration:600,hoverWipeDuration:100},dismiss:{imageDuration:200},thumbGrid:{maxDepth:10,splitJitter:.2,totalDuration:2400,shuffleInterval:1200,presentOpacityDuration:2e3,dismissOpacityDuration:500,hoverMode:"rePresent",hoverTotalDuration:800,microShuffleRate:3,microShuffleLockDelay:8,microShuffleTargetMode:"random",hoverOpacityDuration:10,hoverLeaveDuration:200,hoverClickDuration:500,hoverPlateBaseline:.3,hoverPlateHover:0,flashHoverDuration:600,flashClickDuration:1200,flashPlateHoverSpike:.6,flashPlateClickSpike:.9,caMultiplier:1,checkerCols:256},glitchTransition:{duration:600,rgbShiftAmount:.08,scanlineEnabled:!0,scanlineFrequency:1200,scanlineSpeed:10,scanlineIntensity:.3,stripDisplaceEnabled:!0,stripCount:40,stripDisplaceAmount:.06,stripFlickerRate:12,waveEnabled:!0,waveFrequency:15,waveAmount:.25,waveSpeed:8,dismissFadeDelay:300,dismissImageDuration:200,dismissTextDuration:200},loadingRing:{outerRadius:64,innerRadius:52,segments:10,gapAngle:.08,baseColor:3355443,activeColor:0x999999,fadeDuration:150,fadeInDuration:300,fadeOutDuration:300,minDisplayTime:500,loaderToGlitchDelay:300},gis:{dataScale:6,point:{color:0xaaaaaa,baseSize:2,radius:.5,referenceHeight:1280,opacityMultiplier:.9},segment:{color:0xcccccc,lineWidth:6,opacityMultiplier:.8},fboScale:.75,layers:{gis:8,float:10},ca:{strength:.008,baseIntensity:.3,present:{peak:3,duration:800},rotation:{max:2,refSpeed:.8,lerp:200},movement:{max:2,refSpeed:400}},meshOpacityMultiplier:1,groundEffect:{pulseColor:0xffffff,pulseMaxRadius:5e3,pulseDecayWidth:3e3,pulseWaveDuration:2400,pulseCircleWidth:1,pulseFaceOpacityMin:.4,pulseFaceOpacityMax:.8,pulseEdgeBoost:2,pulseFadeDuration:2400,ringColor:0xcccccc,ringInnerRadius:700,ringOuterRadius:800,ringProgressDuration:1e3,ringDismissDuration:500,thumbPulseEdgeBoost:.4,thumbPulseFaceOpacity:.001,thumbPulseCAStrength:3,agentProximityNear:200,agentProximityFar:550,agentEdgeIntensity:.3,agentCAStrength:.9,groundPulseCAStrength:2,attenuationDistanceNear:4e3,attenuationDistanceFar:9e3,attenuationDistanceMin:.01,attenuationProximityNear:1400,attenuationProximityFar:2200,agentProximityFadeInMs:800,agentProximityFadeOutMs:400},bloom:{strength:3,tint:0xe8fbff,kernelRadius:36,mipWeights:[1,.8,.6],bloomIntensity:.6,bloomLayer:11},compass:{enabled:!1,yOffset:0,tickHeight:100,lineWidth:1,dotSize:3,tickColor:0xcccccc,cardinalFontSize:160,ordinalFontSize:102,degreeFontSize:60,labelColor:0xcccccc,labelGap:40,directionGap:60,attenuationNear:4e3,attenuationFar:6e3,attenuationMin:.1,presentDelay:1e3,elementStaggerDuration:3200,elementStaggerDelay:600,groupIntervalDeg:15,dismissDuration:600,arc:{color:0xcccccc,dashAngle:1,gapAngle:3,segmentsPerDegree:1,innerRing:{radius:1,yOffset:0,lineWidth:2,dashed:!1},outerRing:{radius:1.05,yOffset:0,lineWidth:1,dashed:!0}}},trace:{startDelay:2500,initialStagger:3e3,attenuation:{distanceNear:4e3,distanceFar:9e3,distanceMin:.01,proximityFar:2200,proximityNear:1400}},gisAttenuation:{distanceNear:6e3,distanceFar:12e3,distanceMin:.1},lighting:{ambientIntensity:.1,spotPosition:[0,6e3,0],spotColor:0xffffff,spotIntensity:1e5,spotAngle:60,spotPenumbra:1.2,spotDecay:1.5,pointPositions:[[-1600,1500,1e3],[0,1500,1e3],[1600,1500,1e3]],pointDistance:6e3,pointIntensity:6e5,pointDecay:2},trail:{count:2,maxSegments:150,targetDistanceMin:.33,targetDistanceMax:.45,headDuration:3e3,tailDuration:1e3,fadeStart:.5,delay:800,lineWidth:10,yOffset:20,color:0xcf7c73,opacity:.8,thumbMargin:800,bloomIntensity:.2,endpointSamples:20,maxRouteAttempts:5,miterEpsilon:1e-4,miterMa
53xScale:2},gridAnnotation:{yOffset:30,triangleLabelGap:6,triangleSize:16,triangleColor:0xcccccc,labelFontSize:16,labelColor:0xcccccc,proximityNear:300,proximityFar:750,proximityFadeInMs:800,proximityFadeOutMs:400,renderOrder:299,pulseEdgeBoost:1.5,vertexQuantizationInv:100},pathFinder:{count:10,speed:300,speedVariance:.15,lifetime:16e3,lifetimeVariance:.25,dotInDuration:400,ringInDuration:1e3,ringOutDuration:200,dotOutDuration:100,respawnDelay:1e3,dot:{radius:8,color:0xcf7c73,yOffset:10},ring:{innerRadius:25,radius:40,color:0xcf7c73,yOffset:20},thumb:{margin:800,fadeOutDuration:800,fadeInDuration:1e3},spawn:{cellSize:1e3,minSpawnDistance:1500,bounds:{minX:-3e3,maxX:3e3,minZ:0,maxZ:3e3},maxCellAttempts:10,maxSegAttempts:5},thumbFadeVisibilityThreshold:.01,annotation:{nodePlateMarginX:6,nodePlateMarginTop:5,nodePlateMarginBottom:1,textPadding:4,labelWorldHeight:100,nodeFontSize:16,coordFontSize:16,dirFontSize:16,nodeGap:6,dirGap:2,bottomLineGap:12,connectorLength:160,connectorOpacity:1,dotRadius:5,dotOpacity:1,labelOpacity:1,bottomLineOpacity:.5,endpointRadius:4,endpointOpacity:.5,color:0xcf7c73,lerpFactor:3,fadeInDuration:600,fadeOutDuration:100,atlasColumns:4,opacityThreshold:.005,atlasUpdateHz:30},connection:{distanceThreshold:1500,fadeDuration:200,lineHalfWidth:.5,baseOpacity:.8,color:0xcf7c73,yOffset:20,endpointRadiusRatio:.95,subSegments:20,endpointBlendRatio:.2,miterLimit:4,visibilityThreshold:.001}},groundHeightmap:{resolution:256,cameraMargin:100},dust:{count:800,bounds:{minX:-7e3,maxX:7e3,minY:50,maxY:5e3,minZ:-2e3,maxZ:4e3},sizeMin:2,sizeMax:10,referenceHeight:1280,color:0xffffff,opacity:.2,softnessNear:1,softnessFar:.3,softnessDistanceNear:300,softnessDistanceFar:4e3,caOffset:.2,drift:{direction:[.3,.05,.1],speed:45},brownian:{freqLow:[.15,.1,.12],ampLow:[80,60,70],freqHigh:[.5,.4,.45],ampHigh:[20,15,18]},attenuation:{distanceNear:4e3,distanceFar:9e3,distanceMin:.01,proximityNear:400,proximityFar:1500},presentDuration:800},segmentGraph:{vertexMergeEpsilon:.1,thumbPenalty:1e5,longEdgeThreshold:500,longEdgePenalty:2e5,sharpTurnPenalty:2e4}},video:{gain:.2}}},1816:(e,t,n)=>{n.d(t,{re:()=>a,bN:()=>r,FZ:()=>o,bn:()=>c});let r="/*\n * Fullscreen quad vertex shader for bloom blur and composite passes.\n */\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",a="/*\n * Separable Gaussian blur for bloom mip chain.\n * Used for both horizontal and vertical passes â direction controlled by uDirection.\n */\n\n#define KERNEL_SIZE 4\n\n/*\n * The input texture to blur.\n */\nuniform sampler2D tInput;\n\n/*\n * The blur direction in texel-space: (1/width, 0) for H, (0, 1/height) for V.\n */\nuniform vec2 uDirection;\n\n/*\n * The Gaussian sigma (controls kernel spread).\n */\nuniform float uKernelRadius;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 sum = vec4(0.0);\n float weightSum = 0.0;\n\n for (int i = -KERNEL_SIZE; i <= KERNEL_SIZE; i++) {\n float fi = float(i);\n float weight = exp(-0.5 * (fi * fi) / (uKernelRadius * uKernelRadius));\n sum += texture2D(tInput, vUv + uDirection * fi) * weight;\n weightSum += weight;\n }\n\n gl_FragColor = sum / weightSum;\n}\n",o="/*\n * Bloom composite shader: combines 2 mip levels with weighted additive blending.\n */\n\n/*\n * Mip 0 blur result (quarter-res).\n */\nuniform sampler2D tBloomMip0;\n\n/*\n * Mip 1 blur result (eighth-res).\n */\nuniform sampler2D tBloomMip1;\n\n/*\n * Overall bloom intensity multiplier.\n */\nuniform float uStrength;\n\n/*\n * Bloom color tint.\n */\nuniform vec3 uTint;\n\n/*\n * Per-mip weights (x=mip0, y=mip1).\n */\nuniform vec2 uMipWeights;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec3 bloom = texture2D(tBloomMip0, vUv).rgb * uMipWeights.x + texture2D(tBloomMip1, vUv).rgb * uMipWeights.y;\n\n gl_FragColor = vec4(bloom * uStrength * uTint, 1.0);\n}\n";var i=n(7973),s=n(6065),l=n(9618),u=n(1780);let c=(0,s.forwardRef)((e,t)=>{let{...n}=e,r=(0,s.useRef)(null);(0,s.useImperativeHandle)(t,()=>({material:r.current}));let a=u.u.gis.groundEffect,o=u.u.gis.bloom;return(0,s.useMemo)(()=>(0,i.jsx)("shaderMaterial",{ref:r,transparent:!0,depthWrite:!1,depthTest:!0,side:l.hB5,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/*\n * The world position for ring distance calculations.\n */\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 worldPos = modelMatrix * vec4(position, 1.0
53);\n vWorldPosition = worldPos.xyz;\n gl_Position = projectionMatrix * viewMatrix * worldPos;\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <common>\n#include <logdepthbuf_pars_fragment>\n\n/*\n * The donut ring center in world space.\n */\nuniform vec3 uRingCenter;\n\n/*\n * The donut ring inner radius.\n */\nuniform float uRingInnerRadius;\n\n/*\n * The donut ring outer radius.\n */\nuniform float uRingOuterRadius;\n\n/*\n * The arc sweep progress 0â1.\n */\nuniform float uRingProgress;\n\n/*\n * The donut ring alpha.\n */\nuniform float uRingOpacity;\n\n/*\n * The donut ring color.\n */\nuniform vec3 uRingColor;\n\n/*\n * The bloom emissive intensity multiplier.\n */\nuniform float uBloomIntensity;\n\n/*\n * The world position from vertex shader.\n */\nvarying vec3 vWorldPosition;\n\nvoid main() {\n /* Annulus mask: smoothstep between inner and outer radius */\n float ringDist = distance(vWorldPosition.xz, uRingCenter.xz);\n float aa = fwidth(ringDist);\n float ringMask = smoothstep(uRingInnerRadius - aa, uRingInnerRadius + aa, ringDist) * smoothstep(uRingOuterRadius + aa, uRingOuterRadius - aa, ringDist);\n\n /* Arc sweep: offset by PI so the arc starts from the camera-facing side (+Z) */\n float arcMask = 1.0;\n if (uRingProgress < 1.0) {\n float angle = atan(vWorldPosition.x - uRingCenter.x, vWorldPosition.z - uRingCenter.z);\n float normalizedAngle = (angle + PI) / (2.0 * PI);\n arcMask = step(normalizedAngle, uRingProgress);\n }\n\n float ringAlpha = ringMask * arcMask * uRingOpacity;\n if (ringAlpha < 0.001) discard;\n\n gl_FragColor = vec4(uRingColor * ringAlpha * uBloomIntensity, ringAlpha);\n #include <logdepthbuf_fragment>\n}\n",uniforms:{uRingCenter:new l.nc$(new l.Pq0(0,0,0)),uRingInnerRadius:new l.nc$(a.ringInnerRadius),uRingOuterRadius:new l.nc$(a.ringOuterRadius),uRingProgress:new l.nc$(0),uRingOpacity:new l.nc$(0),uRingColor:new l.nc$(new l.Q1f(a.ringColor)),uBloomIntensity:new l.nc$(o.bloomIntensity)},...n}),[])});c.displayName="ProductRingBloomSourceMaterial"}
53,1902:(e,t,n)=>{n.d(t,{fG:()=>o,ff:()=>i,sT:()=>a});var r=n(9618);let a=function(e,t){let n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{min:0,max:1},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{min:0,max:1},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{min:0,max:1},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{min:0,max:1},l=e*t,u=new Float32Array(4*l);for(n=0;n<l;n++){let e=4*n;u[e+0]=r.cj9.randFloat(a.min,a.max),u[e+1]=r.cj9.randFloat(o.min,o.max),u[e+2]=r.cj9.randFloat(i.min,i.max),u[e+3]=r.cj9.randFloat(s.min,s.max)}let c=new r.GYF(u,e,t,r.GWd,r.RQf);return c.needsUpdate=!0,c},o=function(e,t){let n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{min:0,max:1},o=e*t,i=new Float32Array(4*o);for(n=0;n<o;n++){let e=4*n,t="number"==typeof a?a:r.cj9.randFloat(a.min,a.max);i[e+0]=t,i[e+1]=t,i[e+2]=t,i[e+3]=1}let s=new r.GYF(i,e,t,r.GWd,r.RQf);return s.needsUpdate=!0,s},i=(e,t,n,a,o,i)=>{let s,l=e*t,u=new Float32Array(4*l);for(s=0;s<l;s++){let e=4*s,t="number"==typeof n?n:r.cj9.randFloat(n.min,n.max),l="number"==typeof a?a:r.cj9.randFloat(a.min,a.max),c="number"==typeof o?o:r.cj9.randFloat(o.min,o.max),f="number"==typeof i?i:r.cj9.randFloat(i.min,i.max);u[e+0]=t,u[e+1]=l,u[e+2]=c,u[e+3]=f}let c=new r.GYF(u,e,t,r.GWd,r.RQf);return c.needsUpdate=!0,c}},1944:(e,t,n)=>{n.d(t,{Q:()=>l});var r=n(1343),a=n(6065),o=n(3267);let i=1/240,s=1/30,l=(e,t)=>{let n,l,f=(0,r.c)(4),d=(0,o.C)(u);f[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],f[0]=n):n=f[0];let m=(0,a.useRef)(n);f[1]!==e||f[2]!==d?(l=(t,n,r)=>{let a=n;isNaN(a)&&(a=d.getDelta()),a<i&&(a=i),a>s&&(a=s),a>0&&m.current.push(a),(0===a||isNaN(a))&&m.current.length>0&&(a=m.current.reduce(c,0)/m.current.length),isNaN(a)||e(t,a,r),m.current.length>240&&m.current.shift()},f[1]=e,f[2]=d,f[3]=l):l=f[3],(0,o.D)(l,t)};function u(e){return e.clock}function c(e,t){return e+t}},2103:(e,t,n)=>{n.d(t,{q:()=>o});var r=n(9618),a=n(6382);class o extends Object{static MAX_TRIANGLE_DATA_LENGTH=464;index;vertices;colors;normals;midpoint;rotation;angleVelocity;radius;isDummy;constructor(e,t,n){super(),this.index=-1,this.vertices=e,this.colors=[t,t,t];const o=e[0],i=e[1],s=e[2],l=new r.Pq0().subVectors(i,o),u=new r.Pq0().subVectors(s,o),c=new r.Pq0().crossVectors(l,u).normalize();this.normals=[c,c,c],this.midpoint=new r.Pq0().addVectors(o,i).add(s).divideScalar(3),this.rotation=new r.Pq0(r.cj9.randFloatSpread(180),r.cj9.randFloatSpread(180),0).multiplyScalar(a.V$),this.angleVelocity=new r.Pq0(r.cj9.randFloat(.6,.3)*(r.cj9.randFloatSpread(1)>0?1:-1),r.cj9.randFloat(.6,.3)*(r.cj9.randFloatSpread(1)>0?1:-1),r.cj9.randFloat(.6,.3)*(r.cj9.randFloatSpread(1)>0?1:-1)).multiplyScalar(a.V$),this.radius=new r.Pq0(r.cj9.randFloat(2e3,2e3)*(r.cj9.randFloatSpread(1)>0?1:-1),r.cj9.randFloat(2e3,2e3)*(r.cj9.randFloatSpread(1)>0?1:-1),r.cj9.randFloat(2e3,2e3)*(r.cj9.randFloatSpread(1)>0?1:-1)),this.isDummy=n}getScreenCoordinate(e){let t=window.innerWidth/2,n=window.innerHeight/2,a=this.midpoint.clone();return a.project(e.clone()),a.x=a.x*t+t,a.y=-(a.y*n)+n,new r.I9Y(a.x,a.y)}}},2310:(e,t,n)=>{n.d(t,{yP:()=>d,DM:()=>h.D,sY:()=>h.s,nE:()=>g.n,qL:()=>g.q,LC:()=>v.LC,fn:()=>v.fn,_U:()=>v._U,uN:()=>R,FX:()=>C,Ir:()=>b,Xv:()=>S,Oo:()=>P,xk:()=>M,lq:()=>A,AX:()=>D,WD:()=>I,mx:()=>U,MQ:()=>N,z4:()=>L,$Z:()=>V.$Z,yF:()=>V.yF,el:()=>V.el,bQ:()=>V.bQ,_3:()=>j,NL:()=>$,z_:()=>q,Mg:()=>Z,_f:()=>Y,Pl:()=>eo,W4:()=>ei,bC:()=>ea,CM:()=>T.C,dM:()=>T.d,pn:()=>f,zS:()=>E});var r,a,o,i=n(7973),s=n(1343),l=n(6065);let u=()=>{},c=(0,l.createContext)({sendEvent:u,setCurrentPage:u}),f=()=>(0,l.useContext)(c),d=e=>{let t,n,r,a,o,f,d,m,p,h=(0,s.c)(10),{children:g}=e,v=(0,l.useRef)(""),x=(0,l.useRef)("");h[0]===Symbol.for("react.memo_cache_sentinel")?(t="u">typeof performance?performance.now():0,h[0]=t):t=h[0];let y=(0,l.useRef)(t),w=(0,l.useRef)(0);h[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{""===x.current&&(x.current=e),v.current=e,w.current=w.current+1},h[1]=n):n=h[1];let R=n;h[2]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{let t=JSON.stringify({...e,page:v.current,referrer:document.referrer});if(navigator.sendBeacon){let e=new Blob([t],{type:"application/json"});navigator.sendBeacon("/api/beacon",e)||fetch("/api/beacon",{method:"POST",body:t,keepalive:!0,headers:{"Content-Type":"application/json"}}).catch(u)}else fetch("/api/beacon",{method:"POST",body:t,keepalive:!0,headers:{"Content-Type":"application/json"}}).catch(u)},h[2]=r):r=h[2];let C=r;h[3]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{let e=0,t=0,n=0,r=0,a=0,o=i=>{let s=i-n;s>t&&(t=s),n=i,e+=1;let l=i-r;l>=1e4&&(C({event:"fps_sample",fps_avg:Math.round(1e3*e/l*10)/10,fps_min:Math.round(10*(t>0?1e3/t:0))/10,sample_window_ms:Math.round(l)}),e=0,t=0,r=i),a=requestAnimationFrame(o)},i=()=>
53{if(0!==a)return;let i=performance.now();e=0,t=0,n=i,r=i,a=requestAnimationFrame(o)},s=()=>{0!==a&&(cancelAnimationFrame(a),a=0)},l=()=>{"visible"===document.visibilityState?i():s()};return"visible"===document.visibilityState&&i(),document.addEventListener("visibilitychange",l),()=>{document.removeEventListener("visibilitychange",l),s()}},o=[C],h[3]=a,h[4]=o):(a=h[3],o=h[4]),(0,l.useEffect)(a,o),h[5]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{let e=()=>{let e=performance.now()-y.current;C({event:"session_duration",entry_page:x.current,last_page:v.current,total_ms:e,pages_viewed:w.current})};return window.addEventListener("pagehide",e),()=>window.removeEventListener("pagehide",e)},d=[C],h[5]=f,h[6]=d):(f=h[5],d=h[6]),(0,l.useEffect)(f,d),h[7]===Symbol.for("react.memo_cache_sentinel")?(m={sendEvent:C,setCurrentPage:R},h[7]=m):m=h[7];let b=m;return h[8]!==g?(p=(0,i.jsx)(c.Provider,{value:b,children:g}),h[8]=g,h[9]=p):p=h[9],p};var m=n(3882),p=((r=p||{}).NONE="NONE",r.START="START",r.PROGRESS="PROGRESS",r.COMPLETE="COMPLETE",r.CANCELLED="CANCELLED",r),h=n(4295),g=n(8815),v=n(5329),x=n(2466),y=n(8497);let w=["isContactScribbleRendererReady","isContactFormRendererReady","isContactHeaderRendererReady"],R=(0,l.createContext)({shouldPresentContent:!1,isAllRendererReady:!1,isContactScribbleRendererReady:!1,setIsContactScribbleRendererReady:()=>{},isContactFormRendererReady:!1,setIsContactFormRendererReady:()=>{},isContactHeaderRendererReady:!1,setIsContactHeaderRendererReady:()=>{},sceneCamera:{current:null},mouseRotationY:{current:0},contactScene:{current:null}}),C=e=>{let{children:t}=e,{shouldPerformLoading:n}=(0,l.useContext)(V.el),{sendEvent:r}=f();(0,x.Xw)(n,0);let[a,o]=(0,l.useState)(!1),{states:s,setters:u,isAllReady:c}=(0,x.i5)(w,"crimson"),d=(0,l.useRef)(null),m=(0,l.useRef)(null),p=(0,l.useRef)(0),h=(0,l.useRef)("u">typeof performance?performance.now():0),g=(0,l.useRef)(!1);(0,x.SK)(()=>o(!0)),(0,l.useEffect)(()=>{if(!s.isContactFormRendererReady||g.current)return;g.current=!0;let e=performance.now()-h.current;r({event:"scene_init_time",webgl_renderer:(0,y.J)(),duration_ms:Math.round(e),pixel_ratio:window.devicePixelRatio||1})},[s.isContactFormRendererReady,r]);let v=(0,l.useMemo)(()=>({shouldPresentContent:a,isAllRendererReady:c,isContactScribbleRendererReady:s.isContactScribbleRendererReady,setIsContactScribbleRendererReady:u.isContactScribbleRendererReady,isContactFormRendererReady:s.isContactFormRendererReady,setIsContactFormRendererReady:u.isContactFormRendererReady,isContactHeaderRendererReady:s.isContactHeaderRendererReady,setIsContactHeaderRendererReady:u.isContactHeaderRendererReady,sceneCamera:m,mouseRotationY:p,contactScene:d}),[a,c,s.isContactScribbleRendererReady,s.isContactFormRendererReady,s.isContactHeaderRendererReady]);return(0,i.jsx)(R.Provider,{value:v,children:t})},b=(0,l.createContext)({shouldPresentContent:!1,isAllRendererReady:!1,isErrorRendererReady:!1,setIsErrorRendererReady:()=>{},isErrorHeaderRendererReady:!1,setIsErrorHeaderRendererReady:()=>{},isErrorMessageRendererReady:!1,setIsErrorMessageRendererReady:()=>{},errorCode:404,errorMessage:"NOT FOUND",setError:()=>{},errorScene:{current:null},errorHeaderScene:{current:null},errorMessageScene:{current:null}}),S=e=>{let{children:t}=e,[n,r]=(0,l.useState)(!1),[a,o]=(0,l.useState)(404),[s,u]=(0,l.useState)("NOT FOUND"),c=(0,l.useCallback)((e,t)=>{o(e),u(t.toUpperCase())},[]),{states:f,setters:d,isAllReady:m}=(0,x.i5)(["isErrorRendererReady","isErrorHeaderRendererReady","isErrorMessageRendererReady"]),p=(0,l.useRef)(null),h=(0,l.useRef)(null),g=(0,l.useRef)(null),{isLoading:v}=(0,x.Gl)(!0,0);(0,x._B)("orangered"),(0,l.useEffect)(()=>{v||r(!0)},[v]);let y=(0,l.useMemo)(()=>({shouldPresentContent:n,isAllRendererReady:m,isErrorRendererReady:f.isErrorRendererReady,setIsErrorRendererReady:d.isErrorRendererReady,isErrorHeaderRendererReady:f.isErrorHeaderRendererReady,setIsErrorHeaderRendererReady:d.isErrorHeaderRendererReady,isErrorMessageRendererReady:f.isErrorMessageRendererReady,setIsErrorMessageRendererReady:d.isErrorMessageRendererReady,errorCode:a,errorMessage:s,setError:c,errorScene:p,errorHeaderScene:h,errorMessageScene:g}),[n,m,f.isErrorRendererReady,f.isErrorHeaderRendererReady,f.isErrorMessageRendererReady,a,s,c]);return(0,i.jsx)(b.Provider,{value:y,children:t})};var T=n(3698);let P=(0,l.createContext)({primaryTexture:null,setPrimaryTexture:()=>{},primaryCaptureExclude:{current:null}}),M=e=>{let t,n,r=(0,s.c)(5),{children:a}=e,[o,u]=(0,l.useState)(null),c=(0,l.useRef)(null);(0,x._B)("blue"),r[0]!==o?(t={primaryTexture:o,setPrimaryTexture:u,primaryCaptureExclude:c},r[0]=o,r[1]=t):t=r[1];let f=t;return r[2]!==a||r[3]!==f?(n=(0,i.jsx)(P.Provider,{value:f,children:a}),r[2]=a,r[3]=f,r[4]=n):n=r[4],n},A=(0,l.createContext)({shouldPresentContent:!1,isTransitioningToNextDataset:!1,setIsTransitioningToNextDataset:()=>{}
53,isAllRendererReady:!1,isBackgroundRendererReady:!1,isMeshRendererReady:!1,isOverlayRendererReady:!1,isParticleRendererReady:!1,isProfileRendererReady:!1,setIsBackgroundRendererReady:()=>{},setIsMeshRendererReady:()=>{},setIsOverlayRendererReady:()=>{},setIsParticleRendererReady:()=>{},setIsProfileRendererReady:()=>{},portraitDataset:null,profileDataset:null,portraitDatasetHolder:{current:null},profileDatasetHolder:{current:null},portraitOverlayScene:{current:null},portraitBokehScene:{current:null},portraitMeshScene:{current:null},profileScene:{current:null}}),D=e=>{let{children:t}=e,{shouldPerformLoading:n}=(0,l.useContext)(V.el),{sendEvent:r}=f(),[a,o]=(0,l.useState)(null),[s,u]=(0,l.useState)(null),c=(0,l.useRef)(null),d=(0,l.useRef)(null),[m,p]=(0,l.useState)(!1),h=(0,l.useRef)({dataset:null,count:0}),{portraitDataset:g,profileDataset:v,deferredParsedDatasets:w,isLoading:R}=(0,x.W$)(n,0,m),[C,b]=(0,l.useState)(!1),[S,T]=(0,l.useState)(!1),{states:P,setters:M,isAllReady:D}=(0,x.i5)(["isBackgroundRendererReady","isMeshRendererReady","isOverlayRendererReady","isParticleRendererReady","isProfileRendererReady"]),_=(0,l.useRef)(null),I=(0,l.useRef)(null),E=(0,l.useRef)(null),U=(0,l.useRef)(null),O=(0,l.useRef)("u">typeof performance?performance.now():0),F=(0,l.useRef)(!1);(0,l.useLayoutEffect)(()=>{c.current=a},[a]),(0,l.useLayoutEffect)(()=>{d.current=s},[s]),(0,x.SK)(()=>b(!0)),(0,l.useEffect)(()=>{R||!g||g.isEmpty||(o(g.clone()),u(v))},[R,g,v]),(0,l.useEffect)(()=>{if(!D||m)return;let e=()=>{p(!0)};return window.addEventListener("pointermove",e,{passive:!0}),window.addEventListener("pointerdown",e,{passive:!0}),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerdown",e)}},[D,m]),(0,l.useEffect)(()=>{let e=c.current;if(e){h.current.dataset!==e&&(h.current={dataset:e,count:0});for(let t=h.current.count;t<w.length;t++)(0,x.y5)(e,w[t]);h.current.count=w.length}},[w,a]),(0,l.useEffect)(()=>{if(!D||F.current)return;F.current=!0;let e=performance.now()-O.current;r({event:"scene_init_time",webgl_renderer:(0,y.J)(),duration_ms:Math.round(e),pixel_ratio:window.devicePixelRatio||1})},[D,r]);let N=(0,l.useMemo)(()=>({shouldPresentContent:C,isAllRendererReady:D,isBackgroundRendererReady:P.isBackgroundRendererReady,isMeshRendererReady:P.isMeshRendererReady,isOverlayRendererReady:P.isOverlayRendererReady,isParticleRendererReady:P.isParticleRendererReady,isProfileRendererReady:P.isProfileRendererReady,isTransitioningToNextDataset:S,setIsBackgroundRendererReady:M.isBackgroundRendererReady,setIsMeshRendererReady:M.isMeshRendererReady,setIsOverlayRendererReady:M.isOverlayRendererReady,setIsParticleRendererReady:M.isParticleRendererReady,setIsProfileRendererReady:M.isProfileRendererReady,setIsTransitioningToNextDataset:T,portraitDataset:a,profileDataset:s,portraitDatasetHolder:c,profileDatasetHolder:d,portraitOverlayScene:_,portraitMeshScene:E,portraitBokehScene:I,profileScene:U}),[C,D,P.isBackgroundRendererReady,P.isMeshRendererReady,P.isOverlayRendererReady,P.isParticleRendererReady,P.isProfileRendererReady,S,a,s]);return(0,i.jsx)(A.Provider,{value:N,children:t})},_=()=>{},I=(0,l.createContext)({isInfoVisible:!1,showInfo:_,hideInfo:_}),E=()=>(0,l.useContext)(I),U=e=>{let t,n,r,a,o=(0,s.c)(7),{children:u}=e,[c,f]=(0,l.useState)(!1);o[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>f(!0),o[0]=t):t=o[0];let d=t;o[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>f(!1),o[1]=n):n=o[1];let m=n;o[2]!==c?(r={isInfoVisible:c,showInfo:d,hideInfo:m},o[2]=c,o[3]=r):r=o[3];let p=r;return o[4]!==u||o[5]!==p?(a=(0,i.jsx)(I.Provider,{value:p,children:u}),o[4]=u,o[5]=p,o[6]=a):a=o[6],a};var O=n(3267),F=n(4120);let N=(0,l.createContext)({layoutMargins:{top:0,right:0,bottom:0,left:0},headerScale:1,footerScale:1,layoutScale:1}),L=e=>{let t,n,r,a,o,u,c=(0,s.c)(15),{children:f}=e,d=1.7777777777777777*F.P;c[0]===Symbol.for("react.memo_cache_sentinel")?(t={top:40,right:30,bottom:20,left:30},c[0]=t):t=c[0];let m=t,p=(0,O.C)(z),[h,g]=(0,l.useState)(1),[v,y]=(0,l.useState)(1),[w,R]=(0,l.useState)(1);c[1]===Symbol.for("react.memo_cache_sentinel")?(n={top:0,right:0,bottom:0,left:0},c[1]=n):n=c[1];let[C,b]=(0,l.useState)(n);(0,x._B)("orangered"),c[2]!==p.height?(r=()=>{let e=Math.min(Math.max(F.P/p.height,1),1.3);g(e),y(e),R((0,F.H)(p.height)/p.height),b({top:m.top*e/F.P,bottom:m.bottom*e/F.P,left:m.left*e/d,right:m.right*e/d})},c[2]=p.height,c[3]=r):r=c[3],c[4]!==p.height||c[5]!==p.width?(a=[p.width,p.height],c[4]=p.height,c[5]=p.width,c[6]=a):a=c[6],(0,l.useEffect)(r,a),c[7]!==w||c[8]!==v||c[9]!==C||c[10]!==h?(o={layoutMargins:C,headerScale:v,footerScale:w,layoutScale:h},c[7]=w,c[8]=v,c[9]=C,c[10]=h,c[11]=o):o=c[11];let S=o;return c[12]!==f||c[13]!==S?(u=(0,i.jsx)(N.Provider,{value:S,children:f}),c[12]=f,c[13]=S,c[14]=u):u=c[14],u};function z(e){return e.size}var V=n(904),k=n(9618),G=n(8075),B=n(4357);let j=(0,l.createContext)({navigationCameraConfig:null,configureNavigationCamera:()=>{},navigationAnimationConfig:null,configureNavigationAnimation:()=>{},navigationPath:null,setNavigationPath:()=>{},isNavigationHovered:!1,setIsNavigationHovered:()=>{},isClickLocked:!1,setIsClickLocked:()=>{},pointerCaptured:null,setPointerCaptured:()=>{},navigationHoveredIndex:null,setNavigationHoveredIndex:()=>{},isNavigationVisible:!1,setIsNavigationVisible:()=>{},footerVisible:!1,setFooterVisible:()=>{},navigationScene:null,footerScene:null,navigationMenus:null,footerMenus:null,isIntersectingWithNavigation:!1,setIsIntersectingWithNavigation:()=>{},navigationMarkerScreenPosition:null,statusMarkerScreenPositions:null,statusMarkerColors:null,trajectoryTriangleScreenPositions:null,trajectoryCrossScreenPositions:null}),$=e=>{let t,n,r,a,o,u,c,f,d,p,h,g,v,x,y,w,R,C,b,S,T,P=(0,s.c)(38),{children:M}=e,A=(0,G.Zp)(),D=(0,O.C)(W),[_,I]=(0,l.useState)(!1),[E,U]=(0,l.useState)(!1);P[0]===Symbol.for("react.memo_cache_sentinel")?(t={eye:B.Q7,lookAt:new k.Pq0,fov:B.pq,far:1e4},P[0]=t):t=P[0];let F=(0,l.useRef)(t);P[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>
53{F.current={eye:e.eye??F.current.eye,lookAt:e.lookAt??F.current.lookAt,fov:e.fov??F.current.fov,far:e.far??F.current.far}},P[1]=n):n=P[1];let N=n;P[2]===Symbol.for("react.memo_cache_sentinel")?(r={animate:!1,showMarker:!0,parentLerpX:.08,parentLerpY:.08,parentLerpZ:.08,childLerpX:.08,childLerpY:.08,childLerpZ:.08,angleStart:30,angleStep:30,minX:0,maxX:0,minY:0,maxY:0},P[2]=r):r=P[2];let L=(0,l.useRef)(r);P[3]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{L.current={...L.current,...e}},P[3]=a):a=P[3];let z=a,[V,$]=(0,l.useState)(null),[Y,X]=(0,l.useState)(!1),[q,Z]=(0,l.useState)(!1),Q=(0,l.useRef)(!1),[K,J]=(0,l.useState)(null),[ee,et]=(0,l.useReducer)(H,0);P[4]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{J(e),et()},P[4]=o):o=P[4];let en=o,er=(0,l.useRef)(null),ea=(0,l.useRef)(null),eo=(0,l.useRef)(null),ei=(0,l.useRef)(null);P[5]===Symbol.for("react.memo_cache_sentinel")?(u=new k.I9Y,P[5]=u):u=P[5];let es=(0,l.useRef)(u);P[6]===Symbol.for("react.memo_cache_sentinel")?(c=[],P[6]=c):c=P[6];let el=(0,l.useRef)(c);P[7]===Symbol.for("react.memo_cache_sentinel")?(f=[],P[7]=f):f=P[7];let eu=(0,l.useRef)(f);P[8]===Symbol.for("react.memo_cache_sentinel")?(d=[],P[8]=d):d=P[8];let ec=(0,l.useRef)(d);P[9]===Symbol.for("react.memo_cache_sentinel")?(p=[],P[9]=p):p=P[9];let ef=(0,l.useRef)(p);P[10]===Symbol.for("react.memo_cache_sentinel")?(h=new k.tBo,P[10]=h):h=P[10];let ed=(0,l.useRef)(h),[em,ep]=(0,l.useState)(!1);P[11]!==D?(g=()=>{if(Q.current||!er.current||!ea.current||!eo.current||!ei.current)return!1;let e=er.current?.camera;if(!e)return!1;ed.current.setFromCamera(D,e);for(let e=0,t=eo.current.length;e<t;e++){let t=eo.current[e];if(t.mesh&&ed.current.intersectObject(t.mesh).length>0)return ep(!0),!0}ed.current.setFromCamera(D,e);for(let e=0,t=ei.current.length;e<t;e++){let t=ei.current[e];if((t instanceof k.eaF||t instanceof k.YJl)&&ed.current.intersectObject(t).length>0)return ep(!0),!0}return ep(!1),!1},P[11]=D,P[12]=g):g=P[12];let eh=g;P[13]!==eh?(v=e=>{Q.current=e,e||eh()},P[13]=eh,P[14]=v):v=P[14];let eg=v;P[15]!==eh?(x=()=>(window.addEventListener("mousemove",eh),()=>window.removeEventListener("mousemove",eh)),y=[eh],P[15]=eh,P[16]=x,P[17]=y):(x=P[16],y=P[17]),(0,l.useEffect)(x,y),P[18]!==E?(w=()=>{(0,m.Rm)("skyblue","","footerVisible:",E)},R=[E],P[18]=E,P[19]=w,P[20]=R):(w=P[19],R=P[20]),(0,l.useEffect)(w,R),P[21]!==A||P[22]!==K?(C=()=>{K&&A(K)},P[21]=A,P[22]=K,P[23]=C):C=P[23],P[24]!==ee?(b=[ee],P[24]=ee,P[25]=b):b=P[25],(0,l.useEffect)(C,b),P[26]!==E||P[27]!==q||P[28]!==em||P[29]!==Y||P[30]!==_||P[31]!==V||P[32]!==K||P[33]!==eg?(S={navigationCameraConfig:F,configureNavigationCamera:N,navigationAnimationConfig:L,configureNavigationAnimation:z,navigationPath:K,setNavigationPath:en,isNavigationHovered:Y,setIsNavigationHovered:X,isClickLocked:q,setIsClickLocked:Z,pointerCaptured:Q,setPointerCaptured:eg,navigationHoveredIndex:V,setNavigationHoveredIndex:$,isNavigationVisible:_,setIsNavigationVisible:I,footerVisible:E,setFooterVisible:U,navigationScene:er,footerScene:ea,navigationMenus:eo,footerMenus:ei,isIntersectingWithNavigation:em,setIsIntersectingWithNavigation:ep,navigationMarkerScreenPosition:es,statusMarkerScreenPositions:el,statusMarkerColors:eu,trajectoryTriangleScreenPositions:ec,trajectoryCrossScreenPositions:ef},P[26]=E,P[27]=q,P[28]=em,P[29]=Y,P[30]=_,P[31]=V,P[32]=K,P[33]=eg,P[34]=S):S=P[34];let ev=S;return P[35]!==M||P[36]!==ev?(T=(0,i.jsx)(j.Provider,{value:ev,children:M}),P[35]=M,P[36]=ev,P[37]=T):T=P[37],T};function W(e){return e.pointer}function H(e){return e+1}var Y=((a={}).LIST="LIST",a.FOCUS_IN="FOCUS_IN",a.DETAIL="DETAIL",a.BROWSING="BROWSING",a),X=n(7997);let q=(0,l.createContext)({shouldPresentContent:!1,isAllRendererReady:!1,isProductRendererReady:!1,isProductGISRendererReady:!1,isProductItemRendererReady:!1,isProductHeaderRendererReady:!1,setIsProductRendererReady:()=>{},setIsProductGISRendererReady:()=>{},setIsProductItemRendererReady:()=>{},setIsProductHeaderRendererReady:()=>{},productDataset:null,gisPointDataset:{current:null},gisSegmentDataset:{current:null},gisMeshGeometry:{current:null},gisGroup:{current:null},gisGroundMesh:{current:null},bloomEnabled:{current:!1}
53,caOffset:{current:new k.I9Y(0,0)},productScene:{current:null},productHeaderScene:{current:null},viewState:Y.LIST,focusedProductIndex:null,detailProductIndex:null,focusProduct:()=>{},unfocusProduct:()=>{},openDetail:()=>{},closeDetail:()=>{}}),Z=e=>{let{children:t}=e,{shouldPerformLoading:n}=(0,l.useContext)(V.el),{sendEvent:r}=f(),[a,o]=(0,l.useState)(null),s=(0,l.useRef)([]),u=(0,l.useRef)(null),c=(0,l.useRef)(null),{productDataset:d,gisPointDataset:m,gisSegmentDataset:p,gisMeshGeometry:h,isLoading:g,error:v}=(0,x.WR)(n,0),[w,R]=(0,l.useState)(!1),{states:C,setters:b,isAllReady:S}=(0,x.i5)(["isProductRendererReady","isProductGISRendererReady","isProductItemRendererReady","isProductHeaderRendererReady"]),T=(0,l.useRef)(null),P=(0,l.useRef)(null),M=(0,l.useRef)(null),A=(0,l.useRef)(null),D=(0,l.useRef)(new k.I9Y(0,0)),_=(0,l.useRef)(!1),I=(0,l.useRef)("u">typeof performance?performance.now():0),E=(0,l.useRef)(!1),U=(0,G.zy)(),O=(0,G.Zp)(),F=(0,l.useRef)(U.pathname.split("/").filter(Boolean)[1]),N=(0,l.useRef)(!1),[L,z]=(0,l.useState)(Y.LIST),[B,j]=(0,l.useState)(null),[$,W]=(0,l.useState)(null),H=(0,l.useCallback)(e=>{j(e),z(Y.FOCUS_IN)},[]),Z=(0,l.useCallback)(()=>{j(null),z(Y.LIST)},[]),Q=(0,l.useRef)(!1),K=(0,l.useCallback)(()=>{if(null===B)return;let e=(0,X.Ws)(B);e&&(W(B),z(Y.DETAIL),Q.current=!0,O(`/product/${e.uuid}`))},[B,O]),J=(0,l.useCallback)(()=>{W(null),z(Y.BROWSING),Q.current=!0,O("/product")},[O]);(0,x.SK)(()=>R(!0)),(0,l.useEffect)(()=>{g||!d||d.isEmpty||v.length>0||(o(d.clone()),s.current=m.map(e=>new k.Pq0(e.x,e.y,e.z)),u.current=JSON.parse(JSON.stringify(p)),h&&(c.current=h))},[g,d]),(0,l.useEffect)(()=>{if(N.current||!a)return;N.current=!0;let e=F.current;if(!e)return;let t=(0,X.xV)(e);t&&W(t.index)},[a]),(0,l.useEffect)(()=>{if(!S||E.current)return;E.current=!0;let e=performance.now()-I.current;r({event:"scene_init_time",webgl_renderer:(0,y.J)(),duration_ms:Math.round(e),pixel_ratio:window.devicePixelRatio||1})},[S,r]);let ee=(0,l.useRef)(!0);(0,l.useEffect)(()=>{if(ee.current){ee.current=!1;return}if(Q.current){Q.current=!1;return}let e=U.pathname.split("/").filter(Boolean)[1];if(e){let t=(0,X.xV)(e);t&&L!==Y.DETAIL&&(W(t.index),j(t.index),z(Y.DETAIL))}else L===Y.DETAIL&&(W(null),z(Y.BROWSING))},[U.pathname]);let et=(0,l.useMemo)(()=>({shouldPresentContent:w,isAllRendererReady:S,isProductRendererReady:C.isProductRendererReady,isProductHeaderRendererReady:C.isProductHeaderRendererReady,isProductGISRendererReady:C.isProductGISRendererReady,isProductItemRendererReady:C.isProductItemRendererReady,setIsProductHeaderRendererReady:b.isProductHeaderRendererReady,setIsProductRendererReady:b.isProductRendererReady,setIsProductGISRendererReady:b.isProductGISRendererReady,setIsProductItemRendererReady:b.isProductItemRendererReady,productDataset:a,gisPointDataset:s,gisSegmentDataset:u,gisMeshGeometry:c,gisGroup:M,gisGroundMesh:A,caOffset:D,bloomEnabled:_,productScene:T,productHeaderScene:P,viewState:L,focusedProductIndex:B,detailProductIndex:$,focusProduct:H,unfocusProduct:Z,openDetail:K,closeDetail:J}),[w,S,C.isProductRendererReady,C.isProductHeaderRendererReady,C.isProductGISRendererReady,C.isProductItemRendererReady,a,L,B,$,H,Z,K,J]);return(0,i.jsx)(q.Provider,{value:et,children:t})};var Q=n(7653),K=n(4397),J=n(261),ee=n(340),et=n(9151),en=n(1712),er=n(79),ea=((o=ea||{}).NONE="NONE",o.PRESENTING="PRESENTING",o.PRESENTED="PRESENTED",o.DISMISSING="DISMISSING",o.DISMISSED="DISMISSED",o);let eo=(0,l.createContext)({routes:[],routeRefs:null,routeState:{state:"NONE"},setRouteState:()=>{},configureRouteTransition:()=>{},routeTransitionConfig:null}),ei=e=>{let t,n,r,a,o,u,c,f,d,p,h,g,x,y,w=(0,s.c)(19),{children:R}=e;w[0]===Symbol.for("react.memo_cache_sentinel")?(t={},w[0]=t):t=w[0];let b=(0,l.useRef)(t);w[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>t=>{b.current[e]=t},w[1]=n):n=w[1];let P=n,M=(0,G.zy)();w[2]===Symbol.for("react.memo_cache_sentinel")?(r={path:"*",element:(0,i.jsx)(S,{children:(0,i.jsx)(J.default,{ref:P("/error")})})},w[2]=r):r=w[2],w[3]===Symbol.for("react.memo_cache_sentinel")?(a={path:"/",element:(0,i.jsx)(D,{children:(0,i.jsx)(ee.default,{ref:P("/")})})},w[3]=a):a=w[3],w[4]===Symbol.for("react.memo_cache_sentinel")?(o={path:"/award",element:(0,i.jsx)(v._U,{children:(0,i.jsx)(Q.default,{ref:P("/award")})})},w[4]=o):o=w[4],w[5]===Symbol.for("react.memo_cache_sentinel")?(u={path:"/product/*",element:(0,i.jsx)(Z,{children:(0,i.jsx)(et.default,{ref:P("/product")})})},w[5]=u):u=w[5],w[6]===Symbol.for("react.memo_cache_sentinel")?(c={path:"/sketch/*",element:(0,i.jsx)(T.d,{children:(0,i.jsx)(en.default,{ref:P("/sketch")})})},w[6]=c):c=w[6],w[7]===Symbol.for("react.memo_cache_sentinel")?(f=[r,a,o,u,c,{path:"/contact",element:(0,i.jsx)(C,{children:(0,i.jsx)(K.default,{ref:P("/contact")})})}],w[7]=f):f=w[7];let A=f;w[8]===Symbol.for("react.memo_cache_sentinel")?(d={state:"NONE"},w[8]=d):d=w[8];let[_,I]=(0,l.useState)(d);w[9]!==M.pathname?(p=e=>{"function"==typeof e?I(t=>{let n=e(t);n.pathname=M.pathname;let r=(0,er.N)(n.pathname);
53return n.index=A.findIndex(e=>(0,er.N)(e.path)===r),(0,m.Rm)("skyblue","\uD83D\uDD25\uD83D\uDD25\uD83D\uDD25\uD83D\uDD00\uD83D\uDD00\uD83D\uDD00","\n","state:",t.state,"=>",n.state,"\n","pathname:",t.pathname,"=>",n.pathname),n}):I(t=>{e.pathname=M.pathname;let n=(0,er.N)(e.pathname);return e.index=A.findIndex(e=>(0,er.N)(e.path)===n),(0,m.Rm)("skyblue","\uD83D\uDD25\uD83D\uDD25\uD83D\uDD25\uD83D\uDD00\uD83D\uDD00\uD83D\uDD00","\n","state:",t.state,"=>",e.state,"\n","pathname:",t.pathname,"=>",e.pathname),e})},w[9]=M.pathname,w[10]=p):p=w[10];let E=p;w[11]===Symbol.for("react.memo_cache_sentinel")?(h={presentDuration:1e3,presentDelay:2e3,dismissDuration:1e3,dismissDelay:0},w[11]=h):h=w[11];let U=(0,l.useRef)(h);w[12]===Symbol.for("react.memo_cache_sentinel")?(g=e=>{U.current={presentDuration:e.presentDuration??U.current.presentDuration,presentDelay:e.presentDelay??U.current.presentDelay,dismissDuration:e.dismissDuration??U.current.dismissDuration,dismissDelay:e.dismissDelay??U.current.dismissDelay}},w[12]=g):g=w[12];let O=g;w[13]!==E||w[14]!==_?(x={routeState:_,routes:A,routeRefs:b,setRouteState:E,configureRouteTransition:O,routeTransitionConfig:U},w[13]=E,w[14]=_,w[15]=x):x=w[15];let F=x;return w[16]!==R||w[17]!==F?(y=(0,i.jsx)(eo.Provider,{value:F,children:R}),w[16]=R,w[17]=F,w[18]=y):y=w[18],y}},2466:(e,t,n)=>{n.d(t,{y5:()=>g,An:()=>W,O2:()=>$,H2:()=>V,sX:()=>S,pN:()=>Q,Xw:()=>P,v6:()=>er,ml:()=>em,Gl:()=>ee,W$:()=>v,_B:()=>ed,SK:()=>es,pp:()=>H,WR:()=>L,iK:()=>ef.i,i5:()=>el,dV:()=>D,W0:()=>eo,Ql:()=>eu.Q,oD:()=>en,ci:()=>ei,RV:()=>ec,VL:()=>et});var r=n(6065),a=n(9618),o=n(334),i=n(6382);class s extends Object{static MAX_PARTICLE_DATA_LENGTH=60856;index;reference;portraitPosition;blobPosition;rotation;angleVelocity;radius;portraitColor;blobColor;isDummy=!1;isBlob=!1;constructor(e,t,n,r,o){super(),this.index=-1,this.reference=new a.I9Y,this.portraitPosition=e.clone(),this.blobPosition=t.clone(),this.rotation=new a.Pq0(a.cj9.randFloatSpread(180),a.cj9.randFloatSpread(180),0).multiplyScalar(i.V$),this.angleVelocity=new a.Pq0(a.cj9.randFloat(.6,.3)*(a.cj9.randFloatSpread(1)>0?1:-1),a.cj9.randFloat(.6,.3)*(a.cj9.randFloatSpread(1)>0?1:-1),a.cj9.randFloat(.6,.3)*(a.cj9.randFloatSpread(1)>0?1:-1)).multiplyScalar(i.V$),this.radius=new a.Pq0(a.cj9.randFloat(2e3,2e3)*(a.cj9.randFloatSpread(1)>0?1:-1),a.cj9.randFloat(2e3,2e3)*(a.cj9.randFloatSpread(1)>0?1:-1),a.cj9.randFloat(2e3,2e3)*(a.cj9.randFloatSpread(1)>0?1:-1)),this.portraitColor=n.clone();const s={h:0,s:0,l:0};n.getHSL(s),s.l<.5?this.blobColor=n.clone().setHSL(s.h,s.s,.5):this.blobColor=n.clone().setHSL(s.h,s.s,s.l),this.blobColor=n.clone().setHSL(s.h,.5,.5),this.isDummy=r,this.isBlob=o}getScreenCoordinate(e){let t=window.innerWidth/2,n=window.innerHeight/2,r=this.portraitPosition.clone();return r.project(e.clone()),r.x=r.x*t+t,r.y=-(r.y*n)+n,new a.I9Y(r.x,r.y)}dispose(){}}var l=n(3361),u=n(2103),c=n(6987),f=n(2310),d=n(3882),m=n(8528),p=n(3545);let h=["/assets/data/home/model-01-s10.json","/assets/data/home/model-03-s10.json","/assets/data/home/model-06-s10.json"],g=(e,t)=>{e.add(t.pointList,t.navigationMarker,t.cameraFocusMarker,t.statusMarkers,t.trajectoryTrianglePoints,t.trajectoryCrossPoints,t.triangleMeshes,t.maskMeshes)},v=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{createFetcher:i,calculateProgress:f,notifyComplete:v,notifyFailed:x,state:y,sumPercentCompleted:w}=H(e,5,t),R=(0,r.useRef)(new l.i),C=(0,r.useRef)(null),[b]=(0,r.useState)(()=>{let e=Math.floor(Math.random()*h.length);return h.map((t,n)=>h[(e+n)%h.length])}),[S,T]=(0,r.useState)([void 0,void 0]),P=0,M=i(0),A=i(P),D={...$,revalidateIfStale:!1},_=e?P++:P,I=async e=>et(await M(e,_)),{data:E,error:U,isLoading:O}=(0,o.u)(e?b[0]:null,I,D),F=async e=>{let{buffer:t,contentType:n}=await (0,p.G)(e);return et(W(t,n))},N={...D,shouldRetryOnError:!1},{data:L,error:z}=(0,o.u)(n?b[1]:null,F,N),{data:V,error:k}=(0,o.u)(n?b[2]:null,F,N),{data:G,error:B,isLoading:j}=(0,o.u)(e?["/assets/data/home/profile.json",P++]:null,e=>{let[t,n]=e;return A(t,n)},$),{isLoading:Y,error:X}=ee(e,P++,(e,t,n,r)=>f(n,e,t,r),(e,t,n,r)=>f(n,e,t,r)),{isLoading:q,error:Z}
53=en(e,P++,[{key:"BackgroundEffect",url:"/assets/texture/EffectTexture.png"}],(e,t,n,r)=>f(n,e,t,r),(e,t,n,r)=>f(n,e,t,r)),{isLoading:Q,error:K}=eo(e,P++,(e,t,n,r)=>f(n,e,t,r),(e,t,n,r)=>f(n,e,t,r)),J=(0,r.useMemo)(()=>{let e=new a.WBB(1800,47).getAttribute("position"),t=[];for(let n=0;n<e.count;n++)t.push(new a.Pq0().fromBufferAttribute(e,n));let n=Array.from(new Set(t.map(e=>e.toArray().join(",")))).map(e=>{let t=e.split(",").map(Number);return new a.Pq0(t[0],t[1],t[2])}),r=new a.Pq0(100,5e3,100);return n.sort((e,t)=>r.distanceTo(e)-r.distanceTo(t)>0?1:-1)},[]),et=e=>{let t,n,r=0,o=e.pcd.sort((e,t)=>{let n=e.c.map(Number),r=t.c.map(Number),o=new a.Q1f(n[0]/255,n[1]/255,n[2]/255),i=new a.Q1f(r[0]/255,r[1]/255,r[2]/255),s={h:0,s:0,l:0},l={h:0,s:0,l:0};return(o.getHSL(s),i.getHSL(l),s.h!==l.h)?s.h-l.h:s.s!==l.s?l.s-s.s:l.l-s.l}),i=new a.Q1f(0,0,0),f=o.map((e,t,n)=>{let o,l,u=e.p.map(Number),c=e.c.map(Number),f=new a.Pq0(u[0]/1,u[1]/1,u[2]/1),d=new a.Q1f().setRGB(c[0]/255,c[1]/255,c[2]/255);return r<J.length?(o=J[r].clone(),l=!0,r++):(o=new a.Pq0(.1*(1e3*Math.random()-500)/1,.1*(1e3*Math.random()-500)/1,.1*(1e3*Math.random()-500)/1),l=!1),i=d,new s(f,o,d,!1,l)}),d=e.triangle.map((e,t,n)=>{let r=e[0].map(Number),o=e[1].map(Number),i=e[2].map(Number);return new u.q([new a.Pq0(r[0],r[1],r[2]),new a.Pq0(o[0],o[1],o[2]),new a.Pq0(i[0],i[1],i[2])],new a.Q1f(c.i.connector.lineColor),!1)}),p=e.mask.map((e,t,n)=>{let r=e[0].map(Number),o=e[1].map(Number),i=e[2].map(Number);return new u.q([new a.Pq0(r[0],r[1],r[2]),new a.Pq0(o[0],o[1],o[2]),new a.Pq0(i[0],i[1],i[2])],new a.Q1f(c.i.connector.lineColor),!1)});f=f.concat(Array.from(Array(s.MAX_PARTICLE_DATA_LENGTH-f.length)).map((e,t)=>{let n,o,l=new a.Pq0((1e3*Math.random()-500)/1,(1e3*Math.random()-500)/1,(1e3*Math.random()-500)/1);return r<J.length?(n=J[r].clone(),o=!0,r++):(n=new a.Pq0(.1*(1e3*Math.random()-500)/1,.1*(1e3*Math.random()-500)/1,.1*(1e3*Math.random()-500)/1),o=!1),new s(l,n,i,!0,o)})),d=d.concat(Array.from(Array(u.q.MAX_TRIANGLE_DATA_LENGTH-d.length)).map((e,t)=>{let n=[new a.Pq0,new a.Pq0,new a.Pq0],r=new a.Q1f(0);return new u.q(n,r,!0)}));let h=f.slice().shuffle(),g=(0,m.Q0)(s.MAX_PARTICLE_DATA_LENGTH);for(let e=0;e<h.length;e++){let t=h[e];t.index=e,t.reference.x=e%g.width/g.width,t.reference.y=Math.floor(e/g.width)/g.height}let v=1/0,x=new a.Pq0(1500,1500,1500);h.filter(e=>!e.isDummy).forEach((e,n)=>{let r=x.distanceTo(e.portraitPosition);r<v&&(v=r,t=e)});let y=-1/0;h.forEach(e=>{!e.isDummy&&e.portraitPosition.y>y&&(y=e.portraitPosition.y)});let w=-1/0;h.filter(e=>!e.isDummy&&y-700<=e.portraitPosition.y&&e.portraitPosition.y<=y-200).forEach((e,t)=>{e.portraitPosition.z>w&&(w=e.portraitPosition.z,n=e)});let R=[],C=[new a.NRn(new a.Pq0(-200,-500,-1e4),new a.Pq0(200,-400,1e4)),new a.NRn(new a.Pq0(-1500,-1500,-1e4),new a.Pq0(-500,-500,1e4)),new a.NRn(new a.Pq0(500,-1500,-1e4),new a.Pq0(1500,-500,1e4))],b=Array(C.length).fill([]);for(let e=0;e<C.length;e++){let t=C[e];b[e]=h.filter(e=>!e.isDummy&&t.containsPoint(e.portraitPosition))}for(let e=0;e<b.length;e++){let t=b[e],n=t[Math.floor(Math.random()*(t.length-1))];R.push(n)}let S=h.filter(e=>!e.isDummy&&-1500<=e.portraitPosition.y/1&&e.portraitPosition.y<=-200),T=[],P=Math.floor(Math.random()*S.length),M=P;for(T.push(S[P]);T.length<l.i.MAX_DATASET_TRAJECTORY_LENGTH;){++M>=S.length&&(M=0);let e=S[P],t=S[M],n=e.portraitPosition?.clone().distanceTo(t.portraitPosition?.clone())/1;200<n&&n<500&&(T.push(S[M]),P=M)}let A=[];for(M=P=Math.floor(Math.random()*S.length),A.push(S[P]);A.length<l.i.MAX_DATASET_TRAJECTORY_LENGTH;){++M>=S.length&&(M=0);let e=S[P],t=S[M],n=e.portraitPosition?.clone().distanceTo(t.portraitPosition?.clone())/1;200<n&&n<500&&(A.push(S[M]),P=M)}return{pointList:f,navigationMarker:t,cameraFocusMarker:n,statusMarkers:R,trajectoryTrianglePoints:T,trajectoryCrossPoints:A,triangleMeshes:d,maskMeshes:p}},er=(e,t)=>{T(n=>{if(void 0!==n[e])return n;let r=n.slice();return r[e]=t,r})},ea=(0,r.useMemo)(()=>{let e=[];for(let t of S){if(void 0===t)break;t&&e.push(t)}return e},[S]);return(0,r.useEffect)(()=>{E&&g(R.current,E)},[E]),(0,r.useEffect)(()=>{L&&er(0,L)},[L]),(0,r.useEffect)(()=>{V&&er(1,V)},[V]),(0,r.useEffect)(()=>{z&&((0,d.R8)("yellow","â","deferred portrait load error",z),er(0,null))},[z]),(0,r.useEffect)(()=>{k&&((0,d.R8)("yellow","â","deferred portrait load error",k),er(1,null))},[k]),(0,r.useEffect)(()=>{G&&(C.current=G)},[G]),(0,r.useEffect)(()=>{e&&(O||j||Y||q||Q||([U,B,X,Z,K].some(e=>void 0!==e)?x():v()))},[e,O,j,Y,q,Q]),{portraitDataset:R.current,profileDataset:C.current,deferredParsedDatasets:ea,error:[U,B,X,Z,K].filter(e=>void 0!==e),isLoading:O||j||Y||q||Q}};var x=n(1681);let y=(e,t,n)=>{let r=0;switch(e){case"Tokyo":r=1;break;case"Bangkok":r=330/360;break;case"Cannes":r=290/360;break;case"London":r=260/360;break;case"New York":r=230/360;break;default:r=0,t=0,n=.75}return new a.Q1f().setHSL(r,t,n)};class w{index;key;year;title;country;city;coordinate;color;darkColor;uuid;catmullRomPosition0;catmullRomPosition1;constructor(e,t,n,r,o,i,s,l,u,c){this.index=e,this.key=t,this.year=n,this.title=r,this.country=o,this.city=i,this.coordinate=s,this.color=y(i,1,.7);const f={h:0,s:0,l:0};this.color.getHSL(f),this.darkColor=new a.Q1f().setHSL(f.h,.5*f.s,.25*f.l),this.uuid=l??(0,x.A)(),this.catmullRomPosition0=u??new a.Pq0,this.catmullRomPosition1=c??new a.Pq0}clone(){return new w(this.index,this.key,this.year,this.title,this.country,this.city,{latitude:this.coordinate.latitude,longitude:this.coordinate.longitude},this.uuid,this.catmullRomPosition0,this.catmullRomPosition1)}}class R{index;key;country;city;coordinate;offset;color;isAwardCity;labelSize;catmullRomPosition0;catmullRomPosition1;constructor(e,t,n,r,o,i,s,l,u){this.index=e,this.key=t,this.country=n,this.city=r,this.coordinate=o,this.offset=i,this.color=y(r,1,.7),this.isAwardCity=s,this.catmullRomPosition0=l||new a.Pq0,this.catmullRomPosition1=u||new a.Pq0}clone(){return new R(this.index,this.key,this.country,this.city,{latitude:this.coordinate.latitude,longitude:this.coordinate.longitude},{latitude:this.offset.latitude,longitude:this.offset.longitude},this.isAwardCity,this.catmullRomPosition0,this.catmullRomPosition1)}}class C{references={};awardIndices=[];constructor(e,t){this.references=e||{},this.awardIndices=t||[]}clone(){return new C({...this.references},this.awardIndices.slice())}}class b{_awardArrayList=[];get awardArrayList(){return this._awardArrayList}getAward(e){return this._awardArrayList[e]}_cityArrayList=[];get cityArrayList(){return this._cityArrayList}_cityObjectList={};get cityObjectList(){return this._cityObjectList}getCity(e){return this._cityObjectList[e]}_connectionObjectList={};get connectionObjectList(){return this._connectionObjectList}addConnection(e,t){if(this._connectionObjectList[e]){let n=this._connectionObjectList[e];n.references[t]=n.awardIndices.length,n.awardIndices.push(t),this._connectionObjectList[e]=n}else{let n=new C;n.references[t]=n.awardIndices.length,n.awardIndices.push(t),this._connectionObjectList[e]=n}}getAllConnections(e){return this._connectionObjectList[e].awardIndices.map(e=>this._awardArrayList[e])}getConnection(e,t){let n=this._connectionObjectList[e].references[t];return this._awardArrayList[n]}setAwardUIPosition(e,t,n){this._awardArrayList[e].catmullRomPosition0.set(t.x,t.y,t.z),this._awardArrayList[e].catmullRomPosition1.set(n.x,n.y,n.z)}setCityMarkerPosition(e,t,n){this._cityObjectList[e].catmullRomPosition0.set(t.x,t.y,t.z),this._cityObjectList[e].catmullRomPosition1.set(n.x,n.y,n.z)}addAward(e,t,n,r,a){let o=r.toLowerCase().replace(/\s+/g,"_"),i=this._awardArrayList.length,s=new w(i,o,e,t,n,r,a);this._awardArrayList.push(s),this.addConnection(o,i)}addCity(e,t,n,r,a){let o=t.toLowerCase().replace(/\s+/g,"_"),i=new R(this._cityArrayList.length,o,e,t,n,r,a);this._cityArrayList.push(i),this._cityObjectList[o]=i}get isEmpty(){return 0===this._awardArrayList.length||0===Object.keys(this._cityArrayList).length||0===Object.keys(this._cityObjectList).length}clone(){let e=new b;return e._awardArrayList=this._awardArrayList.map(e=>e.clone()),e._cityArrayList=this._cityArrayList.map(e=>e.clone()),e._cityObjectList={},e._cityArrayList.forEach(t=>{e._cityObjectList[t.key]=t.clone()}),e._connectionObjectList={},Object.keys(this._connectionObjectList).forEach(t=>{let n=this._connectionObjectList[t];e._connectionObjectList[t]=n.clone()}),e}dispose(){this._awardArrayList=[],this._cityArrayList=[],this._cityObjectList={},this._connectionObjectList={}}}let S=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{createFetcher:n,calculateProgress:a,notifyComplete:i,notifyFailed:s,sumPercentCompleted:l}=H(e,5,t),u=(0,r.useRef)(new b),c=0,f=n(0),{data:d,error:m,isLoading:p}=(0,o.u)(e?["/assets/data/award/award.json",c++]:null,e=>{let[t,n]=e;return f(t,n)},$),{data:h,error:g,isLoading:v}=(0,o.u)(e?["/assets/data/award/city.json",c++]:null,e=>{let[t,n]=e;return f(t,n)},$),{isLoading:x,error:y}=ee(e,c++,(e,t,n,r)=>a(n,e,t,r),(e,t,n,r)=>a(n,e,t,r)),{isLoading:w,error:R}=en(e,c++,[{key:"EarthMap",url:"/assets/texture/EarthMap-500x250.png"}],(e,t,n,r)=>a(n,e,t,r),(e,t,n,r)=>a(n,e,t,r)),{isLoading:C,error:S}=eo(e,c++,(e,t,n,r)=>a(n,e,t,r),(e,t,n,r)=>a(n,e,t,r)),T=async e=>
53{e.awards.forEach(e=>{u.current.addAward(e.year,e.title,e.country,e.city,e.coordinate)})},P=async e=>{Object.keys(e.regions).forEach(t=>{e.regions[t].sort((e,t)=>e.coordinate.longitude!==t.coordinate.longitude?e.coordinate.longitude-t.coordinate.longitude:e.coordinate.latitude-t.coordinate.latitude).forEach(e=>{u.current.addCity(e.country,e.city,{latitude:e.coordinate.latitude,longitude:e.coordinate.longitude},{latitude:e.offset?.latitude??2,longitude:e.offset?.longitude??2},e.isAwardCity)})})};return(0,r.useEffect)(()=>{d&&T(d)},[d]),(0,r.useEffect)(()=>{h&&P(h)},[h]),(0,r.useEffect)(()=>{e&&(p||v||x||w||C||([m,g,y,R,S].some(e=>void 0!==e)?s():i()))},[e,p,v,x,w,C]),{dataset:u.current,error:[m,g,y,R,S].filter(e=>void 0!==e),isLoading:l.current<100||p||v||x||w||C||!(u.current&&!u.current.isEmpty)}};var T=n(1343);let P=(e,t)=>{let n,a,o,i,s,l,u,c,f=(0,T.c)(24),d=void 0!==e&&e,{calculateProgress:m,notifyComplete:p,notifyFailed:h,sumPercentCompleted:g}=H(d,2,void 0===t?0:t),v=0;f[0]!==m?(n=(e,t,n,r)=>m(n,e,t,r),a=(e,t,n,r)=>m(n,e,t,r),f[0]=m,f[1]=n,f[2]=a):(n=f[1],a=f[2]);let{isLoading:x,error:y}=ee(d,v++,n,a);f[3]!==m?(o=(e,t,n,r)=>m(n,e,t,r),i=(e,t,n,r)=>m(n,e,t,r),f[3]=m,f[4]=o,f[5]=i):(o=f[4],i=f[5]);let{isLoading:w,error:R}=eo(d,v++,o,i);f[6]!==R||f[7]!==y||f[8]!==w||f[9]!==x||f[10]!==p||f[11]!==h||f[12]!==d?(s=()=>{d&&(x||w||([y,R].some(M)?h():p()))},f[6]=R,f[7]=y,f[8]=w,f[9]=x,f[10]=p,f[11]=h,f[12]=d,f[13]=s):s=f[13],f[14]!==w||f[15]!==x||f[16]!==d?(l=[d,x,w],f[14]=w,f[15]=x,f[16]=d,f[17]=l):l=f[17],(0,r.useEffect)(s,l),f[18]!==R||f[19]!==y?(u=[y,R].filter(A),f[18]=R,f[19]=y,f[20]=u):u=f[20];let C=g.current<100||x||w;return f[21]!==u||f[22]!==C?(c={error:u,isLoading:C},f[21]=u,f[22]=C,f[23]=c):c=f[23],c};function M(e){return void 0!==e}function A(e){return void 0!==e}let D=(e,t)=>{let n,a,o,i,s,l,u,c,f=(0,T.c)(24),d=void 0!==e&&e,{calculateProgress:m,notifyComplete:p,notifyFailed:h,sumPercentCompleted:g}=H(d,2,void 0===t?0:t),v=0;f[0]!==m?(n=(e,t,n,r)=>m(n,e,t,r),a=(e,t,n,r)=>m(n,e,t,r),f[0]=m,f[1]=n,f[2]=a):(n=f[1],a=f[2]);let{isLoading:x,error:y}=ee(d,v++,n,a);f[3]!==m?(o=(e,t,n,r)=>m(n,e,t,r),i=(e,t,n,r)=>m(n,e,t,r),f[3]=m,f[4]=o,f[5]=i):(o=f[4],i=f[5]);let{isLoading:w,error:R}=eo(d,v++,o,i);f[6]!==R||f[7]!==y||f[8]!==w||f[9]!==x||f[10]!==p||f[11]!==h||f[12]!==d?(s=()=>{d&&(x||w||([y,R].some(_)?h():p()))},f[6]=R,f[7]=y,f[8]=w,f[9]=x,f[10]=p,f[11]=h,f[12]=d,f[13]=s):s=f[13],f[14]!==w||f[15]!==x||f[16]!==d?(l=[d,x,w],f[14]=w,f[15]=x,f[16]=d,f[17]=l):l=f[17],(0,r.useEffect)(s,l),f[18]!==R||f[19]!==y?(u=[y,R].filter(I),f[18]=R,f[19]=y,f[20]=u):u=f[20];let C=g.current<100||x||w;return f[21]!==u||f[22]!==C?(c={error:u,isLoading:C},f[21]=u,f[22]=C,f[23]=c):c=f[23],c};function _(e){return void 0!==e}function I(e){return void 0!==e}var E=n(9962),U=n(1780);class O{index;title;category;description;technologies;terms;status;downloads;images;constructor(e,t,n,r,a,o,i,s,l){this.index=e,this.title=t,this.category=n,this.description=r,this.technologies=a,this.terms=o,this.status=i,this.downloads=s,this.images=l}}class F{_productLists=[];get productList(){return this._productLists}get isEmpty(){return 0===this._productLists.length}add(e){this._productLists.push(e)}dispose(){this._productLists=[]}clone(){let e=new F;return e._productLists=this._productLists.map(e=>new O(e.index,e.title,e.category,e.description,e.technologies,e.terms,e.status,e.downloads,e.images)),e}}var N=n(7997);let L=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{createFetcher:n,calculateProgress:i,notifyComplete:s,notifyFailed:l,sumPercentCompleted:u}=H(e,7,t,"magenta"),c=(0,r.useRef)(new F),f=(0,r.useRef)([]),m=(0,r.useRef)(null),p=(0,r.useRef)(null),[h,g]=(0,r.useState)(!0),[v,x]=(0,r.useState)(void 0),[y,w]=(0,r.useState)(void 0),[R,C]=(0,r.useState)(!1),b=0,S=n(0),{data:T,error:P,isLoading:M}=(0,o.u)(e?["/assets/data/product/products.json",b++]:null,e=>{let[t,n]=e;return S(t,n)},$),{data:A,error:D,isLoading:_}=(0,o.u)(e?["/assets/data/product/product-gis-pcd.json",b++]:null,e=>{let[t,n]=e;return S(t,n)},$),{data:I,error:L,isLoading:z}=(0,o.u)(e?["/assets/data/product/product-gis-segments.json",b++]:null,e=>{let[t,n]=e;return S(t,n)},$),{isLoading:V,error:k}=ee(e,b++,(e,t,n,r)=>i(n,e,t,r),(e,t,n,r)=>i(n,e,t,r)),{isLoading:G,error:B}=eo(e,b++,(e,t,n,r)=>i(n,e,t,r),(e,t,n,r)=>i(n,e,t,r)),{isLoading:j,error:W}=en(e&&R,b++,y,(e,t,n,r)=>i(n,e,t,r),(e,t,n,r)=>i(n,e,t,r)),Y=b++,X=async e=>{if(!c.current.isEmpty)return;let t=e.map((e,t)=>({uuid:e.uuid,key:e.key,index:t}));(0,N.i1)(t),e.forEach((e,t)=>{c.current.add(new O(t,e.title,e.category,e.description,e.technologies,e.terms,e.status,e.downloads,e.images))});let n=e.map(e=>e.images.main);
53n.push({key:"BackgroundEffect",url:"/assets/texture/EffectTexture.png"}),w(n)},q=async e=>{if(f.current.length>0)return;let t=U.u.gis.dataScale;e.forEach((e,n)=>{f.current.push(new a.Pq0(e[0],e[1],e[2]).multiplyScalar(t))})},Z=async e=>{m.current||((0,d.Rm)("yellowgreen","\uD83D\uDEE0ï¸","parseGISSegmentData",typeof e),m.current=JSON.parse(JSON.stringify(e)))};return(0,r.useEffect)(()=>{if(!e||p.current)return;let t=new AbortController;return new E.B().load("/assets/data/product/product-gis-mesh.glb",e=>{t.signal.aborted||(e.scene.traverse(e=>{e instanceof a.eaF&&!p.current&&(p.current=e.geometry)}),g(!1))},e=>{!t.signal.aborted&&e.lengthComputable&&i(Y,e.loaded,e.total,"/assets/data/product/product-gis-mesh.glb")},e=>{t.signal.aborted||((0,d.Rm)("magenta","â","GLB load error",e),x(e instanceof Error?e:Error(String(e))),g(!1))}),()=>{t.abort()}},[e]),(0,r.useEffect)(()=>{T&&X(T)},[T]),(0,r.useEffect)(()=>{A&&q(A)},[A]),(0,r.useEffect)(()=>{I&&Z(I)},[I]),(0,r.useEffect)(()=>{!R&&y&&y.length>0&&C(!0)},[y]),(0,r.useEffect)(()=>{e&&(M||_||z||V||G||j||h||([P,D,L,k,B,W,v].some(e=>void 0!==e)?l():s()))},[e,M,_,z,V,G,j,h]),{productDataset:c.current,gisPointDataset:f.current,gisSegmentDataset:m.current,gisMeshGeometry:p.current,error:[P,D,L,k,B,W,v].filter(e=>void 0!==e),isLoading:u.current<100||c.current.isEmpty||0===f.current.length||null===m.current||null===p.current||M||_||z||V||G||j||h}};var z=n(904);let V=(e,t,n,a)=>{let o,i,s,l,u=(0,T.c)(13),c=(0,r.useRef)(z.yF.DEFAULT);u[0]!==a||u[1]!==e?(o=a?null:Array(e).fill(0),u[0]=a,u[1]=e,u[2]=o):o=u[2];let f=(0,r.useRef)(o);u[3]!==a||u[4]!==e?(i=a?null:Array(e).fill(0),u[3]=a,u[4]=e,u[5]=i):i=u[5];let d=(0,r.useRef)(i);u[6]!==a||u[7]!==e?(s=a?null:Array(e).fill(!1),u[6]=a,u[7]=e,u[8]=s):s=u[8];let m=(0,r.useRef)(s),p=(0,r.useRef)(0),h=(0,r.useRef)(0),g=(0,r.useRef)(0);return u[9]!==n||u[10]!==t||u[11]!==e?(l={calculateProgress:(r,a,o,i)=>{if(0===e||0===o||c.current===z.yF.COMPLETE)return;f.current||(f.current=Array(e).fill(0),d.current=Array(e).fill(0),m.current=Array(e).fill(!1)),f.current[r]=a,d.current[r]=o,f.current[r]===d.current[r]&&(m.current[r]=!0);let s=d.current.filter(k).length/e;p.current=f.current.reduce(G,0),h.current=d.current.reduce(B,0),0!==p.current&&0!==h.current&&(g.current=Math.round(100*p.current/h.current)*s,100===g.current?(c.current=z.yF.COMPLETE,n.onComplete?.(p.current,h.current,t,i)):(c.current=z.yF.PROGRESS,n.onProgress?.(p.current,h.current,t,i)))},state:c,itemCompleted:m,sumPercentCompleted:g},u[9]=n,u[10]=t,u[11]=e,u[12]=l):l=u[12],l};function k(e){return 0!==e}function G(e,t){return e+t}function B(e,t){return e+t}var j=n(8119);let $={revalidateOnFocus:!1,revalidateOnReconnect:!1},W=(e,t)=>{let n=new TextDecoder().decode(e);return null!==t&&t.includes("application/json")?JSON.parse(n):n},H=(e,t,n,a)=>{let o,i,s,l,u,c,m,h,g,v,x,y,w=(0,T.c)(31),R=void 0===a?"yellow":a,{notifyLoadingFetcherEvent:C}=(0,r.useContext)(f.el);w[0]!==t?(o=Array(t).fill(0),w[0]=t,w[1]=o):o=w[1];let b=(0,r.useRef)(o);w[2]!==t?(i=Array(t).fill(0),w[2]=t,w[3]=i):i=w[3];let S=(0,r.useRef)(i);w[4]!==t?(s=Array(t).fill(!1),w[4]=t,w[5]=s):s=w[5];let P=(0,r.useRef)(s),M=(0,r.useRef)(0),A=(0,r.useRef)(0),D=(0,r.useRef)(0),_=(0,r.useRef)(f.yF.DEFAULT),I=(0,r.useRef)(!0);w[6]!==C||w[7]!==t?(l=(e,n,r,a)=>{if(!I.current||0===r||_.current===f.yF.COMPLETE)return;b.current[e]=n,S.current[e]=r;let o=S.current.filter(Y).length/t;M.current=b.current.reduce(X,0),A.current=S.current.reduce(q,0),0!==M.current&&0!==A.current&&(D.current=Math.round(100*M.current/A.current)*o,100===D.current?_.current=f.yF.COMPLETE:_.current=f.yF.PROGRESS,C(_.current,D.current,M.current,A.current))},w[6]=C,w[7]=t,w[8]=l):l=w[8];let E=l;w[9]!==E||w[10]!==n||w[11]!==R?(u=e=>async(e,t)=>(await function(e){return new Promise(t=>setTimeout(t,e))}(n),(0,p.G)(e,{onProgress:(n,r)=>{E(t,n,r,e)}}).then(n=>{let{buffer:r,contentType:a}=n;return P.current[t]=!0,E(t,S.current[t],S.current[t],e),W(r,a)}).catch(t=>{throw(0,d.Rm)(R,"â","fetch error",e,t),t})),w[9]=E,w[10]=n,w[11]=R,w[12]=u):u=w[12];let U=u;w[13]!==R?(c=()=>(I.current=!0,(0,d.Rm)(R,"â","mounted"),()=>
53{I.current=!1,(0,d.Rm)(R,"â","unmounted")}),w[13]=R,w[14]=c):c=w[14],w[15]===Symbol.for("react.memo_cache_sentinel")?(m=[],w[15]=m):m=w[15],(0,r.useEffect)(c,m),w[16]!==C||w[17]!==e?(h=()=>(e&&(_.current=f.yF.START,C(_.current,D.current,M.current,A.current)),()=>{_.current=f.yF.DEFAULT,D.current=0,M.current=0,A.current=0,b.current.fill(0),S.current.fill(0),P.current.fill(!1)}),w[16]=C,w[17]=e,w[18]=h):h=w[18],w[19]!==e?(g=[e],w[19]=e,w[20]=g):g=w[20],(0,r.useEffect)(h,g),w[21]!==C?(v=()=>{I.current&&_.current!==f.yF.COMPLETE&&(_.current=f.yF.COMPLETE,D.current=100,C(_.current,100,M.current,A.current))},w[21]=C,w[22]=v):v=w[22];let O=v;w[23]!==R||w[24]!==C?(x=()=>{I.current&&_.current!==f.yF.FAILED&&(_.current=f.yF.FAILED,(0,d.Rm)(R,"â","loading failed"),C(_.current,D.current,M.current,A.current))},w[23]=R,w[24]=C,w[25]=x):x=w[25];let F=x;return w[26]!==E||w[27]!==U||w[28]!==O||w[29]!==F?(y={createFetcher:U,calculateProgress:E,notifyComplete:O,notifyFailed:F,state:_,sumPercentCompleted:D},w[26]=E,w[27]=U,w[28]=O,w[29]=F,w[30]=y):y=w[30],y};function Y(e){return 0!==e}function X(e,t){return e+t}function q(e,t){return e+t}var Z=n(9496).hp;let Q=(e,t,n,i,s,l)=>{let u=0,c=(0,r.useRef)([,,].fill(0)),f=(0,r.useRef)([,,].fill(0)),m=(0,r.useRef)([,,].fill(!1)),h=(0,r.useRef)(0),g=(0,r.useRef)(0),v=(0,r.useRef)(0),x=(0,r.useRef)(z.yF.DEFAULT),y=null===n?`/assets/font/${t}-msdf.json`:`/assets/font/${t}-${n}.fnt`,w=null===n?`/assets/font/${t}-msdf.png`:`/assets/font/${t}-${n}.png`,{data:R,error:C,isLoading:b}=(0,o.u)(e?[y,u++]:null,e=>{let[t,n]=e;return M(t,n)},$),{data:S,error:T,isLoading:P}=(0,o.u)(e?[w,u++]:null,e=>{let[t,n]=e;return D(t,n)},$),M=async(e,t)=>e?(0,p.G)(e,{onProgress:(n,r)=>{A(t,n,r,e)}}).then(n=>{let{buffer:r,contentType:a}=n;A(t,f.current[t],f.current[t],e);let o=W(r,a);switch(e.split(".").pop()?.toLowerCase()){case"xml":return new j.Ru().parse(o);case"bin":return new j.jC().parse(Z.from(o,"utf-8"));case"json":return new j.ey().parse(o);default:return new j.jQ().parse(o)}}).catch(t=>{throw(0,d.Rm)("yellow","â","font fetch error",e,t),t}):null,A=(e,t,n,r)=>{if(0===n||x.current===z.yF.COMPLETE)return;c.current[e]=t,f.current[e]=n,c.current[e]===f.current[e]&&(m.current[e]=!0);let a=f.current.filter(e=>0!==e).length;h.current=c.current.reduce((e,t)=>e+t,0),g.current=f.current.reduce((e,t)=>e+t,0),0!==h.current&&0!==g.current&&(v.current=Math.round(100*h.current/g.current)*(a/2),100===v.current?x.current=z.yF.COMPLETE:(x.current=z.yF.PROGRESS,s?.(h.current,g.current,i,r)))},D=async(e,t)=>e?(0,p.G)(e,{onProgress:(n,r)=>{A(t,n,r,e)}}).then(async r=>{let{buffer:o,contentType:i}=r;A(t,f.current[t],f.current[t],e);let s=new Blob([o],{type:i??void 0}),l=URL.createObjectURL(s);try{let e=await new Promise((e,t)=>{new a.Tap().load(l,e,void 0,t)});return null===n&&(e.generateMipmaps=!1,e.minFilter=a.k6q,e.magFilter=a.k6q,e.colorSpace=a.jf0),e}finally{URL.revokeObjectURL(l)}}).catch(t=>{throw(0,d.Rm)("yellow","â","texture fetch error",e,t),t}):null,_=()=>{R&&(R.chars=[],R.kernings=[],R.pages=[]),S&&S.dispose()};return(0,r.useEffect)(()=>()=>void _(),[]),(0,r.useEffect)(()=>{e||_()},[e]),(0,r.useEffect)(()=>{if(!R||!S||!l)return;let e=null===n?t:`${t}${n}`;l(c.current[0],f.current[0],i,e,R,S)},[R,S]),{bmfont:R,texture:S,error:C||T,isLoading:b||P}};Q.displayName="useBMFontTexture";var K=n(4295);let J=[{type:"bitmap",name:"USansRgBd",size:null},{type:"bitmap",name:"USansRgMd",size:null},{type:"bitmap",name:"USansRgBk",size:null},{type:"woff",name:"USansRgBd",size:null},{type:"woff",name:"USansRgMd",size:null},{type:"woff",name:"USansRgBk",size:null},{type:"woff",name:"USansRgLt",size:null}],ee=(e,t,n,a,o)=>{let{addFont:i}=(0,r.useContext)(K.D),s=o??J,l=s.length,u=0,{calculateProgress:c}=V(l,t,{onProgress:n,onComplete:a}),f=s.map(t=>"bitmap"===t.type?Q(e,t.name,t.size,u++,(e,t,n,r)=>c(n,e,t,r),(e,t,n,r,a,o)=>(c(n,e,t,r),i(r,{fontFile:a,fontTexture:o}))):et(e,t.name,u++,(e,t,n,r)=>c(n,e,t,r),(e,t,n,r,a)=>c(n,e,t,r)));return ed("yellow"),{isLoading:f.some(e=>e.isLoading),error:f.map(e=>e.error).find(e=>void 0!==e)}};ee.displayName="useFonts";let et=(e,t,n,a,o)=>{let i,s,l,u,c,f,d,m,p,h,g=(0,T.c)(26),[v,x]=(0,r.useState)(null),[y,w]=(0,r.useState)(void 0),[R,C]=(0,r.useState)(!1);g[0]!==t||g[1]!==n||g[2]!==o||g[3]!==a?(i=async e=>
53{let r=new FontFace(t,`url(${e})`);x(r),document.fonts.add(r),r.load().then(r=>{a?.(1,1,n,e),o?.(1,1,n,t,r),C(!1)}).catch(e=>{w(e),C(!1)})},g[0]=t,g[1]=n,g[2]=o,g[3]=a,g[4]=i):i=g[4];let b=i;return g[5]!==v?(l=()=>{s()},s=()=>{v&&x(null)},g[5]=v,g[6]=s,g[7]=l):(s=g[6],l=g[7]),g[8]!==l?(u=()=>()=>l(),g[8]=l,g[9]=u):u=g[9],g[10]===Symbol.for("react.memo_cache_sentinel")?(c=[],g[10]=c):c=g[10],(0,r.useEffect)(u,c),g[11]!==s||g[12]!==e?(f=()=>{e||s(),e&&C(!0)},g[11]=s,g[12]=e,g[13]=f):f=g[13],g[14]!==e?(d=[e],g[14]=e,g[15]=d):d=g[15],(0,r.useEffect)(f,d),g[16]!==b||g[17]!==t||g[18]!==R?(m=()=>{R&&b(`/assets/font/${t}.woff`)},g[16]=b,g[17]=t,g[18]=R,g[19]=m):m=g[19],g[20]!==R?(p=[R],g[20]=R,g[21]=p):p=g[21],(0,r.useEffect)(m,p),g[22]!==y||g[23]!==v||g[24]!==R?(h={font:v,error:y,isLoading:R},g[22]=y,g[23]=v,g[24]=R,g[25]=h):h=g[25],h};et.displayName="useWoffFont";let en=(e,t,n,i,s)=>{let{addTexture:l}=(0,r.useContext)(f.DM),u=(0,r.useRef)(0),{calculateProgress:c}=V(n?.length??0,t,{onProgress:i,onComplete:s},!0),m=async e=>e&&0!==e.length?Promise.all(e.map(e=>(0,p.G)(e.url,{onProgress:(t,n)=>{0!==n&&c(u.current,t,n,e.url)}}).then(async t=>{let{buffer:n,contentType:r}=t,o=new Blob([n],{type:r??void 0}),i=URL.createObjectURL(o);try{let t=await new Promise((e,t)=>{new a.Tap().load(i,e,void 0,t)});return l(e.key,t),t}finally{URL.revokeObjectURL(i)}}).catch(t=>{throw(0,d.Rm)("cyan","â","texture fetch error",e.url,t),t}))):[],{data:h,isLoading:g,error:v}=(0,o.u)(e?n:null,m,$);return ed("cyan"),{isLoading:g,error:v}};en.displayName="useTextures";let er=()=>{let{addTexture:e,getTexture:t}=(0,r.useContext)(f.DM),[n,o]=(0,r.useState)(!1),i=(0,r.useRef)(null),s=(0,r.useCallback)(async(n,r)=>{let s=t(n.key);if(s)return r?.(1),s;o(!0),i.current&&i.current.abort();let l=new AbortController;i.current=l;let{buffer:u,contentType:c}=await (0,p.G)(n.url,{signal:l.signal,onProgress:(e,t)=>{r&&t>0&&r(e/t)}}),f=new Blob([u],{type:c??void 0}),d=URL.createObjectURL(f);try{let t=await new Promise((e,t)=>{new a.Tap().load(d,e,void 0,t)});return e(n.key,t),o(!1),i.current=null,r?.(1),t}finally{URL.revokeObjectURL(d)}},[e,t]);return(0,r.useEffect)(()=>()=>{i.current?.abort(),i.current=null},[]),{load:s,isLoading:n}};var ea=n(5844);let eo=(e,t,n,a)=>{let{addSound:o}
53=(0,r.useContext)(f.nE),i=Object.values(ea.uc).length,s=0,{calculateProgress:l}=V(i,t,{onProgress:n,onComplete:a}),u=Object.values(ea.uc).map(t=>ei(e,t,`${t}.ogg`,s++,(e,t,n,r)=>l(n,e,t,r),(e,t,n,r,a)=>(l(n,e,t,r),o(r,a))));return ed("orange"),{isLoading:u.some(e=>e.isLoading),error:u.map(e=>e.error).find(e=>void 0!==e)}};eo.displayName="useSounds";let ei=(e,t,n,i,s,l)=>{let u=(0,r.useRef)(0),c=(0,r.useRef)(0),{data:f,error:m,isLoading:h}=(0,o.u)(e?[`/assets/data/audio/${n}`,i]:null,e=>{let[t,n]=e;return g(t,n)},$),g=async(e,n)=>e?(0,p.G)(e,{onProgress:(e,n)=>{0!==n&&(u.current=e,c.current=n,s?.(e,n,i,t))}}).then(async e=>{let{buffer:n}=e,r=n.slice(0),o=a.UtX.getContext(),s=await new Promise(e=>o.decodeAudioData(r,e));return l?.(u.current,c.current,i,t,s),s}).catch(t=>{throw(0,d.Rm)("orange","â","audio fetch error",e,t),t}):null,v=()=>{};return(0,r.useEffect)(()=>()=>void v(),[]),(0,r.useEffect)(()=>{e||v()},[e]),(0,r.useEffect)(()=>{f&&l&&l(0,0,i,t,f)},[f]),{data:f,error:m,isLoading:h}};ei.displayName="useThreeAudio";let es=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"orangered",{setShouldPerformLoading:n,loadingAnimationState:a,registerLoadingAnimationEvent:o,unregisterLoadingAnimationEvent:i}=(0,r.useContext)(f.el),s=(0,d.a4)(["src/hooks/useLoadingLifecycle.ts"]),l=(0,r.useRef)(null);l.current=(t,r)=>{t===f.$Z.DISMISSED&&(n(!1),e())};let u=(0,r.useRef)((e,t)=>{l.current(e,t)}).current;(0,r.useEffect)(()=>((0,d.Og)(s,t,"â","mounted"),o(u),n(!0),a.current.state===f.$Z.DISMISSED&&(n(!1),e()),()=>{(0,d.Og)(s,t,"â","unmounted"),i(u)}),[])},el=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"crimson",n=arguments.length>2?arguments[2]:void 0,a=(0,r.useRef)(e),[o,i]=(0,r.useState)(()=>Object.fromEntries(a.current.map(e=>[e,!1]))),s=(0,r.useMemo)(()=>Object.fromEntries(a.current.map(e=>[e,t=>{i(n=>{let r="function"==typeof t?t(n[e]):t;return n[e]===r?n:{...n,[e]:r}})}])),[]),l=(n??a.current).every(e=>o[e]),u=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{l!==u.current&&(u.current=l),(0,d.Rm)(t,"\uD83D\uDD0D",...a.current.flatMap(e=>[` 54${e}`,o[e]]))},[o]),{states:o,setters:s,isAllReady:l}};var eu=n(1944);let ec=e=>{let t,n=(0,T.c)(2);return n[0]!==e?(t=t=>{t&&Object.assign(t.uniforms,e.current)},n[0]=e,n[1]=t):t=n[1],t};n(3064);var ef=n(3732);let ed=e=>{let t,n,a,o=(0,T.c)(4);o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,d.a4)(["src/hooks/useLifecycleLog.ts"]),o[0]=t):t=o[0];let i=t;o[1]!==e?(n=()=>((0,d.Og)(i,e,"â","mounted"),()=>(0,d.Og)(i,e,"â","unmounted")),o[1]=e,o[2]=n):n=o[2],o[3]===Symbol.for("react.memo_cache_sentinel")?(a=[],o[3]=a):a=o[3],(0,r.useEffect)(n,a)},em=()=>{let e,t,n,a,o,i=(0,T.c)(5);i[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],i[0]=e):e=i[0];let s=(0,r.useRef)(e);i[1]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{s.current.includes(e)||(s.current=[...s.current,e])},i[1]=t):t=i[1];let l=t;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{s.current=s.current.filter(t=>t!==e)},i[2]=n):n=i[2];let u=n;i[3]===Symbol.for("react.memo_cache_sentinel")?(a=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];s.current.forEach(e=>e(...t))},i[3]=a):a=i[3];let c=a;return i[4]===Symbol.for("react.memo_cache_sentinel")?(o={register:l,unregister:u,emit:c,listeners:s},i[4]=o):o=i[4],o};n(6673)},2488:(e,t,n)=>{n.d(t,{z:()=>r});let r={masterVolume:2,bgm:{award:{drone:1,chorus:2},error:{drone:1},home:{drone:1,chorus:.5},contact:{signal:.3,chorus:.6},product:{main:2},sketch:{main:1}},sfx:{award:{globeInitialTransition:.15,globeRotateC1:.3,globeRotateD1:.3,globeRotateE1:.3,globeRotateDismissC1:.3,globeRotateDismissD1:.3,globeRotateDismissE1:.3,globeDragC1:.5,globeDragD1:.5,globeDragE1:.5,globeHover:1},content:{menuClick:1,menuHover:.5},home:{transitionPortraitIn1:.5,transitionPortraitIn2:.5,transitionPortraitIn3:.5,transitionPortraitInMain:1,transitionPortraitLoopMain:.5,transitionPortraitLoopSub:.5,transitionPortraitOut1:.5,transitionPortraitOut2:.5,transitionPortraitOut3:.5,transitionPortraitOutMain:1},loading:{dataProcess:1},navigation:{mainClick:1,mainHover1:1,mainHover2:1,mainHover3:1,mainTransitionConnector1:1,mainTransitionConnector2:1,mainTransitionConnector3:1,mainTransitionConnector4:1,mainTransitionConnector5:1,mainTransitionConnector6:1,mainTransitionConnector7:1,mainTransitionConnector8:1,mainTransitionText1:1,mainTransitionText2:1,mainTransitionText3:1,mainTransitionText4:1,mainTransitionText5:1,mainTransitionText6:1,subClick:.5,subHover:.5},product:{sfx_product_float_close:1,sfx_product_float_open:1,sfx_product_item_click:1,sfx_product_item_hover:2,sfx_product_item_hover_text_transition:1.5,sfx_product_pulse:1,sfx_product_image_transition_1:1,sfx_product_image_transition_2:1,sfx_product_image_transition_3:1,sfx_product_image_transition_4:1,sfx_product_image_transition_5:1},text:{transition1:1,transition2:1}}}}
54,3064:(e,t,n)=>{n.d(t,{u:()=>c});var r=n(6065),a=n(9618),o=n(3267),i=n(1780),s=n(1816);let l=i.u.gis.bloom.bloomLayer,u=i.u.gis.bloom;function c(){let e=(0,o.C)(e=>e.size),t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useRef)(null),c=(0,r.useRef)(null),f=(0,r.useRef)(null),d=(0,r.useRef)([]),m=(0,r.useMemo)(()=>new a.BKk({vertexShader:s.bN,fragmentShader:s.FZ,uniforms:{tBloomMip0:new a.nc$(null),tBloomMip1:new a.nc$(null),uStrength:new a.nc$(u.strength),uTint:new a.nc$(new a.Q1f(u.tint)),uMipWeights:new a.nc$(new a.I9Y(u.mipWeights[0],u.mipWeights[1]))},transparent:!1,depthTest:!1,depthWrite:!1,blending:a.EZo}),[]),p=(0,r.useMemo)(()=>{let e=new a.Z58,t=new a.bdM(2,2),n=new a.eaF(t,m);return n.frustumCulled=!1,e.add(n),e},[m]),h=(0,r.useRef)(p).current,g=(0,r.useMemo)(()=>new a.qUd(-1,1,1,-1,0,1),[]);(0,r.useEffect)(()=>{let r=Math.ceil(e.width/4),o=Math.ceil(e.height/4),l=Math.ceil(e.width/8),p=Math.ceil(e.height/8),h=(e,t,n)=>{let r=new a.nWS(e,t,{minFilter:a.k6q,magFilter:a.k6q,format:a.GWd,type:a.ix0});return n&&(r.depthTexture=new a.VCu(e,t),r.depthTexture.format=a.zdS,r.depthTexture.type=a.bkx),r};t.current=h(r,o,!0),n.current=h(r,o,!1),i.current=h(r,o,!1),c.current=h(l,p,!1),f.current=h(l,p,!1);let g=[[r,o],[r,o],[l,p],[l,p]],v=[[1,0],[0,1],[1,0],[0,1]];for(let e of d.current)e.dispose();return d.current=g.map((e,t)=>{let[n,r]=e,[o,i]=v[t];return new a.BKk({vertexShader:s.bN,fragmentShader:s.re,uniforms:{tInput:new a.nc$(null),uDirection:new a.nc$(new a.I9Y(o/n,i/r)),uKernelRadius:new a.nc$(u.kernelRadius)},depthTest:!1,depthWrite:!1})}),d.current[0].uniforms.tInput.value=t.current.texture,d.current[1].uniforms.tInput.value=n.current.texture,d.current[2].uniforms.tInput.value=i.current.texture,d.current[3].uniforms.tInput.value=c.current.texture,m.uniforms.tBloomMip0.value=i.current.texture,m.uniforms.tBloomMip1.value=f.current.texture,()=>{for(let e of(t.current?.depthTexture?.dispose(),t.current?.dispose(),n.current?.dispose(),i.current?.dispose(),c.current?.dispose(),f.current?.dispose(),t.current=null,n.current=null,i.current=null,c.current=null,f.current=null,d.current))e.dispose();d.current=[]}},[e.width,e.height]),(0,r.useEffect)(()=>()=>{m.dispose();let e=p.children[0];e?.geometry.dispose()},[m,p]);let v=(0,r.useRef)(new a.Q1f);return{renderSource:(e,n,r,a)=>{if(!t.current)return;e.getClearColor(v.current);let o=e.getClearAlpha();e.setRenderTarget(t.current),e.setClearColor(0,0),e.clear(!0,!0,!1);let i=a?.material;i&&(i.depthWrite=!1);let s=e.getContext();s.colorMask(!1,!1,!1,!1),r.layers.set(0),e.render(n,r),s.colorMask(!0,!0,!0,!0),i&&(i.depthWrite=!0),r.layers.set(l),e.render(n,r),r.layers.set(0),e.setRenderTarget(null),e.setClearColor(v.current,o)},renderBlur:e=>{if(d.current.length<4)return;let t=[n,i,c,f],r=h.children[0];for(let n=0;n<4;n++){let a=t[n].current;if(!a)return;r.material=d.current[n],e.setRenderTarget(a),e.clear(!0,!1,!1),e.render(h,g)}e.setRenderTarget(null)},renderComposite:e=>{h.children[0].material=m,e.clearDepth(),e.render(h,g)}}}},3361:(e,t,n)=>{n.d(t,{i:()=>r});class r{static MAX_DATASET_TRAJECTORY_LENGTH=300;static MAX_RENDER_TRAJECTORY_LENGTH=5;pointLists=[];navigationMarkerList=[];statusMarkerLists=[];cameraFocusMarkerLists=[];_currenDatasetIndex=0;get currenDatasetIndex(){return this._currenDatasetIndex}get currentPointList(){return this.pointLists[this._currenDatasetIndex]}get currentNavigationMarker(){return this.navigationMarkerList[this._currenDatasetIndex]}get currentStatusMarker(){return this.statusMarkerLists[this._currenDatasetIndex]}trajectoryTriangleMarkerList=[];trajectoryCrossMarkerList=[];currentTrajectoryTriangleIndex=0;currentTrajectoryCrossIndex=0;triangleMeshList=[];maskMeshList=[];get currentTriangleMeshList(){return this.triangleMeshList[this._currenDatasetIndex]}get currentMaskMeshList(){return this.maskMeshList[this._currenDatasetIndex]}_currentTrajectoryTriangleMarker=[];get currentTrajectoryTriangleMarker(){return this._currentTrajectoryTriangleMarker}_currentTrajectoryCrossMarker=[];get currentTrajectoryCrossMarker(){return this._currentTrajectoryCrossMarker}get cameraFocusMarker(){return this.cameraFocusMarkerLists[this._currenDatasetIndex]}get isEmpty(){return 0===this.pointLists.length}add(e,t,n,r,a,o,i,s){this.pointLists.push(e),this.navigationMarkerList.push(t),this.cameraFocusMarkerLists.push(n),this.statusMarkerLists.push(r),this.trajectoryTriangleMarkerList.push(a),this.trajectoryCrossMarkerList.push(o),this.triangleMeshList.push(i),this.maskMeshList.push(s)}dispose(){this.pointLists=[],this.navigationMarkerList=[],this.statusMarkerLists=[],this.cameraFocusMarkerLists=[],this._currenDatasetIndex=0,this.trajectoryTriangleMarkerList=[],this.trajectoryCrossMarkerList=[],this._currentTrajectoryTriangleMarker=[],this._currentTrajectoryCrossMarker=[],this.triangleMeshList=[],this.maskMeshList=[]}nextDataset(){this._currenDatasetIndex<this.pointLists.length-1?this._currenDatasetIndex++:this._currenDatasetIndex=0;for(let e=0;e<r.MAX_RENDER_TRAJECTORY_LENGTH;e++)this.nextTriangleTrajectory(),this.nextCrossTrajectory()}nextTriangleTrajectory(){let e=this.trajectoryTriangleMarkerList[this._currenDatasetIndex];this.currentTrajectoryTriangleIndex++,this.currentTrajectoryTriangleIndex>=e.length&&(this.currentTrajectoryTriangleIndex=0),this._currentTrajectoryTriangleMarker=[];let t=this.currentTrajectoryTriangleIndex;for(;this._currentTrajectoryTriangleMarker.length<r.MAX_RENDER_TRAJECTORY_LENGTH;){t>=e.length&&(t=0);let n=e[t];this._currentTrajectoryTriangleMarker.push(n),t++}}nextCrossTrajectory(){let e=this.trajectoryCrossMarkerList[this._currenDatasetIndex];this.currentTrajectoryCrossIndex++,this.currentTrajectoryCrossIndex>=e.length&&(this.currentTrajectoryCrossIndex=0),this._currentTrajectoryCrossMarker=[];let t=this.currentTrajectoryCrossIndex;for(;this._currentTrajectoryCrossMarker.length<r.MAX_RENDER_TRAJECTORY_LENGTH;){t>=e.length&&(t=0);let n=e[t];this._currentTrajectoryCrossMarker.push(n),t++}}clone(){let e=new r;return e.pointLists=this.pointLists.map(e=>[...e]),e.navigationMarkerList=[...this.navigationMarkerList],e.statusMarkerLists=this.statusMarkerLists.map(e=>[...e]),e.trajectoryTriangleMarkerList=this.trajectoryTriangleMarkerList.map(e=>[...e]),e.trajectoryCrossMarkerList=this.trajectoryCrossMarkerList.map(e=>[...e]),e.triangleMeshList=this.triangleMeshList.map(e=>[...e]),e.maskMeshList=this.maskMeshList.map(e=>e),e.cameraFocusMarkerLists=[...this.cameraFocusMarkerLists],e._currenDatasetIndex=this._currenDatasetIndex,e.currentTrajectoryTriangleIndex=0,e.currentTrajectoryCrossIndex=0,e}}},3545:(e,t,n)=>{n.d(t,{G:()=>r});let r=async(e,t)=>{let n=await fetch(e,t?.signal?{signal:t.signal}:void 0);if(!n.ok)throw Error(`fetch failed: ${n.status} ${n.statusText} ${e}`);let r=n.headers.get("content-type"),a=Number(n.headers.get("content-length")),o=Number.isFinite(a)&&a>0?a:0;if(!n.body)return{buffer:new ArrayBuffer(0),contentType:r};let i=n.body.getReader(),s=[],l=0;for(;;){let{done:e,value:n}=await i.read();if(e)break;
54n&&(s.push(n),l+=n.byteLength,t?.onProgress?.(l,o))}let u=new Uint8Array(l),c=0;return s.forEach(e=>{u.set(e,c),c+=e.byteLength}),{buffer:u.buffer,contentType:r}}},3698:(e,t,n)=>{n.d(t,{C:()=>c,d:()=>f});var r=n(7973),a=n(6065),o=n(8075),i=n(2310),s=n(2466),l=n(108),u=n(8497);let c=(0,a.createContext)({shouldPresentContent:!1,isAllRendererReady:!1,isSketchCurtainWallRendererReady:!1,setIsSketchCurtainWallRendererReady:()=>{},isSketchAnnotationRendererReady:!1,setIsSketchAnnotationRendererReady:()=>{},isSketchContourMapRendererReady:!1,setIsSketchContourMapRendererReady:()=>{},isSketchContourMapAnnotationRendererReady:!1,setIsSketchContourMapAnnotationRendererReady:()=>{},isSketchElasticGridRendererReady:!1,setIsSketchElasticGridRendererReady:()=>{},isSketchElasticGridAnnotationRendererReady:!1,setIsSketchElasticGridAnnotationRendererReady:()=>{},sceneCamera:{current:null},sketchScene:{current:null},sketchHeaderScene:{current:null},isSketchHeaderRendererReady:!1,setIsSketchHeaderRendererReady:()=>{},surfaceManagerRef:{current:null},curtainWallTimeRef:{current:0},holeManagerRef:{current:null},sphereManagerRef:{current:null},activePattern:"contourmap",switchPattern:()=>{},pendingPattern:null,onDismissComplete:()=>{},isSketchPatternSelectorRendererReady:!1,setIsSketchPatternSelectorRendererReady:()=>{}}),f=e=>{let{children:t}=e,{shouldPerformLoading:n}=(0,a.useContext)(i.el),{sendEvent:f}=(0,i.pn)(),d=(0,o.zy)(),m=(0,o.Zp)(),p=(0,a.useMemo)(()=>{let e=d.pathname.split("/").filter(Boolean)[1],t=e?(0,l.gm)(e):void 0;return t?.key??l.qp[l.am].key},[]);(0,s.dV)(n,0);let[h,g]=(0,a.useState)(!1),[v,x]=(0,a.useState)(p),[y,w]=(0,a.useState)(null),R=(0,a.useMemo)(()=>{let e=l.qp.find(e=>e.key===v);return[...e?.rendererReadyNames??[],...l.hk]},[v]),{states:C,setters:b,isAllReady:S}=(0,s.i5)(l.cY,"darkcyan",R),T=(0,a.useCallback)(e=>{e===v||null===y&&w(e)},[v,y]),P=(0,a.useCallback)(()=>{if(null===y)return;for(let e of l.uL)b[e](!1);x(y),w(null);let e=l.qp.find(e=>e.key===y),t=`/sketch/${e?.uuid}`;e&&d.pathname!==t&&(N.current=!0,m(t))},[y,b,m,d.pathname]),M=(0,a.useRef)(null),A=(0,a.useRef)(null),D=(0,a.useRef)(null),_=(0,a.useRef)(null),I=(0,a.useRef)(0),E=(0,a.useRef)(null),U=(0,a.useRef)(null),O=(0,a.useRef)("u">typeof performance?performance.now():0),F=(0,a.useRef)(!1);(0,s.SK)(()=>g(!0)),(0,a.useEffect)(()=>{d.pathname.split("/").filter(Boolean)[1]||m(`/sketch/${l.rM}`,{replace:!0})},[]);let N=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(N.current){N.current=!1;return}let e=d.pathname.split("/").filter(Boolean)[1];if(!e)return;let t=(0,l.gm)(e);t&&t.key!==v&&null===y&&T(t.key)},[d.pathname]),(0,a.useEffect)(()=>{if(!S||F.current)return;F.current=!0;let e=performance.now()-O.current;f({event:"scene_init_time",webgl_renderer:(0,u.J)(),duration_ms:Math.round(e),pixel_ratio:window.devicePixelRatio||1})},[S,f]);let L=(0,a.useMemo)(()=>({shouldPresentContent:h,isAllRendererReady:S,isSketchCurtainWallRendererReady:C.isSketchCurtainWallRendererReady,setIsSketchCurtainWallRendererReady:b.isSketchCurtainWallRendererReady,isSketchAnnotationRendererReady:C.isSketchAnnotationRendererReady,setIsSketchAnnotationRendererReady:b.isSketchAnnotationRendererReady,isSketchContourMapRendererReady:C.isSketchContourMapRendererReady,setIsSketchContourMapRendererReady:b.isSketchContourMapRendererReady,isSketchContourMapAnnotationRendererReady:C.isSketchContourMapAnnotationRendererReady,setIsSketchContourMapAnnotationRendererReady:b.isSketchContourMapAnnotationRendererReady,isSketchElasticGridRendererReady:C.isSketchElasticGridRendererReady,setIsSketchElasticGridRendererReady:b.isSketchElasticGridRendererReady,isSketchElasticGridAnnotationRendererReady:C.isSketchElasticGridAnnotationRendererReady,setIsSketchElasticGridAnnotationRendererReady:b.isSketchElasticGridAnnotationRendererReady,sceneCamera:D,sketchScene:M,sketchHeaderScene:A,isSketchHeaderRendererReady:C.isSketchHeaderRendererReady,setIsSketchHeaderRendererReady:b.isSketchHeaderRendererReady,surfaceManagerRef:_,curtainWallTimeRef:I,holeManagerRef:E,sphereManagerRef:U,activePattern:v,switchPattern:T,pendingPattern:y,onDismissComplete:P,isSketchPatternSelectorRendererReady:C.isSketchPatternSelectorRendererReady,setIsSketchPatternSelectorRendererReady:b.isSketchPatternSelectorRendererReady}),[h,S,C.isSketchCurtainWallRendererReady,C.isSketchAnnotationRendererReady,C.isSketchContourMapRendererReady,C.isSketchContourMapAnnotationRendererReady,C.isSketchElasticGridRendererReady,C.isSketchElasticGridAnnotationRendererReady,C.isSketchHeaderRendererReady,C.isSketchPatternSelectorRendererReady,v,T,y,P]);return(0,r.jsx)(c.Provider,{value:L,children:t})}},3732:(e,t,n)=>{n.d(t,{i:()=>s,s:()=>i});var r=n(6065),a=n(4121);let o=(0,r.createContext)({isRenderActive:!0,isRenderActiveRef:{current:!0},subscribeRenderLifecycle:()=>()=>{}}),i=e=>{let{children:t}=e,n=(0,r.useCallback)(()=>
54{if("u">typeof document)return document.visibilityState},[]),[i,s]=(0,r.useState)(()=>(0,a.OE)(n())),l=(0,r.useRef)(i),u=(0,r.useRef)(new Set),c=(0,r.useCallback)((e,t)=>{let n=l.current;l.current=e,s(e),n!==e&&u.current.forEach(n=>n(e,t))},[]);(0,r.useEffect)(()=>{l.current=i},[i]),(0,r.useEffect)(()=>{if("u"<typeof document)return;let e=()=>c((0,a.Qb)("visibilitychange",n()),"visibilitychange"),t=()=>c((0,a.Qb)("pagehide",n()),"pagehide"),r=()=>c((0,a.Qb)("pageshow",n()),"pageshow"),o=()=>c((0,a.Qb)("freeze",n()),"freeze"),i=()=>c((0,a.Qb)("resume",n()),"resume");return e(),document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",t),window.addEventListener("pageshow",r),document.addEventListener("freeze",o),document.addEventListener("resume",i),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pagehide",t),window.removeEventListener("pageshow",r),document.removeEventListener("freeze",o),document.removeEventListener("resume",i)}},[n,c]);let f=(0,r.useCallback)(e=>(u.current.add(e),()=>{u.current.delete(e)}),[]),d=(0,r.useMemo)(()=>({isRenderActive:i,isRenderActiveRef:l,subscribeRenderLifecycle:f}),[i,f]);return(0,r.createElement)(o.Provider,{value:d},t)},s=()=>(0,r.useContext)(o)},3882:(e,t,n)=>{n.d(t,{a4:()=>i,z3:()=>u,Rm:()=>l,Og:()=>s,R8:()=>c});let r=["src/utils/debug/Logger.ts","src/utils/debug/index.ts"],a=e=>{let t=e.match(/\(app-pages-browser\)\/\.(\/(?:app|src)\/[^)\s]+:\d+:\d+)/);if(t?.[1]!==void 0)return t[1];let n=e.match(/webpack-internal:\/\/\/\.?\/((?:app|src)\/[^)\s]+:\d+:\d+)/);if(n?.[1]!==void 0)return`/${n[1]}`;let r=e.match(/(?:^|\(|\s)(\.?\/?(?:app|src)\/[^)\s]+:\d+:\d+)/);if(r?.[1]!==void 0){let e=r[1].replace(/^\.\//,"/");return e.startsWith("/")?e:`/${e}`}let a=e.match(/\/((?:app|src)\/[^)\s]+:\d+:\d+)/);return a?.[1]!==void 0?`/${a[1]}`:""},o=(e,t)=>!!(""===e||e.includes("/node_modules/")||e.includes("/react-dom/")||e.includes("/next/dist/"))||[...r,...t].some(t=>e.includes(t)),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let t of Error().stack?.split("\n")??[]){let n=a(t);if(!o(n,e))return n}return""};function s(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a]}function l(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r]}function u(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r]}function c(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r]}},4120:(e,t,n)=>{n.d(t,{H:()=>a,P:()=>r});let r=1080,a=e=>e<1080?1080:e<1440?1280:1920},4121:(e,t,n)=>{n.d(t,{$y:()=>o,OE:()=>r,Qb:()=>a});let r=e=>void 0===e||"visible"===e,a=(e,t)=>"pagehide"!==e&&"freeze"!==e&&r(t),o=e=>e.isSoundEnabled?e.isRenderActive?e.hasUserInteracted&&e.isAudioContextRunning?{type:"fade",volume:e.masterVolume,duration:e.fadeInDuration}:{type:"set",volume:e.masterVolume}:e.hasUserInteracted&&e.isAudioContextRunning?{type:"fade",volume:0,duration:e.fadeOutDuration}:{type:"set",volume:0}:{type:"none"}},4188:(e,t,n)=>{n.d(t,{Yi:()=>c,eU:()=>R,RG:()=>w});var r,a=n(7973),o=n(1343),i=n(6065),s=n(9618),l=n(3267);let u=e=>{let t,n,r=(0,o.c)(8),{defaultScene:s,defaultCamera:u,renderPriority:c,renderEnabled:h}=e,g=void 0===c?1:c,v=void 0===h||h,x=(0,l.C)(f),y=(0,l.C)(d),w=(0,l.C)(m),R=(0,i.useRef)(x).current;return r[0]!==w||r[1]!==u||r[2]!==s||r[3]!==v||r[4]!==g||r[5]!==y?(t=()=>{if(!v||w===u)return;let e=R.autoClear;1===g&&(R.autoClear=!0,R.render(s,u)),R.autoClear=!1,R.clearDepth(),R.render(y,w),R.autoClear=e},r[0]=w,r[1]=u,r[2]=s,r[3]=v,r[4]=g,r[5]=y,r[6]=t):t=r[6],(0,l.D)(t,g),r[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,a.jsx)("group",{onPointerOver:p}),r[7]=n):n=r[7],n},c=(0,i.forwardRef)((e,t)=>{let n,r,c,f,d,m,p,x,y,w,R,C=(0,o.c)(30),{children:b,renderPriority:S,renderEnabled:T,backgroundColor:P}=e,M=void 0===S?1:S,A=void 0===T||T,D=(0,l.C)(h),_=(0,l.C)(g),[I]=(0,i.useState)(v),E=(0,i.useRef)(_).current,U=(0,i.useRef)(D).current,O=(0,i.useRef)(I).current;C[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{E.name="defaultCamera"},C[0]=n):n=C[0],C[1]!==_?(r=[_],C[1]=_,C[2]=r):r=C[2],(0,i.useEffect)(n,r),C[3]!==P?(c=()=>{U.name="defaultScene",P&&(U.background=new s.Q1f(P))},C[3]=P,C[4]=c):c=C[4],C[5]!==D?(f=[D],C[5]=D,C[6]=f):f=C[6],(0,i.useEffect)(c,f),C[7]!==P?(d=()=>{O.name="hudScene",P&&(O.background=new s.Q1f(P))},C[7]=P,C[8]=d):d=C[8],C[9]!==I?(m=[I],C[9]=I,C[10]=m):m=C[10],(0,i.useEffect)(d,m),C[11]!==b||C[12]!==_||C[13]!==D||C[14]!==I?(p=()=>({defaultScene:D,defaultCamera:_,hudScene:I,children:b}),C[11]=b,C[12]=_,C[13]=D,C[14]=I,C[15]=p):p=C[15],(0,i.useImperativeHandle)(t,p),C[16]!==_||C[17]!==D||C[18]!==A||C[19]!==M?(x=(0,a.jsx)(u,{defaultScene:D,defaultCamera:_,renderPri
54ority:M,renderEnabled:A}),C[16]=_,C[17]=D,C[18]=A,C[19]=M,C[20]=x):x=C[20],C[21]!==b||C[22]!==x?(y=(0,a.jsxs)(a.Fragment,{children:[b,x]}),C[21]=b,C[22]=x,C[23]=y):y=C[23];let F=M+1;return C[24]!==I||C[25]!==y||C[26]!==F?(w=(0,l.o)(y,I,{events:{priority:F}}),C[24]=I,C[25]=y,C[26]=F,C[27]=w):w=C[27],C[28]!==w?(R=(0,a.jsx)(a.Fragment,{children:w}),C[28]=w,C[29]=R):R=C[29],R});function f(e){return e.gl}function d(e){return e.scene}function m(e){return e.camera}function p(){return null}function h(e){return e.scene}function g(e){return e.camera}function v(){return new s.Z58}var x=n(4866),y=n(4357);let w=(0,i.forwardRef)((e,t)=>{let{children:n,layers:r,name:o}=e,s=(0,i.useRef)(null),u=(0,i.useRef)(null),f=(0,i.useRef)(null),d=(0,l.C)(e=>e.gl),m=(0,l.C)(e=>e.size);return(0,i.useEffect)(()=>{u.current&&(u.current.aspect=m.width/m.height),u.current&&u.current.updateProjectionMatrix()},[m]),(0,i.useImperativeHandle)(t,()=>({children:n,camera:u.current,ambientLight:f.current,renderer:d,hudScene:s.current.hudScene}),[]),(0,a.jsxs)(c,{ref:s,renderPriority:10,children:[(0,a.jsx)(x.u,{ref:u,layers:r,name:o,makeDefault:!0,position:y.mu,fov:y.$l,far:1e4}),(0,a.jsx)("ambientLight",{ref:f,layers:r,name:o,intensity:1}),n]})});var R=((r=R||{}).AWARD_GLOBE="AWARD_GLOBE",r.AWARD_HEADER="AWARD_HEADER",r.AWARD_UI="AWARD_UI",r.CONTACT_BACKGROUND="CONTACT_BACKGROUND",r.CONTACT_FORM="CONTACT_FORM",r.CONTACT_HEADER="CONTACT_HEADER",r.CONTACT_OVERLAY="CONTACT_OVERLAY",r.SKETCH_BACKGROUND="SKETCH_BACKGROUND",r.SKETCH_HEADER="SKETCH_HEADER",r.SKETCH_OVERLAY="SKETCH_OVERLAY",r.ERROR="ERROR",r.ERROR_HEADER="ERROR_HEADER",r.ERROR_MESSAGE="ERROR_MESSAGE",r.GLOBAL_OVERLAY="GLOBAL_OVERLAY",r.HOME_PORTRAIT_MESH="HOME_PORTRAIT_MESH",r.HOME_PORTRAIT_OVERLAY="HOME_PORTRAIT_OVERLAY",r.HOME_PORTRAIT_PARTICLE="HOME_PORTRAIT_PARTICLE",r.HOME_PORTRAIT_SIGN="HOME_PORTRAIT_SIGN",r.HOME_PROFILE_CARD="HOME_PROFILE_CARD",r.LOADING="LOADING",r.NAVIGATION="NAVIGATION",r.PRODUCT="PRODUCT",r.PRODUCT_HEADER="PRODUCT_HEADER",r)},4295:(e,t,n)=>{n.d(t,{D:()=>s,s:()=>l});var r=n(7973),a=n(1343),o=n(6065),i=n(2466);let s=(0,o.createContext)({fonts:{},addFont:()=>{},textures:{},addTexture:()=>{},getTexture:()=>null}),l=e=>{let t,n,l,u,c,f,d,m,p=(0,a.c)(12),{children:h}=e;p[0]===Symbol.for("react.memo_cache_sentinel")?(t={},p[0]=t):t=p[0];let[g,v]=(0,o.useState)(t);p[1]===Symbol.for("react.memo_cache_sentinel")?(n=(e,t)=>{v(n=>({...n,[e]:{fontFile:t.fontFile,fontTexture:t.fontTexture}}))},p[1]=n):n=p[1];let x=n;p[2]===Symbol.for("react.memo_cache_sentinel")?(l={},p[2]=l):l=p[2];let[y,w]=(0,o.useState)(l);p[3]===Symbol.for("react.memo_cache_sentinel")?(u={},p[3]=u):u=p[3];let R=(0,o.useRef)(u);p[4]===Symbol.for("react.memo_cache_sentinel")?(c=(e,t)=>{let n=R.current[e];if(n){n!==t&&t.dispose();return}R.current={...R.current,[e]:t},w(R.current)},p[4]=c):c=p[4];let C=c;p[5]===Symbol.for("react.memo_cache_sentinel")?(f=e=>R.current[e]??null,p[5]=f):f=p[5];let b=f;(0,i._B)("orangered"),p[6]!==g||p[7]!==y?(d={fonts:g,addFont:x,textures:y,addTexture:C,getTexture:b},p[6]=g,p[7]=y,p[8]=d):d=p[8];let S=d;return p[9]!==h||p[10]!==S?(m=(0,r.jsx)(s.Provider,{value:S,children:h}),p[9]=h,p[10]=S,p[11]=m):m=p[11],m}},4357:(e,t,n)=>{n.d(t,{$2:()=>h,$l:()=>s,DB:()=>y,HG:()=>F,HX:()=>E,It:()=>g,J1:()=>S,Ke:()=>T,Kh:()=>b,Lh:()=>d,OF:()=>w,Q7:()=>l,RA:()=>v,SM:()=>U,Sy:()=>a,T$:()=>C,XF:()=>f,Y2:()=>R,Yv:()=>c,_m:()=>x,d9:()=>_,eZ:()=>D,fk:()=>M,iM:()=>O,mu:()=>i,o8:()=>p,p8:()=>P,pG:()=>o,pq:()=>u,yD:()=>I,ym:()=>m,z6:()=>A});var r=n(9618);let a=new r.Pq0(0,0,2200),o=50,i=new r.Pq0(0,0,2800),s=20,l=new r.Pq0(0,0,2200),u=50,c=new r.Pq0(0,0,2200),f=75,d=new r.Pq0(0,0,3e3),m=75,p=new r.Pq0(0,0,3e3),h=75,g=new r.Pq0(0,0,4e3),v=60,x=new r.Pq0(0,0,3e3),y=75,w=3e3,R=6e-7,C=.005,b=new r.Pq0(0,0,3e3),S=75,T=3e3,P=6e-7,M=.005,A=new r.Pq0(0,500,4400),D=60,_=2e-6,I=.004,E=6e-6,U=.004,O=5e-4,F=new r.Pq0(0,0,0);new r.Pq0(0,0,0)},4397:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var r=n(7973),a=n(6065),o=n(9618),i=n(3267),s=n(4695),l=n(5874),u=n(2310),c=n(2466),f=n(4188),d=n(4866),m=n(4357);let p=(0,a.forwardRef)((e,t)=>{let{layers:n,name:o,children:s}=e,l=(0,a.useRef)(null),u=(0,a.useRef)(null),p=(0,i.C)(e=>e.gl),h=(0,i.C)(e=>e.size);return(0,c._B)("blue"),(0,a.useEffect)(()=>{u.current&&(u.current.aspect=h.width/h.height),u.current&&u.current.updateProjectionMatrix()},[h]),(0,a.useImperativeHandle)(t,()=>({children:s,camera:u.current,renderer:p}
54),[]),(0,r.jsxs)(f.Yi,{ref:l,renderPriority:1e4,children:[(0,r.jsx)(d.u,{ref:u,layers:n,name:o,makeDefault:!0,position:m.Yv,fov:m.XF,far:1e4}),(0,r.jsx)("ambientLight",{intensity:1}),s]})});var h=n(6987),g=n(9753);let v=(0,a.forwardRef)((e,t)=>{let{children:n,layers:s,name:l}=e,{setPrimaryTexture:c}=(0,a.useContext)(u.Oo),p=(0,i.C)(e=>e.gl),v=(0,i.C)(e=>e.size),x=(0,a.useRef)(p).current,y=(0,a.useRef)(null),w=(0,a.useRef)(null),R=(0,a.useRef)(null),C=(0,a.useRef)(null),b=(0,a.useRef)(null),S=(0,a.useRef)(null),T=(0,a.useRef)(null),P=(0,a.useRef)(null),M=(0,a.useRef)(m.OF),A=(0,a.useRef)(m.Y2),D=(0,a.useRef)(m.T$),_=(e,t,n,r)=>{};(0,a.useEffect)(()=>{let e=Math.floor(v.width),t=Math.floor(v.height),n=new o.Pem(e,t);n.minFilter=o.k6q,n.magFilter=o.k6q,C.current=n,c(n);let r=Math.min(p.getPixelRatio(),1),a=Math.floor(v.width*r),i=Math.floor(v.height*r);b.current&&(b.current.depthTexture?.dispose(),b.current.dispose());let s=new o.VCu(a,i);s.type=o.bkx,s.format=o.zdS;let l=new o.nWS(a,i,{minFilter:o.k6q,magFilter:o.k6q,type:o.OUM,depthTexture:s});if(b.current=l,P.current?(P.current.uniforms.tColor.value=l.texture,P.current.uniforms.tDepth.value=s,P.current.uniforms.resolution.value.set(a,i)):P.current=new o.BKk({vertexShader:g.N,fragmentShader:"/**\n * Screen-space depth-of-field + chromatic aberration for Contact scene.\n *\n * Log depth linearization: pow(far + 1, stored) - 1\n * RGB shift: single-loop DOF with per-channel UV offset.\n * Shift amount scales with CoC so sharp regions stay clean.\n *\n * Optimised: merged 3 channel passes into single 3-tap loop.\n * Sharp zone early return skips blur for in-focus pixels.\n */\nprecision highp float;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform sampler2D tDepth;\n\nuniform float cameraNear;\nuniform float cameraFar;\nuniform float dofFocus;\nuniform float dofAperture;\nuniform float dofMaxBlur;\nuniform float rgbShiftAmount;\nuniform vec2 resolution;\n\nvarying vec2 vUv;\n\nfloat linearizeLogDepth(float depth) {\n return pow(cameraFar + 1.0, depth) - 1.0;\n}\n\nfloat computeCoC(float linearDepth) {\n return clamp(abs(linearDepth - dofFocus) * dofAperture, 0.0, dofMaxBlur);\n}\n\nbool isBackground(float depth) {\n return depth > 0.999;\n}\n\nvoid main() {\n vec2 texelSize = 1.0 / resolution;\n\n float centerDepth = texture2D(tDepth, vUv).x;\n\n if (isBackground(centerDepth)) {\n gl_FragColor = texture2D(tColor, vUv);\n return;\n }\n\n float centerLinearDepth = linearizeLogDepth(centerDepth);\n float centerCoC = computeCoC(centerLinearDepth);\n\n /* Sharp zone early return: skip blur entirely for in-focus pixels */\n if (centerCoC < 0.0005) {\n gl_FragColor = texture2D(tColor, vUv);\n return;\n }\n\n float blurRadius = min(centerCoC * resolution.y, 16.0);\n\n /* Per-channel horizontal shift proportional to CoC.\n Smooth onset: no shift near focus (annotations stay clean),\n ramps up for distant grid lines. */\n float cocRatio = centerCoC / max(dofMaxBlur, 0.001);\n float shiftRatio = smoothstep(0.03, 0.25, cocRatio);\n float shift = rgbShiftAmount * shiftRatio;\n\n vec2 shiftVec = vec2(shift, 0.0);\n\n /* Center samples: R at shifted-right UV, G at center, B at shifted-left UV */\n vec3 colorSum = vec3(texture2D(tColor, clamp(vUv + shiftVec, 0.0, 1.0)).r, texture2D(tColor, vUv).g, texture2D(tColor, clamp(vUv - shiftVec, 0.0, 1.0)).b);\n float weightSum = 1.0;\n\n /* 3-tap Poisson disc â single loop for all 3 channels */\n vec2 offsets[3];\n offsets[0] = vec2(-0.613, 0.617);\n offsets[1] = vec2(0.614, -0.293);\n offsets[2] = vec2(-0.541, -0.059);\n\n for (int i = 0; i < 3; i++) {\n vec2 tapOffset = offsets[i] * blurRadius * texelSize;\n vec2 tapUV = clamp(vUv + tapOffset, 0.0, 1.0);\n\n float tapDepth = texture2D(tDepth, tapUV).x;\n if (!isBackground(tapDepth)) {\n float tapCoC = computeCoC(linearizeLogDepth(tapDepth));\n float weight = smoothstep(0.0, 1.0, tapCoC / max(centerCoC, 0.001));\n\n /* Sample R/G/B at per-channel shifted tap positions */\n float r = texture2D(tColor, clamp(tapUV + shiftVec, 0.0, 1.0)).r;\n float g = texture2D(tColor, tapUV).g;\n float b = texture2D(tColor, clamp(tapUV - shiftVec, 0.0, 1.0)).b;\n\n colorSum += vec3(r, g, b) * weight;\n weightSum += weight;\n }\n }\n\n gl_FragColor = vec4(colorSum / weightSum, 1.0);\n}\n",uniforms:{tColor:new o.nc$(l.texture),tDepth:new o.nc$(s),cameraNear:new o.nc$(500),cameraFar:new o.nc$(2e4),dofFocus:new o.nc$(M.current),dofAperture:new o.nc$(A.current),dofMaxBlur:new o.nc$(D.current),resolution:new o.nc$(new o.I9Y(a,i)),rgbShiftAmount:new o.nc$(.0015)},depthTest:!1,depthWrite:!1}
54),!S.current){S.current=new o.Z58,T.current=new o.qUd(-1,1,1,-1,0,1);let e=new o.eaF(new o.bdM(2,2),P.current);e.frustumCulled=!1,S.current.add(e)}return()=>{c(null),n.dispose(),C.current=null,b.current&&(b.current.depthTexture?.dispose(),b.current.dispose(),b.current=null),P.current&&(P.current.dispose(),P.current=null),S.current&&(S.current.traverse(e=>{e.isMesh&&e.geometry.dispose()}),S.current=null),T.current=null}},[v.width,v.height]),(0,a.useEffect)(()=>{w.current&&(w.current.aspect=v.width/v.height),w.current&&w.current.updateProjectionMatrix()},[v]);let I=(0,a.useRef)(0),E=(0,a.useRef)(0),U=(0,a.useRef)(0);return(0,i.D)(()=>{if(!y.current||!w.current||!b.current||!P.current)return;let e=y.current.hudScene,t=w.current,n=P.current.uniforms;I.current!==M.current&&(n.dofFocus.value=M.current,I.current=M.current),E.current!==A.current&&(n.dofAperture.value=A.current,E.current=A.current),U.current!==D.current&&(n.dofMaxBlur.value=D.current,U.current=D.current),n.cameraNear.value=t.near,n.cameraFar.value=t.far;let r=x.autoClear;x.autoClear=!1,x.setRenderTarget(b.current),x.clearColor(),x.clearDepth(),x.render(e,t),x.setRenderTarget(null),x.clearDepth(),x.render(S.current,T.current),x.autoClear=r,C.current&&x.copyFramebufferToTexture(C.current)},2),(0,a.useImperativeHandle)(t,()=>({children:n,camera:w.current,ambientLight:R.current,setFocus:_})),(0,r.jsxs)(f.Yi,{ref:y,renderPriority:2,renderEnabled:!1,backgroundColor:h.i.main.bgColor,children:[(0,r.jsx)(d.u,{ref:w,layers:s,name:l,makeDefault:!0,position:m._m,fov:m.DB,near:.01,far:2e4}),(0,r.jsx)("ambientLight",{ref:R,layers:s,name:l,intensity:1}),(0,r.jsx)("directionalLight",{layers:s,position:[-1,1,.5],intensity:1}),n]})});var x=n(6382);let y=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{setIsContactHeaderRendererReady:o}=(0,a.useContext)(u.uN),{layoutMargins:d,headerScale:m}=(0,a.useContext)(u.MQ),h=(0,a.useRef)(d);h.current=d;let g=(0,a.useRef)(m);g.current=m;let v=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null);(0,i.C)(e=>e.size);let R=(0,i.C)(e=>e.pointer),C=(0,a.useRef)(null),b=(0,a.useRef)({x:0*x.V$,y:2*x.V$}),S=(0,a.useRef)({x:-(0*x.V$),y:-(.2*x.V$)}),T=(0,s.zh)(()=>({from:{rx:v.current?.rotation.x??0,ry:v.current?.rotation.y??0},onChange:e=>{v.current.rotation.x=e.value.rx,v.current.rotation.y=e.value.ry}}),[])[1],P=(0,a.useRef)(null),M=(e,t)=>{P.current=t??null,D(),w.current?.present(e)},A=()=>{w.current?.dismiss()},D=()=>{if(!w.current||!C.current?.camera||!y.current||!v.current)return;y.current.scale.set(g.current,g.current,1);let e=C.current.camera,t=2*Math.tan(e.fov*(Math.PI/180)/2)*e.position.z,n=t*e.aspect,r=w.current.getBoundingBoxSize();y.current.position.x=-r.x/2,v.current.position.x=e.position.x-n/2+n*h.current.left+r.x/2,v.current.position.y=e.position.y+t/2-t*h.current.top+r.y/2},_=e=>{let t=b.current.x+R.y*S.current.x+S.current.x,n=b.current.y+-R.x*S.current.y+S.current.y;T.stop(!0),T.start({to:{rx:t,ry:n},config:{duration:400,easing:s.le.easeOutCubic}})};return(0,c._B)("deeppink"),(0,a.useEffect)(()=>(window.addEventListener("mousemove",_),()=>window.removeEventListener("mousemove",_)),[]),(0,a.useLayoutEffect)(()=>{D()},[m,d]),(0,a.useImperativeHandle)(t,()=>({present:M,dismiss:A})),(0,r.jsx)(p,{ref:C,layers:n,name:f.eU.CONTACT_HEADER,children:(0,r.jsx)("group",{ref:v,layers:n,children:(0,r.jsx)("group",{ref:y,layers:n,children:(0,r.jsx)(l.g,{ref:w,layers:n,position:[0,0,0],onInitialized:()=>{D(),o(!0)},onPresentComplete:()=>{P.current&&(P.current(),P.current=null)}})})})})});var w=n(2488),R=n(5844),C=n(1343),b=n(6766),S=n(4120),T=n(5998),P=n(3882);let M=(0,T.i)(h.i.contactForm.errorColor,h.i.contactForm.errorOpacity),A=(e,t,n,r,a,o,i,s,l)=>{let u,c=document.createElement("div");c.style.marginBottom="32px";let f=document.createElement("div");f.style.marginBottom="16px",c.appendChild(f);let d=new b.j(e,f,{fontSize:"28px",fontWeight:"400",letterSpacing:"2px",color:r,fontFamily:a});if("textarea"===t){let e=document.createElement("textarea");e.className="contact-message-textarea",e.style.cssText=n+";height:400px;resize:none;line-height:1.5;",u=e}else{let t=document.createElement("input");t.type="EMAIL"===e?"email":"text",t.style.cssText=n,u=t}c.appendChild(u);let m=document.createElement("div");m.style.cssText="margin-top:12px;min-height:32px;",c.appendChild(m);let p=new b.j(" ",m,o);return i(u,"input",()=>{p.dismiss(300,0)}),i(u,"focus",()=>{s(),u.style.background=(0,T.i)(l.inputFocusBgColor,l.inputFocusBgOpacity)}),i(u,"blur",()=>{u.style.background="transparent"}
54),{field:c,labelText:d,input:u,errorText:p}};function D(e){e.style.opacity="1"}function _(e){e.style.opacity="0",e.style.transform="translate(0, 0)"}var I=n(433);let E=m.DB/2*Math.PI/180,U=18*Math.PI/180,O=(0,a.forwardRef)((e,t)=>{let{setIsContactFormRendererReady:n,mouseRotationY:r}=(0,a.useContext)(u.uN),{layoutMargins:o,layoutScale:s}=(0,a.useContext)(u.MQ),{navigationMarkerScreenPosition:l,isNavigationVisible:f}=(0,a.useContext)(u._3),{play:d,stop:m,getNextSFXNavigationMainHoverKey:p}=(0,a.useContext)(u.nE),g=(0,a.useRef)(l).current,v=(0,a.useRef)(o);v.current=o;let x=(0,i.C)(e=>e.size),y=(0,a.useRef)(x);y.current=x;let O=(0,a.useRef)("idle"),F=(0,a.useRef)(()=>{}),N=(0,a.useRef)(()=>d(R.uc.SFX_TEXT_TRANSITION_1,w.z.sfx.text.transition1,!0)),L=(0,a.useRef)(()=>m(R.uc.SFX_TEXT_TRANSITION_1)),z=(e=>{let t,n,r,o,i,s,l,c,f,d,m,p,g,v,x,y,w,R=(0,C.c)(37),{canvasSizeRef:I,formStateRef:E,onSubmitRef:U,onPlayShuffleSound:O,onStopShuffleSound:F,onPlayHoverSound:N,onPlayClickSound:L}=e;R[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,T.i)(h.i.contactForm.textColor),R[0]=t):t=R[0];let z=t,V=h.i.contactForm,{sendEvent:k}=(0,u.pn)(),G=(0,a.useRef)(!1),B=(0,a.useRef)(!1),j=(0,a.useRef)(null),$=(0,a.useRef)(null),W=(0,a.useRef)(!1),H=(0,a.useRef)(null),Y=(0,a.useRef)(null),X=(0,a.useRef)(null),q=(0,a.useRef)(null),Z=(0,a.useRef)(null),Q=(0,a.useRef)(null),K=(0,a.useRef)(null),J=(0,a.useRef)(null),ee=(0,a.useRef)(null),et=(0,a.useRef)(null),en=(0,a.useRef)(null),er=(0,a.useRef)(null),ea=(0,a.useRef)(null);R[1]===Symbol.for("react.memo_cache_sentinel")?(n=[],R[1]=n):n=R[1];let eo=(0,a.useRef)(n),ei=(0,a.useRef)(null),es=(0,a.useRef)(null),el=(0,a.useRef)(null),eu=(0,a.useRef)(null),ec=(0,a.useRef)(null),ef=(0,a.useRef)(null);R[2]===Symbol.for("react.memo_cache_sentinel")?(r=[],R[2]=r):r=R[2];let ed=(0,a.useRef)(r);R[3]===Symbol.for("react.memo_cache_sentinel")?(o=(e,t,n)=>{e.addEventListener(t,n),ed.current.push({el:e,type:t,fn:n})},R[3]=o):o=R[3];let em=o,ep=(0,a.useRef)(0);R[4]!==F?(i=e=>{let t=void 0!==e&&e;return()=>{ep.current=ep.current-1,ep.current<=0&&(F.current(),t&&j.current&&(j.current.style.pointerEvents="auto"))}},R[4]=F,R[5]=i):i=R[5];let eh=i;R[6]===Symbol.for("react.memo_cache_sentinel")?(s={containerRef:j,rotateContainerRef:$,isRendererReady:W,titleText:H,nameLabelText:Y,emailLabelText:X,messageLabelText:q,sendTextRef:Z,statusText:Q,nameErrorText:K,emailErrorText:J,messageErrorText:ee,nameInputRef:et,emailInputRef:en,messageInputRef:er,submitButtonRef:ea,bracketEls:eo,wipeBgRef:ei,topRightCornerDotRef:es,svgMarkerRef:el},R[6]=s):s=R[6];let eg=s;R[7]!==E?(l=()=>{"idle"===E.current&&Q.current?.dismiss(300,0)},R[7]=E,R[8]=l):l=R[8];let ev=l;R[9]!==ev||R[10]!==E||R[11]!==L||R[12]!==N||R[13]!==U||R[14]!==k?(c=()=>{let e,t,n,r,a,o,i,s,l,u=document.createElement("div");u.style.cssText=`position:fixed;z-index:10;top:50%;left:50%;width:${V.maxWidth}px;pointer-events:none;opacity:0;transition:opacity 0.6s ease-in-out;user-select:none;-webkit-user-select:none`,j.current=u;let c=document.createElement("div");c.style.cssText=`transform-origin:center center;width:${2*V.maxWidth}px;margin-left:${-V.maxWidth/2}px`,u.appendChild(c),$.current=c;let f=document.createElement("div");f.style.cssText=`position:relative;backdrop-filter:blur(${2*V.containerBlur}px);-webkit-backdrop-filter:blur(${2*V.containerBlur}px);background:${(0,T.i)(V.containerBgColor,V.containerBgOpacity)};border:2px solid ${(0,T.i)(V.containerBorderColor,V.containerBorderOpacity)};padding:${2*V.containerPadding}px`,c.appendChild(f);let d=(0,T.i)(V.cornerDotColor,V.cornerDotOpacity),m=-3,p=`position:absolute;width:6px;height:6px;border-radius:50%;background:${d};pointer-events:none`,g=[`top:${m}px;left:${m}px`,`top:${m}px;right:${m}px`,`bottom:${m}px;right:${m}px`,`bottom:${m}px;left:${m}px`];for(let e=0;e<g.length;e++){let t=document.createElement("span");t.style.cssText=`${p};${g[e]}`,f.appendChild(t),1===e&&(es.current=t)}let v=`background:transparent;border:none;box-shadow:0 2px 0 0 ${(0,T.i)(V.focusShadowColor,0)};transition:box-shadow 0.6s ease-in-out, background 0.1s ease-in-out;color:${z};caret-color:${z};font-family:USansRgBd, sans-serif;font-size:26px;font-weight:300;letter-spacing:1px;outline:none;padding:16px 16px;box-sizing:border-box;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;user-select:text;-webkit-user-select:text`,x={fontSize:"22px",fontWeight:"300",letterSpacing:"1px",color:M,fontFamily:"USansRgBd, sans-serif"},y=document.createElement("div");
54y.style.marginBottom="48px",f.appendChild(y),H.current=new b.j("MESSAGE",y,{fontSize:"64px",fontWeight:"300",letterSpacing:"0px",color:z,fontFamily:"USansRgBd, sans-serif"});let w=A("NAME","input",v,z,"USansRgBd, sans-serif",x,em,ev,V);f.appendChild(w.field),Y.current=w.labelText,et.current=w.input,K.current=w.errorText;let R=A("EMAIL","input",v,z,"USansRgBd, sans-serif",x,em,ev,V);f.appendChild(R.field),X.current=R.labelText,en.current=R.input,J.current=R.errorText;let C=A("MESSAGE","textarea",v,z,"USansRgBd, sans-serif",x,em,ev,V);f.appendChild(C.field),q.current=C.labelText,er.current=C.input,ee.current=C.errorText;let S=e=>{let t=e.currentTarget;!B.current&&t.value.length>0&&(B.current=!0,k({event:"form_funnel",step:"start"}))};em(w.input,"input",S),em(R.input,"input",S),em(C.input,"input",S);let P=document.createElement("style");P.textContent=`.contact-message-textarea::-webkit-scrollbar { width: 8px; } 55.contact-message-textarea::-webkit-scrollbar-track { background: transparent; } 56.contact-message-textarea::-webkit-scrollbar-thumb { background: ${(0,T.i)(V.scrollbarThumbColor)}; border-radius: 4px; } 57.contact-message-textarea { scrollbar-width: thin; scrollbar-color: ${(0,T.i)(V.scrollbarThumbColor)} transparent; }`,document.head.appendChild(P),eu.current=P;let D=document.createElement("div");D.style.cssText="margin-top:-32px;margin-bottom:48px;display:flex;flex-direction:column;gap:4px;opacity:0.6;",f.appendChild(D),ec.current=new b.j("Your message is processed for reply purposes only.",D,{fontSize:"24px",fontWeight:"300",letterSpacing:"0px",color:z,fontFamily:"USansRgBd, sans-serif"}),ef.current=new b.j("Click INFO from the footer for details.",D,{fontSize:"24px",fontWeight:"300",letterSpacing:"0px",color:z,fontFamily:"USansRgBd, sans-serif"});let _=((e=document.createElement("div")).style.cssText="margin-top:16px;",(t=document.createElement("button")).style.cssText=`background:transparent;border:2px solid ${(0,T.i)(V.buttonBorderColor,0)};padding:32px 48px 24px 48px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;position:relative;overflow:visible;isolation:isolate;transition:width 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.6s ease-in-out;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale`,e.appendChild(t),n=new b.j("SEND",t,{fontSize:"48px",fontWeight:"400",letterSpacing:"6px",color:z,fontFamily:"USansRgBd, sans-serif"}),r=(0,T.i)(h.i.ui.bracketCornerColor,h.i.ui.bracketCornerOpacity),a="position:absolute;width:16px;height:16px;pointer-events:none;opacity:0;transition:transform 0.1s linear, opacity 0.6s ease-in-out",o=[["top:-2px;left:-2px","top left"],["top:-2px;right:-2px","top right"],["bottom:-2px;right:-2px","bottom right"],["bottom:-2px;left:-2px","bottom left"]].map(e=>{let[n,o]=e,i=document.createElement("span");return i.style.cssText=`${a};${n};${o.split(" ").map(e=>`border-${e}:2px solid ${r}`).join(";")}`,t.appendChild(i),i}),(i=document.createElement("div")).style.cssText=`position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;background:${(0,T.i)(h.i.ui.buttonWipeColor,h.i.ui.buttonWipeOpacity)};clip-path:inset(0 100% 0 0);transition:clip-path 75ms ease-out;pointer-events:none`,t.appendChild(i),s=e=>{let n=t.getBoundingClientRect(),r=e.clientX-n.left,a=e.clientY-n.top,o=n.width-r,i=n.height-a,s=Math.min(r,o,a,i);return s===r?"left":s===o?"right":s===a?"top":"bottom"},l={left:"inset(0 100% 0 0)",right:"inset(0 0 0 100%)",top:"inset(0 0 100% 0)",bottom:"inset(100% 0 0 0)"},em(t,"mouseenter",e=>{if("idle"!==E.current)return;N.current();let t=s(e);i.style.transition="none",i.style.clipPath=l[t],i.offsetWidth,i.style.transition="clip-path 75ms ease-out",i.style.clipPath="inset(0)",o[0].style.transform="translate(-6px, -6px)",o[1].style.transform="translate(6px, -6px)",o[2].style.transform="translate(6px, 6px)",o[3].style.transform="translate(-6px, 6px)",n.present(300,{min:0,max:200})}),em(t,"mouseleave",e=>{if("idle"!==E.current)return;let t=s(e);i.style.transition="clip-path 75ms ease-out",i.style.clipPath=l[t],o.forEach(e
57=>{e.style.transform="translate(0, 0)"}),n.present(300,{min:0,max:200})}),em(t,"click",()=>{L.current(),U.current()}),{section:e,button:t,sendText:n,brackets:o,wipeBg:i});f.appendChild(_.section),ea.current=_.button,Z.current=_.sendText,eo.current=_.brackets,ei.current=_.wipeBg;let I=document.createElement("div");I.style.cssText="margin-top:32px;",f.appendChild(I),Q.current=new b.j(" ",I,{fontSize:"28px",fontWeight:"300",letterSpacing:"1px",color:M,fontFamily:"USansRgBd, sans-serif"}),document.body.appendChild(u);let O=(()=>{let e="http://www.w3.org/2000/svg",t=(0,T.i)(h.i.marker.color,h.i.marker.opacity),n=document.createElementNS(e,"svg");n.setAttribute("viewBox",`${-5} ${-5} ${10} ${10}`),n.setAttribute("shape-rendering","crispEdges"),n.style.cssText="position:fixed;z-index:11;pointer-events:none;width:20px;height:20px;opacity:0;transition:opacity 1s linear;overflow:visible";let r=[];for(let e=0;e<32;e++){let t=e/32*Math.PI*2;r.push(`${4*Math.cos(t)},${4*Math.sin(t)}`)}let a=document.createElementNS(e,"polygon");a.setAttribute("points",r.join(" ")),a.setAttribute("fill","none"),a.setAttribute("stroke",t),a.setAttribute("stroke-width","1"),n.appendChild(a);let o=document.createElementNS(e,"circle");return o.setAttribute("cx","0"),o.setAttribute("cy","0"),o.setAttribute("r",String(.8)),o.setAttribute("fill",t),n.appendChild(o),n})();document.body.appendChild(O),el.current=O},R[9]=ev,R[10]=E,R[11]=L,R[12]=N,R[13]=U,R[14]=k,R[15]=c):c=R[15];let ex=c;R[16]!==I?(f=()=>{if(!j.current)return;let e=Math.min(1.5,I.current.height/S.P);j.current.style.transform=`translate(-50%, -50%) scale(${e})`},R[16]=I,R[17]=f):f=R[17];let ey=f;R[18]===Symbol.for("react.memo_cache_sentinel")?(d=(e,t)=>{e&&setTimeout(()=>{"BUTTON"===e.tagName?(e.style.borderColor=(0,T.i)(V.buttonBorderColor,V.buttonBorderOpacity),eo.current.forEach(D)):e.style.boxShadow=`0 2px 0 0 ${(0,T.i)(V.focusShadowColor,V.focusShadowOpacity)}`},t)},R[18]=d):d=R[18];let ew=d;R[19]===Symbol.for("react.memo_cache_sentinel")?(m=e=>{e&&("BUTTON"===e.tagName?(e.style.borderColor=(0,T.i)(V.buttonBorderColor,0),eo.current.forEach(_)):e.style.boxShadow=`0 2px 0 0 ${(0,T.i)(V.focusShadowColor,0)}`)},R[19]=m):m=R[19];let eR=m;R[20]!==eh||R[21]!==O||R[22]!==F||R[23]!==k?(p=()=>{(0,P.Rm)("mediumvioletred","â¶ï¸","ContactFormRenderer present"),G.current||(G.current=!0,k({event:"form_funnel",step:"view"})),j.current&&(j.current.style.transition="opacity 0.9s ease-in-out",j.current.style.opacity="1",j.current.style.pointerEvents="none"),F.current(),ep.current=7,O.current();let e=eh(!0);H.current?.present(900,{min:0,max:300},{onComplete:e}),Y.current?.present(600,{min:450,max:750},{onComplete:e}),X.current?.present(600,{min:600,max:900},{onComplete:e}),q.current?.present(600,{min:750,max:1050},{onComplete:e}),ec.current?.present(600,{min:900,max:1200},{onComplete:e}),ef.current?.present(600,{min:1e3,max:1300},{onComplete:e}),Z.current?.present(600,{min:1050,max:1350},{onComplete:e}),ew(et.current,600),ew(en.current,750),ew(er.current,900),ew(ea.current,1200)},R[20]=eh,R[21]=O,R[22]=F,R[23]=k,R[24]=p):p=R[24];let eC=p;R[25]!==eh||R[26]!==O||R[27]!==F?(g=()=>{(0,P.Rm)("mediumvioletred","â¶ï¸","ContactFormRenderer dismiss"),j.current&&(j.current.style.pointerEvents="none",j.current.style.transition="opacity 0.5s ease-in-out 0.0s",j.current.style.opacity="0"),F.current(),ep.current=11,O.current();let e=eh();H.current?.dismiss(400,0,{onComplete:e}),Y.current?.dismiss(400,0,{onComplete:e}),X.current?.dismiss(400,0,{onComplete:e}),q.current?.dismiss(400,0,{onComplete:e}),ec.current?.dismiss(400,0,{onComplete:e}),ef.current?.dismiss(400,0,{onComplete:e}),Z.current?.dismiss(400,0,{onComplete:e}),Q.current?.dismiss(400,0,{onComplete:e}),K.current?.dismiss(400,0,{onComplete:e}),J.current?.dismiss(400,0,{onComplete:e}),ee.current?.dismiss(400,0,{onComplete:e}),eR(et.current),eR(en.current),eR(er.current),eR(ea.current)},R[25]=eh,R[26]=O,R[27]=F,R[28]=g):g=R[28];let eb=g;R[29]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{el.current&&(el.current.style.transition="none",el.current.style.opacity="0",setTimeout(()=>{el.current&&(el.current.style.transition="opacity 1s linear",el.current.style.opacity="1")},500))},R[29]=v):v=R[29];let eS=v;R[30]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{el.current&&(el.current.style.transition="opacity 0.3s linear",el.current.style.opacity="0")},R[30]=x):x=R[30];let eT=x;R[31]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{for(let{el:e,type:t,fn:n}of ed.current)e.removeEventListener(t,n);
57ed.current.length=0,H.current?.dispose(),Y.current?.dispose(),X.current?.dispose(),q.current?.dispose(),ec.current?.dispose(),ef.current?.dispose(),Z.current?.dispose(),Q.current?.dispose(),K.current?.dispose(),J.current?.dispose(),ee.current?.dispose(),j.current?.remove(),j.current=null,el.current?.remove(),el.current=null,eu.current?.remove(),eu.current=null,W.current=!1},R[31]=y):y=R[31];let eP=y;return R[32]!==ex||R[33]!==eb||R[34]!==eC||R[35]!==ey?(w={refs:eg,buildDOM:ex,updateLayout:ey,present:eC,dismiss:eb,dispose:eP,presentMarker:eS,dismissMarker:eT},R[32]=ex,R[33]=eb,R[34]=eC,R[35]=ey,R[36]=w):w=R[36],w})({canvasSizeRef:y,layoutMarginsRef:v,formStateRef:O,onSubmitRef:F,onPlayShuffleSound:N,onStopShuffleSound:L,onPlayHoverSound:(0,a.useRef)(()=>d(p(),w.z.sfx.navigation.mainHover1,!1)),onPlayClickSound:(0,a.useRef)(()=>{m(R.uc.SFX_NAVIGATION_MAIN_CLICK),d(R.uc.SFX_NAVIGATION_MAIN_CLICK,w.z.sfx.navigation.mainClick,!1)})}),V=(e=>{let{refs:t,formStateRef:n,onPlayShuffleSound:r,onStopShuffleSound:o}=e,{sendEvent:i}=(0,u.pn)(),s=(0,a.useRef)(0),l=(0,a.useRef)(null),c=(0,a.useRef)({name:"",email:"",message:""}),f=e=>{let n=t.submitButtonRef.current,r=t.sendTextRef.current;if(!n||!r)return;let a=n.offsetWidth;n.style.width=`${a}px`,r.setText(e);let o=n.style.width;n.style.transition="none",n.style.width="auto";let i=n.offsetWidth;n.style.width=`${o}`,n.offsetWidth,n.style.transition="width 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.6s ease-in-out",n.style.width=`${i}px`},d=()=>{s.current&&(cancelAnimationFrame(s.current),s.current=0),t.submitButtonRef.current&&(t.submitButtonRef.current.style.opacity="1")},m=()=>{d(),f((0,I.Pj)("idle")),t.sendTextRef.current?.present(400,{min:0,max:200},{onStart:()=>r.current(),onComplete:()=>o.current()}),t.submitButtonRef.current&&(t.submitButtonRef.current.disabled=!1,t.submitButtonRef.current.style.cursor="pointer"),t.nameInputRef.current&&(t.nameInputRef.current.disabled=!1),t.emailInputRef.current&&(t.emailInputRef.current.disabled=!1),t.messageInputRef.current&&(t.messageInputRef.current.disabled=!1),t.submitButtonRef.current&&(t.submitButtonRef.current.style.background="transparent"),t.bracketEls.current.forEach(e=>{e.style.transform="translate(0, 0)"}),t.wipeBgRef.current&&(t.wipeBgRef.current.style.transition="none",t.wipeBgRef.current.style.clipPath="inset(0 100% 0 0)"),n.current="idle"},p=async()=>{let e,a;if("idle"!==n.current||(t.statusText.current?.dismiss(200,0),!(()=>{let e={name:t.nameInputRef.current?.value??"",email:t.emailInputRef.current?.value??"",message:t.messageInputRef.current?.value??""},{values:n,errors:a}=(0,I.V4)(e),s=0;if(a.name&&(s++,i({event:"form_funnel",step:"validation_error",field:"name"})),a.email&&(s++,i({event:"form_funnel",step:"validation_error",field:"email"})),a.message&&(s++,i({event:"form_funnel",step:"validation_error",field:"message"})),s>0){let e=s,n=()=>{--e<=0&&o.current()};r.current(),a.name&&(t.nameErrorText.current?.setText(a.name),t.nameErrorText.current?.present(400,{min:0,max:200},{onComplete:n})),a.email&&(t.emailErrorText.current?.setText(a.email),t.emailErrorText.current?.present(400,{min:50,max:250},{onComplete:n})),a.message&&(t.messageErrorText.current?.setText(a.message),t.messageErrorText.current?.present(400,{min:100,max:300},{onComplete:n}))}return 0===s&&(c.current=n),0===s})()))return;let{name:u,email:p,message:h}=c.current,g=performance.now();i({event:"form_funnel",step:"submit_attempted"}),n.current="sending",t.submitButtonRef.current&&(t.submitButtonRef.current.disabled=!0,t.submitButtonRef.current.style.cursor="default",t.submitButtonRef.current.style.background="transparent"),t.bracketEls.current.forEach(e=>{e.style.transform="translate(0, 0)"}),t.wipeBgRef.current&&(t.wipeBgRef.current.style.transition="none",t.wipeBgRef.current.style.clipPath="inset(0 100% 0 0)"),t.nameInputRef.current&&(t.nameInputRef.current.disabled=!0),t.emailInputRef.current&&(t.emailInputRef.current.disabled=!0),t.messageInputRef.current&&(t.messageInputRef.current.disabled=!0),f((0,I.Pj)("sending")),t.sendTextRef.current?.present(400,{min:0,max:200},{onStart:()=>r.current(),onComplete:()=>o.current()}),d(),e=performance.now(),a=n=>{let r=.35+.65*(.5+.5*Math.sin((n-e)/1e3*Math.PI*1.6));t.submitButtonRef.current&&(t.submitButtonRef.current.style.opacity=String(r)),s.current=requestAnimationFrame(a)},s.current=requestAnimationFrame(a);let v=new Promise(e=>setTimeout(e,I.Ch)),x=null,y=!1,w=0,R=!1;try{let e=await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:u,email:p,message:h})});R=e.ok,w=e.status,x=await e.json()}catch(e){y=!0}let C=(0,I.eh)({networkError:y,ok:R,status:w,result:x??void 0}),b=Math.round(performance.now()-g);if("submit_success"===C.analyticsStep?i({event:"form_funnel",step:"submit_success",latency_ms:b}):i({event:"form_funnel",step:"submit_failure",error_type:C.errorType,latency_ms:b}),await v,d(),t.submitButtonRef.current&&(t.submitButtonRef.current.style.background="transparent"),"success"===C.completion.state)n.current="success",f((0,I.Pj)("success")),t.sendTextRef.current?.present(400,0,{onStart:()=>r.current(),onComplete:()=>o.current()}),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,t.nameInputRef.current&&(t.nameInputRef.current.value=""),t.emailInputRef.current&&(t.emailInputRef.current.value=""),t.messageInputRef.current&&(t.messageInputRef.current.value=""),m()},I.nC);else{var S;S=C.completion.statusText,n.current="error",f((0,I.Pj)("error")),t.sendTextRef.current?.present(400,0,{onStart:()=>r.current(),onComplete:()=>o.current()}),t.statusText.current?.setColor(M),t.statusText.current?.setText(S),t.statusText.current?.present(400,{min:0,max:200}),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,m()},I.nC)}};return(0,a.useEffect)(()=>()=>{l.current&&clearTimeout(l.current)},[]),{handleSubmit:p,stopSendingBlink:d}})({refs:z.refs,formStateRef:O,onPlayShuffleSound:N,onStopShuffleSound:L}),k=(0,a.useRef)(z.refs.isRendererReady).current,G=(e=>{let t,n,r,o=(0,C.c)(8),{rotateContainerRef:i,topRightCornerDotRef:s,svgMarkerRef:l,isRendererReady:u,mouseRotationY:c,canvasSizeRef:f,navigationMarkerScreenPosition:d}=e,m=(0,a.useRef)(0),p=(0,a.useRef)(0),h=(0,a.useRef)(0),g=(0,a.useRef)(i).current,v=(0,a.useRef)(d).current,x=(0,a.useRef)(l).current;if(o[0]!==f||o[1]!==u||o[2]!==c||o[3]!==s){let e=()=>{if(g.current&&u.current){let e=f.current.height,t=e/2/Math.tan(E),n=180*c.current/Math.PI;if(g.current.style.transform=`perspective(${t}px) rotateY(${n}deg) scale(0.5)`,s.current){let t=s.current.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2;if(v.current.x=n,v.current.y=r,x.current){e!==h.current&&(h.current=e,p.current=Math.ceil(4/(2200*Math.tan(U))*e*2));let t=p.current;x.current.style.width=`${t}px`,x.current.style.height=`${t}px`,x.current.style.left=`${n-t/2}px`,x.current.style.top=`${r-t/2}px`}}}m.current=requestAnimationFrame(e)};t=()=>{m.current=requestAnimationFrame(e)},o[0]=f,o[1]=u,o[2]=c,o[3]=s,o[4]=t}else t=o[4];let y=t;o[5]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{cancelAnimationFrame(m.current)},o[5]=n):n=o[5];let w=n;return o[6]!==y?(r={startParallax:y,stopParallax:w},o[6]=y,o[7]=r):r=o[7],r})({rotateContainerRef:z.refs.rotateContainerRef,topRightCornerDotRef:z.refs.topRightCornerDotRef,svgMarkerRef:z.refs.svgMarkerRef,isRendererReady:k,mouseRotationY:r,canvasSizeRef:y,navigationMarkerScreenPosition:g});return F.current=V.handleSubmit,(0,c._B)("mediumvioletred"),(0,a.useEffect)(()=>
57{if(z.buildDOM(),z.updateLayout(),G.startParallax(),z.refs.topRightCornerDotRef.current){let e=z.refs.topRightCornerDotRef.current.getBoundingClientRect();g.current.x=e.left+e.width/2,g.current.y=e.top+e.height/2}return k.current=!0,n(!0),()=>{G.stopParallax(),V.stopSendingBlink(),m(R.uc.SFX_TEXT_TRANSITION_1),z.dispose()}},[]),(0,a.useEffect)(()=>{z.updateLayout()},[x,o,s]),(0,a.useEffect)(()=>{f?z.presentMarker():z.dismissMarker()},[f]),(0,a.useImperativeHandle)(t,()=>({present:z.present,dismiss:z.dismiss,onRouteDismissStart:()=>{},onRouteDismissUpdate:()=>{},onRouteDismissEnd:()=>{}})),null});var F=n(8101);let N=(0,a.forwardRef)((e,t)=>{let{fade:n}=(0,a.useContext)(u.nE),{setIsNavigationVisible:s,setFooterVisible:l,configureNavigationAnimation:d,configureNavigationCamera:p}=(0,a.useContext)(u._3),h=(0,a.useContext)(u.uN),{shouldPresentContent:g,isAllRendererReady:x}=h,C=(0,a.useRef)(h.sceneCamera).current,b=(0,a.useRef)(null),T=(0,a.useRef)(null),M=(0,a.useRef)(null),A=(0,a.useRef)(null),D=(0,a.useRef)(null),{size:_}=(0,i.C)(),I=()=>{let e=_.height/S.P;return{minX:_.width/2+240*e,maxX:_.width-70*e,minY:70*e,maxY:_.height/2-70*e}},E=e=>{},U=e=>{T.current.dismiss(),M.current.dismiss(),A.current.dismiss(),s(!1),n(R.uc.BGM_CONTACT_SIGNAL,0,0,4e3,!0),n(R.uc.BGM_CONTACT_CHORUS,0,0,4e3,!0)};return(0,c._B)("green"),(0,a.useEffect)(()=>{!C.current&&b.current?.camera&&(C.current=b.current.camera)}),(0,a.useEffect)(()=>{d(I())},[_]),(0,a.useEffect)(()=>{x&&((0,P.Rm)("green","â¶ï¸","onRenderersReady"),n(R.uc.BGM_CONTACT_SIGNAL,w.z.bgm.contact.signal,0,6e3,!0),n(R.uc.BGM_CONTACT_CHORUS,w.z.bgm.contact.chorus,0,6e3,!0),M.current.present(),p({eye:m.Sy.clone().add(new o.Pq0(0,0,400)),fov:36}),d({animate:!1,showMarker:!1,parentLerpX:.04,parentLerpY:.04,parentLerpZ:.04,childLerpX:.08,childLerpY:.08,childLerpZ:.08,angleStart:30,angleStep:30,...I()}),T.current.present(0,()=>{D.current=setTimeout(()=>{D.current=null,A.current?.present(),s(!0)},600)}),l(!0))},[x]),(0,a.useEffect)(()=>()=>{D.current&&clearTimeout(D.current)},[]),(0,a.useImperativeHandle)(t,()=>({onRoutePresentStart:E,onRouteDismissStart:U})),g&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v,{ref:b,layers:void 0,name:f.eU.CONTACT_BACKGROUND,children:(0,r.jsx)(F.Kw,{ref:M})}),(0,r.jsx)(y,{ref:T,layers:void 0}),(0,r.jsx)(O,{ref:A,layers:void 0})]})})},5206:(e,t,n)=>{n.d(t,{PH:()=>a,y$:()=>r,wN:()=>o});let r="precision highp float;\n\nvarying vec2 vUv;\n\nuniform sampler2D tDiffuse;\nuniform float opacity;\nuniform vec3 color;\nuniform vec3 emissive;\nuniform float emissiveIntensity;\nuniform float pxRange;\nuniform vec2 texSize;\nuniform float softness;\n\n/**\n * Returns the median of three values.\n */\nfloat median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n}\n\n/**\n * Computes the screen-space pixel range for scale-independent MSDF antialiasing.\n * Returns at least 1.0 to guarantee smooth edges even at extreme minification.\n */\nfloat screenPxRange() {\n vec2 unitRange = vec2(pxRange) / texSize;\n vec2 screenTexSize = vec2(1.0) / fwidth(vUv);\n return max(0.5 * dot(unitRange, screenTexSize), 1.0);\n}\n\nvoid main() {\n vec3 s = texture2D(tDiffuse, vUv).rgb;\n float sigDist = median(s.r, s.g, s.b) - 0.5;\n float alpha = clamp(sigDist * screenPxRange() * softness + 0.5, 0.0, 1.0);\n\n /**\n * * When emissive is set, use emissive * emissiveIntensity (matches meshStandardMaterial without lights).\n * * When emissive is zero, use color directly (matches meshBasicMaterial).\n */\n vec3 e = emissive * emissiveIntensity;\n float hasEmissive = step(0.001, e.r + e.g + e.b);\n vec3 finalColor = mix(color, e, hasEmissive);\n\n gl_FragColor = vec4(finalColor, alpha * opacity);\n}\n",a="varying vec2 vUv;\n\nuniform sampler2D tDiffuse;\nuniform float pxRange;\nuniform vec2 texSize;\nuniform float softness;\n\n/*\n * Returns the median of three values.\n */\nfloat median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n}\n\n/*\n * Computes the screen-space pixel range for scale-independent MSDF antialiasing.\n * Returns at least 1.0 to guarantee smooth edges even at extreme minification.\n */\nfloat screenPxRange() {\n vec2 unitRange = vec2(pxRange) / texSize;\n vec2 screenTexSize = vec2(1.0) / fwidth(vUv);\n return max(0.5 * dot(unitRange, screenTexSize), 1.0);\n}\n\nvoid main() {\n vec3 s = texture2D(tDiffuse, vUv).rgb;\n float sigDist = median(s.r, s.g, s.b) - 0.5;\n float alpha = clamp(sigDist * screenPxRange() * softness + 0.5, 0.0, 1.0);\n\n /*\n * Alpha masking only â color, emissive, and lighting are handled\n * by the MeshStandardMaterial base via CSM.\
57n */\n csm_DiffuseColor.a = alpha * opacity;\n}\n",o="varying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},5329:(e,t,n)=>{n.d(t,{LC:()=>c,_U:()=>m,fn:()=>d});var r,a=n(7973),o=n(6065),i=n(9618),s=n(2310),l=n(2466),u=n(8497),c=((r=c||{}).DEFAULT="DEFAULT",r.POSITION_CHANGED="POSITION_CHANGED",r);let f={cameraPosition:new i.Pq0,distanceToEarthCenter:0,distanceToEarthNearestSurface:0,distanceToEarthFarthestSurface:0,distanceToCageNearestSurface:0,distanceToCageFarthestSurface:0,distanceToCoordinateNearestSurface:0,distanceToCoordinateFarthestSurface:0,distanceToCityMarkerNearestSurface:0,distanceToCityMarkerFarthestSurface:0},d=(0,o.createContext)({shouldPresentContent:!1,isAllRendererReady:!1,isAwardHeaderRendererReady:!1,isAwardUIRendererReady:!1,isCageRendererReady:!1,isCityMarkerRendererReady:!1,isCoordinateGuideRendererReady:!1,isEarthRendererReady:!1,isUIMarkerConnectorRendererReady:!1,setIsAwardHeaderRendererReady:()=>{},setIsAwardUIRendererReady:()=>{},setIsCageRendererReady:()=>{},setIsCityMarkerRendererReady:()=>{},setIsCoordinateGuideRendererReady:()=>{},setIsEarthRendererReady:()=>{},setIsUIMarkerConnectorRendererReady:()=>{},dataset:null,datasetHolder:{current:null},earthMapReferenceTexture:null,earthMapReferenceTextureHolder:{current:null},earthOffscreenMapTexture:null,earthOffscreenMapTextureHolder:{current:null},setEarthOffscreenMapTexture:()=>{},earthOffscreenCountryTexture:{current:null},registerAwardCameraEvent:e=>{},unregisterAwardCameraEvent:e=>{},notifyAwardCameraEvent:(e,t)=>{},cameraProps:{current:f},awardGlobeScene:{current:null},awardUIScene:{current:null},awardHeaderScene:{current:null},connectors:{current:[]},targetCoordinate:null,setTargetCoordinate:()=>{},highlightedAwards:null,setHighlightedAwards:()=>{},shouldHighlightAwards:!1,setShouldHighlightAwards:()=>{},awardUIMiddleLeftScreenPosition:new i.I9Y,setAwardUIMiddleLeftScreenPosition:()=>{}}),m=e=>{let{children:t}=e,{shouldPerformLoading:n}=(0,o.useContext)(s.el),{textures:r}=(0,o.useContext)(s.DM),{sendEvent:c}=(0,s.pn)(),[m,p]=(0,o.useState)(null),[h,g]=(0,o.useState)(null),[v,x]=(0,o.useState)(null),y=(0,o.useRef)(null),w=(0,o.useRef)(null),R=(0,o.useRef)(null),C=(0,o.useRef)(null),{dataset:b,isLoading:S}=(0,l.sX)(n,0),[T,P]=(0,o.useState)(!1),{states:M,setters:A,isAllReady:D}=(0,l.i5)(["isAwardHeaderRendererReady","isAwardUIRendererReady","isCageRendererReady","isCityMarkerRendererReady","isCoordinateGuideRendererReady","isEarthRendererReady","isUIMarkerConnectorRendererReady"],"orangered"),_=(0,o.useRef)(f),I=(0,o.useRef)(null),E=(0,o.useRef)(null),U=(0,o.useRef)(null),O=(0,o.useRef)([]),F=(0,o.useRef)("u">typeof performance?performance.now():0),N=(0,o.useRef)(!1),L=(0,o.useRef)({state:"DEFAULT",distance:f}),z=(0,l.ml)(),[V,k]=(0,o.useState)(null),[G,B]=(0,o.useState)(null),[j,$]=(0,o.useState)(!1),[W,H]=(0,o.useState)(new i.I9Y),Y=z.register,X=z.unregister,q=(0,o.useCallback)((e,t)=>{_.current=t,L.current={state:e,distance:t},z.emit(e,t)},[z]);(0,l.SK)(()=>{}),(0,o.useLayoutEffect)(()=>{y.current=m},[m]),(0,o.useLayoutEffect)(()=>{w.current=h},[h]),(0,o.useLayoutEffect)(()=>{R.current=v},[v]),(0,o.useEffect)(()=>{!S&&b&&!b.isEmpty&&r.EarthMap&&(p(b.clone()),g(r.EarthMap.clone()))},[S,b,r.EarthMap]),(0,o.useEffect)(()=>{!n&&y.current&&w.current&&P(!0)},[n,m,h]),(0,o.useEffect)(()=>{if(!D||N.current)return;N.current=!0;let e=performance.now()-F.current;c({event:"scene_init_time",webgl_renderer:(0,u.J)(),duration_ms:Math.round(e),pixel_ratio:window.devicePixelRatio||1})},[D,c]);let Z=(0,o.useMemo)(()=>({shouldPresentContent:T,isAllRendererReady:D,isAwardHeaderRendererReady:M.isAwardHeaderRendererReady,isAwardUIRendererReady:M.isAwardUIRendererReady,isCageRendererReady:M.isCageRendererReady,isCityMarkerRendererReady:M.isCityMarkerRendererReady,isCoordinateGuideRendererReady:M.isCoordinateGuideRendererReady,isEarthRendererReady:M.isEarthRendererReady,isUIMarkerConnectorRendererReady:M.isUIMarkerConnectorRendererReady,setIsAwardHeaderRendererReady:A.isAwardHeaderRendererReady,setIsAwardUIRendererReady:A.isAwardUIRendererReady,setIsCageRendererReady:A.isCageRendererReady,setIsCityMarkerRendererReady:A.isCityMarkerRendererReady,setIsCoordinateGuideRendererReady:A.isCoordinateGuideRendererReady,setIsEarthRendererReady:A.isEarthRendererReady,setIsUIMarkerConnectorRendererReady:A.isUIMarkerConnectorRendererReady,dataset:m,datasetHolder:y,earthMapReferenceTexture:h,earthMapReferenceTextureHolder:w,earthOffscreenMapTexture:v,earthOffscreenMapTextureHolder:R,setEarthOffscreenMapTexture:x,earthOffscreenCountryTexture:C,registerAwardCameraEvent:Y,unregisterAwardCameraEvent:X,notifyAwardCameraEvent:q,cameraProps:_,awardGlobeScene:I,awardUIScene:E,awardHeaderScene:U,connectors:O,targetCoordinate:V,setTargetCoordinate:k,highlightedAwards:G,setHighlightedAwards:B,shouldHighlightAwards:j,setShouldHighlightAwards:$,awardUIMiddleLeftScreenPosition:W,setAwardUIMiddleLeftScreenPosition:H}),[T,D,M.isAwardHeaderRendererReady,M.isAwardUIRendererReady,M.isCageRendererReady,M.isCityMarkerRendererReady,M.isCoordinateGuideRendererReady,M.isEarthRendererReady,M.isUIMarkerConnectorRendererReady,m,h,v,Y,X,q,V,G,j,W]);return(0,a.jsx)(d.Provider,{value:Z,children:t})}},5844:(e,t,n)=>{n.d(t,{zJ:()=>l,uc:()=>u.u});var r,a=n(9618),o=n(4695);class i{from;to;delay;duration;easing;onBegin;onUpdate;onComplete;animationId=null;timeInitial=0;timeBegin=0;progress=0;isBeginCallbackFired=!1;constructor(e,t,n,r,a,i,s,l){this.from=e,this.to=t,this.delay=n,this.duration=r,this.easing="function"==typeof a?a:o.le.easeInOutSine,this.onBegin=i,this.onUpdate=s,this.onComplete=l}
57start(){this.timeInitial=Date.now(),this.timeBegin=this.delay,this.animationId=requestAnimationFrame(this.update.bind(this))}stop(){this.animationId&&cancelAnimationFrame(this.animationId),this.animationId=null}update(){let e=Date.now()-this.timeInitial;this.progress=a.cj9.clamp((e-this.timeBegin)/this.duration,0,1);let t=this.easing(this.progress);this.progress<0?this.animationId=requestAnimationFrame(this.update.bind(this)):this.progress<1?(this.animationId=requestAnimationFrame(this.update.bind(this)),this.isBeginCallbackFired?this.onUpdate?.(t,this.lerp(this.from,this.to,t)):(this.isBeginCallbackFired=!0,this.onBegin?.(t,this.lerp(this.from,this.to,t)))):(this.animationId&&cancelAnimationFrame(this.animationId),this.animationId=null,this.onComplete?.(t,this.lerp(this.from,this.to,t)))}lerp(e,t,n){return e+n*(t-e)}}var s=((r=s||{})[r.C=0]="C",r[r.CS=1]="CS",r[r.D=2]="D",r[r.DS=3]="DS",r[r.E=4]="E",r[r.F=5]="F",r[r.FS=6]="FS",r[r.G=7]="G",r[r.GS=8]="GS",r[r.A=9]="A",r[r.AS=10]="AS",r[r.B=11]="B",r);class l{key;audio;analyser;volume;animation=null;constructor(e,t,n=0){this.key=e,this.audio=t,this.volume=n,this.analyser=new a.CwR(t,256),this.audio.setVolume(this.volume)}play(e,t){this.volume=e??this.volume,this.audio.setLoop(t??!1),this.audio.setVolume(this.volume),this.audio.isPlaying||this.audio.play()}stop(e){this.volume=e??this.volume,this.audio.setVolume(this.volume),this.audio.stop(),this.animation?.stop()}fade(e,t,n,r,a){this.audio.setLoop(r??!1),this.animation?.stop(),this.animation=new i(this.volume,e,t,n,a,(t,n)=>{this.volume=n,this.audio.setVolume(this.volume),!this.audio.isPlaying&&e>0&&this.audio.play()},(e,t)=>{this.volume=t,this.audio.setVolume(this.volume)},(t,n)=>{this.volume=n,this.audio.setVolume(this.volume),0===e&&this.audio.stop(),this.animation=null}),this.animation.start()}getFrequency(){return this.analyser.getFrequencyData()}getAverageFrequency(){return this.analyser.getAverageFrequency()}getNote(e){let t=Object.values(s),n=12*(Math.log2(e/440)+4.75);return{note:t[Math.round(n)%12],octave:Math.floor(n/12)-1}}clone(){return new l(this.key,this.audio,this.volume)}}var u=n(1074)}
57,5874:(e,t,n)=>{n.d(t,{g:()=>p});var r=n(7973),a=n(6065),o=n(9618),i=n(6133),s=n(2488),l=n(6987),u=n(2310),c=n(5844);let f={min:400,max:800},d={min:200,max:400},m={min:0,max:200},p=(0,a.forwardRef)((e,t)=>{let{layers:n,position:p=[0,0,0],text:h="KOJIRO FUTAMURA",withAudio:g=!0,onInitialized:v,onPresentComplete:x}=e,{play:y,stop:w}=(0,a.useContext)(u.nE),{fonts:R}=(0,a.useContext)(u.DM),C=(0,a.useRef)(null),b=e=>{C.current?.present(f,{min:e,max:e+800})},S=()=>{C.current?.dismiss(d,m)},T=()=>C.current?C.current.getBoundingBoxSize():new o.I9Y;return((0,a.useImperativeHandle)(t,()=>({present:b,dismiss:S,getBoundingBoxSize:T}),[]),R.USansRgBd)?(0,r.jsx)(i.PD,{ref:C,layers:n,position:p,text:h,fontFile:R.USansRgBd.fontFile,fontTexture:R.USansRgBd.fontTexture,fontSize:l.i.label.fontSize.header,fontColor:new o.Q1f(l.i.label.fontColor),dithering:!1,onInitialized:v,onPresentStart:()=>{g&&y(c.uc.SFX_TEXT_TRANSITION_1,s.z.sfx.text.transition1,!0)},onPresentEnd:()=>{g&&w(c.uc.SFX_TEXT_TRANSITION_1),x?.()},onDismissStart:()=>{g&&y(c.uc.SFX_TEXT_TRANSITION_1,s.z.sfx.text.transition1,!0)},onDismissEnd:()=>{g&&w(c.uc.SFX_TEXT_TRANSITION_1)}}):null});p.displayName="HeaderTitle"},6133:(e,t,n)=>{n.d(t,{dr:()=>d,Fk:()=>g,Wi:()=>y,q1:()=>C,u$:()=>R,UT:()=>b,mV:()=>T,pi:()=>_,oQ:()=>N,vs:()=>j,Yi:()=>W,Sc:()=>x,fU:()=>H,jx:()=>Y,KE:()=>q,Vx:()=>K,YY:()=>J,PD:()=>ei,Ml:()=>eu});var r,a,o,i,s,l=n(7973),u=n(6065),c=n(9618);let f=e=>({setPositionXYZ:(t,n,r)=>e.current?.position.set(t,n,r),setPositionX:t=>{e.current&&(e.current.position.x=t)},setPositionY:t=>{e.current&&(e.current.position.y=t)},setPositionZ:t=>{e.current&&(e.current.position.z=t)}}),d=(0,u.forwardRef)((e,t)=>{let{layers:n,width:r,height:a,length:o,color:i,opacity:s}=e,d=(0,u.useRef)(null),m=(0,u.useRef)(null),p=(0,u.useRef)(null),h=(0,u.useRef)(null),v=(0,u.useRef)(null),x=(0,u.useMemo)(()=>({topLeft:new c.Pq0(-r/2,a/2,0),topRight:new c.Pq0(r/2,a/2,0),bottomRight:new c.Pq0(r/2,-a/2,0),bottomLeft:new c.Pq0(-r/2,-a/2,0)}),[r,a]),y=e=>{m.current.setPositionXYZ(-1*e,+e,4),p.current.setPositionXYZ(+e,+e,4),h.current.setPositionXYZ(+e,-1*e,4),v.current.setPositionXYZ(-1*e,-1*e,4)},w=e=>{m.current.setOpacityRatio(e),p.current.setOpacityRatio(e),h.current.setOpacityRatio(e),v.current.setOpacityRatio(e)};return(0,u.useImperativeHandle)(t,()=>({hover:y,setOpacityRatio:w,...f(d)}),[]),(0,l.jsxs)("group",{ref:d,layers:n,children:[(0,l.jsx)(g,{ref:m,layers:n,x0:x.topLeft.x,y0:x.topLeft.y-o,x1:x.topLeft.x,y1:x.topLeft.y,x2:x.topLeft.x+o,y2:x.topLeft.y,color:i,opacity:s}),(0,l.jsx)(g,{ref:p,layers:n,x0:x.topRight.x,y0:x.topRight.y-o,x1:x.topRight.x,y1:x.topRight.y,x2:x.topRight.x-o,y2:x.topRight.y,color:i,opacity:s}),(0,l.jsx)(g,{ref:h,layers:n,x0:x.bottomRight.x-o,y0:x.bottomRight.y,x1:x.bottomRight.x,y1:x.bottomRight.y,x2:
57x.bottomRight.x,y2:x.bottomRight.y+o,color:i,opacity:s}),(0,l.jsx)(g,{ref:v,layers:n,x0:x.bottomLeft.x,y0:x.bottomLeft.y+o,x1:x.bottomLeft.x,y1:x.bottomLeft.y,x2:x.bottomLeft.x+o,y2:x.bottomLeft.y,color:i,opacity:s})]})});d.displayName="Bracket";var m=n(2466);let p=` 58 varying vec2 vLocalPos; 59 void main() { 60 /* Pass local position (before model transform) for SDF calculation */ 61 vLocalPos = position.xy; 62 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 63 } 64`,h=` 65 uniform vec2 uP0; 66 uniform vec2 uP1; 67 uniform vec2 uP2; 68 uniform vec3 uColor; 69 uniform float uOpacity; 70 varying vec2 vLocalPos; 71 72 /* Distance from point p to line segment aâb */ 73 float segDist(vec2 p, vec2 a, vec2 b) { 74 vec2 pa = p - a; 75 vec2 ba = b - a; 76 float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0); 77 return length(pa - ba * h); 78 } 79 80 void main() { 81 if (uOpacity <= 0.0) discard; 82 83 float d1 = segDist(vLocalPos, uP0, uP1); 84 float d2 = segDist(vLocalPos, uP1, uP2); 85 float dRaw = min(d1, d2); 86 87 /* Use local-position derivatives rather than fwidth(distance). 88 This keeps 1px bracket arms stable at segment centers and corners. */ 89 float pxSize = max(fwidth(vLocalPos.x), fwidth(vLocalPos.y)); 90 float halfLineWidth = pxSize * 0.4; 91 float d = dRaw - halfLineWidth; 92 93 float aaWidth = pxSize * 0.4; 94 float alpha = 1.0 - smoothstep(0.0, aaWidth, d); 95 alpha *= uOpacity; 96 if (alpha < 0.01) discard; 97 98 gl_FragColor = vec4(uColor, alpha); 99 } 100`,g=(0,u.forwardRef)((e,t)=>{let{layers:n,x0:r,y0:a,x1:o,y1:i,x2:s,y2:d,color:g,opacity:v}=e,x=(0,u.useRef)(null),{cx:y,cy:w,w:R,h:C}=(0,u.useMemo)(()=>{let e=Math.min(r,o,s),t=Math.max(r,o,s),n=Math.min(a,i,d),l=Math.max(a,i,d);return{cx:(e+t)/2,cy:(n+l)/2,w:t-e+24,h:l-n+24}},[r,a,o,i,s,d]),b=(0,u.useRef)({uP0:new c.nc$(new c.I9Y(r,a)),uP1:new c.nc$(new c.I9Y(o,i)),uP2:new c.nc$(new c.I9Y(s,d)),uColor:new c.nc$(new c.Q1f(g)),uOpacity:new c.nc$(0)}),S=(0,m.RV)(b);(0,u.useMemo)(()=>{b.current.uP0.value.set(r,a),b.current.uP1.value.set(o,i),b.current.uP2.value.set(s,d)},[r,a,o,i,s,d]);let T=(0,u.useMemo)(()=>{let e=new c.bdM(R,C);return e.translate(y,w,0),e},[y,w,R,C]),P=e=>{b.current.uOpacity.value=e*v},M=e=>{},A=()=>x.current.position;return(0,u.useImperativeHandle)(t,()=>({setOpacityRatio:P,setPath:M,getPosition:A,...f(x)})),(0,l.jsxs)("mesh",{ref:x,layers:n,children:[(0,l.jsx)("primitive",{object:T,attach:"geometry"}),(0,l.jsx)("shaderMaterial",{ref:S,transparent:!0,depthTest:!1,depthWrite:!1,vertexShader:p,fragmentShader:h,uniforms:b.current})]})});g.displayName="BracketUnit";var v=n(9913),x=((r=x||{}).LINE="LINE",r.DASHED="DASHED",r);let y=(0,u.forwardRef)((e,t)=>{let{layers:n,start:r=new c.Pq0(0,0,0),end:a=new c.Pq0(0,0,0),lineStartColor:o=new c.Q1f(0xff0000),lineEndColor:i=new c.Q1f(0xff0000),lineOpacity:s=.1,lineStartOpacity:f=1,lineEndOpacity:d=1,enableStartCap:m=!1,enableEndCap:p=!0,startCapColor:h=new c.Q1f(0xff0000),endCapColor:g=new c.Q1f(0xff0000),startCapOpacity:y=.2,endCapOpacity:w=.2,style:R=x.L
100INE}=e,C=(0,u.useRef)(null),b=(0,u.useRef)(null),S=(0,u.useRef)(null),T=(0,u.useRef)(null),P=(0,u.useRef)(null),M=(0,u.useRef)(null),A=(0,u.useRef)(null),D=(0,u.useRef)(null),_=(0,u.useRef)([o.r,o.g,o.b,f]),I=(0,u.useRef)([i.r,i.g,i.b,d]),E=(e,t)=>{S.current.setAttribute("position",new c.qtW([e.x,e.y,e.z,t.x,t.y,t.z],3)),S.current.attributes.position.needsUpdate=!0,R===x.DASHED&&b.current.computeLineDistances(),P.current&&P.current.position.set(e.x,e.y,e.z),M.current&&M.current.position.set(t.x,t.y,t.z)},U=e=>{O(e),F(e)},O=e=>{T.current.opacity=e*s},F=e=>{A.current&&(A.current.opacity=e*y),D.current&&(D.current.opacity=e*w)},N=e=>{A.current&&(A.current.opacity=e*y)},L=e=>{D.current&&(D.current.opacity=e*w)},z=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;S.current.setAttribute("color",new c.qtW([e.r,e.g,e.b,n,t.r,t.g,t.b,r],4))};return(0,u.useEffect)(()=>{U(0)},[s]),(0,u.useLayoutEffect)(()=>{r&&a&&E(r,a)},[r,a]),(0,u.useLayoutEffect)(()=>{_.current=[o.r,o.g,o.b,f],I.current=[i.r,i.g,i.b,d],z(o,i,f,d)},[o,i,f,d]),(0,u.useLayoutEffect)(()=>{b.current.layers.set(n)},[n]),(0,u.useLayoutEffect)(()=>{b.current&&(b.current.frustumCulled=!1)},[]),(0,u.useImperativeHandle)(t,()=>({position:C.current.position,connect:E,setOpacityRatio:U,setLineOpacityRatio:O,setCapOpacityRatio:F,setStartCapOpacityRatio:N,setEndCapOpacityRatio:L,setColor:z})),(0,l.jsxs)("group",{ref:C,layers:n,children:[(0,l.jsxs)("line",{ref:b,children:[(0,l.jsx)("bufferGeometry",{ref:S}),R===x.LINE&&(0,l.jsx)("lineBasicMaterial",{ref:T,vertexColors:!0,opacity:s,transparent:!0,depthTest:!1}),R===x.DASHED&&(0,l.jsx)("lineDashedMaterial",{ref:T,vertexColors:!0,opacity:s,transparent:!0,depthTest:!1,dashSize:1,gapSize:2})]}),m&&(0,l.jsx)(v.jl,{ref:P,layers:n,args:[.8,32],children:(0,l.jsx)("meshBasicMaterial",{ref:A,color:h,opacity:y,transparent:!0,depthTest:!1})}),p&&(0,l.jsx)(v.jl,{ref:M,layers:n,args:[.8,32],children:(0,l.jsx)("meshBasicMaterial",{ref:D,color:g,opacity:w,transparent:!0,depthTest:!1})})]})});var w=n(4695),R=((a=R||{}).CIRCLE="CIRCLE",a.SQUARE="SQUARE",a.TRIANGLE="TRIANGLE",a.CROSS="CROSS",a);let C=(0,u.forwardRef)((e,t)=>{let{type:n="CIRCLE",radius:r,crossThickness:a=1,enableOutline:o=!0,enableBackground:i=!1,enableDot:s=!0,lineColor:c=0xff0000,lineOpacity:f=.2,fillColor:d=65280,fillOpacity:m=.1,dotColor:p=0xff0000,dotOpacity:h=.2,layers:g}=e,x=(0,u.useRef)(null),y=(0,u.useRef)(null),R=(0,u.useRef)(null),C=(0,u.useRef)(null),S=(0,u.useRef)(null),P=(0,u.useRef)(0),M=(0,u.useRef)(0),A=(0,w.zh)({from:{progress:P.current},onChange:e=>(P.current=e.value.progress,E(e.value.progress))},[])[1],D=(0,w.zh)({from:{progress:P.current},onChange:e=>(P.current=1-e.value.progress,E(1-e.value.progress))},[])[1],_=(0,w.zh)({from:{progress:M.current},onChange:e=>(M.current=e.value.progress,E(e.value.progress))},[])[1],I=e=>{x.current.position.set(e.x,e.y,e.z)},E=e=>{y.current?.setOpacityRatio(e),R.current?.setOpacityRatio(e),S.current&&(S.current.opacity=e*h)},U=()=>{_.stop(!0),D.stop(!0),A.stop(!0),A.start({from:{progress:P.current},to:{progress:1},config:{duration:200,easing:w.le.easeInOutQuad}})},O=()=>{E(0),_.stop(!0),A.stop(!0),D.stop(!0),D.start({from:{progress:P.current},to:{progress:1},config:{duration:200,easing:w.le.easeInOutQuad}})},F=async()=>{_.stop(!0),_.start({from:{progress:M.current},to:async e=>{await e({to:{progress:1},config:{duration:0,easing:w.le.linear}}),await new Promise(e=>setTimeout(e,40)),await e({to:{progress:0},config:{duration:40,easing:w.le.linear}}),await e({to:{progress:1},config:{duration:0,easing:w.le.linear}}),await new Promise(e=>setTimeout(e,40)),await e({to:{progress:0},config:{duration:40,easing:w.le.linear}}),await e({to:{progress:1},config:{duration:0,easing:w.le.linear}}),await new Promise(e=>setTimeout(e,40)),await e({to:{progress:0},config:{duration:300,easing:w.le.linear}})}})};(0,u.useEffect)(()=>{E(0)},[]),(0,u.useEffect)(()=>{y.current&&y.current.position.setZ(1)},[]),(0,u.useImperativeHandle)(t,()=>({position:x.current.position,updatePosition:I,setOpacityRatio:E,present:U,dismiss:O,blink:F,root:x.current}));let[N,L,z]=(0,u.useMemo)(()=>
100{let e=(e,t,n)=>(0,l.jsx)(Y,{ref:y,layers:g,segments:e,radius:n,startAngle:t,lineColor:c,lineOpacity:f}),t=(e,t,n)=>(0,l.jsx)(T,{ref:R,layers:g,radius:n,segments:e,startAngle:t,fillColor:d,fillOpacity:m}),u=null,x=null;switch(n){case"CIRCLE":u=o?e(32,0,r??4):null,x=i?t(32,0,r??4):null;break;case"SQUARE":u=o?e(4,45,r??5):null,x=i?t(4,45,r??5):null;break;case"TRIANGLE":u=o?e(3,90,r??5):null,x=i?t(3,90,r??5):null;break;case"CROSS":let w,P;u=o?(w=r??2,(0,l.jsx)(H,{ref:y,layers:g,thickness:a,radius:w,startAngle:0,lineColor:c,lineOpacity:f})):null,x=i?(P=r??2,(0,l.jsx)(b,{ref:R,layers:g,radius:P,thickness:a,startAngle:0,fillColor:d,fillOpacity:m})):null}return[u,x,s&&(0,l.jsx)(v.jl,{ref:C,layers:g,args:[.8,32],children:(0,l.jsx)("meshBasicMaterial",{ref:S,color:p,opacity:h,transparent:!0,depthTest:!1})})]},[g,r,n,c,f,d,m,i,s]);return(0,l.jsxs)("group",{ref:x,children:[L,N,z]})}),b=(0,u.forwardRef)((e,t)=>{let{layers:n,radius:r=10,startAngle:a=0,thickness:o=2,fillColor:i=0xff0000,fillOpacity:s=0,transparent:f=!0,depthTest:d=!1}=e,m=(0,u.useRef)(null),p=(0,u.useRef)(null),h=(0,u.useMemo)(()=>{if(o>=2*r)throw Error("Thickness must be less than radius * 2");let e=new c.ypk,t=o/2,n=new c.dwI().makeRotation(a*Math.PI/180),i=[new c.I9Y(-t,-r),new c.I9Y(t,-r),new c.I9Y(t,-t),new c.I9Y(r,-t),new c.I9Y(r,t),new c.I9Y(t,t),new c.I9Y(t,r),new c.I9Y(-t,r),new c.I9Y(-t,t),new c.I9Y(-r,t),new c.I9Y(-r,-t),new c.I9Y(-t,-t)];i.forEach(e=>e.applyMatrix3(n));for(let t=0;t<i.length;t++){let n=i[t].x,r=i[t].y;0===t?e.moveTo(n,r):e.lineTo(n,r)}return e.closePath(),e},[r,a,o]),g=(0,u.useCallback)(e=>{p.current.opacity=e*s},[]);return(0,u.useImperativeHandle)(t,()=>({setOpacityRatio:g,position:m.current.position}),[]),(0,u.useEffect)(()=>()=>void(m.current?.geometry?.dispose(),m.current?.removeFromParent()),[]),(0,l.jsxs)("mesh",{ref:m,layers:n,children:[(0,l.jsx)("shapeGeometry",{args:[h]}),(0,l.jsx)("meshBasicMaterial",{ref:p,color:i,opacity:s,transparent:f,depthTest:d})]})});var S=n(6382);let T=(0,u.forwardRef)((e,t)=>{let{layers:n,radius:r=10,startAngle:a=90,segments:o=3,fillColor:i=0xff0000,fillOpacity:s=0,transparent:f=!0,depthTest:d=!1}=e,m=(0,u.useRef)(null),p=(0,u.useRef)(null),h=(0,u.useMemo)(()=>{let e=new c.ypk,t=new c.I9Y(0,0),n=360/o;for(let i=0;i<o;i++){let o=(i*n+a)*S.V$,s=t.x+r*Math.cos(o),l=t.y+r*Math.sin(o);0===i?e.moveTo(s,l):e.lineTo(s,l)}return e.closePath(),e},[r,a,o]),g=(0,u.useCallback)(e=>{p.current.opacity=e*s},[]);return(0,u.useEffect)(()=>()=>void(m.current?.geometry?.dispose(),m.current?.removeFromParent()),[]),(0,u.useImperativeHandle)(t,()=>({setOpacityRatio:g,position:m.current.position}),[]),(0,l.jsxs)("mesh",{ref:m,layers:n,children:[(0,l.jsx)("shapeGeometry",{args:[h]}),(0,l.jsx)("meshBasicMaterial",{ref:p,color:i,opacity:s,transparent:f,depthTest:d})]})});var P=n(3267),M=n(1944);n(8498);let A=(0,u.forwardRef)((e,t)=>{let{blur:n,opacity:r,blending:a,side:o=c.hB5,transparent:i=!0,depthWrite:s=!1,depthTest:f=!0}=e,d=(0,u.useRef)(null),m=(0,P.C)(e=>e.size);return(0,u.useImperativeHandle)(t,()=>({material:d.current})),(0,u.useMemo)(()=>(0,l.jsx)("shaderMaterial",{ref:d,vertexShader:"uniform vec2 screenResolution;\n\nvarying vec2 vUv;\nvarying vec2 vDiffuseUV;\n\nvoid main() {\n vUv = uv;\n\n /**\n * Calculate the clip space position.\n */\n vec4 clipSpacePosition = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n\n /**\n * Convert the clip space coordinates to NDC.\n */\n vec3 ndc = clipSpacePosition.xyz / clipSpacePosition.w;\n\n /**\n * Convert the NDC coordinates to screen coordinates.\n */\n vec2 screenPosition = vec2((ndc.x + 1.0) * 0.5 * screenResolution.x, (1.0 - ndc.y) * 0.5 * screenResolution.y);\n\n /**\n * Convert the screen coordinates to UV coordinates.\n */\n vDiffuseUV = vec2(screenPosition.x / screenResolution.x, 1.0 - screenPosition.y / screenResolution.y);\n\n gl_Position = clipSpacePosition;\n}\n",fragmentShader:"/**\n * Frost blur fragment shader\n *\n * Applies a box blur
100(uniform-weight averaging) over a square kernel to the\n * diffuse texture, then masks the result with a separate mask texture.\n *\n * Algorithm:\n * 1. Sample the diffuse texture at the current UV plus every offset in a\n * KERNEL_RADIUS x KERNEL_RADIUS grid (including the centre sample).\n * 2. Each offset is scaled by TEXEL_SPACING * blur, where TEXEL_SPACING\n * controls the physical distance between samples in UV space and blur\n * is a runtime intensity multiplier.\n * 3. Divide the accumulated colour by the total number of samples\n * (KERNEL_SAMPLE_COUNT) to normalise.\n * 4. Output the blurred colour with alpha driven by the mask and opacity\n * uniforms.\n */\n\nuniform sampler2D tDiffuse;\nuniform sampler2D tMask;\nuniform float opacity;\nuniform float blur;\n\nvarying vec2 vUv;\nvarying vec2 vDiffuseUV;\n\n/* Half-width of the blur kernel. The full kernel side length is\n 2 * KERNEL_RADIUS + 1, so KERNEL_RADIUS = 2 produces a 5x5 grid. */\nconst int KERNEL_RADIUS = 2;\n\n/* Spacing between neighbouring samples in UV coordinates.\n Larger values widen the blur without adding extra samples. */\nconst float TEXEL_SPACING = 0.008;\n\n/* Total number of samples: (2 * KERNEL_RADIUS + 1)^2.\n Must stay in sync with KERNEL_RADIUS. */\nconst float KERNEL_SAMPLE_COUNT = 25.0;\n\nvoid main() {\n /* Accumulate samples across the kernel grid. The centre sample (i=0, j=0)\n is included in the loop, so we start from zero rather than a separate\n texture fetch. */\n vec4 acc = vec4(0.0);\n for (int i = -KERNEL_RADIUS; i <= KERNEL_RADIUS; i++) {\n for (int j = -KERNEL_RADIUS; j <= KERNEL_RADIUS; j++) {\n vec2 offset = vec2(i, j) * TEXEL_SPACING * blur;\n acc += texture2D(tDiffuse, vDiffuseUV + offset);\n }\n }\n\n vec4 blurredColor = acc / KERNEL_SAMPLE_COUNT;\n\n /* Apply mask and opacity. */\n vec4 maskColor = texture2D(tMask, vUv);\n gl_FragColor = vec4(blurredColor.rgb, maskColor.r * opacity);\n}\n",uniforms:c.LlO.merge([{tDiffuse:new c.nc$(null),tMask:new c.nc$(null),screenResolution:new c.nc$(new c.I9Y(m.width,m.height)),opacity:new c.nc$(r),blur:new c.nc$(n)}]),vertexColors:!0,blending:a,side:o,transparent:i,depthWrite:s,depthTest:f}),[])});var D=n(9319);let _=(0,u.forwardRef)((e,t)=>{let{layers:n,renderOrder:r,width:a=1,height:o=1,cornerRadius:i=0,transparent:s=!0,opacity:f=1,blur:d=.3}=e,m=(0,u.useRef)(null),p=(0,u.useRef)(null),h=(0,u.useRef)(null),[g,v]=(0,u.useState)(a),[x,y]=(0,u.useState)(o),R=(0,u.useRef)(0),[C,b]=(0,w.zh)(()=>({from:{opacity:0}
100}),[]),S=(0,P.C)(e=>e.size),T=(0,u.useRef)(null),_=e=>{T.current=e??null},I=(e,t)=>{v(e),y(t),h.current.material.uniforms.tMask.value?.dispose(),h.current.material.uniforms.tMask.value=(0,D.P7)(e,t,i)},E=e=>{e>=0&&(m.current.visible=!0),h.current.material.uniforms.opacity.value=e*f},U=e=>{m.current.visible=e},O=e=>{h.current.material.uniforms.blur.value=e},F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w.le.easeOutCubic,r=++R.current;b.stop(!0),m.current.visible=!0,b.start({from:{opacity:C.opacity},to:{opacity:1},config:{duration:e,easing:n},delay:t,onChange(e){R.current===r&&(h.current.material.uniforms.opacity.value=e.value.opacity*f)}})},N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w.le.easeOutCubic,r=++R.current;b.stop(!0),b.start({from:{opacity:C.opacity},to:{opacity:0},config:{duration:e,easing:n},delay:t,onChange(e){R.current===r&&(h.current.material.uniforms.opacity.value=e.value.opacity*f)},onRest:()=>{m.current&&R.current===r&&(m.current.visible=!1)}})},L=new c.cZY,z=new c.cZY,V=new c.cZY,k=new c.cZY,G=()=>{let e=p.current.attributes.position,t=m.current.localToWorld(new c.Pq0().fromBufferAttribute(e,0)),n=m.current.localToWorld(new c.Pq0().fromBufferAttribute(e,1)),r=m.current.localToWorld(new c.Pq0().fromBufferAttribute(e,2)),a=m.current.localToWorld(new c.Pq0().fromBufferAttribute(e,3));return L.set(t,n),z.set(n,a),V.set(a,r),k.set(r,t),[L,z,V,k]};return(0,u.useEffect)(()=>{m.current.visible=!1},[]),(0,u.useEffect)(()=>{I(a,o)},[a,o]),(0,u.useEffect)(()=>()=>{h.current?.material.uniforms.tMask?.value?.dispose()},[]),(0,M.Q)(()=>{T.current&&(h.current.material.uniforms.tDiffuse.value=T.current,h.current.material.uniforms.screenResolution.value.set(S.width,S.height))}),(0,u.useImperativeHandle)(t,()=>({position:m.current.position,rotation:m.current.rotation,scale:m.current.scale,visible:m.current.visible,transparent:h.current.material.transparent,diffuseTexture:T.current,setDiffuseTexture:_,setSize:I,setOpacity:E,setVisible:U,setBlur:O,getSegments:G,present:F,dismiss:N})),(0,l.jsxs)("mesh",{ref:m,layers:n,renderOrder:r,children:[(0,l.jsx)("planeGeometry",{ref:p,args:[g,x]}),(0,l.jsx)(A,{ref:h,blur:d,opacity:f,transparent:s})]})});
100_.displayName="FrostBackground";var I=n(6987),E=n(1902);let U=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new c.Q1f(I.i.label.fontColor),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new c.I9Y(1,1);return{tDiffuse:new c.nc$(null),diffuseResolution:new c.nc$(new c.I9Y(0,0)),pxRange:new c.nc$(a),texSize:new c.nc$(o),tDisplace0:new c.nc$(O(e.width,e.height,e.delay,e.amplitude,e.rotation)),tDisplace1:new c.nc$(O(t.width,t.height,t.delay,t.amplitude,t.rotation)),displaceResolution0:new c.nc$(new c.I9Y(e.width,e.height)),displaceResolution1:new c.nc$(new c.I9Y(t.width,t.height)),progress:new c.nc$(0),time:new c.nc$(0),displaceRotation0:new c.nc$(c.cj9.randFloat(-Math.PI,Math.PI)),displaceRotation1:new c.nc$(c.cj9.randFloat(-Math.PI,Math.PI)),color:new c.nc$(new c.Pq0(n.r,n.g,n.b)),colorMultiplier:new c.nc$(r),softness:new c.nc$(1),idleGlitchMode:new c.nc$(0)}},O=(e,t,n,r,a)=>(0,E.sT)(e,t,n,r,a,{min:-.5,max:.5});var F=((o=F||{}).PRESENT="present",o.DISMISS="dismiss",o.IDLE="idle",o);let N=(0,u.forwardRef)((e,t)=>{let{position:n,text:r,fontFile:a,fontTexture:o,fontSize:i,fontColor:s=new c.Q1f().setHex(I.i.label.fontColor),labelWidth:d,lineHeight:m,letterSpacing:p,layers:h,displacement:g,colorMultiplier:v=1,softness:x=1,transparent:y,dithering:R,depthTest:C,side:b,onInitialized:S,onPresentStart:T,onPresentEnd:M,onDismissStart:A,onDismissEnd:D,idleGlitch:_=!1,idleGlitchDuration:E={min:400,max:800},idleGlitchInterval:F={min:1e3,max:3e3}}=e,N=i/I.i.label.fontBaseLineHeight,L=(0,u.useRef)(null),z=(0,u.useRef)(null),V=(0,u.useRef)(null);(0,P.C)(e=>e.gl);let k=(0,P.C)(e=>e.clock),[G,B]=(0,u.useState)(new c.I9Y),[j,$]=(0,u.useTransition)(),W=(0,u.useRef)(T),H=(0,u.useRef)(M),Y=(0,u.useRef)(A),X=(0,u.useRef)(D),q=(0,u.useMemo)(()=>U({width:32,height:16,delay:{min:0,max:.8},amplitude:{min:.4,max:.5},rotation:{min:-.2,max:.2}},{width:28,height:12,delay:{min:.5,max:.9},amplitude:{min:.1,max:.5},rotation:{min:-.2,max:.2}},s,v,a.distanceField?.distanceRange??4,new c.I9Y(a.common.scaleW,a.common.scaleH)),[]);q.softness.value=x;let Z=(0,u.useRef)("idle"),Q=(0,u.useRef)(1),K=(0,u.useRef)(0),J=(0,u.useRef)(0),ee=(0,u.useRef)(null),et=(0,u.useRef)(_);et.current=_;let en=Math.PI/180*c.cj9.randFloat(-.3,.3),[er,ea]=(0,w.zh)(()=>({from:{progress:0},onStart:()=>{if(!V.current)return;V.current.uniforms.tDisplace0.value?.dispose(),V.current.uniforms.tDisplace1.value?.dispose();let e=Math.max(Math.ceil(G.x/(g??10)),3),t=Math.max(Math.ceil(G.y/(g??10)),3);V.current.uniforms.tDisplace0.value=O(e,t,{min:0,max:.8},{min:-.5,max:.5},{min:-Math.PI,max:Math.PI}),V.current.uniforms.tDisplace0.value.needsUpdate=!0;let n=Math.ceil(1.2*e),r=Math.ceil(1.2*t);V.current.uniforms.tDisplace1.value=O(n,r,{min:.5,max:.9},{min:-.5,max:.5},{min:-Math.PI,max:Math.PI}),V.current.uniforms.tDisplace1.value.needsUpdate=!0,"present"===Z.current?W.current?.():"dismiss"===Z.current&&Y.current?.()},onChange:e=>{if(!V.current)return;let t=e.value.progress;V.current.uniforms.progress.value=t,V.current.uniforms.time.value+=k.getDelta(),V.current.uniforms.displaceRotation0.value+=en,V.current.uniforms.displaceRotation1.value+=en},onRest:e=>{if(!V.current)return;let t=V.current.uniforms.progress.value;1===t&&"present"===Z.current?($(()=>{Z.current="idle"}),H.current?.(),et.current&&ev()):0===t&&"dismiss"===Z.current&&($(()=>{Z.current="idle"}),X.current?.())}}),[]),[eo,ei]=(0,w.zh)(()=>({from:{progress:0},onStart:()=>{V.current.uniforms.tDisplace0.value?.dispose(),V.current.uniforms.tDisplace1.value?.dispose();let e=Math.max(Math.ceil(G.x/(g??10)),3),t=Math.max(Math.ceil(G.y/(g??10)),3);V.current.uniforms.tDisplace0.value=O(e,t,{min:0,max:.8},{min:-.5,max:.5},{min:-Math.PI,max:Math.PI}),V.current.uniforms.tDisplace0.value.needsUpdate=!0;let n=Math.ceil(1.2*e),r=Math.ceil(1.2*t);V.current.uniforms.tDisplace1.value=O(n,r,{min:.5,max:.9},{min:-.5,max:.5},{min:-Math.PI,max:Math.PI}),V.current.uniforms.tDisplace1.value.needsUpdate=!0},onChange:e=>{let t=e.value.progress;V.current.uniforms.progress.value=t,V.current.uniforms.time.value+=k.getDelta(),V.current.uniforms.displaceRotation0.value+=en,V.current.uniforms.displaceRotation1.value+=en}}),[]),es=()=>
100{if(0===G.x||0===G.y){let e=new c.Pq0;z.current?.computeBoundingBox(),z.current?.boundingBox?.getSize(e);let t=new c.I9Y(e.x,e.y);return new c.I9Y(t.x*N,t.y*N)}return new c.I9Y(G.x*N,G.y*N)},el=()=>L.current.position,eu=e=>{L.current.position.set(e.x,e.y,e.z)},ec=e=>{z.current.text=e,z.current.attributes.position.needsUpdate=!0},ef=()=>z.current.text,ed=(e,t)=>{eg();let n="number"==typeof e?e:c.cj9.randFloat(e.min,e.max),r="number"==typeof t?t:c.cj9.randFloat(t.min,t.max);return ei.stop(!0),Z.current="present",Q.current=1,K.current=n,J.current=r,ea.stop(!0),ea.start({from:{progress:er.progress},to:{progress:1},delay:r,config:{duration:n,easing:w.le.linear}}),J.current+K.current},em=(e,t)=>(eg(),ei.stop(!0),Z.current="dismiss",Q.current=-1,K.current="number"==typeof e?e:c.cj9.randFloat(e.min,e.max),J.current="number"==typeof t?t:c.cj9.randFloat(t.min,t.max),ea.stop(!0),ea.start({from:{progress:er.progress},to:{progress:0},delay:J.current,config:{duration:K.current,easing:w.le.linear}}),J.current+K.current),ep=(e,t)=>{eg();let n="number"==typeof e?e:c.cj9.randFloat(e.min,e.max),r="number"==typeof t?t:c.cj9.randFloat(t.min,t.max);ei.stop(!0),ei.start({from:{progress:0},to:{progress:1},delay:r,config:{duration:n,easing:w.le.linear},onRest:()=>{et.current&&"idle"===Z.current&&ev()}})},eh=()=>{Z.current="idle",ea.stop(!0)},eg=()=>{null!==ee.current&&(clearTimeout(ee.current),ee.current=null),V.current&&(V.current.uniforms.idleGlitchMode.value=0)},ev=()=>{eg(),ee.current=setTimeout(()=>{if(ee.current=null,"idle"!==Z.current||!V.current)return;ei.stop(!0),(()=>{if(!V.current)return;let e=Math.max(Math.ceil(G.x/(g??10)),3),t=Math.max(Math.ceil(G.y/(g??10)),3);V.current.uniforms.tDisplace0.value=O(e,t,{min:0,max:.8},{min:-.5,max:.5},{min:-Math.PI,max:Math.PI}),V.current.uniforms.tDisplace0.value.needsUpdate=!0;let n=Math.ceil(1.2*e),r=Math.ceil(1.2*t);V.current.uniforms.tDisplace1.value=O(n,r,{min:.5,max:.9},{min:-.5,max:.5},{min:-Math.PI,max:Math.PI}),V.current.uniforms.tDisplace1.value.needsUpdate=!0})(),V.current.uniforms.idleGlitchMode.value=1;let e=c.cj9.randInt(4,8),t=c.cj9.randFloat(E.min,E.max)/e,n=0,r=()=>{V.current&&"idle"===Z.current&&(n<e?(V.current.uniforms.progress.value=c.cj9.randFloat(.2,1),n++,ee.current=setTimeout(r,c.cj9.randFloat(.5*t,1.5*t))):(V.current.uniforms.progress.value=1,V.current.uniforms.idleGlitchMode.value=0,ee.current=null,et.current&&"idle"===Z.current&&ev()))};r()},c.cj9.randFloat(F.min,F.max))};return(0,u.useEffect)(()=>()=>void(eg(),ea.stop(!0),ei.stop(!0),V.current?.uniforms.tDisplace0?.value?.dispose(),V.current?.uniforms.tDisplace1?.value?.dispose(),o?.dispose(),V.current?.dispose(),z.current?.dispose(),L.current?.geometry?.dispose(),Array.isArray(L.current?.material)?L.current?.material.forEach(e=>e.dispose()):L.current?.material&&L.current?.material.dispose(),L.current?.remove()),[]),(0,u.useEffect)(()=>{let e,t;a&&o&&(e=new c.Pq0,z.current.computeBoundingBox(),z.current.boundingBox?.getSize(e),B(t=new c.I9Y(e.x,e.y)),o.generateMipmaps=!1,o.minFilter=c.k6q,o.magFilter=c.k6q,o.needsUpdate=!0,V.current.uniforms.tDiffuse.value=o,V.current.uniforms.diffuseResolution.value=t)},[a,o]),(0,u.useEffect)(()=>{0!==G.x&&0!==G.y&&S&&S()},[G]),(0,u.useEffect)(()=>{_&&"idle"===Z.current?ev():eg()},[_]),(0,u.useImperativeHandle)(t,()=>({...e,...L.current,displayName:"GlitchTextV1",mesh:L.current,textureResolution:G,getBoundingBoxSize:es,getPosition:el,setPosition:eu,...f(L),setText:ec,getText:ef,present:ed,dismiss:em,hover:ep,abort:eh}),[]),(0,l.jsxs)("mesh",{ref:L,layers:h,position:n,scale:N,rotation:[Math.PI,0,0],children:[(0,l.jsx)("textGeometry",{ref:z,args:[r,{font:a,lineHeight:m,letterSpacing:p??0,width:d,flipY:!0}]}),(0,l.jsx)("shaderMaterial",{ref:V,transparent:void 0===y||y,dithering:void 0===R||R,depthTest:void 0!==C&&C,side:void 0!==b?b:c.hB5,vertexShader:"varying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"precision highp float;\n\n/**\n * UV coordinates passed from the vertex shader\n */\nvarying vec2 vUv;\n\n/**\n * Diffuse Texture (MSDF atlas â RGB encodes distance field data)\n */\nuniform sampler2D tDiffuse;\n\n/**\n * Diffuse Texture Resolution\n */\nuniform vec2 diffuseResolution;\n\n/**\n * MSDF pixel range and atlas texture size for scale-independent antialiasing\n */\nuniform float pxR
100ange;\nuniform vec2 texSize;\nuniform float softness;\n\n/**\n * Displacement Map Texture\n */\nuniform sampler2D tDisplace0;\nuniform sampler2D tDisplace1;\n\n/**\n * Displacement Map Texture Resolution\n */\nuniform vec2 displaceResolution0;\nuniform vec2 displaceResolution1;\n\n/**\n * Progress value in the range of 0.0 to 1.0\n */\nuniform float progress;\n/**\n * Time value that changes according to the delta value of the frame loop\n */\nuniform float time;\n/**\n * Rotation angle for movement. Range is -Math.PI to Math.PI\n */\nuniform float displaceRotation0;\nuniform float displaceRotation1;\n/**\n * Idle glitch mode flag (1.0 = distortion only, no alpha fade)\n */\nuniform float idleGlitchMode;\n/**\n * Font color\n */\nuniform vec3 color;\nuniform float colorMultiplier;\n\n/**\n * MSDF: Returns the median of three values.\n * Used to extract the signed distance from an MSDF RGB sample.\n */\nfloat median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n}\n\n/**\n * Computes the screen-space pixel range for scale-independent MSDF antialiasing.\n * Returns at least 1.0 to guarantee smooth edges even at extreme minification.\n */\nfloat screenPxRange() {\n vec2 unitRange = vec2(pxRange) / texSize;\n vec2 screenTexSize = vec2(1.0) / fwidth(vUv);\n return max(0.5 * dot(unitRange, screenTexSize), 1.0);\n}\n\n/**\n * MSDF: Computes a crisp alpha value from an MSDF texture sample.\n */\nfloat msdfAlpha(vec2 uv) {\n vec3 s = texture2D(tDiffuse, uv).rgb;\n float sigDist = median(s.r, s.g, s.b) - 0.5;\n return clamp(sigDist * screenPxRange() * softness + 0.5, 0.0, 1.0);\n}\n\n/**\n * Description : Random value generator\n * @param {vec2} c - Input vector\n * @return {float} - Random value\n */\nfloat random(vec2 c) {\n return fract(sin(dot(c.xy, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\n/**\n * Description : Random value generator\n * @param {float} x - Input value\n * @return {float} - Random value\n */\nfloat random(float x) {\n return fract(sin(x) * 1e4);\n}\n\n/**\n * Description : Array and textureless GLSL 2D/3D/4D simplex\n * noise functions.\n * Author : Ian McEwan, Ashima Arts.\n * Maintainer : ijm\n * Lastmod : 20110822 (ijm)\n * License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n * Distributed under the MIT License. See LICENSE file.\n * https://github.com/ashima/webgl-noise\n */\n\n/**\n * Description : Modulo 289\n * @param {vec3} x - Input vector\n * @return {vec3} - Modulo 289 value\n */\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\n/**\n * Description : Modulo 289\n * @param {vec4} x - Input vector\n * @return {vec4} - Modulo 289 value\n */\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\n/**\n * Description : Permute\n * @param {vec4} x - Input vector\n * @return {vec4} - Permute value\n */\nvec4 permute(vec4 x) {\n return mod289((x * 34.0 + 1.0) * x);\n}\n\n/**\n * Description : Taylor Inv Sqrt\n * @param {vec4} r - Input vector\n * @return {vec4} - Taylor Inv Sqrt value\n */\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\n/**\n * Simplex Noise 3D\n * @param v - Input vector\n * @return - Noise value\n */\nfloat snoise3(vec3 v) {\n const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n /**\n * First\n */\n vec3 i = floor(v + dot(v, C.yyy));\n vec3 x0 = v - i + dot(i, C.xxx);\n\n /**\n * Other corners\n */\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min(g.xyz, l.zxy);\n vec3 i2 = max(g.xyz, l.zxy);\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; /**\n * 2.0*C.x = 1/3 = C.y\n */\n vec3 x3 = x0 - D.yyy; /**\n * -1.0+3.0*C.x = -0.5 = -D.y\n */\n\n /**\n * Permutations\n */\n i = mod289(i);\n vec4 p = permute(permute(permute(i.z + vec4(0.0, i1.z, i2.z, 1.0)) + i.y + vec4(0.0, i1.y, i2.y, 1.0)) + i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\n /**\n * * Gradients: 7x7 points over a square, mapped onto an octahedron.\n * * The r
100ing size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n */\n float n_ = 0.142857142857; /**\n * 1.0/7.0\n */\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); /**\n * mod(p,7*7)\n */\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_); /**\n * mod(j,N)\n */\n\n vec4 x = x_ * ns.x + ns.yyyy;\n vec4 y = y_ * ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4(x.xy, y.xy);\n vec4 b1 = vec4(x.zw, y.zw);\n\n vec4 s0 = floor(b0) * 2.0 + 1.0;\n vec4 s1 = floor(b1) * 2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3(a0.xy, h.x);\n vec3 p1 = vec3(a0.zw, h.y);\n vec3 p2 = vec3(a1.xy, h.z);\n vec3 p3 = vec3(a1.zw, h.w);\n\n /**\n * Normalize gradients\n */\n vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n /**\n * Mix final noise value\n */\n vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n m = m * m;\n return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n\n/**\n * Easing functions\n */\n\nfloat easeInQuart(float t) {\n return t * t * t * t;\n}\n\nfloat easeInQuint(float t) {\n return t * t * t * t * t;\n}\n\nfloat easeOutQuad(float t) {\n return t * (2.0 - t);\n}\n\nfloat easeOutCubic(float t) {\n return 1.0 - pow(1.0 - t, 3.0);\n}\n\n/**\n * Description : Glitch Effect\n *\n * @param {sampler2D} tDisplace - Displacement texture\n * @param {vec2} displaceResolution - Displacement texture resolution\n * @param {float} rotation - Rotation angle for movement. Range is -Math.PI to Math.PI\n * @param {out float} resultProgress - Result progress value in the range of 0.0 to 1.0\n * @param {out float} resultAlpha - MSDF alpha after glitch distortion\n */\nvoid glitch(sampler2D tDisplace, vec2 displaceResolution, float rotation, out float resultProgress, out float resultAlpha) {\n /**\n * Compute MSDF alpha at original UV\n */\n float diffuseAlpha = msdfAlpha(vUv);\n\n /**\n * Get the displacement color\n */\n vec4 displaceColor = texture2D(tDisplace, vUv);\n\n /**\n * Add delay, amplitude, start rotation, and rotation direction to each block according to the displacement map divided into mosaic patterns\n */\n float delay = displaceColor.x;\n float amplitude = displaceColor.y;\n float startRotation = displaceColor.z;\n float seed = displaceColor.w;\n\n /**\n * Calculate the progress of the effect excluding the delay. The value is in the range of 0.0 to 1.0.\n */\n float delayedProgress = max(progress - delay, 0.0) / (1.0 - delay);\n\n /**\n * Adjust the strength of the glitch effect based on progress\n */\n float strength = 1.0 - progress;\n float delayedStrength = 1.0 - delayedProgress;\n\n /**\n * Apply easing functions to the strength value in advance\n */\n float easeOutQuadStrength = easeOutQuad(delayedStrength);\n float easeInQuartStrength = easeInQuart(delayedStrength);\n float easeInQuintStrength = easeInQuint(delayedStrength);\n\n /**\n * * Mosaic effect\n */\n /**\n * divisionX calculates the number of divisions based on the delayed strength, limiting the minimum value to 1.0.\n */\n float divisionX = max(displaceResolution.x - round(delayedStrength * displaceResolution.x), 1.0);\n /**\n * divisionY calculates the number of divisions based on the delayed strength, limiting the minimum value to 1.0.\n */\n float divisionY = max(displaceResolution.y - round(delayedStrength * displaceResolution.y), 1.0);\n /**\n * mosaicScale calculates the scale of the mosaic based on easeOutQuadStrength, rounding it by dividing by 5.0. The values are 0.0, 0.2, 0.4, 0.6, 0.8, and 1.0 in increments of 0.2.\n */\n float mosaicScale = round(easeOutQuadStrength * 4.0) / 4.0;\n /**\n * UV coordinates for applying the mosaic effect\n */\n vec2 mosaicUv = vec2(\n /**\n * * Divide vUv.x by the mosaic scale and center it.\n * * 1. Multiply vUv.x by displaceResolution.x to scale it to the horizontal resolution of the texture.\n * * 2. Divide it by mosaicScale to split it according to the scale of the mosaic.\n * * 3. Use the floor function to truncate the decimal part, resulting in the top-left coordinates of each mosaic block.\n * * 4. Divide it again by displaceResolution.x / mosaicScale to return it to the original scale.\n * * 5. Finally, add (mosaicScale / 2.0) / displaceResolution.x to center it in the mosaic block.\n */\n floor(vUv.x * displaceResolution.x / mosaicScale) / (displaceResolution.x / mosaicScale) + mosaicScale / 2.0 / displaceResolution.x,\n /**\n * * Divide vUv.y by the mosaic scale and center it.\n * * 1. Multiply vUv.y by displaceResolution.y to scale it to the vertical resolution of the texture.\n * * 2. Divide it by mosaicScale to split it according to the scale of the mosaic.\n * * 3. Use the floor function to truncate the decimal part, resulting in the top-left coordinates of each mosaic block.\n * * 4. Divide it again by displaceResolution.y / mosaicScale to return it to the original scale.\n * * 5. Finally, add (mosaicScale / 2.0) / displaceResolution.y to center it in the mosaic block.\n */\n floor(vUv.y * displaceResolution.y / mosaicScale) / (displaceResolution.y / mosaicScale) + mosaicScale / 2.0 / displaceResolution.y\n );\n\n /**\n * * Distortion effect\n */\n /**\n * Calculate the current amplitude\n */\n float currentAmplitude = amplitude * easeInQuartStrength;\n /**\n * Calculate the current rotation angle\n */\n float currentRotation = startRotation + rotation;\n /**\n * Calculate the distortion of the glitch effect\n */\n vec2 distortion = vec2(currentAmplitude * cos(currentRotation), currentAmplitude * sin(currentRotation));\n /**\n * Calculate the noise of the glitch effect\n */\n float noiseX = snoise3(vec3(0.0, vUv.x * 8.0, seed)) / 2.0 * easeInQuintStrength;\n float noiseY = snoise3(vec3(0.0, vUv.y * 8.0, seed)) / 2.0 * easeInQuintStrength;\n vec2 glitchOffset = vec2(noiseX + distortion.x, noiseY + distortion.y);\n\n /**\n * Compute MSDF alpha at distorted UV\n */\n float glitchAlpha = msdfAlpha(mosaicUv + glitchOffset);\n\n /**\n * Mix the original alpha and the glitch alpha\n */\n float mixFactor = floor(easeOutQuadStrength * 3.0) / 3.0;\n float finalAlpha = mix(diffuseAlpha, glitchAlpha, mixFactor);\n\n /**\n * Output values\n */\n resultProgress = delayedProgress;\n resultAlpha = finalAlpha;\n}\n\n/**\n * Description : Glitch Effect\n */\nvoid main(void ) {\n float glitchProgress0;\n float glitchProgress1;\n float glitchAlpha0;\n float glitchAlpha1;\n glitch(tDisplace0, displaceResolution0, displaceRotation0, glitchProgress0, glitchAlpha0);\n glitch(tDisplace1, displaceResolution1, displaceRotation1, glitchProgress1, glitchAlpha1);\n\n /**\n * Mix the both values\n */\n float glitchAlpha = mix(glitchAlpha0, glitchAlpha1, 0.5);\n float glitchProgress = mix(glitchProgress0, glitchProgress1, 0.5);\n\n /**\n * Calculate the final color\n */\n vec3 applyColor = pow(color.rgb, vec3(colorMultiplier));\n\n /**\n * Output the final color with MSDF alpha\n */\n float finalAlpha = idleGlitchMode > 0.5 ? glitchAlpha : glitchProgress * glitchAlpha;\n gl_FragColor = vec4(applyColor, finalAlpha);\n}\n",uniforms:q})]})});N.displayName="GlitchTextV1";let L=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{min:.004,max:.008},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{min:-Math.PI,max:Math.PI},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{min:0,max:1};return(0,E.sT)(e,t,n,r,a)},z=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{min:0,max:.5},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{min:0,max:.5},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{min:.1,max:.3},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.1;return(0,E.ff)(e,t,n,r,a,o)},V=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:6,height:6,amplitude:{min:.004,max:.008},rotation:{min:-Math.PI,max:Math.PI},seed:{min:0,max:1}},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:8,height:8,initial:{min:0,max:.5},delay:{min:0,max:.5},speed:{min:.1,max:.3},quantum:.1},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new c.Q1f(I.i.label.fontColor),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new c.I9Y(1,1);return{tDiffuse:new c.nc$(null),diffuseResolution:new c.nc$(new c.I9Y(0,0)),pxRange:new c.nc$(a),texSize:new c.nc$(o),softness:new c.nc$(1),tDisplace:new c.nc$(L(e.width,e.height,e.amplitude,e.rotation,e.seed)),displaceResolution:new c.nc$(new c.I9Y(e.width,e.height)),displaceProgress:new c.nc$(0),displaceRotation:new c.nc$(c.cj9.randFloat(-Math.PI,Math.PI)),noiseProgress:new c.nc$(0),noiseReduction:new c.nc$(.1),noiseFrequency:new c.nc$(2),tMosaic:new c.nc$(z(t.width,t.height,t.initial,t.delay,t.speed,t.quantum)),mosaicResolution:new c.nc$(new c.I9Y(t.width,t.height)),mosaicProgress:new c.nc$(0),opacity:new c.nc$(0),rgbShiftOffset:new c.nc$(new c.Pq0(-.003,0,.003)),rgbShiftAmount:new c.nc$(0),color:new c.nc$(new c.Pq0(n.r,n.g,n.b)),colorMultiplier:new c.nc$(r),tGPUData:new c.nc$(null),gpuDataWidth:new c.nc$(0),gpuDataNumRows:new c.nc$(6),idleGlitchActive:new c.nc$(0)}};var k=n(1916),G=n(637),B=((i=B||{}
100).PRESENT="present",i.DISMISS="dismiss",i.IDLE="idle",i);let j=(0,u.forwardRef)((e,t)=>{let{position:n,text:r,fontFile:a,fontTexture:o,fontSize:i,fontColor:s=new c.Q1f().setHex(I.i.label.fontColor),labelWidth:d,lineHeight:p,letterSpacing:h,layers:g,gridX:v,gridY:x,noiseFrequency:y=2,colorMultiplier:R=1,softness:C=1,transparent:b,dithering:S,depthTest:T,side:M,rgbShiftOffset:A=[-.003,0,.003],rgbShiftAmount:D=0,onInitialized:_,onPresentStart:E,onPresentEnd:U,onDismissStart:O,onDismissEnd:F,idleGlitch:N=!1,idleGlitchDuration:B,idleGlitchInterval:j}=e,$=i/I.i.label.fontBaseLineHeight,W=(0,u.useRef)($);W.current=$;let H=(0,u.useRef)(null),Y=(0,u.useRef)(null),X=(0,u.useRef)(null),[q,Z]=(0,u.useState)(new c.I9Y),Q=(0,u.useRef)(E),K=(0,u.useRef)(U),J=(0,u.useRef)(O),ee=(0,u.useRef)(F),et=(0,u.useMemo)(()=>V({width:6,height:6,amplitude:{min:.002,max:.004},rotation:{min:-Math.PI,max:Math.PI},seed:{min:0,max:1}},{width:8,height:8,initial:{min:0,max:.5},delay:{min:0,max:.5},speed:{min:.1,max:.3},quantum:.25},s,R,a.distanceField?.distanceRange??4,new c.I9Y(a.common.scaleW,a.common.scaleH)),[]);et.softness.value=C,et.colorMultiplier.value=R,et.noiseFrequency.value=y,et.rgbShiftOffset.value=new c.Pq0(A[0],A[1],A[2]),et.rgbShiftAmount.value=D;let en=(0,u.useRef)("idle"),er=Math.PI/180*c.cj9.randFloat(-.3,.3),ea=(0,u.useRef)(N);ea.current=N;let eo=(e=>{let{gl:t}=e,n=(0,u.useRef)(!1),r=(0,u.useRef)(null),a=(0,u.useRef)(null),o=(0,u.useRef)({}),i=(0,u.useRef)(0),s=1/60;return{isReady:n,setup:e=>{if(r.current||0===e)return;r.current=new k.d(e,6,t),(0,G.n)()&&r.current.setDataType(c.ix0);let i=r.current.createTexture();for(let t=0,n=0;t<e;t++,n+=4){let t=n+0*e*4;i.image.data.set([0,c.cj9.randFloat(-Math.PI,Math.PI),0,0],t),t=n+4*e,i.image.data.set([0,0,c.cj9.randFloat(1,2),c.cj9.randFloat(1,2)],t),t=n+2*e*4,i.image.data.set([0,.1,0,0],t),t=n+3*e*4,i.image.data.set([0,0,c.cj9.randFloat(1,2),c.cj9.randFloat(.5,1)],t),t=n+4*e*4,i.image.data.set([0,0,0,0],t),t=n+5*e*4,i.image.data.set([0,0,c.cj9.randFloat(0,.5),c.cj9.randFloat(.5,1)],t)}i.needsUpdate=!0,a.current=r.current.addVariable("tGPUData","/**\n * GPU compute shader for GlitchTextV2 per-cell idle animation.\n *\n * Simplified from PortraitTextInstanceGPUShader â always PRESENT_LOOP mode,\n * no mode state machine, no shuffle, no animationStatus.\n *\n * Data texture layout (6 rows):\n * Row 0: displaceEffect (strength, rotation, -, -)\n * Row 1: displaceAnimation (progress, currentTime, wait, duration)\n * Row 2: noiseEffect (strength, noiseReduction, -, -)\n * Row 3: noiseAnimation (progress, currentTime, wait, duration)\n * Row 4: mosaicEffect (strength, -, -, -)\n * Row 5: mosaicAnimation (progress, currentTime, wait, duration)\n */\n\n#include <common>\n#include <ftmr_math>\n\nuniform float delta;\nuniform float numTextureRows;\n\n/**\n * Displace effect wave parameters\n */\nuniform float displaceEffectWaveRepeat;\nuniform float displaceEffectWaveTarget;\nuniform float displaceEffectWaveReduction;\n\n/**\n * Displace animation loop parameters\n */\nuniform float displaceAnimationLoopDelay;\nuniform float displaceAnimationLoopDurationMultiplier;\n\n/**\n * Noise effect wave parameters\n */\nuniform float noiseEffectWaveRepeat;\nuniform float noiseEffectWaveTarget;\nuniform float noiseEffectWaveReduction;\n\n/**\n * Noise animation loop parameters\n */\nuniform float noiseAnimationLoopDelay;\nuniform float noiseAnimationLoopDurationMultiplier;\n\n/**\n * Mosaic effect wave parameters\n */\nuniform float mosaicEffectWaveRepeat;\nuniform float mosaicEffectWaveTarget;\nuniform float mosaicEffectWaveReduction;\n\n/**\n * Mosaic animation loop parameters\n */\nuniform float mosaicAnimationLoopDelay;\nuniform float mosaicAnimationLoopDurationMultiplier;\n\n/**\n * **********************************************************\n * Animation functions\n * **********************************************************\n */\n\n/**\n * Advance a looping animation timer.\n * Ported from PortraitTextInstanceGPUShader calculateAnimationColor,\n * hardcoded to PRESENT_LOOP mode.\n *\n * @param {vec2} animationUV - UV coordinates for the animation row.\n * @param {float} loopDelay - Base delay before each loop cycle.\n * @param {float} loopDurationMultiplier - Multiplier applied to per-cell wait.\n * @returns {vec4} (progress, currentTime, wait, duration)\n */\nvec4 calculateAnimationColor(vec2 animationUV, float loopDelay, float loopDurationMultiplier) {\n /**\n * * Read previous frame state:\n * * x: progress\n * * y: currentTime\n * * z: per-cell wait (random, set at init)\n * * w: per-cell duration (random, set at init)\n */\n vec4 animationColor = texture2D(tGPUData, animationUV);\n float animationProgress = animationColor.x;\n float animationCurrentTime = animationColor.y;\n\n /**\n * * Compute effective wait and duration (PRESENT_LOOP formula from Home)\n */\n float animationWait = loopDelay + animationColor.z * loopDurationMultiplier;\n float animationDuration = animationColor.w;\n float totalAnimationDuration = animationWait + animationDuration;\n\n /**\n * * Update progress\n */\n if (animationCurrentTime >= animationWait) {\n animationProgress = clamp((animationCurrentTime - animationWait) / animationDuration, 0.0, 1.0);\n }\n\n /**\n * * Advance time\n */\n animationCurrentTime += delta;\n\n /**\n * * Loop reset\n */\n if (animationCurrentTime >= totalAnimationDuration) {\n animationCurrentTime = 0.0;\n animationProgress = 0.0;\n }\n\n return vec4(animationProgress, animationCurrentTime, animationColor.zw);\n}\n\n/**\n * **********************************************************\n * Effect functions\n * **********************************************************\n */\n\n/**\n * Compute effect strength from animation progress using wave function.\n * Ported from PortraitTextInstanceGPUShader calculateEffe
100ctColor,\n * hardcoded to PRESENT_LOOP mode.\n * Preserves .yzw from init data (rotation, noiseReduction, etc.).\n *\n * @param {vec2} effectUV - UV coordinates for the effect row.\n * @param {vec2} animationUV - UV coordinates for the corresponding animation row.\n * @param {float} waveRepeat - Wave repeat count.\n * @param {float} waveTarget - Wave target value.\n * @param {float} waveReduction - Wave reduction value.\n * @returns {vec4} (effectStrength, preserved.yzw)\n */\nvec4 calculateEffectColor(vec2 effectUV, vec2 animationUV, float waveRepeat, float waveTarget, float waveReduction) {\n vec4 effectColor = texture2D(tGPUData, effectUV);\n vec4 animationColor = texture2D(tGPUData, animationUV);\n float animationProgress = animationColor.x;\n\n float effectStrength = wave(animationProgress, waveRepeat, waveTarget, waveReduction);\n\n return vec4(effectStrength, effectColor.yzw);\n}\n\n/**\n * **********************************************************\n * Main\n * **********************************************************\n */\n\nvoid main() {\n /**\n * * Row indices (pixel centers)\n */\n float DISPLACE_EFFECT_ROW = 0.5;\n float DISPLACE_ANIMATION_ROW = 1.5;\n float NOISE_EFFECT_ROW = 2.5;\n float NOISE_ANIMATION_ROW = 3.5;\n float MOSAIC_EFFECT_ROW = 4.5;\n float MOSAIC_ANIMATION_ROW = 5.5;\n\n /**\n * * Row UV offsets\n */\n float displaceEffectUVOffset = DISPLACE_EFFECT_ROW / numTextureRows;\n float displaceAnimationUVOffset = DISPLACE_ANIMATION_ROW / numTextureRows;\n float noiseEffectUVOffset = NOISE_EFFECT_ROW / numTextureRows;\n float noiseAnimationUVOffset = NOISE_ANIMATION_ROW / numTextureRows;\n float mosaicEffectUVOffset = MOSAIC_EFFECT_ROW / numTextureRows;\n float mosaicAnimationUVOffset = MOSAIC_ANIMATION_ROW / numTextureRows;\n\n /**\n * * Current cell U coordinate on the GPU data texture\n */\n float uvU = gl_FragCoord.x / resolution.x;\n\n /**\n * * UV coordinates for each row\n */\n vec2 displaceEffectUV = vec2(uvU, displaceEffectUVOffset);\n vec2 displaceAnimationUV = vec2(uvU, displaceAnimationUVOffset);\n vec2 noiseEffectUV = vec2(uvU, noiseEffectUVOffset);\n vec2 noiseAnimationUV = vec2(uvU, noiseAnimationUVOffset);\n vec2 mosaicEffectUV = vec2(uvU, mosaicEffectUVOffset);\n vec2 mosaicAnimationUV = vec2(uvU, mosaicAnimationUVOffset);\n\n /**\n * * Dispatch based on current row\n */\n float fragV = gl_FragCoord.y;\n if (fragV == DISPLACE_EFFECT_ROW) {\n gl_FragColor = calculateEffectColor(displaceEffectUV, displaceAnimationUV, displaceEffectWaveRepeat, displaceEffectWaveTarget, displaceEffectWaveReduction);\n } else if (fragV == DISPLACE_ANIMATION_ROW) {\n gl_FragColor = calculateAnimationColor(displaceAnimationUV, displaceAnimationLoopDelay, displaceAnimationLoopDurationMultiplier);\n } else if (fragV == NOISE_EFFECT_ROW) {\n gl_FragColor = calculateEffectColor(noiseEffectUV, noiseAnimationUV, noiseEffectWaveRepeat, noiseEffectWaveTarget, noiseEffectWaveReduction);\n } else if (fragV == NOISE_ANIMATION_ROW) {\n gl_FragColor = calculateAnimationColor(noiseAnimationUV, noiseAnimationLoopDelay, noiseAnimationLoopDurationMultiplier);\n } else if (fragV == MOSAIC_EFFECT_ROW) {\n gl_FragColor = calculateEffectColor(mosaicEffectUV, mosaicAnimationUV, mosaicEffectWaveRepeat, mosaicEffectWaveTarget, mosaicEffectWaveReduction);\n } else if (fragV == MOSAIC_ANIMATION_ROW) {\n gl_FragColor = calculateAnimationColor(mosaicAnimationUV, mosaicAnimationLoopDelay, mosaicAnimationLoopDurationMultiplier);\n } else {\n gl_FragColor = texture2D(tGPUData, vec2(uvU, gl_FragCoord.y / resolution.y));\n }\n}\n",i),a.current.material.needsUpdate=!0,r.current.setVariableDependencies(a.current,[a.current]),o.current=a.current.material.uniforms,o.current.delta=new c.nc$(0),o.current.numTextureRows=new c.nc$(6),o.current.displaceEffectWaveRepeat=new c.nc$(4),o.current.displaceEffectWaveTarget=new c.nc$(.1),o.current.displaceEffectWaveReduction=new c.nc$(.6),o.current.displaceAnimationLoopDelay=new c.nc$(4),o.current.displaceAnimationLoopDurationMultiplier=new c.nc$(1.5),o.current.noiseEffectWaveRepeat=new c.nc$(4),o.current.noiseEffectWaveTarget=new c.nc$(.1),o.current.noiseEffectWaveReduction=new c.nc$(.6),o.current.noiseAnimationLoopDelay=new c.nc$(4),o.current.noiseAnimationLoopDurationMultiplier=new c.nc$(1.5),o.current.mosaicEffectWaveRepeat=new c.nc$(1),o.current.mosaicEffectWaveTarget=new c.nc$(.5),o.current.mosaicEffectWaveReduction=new c.nc$(0),o.current.mosaicAnimationLoopDelay=new c.nc$(4),o.current.mosaicAnimationLoopDurationMultiplier=new c.nc$(1);let s=r.current.init();null!==s&&console.error(s),i.dispose(),n.current=!0},render:e=>{!n.current||(i.current+=e,i.current<s||(o.current.delta.value=i.current,i.current=0,r.current.compute()))},prime:()=>{n.current&&(o.current.delta.value=s,i.current=0,r.current.compute())},getTexture:()=>n.current?r.current.getCurrentRenderTarget(a.current).texture:null,dispose:()=>{r.current?.dispose(),r.current=null,n.current=!1}}})({gl:(0,P.C)(e=>e.gl)}),ei=(0,u.useRef)(!1),es=(0,u.useMemo)(()=>
100{if(0===q.x||0===q.y)return{width:0,height:0};let e=q.x/q.y;if(void 0!==v&&void 0!==x)return{width:Math.max(Math.round(v),2),height:2};if(void 0!==v){let t=Math.max(Math.round(v),2),n=Math.max(Math.round(t/e),2);return{width:t,height:n}}if(void 0!==x){let t=Math.max(Math.round(x),2);return{width:Math.max(Math.round(t*e),2),height:t}}let t=Math.max(Math.ceil(q.y/10),3),n=q.y/t;return{width:Math.max(Math.ceil(q.x/n),3),height:t}},[q,v,x]),el=()=>{if(!X.current||0===q.x||0===q.y)return;let e=es.width,t=es.height;X.current.uniforms.tDisplace.value?.dispose(),X.current.uniforms.tMosaic.value?.dispose(),X.current.uniforms.tDisplace.value=L(e,t,{min:.02,max:.04},{min:-Math.PI,max:Math.PI},{min:0,max:1}),X.current.uniforms.tDisplace.value.needsUpdate=!0,X.current.uniforms.displaceResolution.value.set(e,t),X.current.uniforms.tMosaic.value=z(e,t,{min:0,max:.5},{min:0,max:.5},{min:.1,max:.3},.1),X.current.uniforms.tMosaic.value.needsUpdate=!0,X.current.uniforms.mosaicResolution.value.set(e,t)},eu=()=>{!eo.isReady.current||X.current&&(eo.prime(),ei.current=!0,X.current.uniforms.idleGlitchActive.value=1,X.current.uniforms.tGPUData.value=eo.getTexture())},ec=()=>{ei.current=!1,X.current&&(X.current.uniforms.idleGlitchActive.value=0)},[ef,ed]=(0,w.zh)(()=>({from:{progress:0},onStart:()=>{X.current&&(el(),"present"===en.current?Q.current?.():"dismiss"===en.current&&J.current?.())},onChange:e=>{if(!X.current)return;let t=e.value.progress;X.current.uniforms.displaceProgress.value=t,X.current.uniforms.noiseProgress.value=t,X.current.uniforms.mosaicProgress.value=t,X.current.uniforms.opacity.value=t,X.current.uniforms.displaceRotation.value+=er},onRest:e=>{if(!X.current)return;let t=X.current.uniforms.opacity.value;1===t&&"present"===en.current?(en.current="idle",K.current?.(),ea.current&&eu()):0===t&&"dismiss"===en.current&&(en.current="idle",ee.current?.())}}),[]),[em,ep]=(0,w.zh)(()=>({from:{progress:0},onStart:()=>{el()},onChange:e=>{if(!X.current)return;let t=e.value.progress;X.current.uniforms.displaceProgress.value=t,X.current.uniforms.noiseProgress.value=t,X.current.uniforms.mosaicProgress.value=t,X.current.uniforms.opacity.value=t,X.current.uniforms.displaceRotation.value+=er}}),[]),eh=()=>{if(0===q.x||0===q.y){let e=new c.Pq0;Y.current?.computeBoundingBox(),Y.current?.boundingBox?.getSize(e);let t=new c.I9Y(e.x,e.y);return new c.I9Y(t.x*W.current,t.y*W.current)}return new c.I9Y(q.x*W.current,q.y*W.current)},eg=()=>H.current.position,ev=e=>{H.current.position.set(e.x,e.y,e.z)},ex=e=>{Y.current.text=e,Y.current.attributes.position.needsUpdate=!0},ey=()=>Y.current.text,ew=(e,t)=>{ec();let n="number"==typeof e?e:c.cj9.randFloat(e.min,e.max),r="number"==typeof t?t:c.cj9.randFloat(t.min,t.max);return ep.stop(!0),en.current="present",ed.stop(!0),ed.start({from:{progress:ef.progress},to:{progress:1},delay:r,config:{duration:n,easing:w.le.linear}}),r+n},eR=(e,t)=>{ec(),ep.stop(!0),en.current="dismiss";let n="number"==typeof e?e:c.cj9.randFloat(e.min,e.max),r="number"==typeof t?t:c.cj9.randFloat(t.min,t.max);return ed.stop(!0),ed.start({from:{progress:ef.progress},to:{progress:0},delay:r,config:{duration:n,easing:w.le.linear}}),r+n},eC=(e,t)=>{ec();let n="number"==typeof e?e:c.cj9.randFloat(e.min,e.max),r="number"==typeof t?t:c.cj9.randFloat(t.min,t.max);ep.stop(!0),ep.start({from:{progress:0},to:{progress:1},delay:r,config:{duration:n,easing:w.le.linear},onRest:()=>{ea.current&&"idle"===en.current&&eu()}})},eb=()=>{en.current="idle",ed.stop(!0),ec()};return(0,u.useEffect)(()=>()=>{ec(),eo.dispose(),ed.stop(!0),ep.stop(!0),X.current?.uniforms.tDisplace?.value?.dispose(),X.current?.uniforms.tMosaic?.value?.dispose(),o?.dispose(),X.current?.dispose(),Y.current?.dispose(),H.current?.geometry?.dispose(),Array.isArray(H.current?.material)?H.current?.material.forEach(e=>e.dispose()):H.current?.material&&H.current?.material.dispose(),H.current?.remove()},[]),(0,u.useEffect)(()=>{let e,t;a&&o&&(e=new c.Pq0,Y.current.computeBoundingBox(),Y.current.boundingBox?.getSize(e),Z(t=new c.I9Y(e.x,e.y)),o.generateMipmaps=!1,o.minFilter=c.k6q,o.magFilter=c.k6q,o.needsUpdate=!0,X.current.uniforms.tDiffuse.value=o,X.current.uniforms.diffuseResolution.value=t)},[a,o]),(0,u.useEffect)(()=>{0!==q.x&&0!==q.y&&_&&_()},[q]),(0,u.useEffect)(()=>{0===es.width||0===es.height||X.current&&(X.current.uniforms.displaceResolution.value.set(es.width,es.height),X.current.uniforms.mosaicResolution.value.set(es.width,es.height))},[es]),(0,u.useEffect)(()=>
100{if(0===es.width||0===es.height||!N)return;let e=es.width*es.height;eo.setup(e),X.current&&(X.current.uniforms.gpuDataWidth.value=e,X.current.uniforms.gpuDataNumRows.value=6)},[es,N]),(0,u.useEffect)(()=>{N&&"idle"===en.current&&q.x>0&&q.y>0?eu():ec()},[N,q]),(0,m.Ql)((e,t)=>{ei.current&&(eo.render(t),X.current&&(X.current.uniforms.tGPUData.value=eo.getTexture()))}),(0,u.useImperativeHandle)(t,()=>({...e,...H.current,displayName:"GlitchTextV2",mesh:H.current,textureResolution:q,getBoundingBoxSize:eh,getPosition:eg,setPosition:ev,...f(H),setText:ex,getText:ey,present:ew,dismiss:eR,hover:eC,abort:eb}),[]),(0,l.jsxs)("mesh",{ref:H,layers:g,position:n,scale:$,rotation:[Math.PI,0,0],children:[(0,l.jsx)("textGeometry",{ref:Y,args:[r,{font:a,lineHeight:p,letterSpacing:h??0,width:d,flipY:!0}]}),(0,l.jsx)("shaderMaterial",{ref:X,transparent:void 0===b||b,dithering:void 0===S||S,depthTest:void 0!==T&&T,side:void 0!==M?M:c.hB5,vertexShader:"varying vec2 vUv;\nvarying vec2 vPosition;\n\nvoid main() {\n vUv = uv;\n vPosition = position.xy;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"precision highp float;\n\n/**\n * Definitions of PI and other necessary constants\n */\n#include <common>\n\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_snoise>\n#include <ftmr_math>\n\n/**\n * MSDF font atlas texture\n */\nuniform sampler2D tDiffuse;\n\n/**\n * MSDF font atlas resolution\n */\nuniform vec2 diffuseResolution;\n\n/**\n * MSDF pixel range and atlas texture size for scale-independent antialiasing\n */\nuniform float pxRange;\nuniform vec2 texSize;\nuniform float softness;\n\n/**\n * Displacement map texture and resolution\n */\nuniform sampler2D tDisplace;\nuniform vec2 displaceResolution;\n\n/**\n * Mosaic alpha map texture and resolution\n */\nuniform sampler2D tMosaic;\nuniform vec2 mosaicResolution;\n\n/**\n * Independent progress uniforms\n * displaceProgress: 0 = max distortion, 1 = no distortion\n * noiseProgress: 0 = max noise, 1 = no noise\n * mosaicProgress: 0 = hidden, 1 = fully visible\n */\nuniform float displaceProgress;\nuniform float noiseProgress;\nuniform float noiseReduction;\nuniform float noiseFrequency;\nuniform float mosaicProgress;\n\n/**\n * Global opacity multiplier\n */\nuniform float opacity;\n\n/**\n * RGB shift\n * rgbShiftOffset: per-channel UV offset amounts (r, g, b)\n * rgbShiftAmount: intensity multiplier (0.0 = off, 1.0 = full)\n */\nuniform vec3 rgbShiftOffset;\nuniform float rgbShiftAmount;\n\n/**\n * Displacement rotation angle\n */\nuniform float displaceRotation;\n\n/**\n * Font color\n */\nuniform vec3 color;\nuniform float colorMultiplier;\n\n/**\n * GPU compute data for per-cell idle animation.\n * tGPUData: GPU compute render target texture\n * gpuDataWidth: number of cells (texture width)\n * gpuDataNumRows: number of data rows (texture height)\n * idleGlitchActive: 0.0 = use uniforms, 1.0 = use per-cell GPU data\n */\nuniform sampler2D tGPUData;\nuniform float gpuDataWidth;\nuniform float gpuDataNumRows;\nuniform float idleGlitchActive;\n\n/**\n * UV coordinates passed from the vertex shader\n */\nvarying vec2 vUv;\n\n/**\n * Local-space position for spatial cell indexing.\n * Normalized by diffuseResolution to get [0,1] range.\n */\nvarying vec2 vPosition;\n\n/**\n * ************************************\n * MSDF functions\n * ************************************\n */\n\n/**\n * MSDF: Returns the median of three values.\n * Used to extract the signed distance from an MSDF RGB sample.\n */\nfloat median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n}\n\n/**\n * Computes the screen-space pixel range for scale-independent MSDF antialiasing.\n * Returns at least 1.0 to guarantee smooth edges even at extreme minification.\n */\nfloat screenPxRange() {\n vec2 unitRange = vec2(pxRange) / texSize;\n vec2 screenTexSize = vec2(1.0) / fwidth(vUv);\n return max(0.5 * dot(unitRange, screenTexSize), 1.0);\n}\n\n/**\n * MSDF: Computes a crisp alpha value from an MSDF texture sample.\n */\nfloat msdfAlpha(vec2 uv) {\n vec3 s = texture2D(tDiffuse, uv).rgb;\n float sigDist = median(s.r, s.g, s.b) - 0.5;\n return clamp(sigDist * screenPxRange() * softness + 0.5, 0.0, 1.0);\n}\n\n/**\n * ************************************\n * Glitch effect functions\n * (ported from PortraitTextInstanceFragmentShader)\n * ************************************\n */\n\n/**\n * Computes the spatial cell UV from local-space position.\n * Uses vPosition / diffuseResolution to normalize to [0,1],\n * then maps onto the displaceResolution grid.\n *\n * @return {vec2} Normalized spatial UV in [0,1] range.\n */\nvec2 getSpatialCellUV() {\n return clamp(vPosition / diffuseResolution, 0.0, 1.0);\n}\n\n/**\n * Computes distorted UV coordinates using displacement map and simplex noise.\n * When idleGlitchActive, reads per-cell displaceProgress, displaceRotation,\n * noiseProgress, and noiseReduction from tGPUD
100ata instead of uniforms.\n *\n * @param {vec2} diffuseUV - The original UV coordinates.\n * @param {vec2} spatialUV - Normalized spatial UV for cell-based lookups.\n * @param {float} cellU - The U coordinate for GPU data lookup (0 when idle inactive).\n * @return {vec2} The distorted UV coordinates.\n */\nvec2 getGlitchUV(vec2 diffuseUV, vec2 spatialUV, float cellU) {\n /**\n * * Get the displacement color using spatial UV\n */\n vec4 displaceColor = texture2D(tDisplace, spatialUV);\n\n /**\n * * Retrieve the values from the displacement map texture\n */\n float amplitude = displaceColor.x;\n float startRotation = displaceColor.y;\n float seed = displaceColor.z;\n\n /**\n * * Per-cell GPU data or global uniforms\n */\n float localDisplaceProgress = displaceProgress;\n float localDisplaceRotation = displaceRotation;\n float localNoiseProgress = noiseProgress;\n float localNoiseReduction = noiseReduction;\n\n if (idleGlitchActive > 0.5) {\n /**\n * * Row 0: displaceEffect (strength, rotation, -, -)\n */\n vec4 displaceEffectColor = texture2D(tGPUData, vec2(cellU, 0.5 / gpuDataNumRows));\n localDisplaceProgress = displaceEffectColor.x;\n localDisplaceRotation = displaceEffectColor.y;\n\n /**\n * * Row 2: noiseEffect (strength, noiseReduction, -, -)\n */\n vec4 noiseEffectColor = texture2D(tGPUData, vec2(cellU, 2.5 / gpuDataNumRows));\n localNoiseProgress = noiseEffectColor.x;\n localNoiseReduction = noiseEffectColor.y;\n }\n\n /**\n * * Displacement effect\n */\n float displaceStrength = 1.0 - localDisplaceProgress;\n float displaceLength = amplitude * displaceStrength;\n float displaceAngle = startRotation + localDisplaceRotation;\n vec2 displaceOffset = vec2(displaceLength * cos(displaceAngle), displaceLength * sin(displaceAngle));\n\n /**\n * * Simplex noise effect\n */\n float noiseStrength = 1.0 - localNoiseProgress;\n float noiseAspect = diffuseResolution.x / max(diffuseResolution.y, 1.0);\n vec2 noise = vec2(\n snoise3(vec3(0.0, spatialUV.x * noiseFrequency * noiseAspect, seed)) * noiseStrength * localNoiseReduction,\n snoise3(vec3(0.0, spatialUV.y * noiseFrequency, seed)) * noiseStrength * localNoiseReduction\n );\n\n return diffuseUV + quantize(noise, 0.05) + quantize(displaceOffset, 0.05);\n}\n\n/**\n * Computes the mosaic alpha value for per-cell reveal/hide.\n * When idleGlitchActive, reads per-cell mosaicProgress from tGPUData.\n *\n * @param {vec2} spatialUV - Normalized spatial UV for cell-based lookups.\n * @param {float} cellU - The U coordinate for GPU data lookup (0 when idle inactive).\n * @return {float} The mosaic alpha value (0.0 to 1.0).\n */\nfloat getMosaicAlpha(vec2 spatialUV, float cellU) {\n /**\n * * Get the mosaic color using spatial UV\n */\n vec4 mosaicColor = texture2D(tMosaic, spatialUV);\n\n /**\n * * Retrieve the values from the mosaic map texture\n */\n float initial = mosaicColor.x;\n float delay = mosaicColor.y;\n float speed = mosaicColor.z;\n float quantum = mosaicColor.w;\n\n /**\n * * Per-cell GPU data or global uniform\n */\n float localMosaicProgress = mosaicProgress;\n\n if (idleGlitchActive > 0.5) {\n /**\n * * Row 4: mosaicEffect (strength, -, -, -)\n */\n vec4 mosaicEffectColor = texture2D(tGPUData, vec2(cellU, 4.5 / gpuDataNumRows));\n localMosaicProgress = mosaicEffectColor.x;\n }\n\n /**\n * * Calculate the progress of the effect excluding the delay\n */\n float strength = max(localMosaicProgress - delay, 0.0) / (1.0 - delay);\n\n float alpha = linearstep(initial, 1.0, strength);\n return clamp(quantize(alpha, quantum), 0.0, 1.0);\n}\n\n/**\n * ************************************\n * Main\n * ************************************\n */\n\nvoid main() {\n /**\n * * Compute spatial UV and per-cell index from local-space position\n */\n vec2 spatialUV = getSpatialCellUV();\n float cellU = 0.0;\n float cellIndex = 0.0;\n if (idleGlitchActive > 0.5) {\n float cellX = clamp(floor(spatialUV.x * displaceResolution.x), 0.0, displaceResolution.x - 1.0);\n float cellY = clamp(floor(spatialUV.y * displaceResolution.y), 0.0, displaceResolution.y - 1.0);\n cellIndex = cellY * displaceResolution.x + cellX;\n cellU = (cellIndex + 0.5) / gpuDataWidth;\n }\n\n /**\n * * Compute distorted UV\n */\n vec2 glitchUV = getGlitchUV(vUv, spatialUV, cellU);\n\n /**\n * * RGB shift effect\n */\n float shiftR = rgbShiftOffset.r * rgbShiftAmount;\n float shiftG = rgbShiftOffset.g * rgbShiftAmount;\n float shiftB = rgbShiftOffset.b * rgbShiftAmount;
100\n\n float alphaR = msdfAlpha(glitchUV + vec2(shiftR, 0.0));\n float alphaG = msdfAlpha(glitchUV + vec2(shiftG, 0.0));\n float alphaB = msdfAlpha(glitchUV + vec2(shiftB, 0.0));\n\n /**\n * * Apply color\n */\n vec3 applyColor = color.rgb * colorMultiplier;\n\n float finalTextAlpha = max(max(alphaR, alphaG), alphaB);\n /* Straight alpha output: un-premultiply per-channel alpha to avoid\n dark fringes with standard SrcAlpha blending. */\n vec3 finalColor = finalTextAlpha > 0.001 ? vec3(applyColor.r * alphaR, applyColor.g * alphaG, applyColor.b * alphaB) / finalTextAlpha : vec3(0.0);\n\n /**\n * * Mosaic alpha\n */\n float mosaicAlpha = getMosaicAlpha(spatialUV, cellU);\n\n /**\n * * Debug: per-cell color visualization\n */\n #ifdef DEBUG_CELL_COLOR\n if (idleGlitchActive > 0.5) {\n float hue = mod(cellIndex * 0.618033988749895, 1.0);\n float c = 0.8;\n float x = c * (1.0 - abs(mod(hue * 6.0, 2.0) - 1.0));\n vec3 debugColor;\n if (hue < 1.0 / 6.0) debugColor = vec3(c, x, 0.0);\n else if (hue < 2.0 / 6.0) debugColor = vec3(x, c, 0.0);\n else if (hue < 3.0 / 6.0) debugColor = vec3(0.0, c, x);\n else if (hue < 4.0 / 6.0) debugColor = vec3(0.0, x, c);\n else if (hue < 5.0 / 6.0) debugColor = vec3(x, 0.0, c);\n else debugColor = vec3(c, 0.0, x);\n gl_FragColor = vec4(debugColor * (0.4 + 0.6 * finalTextAlpha), 1.0);\n return;\n }\n #endif\n\n /**\n * * Output\n */\n gl_FragColor = vec4(finalColor, finalTextAlpha * mosaicAlpha * opacity);\n}\n",uniforms:et})]})});j.displayName="GlitchTextV2";let $=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.Q1f(I.i.label.bgColor);return{progress:new c.nc$(0),wipeVector:new c.nc$(new c.I9Y),mouseUV:new c.nc$(new c.I9Y),fillColor:new c.nc$(new c.Pq0(e.r,e.g,e.b))}},W=(0,u.forwardRef)((e,t)=>{let{layers:n,renderOrder:r,width:a,height:o,fillColor:i=0xff0000,fillOpacity:s=1,transparent:d=!0,side:m=c.hB5,depthTest:p=!1,dithering:h=!0}=e,g=(0,u.useRef)(null),v=(0,u.useRef)(null),x=(0,u.useRef)(null),[y,w]=(0,u.useState)(a),[R,C]=(0,u.useState)(o),[b,S]=(0,u.useState)(!1),[T,P]=(0,u.useState)(!1),M=(0,u.useRef)(!1),A=(e,t)=>{w(e),C(t)},D=e=>{x.current&&(x.current.opacity=e*s)},_=new c.cZY,I=new c.cZY,E=new c.cZY,U=new c.cZY,O=()=>{let e=g.current.geometry.attributes.position,t=g.current.localToWorld(new c.Pq0().fromBufferAttribute(e,0)),n=g.current.localToWorld(new c.Pq0().fromBufferAttribute(e,1)),r=g.current.localToWorld(new c.Pq0().fromBufferAttribute(e,2)),a=g.current.localToWorld(new c.Pq0().fromBufferAttribute(e,3));return _.set(t,n),I.set(n,a),E.set(a,r),U.set(r,t),[_,I,E,U]},F=(0,u.useMemo)(()=>$(new c.Q1f(i)),[]),N=(0,u.useRef)(new c.I9Y),L=(0,u.useRef)(new c.I9Y),z=(0,u.useRef)(null),V=(0,u.useRef)([]),k=e=>{M.current=e,P(e)},G=e=>{M.current&&(x.current.uniforms.progress.value=e)},B=e=>{let t=new c.I9Y(e.clientX,-e.clientY);if(null!==z.current){let e=t.clone().sub(z.current);V.current.push(e),V.current.length>5&&V.current.shift();let n=new c.I9Y(0,0);for(let e of V.current)n.add(e);n.divideScalar(V.current.length),n.length()>.5&&L.current.copy(n)}z.current=t};return(0,u.useEffect)(()=>(window.addEventListener("mousemove",B),()=>window.removeEventListener("mousemove",B)),[]),(0,u.useEffect)(()=>{b?x.current.uniforms.wipeVector.value=L.current:x.current.uniforms.wipeVector.value=L.current.clone().negate(),x.current.uniforms.mouseUV.value=N.current},[b]),(0,u.useEffect)(()=>{w(a),C(o)},[a,o]),(0,u.useImperativeHandle)(t,()=>({hover:G,progress:x.current.uniforms.progress.value,setHovered:S,setEnabled:k,setSize:A,setWidth:w,setHeight:C,setOpacityRatio:D,...f(g),get
100Segments:O})),(0,l.jsxs)("mesh",{ref:g,layers:n,renderOrder:r,position:[0,0,0],children:[(0,l.jsx)("planeGeometry",{ref:v,args:[y,R]}),(0,l.jsx)("shaderMaterial",{ref:x,transparent:d,dithering:h,depthTest:p,side:m,vertexShader:"// attribute vec2 uv;\n// attribute vec3 position;\n\n// uniform mat4 projectionMatrix;\n// uniform mat4 modelViewMatrix;\n\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"precision highp float;\n\n/// Represents the progress of the wipe effect. 0.0 indicates the effect has not started, 1.0 indicates the effect is complete.\nuniform float progress;\n/// A vector representing the directionVector of the wipe effect. Indicates the UV directionVector in which the effect progresses.\nuniform vec2 wipeVector;\n/// Represents the UV coordinates of the mouse. Normalized coordinates of the mouse position in the range of 0.0 to 1.0.\nuniform vec2 mouseUV;\n/// Represents the fill color of the wipe effect.\nuniform float fillColor;\n/// UV coordinates used in the fragment shader. Represents texture coordinates.\nvarying vec2 vUv;\n\n/// p0_0ã¨p0_1ãçµã¶ç·åã¨ãp1_0ã¨p1_1ãçµã¶ç·åã®äº¤ç¹ãæ±ãã颿°\nvec2 intersectLines(vec2 p0_0, vec2 p0_1, vec2 p1_0, vec2 p1_1) {\n vec2 s1 = p0_1 - p0_0;\n vec2 s2 = p1_1 - p1_0;\n\n float s = (-s1.y * (p0_0.x - p1_0.x) + s1.x * (p0_0.y - p1_0.y)) / (-s2.x * s1.y + s1.x * s2.y);\n float t = (s2.x * (p0_0.y - p1_0.y) - s2.y * (p0_0.x - p1_0.x)) / (-s2.x * s1.y + s1.x * s2.y);\n\n if (s >= 0.0 && s <= 1.0 && t >= 0.0 && t <= 1.0) {\n return vec2(p0_0.x + t * s1.x, p0_0.y + t * s1.y);\n }\n return vec2(-1.0, -1.0);\n}\n\n/// ç¹pããç·ås0ã¨s1ã®åç´è·é¢ãæ±ãã颿°\nfloat perpendicularDistance(vec2 p, vec2 s0, vec2 s1) {\n vec2 lineDir = s1 - s0;\n vec2 perpDir = vec2(-lineDir.y, lineDir.x);\n vec2 toPoint = p - s0;\n float t = dot(toPoint, lineDir) / dot(lineDir, lineDir);\n vec2 projection = s0 + t * lineDir;\n return length(p - projection);\n}\n\nvoid main(void ) {\n /// Represents the maximum opacity of the wipe effect. Usually set to 0.5 to make the effect semi-transparent at the start.\n float maxAlpha = 0.25;\n /// Represents the minimum opacity of the wipe effect. Usually set to 0.0 to make the effect completely transparent at the start.\n float minAlpha = 0.0;\n\n /// ã¨ãã§ã¯ããå®äºãã¦ããå ´åã¯ãalphaå¤ãåºå®\n if (progress >= 1.0) {\n gl_FragColor = vec4(1.0, 1.0, 1.0, maxAlpha);\n return;\n } else if (progress <= 0.0) {\n gl_FragColor = vec4(1.0, 1.0, 1.0, minAlpha);\n return;\n }\n\n /// ãã¹ã¯ã®æ¹åãã¯ãã«\n vec2 directionVector = normalize(wipeVector);\n\n /// ãã¹ã¯ã®å¢çç·ã«å¯¾ããåç´ãã¯ãã«\n vec2 perpendicularVector = vec2(-directionVector.y, directionVector.x);\n\n /// `mouseUV`ãã`directionVector`æ¹åã«ä¼¸ã°ããç´ç·ã¨ãuv座æ¨ç³»ç«¯é¨ã®å4辺ã¨äº¤å·®ããç¹ãæ±ãããã®ä¸ã§æãè·é¢ã®çãç¹`closestIntersectionPoint`ãæ±ãã\n vec2 vert[4];\n vert[0] = vec2(0.0, 1.0); /// uv top-left point\n vert[1] = vec2(1.0, 1.0); /// uv top-right point\n vert[2] = vec2(1.0, 0.0); /// uv bottom-right point\n vert[3] = vec2(0.0, 0.0); /// uv bottom-left point\n vec2 closestIntersectionPoint = vec2(-1.0, -1.0);\n float minIntersectionDistance = 10000.0; // 大ããªå¤ã§åæå\n vec2 mouseSegmentBegin = mouseUV - directionVector * 10000.0;\n vec2 mouseSegmentEnd = mouseUV + directionVector * 10000.0;\n vec2 intersections[4];\n intersections[0] = intersectLines(mouseSegmentBegin, mouseSegmentEnd, vert[0] + vec2(-1000.0, 0.0), vert[1] + vec2(1000.0, 0.0)); /// top segment\n intersections[1] = intersectLines(mouseSegmentBegin, mouseSegmentEnd, vert[1] + vec2(0.0, 1000.0), vert[2] + vec2(0.0, -1000.0)); /// right segment\n intersections[2] = intersectLines(mouseSegmentBegin, mouseSegmentEnd, vert[2] + vec2(1000.0, 0.0), vert[3] + vec2(-1000.0, 0.0)); /// bottom segment\n intersections[3] = intersectLines(mouseSegmentBegin, mouseSegmentEnd, vert[3] + vec2(0.0, -1000.0), vert[0] + vec2(0.0, 1000.0)); /// left segment\n for (int i = 0; i < 4;
100 i++) {\n vec2 intersection = intersections[i];\n if (intersection.x != -1.0 && intersection.y != -1.0) {\n float distanceToIntersection = distance(mouseUV, intersection);\n if (distanceToIntersection < minIntersectionDistance) {\n closestIntersectionPoint = intersection;\n minIntersectionDistance = distanceToIntersection;\n }\n }\n }\n\n /// `closestIntersectionPoint`ãã`directionVector`æ¹åã«ä¼¸ã°ããç·åã¨ãUV座æ¨ã®å4é ç¹`vertices`ãã`perpendicularVector`æ¹åã«ä¼¸ã°ããç·åã¨ã®äº¤ç¹ãæ±ãã\n /// ãã®ä¸ãã`directionVector`æ¹åã«å¯¾ãã¦ãæãè² ã®æ¹åã«ããç¹ã`wipeBeginBoundaryPoint`ãæãæ£ã®æ¹åã«ããç¹`wipeEndBoundaryPoint`ã¨ãã¦å®ç¾©ãã\n vec2 wipeBeginBoundaryPoint = vec2(-1.0, -1.0);\n vec2 wipeEndBoundaryPoint = vec2(-1.0, -1.0);\n vec2 directionSegmentBegin = closestIntersectionPoint - directionVector * 1000.0;\n vec2 directionSegmentEnd = closestIntersectionPoint + directionVector * 1000.0;\n float minDistanceToIntersection = 10000.0; /// 大ããªå¤ã§åæå\n float maxDistanceToIntersection = -1.0; /// å°ããªå¤ã§åæå\n for (int i = 0; i < 4; i++) {\n vec2 perpendicularBeginPoint = vert[i] - perpendicularVector * 1000.0; /// perpendicularVector from vert[i]\n vec2 perpendicularEndPoint = vert[i] + perpendicularVector * 1000.0; /// perpendicularVector to vert[i]\n vec2 perpendicularIntersection = intersectLines(directionSegmentBegin, directionSegmentEnd, perpendicularBeginPoint, perpendicularEndPoint);\n if (perpendicularIntersection.x != -1.0 && perpendicularIntersection.y != -1.0) {\n float distanceToIntersection = dot(perpendicularIntersection - closestIntersectionPoint, directionVector);\n if (distanceToIntersection < minDistanceToIntersection) {\n wipeBeginBoundaryPoint = perpendicularIntersection;\n minDistanceToIntersection = distanceToIntersection;\n }\n if (distanceToIntersection > maxDistanceToIntersection) {\n wipeEndBoundaryPoint = perpendicularIntersection;\n maxDistanceToIntersection = distanceToIntersection;\n }\n }\n }\n\n /// `wipeBeginBoundaryPoint`ãéå§ç¹ã¨ãã`wipeEndBoundaryPoint`ãçµäºç¹ã¨ããç·åã«å¯¾ãã`progress`ã®æ¯çã«å¿ãããã¹ã¯å¤å®ã®å¢çç¹ã¨ãªãç¹`wipeProgressBoundaryPoint`ãæ±ãã\n vec2 wipeProgressBoundaryPoint = mix(wipeBeginBoundaryPoint, wipeEndBoundaryPoint, progress); /// ç·åã®å
åç¹\n vec2 wipeProgressBoundarySegmentBegin = wipeProgressBoundaryPoint + perpendicularVector; /// ç·åã®å
åç¹ããæ£æ¹åã«åç´ãã¯ãã«ã伸ã°ããç¹\n vec2 wipeProgressBoundarySegmentEnd = wipeProgressBoundaryPoint - perpendicularVector; /// ç·åã®å
åç¹ããè² æ¹åã«åç´ãã¯ãã«ã伸ã°ããç¹\n\n vec2 wipeBeginBoundarySegmentBegin = wipeBeginBoundaryPoint + perpendicularVector; /// ç·åã®å§ç¹ããæ£æ¹åã«åç´ãã¯ãã«ã伸ã°ããç¹\n vec2 wipeBeginBoundarySegmentEnd = wipeBeginBoundaryPoint - perpendicularVector; /// ç·åã®å§ç¹ããè² æ¹åã«åç´ãã¯ãã«ã伸ã°ããç¹\n\n float uvDistance = perpendicularDistance(vUv, wipeBeginBoundarySegmentBegin, wipeBeginBoundarySegmentEnd); /// ç·åã®å§ç¹ããè² æ¹åã«åç´ãã¯ãã«ã伸ã°ããç¹ã¨ãç·åã®å§ç¹ããæ£æ¹åã«åç´ãã¯ãã«ã伸ã°ããç¹ã¨ã®è·é¢\n\n float totalDistance = distance(wipeBeginBoundaryPoint, wipeEndBoundaryPoint); /// ç·åã®å§ç¹ããçµç¹ã¾ã§ã®è·é¢\n float progressDistance = distance(wipeBeginBoundaryPoint, wipeProgressBoundaryPoint); /// ç·åã®å§ç¹ãããã¹ã¯å¤å®ã®å¢çç¹ã¾ã§ã®è·é¢\n\n float alpha = 0.0;
100\n if (progressDistance < uvDistance) {\n alpha = minAlpha;\n } else {\n alpha = maxAlpha;\n }\n\n /// Edge AA â 1px soft fade at geometry boundary\n float aaX = fwidth(vUv.x) * 1.5;\n float aaY = fwidth(vUv.y) * 1.5;\n float edgeAA = smoothstep(0.0, aaX, vUv.x) * smoothstep(0.0, aaX, 1.0 - vUv.x) * smoothstep(0.0, aaY, vUv.y) * smoothstep(0.0, aaY, 1.0 - vUv.y);\n alpha *= edgeAA;\n\n /// Set the fragment color\n gl_FragColor = vec4(1.0, 1.0, 1.0, alpha);\n}\n",uniforms:F})]})});W.displayName="HoverableRectangle";let H=(0,u.forwardRef)((e,t)=>{let{layers:n,radius:r=10,startAngle:a=0,thickness:o=2,lineColor:i=0xff0000,lineOpacity:s=1,lineWidth:f=1,transparent:d=!0,depthTest:m=!1}=e,p=(0,u.useRef)(null),h=(0,u.useRef)(null),g=(0,u.useMemo)(()=>{if(o>=2*r)throw Error("Thickness must be less than radius * 2");let e=new c.wAk,t=o/2,n=new c.dwI().makeRotation(a*Math.PI/180),i=[new c.I9Y(-t,-r),new c.I9Y(t,-r),new c.I9Y(t,-t),new c.I9Y(r,-t),new c.I9Y(r,t),new c.I9Y(t,t),new c.I9Y(t,r),new c.I9Y(-t,r),new c.I9Y(-t,t),new c.I9Y(-r,t),new c.I9Y(-r,-t),new c.I9Y(-t,-t)];i.forEach(e=>e.applyMatrix3(n));for(let t=0;t<i.length;t++){let n=i[t].x,r=i[t].y;0===t?e.moveTo(n,r):e.lineTo(n,r)}return e.closePath(),new Float32Array(e.getPoints().flatMap(e=>[e.x,e.y,0]))},[r,a,o]),v=(0,u.useCallback)(e=>{h.current.opacity=e*s},[]);return(0,u.useImperativeHandle)(t,()=>({setOpacityRatio:v,position:p.current.position}),[]),(0,u.useEffect)(()=>()=>void(p.current?.geometry?.dispose(),p.current?.removeFromParent()),[]),(0,u.useEffect)(()=>{p.current&&n&&(p.current.layers.set(n),p.current.position.needsUpdate=!0)},[n]),(0,u.useEffect)(()=>{(()=>{if(!p.current)return;let e=new c.LoY;e.setAttribute("position",new c.THS(g,3)),p.current.geometry.dispose(),p.current.geometry=e,p.current.geometry.computeBoundingSphere()})()},[g]),(0,l.jsxs)("line",{ref:p,children:[(0,l.jsx)("bufferGeometry",{attach:"geometry",children:(0,l.jsx)("bufferAttribute",{attach:"attributes-position",args:[g,3],count:g.length/3})}),(0,l.jsx)("lineBasicMaterial",{ref:h,color:i,opacity:0,transparent:d,linewidth:f,depthTest:m})]})}),Y=(0,u.forwardRef)((e,t)=>{let{layers:n,radius:r=10,startAngle:a=90,segments:o=3,lineColor:i=0xff0000,lineOpacity:s=0,lineWidth:f=1,transparent:d=!0,depthTest:m=!1,side:p=c.$EB}=e,h=(0,u.useRef)(null),g=(0,u.useRef)(null),v=(0,u.useMemo)(()=>{let e=new c.wAk,t=new c.I9Y(0,0),n=360/o;for(let i=0;i<o;i++){let o=(i*n+a)*S.V$,s=t.x+r*Math.cos(o),l=t.y+r*Math.sin(o);0===i?e.moveTo(s,l):e.lineTo(s,l)}return e.closePath(),new Float32Array(e.getPoints().flatMap(e=>[e.x,e.y,0]))},[r,a,o]),x=(0,u.useCallback)(e=>{g.current.opacity=e*s},[]);return(0,u.useImperativeHandle)(t,()=>({setOpacityRatio:x,position:h.current.position}),[]),(0,u.useEffect)(()=>()=>void(h.current?.geometry?.dispose(),h.current?.removeFromParent()),[]),(0,u.useEffect)(()=>{h.current&&n&&(h.current.layers.set(n),h.current.position.needsUpdate=!0)},[n]),(0,u.useEffect)(()=>{(()=>{if(!h.current)return;let e=new c.LoY;e.setAttribute("position",new c.THS(v,3)),h.current.geometry.dispose(),h.current.geometry=e,h.current.geometry.computeBoundingSphere()})()},[v]),(0,l.jsxs)("line",{ref:h,children:[(0,l.jsx)("bufferGeometry",{attach:"geometry",children:(0,l.jsx)("bufferAttribute",{attach:"attributes-position",args:[v,3],count:v.length/3})}),(0,l.jsx)("lineBasicMaterial",{ref:g,color:i,opacity:0,transparent:d,linewidth:f,depthTest:m,side:p})]})});var X=n(2310);let q=(0,u.forwardRef)((e,t)=>{let{layers:n,renderOrder:r,label:a,buttonWidth:o,buttonHeight:i,fontSize:s,hoverGlitchDuration:c=600,hoverWipeDuration:f=100,isActive:d=!1,idleGlitch:m,onHoverStart:p,onHoverEnd:h,onClick:g}=e,{fonts:v}=(0,u.useContext)(X.DM),x=(0,u.useRef)(null),y=(0,u.useRef)(null),R=(0,u.useRef)(!1),C=(0,u.useRef)(d);C.current=d;let[b,S]=(0,u.useState)(!1),[T,P]=(0,w.zh)(()=>({from:{progress:0},onChange:e=>{y.current?.hover(e.value.progress)}}),[]),M=(e,t)=>{x.current?.present(e,t),y.current?.setEnabled(!0),R.current=!0},A=(e,t)=>{x.current?.dismiss(e,t),P.stop(!0),P.start({from:{progress:T.progress},to:{progress:0},config:{duration:.1*e,easing:w.le.linear},onRest:()=>{y.current?.setHovered(!1),y.current?.setEnabled(!1),R.current=!1}})},D=e=>{R.current=e,y.current?.setEnabled(e)},_=e=>{C.current=e};(0,u.useEffect)(()=>{y.current&&x.current&&(y.current.setHovered(b),b?(x.current.hover(c,0),P.stop(!0),P.start({from:{progress:T.progress},to:{progress:1},config:{duration:f,easing:w.le.linear}})):(P.stop(!0),P.start({from:{progress:T.progress},to:{progress:0},config:{duration:f,easing:w.le.linear}})))},[b]),(0,u.useEffect)(()=>{d&&b&&(S(!1),document.body.style.cursor="auto")},[d,b]),(0,u.useImperativeHandle)(t,()=>
100({present:M,dismiss:A,setEnabled:D,setActive:_}));let E=(0,u.useRef)(null);return(0,u.useEffect)(()=>{void 0!==r&&E.current&&E.current.traverse(e=>{e.isMesh&&(e.renderOrder=r)})},[r]),v.USansRgBd&&(0,l.jsxs)("group",{ref:E,children:[(0,l.jsxs)("mesh",{layers:n,onClick:e=>{R.current&&!C.current&&(S(!1),document.body.style.cursor="auto",g())},onPointerOver:e=>{R.current&&!C.current&&(S(!0),document.body.style.cursor="pointer",p())},onPointerOut:e=>{R.current&&!C.current&&(S(!1),document.body.style.cursor="auto",h())},children:[(0,l.jsx)("planeGeometry",{args:[o,i]}),(0,l.jsx)("meshBasicMaterial",{opacity:0,transparent:!0,depthTest:!1})]}),(0,l.jsx)(j,{ref:x,layers:n,gridY:3,noiseFrequency:.1,text:a,fontFile:v.USansRgBd.fontFile,fontTexture:v.USansRgBd.fontTexture,fontSize:s,colorMultiplier:1,idleGlitch:m,idleGlitchDuration:{min:500,max:900},idleGlitchInterval:{min:1500,max:3500},onInitialized:()=>{let e=x.current?.getBoundingBoxSize();e&&x.current?.setPositionXYZ(-e.x/2+1,e.y/2+2,4)},depthTest:!1}),(0,l.jsx)(W,{ref:y,layers:n,width:o,height:i,fillColor:I.i.label.hoverColor,fillOpacity:I.i.label.hoverOpacity})]})});q.displayName="SelectorButton";let Z=` 101 varying vec2 vLocalPos; 102 void main() { 103 vLocalPos = position.xy; 104 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 105 } 106`,Q=` 107 uniform float uTotalWidth; 108 uniform float uTotalHeight; 109 uniform float uCellWidth; 110 uniform float uColumnCount; 111 uniform float uLineWidthPx; 112 uniform vec3 uColor; 113 uniform float uOpacity; 114 varying vec2 vLocalPos; 115 116 float rectSDF(vec2 p, vec2 halfSize) { 117 vec2 d = abs(p) - halfSize; 118 return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); 119 } 120 121 float segDist(vec2 p, vec2 a, vec2 b) { 122 vec2 pa = p - a; 123 vec2 ba = b - a; 124 float h = clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0); 125 return length(pa - ba * h); 126 } 127 128 void main() { 129 if (uOpacity <= 0.0) discard; 130 131 vec2 p = vLocalPos; 132 float halfW = uTotalWidth * 0.5; 133 float halfH = uTotalHeight * 0.5; 134 135 float pxSize = max(fwidth(vLocalPos.x), fwidth(vLocalPos.y)); 136 float halfLineWidth = pxSize * uLineWidthPx * 0.5; 137 138 float outerDist = abs(rectSDF(p, vec2(halfW, halfH))) - halfLineWidth; 139 float d = outerDist; 140 141 for (int i = 1; i < 16; i++) { 142 if (float(i) >= uColumnCount) break; 143 float lineX = -halfW + uCellWidth * float(i); 144 float dividerDist = segDist(p, vec2(lineX, -halfH + halfLineWidth), vec2(lineX, halfH - halfLineWidth)) - halfLineWidth; 145 d = min(d, dividerDist); 146 } 147 148 float aaWidth = pxSize * 0.4; 149 float alpha = 1.0 - smoothstep(0.0, aaWidth, d); 150 alpha *= uOpacity; 151 if (alpha < 0.01) discard; 152 153 gl_FragColor = vec4(uColor, alpha); 154 } 155`,K=(0,u.forwardRef)((e,t)=>{let{layers:n,renderOrder:r,cellWidth:a,cellHeight:o,columnCount:i,lineWidthPx:s=1,strokeColor:f=I.i.label.outlineColor,strokeOpacity:d=I.i.label.outlineOpacity}=e,p=a*i,h=p+24,g=o+24,v=(0,u.useRef)({uTotalWidth:new c.nc$(p),uTotalHeight:new c.nc$(o),uCellWidth:new c.nc$(a),uColumnCount:new c.nc$(i),uLineWidthPx:new c.nc$(s),uColor:new c.nc$(new c.Q1f(f)),uOpacity:new c.nc$(0)}),x=(0,m.RV)(v);(0,u.useMemo)(()=>{v.current.uTotalWidth.value=p,v.current.uTotalHeight.value=o,v.current.uCellWidth.value=a,v.current.uColumnCount.value=i,v.current.uLineWidthPx.value=s,v.current.uColor.value.setHex(f)},[p,o,a,i,s,f]);let y=e=>{v.current.uOpacity.value=e*d};return(0,u.useImperativeHandle)(t,()=>({setOpacityRatio:y})),(0,l.jsxs)("mesh",{layers:n,renderOrder:r,children:[(0,l.jsx)("planeGeometry",{args:[h,g]}),(0,l.jsx)("shaderMaterial",{ref:x,transparent:!0,depthTest:!1,depthWrite:!1,vertexShader:Z,fragmentShader:Q,uniforms:v.current})]})});K.displayName="SelectorOutlineGrid";let J=(0,u.forwardRef)((e,t)=>{let{layers:n,renderOrder:r,bracketWidth:a,bracketHeight:o,bracketLength:i,initialX:s,slideDuration:c=200,bracketColor:f=I.i.label.bracketColor,bracketOpacity:m=I.i.label.bracketOpacity}=e,p=(0,u.useRef)(null),h=(0,u.useRef)(null),[,g]=(0,w.zh)(()=>({from:{x:s},onChange:e=>{p.current&&(p.current.position.x=e.value.x)}})),v=e=>{g.start({to:{x:e},config:{duration:c}})},x=e=>{g.start({to:{x:e},immediate:!0}),p.current&&(p.current.position.x=e)},y=e=>{h.current?.hover(e)},R=e=>{h.current?.setOpacityRatio(e)};return(0,u.useImperativeHandle)(t,()=>({slideTo:v,slideToImmediate:x,hover:y,setOpacityRatio:R})),(0,u.useEffect)(()=>{void 0!==r&&p.current&&p.current.traverse(e=>{e.isMesh&&(e.renderOrder=r)})},[r]),(0,l.jsx)("group",{ref:p,position:[s,0,0],children:(0,l.jsx)(d,{ref:h,layers:n,width:a,height:o,length:i,color:f,opacity:m})})});J.displayName="SelectorSlidingBracket";var ee=n(7936),et=n(8119),en=n(1652),er=n(5206);Array.prototype.shuffle=function(){let e=this.length,t;for(;e;)t=Math.random()*e-->>>0,[this[e],this[t]]=[this[t],this[e]];return this},Array.prototype.pickRandom=function(){if(0===this.length)return;let e=Math.floor(Math.random()*this.length),[t]=this.splice(e,1);return t},Array.prototype.selectRandom=function(){if(0!==this.length)return this[Math.floor(Math.random()*this.length)]};var ea=((s=ea||{}
155).NONE="none",s.PRESENT="present",s.DISMISS="dismiss",s);let eo=new c.Q1f(0,0,0),ei=(0,u.forwardRef)((e,t)=>{let{layers:n,renderOrder:r,position:a,text:o,fontFile:i,fontTexture:s,fontSize:d,fontColor:m=new c.Q1f().setHex(I.i.label.fontColor),labelWidth:p,lineHeight:h,letterSpacing:g,opacity:v,transparent:x,emissive:y,emissiveIntensity:w,dithering:R,depthTest:C,depthWrite:b,blending:S,side:T,softness:P=1,useLight:M=!1,anisotropy:A,minFilter:D,magFilter:_,onInitialized:E,onPresentStart:U,onPresentEnd:O,onDismissStart:F,onDismissEnd:N}=e,L=d/I.i.label.fontBaseLineHeight,z=(0,u.useRef)(L);z.current=L;let V=(0,u.useRef)(null),k=(0,u.useRef)(null),G=(0,u.useRef)(null),B=(0,u.useRef)(null),j=(0,u.useRef)(M?{tDiffuse:new c.nc$(s),pxRange:new c.nc$(i.distanceField?.distanceRange??4),texSize:new c.nc$(new c.I9Y(i.common.scaleW,i.common.scaleH)),softness:new c.nc$(P)}:{tDiffuse:new c.nc$(s),opacity:new c.nc$(v??1),color:new c.nc$(new c.Pq0(m.r,m.g,m.b)),emissive:new c.nc$(new c.Pq0(y?.r??0,y?.g??0,y?.b??0)),emissiveIntensity:new c.nc$(void 0!==w?w:1),pxRange:new c.nc$(i.distanceField?.distanceRange??4),texSize:new c.nc$(new c.I9Y(i.common.scaleW,i.common.scaleH)),softness:new c.nc$(P)}),$=(0,u.useRef)([]),W=(0,u.useCallback)((e,t)=>n=>{$.current[e]||($.current[e]=[]),$.current[e][t]||($.current[e][t]=n)},[]),H=(0,u.useRef)([]),Y=(0,u.useCallback)((e,t)=>n=>{H.current[e]||(H.current[e]=[]),H.current[e][t]||(H.current[e][t]=n)},[]),X=(0,u.useRef)([]),q=(0,u.useCallback)((e,t)=>n=>{n&&(X.current[e]||(X.current[e]=[]),X.current[e][t]||(X.current[e][t]=n))},[]),Z=(0,u.useCallback)(e=>{B.current=e},[]),Q=(0,u.useRef)(new c.M4G),[K,J]=(0,u.useState)(new c.I9Y),[ea,ei]=(0,u.useState)("none"),[es,el]=(0,u.useState)([]),eu=(0,u.useRef)([]);eu.current=es;let[ec,ef]=(0,u.useState)(null),ed=(0,u.useRef)(null),[em,ep]=(0,u.useState)(!1),eh=()=>{if(0===K.x||0===K.y){let e=new c.Pq0;G.current.computeBoundingBox(),G.current.boundingBox?.getSize(e);let t=new c.I9Y(e.x,e.y);return new c.I9Y(t.x*z.current,t.y*z.current)}return new c.I9Y(K.x*z.current,K.y*z.current)},eg=()=>V.current.position,ev=e=>{V.current.position.set(e.x,e.y,e.z)},ex=e=>{G.current.text=e},ey=()=>G.current.text,ew=(0,u.useMemo)(()=>0!==es.length&&i&&s?(0,l.jsx)(l.Fragment,{children:es.map((e,t)=>e.shuffleChars.map((a,o)=>(0,l.jsxs)("mesh",{ref:W(t,o),layers:n,renderOrder:r??0,name:`${t}-${o}-${e.char}-${a}`,position:[e.bottomLeft.x*L,-e.lineY*L,0],scale:L,rotation:[Math.PI,0,0],children:[(0,l.jsx)("textGeometry",{ref:Y(t,o),name:`${t}-${o}-${e.char}-${a}`,args:[a,{font:i,align:et.nO.Center,flipY:!0}]}),M?(0,l.jsx)(ee.A,{ref:q(t,o),name:`${t}-${o}-${e.char}-${a}`,baseMaterial:c._4j,color:m,emissive:y??eo,emissiveIntensity:void 0!==w?w:1,opacity:0,attach:"material",transparent:void 0===x||x,dithering:void 0===R||R,depthTest:void 0!==C&&C,depthWrite:void 0===b||b,blending:void 0!==S?S:c.NTi,side:void 0!==T?T:c.hB5,vertexShader:er.wN,fragmentShader:er.PH,uniforms:{tDiffuse:new c.nc$(s),pxRange:new c.nc$(i.distanceField?.distanceRange??4),texSize:new c.nc$(new c.I9Y(i.common.scaleW,i.common.scaleH)),softness:new c.nc$(P)}}):(0,l.jsx)("shaderMaterial",{ref:q(t,o),name:`${t}-${o}-${e.char}-${a}`,attach:"material",transparent:void 0===x||x,dithering:void 0===R||R,depthTest:void 0!==C&&C,depthWrite:void 0===b||b,blending:void 0!==S?S:c.NTi,side:void 0!==T?T:c.hB5,vertexShader:er.wN,fragmentShader:er.y$,uniforms:{tDiffuse:new c.nc$(s),opacity:new c.nc$(0),color:new c.nc$(new c.Pq0(m.r,m.g,m.b)),emissive:new c.nc$(new c.Pq0(y?.r??0,y?.g??0,y?.b??0)),emissiveIntensity:new c.nc$(void 0!==w?w:1),pxRange:new c.nc$(i.distanceField?.distanceRange??4),texSize:new c.nc$(new c.I9Y(i.common.scaleW,i.common.scaleH)),softness:new c.nc$(P)}})]},(0,en.A)())))}):(0,l.jsx)(l.Fragment,{}),[es,i,s]),eR=(e,t)=>{M?e.opacity=t:e.uniforms.opacity.value=t},eC=(0,u.useRef)(!1),eb=(0,u.useRef)(!1),eS=(e,t)=>{eC.current=!1;let n=0;return eu.current.forEach((r,a)=>{let o=("number"==typeof e?e:c.cj9.randFloat(e.min,e.max))/1e3,i=("number"==typeof t?t:c.cj9.randFloat(t.min,t.max))/1e3;r.transShuffleIndex=0,r.transDirection=1,r.transDuration=o,r.transDelay=i,r.transProgressCurrent=0,r.transProgressPrevious=0,r.transState="wait";let s=o+i;s>n&&(n=s),r.transTimeoutId=setTimeout(()=>{r.transState="progress",eC.current||(U?.(),eC.current=!0)},1e3*r.transDelay)}),ei("present"),ep(!0),1e3*n},eT=(e,t)=>
155{eb.current=!1;let n=0,r=("number"==typeof e?e:c.cj9.randFloat(e.min,e.max))/1e3,a=("number"==typeof t?t:c.cj9.randFloat(t.min,t.max))/1e3,o=eu.current.length,i=r/Math.min(o,4),s=(r-i)/(o-1),l=Array(eu.current.length).fill({duration:0,delay:0});return l.forEach((e,t)=>{e.duration=c.cj9.randFloat(i/2,i),e.delay=a+s*(o-t-1)}),l.shuffle(),eu.current.forEach((e,t)=>{e.transDirection=-1,e.transProgressPrevious=e.transProgressCurrent,e.transState="wait",e.transDuration=l[t].duration,e.transDelay=l[t].delay;let r=e.transDuration+e.transDelay;r>n&&(n=r),e.transTimeoutId=setTimeout(()=>{e.transState="progress",eb.current||(F?.(),eb.current=!0)},1e3*e.transDelay)}),ei("dismiss"),ep(!0),1e3*n},eP=()=>{ei("none")};return(0,u.useEffect)(()=>()=>(()=>{s?.dispose(),G.current?.dispose(),B.current?.dispose(),k.current?.geometry?.dispose(),Array.isArray(k.current?.material)?k.current?.material.forEach(e=>e.dispose()):k.current?.material&&k.current?.material.dispose();for(let e=0;e<$.current.length;e++){let t=$.current[e];for(let e=0;e<t.length;e++)t[e].geometry?.dispose()}k.current?.remove()})(),[]),(0,u.useEffect)(()=>{let e;i&&s&&(e=new c.Pq0,G.current.computeBoundingBox(),G.current.boundingBox?.getSize(e),J(new c.I9Y(e.x,e.y)),A&&(s.anisotropy=A,s.needsUpdate=!0),D&&(s.generateMipmaps=!1,s.minFilter=D,s.needsUpdate=!0),_&&(s.magFilter=_,s.needsUpdate=!0),(()=>{ef(G.current.attributes.uv);let e=G.current.attributes.position.array,t=e.length/8,n=o.replace(/\s/g,"").split(""),r=0,a=0,i=[],s=0,l=0;for(let o=0;o<t;o++){let t=n[o];0===o&&(r=e[8*o+0],a=e[8*o+1],s=e[8*o+3],l=0);let u=e[8*o+3];Math.abs(u-s)>.5*Math.abs(e[8*o+3]-e[8*o+1])&&(s=u,l=e[8*o+1]-a);let f=e[8*o+0]-r,d=e[8*o+1]-a,m=e[8*o+2]-r,p=e[8*o+3]-a,h=e[8*o+4]-r,g=e[8*o+5]-a,v=e[8*o+6]-r,x=e[8*o+7]-a,y=Math.abs(h-f),w=Math.abs(g-d),R=[];t.toUpperCase()===t?R="ABCDEFGHIJKLMNOPQRSTUVWXYZ".replace(t,"").split("").shuffle().slice(0,5):t.toLowerCase()===t&&(R="abcdefhiklmnorstuvwxz".replace(t,"").split("").shuffle().slice(0,5));let C=f+Math.abs(f-h)/2,b=d+Math.abs(d-g)/2,S={index:o,char:n[o],shuffleChars:R,offsetX:r,offsetY:a,lineY:l,bottomLeft:new c.I9Y(f,d),topLeft:new c.I9Y(m,p),topRight:new c.I9Y(h,g),bottomRight:new c.I9Y(v,x),centerX:C,centerY:b,width:y,height:w,transState:"wait",transShuffleIndex:0,transDirection:1,transDuration:0,transProgressCurrent:0,transProgressPrevious:0,transDelay:0,transTimeoutId:null};i.push(S)}el(i)})())},[i,s]),(0,u.useEffect)(()=>{0!==K.x&&0!==K.y&&0!==es.length&&ew&&E&&E()},[K,es,ew]),(0,u.useEffect)(()=>
155(ed.current&&clearInterval(ed.current),em&&(ed.current=setInterval(()=>{Q.current.update(),(e=>{if("none"===ea||!G.current||!B.current||!k.current)return;let t=new Float32Array(2*o.length*4),n=!0;for(let r=0;r<eu.current.length;r++){let a=eu.current[r];if("completed"===a.transState){if("present"===ea)for(let e=0;e<8;e++)t[8*r+e]=ec.array[8*r+e];else if("dismiss"===ea)for(let e=0;e<8;e++)t[8*r+e]=0;continue}if(n=!1,"wait"===a.transState){if("present"===ea)for(let e=0;e<8;e++)t[8*r+e]=0;else if("dismiss"===ea)for(let e=0;e<8;e++)t[8*r+e]=ec.array[8*r+e];continue}let o=e/a.transDuration;a.transProgressCurrent=c.cj9.clamp(a.transProgressCurrent+o*a.transDirection,0,1);let i=a.shuffleChars,s=c.cj9.clamp(a.transProgressCurrent,0,1),l=!0;if("present"===ea?l=a.transProgressCurrent>=a.transProgressPrevious+.02:"dismiss"===ea&&(l=a.transProgressCurrent<=a.transProgressPrevious-.02),l){for(let e=0;e<i.length;e++){let t=X.current[r][e],n=$.current[r][e];e===a.transShuffleIndex?(eR(t,s),n.visible=!0):(eR(t,0),n.visible=!1)}a.transShuffleIndex=4===a.transShuffleIndex?0:a.transShuffleIndex+1,a.transProgressPrevious=a.transProgressCurrent}if("present"===ea&&a.transProgressCurrent>=1?a.transState="completed":"dismiss"===ea&&a.transProgressCurrent<=0&&(a.transState="completed"),"completed"===a.transState){if("present"===ea)for(let e=0;e<8;e++)t[8*r+e]=ec.array[8*r+e];else if("dismiss"===ea)for(let e=0;e<8;e++)t[8*r+e]=0;for(let e=0;e<i.length;e++)eR(X.current[r][e],0),$.current[r][e].visible=!1;k.current.visible=!0}}if(n){ei("none");for(let e=0;e<$.current.length;e++){let t=$.current[e];for(let e=0;e<t.length;e++)t[e].visible=!1}"present"===ea?(k.current.visible=!0,O?.()):"dismiss"===ea&&(k.current.visible=!1,N?.()),ep(!1)}G.current.setAttribute("uv",new c.THS(t,2)),"present"===ea&&eR(B.current,1)})(Q.current.getDelta())})),()=>{ed.current&&clearInterval(ed.current)}),[em]),(0,u.useImperativeHandle)(t,()=>({...e,...V.current,displayName:"ShuffleText",mesh:k.current,textureResolution:K,getBoundingBoxSize:eh,getPosition:eg,setPosition:ev,...f(V),setText:ex,getText:ey,present:eS,dismiss:eT,hover:()=>{},abort:eP}),[]),(0,l.jsxs)("group",{ref:V,layers:n,position:a,children:[(0,l.jsxs)("mesh",{ref:k,layers:n,renderOrder:r??0,scale:L,position:new c.Pq0(0,0,0),rotation:[Math.PI,0,0],visible:!1,children:[(0,l.jsx)("textGeometry",{ref:G,args:[o,{font:i,lineHeight:h,letterSpacing:g??0,width:p,flipY:!0}]}),M?(0,l.jsx)(ee.A,{ref:Z,baseMaterial:c._4j,color:m,emissive:y??eo,emissiveIntensity:void 0!==w?w:1,opacity:v??1,name:"default-msdf-material",attach:"material",transparent:void 0===x||x,dithering:void 0===R||R,depthTest:void 0!==C&&C,depthWrite:void 0!==b&&b,side:void 0!==T?T:c.hB5,vertexShader:er.wN,fragmentShader:er.PH,uniforms:j.current}):(0,l.jsx)("shaderMaterial",{ref:Z,name:"default-msdf-material",attach:"material",transparent:void 0===x||x,dithering:void 0===R||R,depthTest:void 0!==C&&C,depthWrite:void 0!==b&&b,side:void 0!==T?T:c.hB5,vertexShader:er.wN,fragmentShader:er.y$,uniforms:j.current})]}),ew]})});ei.displayName="ShuffleText",(0,u.forwardRef)((e,t)=>{let{layers:n,radius:r=100,segments:a=64,startAngle:o=0,endAngle:i=2*Math.PI,enableLine:s=!0,lineColor:d=0xff0000,lineOpacity:m=1,lineWidth:p=.1,lineStyle:h=x.LINE,lineDashSize:g=10,lineGapSize:v=20,enableFill:y=!0,fillColor:w=65280,fillOpacity:R=1,transparent:C=!0,side:b=c.$EB,depthTest:S=!1,depthWrite:T=!1,stencil:P}=e,M=(0,u.useRef)(null),A=(0,u.useRef)(null),D=(0,u.useRef)(null),_=(0,u.useRef)(null),I=(0,u.useRef)(null),E=(0,u.useRef)(null),U=(0,u.useMemo)(()=>new Float32Array(new c.S20(0,0,r,r,o,i,!0,0).getPoints(a).flatMap(e=>[e.x,e.y,0])),[r,a,o,i]),O=e=>{F(e),N(e)},F=e=>{h===x.LINE&&D.current?(D.current.opacity=e*m,D.current.needsUpdate=!0):h===x.DASHED&&_.current&&(_.current.opacity=e*m,_.current.needsUpdate=!0,A.current.computeLineDistances())},N=e=>{E.current&&(E.current.opacity=e*R,E.current.needsUpdate=!0)},L=(e,t,n)=>void M.current.rotation.set(e,t,n),z=e=>void(M.current.rotation.x=e),V=e=>void(M.current.rotation.y=e),k=e=>void(M.current.rotation.z=e),G=e=>void M.current.scale.set(e,e,e);return(0,u.useEffect)(()=>(O(0),()=>void(A.current?.geometry?.dispose(),A.current?.material?.dispose(),A.current?.remove())),[]),(0,u.useEffect)(()=>{A.current&&n&&A.current.layers.set(n)},[n]),(0,u.useEffect)(()=>{(()=>{if(!A.current)return;let e=new c.LoY;e.setAttribute("position",new c.THS(U,3)),A.current.geometry.dispose(),A.current.geometry=e,A.current.geometry.computeBoundingSphere()})()},[U]),(0,u.useImperativeHandle)(t,()=>({position:M.current.position,rotation:M.current.rotation,scale:M.current.scale,setOpacityRatio:O,setLineOpacityRatio:F,setFillOpacityRatio:N,...f(M),setRotationX:z,setRotationY:V,setRotationZ:k,setRotationXYZ:L,setScale:G}),[]),(0,l.jsxs)("group",{ref:M,layers:n,children:[y&&(0,l.jsxs)("mesh",{ref:I,layers:n,children:[(0,l.jsx)("circleGeometry",{args:[r,a]}),(0,l.jsx)("meshBasicMaterial",{ref:E,color:w,opacity:R,transparent:C,side:b,depthWrite:T,depthTest:S,...P})]}),s&&(0,l.jsxs)("line",{ref:A,children:[(0,l.jsx)("bufferGeometry",{children:(0,l.jsx)("bufferAttribute",{attach:"attributes-position",args:[U,3],count:U.length/3})}
155),h===x.LINE&&(0,l.jsx)("lineBasicMaterial",{ref:D,color:d,opacity:m,transparent:C,linewidth:p,depthWrite:T,depthTest:S,...P}),h===x.DASHED&&(0,l.jsx)("lineDashedMaterial",{ref:_,color:d,opacity:m,linewidth:p,dashSize:g,gapSize:v,transparent:C,depthWrite:T,depthTest:S,...P})]})]})}).displayName="StylableCircle";let es=` 156 varying vec2 vLocalPos; 157 void main() { 158 vLocalPos = position.xy; 159 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 160 } 161`,el=` 162 uniform vec2 uHalfSize; 163 uniform vec3 uColor; 164 uniform float uOpacity; 165 uniform float uLineWidth; 166 varying vec2 vLocalPos; 167 168 void main() { 169 if (uOpacity <= 0.0) discard; 170 171 /* Signed distance to rectangle (negative inside, positive outside). */ 172 vec2 d = abs(vLocalPos) - uHalfSize; 173 float boxSDF = length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); 174 175 /* Pixel size derived from screen-space derivatives of vLocalPos itself. 176 * Avoids two pitfalls of fwidth on the SDF directly: 177 * (a) fwidth(abs(boxSDF)) collapses to ~0 at the rectangle boundary 178 * where the V-shape causes equal-magnitude opposite-side values 179 * in a 2x2 pixel quad â the AA band vanishes there. 180 * (b) fwidth(boxSDF) doubles the gradient magnitude at boundary 181 * quads (sign jump) â line widens to 2x at the very edge, which 182 * reads visually as a soft / blurry rather than crisp stroke. 183 * Using fwidth(vLocalPos.{x,y}) yields robust local-units-per-pixel 184 * scale that is continuous everywhere, including across corners. */ 185 float pxSize = max(fwidth(vLocalPos.x), fwidth(vLocalPos.y)); 186 187 /* Box-filter coverage of the |boxSDF| <= halfWidth band over a 1px 188 * footprint. A pixel-aligned line fills exactly one pixel, and a line 189 * straddling a pixel boundary splits across two pixels, so the total 190 * coverage stays at uLineWidth pixels instead of spreading into a soft 191 * 2-3px fringe on both sides. */ 192 float halfWidth = pxSize * uLineWidth * 0.5; 193 float alpha = clamp((halfWidth - abs(boxSDF)) / pxSize + 0.5, 0.0, 1.0); 194 alpha *= uOpacity; 195 if (alpha < 0.01) discard; 196 197 gl_FragColor = vec4(uColor, alpha); 198 } 199`,eu=(0,u.forwardRef)((e,t)=>{let{layers:n,width:r,height:a,enableLine:o=!0,enableFill:i=!0,lineColor:s=0xff0000,lineOpacity:d=1,lineWidth:p=1,fillColor:h=0xff0000,fillOpacity:g=1,transparent:v=!0,side:x=c.hB5,depthTest:y=!1,depthWrite:w=!1,alphaTest:R=.5}=e,C=(0,u.useRef)(null),b=(0,u.useRef)(null),S=(0,u.useRef)(null),T=(0,u.useRef)(null),[P,M]=(0,u.useState)(r),[A,D]=(0,u.useState)(a),_=(0,u.useMemo)(()=>Math.max(2,p+2),[p]),I=(0,u.useMemo)(()=>new c.bdM(P+2*_,A+2*_),[P,A,_]),E=(0,u.useRef)({uHalfSize:new c.nc$(new c.I9Y(r/2,a/2)),uColor:new c.nc$(new c.Q1f().setHex(s,c.Zr2)),uOpacity:new c.nc$(0),uLineWidth:new c.nc$(p)}),U=(0,m.RV)(E);(0,u.useMemo)(()=>{E.current.uHalfSize.value.set(P/2,A/2)},[P,A]),(0,u.useMemo)(()=>{E.current.uColor.value.setHex(s,c.Zr2),E.current.uLineWidth.value=p},[s,p]);let O=(e,t)=>{M(e),D(t)},F=e=>{E.current.uOpacity.value=e*d,T.current&&(T.current.opacity=e*g)},N=e=>{E.current.uOpacity.value=e*d},L=e=>{T.current&&(T.current.opacity=e*g)},z=new c.cZY,V=new c.cZY,k=new c.cZY,G=new c.cZY,B=()=>{let e=b.current.geometry.attributes.position,t=b.current.localToWorld(new c.Pq0().fromBufferAttribute(e,0)),n=b.current.localToWorld(new c.Pq0().fromBufferAttribute(e,1)),r=b.current.localToWorld(new c.Pq0().fromBufferAttribute(e,2)),a=b.current.localToWorld(new c.Pq0().fromBufferAttribute(e,3));return z.set(t,n),V.set(n,a),k.set(a,r),G.set(r,t),[z,V,k,G]};return(0,u.useEffect)(()=>{C.current&&n&&C.current.layers.set(n)},[n]),(0,u.useEffect)(()=>{M(r),D(a)},[r,a]),(0,u.useEffect)(()=>()=>{I.dispose()},[I]),(0,u.useImperativeHandle)(t,()=>({setSize:O,setWidth:M,setHeight:D,setOpacityRatio:F,setLineOpacityRatio:N,setFillOpacityRatio:L,...f(b),getSegments:B})),(0,l.jsxs)(l.Fragment,{children:[o&&(0,l.jsxs)("mesh",{ref:C,layers:n,renderOrder:1,children:[(0,l.jsx)("primitive",{object:I,attach:"geometry"}),(0,l.jsx)("shaderMaterial",{ref:U,transparent:v,depthTest:y,depthWrite:w,vertexShader:es,fragmentShader:el,uniforms:E.current})]}),i&&(0,l.jsxs)("mesh",{ref:b,layers:n,position:[0,0,0],children:[(0,l.jsx)("planeGeometry",{ref:S,args:[P,A]}),(0,l.jsx)("meshBasicMaterial",{ref:T,color:h,opacity:0,transparent:v,side:x??c.hB5,depthTest:y,depthWrite:w,alphaTest:R,blending:c.bCz,blendEquation:c.gO9,blendSrc:c.qad,blendDst:c.OuU})]})]})});eu.displayName="StylableRectangle"},6382:(e,t,n)=>{n.d(t,{Gf:()=>s,Kt:()=>o,V$:()=>a,ss:()=>i,xx:()=>l,zG:()=>r}),Number.prototype.clamp=function(e,t){return Math.min(Math.max(this.valueOf(),e),t)};let r=180/Math.PI,a=Math.PI/180,o=Math.PI,i=Math.PI/2,s=2*Math.PI,l=(e,t)=>
1991-Math.pow(1-e,60*t)},6673:(e,t,n)=>{n.d(t,{v:()=>i});var r=n(1343),a=n(6065),o=n(8875);let i=()=>{let e,t,n=(0,r.c)(2),[i,s]=(0,a.useState)("unknown");return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{s((0,o.jD)(window.location.hostname))},t=[],n[0]=e,n[1]=t):(e=n[0],t=n[1]),(0,a.useEffect)(e,t),i}},7197:(e,t,n)=>{n.d(t,{kC:()=>h,U$:()=>g,N3:()=>v,Rh:()=>a,Pn:()=>r,vH:()=>s,RJ:()=>i,eI:()=>l,QY:()=>o,Cg:()=>f,Pv:()=>d,Bg:()=>m,Wx:()=>u,Yb:()=>p,lh:()=>c});let r="/* Attributes: per-vertex identifiers for ring buffer lookup */\nattribute float aCurveId;\nattribute float aSlotIndex;\n\n/* Ring buffer texture containing historical positions */\nuniform sampler2D uRingBuffer;\nuniform float uWriteIndex;\nuniform float uHistoryLength;\nuniform float uRingBufferWidth; /* = HISTORY_LENGTH (1024.0) */\nuniform float uRingBufferHeight; /* = CURVE_COUNT (2048.0) */\nuniform float uFadeStart;\n\n/* Per-curve color lookup (256x1 RGB texture) */\nuniform sampler2D uColorMap;\n\nvarying float vAlpha;\nvarying vec3 vColor;\n\n/* Sample a ring buffer slot (wraps around circularly) */\nvec4 sampleSlot(float slot, float curveY) {\n float wrappedSlot = mod(slot, uHistoryLength);\n vec2 uv = vec2((wrappedSlot + 0.5) / uRingBufferWidth, curveY);\n return texture2D(uRingBuffer, uv);\n}\n\n/* Check if a slot is valid (written and not near the write head) */\nbool isSlotValid(float slot, float curveY) {\n vec4 d = sampleSlot(slot, curveY);\n if (d.w == 0.0) return false;\n float dist = abs(mod(slot - uWriteIndex + uHistoryLength * 0.5, uHistoryLength) - uHistoryLength * 0.5);\n return dist >= 3.0;\n}\n\nvoid main() {\n float curveY = (aCurveId + 0.5) / uRingBufferHeight;\n\n /* Look up per-curve color */\n vColor = texture2D(uColorMap, vec2((aCurveId + 0.5) / uRingBufferHeight, 0.5)).rgb;\n\n /* Sample center slot */\n vec4 data = sampleSlot(aSlotIndex, curveY);\n\n /* This slot must be written and away from the write head */\n if (!isSlotValid(aSlotIndex, curveY)) {\n vAlpha = 0.0;\n gl_Position = vec4(0.0, 0.0, -2.0, 1.0);\n return;\n }\n\n /* Both neighbors must also be valid â if either is hidden, this vertex\n would form a GL_LINES segment to (0,0,-2), creating a clipping artifact.\n Use the valid neighbor's position to collapse the line to zero length. */\n bool prevOk = isSlotValid(aSlotIndex - 1.0, curveY);\n bool nextOk = isSlotValid(aSlotIndex + 1.0, curveY);\n\n if (!prevOk && !nextOk) {\n /* Isolated vertex â hide completely */\n vAlpha = 0.0;\n gl_Position = vec4(0.0, 0.0, -2.0, 1.0);\n return;\n }\n\n /* If one neighbor is invalid, snap to the valid neighbor's raw position\n so the line segment to the invalid side degenerates to zero length */\n vec3 basePos;\n if (!prevOk) {\n basePos = sampleSlot(aSlotIndex + 1.0, curveY).xyz;\n } else if (!nextOk) {\n basePos = sampleSlot(aSlotIndex - 1.0, curveY).xyz;\n } else {\n /* --- Smoothing: average position over neighboring ring buffer slots ---\n 9-tap box filter: [i-4..i+4]. Filters out high-frequency boundary oscillation. */\n vec3 sum = data.xyz;\n float count = 1.0;\n\n for (int offset = 1; offset <= 4; offset++) {\n float prevSlot = mod(aSlotIndex - float(offset) + uHistoryLength, uHistoryLength);\n float nextSlot = mod(aSlotIndex + float(offset), uHistoryLength);\n /* Skip if the neighbor would cross the write head (ring discontinuity) */\n bool prevSafe = floor(prevSlot) != floor(uWriteIndex);\n bool nextSafe = floor(nextSlot) != floor(uWriteIndex);\n if (prevSafe) {\n vec4 prev = sampleSlot(prevSlot, curveY);\n if (prev.w > 0.0) {\n sum += prev.xyz;\n count += 1.0;\n }\n }\n if (nextSafe) {\n vec4 next = sampleSlot(nextSlot, curveY);\n if (next.w > 0.0) {\n sum += next.xyz;\n count += 1.0;\n }\n }\n }\n\n basePos = sum / count;\n }\n\n /* Compute age: how many slots behind the write head */\n float age = mod(uWriteIndex - aSlotIndex + uHistoryLength, uHistoryLength);\n float normalizedAge = age / uHistoryLength;\n\n /* Alpha decay: newest = 1.0, fading to 0 at oldest */\n vAlpha = smoothstep(1.0, uFadeStart, normalizedAge);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(basePos, 1.0);\n}\n",a="uniform float uOpacity;\nuniform float uLineAlpha;\n\nvarying float vAlpha;\nvarying vec3 vColor;\n\nvoid main() {\n float a = vAlpha * uOpacity * uLineAlpha;\n if (a < 0.001) discard;\n gl_FragColor = vec4(vColor * uLineAlpha, a);\n}\n",o="attribute float aAlpha;\n\nvarying float vAlpha;\n\nvoid main() {\n vAlpha = aAlpha;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
199);\n}\n",i="attribute float aAlpha;\n\nuniform float uPointSize;\n\nvarying float vAlpha;\n\nvoid main() {\n vAlpha = aAlpha;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = uPointSize;\n}\n",s="uniform vec3 uColor;\nuniform float uOpacity;\nuniform float uDotAlpha;\n\nvarying float vAlpha;\n\nvoid main() {\n float dist = length(gl_PointCoord - vec2(0.5));\n if (dist > 0.5) discard;\n\n /* Soft edge falloff */\n float edge = 1.0 - smoothstep(0.3, 0.5, dist);\n float a = vAlpha * uOpacity * uDotAlpha * edge;\n if (a < 0.001) discard;\n\n gl_FragColor = vec4(uColor * uDotAlpha, a);\n}\n",l="uniform vec3 uColor;\nuniform float uOpacity;\nuniform float uLineAlpha;\n\nvarying float vAlpha;\n\nvoid main() {\n float a = vAlpha * uOpacity * uLineAlpha;\n if (a < 0.001) discard;\n gl_FragColor = vec4(uColor, a);\n}\n",u="attribute float aAlpha;\nattribute vec3 aColor;\nattribute vec3 aNormal;\nattribute vec3 aNoiseParams; /* x=dist*freq, y=phase, z=ampScale */\n\nuniform float uTime;\nuniform float uNoiseAmp;\nuniform float uAnimSpeed;\n\nvarying float vAlpha;\nvarying vec3 vColor;\n\nvoid main() {\n vAlpha = aAlpha;\n vColor = aColor;\n\n float d = aNoiseParams.x;\n float phase = aNoiseParams.y;\n float ampScale = aNoiseParams.z;\n /* Quantize time into discrete frames for flipbook / stop-motion feel */\n float t = floor(uTime * uAnimSpeed);\n\n /* Multi-octave sine noise â redrawn each discrete frame */\n float noise = sin(d * 1.0 + phase + t) * 0.5 + sin(d * 2.3 + phase * 1.7 + t * 1.3) * 0.3 + sin(d * 5.1 + phase * 0.3 + t * 0.7) * 0.2;\n\n vec3 displaced = position + aNormal * noise * uNoiseAmp * ampScale;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(displaced, 1.0);\n}\n",c="uniform float uOpacity;\nuniform float uLineAlpha;\n\nvarying float vAlpha;\nvarying vec3 vColor;\n\nvoid main() {\n float a = vAlpha * uOpacity * uLineAlpha;\n if (a < 0.001) discard;\n gl_FragColor = vec4(vColor * uLineAlpha, a);\n}\n",f="/* ErrorCurvePositionGPGPU.fs â pure Euler integration (boundary handled by velocity spring) */\n\n/* tCurvePosition and tCurveVelocity are injected by GPUComputationRenderer via setVariableDependencies */\nuniform float uDelta;\nuniform vec2 uBBoxMin;\nuniform vec2 uBBoxMax;\nuniform float uExtrudeCenter;\nuniform float uExtrudeDepth;\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n\n vec3 oldPos = texture2D(tCurvePosition, uv).xyz;\n vec3 velocity = texture2D(tCurveVelocity, uv).xyz;\n\n /* NaN guard: reset to bbox center if position is invalid */\n if (any(notEqual(oldPos, oldPos)) || any(notEqual(velocity, velocity))) {\n vec2 center = (uBBoxMin + uBBoxMax) * 0.5;\n gl_FragColor = vec4(center, uExtrudeCenter, 1.0);\n return;\n }\n\n /* Euler integration â no position correction; velocity spring handles boundary */\n vec3 newPos = oldPos + velocity * uDelta;\n\n /* Loose bounding box clamp â safety net only */\n float bboxMargin = 150.0;\n newPos.x = clamp(newPos.x, uBBoxMin.x - bboxMargin, uBBoxMax.x + bboxMargin);\n newPos.y = clamp(newPos.y, uBBoxMin.y - bboxMargin, uBBoxMax.y + bboxMargin);\n newPos.z = clamp(newPos.z, -bboxMargin, uExtrudeDepth + bboxMargin);\n\n gl_FragColor = vec4(newPos, 1.0);\n}\n",d="/* ErrorRingBufferGPGPU.fs â writes current curve positions into the ring buffer */\n/* Standalone ShaderMaterial for a fullscreen quad (NOT a GPUComputationRenderer variable) */\n/* Axis convention: X = time slot (width = HISTORY_LENGTH = 1024), Y = curve ID (height = CURVE_COUNT = 2048) */\n\nuniform sampler2D tCurvePosition;\nuniform sampler2D tRingBuffer;\nuniform float uWriteIndex;\nuniform float uHistoryLength;\nuniform float uCurveCount;\nuniform float uGpuDim;\nuniform vec2 uResolution;\n\nvarying vec2 vUv;\n\nvoid main() {\n /* Determine which history column this fragment belongs to */\n float col = floor(vUv.x * uHistoryLength);\n\n if (col == floor(uWriteIndex)) {\n /* Write column: sample the current position for this curve */\n float curveId = floor(vUv.y * uCurveCount);\n\n /* Map curveId to 2D UV in GPUComputationRenderer texture (GPU_DIM \xd7 GPU_DIM) */\n float gpuX = mod(curveId, uGpuDim);\n float gpuY = floor(curveId / uGpuDim);\n vec2 posUv = vec2((gpuX + 0.5) / uGpuDim, (gpuY + 0.5) / uGpuDim);\n vec3 pos = texture2D(tCurvePosition, posUv).xyz;
199\n\n gl_FragColor = vec4(pos, 1.0);\n } else {\n /* Passthrough: preserve existing ring buffer data */\n gl_FragColor = texture2D(tRingBuffer, vUv);\n }\n}\n",m="/* ErrorCurveRoleGPGPU.fs â manages per-curve role state (interior wandering vs surface following) */\n\n/* tCurveRole is injected by GPUComputationRenderer via setVariableDependencies */\nuniform float uBasePeriod;\nuniform float uPeriodVariance;\nuniform float uTransitionDuration;\nuniform float uDelta;\nuniform float uTime;\n\nfloat hash(float n) {\n return fract(sin(n * 127.1) * 43758.5453);\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 state = texture2D(tCurveRole, uv);\n\n float role = state.r;\n float transition = state.g;\n float timer = state.b;\n\n /* Compute a stable per-curve period using a hash of its ID */\n float curveId = gl_FragCoord.x + gl_FragCoord.y * resolution.x;\n float period = uBasePeriod + hash(curveId) * uPeriodVariance;\n\n /* Increment timer */\n timer += uDelta;\n\n /* Toggle role when the period elapses */\n if (timer >= period) {\n role = 1.0 - role;\n timer = 0.0;\n transition = 0.0;\n }\n\n /* Advance transition progress toward 1.0 */\n transition = min(transition + uDelta / uTransitionDuration, 1.0);\n\n gl_FragColor = vec4(role, transition, timer, 1.0);\n}\n",p="/* ErrorCurveVelocityGPGPU.fs â computes curve velocity based on role (interior wandering or surface following) */\n\n/* tCurvePosition, tCurveVelocity, tCurveRole are injected by GPUComputationRenderer via setVariableDependencies */\nuniform sampler2D uSdf2D;\nuniform float uInteriorSpeed;\nuniform float uSurfaceSpeed;\nuniform float uNoiseInfluence;\nuniform float uSurfaceNoise;\nuniform float uExtrudeCenter;\nuniform float uExtrudeDepth;\nuniform vec2 uBBoxMin;\nuniform vec2 uBBoxMax;\nuniform float uSdfPad;\nuniform float uDelta;\nuniform float uTime;\nuniform vec2 uSdfResolution;\n\n/* --- Inline simplex noise (GLSL ES 1.00, no #include available) --- */\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x) {\n return mod289((x * 34.0 + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise3(vec3 v) {\n const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n vec3 i = floor(v + dot(v, C.yyy));\n vec3 x0 = v - i + dot(i, C.xxx);\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min(g.xyz, l.zxy);\n vec3 i2 = max(g.xyz, l.zxy);\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy;\n vec3 x3 = x0 - D.yyy;\n i = mod289(i);\n vec4 p = permute(permute(permute(i.z + vec4(0.0, i1.z, i2.z, 1.0)) + i.y + vec4(0.0, i1.y, i2.y, 1.0)) + i.x + vec4(0.0, i1.x, i2.x, 1.0));\n float n_ = 0.142857142857;\n vec3 ns = n_ * D.wyz - D.xzx;\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z);\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_);\n vec4 x = x_ * ns.x + ns.yyyy;\n vec4 y = y_ * ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n vec4 b0 = vec4(x.xy, y.xy);\n vec4 b1 = vec4(x.zw, y.zw);\n vec4 s0 = floor(b0) * 2.0 + 1.0;\n vec4 s1 = floor(b1) * 2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n vec3 p0 = vec3(a0.xy, h.x);\n vec3 p1 = vec3(a0.zw, h.y);\n vec3 p2 = vec3(a1.xy, h.z);\n vec3 p3 = vec3(a1.zw, h.w);\n vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n m = m * m;\n return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n\n/* --- Safe normalize that returns fallback when length is near zero --- */\nvec3 safeNormalize(vec3 v, vec3 fallback) {\n float len = length(v);\n return len > 0.0001\n ? v / len\n : fallback;\n}\n\n/* --- Pseudo-3D SDF combining 2D SDF texture with Z extrusion bounds --- */\nfloat sdf3D(vec3 p) {\n /* Account for SDF texture padding: the texture covers [bboxMin-pad, bboxMax+pad] */\n vec2 padMin = uBBoxMin - uSdfPad;\n vec2 padMax = uBBoxMax + uSdfPad;\n vec2 sdfUv = (p.xy - padMin) / (padMax - padMin);\n sdfUv = clamp(sdfUv, 0.0, 1.0);\n float sdf2d = texture2D(uSdf2D, sdfUv).r;\n float zDist = abs(p.z - uExtrudeCenter) - uExtrudeDepth * 0.5;\n return max(sdf2d, zDist);\n}\n\n/* --- SDF gradient via central differences (eps in world units) --- */\nvec3 sdfGradient(vec3 p) {\n float eps = 5.0;\n vec3 g = vec3(\n sdf3D(p + vec3(eps, 0.0, 0.0)) - sdf3D(p - vec3(eps, 0.0, 0.0)),\n sdf3D(p + vec3(0.0, eps, 0.0)) - sdf3D(p - vec3(0.0, eps, 0.0)),\n sdf3D(p + vec3(0.0, 0.0, eps)) - sdf3D(p - vec3(0.0, 0.0, eps))\n );\n return safeNormalize(g, vec3(0.0, 1.0, 0.0));\n}\n\n/* --- Divergence-free curl noise from a 3-component vector potential ---\n curl(F) where F = (N1, N2, N3) are three independent noise evaluations.\n div(curl(F)) = 0 is guaranteed, preventing particle density accumulation. */\nvec3 curlNoise(vec3 p) {\n float eps = 0.1;\n float inv2eps = 1.0 / (2.0 * eps);\n\n /* Three independent noise fields via fixed coordinate offsets */\n vec3 p1 = p;\n vec3 p2 = p + vec3(31.416, -47.853, 12.679);\n vec3 p3 = p + vec3(-22.197, 68.321, -39.542);\n\n /* curl.x = âN3/ây - âN2/âz */\n float dN3dy = (snoise3(p3 + vec3(0.0, eps, 0.0)) - snoise3(p3 - vec3(0.0, eps, 0.0))) * inv2eps;\n float dN2dz = (snoise3(p2 + vec3(0.0, 0.0, eps)) - snoise3(p2 - vec3(0.0, 0.0, eps))) * inv2eps;
199\n\n /* curl.y = âN1/âz - âN3/âx */\n float dN1dz = (snoise3(p1 + vec3(0.0, 0.0, eps)) - snoise3(p1 - vec3(0.0, 0.0, eps))) * inv2eps;\n float dN3dx = (snoise3(p3 + vec3(eps, 0.0, 0.0)) - snoise3(p3 - vec3(eps, 0.0, 0.0))) * inv2eps;\n\n /* curl.z = âN2/âx - âN1/ây */\n float dN2dx = (snoise3(p2 + vec3(eps, 0.0, 0.0)) - snoise3(p2 - vec3(eps, 0.0, 0.0))) * inv2eps;\n float dN1dy = (snoise3(p1 + vec3(0.0, eps, 0.0)) - snoise3(p1 - vec3(0.0, eps, 0.0))) * inv2eps;\n\n return vec3(dN3dy - dN2dz, dN1dz - dN3dx, dN2dx - dN1dy);\n}\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n\n vec3 pos = texture2D(tCurvePosition, uv).xyz;\n vec3 vel = texture2D(tCurveVelocity, uv).xyz;\n float sdfVal = sdf3D(pos);\n\n /* Scale noise input relative to bbox size (features at ~5% of text width) */\n vec2 bboxSize = uBBoxMax - uBBoxMin;\n float noiseScale = 14.0 / max(bboxSize.x, bboxSize.y);\n\n /* Per-curve random offset to break herding (nearby curves move differently) */\n float curveId = gl_FragCoord.x + gl_FragCoord.y * resolution.x;\n vec3 curveOffset = vec3(fract(sin(curveId * 127.1) * 43758.5453), fract(sin(curveId * 269.5) * 43758.5453), fract(sin(curveId * 419.2) * 43758.5453)) * 200.0;\n\n /* --- NaN guard: if position is invalid, output zero velocity --- */\n if (any(notEqual(pos, pos))) {\n gl_FragColor = vec4(0.0);\n return;\n }\n\n /* Boundary steering uses a wide zone for smooth direction changes */\n float steerRange = max(bboxSize.y * 0.1, 40.0);\n\n /* --- Desired velocity: curl noise + continuous inward bias --- */\n /* Boost noise frequency near boundaries so curves in narrow passages diverge */\n float nearBoundary = smoothstep(-steerRange, 0.0, sdf3D(pos));\n float localNoiseScale = noiseScale * (1.0 + nearBoundary * 2.0);\n vec3 noise = curlNoise(pos * localNoiseScale + curveOffset + uTime * 0.15);\n vec3 desiredDir = safeNormalize(noise, vec3(1.0, 0.0, 0.0));\n vec3 desiredVel = desiredDir * uInteriorSpeed;\n vec3 grad = sdfGradient(pos);\n vec3 inward = -grad;\n\n /* Smooth fallback: gradually blend from SDF gradient to nearest-bbox-face direction\n as the curve moves outside the bbox (SDF gradient becomes unreliable due to UV clamping). */\n float bboxOvershoot = 0.0;\n bboxOvershoot = max(bboxOvershoot, uBBoxMin.x - pos.x);\n bboxOvershoot = max(bboxOvershoot, pos.x - uBBoxMax.x);\n bboxOvershoot = max(bboxOvershoot, uBBoxMin.y - pos.y);\n bboxOvershoot = max(bboxOvershoot, pos.y - uBBoxMax.y);\n bboxOvershoot = max(bboxOvershoot, -pos.z);\n bboxOvershoot = max(bboxOvershoot, pos.z - uExtrudeDepth);\n\n if (bboxOvershoot > 0.0) {\n vec3 nearest;\n nearest.x = clamp(pos.x, uBBoxMin.x, uBBoxMax.x);\n nearest.y = clamp(pos.y, uBBoxMin.y, uBBoxMax.y);\n nearest.z = clamp(pos.z, 0.0, uExtrudeDepth);\n vec3 toNearest = safeNormalize(nearest - pos, vec3(0.0, 1.0, 0.0));\n /* Smooth transition over 30 units: SDF gradient â nearest-face direction */\n float bboxBlend = smoothstep(0.0, 30.0, bboxOvershoot);\n inward = safeNormalize(mix(inward, toNearest, bboxBlend), toNearest);\n }\n\n float steerStrength;\n if (sdfVal > 0.0) {\n /* Outside: desired = strongly inward with curl noise spiral */\n vec3 spiral = curlNoise(pos * noiseScale * 2.0 + curveOffset + uTime * 0.4);\n vec3 returnDir = safeNormalize(inward + spiral * 0.3, inward);\n float outsideBlend = clamp(sdfVal / 15.0 + 0.5, 0.5, 1.0);\n desiredVel = safeNormalize(mix(desiredDir, returnDir, outsideBlend), returnDir) * uInteriorSpeed;\n steerStrength = 250.0;\n } else if (sdfVal > -steerRange) {\n /* Near boundary: blend desired toward inward */\n float proximity = smoothstep(-steerRange, 0.0, sdfVal);\n desiredVel = safeNormalize(mix(desiredDir, inward, proximity * 0.6), inward) * uInteriorSpeed;\n steerStrength = mix(10.0, 80.0, proximity);\n } else {\n steerStrength = 30.0;\n }\n\n vec3 steer = (desiredVel - vel) * steerStrength;\n\n /* Clamp steering acceleration */\n float maxSteer = uInteriorSpeed * 300.0;\n float steerLen = length(steer);\n if (steerLen > maxSteer) steer *= maxSteer / steerLen;\n\n vec3 finalVel = vel + steer * uDelta;
199\n\n /* Enforce constant speed â direction changes only, no slowdown at corners.\n This ensures uniform trail point density everywhere. */\n float speed = length(finalVel);\n if (speed > 0.0001) {\n finalVel *= uInteriorSpeed / speed;\n }\n\n gl_FragColor = vec4(finalVel, length(finalVel));\n}\n",h="/* JFA Distance Pass â computes signed distance from JFA result and winding mask */\n/* R = signed distance (negative inside, positive outside), G = unsigned distance, B = inside mask */\n\nprecision highp float;\n\nuniform sampler2D uJFATexture;\nuniform sampler2D uWindingMask;\nuniform vec2 uResolution;\nuniform vec2 uWorldSize; /* bounding box size in world units (font units) */\n\nvarying vec2 vUv;\n\nvoid main() {\n /* Read the nearest seed UV stored by the JFA propagation passes */\n vec2 nearestSeed = texture2D(uJFATexture, vUv).rg;\n\n /* Compute distance in UV space, then scale to world units */\n vec2 diff = (vUv - nearestSeed) * uWorldSize;\n float worldDist = length(diff);\n\n /* Determine inside/outside from the winding mask (R=1.0 inside, 0.0 outside) */\n float inside = texture2D(uWindingMask, vUv).r;\n\n /* Apply sign: negative distance inside the glyph, positive outside */\n float signedDist = inside > 0.5 ? -worldDist : worldDist;\n\n gl_FragColor = vec4(signedDist, worldDist, inside, 1.0);\n}\n",g='/* JFA Seed Pass â marks outline pixels with their own UV, non-outline pixels with sentinel */\n\nprecision highp float;\n\nuniform sampler2D uOutlineTexture;\nuniform vec2 uResolution;\n\nvarying vec2 vUv;\n\nvoid main() {\n float outline = texture2D(uOutlineTexture, vUv).r;\n\n /* Pixels on the outline store their own UV as the seed coordinate */\n if (outline > 0.5) {\n gl_FragColor = vec4(vUv.x, vUv.y, 0.0, 1.0);\n } else {\n /* Non-outline pixels store a sentinel value meaning "no seed yet" */\n gl_FragColor = vec4(9999.0, 9999.0, 0.0, 1.0);\n }\n}\n',v='/* JFA Step Pass â propagates nearest seed UV across 9 neighbors at \xb1uStepSize pixels */\n\nprecision highp float;\n\nuniform float uStepSize;\nuniform vec2 uResolution;\nuniform sampler2D uPrevPass;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec2 stepUV = uStepSize / uResolution;\n\n vec2 closestSeed = vec2(9999.0, 9999.0);\n float closestDist = 1.0e10;\n\n /* Sample all 9 neighbors including self at \xb1uStepSize pixel offsets */\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 neighborUV = vUv + vec2(float(dx), float(dy)) * stepUV;\n vec2 candidateSeed = texture2D(uPrevPass, neighborUV).rg;\n\n /* Skip sentinel values that represent "no seed" */\n if (candidateSeed.x < 9000.0) {\n /* Compare in texel space to avoid aspect ratio distortion */\n float dist = length((vUv - candidateSeed) * uResolution);\n if (dist < closestDist) {\n closestDist = dist;\n closestSeed = candidateSeed;\n }\n }\n }\n }\n\n gl_FragColor = vec4(closestSeed.x, closestSeed.y, 0.0, 1.0);\n}\n'},7653:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ed});var r=n(7973),a=n(6065),o=n(9618),i=n(3267),s=n(4695),l=n(2488),u=n(2310),c=n(2466),f=n(5844),d=n(4188),m=n(4866),p=n(4357),h=n(6987);let g=(0,a.forwardRef)((e,t)=>{let{children:n,layers:s,name:l}=e,{setPrimaryTexture:c}=(0,a.useContext)(u.Oo),f=(0,i.C)(e=>e.gl),g=(0,i.C)(e=>e.size),v=(0,a.useRef)(f).current,x=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null),R=(0,a.useRef)(null);return(0,a.useEffect)(()=>(v.shadowMap.enabled=!0,()=>{v.shadowMap.enabled=!1}),[f]),(0,a.useEffect)(()=>{let e=new o.Pem(g.width,g.height);return e.minFilter=o.k6q,e.magFilter=o.k6q,R.current=e,c(e),()=>{c(null),e.dispose(),R.current=null}},[g.width,g.height]),(0,a.useEffect)(()=>{y.current&&(y.current.aspect=g.width/g.height,y.current.updateMatrixWorld(!0),y.current.updateProjectionMatrix())},[g]),(0,i.D)(()=>{if(!x.current||!y.current)return;let e=x.current.hudScene,t=y.current,n=v.autoClear;v.autoClear=!1,v.clearDepth(),v.render(e,t),v.autoClear=n,R.current&&v.copyFramebufferToTexture(R.current)}),(0,a.useImperativeHandle)(t,()=>({children:n,camera:y.current,renderer:f,directionalLight:w.current,setFocus:()=>{}}
199)),(0,r.jsxs)(d.Yi,{ref:x,renderPriority:100,renderEnabled:!1,backgroundColor:h.i.main.bgColor,children:[(0,r.jsx)("directionalLight",{ref:w,layers:s,name:l,position:[2500,2500,2500],intensity:1}),(0,r.jsx)(m.u,{ref:y,layers:s,name:l,makeDefault:!0,position:p.It,fov:p.RA,near:.01,far:1e4}),n]})}),v=(0,a.forwardRef)((e,t)=>{let{layers:n,name:o,children:s}=e,l=(0,a.useRef)(null),u=(0,a.useRef)(null),f=(0,i.C)(e=>e.gl),h=(0,i.C)(e=>e.size);return(0,c._B)("blue"),(0,a.useEffect)(()=>{u.current&&(u.current.aspect=h.width/h.height),u.current&&u.current.updateProjectionMatrix()},[h]),(0,a.useImperativeHandle)(t,()=>({children:s,camera:u.current,renderer:f}),[]),(0,r.jsxs)(d.Yi,{ref:l,renderPriority:1e4,children:[(0,r.jsx)(m.u,{ref:u,layers:n,name:o,makeDefault:!0,position:p.Yv,fov:p.XF,far:1e4}),(0,r.jsx)("ambientLight",{intensity:1}),s]})}),x=(0,a.forwardRef)((e,t)=>{let{layers:n,name:o,children:s}=e,l=(0,a.useRef)(null),u=(0,a.useRef)(null),f=(0,a.useRef)(null),h=(0,i.C)(e=>e.gl),g=(0,i.C)(e=>e.size);return(0,c._B)("blue"),(0,a.useEffect)(()=>{u.current&&(u.current.aspect=g.width/g.height),u.current&&u.current.updateProjectionMatrix()},[g]),(0,a.useImperativeHandle)(t,()=>({children:s,camera:u.current,renderer:h,ambientLight:f.current,hudScene:l.current.hudScene})),(0,r.jsxs)(d.Yi,{ref:l,renderPriority:1e3,children:[(0,r.jsx)(m.u,{ref:u,layers:n,name:o,makeDefault:!0,position:p.It,fov:p.RA,far:1e4}),s]})});var y=n(6382),w=n(8528),R=n(1916),C=n(5329),b=n(4201),S=n(9319);n(8498);let T=e=>{let{vertexShader:t,fragmentShader:n,defaultOpacity:i=1,extraUniforms:s={}}=e;return(0,a.forwardRef)((e,l)=>{let{pointSize:u=5,pointTextureSize:c=64,attenuationFar:f,attenuationNear:d,fillColor:m=new o.Q1f(0xffffff),side:p=o.hB5,transparent:h=!0,depthWrite:g=!1,depthTest:v=!0}=e,x=(0,a.useRef)(null);(0,a.useImperativeHandle)(l,()=>({material:x.current}));let y=(0,a.useRef)(null);return(0,a.useEffect)(()=>()=>{y.current?.dispose()},[]),(0,a.useMemo)(()=>{if(!c)return null;y.current?.dispose();let e=(0,S.cD)(c);return e.needsUpdate=!0,y.current=e,(0,r.jsx)("shaderMaterial",{ref:x,vertexShader:t,fragmentShader:n,uniforms:o.LlO.merge([b.UniformsLib.lights,{delta:new o.nc$(0),time:new o.nc$(0),attenuationFar:new o.nc$(f),attenuationNear:new o.nc$(d),tPoint:new o.nc$(e),pointResolution:new o.nc$(new o.I9Y(2*c,2*c)),pointSize:new o.nc$(u),opacity:new o.nc$(i),fillColor:new o.nc$(new o.Pq0(m.r,m.g,m.b)),rgbShift:new o.nc$(new o.Pq0(-.003,0,.003)),...s}]),side:p,transparent:h,depthWrite:g,depthTest:v,lights:!0})},[c])})},P=T({vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The size of the point\n */\nuniform float pointSize;\n\n/**\n * The fill color of the point\n */\nuniform vec4 fillColor;\n\n/**\n * The far attenuation of the point.\n */\nuniform float attenuationFar;\n/**\n * The near attenuation of the point.\n */\nuniform float attenuationNear;\n\n/**\n * The texture for the transition data.\n */\nattribute vec2 dataTextureUV;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The UV coordinates of the transition data.\n */\nvarying vec2 vDataTextureUV;\n/**\n * The distance from the camera.\n */\nvarying float vAttenuation;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n\nvoid main() {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n float dist = distance(worldPosition.xyz, cameraPosition);\n float attenuation = easeInOutQuad(linearstep(attenuationFar, attenuationNear, dist));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = pointSize;\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = fillColor.rgb;\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\
199n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vUv = uv;\n vDataTextureUV = dataTextureUV;\n vLightColor = lightColor;\n vAttenuation = attenuation;\n}\n",fragmentShader:"/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The texture for the point\n */\nuniform sampler2D tPoint;\n/**\n * The texture for the transition data.\n */\nuniform sampler2D tTransitionGPUData;\n\n/**\n * The resolution of the point texture\n */\nuniform vec2 pointResolution;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The fill color of the particles.\n */\nuniform vec4 fillColor;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates of the particles.\n */\nvarying vec2 vUv;\n/**\n * The UV coordinates of the transition data.\n */\nvarying vec2 vDataTextureUV;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n/**\n * The distance from the camera.\n */\nvarying float vAttenuation;\n\n/**\n * ***********************************\n * Main\n * ************************************\n */\n\nvoid main() {\n vec4 transitionAnimationGPUTextureColor = texture2D(tTransitionGPUData, vDataTextureUV);\n float progress = transitionAnimationGPUTextureColor.x;\n\n vec4 pointColor = texture2D(tPoint, gl_PointCoord);\n float alpha = vLightColor.r * opacity * vAttenuation * progress;\n if (alpha > 0.0) {\n gl_FragColor = vec4(pointColor.rgb * fillColor.rgb * vLightColor, pointColor.a * alpha);\n } else {\n discard;\n }\n}\n",extraUniforms:{tTransitionGPUData:new o.nc$(null)}}),M=(0,a.forwardRef)((e,t)=>{let{lineColor:n,attenuationFar:i,attenuationNear:s,blending:l,side:u=o.hB5,transparent:c=!0,depthWrite:f=!1,depthTest:d=!0}=e,m=(0,a.useRef)(null);return(0,a.useImperativeHandle)(t,()=>({material:m.current})),(0,a.useMemo)(()=>(0,r.jsx)("shaderMaterial",{ref:m,vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The line color.\n */\nuniform vec3 lineColor;\n\n/**\n * The UV coordinates.\n */\nattribute vec2 dataTextureUV;\n\n/**\n * The far attenuation of the point.\n */\nuniform float attenuationFar;\n/**\n * The near attenuation of the point.\n */\nuniform float attenuationNear;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The data texture UV coordinates.\n */\nvarying vec2 vDataTextureUV;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n\nvoid main() {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n float dist = distance(worldPosition.xyz, cameraPosition);\n float attenuation = easeInOutSine(linearstep(attenuationFar, attenuationNear, dist));\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = lineColor.rgb;\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vUv = uv;\n vDataTextureUV = dataTextureUV;\n vLightColor = lightColor;\n vAttenuation = attenuation;\n}\n",fragmentShader:"/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The far distance of the attenuation effect.\n */\nuniform float attenuationFar;\n/**\n * The near distance of the attenuation effect.\n */\nuniform float attenuationNear;\n\n/**\n * The texture for the GPU data\n */\nuniform sampler2D tTransitionGPUData;\n/**\n * The texture for the GPU data\n */\nuniform sampler2D tLoopGPUData;\n\n/**\n * The color of the line.\n */\nuniform vec3 lineColor;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The data texture UV coordinates.\n */\nvarying vec2 vDataTextureUV;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n\n/**\n * **********************************\n * Main\n * ***********************************\n */\n\nvoid main() {\n vec4 transitionAnimationGPUTextureColor = texture2D(tTransitionGPUData, vDataTextureUV);\n vec4 loopAnimationGPUTextureColor = texture2D(tLoopGPUData, vDataTextureUV);\n float progress = transitionAnimationGPUTextureColor.x;\n float colorMultiplier = loopAnimationGPUTextureColor.x;\n\n float alpha = vLightColor.r * opacity * vAttenuation * colorMultiplier * progress;\n // float alpha = vLightColor.r * gpuMultiplier * opacity * vAttenuation;\n if (alpha > 0.0) {\n gl_FragColor = vec4(lineColor, alpha);\n } else {\n discard;\n }\n}\n",uniforms:o.LlO.merge([b.UniformsLib.lights,{delta:new o.nc$(0),time:new o.nc$(0),attenuationFar:new o.nc$(i),attenuationNear:new o.nc$(s),tTransitionGPUData:new o.nc$(null),tLoopGPUData:new o.nc$(null),opacity:new o.nc$(1),lineColor:new o.nc$(new o.Q1f(n)),rgbShift:new o.nc$(new o.Pq0(-.003,0,.003))}]),vertexColors:!0,blending:l,side:u,transparent:c,depthWrite:f,depthTest:d,lights:!0}),[])});var A=n(637),D=n(3882);let _=(0,a.forwardRef)((e,t)=>
199{let{sceneRef:n,layers:l,radius:f,lineColor:d=h.i.award.cage.lineColor,pointColor:m=h.i.award.cage.pointColor,lineOpacity:p=h.i.award.cage.lineOpacity,pointOpacity:g=h.i.award.cage.pointOpacity}=e,{navigationMarkerScreenPosition:v}=(0,a.useContext)(u._3),{awardGlobeScene:x,setIsCageRendererReady:b,registerAwardCameraEvent:S,unregisterAwardCameraEvent:T}=(0,a.useContext)(C.fn),_=(0,a.useRef)(null),I=(0,a.useRef)(null),E=(0,a.useRef)(null),U=(0,a.useRef)(null),O=(0,a.useRef)(null),F=(0,a.useRef)(null),N=(0,a.useRef)([]),L=(0,a.useCallback)(e=>t=>N.current[e]=t,[]),[z,V]=(0,s.zh)(()=>({from:{val:0},onChange:e=>{E.current.material.uniforms.opacity.value=e.value.val*p,O.current.material.uniforms.opacity.value=e.value.val*g}}),[]),k=(0,i.C)(e=>e.gl),G=(0,i.C)(e=>e.clock),B=(0,i.C)(e=>e.size),j=(0,a.useRef)(null),$=(0,a.useRef)(null),W=(0,a.useRef)(null),H=(0,a.useRef)(null),Y=(0,a.useRef)(null),X=(0,a.useRef)({}),q=(0,a.useRef)({}),Z=(0,a.useRef)({}),Q=(0,a.useRef)(!1),[K,J]=(0,a.useState)(null),[ee,et]=(0,a.useState)(null),[en,er]=(0,a.useState)(null),ea=(0,a.useRef)(new o.I9Y);(0,a.useRef)(1e7);let eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:80,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:9,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:500,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:80,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:9;((e,t,n,r,a,i,s,l)=>{if(j.current||$.current||!K||!ee)return;(0,D.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupGPUComputationRenderer"),j.current=new R.d(72,36,k),$.current=new R.d(36,18,k),(0,A.n)()&&(j.current.setDataType(o.ix0),$.current.setDataType(o.ix0));let u=j.current.createTexture(),c=j.current.createTexture(),f=$.current.createTexture();for(let a=0;a<36;a++){let i=a-r/36*36;i<0&&(i+=36);let s=i*n+e;for(let e=0;e<18;e++){let n=4*(18*a+e)*2;u.image.data.set([0,s,t,0,0,s,t,0],n),c.image.data.set([0,o.cj9.randFloat(0,2*y.Kt),o.cj9.randFloat(0*y.V$,60*y.V$),0,0,o.cj9.randFloat(0,2*y.Kt),o.cj9.randFloat(0*y.V$,60*y.V$),0],n)}}for(let a=0;a<18;a++)for(let i=0;i<36;i++){let s=i-r/36*36;s<0&&(s+=36);let l=s*n+e,f=4*(36*a+i)*2;u.image.data.set([0,l,t,0,0,l,t,0],f),c.image.data.set([0,o.cj9.randFloat(0,2*y.Kt),o.cj9.randFloat(0*y.V$,60*y.V$),0,0,o.cj9.randFloat(0,2*y.Kt),o.cj9.randFloat(0*y.V$,60*y.V$),0],f)}for(let e=0;e<36;e++){let t=e-l/36*36;t<0&&(t+=36);let n=t*s+a;for(let t=0;t<18;t++){let r=4*(18*e+t);f.image.data.set([0,n,i,0],r)}}u.needsUpdate=!0,c.needsUpdate=!0,f.needsUpdate=!0,W.current=j.current.addVariable("tTransitionGPUData","uniform sampler2D tEarthMap;\nuniform vec2 earthMapResolution;\n\nuniform float delta;\nuniform float time;\n\nuniform float shouldStartTransition;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 gpuTextureColor = texture2D(tTransitionGPUData, uv);\n\n float delay = gpuTextureColor.y;\n float duration = gpuTextureColor.z;\n float isFinished = gpuTextureColor.w;\n\n if (isFinished > 0.0 || shouldStartTransition < 1.0) {\n gl_FragColor = gpuTextureColor;\n return;\n }\n if (delay < time) {\n float timeElapsed = (time - delay) / duration;\n float progress = min(timeElapsed / duration, 1.0);\n float isFinished = progress >= 1.0 ? 1.0 : 0.0;\n gl_FragColor = vec4(progress, delay, duration, isFinished);\n } else {\n gl_FragColor = gpuTextureColor;\n }\n}\n",u),H.current=j.current.addVariable("tLoopGPUData","/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n\nuniform sampler2D tEarthMap;\nuniform vec2 earthMapResolution;\n\nuniform float delta;\nuniform float time;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec3 earthMapColor = texture2D(tEarthMap, uv).rgb;\n vec4 gpuTextureColor = texture2D(tLoopGPUData, uv);\n /**\n * * Invert the color\n * * - Land: Black (0, 0, 0) -> (1.0, 1.0, 1.0)\n * * - Sea: White (1, 1, 1) -> (0.0, 0.0, 0.0)\n */\n float earthMapAlpha = 1.0 - earthMapColor.r;\n if (earthMapAlpha > 0.0) {\n /**\n * Land\n */\n float currentRotation = gpuTextureColor.y;\n float rotationSpeed = gpuTextureColor.z;\n float nextRotation = mod(currentRotation + rotationSpeed * delta, PI * 2.0);\n float colorMultiplier = earthMapAlpha * (abs(sin(nextRotation)) * 0.3 + 0.2);\n gl_FragColor = vec4(colorMultiplier, nextRotation, rotationSpeed, 1.0
199);\n } else {\n /**\n * Sea\n */\n gl_FragColor = vec4(0.0, gpuTextureColor.yzw);\n }\n}\n",c),Y.current=$.current.addVariable("tTransitionGPUData","uniform float delta;\nuniform float time;\n\nuniform float shouldStartTransition;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 gpuTextureColor = texture2D(tTransitionGPUData, uv);\n\n float delay = gpuTextureColor.y;\n float duration = gpuTextureColor.z;\n float isFinished = gpuTextureColor.w;\n\n if (isFinished > 0.0 || shouldStartTransition < 1.0) {\n gl_FragColor = gpuTextureColor;\n return;\n }\n if (delay < time) {\n float timeElapsed = (time - delay) / duration;\n float progress = min(timeElapsed / duration, 1.0);\n float isFinished = progress >= 1.0 ? 1.0 : 0.0;\n gl_FragColor = vec4(progress, delay, duration, isFinished);\n } else {\n gl_FragColor = gpuTextureColor;\n }\n}\n",f),W.current.material.needsUpdate=!0,H.current.material.needsUpdate=!0,Y.current.material.needsUpdate=!0,j.current.setVariableDependencies(W.current,[W.current]),j.current.setVariableDependencies(H.current,[H.current]),$.current.setVariableDependencies(Y.current,[Y.current]),X.current=W.current.material.uniforms,q.current=H.current.material.uniforms,Z.current=Y.current.material.uniforms;let d=G.getDelta();X.current.shouldStartTransition=new o.nc$(0),X.current.delta=new o.nc$(d),X.current.time=new o.nc$(0),q.current.delta=new o.nc$(d),q.current.time=new o.nc$(0),Z.current.shouldStartTransition=new o.nc$(0),Z.current.delta=new o.nc$(d),Z.current.time=new o.nc$(0);let m=j.current.init(),p=$.current.init();null!==m&&(0,D.Rm)("yellowgreen","â","gpuSegmentRenderer init error",m),null!==p&&(0,D.Rm)("yellowgreen","â","gpuPointRenderer init error",p),u.dispose(),c.dispose(),f.dispose(),Q.current=!0})(e/1e3,t/1e3,n/1e3,r,a/1e3,i/1e3,s/1e3,l),X.current.shouldStartTransition.value=1,W.current.material.needsUpdate=!0,Z.current.shouldStartTransition.value=1,Y.current.material.needsUpdate=!0},ei=(e,t)=>{V.stop(!0),V.start({from:{val:1},to:{val:0},delay:t,config:{duration:e,easing:s.le.easeOutCubic}})},es=(e,t)=>{_.current.rotation.x=e,_.current.rotation.y=t,eu()},el=new o.I9Y,eu=()=>{let e=Math.min(1,Math.max(0,(B.width/B.height-9/16)/(16/9-9/16)));ea.current.x=B.width*(.3+(.1-.3)*e),ea.current.y=.2*B.height;let t=x.current.camera;t.updateMatrixWorld();let n=1/0;el.set(0,0);let r=(0,w.UT)(ea.current.clone(),t,B,2400);for(let e=0;e<N.current.length;e++){let a=N.current[e].position.clone().applyEuler(_.current.rotation),o=a.distanceTo(r);o<n&&(n=o,el=(0,w.UK)(a,t,B))}v.current.x=el.x,v.current.y=el.y};return(0,c._B)("yellowgreen"),(0,a.useEffect)(()=>{let e=(e,t)=>{if(e===C.LC.POSITION_CHANGED){let e,n;e=t.distanceToEarthCenter,n=t.distanceToCageNearestSurface,O.current.material.uniforms.attenuationFar.value=1.15*e,O.current.material.uniforms.attenuationNear.value=.94*n,E.current.material.uniforms.attenuationFar.value=1.15*e,E.current.material.uniforms.attenuationNear.value=.94*n}};return S(e),()=>{T(e),j.current?.dispose(),j.current=null,$.current?.dispose(),$.current=null,Q.current=!1,b(!1)}},[]),(0,a.useEffect)(()=>{(()=>{if((0,D.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupSegments"),0===f)return;let e=y.Gf/36,t=y.Gf/36,n=new Float32Array(7776),a=new Float32Array(7776),i=new Float32Array(5184),s=new Float32Array(5184);for(let r=0;r<36;r++)for(let l=0;l<18;l++){let u=18*r+l,c=l*e,d=r*t,m=new o.YHV(f,c,d),p=new o.B69().position.setFromSpherical(m),h=p.clone().normalize(),g=[2*r/72,2*l/36],v=(l+1)*e,x=r*t,y=new o.YHV(f,v,x),w=new o.B69().position.setFromSpherical(y),R=w.clone().normalize(),C=[2*r/72,(2*l+1)/36],b=6*u;n.set([p.x,p.y,p.z,w.x,w.y,w.z],b),a.set([h.x,h.y,h.z,R.x,R.y,R.z],b);let S=4*u;i.set([...g,...C],S),s.set([36*g[0]*2/2,18*g[1]*2/2,36*C[0]*2/2,18*C[1]*2/2],S)}for(let r=0;r<18;r++)for(let l=0;l<36;l++){let u=36*r+l,c=r*e,d=l*t,m=new o.YHV(f,c,d),p=new o.B69().position.setFromSpherical(m),h=p.clone().normalize(),g=[2*l/72,2*r/36],v=r*e,x=(l+1)*t,y=new o.YHV(f,v,x),w=new o.B69().position.setFromSpherical(y),R=w.clone().normalize(),C=[(2*l+1)/72,2*r/36],b=3888+6*u;n.set([p.x,p.y,p.z,w.x,w.y,w.z],b),a.set([h.x,h.y,h.z,R.x,R.y,R.z],b);let S=2592+4*u;i.set([...g,...C],S),s.set([36*g[0]*2/2,18*g[1]*2/2,36*C[0]*2/2,18*C[1]*2/2],S)}J((0,r.jsxs)("lineSegments",{ref:I,layers:l,children:[(0,r.jsxs)("bufferGeometry",{children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",args:[n,3],count:n.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-normal",args:[a,3],count:a.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-dataTextureUV",args:[i,2],count:i.length/2})]}),(0,r.jsx)(M,{ref:E,lineColor:new o.Q1f(d),attenuationFar:5e3,attenuationNear:2e3})]}))})(),(()=>{if((0,D.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupPoints"),0===f)return;let e=y.Gf/36,t=y.Gf/36,n=f+.1,a=new Float32Array(1944),i=new Float32Array(1944),s=new Float32Array(1296),u=[];for(let r=0;r<36;r++)for(let l=0;l<18;l++){let c=(18*r+l)*3,f=l*e,d=r*t,m=new o.YHV(n,f,d),p=new o.B69().position.setFromSpherical(m);a.set([p.x,p.y,p.z],c);let h=p.clone().normalize();i.set([h.x,h.y,h.z],c),i[c+2]=h.z;let g=18*r+l;s.set([r/36,l/18],g),2<=l&&l<=12&&u.push(p)}et((0,r.jsxs)("points",{ref:U,layers:l,children:[(0,r.jsxs)("bufferGeometry",{children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",args:[a,3],count:a.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-normal",args:[i,3],count:i.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-dataTextureUV",args:[s,2],count:s.length/2})]}),(0,r.jsx)(P,{ref:O,fillColor:new o.Q1f(m),attenuationFar:5e3,attenuationNear:2e3})]})),er((0,r.jsx)("group",{ref:F,layers:l,children:u.map((e,t)=>(0,r.jsx)("mesh",{ref:L(t),layers:l,position:e},t))}))})()},[]),(0,a.useEffect)(()=>{b(!0)},[K,ee,en]),(0,c.Ql)((e,t)=>{eu(),Q.current&&(X.current.delta.value=t,X.current.shouldStartTransition.value>0&&(X.current.time.value+=t),q.current.delta.value=t,q.current.time.value+=t,Z.current.delta.value=t,Z.current.shouldStartTransition.value>0&&(Z.current.time.value+=t),W.current.material.needsUpdate=!0,H.
199current.material.needsUpdate=!0,Y.current.material.needsUpdate=!0,j.current.compute(),$.current.compute(),E.current.material.uniforms.tTransitionGPUData.value=j.current.getCurrentRenderTarget(W.current).texture,E.current.material.uniforms.tLoopGPUData.value=j.current.getCurrentRenderTarget(H.current).texture,O.current.material.uniforms.tTransitionGPUData.value=$.current.getCurrentRenderTarget(Y.current).texture,E.current.material.uniforms.delta.value=t,E.current.material.uniforms.time.value+=t,E.current.material.uniforms.tTransitionGPUData.value.needsUpdate=!0,E.current.material.uniforms.tLoopGPUData.value.needsUpdate=!0,E.current.material.needsUpdate=!0,O.current.material.uniforms.tTransitionGPUData.value.needsUpdate=!0,O.current.material.uniforms.delta.value=t,O.current.material.uniforms.time.value+=t,O.current.material.needsUpdate=!0)}),(0,a.useImperativeHandle)(t,()=>({present:eo,dismiss:ei,rotate:es})),(0,r.jsxs)("group",{ref:_,layers:l,children:[K,ee,en]})});_.displayName="CageRenderer";let I="uniform float delta;\nuniform float time;\n\nuniform float shouldStartTransition;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 gpuTextureColor = texture2D(tTransitionGPUData, uv);\n\n float delay = gpuTextureColor.y;\n float duration = gpuTextureColor.z;\n float isFinished = gpuTextureColor.w;\n\n if (isFinished > 0.0 || shouldStartTransition < 1.0) {\n gl_FragColor = gpuTextureColor;\n return;\n }\n if (delay < time) {\n float timeElapsed = (time - delay) / duration;\n float progress = min(timeElapsed / duration, 1.0);\n float isFinished = progress >= 1.0 ? 1.0 : 0.0;\n gl_FragColor = vec4(progress, delay, duration, isFinished);\n } else {\n gl_FragColor = gpuTextureColor;\n }\n}\n",E=e=>{let{vertexShader:t,fragmentShader:n,defaultOpacity:i=1,extraUniforms:s={}}=e;return(0,a.forwardRef)((e,l)=>{let{lineColor:u,innerRadius:c,outerRadius:f,attenuationFar:d,attenuationNear:m,blending:p,side:h=o.hB5,transparent:g=!0,depthWrite:v=!1,depthTest:x=!0}=e,y=(0,a.useRef)(null);return(0,a.useImperativeHandle)(l,()=>({material:y.current})),(0,a.useMemo)(()=>(0,r.jsx)("shaderMaterial",{ref:y,vertexShader:t,fragmentShader:n,uniforms:o.LlO.merge([b.UniformsLib.lights,{delta:new o.nc$(0),time:new o.nc$(0),attenuationFar:new o.nc$(d),attenuationNear:new o.nc$(m),innerRadius:new o.nc$(c),innerRotation:new o.nc$(new o.O9p(0,0,0)),outerRadius:new o.nc$(f),outerRotation:new o.nc$(new o.O9p(0,0,0)),opacity:new o.nc$(i),lineColor:new o.nc$(new o.Q1f(u)),rgbShift:new o.nc$(new o.Pq0(-.003,0,.003)),...s}]),vertexColors:!0,blending:p,side:h,transparent:g,depthWrite:v,depthTest:x,lights:!0}),[])})},U=E({vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The radius of the inner globe.\n */\nuniform float innerRadius;\n/**\n * The radius of the outer globe.\n */\nuniform float outerRadius;\n/**\n * The rotation of the inner globe.\n */\nuniform vec3 innerRotation;\n/**\n * The rotation of the outer globe.\n */\nuniform vec3 outerRotation;\n\n/**\n * The far distance of the attenuation effect.\n */\nuniform float attenuationFar;\n/**\n * The near distance of the attenuation effect.\n */\nuniform float attenuationNear;\n\n/**\n * The line color.\n */\nuniform vec3 lineColor;\n\n/**\n * The texture for the transition GPU data.\n */\nuniform sampler2D tTransitionGPUData;\n\n/**\n * The angle of the vertex.\n */\nattribute vec2 angle;\n/**\n * The flag that indicates whether the vertex is on the inner globe.\n */\nattribute float inner;\n\n/**\n * The texture coordinates of the data.\n */\nattribute vec2 dataTextureUV;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The texture coordinates of the data.\n */\nvarying vec2 vDataTextureUV;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n/**\n * The flag that indicates whether the vertex is on the inner globe.\n */\nvarying float vInner;\n\nvoid main() {\n vec4 transitionGPUTextureColor = texture2D(tTransitionGPUData, dataTextureUV);\n float transitionProgress = transitionGPUTextureColor.x;\n\n vec3 rotatedPosition = position;\n if (inner > 0.0) {\n vec3 diffRotation = outerRotation - innerRotation;\n float angleX = angle.x + diffRotation.y;\n float angleY = angle.y + diffRotation.x;\n rotatedPosition = rotate(innerRadius, angleY, angleX);\n } else {\n /**\n * Ease position while transitioning\n */\n vec3 diffRotation = outerRotation - innerRotation;\n float angleX = angle.x + diffRotation.y;\n float angleY = angle.y + diffRotation.x;\n vec3 innerPosition = rotate(innerRadius, angleY, angleX);\n rotatedPosition = mix(innerPosition, position, transitionProgress);\n }\n\n /**\n * The world position of the vertex.\n */\n vec4 worldPosition = modelMatrix * vec4(rotatedPosition, 1.0
199);\n /**\n * The position of the vertex in the clip space.\n */\n vec4 mvPosition = modelViewMatrix * vec4(rotatedPosition, 1.0);\n\n /**\n * The distance from the camera.\n */\n float dist = distance(worldPosition.xyz, cameraPosition);\n float attenuation = easeInOutQuad(linearstep(attenuationFar, attenuationNear, dist));\n\n /**\n * The position of the vertex in the clip space.\n */\n gl_Position = projectionMatrix * mvPosition;\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = lineColor.rgb;\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vUv = uv;\n vDataTextureUV = dataTextureUV;\n vLightColor = lightColor;\n vAttenuation = attenuation;\n vInner = inner;\n}\n",fragmentShader:"/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The texture for the transition GPU data.\n */\nuniform sampler2D tTransitionGPUData;\n\n/**\n * The color of the line.\n */\nuniform vec3 lineColor;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The texture coordinates of the data.\n */\nvarying vec2 vDataTextureUV;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The inner radius of the connector.\n */\nvarying float vInner;\n\n/**\n * **********************************\n * Main\n * ***********************************\n */\n\nvoid main() {\n vec4 transitionGPUTextureColor = texture2D(tTransitionGPUData, vDataTextureUV);\n float transitionProgress = transitionGPUTextureColor.x;\n\n // float innerMultiplier = vInner > 0.0 ? 1.0 : linearstep(0.0, 1.0, transitionProgress);\n\n float alpha = vLightColor.r * opacity * vAttenuation * transitionProgress;\n\n if (alpha > 0.0) {\n gl_FragColor = vec4(lineColor, alpha);\n } else {\n discard;\n }\n}\n",extraUniforms:{tTransitionGPUData:new o.nc$(null)}});var O=n(1902);let F=(0,a.forwardRef)((e,t)=>{let{texture:n,numTotalInstances:i,gpuLabelDataDimension:s,domeCenter:l=new o.Pq0,attenuationFar:u,attenuationNear:c,fillColor:f=new o.Q1f(h.i.portrait.symbolColor),side:d=o.hB5,transparent:m=!0,depthTest:p=!0,depthWrite:g=!1}=e,v=(0,a.useRef)(null);return(0,a.useEffect)(()=>{v.current&&n&&(n.anisotropy=16,n.needsUpdate=!0,v.current.uniforms.tDiffuse.value=n,v.current.needsUpdate=!0)},[n]),(0,a.useImperativeHandle)(t,()=>({material:v.current})),(0,r.jsx)("shaderMaterial",{ref:v,vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\nuniform float delta;\nuniform float time;\n\nuniform vec3 domeCenter;\n\nattribute vec3 offset;\nattribute float instanceIndex;\nattribute vec2 tileUV;\nattribute float textScale;\n\n/**\n * The far distance of the attenuation effect.\n */\nuniform float attenuationFar;\n/**\n * The near distance of the attenuation effect.\n */\nuniform float attenuationNear;\n\n/**\n * The UV coordinates of the particles.\n */\nvarying vec2 vUv;\n/**\n * The instance index.\n */\nvarying float vInstanceIndex;\n/**\n * The tile UV coordinates.\n */\nvarying vec2 vTileUV;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The tile UV coordinates.\n */\n\nconst vec3 up = vec3(0.0, 1.0, 0.0);\n\nvoid main() {\n /**\n * Calculate the world position of the instance.\n */\n vec4 instanceWorldPosition = instanceMatrix * vec4(offset, 1.0);\n\n /**\n * * The look at matrix.\n * *\n * * Reason for inverting lookAtMatrix:\n * *\n * * The `lookAt` function generates the camera's view matrix based on the camera's position,\n * * the target position, and the up vector. This matrix creates the coordinate system for the\n * * scene as viewed from the camera.\n * *\n * * When calculating the position of objects within the shader, it is typically necessary to\n * * transform from world space to view space. Therefore, inverting the matrix obtained from\n * * `lookAt` allows for the correct transformation of the object's position, ensuring that it\n * * is rendered correctly based on the camera's perspective.\n */\n mat4 lookAtMatrix = inverse(lookAt(domeCenter, instanceWorldPosition.xyz, up));\n\n vec3 scaledPosition = position * textScale;\n\n /**\n * Calculate the world position of the vertex.\n */\n vec4 vertexLocalPosition = vec4(rotate(scaledPosition, 0.0, PI), 1.0);
199\n // vec4 vertexLocalPosition = vec4(position, 1.0);\n vec4 vertexWorldPosition = lookAtMatrix * vertexLocalPosition;\n\n /**\n * Combine the instance and vertex positions.\n */\n vec4 worldPosition = instanceWorldPosition + vertexWorldPosition;\n\n /**\n * The final position of the vertex.\n */\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * worldPosition;\n // gl_Position = projectionMatrix * viewMatrix * instanceMatrix * vec4(position, 1.0); /** For debug */\n\n vec4 distancePosition = modelMatrix * worldPosition;\n float dist = distance(distancePosition.xyz, cameraPosition);\n float attenuation = easeInOutQuad(linearstep(attenuationFar, attenuationNear, dist));\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = vec3(0.0);\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Varying variables.\n */\n vUv = uv;\n vInstanceIndex = instanceIndex;\n vTileUV = tileUV;\n vLightColor = lightColor;\n vAttenuation = attenuation;\n}\n",fragmentShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n#include <ftmr_snoise>\n#include <ftmr_math>\n\n/**\n * Textures\n */\nuniform sampler2D tDiffuse;\nuniform sampler2D tDisplace;\nuniform vec2 tDisplaceResolution;\nuniform sampler2D tNoise;\nuniform vec2 tNoiseResolution;\nuniform sampler2D tMosaic;\nuniform vec2 tMosaicResolution;\nuniform sampler2D tLabelEffectGPUData;\n\n/**\n * The total number of instances\n */\nuniform float numTotalInstances;\n/**\n * The dimension of the GPU data texture.\n */\nuniform float gpuLabelDataDimension;\n\n/**\n * The opacity of the symbol\n */\nuniform float opacity;\n/**\n * The fill color of the symbol\n */\nuniform vec4 fillColor;\n/**\n * The RGB shift value of the symbol\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates of the particles.\n */\nvarying vec2 vUv;\n/**\n * The instance index.\n */\nvarying float vInstanceIndex;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n\n/**\n * **********************************************************\n * Animation functions\n * ***********************************************************\n */\n\n/**\n * Function to get the UV coordinates\n *\n * This function calculates the UV coordinates based on the texture index.\n * When calculating the row index, the direction of the Y-axis is different, so the row index needs to be reversed.\n *\n * @param uv - Input UV coordinates\n * @param texIndex - Texture index\n * @param numGridX - Number of grids in the X direction\n * @param numGridY - Number of grids in the Y direction\n * @return - Calculated UV coordinates\n */\nvec2 getUV(vec2 uv, float row, float numGridY) {\n /**\n * Calculate the unit size of the grid\n */\n float unitY = 1.0 / numGridY;\n\n /**\n * Reverse the row index to make the top of the texture correspond to the 0 of the UV coordinates and the bottom to 1\n */\n row = numGridY - 1.0 - row;\n\n /**\n * Calculate the texture UV coordinates\n */\n vec2 texUV = vec2(0, row * unitY);\n vec2 offsetUV = uv * vec2(1.0, unitY);\n\n return offsetUV + texUV;\n}\n\n/**\n * ************************************\n * Effect functions\n * *************************************\n */\n\n/**\n * Description : Get the RGB shift color\n */\nvec4 getRGBShiftColor(vec2 uv, float amountR, float amountG, float amountB) {\n vec2 uvR = uv + vec2(amountR, 0.0);\n vec2 uvG = uv + vec2(amountG, 0.0);\n vec2 uvB = uv + vec2(amountB, 0.0);\n\n vec4 r = texture2D(tDiffuse, uvR) * vec4(1.0, 0.0, 0.0, 1.0);\n vec4 g = texture2D(tDiffuse, uvG) * vec4(0.0, 1.0, 0.0, 1.0);\n vec4 b = texture2D(tDiffuse, uvB) * vec4(0.0, 0.0, 1.0, 1.0);\n vec4 color = r + g + b;\n\n return color;\n}\n\n/**\n * Description : Get the mixed RGB shift color\n */\nvec4 getMixedRGBShiftColor(vec2 uv, float amountR, float amountG, float amountB, vec4 mixColor) {\n vec2 uvR = uv + vec2(amountR, 0.0);\n vec2 uvG = uv + vec2(amountG, 0.0);\n vec2 uvB = uv + vec2(amountB, 0.0);\n\n vec4 r = mix(texture2D(tDiffuse, uvR), mixColor, 0.5) * vec4(1.0, 0.0, 0.0, 1.0);\n vec4 g = mix(texture2D(tDiffuse, uvG), mixColor, 0.5) * vec4(0.0, 1.0, 0.0, 1.0);\n vec4 b = mix(texture2D(tDiffuse, uvB), mixColor, 0.5) * vec4(0.0, 0.0, 1.0, 1.0);\n vec4 color = r + g + b;\n\n return color;\n}\n\n/**\n * Description : Glitch Effect\n */\nvec2 getGlitchUV(vec2 diffuseUV, float displaceProgress, float displaceRotation, float noiseProgress, float noiseReduction) {\n /**\n * Get the diffuse color\n */\n vec4 diffuseColor = texture2D(tDiffuse, diffuseUV);\n\n /**\n * Get the displacement color\n */\n vec4 displaceColor = texture2D(tDisplace, vUv);\n\n /**\n * Retrieve the values from the displacement map texture\n */\n float amplitude = displaceColor.x;
199\n float startRotation = displaceColor.y;\n float seed = displaceColor.z;\n\n /**\n * * Displacement effect\n */\n /**\n * Calculate the current strength\n */\n float displaceStrength = 1.0 - displaceProgress;\n /**\n * Calculate the current amplitude\n */\n float displaceLength = amplitude * displaceStrength;\n /**\n * Calculate the current rotation angle\n */\n float displaceAngle = startRotation + displaceRotation;\n /**\n * Calculate the displacement offset of the glitch effect\n */\n vec2 displaceOffset = vec2(displaceLength * cos(displaceAngle), displaceLength * sin(displaceAngle));\n\n /**\n * * Simplex noise effect\n */\n /**\n * Calculate the current strength\n */\n float noiseStrength = 1.0 - noiseProgress;\n /**\n * Calculate the noise of the glitch effect\n */\n vec2 noise = vec2(\n snoise3(vec3(0.0, vUv.x * 8.0, seed)) * noiseStrength * noiseReduction,\n snoise3(vec3(0.0, vUv.y * 8.0, seed)) * noiseStrength * noiseReduction\n );\n\n return diffuseUV + quantize(noise, 0.01) + quantize(displaceOffset, 0.01);\n}\n\n/**\n * Description : Get the mosaic alpha\n */\nfloat getMosaicAlpha(float mosaicProgress) {\n /**\n * Get the mosaic color\n */\n vec4 mosaicColor = texture2D(tMosaic, vUv);\n\n /**\n * Retrieve the values from the displacement map texture\n */\n float initial = mosaicColor.x;\n float delay = mosaicColor.y;\n float speed = mosaicColor.z;\n float quantum = mosaicColor.w;\n\n /**\n * Calculate the progress of the effect excluding the delay. The value is in the range of 0.0 to 1.0.\n */\n float strength = max(mosaicProgress - delay, 0.0) / (1.0 - delay);\n\n float alpha = linearstep(initial, 1.0, strength);\n return clamp(quantize(alpha, quantum), 0.0, 1.0);\n}\n\n/**\n * ************************************\n * Main\n * *************************************\n */\n\nvoid main() {\n /**\n * The diffuse UV coordinates.\n */\n vec2 diffuseUV = getUV(vUv, vInstanceIndex, numTotalInstances);\n vec4 diffuseColor = texture2D(tDiffuse, diffuseUV);\n\n /**\n * +0.5 texel-center offset: corner-exact UVs with NearestFilter round to an\n * implementation-dependent neighbor texel (ANGLE D3D11 vs Metal diverge).\n */\n float dataUVXUnit = 1.0 / gpuLabelDataDimension;\n float dataUVY = (vInstanceIndex + 0.5) / numTotalInstances;\n\n /**\n * The transition progress.\n */\n vec4 transitionColor = texture2D(tLabelEffectGPUData, vec2(dataUVXUnit * 0.5, dataUVY));\n float transitionProgress = transitionColor.x;\n float transitionDelay = transitionColor.y;\n float transitionDuration = transitionColor.z;\n float transitionFinished = transitionColor.w;\n\n /**\n * The effect status.\n */\n vec4 statusColor = texture2D(tLabelEffectGPUData, vec2(dataUVXUnit * 1.5, dataUVY));\n float effectStatus = statusColor.x;\n float shouldApplyEffect = statusColor.y;\n float currentTime = statusColor.z;\n float effectAttenuation = statusColor.w;\n\n /**\n * The displace effect.\n */\n vec4 displaceColor = texture2D(tLabelEffectGPUData, vec2(dataUVXUnit * 2.5, dataUVY));\n float displaceStrength = displaceColor.x;\n float displaceRotation = displaceColor.y;\n\n /**\n * The noise effect.\n */\n vec4 noiseColor = texture2D(tLabelEffectGPUData, vec2(dataUVXUnit * 3.5, dataUVY));\n float noiseStrength = noiseColor.x;\n float noiseReduction = noiseColor.y;\n\n /**\n * The mosaic effect.\n */\n vec4 mosaicColor = texture2D(tLabelEffectGPUData, vec2(dataUVXUnit * 4.5, dataUVY));\n float mosaicStrength = mosaicColor.x;\n\n /**\n * * Glitch effect\n */\n vec2 glitchUV = getGlitchUV(diffuseUV, displaceStrength, displaceRotation, noiseStrength, noiseReduction);\n vec4 glitchColor = texture2D(tDiffuse, glitchUV);\n\n /**\n * * RGB shift effect\n */\n vec4 rgbShiftColor = getRGBShiftColor(glitchUV, rgbShift.r, rgbShift.g, rgbShift.b);\n\n /**\n * * Mosaic effect\n */\n float mosaicAlpha = getMosaicAlpha(mosaicStrength);\n\n /**\n * * Merge the effects\n */\n /**\n * Glitch + RGB shift + Mosaic effects\n */\n // vec4 mergedColor = vec4(rgbShiftColor.rgb * fillColor.rgb, glitchColor.a * mosaicAlpha);\n /**\n * Glitch effect only\n */\n // vec4 mergedColor = vec4(glitchColor.rgb * fillColor.rgb, glitchColor.a);\n /**\n * Glitch + Mosaic effects\n */\n vec4 mergedColor = vec4(glitchColor.rgb * fillColor.rgb, glitchColor.a * mosaicAlpha);\n\n /**\n * The alpha value\n */\n float alpha = vLightColor.r * vAttenuation * opacity;\n if (alpha > 0.0) {\n gl_FragColor = vec4(mergedColor.rgb, mergedColor.a * alpha);\n } else {\n discard;\n }\n}\n",uniforms:o.LlO.merge([b.UniformsLib.lights,{delta:new o.nc$(0),time:new o.nc$(0),numTotalInstances:new o.nc$(i),gpuLabelDataDimension:new o.nc$(s),numTextureRows:new o.nc$(0),domeCenter:new o.nc$(l),attenuationFar:new o.nc$(u),attenuationNear:new o.nc$(c),tTransitionGPUData:new o.nc$(null),tLabelEffectGPUData:new o.nc$(null),tDiffuse:new o.nc$(n),diffuseResolution:new o.nc$(new o.I9Y(n.image.width,n.image.height)),tDisplace:new o.nc$((0,O.sT)(9,3,{min:.004,max:.008},{min:-Math.PI,max:Math.PI},{min:0,max:1})),displaceResolution:new o.nc$(new o.I9Y(9,3)),tNoise:new o.nc$((0,O.fG)(9,3,{min:0,max:1}
199)),noiseResolution:new o.nc$(new o.I9Y(9,3)),tMosaic:new o.nc$((0,O.ff)(15,3,{min:0,max:.5},{min:0,max:.5},{min:.1,max:.3},.1)),mosaicResolution:new o.nc$(new o.I9Y(15,3)),opacity:new o.nc$(1),fillColor:new o.nc$(new o.Pq0(f.r,f.g,f.b)),rgbShift:new o.nc$(new o.Pq0(-.007,0,.007))}]),side:d,transparent:m,depthTest:p,depthWrite:g,dithering:!0,lights:!0})}),N=(0,a.forwardRef)((e,t)=>{let{fillColor:n,attenuationFar:i,attenuationNear:s,blending:l,side:u=o.hB5,transparent:c=!0,depthWrite:f=!1,depthTest:d=!0,opacity:m=0}=e,p=(0,a.useRef)(null);return(0,a.useImperativeHandle)(t,()=>({material:p.current})),(0,a.useMemo)(()=>(0,r.jsx)("shaderMaterial",{ref:p,vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The line color.\n */\nuniform vec3 fillColor;\n\n/**\n * The far distance of the attenuation effect.\n */\nuniform float attenuationFar;\n/**\n * The near distance of the attenuation effect.\n */\nuniform float attenuationNear;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n\n// const vec3 up = vec3(0.0, 1.0, 0.0);\n\nvoid main() {\n // vec3 eye = position * 2.0;\n // mat4 lookAtMatrix = inverse(lookAt(eye, position, up));\n /**\n * The position of the vertex in the clip space.\n */\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n /**\n * The position of the vertex in the clip space.\n */\n gl_Position = projectionMatrix * mvPosition;\n\n /**\n * The world position of the vertex.\n */\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n /**\n * The distance from the camera.\n */\n float dist = distance(worldPosition.xyz, cameraPosition);\n float attenuation = easeInOutQuad(linearstep(attenuationFar, attenuationNear, dist));\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = fillColor.rgb;\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vUv = uv;\n vLightColor = lightColor;\n vAttenuation = attenuation;\n}\n",fragmentShader:"/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The color of the line.\n */\nuniform vec3 fillColor;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n\n/**\n * **********************************\n * Main\n * ***********************************\n */\n\nvoid main() {\n float alpha = vLightColor.r * opacity * vAttenuation;\n\n if (alpha > 0.0) {\n gl_FragColor = vec4(fillColor, alpha);\n } else {\n discard;\n }\n}\n",uniforms:o.LlO.merge([b.UniformsLib.lights,{delta:new o.nc$(0),time:new o.nc$(0),attenuationFar:new o.nc$(i),attenuationNear:new o.nc$(s),opacity:new o.nc$(m),fillColor:new o.nc$(new o.Q1f(n)),rgbShift:new o.nc$(new o.Pq0(-.003,0,.003))}]),vertexColors:!0,blending:l,side:u,transparent:c,depthWrite:f,depthTest:d,lights:!0}),[])}),L=T({vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The size of the point\n */\nuniform float pointSize;\n\n/**\n * The fill color of the point\n */\nuniform vec4 fillColor;\n\n/**\n * The far attenuation of the point.\n */\nuniform float attenuationFar;\n/**\n * The near attenuation of the point.\n */\nuniform float attenuationNear;\n\n/**\n * The texture coordinates of the data.\n */\nattribute vec2 dataTextureUV;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The texture coordinates of the data.\n */\nvarying vec2 vDataTextureUV;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n\nvoid main() {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0
199);\n float dist = distance(worldPosition.xyz, cameraPosition);\n float attenuation = easeInOutQuad(linearstep(attenuationFar, attenuationNear, dist));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = pointSize;\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = fillColor.rgb;\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vLightColor = lightColor;\n vUv = uv;\n vDataTextureUV = dataTextureUV;\n vAttenuation = attenuation;\n}\n",fragmentShader:"/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The texture for the point\n */\nuniform sampler2D tPoint;\n/**\n * The texture for the transition GPU data.\n */\nuniform sampler2D tTransitionGPUData;\n\n/**\n * The resolution of the point texture\n */\nuniform vec2 pointResolution;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The fill color of the particles.\n */\nuniform vec4 fillColor;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates of the particles.\n */\nvarying vec2 vUv;\n/**\n * The texture coordinates of the data.\n */\nvarying vec2 vDataTextureUV;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n\n/**\n * ***********************************\n * Main\n * ************************************\n */\n\nvoid main() {\n vec4 transitionGPUTextureColor = texture2D(tTransitionGPUData, vDataTextureUV);\n float transitionProgress = transitionGPUTextureColor.x;\n\n float alpha = vLightColor.r * opacity * vAttenuation * transitionProgress;\n if (alpha > 0.0) {\n vec4 pointColor = texture2D(tPoint, gl_PointCoord);\n gl_FragColor = vec4(pointColor.rgb * fillColor.rgb * vLightColor, pointColor.a * alpha);\n } else {\n discard;\n }\n}\n",extraUniforms:{tTransitionGPUData:new o.nc$(null)}});var z=n(9913);let V=(0,a.forwardRef)((e,t)=>{let{layers:n,color:i,radius:l,thickness:u,attenuationFar:f,attenuationNear:d,outlineOpacity:m,fillOpacity:p}=e,h=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),y=(0,a.useRef)(!1),w=(0,a.useRef)(null),[R,C]=(0,s.zh)(()=>({from:{val:0},onChange:e=>{g.current.material.uniforms.opacity.value=e.value.val*m,x.current.material.uniforms.opacity.value=e.value.val*p}}),[]),[b,S]=(0,s.zh)(()=>({from:{radius:0,opacity:0},onChange:e=>{if(!h.current||!v.current||!g.current||!x.current)return;let t=e.value.radius*l;h.current.geometry.dispose(),h.current.geometry=new o.rKP(t,t+u),v.current.scale.x=e.value.radius,v.current.scale.y=e.value.radius,v.current.geometry.attributes.position.needsUpdate=!0,g.current.material.uniforms.opacity.value=e.value.opacity*m,g.current.material.needsUpdate=!0,x.current.material.uniforms.opacity.value=e.value.opacity*p,x.current.material.needsUpdate=!0}}),[]),T=e=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{w.current=null,S.stop(!0),S.start({from:{radius:0,opacity:0},to:async e=>{!y.current&&h.current&&v.current&&g.current&&x.current?(await e({to:{radius:1,opacity:1},config:{duration:1e3,easing:s.le.easeOutCubic}}),!y.current&&h.current&&v.current&&g.current&&x.current)?(await e({to:{radius:1,opacity:0},config:{duration:1e3,easing:s.le.easeInCubic}}),!y.current&&h.current&&v.current&&g.current&&x.current)?await new Promise(e=>setTimeout(e,1e3)):await new Promise(e=>e):await new Promise(e=>e):await new Promise(e=>e)},loop:!0})},e)},P=(e,t)=>{y.current=!0,S.stop(!0),C.stop(!0),C.start({from:{val:1},to:{val:0},delay:t,config:{duration:e,easing:s.le.easeOutCubic}})},M=(e,t)=>{g.current.material.uniforms.attenuationFar.value=e,g.current.material.uniforms.attenuationNear.value=t,x.current.material.uniforms.attenuationFar.value=e,x.current.material.uniforms.attenuationNear.value=t};return(0,c._B)("deeppink"),(0,a.useEffect)(()=>()=>void(w.current&&clearTimeout(w.current),S.stop(!0),C.stop(!0)),[]),(0,a.useImperativeHandle)(t,()=>({present:T,dismiss:P,setAttenuation:M})),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("mesh",{ref:h,layers:n,children:[(0,r.jsx)("ringGeometry",{args:[l,l+u,32]}),(0,r.jsx)(N,{ref:g,fillColor:new o.Q1f(i),attenuationFar:f,attenuationNear:d})]}),(0,r.jsxs)("mesh",{ref:v,layers:n,children:[(0,r.jsx)("circleGeometry",{args:[l]}),(0,r.jsx)(N,{ref:x,fillColor:new o.Q1f(i),attenuationFar:f,attenuationNear:d})]})]})});V.displayName="CityEffectMarker";let k=(0,a.forwardRef)((e,t)=>{let{layers:n,cityKey:i,position:l,color:c,attenuationFar:f,attenuationNear:d,focusOutlineOpacity:m=1,focusFillOpacity:p=.3,markerOutlineOpacity:h=1,markerDotOpacity:g=1}=e,{datasetHolder:v}=(0,a.useContext)(u.fn),x=(0,a.useMemo)(()=>v.current.getCity(i),[]),y=(0,a.useRef)(null),w=(0,a.useRef)(null),R=(0,a.useRef)(null),C=(0,a.useRef)(null),b=(0,a.useRef)(null),S=(0,a.useRef)(null),T=(0,a.useRef)(null),[P,M]=(0,s.zh)(()=>({from:{val:0},onChange:e=>{b.current.material.uniforms.opacity.value=e.value.val*h,T.current.material.uniforms.opacity.value=e.value.val*g}}),[]),A=new o.Pq0,D=()=>{y.current.getWorldPosition(A);let e=A.clone().multiplyScalar(1.2);v.current.setCityMarkerPosition(i,A,e)},_=(e,t)=>
199{M.stop(!0),M.start({from:{val:0},to:{val:1},delay:t,config:{duration:e,easing:s.le.easeOutCubic}}),w.current?.present(t),R.current?.present(t+1500)},I=(e,t)=>{M.stop(!0),M.start({from:{val:1},to:{val:0},delay:t,config:{duration:e,easing:s.le.easeOutCubic}}),w.current?.dismiss(e,t),R.current?.dismiss(e,t)},E=(e,t)=>{b.current.material.uniforms.attenuationFar.value=e,b.current.material.uniforms.attenuationNear.value=t,T.current.material.uniforms.attenuationFar.value=e,T.current.material.uniforms.attenuationNear.value=t,w.current?.setAttenuation(e,t),R.current?.setAttenuation(e,t)};return(0,a.useEffect)(()=>{let e;e=y.current.position.clone().normalize().multiplyScalar(5e3),y.current.lookAt(e)},[l]),(0,a.useEffect)(()=>{y.current&&D()},[]),(0,a.useImperativeHandle)(t,()=>({present:_,dismiss:I,setAttenuation:E,position:y.current.position,recordWorldPosition:D})),x&&(0,r.jsxs)("group",{ref:y,layers:n,position:l,children:[(0,r.jsxs)("mesh",{ref:C,layers:n,children:[(0,r.jsx)("ringGeometry",{args:[10,13]}),(0,r.jsx)(N,{ref:b,fillColor:new o.Q1f(c),attenuationFar:f,attenuationNear:d})]}),(0,r.jsx)(z.jl,{ref:S,layers:n,args:[3,32],children:(0,r.jsx)(N,{ref:T,fillColor:new o.Q1f(c),attenuationFar:f,attenuationNear:d})}),x.isAwardCity&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V,{ref:w,layers:n,color:c,radius:48,thickness:6,outlineOpacity:m,fillOpacity:p,attenuationFar:f,attenuationNear:d}),(0,r.jsx)(V,{ref:R,layers:n,color:c,radius:48,thickness:6,outlineOpacity:m,fillOpacity:p,attenuationFar:f,attenuationNear:d})]})]})});k.displayName="CityMarker";let G=(e,t)=>{let n=new o.YHV().setFromVector3(e),r=new o.YHV().setFromVector3(e);r.theta+=Math.PI/180;let a=new o.B69().position.setFromSpherical(n),i=new o.B69().position.setFromSpherical(r).clone().sub(a).normalize().multiplyScalar(t);return a.clone().add(i)};var B=n(1343);let j=(0,a.forwardRef)((e,t)=>{let{sceneRef:n,layers:l,innerRadius:u,outerRadius:f,textColor:d=h.i.award.cityMarker.textColor,textOpacity:m=h.i.award.cityMarker.textOpacity,pointColor:p=h.i.award.cityMarker.pointColor,pointOpacity:g=h.i.award.cityMarker.pointOpacity,connectorColor:v=h.i.award.cityMarker.connectorColor,connectorOpacity:x=1}=e,{dataset:w,datasetHolder:b,setIsCityMarkerRendererReady:T,registerAwardCameraEvent:P,unregisterAwardCameraEvent:M}=(0,a.useContext)(C.fn),_=(0,a.useRef)(null),E=(0,a.useRef)(null),O=(0,a.useRef)([]),N=(0,a.useCallback)(e=>t=>{O.current[e]=t},[]),[z,V]=(0,a.useState)(null),j=(0,a.useRef)(null),$=(0,a.useRef)(null),W=(0,a.useRef)(null),[H,Y]=(0,a.useState)(null),X=(0,a.useRef)(null),q=(0,a.useRef)(null),[Z,Q]=(0,a.useState)(null),K=(0,a.useRef)(null),J=(0,a.useRef)(null),ee=(0,a.useRef)(null),[et,en]=(0,a.useState)(null),er=(0,a.useRef)(null),[ea,eo]=(0,s.zh)(()=>({from:{x:0,y:0}}),[]),[ei,es]=(0,s.zh)(()=>({from:{val:0},onChange:e=>{q.current.material.uniforms.opacity.value=e.value.val*g,ee.current.material.uniforms.opacity.value=e.value.val*x,W.current.material.uniforms.opacity.value=e.value.val*m}}),[]),el=(0,i.C)(e=>e.gl),eu=(e=>{let t,n,r,i,s,l,u,c,f,d,m,p=(0,B.c)(21),{gl:h,clock:g,sceneRef:v,dataset:x,pointMaterialRef:y,connectorMaterialRef:w,instanceLabelMatRef:C,instancedLabelMeshRef:b,instancedLabelGeomRef:S,rotationAnimationProps:T,innerRadius:P,instancedLabelElement:M}=e,_=(0,a.useRef)(S).current,E=(0,a.useRef)(b).current,U=(0,a.useRef)(y).current,O=(0,a.useRef)(w).current,F=(0,a.useRef)(C).current,N=(0,a.useRef)(null),L=(0,a.useRef)(null),z=(0,a.useRef)(null),V=(0,a.useRef)(null);p[0]===Symbol.for("react.memo_cache_sentinel")?(t={},p[0]=t):t=p[0];let k=(0,a.useRef)(t),G=(0,a.useRef)(null);p[1]===Symbol.for("react.memo_cache_sentinel")?(n={},p[1]=n):n=p[1];let j=(0,a.useRef)(n),$=(0,a.useRef)(null);p[2]===Symbol.for("react.memo_cache_sentinel")?(r={},p[2]=r):r=p[2];let W=(0,a.useRef)(r);p[3]===Symbol.for("react.memo_cache_sentinel")?(i=new o.I9Y(0,0),p[3]=i):i=p[3];let H=(0,a.useRef)(i);p[4]===Symbol.for("react.memo_cache_sentinel")?(s=new o.I9Y(0,0),p[4]=s):s=p[4];let Y=(0,a.useRef)(s);p[5]===Symbol.for("react.memo_cache_sentinel")?(l=new o.I9Y(0,0),p[5]=l):l=p[5];let X=(0,a.useRef)(l);p[6]===Symbol.for("react.memo_cache_sentinel")?(u=[],p[6]=u):u=p[6];let q=(0,a.useRef)(u),Z=(0,a.useRef)(!1);(0,a.useRef)(1e7),p[7]!==g||p[8]!==x||p[9]!==h||p[10]!==P||p[11]!==M||p[12]!==T?(c=(e,t,n,r,a,i,s,l,u,c,f)=>{if(N.current||L.current||z.current||!E.current||null===M)return;(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupGPUComputationRenderer");let d=x.current.cityArrayList.length;H.current.set(d,1),Y.current.set(d,1),X.current.set(6,d),N.current=ne
199w R.d(H.current.x,H.current.y,h),L.current=new R.d(Y.current.x,Y.current.y,h),z.current=new R.d(X.current.x,X.current.y,h),(0,A.n)()&&(N.current.setDataType(o.ix0),L.current.setDataType(o.ix0),z.current.setDataType(o.ix0));let m=N.current.createTexture(),p=L.current.createTexture(),v=z.current.createTexture(),y=_.current.attributes.offset.array,w=0;for(let h=0;h<d;h++){let d,g,R,C,b,S,T=x.current.cityArrayList[h].coordinate.latitude,P=x.current.cityArrayList[h].coordinate.longitude,M=T>=c.min&&T<=c.max&&P>=f.min&&P<=f.max,A=4*h;M?(d=n*w+e,g=t,w++):(d=3,g=0),m.image.data.set([0,d,g,0],A),M?(R=i*w+r,C=a,w++):(R=3,C=0),p.image.data.set([0,R,C,0],A),M?(b=u*w+s,S=l,w++):(b=3,S=0);let D=4*h*6;v.image.data.set([0,b,S,0,0,0,0,0,0,o.cj9.randFloat(-Math.PI,Math.PI),0,0,0,.01,0,0,0,0,0,0,h,y[3*h+0],y[3*h+1],y[3*h+2]],D)}m.needsUpdate=!0,p.needsUpdate=!0,v.needsUpdate=!0,V.current=N.current.addVariable("tTransitionGPUData",I,m),G.current=L.current.addVariable("tTransitionGPUData",I,p),$.current=z.current.addVariable("tLabelEffectGPUData","/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_math>\n#include <ftmr_matrix>\n\nuniform float delta;\nuniform float time;\n\nuniform mat4 instanceMatrices[168];\nuniform mat4 modelMatrix;\n// uniform mat4 viewMatrix; /** Redefinition */\n// uniform mat4 modelViewMatrix; /** Redefinition */\nuniform mat4 projectionMatrix;\nuniform vec2 pointer;\nuniform vec2 screenResolution;\n// uniform vec3 cameraPosition; /** Redefinition */\n\nuniform vec2 rotation;\nuniform float innerRadius;\n\nuniform float attenuationFar;\nuniform float attenuationNear;\n\nuniform float glitchDuration;\nuniform float mosaicDuration;\n\nuniform float shouldStartTransition;\n\nconst vec3 up = vec3(0.0, 1.0, 0.0);\n\nconst int DEFAULT = 0;\nconst int TRANSITION = 1;\nconst int VISIBLE = 2;\nconst int INVISIBLE = 3;\n\nconst int UV_TRANSITION = 0;\nconst int UV_EFFECT = 1;\nconst int UV_DISPLACE = 2;\nconst int UV_NOISE = 3;\nconst int UV_MOSAIC = 4;\nconst int UV_POSITION = 5;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n float pixelUnitX = 1.0 / resolution.x;\n\n /**\n * Column X uses +0.5 texel-center offsets: corner-exact UVs with NearestFilter round to an\n * implementation-dependent neighbor texel (ANGLE D3D11 vs Metal diverge).\n * gl_FragCoord.y already carries the +0.5 center.\n */\n vec2 currentUV = gl_FragCoord.xy / resolution.xy;\n vec2 transitionUV = vec2(0.5, gl_FragCoord.y) / resolution.xy;\n vec2 effectUV = vec2(1.5, gl_FragCoord.y) / resolution.xy;\n vec2 displaceUV = vec2(2.5, gl_FragCoord.y) / resolution.xy;\n vec2 noiseUV = vec2(3.5, gl_FragCoord.y) / resolution.xy;\n vec2 mosaicUV = vec2(4.5, gl_FragCoord.y) / resolution.xy;\n vec2 positionUV = vec2(5.5, gl_FragCoord.y) / resolution.xy;\n\n vec4 transitionColor = texture2D(tLabelEffectGPUData, transitionUV);\n vec4 effectColor = texture2D(tLabelEffectGPUData, effectUV);\n vec4 displaceColor = texture2D(tLabelEffectGPUData, displaceUV);\n vec4 noiseColor = texture2D(tLabelEffectGPUData, noiseUV);\n vec4 mosaicColor = texture2D(tLabelEffectGPUData, mosaicUV);\n vec4 positionColor = texture2D(tLabelEffectGPUData, positionUV);\n\n float transitionProgress = transitionColor.x;\n float transitionDelay = transitionColor.y;\n float transitionDuration = transitionColor.z;\n float transitionFinished = transitionColor.w;\n\n float currentStatus = effectColor.x;\n float nextStatus = currentStatus;\n float glitchTime = effectColor.y;\n float mosaicTime = effectColor.z;\n float previousAttenuation = effectColor.w;\n\n float displaceStrength = displaceColor.x;\n float displaceRotation = displaceColor.y;\n\n float noiseStrength = noiseColor.x;\n float noiseReduction = noiseColor.y;\n\n float mosaicStrength = mosaicColor.x;\n float mosaicReduction = mosaicColor.y;\n\n float instanceIndex = positionColor.x;\n vec3 position = positionColor.yzw;\n\n mat4 instanceMatrix = instanceMatrices[int(instanceIndex)];\n\n if (int(gl_FragCoord.x) == UV_TRANSITION) {\n /**\n * * Transition\n */\n float delay
199= transitionDelay;\n float duration = transitionDuration;\n float isFinished = transitionFinished;\n\n if (isFinished > 0.0 || shouldStartTransition < 1.0) {\n gl_FragColor = vec4(transitionProgress, transitionDelay, transitionDuration, transitionFinished);\n return;\n }\n if (delay < time) {\n float timeElapsed = (time - delay) / duration;\n float progress = min(timeElapsed / duration, 1.0);\n float isFinished = progress >= 1.0 ? 1.0 : 0.0;\n gl_FragColor = vec4(progress, delay, duration, isFinished);\n } else {\n gl_FragColor = vec4(transitionProgress, transitionDelay, transitionDuration, transitionFinished);\n }\n } else if (int(gl_FragCoord.x) == UV_EFFECT) {\n if (transitionProgress <= 0.0) {\n gl_FragColor = effectColor;\n return;\n }\n /**\n * * Effect Status\n */\n /**\n * Rotate the position.\n */\n float phi = rotation.x; /**\n * Vertical rotation around the X-axis\n */\n float theta = rotation.y; /**\n * Horizontal rotation around the Y-axis\n */\n vec4 rotatedPosition = vec4(rotate(position, phi, -theta), 1.0);\n\n vec4 modelPosition = modelMatrix * rotatedPosition;\n vec4 modelViewPosition = modelMatrix * viewMatrix * rotatedPosition;\n vec4 projectionPosition = projectionMatrix * viewMatrix * modelMatrix * rotatedPosition;\n\n float dist = distance(modelPosition.xyz, cameraPosition);\n float nextAttenuation = easeInOutQuad(linearstep(attenuationFar, attenuationNear, dist));\n\n if (int(currentStatus) == DEFAULT) {\n glitchTime = 0.0;\n mosaicTime = 0.0;\n nextStatus = float(TRANSITION);\n } else if (int(currentStatus) == TRANSITION) {\n if (0.0 < nextAttenuation) {\n nextStatus = float(VISIBLE);\n }\n } else if (int(currentStatus) == VISIBLE) {\n glitchTime += delta;\n glitchTime = clamp(glitchTime, 0.0, glitchDuration);\n mosaicTime += delta;\n mosaicTime = clamp(mosaicTime, 0.0, mosaicDuration);\n if (nextAttenuation <= 0.0) {\n nextStatus = float(INVISIBLE);\n }\n } else if (int(currentStatus) == INVISIBLE) {\n glitchTime -= delta;\n glitchTime = clamp(glitchTime, 0.0, glitchDuration);\n mosaicTime -= delta;\n mosaicTime = clamp(mosaicTime, 0.0, mosaicDuration);\n if (0.0 < nextAttenuation) {\n nextStatus = float(VISIBLE);\n }\n }\n\n gl_FragColor = vec4(nextStatus, glitchTime, mosaicTime, nextAttenuation);\n } else if (int(gl_FragCoord.x) == UV_DISPLACE) {\n if (transitionProgress <= 0.0) {\n gl_FragColor = displaceColor;\n return;\n }\n /**\n * * Displace Effect\n */\n displaceStrength = clamp(glitchTime / glitchDuration, 0.0, 1.0);\n displaceRotation += 30.0 * PI / 180.0 * delta;\n displaceRotation = mod(displaceRotation, PI2);\n gl_FragColor = vec4(displaceStrength, displaceRotation, 0.0, 0.0);\n } else if (int(gl_FragCoord.x) == UV_NOISE) {\n if (transitionProgress <= 0.0) {\n gl_FragColor = noiseColor;\n return;\n }\n /**\n * * Noise Effect\n */\n noiseStrength = clamp(glitchTime / glitchDuration, 0.0, 1.0);\n gl_FragColor = vec4(noiseStrength, noiseReduction, 0.0, 0.0);\n } else if (int(gl_FragCoord.x) == UV_MOSAIC) {\n if (transitionProgress <= 0.0) {\n gl_FragColor = mosaicColor;\n return;\n }\n /**\n * * Mosaic Effect\n */\n mosaicStrength = clamp(mosaicTime / mosaicDuration, 0.0, 1.0);\n gl_FragColor = vec4(mosaicStrength, mosaicReduction, 0.0, 0.0);\n } else if (int(gl_FragCoord.x) == UV_POSITION) {\n /**\n * * Position Effect\n */\n gl_FragColor = vec4(instanceIndex, position.xyz);\n } else {\n discard;\n }\n}\n",v),V.current.material.needsUpdate=!0,G.current.material.needsUpdate=!0,$.current.material.needsUpdate=!0,N.current.setVariableDependencies(V.current,[V.current]),L.current.setVariableDependencies(G.current,[G.current]),z.current.setVariableDependencies($.current,[$.current]),k.current=V.current.material.uniforms,j.current=G.current.material.uniforms,W.current=$.current.material.uniforms;let C=g.getDelta();k.current.delta=new o.nc$(C),k.current.time=new o.nc$(0),k.current.shouldStartTransition=new o.nc$(0),j.current.delta=new o.nc$(C),j.current.time=new o.nc$(0),j.current.shouldStartTransition=new o.nc$(0),W.current.delta=new o.nc$(C),W.current.time=new o.nc$(0),W.current.instanceMatrices=new o.nc$(q.current),W.current.modelMatrix=new o.nc$(new o.kn4),W.current.viewMatrix=new o.nc$(new o.kn4),W.current.modelViewMatrix=new o.nc$(new o.kn4),W.current.projectionMatrix=new o.nc$(new o.kn4),W.current.cameraPosition=new o.nc$(new o.Pq0),W.current.attenuationFar=new o.nc$(2400),W.current.attenuationNear=new o.nc$(1800),W.current.rotation=new o.nc$(new o.I9Y(T.x.get(),T.y.get())),W.current.innerRadius=new o.nc$(P),W.current.glitchDuration=new o.nc$(1.5),W.current.mosaicDuration=new o.nc$(.75),W.current.shouldStartTransition=new o.nc$(0);let b=N.current.init(),S=L.current.init(),U=z.current.init();null!==b&&(0,D.Rm)("green","â","gpuPointRenderer init error",b),null!==S&&(0,D.Rm)("green","â","gpuConnectorRenderer init error",S),null!==U&&(0,D.Rm)("green","â","gpuLabelRenderer init error",U),m.dispose(),p.dispose(),v.dispose(),_.current.attributes.position.needsUpdate=!0,_.current.attributes.offset.needsUpdate=!0,_.current.attributes.instanceIndex.needsUpdate=!0;let O=_.current.attributes.offset.array;for(let e=0;e<O.length;e++){let t=new o.kn4;t.setPosition(new o.Pq0(O[3*e+0],O[3*e+1],O[3*e+2])),E.current.setMatr
199ixAt(e,t),q.current.push(t)}E.current.instanceMatrix.setUsage(o.Vnu),E.current.instanceMatrix.needsUpdate=!0,Z.current=!0},p[7]=g,p[8]=x,p[9]=h,p[10]=P,p[11]=M,p[12]=T,p[13]=c):c=p[13];let Q=c;p[14]!==T||p[15]!==v?(f=(e,t)=>{Z.current&&(k.current.delta.value=t,k.current.time.value=k.current.time.value+t,j.current.delta.value=t,j.current.time.value=j.current.time.value+t,W.current.delta.value=t,W.current.time.value=W.current.time.value+t,W.current.instanceMatrices.value=q.current,W.current.modelMatrix.value=v.current.camera.matrixWorld,W.current.viewMatrix.value=v.current.camera.matrixWorldInverse,W.current.modelViewMatrix.value=v.current.camera.matrixWorld.multiply(v.current.camera.matrixWorldInverse),W.current.projectionMatrix.value=v.current.camera.projectionMatrix,W.current.cameraPosition.value=v.current.camera.position,W.current.rotation.value.x=T.x.get(),W.current.rotation.value.y=T.y.get(),V.current.material.needsUpdate=!0,G.current.material.needsUpdate=!0,$.current.material.needsUpdate=!0,N.current.compute(),L.current.compute(),z.current.compute(),U.current.material.uniforms.delta.value=t,U.current.material.uniforms.time.value=U.current.material.uniforms.time.value+t,U.current.material.uniforms.tTransitionGPUData.value=N.current.getCurrentRenderTarget(V.current).texture,O.current.material.uniforms.delta.value=t,O.current.material.uniforms.time.value=O.current.material.uniforms.time.value+t,O.current.material.uniforms.tTransitionGPUData.value=L.current.getCurrentRenderTarget(G.current).texture,F.current.material.uniforms.delta.value=t,F.current.material.uniforms.time.value=F.current.material.uniforms.time.value+t,F.current.material.uniforms.tLabelEffectGPUData.value=z.current.getCurrentRenderTarget($.current).texture,U.current.material.needsUpdate=!0,U.current.material.uniforms.tTransitionGPUData.value.needsUpdate=!0,O.current.material.needsUpdate=!0,O.current.material.uniforms.tTransitionGPUData.value.needsUpdate=!0,F.current.material.needsUpdate=!0,F.current.material.uniforms.tLabelEffectGPUData.value.needsUpdate=!0)},p[14]=T,p[15]=v,p[16]=f):f=p[16];let K=f;p[17]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{N.current?.dispose(),N.current=null,L.current?.dispose(),L.current=null,z.current?.dispose(),z.current=null,Z.current=!1},p[17]=d):d=p[17];let J=d;return p[18]!==K||p[19]!==Q?(m={setupGPUComputationRenderer:Q,render:K,isRendererReady:Z,gpuPointTransitionDataUniforms:k,gpuConnectorTransitionDataUniforms:j,gpuLabelEffectDataUniforms:W,gpuPointTransitionDataVariable:V,gpuConnectorTransitionDataVariable:G,gpuLabelEffectDataVariable:$,dispose:J},p[18]=K,p[19]=Q,p[20]=m):m=p[20],m})({gl:el,clock:(0,i.C)(e=>e.clock),sceneRef:n,dataset:b,pointMaterialRef:q,connectorMaterialRef:ee,instanceLabelMatRef:W,instancedLabelMeshRef:j,instancedLabelGeomRef:$,rotationAnimationProps:ea,innerRadius:u,instancedLabelElement:H}),ec=(e,t,n,r,a,o,i,l,u,c,f,d,m,p,h,g)=>{es.stop(!0),es.start({from:{val:ei.val},to:{val:1},delay:t,config:{duration:e,easing:s.le.easeOutCubic}});let v=0;for(let e=0;e<O.current.length;e++){let t,o,i=O.current[e],s=b.current.cityArrayList[e],l=s.coordinate.latitude,u=s.coordinate.longitude;h.min<l&&l<h.max&&g.min<u&&u<g.max?(t=a*v+n,o=r,v++):(t=3e3,o=100),i.present(o,t)}eu.setupGPUComputationRenderer(o/1e3,i/1e3,l/1e3,u/1e3,c/1e3,f/1e3,d/1e3,m/1e3,p/1e3,h,g),eu.gpuPointTransitionDataUniforms.current.shouldStartTransition.value=1,eu.gpuPointTransitionDataVariable.current.material.needsUpdate=!0,eu.gpuConnectorTransitionDataUniforms.current.shouldStartTransition.value=1,eu.gpuConnectorTransitionDataVariable.current.material.needsUpdate=!0,eu.gpuLabelEffectDataUniforms.current.shouldStartTransition.value=1,eu.gpuLabelEffectDataVariable.current.material.needsUpdate=!0},ef=(e,t)=>{es.stop(!0),es.start({from:{val:1},to:{val:0},delay:t,config:{duration:e,easing:s.le.easeOutCubic}});for(let n=0;n<O.current.length;n++)O.current[n].dismiss(e,t)},ed=new o.Pq0,em=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s.le.easeOutCubic;_.current.rotation.x=e,_.current.rotation.y=t,ee.current.material.uniforms.innerRotation.value=new o.Pq0(e,t,0),ee.current.material.needsUpdate=!0,eo.stop(!0),eo.start({from:{x:ea.x,y:ea.y},to:{x:e,y:t},delay:r,config:{duration:n,easing:a},onChange:e=>{if(E.current&&ee.current){E.current.rotation.x=e.value.x,E.current.rotation.y=e.value.y,ed.set(e.value.x,e.value.y,0),ee.current.material.uniforms.outerRotation.value=ed,ee.current.material.needsUpdate=!0;for(let e=0;e<O.current.length;e++)O.current[e].recordWorldPosition()}},onRest:()=>{E.current&&ee.current&&(E.current.rotation.x=e,E.current.rotation.y=t,ed.set(e,t,0),ee.current.material.uniforms.outerRotation.value=ed,ee.current.material.needsUpdate=!0)}})},ep=(0,a.useRef)(0);return(0,c._B)("green"),(0,a.useEffect)(()=>{let e=(e,t)=>
199{if(e===C.LC.POSITION_CHANGED){let e=t.distanceToCityMarkerNearestSurface;if(ep.current!==e){q.current.material.uniforms.attenuationFar.value=1.25*e,q.current.material.uniforms.attenuationNear.value=.8*e,ee.current.material.uniforms.attenuationFar.value=1.25*e,ee.current.material.uniforms.attenuationNear.value=.8*e,W.current.material.uniforms.attenuationFar.value=1.1*e,W.current.material.uniforms.attenuationNear.value=.6*e;for(let t=0;t<O.current.length;t++)O.current[t].setAttenuation(1.25*e,.8*e);eu.gpuLabelEffectDataUniforms.current.attenuationFar.value=1.1*e,eu.gpuLabelEffectDataUniforms.current.attenuationNear.value=.6*e,ep.current=e}}};return P(e),()=>{M(e),eu.dispose(),er.current?.dispose(),er.current=null,T(!1)}},[]),(0,a.useEffect)(()=>{b.current?((()=>{(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupInstanceLabelElement");let{texture:e,labelWidth:t,labelHeight:n,offsetAttributes:a,centerAttributes:i,normalAttributes:s,instanceIndexAttributes:u,tileUVAttributes:c,scaleAttributes:m}=((e,t,n,r)=>{let{texture:a,canvasWidth:i,canvasHeight:s,labelWidth:l,labelHeight:u,labelSize:c}=r(e,t.cityArrayList,"N'00.00000\xb0 E'000.00000\xb0","USansRgBd",64,"USansRgBd",38),f=t.cityArrayList.length,d=new Float32Array(3*f),m=new Float32Array(3*f),p=new Float32Array(3*f),h=new Float32Array(f),g=new Float32Array(2*f),v=new Float32Array(f);for(let e=0;e<f;e++){let r=t.cityArrayList[e];r.labelSize=c[e];let a=r.coordinate.latitude+r.offset.latitude-90,i=(r.coordinate.longitude+r.offset.longitude-180)%360,s=new o.YHV(n,a*y.V$,i*y.V$),u=new o.B69().position.setFromSpherical(s),x=r.isAwardCity?1:.59375,w=G(u,x*l*.28),R=w.clone().normalize(),C=new o.I9Y(e/f,0);d.set([w.x,w.y,w.z],3*e),m.set([u.x,u.y,u.z],3*e),p.set([R.x,R.y,R.z],3*e),h[e]=e,g.set([C.x,C.y],2*e),v[e]=x}return{texture:a,labelWidth:l,labelHeight:u,offsetAttributes:d,centerAttributes:m,normalAttributes:p,instanceIndexAttributes:h,tileUVAttributes:g,scaleAttributes:v}})(el,b.current,f,S.lj);er.current?.dispose(),er.current=e;let p=b.current.cityArrayList.length;Y((0,r.jsxs)("instancedMesh",{ref:j,layers:l,args:[void 0,void 0,p],children:[(0,r.jsxs)("planeGeometry",{ref:$,args:[t,n],children:[(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-offset",args:[a,3]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-center",args:[i,3]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-normal",args:[s,3]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-instanceIndex",args:[u,1]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-tileUV",args:[c,2]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-textScale",args:[m,1]})]}),(0,r.jsx)(F,{ref:W,texture:e,numTotalInstances:p,gpuLabelDataDimension:6,fillColor:new o.Q1f(d),attenuationFar:2400,attenuationNear:1800})]}))})(),(()=>{(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupPointElement");let{pointPositions:e,pointNormals:t,dataTextureUVs:n}=((e,t)=>{let n=e.cityArrayList.length,r=new Float32Array(3*n),a=new Float32Array(3*n),i=new Float32Array(2*n);for(let s=0;s<n;s++){let l=e.cityArrayList[s],u=l.coordinate.latitude+l.offset.latitude-90,c=(l.coordinate.longitude+l.offset.longitude-180)%360,f=new o.YHV(t,u*y.V$,c*y.V$),d=new o.B69().position.setFromSpherical(f),m=3*s;r.set([d.x,d.y,d.z],m);let p=d.normalize();a.set([p.x,p.y,p.z],m),i.set([(s+.5)/n,.5],2*s)}return{pointPositions:r,pointNormals:a,dataTextureUVs:i}})(b.current,f);Q((0,r.jsxs)("points",{ref:X,layers:l,children:[(0,r.jsxs)("bufferGeometry",{children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",args:[e,3],count:e.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-normal",args:[t,3],count:t.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-dataTextureUV",args:[n,2],count:n.length/2})]}),(0,r.jsx)(L,{ref:q,fillColor:new o.Q1f(p),attenuationFar:2800,attenuationNear:1800})]}))})(),(()=>{(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupConnectorElement");let{positions:e,normals:t,colors:n,angles:a,isInners:i,dataTextureUVs:s}=((e,t,n,r)=>{let a=e.cityArrayList.length,i=new o.Q1f(r),s=new Float32Array(3*a*2),l=new Float32Array(3*a*2),u=new Float32Array(3*a*2).fill(i.r,i.g,i.b),c=new Float32Array(2*a*2),f=new Float32Array(2*a),d=new Float32Array(2*a*2);for(let r=0;r<a;r++){let i=e.cityArrayList[r],u=i.coordinate.latitude-90,m=(i.coordinate.longitude-180)%360,p=new o.YHV(t,u*y.V$,m*y.V$),h=new o.B69().position.setFromSpherical(p),g=i.coordinate.latitude+i.offset.latitude-90,v=(i.coordinate.longitude+i.offset.longitude-180)%360,x=new o.YHV(n,g*y.V$,v*y.V$),w=new o.B69().position.setFromSpherical(x),R=h.clone().normalize(),C=w.clone().normalize();s.set([h.x,h.y,h.z,w.x,w.y,w.z],6*r),l.set([R.x,R.y,R.z,C.x,C.y,C.z],6*r),c.set([y.ss-p.theta,p.phi,y.ss-x.theta,x.phi],4*r),f.set([1,0],2*r),d.set([(r+.5)/a,.5,(r+.5)/a,.5],4*r)}return{positions:s,normals:l,colors:u,angles:c,isInners:f,dataTextureUVs:d}})(b.current,u,f,v);en((0,r.jsxs)("lineSegments",{ref:K,layers:l,children:[(0,r.jsxs)("bufferGeometry",{ref:J,children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",args:[e,3],count:e.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-normal",args:[t,3],count:t.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-color",args:[n,3],count:n.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-angle",args:[a,2],count:a.length}),(0,r.jsx)("bufferAttribute",{attach:"attributes-inner",args:[i,1],count:i.length}),(0,r.jsx)("bufferAttribute",{attach:"attributes-dataTextureUV",args:[s,2],count:s.length/2})]}),(0,r.jsx)(U,{ref:ee,lineColor:new o.Q1f(v),innerRadius:u,outerRadius:f,attenuationFar:2800,attenuationNear:1800})]}))})(),(()=>{var e;(0,D.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupCountryMarkerElement");let{markers:t}=(e=b.current,{markers:e.cityArrayList.map((e,t)=>{let n=e.coordinate.latitude-90,r=(e.coordinate.longitude-180)%360,a=new o.YHV(u,n*y.V$,r*y.V$);return{position:new o.B69().position.setFromSpherical(a),color:e.color,cityKey:e.key,index:t}})});V(t.map(e=>(0,r.jsx)(k,{ref:N(e.index),layers:l,position:e.position,color:e.color,cityKey:e.cityKey,attenuationFar:3400,attenuationNear:1800},e.index)))})()):(0,D.z3)("red","\uD83D\uDEA8","CityMarkerRenderer: dataset is not ready.")},[w]),(0,a.useEffect)(()=>{H&&Z&&et&&z&&T(!0)},[H,Z,et,z]),(0,c.Ql)((e,t)=>{eu.render(e,t)}),(0,a.useImperativeHandle)(t,()=>
199({present:ec,dismiss:ef,rotate:em})),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("group",{ref:_,layers:l,children:z}),(0,r.jsxs)("group",{ref:E,layers:l,children:[Z,et,H]})]})});j.displayName="CityMarkerRenderer";var $=n(81);let W=E({vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The radius of the inner globe.\n */\nuniform float innerRadius;\n/**\n * The radius of the outer globe.\n */\nuniform float outerRadius;\n/**\n * The rotation of the inner globe.\n */\nuniform vec3 innerRotation;\n/**\n * The rotation of the outer globe.\n */\nuniform vec3 outerRotation;\n\n/**\n * The far attenuation of the point.\n */\nuniform float attenuationFar;\n/**\n * The near attenuation of the point.\n */\nuniform float attenuationNear;\n\n/**\n * The line color.\n */\nuniform vec3 lineColor;\n\n/**\n * The angle of the vertex.\n */\nattribute vec2 angle;\n/**\n * The visibility of the line.\n */\nattribute float visible;\n/**\n * The flag that indicates whether the vertex is on the inner globe.\n */\nattribute float inner;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n/**\n * The visibility of the line.\n */\nvarying float vVisible;\n\nvoid main() {\n vec3 rotatedPosition = position;\n if (inner > 0.0) {\n vec3 diffRotation = innerRotation - outerRotation;\n float angleX = angle.x + diffRotation.y;\n float angleY = angle.y - diffRotation.x;\n float px = cos(angleX) * sin(angleY) * innerRadius;\n float py = cos(angleY) * innerRadius;\n float pz = sin(angleX) * sin(angleY) * innerRadius;\n rotatedPosition = vec3(px, py, pz);\n }\n\n /**\n * The world position of the vertex.\n */\n vec4 worldPosition = modelMatrix * vec4(rotatedPosition, 1.0
199);\n /**\n * The position of the vertex in the clip space.\n */\n vec4 mvPosition = modelViewMatrix * vec4(rotatedPosition, 1.0);\n\n /**\n * The distance from the camera.\n */\n float dist = distance(worldPosition.xyz, cameraPosition);\n /**\n * The attenuation of the point.\n */\n float attenuation = easeInOutQuad(linearstep(attenuationFar, attenuationNear, dist));\n\n /**\n * The position of the vertex in the clip space.\n */\n gl_Position = projectionMatrix * mvPosition;\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = lineColor.rgb;\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vUv = uv;\n vLightColor = lightColor;\n vVisible = visible;\n vAttenuation = attenuation;\n}\n",fragmentShader:"/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The far distance of the attenuation effect.\n */\nuniform float attenuationFar;\n/**\n * The near distance of the attenuation effect.\n */\nuniform float attenuationNear;\n\n/**\n * The color of the line.\n */\nuniform vec3 lineColor;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The visibility of the line.\n */\nvarying float vVisible;\n\n/**\n * **********************************\n * Main\n * ***********************************\n */\n\nvoid main() {\n float alpha = vLightColor.r * opacity * vAttenuation;\n\n if (vVisible > 0.0 && alpha > 0.0) {\n gl_FragColor = vec4(lineColor, alpha);\n } else {\n discard;\n }\n}\n",defaultOpacity:0}),H=(0,a.forwardRef)((e,t)=>{let{texture:n,attenuationFar:i,attenuationNear:s,numTotalInstances:l,numTextureColumns:u=36,numTextureRows:c=18,domeCenter:f=new o.Pq0,fillColor:d=new o.Q1f(h.i.portrait.symbolColor),side:m=o.hB5,transparent:p=!0,depthTest:g=!0,depthWrite:v=!1}=e,x=(0,a.useRef)(null);return(0,a.useEffect)(()=>{x.current&&n&&(n.anisotropy=16,n.needsUpdate=!0,x.current.uniforms.tDiffuse.value=n,x.current.needsUpdate=!0)},[n]),(0,a.useImperativeHandle)(t,()=>({material:x.current})),(0,r.jsx)("shaderMaterial",{ref:x,vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\nuniform float delta;\nuniform float time;\n\nuniform vec3 domeCenter;\n\nuniform float numTotalInstances;\nuniform float numTextureColumns;\nuniform float numTextureRows;\n\nattribute vec3 offset;\nattribute float instanceIndex;\nattribute vec2 coordinate;\nattribute vec2 matrixIndex;\nattribute vec2 tileUV;\nattribute float visible;\n\n/**\n * The far attenuation of the point.\n */\nuniform float attenuationFar;\n/**\n * The near attenuation of the point.\n */\nuniform float attenuationNear;\n\n/**\n * The UV coordinates of the particles.\n */\nvarying vec2 vUv;\n/**\n * The instance index.\n */\nvarying float vInstanceIndex;\n/**\n * The coordinate of the symbol.\n */\nvarying vec2 vCoordinate;\n/**\n * The matrix index of the symbol.\n */\nvarying vec2 vMatrixIndex;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n/**\n * The attenuation of the symbol.\n */\nvarying float vAttenuation;\n/**\n * The tile UV coordinates.\n */\nvarying vec2 vTileUV;\n/**\n * The visible flag.\n */\nvarying float vVisible;\n\nconst vec3 up = vec3(0.0, 1.0, 0.0);\n\nvoid main() {\n /**\n * Calculate the world position of the instance.\n */\n vec4 instanceWorldPosition = instanceMatrix * vec4(offset, 1.0);\n\n /**\n * * The look at matrix.\n * *\n * * Reason for inverting lookAtMatrix:\n * *\n * * The `lookAt` function generates the camera's view matrix based on the camera's position,\n * * the target position, and the up vector. This matrix creates the coordinate system for the\n * * scene as viewed from the camera.\n * *\n * * When calculating the position of objects within the shader, it is typically necessary to\n * * transform from world space to view space. Therefore, inverting the matrix obtained from\n * * `lookAt` allows for the correct transformation of the object's position, ensuring that it\n * * is rendered correctly based on the camera's perspective.\n */\n mat4 lookAtMatrix = inverse(lookAt(domeCenter, instanceWorldPosition.xyz, up));\n\n /**\n * Calculate the world position of the vertex.\n */\n vec4 vertexLocalPosition = vec4(rotate(position, 0.0, 3.1415926535897932384626433832795), 1.0);
199\n // vec4 vertexLocalPosition = vec4(position, 1.0);\n vec4 vertexWorldPosition = lookAtMatrix * vertexLocalPosition;\n\n /**\n * Combine the instance and vertex positions.\n */\n vec4 worldPosition = instanceWorldPosition + vertexWorldPosition;\n\n /**\n * The final position of the vertex.\n */\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * worldPosition;\n // gl_Position = projectionMatrix * viewMatrix * instanceMatrix * vec4(position, 1.0); /** For debug */\n\n vec4 distancePosition = modelMatrix * worldPosition;\n float dist = distance(distancePosition.xyz, cameraPosition);\n float attenuation = easeInOutSine(linearstep(attenuationFar, attenuationNear, dist));\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = vec3(0.0);\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Varying variables.\n */\n vUv = uv;\n vInstanceIndex = instanceIndex;\n vCoordinate = coordinate;\n vMatrixIndex = matrixIndex;\n vLightColor = lightColor;\n vTileUV = tileUV;\n vVisible = visible;\n vAttenuation = attenuation;\n}\n",fragmentShader:"/**\n * The diffuse textures that contains the text symbols\n */\nuniform sampler2D tDiffuse;\n\n/**\n * The total number of instances\n */\nuniform float numTotalInstances;\n\n/**\n * The far distance of the attenuation effect.\n */\nuniform float attenuationFar;\n/**\n * The near distance of the attenuation effect.\n */\nuniform float attenuationNear;\n\n/**\n * The number of columns of the diffuse texture\n */\nuniform float diffuseTextureColumns;\n/**\n * The number of rows of the diffuse texture\n */\nuniform float diffuseTextureRows;\n\n/**\n * The resolution of the displacement texture\n */\nuniform vec2 displaceResolution;\n\n/**\n * The opacity of the symbol\n */\nuniform float opacity;\n/**\n * The RGB shift value of the symbol\n */\nuniform vec3 rgbShift;\n/**\n * The fill color of the symbol\n */\nuniform vec4 fillColor;\n\n/**\n * The UV coordinates of the particles.\n */\nvarying vec2 vUv;\n/**\n * The instance index.\n */\nvarying float vInstanceIndex;\n/**\n * The coordinate of the symbol.\n */\nvarying vec2 vCoordinate;\n/**\n * The matrix index of the symbol.\n */\nvarying vec2 vMatrixIndex;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n/**\n * The attenuation of the symbol.\n */\nvarying float vAttenuation;\n/**\n * The tile UV coordinates.\n */\nvarying vec2 vTileUV;\n/**\n * The visible flag.\n */\nvarying float vVisible;\n\n/**\n * Function to get the UV coordinates\n *\n * This function calculates the UV coordinates based on the texture index.\n * When calculating the row index, the direction of the Y-axis is different, so the row index needs to be reversed.\n *\n * @param uv - Input UV coordinates\n * @param texIndex - Texture index\n * @param numGridX - Number of grids in the X direction\n * @param numGridY - Number of grids in the Y direction\n * @return - Calculated UV coordinates\n */\nvec2 getUV(vec2 uv, float col, float row, float numGridX, float numGridY) {\n /**\n * Calculate the unit size of the grid\n */\n float unitX = 1.0 / numGridX;\n float unitY = 1.0 / numGridY;\n\n /**\n * Reverse the row index to make the top of the texture correspond to the 0 of the UV coordinates and the bottom to 1\n */\n row = numGridY - 1.0 - row;\n\n /**\n * Calculate the texture UV coordinates\n */\n vec2 texUV = vec2(col * unitX, row * unitY);\n vec2 offsetUV = vec2(uv.x, uv.y) * vec2(unitX, unitY);\n\n return offsetUV + texUV;\n}\n\n/**\n * ************************************\n * Main\n * *************************************\n */\n\nvoid main() {\n /**\n * The diffuse UV coordinates.\n */\n vec2 diffuseUV = getUV(vUv, vMatrixIndex.x, vMatrixIndex.y, diffuseTextureColumns, diffuseTextureRows);\n // diffuseUV = vUv; /** For debug */\n /**\n * The texture color.\n */\n vec4 diffuseColor = texture2D(tDiffuse, diffuseUV);\n\n float alpha = vLightColor.r * vAttenuation * opacity;\n if (vVisible > 0.0 && alpha > 0.0) {\n gl_FragColor = vec4(fillColor.rgb * diffuseColor.rgb, diffuseColor.a * alpha);\n } else {\n discard;\n }\n}\n",uniforms:o.LlO.merge([b.UniformsLib.lights,{delta:new o.nc$(0),time:new o.nc$(0),numTotalInstances:new o.nc$(l),numTextureRows:new o.nc$(0),domeCenter:new o.nc$(f),attenuationFar:new o.nc$(i),attenuationNear:new o.nc$(s),tGPUData:new o.nc$(null),tDiffuse:new o.nc$(n),diffuseResolution:new o.nc$(new o.I9Y(n.image.width,n.image.height)),diffuseTextureColumns:new o.nc$(u),diffuseTextureRows:new o.nc$(c),opacity:new o.nc$(0),fillColor:new o.nc$(new o.Pq0(d.r,d.g,d.b)),rgbShift:new o.nc$(new o.Pq0(-.003,0,.003))}]),side:m,transparent:p,depthTest:g,depthWrite:v,dithering:!0,lights:!0})}),Y=T({vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The size of the point\n */\nuniform float pointSize;\n\n/**\n * The fill color of the point\n */\nuniform vec4 fillColor;\n\n/**\n * The visible flag.\n */\nattribute float visible;\n\n/**\n * The far attenuation of the point.\n */\nuniform float attenuationFar;\n/**\n * The near attenuation of the point.\n */\nuniform float attenuationNear;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The distance from the camera.\n */\nvarying float vAttenuation;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n/**\n * The visible flag.\n */\nvarying float vVisible;\n\nvoid main() {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0
199);\n float dist = distance(worldPosition.xyz, cameraPosition);\n float attenuation = easeInOutQuad(linearstep(attenuationFar, attenuationNear, dist));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = pointSize;\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = fillColor.rgb;\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vLightColor = lightColor;\n vUv = uv;\n vVisible = visible;\n vAttenuation = attenuation;\n}\n",fragmentShader:"/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n/**\n * The texture for the point\n */\nuniform sampler2D tPoint;\n\n/**\n * The resolution of the point texture\n */\nuniform vec2 pointResolution;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The fill color of the particles.\n */\nuniform vec4 fillColor;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates of the particles.\n */\nvarying vec2 vUv;\n/**\n * The fragment color.\n */\nvarying vec3 vLightColor;\n/**\n * The distance from the camera.\n */\nvarying float vAttenuation;\n/**\n * The visible flag.\n */\nvarying float vVisible;\n\n/**\n * ***********************************\n * Main\n * ************************************\n */\n\nvoid main() {\n float alpha = vLightColor.r * opacity * vAttenuation;\n if (vVisible > 0.0 && alpha > 0.0) {\n vec4 pointColor = texture2D(tPoint, gl_PointCoord);\n gl_FragColor = vec4(pointColor.rgb * fillColor.rgb * vLightColor, pointColor.a * alpha);\n } else {\n discard;\n }\n}\n",defaultOpacity:0});(0,i.e)({LineSegmentsGeometry:$.n});let X=(0,a.forwardRef)((e,t)=>{let{setIsCoordinateGuideRendererReady:n,registerAwardCameraEvent:l,unregisterAwardCameraEvent:f}=(0,a.useContext)(u.fn),{sceneRef:d,layers:m,innerRadius:p,outerRadius:g,textColor:v=h.i.award.coordinate.textColor,textOpacity:x=h.i.award.coordinate.textOpacity,pointColor:w=h.i.award.coordinate.pointColor,pointOpacity:C=h.i.award.coordinate.pointOpacity,connectorColor:b=h.i.award.coordinate.connectorColor,connectorOpacity:T=1}=e,P=(0,a.useRef)(null),M=(0,a.useRef)(null),_=(0,a.useRef)(null),[I,E]=(0,a.useState)(null),U=(0,a.useRef)(null),O=(0,a.useRef)(null),F=(0,a.useRef)(null),[N,L]=(0,a.useState)(null),z=(0,a.useRef)(null),V=(0,a.useRef)(null),k=(0,a.useRef)(null),[G,B]=(0,a.useState)(null),[j,$]=(0,s.zh)(()=>({from:{x:0,y:0},onChange:e=>{P.current.rotation.x=e.value.x,P.current.rotation.y=e.value.y}}),[]),[X,q]=(0,s.zh)(()=>({from:{val:0},onChange:e=>{_.current.material.uniforms.opacity.value=e.value.val*C,F.current.material.uniforms.opacity.value=e.value.val*x,k.current.material.uniforms.opacity.value=e.value.val*T}}),[]),Z=(e,t)=>{let n=t/(2*new o.Pq0(0,e.y,0).distanceTo(e)*y.Kt);return new o.Pq0(e.x*Math.cos(n)-e.z*Math.sin(n),e.y,e.x*Math.sin(n)+e.z*Math.cos(n))},Q=(0,i.C)(e=>e.gl),K=(0,i.C)(e=>e.clock),J=(0,a.useRef)(null),ee=(0,a.useRef)(null),et=(0,a.useRef)({}),en=(0,a.useRef)(!1),er=(e,t)=>{q.stop(!0),q.start({from:{val:0},to:{val:1},delay:t,config:{duration:e,easing:s.le.easeOutCubic}})},ea=(e,t)=>{q.stop(!0),q.start({from:{val:1},to:{val:0},delay:t,config:{duration:e,easing:s.le.easeOutCubic}})},eo=new o.Pq0,ei=new o.Pq0,es=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s.le.easeOutCubic;eo.set(e,t,0),k.current.material.uniforms.outerRotation.value=eo,k.current.material.needsUpdate=!0,$.stop(!0),$.start({from:{x:j.x,y:j.y},to:{x:e,y:t},delay:r,config:{duration:n,easing:a},onChange:e=>{k.current&&(ei.set(e.value.x,e.value.y,0),k.current.material.uniforms.innerRotation.value=ei,k.current.material.needsUpdate=!0)},onRest:()=>{k.current&&(ei.set(e,t,0),k.current.material.uniforms.innerRotation.value=ei,k.current.material.needsUpdate=!0)}})};return(0,c._B)("green"),(0,a.useEffect)(()=>{let e=(e,t)=>
199{if(e===u.LC.POSITION_CHANGED){let e;e=t.distanceToCoordinateNearestSurface,_.current.material.uniforms.attenuationFar.value=1.15*e,_.current.material.uniforms.attenuationNear.value=.94*e,k.current.material.uniforms.attenuationFar.value=1.15*e,k.current.material.uniforms.attenuationNear.value=.94*e,F.current.material.uniforms.attenuationFar.value=.78*e,F.current.material.uniforms.attenuationNear.value=0}};return l(e),()=>{f(e),J.current?.dispose(),J.current=null,en.current=!1,n(!1)}},[]),(0,a.useEffect)(()=>{(()=>{(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupPointElement");let e=y.Gf/36,t=y.Gf/36,n=new Float32Array(1944),a=new Float32Array(1944),i=new Float32Array(648);for(let r=0;r<36;r++)for(let s=0;s<18;s++){let l=(18*r+s)*3,u=r*e,c=s*t,f=Math.cos(u)*Math.sin(c)*g,d=Math.cos(c)*g,m=Math.sin(u)*Math.sin(c)*g;n.set([f,d,m],l);let p=new o.Pq0(f,d,m).normalize();a.set([p.x,p.y,p.z],l);let h=18*r+s,v=1;0===s||(1===s||17===s)&&r%4!=0?v=0:(2===s||16===s)&&r%2!=0&&(v=0),i[h]=v}E((0,r.jsxs)("points",{ref:M,layers:m,children:[(0,r.jsxs)("bufferGeometry",{children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",args:[n,3],count:n.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-normal",args:[a,3],count:a.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-visible",args:[i,1],count:i.length})]}),(0,r.jsx)(Y,{ref:_,fillColor:new o.Q1f(w),attenuationFar:2200,attenuationNear:1800})]}))})(),(()=>{(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupInstanceLabelElement");let{texture:e,canvasWidth:t,canvasHeight:n,textWidth:a,textHeight:i}=(0,S.D0)("N'00\xb0 E'000\xb0","USansRgBd",28),s=-(2*a),l=new Float32Array(1944),u=new Float32Array(1944),c=new Float32Array(648),f=new Float32Array(1296),d=new Float32Array(1296),p=new Float32Array(648);for(let e=0;e<36;e++)for(let t=0;t<18;t++){let n=18*e+t,r=t,a=(e-18)%36,i=Math.round(e/36*360),m=Math.round(t/18*180),h=new o.YHV(g,m*y.V$,i*y.V$),v=Z(new o.B69().position.setFromSpherical(h),s),x=v.clone().normalize(),w=new o.I9Y(a/36,r/18),R=1;0===r||(1===r||17===r)&&a%4!=0?R=0:(2===r||16===r)&&a%2!=0&&(R=0),l.set([v.x,v.y,v.z],3*n),u.set([x.x,x.y,x.z],3*n),c[n]=n,f.set([a,r],2*n),d.set([w.x,w.y],2*n),p[n]=R}L((0,r.jsxs)("instancedMesh",{ref:U,layers:m,args:[void 0,void 0,648],children:[(0,r.jsxs)("planeGeometry",{ref:O,args:[a,i],children:[(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-offset",args:[l,3]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-normal",args:[u,3]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-instanceIndex",args:[c,1]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-matrixIndex",args:[f,2]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-tileUV",args:[d,2]}),(0,r.jsx)("instancedBufferAttribute",{attach:"attributes-visible",args:[p,1]})]}),(0,r.jsx)(H,{ref:F,texture:e,numTotalInstances:648,fillColor:new o.Q1f(v),blending:o.EZo,attenuationFar:1400,attenuationNear:0})]}))})(),(()=>{(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupConnectorElement");let e=y.Gf/36,t=y.Gf/36,n=new o.Q1f(b),a=new Float32Array(3888),i=new Float32Array(3888),s=new Float32Array(3888).fill(n.r,n.g,n.b),l=new Float32Array(2592),u=new Float32Array(1296),c=new Float32Array(1296);for(let n=0;n<36;n++)for(let r=0;r<18;r++){let s=18*n+r,f=n*e,d=r*t,m=Math.cos(f)*Math.sin(d)*p,h=Math.cos(d)*p,v=Math.sin(f)*Math.sin(d)*p,x=Math.cos(f)*Math.sin(d)*g,y=Math.cos(d)*g,w=Math.sin(f)*Math.sin(d)*g,R=new o.Pq0(m,h,v),C=new o.Pq0(x,y,w),b=R.clone().normalize(),S=C.clone().normalize(),T=1;0===r||(1===r||17===r)&&n%4!=0?T=0:(2===r||16===r)&&n%2!=0&&(T=0),a.set([R.x,R.y,R.z,C.x,C.y,C.z],6*s),i.set([b.x,b.y,b.z,S.x,S.y,S.z],6*s),l.set([f,d,f,d],4*s),u.set([1,0],2*s),c.set([T,T],2*s)}B((0,r.jsxs)("lineSegments",{ref:z,layers:m,children:[(0,r.jsxs)("bufferGeometry",{ref:V,children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",args:[a,3],count:a.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-normal",args:[i,3],count:i.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-color",args:[s,3],count:s.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-angle",args:[l,2],count:l.length}),(0,r.jsx)("bufferAttribute",{attach:"attributes-inner",args:[u,1],count:u.length}),(0,r.jsx)("bufferAttribute",{attach:"attributes-visible",args:[c,1],count:c.length})]}),(0,r.jsx)(W,{ref:k,lineColor:new o.Q1f(b),innerRadius:p,outerRadius:g,attenuationFar:2200,attenuationNear:1800})]}))})()},[]),(0,a.useEffect)(()=>{(()=>{if(J.current||!M.current||0===M.current.geometry.attributes.position.count||null===N)return;(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupGPUComputationRenderer");let e=M.current.geometry.attributes.position.count/3*2;
199J.current=new R.d(e,1,Q),(0,A.n)()&&J.current.setDataType(o.ix0);let t=J.current.createTexture();for(let n=0;n<e;n++){let e=4*n;t.image.data.set([0,o.cj9.randFloat(0,2*y.Kt),o.cj9.randFloat(5*y.V$,10*y.V$),0],e)}t.needsUpdate=!0,ee.current=J.current.addVariable("tGPUData","/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n\nuniform sampler2D tEarthMap;\nuniform vec2 earthMapResolution;\n\nuniform float delta;\nuniform float time;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec3 earthMapColor = texture2D(tEarthMap, uv).rgb;\n vec4 gpuTextureColor = texture2D(tGPUData, uv);\n /**\n * * Invert the color\n * * - Land: Black (0, 0, 0) -> (1.0, 1.0, 1.0)\n * * - Sea: White (1, 1, 1) -> (0.0, 0.0, 0.0)\n */\n float earthMapAlpha = 1.0 - earthMapColor.r;\n if (earthMapAlpha > 0.0) {\n /**\n * Land\n */\n float currentRotation = gpuTextureColor.y;\n float rotationSpeed = gpuTextureColor.z;\n float nextRotation = mod(currentRotation + rotationSpeed * delta, PI * 2.0);\n float colorMultiplier = earthMapAlpha * (abs(sin(nextRotation)) * 0.6 + 0.2);\n gl_FragColor = vec4(colorMultiplier, nextRotation, rotationSpeed, 1.0);\n } else {\n /**\n * Sea\n */\n gl_FragColor = vec4(0.0, gpuTextureColor.yzw);\n }\n}\n",t),ee.current.material.needsUpdate=!0,J.current.setVariableDependencies(ee.current,[ee.current]);let r=K.getDelta();et.current=ee.current.material.uniforms,et.current.delta=new o.nc$(r),et.current.time=new o.nc$(0);let a=J.current.init();null!==a&&(0,D.Rm)("green","â","gpuRenderer init error",a),t.dispose(),O.current.attributes.position.needsUpdate=!0,O.current.attributes.offset.needsUpdate=!0,O.current.attributes.instanceIndex.needsUpdate=!0,O.current.attributes.matrixIndex.needsUpdate=!0;let i=O.current.attributes.offset.array;for(let e=0;e<i.length;e++){let t=new o.kn4;t.setPosition(new o.Pq0(i[3*e+0],i[3*e+1],i[3*e+2])),U.current.setMatrixAt(e,t)}U.current.instanceMatrix.setUsage(o.Vnu),U.current.instanceMatrix.needsUpdate=!0,en.current=!0,n(!0)})()},[I,N,G]),(0,c.Ql)((e,t)=>{en.current&&(et.current.delta.value=t,et.current.time.value+=t,ee.current.material.needsUpdate=!0,J.current.compute(),_.current.material.uniforms.delta.value=t,_.current.material.uniforms.time.value+=t,F.current.material.uniforms.delta.value=t,F.current.material.uniforms.time.value+=t,k.current.material.uniforms.delta.value=t,k.current.material.uniforms.time.value+=t,_.current.material.needsUpdate=!0,F.current.material.needsUpdate=!0,k.current.material.needsUpdate=!0)}),(0,a.useImperativeHandle)(t,()=>({present:er,dismiss:ea,rotate:es})),(0,r.jsxs)("group",{ref:P,layers:m,children:[I,N,G]})});X.displayName="CoordinateGuideRenderer";let q=(0,a.forwardRef)((e,t)=>{let{map:n,attenuationFar:i,attenuationNear:s,opacity:l,blending:u,side:c=o.$EB,transparent:f=!0,depthTest:d=!0,depthWrite:m=!1}=e,p=(0,a.useRef)(null);return(0,a.useImperativeHandle)(t,()=>({material:p.current})),(0,a.useMemo)(()=>(0,r.jsx)("shaderMaterial",{ref:p,vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_matrix>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The far attenuation of the point.\n */\nuniform float attenuationFar;\n/**\n * The near attenuation of the point.\n */\nuniform float attenuationNear;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The normal.\n */\nvarying vec3 vNormal;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n\nvoid main() {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0
199);\n float dist = distance(worldPosition.xyz, cameraPosition);\n float attenuation = easeInOutSine(linearstep(attenuationFar, attenuationNear, dist));\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = vec3(0.0);\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vNormal = normalize(normalMatrix * normal);\n vLightColor = lightColor;\n vUv = uv;\n vAttenuation = attenuation;\n}\n",fragmentShader:"uniform sampler2D tMap;\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The far distance of the attenuation effect.\n */\nuniform float attenuationFar;\n/**\n * The near distance of the attenuation effect.\n */\nuniform float attenuationNear;\n\n/**\n * The texture for the GPU data\n */\nuniform sampler2D tGPUData;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The normal.\n */\nvarying vec3 vNormal;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n\n/**\n * **********************************\n * Main\n * ***********************************\n */\n\nvoid main() {\n float alpha = vLightColor.r * opacity * vAttenuation;\n if (alpha > 0.0) {\n vec4 texColor = texture2D(tMap, vUv);\n gl_FragColor = vec4(texColor.rgb * vLightColor.rgb, texColor.a * alpha);\n } else {\n discard;\n }\n}\n",uniforms:o.LlO.merge([b.UniformsLib.lights,{delta:new o.nc$(0),time:new o.nc$(0),attenuationFar:new o.nc$(i),attenuationNear:new o.nc$(s),tMap:new o.nc$(n),opacity:new o.nc$(l??0),rgbShift:new o.nc$(new o.Pq0(-.003,0,.003))}]),vertexColors:!0,blending:u,side:c,transparent:f,depthWrite:m,depthTest:d,lights:!0}),[])}),Z=(0,a.forwardRef)((e,t)=>{let{numTotalInstances:n,pointSize:i,pointTextureSize:s,fillColor:l=new o.Q1f(0xffffff),side:u=o.hB5,transparent:c=!0,depthTest:f=!0,depthWrite:d=!1}=e,m=(0,a.useRef)(null);return(0,a.useImperativeHandle)(t,()=>({material:m.current})),(0,a.useMemo)(()=>{if(!s)return null;let e=(0,S.cD)(s);return e.needsUpdate=!0,(0,r.jsx)("shaderMaterial",{ref:m,vertexShader:"uniform float delta;\nuniform float time;\n\n/**\n * The size of the point\n */\nuniform float pointSize;\n\nvarying vec2 vUv;\n\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n gl_PointSize = pointSize;\n\n vUv = uv;\n}\n",fragmentShader:"/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The texture for the point\n */\nuniform sampler2D tPoint;\n/**\n * The texture for the GPU data\n */\nuniform sampler2D tTransitionGPUData;\nuniform sampler2D tLoopGPUData;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n/**\n * The fill color of the particles.\n */\nuniform vec4 fillColor;\n/**\n * The RGB shift value of the particles.\n */\nuniform vec3 rgbShift;\n\n/**\n * The UV coordinates of the particles.\n */\nvarying vec2 vUv;\n\n/**\n * ***********************************\n * Main\n * ************************************\n */\n\nvoid main() {\n vec4 transitionAnimationGPUTextureColor = texture2D(tTransitionGPUData, vUv);\n vec4 loopAnimationGPUTextureColor = texture2D(tLoopGPUData, vUv);\n float progress = transitionAnimationGPUTextureColor.x;\n float colorMultiplier = loopAnimationGPUTextureColor.x;\n\n vec4 pointColor = texture2D(tPoint, gl_PointCoord);\n gl_FragColor = vec4(pointColor.rgb, pointColor.a * colorMultiplier * progress);\n}\n",uniforms:{delta:new o.nc$(0),time:new o.nc$(0),numTotalInstances:new o.nc$(n),tTransitionGPUData:new o.nc$(null),tLoopGPUData:new o.nc$(null),tPoint:new o.nc$(e),pointSize:new o.nc$(i),opacity:new o.nc$(0),fillColor:new o.nc$(new o.Pq0(l.r,l.g,l.b)),rgbShift:new o.nc$(new o.Pq0(-.003,0,.003))},side:u,transparent:c,depthWrite:d,depthTest:f})},[s])}),Q=(0,a.forwardRef)((e,t)=>{let{layers:n,width:l,height:f,numTotalCols:d,numTotalRows:m,pointSize:p,pointTextureSize:h}=e,{earthMapReferenceTexture:g,earthMapReferenceTextureHolder:v,setEarthOffscreenMapTexture:x}=(0,a.useContext)(u.fn),w=m*d,C=(0,a.useRef)(null),b=(0,a.useRef)(new o.Z58),S=(0,a.useRef)(new o.qUd(-l/2,l/2,f/2,-f/2,-l,l)),T=(0,a.useRef)(null),P=(0,a.useRef)(null),M=(0,a.useRef)(null),[_,I]=(0,s.zh)(()=>({from:{brightness:.2},onChange:e=>{let t=e.value.brightness;M.current.setRGB(t,t,t)}}),[]),E=()=>{M.current.setRGB(.2,.2,.2),I.start({from:{brightness:.2},to:{brightness:0},config:{duration:1e3,easing:s.le.easeOutCubic}})},U=()=>{I.stop(!0),I.start({from:{brightness:0},to:{brightness:.15},loop:{reverse:!0},config:{duration:600,easing:s.le.easeInOutCubic}})},O=()=>{I.stop(!0),I.start({to:{brightness:0},config:{duration:1e3,easing:s.le.easeOutCubic}})},F=(0,i.C)(e=>e.gl),N=(0,i.C)(e=>e.clock),L=(0,i.C)(e=>e.size),z=(0,a.useRef)(null),V=(0,a.useRef)(null),k=(0,a.useRef)({}),G=(0,a.useRef)(null),B=(0,a.useRef)({}),j=(0,a.useRef)(!1),[$,W]=(0,a.useState)(null),H=(0,a.useRef)(0),Y=1/30;(0,a.useRef)(1e7);let X=(e,t,n,r)=>{((e,t,n,r)=>{if(z.current||null===T.current||!v.current)return;(0,D.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupGPUComputationRenderer"),z.current=ne
199w R.d(d,m,F),(0,A.n)()&&z.current.setDataType(o.ix0);let a=z.current.createTexture(),i=z.current.createTexture(),s=0;for(let l=0;l<m;l++){let l=o.cj9.randFloat(n.min,n.max);for(let n=0;n<d;n++){let u=4*s,c=n-r/d*d;c<0&&(c+=d);let f=c*l+t,m=o.cj9.randFloat(e.min,e.max);a.image.data.set([0,f,m,0],u),i.image.data.set([0,o.cj9.randFloat(0,2*y.Kt),o.cj9.randFloat(30*y.V$,60*y.V$),0],u),s++}}a.needsUpdate=!0,i.needsUpdate=!0,V.current=z.current.addVariable("tTransitionGPUData","uniform float delta;\nuniform float time;\n\nuniform float shouldStartTransition;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 gpuTextureColor = texture2D(tTransitionGPUData, uv);\n\n float delay = gpuTextureColor.y;\n float duration = gpuTextureColor.z;\n float isFinished = gpuTextureColor.w;\n\n if (isFinished > 0.0 || shouldStartTransition < 1.0) {\n gl_FragColor = gpuTextureColor;\n return;\n }\n if (delay < time) {\n float timeElapsed = (time - delay) / duration;\n float progress = min(timeElapsed / duration, 1.0);\n float isFinished = progress >= 1.0 ? 1.0 : 0.0;\n gl_FragColor = vec4(progress, delay, duration, isFinished);\n } else {\n gl_FragColor = gpuTextureColor;\n }\n}\n",a),G.current=z.current.addVariable("tLoopGPUData","/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n\nuniform sampler2D tEarthMap;\nuniform vec2 earthMapResolution;\n\nuniform float delta;\nuniform float time;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec3 earthMapColor = texture2D(tEarthMap, uv).rgb;\n vec4 gpuTextureColor = texture2D(tLoopGPUData, uv);\n /**\n * * Invert the color\n * * - Land: Black (0, 0, 0) -> (1.0, 1.0, 1.0)\n * * - Sea: White (1, 1, 1) -> (0.0, 0.0, 0.0)\n */\n float earthMapAlpha = 1.0 - earthMapColor.r;\n if (earthMapAlpha > 0.0) {\n /**\n * Land\n */\n float currentRotation = gpuTextureColor.y;\n float rotationSpeed = gpuTextureColor.z;\n float nextRotation = mod(currentRotation + rotationSpeed * delta, PI * 2.0);\n float colorMultiplier = earthMapAlpha * (abs(sin(nextRotation)) * 0.8 + 0.2);\n gl_FragColor = vec4(colorMultiplier, nextRotation, rotationSpeed, 1.0);\n } else {\n /**\n * Sea\n */\n gl_FragColor = vec4(0.0, gpuTextureColor.yzw);\n }\n}\n",i),V.current.material.needsUpdate=!0,G.current.material.needsUpdate=!0,z.current.setVariableDependencies(V.current,[V.current]),z.current.setVariableDependencies(G.current,[G.current]);let l=N.getDelta();k.current=V.current.material.uniforms,B.current=G.current.material.uniforms,k.current.shouldStartTransition=new o.nc$(0),k.current.delta=new o.nc$(l),k.current.time=new o.nc$(0),B.current.delta=new o.nc$(l),B.current.time=new o.nc$(0),B.current.tEarthMap=new o.nc$(v.current),B.current.earthMapResolution=new o.nc$(new o.I9Y(1e3,500)),B.current.tEarthMap.value.needsUpdate=!0;let u=z.current.init();null!==u&&(0,D.Rm)("yellowgreen","â","gpuRenderer init error",u),a.dispose(),i.dispose(),j.current=!0})({min:e.min/1e3,max:e.max/1e3},t/1e3,{min:n.min/1e3,max:n.max/1e3},r),k.current.shouldStartTransition.value=1,V.current.material.needsUpdate=!0};return(0,c._B)("yellowgreen"),(0,a.useEffect)(()=>(C.current=new o.nWS(l,f),x(C.current.texture),()=>void(z.current?.dispose(),z.current=null,C.current?.dispose(),C.current=null,j.current=!1,x(null))),[]),(0,a.useEffect)(()=>{(()=>{(0,D.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupMapParticleElement");let e=new Float32Array(3*w),t=new Float32Array(2*w),a=new Uint16Array(w),o=l/d/2,i=0;for(let n=0;n<m;n++)for(let r=0;r<d;r++)e[3*i+0]=l*(r/d-.5)+o,e[3*i+1]=f*(n/m-.5),e[3*i+2]=0,t[2*i+0]=r/d,t[2*i+1]=n/m,a[i]=i,i++;W((0,r.jsxs)("points",{ref:T,layers:n,children:[(0,r.jsxs)("bufferGeometry",{children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",args:[e,3],count:e.length/3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-uv",args:[t,2],count:t.length/2}),(0,r.jsx)("bufferAttribute",{attach:"attributes-index",args:[a,1],count:a.length/2})]}),(0,r.jsx)(Z,{ref:P,numTotalInstances:w,pointSize:p,pointTextureSize:h})]}))})()},[g]),(0,a.useEffect)(()=>{S.current&&(S.current.left=-(l/2),S.current.right=l/2,S.current.top=f/2,S.current.bottom=-(f/2),S.current.updateProjectionMatrix())},[L]),(0,a.useEffect)(()=>{S.current&&n&&S.current.layers.set(n)},[n]),(0,c.Ql)((e,t)=>{(e=>{if(!j.current||(H.current+=e,H.current<Y))return;let t=H.current;H.current=0,k.current.delta.value=t,k.current.shouldStartTransition.value>
1990&&(k.current.time.value+=t),B.current.delta.value=t,B.current.time.value+=t,z.current.compute(),P.current.material.uniforms.tTransitionGPUData.value=z.current.getCurrentRenderTarget(V.current).texture,P.current.material.uniforms.tLoopGPUData.value=z.current.getCurrentRenderTarget(G.current).texture,P.current.material.uniforms.delta.value=t,P.current.material.uniforms.time.value+=t,F.setRenderTarget(C.current),F.render(b.current,S.current),F.setRenderTarget(null)})(t)}),(0,a.useImperativeHandle)(t,()=>({present:X,startHoverAnimation:E,startDragAnimation:U,stopDragAnimation:O})),(0,r.jsxs)("scene",{ref:b,layers:n,children:[(0,r.jsx)("color",{ref:M,attach:"background",args:["#000000"]}),$,";"]})}),K=(0,a.forwardRef)((e,t)=>{let{sceneRef:n,layers:i,radius:l,widthSegments:f,heightSegments:d}=e,{earthOffscreenMapTexture:m,earthOffscreenMapTextureHolder:p,setIsEarthRendererReady:h,registerAwardCameraEvent:g,unregisterAwardCameraEvent:v}=(0,a.useContext)(u.fn),x=(0,a.useRef)(null),w=(0,a.useRef)(null),[R,C]=(0,s.zh)(()=>({from:{val:0},onChange:e=>w.current.material.uniforms.opacity.value=e.value.val}),[]),b=(e,t)=>{(0,D.Rm)("yellowgreen","\uD83C\uDFAC","present")},S=(e,t)=>{(0,D.Rm)("yellowgreen","\uD83C\uDFAC","dismiss"),C.stop(!0),C.start({from:{val:1},to:{val:0},delay:t,config:{duration:e,easing:s.le.easeOutCubic}})};return(0,c._B)("yellowgreen"),(0,a.useEffect)(()=>{let e=(e,t)=>{if(e===u.LC.POSITION_CHANGED){let e,n;e=t.distanceToEarthCenter,n=t.distanceToEarthNearestSurface,w.current.material.uniforms.attenuationFar.value=1.15*e,w.current.material.uniforms.attenuationNear.value=.94*n}};return g(e),()=>{v(e)}},[]),(0,a.useEffect)(()=>{h(!0)},[m]),(0,c.Ql)((e,t)=>{w.current.material.uniforms.delta.value=t,w.current.material.uniforms.time.value+=t,w.current.material.uniforms.tMap.value=p.current}),(0,a.useImperativeHandle)(t,()=>({present:b,dismiss:S,mesh:x.current,position:x.current.position,radius:l})),(0,r.jsxs)("mesh",{ref:x,layers:i,castShadow:!0,receiveShadow:!0,children:[(0,r.jsx)("sphereGeometry",{args:[l,f,d,y.V$,2*Math.PI,0*y.V$,Math.PI]}),(0,r.jsx)(q,{ref:w,map:m,attenuationFar:5e3,attenuationNear:1e3,opacity:1,side:o.hB5})]})});K.displayName="EarthRenderer";var J=n(1255),ee=n(8830);let et=(e=>{let{vertexShader:t,fragmentShader:n}=e;return(0,a.forwardRef)((e,i)=>{let{beginColor:s,endColor:l,opacity:u,splineCount:c,vertexCount:f,innerRadius:d,outerRadius:m,splineRadius:p,attenuationFar:h,attenuationNear:g,blending:v,side:x,transparent:y=!0,depthTest:w=!1,depthWrite:R=!1}=e,C=(0,a.useRef)(null);return(0,a.useImperativeHandle)(i,()=>({material:C.current})),(0,a.useMemo)(()=>(0,r.jsx)("shaderMaterial",{ref:C,vertexShader:t,fragmentShader:n,uniforms:o.LlO.merge([b.UniformsLib.lights,{tPositionGPUData:new o.nc$(null),tTransitionGPUData:new o.nc$(null),delta:new o.nc$(0),time:new o.nc$(0),splineCount:new o.nc$(c),vertexCount:new o.nc$(f),innerRadius:new o.nc$(d),outerRadius:new o.nc$(m),splineRadius:new o.nc$(p),attenuationFar:new o.nc$(h),attenuationNear:new o.nc$(g),screenResolution:new o.nc$(new o.I9Y),uiCameraPosition:new o.nc$(new o.Pq0),uiModelMatrix:new o.nc$(new o.kn4),uiViewMatrix:new o.nc$(new o.kn4),uiModelViewMatrix:new o.nc$(new o.kn4),uiProjectionMatrix:new o.nc$(new o.kn4),rotation:new o.nc$(new o.I9Y),opacity:new o.nc$(u),beginColor:new o.nc$(s),endColor:new o.nc$(l)}]),vertexColors:!0,blending:v,side:x,transparent:y,depthWrite:R,depthTest:w,lights:!0}),[])})})({vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for\n * loading light definitions\n */\n#include <bsdfs>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n#include <ftmr_inverse>\n#include <ftmr_matrix>\n#define SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT 16\n#include <ftmr_geographic>\n\n/**\n * The transition texture.\n */\nuniform sampler2D tPositionGPUData;\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The radius of the globe.\n */\nuniform float innerRadius;\nuniform float outerRadius;\nuniform float splineRadius;\n\n/**\n * The number of the splines.\n */\nuniform float splineCount;\n/**\n * The number of the vertex.\n */\nuniform float vertexCount;\n\n/**\n * The far distance of the attenuation effect.\n */\nuniform float attenuationFar;\n/**\n * The near distance of the attenuation effect.\n */\nuniform float attenuationNear;\n\n/**\n * The screen resolution.\n */\nuniform vec2 screenResolution;\n\n/**\n * The camera used in AwardUIScene\n */\nuniform vec3 uiCameraPosition;\nuniform mat4 uiModelMatrix;\nuniform mat4 uiViewMatrix;\nuniform mat4 uiModelViewMatrix;\nuniform mat4 uiProjectionMatrix;\n\n/**\n * The rotation of the scene.\n */\nuniform vec2 rotation;\n\n/**\n * The index of the vertex.\n */\nattribute float index;\n/**\n * The data of the UV coordinates.\n */\nattribute float dataUVU;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The uv u of the data texture.\n */\nvarying float vDataUVU;\n/**\n * The color of the line.\n */\nvarying vec3 vColor;\n/**\n * The opacity of the line.\n */\nvarying float vVertexOpacity;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n\n/**\n * **********************************\n * Main\n * ***********************************\n */\n\nconst int startOffset = 1;\nconst int endOffset = 0;\nconst int sphericalPointsCount = SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT - startOffset - endOffset;\nconst int controlPointsCount = sphericalPointsCount + 2;\n\nvoid main() {\n /**\n * * Extract data from the texture\n */\n\n /**\n * Row Y uses +0.5 texel-center offsets: corner-exact UVs with NearestFilter round to an\n * implementation-dependent neighbor texel (ANGLE D3D11 vs Metal diverge).\n */\n\n /**\n * The position of the city marker rendered in AwardGlobeScene camera\n */\n vec3 startPosition0 = texture2D(tPositionGPUData, vec2(
199dataUVU, 0.5 / 4.0)).xyz;\n vec3 startPosition1 = texture2D(tPositionGPUData, vec2(dataUVU, 1.5 / 4.0)).xyz;\n\n /**\n * The position of the award marker rendered in AwardUIScene camera\n */\n vec3 endPosition0 = texture2D(tPositionGPUData, vec2(dataUVU, 2.5 / 4.0)).xyz;\n vec3 endPosition1 = texture2D(tPositionGPUData, vec2(dataUVU, 3.5 / 4.0)).xyz;\n\n /**\n * * Calculate the intersection point of the line segment and the sphere\n * * `startPosition0 * 1.01`ã¨ãã¦ããã®ã¯éè¦ã§ãçé¢ä¸ã®ç¹startPosition0ããè¥å¹²å¤§ããå¤ã¨ããäºã§ãè¨ç®èª¤å·®ã«ãã交ç¹ã®å¤å®ãé«éã§å転ããã®ãé²ãã§ãã\n */\n // vec4 intersection = segmentSphereIntersection(startPosition0 * 1.05, endPosition1, vec3(0.0), innerRadius);\n\n vec4 splinePosition;\n // if(intersection.w == 1.0) {\n // /**\n // * If the intersection point is on the line segment, use the spherical interpolation\n // */\n\n // /** Cat-Mull Romè£å®ã®ã³ã³ããã¼ã«ãã¤ã³ããå®ç¾© */\n // vec3 controlPoints[controlPointsCount];\n\n // /** éå§ç¹ãå®ç¾© */\n // controlPoints[0] = startPosition0;\n // controlPoints[1] = startPosition0 * 1.1;\n\n // /** çé¢è£éã«ããé ç¹ç¾¤ãæ±ãã */\n // vec3 greatCircularBegin = startPosition0 * 1.2;\n // // vec3 greatCircularEnd = intersection.xyz * 1.2;\n // vec3 greatCircularEnd = endPosition1;\n // vec3 greatCircularPoints[SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT] = sphericalInterpolation(greatCircularBegin, greatCircularEnd, vec3(0.0), splineRadius);\n\n // /** çé¢è£éã«ããé ç¹ç¾¤ãã³ã³ããã¼ã«ãã¤ã³ãã«æ ¼ç´ */\n // int controlPointsIndex = 2;\n // for(int i = startOffset; i < sphericalPointsCount; i++) {\n // controlPoints[controlPointsIndex] = greatCircularPoints[i];\n // controlPointsIndex++;\n // }\n\n // /** çµç¹ãå®ç¾© */\n // // controlPoints[controlPointsIndex + 0] = mix(controlPoints[controlPointsIndex - 1], endPosition0, 0.8); /** ã³ã³ããã¼ã«ãã¤ã³ã2 */\n // // controlPoints[controlPointsIndex + 1] = endPosition1;\n // // controlPoints[controlPointsIndex + 2] = endPosition1;\n\n // /** ãããã°ç¨ */\n // float ratio = index / vertexCount;\n // int idx = int(mix(0.0, float(controlPointsCount - 1), ratio));\n // splinePosition = vec4(controlPoints[idx], 1.0);\n\n // /** ã³ã³ããã¼ã«ãã¤ã³ãã使ç¨ãã¦Cat-Mull Romè£å®ãè¡ã */\n // splinePosition = vec4(catmullRomInterpolatedVertex14(controlPoints, index, vertexCount), 1.0);\n // } else {\n // /**\n // * If the intersection point is not on the line segment, use the interpolation of the line segment\n // */\n // vec3 controlPoints[CATMULLROM_CONTROL_POINTS_4];\n // controlPoints[0] = startPosition0; /** éå§ç¹ */\n // // controlPoints[1] = startPosition1; /** ã³ã³ããã¼ã«ãã¤ã³ã1 */\n // controlPoints[1] = mix(startPosition1, endPosition0, 0.15); /** ã³ã³ããã¼ã«ãã¤ã³ã1 */\n // // controlPoints[2] = endPosition0; /** ã³ã³ããã¼ã«ãã¤ã³ã2 */\n // controlPoints[2] = mix(startPosition1, endPosition0, 0.8); /** ã³ã³ããã¼ã«ãã¤ã³ã2 */\n // controlPoints[3] = endPosition1; /** çµäºç¹ */\n\n // /** ã³ã³ããã¼ã«ãã¤ã³ãã使ç¨ãã¦Cat-Mull Romè£å®ãè¡ã */\n // splinePosition = vec4(catmullRomInterpolatedVertex4(controlPoints, index, vertexCount), 1.0);\n // }\n\n /**\n * * TODO: Temporary disable great circular interpolation. Enable it when the great circular interpolation is ready.\n */\n vec3 controlPoints[CATMULLROM_CONTROL_POINTS_4];\n controlPoints[0] = startPosition0; /**\n * éå§ç¹\n */\n // controlPoints[1] = startPosition1; /** ã³ã³ããã¼ã«ãã¤ã³ã1 */\n controlPoints[1] = mix(startPosition1, endPosition0, 0.15); /**\n * ã³ã³ããã¼ã«ãã¤ã³ã1\n */\n // controlPoints[2] = endPosition0; /** ã³ã³ããã¼ã«ãã¤ã³ã2 */\n controlPoints[2] = mix(startPosition1, endPosition0, 0.8); /**\n * ã³ã³ããã¼ã«ãã¤ã³ã2\n */\n controlPoints[3] = endPosition1; /**\n * çµäºç¹\n */\n\n /**\n * ã³ã³ããã¼ã«ãã¤ã³ãã使ç¨ãã¦Cat-Mull Romè£å®ãè¡ã\n */\n splinePosition = vec4(catmullRomInterpolatedVertex4
199(controlPoints, index, vertexCount), 1.0);\n\n /**\n * ç»é¢ã®æ¨ªå¹
ã大ãããªãã¨çµç«¯ã«è¿ãé ç¹ãå³ã«ãºã¬ã¦ãã¾ãã®ã§ããã®å ´åã¯çµç«¯ã®é ç¹ã使ç¨ãã\n */\n if (int(index) >= int(vertexCount - 4.0)) {\n splinePosition = vec4(endPosition1, 1.0);\n }\n\n /**\n * * Calculate attenuation\n */\n vec4 worldPosition = modelMatrix * vec4(startPosition0.xyz, 1.0);\n float dist = distance(worldPosition.xyz, cameraPosition);\n float attenuation = easeInOutSine(linearstep(attenuationFar, attenuationNear, dist));\n\n /**\n * * Calculate position\n */\n vec4 mvPosition = modelViewMatrix * vec4(splinePosition.xyz, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n\n /**\n * * Calculate normal\n */\n vec3 normal = normalize(splinePosition.xyz);\n\n /**\n * * Calculate light color\n */\n vec3 lightColor = vec3(0.0);\n #if NUM_DIR_LIGHTS > 0\n /**\n * Get the direction of the light set in three.js\n */\n vec3 vertexToLight = normalize(directionalLights[0].direction);\n /**\n * Get the color of the light set in three.js\n */\n vec3 lightCol = vec3(directionalLights[0].color);\n /**\n * Calculate reflection from normal information and light direction (negative is removed)\n */\n /**\n * Consider the color of the light\n */\n lightColor = lightCol * max(dot(vertexToLight.xyz, normalMatrix * normal), 0.0);\n #endif\n\n /**\n * * Set varying variables\n */\n vUv = uv;\n vColor = color;\n // vVertexOpacity = 1.0 - (index / vertexCount) * 0.8 + 0.2;\n // vVertexOpacity = (index / vertexCount) * 0.9 + 0.1;\n // vVertexOpacity = easeInSine((index / vertexCount) * 0.4 + 0.6);\n vVertexOpacity = index / vertexCount * 0.4 + 0.6;\n vLightColor = lightColor;\n vAttenuation = attenuation;\n vDataUVU = dataUVU;\n}\n",fragmentShader:"/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n\n/**\n * The transition texture.\n */\nuniform sampler2D tTransitionGPUData;\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/**\n * The global opacity of the particles.\n */\nuniform float opacity;\n\n/**\n * The color of the line.\n */\nuniform vec3 beginColor;\nuniform vec3 endColor;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n/**\n * The uv u of the data texture.\n */\nvarying float vDataUVU;\n/**\n * The color of the line.\n */\nvarying vec3 vColor;\n/**\n * The opacity of the line.\n */\nvarying float vVertexOpacity;\n/**\n * The instance index.\n */\nvarying float vInstanceIndex;\n/**\n * The light color.\n */\nvarying vec3 vLightColor;\n/**\n * The attenuation of the point.\n */\nvarying float vAttenuation;\n\n/**\n * **********************************\n * Main\n * ***********************************\n */\n\nvoid main() {\n /**\n * V=0.5 texel center: the transition data texture is a single-row texture.\n */\n float transitionProgress = texture2D(tTransitionGPUData, vec2(vDataUVU, 0.5)).r;\n // float alpha = vAttenuation * vLightColor.r * vVertexOpacity * transitionProgress * opacity;\n float alpha = vAttenuation * vVertexOpacity * transitionProgress * opacity;\n\n if (alpha > 0.0) {\n gl_FragColor = vec4(vColor, alpha);\n } else {\n discard;\n }\n}\n"});(0,i.e)({LineSegmentsGeometry:$.n,LineGeometry:J.v});let en=(0,a.forwardRef)((e,t)=>{let{sceneRef:n,layers:l,innerRadius:u,outerRadius:f,splineRadius:d,splineMaxOpacity:m=.4}=e,{dataset:p,datasetHolder:g,awardGlobeScene:v,awardUIScene:x,isCityMarkerRendererReady:b,isAwardUIRendererReady:S,setIsUIMarkerConnectorRendererReady:T,registerAwardCameraEvent:P,unregisterAwardCameraEvent:M}=(0,a.useContext)(C.fn),_=g.current.awardArrayList.length,I=(0,a.useRef)(null),[E,U]=(0,a.useState)(null),O=(0,a.useRef)(null),F=(0,a.useRef)(null),N=(0,i.C)(e=>e.gl),L=(0,i.C)(e=>e.size),z=(0,i.C)(e=>e.clock),[V,k]=(0,s.zh)(()=>({from:{val:0},onStart:()=>{Y.current.shouldStartTransition.value=1,H.current.material.needsUpdate=!0},onChange:e=>{F.current.material.uniforms.opacity.value=e.value.val*m}}),[]),G=(0,a.useRef)(null),B=(0,a.useRef)(null),j=(0,a.useRef)({}),$=new o.I9Y(g.current.awardArrayList.length,4),W=(0,a.useRef)(null),H=(0,a.useRef)(null),Y=(0,a.useRef)({}),X=new o.I9Y(g.current.awardArrayList.length,1),q=(0,a.useRef)(!1);(0,a.useRef)(1e7);let Z=(e,t)=>{k.stop(!0),k.start({from:{val:V.val},to:{val:1},delay:t,config:{duration:e,easing:s.le.easeOutCubic}})},Q=(e,t)=>{k.stop(!0),k.start({from:{val:1},to:{val:0},delay:t,config:{duration:e,easing:s.le.easeOutCubic}})},K=(e,t)=>{I.current.rotation.x=e,I.current.rotation.y=t};return(0,c._B)("green"),(0,a.useEffect)(()=>{let e=(e,t)=>
199{if(e===C.LC.POSITION_CHANGED){let e,n;e=t.distanceToCityMarkerNearestSurface,(n=F.current.material).uniforms.attenuationFar.value=1.2*e,n.uniforms.attenuationNear.value=.9*e,n.needsUpdate=!0}};return P(e),()=>{M(e),G.current?.dispose(),G.current=null,W.current?.dispose(),W.current=null,q.current=!1,T(!1)}},[]),(0,a.useEffect)(()=>{g.current?b&&S&&(()=>{(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupSplines",_);let e=[];for(let t=0;t<_;t++){let n=g.current.getAward(t),r=g.current.getCity(n.key),a=new Float32Array(360),i=new Float32Array(360),s=new Float32Array(120),l=new Float32Array(120),u=new o.YHV(10,-180+3.3*y.zG*t,-90+2*y.zG*t),c=new o.B69().position.setFromSpherical(u);for(let e=0;e<60;e++){let u=new o.Pq0(e*c.x,e*c.y,e*c.z),f=new o.Pq0((e+1)*c.x,(e+1)*c.y,(e+1)*c.z);a[6*e+0]=r.catmullRomPosition0.x+u.x,a[6*e+1]=r.catmullRomPosition0.y+u.y,a[6*e+2]=r.catmullRomPosition0.z+u.z,a[6*e+3]=r.catmullRomPosition0.x+f.x,a[6*e+4]=r.catmullRomPosition0.y+f.y,a[6*e+5]=r.catmullRomPosition0.z+f.z,a[6*e+0]=u.x,a[6*e+1]=u.y,a[6*e+2]=u.z,a[6*e+3]=f.x,a[6*e+4]=f.y,a[6*e+5]=f.z,i[6*e+0]=n.color.r,i[6*e+1]=n.color.g,i[6*e+2]=n.color.b,i[6*e+3]=n.color.r,i[6*e+4]=n.color.g,i[6*e+5]=n.color.b,s[2*e+0]=e+0,s[2*e+1]=e+1,l[2*e+0]=(t+.5)/_,l[2*e+1]=(t+.5)/_}let f=new o.LoY;f.setAttribute("position",new o.qtW(a,3).setUsage(o.Vnu)),f.setAttribute("color",new o.qtW(i,3).setUsage(o.Vnu)),f.setAttribute("index",new o.qtW(s,1).setUsage(o.Vnu)),f.setAttribute("dataUVU",new o.qtW(l,1).setUsage(o.Vnu)),f.computeVertexNormals(),e.push(f)}let t=(0,ee.pP)(e);U((0,r.jsxs)("lineSegments",{ref:O,layers:l,children:[(0,r.jsxs)("bufferGeometry",{children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",args:[t.attributes.position.array,3],count:t.attributes.position.count}),(0,r.jsx)("bufferAttribute",{attach:"attributes-color",args:[t.attributes.color.array,3],count:t.attributes.color.count}),(0,r.jsx)("bufferAttribute",{attach:"attributes-index",args:[t.attributes.index.array,1],count:t.attributes.index.count}),(0,r.jsx)("bufferAttribute",{attach:"attributes-dataUVU",args:[t.attributes.dataUVU.array,1],count:t.attributes.dataUVU.count})]}),(0,r.jsx)(et,{ref:F,beginColor:new o.Q1f(h.i.award.uiConnector.color),endColor:new o.Q1f(h.i.award.uiConnector.color),opacity:0,splineCount:_,vertexCount:60,innerRadius:u,outerRadius:f,splineRadius:d,attenuationFar:u,attenuationNear:f})]}))})():(0,D.z3)("red","\uD83D\uDEA8","UIMarkerConnectorRenderer: dataset is not ready.")},[p,b,S]),(0,a.useEffect)(()=>{E&&O.current&&F.current&&(()=>{if(q.current||G.current)return;(0,D.Rm)("green","\uD83D\uDEE0ï¸","setupGPUComputationRenderer"),G.current=new R.d($.x,$.y,N),W.current=new R.d(X.x,X.y,N),(0,A.n)()&&(G.current.setDataType(o.ix0),W.current.setDataType(o.ix0));let e=G.current.createTexture(),t=W.current.createTexture(),n=[...g.current.awardArrayList].sort((e,t)=>t.year-e.year),r=4*$.x;for(let a=0;a<$.x;a++){let o=g.current.getAward(a),i=n[a],s=g.current.getCity(o.key),l=s.catmullRomPosition0,u=s.catmullRomPosition1,c=o.catmullRomPosition0,f=o.catmullRomPosition1,d=4*a;e.image.data.set([l.x,l.y,l.z,0],0*r+d),e.image.data.set([u.x,u.y,u.z,0],+r+d),e.image.data.set([c.x,c.y,c.z,0],2*r+d),e.image.data.set([f.x,f.y,f.z,0],3*r+d),t.image.data.set([0,0,1,30*i.index/1e3],d)}e.needsUpdate=!0,t.needsUpdate=!0,B.current=G.current.addVariable("tPositionGPUData","uniform float delta;\nuniform float time;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 gpuTextureColor = texture2D(tPositionGPUData, uv);\n gl_FragColor = gpuTextureColor;\n}\n",e),H.current=W.current.addVariable("tTransitionGPUData","uniform float delta;\nuniform float time;\nuniform float shouldStartTransition;\n\n/**\n * **********************************************************\n * Main function\n * ***********************************************************\n */\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / resolution.xy;\n vec4 gpuTextureColor = texture2D(tTransitionGPUData, uv);\n float progress = gpuTextureColor.x;\n float currentTime = gpuTextureColor.y;\n float duration = gpuTextureColor.z;
199\n float delay = gpuTextureColor.w;\n if (progress >= 1.0) {\n gl_FragColor = vec4(progress, currentTime, duration, delay);\n } else if (shouldStartTransition >= 1.0) {\n currentTime += delta;\n if (currentTime >= delay) {\n progress = (currentTime - delay) / duration;\n progress = clamp(progress, 0.0, 1.0);\n }\n }\n gl_FragColor = vec4(progress, currentTime, duration, delay);\n}\n",t),B.current.material.needsUpdate=!0,H.current.material.needsUpdate=!0,G.current.setVariableDependencies(B.current,[B.current]),W.current.setVariableDependencies(H.current,[H.current]),j.current=B.current.material.uniforms,Y.current=H.current.material.uniforms;let a=z.getDelta();j.current.delta=new o.nc$(a),j.current.time=new o.nc$(0),Y.current.delta=new o.nc$(a),Y.current.time=new o.nc$(0),Y.current.shouldStartTransition=new o.nc$(0);let i=G.current.init();null!==i&&(0,D.Rm)("green","â","gpuPositionRenderer init error",i);let s=W.current.init();null!==s&&(0,D.Rm)("green","â","gpuTransitionRenderer init error",s),e.dispose(),t.dispose(),q.current=!0,T(!0)})()},[E]),(0,c.Ql)((e,t)=>{(e=>{if(!q.current)return;x.current.camera.updateMatrixWorld(),v.current.camera.updateMatrixWorld();let t=G.current.createTexture(),n=4*_;for(let e=0;e<_;e++){let r=g.current.getAward(e),a=g.current.getCity(r.key),o=r.catmullRomPosition0.clone(),i=r.catmullRomPosition1.clone(),s=a.catmullRomPosition0.clone(),l=a.catmullRomPosition1.clone(),u=(0,w.UK)(o,x.current.camera,L),c=(0,w.UK)(i,x.current.camera,L),f=(0,w.UT)(u,v.current.camera,L,1e3),d=(0,w.UT)(c,v.current.camera,L,1e3),m=4*e;t.image.data.set([s.x,s.y,s.z,0],0*n+m),t.image.data.set([l.x,l.y,l.z,0],+n+m),t.image.data.set([f.x,f.y,f.z,0],2*n+m),t.image.data.set([d.x,d.y,d.z,0],3*n+m)}B.current.material.uniforms.tPositionGPUData.value?.dispose(),B.current.material.uniforms.tPositionGPUData.value=t,B.current.material.uniforms.tPositionGPUData.value.needsUpdate=!0,G.current.doRenderTarget(B.current.material,B.current.renderTargets[0]),j.current.delta.value=e,j.current.time.value+=e,Y.current.delta.value=e,Y.current.time.value+=e,B.current.material.needsUpdate=!0,H.current.material.needsUpdate=!0,G.current.compute(),W.current.compute();let r=F.current.material;r.uniforms.tPositionGPUData.value=G.current.getCurrentRenderTarget(B.current).texture,r.uniforms.tTransitionGPUData.value=W.current.getCurrentRenderTarget(H.current).texture,r.uniforms.delta.value=e,r.uniforms.time.value+=e,r.uniforms.screenResolution.value.x=L.width,r.uniforms.screenResolution.value.y=L.height,r.uniforms.uiCameraPosition.value=x.current.camera.position,r.uniforms.uiModelMatrix.value=x.current.camera.matrixWorld,r.uniforms.uiViewMatrix.value=x.current.camera.matrixWorldInverse,r.uniforms.uiModelViewMatrix.value=x.current.camera.matrixWorld.multiply(x.current.camera.matrixWorldInverse),r.uniforms.uiProjectionMatrix.value=x.current.camera.projectionMatrix,r.uniforms.rotation.value.x=I.current.rotation.x,r.uniforms.rotation.value.y=I.current.rotation.y,r.needsUpdate=!0})(t)}),(0,a.useImperativeHandle)(t,()=>({present:Z,dismiss:Q,rotate:K})),(0,r.jsx)("group",{ref:I,layers:l,children:E})});en.displayName="UIMarkerConnectorRenderer";var er=n(1450);let ea=(0,a.forwardRef)((e,t)=>{let{layers:n,enabled:l=!0,children:u,speed:f=2,defaultRotation:d=new o.O9p(0,0,0),polarLimits:m={min:-1/0,max:1/0},azimuthLimits:p={min:-1/0,max:1/0},config:h={mass:1,tension:100,friction:30},onStart:g,onChange:v,onComplete:x,onHover:w,onPointerOut:R,onDragStart:C,onDragEnd:b}=e,S=(0,a.useRef)(null),T=(0,i.C)(e=>e.size),P=(0,a.useMemo)(()=>({min:d.x+m.min,max:d.x+m.max}),[d.x,m]),M=(0,a.useMemo)(()=>({min:d.y+p.min,max:d.y+p.max}),[d.y,p]),A=(0,a.useRef)(l),D=e=>{A.current=e},_=(0,a.useRef)({phi:0,theta:0}),I=(0,a.useRef)({phi:d.x,theta:d.y}),E=()=>({latitude:(I.current.phi-_.current.phi)*y.zG,longitude:-(I.current.theta-_.current.theta)*y.zG}),[U,O]=(0,s.zh)(()=>({from:{rotationX:d.x,rotationY:d.y},onStart:e=>{S.current?.rotation.set(e.value.rotationX,e.value.rotationY,0),I.current.phi=e.value.rotationX,I.current.theta=e.value.rotationY,g?.(e.value.rotationX,e.value.rotationY)},onChange:e=>{S.current?.rotation.set(e.value.rotationX,e.value.rotationY,0),I.current.phi=e.value.rotationX,I.current.theta=e.value.rotationY,v?.(e.value.rotationX,e.value.rotationY)},onRest:e=>{S.current?.rotation.set(e.value.rotationX,e.value.rotationY,0),I.current.phi=e.value.rotationX,I.current.theta=e.value.rotationY,x?.(e.value.rotationX,e.value.rotationY)}})),[F,N]=(0,s.zh)(()=>({from:{progress:0}})),L=(e,t,n,r,a,i,l,u,c,f)=>{_.current.phi=n,_.current.theta=r;let d=y.V$*e,m=-(y.V$*t),p=new o.YHV(1e3,d,m),h=p.phi+n,g=p.theta+r,v=2*Math.PI,x=h-I.current.phi,w=g-I.current.theta,R=I.current.phi+(x-Math.round(x/v)*v),C=I.current.theta+(w-Math.round(w/v)*v);O.start({rotationX:R,rotationY:C,delay:i??0,config:{duration:a??2e3,easing:l??s.le.easeInOutSine}}),N.start({from:{progress:0},to:{progress:1},delay:i??0,config:{duration:a??2e3,easing:l??s.le.linear},onStart:e=>{u?.(e.value.progress)},onChange:e=>{c?.(e.value.progress)},onRest:e=>{f?.(e.value.progress)}})};(0,c._B)("pink"),(0,a.useEffect)(()=>(S.current?.rotation.set(d.x,d.y,d.z),()=>void(O.stop(),N.stop(),document.body.style.cursor="auto")),[]);let z=(0,er.useGesture)({onHover:e=>{let{last:t}=e;A.current&&(document.body.style.cursor=t?"auto":"grab",t||w?.())},onDragStart:()=>{A.current&&C?.()},onPointerMove:e=>{let{down:t}=e;A.current&&(document.body.style.cursor=t?"grabbing":"grab")},onPointerOut:()=>{A.current&&(document.body.style.cursor="auto",R?.())},onDrag:e=>{let{down:t,delta:[n,r],memo:[a,i]=[U.rotationX.animation.to||d.x,U.rotationY.animation.to||d.y]}=e;return A.current&&(document.body.style.cursor=t?"grabbing":"grab",n=o.cj9.clamp(i+n/T.width*Math.PI*f,M.min,M.max),r=o.cj9.clamp(a+r/T.height*Math.PI*f,P.min,P.max),O.start({rotationX:r,rotationY:n,config:h})),[r,n]},onDragEnd:()=>{b?.()}},{target:void 0});return(0,a.useImperativeHandle)(t,()=>({rotate:L,enabled:A.current,setEnabled:D,getCurrentCoordinate:E})),(0,r.jsx)("group",{ref:S,layers:n,...z(),children:u})}),eo=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{play:m,stop:p,fade:h,getNextSFXAwardGlobeRotationKey:v,getNextSFXAwardGlobeDragKey:x,getCurrentSFXAwardGlobeDragKey:R}=(0,a.useContext)(u.nE),{setFooterVisible:C,isIntersectingWithNavigation:b,setPointerCaptured:S}=(0,a.useContext)(u._3);(0,a.useRef)(b).current=b;let T=(0,a.useContext)(u.fn),{datasetHolder:P,notifyAwardCameraEvent:M,targetCoordinate:A,setTargetCoordinate:D,setHighlightedAwards:I,setShouldHighlightAwards:E}=T,U=(0,a.useRef)(T.awardGlobeScene).current,O=(0,a.useRef)(null),F=(0,a.useRef)(null),N=(0,a.useRef)(null),L=(0,a.useRef)(null),z=(0,a.useRef)(null),V=(0,a.useRef)(null),k=(0,a.useRef)(null),G=(0,a.useRef)(null),B=(0,i.C)(e=>e.size),$=(0,a.useRef)(!1),[W,H]=(0,s.zh)(()=>({from:{lookAtX:0,lookAtY:0,lookAtZ:0}})),[Y,q]=(0,s.zh)(()=>({from:{positionX:0,positionY:0,positionZ:5e3}})),Z=()=>$.current?{origin:new o.Pq0(1e3,0,0),eye:new o.Pq0(1e3,0,4e3)}:{origin:new o.Pq0(1200,0,0),eye:new o.Pq0(1200,0,3500)},J=(e,t)=>
199{if(!O.current?.camera)return[0,0];let n=new o.Pq0(0,0,0),r=new o.Pq0(0,0,4e3),a=(0,w.O6)(new o.Pq0(0,0,0),2e3,r,n),i=(0,w.O6)(new o.Pq0(0,0,0),2e3,e,t);if(!a||!i)return[0,0];let s=new o.YHV().setFromVector3(a),l=new o.YHV().setFromVector3(i);return[l.phi-s.phi,l.theta-s.theta]},ee=()=>{if(!O.current||!F.current)return;let e=O.current.camera?.position,t=F.current.position;if(!e||!t)return;let n=Math.round(e.distanceTo(t)),r=Math.round(n-1800),a=Math.round(n+1800),o=Math.round(n-2100),i=Math.round(n+2100),s=Math.round(n-2100),l=Math.round(n+2150),c=Math.round(n-1810),f=Math.round(n+1850);M(u.LC.POSITION_CHANGED,{cameraPosition:e,distanceToEarthCenter:n,distanceToEarthNearestSurface:r,distanceToEarthFarthestSurface:a,distanceToCageNearestSurface:o,distanceToCageFarthestSurface:i,distanceToCoordinateNearestSurface:s,distanceToCoordinateFarthestSurface:l,distanceToCityMarkerNearestSurface:c,distanceToCityMarkerFarthestSurface:f})},et=()=>{k.current?.setEnabled(!1);let{origin:e,eye:t}=Z(),[n,r]=J(t,e),a=P.current.cityObjectList.tokyo;I(P.current.awardArrayList.find(e=>e.key===a.key)),k.current?.rotate(a.coordinate.latitude,a.coordinate.longitude-120,n,r,0,0,s.le.linear,void 0,void 0,()=>{G.current?.present({min:600,max:1200},0,{min:1.5,max:3},8),F.current?.present(100,0),N.current?.present(3e3,800,120,9,0,800,30,3),z.current?.present(1e3,3e3,3400,600,120,3e3,600,40,3e3,600,40,3100,1500,40,{min:10,max:60},{min:100,max:150}),L.current?.present(3e3,3e3),V.current?.present(3e3,6e3),k.current?.rotate(a.coordinate.latitude,a.coordinate.longitude,n,r,4e3,10,s.le.easeOutQuint,()=>{let e=v();p(e),m(e,l.z.sfx.award.globeInitialTransition,!1),h(e,0,0,2e3,!1,s.le.easeInQuint)},void 0,e=>{k.current?.setEnabled(!0),C(!0),$.current=!0,h(f.uc.BGM_AWARD_CHORUS,l.z.bgm.award.chorus,2e3,4e3,!0)}),ei(6e3,e,t)})},er=()=>{k.current?.setEnabled(!1),F.current?.dismiss(1e3,0),N.current?.dismiss(1e3,0),L.current?.dismiss(1e3,0),z.current?.dismiss(1e3,0),V.current?.dismiss(1e3,0),h(f.uc.BGM_AWARD_CHORUS,0,0,4e3,!0)},eo=(e,t)=>{N.current?.rotate(e,t),L.current?.rotate(e,t),z.current?.rotate(e,t)},ei=(e,t,n)=>{let{origin:r,eye:a}=Z();t=t??r,n=n??a,((e,t,n,r,a,o,i,l,u)=>{H.start({lookAtX:e,lookAtY:t,lookAtZ:n,delay:a??0,config:{duration:r??6e3,easing:o??s.le.easeOutQuint},onStart:e=>{O.current?.camera?.lookAt(e.value.lookAtX,e.value.lookAtY,e.value.lookAtZ),i?.(e.value.lookAtX,e.value.lookAtY,e.value.lookAtZ),ee()},onChange:e=>{O.current?.camera?.lookAt(e.value.lookAtX,e.value.lookAtY,e.value.lookAtZ),l?.(e.value.lookAtX,e.value.lookAtY,e.value.lookAtZ),ee()},onRest:e=>{O.current?.camera?.lookAt(e.value.lookAtX,e.value.lookAtY,e.value.lookAtZ),u?.(e.value.lookAtX,e.value.lookAtY,e.value.lookAtZ),ee()}})})(...t.toArray(),e),((e,t,n,r,a,o,i,l,u)=>{q.start({positionX:e,positionY:t,positionZ:n,delay:a??0,config:{duration:r??6e3,easing:o??s.le.easeOutQuint},onStart:e=>{O.current?.camera?.position.set(e.value.positionX,e.value.positionY,e.value.positionZ),i?.(e.value.positionX,e.value.positionY,e.value.positionZ),ee()},onChange:e=>{O.current?.camera?.position.set(e.value.positionX,e.value.positionY,e.value.positionZ),l?.(e.value.positionX,e.value.positionY,e.value.positionZ),ee()},onRest:e=>{O.current?.camera?.position.set(e.value.positionX,e.value.positionY,e.value.positionZ),u?.(e.value.positionX,e.value.positionY,e.value.positionZ),ee()}})})(...n.toArray(),e)};return(0,c._B)("deeppink"),(0,a.useEffect)(()=>{U.current=O.current},[]),(0,a.useEffect)(()=>{A&&(e=>{let{origin:t,eye:n}=Z(),[r,a]=J(n,t),o=v();p(o),m(o,l.z.sfx.award.globeRotateDismissC1,!1),h(o,0,0,2100,!1,s.le.easeInCubic),k.current?.rotate(e.latitude,e.longitude,r,a,2500,0,s.le.easeInOutExpo,void 0,void 0,()=>{k.current?.setEnabled(!0),E(!0)}),ei(2500,t,n)})(A)},[A]),(0,a.useEffect)(()=>{$.current&&k.current?.setEnabled(!b)},[b]),(0,a.useEffect)(()=>{!O.current||$.current&&(()=>{let{origin:e,eye:t}=Z(),[n,r]=J(t,e),a=k.current?.getCurrentCoordinate();k.current?.rotate(a.latitude,a.longitude,n,r,2500,0,s.le.easeInOutExpo,void 0,void 0,()=>{k.current?.setEnabled(!0)}),ei(1e3)})()},[B]),(0,a.useImperativeHandle)(t,()=>({present:et,dismiss:er})),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(g,{ref:O,layers:n,name:d.eU.AWARD_G
199LOBE,children:[(0,r.jsx)(ea,{ref:k,enabled:!1,defaultRotation:new o.O9p(0,0,0),polarLimits:{min:-(60*y.V$),max:60*y.V$},onChange:(e,t)=>{eo(e,t)},onComplete:(e,t)=>{eo(e,t)},onDragStart:()=>{S(!0),ei(6e3),E(!1),I(null),D(null),h(x(),l.z.sfx.award.globeDragC1,0,1e3,!0,s.le.easeInOutSine),h(f.uc.BGM_AWARD_CHORUS,0,0,1e3,!0),G.current?.startDragAnimation()},onDragEnd:()=>{S(!1),h(R(),0,0,1e3,!0,s.le.easeInOutSine),h(f.uc.BGM_AWARD_CHORUS,l.z.bgm.award.chorus,2e3,4e3,!0),G.current?.stopDragAnimation()},onHover:()=>{m(f.uc.SFX_AWARD_GLOBE_HOVER,l.z.sfx.award.globeHover,!1),G.current?.startHoverAnimation()},onPointerOut:()=>{},children:(0,r.jsx)(K,{ref:F,layers:n,radius:1800,widthSegments:64,heightSegments:32,sceneRef:O})}),(0,r.jsx)(_,{ref:N,layers:n,radius:2100,sceneRef:O}),(0,r.jsx)(X,{ref:L,layers:n,innerRadius:2100,outerRadius:2150,sceneRef:O}),(0,r.jsx)(j,{ref:z,layers:n,innerRadius:1810,outerRadius:1850,sceneRef:O}),(0,r.jsx)(en,{ref:V,layers:n,innerRadius:1810,outerRadius:1850,splineRadius:2e3,sceneRef:O})]}),(0,r.jsx)(Q,{ref:G,layers:void 0,width:2e3,height:1e3,numTotalCols:1e3,numTotalRows:500,pointSize:.5,pointTextureSize:16})]})});var ei=n(5874);let es=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,o=(0,a.useContext)(u.fn),{setIsAwardHeaderRendererReady:l}=o,f=(0,a.useRef)(o.awardHeaderScene).current,{layoutMargins:m,headerScale:p}=(0,a.useContext)(u.MQ),h=(0,a.useRef)(m);h.current=m;let g=(0,a.useRef)(p);g.current=p;let x=(0,a.useRef)(null),w=(0,a.useRef)(null),R=(0,a.useRef)(null);(0,i.C)(e=>e.gl),(0,i.C)(e=>e.size);let C=(0,i.C)(e=>e.pointer),b=(0,a.useRef)(null),S=(0,a.useRef)({x:0*y.V$,y:2*y.V$}),T=(0,a.useRef)({x:-(0*y.V$),y:-(.2*y.V$)}),P=(0,s.zh)(()=>({from:{rx:x.current?.rotation.x??0,ry:x.current?.rotation.y??0},onChange:e=>{x.current.rotation.x=e.value.rx,x.current.rotation.y=e.value.ry}}),[])[1],M=e=>{D(),R.current?.present(e)},A=()=>{R.current?.dismiss()},D=()=>{w.current.scale.set(g.current,g.current,1);let e=b.current.camera,t=2*Math.tan(e.fov*(Math.PI/180)/2)*e.position.z,n=t*e.aspect,r=R.current.getBoundingBoxSize();w.current.position.x=-r.x/2,x.current.position.x=e.position.x-n/2+n*h.current.left+r.x/2,x.current.position.y=e.position.y+t/2-t*h.current.top+r.y/2},_=e=>{let t=S.current.x+C.y*T.current.x+T.current.x,n=S.current.y+-C.x*T.current.y+T.current.y;P.stop(!0),P.start({to:{rx:t,ry:n},config:{duration:400,easing:s.le.easeOutCubic}})};return(0,c._B)("deeppink"),(0,a.useEffect)(()=>{f.current=b.current},[]),(0,a.useEffect)(()=>(window.addEventListener("mousemove",_),()=>window.removeEventListener("mousemove",_)),[]),(0,a.useLayoutEffect)(()=>{D()},[p,m]),(0,a.useImperativeHandle)(t,()=>({present:M,dismiss:A})),(0,r.jsx)(v,{ref:b,layers:n,name:d.eU.AWARD_HEADER,children:(0,r.jsx)("group",{ref:x,layers:n,children:(0,r.jsx)("group",{ref:w,layers:n,children:(0,r.jsx)(ei.g,{ref:R,layers:n,position:[0,0,0],onInitialized:()=>{D(),l(!0)}})})})})});var el=n(6133);let eu=(0,a.forwardRef)((e,t)=>{let{layers:n,awardIndex:c,position:d=new o.Pq0,markerTextures:m,markerSize:p,yearText:g,titleText:v,fontFile:x,fontTexture:w,fontSize:R,fontColor:C=new o.Q1f(h.i.label.fontColor),onInitialized:b,onPresentStart:S,onPresentEnd:T,onDismissStart:P,onDismissEnd:M}=e,{play:A,stop:D}=(0,a.useContext)(u.nE),{datasetHolder:_,setTargetCoordinate:I,setHighlightedAwards:E,setShouldHighlightAwards:U}=(0,a.useContext)(u.fn),{pointerCaptured:O}=(0,a.useContext)(u._3),{sendEvent:F}=(0,u.pn)(),N=(0,a.useRef)(null),L=(0,a.useRef)(null),z=(0,a.useRef)(null),V=(0,a.useRef)(null),k=(0,a.useRef)(null),G=(0,a.useRef)(null),B=(0,a.useRef)(null),j=(0,a.useRef)(null),$=(0,a.useRef)(null),W=(0,a.useRef)(null),H=(0,i.C)(e=>e.size),Y=(0,a.useRef)(_.current.getAward(c)),X=(0,a.useRef)({width:0,height:0,top:0,left:0}),q=(0,a.useRef)(!1),Z=(0,a.useRef)(!1),[Q,K]=(0,s.zh)(()=>({from:{progress:0},onStart:()=>{1===Q.progress.goal?S?.(c):0===Q.progress.goal&&P?.(c)},onChange:e=>{k.current.opacity=2*e.value.progress;let t=Math.floor(e.value.progress*(m.length-1));k.current.map=m[t],k.current.needsUpdate=!0,z.current.opacity=e.value.progress},onRest:()=>{1===Q.progress.goal?T?.(c):0===Q.progress.goal&&M?.(c)}})),[J,ee]=(0,s.zh)(()=>({from:{opacity:0,r:0,g:0,b:0},onChange:e=>{W.current.opacity=e.value.opacity,W.current.needsUpdate=!0}})),et=(e,t)=>{K.stop(!0),K.start({from:{progress:0},to:{progress:1},delay:t+100,config:{duration:e,easing:s.le.linear}}),G.current?.present(e,t),B.current?.present(e,t)},en=(e,t)=>{Z.current=!1,K.start({from:{progress:1},to:{progress:0},delay:t,config:{duration:e,easing:s.le.easeOutCubic}}),G.current?.dismiss(e,t),B.current?.dismiss(e,t),ee.stop(!0),ee.start({to:{opacity:0,r:C.r,g:C.g,b:C.b},config:{duration:e,easing:s.le.easeOutCubic},delay:t})},er=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];Z.current&&(n&&(document.body.style.cursor="pointer"),ee.start({to:{opacity:.5,r:C.r,g:C.g,b:C.b},config:{duration:e,easing:s.le.linear},delay:t}))},ea=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];Z.current&&(n&&(document.body.style.cursor="auto"),ee.start({to:{opacity:0,r:C.r,g:C.g,b:C.b},config:{duration:e,easing:s.le.easeOutCubic},delay:t}))},eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Z.current=!1,ee.stop(!0),ee.start({to:{opacity:.5,r:C.r,g:C.g,b:C.b},config:{duration:10,easing:s.le.linear},delay:e,onStart:()=>{D(f.uc.SFX_CONTENT_MENU_HOVER),A(f.uc.SFX_CONTENT_MENU_HOVER,l.z.sfx.content.menuHover,!1)}}),ee.start({to:{opacity:.25,r:C.r,g:C.g,b:C.b},config:{duration:1500,easing:s.le.easeOutCubic},delay:e+200})},ei=()=>{Z.current=!0,ee.stop(!0),ee.start({to:{opacity:0,r:C.r,g:C.g,b:C.b},config:{duration:1e3,easing:s.le.easeOutCubic},delay:0})},es=new o.Pq0,eu=new o.Pq0,ec=()=>{N.current&&L.current&&(N.current.getWorldPosition(es),L.current.getWorldPosition(eu),_.current.setAwardUIPosition(c,es,eu))},ef=(0,a.useRef)(0),ed=()=>
199{if(q.current)return;let e=G.current.getBoundingBoxSize(),t=B.current.getBoundingBoxSize(),n={width:e.x,height:e.y},r={width:t.x,height:t.y},a={width:0,height:0,left:0},i=p.width+24,s=i+n.width+24;a.left=i;let l=s+r.width,u=Math.max(p.height,n.height,r.height);X.current={width:l,height:u,top:0,left:0},a.width=l-a.left+12,a.height=u+8,G.current.setPositionXYZ(i,n.height/2+1,0),B.current.setPositionXYZ(s,r.height/2-1,0);let c=a.left+a.width/2-6;$.current.position.set(c,-4,-4),$.current.geometry.dispose(),$.current.geometry=new o.bdM(a.width,a.height,1,1),q.current=!0,b(X.current),ec()};return(0,a.useEffect)(()=>{L.current&&N.current&&ec()},[H]),(0,a.useImperativeHandle)(t,()=>({name:Y.current.title,position:d,totalSize:X,present:et,dismiss:en,recordWorldPosition:ec,activateHighlight:eo,deactivateHighlight:ei})),(0,r.jsxs)("group",{ref:j,layers:n,position:d,children:[(0,r.jsx)("mesh",{ref:N,layers:n,position:[p.width/2-p.width-400,0,0],visible:!1}),(0,r.jsxs)("mesh",{ref:L,layers:n,position:[p.width/2-p.width,0,0],visible:!0,children:[(0,r.jsx)("circleGeometry",{args:[3,16]}),(0,r.jsx)("meshBasicMaterial",{ref:z,color:Y.current.darkColor,transparent:!0,opacity:0})]}),(0,r.jsxs)("mesh",{ref:V,layers:n,position:[p.width/2,0,0],rotation:[0,0,90*y.V$],children:[(0,r.jsx)("planeGeometry",{args:[p.width,p.height,1,1]}),(0,r.jsx)("meshBasicMaterial",{ref:k,map:m[0],transparent:!0,opacity:0,color:Y.current.darkColor,depthTest:!1})]}),(0,r.jsx)(el.oQ,{ref:G,layers:n,text:g,fontFile:x,fontTexture:w,fontSize:R,fontColor:C,softness:1,dithering:!0,depthTest:!1,onInitialized:()=>{ef.current++,ef.current>=2&&ed()}}),(0,r.jsx)(el.oQ,{ref:B,layers:n,text:v,fontFile:x,fontTexture:w,fontSize:R,fontColor:C,softness:1,dithering:!0,depthTest:!1,onInitialized:()=>{ef.current++,ef.current>=2&&ed()}}),(0,r.jsxs)("mesh",{ref:$,layers:n,position:[0,0,-4],onClick:()=>{Z.current&&!O.current&&(ea(),U(!1),E(Y.current),I(Y.current.coordinate),D(f.uc.SFX_CONTENT_MENU_CLICK),A(f.uc.SFX_CONTENT_MENU_CLICK,l.z.sfx.content.menuClick,!1),F({event:"award_item_click",item_id:Y.current.uuid,item_name:Y.current.title}))},onPointerOver:()=>{Z.current&&!O.current&&(er(),D(f.uc.SFX_CONTENT_MENU_HOVER),A(f.uc.SFX_CONTENT_MENU_HOVER,l.z.sfx.content.menuHover,!1))},onPointerOut:()=>{Z.current&&!O.current&&ea()},children:[(0,r.jsx)("planeGeometry",{args:[1,1,1,1]}),(0,r.jsx)("meshBasicMaterial",{ref:W,transparent:!0,opacity:0,color:Y.current.darkColor,depthTest:!1})]})]})});eu.displayName="AwardListItem";let ec=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{play:m,stop:p}=(0,a.useContext)(u.nE),{fonts:g}=(0,a.useContext)(u.DM),v=(0,a.useContext)(u.fn),{datasetHolder:R,setIsAwardUIRendererReady:C,highlightedAwards:b,shouldHighlightAwards:T,setShouldHighlightAwards:P,setAwardUIMiddleLeftScreenPosition:M}=v,A=(0,a.useRef)(v.awardUIScene).current,{layoutMargins:_,layoutScale:I}=(0,a.useContext)(u.MQ),E=(0,a.useRef)(_);E.current=_;let U=(0,a.useRef)(I);U.current=I;let O=(0,a.useRef)(null),F=(0,a.useRef)(null),N=(0,a.useRef)(null),L=(0,a.useRef)(null),z=(0,a.useRef)(null),[V,k]=(0,a.useState)([]),G=(0,a.useRef)([]),B=(0,a.useRef)([]),j=(0,a.useRef)(null),$=(0,a.useRef)(null),W=(0,a.useCallback)(e=>t=>G.current[e]=t,[]),H=(0,i.C)(e=>e.pointer),Y=(0,i.C)(e=>e.size),X=(0,a.useRef)(0),q=(0,a.useRef)({width:0,height:0,top:0,left:0}),Z=(0,a.useRef)({x:0*y.V$,y:-(8*y.V$)}),Q=(0,a.useRef)({x:-(0*y.V$),y:-(2*y.V$)}),K=(0,s.zh)(()=>({from:{rx:N.current?.rotation.x??0,ry:N.current?.rotation.y??0},onChange:e=>{if(N.current){N.current.rotation.x=e.value.rx,N.current.rotation.y=e.value.ry;for(let e=0;e<G.current.length;e++){let t=G.current[e];t&&t.recordWorldPosition()}}}}),[])[1],J=new o.Pq0(0,0,0),ee=()=>{L.current.scale.set(U.current,U.current,1);let e=O.current.camera,t=2*Math.tan(e.fov*(Math.PI/180)/2)*(e.position.z-1e3)*e.aspect,n=new o.Pq0(e.position.x+t/2-t*E.current.right*2*U.current,e.position.y,1e3),r=new o.Pq0(n.x-U.current*q.current.width/2,n.y,1e3),a=new o.Pq0(-U.current*q.current.width/2,U.current*q.current.height/2,0);N.current.position.set(r.x,r.y,r.z),L.current.position.set(a.x,a.y,a.z);let i=new o.Pq0(r.x-q.current.width/2,r.y,r.z);F.current.position.set(i.x,i.y,i.z),F.current.getWorldPosition(J),M((0,w.UK)(J,O.current.camera,Y))},et=e=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>
199{j.current=null,z.current?.present({min:400,max:800},{min:0,max:800})},e);for(let t=0;t<G.current.length;t++)G.current[t].present(1600,e+400+30*t);$.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,P(!0)},e+400+30*G.current.length*2)},en=()=>{z.current.dismiss({min:200,max:400},{min:200,max:400});for(let e=0;e<G.current.length;e++){let t=G.current.length-e;G.current[e].dismiss(300,10*t)}},er=e=>{},ea=e=>{(0,D.Rm)("deeppink","\uD83C\uDFAC","onListItemPresentEnd",e),p(f.uc.SFX_TEXT_TRANSITION_1)},eo=e=>{},ei=e=>{p(f.uc.SFX_TEXT_TRANSITION_1)},es=e=>{if(X.current++,X.current===G.current.length){(()=>{let e=0;for(let t=0;t<G.current.length;t++)e=Math.max(e,G.current[t].totalSize.current.width);let t=G.current[G.current.length-1],n=t.position,r=t.totalSize.current;q.current={width:e,height:Math.abs(n.y)+r.height,top:0,left:0}})(),ee(),N.current.updateMatrixWorld(!0);for(let e=0;e<G.current.length;e++)G.current[e]?.recordWorldPosition();C(!0)}},ec=e=>{let t=Z.current.x+H.y*Q.current.x+Q.current.x,n=Z.current.y+-H.x*Q.current.y+Q.current.y;K.stop(!0),K.start({to:{rx:t,ry:n},config:{duration:400,easing:s.le.easeOutCubic}})};return(0,c._B)("deeppink"),(0,a.useEffect)(()=>(A.current=O.current,(()=>{if(!g.USansRgMd)return;for(let e of((0,D.Rm)("deeppink","\uD83D\uDEE0ï¸","setupAwardList"),B.current))e.dispose();B.current=[];let e=[],t={width:0,height:0},a=2*Math.PI/72;for(let n=0;n<=72;n++){let{texture:r,width:o,height:i}=(0,S.wO)(32,6,6,0,a*n);t.width=o,t.height=i,e.push(r),B.current.push(r)}k(R.current.awardArrayList.map((a,i)=>{let s=new o.Pq0(0,-48*i+-112,0);return(0,r.jsx)(eu,{ref:W(i),layers:n,awardIndex:i,position:s,markerTextures:e,markerSize:{width:t.width/2,height:t.height/2,top:0,left:0},yearText:a.year.toString(),titleText:a.title,fontFile:g.USansRgMd.fontFile,fontTexture:g.USansRgMd.fontTexture,fontSize:h.i.label.fontSize.awardList,onInitialized:es,onPresentStart:0===i?er:void 0,onPresentEnd:i===Math.max(0,R.current.awardArrayList.length-24)?ea:void 0,onDismissStart:i===R.current.awardArrayList.length-1?eo:void 0,onDismissEnd:0===i?ei:void 0},i)}))})(),()=>(()=>{for(let e of(j.current&&clearTimeout(j.current),$.current&&clearTimeout($.current),B.current))e.dispose();B.current=[]})()),[]),(0,a.useEffect)(()=>(window.addEventListener("mousemove",ec),()=>window.removeEventListener("mousemove",ec)),[]),(0,a.useLayoutEffect)(()=>{ee()},[I,_]),(0,a.useEffect)(()=>{if(b&&T){let e=0;for(let t=0;t<G.current.length;t++){let n=R.current.awardArrayList[t],r=G.current[t];n.key===b.key?(r.activateHighlight(200+40*e),e++):r.deactivateHighlight()}}else for(let e=0;e<G.current.length;e++)G.current[e].deactivateHighlight()},[T]),(0,a.useImperativeHandle)(t,()=>({present:et,dismiss:en})),(0,r.jsxs)(x,{layers:n,ref:O,name:d.eU.AWARD_UI,children:[(0,r.jsxs)("mesh",{ref:F,layers:n,visible:!1,children:[(0,r.jsx)("planeGeometry",{args:[20,20]}),(0,r.jsx)("meshBasicMaterial",{color:0xff0000})]}),(0,r.jsx)("group",{ref:N,layers:n,children:(0,r.jsxs)("group",{ref:L,layers:n,children:[g.USansRgBd&&(0,r.jsx)(el.PD,{ref:z,layers:n,position:[0,0,0],text:"AWARDS",fontFile:g.USansRgBd.fontFile,fontTexture:g.USansRgBd.fontTexture,fontSize:72,fontColor:new o.Q1f(h.i.label.fontColor),dithering:!1,onInitialized:()=>{},onPresentStart:()=>{m(f.uc.SFX_TEXT_TRANSITION_1,l.z.sfx.text.transition1,!0)},onPresentEnd:()=>{},onDismissStart:()=>{m(f.uc.SFX_TEXT_TRANSITION_1,l.z.sfx.text.transition1,!0)},onDismissEnd:()=>{}}),V]})})]})});var ef=n(4120);let ed=(0,a.forwardRef)((e,t)=>{let{play:n,stop:d,fade:m}=(0,a.useContext)(u.nE),{setIsNavigationVisible:h,configureNavigationAnimation:g,configureNavigationCamera:v}=(0,a.useContext)(u._3),{shouldPresentContent:x,isAwardHeaderRendererReady:y,isAwardUIRendererReady:w,isCageRendererReady:R,isCityMarkerRendererReady:C,isCoordinateGuideRendererReady:b,isEarthRendererReady:S,isUIMarkerConnectorRendererReady:T}=(0,a.useContext)(u.fn),P=(0,a.useRef)(null),M=(0,a.useRef)(null),A=(0,a.useRef)(null),D=(0,a.useRef)(null),{size:_}=(0,i.C)(),I=()=>{let e=_.height/ef.P;return{minX:70*e,maxX:_.width/2-70*e,minY:_.height/4,maxY:_.height/2-70*e}},E=e=>{U()},U=()=>{P.current?.dismiss(),M.current?.dismiss(),A.current?.dismiss(),h(!1),m(f.uc.BGM_AWARD_DRONE,0,0,4e3,!0)};return(0,c._B)("green"),(0,a.useEffect)(()=>{g(I())},[_]),(0,a.useEffect)(()=>{y&&w&&R&&C&&b&&S&&T&&(m(f.uc.BGM_AWARD_DRONE,l.z.bgm.award.drone,0,3e3,!0,s.le.easeInOutQuad),P.current?.present(),A.current?.present(4e3),M.current?.present(6e3),v({eye:p.Sy.clone().add(new o.Pq0(0,0,400)),fov:36}),g({animate:!1,showMarker:!0,parentLerpX:.04,parentLerpY:.04,parentLerpZ:.04,childLerpX:.08,childLerpY:.08,childLerpZ:.08,angleStart:150,angleStep:-30,...I()}),D.current=setTimeout(()=>{D.current=null,h(!0)},4e3))},[y,w,R,C,b,S,T]),(0,a.useEffect)(()=>()=>{D.current&&clearTimeout(D.current)},[]),(0,a.useImperativeHandle)(t,()=>
199({onRouteDismissStart:E})),x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ec,{ref:M,layers:void 0}),(0,r.jsx)(es,{ref:A,layers:void 0}),(0,r.jsx)(eo,{ref:P,layers:void 0})]})})},7861:(e,t,n)=>{n.d(t,{BX:()=>u,HD:()=>l,_h:()=>s});var r=n(9618),a=n(4357);let o={basePosition:a.Kh,lookAt:new r.Pq0(0,0,0),defaultAzimuth:45*Math.PI/180,defaultPolar:-30*Math.PI/180,maxAzimuth:15*Math.PI/180,maxPolar:5*Math.PI/180,followSpeed:.012},i={focus:a.Ke,aperture:a.p8,maxBlur:a.fk,rgbSplit:{amount:.0015,onsetMin:.03,onsetMax:.25,fringeMix:0}},s={contourmap:{...o,basePosition:new r.Pq0(1e3,-500,1800),lookAt:new r.Pq0(0,0,0),defaultAzimuth:0*Math.PI/180,defaultPolar:-20*Math.PI/180,maxAzimuth:5*Math.PI/180,maxPolar:5*Math.PI/180,followSpeed:.006},elasticgrid:{...o,basePosition:new r.Pq0(1e3,-500,3e3),lookAt:new r.Pq0(-100,0,0),defaultAzimuth:15*Math.PI/180,defaultPolar:-30*Math.PI/180,maxAzimuth:5*Math.PI/180,maxPolar:5*Math.PI/180,followSpeed:.006},curtainwall:{...o,basePosition:new r.Pq0(1e3,-500,1800),lookAt:new r.Pq0(-100,0,0),defaultAzimuth:-60*Math.PI/180,defaultPolar:-10*Math.PI/180,maxAzimuth:5*Math.PI/180,maxPolar:5*Math.PI/180,followSpeed:.006}},l={contourmap:{...i},elasticgrid:{...i},curtainwall:{...i,focus:3e3,aperture:6e-7,maxBlur:.005}},u={switchDismissDuration:700,selector:{buttonSize:80,textMargin:{top:3,bottom:3,left:6,right:6},fontSize:44,bracketLength:8,bracketSlideDuration:200,bracketExpandDuration:100,marginBottom:.05,presentDuration:1500,presentStagger:160,dismissDuration:100,hoverGlitchDuration:600,hoverWipeDuration:100},snapSymbol:{screenX:.97,screenY:.03,circleRadius:3,crossSize:6,crossThickness:2,triangleSize:4,diamondSize:5,opacity:1,orbitRadiusMin:6,orbitRadiusMax:12,angularSpeed:4,radiusFreq:3,tilt:.5,presentDuration:1e3,dismissDuration:100}}},7997:(e,t,n)=>{n.d(t,{Ws:()=>i,i1:()=>a,xV:()=>o});let r=[],a=e=>{r=e},o=e=>r.find(t=>t.uuid===e),i=e=>r.find(t=>t.index===e)},8101:(e,t,n)=>{n.d(t,{N3:()=>J,qE:()=>ee,Kw:()=>ep,Pq:()=>et,Di:()=>ec,DZ:()=>eo,k3:()=>em});var r=n(7973),a=n(6065),o=n(3267),i=n(4695),s=n(2310),l=n(2466),u=n(3882),c=n(6382);let f=256,d=2048,m=4,p=240,h=280,g=1,v=.9,x=.55,y=.06,w=.15,R=4e3,C=1200,b=.8,S=.3,T=5,P=3,M=1.5,A=600,D=-.3,_=.02,I=1024,E=256,U="BOTH",O=0xcccccc,F=.3,N=0xcccccc,L=4,z=1,V=240,k=280,G=1,B=.9,j=3,$=24,W=.03,H=3,Y=.02,X=.5,q=24;var Z=n(9618),Q=n(7197);function K(e,t,n,r,a){let o=Math.random();return e.setHSL((t+(n-t)*o)/360,r,a),e}let J=e=>{let{ringBufferTexture:t,materialRef:n,layers:o}=e,i=(0,a.useRef)(n).current,s=(0,a.useMemo)(()=>{let e=f*d,t=new Z.LoY,n=new Float32Array(e),r=new Float32Array(e);for(let e=0;e<f;e++)for(let t=0;t<d;t++){let a=e*d+t;n[a]=e,r[a]=t}t.setAttribute("aCurveId",new Z.THS(n,1)),t.setAttribute("aSlotIndex",new Z.THS(r,1));let a=new Uint32Array(f*(d-1)*2),o=0;for(let e=0;e<f;e++){let t=e*d;for(let e=0;e<d-1;e++)a[o++]=t+e,a[o++]=t+e+1}return t.setIndex(new Z.THS(a,1)),t},[]),l=(0,a.useMemo)(()=>{let e=new Uint8Array(4*f),t=new Z.Q1f;for(let n=0;n<f;n++)K(t,p,h,g,v),e[4*n]=Math.round(255*t.r),e[4*n+1]=Math.round(255*t.g),e[4*n+2]=Math.round(255*t.b),e[4*n+3]=255;let n=new Z.GYF(e,f,1,Z.GWd);return n.minFilter=Z.hxR,n.magFilter=Z.hxR,n.needsUpdate=!0,n},[]),u=(0,a.useMemo)(()=>{let e=new Z.BKk({vertexShader:Q.Pn,fragmentShader:Q.Rh,uniforms:{uRingBuffer:{value:null},uWriteIndex:{value:0},uHistoryLength:{value:d},uRingBufferWidth:{value:d},uRingBufferHeight:{value:f},uFadeStart:{value:y},uColorMap:{value:l},uOpacity:{value:0},uLineAlpha:{value:x}},transparent:!0,depthTest:!1,depthWrite:!1,blending:Z.EZo});return i.current=e,e},[i,l]);return(0,a.useEffect)(()=>{u&&t&&(u.uniforms.uRingBuffer.value=t)},[u,t]),(0,a.useEffect)(()=>()=>{s.dispose(),u.dispose(),l.dispose()},[s,u,l]),(0,r.jsx)("lineSegments",{geometry:s,material:u,layers:o,frustumCulled:!1})},ee=e=>{let{glyphData:t,opacity:n,layers:o}=e,{lineGeometry:i,pointGeometry:s}=(0,a.useMemo)(()=>(function(e){let{transformedContours:t,extrudeDepth:n}=e,r=[],a=[],o=[],i=[];for(let e of t){let t=e.vertices,s=t.length/2;if(!(s<2))for(let e=0;e<s;e++){let l=(e+1)%s,u=t[2*e],c=t[2*e+1],f=t[2*l],d=t[2*l+1];r.push(u,c,0,f,d,0),a.push(1,1),r.push(u,c,n,f,d,n),a.push(1,1),r.push(u,c,0,u,c,n),a.push(1,1),o.push(u,c,0),i.push(1),o.push(u,c,n),i.push(1)}}let s=new Z.LoY;s.setAttribute("position",new Z.qtW(r,3)),s.setAttribute("aAlpha",new Z.qtW(a,1));let l=new Z.LoY;return l.setAttribute("position",new Z.qtW(o,3)),l.setAttribute("aAlpha",new Z.qtW(i,1)),{lineGeometry:s,pointGeometry:l}})(t),[t]),u=(0,a.useMemo)(()=>new Z.BKk({vertexShader:Q.QY,fragmentShader:Q.eI,uniforms:{uColor:{value:new Z.Q1f(O)},uOpacity:{value:0},uLineAlpha:{value:F}},transparent:!0,depthTest:!1,depthWrite:!1,blending:Z.EZo}),[]),c=(0,a.useMemo)(()=>new Z.BKk({vertexShader:Q.RJ,fragmentShader:Q.vH,uniforms:{uColor:{value:new Z.Q1f(N)},uOpacity:{value:0},uDotAlpha:{value:z},uPointSize:{value:L}},transparent:!0,depthTest:!1,depthWrite:!1,blending:Z.EZo}),[]);return(0,l.Ql)(()=>{u.uniforms.uOpacity.value=n.current,c.uniforms.uOpacity.value=n.current}),(0,a.useEffect)(()=>()=>{i.dispose(),s.dispose(),u.dispose(),c.dispose()},[i,s,u,c]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("lineSegments",{geometry:i,material:u,layers:o,frustumCulled:!1}),(0,r.jsx)("points",{geometry:s,material:c,layers:o,frustumCulled:!1})]})},et=e=>{let{glyphData:t,opacity:n,layers:o}=e,i=(0,a.useMemo)(()=>(function(e){let{transformedContours:t,extrudeDepth:n}=e,r=[];for(let e of t){let t=e.vertices,a=t.length/2;if(a<2)continue;let o=[];for(let e=0;e<a;e++){let n=(e+1)%a,r=t[2*n]-t[2*e],i=t[2*n+1]-t[2*e+1],s=Math.sqrt(r*r+i*i);o.push(s>
1990?{nx:-i/s,ny:r/s}:{nx:1,ny:0})}for(let e=0;e<a;e++){let i=(e+1)%a,s=t[2*e],l=t[2*e+1],u=t[2*i],c=t[2*i+1],f=u-s,d=c-l,m=Math.sqrt(f*f+d*d),p=m>0?-d/m:0,h=m>0?f/m:0;r.push({sx:s,sy:l,sz:0,ex:u,ey:c,ez:0,length:m,nx:p,ny:h,nz:0}),r.push({sx:s,sy:l,sz:n,ex:u,ey:c,ez:n,length:m,nx:p,ny:h,nz:0});let g=o[(e-1+a)%a],v=o[e],x=g.nx+v.nx,y=g.ny+v.ny,w=Math.sqrt(x*x+y*y);r.push({sx:s,sy:l,sz:0,ex:s,ey:l,ez:n,length:n,nx:w>0?x/w:1,ny:w>0?y/w:0,nz:0})}}return r})(t),[t]),s=(0,a.useMemo)(()=>(function(e){let t=$+1,n=e.length*j,r=n*t,a=new Float32Array(3*r),o=new Float32Array(3*r),i=new Float32Array(3*r),s=new Float32Array(r),l=new Float32Array(3*r),u=new Z.Q1f,c=0;for(let t=0;t<e.length;t++){let n=e[t],r=n.ex-n.sx,f=n.ey-n.sy,d=n.ez-n.sz;for(let e=0;e<j;e++){let m=31*t+7*e,p=50*Math.sin(.1*m)+30*Math.cos(.3*m),h=.3+(.5*Math.sin(1.7*m)+.5)*.7,g=W*(.5+(.5*Math.sin(2.1*m)+.5)),v=W*(.5+(.5*Math.sin(3.3*m)+.5));K(u,V,k,G,B);let x=u.r,y=u.g,w=u.b;for(let e=0;e<=$;e++){let t=-g+e/$*(1+g+v);a[3*c]=n.sx+r*t,a[3*c+1]=n.sy+f*t,a[3*c+2]=n.sz+d*t,o[3*c]=n.nx,o[3*c+1]=n.ny,o[3*c+2]=n.nz,i[3*c]=n.length*t*Y,i[3*c+1]=p,i[3*c+2]=h,l[3*c]=x,l[3*c+1]=y,l[3*c+2]=w,s[c]=1,c++}}}let f=new Z.LoY;f.setAttribute("position",new Z.qtW(a,3)),f.setAttribute("aNormal",new Z.qtW(o,3)),f.setAttribute("aNoiseParams",new Z.qtW(i,3)),f.setAttribute("aColor",new Z.qtW(l,3)),f.setAttribute("aAlpha",new Z.qtW(s,1));let d=new Uint32Array(n*$*2),m=0;for(let e=0;e<n;e++){let n=e*t;for(let e=0;e<$;e++)d[m++]=n+e,d[m++]=n+e+1}return f.setIndex(new Z.THS(d,1)),f})(i),[i]),u=(0,a.useMemo)(()=>new Z.BKk({vertexShader:Q.Wx,fragmentShader:Q.lh,uniforms:{uOpacity:{value:0},uLineAlpha:{value:X},uTime:{value:0},uNoiseAmp:{value:H},uAnimSpeed:{value:q}},transparent:!0,depthTest:!1,depthWrite:!1,blending:Z.EZo}),[]);return(0,l.Ql)((e,t)=>{u.uniforms.uOpacity.value=n.current,u.uniforms.uTime.value+=t}),(0,a.useEffect)(()=>()=>{s.dispose(),u.dispose()},[s,u]),(0,r.jsx)("lineSegments",{geometry:s,material:u,layers:o,frustumCulled:!1})};var en=n(1343),er=n(4357),ea=n(3545);function eo(){let e,t,n=(0,en.c)(2),[r,o]=(0,a.useState)(null);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=!1;return(async()=>{let{buffer:t}=await (0,ea.G)("/assets/font/error-glyphs.bin");if(e)return;let{glyphs:n,kerning:r,unitsPerEm:a,ascender:i,descender:s}=function(e){let t=new DataView(e),n=0;if("GLYF"!==String.fromCharCode(t.getUint8(0),t.getUint8(1),t.getUint8(2),t.getUint8(3)))throw Error("Invalid glyph binary: bad magic");n=6;let r=t.getUint16(n,!0);n+=2;let a=t.getUint16(n,!0);n+=2;let o=t.getInt16(n,!0);n+=2;let i=t.getInt16(n,!0);n+=2;let s=new Map;for(let e=0;e<r;e++){let e=t.getUint16(n,!0);n+=2;let r=t.getFloat32(n,!0);n+=4;let a=t.getUint16(n,!0);n+=2;let o=[];for(let e=0;e<a;e++){let e=t.getUint16(n,!0);n+=2;let r=new Float32Array(2*e);for(let a=0;a<2*e;a++)r[a]=t.getFloat32(n,!0),n+=4;o.push({vertices:r})}s.set(e,{charCode:e,advanceWidth:r,contours:o})}let l=new Map,u=t.getUint16(n,!0);n+=2;for(let e=0;e<u;e++){let e=t.getUint16(n,!0);n+=2;let r=t.getUint16(n,!0);n+=2;let a=t.getFloat32(n,!0);n+=4,l.set(`${e},${r}`,a)}return{glyphs:s,kerning:l,unitsPerEm:a,ascender:o,descender:i}}(t);o(function(e,t,n,r,a,o){let i=a-o,s=i*w,l=.5*s,u=Array.from(e).map(e=>e.charCodeAt(0)),c=[],f=0;for(let e=0;e<u.length;e++){let r=u[e];c.push(f);let a=t.get(r);if(a){f+=a.advanceWidth;let t=u[e+1];if(void 0!==t){let e=n.get(`${r},${t}`);e&&(f+=e)}}}let d=[],m=1/0,p=1/0,h=-1/0,g=-1/0;for(let e=0;e<u.length;e++){let n=t.get(u[e]);if(!n)continue;let r=c[e];for(let e of n.contours){let t=new Float32Array(e.vertices.length);for(let n=0;n<e.vertices.length;n+=2){let a=e.vertices[n]+r,o=-e.vertices[n+1];t[n]=a,t[n+1]=o,a<m&&(m=a),o<p&&(p=o),a>h&&(h=a),o>g&&(g=o)}d.push({vertices:t})}}let v=(m+h)*.5,x=(p+g)*.5,y=[],R=1/0,C=1/0,b=-1/0,S=-1/0;for(let e of d){let t=new Float32Array(e.vertices.length);for(let n=0;n<e.vertices.length;n+=2){let r=e.vertices[n]-v,a=e.vertices[n+1]-x;t[n]=r,t[n+1]=a,r<R&&(R=r),a<C&&(C=a),r>b&&(b=r),a>S&&(S=a)}y.push({vertices:t})}let T=er._m.z,P=2*Math.tan(er.DB*Math.PI/180/2)*T,M=b-R,A=M>0?16/9*P*.8/M:1,D=[],_=1/0,I=1/0,E=-1/0,U=-1/0;for(let e of y){let t=new Float32Array(e.vertices.length);for(let n=0;n<e.vertices.length;n+=2){let r=e.vertices[n]*A,a=e.vertices[n+1]*A;t[n]=r,t[n+1]=a,r<_&&(_=r),a<I&&(I=a),r>E&&(E=r),a>U&&(U=a)}D.push({vertices:t})}return s*=A,l=.5*s,y.length=0,y.push(...D),m=_,p=I,h=E,g=U,{transformedContours:y,bboxMin:new Z.I9Y(m,p),bboxMax:new Z.I9Y(h,g),charHeight:i,extrudeDepth:s,extrudeCenter:l,unitsPerEm:r}}("KOJIRO FUTAMURA",n,r,a,i,s))})(),()=>{e=!0}},t=[],n[0]=e,n[1]=t):(e=n[0],t=n[1]),(0,a.useEffect)(e,t),r}var ei=n(1916),es=n(637);let el=` 200varying vec2 vUv; 201void main() { 202 vUv = uv; 203 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
203); 204} 205`,eu=Math.ceil(Math.sqrt(f));function ec(e){let{gl:t,sdfTexture:n,glyphData:r}=e,[o,i]=(0,a.useState)(!1),s=(0,a.useRef)(null),l=(0,a.useRef)(!1),c=(0,a.useRef)(null),p=(0,a.useRef)(null),h=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null),A=(0,a.useRef)(null),D=(0,a.useRef)(null),_=(0,a.useRef)(0),U=(0,a.useRef)(0),O=(0,a.useRef)(0),F=(0,a.useRef)(null),N=(0,a.useRef)(null);n&&r&&!l.current&&n!==F.current&&r!==N.current&&(F.current=n,N.current=r,function(e,t,n){(0,u.Rm)("crimson","\uD83D\uDEE0ï¸","useContactScribbleGPUCompute.setup");let{bboxMin:r,bboxMax:a,extrudeCenter:o,extrudeDepth:m}=n,F=new ei.d(eu,eu,e);(0,es.n)()&&F.setDataType(Z.ix0);let N=F.createTexture(),L=F.createTexture(),z=F.createTexture(),V=N.image.data,k=L.image.data,G=z.image.data,B=n.transformedContours,j=a.x-r.x,$=a.y-r.y,W=[],H=50*f;for(let e=0;e<H&&W.length<f;e++){let e=r.x+Math.random()*j,t=r.y+Math.random()*$;(function(e,t){let n=0;for(let r of B){let a=r.vertices,o=a.length/2;for(let r=0;r<o;r++){let i=(r+1)%o,s=a[2*r+1],l=a[2*i+1];if(s<=t&&l>t||l<=t&&s>t){let o=a[2*r];e<o+(t-s)/(l-s)*(a[2*i]-o)&&n++}}}return(1&n)==1})(e,t)&&W.push({x:e,y:t})}for(let e=0;e<eu*eu;e++){let t=4*e;if(e<f){let n=W[e%W.length];V[t]=n.x,V[t+1]=n.y,V[t+2]=Math.random()*m,V[t+3]=1;let r=Math.random()*Math.PI*2,a=Math.acos(2*Math.random()-1),o=.5*R;k[t]=Math.sin(a)*Math.cos(r)*o,k[t+1]=Math.sin(a)*Math.sin(r)*o,k[t+2]=Math.cos(a)*o,k[t+3]=0,G[t]=+(Math.random()>.5),G[t+1]=1,G[t+2]=Math.random()*T,G[t+3]=1}else V[t]=0,V[t+1]=0,V[t+2]=0,V[t+3]=0,k[t]=0,k[t+1]=0,k[t+2]=0,k[t+3]=0,G[t]=0,G[t+1]=1,G[t+2]=0,G[t+3]=0}let Y=F.addVariable("tCurvePosition",Q.Cg,N),X=F.addVariable("tCurveVelocity",Q.Yb,L),q=F.addVariable("tCurveRole",Q.Bg,z);F.setVariableDependencies(Y,[Y,X]),F.setVariableDependencies(X,[Y,X,q]),F.setVariableDependencies(q,[q]),Y.material.uniforms.uDelta={value:0},Y.material.uniforms.uBBoxMin={value:new Z.I9Y(r.x,r.y)},Y.material.uniforms.uBBoxMax={value:new Z.I9Y(a.x,a.y)},Y.material.uniforms.uExtrudeCenter={value:o},Y.material.uniforms.uExtrudeDepth={value:m},X.material.uniforms.uDelta={value:0},X.material.uniforms.uTime={value:0},X.material.uniforms.uSdf2D={value:t},X.material.uniforms.uBBoxMin={value:new Z.I9Y(r.x,r.y)},X.material.uniforms.uBBoxMax={value:new Z.I9Y(a.x,a.y)},X.material.uniforms.uExtrudeCenter={value:o},X.material.uniforms.uExtrudeDepth={value:m},X.material.uniforms.uInteriorSpeed={value:R},X.material.uniforms.uSurfaceSpeed={value:C},X.material.uniforms.uNoiseInfluence={value:b},X.material.uniforms.uSurfaceNoise={value:S},X.material.uniforms.uSdfResolution={value:new Z.I9Y(I,E)},X.material.uniforms.uSdfPad={value:2},q.material.uniforms.uDelta={value:0},q.material.uniforms.uTime={value:0},q.material.uniforms.uBasePeriod={value:T},q.material.uniforms.uPeriodVariance={value:P},q.material.uniforms.uTransitionDuration={value:M};let K=F.init();null!==K&&(0,u.Rm)("crimson","â","gpuCompute init error",K),N.dispose(),L.dispose(),z.dispose(),c.current=F,p.current=Y,h.current=X,g.current=q;let J={type:Z.RQf,format:Z.GWd,minFilter:Z.hxR,magFilter:Z.hxR,depthBuffer:!1,stencilBuffer:!1};v.current=new Z.nWS(d,f,J),x.current=new Z.nWS(d,f,J);let ee=new Z.Z58,et=new Z.qUd(-1,1,1,-1,0,1),en=new Z.BKk({vertexShader:el,fragmentShader:Q.Pv,uniforms:{tCurvePosition:{value:null},tRingBuffer:{value:null},uWriteIndex:{value:0},uHistoryLength:{value:d},uCurveCount:{value:f},uGpuDim:{value:eu},uResolution:{value:new Z.I9Y(d,f)}},depthTest:!1,depthWrite:!1}),er=new Z.eaF(new Z.bdM(2,2),en);ee.add(er),y.current=ee,w.current=et,A.current=en,D.current=er,_.current=0,U.current=0,O.current=0,l.current=!0,s.current=v.current.texture,i(!0)}(t,n,r));let L=(0,a.useCallback)(e=>{if(!l.current)return;let n=Math.min(e,1/30)/m,r=t.getRenderTarget();p.current.material.uniforms.uDelta.value=n,h.current.material.uniforms.uDelta.value=n,g.current.material.uniforms.uDelta.value=n;for(let e=0;e<m;e++){O.current+=n,h.current.material.uniforms.uTime.value=O.current,g.current.material.uniforms.uTime.value=O.current,c.current.compute();
205let e=c.current.getCurrentRenderTarget(p.current).texture,r=U.current%2==0,a=r?v.current:x.current,o=r?x.current:v.current;A.current.uniforms.tCurvePosition.value=e,A.current.uniforms.tRingBuffer.value=o.texture,A.current.uniforms.uWriteIndex.value=_.current,t.setRenderTarget(a),t.render(y.current,w.current),_.current=(_.current+1)%d,U.current+=1,s.current=a.texture}t.setRenderTarget(r)},[t]),z=(0,a.useCallback)(()=>{l.current&&(c.current?.dispose(),c.current=null,v.current?.dispose(),v.current=null,x.current?.dispose(),x.current=null,D.current&&(D.current.geometry.dispose(),D.current.material.dispose(),D.current=null),l.current=!1,i(!1),s.current=null)},[]);return{isReady:o,ringBufferTexture:s,writeIndex:_,compute:L,dispose:z}}let ef=` 206varying vec2 vUv; 207void main() { 208 vUv = uv; 209 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 210} 211`;function ed(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Z.nWS(e,t,{minFilter:Z.hxR,magFilter:Z.hxR,format:Z.GWd,type:Z.RQf,depthBuffer:n,stencilBuffer:n})}function em(e,t){let n,r,o,i=(0,en.c)(6),[s,l]=(0,a.useState)(null),u=(0,a.useRef)(null),c=(0,a.useRef)(t).current;return i[0]!==t||i[1]!==e?(n=()=>{if(!e||!c)return;let{transformedContours:n,bboxMin:r,bboxMax:a}=e,o=c.getRenderTarget(),i=c.autoClear;c.autoClear=!0;let s=ed(I,E),f=new Z.Z58,d=r.x-2,m=a.x+2,p=r.y-2,h=a.y+2,g=new Z.qUd(d,m,h,p,-1,1),v=function(e){let t=[],n=new Z.mrM({color:0xffffff});for(let r of e){let e=r.vertices,a=e.length/2;if(a<2)continue;let o=new Float32Array(3*a);for(let t=0;t<a;t++)o[3*t]=e[2*t],o[3*t+1]=e[2*t+1],o[3*t+2]=0;let i=new Z.LoY;i.setAttribute("position",new Z.THS(o,3)),t.push(new Z.FCc(i,n))}return t}(n);for(let e of v)f.add(e);c.setRenderTarget(s),c.setClearColor(0,1),c.clear(),c.render(f,g);let x=ed(I,E,!0),y=new Z.Z58,w=new Z.qUd(d,m,h,p,-1,1),R=function(e){let t=[],n=new Z.V9B({colorWrite:!1,depthWrite:!1,depthTest:!1,stencilWrite:!0,stencilFunc:Z.sKt,stencilRef:0,stencilZPass:Z.oVO,stencilZFail:Z.VVr,stencilFail:Z.VVr,side:Z.$EB});for(let r of e){let e=r.vertices,a=e.length/2;if(a<3)continue;let o=0,i=0;for(let t=0;t<a;t++)o+=e[2*t],i+=e[2*t+1];o/=a,i/=a;let s=new Float32Array(3*a*3);for(let t=0;t<a;t++){let n=(t+1)%a,r=9*t;s[r]=o,s[r+1]=i,s[r+2]=0,s[r+3]=e[2*t],s[r+4]=e[2*t+1],s[r+5]=0,s[r+6]=e[2*n],s[r+7]=e[2*n+1],s[r+8]=0}let l=new Z.LoY;l.setAttribute("position",new Z.THS(s,3)),t.push(new Z.eaF(l,n))}return t}(n);for(let e of R)y.add(e);c.setRenderTarget(x),c.setClearColor(0,1),c.state.buffers.stencil.setClear(0),c.clear(!0,!0,!0),c.render(y,w);let C=new Z.Z58,b=new Z.V9B({color:0xffffff,depthTest:!1,depthWrite:!1,stencilWrite:!0,stencilFunc:Z.klZ,stencilRef:0,stencilZPass:Z.VVr,stencilZFail:Z.VVr,stencilFail:Z.VVr}),S=new Z.bdM(m-d,h-p),T=new Z.eaF(S,b);T.position.set((d+m)*.5,(p+h)*.5,0),C.add(T),c.autoClear=!1,c.render(C,w),c.autoClear=!0;let P=new Z.Z58,M=new Z.qUd(-1,1,1,-1,0,1),A=new Z.bdM(2,2),D=ed(I,E),_=new Z.BKk({vertexShader:ef,fragmentShader:Q.U$,uniforms:{uOutlineTexture:{value:s.texture},uResolution:{value:new Z.I9Y(I,E)}},depthTest:!1,depthWrite:!1}),U=new Z.eaF(A,_);P.add(U),c.setRenderTarget(D),c.clear(),c.render(P,M);let O=ed(I,E),F=ed(I,E),N=new Z.BKk({vertexShader:ef,fragmentShader:Q.N3,uniforms:{uStepSize:{value:0},uResolution:{value:new Z.I9Y(I,E)},uPrevPass:{value:null}},depthTest:!1,depthWrite:!1});U.visible=!1;let L=new Z.eaF(A,N);P.add(L);let z=D,V=O;for(let e=0;e<10;e++){let t=Math.pow(2,9-e);if(N.uniforms.uStepSize.value=t,N.uniforms.uPrevPass.value=z.texture,c.setRenderTarget(V),c.clear(),c.render(P,M),0===e)z=O,V=F;else{let e=z;z=V,V=e}}let k=t.extensions.has("OES_texture_float_linear")?Z.k6q:Z.hxR,G=new Z.nWS(I,E,{minFilter:k,magFilter:k,format:Z.GWd,type:Z.RQf,depthBuffer:!1,stencilBuffer:!1}),B=a.x-r.x+4,j=a.y-r.y+4,$=new Z.BKk({vertexShader:ef,fragmentShader:Q.kC,uniforms:{uJFATexture:{value:z.texture},uWindingMask:{value:x.texture},uResolution:{value:new Z.I9Y(I,E)},uWorldSize:{value:new Z.I9Y(B,j)}},depthTest:!1,depthWrite:!1});L.visible=!1;let W=new Z.eaF(A,$);for(let e of(P.add(W),c.setRenderTarget(G),c.clear(),c.render(P,M),c.setRenderTarget(o),c.autoClear=i,s.dispose(),x.dispose(),D.dispose(),O.dispose(),F.dispose(),v))e.geometry.dispose(),e.material.dispose();for(let e of R)e.geometry.dispose(),e.material.dispose();return S.dispose(),b.dispose(),A.dispose(),_.dispose(),N.dispose(),$.dis
211pose(),u.current=G.texture,l(G.texture),()=>{G.dispose(),u.current=null}},r=[e,t],i[0]=t,i[1]=e,i[2]=n,i[3]=r):(n=i[2],r=i[3]),(0,a.useEffect)(n,r),i[4]!==s?(o={sdfTexture:s},i[4]=s,i[5]=o):o=i[5],o}let ep=(0,a.forwardRef)((e,t)=>{let{setIsContactScribbleRendererReady:n,sceneCamera:f,mouseRotationY:d}=(0,a.useContext)(s.uN),m=(0,a.useRef)(d).current,p=(0,o.C)(e=>e.gl),h=eo(),{sdfTexture:g}=em(h,p),{isReady:v,ringBufferTexture:x,writeIndex:y,compute:w,dispose:R}=ec({gl:p,sdfTexture:g,glyphData:h}),C=(0,a.useRef)(null),b=(0,a.useRef)(0),S=(0,a.useRef)(0),T=(0,a.useRef)(0),P=(0,a.useRef)(0),M=(0,a.useRef)(0),I=(0,a.useRef)(!1),E=(0,a.useRef)(0),[O,F]=(0,i.zh)(()=>({from:{alpha:0},onChange:e=>{E.current=e.value.alpha}}),[]);(0,a.useEffect)(()=>{let e=e=>{b.current=(e.clientX/window.innerWidth-.5)*D*2,T.current=(e.clientX/window.innerWidth-.5)*2};return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}},[]),(0,a.useEffect)(()=>{h&&(M.current=h.bboxMax.x-h.bboxMin.x)},[h]),(0,a.useEffect)(()=>{v&&n(!0)},[v,n]),(0,a.useEffect)(()=>()=>{R()},[R]);let N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,u.Rm)("mediumvioletred","â¶ï¸","ContactScribbleRenderer.present"),I.current=!0,F.stop(!0),F.start({to:{alpha:1},config:{duration:12e3,easing:i.le.easeOutSine},delay:e})},L=()=>{(0,u.Rm)("mediumvioletred","â¶ï¸","ContactScribbleRenderer.dismiss"),I.current=!1,F.stop(!0),F.start({to:{alpha:0},config:{duration:500,easing:i.le.easeOutSine}})};return(0,l._B)("mediumvioletred"),(0,l.Ql)((e,t)=>{let n=(0,c.xx)(_,t);S.current+=(b.current-S.current)*n;let r=(0,c.xx)(.03*_,t);P.current+=(T.current-P.current)*r,m.current=S.current;let a=f.current;if(a){let e=A,t=2*Math.tan(a.fov*(Math.PI/180)/2)*e*a.aspect,n=Math.max(0,(1.1*M.current-t)/2+e*Math.tan(Math.abs(D)));a.position.set(P.current*n,0,e),a.rotation.set(0,-S.current,0,"YXZ"),a.updateProjectionMatrix()}I.current&&w(t);let o=C.current;o&&(o.uniforms.uRingBuffer.value=x.current,o.uniforms.uWriteIndex.value=y.current,o.uniforms.uOpacity.value=E.current)}),(0,a.useImperativeHandle)(t,()=>({present:N,dismiss:L,onRouteDismissStart:()=>{},onRouteDismissUpdate:()=>{},onRouteDismissEnd:()=>{}})),(0,r.jsxs)(r.Fragment,{children:[v&&x.current&&(0,r.jsx)(J,{ringBufferTexture:x.current,writeIndex:y,opacity:E,materialRef:C,layers:void 0}),h&&("A"===U||"BOTH"===U)&&(0,r.jsx)(ee,{glyphData:h,opacity:E,layers:void 0}),h&&("B"===U||"BOTH"===U)&&(0,r.jsx)(et,{glyphData:h,opacity:E,layers:void 0})]})})},8497:(e,t,n)=>{n.d(t,{J:()=>r});let r=()=>{if("u"<typeof document)return"unknown";let e=null;try{let t=document.createElement("canvas");if(!(e=t.getContext("webgl2")??t.getContext("webgl")))return"unknown";let n=e.getExtension("WEBGL_debug_renderer_info");if(!n)return"unknown";let r=e.getParameter(n.UNMASKED_RENDERER_WEBGL);return"string"==typeof r&&r.length>0?r:"unknown"}catch{return"unknown"}finally{if(e){let t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}}}},8498:(e,t,n)=>{var r=n(4201);r.ShaderChunk.ftmr_easings="#define M_PI 3.1415926535897932384626433832795\n\n/*\n * Linear\n *\n * @param {float} edge0 - The start edge.\n * @param {float} edge1 - The end edge.\n * @param {float} x - The value to be clamped.\n * @returns {float} The clamped value.\n */\nfloat linearstep(float edge0, float edge1, float x) {\n return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\n\n/*\n * Easing functions\n *\n * @author https://easings.net/\n */\n\n/*\n * Linear\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat linear(float t) {\n return min(max((t - 0.0) / (1.0 - 0.0), 0.0), 1.0);\n}\n\n/*\n * Sine\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInSine(float t) {\n return 1.0 - cos(t * M_PI / 2.0);\n}\n\n/*\n * Sine\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutSine(float t) {\n return sin(t * M_PI / 2.0);\n}\n\n/*\n * Sine\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutSine(float t) {\n return -(cos(M_PI * t) - 1.0) / 2.0;\n}\n\n/*\n * Quadratic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInQuad(float t) {\n return t * t;\n}\n\n/*\n * Quadratic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutQuad(float t) {\n return 1.0 - (1.0 - t) * (1.0 - t);\n}\n\n/*\n * Quadratic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutQuad(float t) {\n return t < 0.5\n ? 2.0 * t * t\n : 1.0 - pow(-2.0 * t + 2.0, 2.0) / 2.0;\n}\n\n/*\n * Cubic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInCubic(float t) {\n return t * t * t;\n}\n\n/*\n * Cubic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutCubic(float t) {\n return 1.0 - pow(1.0 - t, 3.0);\n}\n\n/*\n * Cubic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutCubic(float t) {\n return t < 0.5\n ? 4.0 * t * t * t\n : 1.0 - pow(-2.0 * t + 2.0, 3.0) / 2.0;\n}\n\n/*\n * Quartic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInQuart(float t) {\n return t * t * t * t;\n}\n\n/*\n * Quartic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutQuart(float t) {\n return 1.0 - pow(1.0 - t, 4.0);\n}\n\n/*\n * Quartic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutQuart(float t) {\n return t < 0.5\n ? 8.0 * t * t * t * t\n : 1.0 - pow(-2.0 * t + 2.0, 4.0) / 2.0;\n}\n\n/*\n * Quintic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInQuint(float t) {\n return t * t * t * t * t;\n}\n\n/*\n * Quintic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutQuint(float t) {\n return 1.0 - pow(1.0 - t, 5.0);\n}\n\n/*\n * Quintic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutQuint(float t) {\n return t < 0.5\n ? 16.0 * t * t * t * t * t\n : 1.0 - pow(-2.0 * t + 2.0, 5.0) / 2.0;\n}\n\n/*\n * Expo\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInExpo(float t) {\n return t == 0.0\n ? 0.0\n : pow(2.0, 10.
2110 * t - 10.0);\n}\n\n/*\n * Expo\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutExpo(float t) {\n return t == 1.0\n ? 1.0\n : 1.0 - pow(2.0, -10.0 * t);\n}\n\n/*\n * Expo\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutExpo(float t) {\n return t == 0.0\n ? 0.0\n : t == 1.0\n ? 1.0\n : t < 0.5\n ? pow(2.0, 20.0 * t - 10.0) / 2.0\n : (2.0 - pow(2.0, -20.0 * t + 10.0)) / 2.0;\n}\n\n/*\n * Circ\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInCirc(float t) {\n return 1.0 - sqrt(1.0 - pow(t, 2.0));\n}\n\n/*\n * Circ\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutCirc(float t) {\n return sqrt(1.0 - pow(t - 1.0, 2.0));\n}\n\n/*\n * Circ\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutCirc(float t) {\n return t < 0.5\n ? (1.0 - sqrt(1.0 - pow(2.0 * t, 2.0))) / 2.0\n : (sqrt(1.0 - pow(-2.0 * t + 2.0, 2.0)) + 1.0) / 2.0;\n}\n\n/*\n * Back\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInBack(float t) {\n float c1 = 1.70158;\n float c3 = c1 + 1.0;\n return c3 * t * t * t - c1 * t * t;\n}\n\n/*\n * Back\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutBack(float t) {\n float c1 = 1.70158;\n float c3 = c1 + 1.0;\n return 1.0 + c3 * pow(t - 1.0, 3.0) + c1 * pow(t - 1.0, 2.0);\n}\n\n/*\n * Back\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutBack(float t) {\n float c1 = 1.70158;\n float c2 = c1 * 1.525;\n return t < 0.5\n ? pow(2.0 * t, 2.0) * ((c2 + 1.0) * 2.0 * t - c2) / 2.0\n : (pow(2.0 * t - 2.0, 2.0) * ((c2 + 1.0) * (t * 2.0 - 2.0) + c2) + 2.0) / 2.0;\n}\n\n/*\n * Elastic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInElastic(float t) {\n float c4 = 2.0 * M_PI / 3.0;\n return t == 0.0\n ? 0.0\n : t == 1.0\n ? 1.0\n : -pow(2.0, 10.
2110 * t - 10.0) * sin((t * 10.0 - 10.75) * c4);\n}\n\n/*\n * Elastic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutElastic(float t) {\n float c4 = 2.0 * M_PI / 3.0;\n return t == 0.0\n ? 0.0\n : t == 1.0\n ? 1.0\n : pow(2.0, -10.0 * t) * sin((t * 10.0 - 0.75) * c4) + 1.0;\n}\n\n/*\n * Elastic\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutElastic(float t) {\n float c5 = 2.0 * M_PI / 4.5;\n return t == 0.0\n ? 0.0\n : t == 1.0\n ? 1.0\n : t < 0.5\n ? -(pow(2.0, 20.0 * t - 10.0) * sin((20.0 * t - 11.125) * c5)) / 2.0\n : pow(2.0, -20.0 * t + 10.0) * sin((20.0 * t - 11.125) * c5) / 2.0 + 1.0;\n}\n\n/*\n * Bounce\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeOutBounce(float t) {\n float n1 = 7.5625;\n float d1 = 2.75;\n if (t < 1.0 / d1) {\n return n1 * t * t;\n } else if (t < 2.0 / d1) {\n return n1 * (t -= 1.5 / d1) * t + 0.75;\n } else if (t < 2.5 / d1) {\n return n1 * (t -= 2.25 / d1) * t + 0.9375;\n } else {\n return n1 * (t -= 2.625 / d1) * t + 0.984375;\n }\n}\n\n/*\n * Bounce\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInBounce(float t) {\n return 1.0 - easeOutBounce(1.0 - t);\n}\n\n/*\n * Bounce\n *\n * @param {float} t - The time value.\n * @returns {float} The eased value.\n */\nfloat easeInOutBounce(float t) {\n return t < 0.5\n ? (1.0 - easeOutBounce(1.0 - 2.0 * t)) / 2.0\n : (1.0 + easeOutBounce(2.0 * t - 1.0)) / 2.0;\n}\n",r.ShaderChunk.ftmr_geographic="/**\n * Calculate the intersection point of the line segment and the sphere\n *\n * @param p0 - The start position of the line segment\n * @param p1 - The end position of the line segment\n * @param center - The center of the sphere\n * @param radius - The radius of the sphere\n * @return The intersection point of the line segment and the sphere\n */\nvec4 segmentSphereIntersection(vec3 p0, vec3 p1, vec3 center, float radius) {\n vec3 d = p1 - p0;\n vec3 f = p0 - center;\n\n float a = dot(d, d);\n float b = 2.0 * dot(f, d);\n float c = dot(f, f) - radius * radius;\n\n float discriminant = b * b - 4.0 * a * c;\n\n if (discriminant < 0.0) {\n /**\n * 交ç¹ãåå¨ããªãå ´å\n */\n return vec4(p0, 0.0);\n }\n\n discriminant = sqrt(discriminant);\n\n float t1 = (-b + discriminant) / (2.0 * a);\n float t2 = (-b - discriminant) / (2.0 * a);\n\n if (t1 >= 0.0 && t1 <= 1.0) {\n /**\n * t1ãç·åä¸ã«ããå ´å\n */\n return vec4(p0 + t1 * d, 1.0);\n } else if (t2 >= 0.0 && t2 <= 1.0) {\n /**\n * t2ãç·åä¸ã«ããå ´å\n */\n return vec4(p0 + t2 * d, 1.0);\n } else {\n /**\n * 交ç¹ãç·åä¸ã«ãªãå ´å\n */\n return vec4(p0, 0.0);\n }\n}\n\n// /**\n// * Calculate the spherical interpolation of the line segment and the sphere\n// *\n// * @param p0 - The start position of the line segment\n// * @param p1 - The end position of the line segment\n// * @param center - The center of the sphere\n// * @param radius - The radius of the sphere\n// * @param vertexCount - The number of the vertex\n// * @param vertexIndex - The index of the vertex\n// * @return The spherical interpolation of the line segment and the sphere\n// */\n// vec3 sphericalInterpolation(vec3 p0, vec3 p1, vec3 center, float radius, float vertexCount, float vertexIndex) {\n// // ä¸å¿ãåç¹ã«ç§»å\n// vec3 v0 = normalize(p0 - center);\n// vec3 v1 = normalize(p1 - center);\n\n// // 2ç¹éã®è§åº¦ãè¨ç®\n// float theta = acos(dot(v0, v1));\n\n// // è£éä¿æ°ãè¨ç®\n// float t = vertexIndex / (vertexCount - 1.0);\n\n// // çé¢ç·å½¢è£éï¼Slerpï¼ãè¡ã\n// float sinTheta = sin(theta);\n// vec3 v = (sin((1.0 - t) * theta) / sinTheta) * v0 + (sin(t * theta) / sinTheta) * v1;\n\n// // çé¢ä¸ã®ç¹ã«å¤æãã¦è¿ã\n// return center + radius * normalize(v);\n// }\n\n/**\n * Define the number of the vertex for the spherical interpolation\n */\n#ifndef SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT\n#define SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT 8\n#endif\n\n/**\n * Calculate the spherical interpolation of the line segment and the sphere\n *\n * @param p0 - The start position of the line segment\n * @param p1 - The end position of the line segment\n * @param center - The center of the sphere\n * @param radius - The radius of the sphere\n * @return The spherical interpolation of the line segment and the sphere\n */\nvec3[SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT] sphericalInterpolation(vec3 p0, vec3 p1, vec3 center, float radius) {\n vec3[SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT] result;\n\n // ä¸å¿ãåç¹ã«ç§»å\n vec3 v0 = normalize(p0 - center);\n vec3 v1 = normalize(p1 - center);
211\n\n // å転軸ã¨è§åº¦ãè¨ç®\n vec3 axis = normalize(cross(v0, v1));\n float angle = acos(dot(v0, v1));\n\n // è£é\n for (int i = 0; i < SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT; i++) {\n float t = float(i) / float(SPHERICAL_INTERPOLATION_OUTPUT_VERTEX_COUNT - 1);\n float theta = angle * t;\n\n // Rodriguesã®å転å
¬å¼\n vec3 rotated = v0 * cos(theta) + cross(axis, v0) * sin(theta) + axis * dot(axis, v0) * (1.0 - cos(theta));\n\n // çé¢ä¸ã®ç¹ã«å¤æ\n result[i] = center + rotated * radius;\n }\n\n return result;\n}\n\n/**\n * ç·åã¨çé¢ã®çé¢è£éãè¨ç®ãã\n *\n * @param p0 - ç·åã®éå§ä½ç½®\n * @param p1 - ç·åã®çµäºä½ç½®\n * @param center - çã®ä¸å¿\n * @param radius - çã®åå¾\n * @param index - åå¾ããé ç¹ã®ã¤ã³ããã¯ã¹\n * @param numVertex - åå²ããé ç¹ã®ç·æ°\n * @return ç·åã¨çé¢ã®çé¢è£é\n */\nvec3 sphericalInterpolation(vec3 p0, vec3 p1, vec3 center, float radius, float index, float numVertex) {\n // ä¸å¿ãåç¹ã«ç§»å\n vec3 v0 = p0 - center;\n vec3 v1 = p1 - center;\n\n // ãã¯ãã«ãæ£è¦å\n v0 = normalize(v0);\n v1 = normalize(v1);\n\n // 2ç¹éã®è§åº¦ãè¨ç®\n float theta = acos(dot(v0, v1));\n\n // è£éä¿æ°ãè¨ç®\n float t = index / (numVertex - 1.0);\n\n // çé¢ç·å½¢è£éï¼SLERPï¼ãå®è¡\n vec3 result = sin((1.0 - t) * theta) / sin(theta) * v0 + sin(t * theta) / sin(theta) * v1;\n\n // åå¾ãé©ç¨ããä¸å¿ãæ»ã\n return result * radius + center;\n}\n\n/**\n * Calculate the catmull rom interpolation\n *\n * @param a - The start position\n * @param b - The middle position\n * @param c - The end position\n * @param d - The next position\n * @param t - The interpolation coefficient\n * @return The catmull rom interpolation\n */\nvec4 catmullRom(vec4 a, vec4 b, vec4 c, vec4 d, float t) {\n // Interpolates in-between samples b and c using t [0, 1].\n return b + t * (0.5 * (c - a) + t * (a + 2.0 * c - 2.5 * b - 0.5 * d + t * (1.5 * (b - c) + 0.5 * (d - a))));\n}\n\n/**\n * Calculate the catmull rom interpolation\n *\n * @param a - The start position\n * @param b - The middle position\n * @param c - The end position\n * @param d - The next position\n * @param t - The interpolation coefficient\n * @return The catmull rom interpolation\n */\nvec3 catmullRom(vec3 a, vec3 b, vec3 c, vec3 d, float t) {\n // Interpolates in-between samples b and c using t [0, 1].\n return b + t * (0.5 * (c - a) + t * (a + 2.0 * c - 2.5 * b - 0.5 * d + t * (1.5 * (b - c) + 0.5 * (d - a))));\n}\n\n/**\n * Calculate the catmull rom interpolation\n *\n * @param a - The start position\n * @param b - The middle position\n * @param c - The end position\n * @param d - The next position\n * @param t - The interpolation coefficient\n * @return The catmull rom interpolation\n */\nvec2 catmullRom(vec2 a, vec2 b, vec2 c, vec2 d, float t) {\n // Interpolates in-between samples b and c using t [0, 1].\n return b + t * (0.5 * (c - a) + t * (a + 2.0 * c - 2.5 * b - 0.5 * d + t * (1.5 * (b - c) + 0.5 * (d - a))));\n}\n\n/**\n * Calculate the catmull rom interpolation\n *\n * @param a - The start position\n * @param b - The middle position\n * @param c - The end position\n * @param d - The next position\n * @param t - The interpolation coefficient\n * @return The catmull rom interpolation\n */\nfloat catmullRom(float a, float b, float c, float d, float t) {\n // Interpolates in-between samples b and c using t [0, 1].\n return b + t * (0.5 * (c - a) + t * (a + 2.0 * c - 2.5 * b - 0.5 * d + t * (1.5 * (b - c) + 0.5 * (d - a))));\n}\n\n/**\n * æå®ãããã¤ã³ããã¯ã¹ã®è£éãããé ç¹ãè¨ç®ãã\n *\n * @param controlPoints - ã³ã³ããã¼ã«ãã¤ã³ãã®é
å\n * @param index - è¨ç®ãããé ç¹ã®ã¤ã³ããã¯ã¹\n * @param numVertex - è£éã®è§£å度ï¼å
¨ä½ã®é ç¹æ°ï¼\n * @return è£éãããé ç¹ã®ä½ç½®\n */\n#define CATMULLROM_CONTROL_POINTS_4 4\nvec3 catmullRomInterpolatedVertex4(vec3 controlPoints[CATMULLROM_CONTROL_POINTS_4], float index, float numVertex) {\n // ã»ã°ã¡ã³ãå
ã§ã®ã¤ã³ããã¯ã¹ãè¨ç®\n float t = fract(index / (numVertex - 1.0) * 3.0);\n\n // ã»ã°ã¡ã³ãã®ã¤ã³ããã¯ã¹ãè¨ç®\n int segmentIndex = int(floor(index / (numVertex - 1.0) * 3.0));\n\n // 4ã¤ã®ã³ã³ããã¼ã«ãã¤ã³ãã鏿\n vec3 p0 = controlPoints[max(segmentIndex - 1, 0)];\n vec3 p1 = controlPoints[segmentIndex];\n vec3 p2 = controlPoints[min(segmentIndex + 1, CATMULLROM_CONTROL_POINTS_4 - 1)];\n vec3 p3 = controlPoints[min(segmentIndex + 2, CATMULLROM_CONTROL_POINTS_4 - 1)];\n\n // Catmull-Romè£éã使ç¨ãã¦é ç¹ãè¨ç®\n return catmullRom(p0, p1, p2, p3, t);\n}\n\n/**\n * æå®ãããã¤ã³ããã¯ã¹ã®è£éãããé ç¹ãè¨ç®ãã\n *\n * @param controlPoints - ã³ã³ããã¼ã«ãã¤ã³ãã®é
å\n * @param index - è¨ç®ãããé ç¹ã®ã¤ã³ããã¯ã¹\n * @param numVertex - è£éå¾ã®ç·é ç¹æ°\n * @return è£éãããé ç¹ã®ä½ç½®\n */\n#define CATMULLROM_CONTROL_POINTS_14 17\nvec3 catmullRomInterpolatedVertex14(vec3
211controlPoints[CATMULLROM_CONTROL_POINTS_14], float index, float numVertex) {\n float segmentCount = float(CATMULLROM_CONTROL_POINTS_14 - 3);\n float t = index / (numVertex - 1.0) * segmentCount;\n int i = int(floor(t));\n t -= float(i);\n\n // æå¾ã®ã»ã°ã¡ã³ãã®å¦ç\n if (i == int(segmentCount)) {\n i = int(segmentCount) - 1;\n t = 1.0;\n }\n\n vec3 p0 = controlPoints[i];\n vec3 p1 = controlPoints[i + 1];\n vec3 p2 = controlPoints[i + 2];\n vec3 p3 = controlPoints[i + 3];\n\n return catmullRom(p0, p1, p2, p3, t);\n}\n",r.ShaderChunk.ftmr_inverse="/**\n * Description : Inverse of a float\n *\n * @param {float} m - Float\n * @return {float} - Inverse of the float\n * @see https://github.com/glslify/glsl-inverse/blob/master/index.glsl\n */\n\nfloat invertFloat(float m) {\n return 1.0 / m;\n}\n\nmat2 invertMatrix(mat2 m) {\n return mat2(m[1][1], -m[0][1], -m[1][0], m[0][0]) / (m[0][0] * m[1][1] - m[0][1] * m[1][0]);\n}\n\nmat3 invertMatrix(mat3 m) {\n float a00 = m[0][0],\n a01 = m[0][1],\n a02 = m[0][2];\n float a10 = m[1][0],\n a11 = m[1][1],\n a12 = m[1][2];\n float a20 = m[2][0],\n a21 = m[2][1],\n a22 = m[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(\n b01,\n -a22 * a01 + a02 * a21,\n a12 * a01 - a02 * a11,\n b11,\n a22 * a00 - a02 * a20,\n -a12 * a00 + a02 * a10,\n b21,\n -a21 * a00 + a01 * a20,\n a11 * a00 - a01 * a10\n ) /\n det;\n}\n\nmat4 invertMatrix(mat4 m) {\n float a00 = m[0][0],\n a01 = m[0][1],\n a02 = m[0][2],\n a03 = m[0][3],\n a10 = m[1][0],\n a11 = m[1][1],\n a12 = m[1][2],\n a13 = m[1][3],\n a20 = m[2][0],\n a21 = m[2][1],\n a22 = m[2][2],\n a23 = m[2][3],\n a30 = m[3][0],\n a31 = m[3][1],\n a32 = m[3][2],\n a33 = m[3][3],\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat4(\n a11 * b11 - a12 * b10 + a13 * b09,\n a02 * b10 - a01 * b11 - a03 * b09,\n a31 * b05 - a32 * b04 + a33 * b03,\n a22 * b04 - a21 * b05 - a23 * b03,\n a12 * b08 - a10 * b11 - a13 * b07,\n a00 * b11 - a02 * b08 + a03 * b07,\n a32 * b02 - a30 * b05 - a33 * b01,\n a20 * b05 - a22 * b02 + a23 * b01,\n a10 * b10 - a11 * b08 + a13 * b06,\n a01 * b08 - a00 * b10 - a03 * b06,\n a30 * b04 - a31 * b02 + a33 * b00,\n a21 * b02 - a20 * b04 - a23 * b00,\n a11 * b07 - a10 * b09 - a12 * b06,\n a00 * b09 - a01 * b07 + a02 * b06,\n a31 * b01 - a30 * b03 - a32 * b00,\n a20 * b03 - a21 * b01 + a22 * b00\n ) /\n det;\n}\n",r.ShaderChunk.ftmr_math="/**\n * Description : Quantize the value\n * @param {float} value - Value to quantize\n * @param {float} quant - Quantization step\n * @return {float} - Quantized value\n */\nfloat quantize(float value, float quant) {\n return round(value / quant) * quant;\n}\n\n/**\n * Description : Quantize the value\n * @param {vec2} value - Value to quantize\n * @param {float} quant - Quantization step\n * @return {vec2} - Quantized value\n */\nvec2 quantize(vec2 value, float quant) {\n return round(value / quant) * quant;\n}\n\n/**\n * Description : Quantize the value\n * @param {vec3} value - Value to quantize\n * @param {float} quant - Quantization step\n * @return {vec3} - Quantized value\n */\nvec3 quantize(vec3 value, float quant) {\n return round(value / quant) * quant;\n}\n\n/**\n * Description : Quantize the value\n * @param {vec4} value - Value to quantize\n * @param {float} quant - Quantization step\n * @return {vec4} - Quantized value\n */\nvec4 quantize(vec4 value, float quant) {\n return round(value / quant) * quant;\n}\n\n/**\n * Description : Generate a random number\n * @param {vec2} st - Input vector\n * @return {float} - Random number\n */\nfloat random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);\n}\n\n/**\n * Description : Generate a random number\n * @param {float}
211 seed - Seed value\n * @return {float} - Random number\n */\nfloat random(float seed) {\n return fract(sin(seed) * 43758.5453);\n}\n\n/**\n * Calculate the triangle wave\n *\n * @param {float} x - The input value\n * @returns {float} The triangle wave value\n */\nfloat triangle(float x) {\n return abs(mod(x, PI2) / PI - 1.0) * 2.0 - 1.0;\n}\n\n/**\n * Calculate the wave\n *\n * @param {float} progress - The progress value\n * @param {float} repeat - The repeat value\n * @returns {float} The wave value\n */\nfloat wave_internal(float progress, float repeat) {\n return (cos(progress * PI2 * repeat) + 1.0) / 2.0;\n}\n\n/**\n * Calculate the wave\n *\n * @param {float} progress - The progress value\n * @param {float} repeat - The repeat value\n * @param {float} targetValue - The target value\n * @param {float} reduceValue - The reduce value\n * @returns {float} The wave value\n */\nfloat wave(float progress, float repeat, float targetValue, float reduceValue) {\n float reduction = wave_internal(progress, 1.0) * reduceValue + (1.0 - reduceValue);\n float y = wave_internal(progress, repeat);\n return (y * (1.0 - targetValue) + targetValue) * reduction;\n}\n",r.ShaderChunk.ftmr_matrix="/**\n * GLSL port of three.js Object3D.lookAt\n */\n\n/**\n * Description : Look at\n *\n * @param {vec3} eye - Eye vector\n * @param {vec3} center - Center vector\n * @param {vec3} up - Up vector\n * @return {mat4} - Look at matrix\n */\nmat4 lookAt(vec3 eye, vec3 center, vec3 up) {\n // from glm/gtc/matrix_transform.inl line#755\n // https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml\n // https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTranslate.xml\n vec3 f = normalize(center - eye);\n vec3 s = normalize(cross(f, up));\n vec3 u = cross(s, f);\n\n return transpose(mat4(vec4(s, -dot(s, eye)), vec4(u, -dot(u, eye)), vec4(-f, dot(f, eye)), vec4(0, 0, 0, 1)));\n}\n\n// mat4 lookAt(vec3 eye, vec3 target, vec3 up) {\n// vec3 z = eye - target;\n// return lookAt(z, up);\n// }\n\n/**\n * Description : Look at\n *\n * @param {vec3} direction - Direction vector\n * @param {vec3} up - Up vector\n * @return {mat4} - Look at matrix\n */\nmat4 lookAt(vec3 direction, vec3 up) {\n vec3 z = direction;\n z.z = length(z) == 0.0 ? 1.0 : z.z;\n z = normalize(z);\n\n vec3 x = cross(up, z);\n x = length(x) == 0.0 ? cross(up, z + vec3(0.0001)) : x;\n x = normalize(x);\n\n vec3 y = cross(z, x);\n\n return mat4(x.x, y.x, z.x, 0.0, x.y, y.y, z.y, 0.0, x.z, y.z, z.z, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// Simplified version of the above, assuming that we always use\n// the default up vector, and the direction was computed beforehand\n// for other purposes.\nmat4 lookAt(vec3 direction) {\n const vec3 up = vec3(0.0, 1.0, 0.0);\n return lookAt(direction, up);\n}\n\n/**\n * Description : Rotation matrix\n * @param {float} phi - Vertical rotation\n * @param {float} theta - Horizontal rotation\n * @return {mat3} - Rotation matrix\n */\nmat3 getRotationMatrix(float phi, float theta) {\n float sinPhi = sin(phi);\n float cosPhi = cos(phi);\n float sinTheta = sin(theta);\n float cosTheta = cos(theta);\n return mat3(cosTheta, -sinTheta * sinPhi, sinTheta * cosPhi, 0.0, cosPhi, sinPhi, -sinTheta, -cosTheta * sinPhi, cosTheta * cosPhi);\n}\n\n/**\n * Description : Rotate point around origin with phi and theta\n * @param {vec3} p - Point\n * @param {float} phi - Vertical rotation\n * @param {float} theta - Horizontal rotation\n * @return {vec3} - Rotated point\n */\nvec3 rotate(vec3 p, float phi, float theta) {\n return getRotationMatrix(phi, theta) * p;\n}\n\n/**\n * Description : Rotate point around origin with radius, phi and theta\n *\n * @param {float} radius - Radius\n * @param {float} phi - Vertical rotation\n * @param {float} theta - Horizontal rotation\n * @return {vec3} - Rotated point\n */\nvec3 rotate(float radius, float phi, float theta) {\n float sinPhi = sin(phi);\n float cosPhi = cos(phi);\n float sinTheta = sin(theta);\n float cosTheta = cos(theta);\n return vec3(radius * sinPhi * cosTheta, radius * cosPhi, radius * sinPhi * sinTheta);\n}\n\n// mat4 rotation3d(vec3 axis, float angle) {\n// axis = normalize(axis);\n// float s = sin(angle);\n// float c = cos(angle);\n// float oc = 1.0 - c;\n\n// return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n// }\n\n// vec3 rotate(vec3 v, vec3 axis, float angle) {\n// return (rotation3d(axis, angle) * vec4(v, 1.0)).xyz;\n// }\n\n// mat3 rotateX(float angle) {\n// return mat3(vec3(1.0, 0.0, 0.0), vec3(0.0, cos(angle), -sin(angle)), vec3(0.0, sin(angle), cos(angle)));\n// }\n\n// mat3 rotateY(float angle) {\n// return mat3(vec3(cos(angle), 0.0, sin(angle)), vec3(0.0, 1.0, 0.0), vec3(-sin(angle), 0.0, cos(angle)));\n// }\n\n// mat3 rotateZ(float angle) {\n// return mat3(vec3(cos(angle), -sin(angle), 0.0), vec3(sin(angle), cos(angle), 0.0), vec3(0.0, 0.0, 1.0));\n// }
211\n\n// mat3 scale(float x, float y, float z) {\n// return mat3(vec3(x, 0.0, 0.0), vec3(0.0, y, 0.0), vec3(0.0, 0.0, z));\n// }\n\n// vec3 rotateY(vec3 v, float angle) {\n// float s = sin(angle);\n// float c = cos(angle);\n// return vec3(c * v.x + s * v.z, v.y, -s * v.x + c * v.z);\n// }\n\n// vec3 rotateAroundX(vec3 position, vec3 origin, float angle) {\n// float c = cos(angle);\n// float s = sin(angle);\n// mat4 rotationXMatrix = mat4(1.0, 0.0, 0.0, 0.0, 0.0, c, -s, 0.0, 0.0, s, c, 0.0, 0.0, 0.0, 0.0, 1.0);\n// return (rotationXMatrix * vec4(position - origin, 1.0)).xyz + origin;\n// }\n\n// vec3 rotateAroundY(vec3 position, vec3 origin, float angle) {\n// float c = cos(angle);\n// float s = sin(angle);\n// mat4 rotationYMatrix = mat4(c, 0.0, s, 0.0, 0.0, 1.0, 0.0, 0.0, -s, 0.0, c, 0.0, 0.0, 0.0, 0.0, 1.0);\n// return (rotationYMatrix * vec4(position - origin, 1.0)).xyz + origin;\n// }\n\n// vec3 rotateAroundZ(vec3 position, vec3 origin, float angle) {\n// float c = cos(angle);\n// float s = sin(angle);\n// mat4 rotationZMatrix = mat4(c, -s, 0.0, 0.0, s, c, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);\n// return (rotationZMatrix * vec4(position - origin, 1.0)).xyz + origin;\n// }\n\nmat4 translateMatrix(vec3 v) {\n return mat4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, v.x, v.y, v.z, 1.0);\n}\n",r.ShaderChunk.ftmr_snoise="/**\n * ************************************\n * Simplex Noise\n * *************************************\n */\n\n/**\n * Description : Array and textureless GLSL 2D/3D/4D simplex\n * noise functions.\n * Author : Ian McEwan, Ashima Arts.\n * Maintainer : ijm\n * Lastmod : 20110822 (ijm)\n * License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n * Distributed under the MIT License. See LICENSE file.\n * https://github.com/ashima/webgl-noise\n */\n\n/**\n * Description : Modulo 289\n * @param {vec3} x - Input vector\n * @return {vec3} - Modulo 289 value\n */\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\n/**\n * Description : Modulo 289\n * @param {vec4} x - Input vector\n * @return {vec4} - Modulo 289 value\n */\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\n/**\n * Description : Permute\n * @param {vec4} x - Input vector\n * @return {vec4} - Permute value\n */\nvec4 permute(vec4 x) {\n return mod289((x * 34.0 + 1.0) * x);\n}\n\n/**\n * Description : Taylor Inv Sqrt\n * @param {vec4} r - Input vector\n * @return {vec4} - Taylor Inv Sqrt value\n */\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\n/**\n * Simplex Noise 3D\n * @param v - Input vector\n * @return - Noise value\n */\nfloat snoise3(vec3 v) {\n const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n /**\n * First\n */\n vec3 i = floor(v + dot(v, C.yyy));\n vec3 x0 = v - i + dot(i, C.xxx);\n\n /**\n * Other corners\n */\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min(g.xyz, l.zxy);\n vec3 i2 = max(g.xyz, l.zxy);\n\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; /**\n * 2.0*C.x = 1/3 = C.y\n */\n vec3 x3 = x0 - D.yyy; /**\n * -1.0+3.0*C.x = -0.5 = -D.y\n */\n\n /**\n * Permutations\n */\n i = mod289(i);\n vec4 p = permute(permute(permute(i.z + vec4(0.0, i1.z, i2.z, 1.0)) + i.y + vec4(0.0, i1.y, i2.y, 1.0)) + i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\n /**\n * * Gradients: 7x7 points over a square, mapped onto an octahedron.\n * * The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n */\n float n_ = 0.142857142857; /**\n * 1.0/7.0\n */\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); /**\n * mod(p,7*7)\n */\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_); /**\n * mod(j,N)\n */\n\n vec4 x = x_ * ns.x + ns.yyyy;\n vec4 y = y_ * ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4(x.xy, y.xy);\n vec4 b1 = vec4(x.zw, y.zw);\n\n vec4 s0 = floor(b0) * 2.0 + 1.0;\n vec4 s1 = floor(b1) * 2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3(a0.xy, h.x);\n vec3 p1 = vec3(a0.zw, h.y);\n vec3 p2 = vec3(a1.xy, h.z);\n vec3 p3 = vec3(a1.zw, h.w);\n\n /**\n * Normalise gradients\n */\n vec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n /**\n * Mix final noise value\n */\n vec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n m = m * m;\n return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n",r.ShaderChunk.ftmr_perlin_noise="vec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}
211\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289((x * 34.0 + 10.0) * x);\n}\n\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec3 fade(vec3 t) {\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n\n/**\n * Perlin Noise\n * @param {vec3} P - Input vector\n * @param {vec3} rep - Repetition vector\n * @return {float} - Perlin noise value\n */\nfloat pnoise(vec3 P, vec3 rep) {\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\n"},8528:(e,t,n)=>{n.d(t,{O6:()=>o,Q0:()=>l,UK:()=>i,UT:()=>s,_K:()=>f,eN:()=>d,lB:()=>u});var r=n(9618);let a=null,o=(e,t,n,a)=>{let o=new r.Pq0().subVectors(a,n).normalize(),i=n.clone(),s=o.dot(o),l=2*o.dot(i.sub(e)),u=l*l-4*s*(i.dot(i)-t*t);if(u<0)return null;let c=(-l-Math.sqrt(u))/(2*s);return c<0?null:i.add(o.multiplyScalar(c))},i=(e,t,n)=>{let a=e.project(t);return a.x=(a.x+1)/2*n.width,a.y=-(a.y-1)/2*n.height,new r.I9Y(a.x,a.y)},s=(e,t,n,a)=>{let o=new r.Pq0(e.x/n.width*2-1,-(2*(e.y/n.height))+1,.5);o.unproject(t);let i=o.sub(t.position).normalize(),s=(a-t.position.z)/i.z;return t.position.clone().add(i.multiplyScalar(s))},l=e=>{let t,n=(t=(()=>{if(a)return a;let e=document.createElement("canvas");return a=e.getContext("webgl")||e.getContext("experimental-webgl")})())?t.getParameter(t.MAX_TEXTURE_SIZE):0;return{width:Math.min(e,n),height:Math.ceil(Math.max(e/n,1))}},u=(e,t,n,r)=>e.clone().sub(t).applyAxisAngle(n,r).add(t),c=(e,t,n)=>{let a=new r.Pq0(n.x-t.x,n.y-t.y,n.z-t.z),o=new r.Pq0(e.x-t.x,e.y-t.y,e.z-t.z),i=a.x*a.x+a.y*a.y+a.z*a.z,s=Math.min(1,Math.max(0,(o.x*a.x+o.y*a.y+o.z*a.z)/i));return new r.Pq0(t.x+a.x*s,t.y+a.y*s,t.z+a.z*s)},f=(e,t)=>{let n=new r.Pq0,a=1/0;for(let r=0;r<t.length;r++){let o=t[r],i=c(e,o.start,o.end),s=e.distanceTo(i);s<a&&(a=s,n=i)}return n},d=(e,t)=>{let n=1/0,r=[];for(let a=0;a<e.length;a++){let o=e[a];for(let e=0;e<t.length;e++){let a=m(o,t[e]),i=a[0].distanceTo(a[1]);i<n&&(n=i,r=a)}}return r},m=(e,t)=>
211{let n,r,a=e.end.clone().sub(e.start),o=t.end.clone().sub(t.start),i=e.start.clone().sub(t.start),s=a.dot(a),l=o.dot(o),u=o.dot(i);if(s<=Number.EPSILON&&l<=Number.EPSILON)return n=r=0,[e.start.clone(),t.start.clone()];if(s<=Number.EPSILON)n=0,r=Math.max(0,Math.min(1,r=u/l));else{let e=a.dot(i);if(l<=Number.EPSILON)r=0,n=Math.max(0,Math.min(1,-e/s));else{let t=a.dot(o),i=s*l-t*t;n=0!==i?Math.max(0,Math.min(1,(t*u-e*l)/i)):0,(r=(t*n+u)/l)<0?(r=0,n=Math.max(0,Math.min(1,-e/s))):r>1&&(r=1,n=Math.max(0,Math.min(1,(t-e)/s)))}}return[e.start.clone().add(a.multiplyScalar(n)),t.start.clone().add(o.multiplyScalar(r))]};new r.Pq0,new r.Pq0,new r.Pq0,new r.Pq0},8815:(e,t,n)=>{n.d(t,{n:()=>h,q:()=>g});var r=n(7973),a=n(6065),o=n(9618),i=n(4695),s=n(2488),l=n(2466),u=n(5844),c=n(3882),f=n(4121);let d="ftmr:sound-enabled";function m(e){return e.startsWith("bgm_")}function p(){return"u">typeof performance?performance.now():Date.now()}let h=(0,a.createContext)({isSoundEnabled:!0,setSoundEnabled:()=>{},toggleSound:()=>{},addSound:()=>{},play:()=>{},stop:()=>{},fade:()=>{},getFrequency:()=>new Uint8Array(0),getAverageFrequency:()=>0,getNextSFXNavigationMainHoverKey:()=>u.uc.SFX_NAVIGATION_MAIN_HOVER_1,getNextSFXTransitionConnectorKey:()=>u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_1,getNextSFXTransitionTextKey:()=>u.uc.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_1,getNextSFXHomeTransitionsInKey:()=>u.uc.SFX_HOME_TRANSITION_PORTRAIT_IN_1,getNextSFXHomeTransitionsOutKey:()=>u.uc.SFX_HOME_TRANSITION_PORTRAIT_OUT_1,getNextSFXAwardGlobeRotationKey:()=>u.uc.SFX_AWARD_GLOBE_ROTATE_C1,getNextSFXAwardGlobeDragKey:()=>u.uc.SFX_AWARD_GLOBE_DRAG_C1,playProductImageTransitionSFX:()=>{},playProductPulseSFX:()=>{},getCurrentSFXAwardGlobeDragKey:()=>u.uc.SFX_AWARD_GLOBE_DRAG_C1,isPlaying:()=>!1,connectMediaElement:()=>()=>{}}),g=e=>{let{children:t}=e,n=(0,a.useRef)(null),g=(0,a.useRef)({}),v=(0,a.useRef)(!1),x=(0,a.useRef)(new Map),[y,w]=(0,a.useState)(!0),R=(0,a.useRef)(!0),C=(0,a.useRef)(s.z.masterVolume),b=(0,a.useRef)(null),S=(0,a.useRef)(new WeakMap),{isRenderActiveRef:T,subscribeRenderLifecycle:P}=(0,l.iK)(),M=(0,a.useCallback)(()=>{if(n.current)return;(0,c.Rm)("blue","\uD83D\uDEE0ï¸","initListener"),n.current=new o.Pf$;let e=R.current?s.z.masterVolume:0;C.current=e,n.current.setMasterVolume(e)},[]),A=(0,a.useCallback)(()=>n.current?.context.state==="running",[]),D=(0,a.useCallback)(e=>{let t=b.current;if(b.current=null,C.current=e,!n.current)return;let r=n.current.getInput().gain,a=n.current.context.currentTime;r.cancelScheduledValues(t?.audioStartTime??a),r.setValueAtTime(e,a)},[]),_=(0,a.useCallback)(()=>{let e,t=b.current,r=t?(e=Math.min(Math.max((p()-t.startTime)/t.duration,0),1),t.from+(t.to-t.from)*i.le.easeInOutSine(e)):C.current;if(b.current=null,C.current=r,!n.current)return;let a=n.current.getInput().gain,o=n.current.context.currentTime;a.cancelScheduledValues(t?.audioStartTime??o),a.setValueAtTime(r,o)},[]),I=(0,a.useCallback)((e,t)=>{if(_(),!n.current){C.current=e;return}if(t<=0)return void D(e);let r=n.current.getInput().gain,a=n.current.context.currentTime,o=C.current;Math.abs(o-e)<Number.EPSILON?D(e):(r.setValueCurveAtTime(function(e,t){let n=new Float32Array(32);for(let r=0;r<32;r+=1){let a=r/31;n[r]=e+(t-e)*i.le.easeInOutSine(a)}return n}(o,e),a,t/1e3),b.current={from:o,to:e,audioStartTime:a,startTime:p(),duration:t},C.current=e)},[D,_]),E=(0,a.useCallback)(e=>{m(e)&&x.current.delete(e)},[]),U=(0,a.useCallback)(()=>{if(!A())return;let e=Array.from(x.current.entries());for(let[t,n]of(x.current.clear(),e)){let e=g.current[t];e&&(e.stop(0),e.fade(n.volume,n.delay,n.duration,n.loop,n.easing))}},[A]),O=(0,a.useCallback)(async()=>{if(!n.current)return!1;if("running"===n.current.context.state)return U(),!0;try{return await n.current.context.resume(),(0,c.Rm)("blue","\uD83D\uDEE0ï¸","AudioListener resumed.","state:",n.current.context.state),U(),A()}catch(e){return(0,c.Rm)("orange","â ï¸","AudioListener resume failed.",e),!1}},[U,A]),F=(0,a.useCallback)(async(e,t)=>{if(g.current[e])return;if(!n.current)return void(0,c.Rm)("orange","â ï¸","addSound called before initListener",e);let r=new o.fP5(n.current);r.setBuffer(t),g.current[e]=new u.zJ(e,r)},[]),N=(0,a.useCallback)((e,t,n)=>{let r=g.current[e];r&&(m(e)||v.current&&R.current)&&r.play.bind(r)(t,n)},[]),L=(0,a.useCallback)((e,t)=>{E(e);let n=g.current[e];n&&n.stop.bind(n)(t)},[E]),z=(0,a.useCallback)((e,t,n,r,a,o)=>{let i=m(e);if(i&&0===t)E(e);else if(i&&!A())return void x.current.set(e,{volume:t,delay:n,duration:r,loop:a,easing:o});else if(!i&&(!v.current||!R.current))return;let s=g.current[e];s&&s.fade.bind(s)(t,n,r,a,o)},[E,A]),V=(0,a.useCallback)(e=>{w(e),R.current=e,_();try{window.localStorage.setItem(d,e?"true":"false")}catch(e){(0,c.Rm)("orange","","Failed to write sound toggle storage.",e)}e?O().then(e=>{!R.current||(e||n.current?.context.state==="running")&&I(s.z.masterVolume,3e3)}
211):v.current&&A()?I(0,1e3):D(0)},[I,A,O,D,_]),k=(0,a.useCallback)(()=>{V(!R.current)},[V]),G=(0,a.useCallback)(e=>{let t=g.current[e];return t?t.getFrequency():new Uint8Array(0)},[]),B=(0,a.useCallback)(e=>{let t=g.current[e];return t?t.getAverageFrequency():0},[]),j=(0,a.useCallback)(e=>{let t=g.current[e];return!!t&&t.audio.isPlaying},[]),$=(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!n.current)return(0,c.Rm)("orange","â ï¸","connectMediaElement called before initListener"),()=>{};let r=n.current.context,a=S.current.get(e);a||(a=r.createMediaElementSource(e),S.current.set(e,a));let o=r.createGain();return o.gain.value=t,a.connect(o),o.connect(n.current.getInput()),()=>{try{a?.disconnect(o)}catch{}try{o.disconnect()}catch{}}},[]),W=e=>{let t={current:0};return{next:()=>(t.current=(t.current+1)%e.length,e[t.current]),current:()=>e[t.current]}},H=(0,a.useRef)(W([u.uc.SFX_NAVIGATION_MAIN_HOVER_1,u.uc.SFX_NAVIGATION_MAIN_HOVER_2,u.uc.SFX_NAVIGATION_MAIN_HOVER_3])),Y=(0,a.useRef)(W([u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_1,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_2,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_3,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_4,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_5,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_6,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_7,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_CONNECTOR_8])),X=(0,a.useRef)(W([u.uc.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_1,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_2,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_3,u.uc.SFX_NAVIGATION_MAIN_TRANSITION_TEXT_4])),q=(0,a.useRef)(W([u.uc.SFX_HOME_TRANSITION_PORTRAIT_IN_1,u.uc.SFX_HOME_TRANSITION_PORTRAIT_IN_2,u.uc.SFX_HOME_TRANSITION_PORTRAIT_IN_3])),Z=(0,a.useRef)(W([u.uc.SFX_HOME_TRANSITION_PORTRAIT_OUT_1,u.uc.SFX_HOME_TRANSITION_PORTRAIT_OUT_2,u.uc.SFX_HOME_TRANSITION_PORTRAIT_OUT_3])),Q=(0,a.useRef)(W([u.uc.SFX_AWARD_GLOBE_ROTATE_C1,u.uc.SFX_AWARD_GLOBE_ROTATE_D1,u.uc.SFX_AWARD_GLOBE_ROTATE_E1,u.uc.SFX_AWARD_GLOBE_ROTATE_D1])),K=(0,a.useRef)(W([u.uc.SFX_AWARD_GLOBE_DRAG_C1,u.uc.SFX_AWARD_GLOBE_DRAG_D1,u.uc.SFX_AWARD_GLOBE_DRAG_E1,u.uc.SFX_AWARD_GLOBE_DRAG_D1])),J=(0,a.useRef)(W([u.uc.SFX_PRODUCT_IMAGE_TRANSITION_1,u.uc.SFX_PRODUCT_IMAGE_TRANSITION_2,u.uc.SFX_PRODUCT_IMAGE_TRANSITION_3])),ee=(0,a.useCallback)(()=>H.current.next(),[]),et=(0,a.useCallback)(()=>Y.current.next(),[]),en=(0,a.useCallback)(()=>X.current.next(),[]),er=(0,a.useCallback)(()=>q.current.next(),[]),ea=(0,a.useCallback)(()=>Z.current.next(),[]),eo=(0,a.useCallback)(()=>Q.current.next(),[]),ei=(0,a.useCallback)(()=>K.current.next(),[]),es=(0,a.useCallback)(()=>{let e=J.current.next();N(e,s.z.sfx.product[e],!1)},[N]),el=(0,a.useCallback)(()=>{N(u.uc.SFX_PRODUCT_PULSE,s.z.sfx.product.sfx_product_pulse,!1)},[N]),eu=(0,a.useCallback)(()=>K.current.current(),[]);(0,l._B)("blue");let ec=(0,a.useCallback)(e=>{if(!n.current)return;let t=(0,f.$y)({isRenderActive:e,isSoundEnabled:R.current,hasUserInteracted:v.current,isAudioContextRunning:A(),masterVolume:s.z.masterVolume,fadeOutDuration:700,fadeInDuration:3e3});if("none"!==t.type){if("set"===t.type){_(),D(t.volume);return}I(t.volume,t.duration)}},[I,A,D,_]);(0,a.useEffect)(()=>{let e=function(){try{let e=window.localStorage.getItem(d);if("false"===e)return!1;if("true"===e||null===e)return!0;return(0,c.Rm)("orange","","Invalid sound toggle storage value.",e),!0}catch(e){return(0,c.Rm)("orange","","Failed to read sound toggle storage.",e),!0}}();R.current=e,w(e),C.current=e?s.z.masterVolume:0,M();let t=["click","touchstart","keydown","pointerdown"],n=()=>{v.current=!0,O(),t.forEach(e=>window.removeEventListener(e,n))};return t.forEach(e=>window.addEventListener(e,n,{once:!0})),()=>{t.forEach(e=>window.removeEventListener(e,n)),_()}},[M,O,_]),(0,a.useEffect)(()=>(ec(T.current),P(e=>ec(e))),[ec,T,P]);let ef=(0,a.useMemo)(()=>({isSoundEnabled:y,setSoundEnabled:V,toggleSound:k,addSound:F,play:N,stop:L,fade:z,getFrequency:G,getAverageFrequency:B,isPlaying:j,getNextSFXNavigationMainHoverKey:ee,getNextSFXTransitionConnectorKey:et,getNextSFXTransitionTextKey:en,getNextSFXHomeTransitionsInKey:er,getNextSFXHomeTransitionsOutKey:ea,getNextSFXAwardGlobeRotationKey:eo,getNextSFXAwardGlobeDragKey:ei,playProductImageTransitionSFX:es,playProductPulseSFX:el,getCurrentSFXAwardGlobeDragKey:eu,connectMediaElement:$}),[y,V,k,F,N,L,z,G,B,j,ee,et,en,er,ea,eo,ei,es,el,eu,$]);return(0,r.jsx)(h.Provider,{value:ef,children:t})}},8875:(e,t,n)=>{n.d(t,{jD:()=>r,x1:()=>a});let r=e=>{if(!e)return"unknown";let t=e.toLowerCase().split(":")[0]??"";return"futamura.dev"===t||"www.futamura.dev"===t?"production":"dev.futamura.dev"===t?"development":"localhost"===t||"127.0.0.1"===t||"0.0.0.0"===t?"local":"unknown"},a=()=>!0},9151:(e,t,n)=>{n.r(t),n.d(t,{default:()=>tH});var r,a=n(7973),o=n(6065),i=n(9618),s=n(3267),l=n(9841),u=n(5114),c=n(2466),f=n(6382);let d=(0,o.forwardRef)((e,t)=>{(0,o.useMemo)(()=>{let e={Box3:i.NRn,MathUtils:{clamp:i.cj9.clamp},Matrix4:i.kn4,Quaternion:i.PTz,Raycaster:i.tBo,Sphere:i.iyt,Spherical:i.YHV,Vector2:i.I9Y,Vector3:i.Pq0,Vector4:i.IUQ};u.A.install({THREE:e}),(0,s.e)({CameraControlsImpl:u.A})},[]);let{camera:n,domElement:r,makeDefault:l,onStart:d,onEnd:m,onChange:p,regress:h,...g}=e,v=(0,s.C)(e=>e.camera),x=(0,s.C)(e=>e.gl),y=(0,s.C)(e=>e.invalidate),w=(0,s.C)(e=>e.events),R=(0,s.C)(e=>e.setEvents),C=(0,s.C)(e=>e.set),b=(0,s.C)(e=>e.get),S=(0,s.C)(e=>e.performance),T=n||v,P=r||w.connected||x.domElement,M=(0,o.useMemo)(()=>new u.A(T),[T]),A=(0,o.useRef)(M);A.current=M;let D=A.current;return(0,c.Ql)((e,t)=>{M.update(t)},-1),(0,o.useEffect)(()=>(D.connect(P),D.maxDistance=6e3,D.minDistance=2e3,D.minPolarAngle=60*f.V$,D.maxPolarAngle=90*f.V$,D.minAzimuthAngle=-(45*f.V$),D.maxAzimuthAngle=45*f.V$,D.smoothTime=.25,D.draggingSmoothTime=.125,D.azimuthRotateSpeed=.2,D.polarRotateSpeed=.2,D.mouseButtons.wheel=u.A.ACTION.NONE,()=>void D.dispose()),[P,M]),(0,o.useEffect)(()=>{let e=e=>{y(),h&&S.regress(),p&&p(e)},t=e=>{document.body.style.cursor="grabbing",d&&d(e)},n=e=>{document.body.style.cursor="grab",m&&m(e)};return M.addEventListener("update",e),M.addEventListener("controlstart",t),M.addEventListener("controlend",n),M.addEventListener("control",e),M.addEventListener("transitionstart",e),M.addEventListener("wake",e),()=>{M.removeEventListener("update",e),M.removeEventListener("controlstart",t),M.removeEventListener("controlend",n),M.removeEventListener("control",e),M.removeEventListener("transitionstart",e),M.removeEventListener("wake",e)}},[M,d,m,y,R,h,p]),(0,o.useEffect)(()=>
211{if(l){let e=b().controls;return C({controls:M}),()=>C({controls:e})}},[l,M]),(0,a.jsx)("primitive",{ref:t,object:M,...g})});var m=n(4695),p=n(6133),h=n(2488),g=n(6987),v=n(2310),x=n(5844),y=n(1780);let w=(0,o.forwardRef)((e,t)=>{let{layers:n,layout:r,contentCount:s,carouselIndexRef:l,carouselActiveRef:u,carouselInterval:f,onDotClick:d,onTogglePlayPause:w,videoProgressRef:R,videoActiveRef:C,contentTypes:b,warmupMode:S=!1}=e,{indicatorButtonSize:T,indicatorFontSize:P,indicatorBracketLength:M,indicatorTotalW:A,indicatorTotalH:D,indicatorCX:_,indicatorY:I,indicatorColumnCount:E,indicatorGetButtonX:U}=r,{play:O,stop:F}=(0,o.useContext)(v.nE),N=(0,o.useRef)({uOpacity:new i.nc$(0)}),L=(0,c.RV)(N),z=(0,o.useRef)(null),V=(0,o.useRef)(null),k=(0,o.useRef)([]),G=(0,o.useRef)(null),B=(0,o.useRef)(null),j=(0,o.useRef)(!1),$=(0,o.useRef)(0),W=(0,o.useRef)(0),[H,Y]=(0,o.useState)(l.current),X=(0,o.useRef)(null),q=(0,o.useRef)(!1),[Z,Q]=(0,o.useState)(!1),K=(0,o.useRef)({uPlaying:new i.nc$(1),uOpacity:new i.nc$(0),uColor:new i.nc$(new i.Q1f(g.i.label.fontColor))}),J=(0,c.RV)(K),ee=(0,o.useMemo)(()=>{let e=new i.bdM(T,T);return e.translate(T/2,0,0),e},[T]),[et,en]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>z.current?.setOpacityRatio(e.value.progress)}),[]),[er,ea]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>V.current?.setOpacityRatio(e.value.progress)}),[]),[eo,ei]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>X.current?.hover(e.value.progress)}),[]),[es,el]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>V.current?.hover(e.value.progress)}),[]),[eu,ec]=(0,m.zh)(()=>({from:{opacity:0}
211,onChange:e=>{N.current.uOpacity.value=e.value.opacity}}),[]),[ef,ed]=(0,m.zh)(()=>({from:{opacity:0},onChange:e=>{K.current.uOpacity.value=e.value.opacity}}),[]);(0,o.useEffect)(()=>{X.current&&(X.current.setHovered(Z),ei.stop(!0),Z?ei.start({from:{progress:eo.progress},to:{progress:1},config:{duration:y.u.indicator.hoverWipeDuration,easing:m.le.linear}}):ei.start({from:{progress:eo.progress},to:{progress:0},config:{duration:y.u.indicator.hoverWipeDuration,easing:m.le.linear}}))},[Z]),(0,c.Ql)((e,t)=>{let n=l.current;if(n!==W.current&&j.current&&(V.current?.slideTo(U(n)-_),$.current=0,W.current=n,Y(n)),G.current&&B.current){let e=b?.[n]==="video",r=!1,a=0;(j.current&&(e?C?.current&&R&&(r=!0,a=Math.min(R.current,1)):u.current&&($.current+=1e3*t,r=!0,a=Math.min($.current/f,1))),r)?(G.current.scale.x=a,B.current.opacity=.3,G.current.position.x=U(n)-_-T/2):B.current.opacity=0}});let em=(0,o.useCallback)(e=>{j.current&&(F(x.uc.SFX_CONTENT_MENU_HOVER),O(x.uc.SFX_CONTENT_MENU_HOVER,h.z.sfx.content.menuHover,!1),e===l.current&&(el.stop(!0),el.start({from:{progress:es.progress},to:{progress:1},config:{duration:y.u.indicator.bracketExpandDuration,easing:m.le.linear}})))},[F,O,el,es.progress]),ep=(0,o.useCallback)(e=>{e===l.current&&(el.stop(!0),el.start({from:{progress:es.progress},to:{progress:0},config:{duration:y.u.indicator.bracketExpandDuration,easing:m.le.linear}}))},[el,es.progress]),eh=(0,o.useCallback)(e=>{e!==l.current&&(F(x.uc.SFX_CONTENT_MENU_CLICK),O(x.uc.SFX_CONTENT_MENU_CLICK,h.z.sfx.content.menuClick,!1),V.current?.slideTo(U(e)-_),W.current=e,Y(e),el.stop(!0),el.start({to:{progress:0},immediate:!0}),$.current=0,d(e),K.current.uPlaying.value=+!!u.current)},[F,O,U,_,el,d,u]);(0,o.useImperativeHandle)(t,()=>({show:()=>{j.current=!0;let e=y.u.indicator.presentDuration;ec.start({from:{opacity:eu.opacity},to:{opacity:.5},config:{duration:300}}),en.start({from:{progress:et.progress},to:{progress:.5},config:{duration:300}}),k.current.forEach((t,n)=>{t?.present(e,y.u.indicator.presentStagger*n)});let t=y.u.indicator.presentStagger*(s-1)+300;ea.start({from:{progress:er.progress},to:{progress:1},delay:t,config:{duration:300}});let n=l.current;V.current?.slideToImmediate(U(n)-_),W.current=n,Y(n),ed.start({from:{opacity:ef.opacity},to:{opacity:1},config:{duration:300}}),K.current.uPlaying.value=+!!u.current,X.current?.setEnabled(!0),q.current=!0,$.current=0},hide:()=>{let e=y.u.indicator.dismissDuration;ec.start({from:{opacity:eu.opacity},to:{opacity:0},config:{duration:e,easing:m.le.easeOutCubic}}),en.start({from:{progress:et.progress},to:{progress:0},config:{duration:e,easing:m.le.easeOutCubic}}),k.current.forEach(t=>t?.dismiss(e,0)),ea.start({from:{progress:er.progress},to:{progress:0},config:{duration:e,easing:m.le.easeOutCubic}}),ed.start({from:{opacity:ef.opacity},to:{opacity:0},config:{duration:e,easing:m.le.easeOutCubic}}),Q(!1),ei.stop(!0),ei.start({from:{progress:eo.progress},to:{progress:0},config:{duration:.1*e,easing:m.le.linear},onRest:()=>{X.current?.setHovered(!1),X.current?.setEnabled(!1),q.current=!1}}),el.stop(!0),el.start({from:{progress:es.progress},to:{progress:0},config:{duration:.1*e,easing:m.le.linear},onRest:()=>{j.current=!1}})}}));let eg=U(s)-_;return(0,a.jsxs)("group",{position:[_,I,1.5],children:[(0,a.jsxs)("mesh",{layers:n,renderOrder:401,children:[(0,a.jsx)("planeGeometry",{args:[A+4,D+4]}),(0,a.jsx)("shaderMaterial",{ref:L,transparent:!0,depthTest:!1,depthWrite:!1,vertexShader:` 212 varying vec2 vUv; 213 void main() { 214 vUv = uv; 215 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 216 } 217 `,fragmentShader:` 218 uniform float uOpacity; 219 varying vec2 vUv; 220 void main() { 221 if (uOpacity <= 0.0) discard; 222 float aaX = fwidth(vUv.x) * 1.5; 223 float aaY = fwidth(vUv.y) * 1.5; 224 float edgeAA = smoothstep(0.0, aaX, vUv.x) * smoothstep(0.0, aaX, 1.0 - vUv.x) 225 * smoothstep(0.0, aaY, vUv.y) * smoothstep(0.0, aaY, 1.0 - vUv.y); 226 gl_FragColor = vec4(0.0, 0.0, 0.0, uOpacity * edgeAA); 227 } 228 `,uniforms:N.current})]}),(0,a.jsx)(p.Vx,{ref:z,layers:n,renderOrder:402,cellWidth:T,cellHeight:T,columnCount:E,strokeColor:y.u.indicator.outlineColor,strokeOpacity:y.u.indicator.outlineOpacity}),Array.from({length:s},(e,t)=>(0,a.jsx)("group",{position:[U(t)-_,0,0],children:(0,a.jsx)(p.KE,{ref:e=>{k.current[t]=e},layers:n,renderOrder:402,label:String(t+1).padStart(2,"0"),buttonWidth:T,buttonHeight:T,fontSize:P,hoverGlitchDuration:y.u.indicator.hoverGlitchDuration,hoverWipeDuration:y.u.indicator.hoverWipeDuration,isActive:t===H,idleGlitch:!S&&t===H,onHoverStart:()=>em(t),onHoverEnd:()=>ep(t),onClick:()=>eh(t)})},t)),(0,a.jsxs)("mesh",{ref:G,layers:n,renderOrder:402,position:[U(H)-_-T/2,0,1],scale:[0,1,1],children:[(0,a.jsx)("primitive",{object:ee,attach:"geometry"}),(0,a.jsx)("meshBasicMaterial",{ref:e=>{e&&(B.current=e)},color:g.i.label.hoverColor,transparent:!0,opacity:0,depthTest:!1,depthWrite:!1})]}),(0,a.jsx)(p.YY,{ref:V,layers:n,renderOrder:403,bracketWidth:T,bracketHeight:T,bracketLength:M,slideDuration:y.u.indicator.bracketSlideDuration,initialX:U(H)-_,bracketColor:y.u.indicator.bracketColor,bracketOpacity:y.u.indicator.bracketOpacity}),(0,a.jsxs)("group",{position:[eg,0,0],children:[(0,a.jsx)(p.Yi,{ref:X,layers:n,renderOrder:404,width:T,height:T,fillColor:g.i.label.hoverColor,fillOpacity:g.i.label.hoverOpacity}),(0,a.jsxs)("mesh",{layers:n,renderOrder:404,position:[0,0,1],onClick:e=>{if(e.stopPropagation(),!q.current)return;F(x.uc.SFX_CONTENT_MENU_CLICK),O(x.uc.SFX_CONTENT_MENU_CLICK,h.z.sfx.content.menuClick,!1),w();let t=u.current;K.current.uPlaying.value=+!!t,t&&($.current=0)},onPointerOver:e=>{e.stopPropagation(),q.current&&(Q(!0),document.body.style.cursor="pointer",F(x.uc.SFX_CONTENT_MENU_HOVER),O(x.uc.SFX_CONTENT_MENU_HOVER,h.z.sfx.content.menuHover,!1))},onPointerOut:e=>{e.stopPropagation(),q.current&&(Q(!1),document.body.style.cursor="auto")},children:[(0,a.jsx)("planeGeometry",{args:[T,T]}),(0,a.jsx)("shaderMaterial",{ref:J,transparent:!0,depthTest:!1,depthWrite:!1,vertexShader:"varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
228);\n}\n",fragmentShader:"uniform float uPlaying;\nuniform float uOpacity;\nuniform vec3 uColor;\nvarying vec2 vUv;\n\nvoid main() {\n if (uOpacity <= 0.0) discard;\n\n /* Centered coords in [-2, 2] â geometry is btnHitS (24px) but icon renders\n in the inner 50% (12px visual). SDF shapes are designed for [-1,1] range,\n so fragments outside that range get discarded by the alpha threshold. */\n vec2 p = (vUv - 0.5) * 4.0;\n\n /* Per-shape offset for independent centering adjustment */\n vec2 playOffset = vec2(0.0, 0.0);\n vec2 pauseOffset = vec2(0.0, 0.0);\n\n /* Play triangle SDF â equilateral, pointing right, centroid at origin.\n Inscribed circle radius r = 0.75.\n Vertices: (r, 0), (-r/2, râ3/2), (-r/2, -râ3/2) */\n float triD;\n {\n vec2 pp = p - playOffset;\n float r = 0.75;\n vec2 a = vec2(-r * 0.5, -r * 0.866);\n vec2 b = vec2(r, 0.0);\n vec2 c = vec2(-r * 0.5, r * 0.866);\n /* Signed distance to triangle using edge normals */\n float d1 = dot(pp - a, normalize(vec2(b.y - a.y, a.x - b.x)));\n float d2 = dot(pp - b, normalize(vec2(c.y - b.y, b.x - c.x)));\n float d3 = dot(pp - c, normalize(vec2(a.y - c.y, c.x - a.x)));\n triD = max(max(d1, d2), d3);\n }\n\n /* Pause bars SDF (two vertical rectangles, matched to triangle height) */\n float barsD;\n {\n vec2 pp = p - pauseOffset;\n float barW = 0.22;\n float barH = 0.7;\n float gap = 0.3;\n vec2 pL = vec2(abs(pp.x + gap) - barW, abs(pp.y) - barH);\n vec2 pR = vec2(abs(pp.x - gap) - barW, abs(pp.y) - barH);\n float dL = length(max(pL, 0.0)) + min(max(pL.x, pL.y), 0.0);\n float dR = length(max(pR, 0.0)) + min(max(pR.x, pR.y), 0.0);\n barsD = min(dL, dR);\n }\n\n /* Interpolate between shapes */\n float sdf = mix(triD, barsD, uPlaying);\n\n float aa = fwidth(sdf) * 1.5;\n float alpha = 1.0 - smoothstep(-aa, aa, sdf);\n if (alpha < 0.01) discard;\n\n gl_FragColor = vec4(uColor, alpha * uOpacity);\n}\n",uniforms:K.current})]})]})]})}),R=y.u.glitchTransition,C=new i.GYF(new Uint8Array([0,0,0,255]),1,1,i.GWd);C.needsUpdate=!0;let b=` 229 varying vec2 vUv; 230 void main() { 231 vUv = uv; 232 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 233 } 234`,S=` 235 uniform sampler2D tDiffuseFrom; 236 uniform sampler2D tDiffuseTo; 237 uniform float uProgress; 238 uniform float uOpacity; 239 uniform float uGlitchIntensity; 240 uniform float uRGBShiftAmount; 241 uniform float uScanlineEnabled; 242 uniform float uScanlineFrequency; 243 uniform float uScanlineSpeed; 244 uniform float uScanlineIntensity; 245 uniform float uStripDisplaceEnabled; 246 uniform float uStripCount; 247 uniform float uStripDisplaceAmount; 248 uniform float uStripFlickerRate; 249 uniform float uWaveEnabled; 250 uniform float uWaveFrequency; 251 uniform float uWaveAmount; 252 uniform float uWaveSpeed; 253 uniform float uTime; 254 uniform vec2 uFromContainScale; 255 uniform vec2 uToContainScale; 256 257 varying vec2 vUv; 258 259 /* Simple hash for strip randomness */ 260 float hash(vec2 p) { 261 return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); 262 } 263 264 void main() { 265 /* 1. Irregular horizontal strips (coarse + fine mix) + temporal flicker */
266 float timeStep = floor(uTime * uStripFlickerRate); 267 float coarseStrip = floor(vUv.y * uStripCount); 268 float fineStrip = floor(vUv.y * uStripCount * 2.7); 269 float sel = hash(vec2(coarseStrip, timeStep * 0.3)); 270 float stripIndex = sel > 0.6 ? fineStrip : coarseStrip; 271 272 /* 2. Stepped glitch envelope â binary flicker with soft tail to avoid snap */ 273 float glitchOn = step(1.0 - uGlitchIntensity, hash(vec2(timeStep, 0.0))); 274 float tailFade = smoothstep(0.0, 0.15, uGlitchIntensity); 275 glitchOn *= tailFade; 276 277 /* 3. Noisy wave distortion â stepped per strip, power-curve amplitude */ 278 float waveTimeStep = floor(uTime * uWaveSpeed); 279 float waveStripIndex = floor(vUv.y * uWaveFrequency); 280 float waveStrength = pow(hash(vec2(waveStripIndex, waveTimeStep)), 2.0); 281 float waveDir = hash(vec2(waveStripIndex, waveTimeStep + 50.0)) - 0.5; 282 float wave = waveDir * 2.0 * uWaveAmount * waveStrength 283 * glitchOn * uWaveEnabled; 284 285 /* 4. Per-strip horizontal displacement */ 286 float displaceHash = hash(vec2(stripIndex, timeStep)); 287 float displaceOffset = (displaceHash - 0.5) 288 * uStripDisplaceAmount 289 * glitchOn 290 * uStripDisplaceEnabled; 291 vec2 uv = vUv + vec2(displaceOffset + wave, 0.0); 292 293 /* Contain remap per texture (object-fit: contain). Scale (1,1) = fill (no-op for images). */ 294 vec2 fromUV = (uv - 0.5) / uFromContainScale + 0.5; 295 vec2 toUV = (uv - 0.5) / uToContainScale + 0.5; 296 297 /* Letterbox mask â applied only when a texture is contained (scale < 1 on an axis). 298 Images keep scale (1,1) so the mask stays 1 and edge displacement clamps as before. 299 Contained bars use fwidth-based smoothstep on the remapped UV to anti-alias the boundary 300 (mirrors the mesh-edge AA below; fwidth on the remapped UV already accounts for contain scale). */ 301 float fromContained = (uFromContainScale.x < 0.999 || uFromContainScale.y < 0.999) ? 1.0 : 0.0; 302 float toContained = (uToContainScale.x < 0.999 || uToContainScale.y < 0.999) ? 1.0 : 0.0; 303 float fromAAx = fwidth(fromUV.x) * 1.5; 304 float fromAAy = fwidth(fromUV.y) * 1.5; 305 float toAAx = fwidth(toUV.x) * 1.5; 306 float toAAy = fwidth(toUV.y) * 1.5; 307 float fromMask = fromContained > 0.5 308 ? smoothstep(0.0, fromAAx, fromUV.x) * smoothstep(0.0, fromAAx, 1.0 - fromUV.x) 309 * smoothstep(0.0, fromAAy, fromUV.y) * smoothstep(0.0, fromAAy, 1.0 - fromUV.y) 310 : 1.0; 311 float toMask = toContained > 0.5 312 ? smoothstep(0.0, toAAx, toUV.x) * smoothstep(0.0, toAAx, 1.0 - toUV.x) 313 * smoothstep(0.0, toAAy, toUV.y) * smoothstep(0.0, toAAy, 1.0 - toUV.y) 314 : 1.0; 315 316 /* 3. Per-channel noisy RGB shift amounts */ 317 float shiftR = uRGBShiftAmount * uGlitchIntensity * hash(vec2(stripIndex, timeStep + 400.0)); 318 float shiftG = uRGBShiftAmount * uGlitchIntensity * hash(vec2(stripIndex, timeStep + 500.0)) * 0.3; 319 float shiftB = uRGBShiftAmount * uGlitchIntensity * hash(vec2(stripIndex, timeStep + 600.0)); 320 321 /* 4. Sample From texture â each channel at its own UV offset (contain-remapped) */ 322 float fromR = texture2D(tDiffuseFrom, fromUV + vec2(-shiftR, 0.0)).r; 323 float fromG = texture2D(tDiffuseFrom, fromUV + vec2( shiftG, 0.0)).g; 324 float fromB = texture2D(tDiffuseFrom, fromUV + vec2( shiftB, 0.0)).b; 325 326 /* 5. Sample To texture â each channel at its own UV offset (contain-remapped) */ 327 float toR = texture2D(tDiffuseTo, toUV + vec2(-shiftR, 0.0)).r; 328 float toG = texture2D(tDiffuseTo, toUV + vec2( shiftG, 0.0)).g; 329 float toB = texture2D(tDiffuseTo, toUV + vec2( shiftB, 0.0)).b; 330 331 /* 6. Per-channel independent noisy transition timing */ 332 float expandedProgress = uProgress * 1.4 - 0.2; 333 float stripMixR = clamp((expandedProgress - hash(vec2(stripIndex, timeStep + 100.0)) * 0.8) * 5.0, 0.0, 1.0); 334 float stripMixG = clamp((expandedProgress - hash(vec2(stripIndex, timeStep + 200.0)) * 0.8) * 5.0, 0.0, 1.0); 335 float stripMixB = clamp((expandedProgress - hash(vec2(stripIndex, timeStep + 300.0)) * 0.8) * 5.0, 0.0, 1.0); 336 337 vec3 color = vec3( 338 mix(fromR, toR, stripMixR), 339 mix(fromG, toG, stripMixG),
340 mix(fromB, toB, stripMixB) 341 ); 342 343 /* 7. Scanline with per-channel Y offset (RGB split) */ 344 float scanlineBase = uScanlineIntensity * uScanlineEnabled * uGlitchIntensity; 345 float scanlinePhase = uTime * uScanlineSpeed; 346 float slOffset = 0.003 * uGlitchIntensity; 347 float scanlineR = 1.0 - scanlineBase * (0.5 + 0.5 * sin((vUv.y - slOffset) * uScanlineFrequency + scanlinePhase)); 348 float scanlineG = 1.0 - scanlineBase * (0.5 + 0.5 * sin( vUv.y * uScanlineFrequency + scanlinePhase)); 349 float scanlineB = 1.0 - scanlineBase * (0.5 + 0.5 * sin((vUv.y + slOffset) * uScanlineFrequency + scanlinePhase)); 350 351 /* 8. Edge AA */ 352 float aaX = fwidth(vUv.x) * 1.5; 353 float aaY = fwidth(vUv.y) * 1.5; 354 float edgeAA = smoothstep(0.0, aaX, vUv.x) * smoothstep(0.0, aaX, 1.0 - vUv.x) 355 * smoothstep(0.0, aaY, vUv.y) * smoothstep(0.0, aaY, 1.0 - vUv.y); 356 357 /* 9. Compose */ 358 /* Blend the two letterbox masks by transition progress; bars are filled opaque black. */ 359 float containMask = mix(fromMask, toMask, uProgress); 360 gl_FragColor = vec4(color.r * scanlineR * containMask, color.g * scanlineG * containMask, color.b * scanlineB * containMask, uOpacity * edgeAA); 361 } 362`,T=(0,o.forwardRef)((e,t)=>{let{layers:n,width:r,height:s,position:l}=e,u=(0,o.useRef)(null),f=(0,o.useRef)(null),d=(0,o.useRef)(null),p=(0,o.useRef)({tDiffuseFrom:new i.nc$(null),tDiffuseTo:new i.nc$(null),uProgress:new i.nc$(0),uOpacity:new i.nc$(0),uGlitchIntensity:new i.nc$(0),uRGBShiftAmount:new i.nc$(R.rgbShiftAmount),uScanlineEnabled:new i.nc$(+!!R.scanlineEnabled),uScanlineFrequency:new i.nc$(R.scanlineFrequency),uScanlineSpeed:new i.nc$(R.scanlineSpeed),uScanlineIntensity:new i.nc$(R.scanlineIntensity),uStripDisplaceEnabled:new i.nc$(+!!R.stripDisplaceEnabled),uStripCount:new i.nc$(R.stripCount),uStripDisplaceAmount:new i.nc$(R.stripDisplaceAmount),uStripFlickerRate:new i.nc$(R.stripFlickerRate),uWaveEnabled:new i.nc$(+!!R.waveEnabled),uWaveFrequency:new i.nc$(R.waveFrequency),uWaveAmount:new i.nc$(R.waveAmount),uWaveSpeed:new i.nc$(R.waveSpeed),uTime:new i.nc$(0),uFromContainScale:new i.nc$(new i.I9Y(1,1)),uToContainScale:new i.nc$(new i.I9Y(1,1))}),[,h]=(0,m.zh)(()=>({from:{opacity:0}
362,onChange:e=>{f.current&&(f.current.uniforms.uOpacity.value=e.value.opacity)}}),[]),[,g]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>{f.current&&(f.current.uniforms.uProgress.value=e.value.progress)},onRest:()=>{!f.current||d.current&&(f.current.uniforms.tDiffuseFrom.value=f.current.uniforms.tDiffuseTo.value,f.current.uniforms.tDiffuseTo.value=null,f.current.uniforms.uFromContainScale.value.copy(f.current.uniforms.uToContainScale.value),f.current.uniforms.uToContainScale.value.set(1,1),f.current.uniforms.uProgress.value=0,f.current.uniforms.uGlitchIntensity.value=0,d.current(),d.current=null)}}),[]),[,v]=(0,m.zh)(()=>({from:{t:0},onChange:e=>{if(!f.current)return;let t=e.value.t;f.current.uniforms.uGlitchIntensity.value=Math.sin(Math.PI*t)}}),[]);(0,c.Ql)((e,t)=>{f.current&&(f.current.uniforms.uTime.value+=t)});let x=(0,o.useCallback)((e,t)=>{if(!f.current)return;let n=f.current.uniforms.tDiffuseFrom.value||f.current.uniforms.tDiffuseTo.value,r=(f.current.uniforms.tDiffuseFrom.value?f.current.uniforms.uFromContainScale.value:f.current.uniforms.uToContainScale.value).clone();f.current.uniforms.tDiffuseFrom.value=C,f.current.uniforms.tDiffuseTo.value=n,f.current.uniforms.uFromContainScale.value.set(1,1),f.current.uniforms.uToContainScale.value.copy(r),f.current.uniforms.uProgress.value=0,f.current.uniforms.uGlitchIntensity.value=0,h.stop(!0),h.start({from:{opacity:0}
362,to:{opacity:1},delay:t,config:{duration:.5*e,easing:m.le.easeOutCubic}});let a=e||R.duration;g.stop(!0),d.current=()=>{},g.start({from:{progress:0},to:{progress:1},delay:t,config:{duration:a,easing:m.le.easeInOutCubic}}),v.stop(!0),v.start({from:{t:0},to:{t:1},delay:t,config:{duration:a,easing:m.le.easeInOutCubic}})},[h,g,v]),w=(0,o.useCallback)((e,t)=>{g.stop(!0),v.stop(!0),f.current&&(f.current.uniforms.uGlitchIntensity.value=0),d.current&&(d.current(),d.current=null),h.stop(!0),h.start({from:{opacity:1},to:{opacity:0},delay:t,config:{duration:e||y.u.dismiss.imageDuration,easing:m.le.easeOutCubic}})},[h,g,v]),T=(0,o.useCallback)(e=>{if(!e||e<=0)return new i.I9Y(1,1);let t=r/s;return new i.I9Y(Math.min(1,e/t),Math.min(1,t/e))},[r,s]),P=(0,o.useCallback)((e,t)=>{if(!f.current)return Promise.resolve();f.current.uniforms.tDiffuseTo.value=e,f.current.uniforms.uToContainScale.value.copy(T(t));let n=R.duration;return new Promise(e=>{d.current=e,g.stop(!0),g.start({from:{progress:0},to:{progress:1},config:{duration:n,easing:m.le.easeInOutCubic}}),v.stop(!0),v.start({from:{t:0},to:{t:1},config:{duration:n,easing:m.le.easeInOutCubic}})})},[g,v,T]),M=(0,o.useCallback)((e,t)=>{f.current&&(f.current.uniforms.tDiffuseFrom.value=e,f.current.uniforms.tDiffuseTo.value=null,f.current.uniforms.uProgress.value=0,f.current.uniforms.uGlitchIntensity.value=0,f.current.uniforms.uFromContainScale.value.copy(T(t)),f.current.uniforms.uToContainScale.value.set(1,1))},[T]),A=(0,o.useCallback)((e,t,n,r,a,o,i,s)=>{if(!u.current)return;let l=u.current.geometry.attributes.position,c=u.current.position.x,f=u.current.position.y;l.setXYZ(0,e-c,t-f,0),l.setXYZ(1,n-c,r-f,0),l.setXYZ(2,a-c,o-f,0),l.setXYZ(3,i-c,s-f,0),l.needsUpdate=!0},[]);return(0,o.useImperativeHandle)(t,()=>({present:x,dismiss:w,crossfadeTo:P,setTexture:M,deformVertices:A})),(0,a.jsxs)("mesh",{ref:u,layers:n,renderOrder:400,position:l,children:[(0,a.jsx)("planeGeometry",{args:[r,s]}),(0,a.jsx)("shaderMaterial",{ref:f,transparent:!0,depthTest:!1,depthWrite:!1,vertexShader:b,fragmentShader:S,uniforms:p.current})]})}),P=(0,o.forwardRef)((e,t)=>{let{...n}=e,r=(0,o.useRef)(null);return(0,o.useImperativeHandle)(t,()=>({material:r.current})),(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:r,transparent:!0,depthTest:!1,depthWrite:!1,side:i.$EB,vertexShader:"/*\n * Target corner positions in local pixel space.\n * Each corner is animated from its origin to its target by its own progress value.\n */\nuniform vec2 uCornerTL;\nuniform vec2 uCornerTR;\nuniform vec2 uCornerBL;\nuniform vec2 uCornerBR;\n\n/* Per-corner animation progress (0-1). */\nuniform float uProgressTL;\nuniform float uProgressTR;\nuniform float uProgressBL;\nuniform float uProgressBR;\n\n/* Per-corner origin positions in local pixel space (thumbnail mesh corners). */\nuniform vec2 uOriginTL;\nuniform vec2 uOriginTR;\nuniform vec2 uOriginBL;\nuniform vec2 uOriginBR;\n\nvoid main() {\n /* Bilinear interpolation of the 4 corner targets.\n Each corner is animated from its origin to its target position by its own progress. */\n vec2 targetTL = mix(uOriginTL, uCornerTL, uProgressTL);\n vec2 targetTR = mix(uOriginTR, uCornerTR, uProgressTR);\n vec2 targetBL = mix(uOriginBL, uCornerBL, uProgressBL);\n vec2 targetBR = mix(uOriginBR, uCornerBR, uProgressBR);\n\n /* Bilinear blend using UV coordinates.\n uv.x: horizontal blend (left to right), uv.y: vertical blend (bottom to top). */\n vec2 blendBottom = mix(targetBL, targetBR, uv.x);\n vec2 blendTop = mix(targetTL, targetTR, uv.x);\n vec2 localPos = mix(blendBottom, blendTop, uv.y);\n\n /* Project through the standard model-view-projection pipeline.\n The parent group handles camera-facing positioning and pixel-scale. */\n gl_Position = projectionMatrix * modelViewMatrix * vec4(localPos.x, localPos.y, 0.0, 1.0);\n}\n",fragmentShader:"/* Frost (framebuffer) texture â the rendered scene behind the float panel. */\nuniform sampler2D tDiffuse;\n\n/* Screen resolution for gl_FragCoord â UV conversion. */\nuniform vec2 uScreenResolution;\n\n/* Base tint color mixed over the blurred scene. */\nuniform vec3 uBaseColor;\n\n/* Global opacity multiplier (animated during open/close). */\nuniform float uOpacity;\n\n/* Blur intensity multiplier for the Gaussian kernel. */\nuniform float uBlur;\n\n/* Darkness mix factor (0 = full scene color, 1 = full base color). */\nuniform float uDarken;\n\n/* Half-width of the blur kernel (7x7 grid). */\nconst int KERNEL_RADIUS = 3;\n\n/* Spacing between neighbouring samples in UV coordinates. */\nconst float TEXEL_SPACING = 0.006;\n\n/* Gaussian standard deviation (in sample-grid units). */\nconst float SIGMA = 2.0;\n\nvoid main() {\n /* Sample frost texture at the actual screen position (rotation-independent). */\n vec2 screenUV = gl_FragCoord.xy / uScreenResolution;\n\n /* Gaussian blur: accumulate weighted samples across a 7x7 kernel. */\n vec3 acc = vec3(0.0);\n float totalWeight = 0.0;\n\n for (int i = -KERNEL_RADIUS; i <= KERNEL_RADIUS;
362 i++) {\n for (int j = -KERNEL_RADIUS; j <= KERNEL_RADIUS; j++) {\n vec2 offset = vec2(float(i), float(j));\n float weight = exp(-(offset.x * offset.x + offset.y * offset.y) / (2.0 * SIGMA * SIGMA));\n acc += texture2D(tDiffuse, screenUV + offset * TEXEL_SPACING * uBlur).rgb * weight;\n totalWeight += weight;\n }\n }\n\n vec3 blurredColor = acc / totalWeight;\n\n /* Darken: mix blurred scene with base tint color. */\n vec3 finalColor = mix(blurredColor, uBaseColor, uDarken);\n\n if (uOpacity < 0.01) discard;\n\n gl_FragColor = vec4(finalColor, uOpacity);\n}\n",uniforms:{tDiffuse:new i.nc$(null),uScreenResolution:new i.nc$(new i.I9Y(1,1)),uBaseColor:new i.nc$(new i.Q1f(1118481)),uOpacity:new i.nc$(0),uBlur:new i.nc$(.3),uDarken:new i.nc$(.7),uCornerTL:new i.nc$(new i.I9Y(-1,1)),uCornerTR:new i.nc$(new i.I9Y(1,1)),uCornerBL:new i.nc$(new i.I9Y(-1,-1)),uCornerBR:new i.nc$(new i.I9Y(1,-1)),uProgressTL:new i.nc$(0),uProgressTR:new i.nc$(0),uProgressBL:new i.nc$(0),uProgressBR:new i.nc$(0),uOriginTL:new i.nc$(new i.I9Y(0,0)),uOriginTR:new i.nc$(new i.I9Y(0,0)),uOriginBL:new i.nc$(new i.I9Y(0,0)),uOriginBR:new i.nc$(new i.I9Y(0,0))},...n}),[])}),M=(0,o.forwardRef)((e,t)=>{let{layers:n,children:r,onOpenComplete:l,onCloseComplete:u,cornerStateRef:d}=e,p=(0,s.C)(e=>e.camera),h=(0,s.C)(e=>e.size),{primaryTexture:x,primaryCaptureExclude:y}=(0,o.useContext)(v.Oo),w=(0,o.useRef)(null),R=(0,o.useRef)(null),C=(0,o.useRef)(null),b=(0,o.useRef)(!1),S=(0,o.useRef)(new i.Pq0),T=(0,o.useRef)(0),M=(0,o.useRef)(0),A=(0,o.useRef)(0),D=(0,o.useRef)(0),_=(0,o.useRef)(new i.PTz),I=(0,o.useRef)(new i.O9p),E=(0,o.useRef)(null),U=(0,o.useRef)(null),O=(0,o.useRef)(null),F=(0,o.useRef)([]),N=(0,o.useRef)(0),[L,z]=(0,o.useState)(!1),V=(0,o.useMemo)(()=>{let e=new i.LoY,t=new Float32Array([0,0,0,1,0,0,0,1,0,1,1,0]),n=new Float32Array([0,0,1,0,0,1,1,1]),r=new Uint16Array([0,1,2,1,3,2]);return e.setAttribute("position",new i.THS(t,3)),e.setAttribute("uv",new i.THS(n,2)),e.setIndex(new i.THS(r,1)),e},[]),k=(0,o.useMemo)(()=>{let e=new i.LoY;return e.setAttribute("position",new i.qtW(new Float32Array(12),3)),e},[]),G=(0,o.useMemo)(()=>new i.tcD(g.i.contactForm.cornerDotSize/2,16),[]);(0,o.useEffect)(()=>()=>{V.dispose(),k.dispose(),G.dispose()},[V,k,G]);let B=0,j=.08,$=.16,W=.24,H=1/.76,Y=m.le.easeOutExpo,X=e=>new i.I9Y(e.x*h.width*.5,e.y*h.height*.5),q=(e,t)=>{if(!C.current?.material)return;let n=C.current.material.uniforms;n[`${e}TL`].value.copy(X(t.tl)),n[`${e}TR`].value.copy(X(t.tr)),n[`${e}BL`].value.copy(X(t.bl)),n[`${e}BR`].value.copy(X(t.br))},[,Z]=(0,m.zh)(()=>({from:{opacity:0}
362,onChange:e=>{if(!C.current?.material)return;let t=e.value.opacity;C.current.material.uniforms.uOpacity.value=t,N.current=t}}),[]),[,Q]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>{if(!C.current?.material)return;let t=e.value.progress,n=C.current.material.uniforms;n.uProgressTL.value=Y(Math.min(Math.max((t-B)*H,0),1)),n.uProgressTR.value=Y(Math.min(Math.max((t-j)*H,0),1)),n.uProgressBL.value=Y(Math.min(Math.max((t-$)*H,0),1)),n.uProgressBR.value=Y(Math.min(Math.max((t-W)*H,0),1))}}),[]),K=(e,t,n)=>{b.current=!0,N.current=0,q("uOrigin",t),q("uCorner",n),z(!0),Q.stop(!0),Q.start({from:{progress:0},to:{progress:1},config:{duration:1200,easing:m.le.linear},onRest:()=>{l?.()}}),Z.stop(!0),Z.start({from:{opacity:0},to:{opacity:1},delay:200,config:{duration:600,easing:m.le.easeOutQuart}})},J=()=>{Q.stop(!0),Q.start({from:{progress:1},to:{progress:0},config:{duration:800,easing:m.le.easeInOutCubic}}),Z.stop(!0),Z.start({from:{opacity:1},to:{opacity:0},config:{duration:1e3,easing:m.le.easeInOutCubic},onRest:()=>{b.current=!1,z(!1),u?.()}})},ee=e=>{q("uCorner",e)},et=e=>{q("uOrigin",e)};return(0,o.useEffect)(()=>(y.current=w.current,()=>{y.current=null}),[y]),(0,o.useEffect)(()=>{if(!L){T.current=0,M.current=0;return}let e=e=>{T.current=(e.clientX/window.innerWidth-.5)*.3,M.current=-(2*(.08*(e.clientY/window.innerHeight-.5)))};return window.addEventListener("mousemove",e),()=>window.removeEventListener("mousemove",e)},[L]),(0,c.Ql)((e,t)=>{if(w.current){S.current.set(0,0,-1).applyQuaternion(p.quaternion),w.current.position.copy(p.position).addScaledVector(S.current,10);let e=(0,f.xx)(.03,t);A.current+=(T.current-A.current)*e,D.current+=(M.current-D.current)*e,w.current.quaternion.copy(p.quaternion),I.current.set(D.current,A.current,0),_.current.setFromEuler(I.current),w.current.quaternion.multiply(_.current);let n=2*Math.tan(p.fov*Math.PI/180/2)*10/h.height;w.current.scale.setScalar(n)}if(C.current?.material){x&&(C.current.material.uniforms.tDiffuse.value=x),C.current.material.uniforms.uScreenResolution.value.set(h.width,h.height);let e=C.current.material.uniforms,t=e.uProgressTL.value,n=e.uProgressTR.value,r=e.uProgressBL.value,a=e.uProgressBR.value,o=e.uOriginTL.value,i=e.uOriginTR.value,s=e.uOriginBL.value,l=e.uOriginBR.value,u=e.uCornerTL.value,c=e.uCornerTR.value,f=e.uCornerBL.value,m=e.uCornerBR.value,p=o.x+(u.x-o.x)*t,v=o.y+(u.y-o.y)*t,y=i.x+(c.x-i.x)*n,w=i.y+(c.y-i.y)*n,R=l.x+(m.x-l.x)*a,b=l.y+(m.y-l.y)*a,S=s.x+(f.x-s.x)*r,T=s.y+(f.y-s.y)*r;if(d?.current!==void 0){d.current||(d.current={tlX:0,tlY:0,trX:0,trY:0,blX:0,blY:0,brX:0,brY:0,targetTlX:0,targetTlY:0,targetTrX:0,targetTrY:0,targetBlX:0,targetBlY:0,targetBrX:0,targetBrY:0});let e=d.current;e.tlX=p,e.tlY=v,e.trX=y,e.trY=w,e.blX=S,e.blY=T,e.brX=R,e.brY=b,e.targetTlX=u.x,e.targetTlY=u.y,e.targetTrX=c.x,e.targetTrY=c.y,e.targetBlX=f.x,e.targetBlY=f.y,e.targetBrX=m.x,e.targetBrY=m.y}if(U.current){let e=U.current.attributes.position;e.setXYZ(0,p,v,.5),e.setXYZ(1,y,w,.5),e.setXYZ(2,R,b,.5),e.setXYZ(3,S,T,.5),e.needsUpdate=!0}let P=F.current;if(P[0]&&P[0].position.set(p,v,.5),P[1]&&P[1].position.set(y,w,.5),P[2]&&P[2].position.set(R,b,.5),P[3]&&P[3].position.set(S,T,.5),E.current){let e=(p+R)/2,t=(v+b)/2,n=Math.abs(y-p),r=Math.abs(v-T);E.current.position.set(e,t,.1),E.current.scale.set(n,r,1)}let M=N.current;for(let e of(O.current&&(O.current.opacity=g.i.contactForm.containerBorderOpacity*M),P))e?.material&&(e.material.opacity=g.i.contactForm.cornerDotOpacity*M)}}),(0,o.useImperativeHandle)(t,()=>({open:K,close:J,updateTargetCorners:ee,updateOriginCorners:et,get isOpen(){return b.current}})),(0,a.jsxs)("group",{ref:w,children:[(0,a.jsxs)("mesh",{ref:R,layers:n,renderOrder:300,frustumCulled:!1,visible:L,children:[(0,a.jsx)("primitive",{object:V,attach:"geometry"}),(0,a.jsx)(P,{ref:C})]}),L&&(0,a.jsx)("mesh",{ref:E,visible:!1,onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,a.jsx)("planeGeometry",{args:[1,1]})}),L&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("lineLoop",{layers:n,renderOrder:400,frustumCulled:!1,children:[(0,a.jsx)("primitive",{ref:U,object:k,attach:"geometry"}),(0,a.jsx)("lineBasicMaterial",{ref:O,color:g.i.contactForm.containerBorderColor,transparent:!0,opacity:0,depthTest:!1,depthWrite:!1})]}),[0,1,2,3].map(e=>(0,a.jsx)("mesh",{ref:t=>{F.current[e]=t},geometry:G,layers:n,renderOrder:401,frustumCulled:!1,children:(0,a.jsx)("meshBasicMaterial",{color:g.i.contactForm.cornerDotColor,transparent:!0,opacity:0,depthTest:!1,depthWrite:!1})},e)),r]})]})});var A=n(8815);let D=y.u.loadingRing,_=new i.Q1f(D.baseColor),I=new i.Q1f(D.activeColor),E=2.5*D.outerRadius,U=` 363 varying vec2 vUv; 364 void main() { 365 vUv = uv; 366 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
366); 367 } 368`,O=` 369 #define PI 3.141592653589793 370 #define TWO_PI 6.283185307179586 371 372 uniform float uProgress; 373 uniform float uOpacity; 374 uniform float uSegments; 375 uniform float uGapAngle; 376 uniform float uOuterRadius; 377 uniform float uInnerRadius; 378 uniform vec3 uBaseColor; 379 uniform vec3 uActiveColor; 380 381 varying vec2 vUv; 382 383 void main() { 384 vec2 p = vUv * 2.0 - 1.0; 385 float dist = length(p); 386 387 /* Ring mask with anti-aliased edges */ 388 float aaWidth = fwidth(dist) * 1.5; 389 float outerMask = smoothstep(uOuterRadius + aaWidth, uOuterRadius - aaWidth, dist); 390 float innerMask = smoothstep(uInnerRadius - aaWidth, uInnerRadius + aaWidth, dist); 391 float ring = outerMask * innerMask; 392 393 /* Angle from 12 o'clock, counter-clockwise, 0-TWO_PI */ 394 float angle = mod(atan(p.x, p.y) + TWO_PI, TWO_PI); 395 396 /* Segment calculation */ 397 float segAngle = TWO_PI / uSegments; 398 float segIndex = floor(angle / segAngle); 399 float localAngle = mod(angle, segAngle); 400 401 /* Gap mask with anti-aliased edges */ 402 float gapAA = fwidth(localAngle) * 1.5; 403 float gapStart = smoothstep(uGapAngle * 0.5 - gapAA, uGapAngle * 0.5 + gapAA, localAngle); 404 float gapEnd = smoothstep(segAngle - uGapAngle * 0.5 + gapAA, segAngle - uGapAngle * 0.5 - gapAA, localAngle); 405 float inSegment = ring * gapStart * gapEnd; 406 407 /* Progress-based segment lighting with soft fade-in per segment */ 408 float segThreshold = (segIndex + 1.0) / uSegments; 409 float fadeWidth = 1.0 / uSegments; 410 float lit = smoothstep(segThreshold - fadeWidth, segThreshold, uProgress); 411 412 vec3 color = mix(uBaseColor, uActiveColor, lit); 413 gl_FragColor = vec4(color, inSegment * uOpacity); 414 415 if (gl_FragColor.a < 0.001) discard; 416 } 417`,F=(0,o.forwardRef)((e,t)=>{let{layers:n,position:r}=e,s=(0,o.useRef)(null),l=(0,o.useRef)(null),u=(0,o.useRef)(0),d=(0,o.useRef)({uProgress:new i.nc$(0),uOpacity:new i.nc$(0),uSegments:new i.nc$(D.segments),uGapAngle:new i.nc$(D.gapAngle),uOuterRadius:new i.nc$(D.outerRadius/E),uInnerRadius:new i.nc$(D.innerRadius/E),uBaseColor:new i.nc$(new i.Pq0(_.r,_.g,_.b)),uActiveColor:new i.nc$(new i.Pq0(I.r,I.g,I.b))}),[,p]=(0,m.zh)(()=>({from:{opacity:0}
417,onChange:e=>{s.current&&(s.current.uniforms.uOpacity.value=e.value.opacity)},onRest:()=>{l.current&&(l.current(),l.current=null)}}),[]);(0,c.Ql)((e,t)=>{if(!s.current)return;let n=s.current.uniforms.uProgress.value,r=u.current;.04>Math.abs(r-n)?s.current.uniforms.uProgress.value=r:s.current.uniforms.uProgress.value=n+(r-n)*(0,f.xx)(.1,t)});let h=(0,o.useCallback)(()=>{u.current=0,s.current&&(s.current.uniforms.uProgress.value=0),p.stop(!0),l.current=null,p.start({from:{opacity:0},to:{opacity:1},config:{duration:D.fadeInDuration,easing:m.le.easeOutCubic}})},[p]),g=(0,o.useCallback)(()=>new Promise(e=>{l.current=e,p.stop(!0),p.start({from:{opacity:1},to:{opacity:0},config:{duration:D.fadeOutDuration,easing:m.le.easeOutCubic}})}),[p]),v=(0,o.useCallback)(e=>{u.current=e},[]);return(0,o.useImperativeHandle)(t,()=>({show:h,hide:g,setProgress:v})),(0,a.jsxs)("mesh",{layers:n,renderOrder:500,position:r,children:[(0,a.jsx)("planeGeometry",{args:[E,E]}),(0,a.jsx)("shaderMaterial",{ref:s,transparent:!0,depthTest:!1,depthWrite:!1,vertexShader:U,fragmentShader:O,uniforms:d.current})]})}),N=` 418 varying vec2 vUv; 419 void main() { 420 vUv = uv; 421 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 422 } 423`,L=` 424 uniform vec3 uColor; 425 uniform float uOpacity; 426 varying vec2 vUv; 427 void main() { 428 float aaX = fwidth(vUv.x) * 1.5; 429 float aaY = fwidth(vUv.y) * 1.5; 430 float edgeAA = smoothstep(0.0, aaX, vUv.x) * smoothstep(0.0, aaX, 1.0 - vUv.x) 431 * smoothstep(0.0, aaY, vUv.y) * smoothstep(0.0, aaY, 1.0 - vUv.y); 432 float alpha = uOpacity * edgeAA; 433 if (alpha < 0.01) discard; 434 gl_FragColor = vec4(uColor, alpha); 435 } 436`,z=e=>{e&&e.traverse(e=>{if(e.isMesh&&e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.stencilWrite=!0,t.stencilFunc=i.jsO,t.stencilRef=1,t.stencilFail=i.VVr,t.stencilZFail=i.VVr,t.stencilZPass=i.VVr})},V=(0,o.forwardRef)((e,t)=>{let{layers:n,product:r,layout:l,isContentVisible:u,onAllTextsReady:d,warmupMode:m=!1}=e,{fonts:h}=(0,o.useContext)(v.DM),x=(0,s.C)(e=>e.camera),w=(0,s.C)(e=>e.gl),{gap1:R,gap2:C,textLeft:b,textWidth:S,textBottom:T,titleX:P,titleY:M,mainTitleFontSize:A,subTitleFontSize:D,bodyFontSize:_,bodyLineHeight:I,titleLabelWidth:E,metaTitleLabelWidth:U,metaLabelWidth:O,descLabelWidth:F}=l,V=(0,o.useRef)(new i.Q1f(g.i.label.fontColor)).current,k=(0,o.useRef)(null),G=(0,o.useRef)(null),B=(0,o.useRef)(null),j=(0,o.useRef)(null),$=(0,o.useRef)(null),W=(0,o.useRef)(null),H=(0,o.useRef)(null),Y=(0,o.useRef)(null),X=(0,o.useRef)(null),q=(0,o.useRef)(null),Z=(0,o.useRef)(null),Q=(0,o.useRef)(null),K=(0,o.useRef)(0),J=(0,o.useRef)(0),ee=(0,o.useRef)(0),et=(0,o.useRef)(0),en=(0,o.useRef)(0),er=(0,o.useRef)(null),ea=(0,o.useRef)(null),eo=(0,o.useRef)(!1),ei=(0,o.useRef)(0),es=(0,o.useRef)(0),el=(0,o.useRef)(null),eu=(0,o.useRef)(null),ec=(0,o.useRef)(!1),ef=(0,o.useRef)(0),ed=(0,o.useRef)(0),em=(0,o.useRef)(0),ep=(0,o.useRef)(0),eh=(0,o.useRef)(0),eg=(0,o.useRef)(0),ev=(0,o.useRef)(!1),ex=(0,o.useRef)(0),ey=(0,o.useRef)(0),ew=(0,o.useRef)(!1),eR=(0,o.useRef)({active:!1,elapsed:0,duration:0}),eC=(0,o.useRef)({uColor:new i.nc$(new i.Q1f(g.i.label.fontColor)),uOpacity:new i.nc$(0)}),eb=(0,c.RV)(eC),eS=r.category?.length?r.category.join(" / "):"",eT=r.status??"",eP=r.downloads??"",eM=r.technologies?.length?r.technologies.map(e=>`- ${e.category}: ${e.items.join(", ")}`).join("\n"):"",eA=(0,o.useCallback)(()=>{if(ee.current<6)return;let e=(e,t,n)=>{e.current?.setPositionXYZ(P,t,1);let r=e.current?.getBoundingBoxSize();return r?t-r.y-n:t},t=M,n=k.current?.getBoundingBoxSize();n&&(t=M-n.y-C);let r=t;t=e(G,t,R),t=e(B,t,C),t=e(j,t,R),t=e($,t,C),t=e(W,t,R),t=e(H,t,C),t=e(Y,t,R),t=e(X,t,C),t=e(q,t,R),Z.current?.setPositionXYZ(P,t,1);let a=Z.current?.getBoundingBoxSize(),o=a?t-a.y:t,i=r-T,s=r-o;if(en.current=s,et.current=Math.max(0,s-i),er.current){let e=Math.max(0,i),t=S+32+4;er.current.position.set(b+t/2,T+e/2,.5),er.current.scale.set(t,e,1),ea.current&&(ea.current.position.set(b+S/2,T+e/2,1.5),ea.current.scale.set(S,e,1))}ev.current=et.current>0;let l=b+S+16+2;
436if(em.current=l,ep.current=r,eh.current=i,ev.current){let e=Math.max(30,i/s*i);eg.current=e,el.current&&(el.current.position.set(l,T+i/2,1.5),el.current.scale.set(24,i,1)),eu.current&&(eu.current.scale.set(4,e,1),eu.current.visible=!0),ex.current=+!!ew.current}else ex.current=0;K.current=0,J.current=0,z(Q.current)},[P,M,R,C,T,b,S]),eD=(0,o.useCallback)(()=>{ee.current+=1,ee.current>=6&&(eA(),d())},[eA,d]);(0,o.useEffect)(()=>{u&&requestAnimationFrame(()=>eA())},[u,eA]),(0,o.useEffect)(()=>{u&&z(Q.current)},[u]),(0,o.useLayoutEffect)(()=>{if(!u||m)return;let e=e=>{ew.current&&(K.current+=.5*e.deltaY,K.current=Math.max(0,Math.min(K.current,et.current)))};return window.addEventListener("wheel",e,{passive:!0}),()=>window.removeEventListener("wheel",e)},[u,m]);let e_=(0,o.useCallback)(()=>{let e=el.current;if(!e)return 1;let t=eh.current,n=eg.current,r=new i.Pq0(0,.5,0),a=new i.Pq0(0,-.5,0),o=e.localToWorld(r).project(x),s=e.localToWorld(a).project(x),l=w.domElement.getBoundingClientRect();return Math.abs(o.y-s.y)*l.height*.5*(t>0?(t-n)/t:1)},[x,w]),eI=(0,o.useCallback)(()=>{ev.current&&ew.current&&(document.body.style.cursor="grab")},[]),eE=(0,o.useCallback)(()=>{eo.current||ec.current||(document.body.style.cursor="")},[]),eU=(0,o.useCallback)(e=>{ev.current&&ew.current&&(e.stopPropagation(),eo.current=!0,ei.current=e.nativeEvent.clientY,es.current=K.current,document.body.style.cursor="grabbing")},[]),eO=(0,o.useCallback)(e=>{ev.current&&ew.current&&(e.stopPropagation(),ec.current=!0,ef.current=e.nativeEvent.clientY,ed.current=K.current,document.body.style.cursor="grabbing")},[]);if((0,o.useLayoutEffect)(()=>{if(!u||m)return;let e=e=>{if(eo.current){let t=e.clientY-ei.current;K.current=Math.max(0,Math.min(et.current,es.current-t))}else if(ec.current){let t=(e.clientY-ef.current)/e_()*et.current;K.current=Math.max(0,Math.min(et.current,ed.current+t))}},t=()=>{eo.current=!1,ec.current=!1,document.body.style.cursor=""};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[u,e_,m]),(0,c.Ql)((e,t)=>{let n=(0,f.xx)(.12,t);if(J.current+=(K.current-J.current)*n,.1>Math.abs(J.current-K.current)&&(J.current=K.current),Q.current&&(Q.current.position.y=J.current),eu.current&&ev.current){let e=ep.current,t=eh.current,n=eg.current,r=et.current,a=r>0?J.current/r:0;eu.current.position.set(em.current,e-n/2-a*(t-n),1)}let r=(0,f.xx)(.1,t);ey.current+=(ex.current-ey.current)*r,.01>Math.abs(ey.current-ex.current)&&(ey.current=ex.current);let a=ey.current;if(eC.current.uOpacity.value=.5*a,eR.current.active){let e=eR.current;e.elapsed+=1e3*t;let n=Math.min(e.elapsed/e.duration,1),r=1-(1-Math.pow(1-n,3));for(let e of[k,G,B,j,$,W,H,Y,X,q,Z]){let t=e.current?.mesh;if(!t)continue;let n=t.material;n?.uniforms?.opacity&&(n.uniforms.opacity.value=r)}n>=1&&(e.active=!1)}}),(0,o.useImperativeHandle)(t,()=>({presentTexts:()=>{let e={min:400,max:800},t=0;for(let n of(k.current?.present(e,{min:t,max:t+400}),t+=50,G.current?.present(e,{min:t,max:t+400}),t+=50,B.current?.present(e,{min:t,max:t+400}),t+=50,j.current?.present(e,{min:t,max:t+400}),t+=50,$.current?.present(e,{min:t,max:t+400}),t+=50,W.current?.present(e,{min:t,max:t+400}),t+=50,H.current?.present(e,{min:t,max:t+400}),t+=50,Y.current?.present(e,{min:t,max:t+400}),t+=50,X.current?.present(e,{min:t,max:t+400}),t+=50,q.current?.present(e,{min:t,max:t+400}),t+=50,Z.current?.present(e,{min:t,max:t+400}),[B,$,H,X,Z]))n.current?.mesh&&(n.current.mesh.renderOrder=400);return t+400+e.max},dismissTexts:()=>{let e={min:150,max:300},t=0;Z.current?.dismiss(e,{min:t,max:t+100}),t+=20,q.current?.dismiss(e,{min:t,max:t+100}),t+=20,X.current?.dismiss(e,{min:t,max:t+100}),t+=20,Y.current?.dismiss(e,{min:t,max:t+100}),t+=20,H.current?.dismiss(e,{min:t,max:t+100}),t+=20,W.current?.dismiss(e,{min:t,max:t+100}),t+=20,$.current?.dismiss(e,{min:t,max:t+100}),t+=20,j.current?.dismiss(e,{min:t,max:t+100}),t+=20,B.current?.dismiss(e,{min:t,max:t+100}),t+=20,G.current?.dismiss(e,{min:t,max:t+100}),t+=20,k.current?.dismiss(e,{min:t,max:t+100}
436)},fadeOutTexts:()=>{for(let e of[B,$,H,X,Z])e.current?.abort();eR.current={active:!0,elapsed:0,duration:y.u.glitchTransition.dismissTextDuration}},relayout:eA,reset:()=>{ee.current=0,K.current=0,J.current=0,eo.current=!1,ec.current=!1,ew.current=!1,ex.current=0,eR.current.active=!1},enableScroll:()=>{ew.current=!0,ev.current&&(ex.current=1)},fadeOutScrollbar:()=>{ex.current=0},isAllTextsReady:()=>ee.current>=6})),!h.USansRgBd)return null;let eF={layers:n,renderOrder:400,fontFile:h.USansRgBd.fontFile,fontTexture:h.USansRgBd.fontTexture,fontSize:D,fontColor:V,labelWidth:U,transparent:!0,depthTest:!1,depthWrite:!1,onInitialized:eD},eN={layers:n,fontFile:h.USansRgBd.fontFile,fontTexture:h.USansRgBd.fontTexture,fontSize:_,fontColor:V,labelWidth:O,transparent:!0,depthTest:!1};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.PD,{ref:k,layers:n,renderOrder:400,position:[P,M,1],text:r.title,fontFile:h.USansRgBd.fontFile,fontTexture:h.USansRgBd.fontTexture,fontSize:A,fontColor:V,labelWidth:E,transparent:!0,depthTest:!1,depthWrite:!1,onInitialized:eD}),(0,a.jsxs)("mesh",{ref:er,layers:n,renderOrder:399,visible:!0,children:[(0,a.jsx)("planeGeometry",{args:[1,1]}),(0,a.jsx)("meshBasicMaterial",{colorWrite:!1,depthWrite:!1,depthTest:!1,stencilWrite:!0,stencilFunc:i.sKt,stencilRef:1,stencilFail:i.VVr,stencilZFail:i.VVr,stencilZPass:i.kG0})]}),(0,a.jsxs)("mesh",{ref:ea,layers:n,renderOrder:402,onPointerOver:eI,onPointerOut:eE,onPointerDown:eU,children:[(0,a.jsx)("planeGeometry",{args:[1,1]}),(0,a.jsx)("meshBasicMaterial",{transparent:!0,opacity:0,depthTest:!1,depthWrite:!1})]}),(0,a.jsxs)("group",{ref:Q,children:[(0,a.jsx)(p.PD,{ref:G,position:[P,M,1],text:"Category",...eF}),(0,a.jsx)(p.vs,{ref:B,text:eS,...eN}),(0,a.jsx)(p.PD,{ref:j,position:[P,M,1],text:"Status",...eF}),(0,a.jsx)(p.vs,{ref:$,text:eT,...eN}),(0,a.jsx)(p.PD,{ref:W,position:[P,M,1],text:"Downloads",...eF}),(0,a.jsx)(p.vs,{ref:H,text:eP,...eN}),(0,a.jsx)(p.PD,{ref:Y,position:[P,M,1],text:"Tech Stack",...eF}),(0,a.jsx)(p.vs,{ref:X,text:eM,lineHeight:I,...eN}),(0,a.jsx)(p.PD,{ref:q,position:[P,M,1],text:"Description",...eF}),(0,a.jsx)(p.vs,{ref:Z,layers:n,text:r.description,fontFile:h.USansRgBd.fontFile,fontTexture:h.USansRgBd.fontTexture,lineHeight:I,fontSize:_,fontColor:V,labelWidth:F,transparent:!0,depthTest:!1})]}),(0,a.jsxs)("mesh",{ref:el,layers:n,renderOrder:402,onPointerOver:eI,onPointerOut:eE,onPointerDown:eO,children:[(0,a.jsx)("planeGeometry",{args:[1,1]}),(0,a.jsx)("meshBasicMaterial",{transparent:!0,opacity:0,depthTest:!1,depthWrite:!1})]}),(0,a.jsxs)("mesh",{ref:eu,layers:n,renderOrder:401,visible:!1,children:[(0,a.jsx)("planeGeometry",{args:[1,1]}),(0,a.jsx)("shaderMaterial",{ref:eb,transparent:!0,depthTest:!1,depthWrite:!1,vertexShader:N,fragmentShader:L,uniforms:eC.current})]})]})});var k=n(1343);let G=g.i.label.fontBaseLineHeight,B=y.u.indicator.buttonSize,j=y.u.indicator.fontSize,$=y.u.indicator.bracketLength,W=y.u.indicator.offsetY;function H(e){return e.size}function Y(){}let X=(0,o.forwardRef)((e,t)=>{var n;let r,l,u,f,d,m,p,g,v,R,C,{layers:b,product:S,cornerStateRef:P,warmupMode:M=!1}=e,D=(0,o.useRef)(null);S&&(D.current=S);let _=S??D.current,I=y.u.glitchTransition,{play:E,stop:U,playProductImageTransitionSFX:O}=(0,o.useContext)(A.n),N=(0,c.v6)(),L=(0,o.useRef)(null),z=(()=>{let e,t,n,r,a,s,l,u,f,d,m,p,h=(0,k.c)(17),{connectMediaElement:g}=(0,o.useContext)(A.n),v=(0,o.useRef)(null),x=(0,o.useRef)(null),w=(0,o.useRef)(null),R=(0,o.useRef)(null),C=(0,o.useRef)(0),b=(0,o.useRef)(!1);h[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{if(v.current)return v.current;let e=document.createElement("video");return e.muted=!1,e.playsInline=!0,e.crossOrigin="anonymous",e.preload="auto",e.setAttribute("playsinline",""),e.addEventListener("ended",()=>{R.current?.()}),v.current=e,e},h[0]=e):e=h[0];let S=e;h[1]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{let t=S();return new Promise((n,r)=>{let a=()=>{if(t.removeEventListener("loadeddata",a),t.removeEventListener("error",o),!x.current){let e=new i.Nv2(t);e.minFilter=i.k6q,e.magFilter=i.k6q,e.generateMipmaps=!1,x.current=e}n(x.current)},o=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",o),r(Error(`product video load failed: ${e}`))};t.addEventListener("loadeddata",a),t.addEventListener("error",o),t.src=e,t.load()})},h[1]=t):t=h[1];let T=t;h[2]!==g?(n=()=>{let e=v.current;e&&(w.current||(w.current=g(e,y.u.video.gain)),e.muted=!1,e.play().catch(()=>{e.muted=!0,e.play().catch(Y)}))},h[2]=g,h[3]=n):n=h[3];let P=n;h[4]!==P?(r=()=>{let e=v.current;e&&(e.currentTime=0,P())},h[4]=P,h[5]=r):r=h[5];let M=r;h[6]!==P?(a=()=>{P()},h[6]=P,h[7]=a):a=h[7];let D=a;h[8]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{v.current?.pause()},h[8]=s):s=h[8];let _=s;h[9]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{R.current=e},h[9]=l):l=h[9];let I=l;h[10]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{let e=v.current;return e&&e.videoWidth>0&&e.videoHeight>0?e.videoWidth/e.videoHeight:0},h[10]=u):u=h[10];let E=u;return h[11]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{let e=v.current;e&&e.duration>0&&(C.current=Math.min(e.currentTime/e.duration,1)),b.current=!!e&&(!e.paused||e.currentTime>0)},h[11]=f):f=h[11],(0,c.Ql)(f),h[12]===Symbol.for("react.memo_cache_sentinel")?(m=()=>()=>{let e=v.current;e&&(e.pause(),e.removeAttribute("src"),e.load()),w.current?.(),w.current=null,x.current?.dispose(),x.current=null,v.current=null},d=[],h[12]=d,h[13]=m):(d=h[12],m=h[13]),(0,o.useEffect)(m,d),h[14]!==D||h[15]!==M?(p={load:T,start:M,stop:_,resume:D,getAspect:E,setOnEnded:I,progressRef:C,activeRef:b},h[14]=D,h[15]=M,h[16]=p):p=h[16],p})(),X=(n={onImageTransition:O},r=(0,c.v6)(),l=(0,o.useRef)(0),u=(0,o.useRef)(null),f=(0,o.useRef)(!1),d=(0,o.useRef)(!1),m=(0,o.useRef)(()=>{}),p=(0,o.useCallback)(()=>{u.current&&clearTimeout(u.current),f.current&&_&&!(_.images.content.length<=1)&&(u.current=setTimeout(()=>{m.current()},3e3))},[_]),m.current=(0,o.useCallback)(()=>
436{if(!f.current||!_||_.images.content.length<=1||d.current)return;let e=_.images.content.length,t=(l.current+1)%e,a=_.images.content[t];(z.stop(),d.current=!0,"video"===a.type)?z.load(a.url).then(e=>{d.current=!1,f.current&&(n?.onImageTransition?.(),L.current?.crossfadeTo(e,z.getAspect()).then(()=>{f.current&&(l.current=t,z.start())}))}).catch(()=>{d.current=!1,f.current&&p()}):r.load(a).then(e=>{d.current=!1,f.current&&(n?.onImageTransition?.(),L.current?.crossfadeTo(e).then(()=>{f.current&&(l.current=t,p())}))}).catch(()=>{d.current=!1,f.current&&p()})},[_,r,L,p,n?.onImageTransition,z]),(0,o.useEffect)(()=>(z.setOnEnded(()=>{f.current&&(z.stop(),m.current())}),()=>z.setOnEnded(null)),[z]),g=(0,o.useCallback)(e=>{if(!_||e===l.current||e<0||e>=_.images.content.length)return;f.current=!1,u.current&&(clearTimeout(u.current),u.current=null),z.stop();let t=_.images.content[e];"video"===t.type?z.load(t.url).then(t=>{n?.onImageTransition?.(),L.current?.crossfadeTo(t,z.getAspect()).then(()=>{l.current=e,z.start()})}).catch(()=>{}):r.load(t).then(t=>{n?.onImageTransition?.(),L.current?.crossfadeTo(t).then(()=>{l.current=e})}).catch(()=>{})},[_,r,L,n?.onImageTransition,z]),v=(0,o.useCallback)(()=>{let e=_?.images.content[l.current]?.type==="video";f.current?(f.current=!1,u.current&&(clearTimeout(u.current),u.current=null),e&&z.stop()):(f.current=!0,e?z.resume():p())},[p,_,z]),R=(0,o.useCallback)(e=>{z.stop(),l.current=0,f.current=!1,u.current&&(clearTimeout(u.current),u.current=null),d.current=!1},[z]),C=(0,o.useCallback)(()=>{z.stop(),f.current=!1,u.current&&(clearTimeout(u.current),u.current=null),d.current=!1},[z]),{carouselIndexRef:l,carouselActiveRef:f,carouselInterval:3e3,startCarouselTimer:p,switchToImage:g,togglePlayPause:v,reset:R,stop:C}),q=(0,o.useRef)(X).current,Z=(e=>{let t,n,r,a,o,i,l,u,c,f,d,m,p,h,g,v,x=(0,k.c)(51),w=(0,s.C)(H),R=w.width>=w.height,C=y.u.float.margins.top/1280*2,b=y.u.float.margins.bottom/1280*2,S=y.u.float.margins.left/2275.5555555555557*2,T=y.u.float.margins.right/2275.5555555555557*2,P=(2-S-T)/2*w.width,M=(2-C-b)/2*w.height;if(R){let{base:e,ceiling:r}=y.u.float.landscapeScale,a=Math.max(0,Math.min(1,(w.height-e.viewportHeight)/(r.viewportHeight-e.viewportHeight)));t=e.width+(r.width-e.width)*a,n=e.height+(r.height-e.height)*a}else{let e=y.u.float.maxSize.portrait;t=e.width,n=e.height}let A=Math.min(P/t,M/n,1),D=t*A,_=n*A,I=(R?t/y.u.float.landscapeScale.base.width:1)*Math.max(A,R?0:y.u.float.portraitMinContentScale),E=32*I,U=20*I,O=14*I,F=(S-T)*w.width/4,N=(b-C)*w.height/4,L=F-D/2,z=F+D/2,V=N+_/2,Y=N-_/2,X=12*I,q=30*I;R?(o=L+(r=a=_)/2,i=N,l=L+r+40*I,u=z-40*I-l,c=V-60*I):(r=D,a=D,o=F,i=V-a/2,l=L+40*I,u=z-40*I-l,c=V-a-60*I),f=Y+60*I;let Z=B*I,Q=j*I,K=$*I,J=e+1,ee=Z*J,et=o,en=i-a/2+W*I+Z/2,er=ee/2;x[0]!==er||x[1]!==Z||x[2]!==et?(d=e=>et-er+Z*e+Z/2,x[0]=er,x[1]=Z,x[2]=et,x[3]=d):d=x[3];let ea=d,eo=l,ei=c;x[4]!==E||x[5]!==u?(m=u*G/E,x[4]=E,x[5]=u,x[6]=m):m=x[6];let es=m;x[7]!==U||x[8]!==u?(p=u*G/U,x[7]=U,x[8]=u,x[9]=p):p=x[9];let el=p;x[10]!==O||x[11]!==u?(h=u*G/O,x[10]=O,x[11]=u,x[12]=h):h=x[12];let eu=h;x[13]!==O||x[14]!==u?(g=u*G/O,x[13]=O,x[14]=u,x[15]=g):g=x[15];let ec=g;return x[16]!==O||x[17]!==e||x[18]!==ec||x[19]!==F||x[20]!==N||x[21]!==_||x[22]!==D||x[23]!==X||x[24]!==q||x[25]!==a||x[26]!==r||x[27]!==o||x[28]!==i||x[29]!==K||x[30]!==Z||x[31]!==et||x[32]!==J||x[33]!==Q||x[34]!==ea||x[35]!==Z||x[36]!==ee||x[37]!==en||x[38]!==R||x[39]!==E||x[40]!==eu||x[41]!==el||x[42]!==U||x[43]!==f||x[44]!==l||x[45]!==c||x[46]!==u||x[47]!==es||x[48]!==eo||x[49]!==ei?(v={isLandscape:R,floatW:D,floatH:_,floatCX:F,floatCY:N,gap1:X,gap2:q,imageW:r,imageH:a,imageX:o,imageY:i,textLeft:l,textWidth:u,textTop:c,textBottom:f,titleX:eo,titleY:ei,mainTitleFontSize:E,subTitleFontSize:U,bodyFontSize:O,bodyLineHeight:63,titleLabelWidth:es,metaTitleLabelWidth:el,metaLabelWidth:eu,descLabelWidth:ec,contentCount:e,indicatorButtonSize:Z,indicatorFontSize:Q,indicatorBracketLength:K,indicatorTotalW:ee,indicatorTotalH:Z,indicatorCX:et,indicatorY:en,indicatorColumnCount:J,indicatorGetButtonX:ea},x[16]=O,x[17]=e,x[18]=ec,x[19]=F,x[20]=N,x[21]=_,x[22]=D,x[23]=X,x[24]=q,x[25]=a,x[26]=r,x[27]=o,x[28]=i,x[29]=K,x[30]=Z,x[31]=et,x[32]=J,x[33]=Q,x[34]=ea,x[35]=Z,x[36]=ee,x[37]=en,x[38]=R,x[39]=E,x[40]=eu,x[41]=el,x[42]=U,x[43]=f,x[44]=l,x[45]=c,x[46]=u,x[47]=es,x[48]=eo,x[49]=ei,x[50]=v):v=x[50],v})(_?.images.content.length??0),Q=(0,o.useRef)(null),K=(0,o.useRef)(null),J=(0,o.useRef)(null),ee=(0,o.useRef)(null),et=(0,o.useRef)(0),en=(0,o.useRef)(null),er=(0,o.useRef)(null),ea=(0,o.useRef)(0),eo=(0,o.useRef)(null),ei=(0,o.useRef)(null),es=(0,o.useRef)(null),el=(0,o.useRef)(null),[eu,ec]=(0,o.useState)(M),ef=(e,t,n)=>{let r=n.targetTrX-n.targetTlX,a=n.targetTlY-n.targetBlY;return{u:(e-n.targetBlX)/r,v:(t-n.targetBlY)/a}},ed=(e,t,n)=>({x:(1-e)*(1-t)*n.blX+e*(1-t)*n.brX+(1-e)*t*n.tlX+e*t*n.trX,y:(1-e)*(1-t)*n.blY+e*(1-t)*n.brY+(1-e)*t*n.tlY+e*t*n.trY}
436),em=(e,t,n)=>{let r=n.targetTrX-n.targetTlX,a=n.targetTlY-n.targetBlY;return{sx:Math.abs((1-t)*(n.brX-n.blX)+t*(n.trX-n.tlX))/Math.abs(r),sy:Math.abs((1-e)*(n.tlY-n.blY)+e*(n.trY-n.brY))/Math.abs(a)}},ep=(0,o.useCallback)(()=>{if(2!==ea.current||!K.current?.isAllTextsReady())return;ea.current=3;let e=_?.images.content[q.carouselIndexRef.current]?.type==="video";J.current&&L.current?.setTexture(J.current,e?z.getAspect():void 0),O(),L.current?.present(I.duration,0),e&&z.start(),ei.current&&clearTimeout(ei.current),ei.current=setTimeout(()=>{ei.current=null;let t=K.current?.presentTexts()??0;Q.current?.show(),e||X.startCarouselTimer(),E(x.uc.SFX_TEXT_TRANSITION_1,h.z.sfx.text.transition1,!0),eo.current=setTimeout(()=>{eo.current=null,U(x.uc.SFX_TEXT_TRANSITION_1),3===ea.current&&(ea.current=4,K.current?.enableScroll())},t)},I.duration)},[X,I.duration,O,E,U,_,q,z]),eh=()=>{if(X.reset(_?.images.content.length??0),K.current?.reset(),ea.current=0,J.current=null,eo.current&&(clearTimeout(eo.current),eo.current=null),!_||!_.images.content.length){ea.current=2,ec(!0);return}ea.current=1,et.current=performance.now(),ee.current?.show();let e=_.images.content[0],t=e=>{J.current=e,q.carouselIndexRef.current=0,q.carouselActiveRef.current=!0,ee.current?.setProgress(1);let t=performance.now()-et.current,n=Math.max(0,y.u.loadingRing.minDisplayTime-t);er.current&&clearTimeout(er.current),er.current=setTimeout(()=>{er.current=null,ee.current?.hide().then(()=>{en.current=setTimeout(()=>{en.current=null,ea.current=2,ec(!0)},y.u.loadingRing.loaderToGlitchDelay)})},n)},n=()=>{ee.current?.hide().then(()=>{ea.current=2,ec(!0)})};"video"===e.type?z.load(e.url).then(t).catch(n):N.load(e,e=>{ee.current?.setProgress(e)}).then(t).catch(n)},eg=()=>{let e=ea.current;if(ea.current=5,eo.current&&(clearTimeout(eo.current),eo.current=null),ei.current&&(clearTimeout(ei.current),ei.current=null),U(x.uc.SFX_TEXT_TRANSITION_1),X.stop(),z.stop(),document.body.style.cursor="auto",en.current&&(clearTimeout(en.current),en.current=null),er.current&&(clearTimeout(er.current),er.current=null),1===e)return void ee.current?.hide();let t=I.dismissFadeDelay;L.current?.dismiss(I.dismissImageDuration,t),setTimeout(()=>{Q.current?.hide(),K.current?.fadeOutTexts(),K.current?.fadeOutScrollbar()},t)},ev=(0,o.useCallback)(()=>{2===ea.current&&ep()},[ep]);if((0,o.useEffect)(()=>{eu&&ep()},[eu,ep]),(0,o.useEffect)(()=>()=>{eo.current&&clearTimeout(eo.current),ei.current&&clearTimeout(ei.current),en.current&&clearTimeout(en.current),er.current&&clearTimeout(er.current)},[]),(0,c.Ql)(()=>{if(5!==ea.current)return;let e=P?.current;if(!e)return;let{imageX:t,imageY:n,imageW:r,imageH:a,indicatorCX:o,indicatorY:i,textLeft:s,textWidth:l,textTop:u,textBottom:c,titleX:f,titleY:d}=Z,m=r/2,p=a/2,h=[ef(t-m,n+p,e),ef(t+m,n+p,e),ef(t-m,n-p,e),ef(t+m,n-p,e)],g=ed(h[0].u,h[0].v,e),v=ed(h[1].u,h[1].v,e),x=ed(h[2].u,h[2].v,e),y=ed(h[3].u,h[3].v,e);if(L.current?.deformVertices(g.x,g.y,v.x,v.y,x.x,x.y,y.x,y.y),es.current){let t=ef(o,i,e),n=ed(t.u,t.v,e),r=em(t.u,t.v,e);es.current.position.set(n.x-o*r.sx,n.y-i*r.sy,0),es.current.scale.set(r.sx,r.sy,1)}if(el.current){let t=(d+c)/2,n=ef(f,t,e),r=ed(n.u,n.v,e),a=em(n.u,n.v,e);el.current.position.set(r.x-f*a.sx,r.y-t*a.sy,0),el.current.scale.set(a.sx,a.sy,1)}}),(0,o.useImperativeHandle)(t,()=>({present:eh,dismiss:eg,canDismiss:()=>4===ea.current})),!_)return null;let{floatCX:ex,floatCY:ey,imageW:ew,imageH:eR,imageX:eC,imageY:eb,contentCount:eS}=Z;return(0,a.jsxs)("group",{layers:b,children:[(0,a.jsx)(F,{ref:ee,layers:b,position:[ex,ey,1]}),eu&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(T,{ref:L,layers:b,width:ew,height:eR,position:[eC,eb,1]}),(0,a.jsx)("group",{ref:es,children:eS>1&&(0,a.jsx)(w,{ref:Q,layers:b,layout:Z,contentCount:eS,carouselIndexRef:X.carouselIndexRef,carouselActiveRef:X.carouselActiveRef,carouselInterval:X.carouselInterval,onDotClick:X.switchToImage,onTogglePlayPause:X.togglePlayPause,videoProgressRef:z.progressRef,videoActiveRef:z.activeRef,contentTypes:_?.images.content.map(e=>e.type??"image"),warmupMode:M})}),(0,a.jsx)("group",{ref:el,children:(0,a.jsx)(V,{ref:K,layers:b,product:_,layout:Z,isContentVisible:eu,onAllTextsReady:ev,warmupMode:M})})]})]})});var q=n(3882);n(8498);var Z=n(7936);let Q=(0,o.forwardRef)((e,t)=>{let{map:n}=e,r=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,()=>({material:r.current}));let s=(0,o.useMemo)(()=>({tMap:new i.nc$(n),alpha:new i.nc$(0),tGrid:new i.nc$(null),caMultiplier:new i.nc$(1),shuffleBlend:new i.nc$(0),uTargetCols:new i.nc$(256)}),[]);return(0,o.useMemo)(()=>(0,a.jsx)(Z.A,{ref:r,baseMaterial:i._4j,transparent:!0,depthTest:!0,depthWrite:!0,vertexShader:"// #include <common>\n// #include <logdepthbuf_pars_vertex>\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"uniform sampler2D tMap;\n\n/**\n * The opacity of the fill.\n */\nuniform float alpha;\n\n/**\n * Grid cell data texture.\n * RG: hover UV offset, BA: shuffle UV.\n */\nuniform sampler2D tGrid;\n\n/**\n * CA intensity multiplier derived from UV offset magnitude.\n * Set to 0.0 to disable CA entirely.\n */\nuniform float caMultiplier;\n\n/**\n * Blend factor between normal UV and shuffle UV.\n * 0.0 = normal, 1.0 = fully shuffled.\n */\nuniform float shuffleBlend;\n\n/**\n * Target column count per thumbnail in the U direction. Cell size in device\n * pixels is derived per-fragment from the thumbnail's projected screen size\n * (via vUv derivatives), so the LCD pattern keeps the same cells-per-thumb\n * density across viewport resolutions and DPR.\n */\nuniform float uTargetCols;\n\n/**\n * The UV coordinates.\n */\nvarying vec2 vUv;\n\n/**\n * **********************************\n * Main\n * **********************************\n */\n\nvoid main() {\n /* Resolution-independent device-pixel checker mask.\n * 1/length(dFdx(vUv)) approximates the thumbnail width in screen pixels;\n * dividing by uTargetCols yields an integer cell size that keeps\n * cells-per-thumb constant across viewports while staying aligned to\n * device pixels (avoids UV-grid moire / block collapse). */\n float thumbPxWidth = 1.0 / max(length(dFdx(vUv)), 1e-6);\n float cellPxSize = max(1.0, floor(thumbPxWidth / uTargetCols + 0.5));\n vec2 cellCoord = floor(gl_FragCoord.xy / cellPxSize);\n\n /* Sample grid cell data */\n vec4 gridData = texture2D(tGrid, vUv);\n vec2 uvOffset = gridData.rg;\n vec2 shuffleUV = gridData.ba;\n\n /* Blend between normal UV and shuffle UV */\n vec2 baseUV = mix(vUv, shuffleUV, shuffleBlend);\n\n /* Apply hover UV displacement */\n vec2 displacedUV = baseUV + uvOffset;\n\n /* CA derived from offset magnitude */\n float caStrength = length(uvOffset) * caMultiplier;\n vec2 caDir = caStrength > 0.001 ? normalize(uvOffset) : vec2(0.0);\n vec2 caOffset = caDir * caStrength;\n\n /* Per-channel sampling for RGB split */\n float r = texture2D(tMap, displacedUV + caOffset).r;\n float g = texture2D(tMap, displacedUV).g;\n float b = texture2D(tMap, displacedUV - caOffset).b;\n float a = texture2D(tMap, displacedUV).a;\n\n /* Off cells of the checker are forced to black. Routing them through the same\n * csm_DiffuseColor assignment as the on cells (only zeroing RGB) keeps their\
436n * alpha identical to the opaque on cells, so the LCD gaps read as solid black\n * instead of letting the GIS scene behind the thumbnail show through. */\n if (mod(cellCoord.x, 2.0) > 0.5 || mod(cellCoord.y, 2.0) > 0.5) {\n r = g = b = 0.0;\n }\n\n csm_DiffuseColor = vec4(vec3(r, g, b) * 0.5, a * alpha);\n #include <logdepthbuf_fragment>\n}\n",uniforms:s}),[])});function K(e,t,n,r,a,o){let i=Math.floor(e.x*n),s=Math.min(Math.ceil((e.x+e.w)*n),n),l=Math.floor(e.y*r),u=Math.min(Math.ceil((e.y+e.h)*r),r),c=e.x+.5*e.w,f=e.y+.5*e.h,d=o>0?1-e.depth/o:0,m=.01*d*d,p=c-.5,h=f-.5,g=Math.sqrt(p*p+h*h),v=g>.001?p/g*m:0,x=g>.001?h/g*m:0;for(let e=l;e<u;e++)for(let o=i;o<s;o++){let i=(e*n+o)*4;a?(t[i+0]=0,t[i+1]=0,t[i+2]=(o+.5)/n,t[i+3]=(e+.5)/r):(t[i+0]=v,t[i+1]=x,t[i+2]=c,t[i+3]=f)}}class J{roots=[];allNodes=[];elapsed=0;complete=!1;config;leafCount=0;lockedLeafCount=0;constructor(e){this.config=e}start(){for(let e of(this.roots=function(e){let{splitJitter:t,maxDepth:n,totalDuration:r,aspectRatio:a}=e,o=r/(n+1);function i(e,t,n){return Math.max(e+.15*t,Math.min(e+.85*t,n))}function s(e,r,l,u,c){let f={x:e,y:r,w:l,h:u,depth:c,children:null,delay:o*Math.random()*.4,duration:o*(.3+.4*Math.random()),state:"inactive",activatedAt:0,shuffleStartedAt:0,lastShuffleTime:0,shuffleTargetU:Math.random(),shuffleTargetV:Math.random()};if(c<n)if(l*a>=u){let n=e+l*(.5+(Math.random()-.5)*2*t),a=i(e,l,n);f.children=[s(e,r,a-e,u,c+1),s(a,r,e+l-a,u,c+1)]}else{let n=r+u*(.5+(Math.random()-.5)*2*t),a=i(r,u,n);f.children=[s(e,r,l,a-r,c+1),s(e,a,l,r+u-a,c+1)]}return f}if(+a>=1){let e=i(0,1,.5+(Math.random()-.5)*2*t);return[s(0,0,e,1,0),s(e,0,1-e,1,0)]}{let e=i(0,1,.5+(Math.random()-.5)*2*t);return[s(0,0,1,e,0),s(0,e,1,1-e,0)]}}(this.config),this.allNodes=function(e){let t=[];for(let n of e)!function e(n){if(t.push(n),n.children)for(let t of n.children)e(t)}(n);return t}(this.roots),this.elapsed=0,this.complete=!1,this.leafCount=this.allNodes.filter(e=>!e.children).length,this.lockedLeafCount=0,this.roots))e.state="waiting",e.activatedAt=0}update(e,t,n,r){if(this.complete)return!1;this.elapsed+=e;let a=!1,{totalDuration:o,shuffleInterval:i}=this.config;if(this.elapsed>=o){for(let e of this.allNodes)"locked"!==e.state&&(e.state="locked",K(e,t,n,r,!0,this.config.maxDepth),a=!0,!e.children&&this.lockedLeafCount++);return this.complete=!0,a}for(let e of this.allNodes)if("inactive"!==e.state&&"locked"!==e.state){if("waiting"===e.state){this.elapsed>=e.activatedAt+e.delay&&(e.state="shuffling",e.shuffleStartedAt=this.elapsed,e.lastShuffleTime=this.elapsed,e.shuffleTargetU=Math.random(),e.shuffleTargetV=Math.random(),K(e,t,n,r,!1,this.config.maxDepth),a=!0);continue}if(this.elapsed-e.shuffleStartedAt>=e.duration){if(e.state="locked",K(e,t,n,r,!0,this.config.maxDepth),a=!0,!e.children&&this.lockedLeafCount++,e.children)for(let t of e.children)t.state="waiting",t.activatedAt=this.elapsed;continue}this.elapsed-e.lastShuffleTime>=i&&(e.lastShuffleTime=this.elapsed,e.shuffleTargetU=Math.random(),e.shuffleTargetV=Math.random(),K(e,t,n,r,!1,this.config.maxDepth),a=!0)}return this.complete=this.lockedLeafCount>=this.leafCount,a}get isComplete(){return this.complete}reset(){this.roots=[],this.allNodes=[],this.elapsed=0,this.complete=!1,this.leafCount=0,this.lockedLeafCount=0}}let ee=(0,o.forwardRef)((e,t)=>{let{layers:n,renderOrder:r,texture:s,width:l=1e3}=e,u=s.image,f=u?u.width/u.height:1,d=l/f,p=Math.floor(32/f),h=(0,o.useRef)(null),g=(0,o.useRef)(null),v=(0,o.useRef)(null),x=(0,o.useRef)(null),w=(0,o.useRef)(null),R=(0,o.useRef)(null),C=(0,o.useRef)(null),b=y.u.thumbGrid,S=Math.floor(128/f),T=128*S,P=(0,o.useRef)(null),M=(0,o.useRef)(null),A=(0,o.useRef)("idle"),D=(0,o.useRef)(null),_=(0,o.useRef)(null),I=(0,o.useRef)(!1),E=(0,o.useRef)(0),U=(0,o.useRef)(b.hoverPlateBaseline),O=()=>{let e=w.current;e&&(e.opacity=E.current*U.current,e.needsUpdate=!0)},F=(0,o.useRef)(0),N=()=>{let e=R.current;e&&(e.opacity=E.current*F.current,e.needsUpdate=!0)},L=(0,o.useRef)([]),[z,V]=(0,m.zh)(()=>({from:{alpha:0},onChange:e=>{C.current.material.uniforms.alpha.value=e.value.alpha,C.current.material.needsUpdate=!0,E.current=e.value.alpha,O(),N()}}),[]),[k,G]=(0,m.zh)(()=>({from:{opacity:b.hoverPlateBaseline},onChange:e=>{U.current=e.value.opacity,O()}}),[]),[B,j]=(0,m.zh)(()=>({from:{opacity:0}
436,onChange:e=>{F.current=e.value.opacity,N()}}),[]);(0,c.Ql)((e,t)=>{let n=P.current,r=M.current;if(!n||!r)return;let a=A.current;if("presenting"===a){let e=D.current;if(!e)return;if(e.update(1e3*t,n,128,S)&&(r.needsUpdate=!0),e.isComplete){A.current="presented";let e=C.current?.material;e&&(e.uniforms.shuffleBlend.value=0),_.current&&(_.current(),_.current=null)}return}if("presented"===a){let e=D.current;if(e&&!e.isComplete){e.update(1e3*t,n,128,S)&&(r.needsUpdate=!0);return}if(e&&e.isComplete){let e=C.current?.material;e&&(e.uniforms.shuffleBlend.value=0),D.current=null}let a=L.current;if(a.length>0){let e=!1;for(let t=a.length-1;t>=0;t--){let r=a[t];if(r.frames--,r.frames<=0){let o=r.idx%128,i=Math.floor(r.idx/128),s=4*r.idx;n[s+2]=(o+.5)/128,n[s+3]=(i+.5)/S,a.splice(t,1),e=!0}}e&&(r.needsUpdate=!0)}}});let $=e=>{if((0,q.Rm)("mediumvioletred","â¶ï¸","present"),_.current=e??null,V.stop(!0),V.start({to:{alpha:1},config:{duration:y.u.thumbGrid.presentOpacityDuration,easing:m.le.easeInOutCubic}}),"idle"===A.current){A.current="presenting";let e=new J({maxDepth:b.maxDepth,splitJitter:b.splitJitter,totalDuration:b.totalDuration,shuffleInterval:b.shuffleInterval,aspectRatio:f});e.start(),D.current=e;let t=C.current?.material;t&&(t.uniforms.shuffleBlend.value=1)}},W=()=>{(0,q.Rm)("mediumvioletred","â¶ï¸","dismiss"),V.stop(!0),V.start({to:{alpha:0},config:{duration:y.u.thumbGrid.dismissOpacityDuration,easing:m.le.easeOutCubic}}),A.current="idle",D.current?.reset(),D.current=null,L.current=[],I.current=!1,G.stop(!0),G.start({to:{opacity:b.hoverPlateBaseline},immediate:!0}),U.current=b.hoverPlateBaseline,j.stop(!0),j.start({to:{opacity:0},immediate:!0}),F.current=0;let e=C.current?.material;e&&(e.uniforms.shuffleBlend.value=0)},H=()=>{if(I.current=!0,"rePresent"===b.hoverMode&&"presented"===A.current){let e=new J({maxDepth:b.maxDepth,splitJitter:b.splitJitter,totalDuration:b.hoverTotalDuration,shuffleInterval:b.shuffleInterval,aspectRatio:f});e.start(),D.current=e;let t=C.current?.material;t&&(t.uniforms.shuffleBlend.value=1)}G.stop(!0),G.start({to:{opacity:b.hoverPlateHover},immediate:!0}),U.current=b.hoverPlateHover,O(),j.stop(!0),F.current=b.flashPlateHoverSpike,N(),j.start({from:{opacity:b.flashPlateHoverSpike},to:{opacity:0},config:{duration:y.u.thumbGrid.flashHoverDuration,easing:m.le.easeOutCubic}})},Y=()=>{I.current=!1,L.current=[],G.stop(!0),G.start({to:{opacity:b.hoverPlateBaseline},config:{duration:y.u.thumbGrid.hoverLeaveDuration,easing:m.le.easeInOutCubic}})},X=()=>{(0,q.Rm)("mediumvioletred","\uD83D\uDC46","click"),I.current=!1,L.current=[],G.stop(!0),G.start({to:{opacity:b.hoverPlateBaseline},config:{duration:y.u.thumbGrid.hoverClickDuration,easing:m.le.easeInOutCubic}}),j.stop(!0),F.current=b.flashPlateClickSpike,N(),j.start({from:{opacity:b.flashPlateClickSpike},to:{opacity:0},config:{duration:y.u.thumbGrid.flashClickDuration,easing:m.le.easeOutCubic}})},Z=(0,o.useCallback)(e=>{if("presented"!==A.current||"micro"!==b.hoverMode||!I.current)return;let t=P.current;if(!t)return;let n=M.current;if(!n)return;let r=b.microShuffleRate,a=b.microShuffleLockDelay,o=L.current;for(let e=0;e<r;e++){let e=Math.floor(Math.random()*T),n=4*e;t[n+2]=Math.random(),t[n+3]=Math.random(),o.push({idx:e,frames:a})}n.needsUpdate=!0},[]);(0,c._B)("mediumvioletred"),(0,o.useEffect)(()=>{x.current.geometry.computeTangents(),x.current.geometry.computeVertexNormals();let e=new Float32Array(128*S*4);for(let t=0;t<S;t++)for(let n=0;n<128;n++){let r=(128*t+n)*4;e[r+0]=0,e[r+1]=0,e[r+2]=(n+.5)/128,e[r+3]=(t+.5)/S}P.current=e;let t=new i.GYF(e,128,S,i.GWd,i.RQf);t.magFilter=i.hxR,t.minFilter=i.hxR,t.needsUpdate=!0,M.current=t;let n=C.current?.material;return n&&(n.uniforms.tGrid.value=t),()=>{M.current?.dispose()}},[]),(0,o.useEffect)(()=>{let e=C.current?.material;e&&(e.uniforms.uTargetCols.value=b.checkerCols)},[b.checkerCols]);let K=(e,t,n)=>{};return(0,o.useImperativeHandle)(t,()=>({present:$,dismiss:W,position:h.current.position,rotation:h.current.rotation,width:l,height:d,aspectRatio:f,onPointerEnter:H,onPointerLeave:Y,onPointerMove:Z,onClick:X,getBoundingBox:()=>new i.NRn().setFromObject(h.current),getNormal:()=>{g.current.geometry.computeVertexNormals();let e=g.current.geometry.getAttribute("normal"),t=new i.Pq0;return t.fromBufferAttribute(e,0),t},setPulseUniforms:K})),(0,a.jsxs)("group",{ref:h,children:[(0,a.jsxs)("mesh",{ref:v,layers:n,position:[0,d/2,3],renderOrder:r?r+4:0,children:[(0,a.jsx)("planeGeometry",{args:[l,d,1,1]}),(0,a.jsx)("meshBasicMaterial",{ref:R,color:"white",transparent:!0,opacity:0}
436)]}),(0,a.jsxs)("mesh",{ref:g,layers:n,position:[0,d/2,2],renderOrder:r?r+3:0,children:[(0,a.jsx)("planeGeometry",{args:[l,d,1,1]}),(0,a.jsx)("meshStandardMaterial",{ref:w,color:"black",transparent:!0,opacity:0})]}),(0,a.jsxs)("mesh",{ref:x,layers:n,position:[0,d/2,0],renderOrder:r?r+1:0,children:[(0,a.jsx)("planeGeometry",{args:[l,d,32,p]}),(0,a.jsx)(Q,{ref:C,map:s})]})]})}),et=(0,o.forwardRef)((e,t)=>{let{fontTexture:n,pxRange:r,texSize:s,...l}=e,u=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,()=>({material:u.current}));let c=y.u.gis.gridAnnotation,f=y.u.gis.groundEffect;return(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:u,transparent:!0,depthWrite:!1,depthTest:!0,side:i.$EB,blending:i.NTi,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/* ===== Per-instance attributes ===== */\n\n/*\n * World position of this grid intersection.\n */\nattribute vec3 aInstancePosition;\n\n/*\n * Per-instance visibility (0 = hidden, 1 = visible).\n */\nattribute float aVisibility;\n\n/*\n * Digit indices for this instance (0-9 per position). Up to 4 digits.\n */\nattribute vec4 aDigits;\n\n/* ===== Uniforms ===== */\n\n/*\n * Camera world position for billboard + attenuation.\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Camera distance attenuation: far fade (near/far/min) + near proximity fade (near/far).\n */\nuniform float uAttenuationNear;\nuniform float uAttenuationFar;\nuniform float uAttenuationMin;\nuniform float uProximityNear;\nuniform float uProximityFar;\n\n/*\n * GIS data scale factor.\n */\nuniform float uDataScale;\n\n/*\n * Y offset above ground surface.\n */\nuniform float uYOffset;\n\n/*\n * Overall transition progress (present/dismiss).\n */\nuniform float uTransitionProgress;\n\n/*\n * Pulse wave uniforms (synced from pulse animation).\n */\nuniform vec3 uPulseCenter;\nuniform float uPulseRadius;\nuniform float uPulseOpacity;\nuniform float uPulseDecayWidth;\nuniform float uPulseEdgeBoost;\n\n/*\n * PathFinder agent proximity: annotations near MOVING agents become visible.\n * Inactive agents have uAgentFades[i] = 0, contributing nothing.\n */\nuniform vec3 uAgentPositions[10];\nuniform float uAgentFades[10];\nuniform float uAgentThumbFades[10];\nuniform float uAgentProximityNear;\nuniform float uAgentProximityFar;\n\n/* ===== Varyings ===== */\n\nvarying vec2 vUv;\nvarying float vOpacity;\nflat varying vec4 vDigits;\n\nvoid main() {\n vUv = uv;\n vDigits = aDigits;\n\n /* ââ Model-space position: scale + offsets ââ */\n vec3 modelPos = aInstancePosition * uDataScale;\n modelPos.y += uYOffset;\n\n /* ââ Transform to world space via parent group matrix ââ */\n vec3 worldPos = (modelMatrix * vec4(modelPos, 1.0)).xyz;\n\n /* ââ Camera distance attenuation (matches pathFinder approach) ââ */\n float camDist = distance(worldPos, uCameraPosition);\n float farFade = mix(1.0, uAttenuationMin, smoothstep(uAttenuationNear, uAttenuationFar, camDist));\n float nearFade = smoothstep(uProximityNear, uProximityFar, camDist);\n float attenuation = farFade * nearFade;\n\n /* ââ PathFinder agent proximity (XZ-plane distance, per
436-vertex loop) ââ */\n float proximityOpacity = 0.0;\n for (int i = 0; i < 10; i++) {\n float d = distance(worldPos.xz, uAgentPositions[i].xz);\n proximityOpacity += (1.0 - smoothstep(uAgentProximityNear, uAgentProximityFar, d)) * uAgentFades[i] * uAgentThumbFades[i];\n }\n proximityOpacity = clamp(proximityOpacity, 0.0, 1.0);\n\n /* ââ Pulse wave edge flash (XZ-plane distance from pulse center) ââ */\n float pulseDist = distance(worldPos.xz, uPulseCenter.xz);\n float behindFront = uPulseRadius - pulseDist;\n float pulseFlash = (1.0 - smoothstep(0.0, uPulseDecayWidth, max(behindFront, 0.0))) * step(0.0, behindFront) * uPulseOpacity * uPulseEdgeBoost;\n\n /* Final opacity: (camera attenuation \xd7 agent proximity) + additive pulse flash, masked by per-instance visibility */\n vOpacity = (attenuation * proximityOpacity + pulseFlash) * uTransitionProgress * aVisibility;\n\n /* ââ Cylindrical billboard (Y-axis fixed, face camera in XZ) ââ */\n vec3 toCamera = uCameraPosition - worldPos;\n float angle = atan(toCamera.x, toCamera.z);\n float cosA = cos(angle);\n float sinA = sin(angle);\n\n /* Rotate local quad vertices to face camera */\n vec3 localPos = position;\n vec3 billboarded = vec3(localPos.x * cosA + localPos.z * sinA, localPos.y, -localPos.x * sinA + localPos.z * cosA);\n\n vec3 finalPos = worldPos + billboarded;\n gl_Position = projectionMatrix * viewMatrix * vec4(finalPos, 1.0);\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:'#include <common>\n#include <logdepthbuf_pars_fragment>\n\n/*\n * MSDF font atlas texture.\n */\nuniform sampler2D tMsdf;\n\n/*\n * MSDF distance range (typically 4.0).\n */\nuniform float uPxRange;\n\n/*\n * Atlas texture dimensions (scaleW, scaleH).\n */\nuniform vec2 uTexSize;\n\n/*\n * Triangle color.\n */\nuniform vec3 uTriangleColor;\n\n/*\n * Label color.\n */\nuniform vec3 uLabelColor;\n\n/*\n * UV boundary: Y coordinate separating triangle region (below) from gap+label region (above).\n */\nuniform float uLabelTriangleSplit;\n\n/*\n * UV boundary: Y coordinate where label region starts (above gap).\n */\nuniform float uLabelStart;\n\n/*\n * Number of digits in the label (e.g. 3 for "001", 4 for "0001").\n */\nuniform float uDigitCount;\n\n/*\n * Per-digit atlas rect bounds (atlasMinU, atlasMinV, atlasMaxU, atlasMaxV).\n * Only glyph pixels are within this rect â sampling is bounded to prevent bleed.\n */\nuniform vec4 uGlyphRect[10];\n\n/*\n * Per-digit glyph X position within its own xadvance cell (startFraction, endFraction).\n * Derived from xoffset/xadvance and (xoffset+width)/xadvance.\n */\nuniform vec2 uGlyphCellX[10];\n\n/*\n * Per-digit xadvance as fraction of maxXAdvance (0-1).\n * Used for proportional spacing layout.\n */\nuniform float uGlyphXAdvance[10];\n\n/*\n * Shared glyph Y position within label region (bottomFraction, topFraction).\n * Derived from yoffset/lineHeight. Same for all digits 0-9.\n */\nuniform vec2 uGlyphCellY;\n\n/*\n * Triangle half-base width in UV x-coordinates.\n * = 0.5 * triangleSize / quadWidth, corrects for quad aspect ratio.\n */\nuniform float uTriangleHalfBaseUV;\n\nvarying vec2 vUv;\nvarying float vOpacity;\nflat varying vec4 vDigits;\n\n/*\n * Median of three values for MSDF sampling.\n */\nfloat median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n}\n\nvoid main() {\n float alpha = 0.0;\n vec3 color = vec3(0.0);\n\n if (vUv.y >= uLabelStart) {\n /* ââ Label region: MSDF text with proportional spacing ââ */\n vec2 labelUv = vec2(vUv.x, (vUv.y - uLabelStart) / (1.0 - uLabelStart));\n\n /* Look up xadvance fraction for each digit position in a single loop */\n int d0 = int(vDigits.x);\n int d1 = int(vDigits.y);\n int d2 = int(vDigits.z);\n int d3 = int(vDigits.w);\n float adv0 = 0.0;\n float adv1 = 0.0;\n float adv2 = 0.0;\n float adv3 = 0.0;\n for (int i = 0; i < 10; i++) {\n float xa = uGlyphXAdvance[i];\n if (i == d0) adv0 = xa;\n if (i == d1) adv1 = xa;\n if (i == d2) adv2 = xa;\n if (i == d3) adv3 = xa;\n }\n\n /* Total proportional width as fraction of monospace (max) width */\n float totalAdv = adv0;\n if (uDigitCount > 1.5) totalAdv += adv1;\n if (uDigitCount > 2.5) totalAdv += adv2;\n if (uDigitCount > 3.5) totalAdv += adv3;\n\n /* Center text within quad\'s label region */\n float textFrac = totalAdv / uDigitCount;\n float offsetX = (1.0 - textFrac) * 0.5;\n\n /* Remap label X to text-local coordinate (in xadvance-fraction units) */\n float textX = (labelUv.x - offsetX) * uDigitCount;\n\n /* Find which digit cell contains this fragment */\n int di = -1;\n float localX = 0.0;\n float cumAdv = 0.0;\n\n if (textX >= cumAdv && textX < cumAdv + adv0) {\n di = d0;\n localX = (textX - cumAdv) / adv0;\n }\n cumAdv += adv0;\n if (di < 0 && uDigitCount > 1.5 && textX >= cumAdv && textX < cumAdv + adv1) {\n di = d1;\n localX = (textX - cumAdv) / adv1;\n }\n cumAdv += adv1;\n if (di < 0 && uDigitCount > 2.5 && textX >= cumAdv && textX < cumAdv + adv2) {\n di = d2;\n localX = (textX - cumAdv) / adv2;\n }\n cumAdv += adv2;\n if (di < 0 && uDigitCount > 3.5 && textX >= cumAdv && textX < cumAdv + adv3) {\n di = d3;\n localX = (textX - cumAdv) / adv3;\n }\n\n if (di >= 0) {\n /* Fetch glyph metrics from uniform arrays */\n vec4 rect;\n vec2 cellX;\n for (int i = 0; i < 10;
436 i++) {\n if (i == di) {\n rect = uGlyphRect[i];\n cellX = uGlyphCellX[i];\n }\n }\n\n /* Check if fragment is within glyph bounds */\n if (localX >= cellX.x && localX <= cellX.y && labelUv.y >= uGlyphCellY.x && labelUv.y <= uGlyphCellY.y) {\n /* Map cell-local UV to normalized glyph UV (0-1) */\n float normX = (localX - cellX.x) / (cellX.y - cellX.x);\n float normY = (labelUv.y - uGlyphCellY.x) / (uGlyphCellY.y - uGlyphCellY.x);\n\n /* Map to atlas UV within bounded glyph rect */\n vec2 atlasUv = vec2(mix(rect.x, rect.z, normX), mix(rect.y, rect.w, normY));\n\n /* Screen pixel range for MSDF anti-aliasing */\n vec2 unitRange = vec2(uPxRange) / uTexSize;\n vec2 screenTexSize = vec2(1.0) / fwidth(atlasUv);\n float spr = max(0.5 * dot(unitRange, screenTexSize), 1.0);\n\n vec3 s = texture2D(tMsdf, atlasUv).rgb;\n float sigDist = median(s.r, s.g, s.b) - 0.5;\n float pxDist = sigDist * spr;\n alpha = clamp(pxDist + 0.5, 0.0, 1.0);\n color = uLabelColor;\n }\n }\n } else if (vUv.y < uLabelTriangleSplit) {\n /* ââ Triangle region: inverted equilateral triangle (â¼) ââ */\n vec2 triUv = vec2(vUv.x, vUv.y / uLabelTriangleSplit);\n\n /*\n * Triangle with base at top, tip at bottom-center.\n * Half-base corrected for quad aspect ratio via uTriangleHalfBaseUV.\n * Signed distance from each edge (positive = inside).\n */\n float hb = uTriangleHalfBaseUV;\n float leftEdge = triUv.x - (0.5 - hb * triUv.y);\n float rightEdge = 0.5 + hb * triUv.y - triUv.x;\n float topEdge = 1.0 - triUv.y;\n float d = min(min(leftEdge, rightEdge), topEdge);\n\n /* Anti-aliased edge */\n alpha = smoothstep(0.0, fwidth(d) * 1.5, d);\n color = uTriangleColor;\n }\n /* Gap region (between triangle and label) falls through with alpha = 0 */\n\n /* Apply trigger + attenuation opacity */\n alpha *= vOpacity;\n\n if (alpha < 0.001) discard;\n\n gl_FragColor = vec4(color, alpha);\n #include <logdepthbuf_fragment>\n}\n',uniforms:{tMsdf:new i.nc$(n),uPxRange:new i.nc$(r),uTexSize:new i.nc$(s),uTriangleColor:new i.nc$(new i.Q1f(c.triangleColor)),uLabelColor:new i.nc$(new i.Q1f(c.labelColor)),uLabelTriangleSplit:new i.nc$(.5),uLabelStart:new i.nc$(.5),uDigitCount:new i.nc$(3),uTriangleHalfBaseUV:new i.nc$(.5),uGlyphRect:new i.nc$(Array.from({length:10},()=>new i.IUQ)),uGlyphCellX:new i.nc$(Array.from({length:10},()=>new i.I9Y)),uGlyphXAdvance:new i.nc$(Array(10).fill(0)),uGlyphCellY:new i.nc$(new i.I9Y),uCameraPosition:new i.nc$(new i.Pq0),uPulseCenter:new i.nc$(new i.Pq0),uPulseRadius:new i.nc$(0),uPulseOpacity:new i.nc$(0),uPulseDecayWidth:new i.nc$(y.u.gis.groundEffect.pulseDecayWidth),uPulseEdgeBoost:new i.nc$(c.pulseEdgeBoost),uAgentPositions:new i.nc$(Array.from({length:10},()=>new i.Pq0)),uAgentFades:new i.nc$(new Float32Array(10)),uAgentThumbFades:new i.nc$(Array(10).fill(1)),uAgentProximityNear:new i.nc$(c.proximityNear),uAgentProximityFar:new i.nc$(c.proximityFar),uAttenuationNear:new i.nc$(f.attenuationDistanceNear),uAttenuationFar:new i.nc$(f.attenuationDistanceFar),uAttenuationMin:new i.nc$(f.attenuationDistanceMin),uProximityNear:new i.nc$(f.attenuationProximityNear),uProximityFar:new i.nc$(f.attenuationProximityFar),uDataScale:new i.nc$(y.u.gis.dataScale),uYOffset:new i.nc$(c.yOffset),uTransitionProgress:new i.nc$(0)},...l}),[])});et.displayName="ProductGISGridAnnotationMaterial";let en=y.u.gis.segmentGraph.vertexMergeEpsilon,er=(e,t,n)=>{let r=1/en;return`${Math.round(e*r)},${Math.round(t*r)},${Math.round(n*r)}`},ea=(e,t,n)=>{let r=3*t,a=3*n,o=e[a]-e[r],i=e[a+2]-e[r+2];return Math.sqrt(o*o+i*i)},eo=(e,t,n)=>{for(let r=0;r<n.length;r++){let a=n[r];if(e>=a.minX&&e<=a.maxX&&t>=a.minZ&&t<=a.maxZ)return!0}return!1},ei=(e,t,n,r)=>{let{adjacency:a,positions:o,edgeWeights:i}=e,s=y.u.gis.segmentGraph.thumbPenalty,l=y.u.gis.segmentGraph.longEdgeThreshold,u=y.u.gis.segmentGraph.longEdgePenalty,c=y.u.gis.segmentGraph.sharpTurnPenalty,f=new Map,d=new Map;f.set(t,0);let m=[[0,t]];for(;m.length>0;){let e=m[0],t=m.pop();if(m.length>0){m[0]=t;let e=0;for(;;){let t=e,n=2*e+1,r=2*e+2;if(n<m.length&&m[n][0]<m[t][0]&&(t=n),r<m.length&&m[r][0]<m[t][0]&&(t=r),t===e)break;let a=m[e];m[e]=m[t],m[t]=a,e=t}}let[p,h]=e;if(h===n)break;if(p>
436(f.get(h)??1/0))continue;let g=a.get(h);if(g)for(let e=0;e<g.length;e++){let t=g[e],n=i[t.segIdx];n>l&&(n+=u);let a=d.get(h);if(a){let e=3*a.from,r=3*h,i=3*t.to,s=o[r]-o[e],l=o[r+2]-o[e+2],u=o[i]-o[r],f=o[i+2]-o[r+2],d=Math.sqrt(s*s+l*l),m=Math.sqrt(u*u+f*f);d>.001&&m>.001&&(s*u+l*f)/(d*m)<0&&(n+=c)}let v=3*t.to;eo(o[v],o[v+2],r)&&(n+=s);let x=p+n;if(x<(f.get(t.to)??1/0)){f.set(t.to,x),d.set(t.to,{from:h,segIdx:t.segIdx}),m.push([x,t.to]);let e=m.length-1;for(;e>0;){let t=e-1>>1;if(m[t][0]<=m[e][0])break;let n=m[t];m[t]=m[e],m[e]=n,e=t}}}}if(!d.has(n)&&t!==n)return null;let p=[],h=[],g=n;for(;g!==t;){p.push(g);let e=d.get(g);if(!e)return null;h.push(e.segIdx),g=e.from}p.push(t),p.reverse(),h.reverse();let v=0;for(let e=0;e<h.length;e++)v+=i[h[e]];return{route:p,segIndices:h,totalLength:v}},es=(e,t)=>e.map(e=>({minX:e.x-t,maxX:e.x+t,minZ:e.z-t,maxZ:e.z+t}));var el=((r=el||{})[r.SPAWN_DOT=0]="SPAWN_DOT",r[r.SPAWN_RING=1]="SPAWN_RING",r[r.MOVING=2]="MOVING",r[r.DIE_RING=3]="DIE_RING",r[r.DIE_DOT=4]="DIE_DOT",r[r.DEAD=5]="DEAD",r);let eu=y.u.gis.gridAnnotation,ec=y.u.gis.dataScale,ef=y.u.gis.pathFinder.thumb.margin,ed=y.u.gis.pathFinder.count,em=eu.vertexQuantizationInv,ep=(0,o.forwardRef)((e,t)=>{let{gisMeshGeometry:n,getThumbPositions:r,agents:s}=e,{fonts:l}=(0,o.useContext)(v.DM),u=l.USansRgBd,f=(0,o.useRef)(null),d=(0,o.useRef)(null),m=(0,o.useRef)(null),p=(0,o.useRef)(!1),h=(0,o.useRef)(0),g=(0,o.useRef)(null),x=(0,o.useRef)(null),y=(0,o.useRef)(new Float32Array(ed)),w=(0,o.useRef)(new Float32Array(ed).fill(1));(0,o.useEffect)(()=>{if(!u)return;let e=n.current;if(!e)return;let t=u.fontFile,r=t.common.scaleW,a=t.common.scaleH,o=t.common.lineHeight,s=(e=>{let t=e.getAttribute("position");if(!t)return[];let n=new Map;for(let e=0;e<t.count;e++){let r=t.getX(e),a=t.getY(e),o=t.getZ(e),s=Math.round(r*em),l=Math.round(a*em),u=Math.round(o*em),c=`${s},${l},${u}`;n.has(c)||n.set(c,new i.Pq0(r,a,o))}let r=Array.from(n.values());return r.sort((e,t)=>e.x!==t.x?e.x-t.x:e.z-t.z),r})(e),l=s.length;if(h.current=l,0===l)return;(0,q.Rm)("yellowgreen","\uD83D\uDCCD",`Grid annotation: ${l} intersections`);let c=Math.max(3,String(l).length),p=Array.from({length:10},()=>new i.IUQ),v=Array.from({length:10},()=>new i.I9Y),y=Array(10).fill(0),w=new i.I9Y,R=0,C=!1;for(let e=48;e<=57;e++){let n=e-48,i=t.chars.find(t=>t.id===e);i&&(i.xadvance>R&&(R=i.xadvance),p[n].set(i.x/r,1-(i.y+i.height)/a,(i.x+i.width)/r,1-i.y/a),C||(w.set(1-(i.yoffset+i.height)/o,1-i.yoffset/o),C=!0))}for(let e=48;e<=57;e++){let n=e-48,r=t.chars.find(t=>t.id===e);r&&(y[n]=r.xadvance/R,v[n].set(r.xoffset/r.xadvance,(r.xoffset+r.width)/r.xadvance))}let b=eu.labelFontSize/o,S=eu.triangleSize*(Math.sqrt(3)/2),T=eu.labelFontSize,P=R*c*b,M=S+eu.triangleLabelGap+T,A=Math.max(P,eu.triangleSize),D=S/M,_=(S+eu.triangleLabelGap)/M,I=.5*eu.triangleSize/A,E=new i.bdM(A,M);E.translate(0,.5*M,0);let U=new Float32Array(3*l),O=new Float32Array(l),F=new Float32Array(4*l);for(let e=0;e<l;e++){let t=s[e];U[3*e]=t.x,U[3*e+1]=t.y,U[3*e+2]=t.z;let n=String(e+1).padStart(c,"0");for(let t=0;t<Math.min(c,4);t++)F[4*e+t]=n.charCodeAt(t)-48}E.setAttribute("aInstancePosition",new i.uWO(U,3)),E.setAttribute("aVisibility",new i.uWO(O,1)),E.setAttribute("aDigits",new i.uWO(F,4));let N=new i.V9B({visible:!1}),L=new i.ZLX(E,N,l);L.frustumCulled=!1,L.renderOrder=eu.renderOrder;let z=new i.kn4;for(let e=0;e<l;e++)L.setMatrixAt(e,z);return L.instanceMatrix.needsUpdate=!0,L.layers.set(0),f.current.add(L),m.current=L,g.current=U,x.current=O,requestAnimationFrame(()=>{if(d.current&&m.current){m.current.material=d.current.material;let e=d.current.material.uniforms;e.uLabelTriangleSplit.value=D,e.uLabelStart.value=_,e.uDigitCount.value=c,e.uTriangleHalfBaseUV.value=I;let t=e.uGlyphRect.value,n=e.uGlyphCellX.value,r=e.uGlyphXAdvance.value;for(let e=0;e<10;e++)t[e].copy(p[e]),n[e].copy(v[e]),r[e]=y[e];e.uGlyphCellY.value.copy(w)}}),()=>{f.current?.remove(L),E.dispose(),N.dispose(),L.dispose(),m.current=null,g.current=null,x.current=null,h.current=0}},[u,n]),(0,c.Ql)((e,t)=>{if(!p.current||!m.current||!d.current)return;let n=d.current.material,r=1e3*t;n.uniforms.uCameraPosition.value.copy(e.camera.position);let a=n.uniforms.uAgentPositions.value,o=y.current,i=w.current,l=eu.proximityFadeInMs,u=eu.proximityFadeOutMs;for(let e=0;e<ed;e++){let t=s[e];if(!t)continue;let n=t.phase===el.MOVING;n?(o[e]<1&&(o[e]=Math.min(1,o[e]+r/l)),a[e].copy(t.position)):!n&&o[e]>0&&(o[e]=Math.max(0,o[e]-r/u)),i[e]=t.thumbFade}n.uniforms.uAgentFades.value=Array.from(o),n.uniforms.uAgentThumbFades.value=Array.from(i)});let R=()=>{p.current=!0,d.current&&(d.current.material.uniforms.uTransitionProgress.value=1);let e=x.current,t=g.current,n=h.current;if(e&&t&&m.current){let a=es(r(),ef),o=m.current.matrixWorld,s=new i.Pq0;for(let r=0;r<n;r++)s.set(t[3*r]*ec,0,t[3*r+2]*ec),s.applyMatrix4(o),eo(s.x,s.z,a)?e[r]=0:e[r]=1;m.current.geometry.attributes.aVisibility.needsUpdate=!0}},C=(e,t,n)=>{if(!d.current)return;let r=d.current.material.uniforms;r.uPulseCenter.value.copy(e),r.uPulseRadius.value=t,r.uPulseOpacity.value=n},b=()=>{p.current=!1,d.current&&(d.current.material.uniforms.uTransitionProgress.value=0);let e=x.current,t=h.current;if(e){for(let n=0;n<t;n++)e[n]=0;m.current&&(m.current.geometry.attributes.aVisibility.needsUpdate=!0)}};return(0,o.useImperativeHandle)(t,()=>({present:R,dismiss:b,syncPulse:C,group:f.current})),(0,a.jsx)("group",{ref:f,children:u&&(0,a.jsx)(et,{ref:d,fontTexture:u.fontTexture,pxRange:u.fontFile.distanceField?.distanceRange??4,texSize:new i.I9Y(u.fontFile.common.scaleW,u.fontFile.common.scaleH)})})});ep.displayName="ProductGISGridAnnotationRenderer";let eh=y.u.gis.pathFinder.count,eg=y.u.gis.pathFinder.annotation,ev=y.u.gis.trace.attenuation,ex=eg.atlasColumns,ey=Math.ceil(eh/ex),ew=1/ex,eR=1/ey,eC=(eg.color>>16&255)/255,eb=(eg.color>>8&255)/255,eS=(255&eg.color)/255,eT=`#${eg.color.toString(16).padStart(6,"0")}
436`,eP=y.u.gis.pathFinder.dot.yOffset,eM=new i.kn4,eA=new i.kn4().makeScale(0,0,0),eD=(e,t,n,r,a,o,i,s,l,u,c,f,d,m,p,h,g)=>{let v,x,y=t.position.x,w=t.position.y,R=t.position.z,C=t.phase===el.MOVING,b=t.phase===el.DIE_RING||t.phase===el.DIE_DOT;if(C&&!n.wasMoving&&(n.followX=y,n.followY=w,n.followZ=R,n.labelFollowX=y,n.labelFollowZ=R),C?n.opacity=Math.min(1,n.opacity+a*r):b&&(n.opacity=Math.max(0,n.opacity-o*r)),n.wasMoving=C,n.opacity<eg.opacityThreshold){let t=4*e;return f[4*t+3]=0,f[(t+1)*4+3]=0,f[(t+2)*4+3]=0,f[(t+3)*4+3]=0,d[e]=0,m[e]=0,p.endpointOpacities[2*e]=0,p.endpointOpacities[2*e+1]=0,p.circleMesh.setMatrixAt(e,eA),p.endpointMesh.setMatrixAt(2*e,eA),p.endpointMesh.setMatrixAt(2*e+1,eA),p.labelMesh.setMatrixAt(e,eA),{visible:!1,atlasUpdated:!1}}let S=Math.min(1,i*r);n.followX+=(y-n.followX)*S,n.followY+=(w-n.followY)*S,n.followZ+=(R-n.followZ)*S,n.labelFollowX+=(n.followX-n.labelFollowX)*S,n.labelFollowZ+=(n.followZ-n.labelFollowZ)*S;let T=n.opacity*t.thumbFade,P=w+eP,M=n.followY+eP+s,A=Math.atan2(l-n.labelFollowX,u-n.labelFollowZ),D=Math.cos(A),_=Math.sin(A),I=.5*p.labelWorldWidth,E=Math.max(-I,Math.min(I,(n.followX-n.labelFollowX)*D+-((n.followZ-n.labelFollowZ)*_))),U=n.labelFollowX+D*E,O=n.labelFollowZ+-_*E,F=4*e,N=F+1,L=F+2,z=F+3;c[3*F]=y,c[3*F+1]=P,c[3*F+2]=R,c[3*N]=U,c[3*N+1]=M,c[3*N+2]=O;let V=n.labelFollowX-D*I,k=n.labelFollowZ+_*I,G=n.labelFollowX+D*I,B=n.labelFollowZ-_*I;c[3*L]=V,c[3*L+1]=M,c[3*L+2]=k,c[3*z]=G,c[3*z+1]=M,c[3*z+2]=B;let j=T*eg.connectorOpacity;for(let e=0;e<2;e++){let t=(F+e)*4;f[t]=eC,f[t+1]=eb,f[t+2]=eS,f[t+3]=j}let $=T*eg.bottomLineOpacity;for(let e=2;e<4;e++){let t=(F+e)*4;f[t]=eC,f[t+1]=eb,f[t+2]=eS,f[t+3]=$}eM.makeRotationY(A),eM.setPosition(U,M,O),p.circleMesh.setMatrixAt(e,eM),d[e]=T*eg.dotOpacity;let W=T*eg.endpointOpacity,H=2*e,Y=H+1;eM.makeRotationY(A),eM.setPosition(V,M,k),p.endpointMesh.setMatrixAt(H,eM),p.endpointOpacities[H]=W,eM.makeRotationY(A),eM.setPosition(G,M,B),p.endpointMesh.setMatrixAt(Y,eM),p.endpointOpacities[Y]=W;let X=M+eg.bottomLineGap+.5*eg.labelWorldHeight;eM.makeRotationY(A),eM.setPosition(n.labelFollowX,X,n.labelFollowZ),p.labelMesh.setMatrixAt(e,eM),m[e]=T*eg.labelOpacity;let q=`NODE-${String(t.nodeIndex+1).padStart(2,"0")}`,Z=`X:${Math.round(y)} Y:${Math.round(R)} Z:${Math.round(w)}`,Q=`HDG: ${((v=180*t.heading/Math.PI%360)<0&&(v+=360),0===(x=Math.round(v))||360===x?"N":90===x?"E":180===x?"S":270===x?"W":45===x?"NE":135===x?"SE":225===x?"SW":315===x?"NW":v>0&&v<90?`N${x}\u00b0E`:v>90&&v<180?`S${180-x}\u00b0E`:v>180&&v<270?`S${x-180}\u00b0W`:`N${360-x}\u00b0W`)}`,K=`${q}|${Z}|${Q}`,J=!1;if(g&&h[e]!==K){var ee,et,en;let t,n,r,a,o,i,s;ee=p.atlasCtx,et=p.tileWidth,en=p.tileHeight,t=Math.floor(e/ex),n=e%ex*et,r=t*en,ee.clearRect(n,r,et,en),ee.textAlign="left",ee.font=`${eg.nodeFontSize}px USansRgBd`,a=ee.measureText(q).width+2*eg.nodePlateMarginX,o=eg.nodeFontSize+eg.nodePlateMarginTop+eg.nodePlateMarginBottom,ee.fillStyle=eT,ee.fillRect(n,r,a,o),ee.fillStyle="black",ee.textBaseline="top",ee.fillText(q,n+eg.nodePlateMarginX,r+eg.nodePlateMarginTop),ee.textBaseline="top",ee.fillStyle=eT,i=r+o+eg.nodeGap,ee.font=`${eg.coordFontSize}px USansRgBd`,ee.fillText(Z,n+eg.textPadding,i),s=i+eg.coordFontSize+eg.dirGap,ee.font=`${eg.dirFontSize}px USansRgBd`,ee.fillText(Q,n+eg.textPadding,s),h[e]=K,J=!0}return{visible:!0,atlasUpdated:J}},e_=()=>new i.BKk({uniforms:{uCameraPosition:{value:new i.Pq0},uColor:{value:new i.Q1f(eg.color)},distanceNear:{value:ev.distanceNear},distanceFar:{value:ev.distanceFar},distanceMin:{value:ev.distanceMin},proximityFar:{value:ev.proximityFar},proximityNear:{value:ev.proximityNear}},vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Distance and proximity attenuation uniforms.\n */\nuniform float distanceNear;\nuniform float distanceFar;\nuniform float distanceMin;\nuniform float proximityFar;\nuniform float proximityNear;\n\nattribute float aOpacity;\n\nvarying float vOpacity;\nvarying float vAttenuation;\nvarying vec2 vUv;\n\nvoid main() {\n vOpacity = aOpacity;\n vUv = uv;\n\n vec4 worldPos = modelMatrix * instanceMatrix * vec4(position, 1.0
436);\n float dist = distance(worldPos.xyz, uCameraPosition);\n float farFade = mix(1.0, distanceMin, smoothstep(distanceNear, distanceFar, dist));\n float nearFade = smoothstep(proximityNear, proximityFar, dist);\n vAttenuation = farFade * nearFade;\n\n gl_Position = projectionMatrix * modelViewMatrix * instanceMatrix * vec4(position, 1.0);\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <logdepthbuf_pars_fragment>\n\nuniform vec3 uColor;\n\nvarying float vOpacity;\nvarying float vAttenuation;\nvarying vec2 vUv;\n\nvoid main() {\n float a = vOpacity * vAttenuation;\n if (a < 0.001) discard;\n float dist = length(vUv - 0.5) * 2.0;\n if (dist > 1.0) discard;\n gl_FragColor = vec4(uColor, a * smoothstep(1.0, 0.8, dist));\n #include <logdepthbuf_fragment>\n}\n",transparent:!0,depthTest:!0,depthWrite:!1,blending:i.EZo}),eI=(0,o.forwardRef)((e,t)=>{let{agents:n}=e,r=(0,o.useRef)(null),s=(0,o.useRef)(null),l=(0,o.useRef)(!1),u=(0,o.useRef)(!1),f=(0,o.useRef)(Array(eh).fill("")),d=(0,o.useRef)(0),m=(0,o.useRef)(Array.from({length:eh},()=>({followX:0,followY:0,followZ:0,labelFollowX:0,labelFollowZ:0,opacity:0,wasMoving:!1})));(0,o.useEffect)(()=>{let e=[],t=document.createElement("canvas").getContext("2d");t.font=`${eg.coordFontSize}px USansRgBd`;let n=t.measureText("X:-0000 Y:0000 Z:000").width,a=eg.nodeFontSize+eg.nodePlateMarginTop+eg.nodePlateMarginBottom,o=Math.ceil(n+2*eg.textPadding),l=Math.ceil(a+eg.nodeGap+eg.coordFontSize+eg.dirGap+eg.dirFontSize),u=eg.labelWorldHeight*(o/l),c=document.createElement("canvas");c.width=ex*o,c.height=ey*l;let f=c.getContext("2d"),d=new i.GOR(c);d.generateMipmaps=!0,d.minFilter=i.$_I,d.magFilter=i.k6q,e.push(d);let m=new i.LoY,p=new Float32Array(4*eh*3),h=new Float32Array(4*eh*4);m.setAttribute("position",new i.THS(p,3)),m.setAttribute("aColor",new i.THS(h,4));let g=new i.BKk({uniforms:{uCameraPosition:{value:new i.Pq0},distanceNear:{value:ev.distanceNear},distanceFar:{value:ev.distanceFar},distanceMin:{value:ev.distanceMin},proximityFar:{value:ev.proximityFar},proximityNear:{value:ev.proximityNear}},vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Distance and proximity attenuation uniforms.\n */\nuniform float distanceNear;\nuniform float distanceFar;\nuniform float distanceMin;\nuniform float proximityFar;\nuniform float proximityNear;\n\nattribute vec4 aColor;\n\nvarying vec4 vColor;\nvarying float vAttenuation;\n\nvoid main() {\n vColor = aColor;\n\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n float dist = distance(worldPos.xyz, uCameraPosition);\n float farFade = mix(1.0, distanceMin, smoothstep(distanceNear, distanceFar, dist));\n float nearFade = smoothstep(proximityNear, proximityFar, dist);\n vAttenuation = farFade * nearFade;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <logdepthbuf_pars_fragment>\n\nvarying vec4 vColor;\nvarying float vAttenuation;\n\nvoid main() {\n float a = vColor.a * vAttenuation;\n if (a < 0.001) discard;\n gl_FragColor = vec4(vColor.rgb, a);\n #include <logdepthbuf_fragment>\n}\n",transparent:!0,depthTest:!0,depthWrite:!1,blending:i.EZo}),v=new i.DXC(m,g);v.frustumCulled=!1,v.renderOrder=303,e.push(m,g);let x=2*eg.dotRadius,y=new i.bdM(x,x),w=new Float32Array(eh);y.setAttribute("aOpacity",new i.uWO(w,1));let R=e_(),C=new i.ZLX(y,R,eh);C.frustumCulled=!1,C.renderOrder=303;for(let e=0;e<eh;e++)C.setMatrixAt(e,eA);C.instanceMatrix.needsUpdate=!0,e.push(y,R);let b=2*eg.endpointRadius,S=new i.bdM(b,b),T=new Float32Array(2*eh);S.setAttribute("aOpacity",new i.uWO(T,1));let P=e_(),M=new i.ZLX(S,P,2*eh);M.frustumCulled=!1,M.renderOrder=303;for(let e=0;e<2*eh;e++)M.setMatrixAt(e,eA);M.instanceMatrix.needsUpdate=!0,e.push(S,P);let A=new i.bdM(u,eg.labelWorldHeight),D=new Float32Array(eh),_=new Float32Array(2*eh);for(let e=0;e<eh;e++)_[2*e]=e%ex*ew,_[2*e+1]=(ey-1-Math.floor(e/ex))*eR;A.setAttribute("aOpacity",new i.uWO(D,1)),A.setAttribute("aUvOffset",new i.uWO(_,2));let I=new i.BKk({uniforms:{atlas:{value:d},uCameraPosition:{value:new i.Pq0},distanceNear:{value:ev.distanceNear},distanceFar:{value:ev.distanceFar},distanceMin:{value:ev.distanceMin},proximityFar:{value:ev.proximityFar},proximityNear:{value:ev.proximityNear},tileSize:{value:new i.I9Y(ew,eR)}},vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Distance and proximity attenuation uniforms.\n */\nuniform float distanceNear;\nuniform float distanceFar;\nuniform float distanceMin;\nuniform float proximityFar;\nuniform float proximityNear;\n\n/*\n * Atlas tile size in UV space (vec2(1/cols, 1/rows)).\n */\nuniform vec2 tileSize;\n\nattribute float aOpacity;\nattribute vec2 aUvOffset;\n\nvarying float vOpacity;\nvarying float vAttenuation;\nvarying vec2 vAtlasUv;\n\nvoid main() {\n vOpacity = aOpacity;\n vAtlasUv = uv * tileSize + aUvOffset;\n\n vec4 worldPos = modelMatrix * instanceMatrix * vec4(position, 1.0
436);\n float dist = distance(worldPos.xyz, uCameraPosition);\n float farFade = mix(1.0, distanceMin, smoothstep(distanceNear, distanceFar, dist));\n float nearFade = smoothstep(proximityNear, proximityFar, dist);\n vAttenuation = farFade * nearFade;\n\n gl_Position = projectionMatrix * modelViewMatrix * instanceMatrix * vec4(position, 1.0);\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <logdepthbuf_pars_fragment>\n\nuniform sampler2D atlas;\n\nvarying float vOpacity;\nvarying float vAttenuation;\nvarying vec2 vAtlasUv;\n\nvoid main() {\n float a = vOpacity * vAttenuation;\n if (a < 0.001) discard;\n vec4 texel = texture2D(atlas, vAtlasUv);\n if (texel.a < 0.01) discard;\n gl_FragColor = vec4(texel.rgb, texel.a * a);\n #include <logdepthbuf_fragment>\n}\n",transparent:!0,depthTest:!0,depthWrite:!1,blending:i.NTi}),E=new i.ZLX(A,I,eh);E.frustumCulled=!1,E.renderOrder=303;for(let e=0;e<eh;e++)E.setMatrixAt(e,eA);return E.instanceMatrix.needsUpdate=!0,e.push(A,I),r.current.add(v,C,M,E),s.current={lineMesh:v,linePositions:p,lineColors:h,circleMesh:C,circleOpacities:w,endpointMesh:M,endpointOpacities:T,labelMesh:E,labelOpacities:D,atlasCtx:f,atlasTexture:d,tileWidth:o,tileHeight:l,labelWorldWidth:u,disposables:e},()=>{for(let t of(r.current?.remove(v,C,M,E),e))t.dispose();s.current=null}},[]),(0,c.Ql)((e,t)=>{if(!l.current)return;let r=s.current;if(!r)return;let a=e.camera.position;r.lineMesh.material.uniforms.uCameraPosition.value.copy(a),r.circleMesh.material.uniforms.uCameraPosition.value.copy(a),r.endpointMesh.material.uniforms.uCameraPosition.value.copy(a),r.labelMesh.material.uniforms.uCameraPosition.value.copy(a);let o=e.camera.position.x,i=e.camera.position.z,c=m.current,p=r.linePositions,h=r.lineColors,g=r.circleOpacities,v=r.labelOpacities,x=f.current,y=1e3/eg.fadeInDuration,w=1e3/eg.fadeOutDuration,R=eg.lerpFactor,C=eg.connectorLength,b=!1,S=!1,T=1/eg.atlasUpdateHz;d.current+=t;let P=d.current>=T;P&&(d.current=0);for(let e=0;e<eh;e++){let a=n[e],s=c[e];if(!a||a.phase===el.DEAD){s.opacity=0,s.wasMoving=!1;let t=4*e;h[4*t+3]=0,h[(t+1)*4+3]=0,h[(t+2)*4+3]=0,h[(t+3)*4+3]=0,g[e]=0,v[e]=0,r.endpointOpacities[2*e]=0,r.endpointOpacities[2*e+1]=0,r.circleMesh.setMatrixAt(e,eA),r.endpointMesh.setMatrixAt(2*e,eA),r.endpointMesh.setMatrixAt(2*e+1,eA),r.labelMesh.setMatrixAt(e,eA);continue}let l=eD(e,a,s,t,y,w,R,C,o,i,p,h,g,v,r,x,P);l.visible&&(S=!0),l.atlasUpdated&&(b=!0)}if(S||u.current||b){let e=r.lineMesh.geometry;e.attributes.position.needsUpdate=!0,e.attributes.aColor.needsUpdate=!0,r.circleMesh.instanceMatrix.needsUpdate=!0,r.circleMesh.geometry.attributes.aOpacity.needsUpdate=!0,r.endpointMesh.instanceMatrix.needsUpdate=!0,r.endpointMesh.geometry.attributes.aOpacity.needsUpdate=!0,r.labelMesh.instanceMatrix.needsUpdate=!0,r.labelMesh.geometry.attributes.aOpacity.needsUpdate=!0,b&&(r.atlasTexture.needsUpdate=!0)}u.current=S});let p=()=>{l.current=!0},h=()=>{l.current=!1;let e=s.current;if(!e)return;for(let t=0;t<eh;t++){let n=4*t;e.lineColors[4*n+3]=0,e.lineColors[(n+1)*4+3]=0,e.lineColors[(n+2)*4+3]=0,e.lineColors[(n+3)*4+3]=0,e.circleOpacities[t]=0,e.endpointOpacities[2*t]=0,e.endpointOpacities[2*t+1]=0,e.labelOpacities[t]=0,e.circleMesh.setMatrixAt(t,eA),e.endpointMesh.setMatrixAt(2*t,eA),e.endpointMesh.setMatrixAt(2*t+1,eA),e.labelMesh.setMatrixAt(t,eA)}e.lineMesh.geometry.attributes.aColor.needsUpdate=!0,e.circleMesh.geometry.attributes.aOpacity.needsUpdate=!0,e.circleMesh.instanceMatrix.needsUpdate=!0,e.endpointMesh.geometry.attributes.aOpacity.needsUpdate=!0,e.endpointMesh.instanceMatrix.needsUpdate=!0,e.labelMesh.geometry.attributes.aOpacity.needsUpdate=!0,e.labelMesh.instanceMatrix.needsUpdate=!0,f.current.fill("");let t=m.current;for(let e=0;e<t.length;e++){let n=t[e];n.opacity=0,n.wasMoving=!1}};return(0,o.useImperativeHandle)(t,()=>({present:p,dismiss:h,group:r.current})),(0,a.jsx)("group",{ref:r})});eI.displayName="ProductGISPathFinderAnnotationRenderer";let eE=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),r=y.u.gis.compass;return(0,o.useImperativeHandle)(t,()=>({material:n.current})),(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:n,transparent:!1,depthTest:!0,depthWrite:!0,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <ftmr_easings>\n\n/*\n * Transition progress (0â1, animated from JS).\n */\nuniform float uTransitionProgress;\n\n/*\n * Total present animation duration (ms).\n */\nuniform float uTotalDuration;\n\n/*\n * Per-group fade-in duration (ms).\n */\nuniform float uElementStaggerDuration;\n\n/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Attenuation near distance (full opacity).\n */\nuniform float uAttenuationNear;\n\n/*\n * Attenuation far distance (minimum opacity).\n */\nuniform float uAttenuationFar;\n\n/*\n * Minimum opacity at max distance.\n */\nuniform float uAttenuationMin;\n\n/*\n * Per-vertex transition delay (0-1).\n */\nattribute float delay;\n\n/*\n * Tick height in world units.\n */\nattribute float height;\n\n/*\n * 0=bottom, 1=top of tick line.\n */\nattribute float endpoint;\n\n/*\n * Local transition progress for fragment shader.\n */\nvarying float vOpacity;\n\n/*\n * Distance attenuation factor.\n */\nvarying float vAttenuation;\n\nvoid main() {\n /* Per-tick stagger (ms-based) */\n float elapsedMs = uTransitionProgress * uTotalDuration;\n float localProgress = clamp((elapsedMs - delay) / uElementStaggerDuration, 0.0, 1.0);\n localProgress = easeOutCubic(localProgress);\n\n /* Animate Y: bottom stays fixed, top grows upward */\n vec3 pos = position;\n pos.y += height * endpoint * localProgress;
436\n\n vec4 worldPos = modelMatrix * vec4(pos, 1.0);\n gl_Position = projectionMatrix * viewMatrix * worldPos;\n\n /* Distance attenuation */\n float dist = distance(worldPos.xyz, uCameraPosition);\n vAttenuation = mix(uAttenuationMin, 1.0, 1.0 - smoothstep(uAttenuationNear, uAttenuationFar, dist));\n vOpacity = localProgress;\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <common>\n#include <logdepthbuf_pars_fragment>\n\n/*\n * Global opacity (for dismiss fade-out).\n */\nuniform float uOpacity;\n\n/*\n * Draw color.\n */\nuniform vec3 uColor;\n\n/*\n * Local transition opacity from vertex shader.\n */\nvarying float vOpacity;\n\n/*\n * Distance attenuation factor.\n */\nvarying float vAttenuation;\n\nvoid main() {\n float visibility = vOpacity * uOpacity;\n if (visibility < 0.001) discard;\n gl_FragColor = vec4(uColor * vAttenuation * visibility, 1.0);\n #include <logdepthbuf_fragment>\n}\n",uniforms:{uTransitionProgress:new i.nc$(0),uTotalDuration:new i.nc$(12*r.elementStaggerDelay+r.elementStaggerDuration),uElementStaggerDuration:new i.nc$(r.elementStaggerDuration),uCameraPosition:new i.nc$(new i.Pq0),uAttenuationNear:new i.nc$(r.attenuationNear),uAttenuationFar:new i.nc$(r.attenuationFar),uAttenuationMin:new i.nc$(r.attenuationMin),uOpacity:new i.nc$(0),uColor:new i.nc$(new i.Q1f(r.tickColor))}}),[])});eE.displayName="ProductCompassMaterial";let eU=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),r=y.u.gis.compass;return(0,o.useImperativeHandle)(t,()=>({material:n.current})),(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:n,transparent:!1,depthTest:!0,depthWrite:!0,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <ftmr_easings>\n\n/*\n * Transition progress (0â1, animated from JS).\n */\nuniform float uTransitionProgress;\n\n/*\n * Total present animation duration (ms).\n */\nuniform float uTotalDuration;\n\n/*\n * Per-group fade-in duration (ms).\n */\nuniform float uElementStaggerDuration;\n\n/*\n * Dot size in pixels (screen-space).\n */\nuniform float uDotSize;\n\n/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Attenuation near distance (full opacity).\n */\nuniform float uAttenuationNear;\n\n/*\n * Attenuation far distance (minimum opacity).\n */\nuniform float uAttenuationFar;\n\n/*\n * Minimum opacity at max distance.\n */\nuniform float uAttenuationMin;\n\n/*\n * Per-vertex transition delay (0-1).\n */\nattribute float delay;\n\n/*\n * Tick height in world units (dot position = position.y + height).\n */\nattribute float height;\n\n/*\n * Local transition progress for fragment shader.\n */\nvarying float vOpacity;\n\n/*\n * Distance attenuation factor.\n */\nvarying float vAttenuation;\n\nvoid main() {\n /* Per-tick stagger (ms-based) */\n float elapsedMs = uTransitionProgress * uTotalDuration;\n float localProgress = clamp((elapsedMs - delay) / uElementStaggerDuration, 0.0, 1.0);\n localProgress = easeOutCubic(localProgress);\n\n /* Dot sits at top of tick line */\n vec3 pos = position;\n pos.y += height * localProgress;\n\n vec4 worldPos = modelMatrix * vec4(pos, 1.0);\n gl_Position = projectionMatrix * viewMatrix * worldPos;\n gl_PointSize = uDotSize;\n\n /* Distance attenuation */\n float dist = distance(worldPos.xyz, uCameraPosition);\n vAttenuation = mix(uAttenuationMin, 1.0, 1.0 - smoothstep(uAttenuationNear, uAttenuationFar, dist));\n vOpacity = localProgress;\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <common>\n#include <logdepthbuf_pars_fragment>\n\n/*\n * Global opacity (for dismiss fade-out).\n */\nuniform float uOpacity;\n\n/*\n * Draw color.\n */\nuniform vec3 uColor;\n\n/*\n * Local transition opacity from vertex shader.\n */\nvarying float vOpacity;\n\n/*\n * Distance attenuation factor.\n */\nvarying float vAttenuation;\n\nvoid main() {\n /* Circular mask from point UV */\n vec2 uv = gl_PointCoord * 2.0 - 1.0;\n if (length(uv) > 1.0) discard;\n\n float visibility = vOpacity * uOpacity;\n if (visibility < 0.001) discard;\n gl_FragColor = vec4(uColor * vAttenuation * visibility, 1.0);\n #include <logdepthbuf_fragment>\n}\n",uniforms:{uTransitionProgress:new i.nc$(0),uTotalDuration:new i.nc$(12*r.elementStaggerDelay+r.elementStaggerDuration),uElementStaggerDuration:new i.nc$(r.elementStaggerDuration),uDotSize:new i.nc$(r.dotSize),uCameraPosition:new i.nc$(new i.Pq0),uAttenuationNear:new i.nc$(r.attenuationNear),uAttenuationFar:new i.nc$(r.attenuationFar),uAttenuationMin:new i.nc$(r.attenuationMin),uOpacity:new i.nc$(0),uColor:new i.nc$(new i.Q1f(r.tickColor))}}),[])});eU.displayName="ProductCompassDotMaterial";let eO=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null),r=y.u.gis.compass;return(0,o.useImperativeHandle)(t,()=>({material:n.current})),(0,o.useMemo)(()=>{let e=r.arc;return(0,a.jsx)("shaderMaterial",{ref:n,transparent:!1,depthTest:!0,depthWrite:!0,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <ftmr_easings>\n\n/*\n * Transition progress (0â1, animated from JS).\n */\nuniform float uTransitionProgress;\n\n/*\n * Total present animation duration (ms).\n */\nuniform float uTotalDuration;\n\n/*\n * Per-group fade-in duration (ms).\n */\nuniform float uElementStaggerDuration;\n\n/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Attenuation near distance (full opacity).\n */\nuniform float uAttenuationNear;\n\n/*\n * Attenuation far distance (minimum opacity).\n */\nuniform float uAttenuationFar;\n\n/*\n * Minimum opacity at max distance.\n */\nuniform float uAttenuationMin;\n\n/*\n * Per-vertex transition delay (ms).\n */\nattribute float delay;\n\n/*\n * Per-vertex angle in degrees (for dashed pattern in fragment shader).\n */\nattribute float angle;\n\n/*\n * Per-vertex ring index (for dashed flag lookup in fragment shader).\n */\nattribute float ringIndex;\n\n/*\n * Local transition progress for fragment shader.\n */\nvarying float vOpacity;\n\n/*\n * Distance attenuation factor.\n */\nvarying float vAttenuation;\n\n/*\n * Pass angle to fragment shader.\n */\nvarying float vAngle;\n\n/*\n * Pass ring index to fragment shader.\n */\nvarying float vRingIndex;\n\nvoid main() {\n /* Per-segment stagger (ms-based) */\n float elapsedMs = uTransitionProgress * uTotalDuration;\n float localProgress = clamp((elapsedMs - delay) / uElementStaggerDuration, 0.0, 1.0);\n localProgress = easeOutCubic(localProgress);
436\n\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * viewMatrix * worldPos;\n\n /* Distance attenuation */\n float dist = distance(worldPos.xyz, uCameraPosition);\n vAttenuation = mix(uAttenuationMin, 1.0, 1.0 - smoothstep(uAttenuationNear, uAttenuationFar, dist));\n vOpacity = localProgress;\n vAngle = angle;\n vRingIndex = ringIndex;\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <common>\n#include <logdepthbuf_pars_fragment>\n\n/*\n * Global opacity (for dismiss fade-out).\n */\nuniform float uOpacity;\n\n/*\n * Draw color.\n */\nuniform vec3 uColor;\n\n/*\n * Dash angle in degrees (for dashed rings).\n */\nuniform float uDashAngle;\n\n/*\n * Gap angle in degrees (for dashed rings).\n */\nuniform float uGapAngle;\n\n/*\n * Per-ring dashed flags (0.0=solid, 1.0=dashed).\n */\nuniform float uRingDashedFlags[2];\n\n/*\n * Local transition opacity from vertex shader.\n */\nvarying float vOpacity;\n\n/*\n * Distance attenuation factor.\n */\nvarying float vAttenuation;\n\n/*\n * Angle in degrees from vertex shader.\n */\nvarying float vAngle;\n\n/*\n * Ring index from vertex shader.\n */\nvarying float vRingIndex;\n\nvoid main() {\n float visibility = vOpacity * uOpacity;\n if (visibility < 0.001) discard;\n\n /* Dashed pattern: discard gap fragments for dashed rings */\n int idx = int(vRingIndex + 0.5);\n float isDashed = uRingDashedFlags[idx];\n if (isDashed > 0.5) {\n float period = uDashAngle + uGapAngle;\n float phase = mod(vAngle, period);\n if (phase > uDashAngle) discard;\n }\n\n gl_FragColor = vec4(uColor * vAttenuation * visibility, 1.0);\n #include <logdepthbuf_fragment>\n}\n",uniforms:{uTransitionProgress:new i.nc$(0),uTotalDuration:new i.nc$(12*r.elementStaggerDelay+r.elementStaggerDuration),uElementStaggerDuration:new i.nc$(r.elementStaggerDuration),uCameraPosition:new i.nc$(new i.Pq0),uAttenuationNear:new i.nc$(r.attenuationNear),uAttenuationFar:new i.nc$(r.attenuationFar),uAttenuationMin:new i.nc$(r.attenuationMin),uOpacity:new i.nc$(0),uColor:new i.nc$(new i.Q1f(e.color)),uDashAngle:new i.nc$(e.dashAngle),uGapAngle:new i.nc$(e.gapAngle),uRingDashedFlags:new i.nc$([+!!e.innerRing.dashed,+!!e.outerRing.dashed])}})},[])});eO.displayName="ProductCompassArcMaterial";let eF=360/y.u.gis.compass.groupIntervalDeg,eN=y.u.gis.compass.groupIntervalDeg,eL=e=>{let t=y.u.gis.compass,n=Math.abs(e-180);n>180&&(n=360-n);let r=n/t.groupIntervalDeg;return t.elementStaggerDelay*r},ez=()=>{let e=y.u.gis.compass;return 12*e.elementStaggerDelay+e.elementStaggerDuration},eV=Math.PI/180,ek=(0,o.forwardRef)((e,t)=>{let{radius:n}=e,r=y.u.gis.compass.arc,s=(0,o.useRef)(null),l=ez(),[u,c]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>{if(!s.current)return;let t=e.value.progress;s.current.material.uniforms.uTransitionProgress.value=t,s.current.material.uniforms.uOpacity.value=1}}),[]),[f,d]=(0,m.zh)(()=>({from:{opacity:1},onChange:e=>{s.current&&(s.current.material.uniforms.uOpacity.value=e.value.opacity)}}),[]),p=(0,o.useCallback)(()=>{let e=[{radius:r.innerRing.radius*n,yOffset:r.innerRing.yOffset,lineWidth:r.innerRing.lineWidth,dashed:r.innerRing.dashed,ringIndex:0},{radius:r.outerRing.radius*n,yOffset:r.outerRing.yOffset,lineWidth:r.outerRing.lineWidth,dashed:r.outerRing.dashed,ringIndex:1}],t=r.segmentsPerDegree,a=360*t,o=2*a*e.length,s=new Float32Array(3*o),l=new Float32Array(o),u=new Float32Array(o),c=new Float32Array(o),f=0;for(let n of e)for(let e=0;e<a;e++){let r=e/t,a=(e+1)/t,o=r*eV,i=a*eV,d=Math.sin(o)*n.radius,m=Math.cos(o)*n.radius,p=Math.sin(i)*n.radius,h=Math.cos(i)*n.radius,g=eL((r+a)/2),v=f;s[3*v]=d,s[3*v+1]=n.yOffset,s[3*v+2]=m,l[v]=g,u[v]=r,c[v]=n.ringIndex;let x=f+1;s[3*x]=p,s[3*x+1]=n.yOffset,s[3*x+2]=h,l[x]=g,u[x]=a,c[x]=n.ringIndex,f+=2}let d=new i.LoY;return d.setAttribute("position",new i.THS(s,3)),d.setAttribute("delay",new i.THS(l,1)),d.setAttribute("angle",new i.THS(u,1)),d.setAttribute("ringIndex",new i.THS(c,1)),d},[n]),h=(e,t)=>{d.stop(!0),c.stop(!0),c.start({from:{progress:0},to:{progress:1},delay:t,config:{duration:l,easing:m.le.easeOutCubic}})},g=(e,t)=>{c.stop(!0),d.stop(!0),d.start({from:{opacity:1},to:{opacity:0}
436,delay:t,config:{duration:e,easing:m.le.easeOutCubic}})},v=e=>{s.current&&s.current.material.uniforms.uCameraPosition.value.copy(e)},x=(0,o.useMemo)(()=>n<=0?null:p(),[n,p]);return((0,o.useImperativeHandle)(t,()=>({present:h,dismiss:g,updateCameraPosition:v})),x)?(0,a.jsx)("lineSegments",{geometry:x,frustumCulled:!1,renderOrder:200,children:(0,a.jsx)(eO,{ref:s})}):null});ek.displayName="ProductCompassArcs";var eG=n(8119);let eB=["N","NE","E","SE","S","SW","W","NW"],ej=[0,45,90,135,180,225,270,315],e$=new Set(["N","S","W","E"]),eW=Math.PI/180,eH=(0,o.forwardRef)((e,t)=>{let{radius:n}=e,r=y.u.gis.compass,{fonts:s}=(0,o.useContext)(v.DM),l=(0,o.useRef)([]),u=(0,o.useRef)(null),c=(0,o.useRef)(0),f=(0,o.useRef)(null),d=ez(),[p,h]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>{let t=e.value.progress;if(c.current=t,!u.current)return;let n=u.current.array;for(let e=0;e<l.current.length;e++){let a=l.current[e],o=Math.min(Math.max((t*d-a.delay)/r.elementStaggerDuration,0),1);for(let e=a.vertexStart;e<a.vertexStart+a.vertexCount;e++)n[e]=o}u.current.needsUpdate=!0}}),[]),[x,w]=(0,m.zh)(()=>({from:{opacity:1},onChange:e=>{if(!u.current)return;let t=u.current.array;for(let n of l.current){let r=e.value.opacity*n.presentedOpacity;for(let e=n.vertexStart;e<n.vertexStart+n.vertexCount;e++)t[e]=r}u.current.needsUpdate=!0}}),[]),[R,C]=(0,o.useState)(null);(0,o.useEffect)(()=>{let e=s.USansRgMd;if(!e||n<=0)return;let{fontFile:t,fontTexture:o}=e,m=g.i.label.fontBaseLineHeight,p=[],h=new i.PTz,v=new i.Pq0;for(let e=0;e<eF;e++){let a=e*eN,o=a*eW,s=Math.sin(o)*n,l=Math.cos(o)*n,u=eL(a),c=r.tickHeight+r.directionGap,f=Math.atan2(-s,-l),d=`${a}\xb0`,g=r.degreeFontSize/m,x=new eG.Ay(d,{font:t,flipY:!0});x.computeBoundingBox();let y=x.boundingBox,w=new i.Pq0;y.getSize(w);let R=-(w.x*g)/2,C=y.max.y*g,b=w.y*g,S=new i.kn4().compose(new i.Pq0(R,C,0),h.setFromEuler(new i.O9p(Math.PI,0,0)),v.set(g,g,g)),T=new i.kn4().compose(new i.Pq0(s,c,l),h.setFromEuler(new i.O9p(0,f,0)),v.set(1,1,1)),P=new i.kn4().multiplyMatrices(T,S);p.push({geo:x,matrix:P,delay:u,worldX:s,worldZ:l});let M=ej.indexOf(a);if(M>=0){let e=eB[M],n=(e$.has(e)?r.cardinalFontSize:r.ordinalFontSize)/m,a=c+b+r.labelGap,o=new eG.Ay(e,{font:t,flipY:!0});o.computeBoundingBox();let d=o.boundingBox,g=new i.Pq0;d.getSize(g);let x=-(g.x*n)/2,y=d.max.y*n,w=new i.kn4().compose(new i.Pq0(x,y,0),h.setFromEuler(new i.O9p(Math.PI,0,0)),v.set(n,n,n)),R=new i.kn4().compose(new i.Pq0(s,a,l),h.setFromEuler(new i.O9p(0,f,0)),v.set(1,1,1)),C=new i.kn4().multiplyMatrices(R,w);p.push({geo:o,matrix:C,delay:u,worldX:s,worldZ:l})}}let x=0,y=0;for(let e of p)x+=e.geo.attributes.position.count,y+=e.geo.index?e.geo.index.count:0;let w=new Float32Array(3*x),R=new Float32Array(2*x),b=new Float32Array(x),S=new Uint16Array(y),T=[],P=0,M=0,A=new i.Pq0;for(let e of p){let t=e.geo.attributes.position,n=e.geo.attributes.uv,r=e.geo.index,a=t.count;T.push({delay:e.delay,worldX:e.worldX,worldZ:e.worldZ,vertexStart:P,vertexCount:a,presentedOpacity:1});for(let n=0;n<a;n++){let r=t.getX(n),a=t.getY(n),o=2===t.itemSize?0:t.getZ(n);A.set(r,a,o).applyMatrix4(e.matrix);let i=(P+n)*3;w[i]=A.x,w[i+1]=A.y,w[i+2]=A.z}for(let e=0;e<a;e++){let t=(P+e)*2;R[t]=n.getX(e),R[t+1]=n.getY(e)}if(r){for(let e=0;e<r.count;e++)S[M+e]=r.array[e]+P;M+=r.count}P+=a}let D=new i.LoY;D.setAttribute("position",new i.THS(w,3)),D.setAttribute("uv",new i.THS(R,2));let _=new i.THS(b,1);D.setAttribute("aBrightness",_),D.setIndex(new i.THS(S,1));let I=new i.BKk({vertexShader:"/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Distance attenuation uniforms (camera distance).\n */\nuniform float uAttenuationNear;\nuniform float uAttenuationFar;\nuniform float uAttenuationMin;\n\nattribute float aBrightness;\n\nvarying vec2 vUv;\nvarying float vBrightness;\nvarying float vAttenuation;\n\nvoid main() {\n vUv = uv;\n vBrightness = aBrightness;\n\n /* Distance attenuation */\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n float dist = distance(worldPos.xyz, uCameraPosition);\n vAttenuation = mix(uAttenuationMin, 1.0, 1.0 - smoothstep(uAttenuationNear, uAttenuationFar, dist));\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
436);\n}\n",fragmentShader:"precision highp float;\n\nvarying vec2 vUv;\nvarying float vBrightness;\nvarying float vAttenuation;\n\nuniform sampler2D tDiffuse;\nuniform float opacity;\nuniform vec3 color;\nuniform vec3 emissive;\nuniform float emissiveIntensity;\nuniform float pxRange;\nuniform vec2 texSize;\nuniform float softness;\n\n/**\n * Returns the median of three values.\n */\nfloat median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n}\n\n/**\n * Computes the screen-space pixel range for scale-independent MSDF antialiasing.\n * Returns at least 1.0 to guarantee smooth edges even at extreme minification.\n */\nfloat screenPxRange() {\n vec2 unitRange = vec2(pxRange) / texSize;\n vec2 screenTexSize = vec2(1.0) / fwidth(vUv);\n return max(0.5 * dot(unitRange, screenTexSize), 1.0);\n}\n\nvoid main() {\n vec3 s = texture2D(tDiffuse, vUv).rgb;\n float sigDist = median(s.r, s.g, s.b) - 0.5;\n float alpha = clamp(sigDist * screenPxRange() * softness + 0.5, 0.0, 1.0);\n\n vec3 e = emissive * emissiveIntensity;\n float hasEmissive = step(0.001, e.r + e.g + e.b);\n vec3 finalColor = mix(color, e, hasEmissive);\n\n /* Per-vertex brightness modulation + distance attenuation */\n float brightness = vBrightness * vAttenuation;\n finalColor *= brightness;\n float finalOpacity = brightness < 0.001 ? 0.0 : alpha * opacity;\n\n gl_FragColor = vec4(finalColor, finalOpacity);\n}\n",transparent:!0,depthTest:!0,depthWrite:!1,side:i.hB5,uniforms:{tDiffuse:new i.nc$(o),opacity:new i.nc$(1),color:new i.nc$(new i.Q1f(r.labelColor)),emissive:new i.nc$(new i.Pq0(0,0,0)),emissiveIntensity:new i.nc$(1),pxRange:new i.nc$(t.distanceField?.distanceRange??4),texSize:new i.nc$(new i.I9Y(t.common.scaleW,t.common.scaleH)),softness:new i.nc$(1),uCameraPosition:new i.nc$(new i.Pq0),uAttenuationNear:new i.nc$(r.attenuationNear),uAttenuationFar:new i.nc$(r.attenuationFar),uAttenuationMin:new i.nc$(r.attenuationMin)}});f.current=I,l.current=T,u.current=_,C((0,a.jsxs)("mesh",{frustumCulled:!1,renderOrder:200,children:[(0,a.jsx)("primitive",{object:D,attach:"geometry"}),(0,a.jsx)("primitive",{object:I,attach:"material"})]}));let E=c.current;if(E>0){for(let e of T){let t=Math.min(Math.max((E*d-e.delay)/r.elementStaggerDuration,0),1);for(let n=e.vertexStart;n<e.vertexStart+e.vertexCount;n++)b[n]=t;e.presentedOpacity=t<.001?0:1}_.needsUpdate=!0}},[s,n]);let b=(e,t)=>{w.stop(!0),h.stop(!0),h.start({from:{progress:0},to:{progress:1},delay:t,config:{duration:d,easing:m.le.easeOutCubic},onRest:()=>{if(!u.current)return;let e=u.current.array;for(let t of l.current){let n=e[t.vertexStart]??0;t.presentedOpacity=n<.001?0:1}}})},S=(e,t)=>{h.stop(!0),w.stop(!0),w.start({from:{opacity:1},to:{opacity:0},delay:t,config:{duration:e,easing:m.le.easeOutCubic}})},T=e=>{f.current&&f.current.uniforms.uCameraPosition.value.copy(e)},P=()=>null!==R;return(0,o.useImperativeHandle)(t,()=>({present:b,dismiss:S,updateCameraPosition:T,isReady:P})),(0,a.jsx)(a.Fragment,{children:R})});eH.displayName="ProductCompassLabels";let eY=Math.PI/180,eX=(0,o.forwardRef)((e,t)=>{let{radius:n}=e,r=y.u.gis.compass,s=(0,o.useRef)(null),l=(0,o.useRef)(null),u=ez(),[c,f]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>{if(!s.current)return;let t=e.value.progress;s.current.material.uniforms.uTransitionProgress.value=t,s.current.material.uniforms.uOpacity.value=1,l.current&&(l.current.material.uniforms.uTransitionProgress.value=t,l.current.material.uniforms.uOpacity.value=1)}}),[]),[d,p]=(0,m.zh)(()=>({from:{opacity:1},onChange:e=>{s.current&&(s.current.material.uniforms.uOpacity.value=e.value.opacity,l.current&&(l.current.material.uniforms.uOpacity.value=e.value.opacity))}}),[]),h=(0,o.useCallback)(()=>{let e=2*eF,t=new Float32Array(3*e),a=new Float32Array(e),o=new Float32Array(e),s=new Float32Array(e);for(let e=0;e<eF;e++){let i=e*eN,l=i*eY,u=Math.sin(l)*n,c=Math.cos(l)*n,f=eL(i),d=2*e;t[3*d]=u,t[3*d+1]=0,t[3*d+2]=c,a[d]=f,o[d]=r.tickHeight,s[d]=0,t[(d+1)*3]=u,t[(d+1)*3+1]=0,t[(d+1)*3+2]=c,a[d+1]=f,o[d+1]=r.tickHeight,s[d+1]=1}let l=new i.LoY;return l.setAttribute("position",new i.THS(t,3)),l.setAttribute("delay",new i.THS(a,1)),l.setAttribute("height",new i.THS(o,1)),l.setAttribute("endpoint",new i.THS(s,1)),l},[n]),g=(0,o.useCallback)(()=>{let e=new Float32Array(3*eF),t=new Float32Array(eF),a=new Float32Array(eF);for(let o=0;o<eF;o++){let i=o*eN,s=i*eY;e[3*o]=Math.sin(s)*n,e[3*o+1]=0,e[3*o+2]=Math.cos(s)*n,t[o]=eL(i),a[o]=r.tickHeight}let o=new i.LoY;return o.setAttribute("position",new i.THS(e,3)),o.setAttribute("delay",new i.THS(t,1)),o.setAttribute("height",new i.THS(a,1)),o},[n]),v=(e,t)=>
436{p.stop(!0),f.stop(!0),f.start({from:{progress:0},to:{progress:1},delay:t,config:{duration:u,easing:m.le.easeOutCubic}})},x=(e,t)=>{f.stop(!0),p.stop(!0),p.start({from:{opacity:1},to:{opacity:0},delay:t,config:{duration:e,easing:m.le.easeOutCubic}})},w=e=>{s.current&&s.current.material.uniforms.uCameraPosition.value.copy(e),l.current&&l.current.material.uniforms.uCameraPosition.value.copy(e)},R=(0,o.useMemo)(()=>n<=0?null:h(),[n,h]),C=(0,o.useMemo)(()=>n<=0?null:g(),[n,g]);return((0,o.useImperativeHandle)(t,()=>({present:v,dismiss:x,updateCameraPosition:w})),R&&C)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("lineSegments",{geometry:R,frustumCulled:!1,renderOrder:200,children:(0,a.jsx)(eE,{ref:s})}),(0,a.jsx)("points",{geometry:C,frustumCulled:!1,renderOrder:200,children:(0,a.jsx)(eU,{ref:l})})]}):null});eX.displayName="ProductCompassTicks";let eq=(0,o.forwardRef)((e,t)=>{let{radius:n}=e,r=y.u.gis.compass,i=(0,o.useRef)(null),l=(0,o.useRef)(null),u=(0,o.useRef)(null),f=(0,o.useRef)(null),d=(e,t)=>{l.current?.present(e,t),u.current?.present(e,t),f.current?.present(e,t)},m=(e,t)=>{l.current?.dismiss(e,t),u.current?.dismiss(e,t),f.current?.dismiss(e,t)};return((0,c._B)("limegreen"),(0,s.D)(e=>{let{camera:t}=e;l.current?.updateCameraPosition(t.position),u.current?.updateCameraPosition(t.position),f.current?.updateCameraPosition(t.position)}),(0,o.useEffect)(()=>{u.current?.isReady()&&i.current.traverse(e=>{e.layers.set(0)})}),(0,o.useImperativeHandle)(t,()=>({present:d,dismiss:m,group:i.current})),n<=0)?null:(0,a.jsxs)("group",{ref:i,position:[0,r.yOffset,0],children:[(0,a.jsx)(eX,{ref:l,radius:n}),(0,a.jsx)(eH,{ref:u,radius:n}),(0,a.jsx)(ek,{ref:f,radius:n})]})});eq.displayName="ProductCompassRenderer";let eZ=(e,t)=>{let n=3*t;return[e[n],e[n+1],e[n+2]]},eQ=(e,t,n)=>{let{cols:r,rows:a,originX:o,originZ:i,cellSize:s}=n.spawnGrid,l=Math.floor((e-o)/s),u=Math.floor((t-i)/s);return l<0||l>=r||u<0||u>=a?-1:u*r+l},eK=[[-1,1],[-1,-1],[1,1],[1,-1]];var eJ=n(1816);let e0=(0,o.forwardRef)((e,t)=>{let{...n}=e,r=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,()=>({material:r.current}));let s=y.u.gis.groundEffect;return(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:r,transparent:!0,depthWrite:!0,depthTest:!0,side:i.hB5,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/*\n * Barycentric coordinate for wireframe edge detection.\n */\nattribute vec3 barycentric;\n\n/*\n * Quad ID for consistent per-face hashing across both triangles.\n */\nattribute float quadId;\n\n/*\n * The world position for pulse/ring distance calculations.\n */\nvarying vec3 vWorldPosition;\n\n/*\n * Scaled position without group rotation, for agent proximity (matches graph coordinate space).\n */\nuniform float uDataScale;\nvarying vec3 vScaledPosition;\n\n/*\n * Barycentric coordinate passed to fragment shader.\n */\nvarying vec3 vBarycentric;\n\n/*\n * Quad ID passed to fragment shader (flat = no interpolation).\n */\nflat varying float vQuadId;\n\nvoid main() {\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n vWorldPosition = worldPos.xyz;\n vScaledPosition = position * uDataScale;\n vBarycentric = barycentric;\n vQuadId = quadId;\n gl_Position = projectionMatrix * viewMatrix * worldPos;\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <common>\n#include <logdepthbuf_pars_fragment>\n\n/*\n * Base color of the ground mesh.\n */\nuniform vec3 uBaseColor;\n\n/*\n * The base opacity (animated present/dismiss).\n */\nuniform float uOpacity;\n\n/* ===== Pulse Wave ===== */\n\n/*\n * The pulse wave center in world space.\n */\nuniform vec3 uPulseCenter;\n\n/*\n * The current pulse wave radius (animated 0âmax).\n */\nuniform float uPulseRadius;\n\n/*\n * The global pulse opacity (animated 1â0).\n */\nuniform float uPulseOpacity;\n\n/*\n * The flash trail width behind the wave front.\n */\nuniform float uPulseDecayWidth;\n\n/*\n * The pulse wave color.\n */\nuniform vec3 uPulseColor;\n\n/*\n * The pulse circle line width multiplier (screen-space pixels).\n */\nuniform float uPulseCircleWidth;\n\n/*\n * The minimum face opacity (flat surfaces).\n */\nuniform float uPulseFaceOpacityMin;\n\n/*\n * The maximum face opacity (steep surfaces).\n */\nuniform float uPulseFaceOpacityMax;\n\n/*\n * Edge brightness multiplier (>1 makes grid lines pop over faces).\n */\nuniform float uPulseEdgeBoost;\n\n/* ===== Donut Ring ===== */\n\n/*\n * The donut ring center in world space.\n */\nuniform vec3 uRingCenter;\n\n/*\n * The donut ring inner radius.\n */\nuniform float uRingInnerRadius;\n\n/*\n * The donut ring outer radius.\n */\nuniform float uRingOuterRadius;\n\n/*\n * The arc sweep progress 0â1.\n */\nuniform float uRingProgress;
436\n\n/*\n * The donut ring alpha.\n */\nuniform float uRingOpacity;\n\n/*\n * The donut ring color.\n */\nuniform vec3 uRingColor;\n\n/* ===== PathFinder Agent Proximity ===== */\n\n/*\n * Agent world positions (up to 10 simultaneous agents).\n */\nuniform vec3 uAgentPositions[10];\n\n/*\n * Per-agent fade (0 = inactive, 1 = fully visible). CPU-side lerp over 800ms.\n */\nuniform float uAgentFades[10];\n\n/*\n * Distance (world units) at which agent glow is full.\n */\nuniform float uAgentProximityNear;\n\n/*\n * Distance (world units) at which agent glow fades to zero.\n */\nuniform float uAgentProximityFar;\n\n/*\n * Edge brightness multiplier for agent proximity glow.\n */\nuniform float uAgentEdgeIntensity;\n\n/*\n * Camera world position for distance attenuation.\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Far-distance fade: full opacity within this distance.\n */\nuniform float uAttenuationDistanceNear;\n\n/*\n * Far-distance fade: reaches minimum at this distance.\n */\nuniform float uAttenuationDistanceFar;\n\n/*\n * Far-distance minimum opacity.\n */\nuniform float uAttenuationDistanceMin;\n\n/*\n * Near-distance fade: below this distance, start fading out.\n */\nuniform float uAttenuationProximityNear;\n\n/*\n * Near-distance fade: fully visible beyond this distance.\n */\nuniform float uAttenuationProximityFar;\n\n/*\n * Per-agent thumbnail visibility (0 = inside thumb AABB, 1 = outside).\n * CPU-side lerp when agent crosses AABB boundary.\n */\nuniform float uAgentThumbFades[10];\n\n/*\n * Agent proximity glow CA pixel offset (screen-space RGB split on wireframe).\n */\nuniform float uAgentCAStrength;\n\n/*\n * Pulse wave CA pixel offset (screen-space RGB split on wireframe).\n */\nuniform float uGroundPulseCAStrength;\n\n/*\n * The world position from vertex shader.\n */\nvarying vec3 vWorldPosition;\n\n/*\n * Scaled position without group rotation, for agent proximity (matches graph coordinate space).\n */\nvarying vec3 vScaledPosition;\n\n/*\n * Barycentric coordinate for wireframe edge detection.\n */\nvarying vec3 vBarycentric;\n\n/*\n * Quad ID for consistent per-face hashing (same value for both triangles in a quad).\n */\nflat varying float vQuadId;\n\n/*\n * Hash function for per-face randomization.\n */\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvoid main() {\n /* Camera distance attenuation */\n float camDist = distance(vWorldPosition, uCameraPosition);\n float farFade = mix(1.0, uAttenuationDistanceMin, smoothstep(uAttenuationDistanceNear, uAttenuationDistanceFar, camDist));\n float nearFade = smoothstep(uAttenuationProximityNear, uAttenuationProximityFar, camDist);\n float cameraAtt = farFade * nearFade;\n\n /* Base color */\n vec3 color = uBaseColor;\n float alpha = uOpacity * cameraAtt;\n\n /* Pulse wave: bright at outer circle, decaying inward only (outside = black) */\n float pulseDist = distance(vWorldPosition, uPulseCenter);\n float behindFront = uPulseRadius - pulseDist;\n float insideMask = step(0.0, behindFront);\n float innerDecay = 1.0 - smoothstep(0.0, uPulseDecayWidth, max(behindFront, 0.0));\n float pulseIntensity = innerDecay * insideMask * uPulseOpacity;\n\n if (pulseIntensity > 0.0) {\n /* Slope-based face opacity â steeper faces are brighter, revealing terrain and grid */\n vec3 faceNormal = normalize(cross(dFdx(vWorldPosition), dFdy(vWorldPosition)));\n float slope = 1.0 - abs(dot(faceNormal, vec3(0.0, 1.0, 0.0)));\n float faceOpacity = mix(uPulseFaceOpacityMin, uPulseFaceOpacityMax, slope);\n\n /* Wireframe edge detection via barycentric coordinates â anti-aliased 1px lines */\n float edgeMin = min(vBarycentric.x, min(vBarycentric.y, vBarycentric.z));\n float edgeFactor = 1.0 - smoothstep(0.0, fwidth(edgeMin), edgeMin);\n\n /* CA: shift edge detection diagonally in screen space via dFdx+dFdy(barycentric) */\n float pulseCA = pulseIntensity * uGroundPulseCAStrength;\n vec3 dBaryShiftPulse = dFdx(vBarycentric) + dFdy(vBarycentric);\n vec3 baryRPulse = vBarycentric - dBaryShiftPulse * pulseCA;\n vec3 baryBPulse = vBarycentric + dBaryShiftPulse * pulseCA;\n float edgeMinRPulse = min(baryRPulse.x, min(baryRPulse.y, baryRPulse.z));\n float edgeRPulse = 1.0 - smoothstep(0.0, fwidth(edgeMinRPulse), edgeMinRPulse);\n float edgeMinBPulse = min(baryBPulse.x, min(baryBPulse.y, baryBPulse.z));\n float edgeBPulse = 1.0 - smoothstep(0.0, fwidth(edgeMinBPulse), edgeMinBPulse);\n\n /* Per-channel composite: edges boosted above faces so grid lines pop */\n float glowR = pulseIntensity * max(edgeRPulse * uPulseEdgeBoost, faceOpacity);\n float glowG = pulseIntensity * max(edgeFactor * uPulseEdgeBoost, faceOpacity);\n float glowB = pulseIntensity * max(edgeBPulse * uPulseEdgeBoost, faceOpacity);\n\n color.r += uPulseColor.r * glowR;\n color.g += uPulseColor.g * glowG;\n color.b += uPulseColor.b * glowB;
436\n alpha = max(alpha, max(glowR, max(glowG, glowB)));\n }\n\n /* Circular segment at pulse wave front â 1px anti-aliased line */\n if (uPulseRadius > 0.0 && uPulseOpacity > 0.0) {\n float circleEdge = abs(pulseDist - uPulseRadius);\n float circleHalfWidth = fwidth(pulseDist) * uPulseCircleWidth;\n float circleAA = fwidth(pulseDist);\n float circleLine = 1.0 - smoothstep(circleHalfWidth, circleHalfWidth + circleAA, circleEdge);\n float circleAlpha = circleLine * uPulseOpacity;\n color += uPulseColor * circleAlpha;\n alpha = max(alpha, circleAlpha);\n }\n\n /* PathFinder agent proximity: wireframe glow near moving agents */\n float agentGlow = 0.0;\n for (int i = 0; i < 10; i++) {\n float d = distance(vScaledPosition.xz, uAgentPositions[i].xz);\n agentGlow += (1.0 - smoothstep(uAgentProximityNear, uAgentProximityFar, d)) * uAgentFades[i] * uAgentThumbFades[i];\n }\n /* Gate agent glow by base opacity so dismiss fades the wireframe edge glow in lockstep with the mesh itself */\n agentGlow = clamp(agentGlow, 0.0, 1.0) * uOpacity;\n if (agentGlow > 0.0) {\n float edgeMin2 = min(vBarycentric.x, min(vBarycentric.y, vBarycentric.z));\n float edgeFactor2 = 1.0 - smoothstep(0.0, fwidth(edgeMin2), edgeMin2);\n\n /* CA: shift edge detection diagonally in screen space via dFdx+dFdy(barycentric) */\n float agentCA = agentGlow * uAgentCAStrength;\n vec3 dBaryShiftAgent = dFdx(vBarycentric) + dFdy(vBarycentric);\n vec3 baryRAgent = vBarycentric - dBaryShiftAgent * agentCA;\n vec3 baryBAgent = vBarycentric + dBaryShiftAgent * agentCA;\n float edgeMinRAgent = min(baryRAgent.x, min(baryRAgent.y, baryRAgent.z));\n float edgeRAgent = 1.0 - smoothstep(0.0, fwidth(edgeMinRAgent), edgeMinRAgent);\n float edgeMinBAgent = min(baryBAgent.x, min(baryBAgent.y, baryBAgent.z));\n float edgeBAgent = 1.0 - smoothstep(0.0, fwidth(edgeMinBAgent), edgeMinBAgent);\n\n /* Per-channel composite */\n float agentEdgeR = agentGlow * edgeRAgent * uAgentEdgeIntensity;\n float agentEdgeG = agentGlow * edgeFactor2 * uAgentEdgeIntensity;\n float agentEdgeB = agentGlow * edgeBAgent * uAgentEdgeIntensity;\n\n color.r += uPulseColor.r * agentEdgeR;\n color.g += uPulseColor.g * agentEdgeG;\n color.b += uPulseColor.b * agentEdgeB;\n alpha = max(alpha, max(agentEdgeR, max(agentEdgeG, agentEdgeB)) * cameraAtt);\n }\n\n /* Donut ring: annulus mask + arc sweep */\n float ringDist = distance(vWorldPosition, uRingCenter);\n float aa = fwidth(ringDist);\n float ringMask = smoothstep(uRingInnerRadius - aa, uRingInnerRadius + aa, ringDist) * smoothstep(uRingOuterRadius + aa, uRingOuterRadius - aa, ringDist);\n\n /* Arc sweep: offset by PI so the arc starts from the camera-facing side (+Z) */\n float arcMask = 1.0;\n if (uRingProgress < 1.0) {\n float angle = atan(vWorldPosition.x - uRingCenter.x, vWorldPosition.z - uRingCenter.z);\n float normalizedAngle = (angle + PI) / (2.0 * PI);\n arcMask = step(normalizedAngle, uRingProgress);\n }\n float ringAlpha = ringMask * arcMask * uRingOpacity;\n\n color += uRingColor * ringAlpha;\n alpha = max(alpha, ringAlpha);\n\n gl_FragColor = vec4(color, alpha);\n #include <logdepthbuf_fragment>\n}\n",uniforms:{uBaseColor:new i.nc$(new i.Q1f(0)),uOpacity:new i.nc$(0),uPulseCenter:new i.nc$(new i.Pq0(0,0,0)),uPulseRadius:new i.nc$(0),uPulseOpacity:new i.nc$(0),uPulseDecayWidth:new i.nc$(s.pulseDecayWidth),uPulseColor:new i.nc$(new i.Q1f(s.pulseColor)),uPulseCircleWidth:new i.nc$(s.pulseCircleWidth),uPulseFaceOpacityMin:new i.nc$(s.pulseFaceOpacityMin),uPulseFaceOpacityMax:new i.nc$(s.pulseFaceOpacityMax),uPulseEdgeBoost:new i.nc$(s.pulseEdgeBoost),uRingCenter:new i.nc$(new i.Pq0(0,0,0)),uRingInnerRadius:new i.nc$(s.ringInnerRadius),uRingOuterRadius:new i.nc$(s.ringOuterRadius),uRingProgress:new i.nc$(0),uRingOpacity:new i.nc$(0),uRingColor:new i.nc$(new i.Q1f(s.ringColor)),uDataScale:new i.nc$(y.u.gis.dataScale),uAgentPositions:new i.nc$(Array.from({length:10},()=>new i.Pq0)),uAgentFades:new i.nc$(Array(10).fill(0)),uAgentProximityNear:ne
436w i.nc$(s.agentProximityNear),uAgentProximityFar:new i.nc$(s.agentProximityFar),uAgentEdgeIntensity:new i.nc$(s.agentEdgeIntensity),uCameraPosition:new i.nc$(new i.Pq0),uAttenuationDistanceNear:new i.nc$(s.attenuationDistanceNear),uAttenuationDistanceFar:new i.nc$(s.attenuationDistanceFar),uAttenuationDistanceMin:new i.nc$(s.attenuationDistanceMin),uAttenuationProximityNear:new i.nc$(s.attenuationProximityNear),uAttenuationProximityFar:new i.nc$(s.attenuationProximityFar),uAgentThumbFades:new i.nc$(Array(10).fill(1)),uAgentCAStrength:new i.nc$(s.agentCAStrength),uGroundPulseCAStrength:new i.nc$(s.groundPulseCAStrength)},...n}),[])});e0.displayName="ProductGISGroundMaterial";let e1=(0,o.forwardRef)((e,t)=>{let{...n}=e,r=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,()=>({material:r.current}));let s=y.u.gis.pathFinder,l=y.u.gis.trace.attenuation;return(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:r,transparent:!0,depthTest:!0,depthWrite:!1,side:i.$EB,blending:i.EZo,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/*\n * Per-vertex opacity (0 = hidden, 1 = fully visible).\n */\nattribute float aOpacity;\n\n/*\n * Local quad UV (-1 to +1) for distance-from-center in fragment shader.\n */\nattribute vec2 aUv;\n\n/*\n * 0.0 = ring quad, 1.0 = dot quad.\n */\nattribute float aIsRing;\n\n/*\n * Dot scale (0â1): controls â size during appear/disappear.\n */\nattribute float aDotScale;\n\n/*\n * Ring sweep progress (0â1): controls ⯠donut arc.\n */\nattribute float aRingProgress;\n\n/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Distance and proximity attenuation uniforms.\n */\nuniform float distanceNear;\nuniform float distanceFar;\nuniform float distanceMin;\nuniform float proximityFar;\nuniform float proximityNear;\n\nvarying float vOpacity;\nvarying vec2 vUv;\nvarying float vIsRing;\nvarying float vAttenuation;\nvarying float vDotScale;\nvarying float vRingProgress;\n\nvoid main() {\n vOpacity = aOpacity;\n vUv = aUv;\n vIsRing = aIsRing;\n vDotScale = aDotScale;\n vRingProgress = aRingProgress;\n\n /* Position is pre-computed on CPU (center + offset * radius + yOffset) */\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n\n /* Distance from camera for light attenuation */\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n float dist = distance(worldPos.xyz, uCameraPosition);\n float farFade = mix(1.0, distanceMin, smoothstep(distanceNear, distanceFar, dist));\n float nearFade = smoothstep(proximityNear, proximityFar, dist);\n vAttenuation = farFade * nearFade;\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/*\n * Filled circle (dot) color.\n */\nuniform vec3 dotColor;\n\n/*\n * Ring color.\n */\nuniform vec3 ringColor;\n\n/*\n * Ring inner radius as a fraction of outer radius (0â1).\n */\nuniform float ringInnerRatio;\n\n#include <logdepthbuf_pars_fragment>\n\nvarying float vOpacity;\nvarying vec2 vUv;\nvarying float vIsRing;\nvarying float vAttenuation;\nvarying float vDotScale;\nvarying float vRingProgress;\n\nvoid main() {\n #include <logdepthbuf_fragment>\n\n float dist = length(vUv);\n\n if (vIsRing < 0.5) {\n /* Filled circle (â) with scale animation */\n float scaledDist = dist / max(vDotScale, 0.001);\n if (scaledDist > 1.0) discard;\n float edge = 1.0 - smoothstep(0.85, 1.0, scaledDist);\n float finalAlpha = vOpacity * edge * vAttenuation;\n if (finalAlpha < 0.001) discard;\n gl_FragColor = vec4(dotColor, finalAlpha);\n } else {\n /* Ring (â¯) with donut sweep animation */\n if (dist > 1.0 || dist < ringInnerRatio) discard;\n\n /* Angle-based sweep: 0â1 maps to 0â360\xb0 clockwise from 12 o'clock */\n float angle = atan(vUv.x, vUv.y);\n if (angle < 0.0) angle += 6.2831853;\n float normalizedAngle = angle / 6.2831853;\n\n float sweepMask = 1.0;\n if (vRingProgress < 0.999) {\n if (normalizedAngle > vRingProgress) discard;
436\n /* Soft edge at sweep boundary */\n sweepMask = 1.0 - smoothstep(vRingProgress - 0.02, vRingProgress, normalizedAngle);\n }\n\n float outerEdge = 1.0 - smoothstep(0.85, 1.0, dist);\n float innerEdge = smoothstep(ringInnerRatio, ringInnerRatio + 0.15, dist);\n\n float finalAlpha = vOpacity * outerEdge * innerEdge * sweepMask * vAttenuation;\n if (finalAlpha < 0.001) discard;\n gl_FragColor = vec4(ringColor, finalAlpha);\n }\n}\n",uniforms:{uCameraPosition:new i.nc$(new i.Pq0),dotColor:new i.nc$(new i.Q1f(s.dot.color)),ringColor:new i.nc$(new i.Q1f(s.ring.color)),ringInnerRatio:new i.nc$(s.ring.innerRadius/s.ring.radius),distanceNear:new i.nc$(l.distanceNear),distanceFar:new i.nc$(l.distanceFar),distanceMin:new i.nc$(l.distanceMin),proximityFar:new i.nc$(l.proximityFar),proximityNear:new i.nc$(l.proximityNear)},...n}),[])});e1.displayName="ProductGISPathFinderMaterial";let e2=(0,o.forwardRef)((e,t)=>{let{...n}=e,r=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,()=>({material:r.current}));let s=y.u.gis.pathFinder.connection;return(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:r,transparent:!0,depthTest:!0,depthWrite:!1,side:i.$EB,blending:i.EZo,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/*\n * Endpoint A world position (agent A center + yOffset â shared across all 22 vertices of this pair).\n */\nattribute vec3 aEndpointA;\n\n/*\n * Endpoint B world position (agent B center + yOffset â shared across all 22 vertices).\n */\nattribute vec3 aEndpointB;\n\n/*\n * Normalized sub-segment position 0..1 (equal across both side vertices of the same boundary).\n */\nattribute float aSubSegT;\n\n/*\n * Screen-space side (-1 or +1) for quad expansion.\n */\nattribute float aSide;\n\n/*\n * Previous boundary's world position (Y already terrain-adjusted on CPU). Degenerate to curr at t=0.\n */\nattribute vec3 aPrev;\n\n/*\n * Next boundary's world position (Y already terrain-adjusted on CPU). Degenerate to curr at t=1.\n */\nattribute vec3 aNext;\n\n/*\n * Per-vertex opacity (fade * baseOpacity * thumbFade * attenuation, computed on CPU).\n */\nattribute float aOpacity;\n\nuniform vec2 uResolution;\nuniform float lineHalfWidth;\n\nuniform sampler2D uHeightmap;\nuniform vec2 uHeightmapWorldMin;\nuniform vec2 uHeightmapWorldSize;\nuniform float uHeightmapReady;\nuniform float uYOffset;\nuniform float uEndpointBlendRatio;\nuniform float uMiterLimit;\nuniform float uSubSegCount;\n\nvarying float vOpacity;\nvarying float vSide;\n\n/**\n * Samples the ground heightmap at a world-space XZ position and returns\n * the terrain-follow Y (world Y from heightmap + configured yOffset).\n */\nfloat sampleTerrainY(vec2 worldXZ) {\n vec2 uv = (worldXZ - uHeightmapWorldMin) / uHeightmapWorldSize;\n float h = texture2D(uHeightmap, uv).r;\n return h + uYOffset;\n}\n\n/**\n * Given a boundary's XZ, the two endpoints, and the sub-segment parameter t,\n * returns the final world-space Y blending agent Y (endpoints) with terrain Y (middle).\n * Blend is bell-shaped: 0 at both endpoints (t=0 and t=1) so the connector stays\n * anchored to the rings, 1 in the middle so it follows terrain.\n */\nfloat blendedY(vec2 xz, vec3 endpointA, vec3 endpointB, float t) {\n float agentY = mix(endpointA.y, endpointB.y, t);\n float terrainY = sampleTerrainY(xz);\n float w = uEndpointBlendRatio;\n float d = min(t, 1.0 - t);\n float blend = smoothstep(0.0, w, d) * uHeightmapReady;\n return mix(agentY, terrainY, blend);\n}\n\nvoid main() {\n /* 1. curr world XZ from endpoints */\n vec3 currXZ = mix(aEndpointA, aEndpointB, aSubSegT);\n float currY = blendedY(currXZ.xz, aEndpointA, aEndpointB, aSubSegT);\n vec3 curr = vec3(currXZ.x, currY, currXZ.z);\n\n /* 2. prev / next boundary positions. CPU provides XZ; Y is re-blended here. */\n float inv = 1.0 / uSubSegCount;\n float tPrev = clamp(aSubSegT - inv, 0.0, 1.0);\n float tNext = clamp(aSubSegT + inv, 0.0, 1.0);\n float prevY = blendedY(aPrev.xz, aEndpointA, aEndpointB, tPrev);\n float nextY = blendedY(aNext.xz, aEndpointA, aEndpointB, tNext);\n vec3 prev = vec3(aPrev.x, prevY, aPrev.z);\n vec3 next = vec3(aNext.x, nextY, aNext.z);\n\n /* 3. Project to clip space */\n vec4 currClip = projectionMatrix * modelViewMatrix * vec4(curr, 1.0);\n vec4 prevClip = projectionMatrix * modelViewMatrix * vec4(prev, 1.0);\n vec4 nextClip = projectionMatrix * modelViewMatrix * vec4(next, 1.0);\n\n /* 4. NDC in pixels for consistent screen-space math */\n vec2 currNDC = currClip.xy / currClip.w * uResolution;\n vec2 prevNDC = prevClip.xy / prevClip.w * uResolution;\n vec2 nextNDC = nextClip.xy / nextClip.w * uResolution;\n\n vec2 dirIn = currNDC - prevNDC;\n vec2 dirOut = nextNDC - currNDC;\n\n /* Degenerate handling: at t=0, prev=curr so dirIn=0 â fall back to dirOut; at t=1, dirOut=0 â fall back to dirIn */\n float lenIn = length(dirIn);\n float lenOut = length(dirOut);\n vec2 dirInN = lenIn > 1e-4 ? dirIn / lenIn : lenOut > 1e-4 ? dirOut / lenOut : vec2(1.0, 0.0);\n vec2 dirOutN = lenOut > 1e-4 ? dirOut / lenOut : dirInN;\n\n vec2 tangent = normalize(dirInN + dirOutN);\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 segNormal = vec2(-dirOutN.y, dirOutN.x);\n\n float denom = max(abs(dot(normal, segNormal)), 1.0 / uMiterLimit);\n float miterLen = 1.0 / denom;\n miterLen = min(miterLen, uMiterLimit);\n\n /* 5. Screen-space expansion (pixel â NDC) */\n vec2 offsetPx = normal * aSide * lineHalfWidth * miterLen;\n vec2 offsetNDC = offsetPx / uResolution * 2.0;\n\n gl_Position = currClip;\n gl_Position.xy += offsetNDC * currClip.w;\n\n vOpacity = aOpacity;\n vSide = aSide;\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <logdepthbuf_pars_fragment>\n\n/*\n * Line color.\n */\nuniform vec3 color;\n\nvarying float vOpacity;\nvarying float vSide;\n\nvoid main() {\n #include <logdepthbuf_fragment>
436\n\n /* Cross-strip edge anti-aliasing */\n float edgeFade = 1.0 - smoothstep(0.7, 1.0, abs(vSide));\n\n float finalAlpha = vOpacity * edgeFade;\n if (finalAlpha < 0.001) discard;\n\n gl_FragColor = vec4(color, finalAlpha);\n}\n",uniforms:{uResolution:new i.nc$(new i.I9Y(1280,720)),color:new i.nc$(new i.Q1f(s.color)),lineHalfWidth:new i.nc$(s.lineHalfWidth),uHeightmap:new i.nc$(null),uHeightmapWorldMin:new i.nc$(new i.I9Y(0,0)),uHeightmapWorldSize:new i.nc$(new i.I9Y(1,1)),uHeightmapReady:new i.nc$(0),uYOffset:new i.nc$(s.yOffset),uEndpointBlendRatio:new i.nc$(s.endpointBlendRatio),uMiterLimit:new i.nc$(s.miterLimit),uSubSegCount:new i.nc$(s.subSegments)},...n}),[])});e2.displayName="ProductGISPathFinderConnectionMaterial";var e3=n(4201);let e4=(0,o.forwardRef)((e,t)=>{let{pointSize:n=y.u.gis.point.baseSize}=e,r=(0,o.useRef)(null);return(0,o.useImperativeHandle)(t,()=>({material:r.current})),(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:r,blending:i.bCz,blendEquation:i.gO9,blendSrc:i.ie2,blendDst:i.qad,side:i.hB5,transparent:!0,depthTest:!0,depthWrite:!1,lights:!0,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n\n/**\n * The transition progress (0 â 1).\n */\nuniform float progress;\n\n/**\n * The size of the point.\n */\nuniform float pointSize;\n\n/*\n * Viewport resolution for screen-size-dependent scaling.\n */\nuniform vec2 uResolution;\n\n/*\n * Reference screen height for point size scaling.\n */\nuniform float uReferenceHeight;\n\n/*\n * Camera position in world space for distance attenuation.\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Distance attenuation: full opacity within this distance.\n */\nuniform float distanceNear;\n\n/*\n * Distance attenuation: minimum opacity beyond this distance.\n */\nuniform float distanceFar;\n\n/*\n * Distance attenuation: minimum opacity fraction.\n */\nuniform float distanceMin;\n\n/**\n * The multiplier of the progress.\n */\nattribute float multiplier;\n\n/**\n * The view position.\n */\nvarying vec3 vViewPosition;\n/**\n * The view normal.\n */\nvarying vec3 vViewNormal;\n/*\n * The world position for pulse distance calculation.\n */\nvarying vec3 vWorldPosition;\n\n/*\n * Distance attenuation factor (0..1).\n */\nvarying float vAttenuation;\n\nvoid main() {\n /**\n * The current animated position of the particles.\n */\n float ratio = clamp(linearstep(0.0, 1.0, progress * multiplier), 0.0, 1.0);\n ratio = easeInOutCubic(ratio);\n vec3 currentPosition = vec3(position.x, position.y * ratio, position.z);\n\n /**\n * The model view position of the particles.\n */\n vec4 modelViewPosition = modelViewMatrix * vec4(currentPosition, 1.0
436);\n\n /**\n * The view normal of the particles (hardcoded up normal).\n */\n vec3 viewNormal = normalMatrix * vec3(0.0, 1.0, 0.0);\n\n /**\n * Export the position and size of the particles.\n */\n gl_Position = projectionMatrix * modelViewPosition;\n gl_PointSize = pointSize * (uResolution.y / uReferenceHeight);\n\n /**\n * Set varying variables.\n */\n vViewPosition = modelViewPosition.xyz;\n vViewNormal = viewNormal;\n vWorldPosition = (modelMatrix * vec4(currentPosition, 1.0)).xyz;\n\n /*\n * Camera distance attenuation.\n */\n float dist = distance(vWorldPosition, uCameraPosition);\n float farFade = mix(1.0, distanceMin, smoothstep(distanceNear, distanceFar, dist));\n vAttenuation = farFade;\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <bsdfs>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <logdepthbuf_pars_fragment>\n/**\n * Light structures, uniform variables, and other definitions are included\n */\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n\n/**\n * The delta time of the effect.\n */\nuniform float delta;\n/**\n * The time elapsed of the effect.\n */\nuniform float time;\n\n/*\n * Circle radius in point-coord space (0.0-0.5).\n */\nuniform float uPointRadius;\n\n/**\n * The global opacity.\n */\nuniform float opacity;\n\n/*\n * Pulse wave center in GIS group local space.\n */\nuniform vec3 uPulseCenter;\n\n/*\n * Current pulse wave radius.\n */\nuniform float uPulseRadius;\n\n/*\n * Pulse global opacity.\n */\nuniform float uPulseOpacity;\n\n/*\n * Pulse flash trail width.\n */\nuniform float uPulseDecayWidth;\n\n/*\n * Pulse wave color.\n */\nuniform vec3 uPulseColor;\n/**\n * The view position.\n */\nvarying vec3 vViewPosition;\n/**\n * The view normal.\n */\nvarying vec3 vViewNormal;\n/*\n * The world position for pulse distance calculation.\n */\nvarying vec3 vWorldPosition;\n\n/*\n * Distance attenuation factor (0..1).\n */\nvarying float vAttenuation;\n\n/**\n * ***********************************\n * Main\n * ************************************\n */\n\nvoid main() {\n /**\n * Calculate the geometry position and normal.\n */\n vec3 geometryPosition = vViewPosition;\n vec3 geometryNormal = normalize(vViewNormal);\n vec3 geometryViewDir = isOrthographic ? vec3(0, 0, 1) : normalize(-vViewPosition);\n vec3 backGeometryNormal = -geometryNormal;\n\n /**\n * Calculate the light\n */\n vec3 vLightFront = vec3(0.0);\n vec3 vIndirectFront = vec3(0.0);\n IncidentLight directLight;\n float dotNL;\n vec3 directLightColor_Diffuse;\n\n /**\n * Calculate the ambient light.\n */\n vIndirectFront += getAmbientLightIrradiance(ambientLightColor);\n\n #if defined(USE_LIGHT_PROBES)\n\n vIndirectFront += getLightProbeIrradiance(lightProbe, geometryNormal);\n\n #endif\n\n #ifdef DOUBLE_SIDED\n\n vIndirectBack += getAmbientLightIrradiance(ambientLightColor);\n\n #if defined(USE_LIGHT_PROBES)\n\n vIndirectBack += getLightProbeIrradiance(lightProbe, backGeometryNormal);\n\n #endif\n\n #endif\n\n /**\n * Calculate the point light.\n */\n #if NUM_POINT_LIGHTS > 0\n\n #pragma unroll_loop_start\n for (int i = 0; i < NUM_POINT_LIGHTS; i++) {\n getPointLightInfo(pointLights[i], geometryPosition, directLight);\n\n dotNL = dot(geometryNormal, directLight.direction);\n directLightColor_Diffuse = directLight.color;\n\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += saturate(-dotNL) * directLightColor_Diffuse;\n\n #endif\n\n }\n #pragma unroll_loop_end\n\n #endif\n\n /**\n * Calculate the spot light.\n */\n #if NUM_SPOT_LIGHTS > 0\n\n #pragma unroll_loop_start\n for (int i = 0; i < NUM_SPOT_LIGHTS; i++) {\n getSpotLightInfo(spotLights[i], geometryPosition, directLight);\n\n dotNL = dot(geometryNormal, directLight.direction);\n directLightColor_Diffuse = directLight.color;\n\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += saturate(-dotNL) * directLightColor_Diffuse;\n\n #endif\n }\n #pragma unroll_loop_end\n\n #endif\n\n /**\n * Calculate the directional light.\n */\n #if NUM_DIR_LIGHTS > 0\n\n #pragma unroll_loop_start\n for (int i = 0; i < NUM_DIR_LIGHTS;
436 i++) {\n getDirectionalLightInfo(directionalLights[i], directLight);\n\n dotNL = dot(geometryNormal, directLight.direction);\n directLightColor_Diffuse = directLight.color;\n\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += saturate(-dotNL) * directLightColor_Diffuse;\n\n #endif\n\n }\n #pragma unroll_loop_end\n\n #endif\n\n /**\n * Calculate the minimum of the light.\n */\n float minLight = min(vLightFront.r, min(vLightFront.g, vLightFront.b));\n\n /* Circle clipping with smoothstep AA */\n float pointDist = length(gl_PointCoord - 0.5);\n if (pointDist > uPointRadius) discard;\n float circleAlpha = 1.0 - smoothstep(uPointRadius - 0.1, uPointRadius, pointDist);\n\n /* Pulse flash: bright at outer circle, decaying inward only (outside = zero) */\n float pulseDist = distance(vWorldPosition.xz, uPulseCenter.xz);\n float behindFront = uPulseRadius - pulseDist;\n float pulseFlash = (1.0 - smoothstep(0.0, uPulseDecayWidth, max(behindFront, 0.0))) * step(0.0, behindFront) * uPulseOpacity;\n\n vec3 litColor = circleAlpha * vLightFront + uPulseColor * pulseFlash;\n float litAlpha = circleAlpha * minLight * opacity * vAttenuation + pulseFlash;\n\n gl_FragColor = vec4(litColor, litAlpha);\n\n #include <logdepthbuf_fragment>\n}\n",uniforms:i.LlO.merge([e3.UniformsLib.lights,{progress:new i.nc$(0),pointSize:new i.nc$(n),uResolution:new i.nc$(new i.I9Y(1,y.u.gis.point.referenceHeight)),uReferenceHeight:new i.nc$(y.u.gis.point.referenceHeight),uPointRadius:new i.nc$(y.u.gis.point.radius),opacity:new i.nc$(0),uPulseCenter:new i.nc$(new i.Pq0(0,0,0)),uPulseRadius:new i.nc$(0),uPulseOpacity:new i.nc$(0),uPulseDecayWidth:new i.nc$(y.u.gis.groundEffect.pulseDecayWidth),uPulseColor:new i.nc$(new i.Q1f(y.u.gis.groundEffect.pulseColor)),uCameraPosition:new i.nc$(new i.Pq0(0,0,0)),distanceNear:new i.nc$(y.u.gis.gisAttenuation.distanceNear),distanceFar:new i.nc$(y.u.gis.gisAttenuation.distanceFar),distanceMin:new i.nc$(y.u.gis.gisAttenuation.distanceMin)}])}),[n])}),e5=(0,o.forwardRef)((e,t)=>{let{color:n=new i.Q1f(0xffffff)}=e,r=(0,o.useRef)(null),l=(0,s.C)(e=>e.size);return(0,o.useImperativeHandle)(t,()=>({material:r.current})),(0,o.useEffect)(()=>{r.current&&r.current.uniforms.resolution.value.set(l.width,l.height)},[l.width,l.height]),(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:r,vertexColors:!0,transparent:!0,depthTest:!0,depthWrite:!0,lights:!0,side:i.$EB,vertexShader:"/**\n * Definitions of PI and other necessary constants for using light information\n */\n#include <common>\n/**\n * The punctualLightIntensityToIrradianceFactor function is necessary for loading light definitions\n */\n#include <logdepthbuf_pars_vertex>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n\n/**\n * The transition progress (0 â 1).\n */\nuniform float progress;\n\n/**\n * The line width in pixels.\n */\nuniform float lineWidth;\n\n/**\n * The viewport resolution in pixels.\n */\nuniform vec2 resolution;\n\n/*\n * Camera position in world space for distance attenuation.\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Distance attenuation: full opacity within this distance.\n */\nuniform float distanceNear;\n\n/*\n * Distance attenuation: minimum opacity beyond this distance.\n */\nuniform float distanceFar;\n\n/*\n * Distance attenuation: minimum opacity fraction.\n */\nuniform float distanceMin;\n\n/**\n * The start position of the segment.\n */\nattribute vec3 positionStart;\n\n/**\n * The end position of the segment.\n */\nattribute vec3 positionEnd;\n\n/**\n * Which endpoint this vertex belongs to (0.0 = start, 1.0 = end).\n */\nattribute float endpoint;\n\n/**\n * The side offset direction (+1 or -1).\n */\nattribute float side;\n\n/**\n * The view position.\n */\nvarying vec3 vViewPosition;\n/**\n * The view normal.\n */\nvarying vec3 vViewNormal;\n/*\n * The world position for pulse distance calculation.\n */\nvarying vec3 vWorldPosition;\n\n/*\n * Distance attenuation factor (0..1).\n */\nvarying float vAttenuation;\n\nvoid main() {\n /**\n * Animate Y axis with progress easing.\n */\n float ratio = clamp(linearstep(0.0, 1.0, progress), 0.0, 1.0);\n ratio = easeInOutCubic(ratio);\n\n vec3 animStart = vec3(positionStart.x, positionStart.y * ratio, positionStart.z);\n vec3 animEnd = vec3(positionEnd.x, positionEnd.y * ratio, positionEnd.z);\n\n /**\n * Project both endpoints to clip space.\n */\n vec4 clipStart = projectionMatrix * modelViewMatrix * vec4(animStart, 1.0);\n vec4 clipEnd = projectionMatrix * modelViewMatrix * vec4(animEnd, 1.0);\n\n /**\n * Compute screen-space direction and perpendicular normal.\n */\n vec2 aspectVec = resolution;\n vec2 ndcStart = clipStart.xy / clipStart.w;\n vec2 ndcEnd = clipEnd.xy / clipEnd.w;\n vec2 screenDir = normalize((ndcEnd - ndcStart) * aspectVec);\n vec2 screenNormal = vec2(-screenDir.y, screenDir.x);\n\n /**\n * Pixel offset converted to NDC.\n */\n vec2 offset = screenNormal * side * lineWidth * 0.5 / aspectVec;\n\n /**\n * Select clip position based on endpoint (0.0 = start, 1.0 = end).\n */\n vec4 clipPos = mix(clipStart, clipEnd, endpoint);\n clipPos.xy += offset * clipPos.w;\n\n gl_Position = clipPos;\n\n /**\n * Compute varying values for the selected endpoint.\n */\n vec3 currentPosition = mix(animStart, animEnd, endpoint);\n vec4 modelViewPosition = modelViewMatrix * vec4(currentPosition, 1.0
436);\n vec3 viewNormal = normalMatrix * vec3(0.0, 1.0, 0.0);\n\n vViewPosition = modelViewPosition.xyz;\n vViewNormal = viewNormal;\n vWorldPosition = (modelMatrix * vec4(currentPosition, 1.0)).xyz;\n\n /*\n * Camera distance attenuation.\n */\n float dist = distance(vWorldPosition, uCameraPosition);\n float farFade = mix(1.0, distanceMin, smoothstep(distanceNear, distanceFar, dist));\n vAttenuation = farFade;\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/**\n * The opacity of the polygon.\n */\nuniform float opacity;\n\n/**\n * The color of the segment.\n */\nuniform vec3 color;\n\n/*\n * Pulse wave center in GIS group local space.\n */\nuniform vec3 uPulseCenter;\n\n/*\n * Current pulse wave radius.\n */\nuniform float uPulseRadius;\n\n/*\n * Pulse global opacity.\n */\nuniform float uPulseOpacity;\n\n/*\n * Pulse flash trail width.\n */\nuniform float uPulseDecayWidth;\n\n/*\n * Pulse wave color.\n */\nuniform vec3 uPulseColor;\n/**\n * The view position.\n */\nvarying vec3 vViewPosition;\n/**\n * The view normal.\n */\nvarying vec3 vViewNormal;\n/*\n * The world position for pulse distance calculation.\n */\nvarying vec3 vWorldPosition;\n\n/*\n * Distance attenuation factor (0..1).\n */\nvarying float vAttenuation;\n\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <logdepthbuf_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <lights_pars_begin>\n/**\n * Custom shader chunks\n */\n#include <ftmr_easings>\n\n/**\n * **********************************\n * Main\n * ***********************************\n */\n\nvoid main() {\n #include <logdepthbuf_fragment>\n\n /**\n * Calculate the geometry position and normal.\n */\n vec3 geometryPosition = vViewPosition;\n vec3 geometryNormal = normalize(vViewNormal);\n\n /**\n * Calculate the light.\n */\n vec3 vLightFront = vec3(0.0);\n vec3 vIndirectFront = vec3(0.0);\n IncidentLight directLight;\n float dotNL;\n vec3 directLightColor_Diffuse;\n\n /**\n * Calculate the ambient light.\n */\n vIndirectFront += getAmbientLightIrradiance(ambientLightColor);\n\n #if defined(USE_LIGHT_PROBES)\n vIndirectFront += getLightProbeIrradiance(lightProbe, geometryNormal);\n #endif\n\n /**\n * Calculate the point light.\n */\n #if NUM_POINT_LIGHTS > 0\n #pragma unroll_loop_start\n for (int i = 0; i < NUM_POINT_LIGHTS; i++) {\n getPointLightInfo(pointLights[i], geometryPosition, directLight);\n dotNL = dot(geometryNormal, directLight.direction);\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n }\n #pragma unroll_loop_end\n #endif\n\n /**\n * Calculate the spot light.\n */\n #if NUM_SPOT_LIGHTS > 0\n #pragma unroll_loop_start\n for (int i = 0; i < NUM_SPOT_LIGHTS; i++) {\n getSpotLightInfo(spotLights[i], geometryPosition, directLight);\n dotNL = dot(geometryNormal, directLight.direction);\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n }\n #pragma unroll_loop_end\n #endif\n\n /**\n * Calculate the directional light.\n */\n #if NUM_DIR_LIGHTS > 0\n #pragma unroll_loop_start\n for (int i = 0; i < NUM_DIR_LIGHTS; i++) {\n getDirectionalLightInfo(directionalLights[i], directLight);\n dotNL = dot(geometryNormal, directLight.direction);\n directLightColor_Diffuse = directLight.color;\n vLightFront += saturate(dotNL) * directLightColor_Diffuse;\n }\n #pragma unroll_loop_end\n #endif\n\n /**\n * Calculate the minimum of the light for alpha attenuation.\n */\n float minLight = min(vLightFront.r, min(vLightFront.g, vLightFront.b));\n\n /**\n * Output lit color. RGB split is applied as post-process CA.\n */\n /* Pulse flash: bright at outer circle, decaying inward only (outside = zero) */\n float pulseDist = distance(vWorldPosition.xz, uPulseCenter.xz);\n float behindFront = uPulseRadius - pulseDist;\n float pulseFlash = (1.0 - smoothstep(0.0, uPulseDecayWidth, max(behindFront, 0.0))) * step(0.0, behindFront) * uPulseOpacity;\n\n vec3 litColor = color * (vLightFront + vIndirectFront) + uPulseColor * pulseFlash;\n float litAlpha = minLight * opacity * vAttenuation + pulseFlash;\n\n gl_FragColor = vec4(litColor, litAlpha);\n}\n",uniforms:i.LlO.merge([e3.UniformsLib.lights,{progress:new i.nc$(0),color:new i.nc$(n),opacity:new i.nc$(0),lineWidth:new i.nc$(y.u.gis.segment.lineWidth),resolution:new i.nc$(new i.I9Y(l.width,l.height)),uPulseCenter:new i.nc$(new i.Pq0(0,0,0)),uPulseRadius:new i.nc$(0),uPulseOpacity:new i.nc$(0),uPulseDecayWidth:new i.nc$(y.u.gis.groundEffect.pulseDecayWidth),uPulseColor:new i.nc$(new i.Q1f(y.u.gis.groundEffect.pulseColor)),uCameraPosition:new i.nc$(new i.Pq0(0,0,0)),distanceNear:new i.nc$(y.u.gis.gisAttenuation.distanceNear),distanceFar:new i.nc$(y.u.gis.gisAttenuation.distanceFar),distanceMin:new i.nc$(y.u.gis.gisAttenuation.distanceMin)}])}),[])}),e6=(0,o.forwardRef)((e,t)=>{let{...n}=e,r=(0,o.useRef)(null);(0,o.useImperativeHandle)(t,()=>({material:r.current}));let s=y.u.gis.trail,l=y.u.gis.trace.attenuation;return(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:r,transparent:!0,depthTest:!0,depthWrite:!1,side:i.$EB,blending:i.EZo,polygonOffset:!0,polygonOffsetFactor:-1,polygonOffsetUnits:-1,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/*\n * Progress along the entire trail route (0â1) for this vertex.\n */\nattribute float edgeProgress;\n\n/*\n * Cross-strip side (+1 or -1): distance from strip center for edge AA.\n */\nattribute float aSide;\n\n/*\n * Trail slot index (0 or 1) â selects the matching uniform entry.\n */\nattribute float aSlotIndex;\n\n/*\n * Per-slot head/tail/opacity uniforms (indexed by aSlotIndex).\n */\nuniform float uHeadProgress[2];\nuniform float uTailProgress[2];\nuniform float uOpacity[2];\n\n/*\n * Camera position in world space (for attenuation).\n */\nuniform vec3 uCameraPosition;\n\n/*\n * Distance attenuation uniforms.\n */\nuniform float distanceNear;\nuniform float distanceFar;\nuniform float distanceMin;\n\nvarying float vEdgeProgress;\nvarying float vHeadProgress;\nvarying float vTailProgress;\nvarying float vOpacity;\nvarying float vSide;\nvarying float vAttenuation;\n\nvoid main() {\n /* position is pre-computed on CPU with miter joints and Y offset */\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
436);\n\n int slot = int(aSlotIndex);\n vEdgeProgress = edgeProgress;\n vHeadProgress = uHeadProgress[slot];\n vTailProgress = uTailProgress[slot];\n vOpacity = uOpacity[slot];\n vSide = aSide;\n\n /* Distance from camera for light attenuation */\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n float dist = distance(worldPos.xyz, uCameraPosition);\n vAttenuation = mix(1.0, distanceMin, smoothstep(distanceNear, distanceFar, dist));\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"/*\n * Trail color.\n */\nuniform vec3 color;\n\n/*\n * Emissive intensity multiplier (1.0 for main mesh, < 1.0 for bloom source).\n */\nuniform float bloomIntensity;\n\n#include <logdepthbuf_pars_fragment>\n\nvarying float vEdgeProgress;\nvarying float vHeadProgress;\nvarying float vTailProgress;\nvarying float vOpacity;\nvarying float vSide;\nvarying float vAttenuation;\n\nvoid main() {\n #include <logdepthbuf_fragment>\n\n /* Hard wipe boundaries: uniform opacity across all visible vertices */\n if (vEdgeProgress > vHeadProgress || vEdgeProgress < vTailProgress) discard;\n\n /* Cross-strip edge anti-aliasing */\n float edgeFade = 1.0 - smoothstep(0.7, 1.0, abs(vSide));\n\n float finalAlpha = vOpacity * edgeFade * vAttenuation;\n if (finalAlpha < 0.001) discard;\n\n gl_FragColor = vec4(color * bloomIntensity * finalAlpha, finalAlpha);\n}\n",uniforms:{uCameraPosition:new i.nc$(new i.Pq0),color:new i.nc$(new i.Q1f(s.color)),bloomIntensity:new i.nc$(1),uHeadProgress:new i.nc$(new Float32Array(s.count)),uTailProgress:new i.nc$(new Float32Array(s.count)),uOpacity:new i.nc$(new Float32Array(s.count)),distanceNear:new i.nc$(l.distanceNear),distanceFar:new i.nc$(l.distanceFar),distanceMin:new i.nc$(l.distanceMin)},...n}),[])});e6.displayName="ProductGISTrailMaterial";let e9=y.u.gis.dust,e8=new i.Pq0(e9.drift.direction[0],e9.drift.direction[1],e9.drift.direction[2]).normalize(),e7=(0,o.forwardRef)((e,t)=>{let n=(0,o.useRef)(null);return(0,o.useImperativeHandle)(t,()=>({material:n.current})),(0,o.useMemo)(()=>(0,a.jsx)("shaderMaterial",{ref:n,vertexShader:"#include <common>\n#include <logdepthbuf_pars_vertex>\n\n/* Attributes */\nattribute vec3 aSeed;\nattribute float aSize;\n\n/* Uniforms - Motion */\nuniform float uTime;\nuniform vec3 uFreqLow;\nuniform vec3 uAmpLow;\nuniform vec3 uFreqHigh;\nuniform vec3 uAmpHigh;\nuniform vec3 uDriftDirection;\nuniform float uDriftSpeed;\n\n/* Uniforms - Bounds (wrap-around) */\nuniform vec3 uBoundsMin;\nuniform vec3 uBoundsMax;\n\n/* Uniforms - Size */\nuniform float uReferenceHeight;\nuniform vec2 uResolution;\n\n/* Uniforms - Attenuation */\nuniform vec3 uCameraPosition;\nuniform float uDistanceNear;\nuniform float uDistanceFar;\nuniform float uDistanceMin;\nuniform float uProximityNear;\nuniform float uProximityFar;\n\n/* Uniforms - Softness */\nuniform float uSoftnessDistanceNear;\nuniform float uSoftnessDistanceFar;\n\n/* Varyings */\nvarying float vAttenuation;\nvarying float vDistanceRatio;\n\nvoid main() {\n /* Per-particle frequency scale: 0.5ã1.5x base frequency */\n vec3 freqScale = vec3(0.5 + aSeed.x / PI, 0.5 + aSeed.y / PI, 0.5 + aSeed.z / PI);\n\n /* Brownian motion: 3 octaves with per-particle frequency variation */\n vec3 brownian = vec3(0.0);\n\n /* Octave 1: low frequency, large amplitude */\n brownian.x += sin(uTime * uFreqLow.x * freqScale.x + aSeed.x) * uAmpLow.x;\n brownian.y += sin(uTime * uFreqLow.y * freqScale.y + aSeed.y) * uAmpLow.y;\n brownian.z += sin(uTime * uFreqLow.z * freqScale.z + aSeed.z) * uAmpLow.z;\n\n /* Octave 2: high frequency, small amplitude */\n brownian.x += sin(uTime * uFreqHigh.x * freqScale.z + aSeed.x * 2.0) * uAmpHigh.x;\n brownian.y += sin(uTime * uFreqHigh.y * freqScale.x + aSeed.y * 2.0) * uAmpHigh.y;\n brownian.z += sin(uTime * uFreqHigh.z * freqScale.y + aSeed.z * 2.0) * uAmpHigh.z;\n\n /* Octave 3: cross-axis cos for lazy direction changes */\n brownian.x += cos(uTime * uFreqLow.z * freqScale.y + aSeed.z) * uAmpLow.x * 0.5;\n brownian.y += cos(uTime * uFreqLow.x * freqScale.z + aSeed.x) * uAmpLow.y * 0.3;\n brownian.z += cos(uTime * uFreqLow.y * freqScale.x + aSeed.y) * uAmpLow.z * 0.5;\n\n /* Global drift */\n vec3 drift = uDriftDirection * uDriftSpeed * uTime;\n\n /* Apply motion + wrap-around */\n vec3 pos = position + brownian + drift;\n vec3 boundsRange = uBoundsMax - uBoundsMin;\n pos = mod(pos - uBoundsMin, boundsRange) + uBoundsMin;\n\n /* Transform */\n vec4 worldPosition = modelMatrix * vec4(pos, 1.0
436);\n vec4 mvPosition = viewMatrix * worldPosition;\n\n gl_Position = projectionMatrix * mvPosition;\n\n /* Perspective point size */\n float dist = distance(worldPosition.xyz, uCameraPosition);\n float perspective = uResolution.y / uReferenceHeight / max(dist, 1.0) * uReferenceHeight;\n gl_PointSize = aSize * perspective;\n\n /* Y boundary fade: soft fade near top/bottom bounds */\n float yMargin = (uBoundsMax.y - uBoundsMin.y) * 0.1;\n float yFade = smoothstep(0.0, yMargin, pos.y - uBoundsMin.y) * smoothstep(0.0, yMargin, uBoundsMax.y - pos.y);\n\n /* Distance attenuation (far fade) */\n float farFade = mix(1.0, uDistanceMin, smoothstep(uDistanceNear, uDistanceFar, dist));\n\n /* Proximity attenuation (near fade) */\n float nearFade = smoothstep(uProximityNear, uProximityFar, dist);\n\n vAttenuation = farFade * nearFade * yFade;\n\n /* Distance ratio for softness interpolation */\n vDistanceRatio = smoothstep(uSoftnessDistanceNear, uSoftnessDistanceFar, dist);\n\n #include <logdepthbuf_vertex>\n}\n",fragmentShader:"#include <common>\n#include <logdepthbuf_pars_fragment>\n\n/* Uniforms */\nuniform vec3 uColor;\nuniform float uOpacity;\nuniform float uSoftnessNear;\nuniform float uSoftnessFar;\nuniform float uCAOffset;\n\n/* Varyings */\nvarying float vAttenuation;\nvarying float vDistanceRatio;\n\nvoid main() {\n vec2 center = vec2(0.5);\n float softness = mix(uSoftnessNear, uSoftnessFar, vDistanceRatio);\n float fade = uOpacity * vAttenuation;\n\n /* Per-channel circle with CA offset */\n float rDist = length(gl_PointCoord - center + vec2(uCAOffset, 0.0)) * 2.0;\n float gDist = length(gl_PointCoord - center) * 2.0;\n float bDist = length(gl_PointCoord - center - vec2(uCAOffset, 0.0)) * 2.0;\n\n /* Discard if all channels outside circle */\n if (rDist > 1.0 && gDist > 1.0 && bDist > 1.0) discard;\n\n float rAlpha = smoothstep(1.0, 1.0 - softness, rDist);\n float gAlpha = smoothstep(1.0, 1.0 - softness, gDist);\n float bAlpha = smoothstep(1.0, 1.0 - softness, bDist);\n\n gl_FragColor = vec4(uColor.r * rAlpha * fade, uColor.g * gAlpha * fade, uColor.b * bAlpha * fade, max(rAlpha, max(gAlpha, bAlpha)) * fade);\n\n #include <logdepthbuf_fragment>\n}\n",transparent:!0,depthTest:!0,depthWrite:!1,blending:i.bCz,blendSrc:i.qad,blendDst:i.OuU,uniforms:{uTime:new i.nc$(0),uFreqLow:new i.nc$(new i.Pq0(e9.brownian.freqLow[0],e9.brownian.freqLow[1],e9.brownian.freqLow[2])),uAmpLow:new i.nc$(new i.Pq0(e9.brownian.ampLow[0],e9.brownian.ampLow[1],e9.brownian.ampLow[2])),uFreqHigh:new i.nc$(new i.Pq0(e9.brownian.freqHigh[0],e9.brownian.freqHigh[1],e9.brownian.freqHigh[2])),uAmpHigh:new i.nc$(new i.Pq0(e9.brownian.ampHigh[0],e9.brownian.ampHigh[1],e9.brownian.ampHigh[2])),uDriftDirection:new i.nc$(e8),uDriftSpeed:new i.nc$(e9.drift.speed),uBoundsMin:new i.nc$(new i.Pq0(e9.bounds.minX,e9.bounds.minY,e9.bounds.minZ)),uBoundsMax:new i.nc$(new i.Pq0(e9.bounds.maxX,e9.bounds.maxY,e9.bounds.maxZ)),uReferenceHeight:new i.nc$(e9.referenceHeight),uResolution:new i.nc$(new i.I9Y(1,e9.referenceHeight)),uColor:new i.nc$(new i.Q1f(e9.color)),uOpacity:new i.nc$(0),uSoftnessNear:new i.nc$(e9.softnessNear),uSoftnessFar:new i.nc$(e9.softnessFar),uSoftnessDistanceNear:new i.nc$(e9.softnessDistanceNear),uSoftnessDistanceFar:new i.nc$(e9.softnessDistanceFar),uCAOffset:new i.nc$(e9.caOffset),uCameraPosition:new i.nc$(new i.Pq0(0,0,0)),uDistanceNear:new i.nc$(e9.attenuation.distanceNear),uDistanceFar:new i.nc$(e9.attenuation.distanceFar),uDistanceMin:new i.nc$(e9.attenuation.distanceMin),uProximityNear:new i.nc$(e9.attenuation.proximityNear),uProximityFar:new i.nc$(e9.attenuation.proximityFar)},...e}),[])});e7.displayName="ProductGISDustMaterial";let te=y.u.gis.dust,tt=2*Math.PI,tn=(0,o.forwardRef)((e,t)=>{let{layers:n}=e,r=(0,o.useRef)(null),s=(0,o.useRef)(null),l=(0,o.useRef)(0),u=(0,o.useMemo)(()=>{let e=te.count,t=new Float32Array(3*e),n=new Float32Array(3*e),r=new Float32Array(e),{minX:a,maxX:o,minY:s,maxY:l,minZ:u,maxZ:c}=te.bounds;for(let i=0;i<e;i++){let e=3*i;t[e]=a+Math.random()*(o-a),t[e+1]=s+Math.random()*(l-s),t[e+2]=u+Math.random()*(c-u),n[e]=Math.random()*tt,n[e+1]=Math.random()*tt,n[e+2]=Math.random()*tt,r[i]=te.sizeMin+Math.random()*(te.sizeMax-te.sizeMin)}let f=new i.LoY;return f.setAttribute("position",new i.THS(t,3)),f.setAttribute("aSeed",new i.THS(n,3)),f.setAttribute("aSize",new i.THS(r,1)),f},[]);(0,o.useEffect)(()=>()=>{u.dispose()},[u]);let[f,d]=(0,m.zh)(()=>({from:{opacity:0}
436,onChange:e=>{s.current&&(s.current.material.uniforms.uOpacity.value=e.value.opacity*te.opacity)}}),[]);(0,c.Ql)((e,t)=>{if(!s.current)return;let n=s.current.material;l.current+=t,n.uniforms.uTime.value=l.current,n.uniforms.uCameraPosition.value.copy(e.camera.position);let{width:r,height:a}=e.size;n.uniforms.uResolution.value.set(r,a)});let p=(e,t)=>{d.stop(!0),d.start({to:{opacity:1},delay:t,config:{duration:e,easing:m.le.easeOutCubic}})},h=(e,t)=>{d.stop(!0),d.start({to:{opacity:0},delay:t,config:{duration:e,easing:m.le.easeOutCubic}})};return(0,o.useImperativeHandle)(t,()=>({present:p,dismiss:h,points:r.current})),(0,a.jsx)("points",{ref:r,geometry:u,layers:n,renderOrder:200,children:(0,a.jsx)(e7,{ref:s})})});tn.displayName="ProductGISDustRenderer";let tr=y.u.gis.pathFinder.count,ta=y.u.gis.pathFinder.connection,to=y.u.gis.pathFinder.ring.radius*ta.endpointRadiusRatio,ti=ta.distanceThreshold*ta.distanceThreshold,ts=y.u.gis.trace.attenuation,tl=tr*(tr-1)/2,tu=ta.subSegments,tc=tu+1,tf=2*tc,td=tl*tf,tm=6*tu*tl,tp=(e,t,n,r)=>{let a=e-r.x,o=t-r.y,i=n-r.z,s=Math.sqrt(a*a+o*o+i*i),l=Math.min(1,Math.max(0,(s-ts.distanceNear)/(ts.distanceFar-ts.distanceNear))),u=1+(ts.distanceMin-1)*(l*l*(3-2*l)),c=Math.min(1,Math.max(0,(s-ts.proximityNear)/(ts.proximityFar-ts.proximityNear)));return c*c*(3-2*c)*u},th=(e,t,n,r,a)=>{let o=n-e,i=r-t,s=0,l=1;if(1e-8>Math.abs(o)){if(e<a.minX||e>a.maxX)return!1}else{let t=1/o,n=(a.minX-e)*t,r=(a.maxX-e)*t;if(n>r){let e=n;n=r,r=e}if((s=Math.max(s,n))>(l=Math.min(l,r)))return!1}if(1e-8>Math.abs(i)){if(t<a.minZ||t>a.maxZ)return!1}else{let e=1/i,n=(a.minZ-t)*e,r=(a.maxZ-t)*e;if(n>r){let e=n;n=r,r=e}if((s=Math.max(s,n))>(l=Math.min(l,r)))return!1}return!0},tg=(e,t,n,r,a)=>{for(let o=0;o<a.length;o++)if(th(e,t,n,r,a[o]))return!0;return!1},tv=(0,o.forwardRef)((e,t)=>{let{agents:n,getThumbPositions:r,groundHeightmap:s}=e,l=(0,o.useRef)(null),u=(0,o.useRef)(null),f=(0,o.useRef)(null),d=(0,o.useRef)(null),m=(0,o.useRef)(!1),p=(0,o.useRef)(new Float32Array(tl)),h=(0,o.useRef)([]),[g,v]=(0,o.useState)(null);(0,o.useEffect)(()=>{let e=new i.LoY,t=new Float32Array(3*td),n=new Float32Array(3*td),r=new Float32Array(td),o=new Float32Array(td),s=new Float32Array(3*td),l=new Float32Array(3*td),c=new Float32Array(td),m=new Uint32Array(tm);for(let e=0;e<tl;e++){let t=e*tf;for(let e=0;e<tc;e++){let n=e/tu,a=t+2*e+0,i=t+2*e+1;r[a]=n,r[i]=n,o[a]=1,o[i]=-1}for(let n=0;n<tu;n++){let r=t+2*n+0,a=t+2*n+1,o=t+(n+1)*2+0,i=t+(n+1)*2+1,s=(e*tu+n)*6;m[s+0]=r,m[s+1]=a,m[s+2]=o,m[s+3]=o,m[s+4]=a,m[s+5]=i}}return e.setAttribute("aEndpointA",new i.THS(t,3)),e.setAttribute("aEndpointB",new i.THS(n,3)),e.setAttribute("aSubSegT",new i.THS(r,1)),e.setAttribute("aSide",new i.THS(o,1)),e.setAttribute("aPrev",new i.THS(s,3)),e.setAttribute("aNext",new i.THS(l,3)),e.setAttribute("aOpacity",new i.THS(c,1)),e.setIndex(new i.THS(m,1)),d.current=e,v((0,a.jsx)("mesh",{ref:u,geometry:e,frustumCulled:!1,renderOrder:300,children:(0,a.jsx)(e2,{ref:f})})),()=>{e.dispose()}},[]),(0,c.Ql)((e,t)=>{if(!m.current)return;let r=d.current;if(!r)return;if(f.current){let t=f.current.material.uniforms;t.uResolution.value.set(e.size.width,e.size.height),t.uHeightmap.value=s.texture,t.uHeightmapWorldMin.value.copy(s.worldMin),t.uHeightmapWorldSize.value.copy(s.worldSize),t.uHeightmapReady.value=+!!s.ready}let a=e.camera.position,o=r.attributes.aEndpointA,i=r.attributes.aEndpointB,l=r.attributes.aPrev,u=r.attributes.aNext,c=r.attributes.aOpacity,g=o.array,v=i.array,x=l.array,y=u.array,w=c.array,R=p.current,C=1e3*t/ta.fadeDuration,b=h.current,S=ta.yOffset,T=1/tu,P=0;for(let e=0;e<tr;e++)for(let t=e+1;t<tr;t++){let r=n[e],o=n[t],i=!1;if(r.visible&&o.visible&&r.phase===el.MOVING&&o.phase===el.MOVING){let e=r.position.x-o.position.x,t=r.position.z-o.position.z;e*e+t*t<ti&&!tg(r.position.x,r.position.z,o.position.x,o.position.z,b)&&(i=!0)}i?R[P]=Math.min(1,R[P]+C):R[P]=Math.max(0,R[P]-C);let s=R[P],l=P*tf;if(s>ta.visibilityThreshold){let e=r.position.x,t=r.position.y+S,n=r.position.z,i=o.position.x,u=o.position.y+S,c=o.position.z,f=i-e,d=c-n,m=Math.sqrt(f*f+d*d);if(m>2*to){let p=1/m,h=f*p,R=d*p,C=e+h*to,b=n+R*to,S=i-h*to,P=c-R*to,M=s*ta.baseOpacity*Math.min(r.thumbFade,o.thumbFade),A=tp(e,t,n,a),D=tp(i,u,c,a),_=M*A,I=M*D;for(let e=0;e<tc;e++){let n=e*T,r=Math.max(0,(e-1)*T),a=Math.min(1,(e+1)*T),o=C+(S-C)*r,i=t+(u-t)*r,s=b+(P-b)*r,c=C+(S-C)*a,f=t+(u-t)*a,d=b+(P-b)*a,m=_+(I-_)*n;for(let n=0;n<2;n++){let r=l+2*e+n,a=3*r;g[a+0]=C,g[a+1]=t,g[a+2]=b,v[a+0]=S,v[a+1]=u,v[a+2]=P,x[a+0]=o,x[a+1]=i,x[a+2]=s,y[a+0]=c,y[a+1]=f,y[a+2]=d,w[r]=m}}}else for(let e=0;e<tf;e++)w[l+e]=0}else for(let e=0;e<tf;e++)w[l+e]=0;P++}o.needsUpdate=!0,i.needsUpdate=!0,l.needsUpdate=!0,u.needsUpdate=!0,c.needsUpdate=!0});let x=()=>{m.current=!0,h.current=es(r(),y.u.gis.pathFinder.thumb.margin)},w=()=>{m.current=!1,p.current.fill(0);let e=d.current;if(e){let t=e.attributes.aOpacity;t.array.fill(0),t.needsUpdate=!0}};return(0,o.useImperativeHandle)(t,()=>({present:x,dismiss:w,group:l.current})),(0,a.jsx)("group",{ref:l,children:g})});tv.displayName="ProductGISPathFinderConnectionRenderer";let tx=y.u.gis.trail,ty=tx.targetDistanceMin,tw=tx.targetDistanceMax,tR=tx.endpointSamples,tC=(e,t,n,r)=>{let a=[0],o=0;for(let t=0;t<n.length;t++)o+=e.edgeWeights[n[t]],a.push(r>0?o/r:0);return{route:t,routeSegIndices:n,routeFractions:a,totalLength:r}},tb=(0,o.forwardRef)((e,t)=>{let n,r,l,{layers:u,pointColor:f=y.u.gis.point.color,thumbPositions:d=[],onPulseUpd
436ate:p}=e,h=(0,o.useRef)(p);h.current=p;let{setIsProductGISRendererReady:g,gisPointDataset:x,gisSegmentDataset:w,gisMeshGeometry:R,productScene:C,gisGroup:b,gisGroundMesh:S,bloomEnabled:T}=(0,o.useContext)(v.z_),P=(0,o.useRef)(null),M=(0,o.useRef)(null),A=(0,o.useRef)(null),D=(0,o.useRef)(null),_=(0,o.useRef)(null),I=(0,o.useRef)(null),E=(0,o.useRef)(null),U=(0,o.useRef)(null),O=(0,o.useRef)(null),F=(0,o.useRef)(null),[N,L]=(0,o.useState)(0),z=(0,o.useRef)(null),V=(0,o.useRef)(null),G=(0,o.useRef)(null),B=(0,o.useRef)(null),j=(0,o.useRef)(null),$=(0,o.useRef)(null),W=(0,o.useRef)(null),H=(0,o.useRef)(null),Y=(0,o.useRef)(null),X=(0,o.useRef)(null),Z=(0,o.useRef)(null),Q=(0,o.useRef)(null),K=y.u.gis.pathFinder.count,J=(0,o.useRef)(new Float32Array(K)),ee=(0,o.useRef)(new Float32Array(K).fill(1)),{build:et,graphRef:en}=(r=(0,k.c)(1),l=(0,o.useRef)(null),r[0]===Symbol.for("react.memo_cache_sentinel")?(n={build:e=>{let t=(e=>{let{vertices:t,lines:n}=e,r=y.u.gis.dataScale,a=new Int32Array(t.length),o=new Map;for(let e=0;e<t.length;e++){let n=t[e],r=er(n[0],n[1],n[2]),i=o.get(r);void 0!==i?a[e]=i:(o.set(r,e),a[e]=e)}let i=new Float32Array(3*t.length);for(let e=0;e<t.length;e++){let n=t[e];i[3*e]=n[0]*r,i[3*e+1]=n[1]*r,i[3*e+2]=n[2]*r}let s=new Map;for(let e=0;e<n.length;e++){let[t,r]=n[e],o=a[t],i=a[r];o!==i&&(s.has(o)||s.set(o,[]),s.has(i)||s.set(i,[]),s.get(o).push({to:i,segIdx:e}),s.get(i).push({to:o,segIdx:e}))}let l=new Float32Array(n.length);for(let e=0;e<n.length;e++){let[t,r]=n[e],o=a[t],s=a[r];if(o===s){l[e]=0;continue}let u=3*o,c=3*s,f=i[c]-i[u],d=i[c+1]-i[u+1],m=i[c+2]-i[u+2];l[e]=Math.sqrt(f*f+d*d+m*m)}let u=Array.from(s.keys()),{bounds:c,cellSize:f}=y.u.gis.pathFinder.spawn,d=Math.max(1,Math.ceil((c.maxX-c.minX)/f)),m=Math.max(1,Math.ceil((c.maxZ-c.minZ)/f)),p=d*m,h=Array.from({length:p},()=>[]);for(let e=0;e<n.length;e++){let[t,r]=n[e],o=a[t],s=a[r];if(o===s)continue;let l=3*o,u=3*s,p=(i[l]+i[u])*.5,g=(i[l+2]+i[u+2])*.5;if(p<c.minX||p>c.maxX||g<c.minZ||g>c.maxZ)continue;let v=Math.min(d-1,Math.floor((p-c.minX)/f));h[Math.min(m-1,Math.floor((g-c.minZ)/f))*d+v].push(e)}return{adjacency:s,positions:i,lines:n,remap:a,edgeWeights:l,canonicalKeys:u,spawnGrid:{cols:d,rows:m,originX:c.minX,originZ:c.minZ,cellSize:f,cellSegments:h,cellCount:p}}})(e);return l.current=t,t},graphRef:l},r[0]=n):n=r[0],n),eu=(0,o.useCallback)(()=>d,[d]),ec=(e=>{let{graphRef:t,trailGeometryRef:n,getThumbPositions:r}=e,a=(0,o.useRef)(!1),s=(0,o.useRef)([]),l=(0,o.useRef)([]),u=(0,o.useRef)(0),c=(0,o.useCallback)(()=>{let e=n.current;if(!e)return;let t=tx.maxSegments,r=tx.count*t,a=4*r,o=6*r;e.setAttribute("position",new i.THS(new Float32Array(3*a),3)),e.setAttribute("edgeProgress",new i.THS(new Float32Array(a),1));let s=new Float32Array(a);for(let e=0;e<r;e++){let t=4*e;s[t]=1,s[t+1]=-1,s[t+2]=1,s[t+3]=-1}e.setAttribute("aSide",new i.THS(s,1));let l=new Float32Array(a);for(let e=0;e<tx.count;e++){let n=e*t*4,r=4*t;for(let t=0;t<r;t++)l[n+t]=e}e.setAttribute("aSlotIndex",new i.THS(l,1));let u=new Uint32Array(o);for(let e=0;e<r;e++){let t=4*e,n=6*e;u[n]=t,u[n+1]=t+1,u[n+2]=t+2,u[n+3]=t+2,u[n+4]=t+1,u[n+5]=t+3}e.setIndex(new i.THS(u,1)),e.setDrawRange(0,o)},[n]),f=(e,t,n)=>{if(t.length<2)return{px:1,pz:0};let r=3*t[n],a=e[r],o=e[r+2],i=0,s=0,l=!1;if(n>0){let r=3*t[n-1],u=Math.sqrt((i=a-e[r])*i+(s=o-e[r+2])*s);u>tx.miterEpsilon&&(i/=u,s/=u,l=!0)}let u=0,c=0,f=!1;if(n<t.length-1){let r=3*t[n+1],i=Math.sqrt((u=e[r]-a)*u+(c=e[r+2]-o)*c);i>tx.miterEpsilon&&(u/=i,c/=i,f=!0)}if(!l&&f)return{px:-c,pz:u};if(l&&!f)return{px:-s,pz:i};if(!l&&!f)return{px:1,pz:0};let d=i+u,m=s+c,p=Math.sqrt(d*d+m*m);if(p<tx.miterEpsilon)return{px:-s,pz:i};let h=-m/p,g=d/p,v=tx.miterMaxScale,x=-(h*s)+g*i,y=Math.abs(x)>tx.miterEpsilon?Math.min(1/Math.abs(x),v):1;return{px:h*y,pz:g*y}},d=(0,o.useCallback)((e,r)=>{let a=n.current,o=t.current;if(!a||!o)return;let i=tx.maxSegments,s=e*i*4,l=tx.lineWidth,u=tx.yOffset,c=a.getAttribute("position"),d=a.getAttribute("edgeProgress"),{positions:m}=o;for(let e=0;e<i;e++){let t=s+4*e;if(e>=r.route.length-1){for(let e=0;e<4;e++)c.setXYZ(t+e,0,0,0),d.setX(t+e,0);continue}let n=r.route[e],a=r.route[e+1],o=3*n,i=3*a,p=m[o],h=m[o+1]+u,g=m[o+2],v=m[i],x=m[i+1]+u,y=m[i+2],w=f(m,r.route,e),R=f(m,r.route,e+1),C=r.routeFractions[e]??0,b=r.routeFractions[e+1]??1;c.setXYZ(t,p+w.px*l,h,g+w.pz*l),c.setXYZ(t+1,p-w.px*l,h,g-w.pz*l),c.setXYZ(t+2,v+R.px*l,x,y+R.pz*l),c.setXYZ(t+3,v-R.px*l,x,y-R.pz*l),d.setX(t,C),d.setX(t+1,C),d.setX(t+2,b),d.setX(t+3,b)}c.needsUpdate=!0,d.needsUpdate=!0},[n,t]),m=(0,o.useCallback)((e,n,r)=>{let a=t.current;if(!a)return;
436let o={...((e,t,n)=>{let{positions:r,canonicalKeys:a}=e,o=n*ty,i=n*tw,s=a.length,l=tx.maxSegments,u=tx.maxRouteAttempts;for(let n=0;n<u;n++){let c=a[0],f=a[1],d=1/0;for(let e=0;e<tR;e++){let e=a[Math.floor(Math.random()*s)],t=a[Math.floor(Math.random()*s)];if(e===t)continue;let n=Math.abs(ea(r,e,t)-(o+i)*.5);n<d&&(d=n,c=e,f=t)}let m=ei(e,c,f,t);if(m&&m.route.length>1){if(m.route.length-1<=l)return tC(e,m.route,m.segIndices,m.totalLength);if(n===u-1){let t=m.route.slice(0,l+1),n=m.segIndices.slice(0,l),r=0;for(let t=0;t<n.length;t++)r+=e.edgeWeights[n[t]];return tC(e,t,n,r)}}}let c=a[0],f=a[1];return{route:[c,f],routeSegIndices:[],routeFractions:[0,1],totalLength:ea(r,c,f)}})(a,l.current,u.current),phase:n,timer:r,headProgress:0,tailProgress:0,opacity:1===n?tx.opacity:0};s.current[e]=o,d(e,o)},[t,d]),p=(0,o.useCallback)(()=>{let e=t.current;if(!e)return;a.current=!0,l.current=es(r(),tx.thumbMargin),u.current=(e=>{let{positions:t,canonicalKeys:n}=e,r=1/0,a=-1/0,o=1/0,i=-1/0;for(let e=0;e<n.length;e++){let s=3*n[e],l=t[s],u=t[s+2];l<r&&(r=l),l>a&&(a=l),u<o&&(o=u),u>i&&(i=u)}return Math.sqrt((a-r)**2+(i-o)**2)})(e);let n=y.u.gis.trace.initialStagger;s.current=[];for(let e=0;e<tx.count;e++)m(e,3,-(Math.random()*n))},[t,m,r]),h=(0,o.useCallback)(()=>{for(let e of(a.current=!1,s.current))e&&(e.opacity=0)},[]);return{start:p,stop:h,update:(0,o.useCallback)(e=>{if(!a.current)return;let t=1e3*e;for(let e=0;e<s.current.length;e++){let n=s.current[e];if(n)switch(n.timer+=t,n.phase){case 1:n.headProgress=Math.min(n.timer/tx.headDuration,1),n.tailProgress=0,n.opacity=tx.opacity,n.timer>=tx.headDuration&&(n.phase=2,n.timer=0);break;case 2:{n.tailProgress=Math.min(n.timer/tx.tailDuration,1),n.headProgress=1;let e=(n.tailProgress-tx.fadeStart)/(1-tx.fadeStart);e>0?n.opacity=tx.opacity*(1-Math.min(e,1)):n.opacity=tx.opacity,n.timer>=tx.tailDuration&&(n.phase=3,n.timer=0,n.opacity=0);break}case 3:n.opacity=0,n.timer>=tx.delay&&m(e,1,0)}}},[m]),setupGeometry:c,getTrailStates:(0,o.useCallback)(()=>s.current,[])}})({graphRef:en,trailGeometryRef:G,getThumbPositions:eu}),ef=(e=>{let{graphRef:t,pathFinderGeometryRef:n,getThumbPositions:r}=e,a=y.u.gis.pathFinder,s=(0,o.useRef)(!1),l=(0,o.useRef)([]),u=(0,o.useRef)(new Set),c=(0,o.useRef)(!1),f=(0,o.useRef)(Array.from({length:a.count},(e,t)=>({position:new i.Pq0,phase:el.DEAD,heading:0,speed:0,nodeIndex:t,visible:!1,thumbFade:0}))),d=(0,o.useCallback)(()=>{let e=n.current;if(!e)return;let t=a.count,r=2*t,o=4*r,s=6*r,l=new Float32Array(3*o),u=new Float32Array(2*o),c=new Float32Array(o),f=new Float32Array(o),d=new Uint32Array(s);for(let e=0;e<r;e++){let n=4*e,r=6*e,a=+(e<t);for(let e=0;e<4;e++){let t=n+e;u[2*t]=eK[e][0],u[2*t+1]=eK[e][1],f[t]=a}d[r]=n,d[r+1]=n+1,d[r+2]=n+2,d[r+3]=n+2,d[r+4]=n+1,d[r+5]=n+3}e.setAttribute("position",new i.THS(l,3)),e.setAttribute("aUv",new i.THS(u,2)),e.setAttribute("aOpacity",new i.THS(c,1)),e.setAttribute("aIsRing",new i.THS(f,1)),e.setAttribute("aDotScale",new i.THS(new Float32Array(o),1)),e.setAttribute("aRingProgress",new i.THS(new Float32Array(o),1)),e.setIndex(new i.THS(d,1)),e.setDrawRange(0,s)},[n,a.count]),{advanceAgent:m,getVertexPos:p}=(e=>{let t,n,r,a=(0,k.c)(8),{occupiedCellsRef:o}=e;a[0]!==o?(t=(e,t,n)=>{let r=n.adjacency.get(e);if(!r||0===r.length)return null;let a=o.current,{cols:i,originX:s,originZ:l,cellSize:u}=n.spawnGrid,c=r.filter(e=>e.to!==t),f=c.length>0?c:r,d=f.filter(e=>{let t=3*e.to,r=Math.floor((n.positions[t]-s)/u),o=Math.floor((n.positions[t+2]-l)/u);return!a.has(o*i+r)}),m=d.length>0?d:f;return m[Math.floor(Math.random()*m.length)]},a[0]=o,a[1]=t):t=a[1];let i=t;a[2]!==i||a[3]!==o?(n=(e,t,n)=>{let r=e.speed*t;for(let t=0;t<8&&r>0;t++){let[t,a,o]=eZ(n.positions,e.fromVertex),[s,l,u]=eZ(n.positions,e.toVertex),c=s-t,f=l-a,d=u-o,m=Math.sqrt(c*c+f*f+d*d)||1,p=(1-e.segmentProgress)*m;if(r<p)e.segmentProgress=e.segmentProgress+r/m,r=0;else{r-=p;let t=i(e.toVertex,e.fromVertex,n);t?(e.prevVertex=e.fromVertex,e.fromVertex=e.toVertex,e.toVertex=t.to,e.segIdx=t.segIdx,e.segmentProgress=0):(e.segmentProgress=1,r=0)}}let a=Math.min(1,Math.max(0,e.segmentProgress)),[s,l,u]=eZ(n.positions,e.fromVertex),[c,f,d
436]=eZ(n.positions,e.toVertex),m=s+(c-s)*a,p=u+(d-u)*a,h=o.current,g=eQ(m,p,n);return g!==e.cellIndex&&(e.cellIndex>=0&&h.delete(e.cellIndex),g>=0&&h.add(g),e.cellIndex=g),{wx:m,wy:l+(f-l)*a,wz:p,dirX:c-s,dirZ:d-u}},a[2]=i,a[3]=o,a[4]=n):n=a[4];let s=n;return a[5]!==s||a[6]!==i?(r={advanceAgent:s,chooseNextEdge:i,getVertexPos:eZ,getCellIndex:eQ},a[5]=s,a[6]=i,a[7]=r):r=a[7],r})({occupiedCellsRef:u}),{spawnAgent:h}=(e=>{let t,n,r,a=(0,k.c)(8),{occupiedCellsRef:i,agentsRef:s,snapshotsRef:l}=e,u=y.u.gis.pathFinder,c=(0,o.useRef)(s).current;a[0]!==s||a[1]!==l?(t=(e,t,n,r)=>{let a=n*n,o=s.current;for(let n=0;n<o.length;n++){if(n===r)continue;let i=o[n];if(!i||i.phase===el.DEAD)continue;let s=l.current[n];if(!s)continue;let u=e-s.position.x,c=t-s.position.z;if(u*u+c*c<a)return!1}return!0},a[0]=s,a[1]=l,a[2]=t):t=a[2];let f=t;a[3]!==f||a[4]!==i?(n=(e,t)=>{let n=i.current,{cellSegments:r,cellCount:a}=t.spawnGrid,o=u.spawn.minSpawnDistance,s=t.positions,l=[];for(let e=0;e<a;e++)!n.has(e)&&r[e].length>0&&l.push(e);let d=l.length>0?l:(()=>{let e=[];for(let t=0;t<a;t++)r[t].length>0&&e.push(t);return e})();if(0===d.length)return;let m=Math.min(d.length,y.u.gis.pathFinder.spawn.maxCellAttempts),p=y.u.gis.pathFinder.spawn.maxSegAttempts;for(let a=0;a<m;a++){let a=Math.floor(Math.random()*d.length),i=d[a],l=r[i];for(let r=0;r<Math.min(p,l.length);r++){let r=l[Math.floor(Math.random()*l.length)],[a,d]=t.lines[r],m=t.remap[a],p=t.remap[d],h=Math.random(),g=3*m,v=3*p;if(f(s[g]+(s[v]-s[g])*h,s[g+2]+(s[v+2]-s[g+2])*h,o,e)){let t=u.speed*(1+(2*Math.random()-1)*u.speedVariance),a=u.lifetime*(1+(2*Math.random()-1)*u.lifetimeVariance);n.add(i),c.current[e]={phase:el.SPAWN_DOT,segIdx:r,fromVertex:m,toVertex:p,segmentProgress:h,speed:t,dotOpacity:0,dotScale:0,ringProgress:0,timer:0,aliveTime:0,lifetime:a,prevVertex:m,thumbFade:1,cellIndex:i};return}}}},a[3]=f,a[4]=i,a[5]=n):n=a[5];let d=n;return a[6]!==d?(r={spawnAgent:d},a[6]=d,a[7]=r):r=a[7],r})({occupiedCellsRef:u,agentsRef:l,snapshotsRef:f}),{resetAgents:g,tickAgent:v}=(e=>{let t,n,r,a,i=(0,k.c)(9),{agentsRef:s,snapshotsRef:l,occupiedCellsRef:u,advanceAgent:c,spawnAgent:f,getVertexPos:d}=e,m=y.u.gis.pathFinder,p=(0,o.useRef)(s).current,h=(0,o.useRef)(l).current;i[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],i[0]=t):t=i[0];let g=(0,o.useRef)(t);i[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{p.current=Array(m.count);for(let e=0;e<m.count;e++){let t=h.current[e];t.position.set(0,0,0),t.phase=el.DEAD,t.heading=0,t.speed=0,t.visible=!1}g.current=es(e,m.thumb.margin);let t=y.u.gis.trace.initialStagger;for(let e=0;e<m.count;e++)p.current[e]={phase:el.DEAD,segIdx:0,fromVertex:0,toVertex:0,segmentProgress:0,speed:0,dotOpacity:0,dotScale:0,ringProgress:0,timer:-(Math.random()*t),aliveTime:0,lifetime:0,prevVertex:0,thumbFade:1,cellIndex:-1}},i[1]=n):n=i[1];let v=n;i[2]!==c||i[3]!==d||i[4]!==u||i[5]!==f?(r=(e,t,n)=>{let r=p.current[e];if(!r)return null;let a=1e3*t,o=null;switch(r.phase){case el.SPAWN_DOT:{r.timer=r.timer+a;let e=Math.min(1,r.timer/m.dotInDuration);r.dotOpacity=e,r.dotScale=e,r.ringProgress=0,r.timer>=m.dotInDuration&&(r.phase=el.SPAWN_RING,r.timer=0,r.dotOpacity=1,r.dotScale=1);break}case el.SPAWN_RING:r.timer=r.timer+a,r.ringProgress=Math.min(1,r.timer/m.ringInDuration),r.timer>=m.ringInDuration&&(r.phase=el.MOVING,r.timer=0,r.ringProgress=1);break;case el.MOVING:r.aliveTime=r.aliveTime+a,o=c(r,t,n),r.aliveTime>=r.lifetime&&(r.phase=el.DIE_RING,r.timer=0);break;case el.DIE_RING:r.timer=r.timer+a,r.aliveTime=r.aliveTime+a,r.ringProgress=Math.max(0,1-r.timer/m.ringOutDuration),o=c(r,t,n),r.timer>=m.ringOutDuration&&(r.phase=el.DIE_DOT,r.timer=0,r.ringProgress=0);break;case el.DIE_DOT:{r.timer=r.timer+a,r.aliveTime=r.aliveTime+a;let e=Math.max(0,1-r.timer/m.dotOutDuration);r.dotOpacity=e,r.dotScale=e,o=c(r,t,n),r.timer>=m.dotOutDuration&&(r.phase=el.DEAD,r.timer=0,r.dotOpacity=0,r.dotScale=0,u.current.delete(r.cellIndex),r.cellIndex=-1);break}case el.DEAD:r.timer=r.timer+a,r.timer>=m.respawnDelay&&f(e,n)}if(r.phase!==el.DEAD){let t,i,s,l,u;if(o)({wx:t,wy:i,wz:s,dirX:l,dirZ:u}=o);else{let e=Math.min(1,Math.max(0,r.segmentProgress)),[a,o,c]=d(n.positions,r.fromVertex),[f,m,p]=d(n.positions,r.toVertex);t=a+(f-a)*e,i=o+(m-o)*e,s=c+(p-c)*e,l=f-a,u=p-c}eo(t,s,g.current)?r.thumbFade=Math.max(0,r.thumbFade-a/m.thumb.fadeOutDuration):r.thumbFade=Math.min(1,r.thumbFade+a/m.thumb.fadeInDuration);let c=h.current[e];c&&(c.position.set(t,i,s),c.phase=r.phase,c.speed=r.speed,c.heading=Math.atan2(l,u),c.visible=r.thumbFade>m.thumbFadeVisibilityThreshold,c.thumbFade=r.thumbFade);let f=r.dotOpacity*r.thumbFade;return{wx:t,wy:i,wz:s,fadedOpacity:f,fadedDotScale:r.dotScale*r.thumbFade,fadedRingProgress:r.thumbFade>m.thumbFadeVisibilityThreshold?r.ringProgress:0}}let i=h.current[e];return i&&(i.phase=el.DEAD,i.visible=!1,i.thumbFade=0),null},i[2]=c,i[3]=d,i[4]=u,i[5]=f,i[6]=r):r=i[6];let x=r;return i[7]!==x?(a={resetAgents:v,tickAgent:x},i[7]=x,i[8]=a):a=i[8],a})({agentsRef:l,snapshotsRef:f,occupiedCellsRef:u,advanceAgent:m,spawnAgent:h,getVertexPos:p}),x=(e,t,n,r,a,o)=>{let i=4*t;for(let t=0;t<4;t++){let s=(i+t)*3;e[s]=n+eK[t][0]*o,e[s+1]=r,e[s+2]=a+eK[t][1]*o}},w=(e,t,n,r,o,i,s)=>{let l=a.count,u=4*r;for(let r=0;r<4;r++)e[u+r]=o,t[u+r]=i,n[u+r]=s;let c=(l+r)*4;for(let r=0;r<4;r++)e[c+r]=o,t[c+r]=i,n[c+r]=s},R=(0,o.useCallback)(()=>
436{t.current&&(s.current=!0,u.current=new Set,g(r()))},[t,r,g]);return{start:R,stop:(0,o.useCallback)(()=>{s.current=!1;let e=f.current;for(let t=0;t<e.length;t++){let n=e[t];n&&(n.phase=el.DEAD)}let t=n.current;if(!t)return;let r=t.getAttribute("aOpacity"),a=t.getAttribute("aDotScale"),o=t.getAttribute("aRingProgress");r&&(r.array.fill(0),r.needsUpdate=!0,a&&(a.array.fill(0),a.needsUpdate=!0),o&&(o.array.fill(0),o.needsUpdate=!0))},[n]),update:(0,o.useCallback)(e=>{if(!s.current)return;let r=t.current;if(!r)return;let o=n.current;if(!o)return;let i=o.getAttribute("position"),u=o.getAttribute("aOpacity"),f=o.getAttribute("aDotScale"),d=o.getAttribute("aRingProgress");if(!i||!u||!f||!d)return;let m=i.array,p=u.array,h=f.array,g=d.array,y=l.current,R=a.count,C=a.dot.radius,b=a.dot.yOffset,S=a.ring.radius,T=a.ring.yOffset;for(let t=0;t<y.length;t++){let n=v(t,e,r);n?(x(m,t,n.wx,n.wy+T,n.wz,S),x(m,R+t,n.wx,n.wy+b,n.wz,C),w(p,h,g,t,n.fadedOpacity,n.fadedDotScale,n.fadedRingProgress)):w(p,h,g,t,0,0,0)}let P=!1;for(let e=0;e<y.length;e++)if(y[e].phase!==el.DEAD){P=!0;break}(P||c.current)&&(i.needsUpdate=!0,u.needsUpdate=!0,f.needsUpdate=!0,d.needsUpdate=!0),c.current=P},[t,n,a,v]),setupGeometry:d,agents:f.current}})({graphRef:en,pathFinderGeometryRef:H,getThumbPositions:eu}),ed=(e=>{let t,n=(0,s.C)(e=>e.gl),r=(0,o.useRef)(null),a=(0,o.useRef)(null),l=(0,o.useRef)(new i.I9Y),u=(0,o.useRef)(new i.I9Y(1,1)),[c,f]=(0,o.useState)(!1);return null===r.current&&((t=new i.GYF(new Float32Array([0]),1,1,i.VT0,i.RQf)).minFilter=i.k6q,t.magFilter=i.k6q,t.wrapS=i.ghU,t.wrapT=i.ghU,t.needsUpdate=!0,r.current=t),(0,o.useEffect)(()=>{let t=e.current;if(!t)return;let r=y.u.gis.groundHeightmap.resolution,o=y.u.gis.groundHeightmap.cameraMargin,s=y.u.gis.dataScale;t.computeBoundingBox();let c=t.boundingBox;if(!c)return;let d=c.min.x*s,m=c.max.x*s,p=c.min.y*s,h=c.max.y*s,g=c.min.z*s,v=c.max.z*s;l.current.set(d,g),u.current.set(m-d,v-g);let x=new i.nWS(r,r,{format:i.VT0,type:i.RQf,minFilter:i.k6q,magFilter:i.k6q,wrapS:i.ghU,wrapT:i.ghU,depthBuffer:!1,stencilBuffer:!1}),w=(d+m)*.5,R=(g+v)*.5,C=new i.qUd(-(.5*u.current.x),.5*u.current.x,.5*u.current.y,-(.5*u.current.y),0,h-p+2*o);C.position.set(w,h+o,R),C.lookAt(w,0,R),C.updateMatrixWorld(!0);let b=new i.Z58,S=new i.BKk({vertexShader:"/*\n * Heightmap bake vertex shader. Projects the ground mesh top-down\n * and passes the world-space Y coordinate to the fragment shader.\n * The V axis is flipped so that world Z+ maps to UV.v+, matching the\n * sampler formula `uv.v = (worldZ - minZ) / sizeZ` used by consumers.\n */\n\nvarying float vWorldY;\n\nvoid main() {\n vec4 worldPos = modelMatrix * vec4(position, 1.0);\n vWorldY = worldPos.y;\n gl_Position = projectionMatrix * viewMatrix * worldPos;\n gl_Position.y = -gl_Position.y;\n}\n",fragmentShader:"/*\n * Heightmap bake fragment shader. Writes world-space Y into the red channel\n * of a R32F float render target.\n */\n\nvarying float vWorldY;\n\nvoid main() {\n gl_FragColor = vec4(vWorldY, 0.0, 0.0, 1.0);\n}\n",side:i.$EB,depthTest:!1,depthWrite:!1,transparent:!1,blending:i.XIg}),T=new i.eaF(t,S);T.scale.set(s,s,s),T.updateMatrixWorld(!0),b.add(T);let P=n.getRenderTarget(),M=n.getClearAlpha(),A=new i.Q1f;return n.getClearColor(A),n.setRenderTarget(x),n.setClearColor(0,0),n.clear(!0,!1,!1),n.render(b,C),n.setRenderTarget(P),n.setClearColor(A,M),b.remove(T),S.dispose(),a.current=x,f(!0),()=>{x.dispose(),a.current=null,f(!1)}},[e,n]),{texture:a.current?a.current.texture:r.current,worldMin:l.current,worldSize:u.current,ready:c}})(R),[em,eh]=(0,m.zh)(()=>({from:{opacity:0}
436,onChange:e=>{A.current.material.uniforms.opacity.value=e.value.opacity*y.u.gis.point.opacityMultiplier,_.current.material.uniforms.opacity.value=e.value.opacity*y.u.gis.segment.opacityMultiplier,E.current&&(E.current.material.uniforms.uOpacity.value=e.value.opacity*y.u.gis.meshOpacityMultiplier)}}),[]),[eg,ev]=(0,m.zh)(()=>({from:{progress:0},onChange:e=>{A.current.material.uniforms.progress.value=e.value.progress,_.current.material.uniforms.progress.value=e.value.progress}}),[]),[ex,ey]=(0,m.zh)(()=>({from:{radius:0,opacity:0},onChange:e=>{E.current&&(E.current.material.uniforms.uPulseRadius.value=e.value.radius,A.current.material.uniforms.uPulseRadius.value=e.value.radius,A.current.material.uniforms.uPulseOpacity.value=e.value.opacity,_.current.material.uniforms.uPulseRadius.value=e.value.radius,_.current.material.uniforms.uPulseOpacity.value=e.value.opacity,h.current?.(E.current.material.uniforms.uPulseCenter.value,e.value.radius,e.value.opacity),Z.current?.syncPulse(E.current.material.uniforms.uPulseCenter.value,e.value.radius,e.value.opacity))}}),[]),[ew,eR]=(0,m.zh)(()=>({from:{opacity:0}
436,onChange:e=>{E.current&&(E.current.material.uniforms.uPulseOpacity.value=e.value.opacity)}}),[]),[eC,eb]=(0,m.zh)(()=>({from:{progress:0,opacity:0},onChange:e=>{if(!E.current)return;let t=E.current.material.uniforms;if(t.uRingProgress.value=e.value.progress,t.uRingOpacity.value=e.value.opacity,O.current){let t=O.current.material.uniforms;t.uRingProgress.value=e.value.progress,t.uRingOpacity.value=e.value.opacity}}}),[]),eS=(0,o.useRef)(!1),[eT,eP]=(0,o.useState)(null),[eM,eA]=(0,o.useState)(null),[eD,e_]=(0,o.useState)(null),[eE,eU]=(0,o.useState)(null),[eO,eF]=(0,o.useState)(null),eN=(0,o.useRef)(null),eL=(0,o.useRef)(null);(0,o.useEffect)(()=>()=>{eN.current?.dispose(),eL.current?.dispose(),G.current?.dispose(),H.current?.dispose()},[]);let ez=(e,t)=>{eh.stop(!0),eh.start({to:{opacity:1},delay:t,config:{duration:e/2,easing:m.le.easeOutCubic}}),ev.stop(!0),ev.start({to:{progress:1},delay:t,config:{duration:e,easing:m.le.easeOutCubic},onRest:()=>{F.current?.present(y.u.gis.compass.elementStaggerDuration,y.u.gis.compass.presentDelay)}}),Q.current?.present(y.u.gis.dust.presentDuration,t)},eV=(e,t)=>{eh.stop(!0),eh.start({to:{opacity:0},delay:t,config:{duration:e,easing:m.le.easeOutCubic}}),ev.stop(!0),F.current?.dismiss(y.u.gis.compass.dismissDuration,t),Q.current?.dismiss(e,t)},ek=(e,t)=>{P.current.rotation.x=e,P.current.rotation.y=t},eG=e=>{if(!E.current)return;let t=y.u.gis.groundEffect;E.current.material.uniforms.uPulseCenter.value.copy(e),A.current.material.uniforms.uPulseCenter.value.copy(e),_.current.material.uniforms.uPulseCenter.value.copy(e),ey.stop(!0),ey.start({from:{radius:0,opacity:1},to:{radius:t.pulseMaxRadius,opacity:0},config:{duration:t.pulseWaveDuration,easing:m.le.easeOutCubic}}),eR.stop(!0),eR.start({from:{opacity:1},to:async e=>{await e({opacity:1,config:{duration:t.pulseWaveDuration}}),await e({opacity:0,config:{duration:t.pulseFadeDuration,easing:m.le.easeOutQuad}})}})},eB=e=>{if(!E.current)return;let t=y.u.gis.groundEffect;E.current.material.uniforms.uRingCenter.value.copy(e),O.current&&O.current.material.uniforms.uRingCenter.value.copy(e),T.current=!0,eb.stop(!0),eb.start({from:{progress:0,opacity:0},to:{progress:1,opacity:1},config:{duration:t.ringProgressDuration,easing:m.le.easeOutCubic}})},ej=()=>{let e=y.u.gis.groundEffect;eb.stop(!0),eb.start({to:{opacity:0},config:{duration:e.ringDismissDuration,easing:m.le.easeOutCubic},onRest:()=>{T.current=!1}})},e$=()=>{ec.start(),ef.start(),Y.current?.present(),X.current?.present(),Z.current?.present(),T.current=!0},eW=()=>{ec.stop(),ef.stop(),Y.current?.dismiss(),X.current?.dismiss(),Z.current?.dismiss(),T.current=!1};return(0,c._B)("yellowgreen"),(0,c.Ql)((e,t)=>{let n=e.camera.position;for(let e of(W.current&&W.current.material.uniforms.uCameraPosition.value.copy(n),[V.current,j.current]))e&&e.material.uniforms.uCameraPosition.value.copy(n);if(_.current&&_.current.material.uniforms.uCameraPosition.value.copy(n),A.current){A.current.material.uniforms.uCameraPosition.value.copy(n);let{width:t,height:r}=e.size;A.current.material.uniforms.uResolution.value.set(t,r)}ec.update(t);let r=ec.getTrailStates();for(let e of[V.current,j.current]){if(!e)continue;let t=e.material.uniforms,n=t.uHeadProgress?.value,a=t.uTailProgress?.value,o=t.uOpacity?.value;if(n&&a&&o)for(let e=0;e<r.length;e++){let t=r[e];t&&(n[e]=t.headProgress,a[e]=t.tailProgress,o[e]=t.opacity)}}if(ef.update(t),E.current){let n=E.current.material,r=n.uniforms.uAgentPositions.value,a=J.current,o=ee.current,i=1e3*t,s=y.u.gis.groundEffect.agentProximityFadeInMs,l=y.u.gis.groundEffect.agentProximityFadeOutMs;n.uniforms.uCameraPosition.value.copy(e.camera.position);for(let e=0;e<K;e++){let t=ef.agents[e];if(!t)continue;let n=t.phase===el.MOVING;n?(a[e]<1&&(a[e]=Math.min(1,a[e]+i/s)),r[e].copy(t.position)):!n&&a[e]>0&&(a[e]=Math.max(0,a[e]-i/l)),o[e]=t.thumbFade}n.uniforms.uAgentFades.value=Array.from(a),n.uniforms.uAgentThumbFades.value=Array.from(o)}}),(0,o.useEffect)(()=>{0!==x.current.length&&null==eT&&(()=>{if(0===x.current.length)return;let e=x.current.length,t=new Float32Array(3*e),n=new Float32Array(e);for(let r=0;r<e;r++){let e=x.current[r],a=3*r;t.set([e.x,e.y,e.z],a),n[r]=i.cj9.randFloat(1,2)}let r=new i.LoY;r.setAttribute("position",new i.THS(t,3)),r.setAttribute("multiplier",new i.THS(n,1)),eN.current=r,eP((0,a.jsx)("points",{ref:M,geometry:r,layers:u,renderOrder:300,children:(0,a.jsx)(e4,{ref:A,diffuse:new i.Q1f(f),emissive:new i.Q1f(0),specular:0,opacity:0}
436)}))})()},[x]),(0,o.useEffect)(()=>{null!=w.current&&null==eM&&(()=>{if(!w.current)return;(0,q.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupSegments");let e=y.u.gis.dataScale,t=w.current.vertices,n=w.current.lines,r=n.length,o=4*r,s=new Float32Array(3*o),l=new Float32Array(3*o),c=new Float32Array(o),f=new Float32Array(o),d=new Float32Array(3*o),m=new Uint32Array(6*r);for(let a=0;a<r;a++){let r=n[a],o=t[r[0]],i=t[r[1]],u=o[0]*e,p=o[1]*e,h=o[2]*e,g=i[0]*e,v=i[1]*e,x=i[2]*e,y=4*a,w=3*y;for(let e=0;e<4;e++){let t=w+3*e;s[t]=u,s[t+1]=p,s[t+2]=h,l[t]=g,l[t+1]=v,l[t+2]=x,d[t]=1,d[t+1]=1,d[t+2]=1}c[y]=1,c[y+1]=-1,c[y+2]=1,c[y+3]=-1,f[y]=0,f[y+1]=0,f[y+2]=1,f[y+3]=1;let R=6*a;m[R]=y,m[R+1]=y+1,m[R+2]=y+2,m[R+3]=y+2,m[R+4]=y+1,m[R+5]=y+3}(0,q.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupSegments quad geometry",r,"segments â",o,"vertices");let p=new i.LoY;p.setAttribute("positionStart",new i.THS(s,3)),p.setAttribute("positionEnd",new i.THS(l,3)),p.setAttribute("side",new i.THS(c,1)),p.setAttribute("endpoint",new i.THS(f,1)),p.setAttribute("color",new i.THS(d,3)),p.setIndex(new i.THS(m,1)),eL.current=p,eA((0,a.jsx)("mesh",{ref:D,geometry:p,layers:u,frustumCulled:!1,children:(0,a.jsx)(e5,{ref:_,color:new i.Q1f(y.u.gis.segment.color)})}))})()},[w]),(0,o.useEffect)(()=>{R.current&&null==eD&&(()=>{if(!R.current)return;let e=R.current,t=e.index,n=t?e.toNonIndexed():e.clone(),r=n.getAttribute("position").count,o=r/3,s=new Float32Array(3*r),l=new Float32Array(r),c=(e,t,n)=>{let r=3*e,a=n>=0?(n+2)%3:-1;for(let e=0;e<3;e++){let t=(r+e)*3;s[t]=+(0===e),s[t+1]=+(1===e),s[t+2]=+(2===e),a>=0&&e!==a&&(s[t+a]=1)}l[r]=t,l[r+1]=t,l[r+2]=t},f=(e,t,n,r)=>{for(let a=0;a<3;a++){let o=r[3*e+a],i=r[3*e+(a+1)%3];if(o===t&&i===n||o===n&&i===t)return a}return -1};if(t){let e=t.array,n=new Int8Array(o).fill(-1),r=new Float32Array(o),a=0,i=0;for(;i<o;)if(i+1<o){let t=[e[3*i],e[3*i+1],e[3*i+2]],o=!1;for(let s=0;s<3;s++){let l=f(i+1,t[s],t[(s+1)%3],e);if(l>=0){let e=a++;n[i]=s,n[i+1]=l,r[i]=e,r[i+1]=e,o=!0;break}}i+=o?2:1}else i++;for(let e=0;e<o;e++)n[e]<0&&(r[e]=a++),c(e,r[e],n[e])}else for(let e=0;e<o;e++)c(e,e,-1);n.setAttribute("barycentric",new i.THS(s,3)),n.setAttribute("quadId",new i.THS(l,1));let d=y.u.gis.dataScale;n.computeBoundingSphere(),n.boundingSphere&&L(n.boundingSphere.radius*d);let m=[d,d,d];e_((0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("mesh",{ref:I,scale:m,renderOrder:-1,layers:u,children:[(0,a.jsx)("primitive",{object:n,attach:"geometry"}),(0,a.jsx)(e0,{ref:E})]}),(0,a.jsxs)("mesh",{ref:U,scale:m,renderOrder:-1,children:[(0,a.jsx)("primitive",{object:n,attach:"geometry"}),(0,a.jsx)(eJ.bn,{ref:O})]})]}))})()},[R]),(0,o.useEffect)(()=>{if(w.current&&null==eE&&w.current){let e,t;(0,q.Rm)("yellowgreen","\uD83D\uDEE0ï¸","setupTrace"),et(w.current),G.current=e=new i.LoY,ec.setupGeometry(),eU((0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("mesh",{ref:z,geometry:e,layers:u,frustumCulled:!1,renderOrder:302,children:(0,a.jsx)(e6,{ref:V})}),(0,a.jsx)("mesh",{ref:B,geometry:e,frustumCulled:!1,renderOrder:302,children:(0,a.jsx)(e6,{ref:j})})]})),H.current=t=new i.LoY,ef.setupGeometry(),eF((0,a.jsx)("mesh",{ref:$,geometry:t,layers:u,frustumCulled:!1,renderOrder:301,children:(0,a.jsx)(e1,{ref:W})}))}},[w]),(0,o.useEffect)(()=>{eT&&eM&&eD&&eE&&eO&&C.current&&(eS.current=!0,g(!0),P.current.traverse(e=>{e.layers.set(y.u.gis.layers.gis)}),I.current&&I.current.layers.set(0),U.current&&U.current.layers.set(y.u.gis.bloom.bloomLayer),z.current&&z.current.layers.set(0),$.current&&$.current.layers.set(0),B.current&&B.current.layers.set(y.u.gis.bloom.bloomLayer),j.current&&(j.current.material.uniforms.bloomIntensity.value=y.u.gis.trail.bloomIntensity),Y.current&&Y.current.group.traverse(e=>{e.layers.set(0)}),X.current&&X.current.group.traverse(e=>{e.layers.set(0)}),Z.current&&Z.current.group.traverse(e=>{e.layers.set(0)}),F.current?.group&&F.current.group.traverse(e=>{e.layers.set(0)}),Q.current?.points&&Q.current.points.layers.set(0),b.current=P.current,S.current=I.current)},[eT,eM,eD,eE,eO,N]),(0,o.useImperativeHandle)(t,()=>({present:ez,dismiss:eV,rotate:ek,firePulse:eG,showRing:eB,hideRing:ej,startTrace:e$,stopTrace:eW})),(0,a.jsxs)("group",{ref:P,layers:u,children:[eT,eM,eE,eO,(0,a.jsx)(eI,{ref:Y,agents:ef.agents}),(0,a.jsx)(tv,{ref:X,agents:ef.agents,getThumbPositions:eu,groundHeightmap:ed}),(0,a.jsx)(ep,{ref:Z,gisMeshGeometry:R,getThumbPositions:eu,agents:ef.agents}),(0,a.jsx)(tn,{ref:Q,layers:u}),eD,y.u.gis.compass.enabled&&N>0&&(0,a.jsx)(eq,{ref:F,radius:N})]})});tb.displayName="ProductGISRenderer";let tS=[1e9,1e9,1e9],tT=e=>{let t,n,r,i=(0,k.c)(8),{layers:l,product:u}=e,c=(0,s.C)(tP),f=(0,s.C)(tM),d=(0,s.C)(tA),m=(0,o.useRef)(!1);return i[0]!==d||i[1]!==c||i[2]!==f?(t=()=>{if(m.current)return;let e=requestAnimationFrame(()=>
436{m.current||(m.current=!0,c.compileAsync(f,d))});return()=>cancelAnimationFrame(e)},n=[c,f,d],i[0]=d,i[1]=c,i[2]=f,i[3]=t,i[4]=n):(t=i[3],n=i[4]),(0,o.useEffect)(t,n),i[5]!==l||i[6]!==u?(r=(0,a.jsx)("group",{position:tS,renderOrder:-1,children:(0,a.jsx)(X,{layers:l,product:u,warmupMode:!0})}),i[5]=l,i[6]=u,i[7]=r):r=i[7],r};function tP(e){return e.gl}function tM(e){return e.scene}function tA(e){return e.camera}var tD=n(5874),t_=n(4188),tI=n(4866),tE=n(4357),tU=n(3064);let tO=(0,o.forwardRef)((e,t)=>{let{name:n,layers:r,layerIds:i}=e,s=(0,o.useRef)(null),l=(0,o.useRef)([]),u=(0,o.useCallback)(e=>t=>{l.current[e]=t},[]),c=(0,o.useRef)([]),d=(0,o.useCallback)(e=>t=>{c.current[e]=t},[]);return(0,o.useEffect)(()=>{for(let e of[i.gis,i.float,i.bloom]){for(let t of(s.current&&s.current.layers.enable(e),l.current))t&&t.layers.enable(e);for(let t of c.current)t&&t.layers.enable(e)}},[i.gis,i.float,i.bloom]),(0,o.useImperativeHandle)(t,()=>({ambientLight:s,spotLights:l,pointLights:c}),[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ambientLight",{ref:s,layers:r,name:n,intensity:y.u.gis.lighting.ambientIntensity}),(0,a.jsx)("spotLight",{ref:u(0),layers:r,name:n,position:y.u.gis.lighting.spotPosition,color:y.u.gis.lighting.spotColor,distance:0,intensity:y.u.gis.lighting.spotIntensity,angle:f.V$*y.u.gis.lighting.spotAngle,penumbra:y.u.gis.lighting.spotPenumbra,decay:y.u.gis.lighting.spotDecay,castShadow:!1,receiveShadow:!1}),(0,a.jsx)("pointLight",{ref:d(0),position:y.u.gis.lighting.pointPositions[0],distance:y.u.gis.lighting.pointDistance,intensity:y.u.gis.lighting.pointIntensity,decay:y.u.gis.lighting.pointDecay}),(0,a.jsx)("pointLight",{ref:d(1),position:y.u.gis.lighting.pointPositions[1],distance:y.u.gis.lighting.pointDistance,intensity:y.u.gis.lighting.pointIntensity,decay:y.u.gis.lighting.pointDecay}),(0,a.jsx)("pointLight",{ref:d(2),position:y.u.gis.lighting.pointPositions[2],distance:y.u.gis.lighting.pointDistance,intensity:y.u.gis.lighting.pointIntensity,decay:y.u.gis.lighting.pointDecay})]})});tO.displayName="ProductSceneLights";let tF=(0,o.forwardRef)((e,t)=>{let{children:n,layers:r,name:l}=e,{setPrimaryTexture:u,primaryCaptureExclude:c}=(0,o.useContext)(v.Oo),{gisGroup:f,gisGroundMesh:m,caOffset:p,bloomEnabled:h}=(0,o.useContext)(v.z_),x=(0,o.useRef)(c).current,w=(0,o.useRef)(m).current,R=(0,s.C)(e=>e.gl),C=(0,s.C)(e=>e.size),b=(0,o.useRef)(R).current,S=(0,o.useRef)(null),T=(0,o.useRef)(null),P=(0,o.useRef)(null),M=(0,o.useRef)(null),A=(0,o.useRef)(null),D=y.u.gis.layers.gis,_=y.u.gis.layers.float,I=y.u.gis.bloom.bloomLayer,E=(0,o.useRef)(new i.Q1f),{material:U,scene:O,camera:F}=function(){let e,t,n,r,a,s,l=(0,k.c)(6);l[0]===Symbol.for("react.memo_cache_sentinel")?(e=new i.BKk({vertexShader:"/**\n * Fullscreen quad vertex shader for post-process chromatic aberration.\n */\n\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"/**\n * Post-process chromatic aberration fragment shader.\n * Samples the GIS FBO at shifted UV positions for R/G/B channels.\n * CA applies uniformly across all GIS content â no mask suppression.\n */\n\nuniform sampler2D tGIS;\nuniform vec2 caOffset;\n\nvarying vec2 vUv;\n\nvoid main() {\n float r = texture2D(tGIS, vUv + caOffset).r;\n float g = texture2D(tGIS, vUv).g;\n float b = texture2D(tGIS, vUv - caOffset).b;\n\n gl_FragColor = vec4(r, g, b, 1.0);\n}\n",uniforms:{tGIS:new i.nc$(null),tDepth:new i.nc$(null),caOffset:new i.nc$(new i.I9Y(0,0))},transparent:!1,depthTest:!1,depthWrite:!1,blending:i.EZo}),l[0]=e):e=l[0];let u=e;if(l[1]===Symbol.for("react.memo_cache_sentinel")){t=new i.Z58;let e=new i.bdM(2,2),n=new i.eaF(e,u);n.frustumCulled=!1,t.add(n),l[1]=t}else t=l[1];let c=t;l[2]===Symbol.for("react.memo_cache_sentinel")?(n=new i.qUd(-1,1,1,-1,0,1),l[2]=n):n=l[2];let f=n;return l[3]===Symbol.for("react.memo_cache_sentinel")?(r=()=>()=>{u.dispose();let e=c.children[0];e?.geometry.dispose()},a=[u,c],l[3]=r,l[4]=a):(r=l[3],a=l[4]),(0,o.useEffect)(r,a),l[5]===Symbol.for("react.memo_cache_sentinel")?(s={material:u,scene:c,camera:f},l[5]=s):s=l[5],s}(),N=(0,tU.u)(),{gisRT:L,frostTexture:z}=function(e){let t,n,r,a=(0,k.c)(9),{size:s,fboScale:l,caMaterial:u,setPrimaryTexture:c}=e,f=(0,o.useRef)(null),d=(0,o.useRef)(null),m=(0,o.useRef)(u).current;return a[0]!==l||a[1]!==c||a[2]!==s.height||a[3]!==s.width?(t=()=>{let e=new i.Pem(s.width,s.height);e.minFilter=i.k6q,e.magFilter=i.k6q,d.current=e,c(e);let t=Math.ceil(s.width*l),n=Math.ceil(s.height*l),r=new i.nWS(t,n,{minFilter:i.k6q,magFilter:i.k6q,format:i.GWd,type:i.ix0});return r.depthTexture=new i.VCu(t,n),r.depthTexture.format=i.zdS,r.depthTexture.type=i.bkx,f.current=r,m.uniforms.tGIS.value=r.texture,m.uniforms.tDepth.value=r.depthTexture,()=>{c(null),e.dispose(),d.current=null,r.depthTexture?.dispose(),r.dispose(),f.current=null}},a[0]=l,a[1]=c,a[2]=s.height,a[3]=s.width,a[4]=t):t=a[4],a[5]!==s.height||a[6]!==s.width?(n=[s.width,s.height],a[5]=s.height,a[6]=s.width,a[7]=n):n=a[7],(0,o.useEffect)(t,n),a[8]===Symbol.for("react.memo_cache_sentinel")?(r={gisRT:f,frostTexture:d},a[8]=r):r=a[8],r}({size:C,fboScale:y.u.gis.fboScale,caMaterial:U,setPrimaryTexture:u});return(0,o.useEffect)(()=>{T.current&&(T.current.aspect=C.width/C.height),T.current&&T.current.updateProjectionMatrix()},[C]),(0,s.D)(()=>
436{if(!S.current||!T.current)return;let e=S.current.hudScene,t=T.current,n=b.autoClear;b.autoClear=!1,e.matrixWorldAutoUpdate&&(e.matrixWorldAutoUpdate=!1),e.updateMatrixWorld(!0);let r=x.current;r&&r.traverse(e=>{e.layers.isEnabled(_)||e.layers.enable(_)});let a=r?.children[0]?.visible===!0;if(r&&(r.visible=!1),t.layers.set(0),b.clearDepth(),b.render(e,t),f.current&&L.current){b.getClearColor(E.current);let n=b.getClearAlpha(),r=e.background;e.background=null,b.setRenderTarget(L.current),b.setClearColor(0,0),b.clear(!0,!0,!1);let a=w.current?.material;a&&(a.colorWrite=!1,a.depthWrite=!1),t.layers.set(0),b.render(e,t),a&&(a.colorWrite=!0,a.depthWrite=!0);let o=b.getContext();o.colorMask(!0,!0,!0,!1),b.clear(!0,!1,!1),t.layers.set(D),b.render(e,t),o.colorMask(!0,!0,!0,!0),b.setRenderTarget(null),t.layers.set(0),e.background=r,b.setClearColor(E.current,n),U.uniforms.caOffset.value.copy(p.current),b.clearDepth(),b.render(O,F)}h.current&&(N.renderSource(b,e,t,m.current),N.renderBlur(b),N.renderComposite(b)),z.current&&b.copyFramebufferToTexture(z.current),r&&(r.visible=!0),a&&(t.layers.set(_),b.clearDepth(),b.render(e,t)),t.layers.set(0),b.autoClear=n},2),(0,o.useImperativeHandle)(t,()=>({children:n,camera:T,ambientLight:A.current?.ambientLight||{current:null},directionalLight:P,spotLights:A.current?.spotLights||{current:[]},pointLights:A.current?.pointLights||{current:[]},cameraControls:M,setFocus:()=>{}})),(0,a.jsxs)(t_.Yi,{ref:S,renderPriority:2,renderEnabled:!1,backgroundColor:g.i.main.bgColor,children:[(0,a.jsx)(tI.u,{ref:T,layers:r,name:l,makeDefault:!0,position:tE.z6,fov:tE.eZ,near:.01,far:2e4}),(0,a.jsx)(tO,{ref:A,name:l,layers:r,layerIds:{gis:D,float:_,bloom:I}}),T.current&&(0,a.jsx)(d,{ref:M,camera:T.current}),n]})}),tN=(0,o.forwardRef)((e,t)=>{let{layers:n,name:r,children:i}=e,l=(0,o.useRef)(null),u=(0,o.useRef)(null),f=(0,s.C)(e=>e.gl),d=(0,s.C)(e=>e.size);return(0,c._B)("blue"),(0,o.useEffect)(()=>{u.current&&(u.current.aspect=d.width/d.height),u.current&&u.current.updateProjectionMatrix()},[d]),(0,o.useImperativeHandle)(t,()=>({children:i,camera:u.current,renderer:f}),[]),(0,a.jsxs)(t_.Yi,{ref:l,renderPriority:1e4,children:[(0,a.jsx)(tI.u,{ref:u,layers:n,name:r,makeDefault:!0,position:tE.Yv,fov:tE.XF,far:1e4}),(0,a.jsx)("ambientLight",{intensity:1}),i]})}),tL=(0,o.forwardRef)((e,t)=>{let{layers:n}=e,{productHeaderScene:r,setIsProductHeaderRendererReady:i}=(0,o.useContext)(v.z_),l=(0,o.useRef)(r).current,{layoutMargins:u,headerScale:d}=(0,o.useContext)(v.MQ),p=(0,o.useRef)(u);p.current=u;let h=(0,o.useRef)(d);h.current=d;let g=(0,o.useRef)(null),x=(0,o.useRef)(null),y=(0,o.useRef)(null);(0,s.C)(e=>e.size);let w=(0,s.C)(e=>e.pointer),R=(0,o.useRef)(null),C=(0,o.useRef)({x:0*f.V$,y:2*f.V$}),b=(0,o.useRef)({x:-(0*f.V$),y:-(.2*f.V$)}),S=(0,m.zh)(()=>({from:{rx:g.current?.rotation.x??0,ry:g.current?.rotation.y??0},onChange:e=>{g.current.rotation.x=e.value.rx,g.current.rotation.y=e.value.ry}}),[])[1],T=e=>{M(),y.current?.present(e)},P=()=>{y.current?.dismiss()},M=()=>{x.current.scale.set(h.current,h.current,1);let e=R.current.camera,t=2*Math.tan(e.fov*(Math.PI/180)/2)*e.position.z,n=t*e.aspect,r=y.current.getBoundingBoxSize();x.current.position.x=-r.x/2,g.current.position.x=e.position.x-n/2+n*p.current.left+r.x/2,g.current.position.y=e.position.y+t/2-t*p.current.top+r.y/2},A=e=>{let t=C.current.x+w.y*b.current.x+b.current.x,n=C.current.y+-w.x*b.current.y+b.current.y;S.stop(!0),S.start({to:{rx:t,ry:n},config:{duration:400,easing:m.le.easeOutCubic}})};return(0,c._B)("deeppink"),(0,o.useEffect)(()=>{l.current=R.current},[]),(0,o.useEffect)(()=>(window.addEventListener("mousemove",A),()=>window.removeEventListener("mousemove",A)),[]),(0,o.useLayoutEffect)(()=>{M()},[d,u]),(0,o.useImperativeHandle)(t,()=>({present:T,dismiss:P})),(0,a.jsx)(tN,{ref:R,layers:n,name:t_.eU.PRODUCT_HEADER,children:(0,a.jsx)("group",{ref:g,layers:n,children:(0,a.jsx)("group",{ref:x,layers:n,children:(0,a.jsx)(tD.g,{ref:y,layers:n,position:[0,0,0],onInitialized:()=>{M(),i(!0)}})})})})});var tz=n(1074);let tV=(0,o.forwardRef)((e,t)=>{let{layers:n,product:r,position:s,imageWidth:l,isFocused:u,onClickedAt:f}=e,{fonts:d,getTexture:m}=(0,o.useContext)(v.DM),{play:x,stop:y}=(0,o.useContext)(v.nE),{setIsProductItemRendererReady:w,productScene:R,viewState:C}=(0,o.useContext)(v.z_),{sendEvent:b}=(0,v.pn)(),S=(0,o.useRef)(null),T=(0,o.useRef)(null),P=(0,o.useRef)(null),M=(0,o.useRef)(null),[A,D]=(0,o.useState)(!1),_=(0,o.useRef)(C);(0,o.useEffect)(()=>{_.current=C},[C]);let I=(0,o.useRef)(!1),E=(0,o.useRef)(!1),U=(0,o.useRef)(!1),O=(0,o.useRef)(new i.Q1f(g.i.label.fontColor)).current,F=(0,o.useRef)(h.z.sfx.text.transition1),N=(0,o.useRef)(h.z.sfx.text.transition1),L=m(r.images.main.key),z=96/g.i.label.fontBaseLineHeight,V=e=>{F.current=h.z.sfx.text.transition1,N.current=h.z.sfx.text.transition1,M.current.present(()=>{_.current!==v._f.FOCUS_IN&&_.current!==v._f.DETAIL&&D(!0)}
436),T.current.present({min:400,max:800},{min:e,max:e+800}),P.current.present({min:400,max:800},{min:e+800,max:e+1600})},k=()=>{F.current=h.z.sfx.text.transition1,N.current=h.z.sfx.text.transition1,D(!1),M.current.dismiss(),T.current.dismiss({min:200,max:400},{min:0,max:200}),P.current.dismiss({min:200,max:400},{min:0,max:200})},G=()=>{if(!E.current||!U.current||I.current)return;if(I.current=!0,w(!0),S.current&&R.current?.cameraControls.current){let e=R.current.cameraControls.current.camera.position,t=new i.Pq0(e.x,0,e.z);S.current.lookAt(t),S.current.updateMatrixWorld(!0)}let e=M.current.width/2,t=M.current.height/2,n=T.current.getBoundingBoxSize().y;T.current.setPositionXYZ(100-e,t+100,100),P.current.setPositionXYZ(100-e,t-n+100-16,100)},B=e=>{x(tz.u.SFX_TEXT_TRANSITION_1,e,!0)},j=()=>{y(tz.u.SFX_TEXT_TRANSITION_1)},$=()=>{j()},W=()=>{B(h.z.sfx.text.transition1)},H=()=>{j()},Y=()=>{R.current?.cameraControls.current?.normalizeRotations();let e=R.current?.cameraControls.current?.camera;if(!e)return{cameraPos:void 0,lookAtPos:void 0};let t=M.current.getNormal().applyEuler(S.current.rotation),n=M.current.getBoundingBox().getCenter(new i.Pq0);return{cameraPos:n.clone().add(t.multiplyScalar(4e3)??e.position),lookAtPos:n}};(0,c._B)("mediumvioletred");let X=()=>{let e=M.current.width,t=M.current.height;return e&&t?(S.current.updateMatrixWorld(!0),{tl:S.current.localToWorld(new i.Pq0(-e/2,t,0)),tr:S.current.localToWorld(new i.Pq0(e/2,t,0)),bl:S.current.localToWorld(new i.Pq0(-e/2,0,0)),br:S.current.localToWorld(new i.Pq0(e/2,0,0))}):null},q=()=>S.current.getWorldPosition(new i.Pq0);return(0,o.useImperativeHandle)(t,()=>({present:V,dismiss:k,setEnabled:D,getFocusPositions:Y,getWorldCorners:X,getWorldPosition:q,setPulseUniforms:(e,t,n)=>{M.current?.setPulseUniforms(e,t,n)}})),(0,a.jsxs)("group",{layers:n,ref:S,position:s,onPointerMove:e=>{A&&C!==v._f.FOCUS_IN&&C!==v._f.DETAIL&&M.current.onPointerMove(e)},onPointerEnter:e=>{A&&C!==v._f.FOCUS_IN&&C!==v._f.DETAIL&&0===e.buttons&&(document.body.style.cursor="pointer",M.current.onPointerEnter(),F.current=h.z.sfx.product.sfx_product_item_hover_text_transition,N.current=h.z.sfx.product.sfx_product_item_hover_text_transition,T.current.present({min:200,max:400},{min:0,max:400}),P.current.present({min:200,max:400},{min:400,max:800}),x(tz.u.SFX_PRODUCT_ITEM_HOVER,h.z.sfx.product.sfx_product_item_hover,!1))},onPointerLeave:e=>{A&&0===e.buttons&&(document.body.style.cursor="grab",M.current.onPointerLeave())},onClick:e=>{A&&C!==v._f.FOCUS_IN&&C!==v._f.DETAIL&&(e.stopPropagation(),M.current.onClick(),x(tz.u.SFX_PRODUCT_ITEM_CLICK,h.z.sfx.product.sfx_product_item_click,!1),f?.(r.index),b({event:"agent_click",agent_name:r.title,position_state:u?"focu
436s":"idle"}))},children:[(0,a.jsx)(p.PD,{ref:T,layers:n,renderOrder:200,position:[0,0,50],text:r.title,fontFile:d.USansRgBd.fontFile,fontTexture:d.USansRgBd.fontTexture,fontSize:80,labelWidth:(l-200)/z,fontColor:O,transparent:!0,emissive:O,emissiveIntensity:.2,useLight:!0,dithering:!1,depthTest:!1,depthWrite:!1,onInitialized:()=>{E.current=!0,G()},onPresentStart:()=>{B(F.current)},onPresentEnd:$,onDismissStart:W,onDismissEnd:H}),(0,a.jsx)(p.PD,{ref:P,layers:n,renderOrder:200,position:[0,0,50],text:r.category.join(", "),fontFile:d.USansRgBd.fontFile,fontTexture:d.USansRgBd.fontTexture,fontSize:36,fontColor:O,transparent:!0,emissive:O,emissiveIntensity:.2,useLight:!0,dithering:!1,depthTest:!1,depthWrite:!1,onInitialized:()=>{U.current=!0,G()},onPresentStart:()=>{B(N.current)},onPresentEnd:$,onDismissStart:W,onDismissEnd:H}),L&&(0,a.jsx)(ee,{layers:n,renderOrder:100,ref:M,texture:L,width:l})]})});function tk(e){let{angle:t}=e;return new i.O9p(0,t+Math.PI,0)}function tG(e){let{angle:t,center:n,radius:r}=e;return new i.Pq0(n.x+r*Math.cos(t),0,n.y+r*Math.sin(t))}function tB(e){return void 0!==e.images.main}let tj=(0,o.forwardRef)((e,t)=>{let{layers:n,onDetailCloseComplete:r}=e,{productScene:l,productDataset:u,setIsProductRendererReady:f,viewState:d,focusedProductIndex:p,detailProductIndex:g,focusProduct:w,unfocusProduct:R,openDetail:C,closeDetail:b,caOffset:S}=(0,o.useContext)(v.z_),{play:T,playProductPulseSFX:P}=(0,o.useContext)(A.n),D=(0,s.C)(e=>e.gl),_=(0,s.C)(e=>e.size),I=(0,o.useRef)(l).current,E=(0,o.useRef)(null),U=(0,o.useRef)(null),O=(0,o.useRef)(null),F=(0,o.useRef)([]),N=(0,o.useRef)(null),L=(0,o.useRef)(null),z=(0,o.useRef)(null),V=(0,o.useCallback)(e=>t=>F.current[e]=t,[]),G=(0,o.useRef)(null),B=(0,o.useRef)(null),j=(0,o.useRef)(!1),$=(0,o.useRef)({x:0,y:0}),W=(0,o.useRef)(!1),H=(0,o.useRef)(new i.Pq0),Y=(0,o.useRef)(null),Z=(0,o.useRef)(null),Q=(0,o.useRef)(y.u.gis.ca.baseIntensity),K=(0,o.useRef)(0),J=(0,o.useRef)(1),ee=(0,o.useRef)(1),et=(0,o.useRef)(0),en=(0,o.useRef)(null),er=(0,o.useRef)(0),ea=(0,o.useRef)(0),eo=(0,o.useRef)(null),ei=(0,o.useRef)(d),es=(0,o.useRef)(C),el=(0,o.useMemo)(()=>null!==g&&u?u.productList[g]??null:null,[g,u]),eu=(0,o.useMemo)(()=>u?.productList?u.productList.find(e=>(e.images.content?.length??0)>1)??u.productList[0]??null:null,[u]),[ec,ef]=(0,m.zh)(()=>({from:{px:0,py:0,pz:0,tx:0,ty:0,tz:0},onChange:e=>{let t=l.current?.cameraControls.current;if(!t)return;let{px:n,py:r,pz:a,tx:o,ty:s,tz:u}=e.value;t.setLookAt(n,r,a,o,s,u,!1);let c=n-o,f=r-s,d=a-u,m=Math.sqrt(c*c+f*f+d*d);if(m>0&&t.rotateTo(Math.atan2(c,d),Math.acos(i.cj9.clamp(f/m,-1,1)),!1),null!==en.current&&(et.current=n-en.current),en.current=n,ei.current===v._f.FOCUS_IN&&!W.current){let e=Y.current,t=Z.current;if(e&&t){let o=e.distanceTo(t);o>1?Math.min(e.distanceTo(H.current.set(n,r,a))/o,1)>=y.u.focusIn.autoDetailThreshold&&(W.current=!0,es.current()):(W.current=!0,es.current())}}}}),[]),[ed,em]=(0,m.zh)(()=>({from:{intensity:0},onChange:e=>{ea.current=e.value.intensity}}),[]),ep=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{cameraPos:n,lookAtPos:r}=F.current[e].getFocusPositions();if(!n||!r)return;let a=l.current?.cameraControls.current;if(a)if(t){ef.stop(!0),en.current=null;let e=new i.Pq0;a.getPosition(e);let t=new i.Pq0;a.getTarget(t),Y.current=e.clone(),Z.current=n.clone(),ef.start({from:{px:e.x,py:e.y,pz:e.z,tx:t.x,ty:t.y,tz:t.z},to:{px:n.x,py:n.y,pz:n.z,tx:r.x,ty:r.y,tz:r.z},config:{duration:y.u.focusIn.cameraDuration,easing:m.le.easeInOutCubic},onRest:()=>{ei.current!==v._f.FOCUS_IN||W.current||(W.current=!0,es.current())}})}else{a.setLookAt(n.x,n.y,n.z,r.x,r.y,r.z,!1);let e=n.x-r.x,t=n.y-r.y,o=n.z-r.z,s=Math.sqrt(e*e+t*t+o*o);s>0&&a.rotateTo(Math.atan2(e,o),Math.acos(i.cj9.clamp(t/s,-1,1)),!1)}},eh=(0,o.useCallback)(e=>{j.current||(d===v._f.LIST?w(e):d===v._f.BROWSING&&w(e))},[d,w]),eg=(0,o.useCallback)(e=>{$.current.x=e.nativeEvent.clientX,$.current.y=e.nativeEvent.clientY},[]),ev=(0,o.useCallback)(e=>{if(j.current)return;let t=e.nativeEvent.clientX-$.current.x,n=e.nativeEvent.clientY-$.current.y;!(t*t+n*n>25)&&(d===v._f.BROWSING?R():d===v._f.DETAIL&&L.current?.canDismiss()&&b())},[d,R,b]),ex=(0,o.useCallback)(()=>{(0,q.Rm)("mediumvioletred","â¶ï¸","float open complete"),j.current=!1,L.current?.present()},[]),ey=(0,o.useCallback)((e,t,n)=>
436{for(let r of F.current)r?.setPulseUniforms(e,t,n)},[]),ew=(0,o.useCallback)(()=>{(0,q.Rm)("mediumvioletred","â¶ï¸","float close complete"),j.current=!1;let e=E.current?.cameraControls.current;for(let t of(e&&(e.enabled=!0),document.body.style.cursor="grab",F.current))t?.setEnabled(!0);r?.()},[D,r]),{itemPositions:eR,itemRotations:eC}=function(e){let t,n,r,a,o=(0,k.c)(10);e:{let n;if(!e||!e.productList||0===e.productList.length){let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],o[0]=e):e=o[0],t=e;break e}if(o[1]!==e.productList){let t=e.productList.filter(tB),r=y.u.layout.margin,a=new i.I9Y(tE.z6.x,tE.z6.z),s=new i.I9Y(0,0),l=a.distanceTo(s),u=Math.atan2(s.y-a.y,s.x-a.x),c=2*Math.asin(r/(2*l)),f=t.length%2==0;n=t.map((e,t)=>{let n;if(f){let e=Math.floor(t/2);n=(t%2==0?1:-1)*(e+.5)}else{let e=Math.ceil(t/2);n=(0===t?0:t%2==1?1:-1)*e}return{angle:u+n*c,center:a,radius:l}}),o[1]=e.productList,o[2]=n}else n=o[2];t=n}let s=t;o[3]!==s?(n=s.map(tG),o[3]=s,o[4]=n):n=o[4];let l=n;o[5]!==s?(r=s.map(tk),o[5]=s,o[6]=r):r=o[6];let u=r;return o[7]!==l||o[8]!==u?(a={itemPositions:l,itemRotations:u},o[7]=l,o[8]=u,o[9]=a):a=o[9],a}(u),{computeFloatTargetCorners:eb,computeOriginCorners:eS}=function(e){let{size:t,productScene:n,productItemRefs:r}=e;return{computeFloatTargetCorners:(0,o.useCallback)(()=>{let e,n,r=16/9*1280,a=y.u.float.margins.top/1280*2,o=y.u.float.margins.bottom/1280*2,s=y.u.float.margins.left/r*2,l=y.u.float.margins.right/r*2,u=-1+s,c=1-l,f=1-a,d=-1+o,m=(c-u)/2*t.width,p=(f-d)/2*t.height;if(t.width>=t.height){let{base:r,ceiling:a}=y.u.float.landscapeScale,o=Math.max(0,Math.min(1,(t.height-r.viewportHeight)/(a.viewportHeight-r.viewportHeight)));e=r.width+(a.width-r.width)*o,n=r.height+(a.height-r.height)*o}else{let t=y.u.float.maxSize.portrait;e=t.width,n=t.height}let h=Math.min(m/e,p/n,1),g=e*h/t.width,v=n*h/t.height,x=(u+c)/2,w=(f+d)/2;return{tl:new i.I9Y(x-g,w+v),tr:new i.I9Y(x+g,w+v),bl:new i.I9Y(x-g,w-v),br:new i.I9Y(x+g,w-v)}},[t]),computeOriginCorners:(0,o.useCallback)(e=>{let t=n.current?.camera?.current;if(!t)return null;let a=r.current[e],o=a?.getWorldCorners();if(!o)return null;t.updateMatrixWorld();let s=o.tl.clone().project(t),l=o.tr.clone().project(t),u=o.bl.clone().project(t),c=o.br.clone().project(t);return{tl:new i.I9Y(s.x,s.y),tr:new i.I9Y(l.x,l.y),bl:new i.I9Y(u.x,u.y),br:new i.I9Y(c.x,c.y)}},[])}}({size:_,productScene:l,productItemRefs:F}),eT=(0,o.useMemo)(()=>{if(!u||!u.productList||0===u.productList.length)return[];let e=u.productList.filter(e=>void 0!==e.images.main),t=y.u.layout.imageWidth;return e.map((e,r)=>{let o=eR[r]??new i.Pq0,s=eC[r]??new i.O9p;return(0,a.jsx)(tV,{ref:V(r),layers:n,product:e,position:o,rotation:s,imageWidth:t,isFocused:p===r,onClickedAt:()=>eh(r)},r)})},[u,eR,eC,p,eh]),eP=()=>{(0,q.Rm)("mediumvioletred","â¶ï¸","present");let{cameraPos:e,lookAtPos:t}=F.current[0].getFocusPositions(),n=t?new i.Pq0(0,t.y,0):null,r=n?new i.Pq0(tE.z6.x,tE.z6.y,tE.z6.z):null;for(let e of(G.current=r??null,B.current=n??null,F.current))e.present(0);O.current?.present(1e3,0),eo.current=setTimeout(()=>{O.current?.startTrace()},y.u.gis.trace.startDelay);let a=l.current?.cameraControls.current;if(a&&r&&n){a.setLookAt(r.x,r.y,r.z,n.x,n.y,n.z,!1);let e=r.x-n.x,t=r.y-n.y,o=r.z-n.z,s=Math.sqrt(e*e+t*t+o*o);s>0&&a.rotateTo(Math.atan2(e,o),Math.acos(i.cj9.clamp(t/s,-1,1)),!1)}let o=y.u.gis;em.stop(!0),em.start({from:{intensity:o.ca.present.peak},to:{intensity:0},config:{duration:o.ca.present.duration,easing:m.le.easeOutCubic}})},eM=()=>{for(let e of((0,q.Rm)("mediumvioletred","â¶ï¸","dismiss"),null!==eo.current&&(clearTimeout(eo.current),eo.current=null),F.current))e.dismiss();O.current?.stopTrace(),O.current?.dismiss(y.u.thumbGrid.dismissOpacityDuration,0)};return(0,c._B)("mediumvioletred"),(0,o.useEffect)(()=>{ei.current=d},[d]),(0,o.useEffect)(()=>{es.current=C},[C]),(0,o.useEffect)(()=>{I.current=E.current},[]),(0,o.useEffect)(()=>{u&&(f(!0),(0,q.Rm)("mediumvioletred","\uD83D\uDD25","productDataset",u))},[u]),(0,o.useEffect)(()=>{if(null===p||d!==v._f.FOCUS_IN)return;W.current=!1,ep(p,!0);let e=F.current[p];if(e){let t=e.getWorldPosition();P(),O.current?.firePulse(t)}},[p,d]),(0,o.useEffect)(()=>
436{if(d===v._f.LIST&&G.current&&B.current){let e=l.current?.cameraControls.current;if(!e)return;ef.stop(!0);let t=new i.Pq0;e.getPosition(t);let n=new i.Pq0;e.getTarget(n);let r=G.current,a=B.current;ef.start({from:{px:t.x,py:t.y,pz:t.z,tx:n.x,ty:n.y,tz:n.z},to:{px:r.x,py:r.y,pz:r.z,tx:a.x,ty:a.y,tz:a.z},config:{duration:y.u.focusIn.unfocusDuration,easing:m.le.easeInOutCubic}})}},[d]),(0,o.useEffect)(()=>{if(d!==v._f.DETAIL||null===g)return;let e=eb(),t={tl:new i.I9Y(0,0),tr:new i.I9Y(0,0),bl:new i.I9Y(0,0),br:new i.I9Y(0,0)},n=eS(g)??t;j.current=!0,T(x.uc.SFX_PRODUCT_FLOAT_OPEN,h.z.sfx.product.sfx_product_float_open,!1),N.current?.open(new i.I9Y(.5,.5),n,e)},[d,g]),(0,o.useEffect)(()=>{if(d!==v._f.DETAIL||!N.current?.isOpen||null===g)return;N.current.updateTargetCorners(eb());let e=eS(g);e&&N.current.updateOriginCorners(e)},[_.width,_.height]),(0,o.useEffect)(()=>{if(d!==v._f.DETAIL&&N.current?.isOpen){if(null!==p){let e=eS(p);e&&N.current.updateOriginCorners(e)}j.current=!0,T(x.uc.SFX_PRODUCT_FLOAT_CLOSE,h.z.sfx.product.sfx_product_float_close,!1),L.current?.dismiss(),N.current.close()}},[d]),(0,o.useEffect)(()=>{if(d!==v._f.DETAIL)return;let e=E.current?.cameraControls.current;for(let t of(e&&(e.enabled=!1),document.body.style.cursor="default",F.current))t?.setEnabled(!1)},[d,D]),(0,c.Ql)((e,t)=>{(e=>{let t=l.current?.cameraControls.current;if(t){let n=y.u.gis,r=Math.min(n.ca.rotation.lerp*e,1),a=t._thetaVelocity.value,o=Math.min(Math.abs(a)/n.ca.rotation.refSpeed,1),i=Math.sign(a)||J.current;0!==a&&(J.current=i);let s=i*(n.ca.baseIntensity+o*(n.ca.rotation.max-n.ca.baseIntensity));Q.current+=(s-Q.current)*r;let l=t._phiVelocity.value,u=Math.min(Math.abs(l)/n.ca.rotation.refSpeed,1),c=Math.sign(l)||ee.current;0!==l&&(ee.current=c);let f=c*(u*(n.ca.rotation.max-n.ca.baseIntensity));K.current+=(f-K.current)*r;let d=et.current;et.current=0;let m=d/e,p=Math.min(Math.abs(m)/n.ca.movement.refSpeed,1),h=(Math.sign(m)||0)*p*n.ca.movement.max;er.current+=(h-er.current)*r;let g=Q.current+er.current+ea.current,v=K.current+ea.current;S.current.set(g*n.ca.strength,v*n.ca.strength)}})(t)}),(0,o.useImperativeHandle)(t,()=>({present:eP,dismiss:eM,onRouteDismissStart:()=>{},onRouteDismissUpdate:()=>{},onRouteDismissEnd:()=>{}})),(0,a.jsx)(tF,{ref:E,layers:n,name:t_.eU.PRODUCT,children:(0,a.jsxs)("group",{ref:U,children:[u&&u.productList.length>0&&eT,u&&u.productList.length>0&&(0,a.jsx)(tb,{ref:O,layers:n,thumbPositions:eR,onPulseUpdate:ey}),(0,a.jsx)(M,{ref:N,layers:n,onOpenComplete:ex,onCloseComplete:ew,cornerStateRef:z,children:(0,a.jsx)(X,{ref:L,layers:n,product:el,cornerStateRef:z})}),eu&&(0,a.jsx)(tT,{layers:n,product:eu}),(0,a.jsxs)("mesh",{position:[0,0,-100],onPointerDown:eg,onClick:ev,visible:!1,children:[(0,a.jsx)("planeGeometry",{args:[5e4,5e4]}),(0,a.jsx)("meshBasicMaterial",{})]})]})})});var t$=n(7861),tW=n(4120);let tH=(0,o.forwardRef)((e,t)=>{let{play:n,stop:r,fade:u}=(0,o.useContext)(v.nE),{setIsNavigationVisible:f,configureNavigationAnimation:d,configureNavigationCamera:m,setFooterVisible:p}=(0,o.useContext)(v._3),{shouldPresentContent:g,isAllRendererReady:y,viewState:w,detailProductIndex:R,focusProduct:C,openDetail:b}=(0,o.useContext)(v.z_),{size:S}=(0,s.C)(),T=(0,o.useRef)(null),P=(0,o.useRef)(null),M=(0,o.useRef)(null),A=(0,o.useRef)(!1),D=(0,o.useRef)(!1),_=(0,o.useRef)(!1),I=(0,o.useRef)(null),E=(0,o.useRef)(null),U=(0,o.useRef)(null),O=()=>{let e=S.height/tW.P;return{minX:S.width/2+70*e,maxX:S.width-40*e,minY:Math.min(150*e,S.height/4),maxY:S.height/2-70*e}},F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1500,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;M.current?.present(e),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{U.current=null,f(!0)},t)},N=()=>{f(!1),M.current?.dismiss()},L=(0,o.useCallback)(()=>{_.current&&F(0,0)},[]),z=e=>{},V=e=>{P.current.dismiss(),T.current.dismiss(),N(),_.current=!1,u(x.uc.BGM_PRODUCT,0,0,3e3,!0)};return(0,c._B)("green"),(0,o.useEffect)(()=>{d(O())},[S]),(0,o.useEffect)(()=>{if(y){var e;(0,q.Rm)("green","â¶ï¸","onRenderersReady"),e=null!==R,u(x.uc.BGM_PRODUCT,h.z.bgm.product.main,0,6e3,!0),P.current.present(0),T.current.present(),m({eye:tE.Sy.clone().add(new i.Pq0(0,0,400)),fov:36}),d({animate:!1,showMarker:!0,parentLerpX:.04,parentLerpY:.04,parentLerpZ:.04,childLerpX:.08,childLerpY:.08,childLerpZ:.08,angleStart:30,angleStep:30,...O()}),e||F(),p(!0),_.current=!0,null===R||A.current||(A.current=!0,D.current=!0,I.current=setTimeout(()=>{C(R)},500))}},[y]),(0,o.useEffect)(()=>{_.current&&w===v._f.DETAIL&&N()},[w]),(0,o.useEffect)(()=>
436{if(D.current&&w===v._f.FOCUS_IN)return D.current=!1,E.current=setTimeout(()=>{b()},1200),()=>{E.current&&clearTimeout(E.current)}},[w,b]),(0,o.useEffect)(()=>()=>{I.current&&clearTimeout(I.current),E.current&&clearTimeout(E.current),U.current&&clearTimeout(U.current)},[]),(0,o.useImperativeHandle)(t,()=>({onRoutePresentStart:z,onRouteDismissStart:V})),g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.DA,{ref:M,config:t$.BX.snapSymbol}),(0,a.jsx)(tj,{ref:T,layers:void 0,onDetailCloseComplete:L}),(0,a.jsx)(tL,{ref:P,layers:void 0})]})})},9319:(e,t,n)=>{n.d(t,{D0:()=>s,P7:()=>f,cD:()=>l,lj:()=>i,wO:()=>u});var r,a=n(9618),o=n(6382);let i=function(e,t,n,r,o,i,s){let l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0xffffff,u=document.createElement("canvas");u.style.backgroundColor="rgba(255, 0, 0, 0.0)";let c=u.getContext("2d");if(!c)return{texture:new a.GOR(u),canvasWidth:0,canvasHeight:0,labelWidth:0,labelHeight:0,labelSize:[]};c.textAlign="left",c.textBaseline="top",c.font=`${s}px ${i}`;let f=Math.ceil(1.1*c.measureText(n).width),d=Math.ceil(o),m=d+Math.ceil(s),p=m*t.length;u.width=f,u.height=p,c.scale(window.devicePixelRatio,window.devicePixelRatio),c.textAlign="left",c.textBaseline="top",c.clearRect(0,0,u.width,u.height);let h=[];for(let e=0;e<t.length;e++){let n=t[e],a=n.coordinate.longitude,u=a>=0?"W":"E",f=Math.abs(a),p=n.coordinate.latitude,g="",v=Math.abs(p%90);0<=p&&p<90?(g="N",v=90-v):90<=p&&p<180||180<=p&&p<270?g="S":270<=p&&(g="N");let x=Math.floor(m*e)+.5,y=`${n.city.toUpperCase()}`,w=`${g}'${v.toFixed(3)}\xb0 ${u}'${f.toFixed(3)}\xb0 `;c.fillStyle=`#${l.toString(16).padStart(6,"0")}`,c.font=`${o}px ${r}`,c.fillText(y,.5,x),c.font=`${s}px ${i}`,c.fillText(w,.5,x+d),c.font=`${o}px ${r}`;let R=Math.ceil(1.1*c.measureText(y).width);c.font=`${s}px ${i}`;let C=Math.ceil(1.1*c.measureText(w).width);h.push({width:Math.max(R,C),height:m})}let g=new a.GOR(u,a.UTZ,a.GJx,a.GJx,a.k6q,a.k6q,a.GWd,a.OUM);return g.anisotropy=e.capabilities.getMaxAnisotropy(),g.generateMipmaps=!0,g.minFilter=a.$_I,g.needsUpdate=!0,{texture:g,canvasWidth:f,canvasHeight:p,labelWidth:f,labelHeight:m,labelSize:h}},s=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0xffffff,i=document.createElement("canvas");i.style.backgroundColor="rgba(255, 0, 0, 0.0)";let s=i.getContext("2d");if(!s)return{texture:new a.GOR(i),canvasWidth:0,canvasHeight:0,textWidth:0,textHeight:0};s.font=`${n}px ${t}`,s.textAlign="left",s.textBaseline="top";let l=Math.ceil(1.1*s.measureText(e).width),u=Math.ceil(n),c=36*l,f=18*u;i.width=c,i.height=f,s.scale(window.devicePixelRatio,window.devicePixelRatio),s.font=`${n}px ${t}`,s.textAlign="left",s.textBaseline="top",s.clearRect(0,0,i.width,i.height);let d=o.Gf/36,m=o.Gf/36;for(let e=0;e<36;e++)for(let t=0;t<18;t++){let n=Math.floor(l*e)+.5,a=Math.floor(u*t)+.5,i=e*d,c=t*m,f=Math.round(o.zG*i)-180,p=f>=0?"W":"E",h=Math.abs(f),g=Math.round(o.zG*c),v="",x=Math.abs(g%90);0<=g&&g<90?(v="N",x=90-x):90<=g&&g<180||180<=g&&g<270?v="S":270<=g&&(v="N");let y=`${v}'${x}\xb0 ${p}'${h}\xb0 `;s.fillStyle=`#${r.toString(16).padStart(6,"0")}`,s.fillText(y,n,a)}let p=new a.GOR(i,a.UTZ,a.GJx,a.GJx,a.k6q,a.k6q,a.GWd,a.OUM);return p.needsUpdate=!0,{texture:p,canvasWidth:c,canvasHeight:f,textWidth:l,textHeight:u}},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=(e+t)*2,o=document.createElement("canvas");o.width=r,o.height=r,n&&(o.style.backgroundColor="rgba(255, 255, 255, 0.0)");let i=o.getContext("2d");return i&&(i.beginPath(),i.arc(e+t,e+t,e,0,2*Math.PI,!1),i.closePath(),i.fillStyle="#ffffff",i.fill()),new a.GOR(o)},u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=!(arguments.length>6)||void 0===arguments[6]||arguments[6],l=e+t+2,u=2*l,c=document.createElement("canvas");c.width=u,c.height=u,s&&(c.style.backgroundColor="rgba(255, 255, 255, 0.0)");let f=c.getContext("2d");return f&&(f.scale(window.devicePixelRatio,window.devicePixelRatio),f.beginPath(),f.arc(l,l,e,r,o,i),o===2*Math.PI&&f.closePath(),f.lineWidth=t,f.strokeStyle="#ffffff",f.stroke(),f.beginPath(),f.arc(l,l,n,0,2*Math.PI,!1),f.closePath(),f.fillStyle="#ffffff",f.fill()),{texture:new a.GOR(c),width:c.width,height:c.height}};var c=((r=c||{}).MoveTo="moveTo",r.LineTo="lineTo",r.ClosePath="closePath",r.Arc="arc",r);let f=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=document.createElement("canvas");r.width=e,r.height=t;let o=r.getContext("2d");return o?(o.scale(window.devicePixelRatio,window.devicePixelRatio),o.fillStyle="#000000",o.beginPath(),o.rect(0,0,e,t),o.fill(),o.fillStyle="#ffffff",o.beginPath(),o.roundRect(0,0,e,t,n),o.fill(),new a.GOR(r,a.UTZ,a.GJx,a.GJx,a.k6q,a.k6q,a.GWd,a.OUM)):new a.GOR(r)}},9753:(e,t,n)=>{n.d(t,{n:()=>r,N:()=>a});let r="/**\n * Screen-space depth-of-field fragment shader (8-tap Poisson disc).\n *\n * Used by PortraitBokehScene to apply selective DOF blur to the home portrait.\n * Both the portrait particles and the text dome receive physically-based DOF\n * from their real depth; only the cleared far plane is skipped.\n *\n * Depth handling:\n * 1. Particles and the text dome write their real logarithmic depth. The DOF\n * pass decodes it (linearizeDepth, gated by logDepthFar), reconstructs the\n * view-space position, and derives a per-fragment circle of confusion from\n * the 3D distance to the focus point (radial DOF).\n * 2. isBackgroun
436d(depth > 0.999) detects only the cleared far plane (no\n * geometry) â early return, so empty regions stay sharp.\n * 3. Poisson disc sampling skips far-plane neighbours so the background does\n * not leak into the blurred dome.\n * 4. CoC threshold (dofCocThreshold uniform) keeps a sharp zone around the\n * focus distance (portrait face); the dome sits far past focus so its\n * CoC saturates to dofMaxBlur and it reads as uniformly soft.\n *\n * RT requirements (set up in PortraitBokehScene.tsx):\n * - DepthStencilFormat (UnsignedInt248Type) for stencil support\n * - near=100 for depth precision (default near=0.01 loses precision)\n * - clearStencil() before each render pass\n *\n * Parameters (camera.ts):\n * - dofAperture: controls CoC growth rate (distance-to-blur sensitivity)\n * - dofMaxBlur: caps maximum blur radius\n * - dofFocusViewPos: view-space focus point (lerped in setFocus)\n */\nprecision highp float;\nprecision highp sampler2D;\n\nuniform sampler2D tColor;\nuniform sampler2D tDepth;\n\nuniform float cameraNear;\nuniform float cameraFar;\n/* View-space position of the focus point (face marker). Radial DOF keeps a\n * spherical sharp zone around this point regardless of camera angle. */\nuniform vec3 dofFocusViewPos;\n/* x = tan(fovY/2) * aspect, y = tan(fovY/2); used to reconstruct view-space\n * positions from UV + linear depth. */\nuniform vec2 viewTanHalfFov;\nuniform float dofAperture;\nuniform float dofMaxBlur;\nuniform vec2 resolution;\n/* Sharp-zone CoC fast-path threshold. Also sets the blur onset step size\n * (threshold * resolution.y px), so it is kept small for a continuous\n * crisp-to-blur transition. */\nuniform float dofCocThreshold;\n/* Home scene: view-space far distance for logarithmic depth decode.\n * >0 selects the log decode path in linearizeDepth (renderer\n * logarithmicDepthBuffer:true); other DOF scenes leave it 0 to keep the\n * standard perspective linearization and their tuned look unchanged. */\nuniform float logDepthFar;\n\nvarying vec2 vUv;\n\n/**\n * Linearize depth from the depth buffer.\n * Converts non-linear [0,1] depth to linear view-space distance.\n */\nfloat linearizeDepth(float depth) {\n /* Logarithmic depth buffer decode. three writes\n * depth = log2(1 + w) / log2(far + 1), where w is the view-space distance,\n * so exp2(depth * log2(far + 1)) - 1 recovers w. Gated on logDepthFar so\n * only the log-depth home scene uses it; other scenes keep the perspective\n * linearization below. */\n if (logDepthFar > 0.0) {\n return exp2(depth * log2(logDepthFar + 1.0)) - 1.0;\n }\n float z = depth * 2.0 - 1.0;\n return (2.0 * cameraNear * cameraFar) / (cameraFar + cameraNear - z * (cameraFar - cameraNear));\n}\n\n/**\n * Reconstruct the view-space position from screen UV and linear view depth.\n */\nvec3 viewPositionFromDepth(vec2 uv, float linearDepth) {\n vec2 ndc = uv * 2.0 - 1.0;\n return vec3(ndc * viewTanHalfFov * linearDepth, -linearDepth);\n}\n\n/**\n * Compute circle of confusion from a view-space position.\n * Radial model: blur grows with the 3D distance from the focus point, so the\n * sharp zone is a sphere around the face marker (crisp at any camera angle).\n */\nfloat computeCoC(vec3 viewPos) {\n return clamp(length(viewPos - dofFocusViewPos) * dofAperture, 0.0, dofMaxBlur);\n}\n\n/**\n * Check if a depth value represents the far plane (background).\n * Background and particle-only pixels should not be blurred.\n */\nbool isBackground(float depth) {\n return depth > 0.999;\n}\n\nvoid main() {\n vec2 texelSize = 1.0 / resolution;\n\n /* Centre sample */\n vec4 centerColor = texture2D(tColor, vUv);\n float centerDepth = texture2D(tDepth, vUv).x;\n\n /**\n * Skip blur only for the cleared far plane (no geometry). Particles and the\n * text dome write real depth, so they are processed below and receive DOF\n * from their actual distance.\n */\n if (isBackground(centerDepth)) {\n gl_FragColor = centerColor;\n return;\n }\n\n float centerLinearDepth = linearizeDepth(centerDepth);\n float centerCoC = computeCoC(viewPositionFromDepth(vUv, centerLinearDepth));\n\n /**\n * If CoC is below the sharp-zone threshold, skip blur entirely (fast path).\n * The threshold also sets the blur onset step (threshold * resolution.y px),\n * so a small value keeps the crisp-to-blur transition visually continuous.\n */\n if (centerCoC < dofCocThreshold) {\n gl_FragColor = centerColor;\n return;\n }\n\n /* Blur radius in pixels, capped for performance */\n float blurRadius = centerCoC * resolution.y;\n blurRadius = min(blurRadius, 16.0);\n\n /**\n * 8-tap Poisson disc offsets for variable-radius blur.\n * Distributed across a unit disc for even coverage.\n */\n vec2 p0 = vec2(-0.613, 0.617);\n vec2 p1 = vec2( 0.170, -0.040);\n vec2 p2 = vec2(-0.299, -0.293);\n vec2 p3 = vec2( 0.614, 0.457);\n vec2 p4 = vec2(-0.098, 0.467);\n vec2 p5 = vec2( 0.350, -0.500);\n vec2 p6 = vec2(-0.541, -0.059);\n vec2 p7 = vec2( 0.421, 0.081);\n\n /* Accumulate weighted samples */\n vec4 colorSum = centerColor;\n float weightSum = 1.0;\n\n /**\n * Sample neighbours with Poisson disc.\n * Backgroun
436d / particle samples (depth > 0.999) are skipped entirely\n * so that particle colours never leak into text dome blur.\n */\n #define DOF_SAMPLE(OFFSET) { \\\n vec2 sampleUV = clamp(vUv + (OFFSET) * blurRadius * texelSize, 0.0, 1.0); \\\n float sampleDepth = texture2D(tDepth, sampleUV).x; \\\n if (!isBackground(sampleDepth)) { \\\n vec4 sampleColor = texture2D(tColor, sampleUV); \\\n float sampleCoC = computeCoC(viewPositionFromDepth(sampleUV, linearizeDepth(sampleDepth))); \\\n float weight = smoothstep(0.0, 1.0, sampleCoC / max(centerCoC, 0.001)); \\\n colorSum += sampleColor * weight; \\\n weightSum += weight; \\\n } \\\n }\n\n DOF_SAMPLE(p0)\n DOF_SAMPLE(p1)\n DOF_SAMPLE(p2)\n DOF_SAMPLE(p3)\n DOF_SAMPLE(p4)\n DOF_SAMPLE(p5)\n DOF_SAMPLE(p6)\n DOF_SAMPLE(p7)\n\n #undef DOF_SAMPLE\n\n gl_FragColor = colorSum / weightSum;\n}\n",a="varying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = vec4(position.xy, 0.0, 1.0);\n}\n"},9841:(e,t,n)=>{n.d(t,{Vx:()=>M,DA:()=>U});var r=n(7973),a=n(6065),o=n(9618),i=n(3267),s=n(4695),l=n(6133),u=n(2488),c=n(6987),f=n(2310),d=n(2466),m=n(108),p=n(4188),h=n(4866),g=n(4357);let v=(0,a.forwardRef)((e,t)=>{let{children:n,layers:o,name:s}=e,{navigationCameraConfig:l}=(0,a.useContext)(f._3),u=(0,i.C)(e=>e.gl),c=(0,i.C)(e=>e.size),d=(0,a.useRef)(null),m=(0,a.useRef)(null),v=(0,a.useRef)(null);return(0,a.useEffect)(()=>{m.current&&(m.current.aspect=c.width/c.height),m.current&&m.current.updateProjectionMatrix()},[c]),(0,a.useImperativeHandle)(t,()=>({children:n,camera:m.current,ambientLight:v.current,renderer:u})),(0,r.jsxs)(p.Yi,{ref:d,renderPriority:1e3,children:[(0,r.jsx)(h.u,{ref:m,layers:o,name:s,makeDefault:!0,position:l.current.eye??g.Q7,fov:l.current.fov??g.pq,far:l.current.far??1e4}),(0,r.jsx)("ambientLight",{ref:v,layers:o,name:s,intensity:1}),n]})});var x=n(6382),y=n(8528),w=n(79);let R=e=>{let{index:t,connectorRefs:n,progressRef:r,onRegisterOpacitySpring:o,onRegisterProgressSpring:i}=e,l=(0,a.useRef)(r);l.current=r;let u=(0,s.zh)(()=>({from:{progress:0},onChange:e=>n.current?.[t]?.setOpacityRatio(e.value.progress)}),[])[1],c=(0,s.zh)(()=>({from:{progress:0},onChange:e=>{let n=l.current.current;n&&(n[t]=e.value.progress)}}),[])[1];return(0,a.useEffect)(()=>{o(t,u),i(t,c)},[]),null};var C=n(5844);let b=(0,a.forwardRef)((e,t)=>{let{layers:n,order:i,pathname:d,label:m,onPresentStart:p,onPresentEnd:h,onDismissStart:g,onDismissEnd:v}=e,{play:y,stop:w,getNextSFXNavigationMainHoverKey:R,getNextSFXTransitionTextKey:b,getNextSFXTransitionConnectorKey:S}=(0,a.useContext)(f.nE),{setNavigationPath:T,setIsNavigationHovered:P,setNavigationHoveredIndex:M,isClickLocked:A,setIsClickLocked:D,pointerCaptured:_}=(0,a.useContext)(f._3),{primaryTexture:I}=(0,a.useContext)(f.Oo),{fonts:E}=(0,a.useContext)(f.DM),U=c.i.label.fontSize.navigation,O=(0,a.useRef)(null),F=(0,a.useRef)(null),N=(0,a.useRef)(null),L=(0,a.useRef)(null),z=(0,a.useRef)(null),V=(0,a.useRef)(null),k=(0,a.useRef)(null),[G,B]=(0,a.useTransition)(),[j,$]=(0,a.useState)(!1),[W,H]=(0,a.useState)(!1),Y=(0,a.useRef)(W);Y.current=W;let[X,q]=(0,a.useState)(!1),[Z,Q]=(0,a.useState)(new o.I9Y(0,0)),K=(0,a.useMemo)(()=>new o.I9Y(Z.x+6+6,Z.y+3+3),[Z]),[J,ee]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>V.current?.setOpacity(e.value.progress)}),[]),[et,en]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>L.current?.setOpacityRatio(e.value.progress)}),[]),[er,ea]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>z.current?.setOpacityRatio(e.value.progress)}),[]),[eo,ei]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>{z.current?.hover(e.value.progress),F.current?.setPositionZ(4+20*e.value.progress),N.current?.hover(e.value.progress)}}),[]),es=(e,t,n,r,a,o)=>{O.current&&(O.current.position.x+=(e.x-O.current.position.x)*(0,x.xx)(n,o),O.current.position.y+=(e.y-O.current.position.y)*(0,x.xx)(r,o),O.current.position.z+=(e.z-O.current.position.z)*(0,x.xx)(a,o),O.current.lookAt(t.position.x,t.position.y,t.position.z))},el=(e,t)=>{F.current&&V.current&&N.current&&(F.current.present(e,t),V.current.present(e,t),ee.stop(!0),ee.start({from:{progress:J.progress},to:{progress:1},delay:t,config:{duration:.2*e}}),en.stop(!0),en.start({from:{progress:et.progress},to:{progress:1},delay:t,config:{duration:.2*e}}),ea.stop(!0),ea.start({from:{progress:er.progress},to:{progress:1},delay:t,config:{duration:.2*e}}),N.current.setEnabled(!0))},eu=(e,t)=>
436{F.current&&V.current&&N.current&&(F.current.dismiss(e,t),V.current.dismiss(e,t),ee.stop(!0),ee.start({from:{progress:J.progress},to:{progress:0},delay:t,config:{duration:e}}),en.stop(!0),en.start({from:{progress:et.progress},to:{progress:0},delay:t,config:{duration:e}}),ea.stop(!0),ea.start({from:{progress:er.progress},to:{progress:0},delay:t,config:{duration:e}}),ei.stop(!0),ei.start({from:{progress:eo.progress},to:{progress:0},config:{duration:.1*e,easing:s.le.linear},onRest:()=>{N.current?.setHovered(!1),N.current?.setEnabled(!1)}}))},ec=()=>V.current?.getSegments()??[,,,,].fill(new o.cZY),ef=()=>K;return(0,a.useEffect)(()=>{let e=e=>{e.stopPropagation()};return window.addEventListener("mousedown",e),window.addEventListener("mouseup",e),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("mouseup",e),k.current&&clearTimeout(k.current)}},[]),(0,a.useEffect)(()=>{I&&E.USansRgBd&&V.current&&V.current.setDiffuseTexture(I)},[I,E.USansRgBd]),(0,a.useEffect)(()=>{j&&N.current&&F.current&&(N.current.setHovered(X),X?(ei.stop(!0),F.current.hover(600,0),ei.start({from:{progress:eo.progress},to:{progress:1},config:{duration:100,easing:s.le.linear}})):(ei.stop(!0),ei.start({from:{progress:eo.progress},to:{progress:0},config:{duration:100,easing:s.le.linear}}))),B(()=>{P(X),M(X?i:null)})},[X]),(0,a.useImperativeHandle)(t,()=>({pathname:d,mesh:O.current,setIsActive:H,present:el,dismiss:eu,updatePosition:es,getSegments:ec,getSize:ef}),[]),E.USansRgBd&&(0,r.jsxs)("mesh",{ref:O,layers:n,children:[(0,r.jsxs)("mesh",{layers:n,position:[0,0,100],onClick:e=>{!j||A||_.current||(e.stopPropagation(),$(!1),q(!1),D(!0),T(d),document.body.style.cursor="auto",w(C.uc.SFX_NAVIGATION_MAIN_CLICK),y(C.uc.SFX_NAVIGATION_MAIN_CLICK,u.z.sfx.navigation.mainClick,!1))},onPointerEnter:e=>{!j||A||_.current||(e.stopPropagation(),q(!0),document.body.style.cursor="pointer",y(R(),u.z.sfx.navigation.mainHover1,!1))},onPointerLeave:e=>{!j||A||_.current||(e.stopPropagation(),q(!1),document.body.style.cursor="auto")},children:[(0,r.jsx)("planeGeometry",{args:[K.x,K.y]}),(0,r.jsx)("meshBasicMaterial",{opacity:0,transparent:!0,side:o.hB5,depthTest:!1})]}),(0,r.jsx)(l.vs,{ref:F,layers:n,gridY:2,noiseFrequency:.1,text:m,fontFile:E.USansRgBd.fontFile,fontTexture:E.USansRgBd.fontTexture,fontSize:U,colorMultiplier:1,idleGlitch:W,onInitialized:()=>{let e=F.current?.getBoundingBoxSize();e&&(F.current?.setPositionXYZ(-e.x/2,e.y/2,4),Q(new o.I9Y(e.x,e.y)))},onPresentStart:()=>($(!1),p?.(),void(k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{k.current=null,y(b(),u.z.sfx.navigation.mainTransitionText1,!1),y(S(),u.z.sfx.navigation.mainTransitionConnector1,!1)},1200))),onPresentEnd:()=>($(!Y.current),h?.()),onDismissStart:()=>($(!1),g?.()),onDismissEnd:()=>($(!1),v?.())}),(0,r.jsx)(l.Yi,{ref:N,layers:n,width:K.x,height:K.y,fillColor:c.i.label.hoverColor,fillOpacity:c.i.label.hoverOpacity}),(0,r.jsx)(l.dr,{ref:z,layers:n,width:K.x,height:K.y,length:2,color:c.i.label.bracketColor,opacity:c.i.label.bracketOpacity}),(0,r.jsx)(l.Ml,{ref:L,layers:n,width:K.x,height:K.y,enableLine:!0,enableFill:!1,lineColor:c.i.label.outlineColor,lineOpacity:c.i.label.navigationOutlineOpacity}),(0,r.jsx)(l.pi,{ref:V,layers:n,width:K.x,height:K.y,blur:.3,opacity:.7,transparent:!0})]})});b.displayName="NavigationMenu";let S=new o.Q1f(c.i.connector.lineColor),T=new o.Q1f(c.i.connector.capColor),P=[1,2,3,4],M=(0,a.forwardRef)((e,t)=>{let{layers:n}=e,{play:h,getNextSFXTransitionConnectorKey:g}=(0,a.useContext)(f.nE),{routeState:C}=(0,a.useContext)(f.Pl),{navigationScene:M,navigationMenus:A,navigationMarkerScreenPosition:D,isNavigationVisible:_,navigationAnimationConfig:I,isNavigationHovered:E,navigationHoveredIndex:U,setIsClickLocked:O}=(0,a.useContext)(f._3),F=(0,a.useRef)(M).current,N=(0,a.useRef)(A).current,L=(0,a.useRef)(!1);L.current=E;let z=(0,a.useRef)(null);z.current=U;let V=(0,a.useRef)(null),k=(0,a.useRef)([,,,,,].fill(null)),G=(0,a.useCallback)(e=>t=>{k.current[e]=t},[]),B=(0,a.useRef)([,,,,].fill(null)),j=(0,a.useCallback)(e=>t=>{B.current[e]=t},[]),$=(0,a.useRef)(null),W=(0,a.useRef)(null),H=(0,a.useRef)(null),Y=(0,a.useRef)(0),X=(0,i.C)(e=>e.size),q=(0,a.useRef)(!1),Z=(0,a.useRef)([0,1,2,3,4]),Q=(0,a.useRef)(P.slice()),K=(0,a.useRef)(0),J=(0,a.useRef)([,,,,].fill(0)),ee=(0,s.zh)(()=>({from:{progress:0},onChange:e=>$.current.setOpacityRatio(e.value.progress)}),[])[1],et=(0,s.zh)(()=>({from:{progress:0},onChange:e=>W.current.setOpacityRatio(e.value.progress)}),[])[1],en=(0,s.zh)(()=>({from:{progress:0},onChange:e=>K.current=e.value.progress}),[])[1],er=(0,a.useRef)([,,,,].fill(null)),ea=(0,a.useRef)([,,,,].fill(null)),eo=(0,a.useCallback)((e,t)=>{er.current[e]=t},[]),ei=(0,a.useCallback)((e,t)=>{ea.current[e]=t},[]),es=()=>{for(let e=0;e<Z.current.length;e++){let t=Z.current[e],n=k.current[t];n.setIsActive(null!=C.pathname&&(0,w.N)(n.pathname)===(0,w.N)(C.pathname)),n.dismiss(100,50*e)}ee.stop(!0),ee.start({to:{progress:0},config:{duration:100,easing:s.le.linear}}),et.stop(!0),et.start({to:{progress:0},config:{duration:100,easing:s.le.linear}}),en.stop(!0),en.start({to:{progress:0},config:{duration:100,easing:s.le.linear}});for(let e=0;e<ea.current.length;e++)er.current[e].stop(!0),er.current[e].start({to:{progress:0},config:{duration:100,easing:s.le.linear}}),ea.current[e].stop(!0),ea.current[e].start({to:{progress:0},config:{duration:100,easing:s.le.linear}})},el=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=I.current;e.x>r.maxX-t?e.setX(r.maxX-t):e.x<r.minX+t&&e.setX(r.minX+t),n&&(e.y>r.maxY?e.setY(r.maxY):e.y<r.minY&&e.setY(r.minY))};return(0,d._B)("crimson"),(0,a.useEffect)(()=>{F.current=V.current,N.current=k.current},[]),(0,a.useEffect)(()=>{switch(C.state){case f.bC.PRESENTING:q.current=!0;break;case f.bC.DISMISSING:q.current=!1,es();case f.bC.NONE:}},[C]),(0,a.useEffect)(()=>{_?((()=>
436{if(C.state!==f.bC.PRESENTING)return;let e=[0,1,2,3,4],t=(null!=C.pathname?({"/":0,"/product":1,"/sketch":2,"/award":3,"/contact":4})[(0,w.N)(C.pathname)]:void 0)??0,n=[],r=t-1,a=t+1;for(n.push(t);r>=0||a<e.length;)r>=0&&(n.push(r),r--),a<e.length&&(n.push(a),a++);Z.current=n})(),(()=>{H.current=null,Y.current=0,(()=>{let e=D.current;if(!e)return;let t=V.current?.camera;if(!t)return;let n=(0,y.UT)(e,t,X,1500);for(let e of k.current)e?.mesh&&e.mesh.position.copy(n);$.current&&$.current.position.copy(n)})(),I.current.showMarker&&(ee.stop(!0),ee.start({to:{progress:1},delay:500,config:{duration:1e3,easing:s.le.linear}}));for(let e=0;e<k.current.length;e++){let t=500+(e+1)*160,n=k.current[e];n.setIsActive(null!=C.pathname&&(0,w.N)(n.pathname)===(0,w.N)(C.pathname)),n.present(1500,t)}et.stop(!0),et.start({to:{progress:1},delay:500,config:{duration:0,easing:s.le.linear}}),en.stop(!0),en.start({to:{progress:1},delay:660,config:{duration:160,easing:s.le.easeInOutQuad}});for(let e=0;e<ea.current.length;e++){er.current[e].stop(!0),er.current[e].start({to:{progress:1},delay:500+(e+1)*160,config:{duration:20,easing:s.le.linear}}),ea.current[e].stop(!0);let t=e===ea.current.length-1;ea.current[e].start({to:{progress:1},delay:500+(e+1)*160,config:{duration:160,easing:s.le.easeInOutQuad},onStart:()=>{h(g(),u.z.sfx.navigation.mainTransitionConnector1,!1)},onRest:t?()=>{O(!1)}:void 0})}})()):es()},[_]),(0,d.Ql)((e,t)=>{(e=>{let t=D.current;if(!t)return;let n=V.current.camera,r=(0,y.UT)(t,n,X,1500),a=Z.current.concat(),i=I.current,s=H.current,l=s?t.distanceTo(s)/Math.max(e,1e-4):0;s?s.copy(t):H.current=t.clone();let u=l>Y.current?.06:.02;Y.current+=(0,x.xx)(u,e)*(l-Y.current);let c=1-.8*Math.min(1,Math.max(0,Y.current/500)),f=x.V$*i.angleStart,d=x.V$*i.angleStep,m=d*(a.length-4),p=((e,t,n,r,a,i,s)=>{let l=k.current[0];if(!l)return null;let u=l.getSize().x,c=(0,y.UK)(new o.Pq0(0,0,1500),t,X),f=Math.abs((0,y.UK)(new o.Pq0(u,0,1500),t,X).x-c.x),d=e.clone().add(new o.Pq0(60,0,0));d=(0,y.lB)(d,e,new o.Pq0(0,0,1),n).setZ(1500);let m=(0,y.UK)(d.clone(),t,X);return el(m,2*f),d=(0,y.UT)(m,t,X,1500),l.updatePosition(d,t,r,a,i,s),l.mesh?.position?l.mesh.position.clone():d})(r,n,f,i.parentLerpX*c,i.parentLerpY*c,i.parentLerpZ*c,e);p&&(Q.current=((e,t,n,r,a,i,s,l,u)=>{let c=((e,t,n,r,a)=>{let i=new o.Pq0().subVectors(t,e).normalize(),s=t.clone().add(i.multiplyScalar(100)).setZ(1500),l=(0,y.lB)(s,t,new o.Pq0(0,0,1),a),u=[];for(let e=0;e<4;e++){let a=(0,y.lB)(l.clone(),t,new o.Pq0(0,0,1),-r*e).setZ(1500),i=(0,y.UK)(a.clone(),n,X
436);el(i,0,!1),a=(0,y.UT)(i,n,X,1500),u.push({slotIndex:e,position:a,screenY:i.y})}return u})(e,t,n,r,a),f=(e=>{let t=[,,,,],n=e.concat().sort((e,t)=>e.screenY===t.screenY?e.slotIndex-t.slotIndex:e.screenY-t.screenY);for(let e=0;e<n.length;e++)t[n[e].slotIndex]=P[e];return t})(c);for(let e of c){let t=f[e.slotIndex],r=L.current&&t===z.current?1e-4:1,a=e.slotIndex+2,o=r*i/a,c=r*s/a,d=r*l/a;k.current[t].updatePosition(e.position,n,o,c,d,u)}return f})(r,p,n,d,m/4,i.childLerpX*c,i.childLerpY*c,i.childLerpZ*c,e),$.current&&(I.current.animate?($.current.position.x=r.x,$.current.position.y=r.y,$.current.position.z=r.z):$.current.position.copy(r)),(e=>{if(!$.current)return;let t=k.current[0].getSegments(),n=(0,y._K)($.current.position,t),r=new o.Pq0;r.lerpVectors($.current.position,n,K.current),W.current.connect($.current.position,r);let a=k.current[0].getSegments();for(let t=0;t<B.current.length;t++){let n=e[t],r=k.current[n].getSegments(),i=(0,y.eN)(a,r);if(i.length<2)continue;let s=new o.Pq0;s.lerpVectors(i[0],i[1],J.current[t]),B.current[t].connect(i[0],s)}})(Q.current))})(t)}),(0,a.useImperativeHandle)(t,()=>({_:()=>{}})),(0,r.jsxs)(v,{ref:V,layers:n,name:p.eU.NAVIGATION,children:[(0,r.jsx)("group",{children:(0,r.jsx)(l.q1,{ref:$,type:l.u$.CIRCLE,radius:4,enableOutline:!0,enableBackground:!1,enableDot:!0,lineColor:c.i.marker.color,lineOpacity:c.i.marker.opacity,dotColor:c.i.marker.color,dotOpacity:c.i.marker.opacity})}),(0,r.jsx)(l.Wi,{ref:W,layers:n,style:l.Sc.LINE,enableStartCap:!1,enableEndCap:!0,lineStartColor:S,lineEndColor:S,lineOpacity:c.i.connector.lineOpacity,startCapColor:T,startCapOpacity:c.i.connector.capOpacity,endCapColor:T,endCapOpacity:c.i.connector.capOpacity}),Array.from({length:4},(e,t)=>(0,r.jsx)(R,{index:t,connectorRefs:B,progressRef:J,onRegisterOpacitySpring:eo,onRegisterProgressSpring:ei},`child-connector-spring-${t}`)),Array.from({length:4},(e,t)=>(0,r.jsx)(l.Wi,{ref:j(t),layers:n,style:l.Sc.DASHED,enableStartCap:!0,enableEndCap:!0,lineStartColor:S,lineEndColor:S,lineOpacity:c.i.connector.lineOpacity,startCapColor:T,startCapOpacity:c.i.connector.capOpacity,endCapColor:T,endCapOpacity:c.i.connector.capOpacity},t)),(0,r.jsx)(b,{ref:G(0),layers:n,order:0,pathname:"/",label:"Home"}),(0,r.jsx)(b,{ref:G(1),layers:n,order:1,pathname:"/product",label:"Product"}),(0,r.jsx)(b,{ref:G(2),layers:n,order:2,pathname:`/sketch/${m.rM}`,label:"Sketch"}),(0,r.jsx)(b,{ref:G(3),layers:n,order:3,pathname:"/award",label:"Award"}),(0,r.jsx)(b,{ref:G(4),layers:n,order:4,pathname:"/contact",label:"Contact"})]})});var A=n(4120);let D=[[0,0,1],[2*Math.sqrt(2)/3,0,-1/3],[-(Math.sqrt(2)/3),Math.sqrt(2/3),-1/3],[-(Math.sqrt(2)/3),-Math.sqrt(2/3),-1/3]],_=new o.PTz,I=new o.Pq0,E=new o.Pq0,U=(0,a.forwardRef)((e,t)=>{let{config:n}=e,{navigationMarkerScreenPosition:l}=(0,a.useContext)(f._3),u=(0,i.C)(e=>e.size),c=(0,i.C)(e=>e.gl),m=(0,a.useRef)(c).current,p=(0,a.useMemo)(()=>new o.Z58,[]),h=(0,a.useMemo)(()=>{let e=new o.ubm(40,1,.1,500);return e.position.set(0,0,100),e.lookAt(0,0,0),e},[]);(0,a.useEffect)(()=>{h.aspect=u.width/u.height,h.updateProjectionMatrix()},[u.width,u.height]),(0,i.D)(()=>{let e=m.autoClear;m.autoClear=!1,m.clearDepth(),m.render(p,h),m.autoClear=e},10);let g=(0,a.useMemo)(()=>new o.tcD(n.circleRadius,24),[n.circleRadius]),v=(0,a.useMemo)(()=>new o.bdM(n.crossSize,n.crossThickness),[n.crossSize,n.crossThickness]),x=(0,a.useMemo)(()=>new o.bdM(n.crossThickness,n.crossSize),[n.crossThickness,n.crossSize]),y=(0,a.useMemo)(()=>{let e=new o.ypk,t=n.triangleSize;return e.moveTo(0,t),e.lineTo(.866*t,-(.5*t)),e.lineTo(-(.866*t),-(.5*t)),e.closePath(),new o.MSw(e)},[n.triangleSize]),w=(0,a.useMemo)(()=>{let e=n.diamondSize,t=new o.bdM(e,e);return t.rotateZ(Math.PI/4),t},[n.diamondSize]),R=(0,a.useMemo)(()=>new o.Q1f(0xffffff),[]),C=(0,a.useMemo)(()=>new o.V9B({color:R,transparent:!0,depthTest:!1,opacity:0}),[]),b=(0,a.useMemo)(()=>new o.V9B({color:R,transparent:!0,depthTest:!1,opacity:0}),[]),S=(0,a.useMemo)(()=>new o.V9B({color:R,transparent:!0,depthTest:!1,opacity:0}),[]),T=(0,a.useMemo)(()=>new o.V9B({color:R,transparent:!0,depthTest:!1,opacity:0}
436),[]),P=(0,a.useRef)(null),M=(0,a.useRef)(null),U=(0,a.useRef)(null),O=(0,a.useRef)(null),F=(0,a.useRef)(null),N=(0,a.useRef)(0),L=(0,a.useRef)(0),z=(0,a.useRef)(new o.Pq0),[,V]=(0,s.zh)(()=>({from:{progress:0},onChange:e=>{N.current=e.value.progress}}),[]);return(0,a.useEffect)(()=>{let e=P.current;return e&&p.add(e),()=>{e&&p.remove(e)}},[]),(0,d.Ql)((e,t)=>{if(!P.current)return;L.current+=t;let r=L.current,a=100*Math.tan(20*Math.PI/180)*2/u.height,o=u.height/A.P,i=(n.screenX-.5)*u.width*a,s=(.5-n.screenY)*u.height*a;P.current.position.set(i,s,0),P.current.scale.setScalar(a*o);let c=n.orbitRadiusMin,f=n.orbitRadiusMax,d=(c+f)*.5+Math.sin(r*n.radiusFreq)*((f-c)*.5),m=r*n.angularSpeed;I.set(Math.sin(n.tilt),Math.cos(n.tilt),0).normalize(),_.setFromAxisAngle(I,m);let p=[M.current,U.current,O.current,F.current];for(let e=0;e<4;e++){let t=p[e];if(!t)continue;let n=D[e];E.set(n[0],n[1],n[2]).applyQuaternion(_).multiplyScalar(d),t.position.copy(E)}if(O.current&&l?.current){let e=z.current,t=a*o;e.set(i+O.current.position.x*t,s+O.current.position.y*t,O.current.position.z*t),e.project(h);let n=(e.x+1)*.5*u.width,r=(1-e.y)*.5*u.height;l.current.set(n-1,r)}let g=N.current*n.opacity;C.opacity=g,b.opacity=g,S.opacity=g,T.opacity=g}),(0,a.useImperativeHandle)(t,()=>({present:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;V.stop(!0),V.start({to:{progress:1},delay:e,config:{duration:n.presentDuration,easing:s.le.linear}})},dismiss:()=>{V.stop(!0),V.start({to:{progress:0},config:{duration:n.dismissDuration,easing:s.le.linear}})}})),(0,r.jsxs)("group",{ref:P,children:[(0,r.jsx)("mesh",{ref:M,geometry:g,material:C}),(0,r.jsxs)("group",{ref:U,children:[(0,r.jsx)("mesh",{geometry:v,material:b}),(0,r.jsx)("mesh",{geometry:x,material:b})]}),(0,r.jsx)("mesh",{ref:O,geometry:y,material:S}),(0,r.jsx)("mesh",{ref:F,geometry:w,material:T})]})});U.displayName="NavigationSnapSymbol"}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.