@arcgis/core 4.34.0-next.71 → 4.34.0-next.73

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 (100) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/11acefc48c0354e675df.js +1 -0
  3. package/assets/esri/core/workers/chunks/433c4dc666a6b2c99063.js +353 -0
  4. package/assets/esri/core/workers/chunks/{1f51c94d392826fdbdf4.js → 8ce653c3c5dde10ccbcf.js} +46 -46
  5. package/assets/esri/core/workers/chunks/8d91e2d185be4a4e8598.js +1 -0
  6. package/assets/esri/core/workers/chunks/{bcc233a86e01ff1eac16.js → ae7b86bd08a44e26b339.js} +1 -1
  7. package/assets/esri/core/workers/chunks/be9edd9791a00cab9c2b.js +1 -0
  8. package/assets/esri/core/workers/chunks/e8d25d4ca9b335883f34.js +1 -0
  9. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  10. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  11. package/chunks/Fog.glsl.js +5 -10
  12. package/chunks/GlowComposition.glsl.js +4 -4
  13. package/chunks/Terrain.glsl.js +29 -43
  14. package/chunks/boundedPlane.js +1 -1
  15. package/config.js +1 -1
  16. package/geometry/support/boundedPlane.js +1 -1
  17. package/interfaces.d.ts +26 -3
  18. package/kernel.js +1 -1
  19. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  20. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  21. package/layers/support/gaussianSplatUtils.js +1 -1
  22. package/package.json +3 -3
  23. package/support/basemapDefinitions.js +1 -1
  24. package/support/revision.js +1 -1
  25. package/views/2d/engine/flow/FlowDisplayData.js +1 -1
  26. package/views/2d/engine/flow/FlowStrategy.js +1 -1
  27. package/views/2d/engine/flow/dataUtils.js +1 -1
  28. package/views/2d/engine/flow/utils.js +1 -1
  29. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  30. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  31. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  32. package/views/3d/analysis/Slice/SliceController.js +1 -1
  33. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  34. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  35. package/views/3d/environment/Fog.glsl.js +1 -1
  36. package/views/3d/interactive/Manipulator3D.js +1 -1
  37. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  38. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  39. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  40. package/views/3d/interactive/support/viewUtils.js +1 -1
  41. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  42. package/views/3d/layers/FlowSubView3D.js +1 -1
  43. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  44. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  45. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  46. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  47. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  48. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  49. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  50. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  51. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  52. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  53. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  54. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  55. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  56. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  57. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  58. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  59. package/views/3d/state/ScreenSizePerspective.js +5 -0
  60. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  61. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  62. package/views/3d/support/SharedSymbolResources.js +1 -1
  63. package/views/3d/support/ViewSlice.js +1 -1
  64. package/views/3d/support/engineContent/line.js +1 -1
  65. package/views/3d/support/flow/FlowWorker.js +1 -1
  66. package/views/3d/support/flow/geometryUtils.js +1 -1
  67. package/views/3d/support/geometryUtils/ray.js +1 -1
  68. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  69. package/views/3d/terrain/TerrainRenderer.js +1 -1
  70. package/views/3d/terrain/TerrainSurface.js +1 -1
  71. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +4 -4
  72. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  73. package/views/3d/webgl-engine/effects/raymarching/RayDistanceFalloff.glsl.js +10 -0
  74. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  75. package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
  76. package/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js +1 -1
  77. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  78. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  79. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  80. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  81. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  82. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +28 -10
  83. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  84. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  85. package/views/SceneView.js +1 -1
  86. package/views/draw/support/tooltipUtils.js +1 -1
  87. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  88. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  89. package/views/support/GroundViewElevationSampler.js +1 -1
  90. package/widgets/Sketch/SketchViewModel.js +1 -1
  91. package/widgets/Sketch/VisibleElements.js +1 -1
  92. package/widgets/Sketch/support/OperationHandle.js +1 -1
  93. package/widgets/Sketch/support/sketchUtils.js +1 -1
  94. package/widgets/Sketch.js +1 -1
  95. package/assets/esri/core/workers/chunks/16cfbe7bedf75d3a86e5.js +0 -1
  96. package/assets/esri/core/workers/chunks/226833d408eb1225e168.js +0 -1
  97. package/assets/esri/core/workers/chunks/cf69f6afeaf1229e032c.js +0 -1
  98. package/assets/esri/core/workers/chunks/e21eeb4e78a46fb7e32e.js +0 -1
  99. package/assets/esri/core/workers/chunks/f87a6b32292c1464b7b7.js +0 -353
  100. package/views/3d/webgl-engine/materials/ScaleInfo.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as a,d as o,e as n,g as l,f as h,c as p,l as m,j as c,t as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as g}from"../../../../geometry/support/float16.js";import{distance2 as b,fromPoints as _,create as S,closestLineSegmentPoint as v}from"../../../../geometry/support/lineSegment.js";import{fromPoints as P,create as y,signedDistance as j,getNormal as E}from"../../../../geometry/support/plane.js";import{isHighlightOrOID as w,isColorOrColorEmission as A,isDepth as T,isColorEmissionHighlightOIDOrDepth as z,is2DGeometryOutput as C}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as L}from"../effects/geometry/olidUtils.js";import M from"../lib/GLMaterial.js";import{Material as O}from"../lib/Material.js";import{isTranslationMatrix as V}from"../lib/Util.js";import{VisualVariablePassParameters as R}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as x}from"./internal/bufferWriterUtils.js";import{r as F}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as N,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as U}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as D}from"../../../../webscene/support/AlphaCutoff.js";class B extends O{constructor(t){super(t,J),this._configuration=new U,this.produces=new Map([[2,t=>w(t)||A(t)&&8===this.parameters.renderOccluded],[3,t=>T(t)],[10,t=>z(t)&&8===this.parameters.renderOccluded],[11,t=>z(t)&&8===this.parameters.renderOccluded],[4,t=>A(t)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,t=>A(t)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,t=>C(t)]])}getConfiguration(t,e){super.getConfiguration(t,e,this._configuration),this._configuration.oitPass=e.oitPass,this._configuration.draped=18===e.slot;const i=null!=this.parameters.stipplePattern&&9!==t;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&G(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&A(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration}get visible(){return this.parameters.color[3]>=D||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>D}setParameters(t,e){t.animation=this.parameters.animation,super.setParameters(t,e)}intersectDraped({attributes:t,screenToWorldRatio:i},r,s,a,o){if(!r.options.selectionMode)return;const n=t.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=t.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=e(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else n&&(l*=n.data[0]);const h=s[0],p=s[1],m=(l/2+4)*i;let c=Number.MAX_VALUE,u=0;const f=t.get("position").data,d=X(this.parameters,t)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const t=f[g],i=f[g+1],r=(g+3)%f.length,s=h-t,a=p-i,o=f[r]-t,n=f[r+1]-i,l=e((o*s+n*a)/(o*o+n*n),0,1),m=o*l-s,d=n*l-a,b=m*m+d*d;b<c&&(c=b,u=g/3)}c<m*m&&a(o.distance,o.normal,u)}intersect(i,r,u,f,d,g){const{options:S,camera:y,rayBegin:w,rayEnd:A}=u;if(!S.selectionMode||!i.visible||!y)return;if(!V(r))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const T=i.attributes,z=T.get("position").data;let C=this.parameters.width;if(this.parameters.vvSize){const t=T.get("sizeFeatureAttribute").data[0];Number.isNaN(t)||(C*=e(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else T.has("size")&&(C*=T.get("size").data[0]);const L=Z;s(L,u.point);const M=C*y.pixelRatio/2+4*y.pixelRatio;a(ht[0],L[0]-M,L[1]+M,0),a(ht[1],L[0]+M,L[1]+M,0),a(ht[2],L[0]+M,L[1]-M,0),a(ht[3],L[0]-M,L[1]-M,0);for(let t=0;t<4;t++)if(!y.unprojectFromRenderScreen(ht[t],pt[t]))return;P(y.eye,pt[0],pt[1],mt),P(y.eye,pt[1],pt[2],ct),P(y.eye,pt[2],pt[3],ut),P(y.eye,pt[3],pt[0],ft);let O=Number.MAX_VALUE,R=0;const x=X(this.parameters,T)?z.length-2:z.length-5;for(let t=0;t<x;t+=3){H[0]=z[t]+r[12],H[1]=z[t+1]+r[13],H[2]=z[t+2]+r[14];const e=(t+3)%z.length;if(I[0]=z[e]+r[12],I[1]=z[e+1]+r[13],I[2]=z[e+2]+r[14],j(mt,H)<0&&j(mt,I)<0||j(ct,H)<0&&j(ct,I)<0||j(ut,H)<0&&j(ut,I)<0||j(ft,H)<0&&j(ft,I)<0)continue;if(y.projectToRenderScreen(H,$),y.projectToRenderScreen(I,tt),$[2]<0&&tt[2]>0){o(K,H,I);const t=y.frustum,e=-j(t[4],H)/n(K,E(t[4]));l(K,K,e),h(H,H,K),y.projectToRenderScreen(H,$)}else if($[2]>0&&tt[2]<0){o(K,I,H);const t=y.frustum,e=-j(t[4],I)/n(K,E(t[4]));l(K,K,e),h(I,I,K),y.projectToRenderScreen(I,tt)}else if($[2]<0&&tt[2]<0)continue;$[2]=0,tt[2]=0;const i=b(_($,tt,rt),L);i<O&&(O=i,p(et,H),p(it,I),R=t/3)}if(O<M*M){let t=Number.MAX_VALUE;if(v(_(et,it,rt),_(w,A,st),Q)){o(Q,Q,w);const e=m(Q);l(Q,Q,1/e),t=e/c(w,A)}g(t,Q,R)}}get hasEmissions(){return this.parameters.emissiveStrength>0}createBufferWriter(){return new Y(N(this.parameters),this.parameters)}createGLMaterial(t){return new W(t)}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0),null!=t.markerParameters&&(t.markerScale=t.markerParameters.width/t.width)}update(t){const{hasAnimation:e,animationSpeed:i}=this.parameters;return!!e&&(this.setParameters({timeElapsed:r(t.time)*i},!1),0!==t.dt)}}class W extends M{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(t){const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(e,this._stipplePattern)}),this._stipplePattern=e),this.getTechnique(k,t)}}class J extends R{constructor(){super(...arguments),this.width=0,this.color=d,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=0,this.animationSpeed=1,this.trailLength=1,this.emissiveStrength=0}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}}class Y{constructor(t,e){this.layout=t,this._parameters=e;const i=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=i;break;case"round":this.numJoinSubdivisions=F+i}}_isClosed(t){return X(this._parameters,t)}allocate(t){return this.layout.createBuffer(t)}elementCount(t){const e=2,i=t.get("position").indices.length/2+1,r=this._isClosed(t);let s=r?2:2*e;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,i,r,s,o){const n=i.get("position"),l=n.indices,h=n.data.length/3,m=i.get("distanceToStart")?.data;l&&l.length!==2*(h-1)&&console.warn("RibbonLineMaterial does not support indices");const f=(this.layout.fields.has("sizeFeatureAttribute")?i.get("sizeFeatureAttribute")?.data[0]:i.get("size")?.data[0])??1;let d=[1,1,1,1],b=0;const _=this.layout.fields.has("colorFeatureAttribute");_?b=i.get("colorFeatureAttribute").data[0]:i.has("color")&&(d=i.get("color").data);const S=i.get("timeStamps")?.data,v=S&&this.layout.fields.has("timeStamps"),P=this.layout.fields.has("opacityFeatureAttribute"),y=P?i.get("opacityFeatureAttribute").data[0]:0,j=new Float32Array(s.buffer),E=g(s.buffer),w=new Uint8Array(s.buffer),A=this.layout.stride/4;let T=o*A;const z=T;let C=0;const M=m?(t,e,i)=>C=m[i]:(t,e,i)=>C+=c(t,e),O=j.BYTES_PER_ELEMENT/E.BYTES_PER_ELEMENT,V=4/O,R=(t,e,i,s,a,o,n,l)=>{j[T++]=e[0],j[T++]=e[1],j[T++]=e[2],x(t,e,E,T*O),T+=V,x(i,e,E,T*O),T+=V,j[T++]=l;let h=T*O;if(E[h++]=a,E[h++]=o,T=Math.ceil(h/O),_)j[T]=b;else{const t=Math.min(4*n,d.length-4),e=4*T;w[e]=255*d[t],w[e+1]=255*d[t+1],w[e+2]=255*d[t+2],w[e+3]=255*d[t+3]}if(T++,j[T++]=f,P&&(j[T++]=y),L()){let t=4*T;r?(w[t++]=r[0],w[t++]=r[1],w[t++]=r[2],w[t++]=r[3]):(w[t++]=0,w[t++]=0,w[t++]=0,w[t++]=0),T=Math.ceil(.25*t)}v&&(h=T*O,E[h++]=s[0],E[h++]=s[1],E[h++]=s[2],T=Math.ceil(h/O))};T+=A,a(ot,n.data[0],n.data[1],n.data[2]),v&&a(lt,S[0],S[1],S[2]),t&&u(ot,ot,t);const F=this._isClosed(i);if(F){const e=n.data.length-3;a(at,n.data[e],n.data[e+1],n.data[e+2]),t&&u(at,at,t)}else a(nt,n.data[3],n.data[4],n.data[5]),t&&u(nt,nt,t),R(ot,ot,nt,lt,1,-4,0,0),R(ot,ot,nt,lt,1,4,0,0),p(at,ot),p(ot,nt),v&&a(lt,S[3],S[4],S[5]);const N=F?0:1,k=F?h:h-1;for(let c=N;c<k;c++){const e=(c+1)%h*3;a(nt,n.data[e],n.data[e+1],n.data[e+2]),t&&u(nt,nt,t),M(at,ot,c),R(at,ot,nt,lt,0,-1,c,C),R(at,ot,nt,lt,0,1,c,C);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const e=(t+1)/(i+1);R(at,ot,nt,lt,e,-1,c,C),R(at,ot,nt,lt,e,1,c,C)}R(at,ot,nt,lt,1,-2,c,C),R(at,ot,nt,lt,1,2,c,C),p(at,ot),p(ot,nt),v&&a(lt,S[e],S[e+1],S[e+2])}F?(a(nt,n.data[3],n.data[4],n.data[5]),t&&u(nt,nt,t),C=M(at,ot,k),R(at,ot,nt,lt,0,-1,N,C),R(at,ot,nt,lt,0,1,N,C)):(C=M(at,ot,k),R(at,ot,ot,lt,0,-5,k,C),R(at,ot,ot,lt,0,5,k,C)),q(j,z+A,j,z,A);return T=q(j,T-A,j,T,A),this._parameters.wireframe&&this._addWireframeVertices(s,z,T,A),null}_addWireframeVertices(t,e,i,r){const s=new Float32Array(t.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,i-e);let o=0;const n=t=>o=q(a,t,s,o,r);for(let l=0;l<a.length-1;l+=2*r)n(l),n(l+2*r),n(l+1*r),n(l+2*r),n(l+1*r),n(l+3*r)}}function q(t,e,i,r,s){for(let a=0;a<s;a++)i[r++]=t[e++];return r}function X(t,e){if(!t.isClosed)return!1;return e.get("position").indices.length>2}function G(t){return 1===t.anchor&&t.hideOnShortSegments&&"begin-end"===t.placement&&t.worldSpace}const H=f(),I=f(),K=f(),Q=f(),Z=f(),$=i(),tt=i(),et=f(),it=f(),rt=S(),st=S(),at=f(),ot=f(),nt=f(),lt=f(),ht=[i(),i(),i(),i()],pt=[f(),f(),f(),f()],mt=y(),ct=y(),ut=y(),ft=y();export{J as Parameters,B as RibbonLineMaterial};
