1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7383370c-0de3-4892-80d9-857ea47f2c27",e._sentryDebugIdIdentifier="sentry-dbid-7383370c-0de3-4892-80d9-857ea47f2c27")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[72069],{14814:(e,t,n)=>{n.d(t,{r:()=>i});let i=parseInt(n(85339).sPf.replace(/\D+/g,""))},21955:(e,t,n)=>{n.d(t,{Q:()=>s});var i=n(88945),r=n(12115),o=n(85339),a=n(83388);let s=r.forwardRef(function({children:e,follow:t=!0,lockX:n=!1,lockY:s=!1,lockZ:l=!1,...d},c){let u=r.useRef(null),f=r.useRef(null),p=new o.PTz;return(0,a.D)(({camera:e})=>{if(!t||!f.current)return;let i=u.current.rotation.clone();f.current.updateMatrix(),f.current.updateWorldMatrix(!1,!1),f.current.getWorldQuaternion(p),e.getWorldQuaternion(u.current.quaternion).premultiply(p.invert()),n&&(u.current.rotation.x=i.x),s&&(u.current.rotation.y=i.y),l&&(u.current.rotation.z=i.z)}),r.useImperativeHandle(c,()=>f.current,[]),r.createElement("group",(0,i.A)({ref:f},d),r.createElement("group",{ref:u},e))})},43646:(e,t,n)=>{let i,r;n.d(t,{E:()=>x});var o=n(88945),a=n(12115),s=n(12669),l=n(85339),d=n(83388);let c=new l.Pq0,u=new l.Pq0,f=new l.Pq0,p=new l.I9Y;function m(e,t,n){let i=c.setFromMatrixPosition(e.matrixWorld);i.project(t);let r=n.width/2,o=n.height/2;return[i.x*r+r,-(i.y*o)+o]}let h=e=>1e-10>Math.abs(e)?0:e;function v(e,t,n=""){let i="matrix3d(";for(let n=0;16!==n;n++)i+=h(t[n]*e.elements[n])+(15!==n?",":")");return n+i}let y=(i=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>v(e,i)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>v(e,r(t),"translate(-50%,-50%)")),x=a.forwardRef(({children:e,eps:t=.001,style:n,className:i,prepend:r,center:v,fullscreen:x,portal:w,distanceFactor:S,sprite:b=!1,transform:E=!1,occlude:_,onOcclude:M,castShadow:A,receiveShadow:L,material:P,geometry:z,zIndexRange:U=[0x1000037,0],calculatePosition:C=m,as:O="div",wrapperClass:D,pointerEvents:R="auto",...T},I)=>{let{gl:B,camera:W,scene:H,size:j,raycaster:N,events:q,viewport:F}=(0,d.C)(),[$]=a.useState(()=>document.createElement(O)),G=a.useRef(null),k=a.useRef(null),V=a.useRef(0),Q=a.useRef([0,0]),Y=a.useRef(null),J=a.useRef(null),X=(null==w?void 0:w.current)||q.connected||B.domElement.parentNode,Z=a.useRef(null),K=a.useRef(!1),ee=a.useMemo(()=>_&&"blending"!==_||Array.isArray(_)&&_.length&&function(e){return e&&"object"==typeof e&&"current"in e}(_[0]),[_]);a.useLayoutEffect(()=>{let e=B.domElement;_&&"blending"===_?(e.style.zIndex=`${Math.floor(U[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[_]),a.useLayoutEffect(()=>{if(k.current){let e=G.current=s.createRoot($);if(H.updateMatrixWorld(),E)$.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=C(k.current,W,j);$.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return X&&(r?X.prepend($):X.appendChild($)),()=>{X&&X.removeChild($),e.unmount()}}},[X,E]),a.useLayoutEffect(()=>{D&&($.className=D)},[D]);let et=a.useMemo(()=>E?{position:"absolute",top:0,left:0,width:j.width,height:j.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:v?"translate3d(-50%,-50%,0)":"none",...x&&{top:-j.height/2,left:-j.width/2,width:j.width,height:j.height},...n},[n,v,x,j,E]),en=a.useMemo(()=>({position:"absolute",pointerEvents:R}),[R]);a.useLayoutEffect(()=>{var t,r;K.current=!1,E?null==(t=G.current)||t.render(a.createElement("div",{ref:Y,style:et},a.createElement("div",{ref:J,style:en},a.createElement("div",{ref:I,className:i,style:n,children:e})))):null==(r=G.current)||r.render(a.createElement("div",{ref:I,style:et,className:i,children:e}))});let ei=a.useRef(!0);(0,d.D)(e=>{if(k.current){W.updateMatrixWorld(),k.current.updateWorldMatrix(!0,!1);let e=E?Q.current:C(k.current,W,j);if(E||Math.abs(V.current-W.zoom)>t||Math.abs(Q.current[0]-e[0])>t||Math.abs(Q.current[1]-e[1])>t){let t=function(e,t){let n=c.setFromMatrixPosition(e.matrixWorld),i=u.setFromMatrixPosition(t.matrixWorld),r=n.sub(i),o=t.getWorldDirection(f);return r.angleTo(o)>Math.PI/2}(k.current,W),n=!1;ee&&(Array.isArray(_)?n=_.map(e=>e.current):"blending"!==_&&(n=[H]));let i=ei.current;n?ei.current=function(e,t,n,i){let r=c.setFromMatrixPosition(e.matrixWorld),o=r.clone();o.project(t),p.set(o.x,o.y),n.setFromCamera(p,t);let a=n.intersectObjects(i,!0);if(a.length){let e=a[0].distance;return r.distanceTo(n.ray.origin)<e}return!0}
1(k.current,W,N,n)&&!t:ei.current=!t,i!==ei.current&&(M?M(!ei.current):$.style.display=ei.current?"block":"none");let r=Math.floor(U[0]/2),o=_?ee?[U[0],r]:[r-1,0]:U;if($.style.zIndex=`${function(e,t,n){if(t instanceof l.ubm||t instanceof l.qUd){let i=c.setFromMatrixPosition(e.matrixWorld),r=u.setFromMatrixPosition(t.matrixWorld),o=i.distanceTo(r),a=(n[1]-n[0])/(t.far-t.near),s=n[1]-a*t.far;return Math.round(a*o+s)}}(k.current,W,o)}`,E){let[e,t]=[j.width/2,j.height/2],n=W.projectionMatrix.elements[5]*t,{isOrthographicCamera:i,top:r,left:o,bottom:a,right:s}=W,l=y(W.matrixWorldInverse),d=i?`scale(${n})translate(${h(-(s+o)/2)}px,${h((r+a)/2)}px)`:`translateZ(${n}px)`,c=k.current.matrixWorld;b&&((c=W.matrixWorldInverse.clone().transpose().copyPosition(c).scale(k.current.scale)).elements[3]=c.elements[7]=c.elements[11]=0,c.elements[15]=1),$.style.width=j.width+"px",$.style.height=j.height+"px",$.style.perspective=i?"":`${n}px`,Y.current&&J.current&&(Y.current.style.transform=`${d}${l}translate(${e}px,${t}px)`,J.current.style.transform=g(c,1/((S||10)/400)))}else{let t=void 0===S?1:function(e,t){if(t instanceof l.qUd)return t.zoom;if(!(t instanceof l.ubm))return 1;{let n=c.setFromMatrixPosition(e.matrixWorld),i=u.setFromMatrixPosition(t.matrixWorld);return 1/(2*Math.tan(t.fov*Math.PI/180/2)*n.distanceTo(i))}}(k.current,W)*S;$.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}Q.current=e,V.current=W.zoom}}if(!ee&&Z.current&&!K.current)if(E){if(Y.current){let e=Y.current.children[0];if(null!=e&&e.clientWidth&&null!=e&&e.clientHeight){let{isOrthographicCamera:t}=W;if(t||z)T.scale&&(Array.isArray(T.scale)?T.scale instanceof l.Pq0?Z.current.scale.copy(T.scale.clone().divideScalar(1)):Z.current.scale.set(1/T.scale[0],1/T.scale[1],1/T.scale[2]):Z.current.scale.setScalar(1/T.scale));else{let t=(S||10)/400,n=e.clientWidth*t,i=e.clientHeight*t;Z.current.scale.set(n,i,1)}K.current=!0}}}else{let t=$.children[0];if(null!=t&&t.clientWidth&&null!=t&&t.clientHeight){let e=1/F.factor,n=t.clientWidth*e,i=t.clientHeight*e;Z.current.scale.set(n,i,1),K.current=!0}Z.current.lookAt(e.camera.position)}});let er=a.useMemo(()=>({vertexShader:E?void 0:` 2 /* 3 This shader is from the THREE's SpriteMaterial. 4 We need to turn the backing plane into a Sprite 5 (make it always face the camera) if "transfrom" 6 is false. 7 */ 8 #include <common> 9 10 void main() { 11 vec2 center = vec2(0., 1.); 12 float rotation = 0.0; 13 14 // This is somewhat arbitrary, but it seems to work well 15 // Need to figure out how to derive this dynamically if it even matters 16 float size = 0.03; 17 18 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 19 vec2 scale; 20 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 21 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 22 23 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 24 if ( isPerspective ) scale *= - mvPosition.z; 25 26 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; 27 vec2 rotatedPosition; 28 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 29 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 30 mvPosition.xy += rotatedPosition; 31 32 gl_Position = projectionMatrix * mvPosition; 33 } 34 `,fragmentShader:` 35 void main() { 36 gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); 37 } 38 `}),[E]);return a.createElement("group",(0,o.A)({},T,{ref:k}),_&&!ee&&a.createElement("mesh",{castShadow:A,receiveShadow:L,ref:Z},z||a.createElement("planeGeometry",null),P||a.createElement("shaderMaterial",{side:l.$EB,vertexShader:er.vertexShader,fragmentShader:er.fragmentShader})))})},51288:(e,t,n)=>{let i,r;n.d(t,{N:()=>D});var o=n(88945),a=n(12115),s=n(85339),l=n(83388);let d=new s.NRn,c=new s.Pq0;class u extends s.CmU{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new s.qtW([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new s.qtW([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new s.LuO(t,6,1);return this.setAttribute("instanceStart",new s.eHs(n,3,0)),this.setAttribute("instanceEnd",new s.eHs(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));let i=new s.LuO(n,2*t,1);return this.setAttribute("instanceColorStart",new s.eHs(i,t,0)),this.setAttribute("instanceColorEnd",new s.eHs(i,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new s.XJ7(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}
38computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new s.NRn);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),d.setFromBufferAttribute(t),this.boundingBox.union(d))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new s.iyt),null===this.boundingBox&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,o=e.count;r<o;r++)c.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(c)),c.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(c));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}var f=n(87548),p=n(14814);class m extends s.BKk{constructor(e){super({type:"LineMaterial",uniforms:s.LlO.clone(s.LlO.merge([f.UniformsLib.common,f.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new s.I9Y(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:` 39 #include <common> 40 #include <fog_pars_vertex> 41 #include <logdepthbuf_pars_vertex> 42 #include <clipping_planes_pars_vertex> 43 44 uniform float linewidth; 45 uniform vec2 resolution; 46 47 attribute vec3 instanceStart; 48 attribute vec3 instanceEnd; 49 50 #ifdef USE_COLOR 51 #ifdef USE_LINE_COLOR_ALPHA 52 varying vec4 vLineColor; 53 attribute vec4 instanceColorStart; 54 attribute vec4 instanceColorEnd; 55 #else 56 varying vec3 vLineColor; 57 attribute vec3 instanceColorStart; 58 attribute vec3 instanceColorEnd; 59 #endif 60 #endif 61 62 #ifdef WORLD_UNITS 63 64 varying vec4 worldPos; 65 varying vec3 worldStart; 66 varying vec3 worldEnd; 67 68 #ifdef USE_DASH 69 70 varying vec2 vUv; 71 72 #endif 73 74 #else 75 76 varying vec2 vUv; 77 78 #endif 79 80 #ifdef USE_DASH 81 82 uniform float dashScale; 83 attribute float instanceDistanceStart; 84 attribute float instanceDistanceEnd; 85 varying float vLineDistance; 86 87 #endif 88 89 void trimSegment( const in vec4 start, inout vec4 end ) { 90 91 // trim end segment so it terminates between the camera plane and the near plane 92 93 // conservative estimate of the near plane 94 float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column 95 float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column 96 float nearEstimate = - 0.5 * b / a; 97 98 float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); 99 100 end.xyz = mix( start.xyz, end.xyz, alpha ); 101 102 } 103 104 void main() { 105 106 #ifdef USE_COLOR 107 108 vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; 109 110 #endif 111 112 #ifdef USE_DASH 113 114 vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; 115 vUv = uv; 116 117 #endif 118 119 float aspect = resolution.x / resolution.y; 120 121 // camera space 122 vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); 123 vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); 124 125 #ifdef WORLD_UNITS 126 127 worldStart = start.xyz; 128 worldEnd = end.xyz; 129 130 #else 131 132 vUv = uv; 133 134 #endif 135 136 // special case for perspective projection, and segments that terminate either in, or behind, the camera plane 137 // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space 138 // but we need to perform ndc-space calculations in the shader, so we must address this issue directly 139 // perhaps there is a more elegant solution -- WestLangley 140 141 bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column 142 143 if ( perspective ) { 144 145 if ( start.z < 0.0 && end.z >= 0.0 ) { 146 147 trimSegment( start, end ); 148 149 } else if ( end.z < 0.0 && start.z >= 0.0 ) { 150 151 trimSegment( end, start ); 152 153 } 154 155 } 156 157 // clip space 158 vec4 clipStart = projectionMatrix * start; 159 vec4 clipEnd = projectionMatrix * end; 160 161 // ndc space 162 vec3 ndcStart = clipStart.xyz / clipStart.w; 163 vec3 ndcEnd = clipEnd.xyz / clipEnd.w; 164 165 // direction 166 vec2 dir = ndcEnd.xy - ndcStart.xy; 167 168 // account for clip-space aspect ratio 169 dir.x *= aspect; 170 dir = normalize( dir ); 171 172 #ifdef WORLD_UNITS 173 174 // get the offset direction as perpendicular to the view vector
175 vec3 worldDir = normalize( end.xyz - start.xyz ); 176 vec3 offset; 177 if ( position.y < 0.5 ) { 178 179 offset = normalize( cross( start.xyz, worldDir ) ); 180 181 } else { 182 183 offset = normalize( cross( end.xyz, worldDir ) ); 184 185 } 186 187 // sign flip 188 if ( position.x < 0.0 ) offset *= - 1.0; 189 190 float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) ); 191 192 // don't extend the line if we're rendering dashes because we 193 // won't be rendering the endcaps 194 #ifndef USE_DASH 195 196 // extend the line bounds to encompass endcaps 197 start.xyz += - worldDir * linewidth * 0.5; 198 end.xyz += worldDir * linewidth * 0.5; 199 200 // shift the position of the quad so it hugs the forward edge of the line 201 offset.xy -= dir * forwardOffset; 202 offset.z += 0.5; 203 204 #endif 205 206 // endcaps 207 if ( position.y > 1.0 || position.y < 0.0 ) { 208 209 offset.xy += dir * 2.0 * forwardOffset; 210 211 } 212 213 // adjust for linewidth 214 offset *= linewidth * 0.5; 215 216 // set the world position 217 worldPos = ( position.y < 0.5 ) ? start : end; 218 worldPos.xyz += offset; 219 220 // project the worldpos 221 vec4 clip = projectionMatrix * worldPos; 222 223 // shift the depth of the projected points so the line 224 // segments overlap neatly 225 vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd; 226 clip.z = clipPose.z * clip.w; 227 228 #else 229 230 vec2 offset = vec2( dir.y, - dir.x ); 231 // undo aspect ratio adjustment 232 dir.x /= aspect; 233 offset.x /= aspect; 234 235 // sign flip 236 if ( position.x < 0.0 ) offset *= - 1.0; 237 238 // endcaps 239 if ( position.y < 0.0 ) { 240 241 offset += - dir; 242 243 } else if ( position.y > 1.0 ) { 244 245 offset += dir; 246 247 } 248 249 // adjust for linewidth 250 offset *= linewidth; 251 252 // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... 253 offset /= resolution.y; 254 255 // select end 256 vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; 257 258 // back to clip space 259 offset *= clip.w; 260 261 clip.xy += offset; 262 263 #endif 264 265 gl_Position = clip; 266 267 vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation 268 269 #include <logdepthbuf_vertex> 270 #include <clipping_planes_vertex> 271 #include <fog_vertex> 272 273 } 274 `,fragmentShader:` 275 uniform vec3 diffuse; 276 uniform float opacity; 277 uniform float linewidth; 278 279 #ifdef USE_DASH 280 281 uniform float dashOffset; 282 uniform float dashSize; 283 uniform float gapSize; 284 285 #endif 286 287 varying float vLineDistance; 288 289 #ifdef WORLD_UNITS 290 291 varying vec4 worldPos; 292 varying vec3 worldStart; 293 varying vec3 worldEnd; 294 295 #ifdef USE_DASH 296 297 varying vec2 vUv; 298 299 #endif 300 301 #else 302 303 varying vec2 vUv; 304 305 #endif 306 307 #include <common> 308 #include <fog_pars_fragment> 309 #include <logdepthbuf_pars_fragment> 310 #include <clipping_planes_pars_fragment> 311 312 #ifdef USE_COLOR 313 #ifdef USE_LINE_COLOR_ALPHA 314 varying vec4 vLineColor; 315 #else 316 varying vec3 vLineColor; 317 #endif 318 #endif 319 320 vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) { 321 322 float mua; 323 float mub; 324 325 vec3 p13 = p1 - p3; 326 vec3 p43 = p4 - p3; 327 328 vec3 p21 = p2 - p1; 329 330 float d1343 = dot( p13, p43 ); 331 float d4321 = dot( p43, p21 );
332 float d1321 = dot( p13, p21 ); 333 float d4343 = dot( p43, p43 ); 334 float d2121 = dot( p21, p21 ); 335 336 float denom = d2121 * d4343 - d4321 * d4321; 337 338 float numer = d1343 * d4321 - d1321 * d4343; 339 340 mua = numer / denom; 341 mua = clamp( mua, 0.0, 1.0 ); 342 mub = ( d1343 + d4321 * ( mua ) ) / d4343; 343 mub = clamp( mub, 0.0, 1.0 ); 344 345 return vec2( mua, mub ); 346 347 } 348 349 void main() { 350 351 #include <clipping_planes_fragment> 352 353 #ifdef USE_DASH 354 355 if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps 356 357 if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX 358 359 #endif 360 361 float alpha = opacity; 362 363 #ifdef WORLD_UNITS 364 365 // Find the closest points on the view ray and the line segment 366 vec3 rayEnd = normalize( worldPos.xyz ) * 1e5; 367 vec3 lineDir = worldEnd - worldStart; 368 vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd ); 369 370 vec3 p1 = worldStart + lineDir * params.x; 371 vec3 p2 = rayEnd * params.y; 372 vec3 delta = p1 - p2; 373 float len = length( delta ); 374 float norm = len / linewidth; 375 376 #ifndef USE_DASH 377 378 #ifdef USE_ALPHA_TO_COVERAGE 379 380 float dnorm = fwidth( norm ); 381 alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm ); 382 383 #else 384 385 if ( norm > 0.5 ) { 386 387 discard; 388 389 } 390 391 #endif 392 393 #endif 394 395 #else 396 397 #ifdef USE_ALPHA_TO_COVERAGE 398 399 // artifacts appear on some hardware if a derivative is taken within a conditional 400 float a = vUv.x; 401 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 402 float len2 = a * a + b * b; 403 float dlen = fwidth( len2 ); 404 405 if ( abs( vUv.y ) > 1.0 ) { 406 407 alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 ); 408 409 } 410 411 #else 412 413 if ( abs( vUv.y ) > 1.0 ) { 414 415 float a = vUv.x; 416 float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; 417 float len2 = a * a + b * b; 418 419 if ( len2 > 1.0 ) discard; 420 421 } 422 423 #endif 424 425 #endif 426 427 vec4 diffuseColor = vec4( diffuse, alpha ); 428 #ifdef USE_COLOR 429 #ifdef USE_LINE_COLOR_ALPHA 430 diffuseColor *= vLineColor; 431 #else 432 diffuseColor.rgb *= vLineColor; 433 #endif 434 #endif 435 436 #include <logdepthbuf_fragment> 437 438 gl_FragColor = diffuseColor; 439 440 #include <tonemapping_fragment> 441 #include <${p.r>=154?"colorspace_fragment":"encodings_fragment"}> 442 #include <fog_fragment> 443 #include <premultiplied_alpha_fragment> 444 445 } 446 `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(e){!!e!="USE_DASH"in this.defines&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}
446,alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){!!e!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}let h=p.r>=125?"uv1":"uv2",v=new s.IUQ,y=new s.Pq0,g=new s.Pq0,x=new s.IUQ,w=new s.IUQ,S=new s.IUQ,b=new s.Pq0,E=new s.kn4,_=new s.cZY,M=new s.Pq0,A=new s.NRn,L=new s.iyt,P=new s.IUQ;function z(e,t,n){return P.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),P.multiplyScalar(1/P.w),P.x=r/n.width,P.y=r/n.height,P.applyMatrix4(e.projectionMatrixInverse),P.multiplyScalar(1/P.w),Math.abs(Math.max(P.x,P.y))}class U extends s.eaF{constructor(e=new u,t=new m({color:0xffffff*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let e=0,r=0,o=t.count;e<o;e++,r+=2)y.fromBufferAttribute(t,e),g.fromBufferAttribute(n,e),i[r]=0===r?0:i[r-1],i[r+1]=i[r]+y.distanceTo(g);let r=new s.LuO(i,2,1);return e.setAttribute("instanceDistanceStart",new s.eHs(r,1,0)),e.setAttribute("instanceDistanceEnd",new s.eHs(r,1,1)),this}raycast(e,t){let n,o,a=this.material.worldUnits,l=e.camera;null!==l||a||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let d=void 0!==e.params.Line2&&e.params.Line2.threshold||0;i=e.ray;let c=this.matrixWorld,u=this.geometry,f=this.material;if(r=f.linewidth+d,null===u.boundingSphere&&u.computeBoundingSphere(),L.copy(u.boundingSphere).applyMatrix4(c),a)n=.5*r;else{let e=Math.max(l.near,L.distanceToPoint(i.origin));n=z(l,e,f.resolution)}
446if(L.radius+=n,!1!==i.intersectsSphere(L)){if(null===u.boundingBox&&u.computeBoundingBox(),A.copy(u.boundingBox).applyMatrix4(c),a)o=.5*r;else{let e=Math.max(l.near,A.distanceToPoint(i.origin));o=z(l,e,f.resolution)}A.expandByScalar(o),!1!==i.intersectsBox(A)&&(a?function(e,t){let n=e.matrixWorld,o=e.geometry,a=o.attributes.instanceStart,l=o.attributes.instanceEnd,d=Math.min(o.instanceCount,a.count);for(let o=0;o<d;o++){_.start.fromBufferAttribute(a,o),_.end.fromBufferAttribute(l,o),_.applyMatrix4(n);let d=new s.Pq0,c=new s.Pq0;i.distanceSqToSegment(_.start,_.end,c,d),c.distanceTo(d)<.5*r&&t.push({point:c,pointOnLine:d,distance:i.origin.distanceTo(c),object:e,face:null,faceIndex:o,uv:null,[h]:null})}}(this,t):function(e,t,n){let o=t.projectionMatrix,a=e.material.resolution,l=e.matrixWorld,d=e.geometry,c=d.attributes.instanceStart,u=d.attributes.instanceEnd,f=Math.min(d.instanceCount,c.count),p=-t.near;i.at(1,S),S.w=1,S.applyMatrix4(t.matrixWorldInverse),S.applyMatrix4(o),S.multiplyScalar(1/S.w),S.x*=a.x/2,S.y*=a.y/2,S.z=0,b.copy(S),E.multiplyMatrices(t.matrixWorldInverse,l);for(let t=0;t<f;t++){if(x.fromBufferAttribute(c,t),w.fromBufferAttribute(u,t),x.w=1,w.w=1,x.applyMatrix4(E),w.applyMatrix4(E),x.z>p&&w.z>p)continue;if(x.z>p){let e=x.z-w.z,t=(x.z-p)/e;x.lerp(w,t)}else if(w.z>p){let e=w.z-x.z,t=(w.z-p)/e;w.lerp(x,t)}x.applyMatrix4(o),w.applyMatrix4(o),x.multiplyScalar(1/x.w),w.multiplyScalar(1/w.w),x.x*=a.x/2,x.y*=a.y/2,w.x*=a.x/2,w.y*=a.y/2,_.start.copy(x),_.start.z=0,_.end.copy(w),_.end.z=0;let d=_.closestPointToPointParameter(b,!0);_.at(d,M);let f=s.cj9.lerp(x.z,w.z,d),m=f>=-1&&f<=1,v=b.distanceTo(M)<.5*r;if(m&&v){_.start.fromBufferAttribute(c,t),_.end.fromBufferAttribute(u,t),_.start.applyMatrix4(l),_.end.applyMatrix4(l);let r=new s.Pq0,o=new s.Pq0;i.distanceSqToSegment(_.start,_.end,o,r),n.push({point:o,pointOnLine:r,distance:i.origin.distanceTo(o),object:e,face:null,faceIndex:t,uv:null,[h]:null})}}}(this,l,t))}}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(v),this.material.uniforms.resolution.value.set(v.z,v.w))}}class C extends u{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setPositions(n),this}setColors(e,t=3){let n=e.length-t,i=new Float32Array(2*n);if(3===t)for(let r=0;r<n;r+=t)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5];else for(let r=0;r<n;r+=t)i[2*r]=e[r],i[2*r+1]=e[r+1],i[2*r+2]=e[r+2],i[2*r+3]=e[r+3],i[2*r+4]=e[r+4],i[2*r+5]=e[r+5],i[2*r+6]=e[r+6],i[2*r+7]=e[r+7];return super.setColors(i,t),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class O extends U{constructor(e=new C,t=new m({color:0xffffff*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}let D=a.forwardRef(function({points:e,color:t=0xffffff,vertexColors:n,linewidth:i,lineWidth:r,segments:d,dashed:c,...f},p){var h,v;let y=(0,l.C)(e=>e.size),g=a.useMemo(()=>d?new U:new O,[d]),[x]=a.useState(()=>new m),w=(null==n||null==(h=n[0])?void 0:h.length)===4?4:3,S=a.useMemo(()=>{let i=d?new u:new C,r=e.map(e=>{let t=Array.isArray(e);return e instanceof s.Pq0||e instanceof s.IUQ?[e.x,e.y,e.z]:e instanceof s.I9Y?[e.x,e.y,0]:t&&3===e.length?[e[0],e[1],e[2]]:t&&2===e.length?[e[0],e[1],0]:e});if(i.setPositions(r.flat()),n){t=0xffffff;let e=n.map(e=>e instanceof s.Q1f?e.toArray():e);i.setColors(e.flat(),w)}return i},[e,d,n,w]);return a.useLayoutEffect(()=>{g.computeLineDistances()},[e,g]),a.useLayoutEffect(()=>{c?x.defines.USE_DASH="":delete x.defines.USE_DASH,x.needsUpdate=!0},[c,x]),a.useEffect(()=>()=>{S.dispose(),x.dispose()},[S]),a.createElement("primitive",(0,o.A)({object:g,ref:p},f),a.createElement("primitive",{object:S,attach:"geometry"}),a.createElement("primitive",(0,o.A)({object:x,attach:"material",color:t,vertexColors:!!n,resolution:[y.width,y.height],linewidth:null!=(v=null!=i?i:r)?v:1,dashed:c,transparent:4===w},f)))})}}]);
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.