@arcgis/core 4.34.0-next.30 → 4.34.0-next.31

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 (81) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0ca8d6516323fc28dd58.js +1 -0
  4. package/assets/esri/core/workers/chunks/{031c4b4bf78079d0002d.js → 36024406932b0a44a74a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{4e267a813e8b10d10b3b.js → 37bfc1a771792b6697fd.js} +121 -140
  6. package/assets/esri/core/workers/chunks/42c5d957813080143e5a.js +1 -0
  7. package/assets/esri/core/workers/chunks/6269c4bbf0f224a954e9.js +1 -0
  8. package/assets/esri/core/workers/chunks/871da12fb3029177df6f.js +1 -0
  9. package/assets/esri/core/workers/chunks/8abcf9d3343dd8d45103.js +1 -0
  10. package/assets/esri/core/workers/chunks/ac88e0aabbd6c1f1ec98.js +1 -0
  11. package/assets/esri/core/workers/chunks/{e7209654ecdfde926272.js → eec36628e638e244f452.js} +1 -1
  12. package/chunks/ComponentShader.glsl.js +34 -33
  13. package/chunks/DefaultMaterial.glsl.js +25 -25
  14. package/chunks/Path.glsl.js +20 -24
  15. package/chunks/RealisticTree.glsl.js +18 -20
  16. package/chunks/Terrain.glsl.js +32 -33
  17. package/chunks/WaterSurface.glsl.js +16 -16
  18. package/config.js +1 -1
  19. package/core/workers/registry.js +1 -1
  20. package/interfaces.d.ts +22 -25
  21. package/kernel.js +1 -1
  22. package/layers/MapImageLayer.js +1 -1
  23. package/package.json +1 -1
  24. package/portal/schemas/definitions.js +1 -1
  25. package/support/revision.js +1 -1
  26. package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
  27. package/views/3d/environment/Precipitation.js +1 -1
  28. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  29. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  30. package/views/3d/layers/FlowSubView3D.js +1 -1
  31. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  32. package/views/3d/layers/MediaLayerView3D.js +1 -1
  33. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  34. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  35. package/views/3d/support/engineContent/line.js +1 -1
  36. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  37. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  38. package/views/3d/support/flow/FlowWorker.js +5 -0
  39. package/views/3d/support/flow/FlowWorkerHandle.js +5 -0
  40. package/views/3d/support/flow/geometryUtils.js +1 -1
  41. package/views/3d/support/flow/loadUtils.js +1 -1
  42. package/views/3d/support/hitTest.js +1 -1
  43. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  44. package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
  45. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -5
  46. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToReadShadowMap.glsl.js +7 -0
  47. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +11 -0
  48. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +1 -1
  49. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
  50. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -2
  51. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  52. package/views/3d/webgl-engine/lib/TextureUpdater.js +1 -1
  53. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  54. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  55. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  56. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  57. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  58. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  59. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  60. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  61. package/views/SceneView.js +1 -1
  62. package/views/View.js +1 -1
  63. package/views/draw/support/Box.js +1 -1
  64. package/views/draw/support/Reshape.js +1 -1
  65. package/views/webgl/RenderingContext.js +1 -1
  66. package/views/webgl/Util.js +1 -1
  67. package/views/webgl/checkWebGLError.js +1 -1
  68. package/views/webgl/testFloatBufferBlend.js +1 -1
  69. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  70. package/widgets/Editor/workflowUtils.js +1 -1
  71. package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
  72. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  73. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  74. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  75. package/widgets/Sketch/SketchViewModel.js +1 -1
  76. package/widgets/UtilityNetworkTrace.js +1 -1
  77. package/assets/esri/core/workers/chunks/278df50f2c557be81808.js +0 -1
  78. package/assets/esri/core/workers/chunks/2931fd6bb123200622c2.js +0 -1
  79. package/assets/esri/core/workers/chunks/4cf2894bda9e38af8790.js +0 -1
  80. package/assets/esri/core/workers/chunks/6a0777cf1270fcab4574.js +0 -1
  81. package/assets/esri/core/workers/chunks/9723512bc9db4a301c72.js +0 -1
@@ -2,7 +2,7 @@
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{addCalculateLinearDepth as e}from"./ForwardLinearDepth.glsl.js";import{glsl as r}from"../shaderModules/glsl.js";function o(o){e(o),o.vertex.code.add(r`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
5
+ import{addCalculateLinearDepth as e}from"./ForwardLinearDepthToWriteShadowMap.glsl.js";import{glsl as r}from"../shaderModules/glsl.js";function o(o){e(o),o.vertex.code.add(r`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
6
6
  vec4 eye = view * vec4(pos, 1.0);
7
7
  depth = calculateLinearDepth(nearFar,eye.z);
8
8
  return proj * eye;
@@ -2,7 +2,7 @@
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{addNearFar as o}from"../ForwardLinearDepth.glsl.js";import{SliceDraw as r}from"../Slice.glsl.js";import{Transform as e}from"../Transform.glsl.js";import{NormalAttribute as t}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as i}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as a}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as s}from"../attributes/VertexNormal.glsl.js";import{OutputDepth as l}from"../output/OutputDepth.glsl.js";import{OutputHighlight as d}from"../output/OutputHighlight.glsl.js";import{VisualVariables as n}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as c}from"../util/DiscardOrAdjustAlpha.glsl.js";import{addProjViewLocalOrigin as u}from"../util/View.glsl.js";import{glsl as p,If as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as m}from"../../shaderModules/Texture2DPassUniform.js";function f(f,g){const{vertex:x,fragment:O,varyings:j}=f,{hasColorTexture:h,alphaDiscardMode:w}=g,V=h&&1!==w,{output:C,normalType:b,hasColorTextureTransform:A}=g;switch(C){case 2:u(x,g),f.include(e,g),O.include(r,g),f.include(a,g),V&&O.uniforms.add(new m("tex",o=>o.texture)),x.main.add(p`vpos = getVertexInLocalOriginSpace();
5
+ import{addNearFar as o}from"../ForwardLinearDepthToWriteShadowMap.glsl.js";import{SliceDraw as r}from"../Slice.glsl.js";import{Transform as e}from"../Transform.glsl.js";import{NormalAttribute as t}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as i}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as a}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as s}from"../attributes/VertexNormal.glsl.js";import{OutputDepth as l}from"../output/OutputDepth.glsl.js";import{OutputHighlight as d}from"../output/OutputHighlight.glsl.js";import{VisualVariables as n}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as c}from"../util/DiscardOrAdjustAlpha.glsl.js";import{addProjViewLocalOrigin as u}from"../util/View.glsl.js";import{glsl as p,If as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as m}from"../../shaderModules/Texture2DPassUniform.js";function f(f,g){const{vertex:x,fragment:O,varyings:j}=f,{hasColorTexture:h,alphaDiscardMode:w}=g,V=h&&1!==w,{output:C,normalType:b,hasColorTextureTransform:A}=g;switch(C){case 2:u(x,g),f.include(e,g),O.include(r,g),f.include(a,g),V&&O.uniforms.add(new m("tex",o=>o.texture)),x.main.add(p`vpos = getVertexInLocalOriginSpace();
6
6
  vpos = subtractOrigin(vpos);
7
7
  vpos = addVerticalOffset(vpos, localOrigin);
8
8
  gl_Position = transformPosition(proj, view, vpos);
@@ -2,10 +2,14 @@
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{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{calculateUVZShadowPass as e,calculateUVZShadowDraw as a,ReadShadowMapOrigin as r}from"./calculateUVZShadow.glsl.js";import{ShadowmapFiltering as s}from"./ShadowmapFiltering.glsl.js";import{glsl as d}from"../../shaderModules/glsl.js";import{Texture2DShadowBindUniform as t}from"../../shaderModules/Texture2DShadowBindUniform.js";import{NoParameters as i}from"../../../../../webgl/NoParameters.js";class l extends r{}class n extends i{constructor(){super(...arguments),this.origin=o()}}function c(o,a){a.receiveShadows&&(o.include(e),u(o))}function h(o,e){e.receiveShadows&&(o.include(a),u(o))}function u(o){o.include(s);const{fragment:e}=o;e.uniforms.add(new t("shadowMap",o=>o.shadowMap.depthTexture)),e.code.add(d`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
5
+ import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ForwardLinearDepthToReadShadowMap as o}from"../ForwardLinearDepthToReadShadowMap.glsl.js";import{calculateUVZShadowPass as e,calculateUVZShadowDraw as r,ReadShadowMapOrigin as t}from"./calculateUVZShadow.glsl.js";import{ShadowmapFiltering as d}from"./ShadowmapFiltering.glsl.js";import{FloatBindUniform as i}from"../../shaderModules/FloatBindUniform.js";import{If as l,glsl as n}from"../../shaderModules/glsl.js";import{Texture2DShadowBindUniform as s}from"../../shaderModules/Texture2DShadowBindUniform.js";import{NoParameters as c}from"../../../../../webgl/NoParameters.js";class h extends t{}class m extends c{constructor(){super(...arguments),this.origin=a()}}function p(a,o){o.receiveShadows&&a.include(e),u(a,o)}function f(a,o){o.receiveShadows&&a.include(r),u(a,o)}function u(a,e){a.fragment.uniforms.add(new i("lightingGlobalFactor",a=>a.lighting.globalFactor));const{receiveShadows:r,spherical:t}=e;a.include(o,e),r&&w(a),a.fragment.code.add(n`
6
+ float readShadow(float additionalAmbientScale, vec3 vpos) {
7
+ return ${r?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":l(t,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
8
+ }
9
+ `)}function w(a){a.include(d);const{fragment:o}=a;o.uniforms.add(new s("shadowMap",a=>a.shadowMap.depthTexture)),o.code.add(n`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
6
10
  vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap,0));
7
11
  if (uvzShadow.z < 0.0) {
8
12
  return 0.0;
9
13
  }
10
14
  return readShadowMapUVZ(uvzShadow, shadowMap);
11
- }`)}export{h as ReadShadowMapDraw,l as ReadShadowMapDrawParameters,c as ReadShadowMapPass,n as ReadShadowMapPassParameters};
15
+ }`)}export{f as ReadShadowMapDraw,h as ReadShadowMapDrawParameters,p as ReadShadowMapPass,m as ReadShadowMapPassParameters};
@@ -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"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Logger.js";import{isPromiseLike as o,isAbortError as i}from"../../../../core/promiseUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{isUpdatableTexture as a}from"./ITexture.js";import{TextureUpdater as d}from"./TextureUpdater.js";import{TaskPriority as l}from"../../../support/Scheduler.js";let h=class extends t{constructor(e){super({}),this._stage=e,this._textures=new Map,this._loadingCount=0,this.events=new r.EventEmitter,this.updater=new d,this._frameTask=e.view.resourceController.scheduler.registerTask(l.TEXTURE_UNLOAD)}normalizeCtorArgs(){return{}}destroy(){this._frameTask.remove(),this._stage.forEachTexture(e=>e.unload())}get updating(){return this._loadingCount>0||this._frameTask.updating}acquire(e){const t=this._textures.get(e);return t?(t.ref(),t.loadingPromise??t):this._createNewRef(e)}update(){this.updater.run()&&this.events.emit("changed",0)}_createNewRef(e){const t=this._stage.getTexture(e);if(null==t)return null;const r=t.events.on("unloaded",()=>{r.remove(),this._onTextureUnloaded(t)}),n=new p(e,()=>{this._frameTask.schedule(()=>{n.isUnreferenced&&t.unload()})});return this._textures.set(e,n),n.ref(),t.loaded?(this._updateGLTexture(n,t.glTexture),a(t)&&this.updater.add(t),n):(this._loadingCount++,n.loadingPromise=this._stage.schedule(()=>{const e=t.load(this._stage.renderView.renderingContext),r=e=>(this._loadingCount--,n.loadingPromise=null,this._updateGLTexture(n,e),a(t)&&this.updater.add(t),n),u=e=>(this._loadingCount--,n.loadingPromise=null,i(e)||s.getLogger(this).error(e),null);return o(e)?e.then(r,u):r(e)}),n.loadingPromise)}_updateGLTexture(e,t){e.glTexture=t,this.events.emit("changed",1)}_onTextureUnloaded(e){this._textures.delete(e.id),this.updater.remove(e)}};e([n()],h.prototype,"_loadingCount",void 0),e([n()],h.prototype,"_frameTask",void 0),e([n()],h.prototype,"updating",null),h=e([u("esri.views.3d.webgl-engine.lib.TextureRepository")],h);class p{constructor(e,t){this.id=e,this._release=t,this._refCount=0}get isUnreferenced(){return 0===this._refCount}ref(){++this._refCount}release(){--this._refCount,this._refCount>0||(0!==this._refCount?(s.getLogger("esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl").error("Cannot dereference texture that has no references!"),this._refCount=0):this._release())}}export{h as TextureRepository};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Logger.js";import{isPromiseLike as o,isAbortError as i}from"../../../../core/promiseUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{isUpdatableTexture as a}from"./ITexture.js";import{TextureUpdater as d}from"./TextureUpdater.js";import{TaskPriority as l}from"../../../support/Scheduler.js";let h=class extends t{constructor(e){super({}),this._stage=e,this._textures=new Map,this._loadingCount=0,this.events=new r.EventEmitter,this.updater=new d,this._frameTask=e.view.resourceController.scheduler.registerTask(l.TEXTURE_UNLOAD)}normalizeCtorArgs(){return{}}destroy(){this._frameTask.remove(),this.updater.destroy(),this._textures.forEach(e=>e.unload())}get updating(){return this._loadingCount>0||this._frameTask.updating}acquire(e){const t=this._textures.get(e);return t?(t.ref(),t.loadingPromise??t):this._createNewRef(e)}update(){this.updater.run()&&this.events.emit("changed",0)}_createNewRef(e){const t=this._stage.getTexture(e);if(null==t)return null;const r=t.events.on("unloaded",()=>{r.remove(),this._onTextureUnloaded(t)}),n=new p(t,()=>{this._frameTask.schedule(()=>{n.isUnreferenced&&t.unload()})});return this._textures.set(e,n),n.ref(),t.loaded?(this._updateGLTexture(n,t.glTexture),a(t)&&this.updater.add(t),n):(this._loadingCount++,n.loadingPromise=this._stage.schedule(()=>{const e=t.load(this._stage.renderView.renderingContext),r=e=>(this._loadingCount--,n.loadingPromise=null,this._updateGLTexture(n,e),a(t)&&this.updater.add(t),n),u=e=>(t.unload(),this._loadingCount--,n.loadingPromise=null,i(e)||s.getLogger(this).error(e),null);return o(e)?e.then(r,u):r(e)}),n.loadingPromise)}_updateGLTexture(e,t){e.glTexture=t,this.events.emit("changed",1)}_onTextureUnloaded(e){this._textures.delete(e.id),this.updater.remove(e)}};e([n()],h.prototype,"_loadingCount",void 0),e([n()],h.prototype,"_frameTask",void 0),e([n()],h.prototype,"updating",null),h=e([u("esri.views.3d.webgl-engine.lib.TextureRepository")],h);class p{constructor(e,t){this._texture=e,this._release=t,this._refCount=0}get id(){return this._texture.id}get isUnreferenced(){return 0===this._refCount}ref(){++this._refCount}release(){--this._refCount,this._refCount>0||(0!==this._refCount?(s.getLogger("esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl").error("Cannot dereference texture that has no references!"),this._refCount=0):this._release())}unload(){this._texture.unload()}}export{h as TextureRepository};
@@ -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
- class t{constructor(){this._updating=new Map}add(t){this._updating.set(t.id,new e(t))}remove(t){this._updating.delete(t.id)}run(){let t=!1;return this._updating.forEach(e=>{const s=e.texture.update(e.previousToken);s>=0&&s!==e.previousToken&&(e.previousToken=s,t=!0)}),t}}class e{constructor(t){this.texture=t,this.previousToken=-1}}export{t as TextureUpdater};
5
+ class t{constructor(){this._updating=new Map}destroy(){this._updating.clear()}add(t){this._updating.set(t.id,new e(t))}remove(t){this._updating.delete(t.id)}run(){let t=!1;return this._updating.forEach(e=>{const s=e.texture.update(e.previousToken);s>=0&&s!==e.previousToken&&(e.previousToken=s,t=!0)}),t}}class e{constructor(t){this.texture=t,this.previousToken=-1}}export{t as TextureUpdater};
@@ -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{isSome as t}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Error.js";import{someMap as r,getOrCreateMapValue as s}from"../../../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{isAborted as i,throwIfAborted as o}from"../../../../../core/promiseUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d,e as u,t as m}from"../../../../../chunks/vec32.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{debugFlags as g}from"../../../support/debugFlags.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import{newLayout as v}from"../../../support/buffer/InterleavedLayout.js";import b from"../../../webgl/RenderCamera.js";import{AsyncRenderPlugin as I}from"../../effects/RenderPlugin.js";import{Default3D as C}from"../DefaultVertexAttributeLocations.js";import{DepthRange as D}from"../DepthRange.js";import{assert as R}from"../Util.js";import{InstanceData as E}from"./InstanceData.js";import{InstanceOctree as L}from"./InstanceOctree.js";import{LevelSelector as x}from"./LevelSelector.js";import{LodLevel as j}from"./LodLevel.js";import{RenderInstanceData as S}from"./RenderInstanceData.js";import{colorMixModes as w}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as M}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as A}from"../../shaders/DefaultMaterialTechnique.js";import{defaultHighlightName as O}from"../../../../support/HighlightDefaults.js";import{TaskPriority as U,noBudget as T}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as F,unbindVertexBufferLayout as q}from"../../../../webgl/Util.js";const H=e=>{const t=e.baseBoundingSphere.radius,n=e.levels.map(e=>e.minScreenSpaceRadius);return new x(t,n)};let B=class extends I{constructor(e,t){super(e),this.type=6,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDataMap=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new b,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>!!this._hasTransparentLevels()&&this._produces(e)]]),this._instanceData=new E({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(t.registerTask(U.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=P(this.optionalFields),this._glInstanceBufferLayout=y(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDataMap.values()]}get _allRenderInstanceDataExceptHighlightShadow(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDataMap)t[0]!==O&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDataMap.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get hasEmissions(){return this._levels.some(e=>e.components.some(e=>e.material.hasEmissions))}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((e,n)=>{const r=this._allRenderInstanceData[0][n].size+this._allRenderInstanceData[1][n].size,s=e.triangleCount;t.push({renderedInstances:r,renderedTriangles:r*s,trianglesPerInstance:s})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(e=[]){const{rctx:t}=this._context.renderContext;return this.symbol.levels.map(n=>{e.push(new S(t,this._instanceBufferLayout))}),e}async initializeRenderContext(e,n){this._context=e,this._createRenderInstanceDataArray(this._defaultRenderInstanceData);const r=await Promise.allSettled(this.symbol.levels.map(t=>j.create(e,t,n))),s=r.map(e=>"fulfilled"===e.status?e.value:null).filter(t);if(i(n)||s.length!==r.length){s.forEach(e=>e.destroy()),o(n);for(const e of r)if("rejected"===e.status)throw e.reason}this._levels=s,this._levelSelector=H(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDataMap.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(e=>{const t=e.material.produces.get(4);return t?.(0)}))}hasHighlights(){return r(this._highlightRenderInstanceDataMap,e=>e.some(e=>e.size>0))}_produces(e){return(8!==e||this.hasHighlights())&&(5!==e||this.hasHighlight(O))}prepareRender(e){if(!g.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(T),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const n=new Array,r=this.levels;return t.forEach(t=>r.forEach(({components:r},s)=>r.forEach(r=>n.push(this._beginComponent(e,t[s],r))))),n}render(e,t){const n=this._getInstanceDatas(e);if(!n||null==t)return;let r=0;e.rctx.bindVAO();const s=this.levels;n.forEach(n=>s.forEach(({components:s},a)=>s.forEach(s=>this._renderComponent(e,t[r++],n[a],s,a))))}_getInstanceDatas(e){const{output:t,bind:n}=e,r=8===t,s=5===t,a=6!==t;if(!r&&!s)return a?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;const{_highlightRenderInstanceDataMap:i}=this;if(a){if(r){const e=n.highlight?.name;if(!e)return null;const t=i.get(e);return t?[t]:null}const e=i.get(O);return s?e?[e]:null:Array.from(i.values())}return null}intersect(e,t,n,r){if(!this.baseMaterial.visible||null==this._octree)return;const s=f();d(s,r,n);const a=s=>{this._instanceData.getCombinedModelTransform(s,k),e.transform.set(k),m(G,n,e.transform.inverse),m(Y,r,e.transform.inverse);const a=this._instanceData.getState(s),i=this._instanceData.getLodLevel(s),o=this._levels.length;R(!!(18&a),"invalid instance state"),R(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,G,Y,s,this.metadata,o)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(n,s,a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new L(e,this.baseBoundingSphere);for(let n=0;n<e.capacity;++n)18&t.get(n)&&this._octreeCached.addInstance(n)}return this._octreeCached}_invalidateOctree(){this._octreeCached=a(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return new D;const t=e.viewForward,n=this._octree.findClosest(t,1,e.frustum),r=this._octree.findClosest(t,-1,e.frustum);if(null==n||null==r)return new D;const s=e.eye,a=this._instanceData.view;a.boundingSphere.getVec(n,W),d(W,W,s);const i=u(W,t)-W[3];a.boundingSphere.getVec(r,W),d(W,W,s);const o=u(W,t)+W[3];return new D(i,o)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:a}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));const i=this._instanceData,o=i.view;let l=i.size;const c=i.capacity;let h=this._instanceIndex;const d=Math.ceil(c/500),{_highlightRenderInstanceDataMap:u}=this;for(let m=0;m<l&&!e.done;++m){h===this._cycleStartIndex&&this._startUpdateCycle();const m=o.state.get(h);let f=0;if(!(1&m)){h=h+1===c?0:h+1,l++;continue}const p=o.lodLevel.get(h);if(2&m&&this._defaultRenderInstanceData[p].freeTail(),16&m){const e=i.geHighlightOptionsPrev(h);if(e){const t=u.get(e);if(!t)throw new n("internal:lod-renderer","Internal error in lodRenderer");t[p].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),u.delete(e))}}if(32&m)i.freeInstance(h);else if(4&m){let e=0;if(t&&(o.modelOrigin.getVec(h,z),e=a.selectLevel(z,i.getCombinedMedianScaleFactor(h),r)),f=-83&m,e>=0)if(8&m){const t=i.getHighlightName(h);if(t){const r=()=>{const e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e},a=s(u,t,r);if(e>=a.length)throw new n("internal:lod-renderer",`LodRenderer internal error - missing lodLevel ${e}`);V(a[e],o,h)}f|=16}else V(this._defaultRenderInstanceData[e],o,h),f|=2;o.state.set(h,f),o.lodLevel.set(h,e)}else f=-83&m,o.state.set(h,f);if(null!=this._octreeCached){const e=!!(18&m),t=!!(18&f);!e&&t?this._octreeCached.addInstance(h):e&&!t?this._octreeCached.removeInstance(h):e&&t&&64&m&&(this._octreeCached.removeInstance(h),this._octreeCached.addInstance(h))}h=h+1===c?0:h+1,h%d===0&&e.madeProgress()}this._instanceIndex=h,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,n){if(0===t.size)return null;const r=n.glMaterials.load(e.rctx,e.bind.slot,e.output);return r?.beginSlot(e.bind)}_renderComponent(e,t,n,r,s){if(!t)return;const{bind:a,rctx:i}=e;i.runAppleAmdDriverHelper();const o=i.bindTechnique(t,a,r.material.parameters,$);i.bindVAO(r.vao),t.ensureAttributeLocations(r.vao),g.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&0===e.output&&(o.setUniform4fv("externalColor",Z[Math.min(s,Z.length-1)]),o.setUniform1i("symbolColorMixMode",w.replace));const l=n.capacity,c=n.headIndex,h=n.tailIndex,d=n.firstIndex,u=this._glInstanceBufferLayout,m=(e,s)=>{F(i,C,n.buffer,u,e),i.drawArraysInstanced(t.primitiveType,0,r.vertexCount,s-e),q(i,C,n.buffer,u)};r.material.transparent&&null!=d?c>h?(R(d>=h&&d<=c,"invalid firstIndex"),m(d,c),m(h,d)):c<h&&(d<=c?(R(d>=0&&d<=c,"invalid firstIndex"),m(d,c),m(h,l),m(0,d)):(R(d>=h&&d<=l,"invalid firstIndex"),m(d,l),m(0,c),m(h,d))):c>h?m(h,c):c<h&&(m(0,c),m(h,l)),i.bindVAO(null)}};function V(e,t,n){const r=e.allocateHead();N(t,n,e.view,r)}function N(e,t,n,r){M(e.modelOrigin,t,n.modelOriginHi,n.modelOriginLo,r),n.model.copyFrom(r,e.model,t),n.modelNormal.copyFrom(r,e.modelNormal,t),e.color&&n.color&&n.color.copyFrom(r,e.color,t),e.objectAndLayerIdColor&&n.objectAndLayerIdColor&&n.objectAndLayerIdColor.copyFrom(r,e.objectAndLayerIdColor,t),e.featureAttribute&&n.featureAttribute&&n.featureAttribute.copyFrom(r,e.featureAttribute,t)}function P(e){let t=v().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");return null!=e&&e.includes("featureAttribute")&&(t=t.vec4f("instanceFeatureAttribute")),null!=e&&e.includes("color")&&(t=t.vec4u8("instanceColor")),null!=e&&e.includes("objectAndLayerIdColor")&&(t=t.vec4u8("instanceObjectAndLayerIdColor")),t}e([l({constructOnly:!0})],B.prototype,"symbol",void 0),e([l({constructOnly:!0})],B.prototype,"optionalFields",void 0),e([l({constructOnly:!0})],B.prototype,"metadata",void 0),e([l({constructOnly:!0})],B.prototype,"shaderTransformation",void 0),e([l()],B.prototype,"_instanceData",void 0),e([l()],B.prototype,"_cycleStartIndex",void 0),e([l({readOnly:!0})],B.prototype,"_enableLevelSelection",null),e([l()],B.prototype,"_updateCyclesWithStaticCamera",void 0),e([l({readOnly:!0})],B.prototype,"running",null),B=e([c("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],B);const z=f(),W=p(),k=h(),G=f(),Y=f(),Z=[_(1,0,1,1),_(0,0,1,1),_(0,1,0,1),_(1,1,0,1),_(1,0,0,1)],$=new A;export{B as LodRenderer};
5
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import n from"../../../../../core/Error.js";import{someMap as r,getOrCreateMapValue as s}from"../../../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{isAborted as i,throwIfAborted as o}from"../../../../../core/promiseUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d,e as u,t as m}from"../../../../../chunks/vec32.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{debugFlags as g}from"../../../support/debugFlags.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import{newLayout as v}from"../../../support/buffer/InterleavedLayout.js";import b from"../../../webgl/RenderCamera.js";import{AsyncRenderPlugin as I}from"../../effects/RenderPlugin.js";import{Default3D as C}from"../DefaultVertexAttributeLocations.js";import{DepthRange as D}from"../DepthRange.js";import{assert as R}from"../Util.js";import{InstanceData as E}from"./InstanceData.js";import{InstanceOctree as L}from"./InstanceOctree.js";import{LevelSelector as x}from"./LevelSelector.js";import{LodLevel as j}from"./LodLevel.js";import{RenderInstanceData as S}from"./RenderInstanceData.js";import{colorMixModes as w}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as M}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as A}from"../../shaders/DefaultMaterialTechnique.js";import{defaultHighlightName as O}from"../../../../support/HighlightDefaults.js";import{TaskPriority as U,noBudget as T}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as F}from"../../../../webgl/Util.js";const q=e=>{const t=e.baseBoundingSphere.radius,n=e.levels.map(e=>e.minScreenSpaceRadius);return new x(t,n)};let H=class extends I{constructor(e,t){super(e),this.type=6,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDataMap=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new b,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>!!this._hasTransparentLevels()&&this._produces(e)]]),this._instanceData=new E({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(t.registerTask(U.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=N(this.optionalFields),this._glInstanceBufferLayout=y(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDataMap.values()]}get _allRenderInstanceDataExceptHighlightShadow(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDataMap)t[0]!==O&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDataMap.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get hasEmissions(){return this._levels.some(e=>e.components.some(e=>e.material.hasEmissions))}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((e,n)=>{const r=this._allRenderInstanceData[0][n].size+this._allRenderInstanceData[1][n].size,s=e.triangleCount;t.push({renderedInstances:r,renderedTriangles:r*s,trianglesPerInstance:s})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(e=[]){const{rctx:t}=this._context.renderContext;return this.symbol.levels.map(n=>{e.push(new S(t,this._instanceBufferLayout))}),e}async initializeRenderContext(e,n){this._context=e,this._createRenderInstanceDataArray(this._defaultRenderInstanceData);const r=await Promise.allSettled(this.symbol.levels.map(t=>j.create(e,t,n))),s=r.map(e=>"fulfilled"===e.status?e.value:null).filter(t);if(i(n)||s.length!==r.length){s.forEach(e=>e.destroy()),o(n);for(const e of r)if("rejected"===e.status)throw e.reason}this._levels=s,this._levelSelector=q(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDataMap.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(e=>{const t=e.material.produces.get(4);return t?.(0)}))}hasHighlights(){return r(this._highlightRenderInstanceDataMap,e=>e.some(e=>e.size>0))}_produces(e){return(8!==e||this.hasHighlights())&&(5!==e||this.hasHighlight(O))}prepareRender(e){if(!g.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(T),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const n=new Array,r=this.levels;return t.forEach(t=>r.forEach(({components:r},s)=>r.forEach(r=>n.push(this._beginComponent(e,t[s],r))))),n}render(e,t){const n=this._getInstanceDatas(e);if(!n||null==t)return;let r=0;e.rctx.bindVAO();const s=this.levels;n.forEach(n=>s.forEach(({components:s},a)=>s.forEach(s=>this._renderComponent(e,t[r++],n[a],s,a))))}_getInstanceDatas(e){const{output:t,bind:n}=e,r=8===t,s=5===t,a=6!==t;if(!r&&!s)return a?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;const{_highlightRenderInstanceDataMap:i}=this;if(a){if(r){const e=n.highlight?.name;if(!e)return null;const t=i.get(e);return t?[t]:null}const e=i.get(O);return s?e?[e]:null:Array.from(i.values())}return null}intersect(e,t,n,r){if(!this.baseMaterial.visible||null==this._octree)return;const s=f();d(s,r,n);const a=s=>{this._instanceData.getCombinedModelTransform(s,W),e.transform.set(W),m(k,n,e.transform.inverse),m(G,r,e.transform.inverse);const a=this._instanceData.getState(s),i=this._instanceData.getLodLevel(s),o=this._levels.length;R(!!(18&a),"invalid instance state"),R(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,k,G,s,this.metadata,o)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(n,s,a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new L(e,this.baseBoundingSphere);for(let n=0;n<e.capacity;++n)18&t.get(n)&&this._octreeCached.addInstance(n)}return this._octreeCached}_invalidateOctree(){this._octreeCached=a(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return new D;const t=e.viewForward,n=this._octree.findClosest(t,1,e.frustum),r=this._octree.findClosest(t,-1,e.frustum);if(null==n||null==r)return new D;const s=e.eye,a=this._instanceData.view;a.boundingSphere.getVec(n,z),d(z,z,s);const i=u(z,t)-z[3];a.boundingSphere.getVec(r,z),d(z,z,s);const o=u(z,t)+z[3];return new D(i,o)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:r,_levelSelector:a}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));const i=this._instanceData,o=i.view;let l=i.size;const c=i.capacity;let h=this._instanceIndex;const d=Math.ceil(c/500),{_highlightRenderInstanceDataMap:u}=this;for(let m=0;m<l&&!e.done;++m){h===this._cycleStartIndex&&this._startUpdateCycle();const m=o.state.get(h);let f=0;if(!(1&m)){h=h+1===c?0:h+1,l++;continue}const p=o.lodLevel.get(h);if(2&m&&this._defaultRenderInstanceData[p].freeTail(),16&m){const e=i.geHighlightOptionsPrev(h);if(e){const t=u.get(e);if(!t)throw new n("internal:lod-renderer","Internal error in lodRenderer");t[p].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),u.delete(e))}}if(32&m)i.freeInstance(h);else if(4&m){let e=0;if(t&&(o.modelOrigin.getVec(h,P),e=a.selectLevel(P,i.getCombinedMedianScaleFactor(h),r)),f=-83&m,e>=0)if(8&m){const t=i.getHighlightName(h);if(t){const r=()=>{const e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e},a=s(u,t,r);if(e>=a.length)throw new n("internal:lod-renderer",`LodRenderer internal error - missing lodLevel ${e}`);B(a[e],o,h)}f|=16}else B(this._defaultRenderInstanceData[e],o,h),f|=2;o.state.set(h,f),o.lodLevel.set(h,e)}else f=-83&m,o.state.set(h,f);if(null!=this._octreeCached){const e=!!(18&m),t=!!(18&f);!e&&t?this._octreeCached.addInstance(h):e&&!t?this._octreeCached.removeInstance(h):e&&t&&64&m&&(this._octreeCached.removeInstance(h),this._octreeCached.addInstance(h))}h=h+1===c?0:h+1,h%d===0&&e.madeProgress()}this._instanceIndex=h,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,n){if(0===t.size)return null;const r=n.glMaterials.load(e.rctx,e.bind.slot,e.output);return r?.beginSlot(e.bind)}_renderComponent(e,t,n,r,s){if(!t)return;const{bind:a,rctx:i}=e;i.runAppleAmdDriverHelper();const o=i.bindTechnique(t,a,r.material.parameters,Z);i.bindVAO(r.vao),t.ensureAttributeLocations(r.vao),g.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&0===e.output&&(o.setUniform4fv("externalColor",Y[Math.min(s,Y.length-1)]),o.setUniform1i("symbolColorMixMode",w.replace));const l=n.capacity,c=n.headIndex,h=n.tailIndex,d=n.firstIndex,u=this._glInstanceBufferLayout,m=(e,s)=>{F(i,C,n.buffer,u,e),i.drawArraysInstanced(t.primitiveType,0,r.vertexCount,s-e)};r.material.transparent&&null!=d?c>h?(R(d>=h&&d<=c,"invalid firstIndex"),m(d,c),m(h,d)):c<h&&(d<=c?(R(d>=0&&d<=c,"invalid firstIndex"),m(d,c),m(h,l),m(0,d)):(R(d>=h&&d<=l,"invalid firstIndex"),m(d,l),m(0,c),m(h,d))):c>h?m(h,c):c<h&&(m(0,c),m(h,l)),i.unbindBuffer(34962),i.bindVAO(null)}};function B(e,t,n){const r=e.allocateHead();V(t,n,e.view,r)}function V(e,t,n,r){M(e.modelOrigin,t,n.modelOriginHi,n.modelOriginLo,r),n.model.copyFrom(r,e.model,t),n.modelNormal.copyFrom(r,e.modelNormal,t),e.color&&n.color&&n.color.copyFrom(r,e.color,t),e.objectAndLayerIdColor&&n.objectAndLayerIdColor&&n.objectAndLayerIdColor.copyFrom(r,e.objectAndLayerIdColor,t),e.featureAttribute&&n.featureAttribute&&n.featureAttribute.copyFrom(r,e.featureAttribute,t)}function N(e){let t=v().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");return null!=e&&e.includes("featureAttribute")&&(t=t.vec4f("instanceFeatureAttribute")),null!=e&&e.includes("color")&&(t=t.vec4u8("instanceColor")),null!=e&&e.includes("objectAndLayerIdColor")&&(t=t.vec4u8("instanceObjectAndLayerIdColor")),t}e([l({constructOnly:!0})],H.prototype,"symbol",void 0),e([l({constructOnly:!0})],H.prototype,"optionalFields",void 0),e([l({constructOnly:!0})],H.prototype,"metadata",void 0),e([l({constructOnly:!0})],H.prototype,"shaderTransformation",void 0),e([l()],H.prototype,"_instanceData",void 0),e([l()],H.prototype,"_cycleStartIndex",void 0),e([l({readOnly:!0})],H.prototype,"_enableLevelSelection",null),e([l()],H.prototype,"_updateCyclesWithStaticCamera",void 0),e([l({readOnly:!0})],H.prototype,"running",null),H=e([c("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],H);const P=f(),z=p(),W=h(),k=f(),G=f(),Y=[_(1,0,1,1),_(0,0,1,1),_(0,1,0,1),_(1,1,0,1),_(1,0,0,1)],Z=new A;export{H as LodRenderer};
@@ -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{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmission as a,isHighlightOrOID as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{MaterialParameters as n}from"../lib/Material.js";import{OITPolygonOffsetLimit as c}from"../lib/OrderIndependentTransparency.js";import{DefaultBufferWriter as l}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as h,PositionUvf32Layout as m}from"./DefaultLayouts.js";import{TriangleMaterial as f}from"./TriangleMaterial.js";import{WaterGLMaterial as p}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as u}from"./WaterTechniqueConfiguration.js";class d extends f{constructor(t,e){super(t,g),this.produces=new Map([[2,t=>a(t)&&!this.parameters.transparent||s(t)],[4,t=>a(t)&&this.parameters.transparent||s(t)],[17,t=>this.parameters.draped&&a(t)||3===t||s(t)],[18,t=>3===t]]),this._configuration=new u(e.spherical)}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.writeDepth=!0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.screenSpaceReflections=null!=e.ssr.lastFrameColor,this._configuration.cloudReflections=null!=e.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<c,this._configuration.terrainDepthTest=e.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration}get visible(){return!0}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<v}createGLMaterial(t){return new p(t)}createBufferWriter(){return new l(o()?h:m)}get test(){}}class g extends n{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const v=35e3;export{g as Parameters,d as WaterMaterial};
5
+ import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrColorEmission as a,isHighlightOrOID as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{MaterialParameters as n}from"../lib/Material.js";import{OITPolygonOffsetLimit as c}from"../lib/OrderIndependentTransparency.js";import{DefaultBufferWriter as l}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as h,PositionUvf32Layout as m}from"./DefaultLayouts.js";import{TriangleMaterial as f}from"./TriangleMaterial.js";import{WaterGLMaterial as p}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as u}from"./WaterTechniqueConfiguration.js";class d extends f{constructor(t,e){super(t,g),this.produces=new Map([[2,t=>a(t)&&!this.parameters.transparent||s(t)],[4,t=>a(t)&&this.parameters.transparent||s(t)],[17,t=>this.parameters.draped&&a(t)||3===t||s(t)],[18,t=>3===t]]),this._configuration=new u(e.spherical)}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.writeDepth=!0,this._configuration.receiveShadows=a(t)&&e.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.screenSpaceReflections=null!=e.ssr.lastFrameColor,this._configuration.cloudReflections=null!=e.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<c,this._configuration.terrainDepthTest=e.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration}get visible(){return!0}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<v}createGLMaterial(t){return new p(t)}createBufferWriter(){return new l(o()?h:m)}get test(){}}class g extends n{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const v=35e3;export{g as Parameters,d as WaterMaterial};
@@ -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"../../../../core/Accessor.js";import{unpackFloatRGBA as r}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as i,destroyMaybe as n}from"../../../../core/maybe.js";import{watch as o,initial as a,syncAndInitial as h}from"../../../../core/reactiveUtils.js";import{addFrameTask as l}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{isMoon as m,isMars as u}from"../../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as f}from"../../environment/ChapmanAtmosphere.js";import{CloudsComposition as _}from"../../environment/CloudsComposition.js";import{Fog as g}from"../../environment/Fog.js";import{LocalAtmosphere as x}from"../../environment/LocalAtmosphere.js";import w from"../../environment/MarsAtmosphere.js";import{ComponentObjectCollection as v}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as y}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as b}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{BloomRenderNode as j}from"../effects/bloom/BloomRenderNode.js";import{ObjectAndLayerIDRenderNode as R}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as T}from"../effects/geometry/RenderOccludedRenderNode.js";import{Haze as A}from"../effects/haze/Haze.js";import{Highlight as S}from"../effects/highlight/Highlight.js";import{ShadowHighlight as O}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as q}from"../effects/magnifier/Magnifier.js";import{SMAA as M}from"../effects/smaa/SMAA.js";import{SSAO as L}from"../effects/ssao/SSAO.js";import{Stars as U}from"../effects/stars/Stars.js";import k from"../lib/CompositingHelper.js";import{GLMaterialRepository as D}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as H}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as W}from"../lib/Renderer.js";import{RenderingContext as F}from"../lib/RenderingContext.js";import{TextureRepository as E}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as B}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as G}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as P}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as I}from"./contextCache.js";import{removeLoadedShaderModules as N}from"./renderUtils.js";import{ScreenshotManager as z,ScreenshotContext as V}from"./ScreenshotManager.js";import{contextCache as X}from"./testUtils.js";import{noBudget as Q}from"../../../support/Scheduler.js";import{checkWebGLError as J}from"../../../webgl/checkWebGLError.js";let K=class extends t{constructor(e){super(e),this._waterTextures=new P,this.olidRenderHelper=C()?new H:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.bloom=null,this.test=null;const t=e.stage;try{this._initializeContext(t)}catch(n){return void console.error("Failed to initialize context",n)}const{memoryController:r}=t.view.resourceController;this._stippleTextures=G(this._rctx,r),this.notifyChange("stippleTextures"),this._markerTextures=B(this._rctx,r),this.notifyChange("markerTextures"),this._techniques=new b(new y(this._rctx,t.viewingMode,this.stippleTextures,this.waterTextures,this.markerTextures)),this._textures=new E(t),this.addHandles(this._textures.events.on("changed",e=>this.requestRender(e)));const s=new D(this._textures,this._techniques,()=>this.requestRender(),()=>this.requestRender());this._compositingHelper=new k(this._rctx,this._techniques),this._renderer=new W(t,s,this._techniques,this._rctx,this._compositingHelper,e=>this.requestRender(e)),this.notifyChange("renderer"),this.addHandles([o(()=>t.view.ready,e=>{e&&this._createRenderNodes()},a),o(()=>this.waterTextures?.updating,()=>this.requestRender(),a),o(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),h)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new z(this._rctx,i,e=>t.view.basemapTerrain.overlayManager.updateOverlays(Q,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=i(this._frameTask),this._techniques=n(this._techniques),this._componentObjectCollection=n(this._componentObjectCollection),this._set("componentObjectCollection",null),this._screenshotManager=n(this._screenshotManager),n(this.renderer),this._textures=n(this._textures),n(this.waterTextures),n(this.markerTextures),n(this.stippleTextures),this._waterTextures=null,this._markerTextures=null,this._stippleTextures=null,this._canvas=null,this._rctx=n(this._rctx),this._compositingHelper=null,this._renderer=null,this._set("renderer",null),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new U({view:e}),m(e.spatialReference)||(2===t?(new x({view:e}),this.bloom=new j({view:e})):u(e.spatialReference)?(new w({view:e}),this.bloom=new j({view:e})):(new f({view:e}),new _({view:e}),this.bloom=new j({view:e}),new A({view:e}),new g({view:e}))),new L({view:e,isEnabled:()=>this.renderer.hasSSAO}),new M({view:e,isEnabled:()=>this.renderer.hasSMAA}),new q({view:e}),new S({view:e}),new O({view:e,viewingMode:t}),new T({view:e}),C()&&new R({view:e})}requestRender(e=1){this._needsRender=!0,1===e&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get techniques(){return this._techniques}get compositingHelper(){return this._compositingHelper}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e).then(e=>e[0])}takeScreenshotWithOID(e){return e.objectAndLayerIdColor=!0,this._screenshotManager.takeScreenshot(e)}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,s,i,n,o=n){const a=i.constrainWindowSize(t,s,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const l=(e,t,s)=>r(t,e)*(s[1]-s[0])+s[0];let p=Number.MAX_VALUE;for(let r=0;r<a[2]*a[3];r++){const e=l(4*r,h,i.nearFar);p>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(p=e)}if(e){const r=e.pickDepth(t*i.pixelRatio,s*i.pixelRatio,i);null!=r&&p>r&&r!==i.nearFar[0]&&r!==i.nearFar[1]&&(p=r)}return p===Number.MAX_VALUE?void 0:p}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){N(),await this._techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;(p(i-this._lastAnimationUpdate)>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this._textures.update();const r=new V(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=l(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");J(n,!0),this._rctx=Y(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stippleTextures(){return this._stippleTextures}get markerTextures(){return this._markerTextures}get waterTextures(){return this._waterTextures}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get renderer(){return this._renderer}get componentObjectCollection(){return null==this._componentObjectCollection&&(this._componentObjectCollection=new v(this.renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}updateQualitySettings(e){null!=this.test?.time&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.stage.view.qualitySettings.maxTexturePixels})}};function Y(e,t){const r=(e,r)=>t.view.resourceController.memoryController.newCache(e,r),s={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8,maxPreferredTexturePixels:t.view.qualitySettings.maxTexturePixels,newCache:r};if(X.enabled){let t=Z.get(e);return t?(t.configure(s),t.ref(),t):(t=new F(e,s),Z.set(e,t),t.ref(),t)}return new F(e,s)}e([d({type:Boolean,readOnly:!0})],K.prototype,"updating",null),e([d({constructOnly:!0})],K.prototype,"stage",void 0),e([d({readOnly:!0})],K.prototype,"stippleTextures",null),e([d({readOnly:!0})],K.prototype,"markerTextures",null),e([d({readOnly:!0})],K.prototype,"waterTextures",null),e([d({readOnly:!0})],K.prototype,"olidRenderHelper",void 0),e([d()],K.prototype,"_textures",void 0),e([d({readOnly:!0})],K.prototype,"renderer",null),e([d()],K.prototype,"_screenshotManager",void 0),e([d()],K.prototype,"componentObjectCollection",null),e([d()],K.prototype,"_componentObjectCollection",void 0),e([d()],K.prototype,"_needsUpdate",void 0),e([d()],K.prototype,"_needsWaterReflectionUpdate",void 0),K=e([c("esri.views.3d.webgl-engine.parts.RenderView")],K);const Z=I();export{K as RenderView};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{unpackFloatRGBA as r}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as i,destroyMaybe as n}from"../../../../core/maybe.js";import{watch as o,initial as a,syncAndInitial as h}from"../../../../core/reactiveUtils.js";import{addFrameTask as l}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{isMoon as m,isMars as u}from"../../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as f}from"../../environment/ChapmanAtmosphere.js";import{CloudsComposition as _}from"../../environment/CloudsComposition.js";import{Fog as g}from"../../environment/Fog.js";import{LocalAtmosphere as x}from"../../environment/LocalAtmosphere.js";import w from"../../environment/MarsAtmosphere.js";import{ComponentObjectCollection as v}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as y}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as b}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{BloomRenderNode as j}from"../effects/bloom/BloomRenderNode.js";import{ObjectAndLayerIDRenderNode as R}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as T}from"../effects/geometry/RenderOccludedRenderNode.js";import{Haze as A}from"../effects/haze/Haze.js";import{Highlight as O}from"../effects/highlight/Highlight.js";import{ShadowHighlight as S}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as q}from"../effects/magnifier/Magnifier.js";import{SMAA as M}from"../effects/smaa/SMAA.js";import{SSAO as U}from"../effects/ssao/SSAO.js";import{Stars as L}from"../effects/stars/Stars.js";import k from"../lib/CompositingHelper.js";import{GLMaterialRepository as D}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as H}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as F}from"../lib/Renderer.js";import{RenderingContext as W}from"../lib/RenderingContext.js";import{TextureRepository as E}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as B}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as G}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as P}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as N}from"./contextCache.js";import{removeLoadedShaderModules as z}from"./renderUtils.js";import{ScreenshotManager as I,ScreenshotContext as V}from"./ScreenshotManager.js";import{contextCache as X}from"./testUtils.js";import{noBudget as Q}from"../../../support/Scheduler.js";import{checkWebGLError as J}from"../../../webgl/checkWebGLError.js";let K=class extends t{constructor(e){super(e),this._waterTextures=new P,this.olidRenderHelper=C()?new H:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.bloom=null,this.test=null;const t=e.stage;try{this._initializeContext(t)}catch(n){return void console.error("Failed to initialize context",n)}const{memoryController:r}=t.view.resourceController;this._stippleTextures=G(this._rctx,r),this.notifyChange("stippleTextures"),this._markerTextures=B(this._rctx,r),this.notifyChange("markerTextures"),this._techniques=new b(new y(this._rctx,t.viewingMode,this.stippleTextures,this.waterTextures,this.markerTextures)),this._textures=new E(t),this.addHandles(this._textures.events.on("changed",e=>this.requestRender(e)));const s=new D(this._textures,this._techniques,()=>this.requestRender(),()=>this.requestRender());this._compositingHelper=new k(this._rctx,this._techniques),this._renderer=new F(t,s,this._techniques,this._rctx,this._compositingHelper,e=>this.requestRender(e)),this.notifyChange("renderer"),this.addHandles([o(()=>t.view.ready,e=>{e&&this._createRenderNodes()},a),o(()=>this.waterTextures?.updating,()=>this.requestRender(),a),o(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),h)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new I(this._rctx,i,e=>t.view.basemapTerrain.overlayManager.updateOverlays(Q,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=i(this._frameTask),this._techniques=n(this._techniques),this._componentObjectCollection=n(this._componentObjectCollection),this._set("componentObjectCollection",null),this._screenshotManager=n(this._screenshotManager),n(this.renderer),this._textures=n(this._textures),n(this.waterTextures),n(this.markerTextures),n(this.stippleTextures),this._waterTextures=null,this._markerTextures=null,this._stippleTextures=null,this._canvas=null,this._rctx=n(this._rctx),this._compositingHelper=null,this._renderer=null,this._set("renderer",null),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new L({view:e}),m(e.spatialReference)||(2===t?(new x({view:e}),this.bloom=new j({view:e})):u(e.spatialReference)?(new w({view:e}),this.bloom=new j({view:e})):(new f({view:e}),new _({view:e}),this.bloom=new j({view:e}),new A({view:e}),new g({view:e}))),new U({view:e,isEnabled:()=>this.renderer.hasSSAO}),new M({view:e,isEnabled:()=>this.renderer.hasSMAA}),new q({view:e}),new O({view:e}),new S({view:e,viewingMode:t}),new T({view:e}),C()&&new R({view:e})}requestRender(e=1){this._needsRender=!0,1===e&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get techniques(){return this._techniques}get compositingHelper(){return this._compositingHelper}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e)}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,s,i,n,o=n){const a=i.constrainWindowSize(t,s,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const l=(e,t,s)=>r(t,e)*(s[1]-s[0])+s[0];let p=Number.MAX_VALUE;for(let r=0;r<a[2]*a[3];r++){const e=l(4*r,h,i.nearFar);p>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(p=e)}if(e){const r=e.pickDepth(t*i.pixelRatio,s*i.pixelRatio,i);null!=r&&p>r&&r!==i.nearFar[0]&&r!==i.nearFar[1]&&(p=r)}return p===Number.MAX_VALUE?void 0:p}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){z(),await this._techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;(p(i-this._lastAnimationUpdate)>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this._textures.update();const r=new V(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=l(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");J(n,!0),this._rctx=Y(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stippleTextures(){return this._stippleTextures}get markerTextures(){return this._markerTextures}get waterTextures(){return this._waterTextures}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get renderer(){return this._renderer}get componentObjectCollection(){return null==this._componentObjectCollection&&(this._componentObjectCollection=new v(this.renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}updateQualitySettings(e){null!=this.test?.time&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.stage.view.qualitySettings.maxTexturePixels})}};function Y(e,t){const r=(e,r)=>t.view.resourceController.memoryController.newCache(e,r),s={disabledExtensions:t.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:t.options.debugWebGLExtensions||{},maxAnisotropy:8,maxPreferredTexturePixels:t.view.qualitySettings.maxTexturePixels,newCache:r};if(X.enabled){let t=Z.get(e);return t?(t.configure(s),t.ref(),t):(t=new W(e,s),Z.set(e,t),t.ref(),t)}return new W(e,s)}e([d({type:Boolean,readOnly:!0})],K.prototype,"updating",null),e([d({constructOnly:!0})],K.prototype,"stage",void 0),e([d({readOnly:!0})],K.prototype,"stippleTextures",null),e([d({readOnly:!0})],K.prototype,"markerTextures",null),e([d({readOnly:!0})],K.prototype,"waterTextures",null),e([d({readOnly:!0})],K.prototype,"olidRenderHelper",void 0),e([d()],K.prototype,"_textures",void 0),e([d({readOnly:!0})],K.prototype,"renderer",null),e([d()],K.prototype,"_screenshotManager",void 0),e([d()],K.prototype,"componentObjectCollection",null),e([d()],K.prototype,"_componentObjectCollection",void 0),e([d()],K.prototype,"_needsUpdate",void 0),e([d()],K.prototype,"_needsWaterReflectionUpdate",void 0),K=e([c("esri.views.3d.webgl-engine.parts.RenderView")],K);const Z=N();export{K as RenderView};
@@ -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/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstanceColor.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/MaskedColor.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/weather/SnowCover.glsl.js";import"../materials/internal/MaterialUtil.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
5
+ import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstanceColor.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/MaskedColor.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/weather/SnowCover.glsl.js";import"../materials/internal/MaterialUtil.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
@@ -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/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/weather/SnowCover.glsl.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
5
+ import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/weather/SnowCover.glsl.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
@@ -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/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstanceColor.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/MaskedColor.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../materials/internal/MaterialUtil.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";
5
+ import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstanceColor.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/MaskedColor.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../materials/internal/MaterialUtil.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";
@@ -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/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../chunks/vec32.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexTangent.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/terrain/Overlay.glsl.js";import"../core/shaderLibrary/terrain/TerrainTexture.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{T as TerrainPassParameters,b as build}from"../../../../chunks/Terrain.glsl.js";
5
+ import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../../chunks/vec32.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexTangent.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/output/OutputHighlightOverlay.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/terrain/Overlay.glsl.js";import"../core/shaderLibrary/terrain/TerrainTexture.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{T as TerrainPassParameters,b as build}from"../../../../chunks/Terrain.glsl.js";
@@ -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/shaderLibrary/ForwardLinearDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/shading/Water.glsl.js";import"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/WaterSurface.glsl.js";
5
+ import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/shading/Water.glsl.js";import"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/WaterSurface.glsl.js";
@@ -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{throwIfAborted as d}from"../core/promiseUtils.js";import{on as u,watch as c,initial as g,sync as m,whenOnce as y,syncAndInitial as f}from"../core/reactiveUtils.js";import{setFrameDuration as w,cleanupScheduling as v}from"../core/scheduling.js";import{createScreenPointArray as _,createScreenPoint as b}from"../core/screenUtils.js";import{cleanupWhereClauseCache as M}from"../core/sql.js";import{getMetersPerUnitForSR as S}from"../core/unitUtils.js";import{initialize as V}from"../core/workers/workers.js";import{property as j}from"../core/accessorSupport/decorators/property.js";import{cast as R}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as C}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as T,ensureClass as O}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as x}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as A}from"../core/accessorSupport/trackingUtils.js";import{create as E}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as L}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as H}from"../core/support/OwningCollection.js";import I from"../geometry/Extent.js";import P from"../geometry/HeightModelInfo.js";import D from"../geometry/Point.js";import{project as F,canProjectWithoutEngine as G}from"../geometry/projectionUtils.js";import U from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as W}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as q}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as z}from"../geometry/projection/projectPointToVector.js";import{create as k,toExtent as B}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as N}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Q}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as Y,isTiledLayer as Z,isVoxelLayer as $,isIntegratedMeshLayer as J}from"../layers/support/layerUtils.js";import{TilemapCache as K}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as X}from"../portal/portalDefault.js";import{AnalysesCollection as ee}from"../support/AnalysesCollection.js";import{WebSceneTag as te}from"../support/tagSymbols.js";import{BreakpointsOwner as ie}from"./BreakpointsOwner.js";import{DOMContainer as re}from"./DOMContainer.js";import se from"./GroundView.js";import{PopupView as ne}from"./PopupView.js";import ae from"./View.js";import oe from"./ViewAnimation.js";import{stringFromViewingMode as le,viewingModeFromString as pe}from"./ViewingMode.js";import{layerView3DImporter as he}from"./3d/layerViewModuleImportUtils.js";import de from"./3d/analysis/AnalysisViewManager3D.js";import{cleanupIntersectionUtils as ue}from"./3d/camera/intersectionUtils.js";import{Constraints as ce}from"./3d/constraints/Constraints.js";import{EnvironmentManager as ge}from"./3d/environment/EnvironmentManager.js";import me from"./3d/environment/SceneViewEnvironment.js";import ye from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as fe}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as we}from"./3d/layers/graphics/Labeler.js";import ve from"./3d/layers/i3s/I3SLodHandling.js";import{FeatureTileTree3D as _e}from"./3d/layers/support/FeatureTileTree3D.js";import{cleanupStageLayerElevationProvider as be}from"./3d/layers/support/StageLayerElevationProvider.js";import Me from"./3d/state/ViewState.js";import{ViewStateManager as Se,cleanupViewStateManager as Ve}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as je}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Re}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ce}from"./3d/state/utils/navigationUtils.js";import{CombinedElevationProvider as Te}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Oe}from"./3d/support/debugFlags.js";import xe from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Ae}from"./3d/support/ElevationProvider.js";import{toMap as Ee,hitTest as Le}from"./3d/support/hitTest.js";import{popupHitTest as He}from"./3d/support/popupHitTest.js";import Ie from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Pe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as De}from"./3d/support/ResourceController.js";import Fe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ge}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ue}from"./3d/support/ViewSlice.js";import{PointsOfInterest as We}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import qe from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as ze,getTiledLayerInfo as ke,checkIfTileInfoSupportedForView as Be}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ne}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Qe}from"./3d/terrain/TileRenderer.js";import{Stage as Ye}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Ze}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as $e}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as Je}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as Ke}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as Xe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as et}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{cleanupDrapedUtils as tt}from"./support/drapedUtils.js";import{defaultHighlightName as it}from"./support/HighlightDefaults.js";import rt from"./support/HighlightOptions.js";import{occludeesSupported as st}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as nt,createScreenPointFromSupportedEvent as at}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ot}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as lt,destroyTextureCompressionWorker as pt}from"./support/TextureCompressionHelper.js";import{check as ht}from"./support/WebGLRequirements.js";import dt from"./ui/DefaultUI.js";import ut from"./ui/3d/DefaultUI3D.js";import ct from"../webscene/Environment.js";import{clearVNodeCache as gt}from"../widgets/support/vnodeCache.js";let mt=class extends(ie(ne(re(ae)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=De(this),this.deconflictor=new fe({view:this}),this.labeler=new we({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new ee,this.basemapTerrain=null,this.elevationProvider=null,this._canvas=null,this.constraints=new ce,this.environment=new me,this.environmentManager=new ge,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new de({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new Me({view:this}),this.slice=new Ue,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new ut,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,V();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([u(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),c(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new ye({view:this}),this.stateManager=new Se({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=lt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new se({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},g),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},g),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>w(e>0?1e3/Math.ceil(e):0),g),this.addHandles([c(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),m),c(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),m)])}destroy(){this.destroyed||(pt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),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._exitBasemapTerrain(),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 I?this.spatialReference&&(t=yt(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:yt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||U.WGS84,i=yt(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||U.WGS84;let t;const i=i=>{const r=yt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new I({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}castEnvironment(e){return e?e instanceof me?e:e instanceof ct?this.environment?.cloneWithWebsceneEnvironment(e)??me.fromWebsceneEnvironment(e):T(me,e):new me}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&&te in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){xe.isValidProfile(e)&&(xe.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||xe.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?Q(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?P.deriveUnitFromSR(e,this.spatialReference):null}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||ze(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 le(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?le(this.defaultsFromMap.viewingMode):ot(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===it)??new rt}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===it)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 Fe(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=nt(e)?at(this,e):e;return Ee(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?Ae(this.elevationProvider,e):null)??0;return z(e,ft,this.renderSpatialReference,t),this.state.camera.projectToScreen(ft,wt),b(wt[0],wt[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;z(e,ft,i);const r=this.state.camera.computeScreenPixelSizeAt(ft);return t&&i!==t?r*S(i)/S(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=nt(e)?at(this,e):e;return Le(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return He(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 has not been added to 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);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);return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshotWithOID(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(!Ze())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);await this.whenReady();const r=await this.stage.renderView.takeScreenshotWithOID(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 he.importLayerView(e)}hasLayerViewModule(e){return he.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=ht(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?pe(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!!ot(e,i)&&(null==t||(!!Y(t)||(!Z(t)||null!=ke(t,e,i))&&(!$(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(Y(t)&&(r||s)){return!s||2===i||null===Be(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:U.WebMercator,viewingMode:i}]:[{spatialReference:r?U.WGS84:U.WebMercator,viewingMode:i}]}return Z(t)||$(t)||!r&&!s?Z(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:U.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?U.WGS84:U.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 ${le(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&&st(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 y(()=>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}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await _t[e]();return t&&(d(i.signal),await t(i.signal)),d(i.signal),this._importControllers.delete(e),r}catch{this._importControllers.delete(e)}return null}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new qe({view:this})),this._set("elevationProvider",new Te({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),this._set("elevationProvider",null),t.unregister(e),t.destroy(),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new We({view:this})),this._set("featureTiles",new _e({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?F(B(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add(()=>Oe.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Oe.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||!this._featureTreeDebugger||Oe.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)},f),this.updatingHandles.add(()=>this.clippingArea,e,f),this.updatingHandles.add(()=>this.basemapTerrain.extent,e,f)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.featureTiles&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this._set("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=N(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Pe.create(this.state.viewingMode,i)),t||this.addHandles(c(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!q(e,this.basemapTerrain.spatialReference,vt,t)||(this.renderCoordsHelper.extent=vt)},m),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Je/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),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(c(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),m),"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.forAll(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ye({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}),g),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(Je/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 Ge({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._exitGlobe(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this._importModule("GraphicsView3D",e=>y(()=>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._importModule("FocusAreasView"))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){const e=pe(this.viewingMode);1===e&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(u(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(c(()=>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?x(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(Xe);for(const t of this.allLayerViews)J(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(Xe);for(const t of this.allLayerViews)J(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){gt(),A(),M(),et(),Ve(),ue(),be(),W(),tt(),X(),Qe(),Ke(),je(),Ce(),L(),v(),$e(),Ne(),ve.cleanupI3SLodHandling(),K.cleanupTilemapCache(),Me.cleanupViewstate(),qe.cleanupTerrainSurface()}};function yt(e,t){return null!=e&&G(e.spatialReference,t)?F(e,t):null}e([j()],mt.prototype,"_userClippingArea",void 0),e([j()],mt.prototype,"_resourceController",void 0),e([j()],mt.prototype,"stage",null),e([j({readOnly:!0})],mt.prototype,"deconflictor",void 0),e([j({readOnly:!0})],mt.prototype,"labeler",void 0),e([j(H(ee,"analyses"))],mt.prototype,"analyses",void 0),e([j({type:oe,readOnly:!0})],mt.prototype,"animation",null),e([j({readOnly:!0})],mt.prototype,"basemapTerrain",void 0),e([j({readOnly:!0})],mt.prototype,"elevationProvider",void 0),e([j()],mt.prototype,"camera",null),e([j({type:t})],mt.prototype,"contentCamera",null),e([j({readOnly:!0})],mt.prototype,"canvas",null),e([j({type:D})],mt.prototype,"center",null),e([j({type:I})],mt.prototype,"clippingArea",null),e([j({type:ce})],mt.prototype,"constraints",void 0),e([j({type:I,readOnly:!0})],mt.prototype,"renderDataExtent",null),e([j({readOnly:!0})],mt.prototype,"tileInfo",null),e([j({type:I,readOnly:!0})],mt.prototype,"dataExtent",null),e([j({type:I,readOnly:!0})],mt.prototype,"_groundAndLayersExtent",null),e([j({type:me})],mt.prototype,"environment",void 0),e([R("environment")],mt.prototype,"castEnvironment",null),e([j({readOnly:!0})],mt.prototype,"environmentManager",void 0),e([j({type:I})],mt.prototype,"extent",null),e([j({type:r})],mt.prototype,"floors",void 0),e([j()],mt.prototype,"screenCenter",null),e([j()],mt.prototype,"frustum",null),e([j({type:Number,readOnly:!0})],mt.prototype,"fullOpacity",void 0),e([j({readOnly:!0})],mt.prototype,"graphicsView",void 0),e([j({})],mt.prototype,"analysisViewManager",void 0),e([j()],mt.prototype,"groundView",void 0),e([j({type:Boolean})],mt.prototype,"initialExtentRequired",null),e([j()],mt.prototype,"defaultsFromMapSettings",null),e([j()],mt.prototype,"interacting",null),e([j()],mt.prototype,"stationary",null),e([j()],mt.prototype,"navigating",null),e([j()],mt.prototype,"map",void 0),e([j()],mt.prototype,"padding",null),e([j({type:We,readOnly:!0})],mt.prototype,"pointsOfInterest",void 0),e([j({type:_e,readOnly:!0})],mt.prototype,"featureTiles",void 0),e([j()],mt.prototype,"_featureTreeDebugger",void 0),e([j({type:Boolean})],mt.prototype,"screenSizePerspectiveEnabled",void 0),e([j({constructOnly:!0})],mt.prototype,"deactivatedWebGLExtensions",void 0),e([j({constructOnly:!0})],mt.prototype,"debugWebGLExtensions",void 0),e([j({constructOnly:!0})],mt.prototype,"renderCanvas",void 0),e([j({constructOnly:!0})],mt.prototype,"state",void 0),e([j({readOnly:!0})],mt.prototype,"inputManager",void 0),e([j({readOnly:!0})],mt.prototype,"stateManager",void 0),e([j({type:["low","medium","high"]})],mt.prototype,"qualityProfile",null),e([j({type:Ie,get(){let e=this._get("qualitySettings");return e||(e=new Ie,xe.apply(this.qualityProfile,e)),e}})],mt.prototype,"qualitySettings",void 0),e([j()],mt.prototype,"slice",void 0),e([j({readOnly:!0})],mt.prototype,"typeSpecificPreconditionsReady",null),e([j({readOnly:!0})],mt.prototype,"renderCoordsHelper",void 0),e([j({readOnly:!0})],mt.prototype,"sceneIntersectionHelper",void 0),e([j({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],mt.prototype,"resolution",null),e([j({type:Number})],mt.prototype,"scale",null),e([j()],mt.prototype,"heightModelInfo",null),e([j()],mt.prototype,"spatialReference",void 0),e([j({type:Boolean,constructOnly:!0})],mt.prototype,"alphaCompositingEnabled",void 0),e([j({constructOnly:!0})],mt.prototype,"preserveDrawingBufferEnabled",void 0),e([j({type:Boolean})],mt.prototype,"supersampleScreenshotsEnabled",void 0),e([j({readOnly:!0})],mt.prototype,"type",void 0),e([j(),R(e=>e instanceof dt?e:O(ut,e))],mt.prototype,"ui",void 0),e([j({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"]})],mt.prototype,"updating",null),e([j()],mt.prototype,"_updatingObjects",null),e([j()],mt.prototype,"_updatingObjectsWithProgress",null),e([j({type:Number,readOnly:!0,dependsOn:["updating"]})],mt.prototype,"updatingProgress",void 0),e([j({type:["global","local"]})],mt.prototype,"viewingMode",null),e([j({type:i})],mt.prototype,"viewpoint",null),e([j({readOnly:!0})],mt.prototype,"visibleArea",null),e([j({type:Number})],mt.prototype,"zoom",null),e([j({type:rt})],mt.prototype,"highlightOptions",null),e([j({readOnly:!0})],mt.prototype,"quality",null),e([j({readOnly:!0})],mt.prototype,"resolutionScale",null),e([j()],mt.prototype,"focusAreasView",void 0),e([j()],mt.prototype,"_defaultToMapOptions",null),e([j()],mt.prototype,"_defaultHitTestOptions",null),mt=e([C("esri.views.SceneView")],mt);const ft=E(),wt=_(),vt=k(),_t={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js")},bt=mt;export{bt 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{throwIfAborted as d}from"../core/promiseUtils.js";import{on as u,watch as c,initial as g,sync as m,whenOnce as y,syncAndInitial as f}from"../core/reactiveUtils.js";import{setFrameDuration as w,cleanupScheduling as v}from"../core/scheduling.js";import{createScreenPointArray as _,createScreenPoint as b}from"../core/screenUtils.js";import{cleanupWhereClauseCache as M}from"../core/sql.js";import{getMetersPerUnitForSR as S}from"../core/unitUtils.js";import{initialize as V}from"../core/workers/workers.js";import{property as j}from"../core/accessorSupport/decorators/property.js";import{cast as R}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as C}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as T,ensureClass as x}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as O}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as A}from"../core/accessorSupport/trackingUtils.js";import{create as E}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as L}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as H}from"../core/support/OwningCollection.js";import I from"../geometry/Extent.js";import P from"../geometry/HeightModelInfo.js";import D from"../geometry/Point.js";import{project as F,canProjectWithoutEngine as G}from"../geometry/projectionUtils.js";import U from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as W}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as q}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as z}from"../geometry/projection/projectPointToVector.js";import{create as k,toExtent as B}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as N}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Q}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as Y,isTiledLayer as Z,isVoxelLayer as $,isIntegratedMeshLayer as J}from"../layers/support/layerUtils.js";import{TilemapCache as K}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as X}from"../portal/portalDefault.js";import{AnalysesCollection as ee}from"../support/AnalysesCollection.js";import{WebSceneTag as te}from"../support/tagSymbols.js";import{BreakpointsOwner as ie}from"./BreakpointsOwner.js";import{DOMContainer as re}from"./DOMContainer.js";import se from"./GroundView.js";import{PopupView as ne}from"./PopupView.js";import ae from"./View.js";import oe from"./ViewAnimation.js";import{stringFromViewingMode as le,viewingModeFromString as pe}from"./ViewingMode.js";import{layerView3DImporter as he}from"./3d/layerViewModuleImportUtils.js";import de from"./3d/analysis/AnalysisViewManager3D.js";import{cleanupIntersectionUtils as ue}from"./3d/camera/intersectionUtils.js";import{Constraints as ce}from"./3d/constraints/Constraints.js";import{EnvironmentManager as ge}from"./3d/environment/EnvironmentManager.js";import me from"./3d/environment/SceneViewEnvironment.js";import ye from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as fe}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as we}from"./3d/layers/graphics/Labeler.js";import ve from"./3d/layers/i3s/I3SLodHandling.js";import{FeatureTileTree3D as _e}from"./3d/layers/support/FeatureTileTree3D.js";import{cleanupStageLayerElevationProvider as be}from"./3d/layers/support/StageLayerElevationProvider.js";import Me from"./3d/state/ViewState.js";import{ViewStateManager as Se,cleanupViewStateManager as Ve}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as je}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Re}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ce}from"./3d/state/utils/navigationUtils.js";import{CombinedElevationProvider as Te}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as xe}from"./3d/support/debugFlags.js";import Oe from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Ae}from"./3d/support/ElevationProvider.js";import{toMap as Ee,hitTest as Le}from"./3d/support/hitTest.js";import{popupHitTest as He}from"./3d/support/popupHitTest.js";import Ie from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Pe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as De}from"./3d/support/ResourceController.js";import Fe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ge}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ue}from"./3d/support/ViewSlice.js";import{PointsOfInterest as We}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import qe from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as ze,getTiledLayerInfo as ke,checkIfTileInfoSupportedForView as Be}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ne}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Qe}from"./3d/terrain/TileRenderer.js";import{Stage as Ye}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Ze}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as $e}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as Je}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as Ke}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as Xe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as et}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{cleanupDrapedUtils as tt}from"./support/drapedUtils.js";import{defaultHighlightName as it}from"./support/HighlightDefaults.js";import rt from"./support/HighlightOptions.js";import{occludeesSupported as st}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as nt,createScreenPointFromSupportedEvent as at}from"./support/screenUtils.js";import{isSpatialReferenceSupported as ot}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as lt,destroyTextureCompressionWorker as pt}from"./support/TextureCompressionHelper.js";import{check as ht}from"./support/WebGLRequirements.js";import dt from"./ui/DefaultUI.js";import ut from"./ui/3d/DefaultUI3D.js";import ct from"../webscene/Environment.js";import{clearVNodeCache as gt}from"../widgets/support/vnodeCache.js";let mt=class extends(ie(ne(re(ae)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=De(this),this.deconflictor=new fe({view:this}),this.labeler=new we({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new ee,this.basemapTerrain=null,this.elevationProvider=null,this._canvas=null,this.constraints=new ce,this.environment=new me,this.environmentManager=new ge,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new de({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new Me({view:this}),this.slice=new Ue,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new ut,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,V();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([u(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),c(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new ye({view:this}),this.stateManager=new Se({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=lt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new se({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},g),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},g),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>w(e>0?1e3/Math.ceil(e):0),g),this.addHandles([c(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),m),c(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),m)])}destroy(){this.destroyed||(pt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),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._exitBasemapTerrain(),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 I?this.spatialReference&&(t=yt(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:yt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||U.WGS84,i=yt(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||U.WGS84;let t;const i=i=>{const r=yt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new I({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}castEnvironment(e){return e?e instanceof me?e:e instanceof ct?this.environment?.cloneWithWebsceneEnvironment(e)??me.fromWebsceneEnvironment(e):T(me,e):new me}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&&te in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){Oe.isValidProfile(e)&&(Oe.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Oe.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?Q(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?P.deriveUnitFromSR(e,this.spatialReference):null}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||ze(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 le(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?le(this.defaultsFromMap.viewingMode):ot(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===it)??new rt}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===it)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 Fe(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=nt(e)?at(this,e):e;return Ee(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?Ae(this.elevationProvider,e):null)??0;return z(e,ft,this.renderSpatialReference,t),this.state.camera.projectToScreen(ft,wt),b(wt[0],wt[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;z(e,ft,i);const r=this.state.camera.computeScreenPixelSizeAt(ft);return t&&i!==t?r*S(i)/S(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=nt(e)?at(this,e):e;return Le(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return He(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 has not been added to 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.objectAndLayerIdColor=!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(!Ze())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.objectAndLayerIdColor=!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 he.importLayerView(e)}hasLayerViewModule(e){return he.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=ht(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?pe(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!!ot(e,i)&&(null==t||(!!Y(t)||(!Z(t)||null!=ke(t,e,i))&&(!$(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(Y(t)&&(r||s)){return!s||2===i||null===Be(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:U.WebMercator,viewingMode:i}]:[{spatialReference:r?U.WGS84:U.WebMercator,viewingMode:i}]}return Z(t)||$(t)||!r&&!s?Z(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:U.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?U.WGS84:U.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 ${le(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&&st(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 y(()=>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}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await _t[e]();return t&&(d(i.signal),await t(i.signal)),d(i.signal),this._importControllers.delete(e),r}catch{this._importControllers.delete(e)}return null}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new qe({view:this})),this._set("elevationProvider",new Te({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),this._set("elevationProvider",null),t.unregister(e),t.destroy(),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new We({view:this})),this._set("featureTiles",new _e({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?F(B(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add(()=>xe.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&xe.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||!this._featureTreeDebugger||xe.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)},f),this.updatingHandles.add(()=>this.clippingArea,e,f),this.updatingHandles.add(()=>this.basemapTerrain.extent,e,f)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.featureTiles&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this._set("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=N(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Pe.create(this.state.viewingMode,i)),t||this.addHandles(c(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!q(e,this.basemapTerrain.spatialReference,vt,t)||(this.renderCoordsHelper.extent=vt)},m),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Je/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),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(c(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),m),"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.forAll(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new Ye({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}),g),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(Je/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 Ge({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._exitGlobe(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this._importModule("GraphicsView3D",e=>y(()=>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._importModule("FocusAreasView"))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){const e=pe(this.viewingMode);1===e&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(u(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(c(()=>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?O(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(Xe);for(const t of this.allLayerViews)J(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(Xe);for(const t of this.allLayerViews)J(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){gt(),A(),M(),et(),Ve(),ue(),be(),W(),tt(),X(),Qe(),Ke(),je(),Ce(),L(),v(),$e(),Ne(),ve.cleanupI3SLodHandling(),K.cleanupTilemapCache(),Me.cleanupViewstate(),qe.cleanupTerrainSurface()}};function yt(e,t){return null!=e&&G(e.spatialReference,t)?F(e,t):null}e([j()],mt.prototype,"_userClippingArea",void 0),e([j()],mt.prototype,"_resourceController",void 0),e([j()],mt.prototype,"stage",null),e([j({readOnly:!0})],mt.prototype,"deconflictor",void 0),e([j({readOnly:!0})],mt.prototype,"labeler",void 0),e([j(H(ee,"analyses"))],mt.prototype,"analyses",void 0),e([j({type:oe,readOnly:!0})],mt.prototype,"animation",null),e([j({readOnly:!0})],mt.prototype,"basemapTerrain",void 0),e([j({readOnly:!0})],mt.prototype,"elevationProvider",void 0),e([j()],mt.prototype,"camera",null),e([j({type:t})],mt.prototype,"contentCamera",null),e([j({readOnly:!0})],mt.prototype,"canvas",null),e([j({type:D})],mt.prototype,"center",null),e([j({type:I})],mt.prototype,"clippingArea",null),e([j({type:ce})],mt.prototype,"constraints",void 0),e([j({type:I,readOnly:!0})],mt.prototype,"renderDataExtent",null),e([j({readOnly:!0})],mt.prototype,"tileInfo",null),e([j({type:I,readOnly:!0})],mt.prototype,"dataExtent",null),e([j({type:I,readOnly:!0})],mt.prototype,"_groundAndLayersExtent",null),e([j({type:me})],mt.prototype,"environment",void 0),e([R("environment")],mt.prototype,"castEnvironment",null),e([j({readOnly:!0})],mt.prototype,"environmentManager",void 0),e([j({type:I})],mt.prototype,"extent",null),e([j({type:r})],mt.prototype,"floors",void 0),e([j()],mt.prototype,"screenCenter",null),e([j()],mt.prototype,"frustum",null),e([j({type:Number,readOnly:!0})],mt.prototype,"fullOpacity",void 0),e([j({readOnly:!0})],mt.prototype,"graphicsView",void 0),e([j({})],mt.prototype,"analysisViewManager",void 0),e([j()],mt.prototype,"groundView",void 0),e([j({type:Boolean})],mt.prototype,"initialExtentRequired",null),e([j()],mt.prototype,"defaultsFromMapSettings",null),e([j()],mt.prototype,"interacting",null),e([j()],mt.prototype,"stationary",null),e([j()],mt.prototype,"navigating",null),e([j()],mt.prototype,"map",void 0),e([j()],mt.prototype,"padding",null),e([j({type:We,readOnly:!0})],mt.prototype,"pointsOfInterest",void 0),e([j({type:_e,readOnly:!0})],mt.prototype,"featureTiles",void 0),e([j()],mt.prototype,"_featureTreeDebugger",void 0),e([j({type:Boolean})],mt.prototype,"screenSizePerspectiveEnabled",void 0),e([j({constructOnly:!0})],mt.prototype,"deactivatedWebGLExtensions",void 0),e([j({constructOnly:!0})],mt.prototype,"debugWebGLExtensions",void 0),e([j({constructOnly:!0})],mt.prototype,"renderCanvas",void 0),e([j({constructOnly:!0})],mt.prototype,"state",void 0),e([j({readOnly:!0})],mt.prototype,"inputManager",void 0),e([j({readOnly:!0})],mt.prototype,"stateManager",void 0),e([j({type:["low","medium","high"]})],mt.prototype,"qualityProfile",null),e([j({type:Ie,get(){let e=this._get("qualitySettings");return e||(e=new Ie,Oe.apply(this.qualityProfile,e)),e}})],mt.prototype,"qualitySettings",void 0),e([j()],mt.prototype,"slice",void 0),e([j({readOnly:!0})],mt.prototype,"typeSpecificPreconditionsReady",null),e([j({readOnly:!0})],mt.prototype,"renderCoordsHelper",void 0),e([j({readOnly:!0})],mt.prototype,"sceneIntersectionHelper",void 0),e([j({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],mt.prototype,"resolution",null),e([j({type:Number})],mt.prototype,"scale",null),e([j()],mt.prototype,"heightModelInfo",null),e([j()],mt.prototype,"spatialReference",void 0),e([j({type:Boolean,constructOnly:!0})],mt.prototype,"alphaCompositingEnabled",void 0),e([j({constructOnly:!0})],mt.prototype,"preserveDrawingBufferEnabled",void 0),e([j({type:Boolean})],mt.prototype,"supersampleScreenshotsEnabled",void 0),e([j({readOnly:!0})],mt.prototype,"type",void 0),e([j(),R(e=>e instanceof dt?e:x(ut,e))],mt.prototype,"ui",void 0),e([j({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"]})],mt.prototype,"updating",null),e([j()],mt.prototype,"_updatingObjects",null),e([j()],mt.prototype,"_updatingObjectsWithProgress",null),e([j({type:Number,readOnly:!0,dependsOn:["updating"]})],mt.prototype,"updatingProgress",void 0),e([j({type:["global","local"]})],mt.prototype,"viewingMode",null),e([j({type:i})],mt.prototype,"viewpoint",null),e([j({readOnly:!0})],mt.prototype,"visibleArea",null),e([j({type:Number})],mt.prototype,"zoom",null),e([j({type:rt})],mt.prototype,"highlightOptions",null),e([j({readOnly:!0})],mt.prototype,"quality",null),e([j({readOnly:!0})],mt.prototype,"resolutionScale",null),e([j()],mt.prototype,"focusAreasView",void 0),e([j()],mt.prototype,"_defaultToMapOptions",null),e([j()],mt.prototype,"_defaultHitTestOptions",null),mt=e([C("esri.views.SceneView")],mt);const ft=E(),wt=_(),vt=k(),_t={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js")},bt=mt;export{bt as default};