5
+ import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as a,d as o,e as n,g as l,f as h,c,l as m,j as p,t as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as d}from"../../../../chunks/vec42.js";import{ONES as g,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as _}from"../../../../geometry/support/float16.js";import{distance2 as S,fromPoints as v,create as P,closestLineSegmentPoint as y}from"../../../../geometry/support/lineSegment.js";import{fromPoints as j,create as E,signedDistance as w,getNormal as T}from"../../../../geometry/support/plane.js";import{isHighlightOrOID as A,isColorOrColorEmission as z,isDepth as C,isColorEmissionHighlightOIDOrDepth as O,is2DGeometryOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import V from"../lib/GLMaterial.js";import{Material as R}from"../lib/Material.js";import{isTranslationMatrix as x}from"../lib/Util.js";import{VisualVariablePassParameters as F}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as k}from"./internal/bufferWriterUtils.js";import{r as N}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as U,RibbonLineTechnique as D}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as B}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";class J extends R{constructor(t){super(t,q),this._configuration=new B,this.produces=new Map([[2,t=>A(t)||z(t)&&8===this.parameters.renderOccluded],[3,t=>C(t)],[10,t=>O(t)&&8===this.parameters.renderOccluded],[11,t=>O(t)&&8===this.parameters.renderOccluded],[4,t=>z(t)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,t=>z(t)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,t=>L(t)]])}getConfiguration(t,e){super.getConfiguration(t,e,this._configuration),this._configuration.oitPass=e.oitPass,this._configuration.draped=18===e.slot;const i=null!=this.parameters.stipplePattern&&9!==t;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&H(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&z(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}setParameters(t,e){t.animation=this.parameters.animation,super.setParameters(t,e)}intersectDraped({attributes:t,screenToWorldRatio:i},r,s,a,o){if(!r.options.selectionMode)return;const n=t.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=t.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=e(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else n&&(l*=n.data[0]);const h=s[0],c=s[1],m=(l/2+4)*i;let p=Number.MAX_VALUE,u=0;const f=t.get("position").data,d=I(this.parameters,t)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const t=f[g],i=f[g+1],r=(g+3)%f.length,s=h-t,a=c-i,o=f[r]-t,n=f[r+1]-i,l=e((o*s+n*a)/(o*o+n*n),0,1),m=o*l-s,d=n*l-a,b=m*m+d*d;b<p&&(p=b,u=g/3)}p<m*m&&a(o.distance,o.normal,u)}intersect(i,r,u,f,d,g){const{options:b,camera:_,rayBegin:P,rayEnd:E}=u;if(!b.selectionMode||!i.visible||!_)return;if(!x(r))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const A=i.attributes,z=A.get("position").data;let C=this.parameters.width;if(this.parameters.vvSize){const t=A.get("sizeFeatureAttribute").data[0];Number.isNaN(t)||(C*=e(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else A.has("size")&&(C*=A.get("size").data[0]);const O=tt;s(O,u.point);const L=C*_.pixelRatio/2+4*_.pixelRatio;a(mt[0],O[0]-L,O[1]+L,0),a(mt[1],O[0]+L,O[1]+L,0),a(mt[2],O[0]+L,O[1]-L,0),a(mt[3],O[0]-L,O[1]-L,0);for(let t=0;t<4;t++)if(!_.unprojectFromRenderScreen(mt[t],pt[t]))return;j(_.eye,pt[0],pt[1],ut),j(_.eye,pt[1],pt[2],ft),j(_.eye,pt[2],pt[3],dt),j(_.eye,pt[3],pt[0],gt);let M=Number.MAX_VALUE,V=0;const R=I(this.parameters,A)?z.length-2:z.length-5;for(let t=0;t<R;t+=3){K[0]=z[t]+r[12],K[1]=z[t+1]+r[13],K[2]=z[t+2]+r[14];const e=(t+3)%z.length;if(Q[0]=z[e]+r[12],Q[1]=z[e+1]+r[13],Q[2]=z[e+2]+r[14],w(ut,K)<0&&w(ut,Q)<0||w(ft,K)<0&&w(ft,Q)<0||w(dt,K)<0&&w(dt,Q)<0||w(gt,K)<0&&w(gt,Q)<0)continue;const i=_.projectToRenderScreen(K,et),s=_.projectToRenderScreen(Q,it);if(null==i||null==s)continue;if(i[2]<0&&s[2]>0){o(Z,K,Q);const t=_.frustum,e=-w(t[4],K)/n(Z,T(t[4]));if(l(Z,Z,e),h(K,K,Z),!_.projectToRenderScreen(K,i))continue}else if(i[2]>0&&s[2]<0){o(Z,Q,K);const t=_.frustum,e=-w(t[4],Q)/n(Z,T(t[4]));if(l(Z,Z,e),h(Q,Q,Z),!_.projectToRenderScreen(Q,s))continue}else if(i[2]<0&&s[2]<0)continue;i[2]=0,s[2]=0;const a=S(v(i,s,at),O);a<M&&(M=a,c(rt,K),c(st,Q),V=t/3)}if(M<L*L){let t=Number.MAX_VALUE;if(y(v(rt,st,at),v(P,E,ot),$)){o($,$,P);const e=m($);l($,$,1/e),t=e/p(P,E)}g(t,$,V)}}get hasEmissions(){return this.parameters.emissiveStrength>0}createBufferWriter(){return new X(U(this.parameters),this.parameters)}createGLMaterial(t){return new Y(t)}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0),null!=t.markerParameters&&(t.markerScale=t.markerParameters.width/t.width)}update(t){const{hasAnimation:e}=this.parameters;return!!e&&(this.setParameters({timeElapsed:r(t.time)},!1),0!==t.dt)}}class Y extends V{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(t){const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(e,this._stipplePattern)}),this._stipplePattern=e),this.getTechnique(D,t)}}class q extends F{constructor(){super(...arguments),this.width=0,this.color=g,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=0,this.endTime=1/0,this.fadeInTime=0,this.fadeOutTime=1/0,this.emissiveStrength=0}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}}class X{constructor(t,e){this.layout=t,this._parameters=e;const i=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=i;break;case"round":this.numJoinSubdivisions=N+i}}_isClosed(t){return I(this._parameters,t)}allocate(t){return this.layout.createBuffer(t)}elementCount(t){const e=2,i=t.get("position").indices.length/2+1,r=this._isClosed(t);let s=r?2:2*e;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,i,r,s,o){const n=i.get("position"),l=n.indices,h=n.data.length/3,m=i.get("distanceToStart")?.data;l&&l.length!==2*(h-1)&&console.warn("RibbonLineMaterial does not support indices");const f=(this.layout.fields.has("sizeFeatureAttribute")?i.get("sizeFeatureAttribute")?.data[0]:i.get("size")?.data[0])??1;let g=[1,1,1,1],b=0;const S=this.layout.fields.has("colorFeatureAttribute");S?b=i.get("colorFeatureAttribute").data[0]:i.has("color")&&(g=i.get("color").data);const v=i.get("timeStamps")?.data,P=v&&this.layout.fields.has("timeStamps"),y=this.layout.fields.has("opacityFeatureAttribute"),j=y?i.get("opacityFeatureAttribute").data[0]:0,E=new Float32Array(s.buffer),w=_(s.buffer),T=new Uint8Array(s.buffer),A=this.layout.stride/4;let z=o*A;const C=z;let O=0;const L=m?(t,e,i)=>O=m[i]:(t,e,i)=>O+=p(t,e),V=E.BYTES_PER_ELEMENT/w.BYTES_PER_ELEMENT,R=4/V,x=(t,e,i,s,a,o,n,l)=>{E[z++]=e[0],E[z++]=e[1],E[z++]=e[2],k(t,e,w,z*V),z+=R,k(i,e,w,z*V),z+=R,E[z++]=l;let h=z*V;if(w[h++]=a,w[h++]=o,z=Math.ceil(h/V),S)E[z]=b;else{const t=Math.min(4*n,g.length-4),e=4*z;T[e]=255*g[t],T[e+1]=255*g[t+1],T[e+2]=255*g[t+2],T[e+3]=255*g[t+3]}if(z++,E[z++]=f,y&&(E[z++]=j),M()){let t=4*z;r?(T[t++]=r[0],T[t++]=r[1],T[t++]=r[2],T[t++]=r[3]):(T[t++]=0,T[t++]=0,T[t++]=0,T[t++]=0),z=Math.ceil(.25*t)}P&&(h=z*V,w[h++]=s[0],w[h++]=s[1],w[h++]=s[2],w[h++]=s[3],z=Math.ceil(h/V))};z+=A,a(lt,n.data[0],n.data[1],n.data[2]),P&&d(ct,v[0],v[1],v[2],v[3]),t&&u(lt,lt,t);const F=this._isClosed(i);if(F){const e=n.data.length-3;a(nt,n.data[e],n.data[e+1],n.data[e+2]),t&&u(nt,nt,t)}else a(ht,n.data[3],n.data[4],n.data[5]),t&&u(ht,ht,t),x(lt,lt,ht,ct,1,-4,0,0),x(lt,lt,ht,ct,1,4,0,0),c(nt,lt),c(lt,ht),P&&d(ct,v[4],v[5],v[6],v[7]);const N=F?0:1,U=F?h:h-1;for(let p=N;p<U;p++){const e=(p+1)%h*3;a(ht,n.data[e],n.data[e+1],n.data[e+2]),t&&u(ht,ht,t),L(nt,lt,p),x(nt,lt,ht,ct,0,-1,p,O),x(nt,lt,ht,ct,0,1,p,O);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const e=(t+1)/(i+1);x(nt,lt,ht,ct,e,-1,p,O),x(nt,lt,ht,ct,e,1,p,O)}if(x(nt,lt,ht,ct,1,-2,p,O),x(nt,lt,ht,ct,1,2,p,O),c(nt,lt),c(lt,ht),P){const t=(p+1)%h*4;d(ct,v[t],v[t+1],v[t+2],v[t+3])}}F?(a(ht,n.data[3],n.data[4],n.data[5]),t&&u(ht,ht,t),O=L(nt,lt,U),x(nt,lt,ht,ct,0,-1,N,O),x(nt,lt,ht,ct,0,1,N,O)):(O=L(nt,lt,U),x(nt,lt,lt,ct,0,-5,U,O),x(nt,lt,lt,ct,0,5,U,O)),G(E,C+A,E,C,A);return z=G(E,z-A,E,z,A),this._parameters.wireframe&&this._addWireframeVertices(s,C,z,A),null}_addWireframeVertices(t,e,i,r){const s=new Float32Array(t.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,i-e);let o=0;const n=t=>o=G(a,t,s,o,r);for(let l=0;l<a.length-1;l+=2*r)n(l),n(l+2*r),n(l+1*r),n(l+2*r),n(l+1*r),n(l+3*r)}}function G(t,e,i,r,s){for(let a=0;a<s;a++)i[r++]=t[e++];return r}function I(t,e){if(!t.isClosed)return!1;return e.get("position").indices.length>2}function H(t){return 1===t.anchor&&t.hideOnShortSegments&&"begin-end"===t.placement&&t.worldSpace}const K=f(),Q=f(),Z=f(),$=f(),tt=f(),et=i(),it=i(),rt=f(),st=f(),at=P(),ot=P(),nt=f(),lt=f(),ht=f(),ct=b(),mt=[i(),i(),i(),i()],pt=[f(),f(),f(),f()],ut=E(),ft=E(),dt=E(),gt=E();export{q as Parameters,J as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{makeArrayEquals as r}from"../../../../../core/arrayUtils.js";import{clamp as t}from"../../../../../core/mathUtils.js";import{scale as e}from"../../lib/screenSizePerspectiveUtils.js";function i(r,i,o,n,l){let s=o.screenLength*r.pixelRatio;null!=l&&(s=e(s,n,i,l));const c=s*Math.tan(.5*r.fovY)/(.5*r.fullHeight);return t(c*i,o.minWorldLength,o.maxWorldLength)}const o=r();function n(r,t){let e=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(r[i])&&o(n,r[i])||(r[i]=n.slice(),e=!0):r[i]!==n&&(e=!0,r[i]=n))}return e}const l={multiply:1,ignore:2,replace:3,tint:4};export{l as colorMixModes,n as updateParameters,i as verticalOffsetAtDistance};
5
+ import{makeArrayEquals as r}from"../../../../../core/arrayUtils.js";import{clamp as t}from"../../../../../core/mathUtils.js";import{ScreenSizePerspectiveEvaluator as e}from"../../lib/screenSizePerspectiveUtils.js";function i(r,e,i,n,o,l){let a=i.screenLength*r.pixelRatio;null!=o&&(s.update(n,e,o,l),a=s.apply(a));const c=a*Math.tan(.5*r.fovY)/(.5*r.fullHeight);return t(c*e,i.minWorldLength,i.maxWorldLength)}const n=r();function o(r,t){let e=!1;for(const i in t){const o=t[i];void 0!==o&&(Array.isArray(o)?Array.isArray(r[i])&&n(o,r[i])||(r[i]=o.slice(),e=!0):r[i]!==o&&(e=!0,r[i]=o))}return e}const l={multiply:1,ignore:2,replace:3,tint:4},s=new e;export{l as colorMixModes,o as updateParameters,i as verticalOffsetAtDistance};
@@ -2,16 +2,34 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FloatPassUniform as t}from"../core/shaderModules/FloatPassUniform.js";import{glsl as a}from"../core/shaderModules/glsl.js";function e(e,r){if(!r.hasAnimation)return;const{attributes:m,varyings:o,vertex:d,fragment:n}=e;m.add("timeStamps","vec3"),o.add("vTimeStamp","float"),o.add("vFirstTime","float"),o.add("vLastTime","float"),d.main.add(a`vTimeStamp = timeStamps.x;
5
+ import{s as e}from"../../../../chunks/vec42.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Float4PassUniform as a}from"../core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as i}from"../core/shaderModules/FloatPassUniform.js";import{glsl as m}from"../core/shaderModules/glsl.js";function o(t,o){if(!o.hasAnimation)return;const{attributes:d,varyings:r,vertex:l,fragment:T}=t;d.add("timeStamps","vec4"),r.add("vTimeStamp","float"),r.add("vFirstTime","float"),r.add("vLastTime","float"),r.add("vTransitionType","int",{flat:!0}),l.main.add(m`vTimeStamp = timeStamps.x;
6
6
  vFirstTime = timeStamps.y;
7
- vLastTime = timeStamps.z;`);const{animation:s}=r;3===s&&n.constants.add("decayRate","float",2.3),n.code.add(a`
7
+ vLastTime = timeStamps.z;
8
+ vTransitionType = int(timeStamps.w);`);const{animation:f}=o;3===f&&T.constants.add("decayRate","float",2.3),T.code.add(m`
8
9
  float getTrailOpacity(float x) {
9
- ${i(s)}
10
- }`),n.uniforms.add(new t("timeElapsed",t=>t.timeElapsed),new t("trailLength",t=>t.trailLength)).code.add(a`vec4 animate(vec4 color) {
11
- float totalTimeWithTrail = vLastTime - vFirstTime + trailLength;
12
- float timeAtHead = mod(timeElapsed - vFirstTime, totalTimeWithTrail) + vFirstTime;
13
- float t = timeAtHead - vTimeStamp;
14
- vec4 animatedColor = color * step(0.0, t);
15
- animatedColor.a *= getTrailOpacity(t / trailLength);
10
+ ${s(f)}
11
+ }`),T.uniforms.add(new i("timeElapsed",e=>e.timeElapsed),new i("trailLength",e=>e.trailLength),new i("speed",e=>e.animationSpeed),new a("timingOptions",t=>e(n,t.startTime,t.endTime,t.fadeInTime,t.fadeOutTime))),T.code.add(m`float fadeIn(float x) {
12
+ return smoothstep(0.0, timingOptions[2], x);
13
+ }`),T.code.add(m`vec4 animate(vec4 color) {
14
+ float startTime = timingOptions[0];
15
+ float endTime = timingOptions[1];
16
+ float totalTime = vLastTime - vFirstTime;
17
+ float actualEndTime = vTransitionType == 2 ? min(endTime, startTime + vLastTime / speed) : endTime;
18
+ vec4 animatedColor = color;
19
+ float relativeStartTime = mod(startTime, totalTime);
20
+ float vRelativeToHead = mod((timeElapsed - relativeStartTime) * speed - vFirstTime, totalTime) + vFirstTime - vTimeStamp;
21
+ vRelativeToHead += vRelativeToHead < 0.0 ? totalTime : 0.0;
22
+ float vAbsoluteTime = timeElapsed - vRelativeToHead / speed;
23
+ if (vAbsoluteTime > actualEndTime) {
24
+ vRelativeToHead = (timeElapsed - relativeStartTime) * speed - vTimeStamp;
25
+ vAbsoluteTime = timeElapsed - vRelativeToHead / speed;
26
+ }
27
+ animatedColor *= step(startTime, vAbsoluteTime);
28
+ animatedColor *= step(vAbsoluteTime, actualEndTime);
29
+ float fadeOutTime = timingOptions[3];
30
+ animatedColor.a *= isinf(fadeOutTime) || isinf(actualEndTime) ? 1.0 : smoothstep(fadeOutTime, 0.0, timeElapsed - actualEndTime);
31
+ animatedColor.a *= getTrailOpacity(vRelativeToHead / trailLength);
32
+ animatedColor.a *= vTransitionType == 0 ? fadeIn(vAbsoluteTime - startTime) : 1.0;
33
+ animatedColor.a *= fadeIn(vTimeStamp - vFirstTime);
16
34
  return animatedColor;
17
- }`)}function i(t){switch(t){case 2:return"return x >= 0.0 && x <= 1.0 ? 1.0 : 0.0;";case 3:return"float cutOff = exp(-decayRate);\n return (exp(-decayRate * x) - cutOff) / (1.0 - cutOff);";default:return"return 1.0;"}}export{e as AnimatedLine};
35
+ }`)}function s(e){switch(e){case 2:return"return x >= 0.0 && x <= 1.0 ? 1.0 : 0.0;";case 3:return"float cutOff = exp(-decayRate);\n return (exp(-decayRate * x) - cutOff) / (1.0 - cutOff);";default:return"return 1.0;"}}const n=t();export{o as AnimatedLine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r,depthOnlyOutputBuffersOr as l}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as n,depthWrite as o,oitDepthTest as u,blending as c,getDrawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as f,stencilWriteMaskOn as d,stencilToolTransparentOccluderParams as h,depthCompareAlways as m,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as g,depthCompareLess as b}from"../lib/StencilUtils.js";import{R as T}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{makePipelineState as y,defaultColorWrite as O,unpremultipliedAlphaToPremultipliedAlpha as j}from"../../../webgl/renderState.js";class S extends r{constructor(e,t){super(e,t,new i(T,()=>import("./RibbonLine.glsl.js")),v(t).locations),this.primitiveType=t.wireframe?W.LINES:W.TRIANGLE_STRIP}_makePipelineState(e,i){const{oitPass:r,output:s,hasOccludees:h,hasPolygonOffset:m}=e,P=0===r,g=2===r;return y({blending:t(s)?c(r):null,depthTest:{func:u(r)},depthWrite:o(e),drawBuffers:l(s,a(r,s)),colorWrite:O,stencilWrite:h?d:null,stencilTest:h?i?p:f:null,polygonOffset:P||g?m?_:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?_:null,{output:i,hasOccludees:r}=e;this._occluderPipelineTransparent=y({blending:j,polygonOffset:t,depthTest:m,depthWrite:null,colorWrite:O,stencilWrite:null,stencilTest:r?h:null,drawBuffers:l(i)}),this._occluderPipelineOpaque=y({blending:j,polygonOffset:t,depthTest:r?m:b,depthWrite:null,colorWrite:O,stencilWrite:r?g:null,stencilTest:r?P:null,drawBuffers:l(i)}),this._occluderPipelineMaskWrite=y({blending:null,polygonOffset:t,depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:r?d:null,stencilTest:r?p:null,drawBuffers:l(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case 11:return this._occluderPipelineTransparent??super.getPipeline();case 10:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const _={factor:0,units:-4};function v(t){const i=e().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return t.hasVVColor?i.f32("colorFeatureAttribute"):i.vec4u8("color",{glNormalized:!0}),t.hasVVSize?i.f32("sizeFeatureAttribute"):i.f32("size"),t.hasVVOpacity&&i.f32("opacityFeatureAttribute"),s()&&i.vec4u8("olidColor"),t.hasAnimation&&i.vec3f16("timeStamps"),i}export{S as RibbonLineTechnique,v as getLayout};
5
+ import"../../../../core/has.js";import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r,depthOnlyOutputBuffersOr as l}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as s}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as n,depthWrite as o,oitDepthTest as u,blending as c,getDrawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as p,stencilBaseAllZerosParams as f,stencilWriteMaskOn as d,stencilToolTransparentOccluderParams as h,depthCompareAlways as m,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as g,depthCompareLess as b}from"../lib/StencilUtils.js";import{R as T}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as W}from"../../../webgl/enums.js";import{makePipelineState as y,defaultColorWrite as O,unpremultipliedAlphaToPremultipliedAlpha as j}from"../../../webgl/renderState.js";class S extends r{constructor(e,t){super(e,t,new i(T,()=>import("./RibbonLine.glsl.js")),v(t).locations),this.primitiveType=t.wireframe?W.LINES:W.TRIANGLE_STRIP}_makePipelineState(e,i){const{oitPass:r,output:s,hasOccludees:h,hasPolygonOffset:m}=e,P=0===r,g=2===r;return y({blending:t(s)?c(r):null,depthTest:{func:u(r)},depthWrite:o(e),drawBuffers:l(s,a(r,s)),colorWrite:O,stencilWrite:h?d:null,stencilTest:h?i?p:f:null,polygonOffset:P||g?m?_:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?_:null,{output:i,hasOccludees:r}=e;this._occluderPipelineTransparent=y({blending:j,polygonOffset:t,depthTest:m,depthWrite:null,colorWrite:O,stencilWrite:null,stencilTest:r?h:null,drawBuffers:l(i)}),this._occluderPipelineOpaque=y({blending:j,polygonOffset:t,depthTest:r?m:b,depthWrite:null,colorWrite:O,stencilWrite:r?g:null,stencilTest:r?P:null,drawBuffers:l(i)}),this._occluderPipelineMaskWrite=y({blending:null,polygonOffset:t,depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:r?d:null,stencilTest:r?p:null,drawBuffers:l(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case 11:return this._occluderPipelineTransparent??super.getPipeline();case 10:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const _={factor:0,units:-4};function v(t){const i=e().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return t.hasVVColor?i.f32("colorFeatureAttribute"):i.vec4u8("color",{glNormalized:!0}),t.hasVVSize?i.f32("sizeFeatureAttribute"):i.f32("size"),t.hasVVOpacity&&i.f32("opacityFeatureAttribute"),s()&&i.vec4u8("olidColor"),t.hasAnimation&&i.vec4f16("timeStamps"),i}export{S as RibbonLineTechnique,v as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.normalType=1,this.textureCoordinateType=1,this.highStepCount=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1}get overlayEnabled(){return 0!==this.overlayMode}}e([t({count:3})],i.prototype,"overlayMode",void 0),e([t({count:3})],i.prototype,"tileBlendInput",void 0),e([t({count:4})],i.prototype,"transparencyMode",void 0),e([t({count:7})],i.prototype,"pbrMode",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"backfaceCullingEnabled",void 0),e([t()],i.prototype,"textureFadingEnabled",void 0),e([t()],i.prototype,"renderOccluded",void 0),e([t()],i.prototype,"screenSpaceReflections",void 0),e([t()],i.prototype,"cloudReflections",void 0),e([t()],i.prototype,"screenSizePerspective",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"tileBorders",void 0),e([t()],i.prototype,"visualizeNormals",void 0);export{i as TerrainTechniqueConfiguration};
5
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.overlayMode=0,this.tileBlendInput=0,this.transparencyMode=0,this.pbrMode=5,this.receiveShadows=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.screenSpaceReflections=!1,this.cloudReflections=!1,this.receiveAmbientOcclusion=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.normalType=1,this.textureCoordinateType=1,this.highStepCount=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0,this.draped=!1}get overlayEnabled(){return 0!==this.overlayMode}}e([t({count:3})],i.prototype,"overlayMode",void 0),e([t({count:3})],i.prototype,"tileBlendInput",void 0),e([t({count:4})],i.prototype,"transparencyMode",void 0),e([t({count:7})],i.prototype,"pbrMode",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"backfaceCullingEnabled",void 0),e([t()],i.prototype,"textureFadingEnabled",void 0),e([t()],i.prototype,"renderOccluded",void 0),e([t()],i.prototype,"screenSpaceReflections",void 0),e([t()],i.prototype,"cloudReflections",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"tileBorders",void 0),e([t()],i.prototype,"visualizeNormals",void 0);export{i as TerrainTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/unitUtils.js";import{initialize as T}from"../core/workers/workers.js";import{property as R}from"../core/accessorSupport/decorators/property.js";import{cast as x}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as O}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as E,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as H}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as I}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as F}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as P}from"../core/support/OwningCollection.js";import D from"../geometry/Extent.js";import U from"../geometry/HeightModelInfo.js";import G from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as J,isTiledLayer as K,isVoxelLayer as X,isIntegratedMeshLayer as ee}from"../layers/support/layerUtils.js";import{TilemapCache as te}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as ie}from"../portal/portalDefault.js";import{AnalysesCollection as re}from"../support/AnalysesCollection.js";import{WebSceneTag as se}from"../support/tagSymbols.js";import{BreakpointsOwner as ne}from"./BreakpointsOwner.js";import{DOMContainer as ae}from"./DOMContainer.js";import oe from"./GroundView.js";import{PopupView as le}from"./PopupView.js";import pe from"./View.js";import he from"./ViewAnimation.js";import{stringFromViewingMode as de,viewingModeFromString as ue}from"./ViewingMode.js";import{layerView3DImporter as ce}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ge}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as me}from"./3d/camera/intersectionUtils.js";import{Constraints as ye}from"./3d/constraints/Constraints.js";import{EnvironmentManager as fe}from"./3d/environment/EnvironmentManager.js";import we from"./3d/environment/SceneViewEnvironment.js";import ve from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as _e}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as be}from"./3d/layers/graphics/Labeler.js";import Me from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Se}from"./3d/layers/support/StageLayerElevationProvider.js";import Ve from"./3d/state/ViewState.js";import{ViewStateManager as je,cleanupViewStateManager as Ce}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Te}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Re}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as xe}from"./3d/state/utils/navigationUtils.js";import{CombinedElevationProvider as Oe}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Ee}from"./3d/support/debugFlags.js";import Ae from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as He}from"./3d/support/ElevationProvider.js";import{toMap as Le,hitTest as Ie}from"./3d/support/hitTest.js";import{popupHitTest as Fe}from"./3d/support/popupHitTest.js";import Pe from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as De}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ue}from"./3d/support/ResourceController.js";import Ge from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as We}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as qe}from"./3d/support/ViewSlice.js";import{PointsOfInterest as ze}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import ke from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Be,getTiledLayerInfo as Ne,checkIfTileInfoSupportedForView as Qe}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ye}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Ze}from"./3d/terrain/TileRenderer.js";import{Stage as $e}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Je}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as Ke}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as Xe}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as et}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as tt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as it}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import rt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as st}from"./support/drapedUtils.js";import{defaultHighlightName as nt}from"./support/HighlightDefaults.js";import at from"./support/HighlightOptions.js";import{occludeesSupported as ot}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as lt,createScreenPointFromSupportedEvent as pt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ht}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as dt,destroyTextureCompressionWorker as ut}from"./support/TextureCompressionHelper.js";import{check as ct}from"./support/WebGLRequirements.js";import gt from"./ui/DefaultUI.js";import mt from"./ui/3d/DefaultUI3D.js";import yt from"../webscene/Environment.js";import{clearVNodeCache as ft}from"../widgets/support/vnodeCache.js";const wt=Symbol(),vt=Symbol();let _t=class extends(ne(le(ae(pe)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Ue(this),this.deconflictor=new _e({view:this}),this.labeler=new be({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new re,this.basemapTerrain=null,this.elevationProvider=new Oe({view:this}),this._canvas=null,this.constraints=new ye,this._environment=new we,this.environmentManager=new fe,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new rt({importAnalysisViewModule:e=>ge(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.screenSizePerspectiveEnabled=!0,this.state=new Ve({view:this}),this.slice=new qe,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new mt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,T();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new ve({view:this}),this.stateManager=new je({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=dt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new oe({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(ut(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null)}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=bt(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:bt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=bt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=bt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new D({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>s(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof we?e:e instanceof yt?this.environment?.cloneWithWebsceneEnvironment(e)??we.fromWebsceneEnvironment(e):E(we,e):new we}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&se in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){Ae.isValidProfile(e)&&(Ae.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Ae.getDefaultProfile()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?U.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Be(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return de(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?de(this.defaultsFromMap.viewingMode):ht(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find(({name:e})=>e===nt)??new at}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===nt)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Ge(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=lt(e)?pt(this,e):e;return Le(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?He(this.elevationProvider,e):null)??0;return N(e,Mt,this.renderSpatialReference,t),this.state.camera.projectToScreen(Mt,St),V(St[0],St[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,Mt,i);const r=this.state.camera.computeScreenPixelSizeAt(Mt);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e)):1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=lt(e)?pt(this,e):e;return Ie(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Fe(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Je())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ce.importLayerView(e)}hasLayerViewModule(e){return ce.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=ct(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ue(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!ht(e,i)&&(null==t||(!!J(t)||(!K(t)||null!=Ne(t,e,i))&&(!X(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(J(t)&&(r||s)){return!s||2===i||null===Qe(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return K(t)||X(t)||!r&&!s?K(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${de(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ot(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await jt[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new ke({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new ze({view:this})),this.addHandles([this.updatingHandles.add(()=>Ee.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Ee.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.basemapTerrain?.extent,basemapSpatialReference:this.basemapTerrain?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this._ensureFeatureTileTree():this._featureTiles=p(this._featureTiles)},w)],wt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(vt),this.removeHandles(wt),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",De.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.basemapTerrain.spatialReference,Vt,t)||(this.renderCoordsHelper.extent=Vt)},w),vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Xe/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(vt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Re(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new $e({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.updatingHandles.add(()=>this.qualitySettings.highQualityTransparency,e=>this.stage.renderer.setParameters({highQualityTransparency:e}),f),this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Xe/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new We({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.basemapTerrain?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){const e=ue(this.viewingMode);1===e&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const t=this.scene?.initialViewProperties??null,i=t?.environment;i&&(this._overrideDefaultEnvironmentOnly?H(this.environment,i):this.environment=this.environment.cloneWithWebsceneEnvironment(i)),this.timeExtent=t?.timeExtent,t?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(tt);for(const t of this.allLayerViews)ee(t.layer.type)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(tt);for(const t of this.allLayerViews)ee(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){ft(),L(),j(),it(),Ce(),me(),Se(),k(),st(),ie(),Ze(),et(),Te(),xe(),F(),M(),Ke(),Ye(),Me.cleanupI3SLodHandling(),te.cleanupTilemapCache(),Ve.cleanupViewstate(),ke.cleanupTerrainSurface()}};function bt(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([R()],_t.prototype,"_userClippingArea",void 0),e([R()],_t.prototype,"_resourceController",void 0),e([R()],_t.prototype,"stage",null),e([R({readOnly:!0})],_t.prototype,"deconflictor",void 0),e([R({readOnly:!0})],_t.prototype,"labeler",void 0),e([R(P(re,"analyses"))],_t.prototype,"analyses",void 0),e([R({type:he,readOnly:!0})],_t.prototype,"animation",null),e([R({readOnly:!0})],_t.prototype,"basemapTerrain",void 0),e([R({readOnly:!0})],_t.prototype,"elevationProvider",void 0),e([R()],_t.prototype,"camera",null),e([R({type:t})],_t.prototype,"contentCamera",null),e([R({readOnly:!0})],_t.prototype,"canvas",null),e([R({type:G})],_t.prototype,"center",null),e([R({type:D})],_t.prototype,"clippingArea",null),e([R({type:ye,nonNullable:!0})],_t.prototype,"constraints",void 0),e([R({type:D,readOnly:!0})],_t.prototype,"renderDataExtent",null),e([R({readOnly:!0})],_t.prototype,"tileInfo",null),e([R({type:D,readOnly:!0})],_t.prototype,"dataExtent",null),e([R({type:D,readOnly:!0})],_t.prototype,"_groundAndLayersExtent",null),e([R({type:we})],_t.prototype,"environment",null),e([x("environment")],_t.prototype,"castEnvironment",null),e([R({readOnly:!0})],_t.prototype,"environmentManager",void 0),e([R({type:D})],_t.prototype,"extent",null),e([R({type:r})],_t.prototype,"floors",void 0),e([R()],_t.prototype,"screenCenter",null),e([R()],_t.prototype,"frustum",null),e([R({type:Number,readOnly:!0})],_t.prototype,"fullOpacity",void 0),e([R({readOnly:!0})],_t.prototype,"graphicsView",void 0),e([R()],_t.prototype,"analysisViewManager",void 0),e([R()],_t.prototype,"groundView",void 0),e([R({type:Boolean})],_t.prototype,"initialExtentRequired",null),e([R()],_t.prototype,"defaultsFromMapSettings",null),e([R()],_t.prototype,"interacting",null),e([R()],_t.prototype,"stationary",null),e([R()],_t.prototype,"navigating",null),e([R()],_t.prototype,"map",void 0),e([R()],_t.prototype,"padding",null),e([R({type:ze,readOnly:!0})],_t.prototype,"pointsOfInterest",void 0),e([R()],_t.prototype,"_featureTiles",void 0),e([R()],_t.prototype,"featureTiles",null),e([R()],_t.prototype,"_featureTreeDebugger",void 0),e([R({type:Boolean})],_t.prototype,"screenSizePerspectiveEnabled",void 0),e([R({constructOnly:!0})],_t.prototype,"deactivatedWebGLExtensions",void 0),e([R({constructOnly:!0})],_t.prototype,"debugWebGLExtensions",void 0),e([R({constructOnly:!0})],_t.prototype,"renderCanvas",void 0),e([R({constructOnly:!0})],_t.prototype,"state",void 0),e([R({readOnly:!0})],_t.prototype,"inputManager",void 0),e([R({readOnly:!0})],_t.prototype,"stateManager",void 0),e([R({type:["low","medium","high"]})],_t.prototype,"qualityProfile",null),e([R({type:Pe,get(){let e=this._get("qualitySettings");return e||(e=new Pe,Ae.apply(this.qualityProfile,e)),e}})],_t.prototype,"qualitySettings",void 0),e([R()],_t.prototype,"slice",void 0),e([R({readOnly:!0})],_t.prototype,"typeSpecificPreconditionsReady",null),e([R({readOnly:!0})],_t.prototype,"renderCoordsHelper",void 0),e([R({readOnly:!0})],_t.prototype,"sceneIntersectionHelper",void 0),e([R({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],_t.prototype,"resolution",null),e([R({type:Number})],_t.prototype,"scale",null),e([R()],_t.prototype,"heightModelInfo",null),e([R()],_t.prototype,"spatialReference",void 0),e([R({type:Boolean,value:!1})],_t.prototype,"alphaCompositingEnabled",null),e([R({constructOnly:!0})],_t.prototype,"preserveDrawingBufferEnabled",void 0),e([R({type:Boolean})],_t.prototype,"supersampleScreenshotsEnabled",void 0),e([R({readOnly:!0})],_t.prototype,"type",void 0),e([R(),x(e=>e instanceof gt?e:A(mt,e))],_t.prototype,"ui",void 0),e([R({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],_t.prototype,"updating",null),e([R()],_t.prototype,"_updatingObjects",null),e([R()],_t.prototype,"_updatingObjectsWithProgress",null),e([R({type:Number,readOnly:!0,dependsOn:["updating"]})],_t.prototype,"updatingProgress",void 0),e([R({type:["global","local"]})],_t.prototype,"viewingMode",null),e([R({type:i})],_t.prototype,"viewpoint",null),e([R({readOnly:!0})],_t.prototype,"visibleArea",null),e([R({type:Number})],_t.prototype,"zoom",null),e([R({type:at})],_t.prototype,"highlightOptions",null),e([R({readOnly:!0})],_t.prototype,"quality",null),e([R({readOnly:!0})],_t.prototype,"resolutionScale",null),e([R()],_t.prototype,"focusAreasView",void 0),e([R()],_t.prototype,"_defaultToMapOptions",null),e([R()],_t.prototype,"_defaultHitTestOptions",null),_t=e([O("esri.views.SceneView")],_t);const Mt=I(),St=S(),Vt=Y(),jt={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Ct=_t;export{Ct as default};
5
+ import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/unitUtils.js";import{initialize as T}from"../core/workers/workers.js";import{property as R}from"../core/accessorSupport/decorators/property.js";import{cast as x}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as O}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as E,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as H}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as I}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as P}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as F}from"../core/support/OwningCollection.js";import D from"../geometry/Extent.js";import U from"../geometry/HeightModelInfo.js";import G from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as J,isTiledLayer as K,isVoxelLayer as X,isIntegratedMeshLayer as ee}from"../layers/support/layerUtils.js";import{TilemapCache as te}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as ie}from"../portal/portalDefault.js";import{AnalysesCollection as re}from"../support/AnalysesCollection.js";import{WebSceneTag as se}from"../support/tagSymbols.js";import{BreakpointsOwner as ne}from"./BreakpointsOwner.js";import{DOMContainer as ae}from"./DOMContainer.js";import oe from"./GroundView.js";import{PopupView as le}from"./PopupView.js";import pe from"./View.js";import he from"./ViewAnimation.js";import{stringFromViewingMode as de,viewingModeFromString as ue}from"./ViewingMode.js";import{layerView3DImporter as ce}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as ge}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as me}from"./3d/camera/intersectionUtils.js";import{Constraints as ye}from"./3d/constraints/Constraints.js";import{EnvironmentManager as fe}from"./3d/environment/EnvironmentManager.js";import we from"./3d/environment/SceneViewEnvironment.js";import ve from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as _e}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as be}from"./3d/layers/graphics/Labeler.js";import Me from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Se}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as Ve}from"./3d/state/ScreenSizePerspective.js";import je from"./3d/state/ViewState.js";import{ViewStateManager as Ce,cleanupViewStateManager as Te}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Re}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as xe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Oe}from"./3d/state/utils/navigationUtils.js";import{CombinedElevationProvider as Ee}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Ae}from"./3d/support/debugFlags.js";import He from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Le}from"./3d/support/ElevationProvider.js";import{toMap as Ie,hitTest as Pe}from"./3d/support/hitTest.js";import{popupHitTest as Fe}from"./3d/support/popupHitTest.js";import De from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ue}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ge}from"./3d/support/ResourceController.js";import We from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as qe}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as ze}from"./3d/support/ViewSlice.js";import{PointsOfInterest as ke}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Be from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ne,getTiledLayerInfo as Qe,checkIfTileInfoSupportedForView as Ye}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ze}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as $e}from"./3d/terrain/TileRenderer.js";import{Stage as Je}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Ke}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as Xe}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as et}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as tt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as it}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as rt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import st from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as nt}from"./support/drapedUtils.js";import{defaultHighlightName as at}from"./support/HighlightDefaults.js";import ot from"./support/HighlightOptions.js";import{occludeesSupported as lt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as pt,createScreenPointFromSupportedEvent as ht}from"./support/screenUtils.js";import{isSpatialReferenceSupported as dt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as ut,destroyTextureCompressionWorker as ct}from"./support/TextureCompressionHelper.js";import{check as gt}from"./support/WebGLRequirements.js";import mt from"./ui/DefaultUI.js";import yt from"./ui/3d/DefaultUI3D.js";import ft from"../webscene/Environment.js";import{clearVNodeCache as wt}from"../widgets/support/vnodeCache.js";const vt=Symbol(),_t=Symbol();let bt=class extends(ne(le(ae(pe)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Ge(this),this.deconflictor=new _e({view:this}),this.labeler=new be({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new re,this.basemapTerrain=null,this.elevationProvider=new Ee({view:this}),this._canvas=null,this.constraints=new ye,this._environment=new we,this.environmentManager=new fe,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new st({importAnalysisViewModule:e=>ge(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new je({view:this}),this.slice=new ze,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new yt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,T();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new ve({view:this}),this.stateManager=new Ce({view:this}),this.screenSizePerspective=new Ve({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=ut(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new oe({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(ct(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=Mt(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Mt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=Mt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=Mt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new D({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>s(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof we?e:e instanceof ft?this.environment?.cloneWithWebsceneEnvironment(e)??we.fromWebsceneEnvironment(e):E(we,e):new we}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&se in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){He.isValidProfile(e)&&(He.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||He.getDefaultProfile()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?U.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ne(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return de(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?de(this.defaultsFromMap.viewingMode):dt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find(({name:e})=>e===at)??new ot}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===at)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new We(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=pt(e)?ht(this,e):e;return Ie(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?Le(this.elevationProvider,e):null)??0;return N(e,St,this.renderSpatialReference,t),this.state.camera.projectToScreen(St,Vt),V(Vt[0],Vt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,St,i);const r=this.state.camera.computeScreenPixelSizeAt(St);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e)):1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=pt(e)?ht(this,e):e;return Pe(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return Fe(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Ke())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ce.importLayerView(e)}hasLayerViewModule(e){return ce.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=gt(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ue(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!dt(e,i)&&(null==t||(!!J(t)||(!K(t)||null!=Qe(t,e,i))&&(!X(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(J(t)&&(r||s)){return!s||2===i||null===Ye(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return K(t)||X(t)||!r&&!s?K(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${de(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&lt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Ct[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Be({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new ke({view:this})),this.addHandles([this.updatingHandles.add(()=>Ae.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Ae.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.basemapTerrain?.extent,basemapSpatialReference:this.basemapTerrain?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this._ensureFeatureTileTree():this._featureTiles=p(this._featureTiles)},w)],vt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(_t),this.removeHandles(vt),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ue.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.basemapTerrain.spatialReference,jt,t)||(this.renderCoordsHelper.extent=jt)},w),_t),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(et/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(_t),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new xe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Je({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.updatingHandles.add(()=>this.qualitySettings.highQualityTransparency,e=>this.stage.renderer.setParameters({highQualityTransparency:e}),f),this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(et/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new qe({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.basemapTerrain?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ue(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?H(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(it);for(const t of this.allLayerViews)ee(t.layer.type)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(it);for(const t of this.allLayerViews)ee(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){wt(),L(),j(),rt(),Te(),me(),Se(),k(),nt(),ie(),$e(),tt(),Re(),Oe(),P(),M(),Xe(),Ze(),Me.cleanupI3SLodHandling(),te.cleanupTilemapCache(),je.cleanupViewstate(),Be.cleanupTerrainSurface()}};function Mt(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([R()],bt.prototype,"_userClippingArea",void 0),e([R()],bt.prototype,"_resourceController",void 0),e([R()],bt.prototype,"stage",null),e([R({readOnly:!0})],bt.prototype,"deconflictor",void 0),e([R({readOnly:!0})],bt.prototype,"labeler",void 0),e([R(F(re,"analyses"))],bt.prototype,"analyses",void 0),e([R({type:he,readOnly:!0})],bt.prototype,"animation",null),e([R({readOnly:!0})],bt.prototype,"basemapTerrain",void 0),e([R({readOnly:!0})],bt.prototype,"elevationProvider",void 0),e([R()],bt.prototype,"camera",null),e([R({type:t})],bt.prototype,"contentCamera",null),e([R({readOnly:!0})],bt.prototype,"canvas",null),e([R({type:G})],bt.prototype,"center",null),e([R({type:D})],bt.prototype,"clippingArea",null),e([R({type:ye,nonNullable:!0})],bt.prototype,"constraints",void 0),e([R({type:D,readOnly:!0})],bt.prototype,"renderDataExtent",null),e([R({readOnly:!0})],bt.prototype,"tileInfo",null),e([R({type:D,readOnly:!0})],bt.prototype,"dataExtent",null),e([R({type:D,readOnly:!0})],bt.prototype,"_groundAndLayersExtent",null),e([R({type:we})],bt.prototype,"environment",null),e([x("environment")],bt.prototype,"castEnvironment",null),e([R({readOnly:!0})],bt.prototype,"environmentManager",void 0),e([R({type:D})],bt.prototype,"extent",null),e([R({type:r})],bt.prototype,"floors",void 0),e([R()],bt.prototype,"screenCenter",null),e([R()],bt.prototype,"frustum",null),e([R({type:Number,readOnly:!0})],bt.prototype,"fullOpacity",void 0),e([R({readOnly:!0})],bt.prototype,"graphicsView",void 0),e([R()],bt.prototype,"analysisViewManager",void 0),e([R()],bt.prototype,"groundView",void 0),e([R({type:Boolean})],bt.prototype,"initialExtentRequired",null),e([R()],bt.prototype,"defaultsFromMapSettings",null),e([R()],bt.prototype,"interacting",null),e([R()],bt.prototype,"stationary",null),e([R()],bt.prototype,"navigating",null),e([R()],bt.prototype,"map",void 0),e([R()],bt.prototype,"padding",null),e([R({type:ke,readOnly:!0})],bt.prototype,"pointsOfInterest",void 0),e([R()],bt.prototype,"_featureTiles",void 0),e([R()],bt.prototype,"featureTiles",null),e([R()],bt.prototype,"_featureTreeDebugger",void 0),e([R({constructOnly:!0})],bt.prototype,"deactivatedWebGLExtensions",void 0),e([R({constructOnly:!0})],bt.prototype,"debugWebGLExtensions",void 0),e([R({constructOnly:!0})],bt.prototype,"renderCanvas",void 0),e([R({constructOnly:!0})],bt.prototype,"state",void 0),e([R()],bt.prototype,"screenSizePerspective",void 0),e([R({readOnly:!0})],bt.prototype,"inputManager",void 0),e([R({readOnly:!0})],bt.prototype,"stateManager",void 0),e([R({type:["low","medium","high"]})],bt.prototype,"qualityProfile",null),e([R({type:De,get(){let e=this._get("qualitySettings");return e||(e=new De,He.apply(this.qualityProfile,e)),e}})],bt.prototype,"qualitySettings",void 0),e([R()],bt.prototype,"slice",void 0),e([R({readOnly:!0})],bt.prototype,"typeSpecificPreconditionsReady",null),e([R({readOnly:!0})],bt.prototype,"renderCoordsHelper",void 0),e([R({readOnly:!0})],bt.prototype,"sceneIntersectionHelper",void 0),e([R({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],bt.prototype,"resolution",null),e([R({type:Number})],bt.prototype,"scale",null),e([R()],bt.prototype,"heightModelInfo",null),e([R()],bt.prototype,"spatialReference",void 0),e([R({type:Boolean,value:!1})],bt.prototype,"alphaCompositingEnabled",null),e([R({constructOnly:!0})],bt.prototype,"preserveDrawingBufferEnabled",void 0),e([R({type:Boolean})],bt.prototype,"supersampleScreenshotsEnabled",void 0),e([R({readOnly:!0})],bt.prototype,"type",void 0),e([R(),x(e=>e instanceof mt?e:A(yt,e))],bt.prototype,"ui",void 0),e([R({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],bt.prototype,"updating",null),e([R()],bt.prototype,"_updatingObjects",null),e([R()],bt.prototype,"_updatingObjectsWithProgress",null),e([R({type:Number,readOnly:!0,dependsOn:["updating"]})],bt.prototype,"updatingProgress",void 0),e([R({type:["global","local"]})],bt.prototype,"viewingMode",null),e([R({type:i})],bt.prototype,"viewpoint",null),e([R({readOnly:!0})],bt.prototype,"visibleArea",null),e([R({type:Number})],bt.prototype,"zoom",null),e([R({type:ot})],bt.prototype,"highlightOptions",null),e([R({readOnly:!0})],bt.prototype,"quality",null),e([R({readOnly:!0})],bt.prototype,"resolutionScale",null),e([R()],bt.prototype,"focusAreasView",void 0),e([R()],bt.prototype,"_defaultToMapOptions",null),e([R()],bt.prototype,"_defaultHitTestOptions",null),bt=e([O("esri.views.SceneView")],bt);const St=I(),Vt=S(),jt=Y(),Ct={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Tt=bt;export{Tt as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{valueInUnit as e,zeroSquareMeters as t,zeroMeters as o,createLength as n,zeroDegreesGeographic as i}from"../../../core/quantityUtils.js";import{getMetersPerVerticalUnitForSR as r}from"../../../core/unitUtils.js";import{ensureType as a}from"../../../core/accessorSupport/ensureType.js";import c from"../../../geometry/Point.js";import{absoluteHeightElevationInfo as l,getConvertedElevationFromXYZ as s}from"../../../support/elevationInfoUtils.js";import{getDrawHelpMessage as p}from"./helpMessageUtils.js";import{getDrawMeshHelpMessage as u}from"./helpMessageUtils3d.js";import{getConstraintContext as m}from"../../interactive/sketch/constraintUtils.js";import{updateTooltipInfoFromMeshTransform as d}from"../../interactive/tooltip/tooltipCommonUtils.js";import{DrawCircleTooltipInfo as f}from"../../interactive/tooltip/infos/DrawCircleTooltipInfo.js";import{DrawMeshTooltipInfo as y}from"../../interactive/tooltip/infos/DrawMeshTooltipInfo.js";import{DrawMultipointTooltipInfo as g}from"../../interactive/tooltip/infos/DrawMultipointTooltipInfo.js";import{DrawPointTooltipInfo as w}from"../../interactive/tooltip/infos/DrawPointTooltipInfo.js";import{DrawPolygonTooltipInfo as h}from"../../interactive/tooltip/infos/DrawPolygonTooltipInfo.js";import{DrawPolylineTooltipInfo as v}from"../../interactive/tooltip/infos/DrawPolylineTooltipInfo.js";import{DrawRectangleTooltipInfo as O}from"../../interactive/tooltip/infos/DrawRectangleTooltipInfo.js";import{directionForVertices as k}from"../../support/angularMeasurementUtils.js";import{elevationFromZ as M,elevationFromPoint as x}from"../../support/euclideanLengthMeasurementUtils.js";function D(e,t){return{point:new w({sketchOptions:t,viewType:e}),multipoint:new g({sketchOptions:t,viewType:e}),polyline:new v({sketchOptions:t,viewType:e}),polygon:new h({sketchOptions:t,viewType:e}),mesh:new y({sketchOptions:t,viewType:e}),rectangle:new O({sketchOptions:t}),circle:new f({sketchOptions:t})}}function T(e){const{directionOptions:t,geometryType:o,sketchOptions:n,tooltipInfos:i}=e,r=t=>{const o=N(e).mode,n=i[t].elevation;"relative-to-ground"===o||"relative-to-scene"===o||"on-the-ground"===o?n.lock(W(e)):n.unlock()},a=e=>{if(t){const o=i[e].direction;o.committed=t.angle,o.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(o){case"polygon":case"polyline":r(o),a(o);break;case"point":case"mesh":r(o)}}function j(e,t){const{drawOperation:o,view:n}=t,i=b(t),r=N(t);if("2d"===n.type||!e||"absolute-height"!==r.mode||1!==o?.numCommittedVertices||!i||"draw-polyline"!==i.type&&"draw-polygon"!==i.type||i.elevation.locked)return;const[a,c,l]=e,s=K(a,c,l,r,t);null!=s&&i.elevation.lock(s)}function U(e){b(e)?.allFields.forEach(e=>{e.unlockOnVertexPlacement&&e.unlock()})}function b({geometryType:e,graphic:t,tooltipInfos:o}){return t?.geometry?.type!==P[e]?"circle"===e||"rectangle"===e?o[e]:null:o[e]}const P={point:"point",multipoint:"multipoint",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon",freehandPolygon:"polygon",freehandPolyline:"polyline"};function I(e,t){switch(e?.type){case"draw-point":L(e,t);break;case"draw-multipoint":V(e,t);break;case"draw-polyline":z(e,t);break;case"draw-polygon":A(e,t);break;case"draw-rectangle":F(e,t);break;case"draw-circle":H(e,t);break;case"draw-mesh":G(e,t)}}function L(e,t){const o=t.graphic?.geometry;"point"===o?.type&&(S(e,o,t),e.helpMessage=p("point",o,t.drawOperation.drawingMode))}function V(e,t){const o=t.graphic?.geometry;"multipoint"===o?.type&&(S(e,o,t),e.helpMessage=p("multipoint",o,t.drawOperation.drawingMode))}function G(e,t){const{graphic:o,view:n}=t,i=o?.geometry;"3d"!==n.type||i&&"mesh"!==i.type||(S(e,i?.origin,t),i&&d(e,i),e.helpMessage=u(o,n))}function S(e,t,o){const{drawOperation:n,view:i,sketchOptions:r}=o,{cursorVertex:a}=n;e.sketchOptions=r,e.viewType=i.type;const c="multipoint"===t?.type?t.getPoint(t.points.length-1):t;if(e.setLocationFromPoint(c,Q(o)),R(e.elevation,o),!a)return void(n.constraints=void 0);const l=a;n.constraints={context:$(l,o),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function z(e,t){const{createOperationGeometry:n,drawOperation:i,automaticLengthMeasurementUtils:r}=t,a=null!=n?n.full:null;a&&"polyline"!==a.type||(Z(e,t),e.totalLength.actual=i.lastVertex?(a?r.autoLength2D(a):null)??o:null,e.helpMessage=p("polyline",a,t.drawOperation.drawingMode))}function A(e,o){const{createOperationGeometry:n,drawOperation:i}=o,r=null!=n?n.full:null;r&&"polygon"!==r.type||(Z(e,o),e.area.actual=i.lastVertex?(r?o.automaticAreaMeasurementUtils.autoArea2D(r):null)??t:null,e.helpMessage=p("polygon",r,o.drawOperation.drawingMode))}const B=a(c);function Z(e,t){const{drawOperation:n,sketchOptions:r,view:a,automaticLengthMeasurementUtils:c}=t,{cursorVertex:l,lastVertex:s,secondToLastVertex:p}=n,u=r.values.effectiveDirectionMode;e.sketchOptions=r,e.viewType=a.type;const m=s&&l?c.autoDistanceBetweenPoints2D(B(s),B(l))??o:null;if(e.distance.actual=m,e.distance.readOnly=null==s,e.direction.actual=null,e.direction.readOnly=!0,s&&l&&("absolute"===u||p)){const t=k(p,s,l,u);e.direction.actual=t??i,e.direction.readOnly=!1}e.setLocationFromPoint(l,Q(t)),R(e.elevation,t);const d=C(s,t);e.xyMode=d,e.direction.visible="direction-distance"===d,e.distance.visible="direction-distance"===d,e.effectiveX.visible="coordinates"===d,e.effectiveY.visible="coordinates"===d;const f=l??s;n.constraints=f?{context:$(f,t),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:e.distance.committed,direction:e.direction.committed}:void 0}function C(e,{sketchOptions:t}){const o=t.tooltips.xyMode;return"auto"===o?e?"direction-distance":"coordinates":o}function F(e,t){e.sketchOptions=t.sketchOptions,e.xSize=E(t),e.ySize=X(t),e.area=q(t),e.helpMessage=p("rectangle",t.graphic?.geometry,t.drawOperation.drawingMode)}function H(e,t){const{forceUniformSize:o,sketchOptions:n}=t;e.sketchOptions=n,e.radius=o?Y(t):null,e.xSize=o?null:E(t),e.ySize=o?null:X(t),e.area=q(t),e.helpMessage=p("circle",t.graphic?.geometry,t.drawOperation.drawingMode)}function R(e,t){const{drawOperation:o}=t,n=o?.cursorVertex??o?.lastVertex;e.actual=x(n)??W(t),e.visible=o.hasZ,e.readOnly=!1,e.showAsZ=!0}function q(e){const o=e.createOperationGeometry?.full;return"polygon"!==o?.type?t:e.automaticAreaMeasurementUtils.autoArea2D(o)??t}function E({createOperationGeometry:e,automaticLengthMeasurementUtils:t}){const n=e?.rectangle?.midpoints;return(null!=n?t.autoDistanceBetweenPoints2D(n.left,n.right):null)??o}function X({createOperationGeometry:e,automaticLengthMeasurementUtils:t}){const n=e?.rectangle?.midpoints;return(null!=n?t.autoDistanceBetweenPoints2D(n.top,n.bottom):null)??o}function Y({createOperationGeometry:e,automaticLengthMeasurementUtils:t}){return(null!=e?.circle?.center&&null!=e.circle.edge?t.autoDistanceBetweenPoints2D(e.circle.center,e.circle.edge):null)??o}function J(t){const{geometryType:o,tooltipInfos:n}=t;switch(o){case"point":case"multipoint":case"mesh":case"polyline":case"polygon":{const i=n[o].elevation.committed;if(!i)return;return e(i,"meters")/r(Q(t))}default:return}}function K(e,t,o,n,i){const{view:r,drawOperation:a}=i;if("3d"!==r.type||!a)return;o??=0;const c=Q(i),l=N(i),p=s(r,e,t,o,c,l,n);return M(p,c)??W(i)}function N(e){return e.drawOperation.elevationInfo??l}function Q(e){return e.drawOperation.coordinateHelper.spatialReference}function W(e){const t=r(Q(e));return n(e.defaultZ*t,"meters")}function $(e,t){return m(e,t.view,Q(t),N(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}export{D as createTooltipInfos,b as getActiveTooltipInfo,J as getConstraintZ,T as initializeConstraints,j as lockElevationOnVertexAdd,U as unlockConstraintsOnVertexAddOrRemove,I as updateTooltipInfo};
5
+ import{valueInUnit as e,zeroSquareMeters as t,zeroMeters as o,createLength as n,zeroDegreesGeographic as i}from"../../../core/quantityUtils.js";import{getMetersPerVerticalUnitForSR as r}from"../../../core/unitUtils.js";import{ensureType as a}from"../../../core/accessorSupport/ensureType.js";import c from"../../../geometry/Point.js";import{absoluteHeightElevationInfo as l,getConvertedElevationFromXYZ as s}from"../../../support/elevationInfoUtils.js";import{getDrawHelpMessage as p}from"./helpMessageUtils.js";import{getDrawMeshHelpMessage as u}from"./helpMessageUtils3d.js";import{getConstraintContext as m}from"../../interactive/sketch/constraintUtils.js";import{updateTooltipInfoFromMeshTransform as d}from"../../interactive/tooltip/tooltipCommonUtils.js";import{DrawCircleTooltipInfo as f}from"../../interactive/tooltip/infos/DrawCircleTooltipInfo.js";import{DrawMeshTooltipInfo as y}from"../../interactive/tooltip/infos/DrawMeshTooltipInfo.js";import{DrawMultipointTooltipInfo as g}from"../../interactive/tooltip/infos/DrawMultipointTooltipInfo.js";import{DrawPointTooltipInfo as w}from"../../interactive/tooltip/infos/DrawPointTooltipInfo.js";import{DrawPolygonTooltipInfo as h}from"../../interactive/tooltip/infos/DrawPolygonTooltipInfo.js";import{DrawPolylineTooltipInfo as v}from"../../interactive/tooltip/infos/DrawPolylineTooltipInfo.js";import{DrawRectangleTooltipInfo as O}from"../../interactive/tooltip/infos/DrawRectangleTooltipInfo.js";import{directionForVertices as k}from"../../support/angularMeasurementUtils.js";import{elevationFromZ as M,elevationFromPoint as x}from"../../support/euclideanLengthMeasurementUtils.js";function D(e,t){return{point:new w({sketchOptions:t,viewType:e}),multipoint:new g({sketchOptions:t,viewType:e}),polyline:new v({sketchOptions:t,viewType:e}),polygon:new h({sketchOptions:t,viewType:e}),mesh:new y({sketchOptions:t,viewType:e}),rectangle:new O({sketchOptions:t}),circle:new f({sketchOptions:t})}}function T(e){const{directionOptions:t,geometryType:o,sketchOptions:n,tooltipInfos:i}=e,r=t=>{const o=N(e).mode,n=i[t].elevation;"relative-to-ground"===o||"relative-to-scene"===o||"on-the-ground"===o?n.lock(W(e)):n.unlock()},a=e=>{if(t){const o=i[e].direction;o.committed=t.angle,o.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(o){case"polygon":case"polyline":r(o),a(o);break;case"point":case"mesh":r(o)}}function j(e,t){const{drawOperation:o,view:n}=t,i=b(t),r=N(t);if("2d"===n.type||!e||"absolute-height"!==r.mode||1!==o?.numCommittedVertices||!i||"draw-polyline"!==i.type&&"draw-polygon"!==i.type||i.elevation.locked)return;const[a,c,l]=e,s=K(a,c,l,r,t);null!=s&&i.elevation.lock(s)}function U(e){b(e)?.allFields.forEach(e=>{e.unlockOnVertexPlacement&&e.unlock()})}function b({geometryType:e,graphic:t,tooltipInfos:o}){return t?.geometry?.type!==P[e]?"circle"===e||"rectangle"===e?o[e]:null:o[e]}const P={point:"point",multipoint:"multipoint",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon",freehandPolygon:"polygon",freehandPolyline:"polyline",text:"point"};function I(e,t){switch(e?.type){case"draw-point":L(e,t);break;case"draw-multipoint":V(e,t);break;case"draw-polyline":z(e,t);break;case"draw-polygon":A(e,t);break;case"draw-rectangle":F(e,t);break;case"draw-circle":H(e,t);break;case"draw-mesh":G(e,t)}}function L(e,t){const o=t.graphic?.geometry;"point"===o?.type&&(S(e,o,t),e.helpMessage=p("point",o,t.drawOperation.drawingMode))}function V(e,t){const o=t.graphic?.geometry;"multipoint"===o?.type&&(S(e,o,t),e.helpMessage=p("multipoint",o,t.drawOperation.drawingMode))}function G(e,t){const{graphic:o,view:n}=t,i=o?.geometry;"3d"!==n.type||i&&"mesh"!==i.type||(S(e,i?.origin,t),i&&d(e,i),e.helpMessage=u(o,n))}function S(e,t,o){const{drawOperation:n,view:i,sketchOptions:r}=o,{cursorVertex:a}=n;e.sketchOptions=r,e.viewType=i.type;const c="multipoint"===t?.type?t.getPoint(t.points.length-1):t;if(e.setLocationFromPoint(c,Q(o)),R(e.elevation,o),!a)return void(n.constraints=void 0);const l=a;n.constraints={context:$(l,o),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function z(e,t){const{createOperationGeometry:n,drawOperation:i,automaticLengthMeasurementUtils:r}=t,a=null!=n?n.full:null;a&&"polyline"!==a.type||(Z(e,t),e.totalLength.actual=i.lastVertex?(a?r.autoLength2D(a):null)??o:null,e.helpMessage=p("polyline",a,t.drawOperation.drawingMode))}function A(e,o){const{createOperationGeometry:n,drawOperation:i}=o,r=null!=n?n.full:null;r&&"polygon"!==r.type||(Z(e,o),e.area.actual=i.lastVertex?(r?o.automaticAreaMeasurementUtils.autoArea2D(r):null)??t:null,e.helpMessage=p("polygon",r,o.drawOperation.drawingMode))}const B=a(c);function Z(e,t){const{drawOperation:n,sketchOptions:r,view:a,automaticLengthMeasurementUtils:c}=t,{cursorVertex:l,lastVertex:s,secondToLastVertex:p}=n,u=r.values.effectiveDirectionMode;e.sketchOptions=r,e.viewType=a.type;const m=s&&l?c.autoDistanceBetweenPoints2D(B(s),B(l))??o:null;if(e.distance.actual=m,e.distance.readOnly=null==s,e.direction.actual=null,e.direction.readOnly=!0,s&&l&&("absolute"===u||p)){const t=k(p,s,l,u);e.direction.actual=t??i,e.direction.readOnly=!1}e.setLocationFromPoint(l,Q(t)),R(e.elevation,t);const d=C(s,t);e.xyMode=d,e.direction.visible="direction-distance"===d,e.distance.visible="direction-distance"===d,e.effectiveX.visible="coordinates"===d,e.effectiveY.visible="coordinates"===d;const f=l??s;n.constraints=f?{context:$(f,t),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:e.distance.committed,direction:e.direction.committed}:void 0}function C(e,{sketchOptions:t}){const o=t.tooltips.xyMode;return"auto"===o?e?"direction-distance":"coordinates":o}function F(e,t){e.sketchOptions=t.sketchOptions,e.xSize=E(t),e.ySize=X(t),e.area=q(t),e.helpMessage=p("rectangle",t.graphic?.geometry,t.drawOperation.drawingMode)}function H(e,t){const{forceUniformSize:o,sketchOptions:n}=t;e.sketchOptions=n,e.radius=o?Y(t):null,e.xSize=o?null:E(t),e.ySize=o?null:X(t),e.area=q(t),e.helpMessage=p("circle",t.graphic?.geometry,t.drawOperation.drawingMode)}function R(e,t){const{drawOperation:o}=t,n=o?.cursorVertex??o?.lastVertex;e.actual=x(n)??W(t),e.visible=o.hasZ,e.readOnly=!1,e.showAsZ=!0}function q(e){const o=e.createOperationGeometry?.full;return"polygon"!==o?.type?t:e.automaticAreaMeasurementUtils.autoArea2D(o)??t}function E({createOperationGeometry:e,automaticLengthMeasurementUtils:t}){const n=e?.rectangle?.midpoints;return(null!=n?t.autoDistanceBetweenPoints2D(n.left,n.right):null)??o}function X({createOperationGeometry:e,automaticLengthMeasurementUtils:t}){const n=e?.rectangle?.midpoints;return(null!=n?t.autoDistanceBetweenPoints2D(n.top,n.bottom):null)??o}function Y({createOperationGeometry:e,automaticLengthMeasurementUtils:t}){return(null!=e?.circle?.center&&null!=e.circle.edge?t.autoDistanceBetweenPoints2D(e.circle.center,e.circle.edge):null)??o}function J(t){const{geometryType:o,tooltipInfos:n}=t;switch(o){case"point":case"multipoint":case"mesh":case"polyline":case"polygon":{const i=n[o].elevation.committed;if(!i)return;return e(i,"meters")/r(Q(t))}default:return}}function K(e,t,o,n,i){const{view:r,drawOperation:a}=i;if("3d"!==r.type||!a)return;o??=0;const c=Q(i),l=N(i),p=s(r,e,t,o,c,l,n);return M(p,c)??W(i)}function N(e){return e.drawOperation.elevationInfo??l}function Q(e){return e.drawOperation.coordinateHelper.spatialReference}function W(e){const t=r(Q(e));return n(e.defaultZ*t,"meters")}function $(e,t){return m(e,t.view,Q(t),N(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}export{D as createTooltipInfos,b as getActiveTooltipInfo,J as getConstraintZ,T as initializeConstraints,j as lockElevationOnVertexAdd,U as unlockConstraintsOnVertexAddOrRemove,I as updateTooltipInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{set as o,dot as i,min as r,max as t,subtract as s,add as n,scale as e,projectAndScale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as c,f,K as m,g}from"../../../../chunks/vec32.js";import{fromValues as p,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as b,u as I}from"../../../../chunks/boundedPlane.js";import{sv2d as N}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as l}from"../operations/MoveVertex.js";import{RotateVertex as d}from"../operations/RotateVertex.js";import{ScaleVertex as j}from"../operations/ScaleVertex.js";import{UpdateVertices as x}from"../operations/UpdateVertices.js";function V(o,i){return E(o,i,!1)}function T(o,i){return E(o,i,!0)}function E(o,i,r){if(o instanceof x){if(o.operation instanceof l)return h(o.operation,i,r),!0;if(o.operation instanceof d)return v(o.operation,i,r),!0;if(o.operation instanceof j)return F(o.operation,i,r),!0}return!1}function h(o,i,r=!1){const t=r?-1:1,s=p(t*o.dx,t*o.dy,t*o.dz);f(i.origin,i.origin,s),I(i)}function v(o,i,r=!1){const t=r?-o.angle:o.angle;m(i.basis1,i.basis1,u,t),m(i.basis2,i.basis2,u,t),I(i)}function F(o,i,r=!1){const t=r?1/o.factor1:o.factor1,s=r?1/o.factor2:o.factor2;g(i.basis1,i.basis1,t),g(i.basis2,i.basis2,s),a(i.origin,i.origin,o.origin,o.axis1,t),a(i.origin,i.origin,o.origin,o.axis2,s),I(i)}function S(a,m,g,p,u=!1){p||(p=b());const l=o(N.get(),a[1],-a[0]),d=o(N.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),j=o(N.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),x=N.get(),V=m.allVerticesUnordered;V.forEach(({pos:s})=>{o(x,i(a,s),i(l,s)),r(d,d,x),t(j,j,x)});const T=1e-6,E=o(N.get(),j[0]-d[0]<T?g/2:0,j[1]-d[1]<T?g/2:0);s(d,d,E),n(j,j,E);const h=u?V.reduce((o,i)=>o+(i.pos[2]??0),0)/V.length:0;return e(p.basis1,a,(j[0]-d[0])/2),e(p.basis2,l,(j[1]-d[1])/2),c(p.origin,d[0]*a[0]+d[1]*l[0],d[0]*a[1]+d[1]*l[1],h),f(p.origin,p.origin,p.basis1),f(p.origin,p.origin,p.basis2),I(p),p}export{V as apply,T as applyInverse,S as calculateOrientedBounds};
5
+ import{set as o,dot as i,min as r,max as t,subtract as s,add as n,scale as e,projectAndScale as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as c,f,K as m,g}from"../../../../chunks/vec32.js";import{fromValues as p,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as b,u as I}from"../../../../chunks/boundedPlane.js";import{sv2d as N}from"../../../../geometry/support/vectorStacks.js";import{MoveVertex as l}from"../operations/MoveVertex.js";import{RotateVertex as d}from"../operations/RotateVertex.js";import{ScaleVertex as j}from"../operations/ScaleVertex.js";import{UpdateVertices as x}from"../operations/UpdateVertices.js";function V(o,i){return E(o,i,!1)}function T(o,i){return E(o,i,!0)}function E(o,i,r){if(o instanceof x){if(o.operation instanceof l)return h(o.operation,i,r),!0;if(o.operation instanceof d)return v(o.operation,i,r),!0;if(o.operation instanceof j)return F(o.operation,i,r),!0}return!1}function h(o,i,r=!1){const t=r?-1:1,s=p(t*o.dx,t*o.dy,t*o.dz);f(i.origin,i.origin,s),I(i)}function v(o,i,r=!1){const t=r?-o.angle:o.angle;m(i.basis1,i.basis1,u,t),m(i.basis2,i.basis2,u,t),I(i)}function F(o,i,r=!1){const t=r?1/o.factor1:o.factor1,s=r?1/o.factor2:o.factor2;g(i.basis1,i.basis1,t),g(i.basis2,i.basis2,s),a(i.origin,i.origin,o.origin,o.axis1,t),a(i.origin,i.origin,o.origin,o.axis2,s),I(i)}function S(a,m,g,p,u=!1){p||(p=b());const l=o(N.get(),a[1],-a[0]),d=o(N.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),j=o(N.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),x=N.get(),V=m.allVerticesUnordered;V.forEach(({pos:s})=>{o(x,i(a,s),i(l,s)),r(d,d,x),t(j,j,x)});const T=1e-6,E=o(N.get(),j[0]-d[0]<T?g/2:0,j[1]-d[1]<T?g/2:0);s(d,d,E),n(j,j,E);const h=u?V.reduce((o,i)=>o+(i.pos[2]??0),0)/V.length:0;return e(p.basis1,a,(j[0]-d[0])/2),e(p.basis2,l,(j[1]-d[1])/2),c(p.origin,d[0]*a[0]+d[1]*l[0],d[0]*a[1]+d[1]*l[1],h),f(p.origin,p.origin,p.basis1),f(p.origin,p.origin,p.basis2),I(p),p}export{V as apply,T as applyInverse,S as calculateOrientedBounds};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{i as r}from"../../../../../chunks/vec32.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{h as e,c as o,j as t}from"../../../../../chunks/boundedPlane.js";function c(s,o){return e(o.extent,a),t(a,r(n,s.x,s.y,0))}const a=o(),n=s();export{c as distanceToTile};
5
+ import{i as r}from"../../../../../chunks/vec32.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{h as e,a as o,j as t}from"../../../../../chunks/boundedPlane.js";function a(s,o){return e(o.extent,c),t(c,r(n,s.x,s.y,0))}const c=o(),n=s();export{a as distanceToTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../core/Evented.js";import r from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../geometry/SpatialReference.js";import{toExtent as s}from"../../geometry/support/aaBoundingRect.js";import{extentContainsXYZ as a}from"../../geometry/support/contains.js";import{updateGeometryElevation as l}from"../../layers/support/ElevationSampler.js";import{elevationNoDataValue as p}from"../3d/terrain/TerrainConst.js";let m=class extends t{constructor(e){super(e),this.noDataValue=p}initialize(){this.view.basemapTerrain.on("elevation-change",()=>this.emit("changed",{}))}get demResolution(){return this.view.basemapTerrain.demResolution}get extent(){const e=this.view.basemapTerrain;if(null==e?.extent||null==e.spatialReference)return null;const t=s(e.extent,e.spatialReference);return t.zmin=e.visibleElevationBounds.min,t.zmax=e.visibleElevationBounds.max,t}get spatialReference(){return this.view.basemapTerrain?.spatialReference??i.WGS84}elevationAt(e,t){if(null==this.extent||!a(this.extent,e,t)){const o=null!=this.extent?`${this.extent.xmin}, ${this.extent.ymin}, ${this.extent.xmax}, ${this.extent.ymax}`:null;return r.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${o})`),this.noDataValue}return this.view.elevationProvider.getElevation(e,t,0,this.spatialReference,"ground")??this.noDataValue}queryElevation(e){return l(e.clone(),this)}};e([o({readOnly:!0})],m.prototype,"demResolution",null),e([o({readOnly:!0})],m.prototype,"extent",null),e([o({readOnly:!0})],m.prototype,"noDataValue",void 0),e([o()],m.prototype,"spatialReference",null),e([o({constructOnly:!0})],m.prototype,"view",void 0),m=e([n("esri.views.support.GroundViewElevationSampler")],m);const u=m;export{u as default};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../core/Evented.js";import r from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import i from"../../geometry/SpatialReference.js";import{toExtent as s}from"../../geometry/support/aaBoundingRect.js";import{extentContainsXYZ as a}from"../../geometry/support/contains.js";import{updateGeometryElevation as l}from"../../layers/support/ElevationSampler.js";import{elevationNoDataValue as p}from"../3d/terrain/TerrainConst.js";let m=class extends t{constructor(e){super(e),this.noDataValue=p}initialize(){this.view.basemapTerrain.on("elevation-change",()=>this.emit("changed",{}))}get demResolution(){return this.view.basemapTerrain.demResolution}get extent(){const e=this.view.basemapTerrain;if(null==e?.extent||null==e.spatialReference)return null;const t=s(e.extent,e.spatialReference);return t.zmin=e.visibleElevationBounds.min,t.zmax=e.visibleElevationBounds.max,t}get spatialReference(){return this.view.basemapTerrain?.spatialReference??i.WGS84}elevationAt(e,t){if(null==this.extent||!a(this.extent,e,t)){const o=null!=this.extent?`${this.extent.xmin}, ${this.extent.ymin}, ${this.extent.xmax}, ${this.extent.ymax}`:null;return r.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${o})`),this.noDataValue}return this.view.elevationProvider?.getElevation(e,t,0,this.spatialReference,"ground")??this.noDataValue}queryElevation(e){return l(e.clone(),this)}};e([o({readOnly:!0})],m.prototype,"demResolution",null),e([o({readOnly:!0})],m.prototype,"extent",null),e([o({readOnly:!0})],m.prototype,"noDataValue",void 0),e([o()],m.prototype,"spatialReference",null),e([o({constructOnly:!0})],m.prototype,"view",void 0),m=e([n("esri.views.support.GroundViewElevationSampler")],m);const u=m;export{u as default};