@arcgis/core 6.0.0-next.31 → 6.0.0-next.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{242a77066ac5cdb5b7d7.js → 14d81280807a3d3c1b7e.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{f21edbfdcab111d8a6cd.js → 1a8d8274df292d65f82e.js} +1 -1
  4. package/assets/esri/core/workers/chunks/29cc6b1705418b1be5d7.js +1 -0
  5. package/assets/esri/core/workers/chunks/2de077c7b971f2c215a6.js +1 -0
  6. package/assets/esri/core/workers/chunks/{4741fac6b6b4202a97c5.js → 360c944c610efa2051fc.js} +3 -3
  7. package/assets/esri/core/workers/chunks/{ffaaa388773e60869df0.js → 46453ebfee17b5421d9d.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{84940d8e14caf5a27e04.js → 487c46d5245cfb35c4bb.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{f7fb6cb7f08c16384443.js → 4d18b48d4a282a0f341c.js} +1 -1
  10. package/assets/esri/core/workers/chunks/52a0aa2d19a495e48ab1.js +1 -0
  11. package/assets/esri/core/workers/chunks/{8a485130781b49dbf608.js → 601e1d020b8115497944.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{d09d8cd43e846d467827.js → 6bb191b19ce43a27f205.js} +1 -1
  13. package/assets/esri/core/workers/chunks/6f6d1873753a9c6994aa.js +1 -0
  14. package/assets/esri/core/workers/chunks/7084dd6e10c6c1393e92.js +1 -0
  15. package/assets/esri/core/workers/chunks/853563c66ecf58d53d36.js +1 -0
  16. package/config.js +1 -1
  17. package/geometry/support/GlobalCoordinateSystem.js +2 -0
  18. package/geometry/support/LocalCoordinateSystem.js +2 -0
  19. package/geometry/support/boundedPlane.js +1 -1
  20. package/geometry/support/coordinateSystem.js +1 -1
  21. package/geometry/support/ray.js +1 -1
  22. package/geometry/support/sphere.js +1 -1
  23. package/kernel.js +1 -1
  24. package/package.json +2 -2
  25. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  26. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  27. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  28. package/views/3d/analysis/Slice/SliceController.js +1 -1
  29. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  30. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  31. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  32. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  33. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  34. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  35. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  36. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  37. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  38. package/views/3d/state/ScreenSizePerspective.js +1 -1
  39. package/views/3d/support/RenderCoordsHelper.js +1 -1
  40. package/views/3d/support/ViewSlice.js +1 -1
  41. package/views/3d/support/hitTest.js +1 -1
  42. package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
  43. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  44. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  45. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  46. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  47. package/assets/esri/core/workers/chunks/00d1c99779bd91b1d10e.js +0 -1
  48. package/assets/esri/core/workers/chunks/8d13f11d0bcc8d3a4bdf.js +0 -1
  49. package/assets/esri/core/workers/chunks/90ba0af9690dc32b2958.js +0 -1
  50. package/assets/esri/core/workers/chunks/ceb2d5b0a23f0ab81f68.js +0 -1
  51. package/assets/esri/core/workers/chunks/e04fb83ab2634bc15cc7.js +0 -1
  52. package/assets/esri/core/workers/chunks/e30fdde253e5521473a2.js +0 -1
  53. package/chunks/boundedPlane.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{lerp as n}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{transpose as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as l,scale as u,round as d,copy as f,set as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as m,create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as g,transformMat4 as _,scale as v}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as ee}from"../../../../geometry/ellipsoidUtils.js";import{create as x,empty as te,copy as S,offset as C,width as w,height as ne,expand as T}from"../../../../geometry/support/aaBoundingRect.js";import{h as E,c as re,a as ie}from"../../../../chunks/boundedPlane.js";import{create as D}from"../../../../geometry/support/ray.js";import{Sphere as O,sphereCSO as k}from"../../../../geometry/support/sphere.js";import{InternalRenderCategory as A}from"../../webgl.js";import{DeconflictAABR as j}from"./DeconflictAABR.js";import{prepare as M,drawPoly as N}from"./deconflictorDebug.js";import{isSymbolLayerWithTransparencyMode as P}from"./transparencyUtils.js";import F from"../../webgl/RenderCamera.js";import{getVec3AttributeView as I,getScalarAttributeView as L}from"../../webgl-engine/lib/attributeViewUtils.js";import{GPUPointOcclusionQuery as R}from"../../webgl-engine/lib/GPUPointOcclusionQuery.js";import{SeparateScreenSizePerspectiveEvaluators as z}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as B}from"../../webgl-engine/materials/HUDMaterial.js";import{Yield as V}from"../../../support/Yield.js";const H=h(),U=h(),W=h(),G=h(),K=y(),q=y(),J=h(),Y=s(),ae=new O,X=D(),oe=h(),Z=x();class se{constructor(e){this.id=e,this.aabr=x(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.culled=!1,this.visible=!1,this.priority=0}}function ce(e,t){let n=e.distanceToOccluder!==0&&e.distance>e.distanceToOccluder,r=t.distanceToOccluder!==0&&t.distance>t.distanceToOccluder;return n===r?e.priority===t.priority?e.distance===t.distance?e.visible===t.visible?e.id-t.id:+t.visible-e.visible:e.distance-t.distance:t.priority-e.priority:+n-r}class le{constructor(e,t){this.graphics3DGraphic=e,this.slicePlaneEnabled=t,this._info=null,this._labelInfo=null}ensureInfo(e){let t=this.getInfo(e);return t||(t=new se(this.graphics3DGraphic.graphic.uid),this._setInfo(e,t)),t}getInfo(e){return e===16?this._labelInfo:this._info}removeInfo(e){this._setInfo(e,null)}_setInfo(e,t){e===16?this._labelInfo=t:this._info=t}}class Q{constructor(){this.camera=new F,this.slicePlane=re(),this.slicePlaneEnabled=!1}copyFrom(e){this.camera.equals(e.camera)||this.camera.copyFrom(e.camera),ie(e.slicePlane,this.slicePlane),this.slicePlaneEnabled=e.slicePlaneEnabled}}let $=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(e){super(e),this._dirty=!1,this._viewState=new Q,this._state=0,this._checkOcclusion=new Map,this._active=new Map,this._checkOcclusionIterator=null,this._activeIterator=null,this._occlusionQueryUids=[],this._updatingHandles=new b,this._deconflictor=new j((e,t)=>{e.visible=t,this._setGraphicVisibility(this._active.get(e.id),t)},(e,t)=>e.id!==t.id,ce),this._baseOccludedVisibility=10,this._altitudeFactor=2,this._minAltitudeDifference=100}initialize(){this._updatingHandles.add(()=>(this.view?.map?.ground?.opacity??0)>0,()=>this.setDirty()),this._updatingHandles.add(()=>this.view.ready,()=>{this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this.setDirty()})}destroy(){this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this._updatingHandles.destroy(),this._deconflictor.destroy(),this._checkOcclusion.clear(),this._active.clear()}setDirty(){!this._dirty&&(this._active.size>0||this._checkOcclusion.size>0)&&(this._dirty=!0,this.notifyChange(`_readyToRun`))}setPriority(e,t){let n=this._active.get(e.graphic.uid)?.getInfo(this.visibilityGroup);n&&(n.priority=t)}get _readyToRun(){return this._state!==0||this._dirty}get updating(){return this._readyToRun||this._updatingHandles.updating}get updatingProgress(){if(!this.updating)return 1;let e=this._state/5;return this._dirty?e*.5:e}get readyToRun(){return this.view.ready&&this.view.state!=null&&this._readyToRun}get usedMemory(){return this._occlusionQuery?.usedMemory??0+(this._occlusionQueryUids?.length??0)*4}runTask(e){switch(this._state){case 0:this._startUpdate(),e.madeProgress();case 1:if(this._state=1,!this._processCheckOcclusion(e))return;case 2:if(this._state=2,!(this._occlusionQuery?.done??!0)||!(this._opaqueOcclusionQuery?.done??!0))return V;this._readOcclusionQueryResult(),e.madeProgress();case 3:if(this._state=3,!this._collectActiveGraphics(e))return;case 4:if(this._state=4,this._deconflictor.run(e),!this._deconflictor.done)return;default:this._state=0,this.notifyChange(`_readyToRun`)}}setGraphicsActive(e,t){t?e.forEach(e=>this.addToActiveGraphics(e)):e.forEach(e=>this.removeFromActiveGraphics(e))}isSupportedLayer(e){if(e==null||e.type!==`buffer`||!e.hiddenIfDeconflicted)return!1;let t=e.stageObject;return(t?.geometries.length??0)===1&&t?.geometries[0]?.material instanceof B}_startUpdate(){M(this.view),this._dirty=!1,this._viewState.copyFrom(this.viewState);let{fullWidth:e,fullHeight:t}=this._viewState.camera;this._deconflictor.reset(e,t),this._resetIterators(),this._occlusionQueryUids.length=0,this._checkOcclusion.size||(this._occlusionQuery=r(this._occlusionQuery),this._opaqueOcclusionQuery=r(this._opaqueOcclusionQuery))}addToActiveGraphics(e){e.ensureInfo(this.visibilityGroup),this._active.set(e.graphics3DGraphic.graphic.uid,e),this.setDirty()}removeFromActiveGraphics(e){this._active.get(e.graphics3DGraphic.graphic.uid)===e&&(ue(e,this.visibilityGroup),e.removeInfo(this.visibilityGroup),this._active.delete(e.graphics3DGraphic.graphic.uid),this.setDirty())}addToCheckOcclusion(e){this._checkOcclusion.set(e.graphics3DGraphic.graphic.uid,e),this.setDirty()}removeFromCheckOcclusion(e){this._checkOcclusion.get(e.graphics3DGraphic.graphic.uid)===e&&this._checkOcclusion.delete(e.graphics3DGraphic.graphic.uid)}_processCheckOcclusion(e){if(this._checkOcclusion.size===0)return!0;let t=this._ensureCheckOcclusionIterator(),n=this._viewState.camera,i=o(Y,n.viewInverseTransposeMatrix),a=this.view.map.ground.opacity>0,s=this.view.viewingMode===`global`&&a&&n.relativeElevation>0?ae:null,c=0;s!=null&&(l(s.center,m,n.viewMatrix),s.radius=ee(this.view.spatialReference).radius,c=k.distanceToSilhouette(s,m));let u=x();for(;;){if(e.done)return!1;e.madeProgress();let r=t.next();if(r.done===!0)break;let a=r.value,o=a.graphics3DGraphic;if(o.destroyed||!o.isVisible(1,8))continue;let d=me(o,this.visibilityGroup),f=null,p=!0,m=!1;for(let e of d){if(!this.isSupportedLayer(e))continue;f=he,this._projectHudLayer(e,n,f),te(u);let t=e.stageObject.geometries[0].material;if(this._expandBoundingRect(u,n,e,t,f),f.isOutsideScreen||this._isCulledBySlice(a,f.positionWorld)||s!=null&&pe(f,s,c)){p=!1;break}f.altitude=this.view.renderCoordsHelper.getAltitude(f.positionWorld);let r=a.ensureInfo(this.visibilityGroup);if(r.altitude=f.altitude,r.distance=f.distance,r.distanceToOccluder=f.distanceToOccluder,r.culled=!1,S(r.aabr,u),!e.occlusionCheck)break;l(U,f.positionView,i);let d=this._ensureOcclusionQuery(),h=this._ensureOpaqueOcclusionQuery();this._occlusionQueryUids.length===0&&(this._initOcclusionQuery(d),this._initOcclusionQuery(h));let g=d.addPosition(U),_=h.addPosition(U);if(g===this._occlusionQueryUids.length&&_===g){let t=e.adaptiveOcclusion;this._occlusionQueryUids.push(t?-o.graphic.uid:o.graphic.uid),m=!0}break}let h=this._active.has(o.graphic.uid);if(!h&&!m)this._setGraphicVisibility(a,p);else if(h&&(!p||!f)){let e=a.ensureInfo(this.visibilityGroup);e.visible=!f,e.culled=!0}}return this._checkOcclusionIterator=null,this._occlusionQueryUids.length||(this._occlusionQuery=r(this._occlusionQuery),this._opaqueOcclusionQuery=r(this._opaqueOcclusionQuery)),this._occlusionQuery?.start(),this._opaqueOcclusionQuery?.start(),!0}_readOcclusionQueryResult(){if(!this._occlusionQuery||!this._occlusionQueryUids.length)return;let e=this._viewState.camera,t=this.view.renderCoordsHelper.getAltitude(e.eye);for(let e=0;e<this._occlusionQueryUids.length;e++){let n=this._occlusionQueryUids[e],r=Math.abs(n),i=n<0,a=this._checkOcclusion.get(r);if(!a)continue;let o=this._occlusionQuery.getOcclusion(e)??-1,s=this._opaqueOcclusionQuery?.getOcclusion(e)??-1,c=a.getInfo(this.visibilityGroup);c&&(c.distanceToOccluder=o>0?c.distance-o:0);let l=s===0||s>0&&this._occludedVisibility(c?c.distance-s:0,c?.distance??s,c?.altitude??0,t,i),u=o===0||o>0&&this._occludedVisibility(c?.distanceToOccluder??0,c?.distance??o,c?.altitude??0,t,i),d=l||u;d&&this._setTransparentMode(a,l&&!u),this._active.has(r)?c&&(c.culled=!d,c.visible=d):this._setGraphicVisibility(a,d)}this._occlusionQueryUids.length=0}_collectActiveGraphics(e){let t=this._ensureActiveGraphicsIterator(),n=this.visibilityGroup===16;for(;!e.done;){e.madeProgress();let r=t.next();if(r.done===!0)return this._activeIterator=null,!0;let i=r.value,a=i.getInfo(this.visibilityGroup);if(!a)continue;let o=!n||i.graphics3DGraphic.isVisible();!o||a.culled?(N(a.aabr,!1,!0),this._setGraphicVisibility(i,o&&a.visible)):this._deconflictor.add(a)}return!1}_occludedVisibility(e,t,n,r,i=!0){let a=Math.max(this._minAltitudeDifference,Math.abs(n-r))-this._minAltitudeDifference,o=i?this._baseOccludedVisibility+this._altitudeFactor*a:0;return e===0||t-e<=o}_resetIterators(){this._checkOcclusionIterator=null,this._activeIterator=null}_ensureCheckOcclusionIterator(){return this._checkOcclusionIterator??=this._checkOcclusion.values(),this._checkOcclusionIterator}_ensureActiveGraphicsIterator(){return this._activeIterator??=this._active.values(),this._activeIterator}_initOcclusionQuery(e){if(!e)return;let{camera:t}=this._viewState,n=Math.max(2,2+Math.round(Math.log2(Math.abs(t.relativeElevation))));u(H,this._viewState.camera.eye,2**-n),u(H,d(H,H),2**n),e.init(this._checkOcclusion.size,H)}_ensureOcclusionQuery(){return this._occlusionQuery??=new R({view:this.view}),this._occlusionQuery}_ensureOpaqueOcclusionQuery(){return this._opaqueOcclusionQuery??=new R({view:this.view,category:A.OPAQUE_OCCLUSION_QUERY}),this._opaqueOcclusionQuery}_getNumVisible(e){return this._checkOcclusion.values().reduce((t,n)=>t+ +!!n.getInfo(e)?.visible,0)}_projectHudLayer(e,t,n){let r=e.stageObject,i=r.geometries[0],a=i.material;f(U,r.boundingVolumeWorldSpace.sphere.center),l(H,U,t.viewMatrix);let o=I(i,`normal`).getVec(0,W),s=I(i,`centerOffset`)?.getVec(0,G)??m,c=L(i,`groundDistance`).get(0);a.applyShaderOffsets(U,H,o,r.transformation,s,c,t,n.screenSizePerspectiveEvaluators),g(K,H[0],H[1],H[2],1),_(q,K,t.projectionMatrix),u(n.positionNDC,q,1/q[3]),a.applyShaderOffsetsNDC(n.positionNDC,s,c,t,n.positionNDC,J),n.distanceWithoutPolygonOffset=t.depthNDCToWorld(J[2]),n.distance=J[2]===n.positionNDC[2]?n.distanceWithoutPolygonOffset:t.depthNDCToWorld(n.positionNDC[2]),g(q,n.positionNDC[0],n.positionNDC[1],n.positionNDC[2],1),_(K,q,t.inverseProjectionMatrix),v(K,K,1/K[3]),p(n.positionView,K[0],K[1],K[2]),f(n.positionWorld,U)}_isCulledBySlice(e,t){return e.slicePlaneEnabled&&this._viewState.slicePlaneEnabled&&E(this._viewState.slicePlane,t)}_expandBoundingRect(e,t,r,i,{positionNDC:a,screenSizePerspectiveEvaluators:o}){let s=r.getScreenSize(de);o.evaluator.applyVec2(s,s),s[0]*=t.pixelRatio,s[1]*=t.pixelRatio;let c=C(i.calculateRelativeScreenBounds(s,o.alignmentEvaluator.apply(t.pixelRatio),Z),n(0,t.fullWidth,.5+.5*a[0]),n(0,t.fullHeight,.5+.5*a[1])),l=this.marginFactor;if(l!==0){let e=l*Math.min(w(c),ne(c));c[0]-=e,c[1]-=e,c[2]+=e,c[3]+=e}T(e,c,e)}_setGraphicVisibility(e,t){let n=e?.graphics3DGraphic;n&&!n.destroyed&&(n.setVisibilityFlag(this.visibilityGroup,8,t),this.visibilityGroup===16&&this.view.labeler.setLabelGraphicVisibility(n,t))}_setTransparentMode(e,t){let n=e?.graphics3DGraphic;if(n&&!n.destroyed)for(let e of n.layers){if(e?.type!==`object3d`&&e?.type!==`buffer`)continue;let{graphics3DSymbolLayer:n}=e;P(n)&&n.updateTransparentMode(e,t)}}};e([i({constructOnly:!0})],$.prototype,`view`,void 0),e([i({type:Boolean,readOnly:!0})],$.prototype,`_readyToRun`,null),e([i({type:Boolean,readOnly:!0})],$.prototype,`updating`,null),e([i({readOnly:!0})],$.prototype,`_updatingHandles`,void 0),$=e([a(`esri.views.3d.layers.graphics.Deconflictor`)],$);function ue(e,t){let n=e.graphics3DGraphic;n.destroyed||n.setVisibilityFlag(t,8,!0)}const de=c();class fe{constructor(){this.positionWorld=h(),this.positionView=h(),this.positionNDC=h(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.distanceWithoutPolygonOffset=0,this.screenSizePerspectiveEvaluators=new z}get isOutsideScreen(){let e=this.positionNDC;return e[0]<-1||e[1]<-1||e[2]<-1||e[0]>=1||e[1]>=1||e[2]>=1}}function pe(e,t,n){return f(X.direction,e.positionView),p(X.origin,0,0,0),t.intersectRay(X,oe)?e.distanceWithoutPolygonOffset>n:!1}function me(e,t){return t===16?e.labelLayers:e.layers}const he=new fe;export{$ as Deconflictor,le as DeconflictorGraphic,Q as DeconflictorViewState};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{lerp as n}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{transpose as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{transformMat4 as l,scale as u,round as d,copy as f,set as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as m,create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as g,transformMat4 as _,scale as v}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as b}from"../../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as x}from"../../../../geometry/ellipsoidUtils.js";import{create as S,empty as ee,copy as C,offset as w,width as T,height as te,expand as ne}from"../../../../geometry/support/aaBoundingRect.js";import{extrusionContainsPoint as re,create as ie,copy as E}from"../../../../geometry/support/boundedPlane.js";import{create as D}from"../../../../geometry/support/ray.js";import{Sphere as O}from"../../../../geometry/support/sphere.js";import{InternalRenderCategory as k}from"../../webgl.js";import{DeconflictAABR as A}from"./DeconflictAABR.js";import{prepare as j,drawPoly as M}from"./deconflictorDebug.js";import{isSymbolLayerWithTransparencyMode as N}from"./transparencyUtils.js";import P from"../../webgl/RenderCamera.js";import{getVec3AttributeView as F,getScalarAttributeView as I}from"../../webgl-engine/lib/attributeViewUtils.js";import{GPUPointOcclusionQuery as L}from"../../webgl-engine/lib/GPUPointOcclusionQuery.js";import{SeparateScreenSizePerspectiveEvaluators as R}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{HUDMaterial as z}from"../../webgl-engine/materials/HUDMaterial.js";import{Yield as B}from"../../../support/Yield.js";const V=h(),H=h(),U=h(),W=h(),G=y(),K=y(),q=h(),J=s(),Y=new O,X=D(),ae=h(),oe=S();class se{constructor(e){this.id=e,this.aabr=S(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.culled=!1,this.visible=!1,this.priority=0}}function ce(e,t){let n=e.distanceToOccluder!==0&&e.distance>e.distanceToOccluder,r=t.distanceToOccluder!==0&&t.distance>t.distanceToOccluder;return n===r?e.priority===t.priority?e.distance===t.distance?e.visible===t.visible?e.id-t.id:+t.visible-e.visible:e.distance-t.distance:t.priority-e.priority:+n-r}class Z{constructor(e,t){this.graphics3DGraphic=e,this.slicePlaneEnabled=t,this._info=null,this._labelInfo=null}ensureInfo(e){let t=this.getInfo(e);return t||(t=new se(this.graphics3DGraphic.graphic.uid),this._setInfo(e,t)),t}getInfo(e){return e===16?this._labelInfo:this._info}removeInfo(e){this._setInfo(e,null)}_setInfo(e,t){e===16?this._labelInfo=t:this._info=t}}class Q{constructor(){this.camera=new P,this.slicePlane=ie(),this.slicePlaneEnabled=!1}copyFrom(e){this.camera.equals(e.camera)||this.camera.copyFrom(e.camera),E(e.slicePlane,this.slicePlane),this.slicePlaneEnabled=e.slicePlaneEnabled}}let $=class extends t{get dirty(){return this._dirty}get state(){return this._state}constructor(e){super(e),this._dirty=!1,this._viewState=new Q,this._state=0,this._checkOcclusion=new Map,this._active=new Map,this._checkOcclusionIterator=null,this._activeIterator=null,this._occlusionQueryUids=[],this._updatingHandles=new b,this._deconflictor=new A((e,t)=>{e.visible=t,this._setGraphicVisibility(this._active.get(e.id),t)},(e,t)=>e.id!==t.id,ce),this._baseOccludedVisibility=10,this._altitudeFactor=2,this._minAltitudeDifference=100}initialize(){this._updatingHandles.add(()=>(this.view?.map?.ground?.opacity??0)>0,()=>this.setDirty()),this._updatingHandles.add(()=>this.view.ready,()=>{this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this.setDirty()})}destroy(){this._occlusionQuery=null,this._opaqueOcclusionQuery=null,this._updatingHandles.destroy(),this._deconflictor.destroy(),this._checkOcclusion.clear(),this._active.clear()}setDirty(){!this._dirty&&(this._active.size>0||this._checkOcclusion.size>0)&&(this._dirty=!0,this.notifyChange(`_readyToRun`))}setPriority(e,t){let n=this._active.get(e.graphic.uid)?.getInfo(this.visibilityGroup);n&&(n.priority=t)}get _readyToRun(){return this._state!==0||this._dirty}get updating(){return this._readyToRun||this._updatingHandles.updating}get updatingProgress(){if(!this.updating)return 1;let e=this._state/5;return this._dirty?e*.5:e}get readyToRun(){return this.view.ready&&this.view.state!=null&&this._readyToRun}get usedMemory(){return this._occlusionQuery?.usedMemory??0+(this._occlusionQueryUids?.length??0)*4}runTask(e){switch(this._state){case 0:this._startUpdate(),e.madeProgress();case 1:if(this._state=1,!this._processCheckOcclusion(e))return;case 2:if(this._state=2,!(this._occlusionQuery?.done??!0)||!(this._opaqueOcclusionQuery?.done??!0))return B;this._readOcclusionQueryResult(),e.madeProgress();case 3:if(this._state=3,!this._collectActiveGraphics(e))return;case 4:if(this._state=4,this._deconflictor.run(e),!this._deconflictor.done)return;default:this._state=0,this.notifyChange(`_readyToRun`)}}setGraphicsActive(e,t){t?e.forEach(e=>this.addToActiveGraphics(e)):e.forEach(e=>this.removeFromActiveGraphics(e))}isSupportedLayer(e){if(e==null||e.type!==`buffer`||!e.hiddenIfDeconflicted)return!1;let t=e.stageObject;return(t?.geometries.length??0)===1&&t?.geometries[0]?.material instanceof z}_startUpdate(){j(this.view),this._dirty=!1,this._viewState.copyFrom(this.viewState);let{fullWidth:e,fullHeight:t}=this._viewState.camera;this._deconflictor.reset(e,t),this._resetIterators(),this._occlusionQueryUids.length=0,this._checkOcclusion.size||(this._occlusionQuery=r(this._occlusionQuery),this._opaqueOcclusionQuery=r(this._opaqueOcclusionQuery))}addToActiveGraphics(e){e.ensureInfo(this.visibilityGroup),this._active.set(e.graphics3DGraphic.graphic.uid,e),this.setDirty()}removeFromActiveGraphics(e){this._active.get(e.graphics3DGraphic.graphic.uid)===e&&(le(e,this.visibilityGroup),e.removeInfo(this.visibilityGroup),this._active.delete(e.graphics3DGraphic.graphic.uid),this.setDirty())}addToCheckOcclusion(e){this._checkOcclusion.set(e.graphics3DGraphic.graphic.uid,e),this.setDirty()}removeFromCheckOcclusion(e){this._checkOcclusion.get(e.graphics3DGraphic.graphic.uid)===e&&this._checkOcclusion.delete(e.graphics3DGraphic.graphic.uid)}_processCheckOcclusion(e){if(this._checkOcclusion.size===0)return!0;let t=this._ensureCheckOcclusionIterator(),n=this._viewState.camera,i=o(J,n.viewInverseTransposeMatrix),a=this.view.map.ground.opacity>0,s=this.view.viewingMode===`global`&&a&&n.relativeElevation>0?Y:null,c=0;s!=null&&(l(s.center,m,n.viewMatrix),s.radius=x(this.view.spatialReference).radius,c=s.distanceToSilhouette(m));let u=S();for(;;){if(e.done)return!1;e.madeProgress();let r=t.next();if(r.done===!0)break;let a=r.value,o=a.graphics3DGraphic;if(o.destroyed||!o.isVisible(1,8))continue;let d=pe(o,this.visibilityGroup),f=null,p=!0,m=!1;for(let e of d){if(!this.isSupportedLayer(e))continue;f=me,this._projectHudLayer(e,n,f),ee(u);let t=e.stageObject.geometries[0].material;if(this._expandBoundingRect(u,n,e,t,f),f.isOutsideScreen||this._isCulledBySlice(a,f.positionWorld)||s!=null&&fe(f,s,c)){p=!1;break}f.altitude=this.view.renderCoordsHelper.getAltitude(f.positionWorld);let r=a.ensureInfo(this.visibilityGroup);if(r.altitude=f.altitude,r.distance=f.distance,r.distanceToOccluder=f.distanceToOccluder,r.culled=!1,C(r.aabr,u),!e.occlusionCheck)break;l(H,f.positionView,i);let d=this._ensureOcclusionQuery(),h=this._ensureOpaqueOcclusionQuery();this._occlusionQueryUids.length===0&&(this._initOcclusionQuery(d),this._initOcclusionQuery(h));let g=d.addPosition(H),_=h.addPosition(H);if(g===this._occlusionQueryUids.length&&_===g){let t=e.adaptiveOcclusion;this._occlusionQueryUids.push(t?-o.graphic.uid:o.graphic.uid),m=!0}break}let h=this._active.has(o.graphic.uid);if(!h&&!m)this._setGraphicVisibility(a,p);else if(h&&(!p||!f)){let e=a.ensureInfo(this.visibilityGroup);e.visible=!f,e.culled=!0}}return this._checkOcclusionIterator=null,this._occlusionQueryUids.length||(this._occlusionQuery=r(this._occlusionQuery),this._opaqueOcclusionQuery=r(this._opaqueOcclusionQuery)),this._occlusionQuery?.start(),this._opaqueOcclusionQuery?.start(),!0}_readOcclusionQueryResult(){if(!this._occlusionQuery||!this._occlusionQueryUids.length)return;let e=this._viewState.camera,t=this.view.renderCoordsHelper.getAltitude(e.eye);for(let e=0;e<this._occlusionQueryUids.length;e++){let n=this._occlusionQueryUids[e],r=Math.abs(n),i=n<0,a=this._checkOcclusion.get(r);if(!a)continue;let o=this._occlusionQuery.getOcclusion(e)??-1,s=this._opaqueOcclusionQuery?.getOcclusion(e)??-1,c=a.getInfo(this.visibilityGroup);c&&(c.distanceToOccluder=o>0?c.distance-o:0);let l=s===0||s>0&&this._occludedVisibility(c?c.distance-s:0,c?.distance??s,c?.altitude??0,t,i),u=o===0||o>0&&this._occludedVisibility(c?.distanceToOccluder??0,c?.distance??o,c?.altitude??0,t,i),d=l||u;d&&this._setTransparentMode(a,l&&!u),this._active.has(r)?c&&(c.culled=!d,c.visible=d):this._setGraphicVisibility(a,d)}this._occlusionQueryUids.length=0}_collectActiveGraphics(e){let t=this._ensureActiveGraphicsIterator(),n=this.visibilityGroup===16;for(;!e.done;){e.madeProgress();let r=t.next();if(r.done===!0)return this._activeIterator=null,!0;let i=r.value,a=i.getInfo(this.visibilityGroup);if(!a)continue;let o=!n||i.graphics3DGraphic.isVisible();!o||a.culled?(M(a.aabr,!1,!0),this._setGraphicVisibility(i,o&&a.visible)):this._deconflictor.add(a)}return!1}_occludedVisibility(e,t,n,r,i=!0){let a=Math.max(this._minAltitudeDifference,Math.abs(n-r))-this._minAltitudeDifference,o=i?this._baseOccludedVisibility+this._altitudeFactor*a:0;return e===0||t-e<=o}_resetIterators(){this._checkOcclusionIterator=null,this._activeIterator=null}_ensureCheckOcclusionIterator(){return this._checkOcclusionIterator??=this._checkOcclusion.values(),this._checkOcclusionIterator}_ensureActiveGraphicsIterator(){return this._activeIterator??=this._active.values(),this._activeIterator}_initOcclusionQuery(e){if(!e)return;let{camera:t}=this._viewState,n=Math.max(2,2+Math.round(Math.log2(Math.abs(t.relativeElevation))));u(V,this._viewState.camera.eye,2**-n),u(V,d(V,V),2**n),e.init(this._checkOcclusion.size,V)}_ensureOcclusionQuery(){return this._occlusionQuery??=new L({view:this.view}),this._occlusionQuery}_ensureOpaqueOcclusionQuery(){return this._opaqueOcclusionQuery??=new L({view:this.view,category:k.OPAQUE_OCCLUSION_QUERY}),this._opaqueOcclusionQuery}_getNumVisible(e){return this._checkOcclusion.values().reduce((t,n)=>t+ +!!n.getInfo(e)?.visible,0)}_projectHudLayer(e,t,n){let r=e.stageObject,i=r.geometries[0],a=i.material;f(H,r.boundingVolumeWorldSpace.sphere.center),l(V,H,t.viewMatrix);let o=F(i,`normal`).getVec(0,U),s=F(i,`centerOffset`)?.getVec(0,W)??m,c=I(i,`groundDistance`).get(0);a.applyShaderOffsets(H,V,o,r.transformation,s,c,t,n.screenSizePerspectiveEvaluators),g(G,V[0],V[1],V[2],1),_(K,G,t.projectionMatrix),u(n.positionNDC,K,1/K[3]),a.applyShaderOffsetsNDC(n.positionNDC,s,c,t,n.positionNDC,q),n.distanceWithoutPolygonOffset=t.depthNDCToWorld(q[2]),n.distance=q[2]===n.positionNDC[2]?n.distanceWithoutPolygonOffset:t.depthNDCToWorld(n.positionNDC[2]),g(K,n.positionNDC[0],n.positionNDC[1],n.positionNDC[2],1),_(G,K,t.inverseProjectionMatrix),v(G,G,1/G[3]),p(n.positionView,G[0],G[1],G[2]),f(n.positionWorld,H)}_isCulledBySlice(e,t){return e.slicePlaneEnabled&&this._viewState.slicePlaneEnabled&&re(this._viewState.slicePlane,t)}_expandBoundingRect(e,t,r,i,{positionNDC:a,screenSizePerspectiveEvaluators:o}){let s=r.getScreenSize(ue);o.evaluator.applyVec2(s,s),s[0]*=t.pixelRatio,s[1]*=t.pixelRatio;let c=w(i.calculateRelativeScreenBounds(s,o.alignmentEvaluator.apply(t.pixelRatio),oe),n(0,t.fullWidth,.5+.5*a[0]),n(0,t.fullHeight,.5+.5*a[1])),l=this.marginFactor;if(l!==0){let e=l*Math.min(T(c),te(c));c[0]-=e,c[1]-=e,c[2]+=e,c[3]+=e}ne(e,c,e)}_setGraphicVisibility(e,t){let n=e?.graphics3DGraphic;n&&!n.destroyed&&(n.setVisibilityFlag(this.visibilityGroup,8,t),this.visibilityGroup===16&&this.view.labeler.setLabelGraphicVisibility(n,t))}_setTransparentMode(e,t){let n=e?.graphics3DGraphic;if(n&&!n.destroyed)for(let e of n.layers){if(e?.type!==`object3d`&&e?.type!==`buffer`)continue;let{graphics3DSymbolLayer:n}=e;N(n)&&n.updateTransparentMode(e,t)}}};e([i({constructOnly:!0})],$.prototype,`view`,void 0),e([i({type:Boolean,readOnly:!0})],$.prototype,`_readyToRun`,null),e([i({type:Boolean,readOnly:!0})],$.prototype,`updating`,null),e([i({readOnly:!0})],$.prototype,`_updatingHandles`,void 0),$=e([a(`esri.views.3d.layers.graphics.Deconflictor`)],$);function le(e,t){let n=e.graphics3DGraphic;n.destroyed||n.setVisibilityFlag(t,8,!0)}const ue=c();class de{constructor(){this.positionWorld=h(),this.positionView=h(),this.positionNDC=h(),this.altitude=0,this.distance=0,this.distanceToOccluder=0,this.distanceWithoutPolygonOffset=0,this.screenSizePerspectiveEvaluators=new R}get isOutsideScreen(){let e=this.positionNDC;return e[0]<-1||e[1]<-1||e[2]<-1||e[0]>=1||e[1]>=1||e[2]>=1}}function fe(e,t,n){return f(X.direction,e.positionView),p(X.origin,0,0,0),t.intersectRay(X,ae)?e.distanceWithoutPolygonOffset>n:!1}function pe(e,t){return t===16?e.labelLayers:e.layers}const me=new de;export{$ as Deconflictor,Z as DeconflictorGraphic,Q as DeconflictorViewState};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{destroyMaybe as t,removeMaybe as n}from"../../../../core/maybe.js";import{initial as r,watch as i,sync as a}from"../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{a as s}from"../../../../chunks/boundedPlane.js";import{Deconflictor as c,DeconflictorGraphic as l}from"./Deconflictor.js";import{LabelDeconflictor as u}from"./LabelDeconflictor.js";import{TaskPriority as d}from"../../../support/Scheduler.js";let f=class extends c{constructor(){super(...arguments),this._contexts=new Map,this.visibilityGroup=1,this._marginFactor=-.1,this.test={overrideMarginFactor:e=>{this._marginFactor=e,this.setDirty()},getNumVisibleLabels:()=>this._getNumVisible(16),getNumVisibleGraphics:()=>this._getNumVisible(1)}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this._updatingHandles.add(()=>this.view?.state?.camera,()=>{this._updateViewState(),this.setDirty()}),this._updatingHandles.add(()=>this.view?.slice?.plane,()=>{this._updateSlicePlane(),this._slicePlaneChanged(),this.setDirty()},r),this.addHandles(i(()=>this.view.groundView?.updating||this.view.graphicsView?.updating||this.view.allLayerViews.some(e=>e.updating),(e,t)=>{!e&&t&&this.setDirty()},a)),this._frameTask=this.view.resourceController.scheduler.registerTask(d.GRAPHICS_DECONFLICTOR,this),this._labels=new u({view:this.view,parent:this})}destroy(){this._labels=t(this._labels),this._frameTask=n(this._frameTask)}get marginFactor(){return this._marginFactor}get usedMemory(){return super.usedMemory+this._labels.usedMemory}setDirty(){this._contexts.size>0&&(super.setDirty(),this._labels.setDirty())}runTask(e){let t=super.runTask(e);return this.readyToRun||this._labels.setDirty(),t}_updateViewState(){this.view?.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){let e=this.view?.slice?.plane;e!=null&&s(e,this._viewState.slicePlane),this._viewState.slicePlaneEnabled=e!=null}_slicePlaneChanged(){for(let e of this._contexts.keys())if(e.symbolCreationContext.slicePlaneEnabled){this.setDirty();return}}addGraphicsOwner(e){let t=this._getGraphicsContext(e);return{addGraphic:n=>this._addGraphic(e,t,n),removeGraphic:e=>this._removeGraphic(t,e),labelingInfoChange:()=>this._labelsEnabledChanged(e,t),featureReductionChange:()=>this._enabledChanged(e,t),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(e,t),screenSizePerspectiveEnabledChanged:()=>this._screenSizePerspectiveEnabledChange(),clear:()=>t.forEach(e=>this._removeGraphic(t,e.graphics3DGraphic)),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty(),getState:e=>this._getDeconflictorState(e),setState:(e,t)=>this._setDeconflictorState(e,t)}}_getDeconflictorState(e){let t=e.getVisibilityFlag(1,8),n=e.getVisibilityFlag(16,8);return!!t|(n?16:0)}_setDeconflictorState(e,t){let n=!!(t&1),r=!!(t&16);e.setVisibilityFlag(1,8,n),e.setVisibilityFlag(16,8,r),this.setDirty()}_removeGraphicsOwner(e){let t=this._contexts.get(e);t&&(t.forEach(e=>this._removeGraphic(t,e.graphics3DGraphic)),this._contexts.delete(e),this.setDirty())}_addGraphic(e,t,n){let r=n.graphic.uid,i=new l(n,e.symbolCreationContext.slicePlaneEnabled);t.set(r,i),this.addToCheckOcclusion(i),p(e)&&this.addToActiveGraphics(i),e.labelsEnabled&&(this._labels.addToCheckOcclusion(i),this._labels.addToActiveGraphics(i));let a=this._initialVisibility(e,n);n.setVisibilityFlag(1,8,a)}_removeGraphic(e,t){let n=t.graphic.uid,r=e.get(n);r&&(this.removeFromActiveGraphics(r),this.removeFromCheckOcclusion(r),this._labels.removeFromActiveGraphics(r),this._labels.removeFromCheckOcclusion(r),e.delete(n),this.setDirty())}_enabledChanged(e,t){p(e)?t.forEach(e=>this.addToActiveGraphics(e)):t.forEach(e=>this.removeFromActiveGraphics(e)),this.setDirty()}_labelsEnabledChanged(e,t){e.labelsEnabled?(t.forEach(e=>this._labels.addToCheckOcclusion(e)),t.forEach(e=>this._labels.addToActiveGraphics(e))):(t.forEach(e=>this._labels.removeFromCheckOcclusion(e)),t.forEach(e=>this._labels.removeFromActiveGraphics(e)))}_slicePlaneEnabledChanged(e,t){let n=e.symbolCreationContext.slicePlaneEnabled;t.forEach(e=>e.slicePlaneEnabled=n),this.setDirty()}_screenSizePerspectiveEnabledChange(){this.setDirty()}_initialVisibility(e,t){if(t.isDraped)return!1;let n=t.layers;if(!n?.length)return!1;let r=!1,i=!1;for(let e of n)this.isSupportedLayer(e)&&(r=!0,i||=e.occlusionCheck);return!i&&(!r||!p(e))}_getGraphicsContext(e){let t=this._contexts.get(e);if(t)return t;let n=new Map;return this._contexts.set(e,n),this.setDirty(),n}};f=e([o(`esri.views.3d.layers.graphics.GraphicsDeconflictor`)],f);function p(e){return e.layer?.featureReduction?.type===`selection`}export{f as GraphicsDeconflictor};
2
+ import{__decorate as e}from"tslib";import{destroyMaybe as t,removeMaybe as n}from"../../../../core/maybe.js";import{initial as r,watch as i,sync as a}from"../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as s}from"../../../../geometry/support/boundedPlane.js";import{Deconflictor as c,DeconflictorGraphic as l}from"./Deconflictor.js";import{LabelDeconflictor as u}from"./LabelDeconflictor.js";import{TaskPriority as d}from"../../../support/Scheduler.js";let f=class extends c{constructor(){super(...arguments),this._contexts=new Map,this.visibilityGroup=1,this._marginFactor=-.1,this.test={overrideMarginFactor:e=>{this._marginFactor=e,this.setDirty()},getNumVisibleLabels:()=>this._getNumVisible(16),getNumVisibleGraphics:()=>this._getNumVisible(1)}}get labels(){return this._labels}get viewState(){return this._viewState}initialize(){this._updatingHandles.add(()=>this.view?.state?.camera,()=>{this._updateViewState(),this.setDirty()}),this._updatingHandles.add(()=>this.view?.slice?.plane,()=>{this._updateSlicePlane(),this._slicePlaneChanged(),this.setDirty()},r),this.addHandles(i(()=>this.view.groundView?.updating||this.view.graphicsView?.updating||this.view.allLayerViews.some(e=>e.updating),(e,t)=>{!e&&t&&this.setDirty()},a)),this._frameTask=this.view.resourceController.scheduler.registerTask(d.GRAPHICS_DECONFLICTOR,this),this._labels=new u({view:this.view,parent:this})}destroy(){this._labels=t(this._labels),this._frameTask=n(this._frameTask)}get marginFactor(){return this._marginFactor}get usedMemory(){return super.usedMemory+this._labels.usedMemory}setDirty(){this._contexts.size>0&&(super.setDirty(),this._labels.setDirty())}runTask(e){let t=super.runTask(e);return this.readyToRun||this._labels.setDirty(),t}_updateViewState(){this.view?.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){let e=this.view?.slice?.plane;e!=null&&s(e,this._viewState.slicePlane),this._viewState.slicePlaneEnabled=e!=null}_slicePlaneChanged(){for(let e of this._contexts.keys())if(e.symbolCreationContext.slicePlaneEnabled){this.setDirty();return}}addGraphicsOwner(e){let t=this._getGraphicsContext(e);return{addGraphic:n=>this._addGraphic(e,t,n),removeGraphic:e=>this._removeGraphic(t,e),labelingInfoChange:()=>this._labelsEnabledChanged(e,t),featureReductionChange:()=>this._enabledChanged(e,t),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(e,t),screenSizePerspectiveEnabledChanged:()=>this._screenSizePerspectiveEnabledChange(),clear:()=>t.forEach(e=>this._removeGraphic(t,e.graphics3DGraphic)),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty(),getState:e=>this._getDeconflictorState(e),setState:(e,t)=>this._setDeconflictorState(e,t)}}_getDeconflictorState(e){let t=e.getVisibilityFlag(1,8),n=e.getVisibilityFlag(16,8);return!!t|(n?16:0)}_setDeconflictorState(e,t){let n=!!(t&1),r=!!(t&16);e.setVisibilityFlag(1,8,n),e.setVisibilityFlag(16,8,r),this.setDirty()}_removeGraphicsOwner(e){let t=this._contexts.get(e);t&&(t.forEach(e=>this._removeGraphic(t,e.graphics3DGraphic)),this._contexts.delete(e),this.setDirty())}_addGraphic(e,t,n){let r=n.graphic.uid,i=new l(n,e.symbolCreationContext.slicePlaneEnabled);t.set(r,i),this.addToCheckOcclusion(i),p(e)&&this.addToActiveGraphics(i),e.labelsEnabled&&(this._labels.addToCheckOcclusion(i),this._labels.addToActiveGraphics(i));let a=this._initialVisibility(e,n);n.setVisibilityFlag(1,8,a)}_removeGraphic(e,t){let n=t.graphic.uid,r=e.get(n);r&&(this.removeFromActiveGraphics(r),this.removeFromCheckOcclusion(r),this._labels.removeFromActiveGraphics(r),this._labels.removeFromCheckOcclusion(r),e.delete(n),this.setDirty())}_enabledChanged(e,t){p(e)?t.forEach(e=>this.addToActiveGraphics(e)):t.forEach(e=>this.removeFromActiveGraphics(e)),this.setDirty()}_labelsEnabledChanged(e,t){e.labelsEnabled?(t.forEach(e=>this._labels.addToCheckOcclusion(e)),t.forEach(e=>this._labels.addToActiveGraphics(e))):(t.forEach(e=>this._labels.removeFromCheckOcclusion(e)),t.forEach(e=>this._labels.removeFromActiveGraphics(e)))}_slicePlaneEnabledChanged(e,t){let n=e.symbolCreationContext.slicePlaneEnabled;t.forEach(e=>e.slicePlaneEnabled=n),this.setDirty()}_screenSizePerspectiveEnabledChange(){this.setDirty()}_initialVisibility(e,t){if(t.isDraped)return!1;let n=t.layers;if(!n?.length)return!1;let r=!1,i=!1;for(let e of n)this.isSupportedLayer(e)&&(r=!0,i||=e.occlusionCheck);return!i&&(!r||!p(e))}_getGraphicsContext(e){let t=this._contexts.get(e);if(t)return t;let n=new Map;return this._contexts.set(e,n),this.setDirty(),n}};f=e([o(`esri.views.3d.layers.graphics.GraphicsDeconflictor`)],f);function p(e){return e.layer?.featureReduction?.type===`selection`}export{f as GraphicsDeconflictor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{deg2rad as n,lerp as r,clamp as i}from"../../../core/mathUtils.js";import{watch as a,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{j as l}from"../../../chunks/boundedPlane.js";import{Sphere as u}from"../../../geometry/support/sphere.js";import{ScreenSizePerspectiveParameters as d}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";let f=class extends t{get parameters(){return this._parameters}get labelParameters(){return this._labelParameters}get _calculations(){return this.view.state.isGlobal?new m(this.view.renderCoordsHelper?.referenceEllipsoid.radius??0):new p}constructor(e){super(e),this._parameters=new d,this._labelParameters=new d}initialize(){this.addHandles([a(()=>({distance:this.view.pointsOfInterest?.centerOnSurfaceInfrequent?.distance??0,fovY:this.view.state.camera.fovY}),e=>this._update(e),o)])}_update(e){let t=this._updateParameters(this._parameters,g,e),n=this._updateParameters(this._labelParameters,_,e);return t||n}_updateParameters(e,t,n){if(e&&e.camera.fovY===n.fovY&&e.camera.distance===n.distance)return!1;let{scaleStart:r,scaleFallOffRange:i}=t,{fovY:a,distance:o}=n;this._calculations.calculateCurvatureDependentParameters(v,t,n);let s=this._calculations.surfaceCoverageCompensation(n,v),{tiltAngle:c,scaleFallOffFactor:l}=v,u=Math.sin(c)*o,d=.5*Math.PI-c-a*(.5-r*s),f=u/Math.cos(d),p=d+a*i*s,m=(f-u/Math.cos(p)*l)/(1-l);return e.camera.fovY=n.fovY,e.camera.distance=n.distance,e.offset=m,e.divisor=f-m,e.minPixelSize=t.minPixelSize,!0}};e([s({constructOnly:!0})],f.prototype,`view`,void 0),e([s()],f.prototype,`_calculations`,null),f=e([c(`esri.views.3d.state.ScreenSizePerspective`)],f);class p{surfaceCoverageCompensation(e,t){return l(t.tiltAngle,e.fovY)}calculateCurvatureDependentParameters(e,t){e.tiltAngle=t.curvatureDependent.min.tiltAngle,e.scaleFallOffFactor=t.curvatureDependent.min.scaleFallOffFactor}}class m{constructor(e){this._ellipsoidRadius=e}surfaceCoverageCompensation(e,t){return y.radius=this._ellipsoidRadius,y.frustumCoverage(t.tiltAngle,e.distance,e.fovY)}calculateCurvatureDependentParameters(e,t,n){let a=t.curvatureDependent,o=1+n.distance/this._ellipsoidRadius,s=Math.sqrt(o*o-1),[c,l]=[a.min.curvature,a.max.curvature],u=i((s-c)/(l-c),0,1),[d,f]=[a.min,a.max];e.tiltAngle=r(d.tiltAngle,f.tiltAngle,u),e.scaleFallOffFactor=r(d.scaleFallOffFactor,f.scaleFallOffFactor,u)}}class h{constructor(){this.tiltAngle=0,this.scaleFallOffFactor=0}}const g={curvatureDependent:{min:{curvature:n(10),tiltAngle:n(12),scaleFallOffFactor:.5},max:{curvature:n(70),tiltAngle:n(40),scaleFallOffFactor:.8}},scaleStart:.3,scaleFallOffRange:.65,minPixelSize:0},_={...g,curvatureDependent:{min:{...g.curvatureDependent.min,scaleFallOffFactor:.7},max:{...g.curvatureDependent.max,scaleFallOffFactor:.95}},minPixelSize:14},v=new h,y=new u;export{f as ScreenSizePerspective};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{deg2rad as n,lerp as r,clamp as i}from"../../../core/mathUtils.js";import{watch as a,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{cameraFrustumCoverage as l}from"../../../geometry/support/boundedPlane.js";import{Sphere as u}from"../../../geometry/support/sphere.js";import{ScreenSizePerspectiveParameters as d}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";let f=class extends t{get parameters(){return this._parameters}get labelParameters(){return this._labelParameters}get _calculations(){return this.view.state.isGlobal?new m(this.view.renderCoordsHelper?.referenceEllipsoid.radius??0):new p}constructor(e){super(e),this._parameters=new d,this._labelParameters=new d}initialize(){this.addHandles([a(()=>({distance:this.view.pointsOfInterest?.centerOnSurfaceInfrequent?.distance??0,fovY:this.view.state.camera.fovY}),e=>this._update(e),o)])}_update(e){let t=this._updateParameters(this._parameters,g,e),n=this._updateParameters(this._labelParameters,_,e);return t||n}_updateParameters(e,t,n){if(e&&e.camera.fovY===n.fovY&&e.camera.distance===n.distance)return!1;let{scaleStart:r,scaleFallOffRange:i}=t,{fovY:a,distance:o}=n;this._calculations.calculateCurvatureDependentParameters(v,t,n);let s=this._calculations.surfaceCoverageCompensation(n,v),{tiltAngle:c,scaleFallOffFactor:l}=v,u=Math.sin(c)*o,d=.5*Math.PI-c-a*(.5-r*s),f=u/Math.cos(d),p=d+a*i*s,m=(f-u/Math.cos(p)*l)/(1-l);return e.camera.fovY=n.fovY,e.camera.distance=n.distance,e.offset=m,e.divisor=f-m,e.minPixelSize=t.minPixelSize,!0}};e([s({constructOnly:!0})],f.prototype,`view`,void 0),e([s()],f.prototype,`_calculations`,null),f=e([c(`esri.views.3d.state.ScreenSizePerspective`)],f);class p{surfaceCoverageCompensation(e,t){return l(t.tiltAngle,e.fovY)}calculateCurvatureDependentParameters(e,t){e.tiltAngle=t.curvatureDependent.min.tiltAngle,e.scaleFallOffFactor=t.curvatureDependent.min.scaleFallOffFactor}}class m{constructor(e){this._ellipsoidRadius=e}surfaceCoverageCompensation(e,t){return y.radius=this._ellipsoidRadius,y.frustumCoverage(t.tiltAngle,e.distance,e.fovY)}calculateCurvatureDependentParameters(e,t,n){let a=t.curvatureDependent,o=1+n.distance/this._ellipsoidRadius,s=Math.sqrt(o*o-1),[c,l]=[a.min.curvature,a.max.curvature],u=i((s-c)/(l-c),0,1),[d,f]=[a.min,a.max];e.tiltAngle=r(d.tiltAngle,f.tiltAngle,u),e.scaleFallOffFactor=r(d.scaleFallOffFactor,f.scaleFallOffFactor,u)}}class h{constructor(){this.tiltAngle=0,this.scaleFallOffFactor=0}}const g={curvatureDependent:{min:{curvature:n(10),tiltAngle:n(12),scaleFallOffFactor:.5},max:{curvature:n(70),tiltAngle:n(40),scaleFallOffFactor:.8}},scaleStart:.3,scaleFallOffRange:.65,minPixelSize:0},_={...g,curvatureDependent:{min:{...g.curvatureDependent.min,scaleFallOffFactor:.7},max:{...g.curvatureDependent.max,scaleFallOffFactor:.95}},minPixelSize:14},v=new h,y=new u;export{f as ScreenSizePerspective};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{rad2deg as e}from"../../../core/mathUtils.js";import{getMetersPerUnitForSR as t,getMetersPerCartesianUnitForSR as n}from"../../../core/units.js";import{set as r}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{copy as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{getReferenceEllipsoid as a}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as o}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectPointToVector as s}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as c}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as l}from"../../../geometry/projection/projectVectorToVector.js";import{create as u}from"../../../geometry/support/aaBoundingRect.js";import{create as d,setExtent as f,getExtent as p,altitudeAt as m,setAltitudeAt as h,setAltitudeOfTransformation as g,normalAt as _,axisAt as v,elevate as y,intersectRayClosestSilhouette as b,intersectRay as x,createGlobal as S,createLocal as C}from"../../../geometry/support/coordinateSystem.js";import{intersectRay as w}from"../../../geometry/support/plane.js";import{angleAroundAxis as T}from"../../../geometry/support/vector.js";import{sv3d as E}from"../../../geometry/support/vectorStacks.js";import{isDehydratedPoint as D}from"../../../layers/graphics/dehydratedFeatureUtils.js";class O{constructor(e,t,n,r){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=n,this._coordinateSystem=r,this._tmpCoordinateSystem=d(r),this.referenceEllipsoid=a(t),this.sphericalPCPF=o(t)}set extent(e){e&&f(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return p(this._coordinateSystem,u())}getAltitude(e){return m(this._coordinateSystem,e)}setAltitude(e,t,n=e){return h(this._coordinateSystem,n,t,e)}setAltitudeOfTransformation(e,t){g(this._coordinateSystem,t,e,t)}worldUpAtPosition(e,t){return _(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,n){return v(this._coordinateSystem,e,t,n)}basisMatrixAtPosition(e,t){let n=this.worldBasisAtPosition(e,0,E.get()),i=this.worldBasisAtPosition(e,1,E.get()),a=this.worldBasisAtPosition(e,2,E.get());return r(t,n[0],n[1],n[2],0,i[0],i[1],i[2],0,a[0],a[1],a[2],0,0,0,0,1),t}headingAtPosition(t,n){let r=this.worldUpAtPosition(t,E.get()),i=this.worldBasisAtPosition(t,1,E.get()),a=T(n,i,r);return e(a)}intersectManifoldClosestSilhouette(e,t,n){return y(this._coordinateSystem,t,this._tmpCoordinateSystem),b(this._tmpCoordinateSystem,e,n),n}intersectManifold(e,t,n){y(this._coordinateSystem,t,this._tmpCoordinateSystem);let r=E.get();return x(this._tmpCoordinateSystem,e,r)?i(n,r):null}intersectInfiniteManifold(e,t,n){if(this.viewingMode===1)return this.intersectManifold(e,t,n);y(this._coordinateSystem,t,this._tmpCoordinateSystem);let r=this._tmpCoordinateSystem.value,a=E.get();return w(r.plane,e,a)?i(n,a):null}toRenderCoords(e,t,n){return D(e)?s(e,t,this.spatialReference):l(e,t,n,this.spatialReference)}fromRenderCoords(e,t,n=null){return D(t)?(n!=null&&(t.spatialReference=n),c(e,this.spatialReference,t)?t:null):l(e,this.spatialReference,t,n)?t:null}static create(e,n){switch(e){case 2:return new O(2,n,t(n),C());case 1:return new O(1,n,1,S(n))}}static renderUnitScaleFactor(e,t){return n(e)/n(t)}}export{O as RenderCoordsHelper};
2
+ import{rad2deg as e}from"../../../core/mathUtils.js";import{getMetersPerUnitForSR as t,getMetersPerCartesianUnitForSR as n}from"../../../core/units.js";import{set as r}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as i,copy as a}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as s}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as c}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectPointToVector as l}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as u}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as d}from"../../../geometry/projection/projectVectorToVector.js";import{create as f}from"../../../geometry/support/aaBoundingRect.js";import{GlobalCoordinateSystem as p}from"../../../geometry/support/GlobalCoordinateSystem.js";import{LocalCoordinateSystem as m}from"../../../geometry/support/LocalCoordinateSystem.js";import{intersectRay as h}from"../../../geometry/support/plane.js";import{angleAroundAxis as g}from"../../../geometry/support/vector.js";import{sv3d as _}from"../../../geometry/support/vectorStacks.js";import{isDehydratedPoint as v}from"../../../layers/graphics/dehydratedFeatureUtils.js";class y{constructor(e,t,n,r){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=n,this._coordinateSystem=r,this._tmpCoordinateSystem=r.clone(),this.referenceEllipsoid=s(t),this.sphericalPCPF=c(t)}set extent(e){this._coordinateSystem.setExtent(e)}get extent(){return this._coordinateSystem.getExtent(f())}getAltitude(e){return this._coordinateSystem.altitudeAt(e)}setAltitude(e,t,n=e){return this._coordinateSystem.setAltitudeAt(n,t,e),e}setAltitudeOfTransformation(e,t){i(b,t[12],t[13],t[14]),this._coordinateSystem.setAltitudeAt(b,e,b),t[12]=b[0],t[13]=b[1],t[14]=b[2]}worldUpAtPosition(e,t){return this._coordinateSystem.worldBasisAtPosition(e,2,t),t}worldBasisAtPosition(e,t,n){return this._coordinateSystem.worldBasisAtPosition(e,t,n),n}basisMatrixAtPosition(e,t){let n=this.worldBasisAtPosition(e,0,_.get()),i=this.worldBasisAtPosition(e,1,_.get()),a=this.worldBasisAtPosition(e,2,_.get());return r(t,n[0],n[1],n[2],0,i[0],i[1],i[2],0,a[0],a[1],a[2],0,0,0,0,1),t}headingAtPosition(t,n){let r=this.worldUpAtPosition(t,_.get()),i=this.worldBasisAtPosition(t,1,_.get()),a=g(n,i,r);return e(a)}intersectManifoldClosestSilhouette(e,t,n){return this._coordinateSystem.elevate(t,this._tmpCoordinateSystem),this._tmpCoordinateSystem.intersectRayClosestSilhouette(e,n),n}intersectManifold(e,t,n){this._coordinateSystem.elevate(t,this._tmpCoordinateSystem);let r=_.get();return this._tmpCoordinateSystem.intersectRay(e,r)?a(n,r):null}intersectInfiniteManifold(e,t,n){if(this.viewingMode===1)return this.intersectManifold(e,t,n);this._coordinateSystem.elevate(t,this._tmpCoordinateSystem);let r=this._tmpCoordinateSystem.plane,i=_.get();return h(r,e,i)?a(n,i):null}toRenderCoords(e,t,n){return v(e)?l(e,t,this.spatialReference):d(e,t,n,this.spatialReference)}fromRenderCoords(e,t,n=null){return v(t)?(n!=null&&(t.spatialReference=n),u(e,this.spatialReference,t)?t:null):d(e,this.spatialReference,t,n)?t:null}static create(e,n){switch(e){case 2:return new y(2,n,t(n),new m);case 1:return new y(1,n,1,new p(n))}}static renderUnitScaleFactor(e,t){return n(e)/n(t)}}const b=o();export{y as RenderCoordsHelper};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{c as a,a as o}from"../../../chunks/boundedPlane.js";import{PropertiesPool as s}from"../../support/PropertiesPool.js";let c=class extends t{constructor(e){super(e),this._propertiesPool=new s({plane:()=>a()},this),this.isDecoration=!0,this.addHandles(n(this._propertiesPool))}set plane(e){if(!e){this._set(`plane`,e);return}let t=this._propertiesPool.get(`plane`);o(e,t),this._set(`plane`,t)}};e([r()],c.prototype,`plane`,null),e([r()],c.prototype,`isDecoration`,void 0),c=e([i(`esri.views.3d.support.ViewSlice`)],c);export{c as ViewSlice};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{create as a,copy as o}from"../../../geometry/support/boundedPlane.js";import{PropertiesPool as s}from"../../support/PropertiesPool.js";let c=class extends t{constructor(e){super(e),this._propertiesPool=new s({plane:()=>a()},this),this.isDecoration=!0,this.addHandles(n(this._propertiesPool))}set plane(e){if(!e){this._set(`plane`,e);return}let t=this._propertiesPool.get(`plane`);o(e,t),this._set(`plane`,t)}};e([r()],c.prototype,`plane`,null),e([r()],c.prototype,`isDecoration`,void 0),c=e([i(`esri.views.3d.support.ViewSlice`)],c);export{c as ViewSlice};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as t}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as n,isScreenPolygon as r,isScreenRect as i,createScreenPointArray as a,createScreenPoint as o}from"../../../core/screenUtils.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{Sphere as d,sphereCSO as f}from"../../../geometry/support/sphere.js";import{fallbackObjectIDAttribute as p}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as m}from"../../../layers/support/layerUtils.js";import{debugFlags as h}from"./debugFlags.js";import{getElevationAtPoint as g}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as _,resolveOrderedIntersectionHits as v}from"./intersectionHitUtils.js";import{Intersector as y}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as b}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as x,toOwner as S}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as C}from"../webgl-engine/lib/verticalOffsetUtils.js";async function w(e,t,n,o){let s=n?I(e,n):o;if(r(t))return T(e,t,s,n?.excludeLabels);if(i(t))return T(e,O(t),s,n?.excludeLabels);let c=t,l=a(c.x,c.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;let u=new y(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=n?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(l,u,s);let d=await Array.fromAsync(A(e,u.results.all,s.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:t=>j(e,t),stopAtSupportSurface:!0})),f=u.results.ground,p=S(f,e),g=p!=null&&`type`in p&&m(p)&&(!has(`enable-feature:im-as-ground`)||p.isUsedAsGroundLayer)?p:null,_={screenPoint:c,results:d,ground:{mapPoint:j(e,f),distance:b(f)?f.distanceInRenderSpace:0,layer:g}};return h.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(_.intersector=u),_}async function T(e,t,r,i){r.enableDraped=!0;let a=new y(e.state.viewingMode);a.options.selectionMode=!0,a.options.store=2,a.options.excludeLabels=i??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(t.map(e=>n(e)),a,r);let o=[];await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(t){for await(let n of A(e,E(e,a.polygonResults.all),r.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(n),t.madeProgress()&&(t=yield)});let s={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return h.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(s.intersector=a),s}function*E(e,t){let n=D(e);if(n==null)yield*t;else for(let e of t)e.distance!=null&&e.distance<=n&&(yield e)}function D(e){let t=e.basemapTerrain,n=e.state.camera;return e.state.viewingMode!==1||!n.aboveGround||!t?.opaque?null:(G.radius=t.getLowerBoundRadius(),f.distanceToSilhouette(G,n.eye)*K)}function O(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function k(e,t,r,i){let a=r?I(e,r):i,o=!!(a.graphics?.include||a.graphics?.exclude),s=!!(a.mediaElements?.include||a.mediaElements?.exclude),c=n(t);a.enableDraped=a.include&&!a.include.has(C)||a.exclude?.has(C);let l=e.sceneIntersectionHelper,u=new y(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||s?2:0,u.options.excludeLabels=r?.excludeLabels??!1,l.intersectIntersectorScreen(c,u,a),o||s){for(let t of u.results.all){let n=x(t,e);if(n==null||o&&(n.type!==`graphic`||N(a.graphics,n.graphic))||s&&(n.type!==`media`||P(a.mediaElements,n.element)))return j(e,t)}return null}return j(e,u.results.min)}async function*A(e,t,n,r){let i=v(e,r.stopAtSupportSurface?(function*(){for(let n of t){yield n;let t=S(n,e);if(t!=null&&(t===e.map.ground||`type`in t&&m(t)&&(!has(`enable-feature:im-as-ground`)||t.isUsedAsGroundLayer)))break}})():t,{getDedupeKey:e=>e.type===`graphic`?M(e.graphic):null,filterHit:e=>e.type!==`graphic`||N(n,e.graphic)});for await(let{input:e,hit:t}of i){let n=r.getMapPoint(e),i=r.getDistance(e);if(t.type===`media`){let e=n?t.element.toSource(n):null;yield{...t,mapPoint:n,distance:i,sourcePoint:e}}else yield{...t,mapPoint:n,distance:i}}}function j(e,t,n){return t.getIntersectionPoint(W)?(n=F(e,W,n),t.intersector===7&&e.basemapTerrain&&(n.z=g(e.basemapTerrain,n)??0),n):null}function M(e){let t=e.getObjectId()??e.attributes?.[p];return e.origin&&t!=null?`o-${e.origin.id}-${t}`:`u-${_(e)}`}function N(e,t){return P(e,M(t))}function P(e,t){return e==null||(e.include==null||e.include.has(t))&&(e.exclude==null||!e.exclude.has(t))}function F(e,t,n){let r=e.spatialReference||l.WGS84;return u(t,e.renderSpatialReference,W,r)?t=W:(r=l.WGS84,u(t,e.renderSpatialReference,W,r)&&(t=W)),n?(n.x=t[0],n.y=t[1],n.z=t[2],n.spatialReference=r):n=new c(t,r),n}function I(e,t){let n=L(e,t.include,0),r=L(e,t.exclude,1);return{include:n.layerViewUids,exclude:r.layerViewUids,graphics:{include:n.graphicUids,exclude:r.graphicUids},mediaElements:{include:n.mediaElements,exclude:r.mediaElements}}}function L(n,r,i,a=new R){if(!r)return a;if(r instanceof e)H(a,M(r)),i===0&&(n.graphicsView!=null&&r.layer===n?B(a,n.graphicsView.uid):r.layer&&z(a,n,r.layer.uid));else if(`layer`in r&&`element`in r)U(a,r.element),i===0&&z(a,n,r.layer.uid);else if(!t(r))`layer`in r&&V(a,n,r),`uid`in r&&z(a,n,r.uid);else for(let e of r)if(e===n.graphics&&n.graphicsView!=null)B(a,n.graphicsView.uid);else if(e===n.map.ground){B(a,C);for(let e of n.map.ground.allIntegratedMeshGround)z(a,n,e.uid)}else L(n,e,i,a);return a}class R{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function z(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n);r&&B(e,r.uid)}function B(e,t){e.layerViewUids??=new Map,e.layerViewUids.set(t,!0)}function V(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n.layer.uid);if(!r)return;e.layerViewUids??=new Map;let i=e.layerViewUids.get(r.uid);i!==!0&&(i?i.add(n.id):e.layerViewUids.set(r.uid,new Set([n.id])))}function H(e,t){e.graphicUids??=new Set,e.graphicUids.add(t)}function U(e,t){e.mediaElements??=new Set,e.mediaElements.add(t)}const W=s(),G=new d,K=1.2;export{F as computeMapPointFromVec3d,I as externalToInternalIntersectOptions,w as hitTest,j as intersectResultToMapPoint,N as testGraphicUidFilter,k as toMap};
2
+ import e from"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as t}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as n,isScreenPolygon as r,isScreenRect as i,createScreenPointArray as a,createScreenPoint as o}from"../../../core/screenUtils.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"../../../geometry/Point.js";import l from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{Sphere as d}from"../../../geometry/support/sphere.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as p}from"../../../layers/support/layerUtils.js";import{debugFlags as m}from"./debugFlags.js";import{getElevationAtPoint as h}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as g,resolveOrderedIntersectionHits as _}from"./intersectionHitUtils.js";import{Intersector as v}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as y}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as b,toOwner as x}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as S}from"../webgl-engine/lib/verticalOffsetUtils.js";async function C(e,t,n,o){let s=n?F(e,n):o;if(r(t))return w(e,t,s,n?.excludeLabels);if(i(t))return w(e,D(t),s,n?.excludeLabels);let c=t,l=a(c.x,c.y);s.requiresGroundFeedback=!0,s.enableDraped=!0;let u=new v(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=n?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(l,u,s);let d=await Array.fromAsync(k(e,u.results.all,s.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:t=>A(e,t),stopAtSupportSurface:!0})),f=u.results.ground,h=x(f,e),g=h!=null&&`type`in h&&p(h)&&(!has(`enable-feature:im-as-ground`)||h.isUsedAsGroundLayer)?h:null,_={screenPoint:c,results:d,ground:{mapPoint:A(e,f),distance:y(f)?f.distanceInRenderSpace:0,layer:g}};return m.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(_.intersector=u),_}async function w(e,t,r,i){r.enableDraped=!0;let a=new v(e.state.viewingMode);a.options.selectionMode=!0,a.options.store=2,a.options.excludeLabels=i??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(t.map(e=>n(e)),a,r);let o=[];await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(t){for await(let n of k(e,T(e,a.polygonResults.all),r.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(n),t.madeProgress()&&(t=yield)});let s={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return m.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(s.intersector=a),s}function*T(e,t){let n=E(e);if(n==null)yield*t;else for(let e of t)e.distance!=null&&e.distance<=n&&(yield e)}function E(e){let t=e.basemapTerrain,n=e.state.camera;return e.state.viewingMode!==1||!n.aboveGround||!t?.opaque?null:(W.radius=t.getLowerBoundRadius(),W.distanceToSilhouette(n.eye)*G)}function D(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function O(e,t,r,i){let a=r?F(e,r):i,o=!!(a.graphics?.include||a.graphics?.exclude),s=!!(a.mediaElements?.include||a.mediaElements?.exclude),c=n(t);a.enableDraped=a.include&&!a.include.has(S)||a.exclude?.has(S);let l=e.sceneIntersectionHelper,u=new v(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||s?2:0,u.options.excludeLabels=r?.excludeLabels??!1,l.intersectIntersectorScreen(c,u,a),o||s){for(let t of u.results.all){let n=b(t,e);if(n==null||o&&(n.type!==`graphic`||M(a.graphics,n.graphic))||s&&(n.type!==`media`||N(a.mediaElements,n.element)))return A(e,t)}return null}return A(e,u.results.min)}async function*k(e,t,n,r){let i=_(e,r.stopAtSupportSurface?(function*(){for(let n of t){yield n;let t=x(n,e);if(t!=null&&(t===e.map.ground||`type`in t&&p(t)&&(!has(`enable-feature:im-as-ground`)||t.isUsedAsGroundLayer)))break}})():t,{getDedupeKey:e=>e.type===`graphic`?j(e.graphic):null,filterHit:e=>e.type!==`graphic`||M(n,e.graphic)});for await(let{input:e,hit:t}of i){let n=r.getMapPoint(e),i=r.getDistance(e);if(t.type===`media`){let e=n?t.element.toSource(n):null;yield{...t,mapPoint:n,distance:i,sourcePoint:e}}else yield{...t,mapPoint:n,distance:i}}}function A(e,t,n){return t.getIntersectionPoint(U)?(n=P(e,U,n),t.intersector===7&&e.basemapTerrain&&(n.z=h(e.basemapTerrain,n)??0),n):null}function j(e){let t=e.getObjectId()??e.attributes?.[f];return e.origin&&t!=null?`o-${e.origin.id}-${t}`:`u-${g(e)}`}function M(e,t){return N(e,j(t))}function N(e,t){return e==null||(e.include==null||e.include.has(t))&&(e.exclude==null||!e.exclude.has(t))}function P(e,t,n){let r=e.spatialReference||l.WGS84;return u(t,e.renderSpatialReference,U,r)?t=U:(r=l.WGS84,u(t,e.renderSpatialReference,U,r)&&(t=U)),n?(n.x=t[0],n.y=t[1],n.z=t[2],n.spatialReference=r):n=new c(t,r),n}function F(e,t){let n=I(e,t.include,0),r=I(e,t.exclude,1);return{include:n.layerViewUids,exclude:r.layerViewUids,graphics:{include:n.graphicUids,exclude:r.graphicUids},mediaElements:{include:n.mediaElements,exclude:r.mediaElements}}}function I(n,r,i,a=new L){if(!r)return a;if(r instanceof e)V(a,j(r)),i===0&&(n.graphicsView!=null&&r.layer===n?z(a,n.graphicsView.uid):r.layer&&R(a,n,r.layer.uid));else if(`layer`in r&&`element`in r)H(a,r.element),i===0&&R(a,n,r.layer.uid);else if(!t(r))`layer`in r&&B(a,n,r),`uid`in r&&R(a,n,r.uid);else for(let e of r)if(e===n.graphics&&n.graphicsView!=null)z(a,n.graphicsView.uid);else if(e===n.map.ground){z(a,S);for(let e of n.map.ground.allIntegratedMeshGround)R(a,n,e.uid)}else I(n,e,i,a);return a}class L{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function R(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n);r&&z(e,r.uid)}function z(e,t){e.layerViewUids??=new Map,e.layerViewUids.set(t,!0)}function B(e,t,n){let r=t.allLayerViews.find(e=>e.layer.uid===n.layer.uid);if(!r)return;e.layerViewUids??=new Map;let i=e.layerViewUids.get(r.uid);i!==!0&&(i?i.add(n.id):e.layerViewUids.set(r.uid,new Set([n.id])))}function V(e,t){e.graphicUids??=new Set,e.graphicUids.add(t)}function H(e,t){e.mediaElements??=new Set,e.mediaElements.add(t)}const U=s(),W=new d,G=1.2;export{P as computeMapPointFromVec3d,F as externalToInternalIntersectOptions,C as hitTest,A as intersectResultToMapPoint,M as testGraphicUidFilter,O as toMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{c as e,g as t,a as n}from"../../../../chunks/boundedPlane.js";const r=e();class i{constructor(){this._plane=e(),this._isDecoration=!0}get plane(){return this._plane}get isDecoration(){return this._isDecoration}update({plane:e,isDecoration:i}){let a=!1;return this._isDecoration!==i&&(this._isDecoration=i,a=!0),e??=r,t(e,this._plane)?a:(n(e,this._plane),!0)}}export{i as default};
2
+ import{create as e,equals as t,copy as n}from"../../../../geometry/support/boundedPlane.js";const r=e();class i{constructor(){this._plane=e(),this._isDecoration=!0}get plane(){return this._plane}get isDecoration(){return this._isDecoration}update({plane:e,isDecoration:i}){let a=!1;return this._isDecoration!==i&&(this._isDecoration=i,a=!0),e??=r,t(e,this._plane)?a:(n(e,this._plane),!0)}}export{i as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../core/PooledArray.js";import{copy as t,lerp as n,squaredLength as r,dot as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as o,h as s}from"../../../../chunks/boundedPlane.js";import{clipLineSegment as c,create as l,clipPolygon as u,fromValues as d}from"../../../../geometry/support/plane.js";function f(e){return(t,r,i)=>!s(e,n(b,t,r,i))}const p=new e({allocator:e=>e??a()}),m=new e({allocator:e=>e??a()});function*h(e,t){let n=t,r=p,i=m;for(let t of e){if(r.length=0,u(t,n,()=>r.pushNew(),!1),r.length>=3&&(yield r),r.length=0,u(t,n,()=>r.pushNew(),!0),r.length<3)return;n=r,[r,i]=[i,r]}}class g{constructor(e){this._lineRemainingA=y(),this._lineRemainingB=y(),this._lineVisible=y(),this._slicedAwayHalfspaces=_(e),this._slicePlane=o(e)}*processTriangle(e){yield*h(this._slicedAwayHalfspaces,e)}*processLineSegment(e,n,r){let i=this._lineRemainingA,a=this._lineRemainingB;t(i[0],n),t(i[1],r);for(let n of this._slicedAwayHalfspaces){if(c(n,i[0],i[1],this._lineVisible[0],this._lineVisible[1],!1)&&(t(e[0],this._lineVisible[0]),t(e[1],this._lineVisible[1]),yield e),!c(n,i[0],i[1],a[0],a[1],!0))return;[a,i]=[i,a]}}validatePoint(e){return!s(this._slicePlane,e)}}function _(e){let t=[l(e.plane),l(),l(),l(),l()];return v(e.basis1,e.origin,t[1],t[2]),v(e.basis2,e.origin,t[3],t[4]),t}function v(e,t,n,a){let o=r(e),s=i(e,t);d(e[0],e[1],e[2],-s+o,n),d(-e[0],-e[1],-e[2],s+o,a)}function y(){return[a(),a()]}const b=a();export{g as SliceScreenPolygonPrimitiveProcessor,h as clipPolygonAgainstSlicedAwayHalfspaces,_ as createSliceExtrusionHalfspacePlanes,f as sliceFilterPredicate};
2
+ import e from"../../../../core/PooledArray.js";import{copy as t,lerp as n,squaredLength as r,dot as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as o,extrusionContainsPoint as s}from"../../../../geometry/support/boundedPlane.js";import{clipLineSegment as c,create as l,clipPolygon as u,fromValues as d}from"../../../../geometry/support/plane.js";function f(e){return(t,r,i)=>!s(e,n(b,t,r,i))}const p=new e({allocator:e=>e??a()}),m=new e({allocator:e=>e??a()});function*h(e,t){let n=t,r=p,i=m;for(let t of e){if(r.length=0,u(t,n,()=>r.pushNew(),!1),r.length>=3&&(yield r),r.length=0,u(t,n,()=>r.pushNew(),!0),r.length<3)return;n=r,[r,i]=[i,r]}}class g{constructor(e){this._lineRemainingA=y(),this._lineRemainingB=y(),this._lineVisible=y(),this._slicedAwayHalfspaces=_(e),this._slicePlane=o(e)}*processTriangle(e){yield*h(this._slicedAwayHalfspaces,e)}*processLineSegment(e,n,r){let i=this._lineRemainingA,a=this._lineRemainingB;t(i[0],n),t(i[1],r);for(let n of this._slicedAwayHalfspaces){if(c(n,i[0],i[1],this._lineVisible[0],this._lineVisible[1],!1)&&(t(e[0],this._lineVisible[0]),t(e[1],this._lineVisible[1]),yield e),!c(n,i[0],i[1],a[0],a[1],!0))return;[a,i]=[i,a]}}validatePoint(e){return!s(this._slicePlane,e)}}function _(e){let t=[l(e.plane),l(),l(),l(),l()];return v(e.basis1,e.origin,t[1],t[2]),v(e.basis2,e.origin,t[3],t[4]),t}function v(e,t,n,a){let o=r(e),s=i(e,t);d(e[0],e[1],e[2],-s+o,n),d(-e[0],-e[1],-e[2],s+o,a)}function y(){return[a(),a()]}const b=a();export{g as SliceScreenPolygonPrimitiveProcessor,h as clipPolygonAgainstSlicedAwayHalfspaces,_ as createSliceExtrusionHalfspacePlanes,f as sliceFilterPredicate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{set as e,dot as t,min as n,max as r,subtract as i,add as a,scale as o,projectAndScale as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as c,add as l,rotateZ as u,scale as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as f,ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as m,u as h}from"../../../../chunks/boundedPlane.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as _}from"../operations/MoveVertex.js";import{RotateVertex as v}from"../operations/RotateVertex.js";import{ScaleVertex as y}from"../operations/ScaleVertex.js";import{UpdateVertices as b}from"../operations/UpdateVertices.js";function x(e,t){return C(e,t,!1)}function S(e,t){return C(e,t,!0)}function C(e,t,n){if(e instanceof b){if(e.operation instanceof _)return w(e.operation,t,n),!0;if(e.operation instanceof v)return T(e.operation,t,n),!0;if(e.operation instanceof y)return E(e.operation,t,n),!0}return!1}function w(e,t,n=!1){let r=n?-1:1,i=f(r*e.dx,r*e.dy,r*e.dz);l(t.origin,t.origin,i),h(t)}function T(e,t,n=!1){let r=n?-e.angle:e.angle;u(t.basis1,t.basis1,p,r),u(t.basis2,t.basis2,p,r),h(t)}function E(e,t,n=!1){let r=n?1/e.factor1:e.factor1,i=n?1/e.factor2:e.factor2;d(t.basis1,t.basis1,r),d(t.basis2,t.basis2,i),s(t.origin,t.origin,e.origin,e.axis1,r),s(t.origin,t.origin,e.origin,e.axis2,i),h(t)}function D(s,u,d,f,p=!1){f||=m();let _=e(g.get(),s[1],-s[0]),v=e(g.get(),1/0,1/0),y=e(g.get(),-1/0,-1/0),b=g.get(),x=u.allVerticesUnordered;x.forEach(({pos:i})=>{e(b,t(s,i),t(_,i)),n(v,v,b),r(y,y,b)});let S=1e-6,C=e(g.get(),y[0]-v[0]<S?d/2:0,y[1]-v[1]<S?d/2:0);i(v,v,C),a(y,y,C);let w=p?x.reduce((e,t)=>e+(t.pos[2]??0),0)/x.length:0;return o(f.basis1,s,(y[0]-v[0])/2),o(f.basis2,_,(y[1]-v[1])/2),c(f.origin,v[0]*s[0]+v[1]*_[0],v[0]*s[1]+v[1]*_[1],w),l(f.origin,f.origin,f.basis1),l(f.origin,f.origin,f.basis2),h(f),f}export{x as apply,S as applyInverse,D as calculateOrientedBounds};
2
+ import{set as e,dot as t,min as n,max as r,subtract as i,add as a,scale as o,projectAndScale as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as c,add as l,rotateZ as u,scale as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as f,ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,updateUnboundedPlane as h}from"../../../../geometry/support/boundedPlane.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as _}from"../operations/MoveVertex.js";import{RotateVertex as v}from"../operations/RotateVertex.js";import{ScaleVertex as y}from"../operations/ScaleVertex.js";import{UpdateVertices as b}from"../operations/UpdateVertices.js";function x(e,t){return C(e,t,!1)}function S(e,t){return C(e,t,!0)}function C(e,t,n){if(e instanceof b){if(e.operation instanceof _)return w(e.operation,t,n),!0;if(e.operation instanceof v)return T(e.operation,t,n),!0;if(e.operation instanceof y)return E(e.operation,t,n),!0}return!1}function w(e,t,n=!1){let r=n?-1:1,i=f(r*e.dx,r*e.dy,r*e.dz);l(t.origin,t.origin,i),h(t)}function T(e,t,n=!1){let r=n?-e.angle:e.angle;u(t.basis1,t.basis1,p,r),u(t.basis2,t.basis2,p,r),h(t)}function E(e,t,n=!1){let r=n?1/e.factor1:e.factor1,i=n?1/e.factor2:e.factor2;d(t.basis1,t.basis1,r),d(t.basis2,t.basis2,i),s(t.origin,t.origin,e.origin,e.axis1,r),s(t.origin,t.origin,e.origin,e.axis2,i),h(t)}function D(s,u,d,f,p=!1){f||=m();let _=e(g.get(),s[1],-s[0]),v=e(g.get(),1/0,1/0),y=e(g.get(),-1/0,-1/0),b=g.get(),x=u.allVerticesUnordered;x.forEach(({pos:i})=>{e(b,t(s,i),t(_,i)),n(v,v,b),r(y,y,b)});let S=1e-6,C=e(g.get(),y[0]-v[0]<S?d/2:0,y[1]-v[1]<S?d/2:0);i(v,v,C),a(y,y,C);let w=p?x.reduce((e,t)=>e+(t.pos[2]??0),0)/x.length:0;return o(f.basis1,s,(y[0]-v[0])/2),o(f.basis2,_,(y[1]-v[1])/2),c(f.origin,v[0]*s[0]+v[1]*_[0],v[0]*s[1]+v[1]*_[1],w),l(f.origin,f.origin,f.basis1),l(f.origin,f.origin,f.basis2),h(f),f}export{x as apply,S as applyInverse,D as calculateOrientedBounds};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{set as e}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{d as n,e as r,c as i}from"../../../../../chunks/boundedPlane.js";function a(t,i){return n(i.extent,o),r(o,e(s,t.x,t.y,0))}const o=i(),s=t();export{a as distanceToTile};
2
+ import{set as e}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromAABoundingRect as n,distance as r,create as i}from"../../../../../geometry/support/boundedPlane.js";function a(t,i){return n(i.extent,o),r(o,e(s,t.x,t.y,0))}const o=i(),s=t();export{a as distanceToTile};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{isSome as n,equals as r}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import{deprecateUnnecessaryViewModel as a}from"../../core/deprecate.js";import"../../core/has.js";import o from"../../core/Logger.js";import{abortMaybe as s,destroyMaybe as c}from"../../core/maybe.js";import{after as l,throwIfAborted as u}from"../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../core/reactiveUtils.js";import{createScreenPointArray as p,createRenderScreenPointArray as m}from"../../core/screenUtils.js";import{convertTime as h,offsetDateUTC as g}from"../../core/timeUtils.js";import{property as _,subclass as v}from"../../core/accessorSupport/decorators.js";import{create as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{g as b}from"../../chunks/boundedPlane.js";import{longitudeToTimezone as x}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as S}from"../../views/3d/support/sunUtils.js";import C from"./DiscreteOptions.js";import w from"./DurationOptions.js";import{ShadowTooltipViewModel as T}from"./ShadowTooltipViewModel.js";import E from"./ThresholdOptions.js";import{breadthFirstBinaryPartitioning as D}from"../support/traversalUtils.js";const O=[],k=y(),A=[],j=h(1,`hours`,`milliseconds`);let M=class extends t{constructor(e){super(e),this.view=null,this.tooltip=new T({getDuration:e=>this.getDuration(e)}),this.startTimeOfDay=h(10,`hours`,`milliseconds`),this.endTimeOfDay=h(16,`hours`,`milliseconds`),this.visualizationType=`threshold`,this.thresholdOptions=new E({suppressDeprecationWarning:!0}),this.durationOptions=new w({suppressDeprecationWarning:!0}),this.discreteOptions=new C({suppressDeprecationWarning:!0}),this._running=!0,this._stopPreviewingTask=null,this._updatedRecently=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,e?.suppressDeprecationWarning||a(o.getLogger(this),`Shadow Cast`,`arcgis-shadow-cast`,{version:`5.0`}),this.date=new Date}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this.addHandles([d(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:e,tooltipEnabled:t})=>{this.tooltip.view=e,this.tooltip.enabled=t},f),d(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{s(this._stopPreviewingTask),this._updatedRecently=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=i(async e=>{await l(500,e),u(e),this._updatedRecently=!1}))},{sync:!0,initial:!0,equals:(e,t)=>F(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),d(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),e=>N(e.renderer,e.parameters),f),d(()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),e=>N(e.renderer,{lightDirections:e.lightDirections,lightDirectionsContext:e.lightDirectionsContext}),f),d(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),e=>N(e.renderer,e.parameters),f),d(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),e=>N(e.renderer,e.parameters),{sync:!0,initial:!0,equals:()=>!1})])}destroy(){this.stop(),N(this.renderer,{enabled:!1}),c(this.tooltip),this._stopPreviewingTask=s(this._stopPreviewingTask)}get state(){return this.view!=null&&this.view.ready&&this._referencePosition!=null?`ready`:`disabled`}set date(e){let t=new Date(e);t.setHours(0,0,0,0),this._set(`date`,t)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(e){this._utcOffset=e}get testData(){}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews?.some(e=>e.updating)??!1,s=!i?.suspended&&!!i?.updating;return a||o||s}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:x(e[0],!1)}get _dateUTCOffset(){let e=this.date;return e=g(e,-e.getTimezoneOffset(),`minutes`),e=g(e,-this.utcOffset,`hours`),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/254):255}get _interval(){let e=this._durationInterval;switch(this.visualizationType){case`threshold`:case`duration`:return e;case`discrete`:return this.discreteOptions.interval||e}}get _intervalContext(){let{contextEnabled:e,contextOptions:{interval:t}}=this.thresholdOptions;return this.visualizationType===`threshold`&&e?t||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){let{view:t}=this;if(t==null||e<=0)return O;let n=t.viewingMode===`global`?k:this._referencePosition;if(n==null)return O;let r=S(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,255),i=r.length;A.length=0;let a=D(0,i,A),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _tooltipEnabled(){return this.state===`ready`&&this.visualizationType!==`discrete`&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case`threshold`:return this._thresholdVisualizationParameters;case`duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){let{value:e,color:t}=this.thresholdOptions,n=this._duration;return{visualization:2,thresholdColor:t.toUnitRGBA(),threshold:n>0?e/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){let{contextOptions:{color:e},contextEnabled:t}=this.thresholdOptions,n=e.toUnitRGBA(),r=[n[0],n[1],n[2],0];return t?{visualization:3,gradientColorRamp:[[0,r],[1,n]]}:{}}get _durationVisualizationParameters(){let{color:e,mode:t}=this.durationOptions,n=this._duration,r=n>0&&t===`hourly`?j/n:0,i=e.toUnitRGBA(),a=[i[0],i[1],i[2],0];return r===0?{...this._discreteVisualizationParameters,gradientColorRamp:[[0,a],[1,i]]}:{bandedGradientColorRamp:[[0,a],[1,i]],visualization:1,bandSize:r}}get _discreteVisualizationParameters(){let e=this.discreteOptions.color.toUnitRGBA();return{gradientColorRamp:[[0,[e[0],e[1],e[2],0]],[1,e]],visualization:0}}get _shadowLayerViews(){return this.view?.allLayerViews.items.filter(P)}get _previewDependencies(){let{view:e,_shadowLayerViews:t}=this;if(e==null||t==null)return null;let r=e.slice.plane,i=t,a=i.map(e=>e.layer).filter(n),o=i.map(e=>e.suspended),s=a.map(e=>e.visible),c=a.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=a.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),d=i.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:r,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:s,layerOpacities:c,filters:d,definitionExpressions:u}}get renderer(){let{view:e}=this;if(e==null)return null;let t=e.stage;return t==null?null:t.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(e){this._running=e}async getDuration(e){let{view:t,renderer:n,_durationSampleCount:r}=this;if(t==null||n==null||r===0)return 0;let i=t.state.camera.screenToRender(p(e.x,e.y),m());return n.readAccumulatedShadow(i)*this._duration}};e([_()],M.prototype,`state`,null),e([_()],M.prototype,`view`,void 0),e([_()],M.prototype,`tooltip`,void 0),e([_({type:Date,nonNullable:!0})],M.prototype,`date`,null),e([_({type:Number,nonNullable:!0})],M.prototype,`utcOffset`,null),e([_({type:Number,nonNullable:!0})],M.prototype,`startTimeOfDay`,void 0),e([_({type:Number,nonNullable:!0})],M.prototype,`endTimeOfDay`,void 0),e([_({type:[`threshold`,`duration`,`discrete`],nonNullable:!0})],M.prototype,`visualizationType`,void 0),e([_({type:E,nonNullable:!0})],M.prototype,`thresholdOptions`,void 0),e([_({type:w,nonNullable:!0})],M.prototype,`durationOptions`,void 0),e([_({type:C,nonNullable:!0})],M.prototype,`discreteOptions`,void 0),e([_()],M.prototype,`_running`,void 0),e([_()],M.prototype,`_stopPreviewingTask`,void 0),e([_()],M.prototype,`_updatedRecently`,void 0),e([_()],M.prototype,`_autoRestoreForcePreviewEnabled`,void 0),e([_()],M.prototype,`_sceneUpdating`,null),e([_()],M.prototype,`_utcOffset`,void 0),e([_()],M.prototype,`_utcOffsetAuto`,null),e([_()],M.prototype,`_dateUTCOffset`,null),e([_()],M.prototype,`_startDateTimeUTC`,null),e([_()],M.prototype,`_endDateTimeUTC`,null),e([_()],M.prototype,`_referencePosition`,null),e([_()],M.prototype,`_interval`,null),e([_()],M.prototype,`_intervalContext`,null),e([_()],M.prototype,`_durationSampleCount`,null),e([_()],M.prototype,`_duration`,null),e([_()],M.prototype,`_lightDirections`,null),e([_()],M.prototype,`_lightDirectionsContext`,null),e([_()],M.prototype,`_tooltipEnabled`,null),e([_()],M.prototype,`_visualizationParameters`,null),e([_()],M.prototype,`_thresholdVisualizationParameters`,null),e([_()],M.prototype,`_thresholdDiscreteVisualizationParameters`,null),e([_()],M.prototype,`_durationVisualizationParameters`,null),e([_()],M.prototype,`_discreteVisualizationParameters`,null),e([_()],M.prototype,`_shadowLayerViews`,null),e([_()],M.prototype,`_previewDependencies`,null),e([_()],M.prototype,`renderer`,null),M=e([v(`esri.widgets.ShadowCast.ShadowCastViewModel`)],M);function N(e,t){e!=null&&t!=null&&e.setParameters({shadowCast:t})}function P(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`gaussian-splat-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:return!1;case`group`:return!1;case`graphics-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function F(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=b(e.slicePlane,t.slicePlane),i=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=r(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=r(e.layerVisibilities,t.layerVisibilities),s=r(e.layerOpacities,t.layerOpacities),c=r(e.filters,t.filters),l=r(e.definitionExpressions,t.definitionExpressions);return n&&i&&a&&o&&s&&c&&l}const I=M;export{I as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{isSome as n,equals as r}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import{deprecateUnnecessaryViewModel as a}from"../../core/deprecate.js";import"../../core/has.js";import o from"../../core/Logger.js";import{abortMaybe as s,destroyMaybe as c}from"../../core/maybe.js";import{after as l,throwIfAborted as u}from"../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../core/reactiveUtils.js";import{createScreenPointArray as p,createRenderScreenPointArray as m}from"../../core/screenUtils.js";import{convertTime as h,offsetDateUTC as g}from"../../core/timeUtils.js";import{property as _,subclass as v}from"../../core/accessorSupport/decorators.js";import{create as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{equals as b}from"../../geometry/support/boundedPlane.js";import{longitudeToTimezone as x}from"../../views/3d/support/earthUtils.js";import{computeDirectionsOverTime as S}from"../../views/3d/support/sunUtils.js";import C from"./DiscreteOptions.js";import w from"./DurationOptions.js";import{ShadowTooltipViewModel as T}from"./ShadowTooltipViewModel.js";import E from"./ThresholdOptions.js";import{breadthFirstBinaryPartitioning as D}from"../support/traversalUtils.js";const O=[],k=y(),A=[],j=h(1,`hours`,`milliseconds`);let M=class extends t{constructor(e){super(e),this.view=null,this.tooltip=new T({getDuration:e=>this.getDuration(e)}),this.startTimeOfDay=h(10,`hours`,`milliseconds`),this.endTimeOfDay=h(16,`hours`,`milliseconds`),this.visualizationType=`threshold`,this.thresholdOptions=new E({suppressDeprecationWarning:!0}),this.durationOptions=new w({suppressDeprecationWarning:!0}),this.discreteOptions=new C({suppressDeprecationWarning:!0}),this._running=!0,this._stopPreviewingTask=null,this._updatedRecently=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,e?.suppressDeprecationWarning||a(o.getLogger(this),`Shadow Cast`,`arcgis-shadow-cast`,{version:`5.0`}),this.date=new Date}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this.addHandles([d(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:e,tooltipEnabled:t})=>{this.tooltip.view=e,this.tooltip.enabled=t},f),d(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{s(this._stopPreviewingTask),this._updatedRecently=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=i(async e=>{await l(500,e),u(e),this._updatedRecently=!1}))},{sync:!0,initial:!0,equals:(e,t)=>F(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),d(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),e=>N(e.renderer,e.parameters),f),d(()=>({renderer:this.renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),e=>N(e.renderer,{lightDirections:e.lightDirections,lightDirectionsContext:e.lightDirectionsContext}),f),d(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),e=>N(e.renderer,e.parameters),f),d(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),e=>N(e.renderer,e.parameters),{sync:!0,initial:!0,equals:()=>!1})])}destroy(){this.stop(),N(this.renderer,{enabled:!1}),c(this.tooltip),this._stopPreviewingTask=s(this._stopPreviewingTask)}get state(){return this.view!=null&&this.view.ready&&this._referencePosition!=null?`ready`:`disabled`}set date(e){let t=new Date(e);t.setHours(0,0,0,0),this._set(`date`,t)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(e){this._utcOffset=e}get testData(){}get _previewing(){let e=this._updatedRecently,t=this._sceneUpdating;return e||t}get _sceneUpdating(){let{view:e}=this;if(e?.allLayerViews==null)return!0;let{stationary:t,navigating:n,interacting:r,graphicsView:i}=e,a=!t||n||r,o=this._shadowLayerViews?.some(e=>e.updating)??!1,s=!i?.suspended&&!!i?.updating;return a||o||s}get _utcOffsetAuto(){let e=this._referencePosition;return e==null?0:x(e[0],!1)}get _dateUTCOffset(){let e=this.date;return e=g(e,-e.getTimezoneOffset(),`minutes`),e=g(e,-this.utcOffset,`hours`),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){return this.view?.environmentView?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/254):255}get _interval(){let e=this._durationInterval;switch(this.visualizationType){case`threshold`:case`duration`:return e;case`discrete`:return this.discreteOptions.interval||e}}get _intervalContext(){let{contextEnabled:e,contextOptions:{interval:t}}=this.thresholdOptions;return this.visualizationType===`threshold`&&e?t||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){let{view:t}=this;if(t==null||e<=0)return O;let n=t.viewingMode===`global`?k:this._referencePosition;if(n==null)return O;let r=S(this._startDateTimeUTC,this._endDateTimeUTC,e,n,t.state.viewingMode,255),i=r.length;A.length=0;let a=D(0,i,A),o=Array(i);for(let e=0;e<i;++e)o[e]=r[a[e]];return o}get _tooltipEnabled(){return this.state===`ready`&&this.visualizationType!==`discrete`&&this._running&&!this._previewing}get _visualizationParameters(){if(!this._running)return null;switch(this.visualizationType){case`threshold`:return this._thresholdVisualizationParameters;case`duration`:return this._durationVisualizationParameters;case`discrete`:return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){let{value:e,color:t}=this.thresholdOptions,n=this._duration;return{visualization:2,thresholdColor:t.toUnitRGBA(),threshold:n>0?e/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){let{contextOptions:{color:e},contextEnabled:t}=this.thresholdOptions,n=e.toUnitRGBA(),r=[n[0],n[1],n[2],0];return t?{visualization:3,gradientColorRamp:[[0,r],[1,n]]}:{}}get _durationVisualizationParameters(){let{color:e,mode:t}=this.durationOptions,n=this._duration,r=n>0&&t===`hourly`?j/n:0,i=e.toUnitRGBA(),a=[i[0],i[1],i[2],0];return r===0?{...this._discreteVisualizationParameters,gradientColorRamp:[[0,a],[1,i]]}:{bandedGradientColorRamp:[[0,a],[1,i]],visualization:1,bandSize:r}}get _discreteVisualizationParameters(){let e=this.discreteOptions.color.toUnitRGBA();return{gradientColorRamp:[[0,[e[0],e[1],e[2],0]],[1,e]],visualization:0}}get _shadowLayerViews(){return this.view?.allLayerViews.items.filter(P)}get _previewDependencies(){let{view:e,_shadowLayerViews:t}=this;if(e==null||t==null)return null;let r=e.slice.plane,i=t,a=i.map(e=>e.layer).filter(n),o=i.map(e=>e.suspended),s=a.map(e=>e.visible),c=a.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=a.filter(e=>`definitionExpression`in e).map(e=>e.definitionExpression),d=i.filter(e=>`filter`in e).map(e=>e.filter);return{slicePlane:r,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:o,graphicsViewSuspended:l,layerVisibilities:s,layerOpacities:c,filters:d,definitionExpressions:u}}get renderer(){let{view:e}=this;if(e==null)return null;let t=e.stage;return t==null?null:t.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(e){this._running=e}async getDuration(e){let{view:t,renderer:n,_durationSampleCount:r}=this;if(t==null||n==null||r===0)return 0;let i=t.state.camera.screenToRender(p(e.x,e.y),m());return n.readAccumulatedShadow(i)*this._duration}};e([_()],M.prototype,`state`,null),e([_()],M.prototype,`view`,void 0),e([_()],M.prototype,`tooltip`,void 0),e([_({type:Date,nonNullable:!0})],M.prototype,`date`,null),e([_({type:Number,nonNullable:!0})],M.prototype,`utcOffset`,null),e([_({type:Number,nonNullable:!0})],M.prototype,`startTimeOfDay`,void 0),e([_({type:Number,nonNullable:!0})],M.prototype,`endTimeOfDay`,void 0),e([_({type:[`threshold`,`duration`,`discrete`],nonNullable:!0})],M.prototype,`visualizationType`,void 0),e([_({type:E,nonNullable:!0})],M.prototype,`thresholdOptions`,void 0),e([_({type:w,nonNullable:!0})],M.prototype,`durationOptions`,void 0),e([_({type:C,nonNullable:!0})],M.prototype,`discreteOptions`,void 0),e([_()],M.prototype,`_running`,void 0),e([_()],M.prototype,`_stopPreviewingTask`,void 0),e([_()],M.prototype,`_updatedRecently`,void 0),e([_()],M.prototype,`_autoRestoreForcePreviewEnabled`,void 0),e([_()],M.prototype,`_sceneUpdating`,null),e([_()],M.prototype,`_utcOffset`,void 0),e([_()],M.prototype,`_utcOffsetAuto`,null),e([_()],M.prototype,`_dateUTCOffset`,null),e([_()],M.prototype,`_startDateTimeUTC`,null),e([_()],M.prototype,`_endDateTimeUTC`,null),e([_()],M.prototype,`_referencePosition`,null),e([_()],M.prototype,`_interval`,null),e([_()],M.prototype,`_intervalContext`,null),e([_()],M.prototype,`_durationSampleCount`,null),e([_()],M.prototype,`_duration`,null),e([_()],M.prototype,`_lightDirections`,null),e([_()],M.prototype,`_lightDirectionsContext`,null),e([_()],M.prototype,`_tooltipEnabled`,null),e([_()],M.prototype,`_visualizationParameters`,null),e([_()],M.prototype,`_thresholdVisualizationParameters`,null),e([_()],M.prototype,`_thresholdDiscreteVisualizationParameters`,null),e([_()],M.prototype,`_durationVisualizationParameters`,null),e([_()],M.prototype,`_discreteVisualizationParameters`,null),e([_()],M.prototype,`_shadowLayerViews`,null),e([_()],M.prototype,`_previewDependencies`,null),e([_()],M.prototype,`renderer`,null),M=e([v(`esri.widgets.ShadowCast.ShadowCastViewModel`)],M);function N(e,t){e!=null&&t!=null&&e.setParameters({shadowCast:t})}function P(e){if(e.suspended)return!1;switch(e.type){case`building-scene-3d`:case`csv-3d`:case`elevation-3d`:case`feature-3d`:case`geojson-3d`:case`integrated-mesh-3d`:case`integrated-mesh-3dtiles`:case`ogc-feature-3d`:case`route-3d`:case`scene-layer-3d`:case`scene-layer-graphics-3d`:case`stream-3d`:case`wms-3d`:case`catalog-footprint-3d`:return!0;case`base-dynamic-3d`:case`catalog-3d`:case`catalog-dynamic-group-3d`:case`dimension-3d`:case`gaussian-splat-3d`:case`imagery-3d`:case`imagery-tile-3d`:case`line-of-sight-3d`:case`map-image-3d`:case`point-cloud-3d`:case`tile-3d`:case`vector-tile-3d`:case`viewshed-3d`:case`voxel-3d`:case`wfs-3d`:case`wmts-3d`:case`media-3d`:return!1;case`group`:return!1;case`graphics-3d`:return e.layer.graphics.some(e=>{let{symbol:t}=e;return t==null||t.type!==`text`&&!(`symbolLayers`in t)||t.type!==`text`&&t.symbolLayers.some(e=>e.type!==`text`)});default:return!1}}function F(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;let n=b(e.slicePlane,t.slicePlane),i=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=r(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,o=r(e.layerVisibilities,t.layerVisibilities),s=r(e.layerOpacities,t.layerOpacities),c=r(e.filters,t.filters),l=r(e.definitionExpressions,t.definitionExpressions);return n&&i&&a&&o&&s&&c&&l}const I=M;export{I as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[491],{32198(t,e,n){function r(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function i(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}n.d(e,{Cg:()=>r,hk:()=>s,mS:()=>i}),Object.create,Object.create;var o="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function s(t){function e(e){t.error=t.hasError?new o(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var n,r=0;return function i(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(i);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(o).then(i,function(t){return e(t),i()})}else r|=1}catch(t){e(t)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}},4341(t,e,n){n.d(e,{I:()=>i});var r=n(26390);class i{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,r.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){let t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,o));t++)this._items.push(this._allocator())}}const o=1024},29242(t,e,n){function r(){return[1,0,0,0,1,0,0,0,1]}function i(t,e,n,r,i,o,s,a,u){return[t,e,n,r,i,o,s,a,u]}n.d(e,{fA:()=>i,vt:()=>r});const o=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:r,fromValues:i},Symbol.toStringTag,{value:"Module"})),n.d(e,["zK",0,o])},9093(t,e,n){function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}n.d(e,{o8:()=>i,vt:()=>r});const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:i,create:r,fromValues:function(t,e,n,r,i,o,s,a,u,h,c,l,f,d,m,M){return[t,e,n,r,i,o,s,a,u,h,c,l,f,d,m,M]}},Symbol.toStringTag,{value:"Module"})),n.d(e,["zK",0,o])},82534(t,e,n){function r(){return[0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3]]}n.d(e,{o8:()=>i,vt:()=>r});const o=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:i,create:r,fromValues:function(t,e,n,r){return[t,e,n,r]}},Symbol.toStringTag,{value:"Module"})),n.d(e,["zK",0,o])},77690(t,e,n){n.d(e,{B8:()=>a,Ge:()=>d,I0:()=>f,KC:()=>u,a4:()=>h,hZ:()=>o,hs:()=>l,lw:()=>c,mg:()=>s,z0:()=>i});var r=n(34304);function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t,e,n,r,i,o,s,a,u,h){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=u,t[8]=h,t}function s(t,e){if(t===e){let n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function a(t,e){let n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=c*s-a*h,f=-c*o+a*u,d=h*o-s*u,m=n*l+r*f+i*d;return m?(m=1/m,t[0]=l*m,t[1]=(-c*r+i*h)*m,t[2]=(a*r-i*s)*m,t[3]=f*m,t[4]=(c*n-i*u)*m,t[5]=(-a*n+i*o)*m,t[6]=d*m,t[7]=(-h*n+r*u)*m,t[8]=(s*n-r*o)*m,t):null}function u(t,e){let n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],h=e[7],c=e[8];return t[0]=s*c-a*h,t[1]=i*h-r*c,t[2]=r*a-i*s,t[3]=a*u-o*c,t[4]=n*c-i*u,t[5]=i*o-n*a,t[6]=o*h-s*u,t[7]=r*u-n*h,t[8]=n*s-r*o,t}function h(t){let e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],u=t[7],h=t[8];return e*(h*o-s*u)+n*(-h*i+s*a)+r*(u*i-o*a)}function c(t,e,n){let r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=n[0],d=n[1],m=n[2],M=n[3],b=n[4],g=n[5],_=n[6],p=n[7],v=n[8];return t[0]=f*r+d*s+m*h,t[1]=f*i+d*a+m*c,t[2]=f*o+d*u+m*l,t[3]=M*r+b*s+g*h,t[4]=M*i+b*a+g*c,t[5]=M*o+b*u+g*l,t[6]=_*r+p*s+v*h,t[7]=_*i+p*a+v*c,t[8]=_*o+p*u+v*l,t}function l(t,e,n){let r=n[0],i=n[1],o=n[2];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=o*e[6],t[7]=o*e[7],t[8]=o*e[8],t}function f(t,e){let n=e[0],r=e[1],i=e[2],o=e[3],s=n+n,a=r+r,u=i+i,h=n*s,c=r*s,l=r*a,f=i*s,d=i*a,m=i*u,M=o*s,b=o*a,g=o*u;return t[0]=1-l-m,t[3]=c-g,t[6]=f+b,t[1]=c+g,t[4]=1-h-m,t[7]=d-M,t[2]=f-b,t[5]=d+M,t[8]=1-h-l,t}function d(t,e){let n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],m=e[12],M=e[13],b=e[14],g=e[15],_=n*a-r*s,p=n*u-i*s,v=n*h-o*s,x=r*u-i*a,y=r*h-o*a,S=i*h-o*u,w=c*M-l*m,A=c*b-f*m,j=c*g-d*m,O=l*b-f*M,T=l*g-d*M,q=f*g-d*b,C=_*q-p*T+v*O+x*j-y*A+S*w;return C?(C=1/C,t[0]=(a*q-u*T+h*O)*C,t[1]=(u*j-s*q-h*A)*C,t[2]=(s*T-a*j+h*w)*C,t[3]=(i*T-r*q-o*O)*C,t[4]=(n*q-i*j+o*A)*C,t[5]=(r*j-n*T-o*w)*C,t[6]=(M*S-b*y+g*x)*C,t[7]=(b*v-m*S-g*p)*C,t[8]=(m*y-M*v+g*_)*C,t):null}function m(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}const M=c,b=m;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},adjoint:u,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},determinant:h,equals:function(t,e){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=t[8],f=e[0],d=e[1],m=e[2],M=e[3],b=e[4],g=e[5],_=e[6],p=e[7],v=e[8],x=(0,r.FD)();return Math.abs(n-f)<=x*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-d)<=x*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-m)<=x*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-M)<=x*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(a-b)<=x*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(u-g)<=x*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(h-_)<=x*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(c-p)<=x*Math.max(1,Math.abs(c),Math.abs(p))&&Math.abs(l-v)<=x*Math.max(1,Math.abs(l),Math.abs(v))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromMat4:i,fromQuat:f,fromRotation:function(t,e){let n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:a,isOrthoNormal:function(t){let e=(0,r.FD)(),n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=t[8];return Math.abs(1-(n*n+s*s+h*h))<=e&&Math.abs(1-(i*i+a*a+c*c))<=e&&Math.abs(1-(o*o+u*u+l*l))<=e},mul:M,multiply:c,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},normalFromMat4:d,normalFromMat4Legacy:function(t,e){let n=e[0],r=e[1],i=e[2],o=e[4],s=e[5],a=e[6],u=e[8],h=e[9],c=e[10],l=c*s-a*h,f=-c*o+a*u,d=h*o-s*u,m=n*l+r*f+i*d;if(!m)return null;let M=1/m;return t[0]=l*M,t[1]=(-c*r+i*h)*M,t[2]=(a*r-i*s)*M,t[3]=f*M,t[4]=(c*n-i*u)*M,t[5]=(-a*n+i*o)*M,t[6]=d*M,t[7]=(-h*n+r*u)*M,t[8]=(s*n-r*o)*M,t},projection:function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,e,n){let r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*s,t[1]=d*i+f*a,t[2]=d*o+f*u,t[3]=d*s-f*r,t[4]=d*a-f*i,t[5]=d*u-f*o,t[6]=h,t[7]=c,t[8]=l,t},scale:l,scaleByVec2:function(t,e,n){let r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t},set:o,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:b,subtract:m,translate:function(t,e,n){let r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=u,t[6]=f*r+d*s+h,t[7]=f*i+d*a+c,t[8]=f*o+d*u+l,t},transpose:s},Symbol.toStringTag,{value:"Module"}))},58083(t,e,n){n.d(e,{$0:()=>g,$h:()=>O,B8:()=>c,C:()=>o,D_:()=>a,N9:()=>p,O7:()=>j,Qw:()=>h,Tl:()=>f,X_:()=>S,e$:()=>m,eL:()=>M,hM:()=>_,hZ:()=>s,hs:()=>d,kN:()=>b,l:()=>w,lw:()=>l,mg:()=>u,o1:()=>A,sC:()=>y,t2:()=>C,t5:()=>T,tZ:()=>R,ut:()=>E});var r=n(51850),i=n(34304);function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function s(t,e,n,r,i,o,s,a,u,h,c,l,f,d,m,M,b){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=u,t[8]=h,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=m,t[14]=M,t[15]=b,t}function a(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function u(t,e){if(t===e){let n=e[1],r=e[2],i=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function h(t,e){return c(t,e)||a(t),t}function c(t,e){let n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],m=e[12],M=e[13],b=e[14],g=e[15],_=n*a-r*s,p=n*u-i*s,v=n*h-o*s,x=r*u-i*a,y=r*h-o*a,S=i*h-o*u,w=c*M-l*m,A=c*b-f*m,j=c*g-d*m,O=l*b-f*M,T=l*g-d*M,q=f*g-d*b,C=_*q-p*T+v*O+x*j-y*A+S*w;return C?(C=1/C,t[0]=(a*q-u*T+h*O)*C,t[1]=(i*T-r*q-o*O)*C,t[2]=(M*S-b*y+g*x)*C,t[3]=(f*y-l*S-d*x)*C,t[4]=(u*j-s*q-h*A)*C,t[5]=(n*q-i*j+o*A)*C,t[6]=(b*v-m*S-g*p)*C,t[7]=(c*S-f*v+d*p)*C,t[8]=(s*T-a*j+h*w)*C,t[9]=(r*j-n*T-o*w)*C,t[10]=(m*y-M*v+g*_)*C,t[11]=(l*v-c*y-d*_)*C,t[12]=(a*A-s*O-u*w)*C,t[13]=(n*O-r*A+i*w)*C,t[14]=(M*p-m*x-b*_)*C,t[15]=(c*x-l*p+f*_)*C,t):null}function l(t,e,n){let r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],m=e[11],M=e[12],b=e[13],g=e[14],_=e[15],p=n[0],v=n[1],x=n[2],y=n[3];return t[0]=p*r+v*a+x*l+y*M,t[1]=p*i+v*u+x*f+y*b,t[2]=p*o+v*h+x*d+y*g,t[3]=p*s+v*c+x*m+y*_,p=n[4],v=n[5],x=n[6],y=n[7],t[4]=p*r+v*a+x*l+y*M,t[5]=p*i+v*u+x*f+y*b,t[6]=p*o+v*h+x*d+y*g,t[7]=p*s+v*c+x*m+y*_,p=n[8],v=n[9],x=n[10],y=n[11],t[8]=p*r+v*a+x*l+y*M,t[9]=p*i+v*u+x*f+y*b,t[10]=p*o+v*h+x*d+y*g,t[11]=p*s+v*c+x*m+y*_,p=n[12],v=n[13],x=n[14],y=n[15],t[12]=p*r+v*a+x*l+y*M,t[13]=p*i+v*u+x*f+y*b,t[14]=p*o+v*h+x*d+y*g,t[15]=p*s+v*c+x*m+y*_,t}function f(t,e,n){let r=n[0],i=n[1],o=n[2];if(e===t)t[12]=e[0]*r+e[4]*i+e[8]*o+e[12],t[13]=e[1]*r+e[5]*i+e[9]*o+e[13],t[14]=e[2]*r+e[6]*i+e[10]*o+e[14],t[15]=e[3]*r+e[7]*i+e[11]*o+e[15];else{let n=e[0],s=e[1],a=e[2],u=e[3],h=e[4],c=e[5],l=e[6],f=e[7],d=e[8],m=e[9],M=e[10],b=e[11];t[0]=n,t[1]=s,t[2]=a,t[3]=u,t[4]=h,t[5]=c,t[6]=l,t[7]=f,t[8]=d,t[9]=m,t[10]=M,t[11]=b,t[12]=n*r+h*i+d*o+e[12],t[13]=s*r+c*i+m*o+e[13],t[14]=a*r+l*i+M*o+e[14],t[15]=u*r+f*i+b*o+e[15]}return t}function d(t,e,n){let r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function m(t,e,n,r){let s=r[0],a=r[1],u=r[2],h=Math.sqrt(s*s+a*a+u*u);if(h<=(0,i.FD)())return void o(t,e);h=1/h,s*=h,a*=h,u*=h;let c=Math.sin(n),l=Math.cos(n),f=1-l,d=e[0],m=e[1],M=e[2],b=e[3],g=e[4],_=e[5],p=e[6],v=e[7],x=e[8],y=e[9],S=e[10],w=e[11],A=s*s*f+l,j=a*s*f+u*c,O=u*s*f-a*c,T=s*a*f-u*c,q=a*a*f+l,C=u*a*f+s*c,E=s*u*f+a*c,R=a*u*f-s*c,P=u*u*f+l;t[0]=d*A+g*j+x*O,t[1]=m*A+_*j+y*O,t[2]=M*A+p*j+S*O,t[3]=b*A+v*j+w*O,t[4]=d*T+g*q+x*C,t[5]=m*T+_*q+y*C,t[6]=M*T+p*q+S*C,t[7]=b*T+v*q+w*C,t[8]=d*E+g*R+x*P,t[9]=m*E+_*R+y*P,t[10]=M*E+p*R+S*P,t[11]=b*E+v*R+w*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15])}function M(t,e,n){let r=Math.sin(n),i=Math.cos(n),o=e[4],s=e[5],a=e[6],u=e[7],h=e[8],c=e[9],l=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+h*r,t[5]=s*i+c*r,t[6]=a*i+l*r,t[7]=u*i+f*r,t[8]=h*i-o*r,t[9]=c*i-s*r,t[10]=l*i-a*r,t[11]=f*i-u*r,t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function g(t,e,n){if(0===e)return a(t);let r=n[0],o=n[1],s=n[2],u=Math.sqrt(r*r+o*o+s*s);if(u<=(0,i.FD)())return null;u=1/u,r*=u,o*=u,s*=u;let h=Math.sin(e),c=Math.cos(e),l=1-c;return t[0]=r*r*l+c,t[1]=o*r*l+s*h,t[2]=s*r*l-o*h,t[3]=0,t[4]=r*o*l-s*h,t[5]=o*o*l+c,t[6]=s*o*l+r*h,t[7]=0,t[8]=r*s*l+o*h,t[9]=o*s*l-r*h,t[10]=s*s*l+c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _(t,e){let n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function p(t,e){let n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function v(t,e,n){let r=e[0],i=e[1],o=e[2],s=e[3],a=r+r,u=i+i,h=o+o,c=r*a,l=r*u,f=r*h,d=i*u,m=i*h,M=o*h,b=s*a,g=s*u,_=s*h;return t[0]=1-(d+M),t[1]=l+_,t[2]=f-g,t[3]=0,t[4]=l-_,t[5]=1-(c+M),t[6]=m+b,t[7]=0,t[8]=f+g,t[9]=m-b,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}const x=(0,r.vt)();function y(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function S(t,e){let n=e[0],r=e[1],i=e[2],o=e[4],s=e[5],a=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(o*o+s*s+a*a),t[2]=Math.sqrt(u*u+h*h+c*c),t}function w(t,e){let n=e[0]+e[5]+e[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t}function A(t,e,n,r){let i=e[0],o=e[1],s=e[2],a=e[3],u=i+i,h=o+o,c=s+s,l=i*u,f=i*h,d=i*c,m=o*h,M=o*c,b=s*c,g=a*u,_=a*h,p=a*c,v=r[0],x=r[1],y=r[2];return t[0]=(1-(m+b))*v,t[1]=(f+p)*v,t[2]=(d-_)*v,t[3]=0,t[4]=(f-p)*x,t[5]=(1-(l+b))*x,t[6]=(M+g)*x,t[7]=0,t[8]=(d+_)*y,t[9]=(M-g)*y,t[10]=(1-(l+m))*y,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function j(t,e,n,r,i){let o=e[0],s=e[1],a=e[2],u=e[3],h=o+o,c=s+s,l=a+a,f=o*h,d=o*c,m=o*l,M=s*c,b=s*l,g=a*l,_=u*h,p=u*c,v=u*l,x=r[0],y=r[1],S=r[2],w=i[0],A=i[1],j=i[2],O=(1-(M+g))*x,T=(d+v)*x,q=(m-p)*x,C=(d-v)*y,E=(1-(f+g))*y,R=(b+_)*y,P=(m+p)*S,I=(b-_)*S,z=(1-(f+M))*S;return t[0]=O,t[1]=T,t[2]=q,t[3]=0,t[4]=C,t[5]=E,t[6]=R,t[7]=0,t[8]=P,t[9]=I,t[10]=z,t[11]=0,t[12]=n[0]+w-(O*w+C*A+P*j),t[13]=n[1]+A-(T*w+E*A+I*j),t[14]=n[2]+j-(q*w+R*A+z*j),t[15]=1,t}function O(t,e,n,r,i,o,s){let a=1/(n-e),u=1/(i-r),h=1/(o-s);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*a,t[9]=(i+r)*u,t[10]=(s+o)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*h,t[15]=0,t}function T(t,e,n,r){let o=e[0],s=e[1],u=e[2],h=o-n[0],c=s-n[1],l=u-n[2],f=(0,i.FD)();if(Math.abs(h)<f&&Math.abs(c)<f&&Math.abs(l)<f)return void a(t);let d=1/Math.sqrt(h*h+c*c+l*l);h*=d,c*=d,l*=d;let m=r[0],M=r[1],b=r[2],g=M*l-b*c,_=b*h-m*l,p=m*c-M*h;d=Math.sqrt(g*g+_*_+p*p),d?(d=1/d,g*=d,_*=d,p*=d):(g=0,_=0,p=0);let v=c*p-l*_,x=l*g-h*p,y=h*_-c*g;d=Math.sqrt(v*v+x*x+y*y),d?(d=1/d,v*=d,x*=d,y*=d):(v=0,x=0,y=0),t[0]=g,t[1]=v,t[2]=h,t[3]=0,t[4]=_,t[5]=x,t[6]=c,t[7]=0,t[8]=p,t[9]=y,t[10]=l,t[11]=0,t[12]=-(g*o+_*s+p*u),t[13]=-(v*o+x*s+y*u),t[14]=-(h*o+c*s+l*u),t[15]=1}function q(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function C(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function E(t){let e=(0,i.FD)(),n=t[0],r=t[1],o=t[2],s=t[4],a=t[5],u=t[6],h=t[8],c=t[9],l=t[10];return Math.abs(1-(n*n+s*s+h*h))<=e&&Math.abs(1-(r*r+a*a+c*c))<=e&&Math.abs(1-(o*o+u*u+l*l))<=e}function R(t){return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[8]&&0===t[9]&&1===t[10]}const P=l,I=q;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},adjoint:function(t,e){let n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],m=e[12],M=e[13],b=e[14],g=e[15];return t[0]=a*(f*g-d*b)-l*(u*g-h*b)+M*(u*d-h*f),t[1]=-(r*(f*g-d*b)-l*(i*g-o*b)+M*(i*d-o*f)),t[2]=r*(u*g-h*b)-a*(i*g-o*b)+M*(i*h-o*u),t[3]=-(r*(u*d-h*f)-a*(i*d-o*f)+l*(i*h-o*u)),t[4]=-(s*(f*g-d*b)-c*(u*g-h*b)+m*(u*d-h*f)),t[5]=n*(f*g-d*b)-c*(i*g-o*b)+m*(i*d-o*f),t[6]=-(n*(u*g-h*b)-s*(i*g-o*b)+m*(i*h-o*u)),t[7]=n*(u*d-h*f)-s*(i*d-o*f)+c*(i*h-o*u),t[8]=s*(l*g-d*M)-c*(a*g-h*M)+m*(a*d-h*l),t[9]=-(n*(l*g-d*M)-c*(r*g-o*M)+m*(r*d-o*l)),t[10]=n*(a*g-h*M)-s*(r*g-o*M)+m*(r*h-o*a),t[11]=-(n*(a*d-h*l)-s*(r*d-o*l)+c*(r*h-o*a)),t[12]=-(s*(l*b-f*M)-c*(a*b-u*M)+m*(a*f-u*l)),t[13]=n*(l*b-f*M)-c*(r*b-i*M)+m*(r*f-i*l),t[14]=-(n*(a*b-u*M)-s*(r*b-i*M)+m*(r*u-i*a)),t[15]=n*(a*f-u*l)-s*(r*f-i*l)+c*(r*u-i*a),t},copy:o,determinant:function(t){let e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],a=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=t[12],m=t[13],M=t[14],b=t[15];return(e*s-n*o)*(l*b-f*M)-(e*a-r*o)*(c*b-f*m)+(e*u-i*o)*(c*M-l*m)+(n*a-r*s)*(h*b-f*d)-(n*u-i*s)*(h*M-l*d)+(r*u-i*a)*(h*m-c*d)},equals:function(t,e){if(t===e)return!0;let n=t[0],r=t[1],o=t[2],s=t[3],a=t[4],u=t[5],h=t[6],c=t[7],l=t[8],f=t[9],d=t[10],m=t[11],M=t[12],b=t[13],g=t[14],_=t[15],p=e[0],v=e[1],x=e[2],y=e[3],S=e[4],w=e[5],A=e[6],j=e[7],O=e[8],T=e[9],q=e[10],C=e[11],E=e[12],R=e[13],P=e[14],I=e[15],z=(0,i.FD)();return Math.abs(n-p)<=z*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(r-v)<=z*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(o-x)<=z*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(s-y)<=z*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(a-S)<=z*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(u-w)<=z*Math.max(1,Math.abs(u),Math.abs(w))&&Math.abs(h-A)<=z*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(c-j)<=z*Math.max(1,Math.abs(c),Math.abs(j))&&Math.abs(l-O)<=z*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-T)<=z*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(d-q)<=z*Math.max(1,Math.abs(d),Math.abs(q))&&Math.abs(m-C)<=z*Math.max(1,Math.abs(m),Math.abs(C))&&Math.abs(M-E)<=z*Math.max(1,Math.abs(M),Math.abs(E))&&Math.abs(b-R)<=z*Math.max(1,Math.abs(b),Math.abs(R))&&Math.abs(g-P)<=z*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(_-I)<=z*Math.max(1,Math.abs(_),Math.abs(I))},exactEquals:C,frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)},fromQuat:function(t,e){let n=e[0],r=e[1],i=e[2],o=e[3],s=n+n,a=r+r,u=i+i,h=n*s,c=r*s,l=r*a,f=i*s,d=i*a,m=i*u,M=o*s,b=o*a,g=o*u;return t[0]=1-l-m,t[1]=c+g,t[2]=f-b,t[3]=0,t[4]=c-g,t[5]=1-h-m,t[6]=d+M,t[7]=0,t[8]=f+b,t[9]=d-M,t[10]=1-h-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromQuat2:function(t,e){let n=x,r=-e[0],i=-e[1],o=-e[2],s=e[3],a=e[4],u=e[5],h=e[6],c=e[7],l=r*r+i*i+o*o+s*s;return l>0?(n[0]=2*(a*s+c*r+u*o-h*i)/l,n[1]=2*(u*s+c*i+h*r-a*o)/l,n[2]=2*(h*s+c*o+a*i-u*r)/l):(n[0]=2*(a*s+c*r+u*o-h*i),n[1]=2*(u*s+c*i+h*r-a*o),n[2]=2*(h*s+c*o+a*i-u*r)),v(t,e,n),t},fromRotation:g,fromRotationTranslation:v,fromRotationTranslationScale:A,fromRotationTranslationScaleOrigin:j,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromTranslation:b,fromXRotation:_,fromYRotation:function(t,e){let n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:p,frustum:O,getRotation:w,getScale:S,getTranslation:y,hasIdentityRotation:R,identity:a,invert:c,invertOrIdentity:h,isOrthoNormal:E,lookAt:T,mul:P,multiply:l,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},ortho:function(t,e,n,r,i,o,s){let a=1/(e-n),u=1/(r-i),h=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+n)*a,t[13]=(i+r)*u,t[14]=(s+o)*h,t[15]=1,t},perspective:function(t,e,n,r,i){let o,s=1/Math.tan(e/2);return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t},perspectiveFromFieldOfView:function(t,e,n,r){let i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),u=2/(s+a),h=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(s-a)*u*.5,t[9]=(i-o)*h*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},rotate:m,rotateX:M,rotateY:function(t,e,n){let r=Math.sin(n),i=Math.cos(n),o=e[0],s=e[1],a=e[2],u=e[3],h=e[8],c=e[9],l=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-h*r,t[1]=s*i-c*r,t[2]=a*i-l*r,t[3]=u*i-f*r,t[8]=o*r+h*i,t[9]=s*r+c*i,t[10]=a*r+l*i,t[11]=u*r+f*i,t},rotateZ:function(t,e,n){let r=Math.sin(n),i=Math.cos(n),o=e[0],s=e[1],a=e[2],u=e[3],h=e[4],c=e[5],l=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+h*r,t[1]=s*i+c*r,t[2]=a*i+l*r,t[3]=u*i+f*r,t[4]=h*i-o*r,t[5]=c*i-s*r,t[6]=l*i-a*r,t[7]=f*i-u*r,t},scale:d,set:s,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:I,subtract:q,targetTo:function(t,e,n,r){let i=e[0],o=e[1],s=e[2],a=r[0],u=r[1],h=r[2],c=i-n[0],l=o-n[1],f=s-n[2],d=c*c+l*l+f*f;d>0&&(d=1/Math.sqrt(d),c*=d,l*=d,f*=d);let m=u*f-h*l,M=h*c-a*f,b=a*l-u*c;return d=m*m+M*M+b*b,d>0&&(d=1/Math.sqrt(d),m*=d,M*=d,b*=d),t[0]=m,t[1]=M,t[2]=b,t[3]=0,t[4]=l*b-f*M,t[5]=f*m-c*b,t[6]=c*M-l*m,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=s,t[15]=1,t},translate:f,transpose:u},Symbol.toStringTag,{value:"Module"}))},4197(t,e,n){n.d(e,{Vj:()=>s,cj:()=>o,jh:()=>i});var r=n(9093);function i(t){return t<=1024?Array(t).fill(0):new Float64Array(t)}function o(t){return[...t]}function s(t){let e=(0,r.vt)();for(let n=0;n<16;++n)e[n]=t[n];return e}},70328(t,e,n){n.d(e,{BI:()=>O,C:()=>s,DC:()=>f,Ej:()=>p,Ie:()=>A,Jt:()=>j,Lu:()=>x,Ne:()=>y,RF:()=>l,TF:()=>g,VL:()=>m,aI:()=>q,fA:()=>a,gE:()=>h,gX:()=>_,hZ:()=>w,iT:()=>d,is:()=>T,pg:()=>v,uJ:()=>b,vI:()=>S,vY:()=>u,vt:()=>o,w1:()=>c,yr:()=>M}),n(35522);var r=n(5443),i=(n(19419),n(4197));function o(t=E){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function s(t,e){for(let n=0;n<6;n++)t[n]=e[n];return t}function a(t,e,n,r,i,s,a=o()){return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a[4]=i,a[5]=s,a}function u(t,e=o()){return function(t,e,n,r=o()){return w(r,C),function(t,e,n=0,r=e.length/3){let i=t[0],o=t[1],s=t[2],a=t[3],u=t[4],h=t[5];for(let t=0;t<r;t++)i=Math.min(i,e[n+3*t]),o=Math.min(o,e[n+3*t+1]),s=Math.min(s,e[n+3*t+2]),a=Math.max(a,e[n+3*t]),u=Math.max(u,e[n+3*t+1]),h=Math.max(h,e[n+3*t+2]);t[0]=i,t[1]=o,t[2]=s,t[3]=a,t[4]=u,t[5]=h}(r,t,e,n),r}(t,0,t.length/3,e)}function h(t,e=(0,i.jh)(24)){let[n,r,o,s,a,u]=t;return e[0]=n,e[1]=r,e[2]=o,e[3]=n,e[4]=r,e[5]=u,e[6]=n,e[7]=a,e[8]=o,e[9]=n,e[10]=a,e[11]=u,e[12]=s,e[13]=r,e[14]=o,e[15]=s,e[16]=r,e[17]=u,e[18]=s,e[19]=a,e[20]=o,e[21]=s,e[22]=a,e[23]=u,e}function c(t,e){return isFinite(t[2])||isFinite(t[5])?new r.A({xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}):new r.A({xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function l(t,e,n=t){n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.min(t[2],e[2]),n[3]=Math.max(t[3],e[3]),n[4]=Math.max(t[4],e[4]),n[5]=Math.max(t[5],e[5])}function f(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[3]=Math.max(t[3],e[2]),t[4]=Math.max(t[4],e[3])}function d(t,[e,n,r]){!function(t,e,n,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.min(t[2],r),t[3]=Math.max(t[3],e),t[4]=Math.max(t[4],n),t[5]=Math.max(t[5],r)}(t,e,n,r)}function m(t){return t[0]>=t[3]?0:t[3]-t[0]}function M(t){return t[1]>=t[4]?0:t[4]-t[1]}function b(t){return t[2]>=t[5]?0:t[5]-t[2]}function g(t){let e=m(t),n=b(t),r=M(t);return e*e+n*n+r*r}function _(t,e=[0,0,0]){return e[0]=t[0]+m(t)/2,e[1]=t[1]+M(t)/2,e[2]=t[2]+b(t)/2,e}function p(t,e=[0,0,0]){return e[0]=m(t),e[1]=M(t),e[2]=b(t),e}function v(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function x(t,e){return e[0]=t[3],e[1]=t[4],e[2]=t[5],e}function y(t,e,n=t){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n!==t&&(n[3]=t[3],n[4]=t[4],n[5]=t[5]),n}function S(t,e,n=t){return n[3]=e[0],n[4]=e[1],n[5]=e[2],n!==t&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),t}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function A(t){return t?w(t,C):o(C)}function j(t,e){return t[0]=e[0],t[1]=e[1],t[2]=-1/0,t[3]=e[2],t[4]=e[3],t[5]=1/0,t}function O(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=-1/0,t[3]=r,t[4]=i,t[5]=1/0,t}function T(t){return 6===t.length}function q(t,e,n){if(null==t||null==e)return t===e;if(!T(t)||!T(e))return!1;if(n){for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1}else for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const C=[1/0,1/0,1/0,-1/0,-1/0,-1/0],E=[0,0,0,0,0,0];o(),n.d(e,["qv",0,C,"v_",0,E])},19419(t,e,n){n.d(e,{$9:()=>S,C:()=>o,DC:()=>m,HY:()=>y,IO:()=>l,Ie:()=>A,Rj:()=>x,Uc:()=>v,VL:()=>M,VY:()=>a,Wc:()=>g,aI:()=>O,bx:()=>f,fA:()=>s,fT:()=>d,gR:()=>w,gX:()=>_,ib:()=>p,nw:()=>c,pJ:()=>T,tK:()=>h,uJ:()=>b,vt:()=>i,w1:()=>u}),n(34727);var r=n(5443);function i(t=C){return[t[0],t[1],t[2],t[3]]}function o(t,e){return t!==e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]),t}function s(t,e,n,r,o=i()){return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o}function a(t,e=i()){return e[0]=t.xmin,e[1]=t.ymin,e[2]=t.xmax,e[3]=t.ymax,e}function u(t,e,n=new r.A){return n.xmin=t[0],n.ymin=t[1],n.xmax=t[2],n.ymax=t[3],n.spatialReference=e,n}function h(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function c(t,e){e<t[0]&&(t[0]=e),e>t[2]&&(t[2]=e)}function l(t,e){e<t[1]&&(t[1]=e),e>t[3]&&(t[3]=e)}function f(t,{xmin:e,ymin:n,xmax:r,ymax:i}){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],r),t[3]=Math.max(t[3],i)}function d(t,e,n){if(null==e)o(n,t);else if("length"in e)j(e)?(n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.max(t[2],e[2]),n[3]=Math.max(t[3],e[3])):(2===e.length||3===e.length)&&(n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.max(t[2],e[0]),n[3]=Math.max(t[3],e[1]));else switch(e.type){case"extent":n[0]=Math.min(t[0],e.xmin),n[1]=Math.min(t[1],e.ymin),n[2]=Math.max(t[2],e.xmax),n[3]=Math.max(t[3],e.ymax);break;case"point":n[0]=Math.min(t[0],e.x),n[1]=Math.min(t[1],e.y),n[2]=Math.max(t[2],e.x),n[3]=Math.max(t[3],e.y)}}function m(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[2]),t[3]=Math.max(t[3],e[3])}function M(t){return null==t||t[0]>=t[2]?0:t[2]-t[0]}function b(t){return null==t||t[1]>=t[3]?0:t[3]-t[1]}function g(t){return M(t)*b(t)}function _(t,e=[0,0]){return e[0]=(t[0]+t[2])/2,e[1]=(t[1]+t[3])/2,e}function p(t){let e=M(t),n=b(t);return Math.sqrt(e*e+n*n)}function v(t,e){return x(t,e[0],e[1])}function x(t,e,n){return e>=t[0]&&n>=t[1]&&e<=t[2]&&n<=t[3]}function y(t,e){return Math.max(e[0],t[0])<=Math.min(e[2],t[2])&&Math.max(e[1],t[1])<=Math.min(e[3],t[3])}function S(t,e,n){return Math.max(e[0],t[0])-n<=Math.min(e[2],t[2])&&Math.max(e[1],t[1])-n<=Math.min(e[3],t[3])}function w(t,e){return e[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]}function A(t){return t?o(t,q):i(q)}function j(t){return null!=t&&4===t.length}function O(t,e){return j(t)&&j(e)?t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]:null==t&&null==e||t===e}function T(t,e){if(4!==e.length||t[0]===t[2]||t[1]===t[3])return!1;for(let n=0;n<e.length;n++){let r=e[n],i=e[(n+1)%e.length];if(r[0]!==t[0]&&r[0]!==t[2]||r[1]!==t[1]&&r[1]!==t[3])return!1;let o=r[1]===i[1]&&r[0]!==i[0],s=r[0]===i[0]&&r[1]!==i[1];if(!o&&!s)return!1}return!0}const q=[1/0,1/0,-1/0,-1/0],C=[0,0,0,0];n.d(e,["qv",0,q])},65720(t,e,n){n.d(e,{C:()=>g,vt:()=>M,Qy:()=>b,ui:()=>_,ST:()=>w,bU:()=>j,pw:()=>S,m7:()=>p,ZU:()=>v,GH:()=>y,Pi:()=>x,LJ:()=>A,c8:()=>q});var r=n(4341),i=n(58083),o=n(35522),s=n(51850),a=n(78955),u=n(91829),h=n(70328),c=n(71351);function l(t){return t?{ray:(0,c.vt)(t.ray),c0:t.c0,c1:t.c1}:{ray:(0,c.vt)(),c0:0,c1:Number.MAX_VALUE}}new r.I(()=>l());var f=n(27921);function d(t,e,n,r){let{t0:i,t1:o}=r,s=(0,f.mN)(t,e),a=(0,f.mN)(t,n);if(s>=0&&a>=0)return!1;if(s<0&&a>=0){let t=-s/(a-s);if(t<i)return!1;t<o&&(o=t)}else if(s>=0&&a<0){let t=s/(s-a);if(t>o)return!1;t>i&&(i=t)}return r.t0=i,r.t1=o,!0}var m=n(32114);function M(t){return t?[(0,f.vt)(t[0]),(0,f.vt)(t[1]),(0,f.vt)(t[2]),(0,f.vt)(t[3]),(0,f.vt)(t[4]),(0,f.vt)(t[5])]:[(0,f.vt)(),(0,f.vt)(),(0,f.vt)(),(0,f.vt)(),(0,f.vt)(),(0,f.vt)()]}function b(){return[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()]}function g(t,e){for(let n=0;n<C;n++)(0,f.C)(t[n],e[n]);return t}function _(t,e,n,r=I){let s=(0,i.lw)(m.Rc.get(),e,t);(0,i.B8)(s,s);for(let t=0;t<E;++t){let e=(0,a.Z0)(m.Km.get(),R[t],s);(0,o.hZ)(r[t],e[0]/e[3],e[1]/e[3],e[2]/e[3])}!function(t,e){(0,f.Cr)(e[4],e[0],e[3],t[0]),(0,f.Cr)(e[1],e[5],e[6],t[1]),(0,f.Cr)(e[4],e[5],e[1],t[2]),(0,f.Cr)(e[3],e[2],e[6],t[3]),(0,f.Cr)(e[0],e[1],e[2],t[4]),(0,f.Cr)(e[5],e[4],e[7],t[5])}(n,r)}function p(t,e){return v(t,e.center,e.radius)}function v(t,e,n){for(let r=0;r<C;r++){let i=t[r];if(i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]>=n)return!1}return!0}function x(t,e,n){for(let r of T)if((0,f.wE)(t[r],e,n))return!0;return!1}function y(t,e,n){let r=(0,h.gX)(e,z),i=(0,h.VL)(e)/2,s=(0,h.yr)(e)/2,a=(0,h.uJ)(e)/2;return n?function(t,e,n,r,i,s){let a=(0,o.Z0)(V,e,s);for(let e=0;e<C;e++){let o=t[e];if(o[0]*a[0]+o[1]*a[1]+o[2]*a[2]+o[3]-(Math.abs(o[0]*s[0]+o[1]*s[1]+o[2]*s[2])*n+Math.abs(o[0]*s[4]+o[1]*s[5]+o[2]*s[6])*r+Math.abs(o[0]*s[8]+o[1]*s[9]+o[2]*s[10])*i)>0)return!1}return!0}(t,r,i,s,a,n):function(t,e,n,r,i){for(let o=0;o<C;o++){let s=t[o];if(s[0]*e[0]+s[1]*e[1]+s[2]*e[2]+s[3]-(Math.abs(s[0])*n+Math.abs(s[1])*r+Math.abs(s[2])*i)>0)return!1}return!0}(t,r,i,s,a)}function S(t,e){return O(t,function(t,e=l()){return(0,c.C)(t,e.ray),e.c0=0,e.c1=Number.MAX_VALUE,e}(e,P.get()))}function w(t,e,n){return O(t,function(t,e,n=l()){let r=(0,o.Bw)(t.vector);return(0,c.fA)(t.origin,e,n.ray),n.c0=0,n.c1=r,n}(e,n,P.get()))}function A(t,e,n){return function(t,e,n,r){let i={t0:0,t1:1};for(let o of e)if(!d(t[o],n,r,i))return!1;return i.t0<i.t1}(t,T,e,n)}function j(t,e){for(let n=0;n<C;n++)if((0,f.mN)(t[n],e)>0)return!1;return!0}function O(t,e){for(let n=0;n<C;n++)if(!(0,f.$Q)(t[n],e))return!1;return!0}const T=[0,1,2,3,5],q={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},C=6,E=8,R=[(0,u.fA)(-1,-1,-1,1),(0,u.fA)(1,-1,-1,1),(0,u.fA)(1,1,-1,1),(0,u.fA)(-1,1,-1,1),(0,u.fA)(-1,-1,1,1),(0,u.fA)(1,-1,1,1),(0,u.fA)(1,1,1,1),(0,u.fA)(-1,1,1,1)],P=new r.I(l),I=b(),z=(0,s.vt)(),V=(0,s.vt)()},11964(t,e,n){n.d(e,{Cr:()=>c,H6:()=>d,LV:()=>h,_I:()=>f,kb:()=>l,vt:()=>u});var r=n(34727),i=n(4341),o=n(35522),s=n(51850),a=n(32114);function u(t){return t?{origin:(0,s.o8)(t.origin),vector:(0,s.o8)(t.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function h(t,e){let n=m.get();return n.origin=t,n.vector=e,n}function c(t,e,n=u()){return(0,o.C)(n.origin,t),(0,o.Re)(n.vector,e,t),n}function l(t,e){let n=(0,o.Re)(a.rq.get(),e,t.origin),i=(0,o.Om)(t.vector,n),s=(0,o.Om)(t.vector,t.vector);if(Math.abs(s)<M)return(0,o.hG)(t.origin,e);let u=(0,r.qE)(i/s,0,1),h=(0,o.Re)(a.rq.get(),(0,o.hs)(a.rq.get(),t.vector,u),n);return(0,o.Om)(h,h)}function f(t,e,n){return d(t,e,0,1,n)}function d(t,e,n,i,s){let{vector:u,origin:h}=t,c=(0,o.Re)(a.rq.get(),e,h),l=(0,o.Om)(u,c)/(0,o.m3)(u);return(0,o.hs)(s,u,(0,r.qE)(l,n,i)),(0,o.WQ)(s,s,t.origin)}(0,s.vt)(),(0,s.vt)();const m=new i.I(()=>u()),M=1e-9},27921(t,e,n){n.d(e,{$Q:()=>y,BX:()=>x,C:()=>h,Cr:()=>d,H:()=>w,LV:()=>u,O_:()=>f,Qj:()=>c,T7:()=>_,Ui:()=>g,_I:()=>A,fA:()=>l,gv:()=>p,mN:()=>j,mP:()=>M,mR:()=>b,vE:()=>q,vt:()=>a,wE:()=>O});var r=n(34727),i=n(35522),o=n(51850),s=(n(78955),n(44280),n(32114));function a(t=C){return[t[0],t[1],t[2],t[3]]}function u(t=C[0],e=C[1],n=C[2],r=C[3]){return l(t,e,n,r,s.Km.get())}function h(t,e){return l(e[0],e[1],e[2],e[3],t)}function c(t){return t}function l(t,e,n,r,i=a()){return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function f(t,e,n){let r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=Math.abs(r-1)>1e-5&&r>1e-12?1/Math.sqrt(r):1;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=-(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]),n}function d(t,e,n,r=a()){let i=n[0]-e[0],o=n[1]-e[1],s=n[2]-e[2],u=t[0]-e[0],h=t[1]-e[1],c=t[2]-e[2],l=o*c-s*h,f=s*u-i*c,d=i*h-o*u,m=l*l+f*f+d*d,M=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return r[0]=l*M,r[1]=f*M,r[2]=d*M,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}n(32728),(0,o.vt)(),(0,o.vt)();const m=(0,o.vt)();function M(t,e,n){return e!==t&&h(t,e),t[3]=-(0,i.Om)(t,n),t}function b(t,e,n,r){return(0,i.$A)(m,e,t),f(n,m,r)}function g(t,e,n){return null!=e&&T(q(t,e.origin,e.direction,E,n))}function _(t,e,n){return T(q(t,e.origin,e.vector,0,n))}function p(t,e,n){return T(q(t,e.origin,e.vector,1,n))}function v(t,e){return j(t,e)<=0}function x(t,e){return j(t,e)>=0}function y(t,e){return function(t,e,n,r,o,s,a,u){let h=(0,i.Om)(t,n),c=j(t,e);if(h>=-u&&h<=u)return S(c,o,s);let l=-c/h,f=S(h,o,!1);return!(a&&!f&&!S(c,o,s))&&(f?l>r.c0&&(r.c0=l):l<r.c1&&(r.c1=l),r.c0<=r.c1)}(t,e.ray.origin,e.ray.direction,e,!1,!1,!0,1e-6)}function S(t,e,n){return n?e?t>=0:t<=0:e?t>0:t<0}function w(t,e,n,r=!1){let o=e.at(-1),s=j(t,o),a=r?s>0:s<=0;for(let u=0;u<e.length;u++){let h=e.at(u),c=j(t,h),l=r?c>0:c<=0;a!==l&&(0,i.Cc)(n(),o,h,s/(s-c)),l&&(0,i.C)(n(),h),o=h,s=c,a=l}}function A(t,e,n){let r=(0,i.hs)(s.rq.get(),t,-t[3]),o=function(t,e,n){let r=(0,i.hs)(s.rq.get(),t,(0,i.Om)(t,e));return(0,i.Re)(n,e,r),n}(t,(0,i.Re)(s.rq.get(),e,r),s.rq.get());return(0,i.WQ)(n,o,r),n}function j(t,e){return(0,i.Om)(t,e)+t[3]}function O(t,e,n){for(let r=0;r<n;++r)if(v(t,e[r]))return!1;return!0}function T(t){return 0===t||1===t}function q(t,e,n,o,s){let a=(0,i.Om)(t,n),u=j(t,e);if(0===a)return u>=0?2:3;let h=-u/a;return 1&o&&(h=(0,r.qE)(h,0,1)),!(4&o)&&h<0||!(8&o)&&h>1?u>=0?2:3:((0,i.WQ)(s,e,(0,i.hs)(s,n,h)),u>=0?0:1)}(0,o.vt)(),(0,o.vt)();const C=[0,0,1,0],E=8;(0,o.vt)()},71351(t,e,n){n.d(e,{C:()=>l,Cr:()=>f,LV:()=>c,fA:()=>d,kb:()=>m,vt:()=>u});var r=n(4341),i=(n(77690),n(29242)),o=n(35522),s=n(51850),a=n(32114);function u(t){return t?h((0,s.o8)(t.origin),(0,s.o8)(t.direction)):h((0,s.vt)(),(0,s.vt)())}function h(t,e){return{origin:t,direction:e}}function c(t,e){let n=M.get();return n.origin=t,n.direction=e,n}function l(t,e=u()){return d(t.origin,t.direction,e)}function f(t,e,n=u()){return(0,o.C)(n.origin,t),(0,o.Re)(n.direction,e,t),n}function d(t,e,n=u()){return(0,o.C)(n.origin,t),(0,o.C)(n.direction,e),n}function m(t,e){let n=(0,o.$A)(a.rq.get(),(0,o.S8)(a.rq.get(),t.direction),(0,o.Re)(a.rq.get(),e,t.origin));return(0,o.Om)(n,n)}const M=new r.I(()=>u());(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,i.vt)()},94008(t,e,n){n.d(e,{iy:()=>d}),n(44208),n(53966);var r=n(34727),i=n(34304),o=n(58083),s=n(35522),a=n(51850),u=n(91829),h=n(34275);var c=n(71351),l=n(44280),f=n(32114);class d{constructor(t=0,e=0,n=0,r=0){this.radius=r,"number"==typeof t?this._center=(0,a.fA)(t,e,n):function(t){return e=t,(0,h.vZ)(e)&&e.length>=3||function(t){return((0,h.aI)(t)||Array.isArray(t))&&t.length>=3}(t);var e}(t)||function(t){return(e=t)instanceof Float32Array&&e.length>=4||function(t){return Array.isArray(t)&&t.length>=4}(t);var e}(t)?(this._center=(0,a.ci)(t),this.radius=4===t.length?t[3]:e):(this._center=(0,a.o8)(t.center),this.radius=t.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(t){(0,s.C)(this.center,t)}exactEquals(t){return(0,s.aI)(this._center,t.center)&&this.radius===t.radius}copyFrom(t){return t!==this&&((0,s.C)(this._center,t.center),this.radius=t.radius),this}clone(){return new d(this.center,this.radius)}toVec4(){return(0,u.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return(0,s.hG)(this.center,t)<=this.radius**2}intersects(t){let e=this.radius+t.radius;return(0,s.hG)(this.center,t.center)<=e*e}intersectRay(t,e){if(null==t||!this._intersect(t,m))return!1;let{t0:n,t1:r}=m;if((n<0||r<n&&r>0)&&(n=r),n<0)return!1;if(e){let{origin:r,direction:i}=t;e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e[2]=r[2]+i[2]*n}return!0}intersectLine(t,e){let n=(0,c.Cr)(t,e);if(!this._intersect(n,m))return[];let{origin:r,direction:o}=n,{t0:u,t1:h}=m,l=t=>{let e=(0,a.vt)();return(0,s.Ln)(e,r,o,t),this.projectPoint(e,e)};return Math.abs(u-h)<(0,i.FD)()?[l(u)]:[l(u),l(h)]}_intersect(t,e){let{origin:n,direction:r}=t,i=M;i[0]=n[0]-this.center[0],i[1]=n[1]-this.center[1],i[2]=n[2]-this.center[2];let o=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(0===o)return!1;let s=2*(r[0]*i[0]+r[1]*i[1]+r[2]*i[2]),a=s*s-4*o*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-this.radius**2);if(a<0)return!1;let u=Math.sqrt(a);return e.t0=(-s-u)/(2*o),e.t1=(-s+u)/(2*o),!0}projectPoint(t,e){let n=(0,s.Re)(f.rq.get(),t,this.center),r=(0,s.hs)(f.rq.get(),n,this.radius/(0,s.Bw)(n));return(0,s.WQ)(e,r,this.center)}closestPointOnSilhouette(t,e){let n=f.rq.get(),r=f.Rc.get();(0,s.$A)(n,t.origin,t.direction),(0,s.$A)(e,n,t.origin),(0,s.hs)(e,e,1/(0,s.Bw)(e)*this.radius);let i=this._angleToSilhouette(t.origin),a=(0,l.g7)(t.origin,e);return(0,o.$0)(r,a+i,n),(0,s.Z0)(e,e,r),e}frustumCoverage(t,e,n){let r=this.radius,i=r*r,o=t+.5*Math.PI,s=e*e+i-2*Math.cos(o)*e*r,a=Math.sqrt(s),u=s-i;if(u<=0)return.5;let h=Math.acos(Math.sqrt(u)/a)-Math.asin(r/(a/Math.sin(o)));return Math.min(1,(h+.5*n)/n)}_angleToSilhouette(t){let e=(0,s.Re)(f.rq.get(),t,this.center),n=(0,s.Bw)(e),i=this.radius,o=i+Math.abs(i-n);return(0,r.XM)(i/o)}union(t){let e=(0,s.Io)(this._center,t.center),n=this.radius,r=t.radius;return e+r<n?this:e+n<r?(this.copyFrom(t),this):((0,s.Cc)(this._center,this._center,t.center,(e+r-n)/(2*e)),this.radius=(e+n+r)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}signedDistanceToPlane(t){let{center:e,radius:n}=this,r=t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3];return r<0?Math.min(r+n,0):Math.max(r-n,0)}}new d;const m={t0:0,t1:0},M=(0,a.vt)();(0,a.vt)(),(0,a.vt)()},44280(t,e,n){n.d(e,{g7:()=>a,gr:()=>s});var r=n(34727),i=n(35522),o=n(51850);function s(t,e){return(0,i.Om)(t,e)/(0,i.Bw)(t)}function a(t,e){let n=(0,i.Om)(t,e)/((0,i.Bw)(t)*(0,i.Bw)(e));return-(0,r.XM)(n)}(0,o.vt)(),(0,o.vt)()},32114(t,e,n){n.d(e,{Rc:()=>d,rq:()=>l,Km:()=>f}),n(44208);var r=n(26390),i=n(29242),o=n(9093),s=n(82534),a=n(48163),u=n(51850),h=n(91829);class c{constructor(t){this._create=t,this._items=[],this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,r.d)(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){let t=2*this._itemsPtr;this._items.length>t&&(this._items.length=t),this._itemsPtr=0}static createVec2f64(){return new c(a.vt)}static createVec3f64(){return new c(u.vt)}static createVec4f64(){return new c(h.vt)}static createMat3f64(){return new c(i.vt)}static createMat4f64(){return new c(o.vt)}static createQuatf64(){return new c(s.vt)}get test(){}}c.createVec2f64();const l=c.createVec3f64(),f=c.createVec4f64(),d=(c.createMat3f64(),c.createMat4f64());c.createQuatf64()},32728(t,e,n){n.d(e,{YH:()=>s,nu:()=>a,wp:()=>o}),n(34727);var r=n(35522),i=n(51850);function o(t,e){let n=Math.sqrt(e[0]*e[0]+e[4]*e[4]+e[8]*e[8]),i=Math.sqrt(e[1]*e[1]+e[5]*e[5]+e[9]*e[9]),o=Math.sqrt(e[2]*e[2]+e[6]*e[6]+e[10]*e[10]);return(0,r.hZ)(t,n,i,o),t}function s(t,e,n){n||=t;let i=(0,r.Om)(t,e);(0,r.hZ)(n,t[0]-i*e[0],t[1]-i*e[1],t[2]-i*e[2]),(0,r.S8)(n,n)}function a(t,e,n,o=(0,i.vt)()){let s=(0,r.Bw)(t),a=(0,r.Bw)(e),c=(0,r.Om)(t,e)/(s*a);if(c<.9999999999999999){let i=Math.acos(c),l=((1-n)*s+n*a)/Math.sin(i),f=l/s*Math.sin((1-n)*i),d=l/a*Math.sin(n*i);return(0,r.hs)(u,t,f),(0,r.hs)(h,e,d),(0,r.WQ)(o,u,h)}return(0,r.Cc)(o,t,e,n)}(0,i.vt)(),(0,i.vt)(),(0,i.vt)();const u=(0,i.vt)(),h=(0,i.vt)()},70491(t,e,n){n.r(e),n.d(e,{default:()=>K});var r=n(32198),i=n(17676),o=n(24326),s=n(91429),a=n(35522),u=n(51850),h=n(11964),c=n(94008),l=n(93687),f=n(15142),d=n(65720),m=n(71351),M=n(620);class b{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new g,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),g.clearPool(),I[0]=null,N.prune(),W.prune()}add(t){let e=Array.from(t);this._grow(e);let n=g.acquire();for(let t of e)++this._objectCount,this._isDegenerate(t)?this._degenerateObjects.add(t):(n.init(this._root),this._add(t,n));g.release(n)}remove(t,e=null){this._objectCount-=t.length;let n=g.acquire();for(let r of t){let t=e??this.objectToBoundingSphere(r);C(t.radius)?(n.init(this._root),x(r,t,n)):this._degenerateObjects.delete(r)}g.release(n),this._shrink()}update(t,e){if(!C(e.radius)&&this._isDegenerate(t))return;let n=function(t){return I[0]=t,I}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){let r=(0,m.LV)(t,e);p(this._root,t=>{if(!function(t,e){return j(e.bounds.center,2*-e.halfSize,D),j(e.bounds.center,2*e.halfSize,F),(0,M.O_)(t.origin,t.direction,D,F)}(r,t))return!1;let e=t.node;return e.terminals.forAll(t=>{this._intersectsObject(r,t)&&n(t)}),null!==e.residents&&e.residents.forAll(t=>{this._intersectsObject(r,t)&&n(t)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,r){let i=(0,m.LV)(t,e);p(this._root,t=>{if(!function(t,e,n){return j(e.bounds.center,2*-e.halfSize,D),j(e.bounds.center,2*e.halfSize,F),n.applyToMinMax(D,F),(0,M.O_)(t.origin,t.direction,D,F)}(i,t,r))return!1;let e=t.node;return e.terminals.forAll(t=>{this._intersectsObjectWithOffset(i,t,r)&&n(t)}),null!==e.residents&&e.residents.forAll(t=>{this._intersectsObjectWithOffset(i,t,r)&&n(t)}),!0})}forEach(t){for(let e of this.values())t(e)}*values(){for(let t of this._nodeIteratorValues()){let e=t.node;yield*e.terminals,null!==e.residents&&(yield*e.residents)}yield*this.degenerateObjectValues()}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}*degenerateObjectValues(){yield*this._degenerateObjects.values()}findClosest(t,e,n,r=()=>!0,i=1/0){let o=1/0,s=1/0,u=null,h=T(t,e),c=a=>{if(--i,!r(a))return;let h=this.objectToBoundingSphere(a);if(!(0,d.m7)(n,h))return;let c=q(t,e,h.center),l=c-h.radius,f=c+h.radius;l<o&&(o=l,s=f,u=a)};return v(this._root,r=>{if(i<=0||!(0,d.ZU)(n,r.bounds.center,2*r.bounds.radius)||((0,a.hs)(V,h,2*r.halfSize),(0,a.WQ)(V,V,r.bounds.center),q(t,e,V)>s))return!1;let o=r.node;return o.terminals.forAll(t=>c(t)),null!==o.residents&&o.residents.forAll(t=>c(t)),!0},t,e),u}forEachInDepthRange(t,e,n,r,i,o,s){let u=-1/0,h=1/0,c={setRange:t=>{1===n?(u=Math.max(u,t.near),h=Math.min(h,t.far)):(u=Math.max(u,-t.far),h=Math.min(h,-t.near))}};c.setRange(r);let l=q(e,n,t),f=T(e,n),m=T(e,-n),M=t=>{if(!s(t))return;let r=this.objectToBoundingSphere(t),a=q(e,n,r.center)-l,f=a-r.radius,m=a+r.radius;f>h||m<u||!(0,d.m7)(o,r)||i(t,c)};v(this._root,t=>{if(!(0,d.ZU)(o,t.bounds.center,2*t.bounds.radius)||((0,a.hs)(V,f,2*t.halfSize),(0,a.WQ)(V,V,t.bounds.center),q(e,n,V)-l>h)||((0,a.hs)(V,m,2*t.halfSize),(0,a.WQ)(V,V,t.bounds.center),q(e,n,V)-l<u))return!1;let r=t.node;return r.terminals.forAll(t=>M(t)),null!==r.residents&&r.residents.forAll(t=>M(t)),!0},e,n)}forEachNode(t){p(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachIntersectingFrustum(t,e,n=()=>!0){for(let r of this.intersectingFrustumValues(t,n))e(r)}*intersectingFrustumValues(t,e=()=>!0){for(let n of this._nodeIteratorValues(e=>(0,d.ZU)(t,e.bounds.center,2*e.bounds.radius))){let r=n.node;for(let n of r.terminals)e(n)&&(0,d.m7)(t,this.objectToBoundingSphere(n))&&(yield n);if(null!==r.residents)for(let n of r.residents)e(n)&&(0,d.m7)(t,this.objectToBoundingSphere(n))&&(yield n)}}*_nodeIteratorValues(t=()=>!0){yield*_(this._root,t)}forEachNeighbor(t,e){let n=e.radius,r=e.center,i=n=>{let r=this.objectToBoundingSphere(n);return!e.intersects(r)||t(n)},o=!0,s=t=>{o&&=i(t)};p(this._root,t=>{let e=2*t.bounds.radius,i=n+e;if((0,a.hG)(t.bounds.center,r)-i*i>0)return!1;let u=t.node;return u.terminals.forAll(s),o&&null!==u.residents&&u.residents.forAll(s),o}),o&&this.forEachDegenerateObject(s)}_intersectsObject(t,e){let n=this.objectToBoundingSphere(e);return!(n.radius>0)||n.intersectRay(t)}_intersectsObjectWithOffset(t,e,n){let r=this.objectToBoundingSphere(e);return!(r.radius>0)||n.applyToBoundingSphere(r).intersectRay(t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){let e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){let r=g.acquire().init(t);this._add(e.at(n),r),g.release(r)}}_grow(t){if(O(t,t=>this.objectToBoundingSphere(t),B),C(B.radius)&&!this._fitsInsideTree(B))if(S(this._root.node))this._root.bounds.copyFrom(B),this._root.halfSize=1.25*this._root.bounds.radius,this._root.updateBoundsRadiusFromHalfSize();else{let t=this._rootBoundsForRootAsSubNode(B);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(B,t):this._growRootAsSubNode(t),g.release(t)}}_rebuildTree(t,e){L.center=e.bounds.center,L.radius=e.halfSize,O([t,L],t=>t,k);let n=g.acquire().init(this._root);this._root.initFrom(null,k,k.radius),this._root.increaseHalfSize(1.25),p(n,t=>(this.add(t.node.terminals.data),null!==t.node.residents&&this.add(t.node.residents.data),!0)),g.release(n)}_placingRootViolatesMaxDepth(t){let e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E,n=0;return p(this._root,t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){let e=t.radius,n=t.center,r=-1/0,i=this._root.bounds.center,o=this._root.halfSize;for(let t=0;t<3;t++){let s=i[t]-o-(n[t]-e),a=n[t]+e-(i[t]+o),u=Math.max(0,Math.ceil(s/(2*o))),h=Math.max(0,Math.ceil(a/(2*o)))+1,c=2**Math.ceil(Math.log(u+h)*Math.LOG2E);r=Math.max(r,c),Q[t].min=u,Q[t].max=h}for(let t=0;t<3;t++){let e=Q[t].min,n=Q[t].max,s=(r-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);let a=i[t]-o-e*o*2;z.center[t]=a+(n+e)*o}let s=r*o;return z.radius=s*P,g.acquire().initFrom(null,z,s,0)}_growRootAsSubNode(t){let e=this._root.node;B.center=this._root.bounds.center,B.radius=this._root.halfSize,this._root.init(t),t.advanceTo(B,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){let t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null,e=this._root.node.children,n=0,r=0;for(;r<e.length&&null==t;)n=r++,t=e[n];for(;r<e.length;)if(e[r++])return-1;return n}_isDegenerate(t){return!C(this.objectToBoundingSphere(t).radius)}_fitsInsideTree(t){let e=this._root.bounds,n=this._root.halfSize;return t.radius<=n&&t.center[0]>=e.center[0]-n&&t.center[0]<=e.center[0]+n&&t.center[1]>=e.center[1]-n&&t.center[1]<=e.center[1]+n&&t.center[2]>=e.center[2]-n&&t.center[2]<=e.center[2]+n}_nodeToJSON(t){return{children:t.children.map(t=>t?this._nodeToJSON(t):null),residents:t.residents?.map(t=>this.objectToBoundingSphere(t)),terminals:t.terminals?.map(t=>this.objectToBoundingSphere(t))}}}class g{constructor(){this.bounds=new c.iy,this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,r=this.depth){return this.node=t??g.createEmptyNode(),e&&this.bounds.copyFrom(e),this.halfSize=n,this.depth=r,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds.radius=this.halfSize*P}advance(t){let e=this.node.children[t];e||(e=g.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;let n=E[t];return this.bounds.center[0]+=n[0]*this.halfSize,this.bounds.center[1]+=n[1]*this.halfSize,this.bounds.center[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e?.(this,-1),!0;if(this.isLeaf()){if(!n)return e?.(this,-1),!1;this.node.residents=null}let r=this._childIndex(t);e?.(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t.radius>this.halfSize/2}_childIndex(t){let e=this.bounds.center;return+(e[0]<t.center[0])+(e[1]<t.center[1]?2:0)+(e[2]<t.center[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new f.A({shrink:!0}),residents:new f.A({shrink:!0})}}static{this._pool=new l.A(()=>new g)}static acquire(){return g._pool.acquire()}static release(t){g._pool.release(t)}static clearPool(){g._pool.prune()}}function*_(t,e=()=>!0){let n=[g.acquire().init(t)];for(;0!==n.length;){let t=n.pop();if(e(t)){if(yield t,!t.isLeaf())for(let e=0;e<t.node.children.length;e++)t.node.children[e]&&n.push(g.acquire().init(t).advance(e));g.release(t)}}}function p(t,e){let n=_(t,e);for(let t of n);}function v(t,e,n,r=1){let i=g.acquire().init(t),o=[i];for(function(t,e,n){if(!W.length)for(let t=0;t<8;++t)W.push({index:0,distance:0});for(let n=0;n<8;++n){let r=E[n];W.data[n].index=n,W.data[n].distance=q(t,e,r)}W.sort((t,e)=>t.distance-e.distance);for(let t=0;t<8;++t)n[t]=W.data[t].index}(n,r,Z);0!==o.length;){if(i=o.pop(),e(i)&&!i.isLeaf())for(let t=7;t>=0;--t){let e=Z[t];i.node.children[e]&&o.push(g.acquire().init(i).advance(e))}g.release(i)}}function x(t,e,n){N.clear();let r=n.advanceTo(e,(t,e)=>{N.push(t.node),N.push(e)})?n.node.terminals:n.node.residents;if(r.removeUnordered(t),0===r.length)for(let t=N.length-2;t>=0&&y(N.data[t],N.data[t+1]);t-=2);}function y(t,e){return e>=0&&(t.children[e]=null),!!S(t)&&(null===t.residents&&(t.residents=new f.A({shrink:!0})),!0)}function S(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}function w(t,e){t[0]=Math.min(t[0],e.center[0]-e.radius),t[1]=Math.min(t[1],e.center[1]-e.radius),t[2]=Math.min(t[2],e.center[2]-e.radius)}function A(t,e){t[0]=Math.max(t[0],e.center[0]+e.radius),t[1]=Math.max(t[1],e.center[1]+e.radius),t[2]=Math.max(t[2],e.center[2]+e.radius)}function j(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function O(t,e,n){D[0]=1/0,D[1]=1/0,D[2]=1/0,F[0]=-1/0,F[1]=-1/0,F[2]=-1/0;for(let n of t){let t=e(n);C(t.radius)&&(w(D,t),A(F,t))}(0,a.Cc)(n.center,D,F,.5),n.radius=Math.max(F[0]-D[0],F[1]-D[1],F[2]-D[2])/2}function T(t,e){let n,r=1/0;for(let i=0;i<8;++i){let o=q(t,e,R[i]);o<r&&(r=o,n=R[i])}return n}function q(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function C(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}const E=[(0,u.fA)(-1,-1,-1),(0,u.fA)(1,-1,-1),(0,u.fA)(-1,1,-1),(0,u.fA)(1,1,-1),(0,u.fA)(-1,-1,1),(0,u.fA)(1,-1,1),(0,u.fA)(-1,1,1),(0,u.fA)(1,1,1)],R=[(0,u.fA)(-1,-1,-1),(0,u.fA)(-1,-1,1),(0,u.fA)(-1,1,-1),(0,u.fA)(-1,1,1),(0,u.fA)(1,-1,-1),(0,u.fA)(1,-1,1),(0,u.fA)(1,1,-1),(0,u.fA)(1,1,1)],P=Math.sqrt(3),I=[null],z=new c.iy,V=(0,u.vt)(),D=(0,u.vt)(),F=(0,u.vt)(),N=new f.A,B=new c.iy,L=new c.iy,k=new c.iy,Q=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],W=new f.A,Z=[0,0,0,0,0,0,0,0];var H=n(44801);function $(t,e,n){let r=new c.iy;return(0,a.hs)(r.center,t,.5),(0,a.Ln)(r.center,r.center,e,.5),r.radius=(0,a.Io)(r.center,t),(0,a.WQ)(r.center,r.center,n),r}class X{constructor(t,e,n){this.objectId=t,this.target=e,this.distance=n}}class J extends X{constructor(t,e,n){super(t,e,n),this.type="vertex"}}class U extends X{constructor(t,e,n,r,i){super(t,e,n),this.start=r,this.end=i,this.type="edge"}}let Y=class{constructor(){this._idToComponent=new Map,this._components=new b(t=>t.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=(0,h.vt)(),this._tmpP1=(0,u.vt)(),this._tmpP2=(0,u.vt)(),this._tmpP3=(0,u.vt)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,i.Te)(e);let n=t;n.mbs=new c.iy(t.mbsJSON),await this._ensureEdgeLocations(n,e);let r=[];return this._edges.forEachNeighbor(t=>(this._addCandidates(n,t,r),r.length<1e3),n.mbs),{result:{candidates:r}}}async _ensureEdgeLocations(t,e){let n=[];if(this._components.forEachNeighbor(t=>{if(null==t.info){let{id:e,uid:r}=t;n.push({id:e,uid:r})}return!0},t.mbs),!n.length)return;let r={components:n},i=await this.remoteClient.invoke("fetchAllEdgeLocations",r,e??{});for(let t of i.components)this._setFetchEdgeLocations(t)}async add(t){let e=new tt(t.id,new c.iy(t.bounds));return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){let e=this._idToComponent.get(t.id);if(e){let t=[];this._edges.forEachNeighbor(n=>(n.component===e&&t.push(n),!0),e.bounds),this._edges.remove(t),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){let e=this._idToComponent.get(t.id);if(null==e||t.uid!==e.uid)return;let n=H.HY.createView(t.locations),r=Array(n.count),i=(0,u.vt)(),o=(0,u.vt)();for(let s=0;s<n.count;s++){n.position0.getVec(s,i),n.position1.getVec(s,o);let a=$(i,o,t.origin),u=new et(e,s,a);r[s]=u}this._edges.add(r);let{objectIds:s,origin:a}=t;e.info={locations:n,objectIds:s,origin:a}}_addCandidates(t,e,n){let{info:r}=e.component,{origin:i,objectIds:o}=r,s=r.locations,u=s.position0.getVec(e.index,this._tmpP1),h=s.position1.getVec(e.index,this._tmpP2);(0,a.WQ)(u,u,i),(0,a.WQ)(h,h,i);let c=o[s.componentIndex.get(e.index)];this._addEdgeCandidate(t,c,u,h,n),G(t,c,u,n),G(t,c,h,n)}_addEdgeCandidate(t,e,n,r,i){if(!t.returnEdge)return;let o=t.mbs.center,s=(0,h.Cr)(n,r,this._tmpLineSegment),c=(0,h._I)(s,o,this._tmpP3);t.mbs.contains(c)&&i.push(new U(e,(0,u.o8)(c),(0,a.Io)(o,c),(0,u.o8)(n),(0,u.o8)(r)))}};Y=(0,r.Cg)([(0,s.$K)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],Y);const K=Y;function G(t,e,n,r){t.returnVertex&&t.mbs.contains(n)&&r.push(new J(e,(0,u.o8)(n),(0,a.Io)(t.mbs.center,n)))}class tt{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=(0,o.c)()}}class et{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7005],{82534(t,e,n){function r(){return[0,0,0,1]}function a(t){return[t[0],t[1],t[2],t[3]]}n.d(e,{o8:()=>a,vt:()=>r});const i=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:a,create:r,fromValues:function(t,e,n,r){return[t,e,n,r]}},Symbol.toStringTag,{value:"Module"})),n.d(e,["zK",0,i])},67026(t,e,n){n.d(e,{A6:()=>M,Xd:()=>l,Xr:()=>d,lw:()=>c,x8:()=>u});var r=n(29242),a=n(82534),i=n(51850),s=n(34304),h=n(35522),o=n(78955);function u(t,e,n){n*=.5;let r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function l(t,e){let n=2*Math.acos(e[3]),r=Math.sin(n/2);return r>(0,s.FD)()?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function c(t,e,n){let r=e[0],a=e[1],i=e[2],s=e[3],h=n[0],o=n[1],u=n[2],l=n[3];return t[0]=r*l+s*h+a*u-i*o,t[1]=a*l+s*o+i*h-r*u,t[2]=i*l+s*u+r*o-a*h,t[3]=s*l-r*h-a*o-i*u,t}function f(t,e,n,r){let a,i,h,o,u,l=e[0],c=e[1],f=e[2],d=e[3],m=n[0],M=n[1],g=n[2],v=n[3];return i=l*m+c*M+f*g+d*v,i<0&&(i=-i,m=-m,M=-M,g=-g,v=-v),1-i>(0,s.FD)()?(a=Math.acos(i),h=Math.sin(a),o=Math.sin((1-r)*a)/h,u=Math.sin(r*a)/h):(o=1-r,u=r),t[0]=o*l+u*m,t[1]=o*c+u*M,t[2]=o*f+u*g,t[3]=o*d+u*v,t}function d(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function m(t,e){let n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);let a=(r+1)%3,i=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*a+a]-e[3*i+i]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*a+i]-e[3*i+a])*n,t[a]=(e[3*a+r]+e[3*r+a])*n,t[i]=(e[3*i+r]+e[3*r+i])*n}return t}function M(t,e,n,r){let a=.5*Math.PI/180;e*=a,n*=a,r*=a;let i=Math.sin(e),s=Math.cos(e),h=Math.sin(n),o=Math.cos(n),u=Math.sin(r),l=Math.cos(r);return t[0]=i*o*l-s*h*u,t[1]=s*h*l+i*o*u,t[2]=s*o*u-i*h*l,t[3]=s*o*l+i*h*u,t}const g=o.C,v=o.hZ,_=o.WQ,b=c,P=o.hs,j=o.Om,p=o.Cc,x=o.Bw,w=x,C=o.m3,A=C,z=o.S8,S=o.t2,q=o.aI,Q=(0,i.vt)(),y=(0,i.fA)(1,0,0),O=(0,i.fA)(0,1,0),V=(0,a.vt)(),R=(0,a.vt)(),H=(0,r.vt)();Object.freeze(Object.defineProperty({__proto__:null,add:_,calculateW:function(t,e){let n=e[0],r=e[1],a=e[2];return t[0]=n,t[1]=r,t[2]=a,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-a*a)),t},conjugate:d,copy:g,dot:j,equals:q,exactEquals:S,fromEuler:M,fromMat3:m,getAxisAngle:l,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},invert:function(t,e){let n=e[0],r=e[1],a=e[2],i=e[3],s=n*n+r*r+a*a+i*i,h=s?1/s:0;return t[0]=-n*h,t[1]=-r*h,t[2]=-a*h,t[3]=i*h,t},len:w,length:x,lerp:p,mul:b,multiply:c,normalize:z,random:function(t){let e=s.Ov,n=e(),r=e(),a=e(),i=Math.sqrt(1-n),h=Math.sqrt(n);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=h*Math.sin(2*Math.PI*a),t[3]=h*Math.cos(2*Math.PI*a),t},rotateX:function(t,e,n){n*=.5;let r=e[0],a=e[1],i=e[2],s=e[3],h=Math.sin(n),o=Math.cos(n);return t[0]=r*o+s*h,t[1]=a*o+i*h,t[2]=i*o-a*h,t[3]=s*o-r*h,t},rotateY:function(t,e,n){n*=.5;let r=e[0],a=e[1],i=e[2],s=e[3],h=Math.sin(n),o=Math.cos(n);return t[0]=r*o-i*h,t[1]=a*o+s*h,t[2]=i*o+r*h,t[3]=s*o-a*h,t},rotateZ:function(t,e,n){n*=.5;let r=e[0],a=e[1],i=e[2],s=e[3],h=Math.sin(n),o=Math.cos(n);return t[0]=r*o+a*h,t[1]=a*o-r*h,t[2]=i*o+s*h,t[3]=s*o-i*h,t},rotationTo:function(t,e,n){let r=(0,h.Om)(e,n);return r<-.999999?((0,h.$A)(Q,y,e),(0,h.Il)(Q)<1e-6&&(0,h.$A)(Q,O,e),(0,h.S8)(Q,Q),u(t,Q,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):((0,h.$A)(Q,e,n),t[0]=Q[0],t[1]=Q[1],t[2]=Q[2],t[3]=1+r,z(t,t))},scale:P,set:v,setAxes:function(t,e,n,r){let a=H;return a[0]=n[0],a[3]=n[1],a[6]=n[2],a[1]=r[0],a[4]=r[1],a[7]=r[2],a[2]=-e[0],a[5]=-e[1],a[8]=-e[2],z(t,m(t,a))},setAxisAngle:u,slerp:f,sqlerp:function(t,e,n,r,a,i){return f(V,e,a,i),f(R,n,r,i),f(t,V,R,2*i*(1-i)),t},sqrLen:A,squaredLength:C,str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}},Symbol.toStringTag,{value:"Module"})),n.d(e,["hZ",0,v,"t2",0,S])},48353(t,e,n){n.d(e,{l:()=>u});var r=n(34727),a=n(58083),i=n(51850);function s(t,e,n){let r=Math.sin(t),a=Math.cos(t),i=Math.sin(e),s=Math.cos(e),h=n;return h[0]=-r,h[4]=-i*a,h[8]=s*a,h[12]=0,h[1]=a,h[5]=-i*r,h[9]=s*r,h[13]=0,h[2]=0,h[6]=s,h[10]=i,h[14]=0,h[3]=0,h[7]=0,h[11]=0,h[15]=1,h}var h=n(37539),o=n(21325);function u(t,e,n,r){let i=(0,h.Tp)(t,r);if(null==i)return!1;let u=i.source.spatialReferenceId,m=i.dest.spatialReferenceId;if(u===m&&!l(m)&&(0!==u||(0,o.aI)(t,r)))return(0,a.kN)(n,e),!0;if(l(m)){let t=h.w5[u][10],r=h.w5[10][m];return null!=t&&null!=r&&(t(e,0,f,0),r(f,0,d,0),s(c*f[0],c*f[1],n),n[12]=d[0],n[13]=d[1],n[14]=d[2],!0)}let M=l(u);if((3===m||11===m||2===m||5===m)&&(2===u||M||3===u||5===u)){let t=h.w5[u][10],r=h.w5[10][m];return null!=t&&null!=r&&(t(e,0,f,0),r(f,0,d,0),M?function(t,e,n){s(t,e,n),(0,a.mg)(n,n)}(c*f[0],c*f[1],n):(0,a.D_)(n),n[12]=d[0],n[13]=d[1],n[14]=d[2],!0)}return!1}function l(t){return 1===t||6===t||8===t||4===t}const c=(0,r.kU)(1),f=(0,i.vt)(),d=(0,i.vt)()},27921(t,e,n){n.d(e,{$Q:()=>p,BX:()=>j,C:()=>u,Cr:()=>d,H:()=>w,LV:()=>o,O_:()=>f,Qj:()=>l,T7:()=>_,Ui:()=>v,_I:()=>C,fA:()=>c,gv:()=>b,mN:()=>A,mP:()=>M,mR:()=>g,vE:()=>q,vt:()=>h,wE:()=>z});var r=n(34727),a=n(35522),i=n(51850),s=(n(78955),n(44280),n(32114));function h(t=Q){return[t[0],t[1],t[2],t[3]]}function o(t=Q[0],e=Q[1],n=Q[2],r=Q[3]){return c(t,e,n,r,s.Km.get())}function u(t,e){return c(e[0],e[1],e[2],e[3],t)}function l(t){return t}function c(t,e,n,r,a=h()){return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a}function f(t,e,n){let r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],a=Math.abs(r-1)>1e-5&&r>1e-12?1/Math.sqrt(r):1;return n[0]=e[0]*a,n[1]=e[1]*a,n[2]=e[2]*a,n[3]=-(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]),n}function d(t,e,n,r=h()){let a=n[0]-e[0],i=n[1]-e[1],s=n[2]-e[2],o=t[0]-e[0],u=t[1]-e[1],l=t[2]-e[2],c=i*l-s*u,f=s*o-a*l,d=a*u-i*o,m=c*c+f*f+d*d,M=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return r[0]=c*M,r[1]=f*M,r[2]=d*M,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}n(32728),(0,i.vt)(),(0,i.vt)();const m=(0,i.vt)();function M(t,e,n){return e!==t&&u(t,e),t[3]=-(0,a.Om)(t,n),t}function g(t,e,n,r){return(0,a.$A)(m,e,t),f(n,m,r)}function v(t,e,n){return null!=e&&S(q(t,e.origin,e.direction,y,n))}function _(t,e,n){return S(q(t,e.origin,e.vector,0,n))}function b(t,e,n){return S(q(t,e.origin,e.vector,1,n))}function P(t,e){return A(t,e)<=0}function j(t,e){return A(t,e)>=0}function p(t,e){return function(t,e,n,r,i,s,h,o){let u=(0,a.Om)(t,n),l=A(t,e);if(u>=-o&&u<=o)return x(l,i,s);let c=-l/u,f=x(u,i,!1);return!(h&&!f&&!x(l,i,s))&&(f?c>r.c0&&(r.c0=c):c<r.c1&&(r.c1=c),r.c0<=r.c1)}(t,e.ray.origin,e.ray.direction,e,!1,!1,!0,1e-6)}function x(t,e,n){return n?e?t>=0:t<=0:e?t>0:t<0}function w(t,e,n,r=!1){let i=e.at(-1),s=A(t,i),h=r?s>0:s<=0;for(let o=0;o<e.length;o++){let u=e.at(o),l=A(t,u),c=r?l>0:l<=0;h!==c&&(0,a.Cc)(n(),i,u,s/(s-l)),c&&(0,a.C)(n(),u),i=u,s=l,h=c}}function C(t,e,n){let r=(0,a.hs)(s.rq.get(),t,-t[3]),i=function(t,e,n){let r=(0,a.hs)(s.rq.get(),t,(0,a.Om)(t,e));return(0,a.Re)(n,e,r),n}(t,(0,a.Re)(s.rq.get(),e,r),s.rq.get());return(0,a.WQ)(n,i,r),n}function A(t,e){return(0,a.Om)(t,e)+t[3]}function z(t,e,n){for(let r=0;r<n;++r)if(P(t,e[r]))return!1;return!0}function S(t){return 0===t||1===t}function q(t,e,n,i,s){let h=(0,a.Om)(t,n),o=A(t,e);if(0===h)return o>=0?2:3;let u=-o/h;return 1&i&&(u=(0,r.qE)(u,0,1)),!(4&i)&&u<0||!(8&i)&&u>1?o>=0?2:3:((0,a.WQ)(s,e,(0,a.hs)(s,n,u)),o>=0?0:1)}(0,i.vt)(),(0,i.vt)();const Q=[0,0,1,0],y=8;(0,i.vt)()},44280(t,e,n){n.d(e,{g7:()=>h,gr:()=>s});var r=n(34727),a=n(35522),i=n(51850);function s(t,e){return(0,a.Om)(t,e)/(0,a.Bw)(t)}function h(t,e){let n=(0,a.Om)(t,e)/((0,a.Bw)(t)*(0,a.Bw)(e));return-(0,r.XM)(n)}(0,i.vt)(),(0,i.vt)()},32114(t,e,n){n.d(e,{Rc:()=>d,rq:()=>c,Km:()=>f}),n(44208);var r=n(26390),a=n(29242),i=n(9093),s=n(82534),h=n(48163),o=n(51850),u=n(91829);class l{constructor(t){this._create=t,this._items=[],this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,r.d)(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){let t=2*this._itemsPtr;this._items.length>t&&(this._items.length=t),this._itemsPtr=0}static createVec2f64(){return new l(h.vt)}static createVec3f64(){return new l(o.vt)}static createVec4f64(){return new l(u.vt)}static createMat3f64(){return new l(a.vt)}static createMat4f64(){return new l(i.vt)}static createQuatf64(){return new l(s.vt)}get test(){}}l.createVec2f64();const c=l.createVec3f64(),f=l.createVec4f64(),d=(l.createMat3f64(),l.createMat4f64());l.createQuatf64()},32728(t,e,n){n.d(e,{YH:()=>s,nu:()=>h,wp:()=>i}),n(34727);var r=n(35522),a=n(51850);function i(t,e){let n=Math.sqrt(e[0]*e[0]+e[4]*e[4]+e[8]*e[8]),a=Math.sqrt(e[1]*e[1]+e[5]*e[5]+e[9]*e[9]),i=Math.sqrt(e[2]*e[2]+e[6]*e[6]+e[10]*e[10]);return(0,r.hZ)(t,n,a,i),t}function s(t,e,n){n||=t;let a=(0,r.Om)(t,e);(0,r.hZ)(n,t[0]-a*e[0],t[1]-a*e[1],t[2]-a*e[2]),(0,r.S8)(n,n)}function h(t,e,n,i=(0,a.vt)()){let s=(0,r.Bw)(t),h=(0,r.Bw)(e),l=(0,r.Om)(t,e)/(s*h);if(l<.9999999999999999){let a=Math.acos(l),c=((1-n)*s+n*h)/Math.sin(a),f=c/s*Math.sin((1-n)*a),d=c/h*Math.sin(n*a);return(0,r.hs)(o,t,f),(0,r.hs)(u,e,d),(0,r.WQ)(i,o,u)}return(0,r.Cc)(i,t,e,n)}(0,a.vt)(),(0,a.vt)(),(0,a.vt)();const o=(0,a.vt)(),u=(0,a.vt)()},57005(t,e,n){n.d(e,{ab:()=>_t,gm:()=>zt});var r=n(77690),a=n(29242),i=n(9093),s=n(67026),h=n(82534),o=n(35522),u=n(51850),l=n(78955),c=n(91829),f=n(73941),d=n(98764),m=n(48353),M=n(9762),g=n(37539),v=n(27921),_=n(21325),b=n(48163),P=n(46610);const j=1e-6,p=(0,u.vt)(),x=(0,u.vt)();function w(t,e,n,r,a,i,s,h,o,u){return function(t,e,n){let r=gt(t.maxVert[0],t.minVert[0]),a=0;for(let e=1;e<7;++e){let n=gt(t.maxVert[e],t.minVert[e]);n>r&&(r=n,a=e)}ft(e,t.minVert[a]),ft(n,t.maxVert[a])}(t,r,a),gt(r,a)<j?1:(lt(s,r,a),mt(s,s),function(t,e,n,r){let{data:a,size:i}=t,s=-1/0,h=0;for(let t=0;t<a.length;t+=i){R[0]=a[t]-e[0],R[1]=a[t+1]-e[1],R[2]=a[t+2]-e[2];let r=n[0]*R[0]+n[1]*R[1]+n[2]*R[2],i=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],o=R[0]*R[0]+R[1]*R[1]+R[2]*R[2]-r*r/i;o>s&&(s=o,h=t)}return ft(r,a,h),s}(e,r,s,i)<j?2:(lt(h,a,i),mt(h,h),lt(o,i,r),mt(o,o),dt(n,h,s),mt(n,n),W(e,n,s,h,o,u),0))}const C=(0,u.vt)(),A=(0,u.vt)(),z=(0,u.vt)(),S=(0,u.vt)(),q=(0,u.vt)(),Q=(0,u.vt)(),y=(0,u.vt)(),O=(0,u.vt)();function V(t,e,n,r,a,i,s,h,o){(function(t,e,n,r,a){!function(t,e,n,r,a){let{data:i,size:s}=t;ft(r,i),ft(a,r),n[0]=vt(X,e),n[1]=n[0];for(let t=s;t<i.length;t+=s){let s=i[t]*e[0]+i[t+1]*e[1]+i[t+2]*e[2];s<n[0]&&(n[0]=s,ft(r,i,t)),s>n[1]&&(n[1]=s,ft(a,i,t))}}(t,e,H,a,r);let i=vt(n,e);H[1]-j<=i&&(r[0]=void 0),H[0]+j>=i&&(a[0]=void 0)})(t,e,n,C,A),void 0!==C[0]&&(lt(z,C,n),mt(z,z),lt(S,C,r),mt(S,S),lt(q,C,a),mt(q,q),dt(Q,S,i),mt(Q,Q),dt(y,q,s),mt(y,y),dt(O,z,h),mt(O,O),W(t,Q,i,S,z,o),W(t,y,s,q,S,o),W(t,O,h,z,q,o)),void 0!==A[0]&&(lt(z,A,n),mt(z,z),lt(S,A,r),mt(S,S),lt(q,A,a),mt(q,q),dt(Q,S,i),mt(Q,Q),dt(y,q,s),mt(y,y),dt(O,z,h),mt(O,O),W(t,Q,i,S,z,o),W(t,y,s,q,S,o),W(t,O,h,z,q,o))}const R=[0,0,0],H=(0,b.vt)(),I=(0,u.vt)(),L=(0,u.vt)(),B=(0,u.vt)(),D=(0,u.vt)(),F=(0,u.vt)(),Z=(0,u.vt)();function W(t,e,n,r,a,i){if(Mt(e)<j)return;dt(I,n,e),dt(L,r,e),dt(B,a,e),k(t,e,H),F[1]=H[0],D[1]=H[1],Z[1]=D[1]-F[1];let s=[n,r,a],h=[I,L,B];for(let n=0;n<3;++n){k(t,s[n],H),F[0]=H[0],D[0]=H[1],k(t,h[n],H),F[2]=H[0],D[2]=H[1],Z[0]=D[0]-F[0],Z[2]=D[2]-F[2];let r=ot(Z);r<i.quality&&(ft(i.b0,s[n]),ft(i.b1,e),ft(i.b2,h[n]),i.quality=r)}}const X=(0,u.vt)();function k(t,e,n){let{data:r,size:a}=t,i=1/0,s=-1/0,h=e[0],o=e[1],u=e[2];for(let t=0;t<r.length;t+=a){let e=r[t]*h+r[t+1]*o+r[t+2]*u;i=Math.min(i,e),s=Math.max(s,e)}n[0]=i,n[1]=s}function K(t,e,n){n.setCenter(t),n.setHalfSize((0,o.hs)(e,e,.5)),n.setQuaternion(h.zK)}const T=(0,u.vt)(),Y=(0,u.vt)(),E=(0,u.vt)(),$=(0,u.vt)(),N=(0,u.vt)(),G=(0,u.vt)();function U(t,e,n){ft(T,e),Math.abs(e[0])>Math.abs(e[1])&&Math.abs(e[0])>Math.abs(e[2])?T[0]=0:Math.abs(e[1])>Math.abs(e[2])?T[1]=0:T[2]=0,Mt(T)<j&&(T[0]=T[1]=T[2]=1),dt(Y,e,T),mt(Y,Y),dt(E,e,Y),mt(E,E),J(t,e,Y,E,$,N),lt(G,N,$),it(e,Y,E,$,N,G,n)}function J(t,e,n,r,a,i){k(t,e,H),a[0]=H[0],i[0]=H[1],k(t,n,H),a[1]=H[0],i[1]=H[1],k(t,r,H),a[2]=H[0],i[2]=H[1]}const tt=(0,u.vt)(),et=(0,u.vt)(),nt=(0,u.vt)(),rt=(0,a.fA)(1,0,0,0,1,0,0,0,1),at=(0,h.vt)();function it(t,e,n,r,a,i,s){rt[0]=t[0],rt[1]=t[1],rt[2]=t[2],rt[3]=e[0],rt[4]=e[1],rt[5]=e[2],rt[6]=n[0],rt[7]=n[1],rt[8]=n[2],s.setQuaternion(function(t,e){let n=e[0]+e[4]+e[8];if(n>0){let r=Math.sqrt(n+1);t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r}else{let n=0;e[4]>e[0]&&(n=1),e[8]>e[3*n+n]&&(n=2);let r=(n+1)%3,a=(n+2)%3,i=Math.sqrt(e[3*n+n]-e[3*r+r]-e[3*a+a]+1);t[n]=.5*i,i=.5/i,t[3]=(e[3*r+a]-e[3*a+r])*i,t[r]=(e[3*r+n]+e[3*n+r])*i,t[a]=(e[3*a+n]+e[3*n+a])*i}return t}(at,rt)),ut(tt,r,a),ct(tt,tt,.5),ct(et,t,tt[0]),ct(nt,e,tt[1]),ut(et,et,nt),ct(nt,n,tt[2]),s.setCenter((0,o.WQ)(et,et,nt)),s.setHalfSize((0,o.hs)(tt,i,.5))}class st{constructor(t){this.minVert=Array(7),this.maxVert=Array(7),this.buffer=new ArrayBuffer(448);let e=0;this.minProj=new Float64Array(this.buffer,e,7),e+=56,this.maxProj=new Float64Array(this.buffer,e,7),e+=56;for(let t=0;t<7;++t)this.minVert[t]=new Float64Array(this.buffer,e,3),e+=24;for(let t=0;t<7;++t)this.maxVert[t]=new Float64Array(this.buffer,e,3),e+=24;for(let t=0;t<7;++t)this.minProj[t]=1/0,this.maxProj[t]=-1/0;let n=Array(7),r=Array(7),{data:a,size:i}=t;for(let t=0;t<a.length;t+=i){let e=a[t];e<this.minProj[0]&&(this.minProj[0]=e,n[0]=t),e>this.maxProj[0]&&(this.maxProj[0]=e,r[0]=t),e=a[t+1],e<this.minProj[1]&&(this.minProj[1]=e,n[1]=t),e>this.maxProj[1]&&(this.maxProj[1]=e,r[1]=t),e=a[t+2],e<this.minProj[2]&&(this.minProj[2]=e,n[2]=t),e>this.maxProj[2]&&(this.maxProj[2]=e,r[2]=t),e=a[t]+a[t+1]+a[t+2],e<this.minProj[3]&&(this.minProj[3]=e,n[3]=t),e>this.maxProj[3]&&(this.maxProj[3]=e,r[3]=t),e=a[t]+a[t+1]-a[t+2],e<this.minProj[4]&&(this.minProj[4]=e,n[4]=t),e>this.maxProj[4]&&(this.maxProj[4]=e,r[4]=t),e=a[t]-a[t+1]+a[t+2],e<this.minProj[5]&&(this.minProj[5]=e,n[5]=t),e>this.maxProj[5]&&(this.maxProj[5]=e,r[5]=t),e=a[t]-a[t+1]-a[t+2],e<this.minProj[6]&&(this.minProj[6]=e,n[6]=t),e>this.maxProj[6]&&(this.maxProj[6]=e,r[6]=t)}for(let t=0;t<7;++t){let e=n[t];ft(this.minVert[t],a,e),e=r[t],ft(this.maxVert[t],a,e)}}}class ht{constructor(){this.b0=(0,u.fA)(1,0,0),this.b1=(0,u.fA)(0,1,0),this.b2=(0,u.fA)(0,0,1),this.quality=0}}function ot(t){return t[0]*t[1]+t[0]*t[2]+t[1]*t[2]}function ut(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function lt(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function ct(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function ft(t,e,n=0){t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2]}function dt(t,e,n){let r=e[0],a=e[1],i=e[2],s=n[0],h=n[1],o=n[2];t[0]=a*o-i*h,t[1]=i*s-r*o,t[2]=r*h-a*s}function mt(t,e){let n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];if(n>0){let r=1/Math.sqrt(n);t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r}}function Mt(t){return t[0]*t[0]+t[1]*t[1]+t[2]*t[2]}function gt(t,e){let n=e[0]-t[0],r=e[1]-t[1],a=e[2]-t[2];return n*n+r*r+a*a}function vt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}class _t{constructor(t=u.uY,e=qt,n=h.zK){this._data=[t[0],t[1],t[2],e[0],e[1],e[2],n[0],n[1],n[2],n[3]]}clone(){return _t.fromData(this._data)}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){let e=new _t;return e._copyFromData(t),e}static fromJSON(t){return new _t(t.center,t.halfSize,t.quaternion)}copy(t){this._copyFromData(t.data)}_copyFromData(t){for(let e=0;e<10;++e)this._data[e]=t[e]}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}setCenter(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenterFromValues(t,e,n){this._data[0]=t,this._data[1]=e,this._data[2]=n}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}setHalfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}setHalfSizeFromValues(t,e,n){this._data[3]=t,this._data[4]=e,this._data[5]=n}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}getQuaternionConjugate(t){return t[0]=-this._data[6],t[1]=-this._data[7],t[2]=-this._data[8],t[3]=this._data[9],t}setQuaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){let e=this._data,n=(0,s.hZ)(bt,e[6],e[7],e[8],e[9]);for(let r=0;r<8;++r){let a=t[r];a[0]=(1&r?-1:1)*e[3],a[1]=(2&r?-1:1)*e[4],a[2]=(4&r?-1:1)*e[5],(0,o.gL)(a,a,n),a[0]+=e[0],a[1]+=e[1],a[2]+=e[2]}return t}getAxes(t){let e=this._data,n=(0,s.hZ)(bt,e[6],e[7],e[8],e[9]);return(0,o.gL)(t[0],[1,0,0],n),(0,o.gL)(t[1],[0,1,0],n),(0,o.gL)(t[2],[0,0,1],n),t}intersectsFrustum(t){let{centerX:e,centerY:n,centerZ:r}=this,a=t.planes;for(let t of a){let a=(0,v.Qj)(t),i=this.projectedRadius(a);if(e*a[0]+n*a[1]+r*a[2]+t[3]-i>0)return!1}let i=this.getAxes(Bt),s=t.points,h=this.getHalfSize(Rt);for(let t=0;t<3;++t){let a=i[t],u=-a[0]*e-a[1]*n-a[2]*r,l=h[t],c=!0,f=!0;for(let t of s){let e=(0,o.Om)(t,a)+u;c&&=e>l,f&&=e<-l}if(c||f)return!1}if(this.getCorners(Lt).some(e=>t.intersectsPoint(e)))return!0;let u=Xt;for(let t=0;t<3;++t){let a=i[t];u[t]=a[0]*e+a[1]*n+a[2]*r}if(t.points.some(t=>(t=>{for(let e=0;e<3;++e){let n=i[e],r=h[e],a=n[0]*t[0]+n[1]*t[1]+n[2]*t[2]-u[e];if(a>r||a<-r)return!1}return!0})(t)))return!0;let l=t.lines,c=Wt;for(let t=0;t<8;++t){let a=l[t].direction;for(let t of i){(0,o.$A)(c,a,t);let i=(0,o.Il)(c);if(!(i>0))continue;(0,o.hs)(c,c,1/i);let h=this.projectedRadius(c),u=c[0]*e+c[1]*n+c[2]*r,l=u-h,f=u+h,d=!1,m=!1,M=!0;for(let t of s){let e=(0,o.Om)(c,t);if(e>f){if(m){M=!1;break}d=!0}else{if(!(e<l)){M=!1;break}if(d){M=!1;break}m=!0}}if(M)return!1}}return!0}intersectsFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}intersectsFrustumConservativeApproximationWithMargin(t,e){return this.signedDistanceRangePlane(t[0]).min<=e&&this.signedDistanceRangePlane(t[1]).min<=e&&this.signedDistanceRangePlane(t[2]).min<=e&&this.signedDistanceRangePlane(t[3]).min<=e&&this.signedDistanceRangePlane(t[4]).min<=e&&this.signedDistanceRangePlane(t[5]).min<=e}get radius(){let t=this._data[3],e=this._data[4],n=this._data[5];return Math.sqrt(t*t+e*e+n*n)}intersectsPoint(t){let e=this.getAxes(Bt),n=this.getHalfSize(Rt),r=this.getCenter(Vt);for(let a=0;a<3;++a){let i=e[a],s=n[a],h=(0,o.Om)(i,t)-(0,o.Om)(i,r);if(h>s||h<-s)return!1}return!0}intersectSphere(t){let{center:e,radius:n}=t,r=this._data,a=r[3],i=r[4],s=r[5],h=a+i+s+n,o=r[0]-e[0];if(Math.abs(o)>h)return!1;let u=r[1]-e[1];if(Math.abs(u)>h)return!1;let l=r[2]-e[2];if(Math.abs(l)>h)return!1;let c=-r[6],f=-r[7],d=-r[8],m=f*l-d*u,M=d*o-c*l,g=c*u-f*o,v=f*g-d*M,_=d*m-c*g,b=c*M-f*m,P=2*r[9],j=Math.abs(o+m*P+2*v),p=Math.abs(u+M*P+2*_),x=Math.abs(l+g*P+2*b),w=j-Math.min(j,a),C=p-Math.min(p,i),A=x-Math.min(x,s);return w*w+C*C+A*A<=n*n}intersectSphereWithMBS(t,e=this.radius){let n=this._data,{center:r,radius:a}=t,i=e+a,s=n[0]-r[0];if(s>i)return!1;let h=n[1]-r[1];if(h>i)return!1;let o=n[2]-r[2];if(o>i||s*s+h*h+o*o>i*i)return!1;let u=-n[6],l=-n[7],c=-n[8],f=l*o-c*h,d=c*s-u*o,m=u*h-l*s,M=l*m-c*d,g=c*f-u*m,v=u*d-l*f,_=2*n[9],b=Math.abs(s+f*_+2*M),P=Math.abs(h+d*_+2*g),j=Math.abs(o+m*_+2*v),p=b-Math.min(b,n[3]),x=P-Math.min(P,n[4]),w=j-Math.min(j,n[5]);return p*p+x*x+w*w<a*a}intersectPlane(t){let e=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],n=this.projectedRadius((0,v.Qj)(t));return e>n?1:e<-n?-1:0}intersectRay(t,e,n=0){let r=this._data,a=bt;a[0]=-r[6],a[1]=-r[7],a[2]=-r[8],a[3]=r[9],pt[0]=t[0]-r[0],pt[1]=t[1]-r[1],pt[2]=t[2]-r[2];let i=(0,o.gL)(pt,pt,bt),s=(0,o.gL)(xt,e,bt),h=-1/0,u=1/0,l=this.getHalfSize(Rt);for(let t=0;t<3;t++){let e=i[t],r=s[t],a=l[t]+n;if(Math.abs(r)>1e-6){let t=(a-e)/r,n=(-a-e)/r;h=Math.max(h,Math.min(t,n)),u=Math.min(u,Math.max(t,n))}else if(e>a||e<-a)return!1}return h<=u}projectedArea(t,e,n,a){let i=this.getQuaternion(Pt);(0,s.Xr)(bt,i),pt[0]=t[0]-this._data[0],pt[1]=t[1]-this._data[1],pt[2]=t[2]-this._data[2],(0,o.gL)(pt,pt,bt);let h=this.getHalfSize(Rt),u=pt[0]<-h[0]?-1:+(pt[0]>h[0]),c=pt[1]<-h[1]?-1:+(pt[1]>h[1]),f=pt[2]<-h[2]?-1:+(pt[2]>h[2]),d=Math.abs(u)+Math.abs(c)+Math.abs(f);if(0===d)return 1/0;let m=1===d?4:6,M=6*(u+3*c+9*f+13);(0,r.I0)(Ht,i),(0,r.hs)(Ht,Ht,h);let g=this.getCenter(Vt);for(let t=0;t<m;t++){let n=At[M+t];(0,o.hZ)(pt,((1&n)<<1)-1,(2&n)-1,((4&n)>>1)-1),(0,o.ei)(pt,pt,Ht),(0,o.WQ)(wt,g,pt),wt[3]=1,(0,l.Z0)(wt,wt,e);let r=1/Math.max(1e-6,wt[3]);Ct[2*t]=wt[0]*r,Ct[2*t+1]=wt[1]*r}let v=2*m-2,_=Ct[0]*(Ct[3]-Ct[v+1])+Ct[v]*(Ct[1]-Ct[v-1]);for(let t=2;t<v;t+=2)_+=Ct[t]*(Ct[t+3]-Ct[t-1]);return Math.abs(_)*n*a*.125}projectedRadius(t){let e=this._data;return(0,o.fw)(pt,t,-e[6],-e[7],-e[8],e[9]),Math.abs(pt[0]*e[3])+Math.abs(pt[1]*e[4])+Math.abs(pt[2]*e[5])}signedDistancePlane(t,e){let n=this._data,r=t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+e,a=this.projectedRadius(t);return r>a?r-a:r<-a?r+a:0}signedDistanceRangePlane(t){let e=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],n=this.projectedRadius((0,v.Qj)(t));return{min:e-n,max:e+n}}toAaBoundingBox(t){let e=this.getQuaternion(Pt),n=(0,r.I0)(Ht,e),a=this._data[3]*Math.abs(n[0])+this._data[4]*Math.abs(n[3])+this._data[5]*Math.abs(n[6]),i=this._data[3]*Math.abs(n[1])+this._data[4]*Math.abs(n[4])+this._data[5]*Math.abs(n[7]),s=this._data[3]*Math.abs(n[2])+this._data[4]*Math.abs(n[5])+this._data[5]*Math.abs(n[8]);t[0]=this._data[0]-a,t[1]=this._data[1]-i,t[2]=this._data[2]-s,t[3]=this._data[0]+a,t[4]=this._data[1]+i,t[5]=this._data[2]+s}transform(t,e,n,r=0,a=(0,d.lO)(n),i=(0,d.lO)(e),h=(0,g.jd)(e,i)){if(n===a)e.isGeographic?function(t,e,n,r,a=(0,d.lO)(n)){let i=(0,f.tO)(n),h=1+Math.max(0,r)/(i.radius+t.centerZ);t.getCenter(Ot),Ot[2]+=r,(0,M.projectBuffer)(Ot,n,0,Ot,a,0),e.setCenter(Ot);let u=t.getQuaternion(Pt);e.setQuaternion(u),(0,s.Xr)(bt,u),(0,o.hZ)(Dt,0,0,1),(0,o.gL)(Dt,Dt,bt);let l=t.getHalfSize(Rt);(0,o.hZ)(Dt,l[0]*Math.abs(Dt[0]),l[1]*Math.abs(Dt[1]),l[2]*Math.abs(Dt[2])),(0,o.hs)(Dt,Dt,i.inverseFlattening),(0,o.WQ)(Dt,l,Dt),e.setHalfSize((0,o.hs)(Dt,Dt,h))}(this,t,e,r,i):function(t,e,n,r,a=(0,d.lO)(n),i=(0,g.jd)(n,a)){t.getCorners(Lt);let h=t.getCenter(Vt);h[2]+=r,(0,m.l)(n,h,It,a),e.setCenterFromValues(It[12],It[13],It[14]);let u=2*Math.sqrt(1+It[0]+It[5]+It[10]);bt[0]=(It[6]-It[9])/u,bt[1]=(It[8]-It[2])/u,bt[2]=(It[1]-It[4])/u,bt[3]=.25*u;let l=t.getQuaternion(Pt);e.setQuaternion((0,s.lw)(bt,bt,l)),(0,s.Xr)(bt,bt),(0,o.hZ)(Ft,0,0,0);let c=e.getCenter(Vt);for(let t of Lt)t[2]+=r,i(t,0,t,0),(0,o.jb)(Dt,t,c),(0,o.gL)(Dt,Dt,bt),(0,o.tn)(Dt,Dt),(0,o.T9)(Ft,Ft,Dt);e.setHalfSize(Ft)}(this,t,e,r,i,h);else if(e.isGeographic&&(n.isWebMercator||(0,_.r1)(n)))!function(t,e,n,r,a){let i=e.getCenter(Vt);i[2]+=a;let s=(0,d.lO)(n);(0,M.projectBuffer)(i,t,0,i,s,0),St(s,e,i,n,r)}(e,this,n,t,r);else if(e.isWebMercator&&(0,_.r1)(n))!function(t,e,n,r,a){let i=e.getCenter(Vt);i[2]+=a,St(t,e,i,n,r)}(e,this,n,t,r);else{let a=this.getCenter(Vt);a[2]+=r,(0,M.projectBuffer)(a,e,0,a,n,0),t.setCenter(a),this!==t&&(t.setQuaternion(this.getQuaternion(Pt)),t.setHalfSize(this.getHalfSize(Rt)))}}}const bt=(0,h.vt)(),Pt=(0,h.vt)(),jt=(0,h.vt)(),pt=(0,u.vt)(),xt=(0,u.vt)(),wt=(0,c.vt)();const Ct=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],At=(()=>{let t=new Int8Array(162),e=0,n=n=>{for(let r=0;r<n.length;r++)t[e+r]=n[r];e+=6};return n([6,2,3,1,5,4]),n([0,2,3,1,5,4]),n([0,2,3,7,5,4]),n([0,1,3,2,6,4]),n([0,1,3,2,0,0]),n([0,1,5,7,3,2]),n([0,1,3,7,6,4]),n([0,1,3,7,6,2]),n([0,1,5,7,6,2]),n([0,1,5,4,6,2]),n([0,1,5,4,0,0]),n([0,1,3,7,5,4]),n([0,2,6,4,0,0]),n([0,0,0,0,0,0]),n([1,3,7,5,0,0]),n([2,3,7,6,4,0]),n([2,3,7,6,0,0]),n([2,3,1,5,7,6]),n([0,1,5,7,6,2]),n([0,1,5,7,6,4]),n([0,1,3,7,6,4]),n([4,5,7,6,2,0]),n([4,5,7,6,0,0]),n([4,5,1,3,7,6]),n([0,2,3,7,5,4]),n([6,2,3,7,5,4]),n([6,2,3,1,5,4]),t})();function zt(t,e,n,r,a){let i=t.getQuaternion(Pt);a.setQuaternion(i),(0,s.Xr)(bt,i);let h=t.getCenter(Vt),l=t.getHalfSize(Rt);if(1===r){(0,o.gL)(Dt,h,bt),(0,o.tn)(Ft,Dt),(0,o.jk)(Zt,Ft,l),(0,o.jb)(Zt,Ft,Zt);let r=(0,o.Bw)(Zt);(0,o.WQ)(Zt,Ft,l);let i=(0,o.Bw)(Zt);if(r<n)a.setCenter(h),(0,o.hZ)(Dt,n,n,n),a.setHalfSize((0,o.WQ)(Dt,l,Dt));else{let s=i>0?1+e/i:1,h=r>0?1+n/r:1,u=(h+s)/2,c=(h-s)/2;(0,o.hs)(Zt,Ft,c),a.setHalfSize((0,o.Ln)(Zt,Zt,l,u)),(0,o.hs)(Zt,Ft,u),(0,o.Ln)(Zt,Zt,l,c),(0,o._S)(Dt,Dt),(0,o.lw)(Dt,Zt,Dt);let f=t.getQuaternion(jt);a.setCenter((0,o.gL)(Dt,Dt,f))}}else{a.setCenter((0,o.Ln)(Dt,h,u.Cb,(n+e)/2));let t=(0,o.gL)(Dt,u.Cb,bt);(0,o.tn)(t,t),a.setHalfSize((0,o.Ln)(Ft,l,t,(n-e)/2))}return a}function St(t,e,n,a,i){let s=e.getQuaternion(Pt),h=(0,r.I0)(Ht,s),o=e.getHalfSize(Rt);for(let t=0;t<8;++t){for(let e=0;e<3;++e)Ot[e]=o[e]*(t&1<<e?-1:1);for(let e=0;e<3;++e){let r=n[e];for(let t=0;t<3;++t)r+=Ot[t]*h[3*t+e];Qt[3*t+e]=r}}(0,M.projectBuffer)(Qt,t,0,Qt,a,0,8),function(t,e=new _t){(function(t,e){let{data:n,size:r}=t,a=n.length/r;if(a<=0)return;let i=new st(t);ut(p,i.minProj,i.maxProj),ct(p,p,.5),lt(x,i.maxProj,i.minProj);let s=ot(x),h=new ht;h.quality=s,a<14&&(t=new P.K(new Float64Array(i.buffer,112,42),3));let o=(0,u.vt)(),l=(0,u.vt)(),c=(0,u.vt)(),f=(0,u.vt)(),d=(0,u.vt)(),m=(0,u.vt)(),M=(0,u.vt)();switch(w(i,t,M,o,l,c,f,d,m,h)){case 1:return void K(p,x,e);case 2:return void U(t,f,e)}V(t,M,o,l,c,f,d,m,h),J(t,h.b0,h.b1,h.b2,$,N);let g=(0,u.vt)();lt(g,N,$),h.quality=ot(g),h.quality<s?it(h.b0,h.b1,h.b2,$,N,g,e):K(p,x,e)})(t,e)}(yt,i)}const qt=(0,u.CN)(-1,-1,-1),Qt=Array(24),yt=new P.K(Qt,3),Ot=(0,u.vt)(),Vt=(0,u.vt)(),Rt=(0,u.vt)(),Ht=(0,a.vt)(),It=(0,i.vt)(),Lt=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],Bt=[(0,u.vt)(),(0,u.vt)(),(0,u.vt)()],Dt=(0,u.vt)(),Ft=(0,u.vt)(),Zt=(0,u.vt)(),Wt=(0,u.vt)(),Xt=[0,0,0]},46610(t,e,n){n.d(e,{K:()=>r,n:()=>a});class r{constructor(t,e,n=e){this.data=t,this.size=e,this.stride=n}}class a extends r{constructor(t,e,n,r=!1,a=n){super(t,n,a),this.indices=e,this.exclusive=r}}}}]);